From dc99ab0c0a0603d5efc1e07cf690c53260528820 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 1 Nov 2018 04:43:55 -0400 Subject: 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 --- app/model/issue.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'app/model/issue.php') 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)) { -- cgit v1.2.3