summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-11-04 16:49:17 -0500
committerMalf Furious <m@lfurio.us>2018-11-04 16:49:17 -0500
commit2fc9cff6006580e3b1d9e3f194de3ef29e5d0247 (patch)
treedb9ec7a06524cb855bd5814456a3a1120c9fc735 /app
parent23cc51685c5479d487d6416bc7e414e3f8aa60c1 (diff)
downloadscrott-2fc9cff6006580e3b1d9e3f194de3ef29e5d0247.tar.gz
scrott-2fc9cff6006580e3b1d9e3f194de3ef29e5d0247.zip
Implement 'add assignee' form handler
The 'iss-mesg-add' form now handles when the 'assIssue' submission is sent. This is the only submission of this form that looks at the (usually hidden) 'assignee' dropdown field, which has been made a required field however. Signed-off-by: Malf Furious <m@lfurio.us>
Diffstat (limited to 'app')
-rw-r--r--app/model/issue.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/model/issue.php b/app/model/issue.php
index 910cb14..923bfc2 100644
--- a/app/model/issue.php
+++ b/app/model/issue.php
@@ -24,6 +24,7 @@ if (isAction("iss-mesg-add"))
$form = new form();
$form->text("issue");
$form->text("mesg", false);
+ $form->text("assignee");
if (!$form->populate(input()))
return;
@@ -71,6 +72,23 @@ if (isAction("iss-mesg-add"))
}
}
+ else if (isset(input()['assIssue']))
+ {
+ if (!$user->canModify($issue))
+ {
+ logError(ERROR, "You do not have permission to assign this issue");
+ return;
+ }
+
+ $assignee = new user($form->assignee);
+ $stat = $issue->addAssignee($assignee, $user);
+
+ if (!$stat)
+ logError(ERROR, "Failed to assign issue");
+ else
+ $log = mesg::initNewLog("%s assigned " . $assignee->getDisplayName(), $user, $issue);
+ }
+
else if (isset(input()['closeIssue']))
{
if (!$user->canModify($issue))