From e88b153336610e18732fbcc1d8ff3ac4e653d080 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Wed, 20 Oct 2021 01:15:28 -0400 Subject: Add UI for explicit issue signoff Active issue assignees will now have a button on issues to explicitly 'signoff' their assignment - that is, to affirmatively declare it done. The use of this new action will allow assignees to signoff without needing to close the issue as well. This is useful for multiple assigned users collaborating on an issue. Note that if an assignee chooses to close a ticket directly, they are still automatically signed-off, as before. To aid this feature, the low-level definition of an 'assigned user' is updated to exclude users occupying an assignment slot, but which have already signed-off. Since the icon representing this action is the same as for closing a ticket, the buttons enabling these two actions are now color-coded wherever they appear. Signed-off-by: Malfurious --- app/class/agent.class.php | 1 + app/model/issue.php | 12 ++++++++++++ app/view/datalsts.php | 2 +- app/view/issue.php | 40 +++++++++++++++++++++++++--------------- 4 files changed, 39 insertions(+), 16 deletions(-) (limited to 'app') diff --git a/app/class/agent.class.php b/app/class/agent.class.php index 4651a10..cf6ae9b 100644 --- a/app/class/agent.class.php +++ b/app/class/agent.class.php @@ -82,6 +82,7 @@ abstract class agent extends obj foreach ($issue->getAssignees() as $assign) { if ($assign->assignee->guid == $this->guid + && $assign->signedoff == "" && $assign->dismissed == "") return true; } diff --git a/app/model/issue.php b/app/model/issue.php index 41392e8..c3423f7 100644 --- a/app/model/issue.php +++ b/app/model/issue.php @@ -106,6 +106,18 @@ if (isAction("iss-mesg-add")) $log = mesg::initNewLog("%s closed issue", $user, $issue); } + else if (isset(input()['signoff'])) + { + if (!$user->isAssignedTo($issue)) + { + logError(ERROR, "You are not an active assignee of this issue"); + return; + } + + $issue->signoffAssignee($user); + $log = mesg::initNewLog("%s signed off", $user, $issue); + } + /* automatically redisplay issue modal */ if ($form->nopop != "1") setAutoModal("#issueModal-" . $issue->guid); diff --git a/app/view/datalsts.php b/app/view/datalsts.php index b80de78..298d036 100644 --- a/app/view/datalsts.php +++ b/app/view/datalsts.php @@ -163,7 +163,7 @@ require_once "view/formctrl.php"; - diff --git a/app/view/issue.php b/app/view/issue.php index 4ca0e3b..fbd180a 100644 --- a/app/view/issue.php +++ b/app/view/issue.php @@ -122,22 +122,32 @@ require_once "class/issue.class.php"; guid )?> -
- - - - - +
+
+ + + + + + + +
- + isAssignedTo($i)) { ?> +
+ +
+
-- cgit v1.2.3