From 4b464ddfac4b246bd5fdc0cf9a1c6072385b7aff Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 23 Oct 2021 05:26:44 -0400 Subject: Fix issue re-assignment The backend will now properly handle an action to assign someone who has already signed-off on a ticket. In effect, their signoff is removed, and the original assignment metadata (assigner, timestamp) is updated. Signed-off-by: Malfurious --- app/class/issue.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/class/issue.class.php b/app/class/issue.class.php index 47adfa1..ee4693f 100644 --- a/app/class/issue.class.php +++ b/app/class/issue.class.php @@ -115,6 +115,12 @@ class issue extends obj || !isset($assigner->guid)) return false; + /* 'reset' any existing assignee slot. Remove any signoff or dismissal, and + * update the assigner info. AKA, just recreate the DB entry. */ + $query = "DELETE FROM assignees WHERE guid = '" . database::esc($this->guid) . + "' AND assignee = '" . database::esc($assignee->guid) . "'"; + database::query($query); + $query = "INSERT INTO assignees (guid, assignee, assigner, assigned)" . " VALUES ('" . database::esc($this->guid) . "', '" . database::esc($assignee->guid) . "', '" . database::esc($assigner->guid) . -- cgit v1.2.3