summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-11-01 04:43:55 -0400
committerMalf Furious <m@lfurio.us>2018-11-01 04:43:55 -0400
commitdc99ab0c0a0603d5efc1e07cf690c53260528820 (patch)
tree7cdb94bb81e6e92b1230377c3b5c59eee710a488 /app
parentd8e6fc09df73e4165fa5503b713f8958e1599175 (diff)
downloadscrott-dc99ab0c0a0603d5efc1e07cf690c53260528820.tar.gz
scrott-dc99ab0c0a0603d5efc1e07cf690c53260528820.zip
Implement iss-mesg-add 'advIssue' submission
Handler now includes logic for optionally advancing the issue through the pipeline. If this happens, 'closeIssue' (for example) will not be checked, as only one submission can be used. Signed-off-by: Malf Furious <m@lfurio.us>
Diffstat (limited to 'app')
-rw-r--r--app/model/issue.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/app/model/issue.php b/app/model/issue.php
index 403e82e..910cb14 100644
--- a/app/model/issue.php
+++ b/app/model/issue.php
@@ -50,7 +50,28 @@ if (isAction("iss-mesg-add"))
logError(NOTICE, "Saved attachment " . $mesg->attachment);
}
- if (isset(input()['closeIssue']))
+ if (isset(input()['advIssue']))
+ {
+ if (!$user->canModify($issue))
+ {
+ logError(ERROR, "You do not have permission to move this issue");
+ return;
+ }
+
+ $issue->advance($user);
+
+ if ($issue->isOpen())
+ {
+ $sgename = $issue->getParent()->name;
+ $log = mesg::initNewLog("%s advanced issue to '" . $sgename . "'", $user, $issue);
+ }
+ else
+ {
+ $log = mesg::initNewLog("%s closed issue", $user, $issue);
+ }
+ }
+
+ else if (isset(input()['closeIssue']))
{
if (!$user->canModify($issue))
{