From a2f522583ef35e009f1f0be7086fc511d52c2b36 Mon Sep 17 00:00:00 2001
From: Malfurious <m@lfurio.us>
Date: Mon, 18 Oct 2021 20:14:26 -0400
Subject: Keep issue modal open after closing an issue

For consistency reasons, I've decided to keep the issue UI open even
after just closing an issue.  That is assuming the user used the modal
window to perform the close.  If an issue is closed via the quick control
buttons in the pad view page, no window is spawned since none was open
to begin with.

Other edge-cases that would interrupt the return of the issue modal have
also been removed.  For example, an informational message is no longer
produced when an attachment is successfully uploaded, and users are no
longer notified that an action resulted in an issue being closed.

Signed-off-by: Malfurious <m@lfurio.us>
---
 app/model/issue.php | 6 +++---
 app/model/pad.php   | 5 +++++
 2 files changed, 8 insertions(+), 3 deletions(-)

(limited to 'app/model')

diff --git a/app/model/issue.php b/app/model/issue.php
index 3f7b620..41392e8 100644
--- a/app/model/issue.php
+++ b/app/model/issue.php
@@ -49,7 +49,9 @@ if (isAction("iss-mesg-add"))
         $mesg = mesg::initNew($form->mesg, $user, $issue);
 
         if ($mesg->setAttachment("attachment"))
-            logError(NOTICE, "Saved attachment " . $mesg->attachment);
+        {
+            //logError(NOTICE, "Saved attachment " . $mesg->attachment);
+        }
     }
 
     if (isset(input()['advIssue']))
@@ -70,7 +72,6 @@ if (isAction("iss-mesg-add"))
         else
         {
             $issue->signoffAssignee($user);
-            logError(NOTICE, "Issue #" . $issue->numb . " closed");
             $log = mesg::initNewLog("%s closed issue", $user, $issue);
         }
     }
@@ -102,7 +103,6 @@ if (isAction("iss-mesg-add"))
 
         $issue->signoffAssignee($user);
         $issue->close($user);
-        logError(NOTICE, "Issue #" . $issue->numb . " closed");
         $log = mesg::initNewLog("%s closed issue", $user, $issue);
     }
 
diff --git a/app/model/pad.php b/app/model/pad.php
index e11a644..69f58e2 100644
--- a/app/model/pad.php
+++ b/app/model/pad.php
@@ -41,6 +41,11 @@ foreach ($stages as $s)
     $issues = array_merge($issues, $i);
 }
 
+/* this will include a 'just closed' issue on the main pad page, enabling it
+ * to be displayed via auto-modal */
+if (isset($_REQUEST['input']['issue']))
+    $issues[] = new issue($_REQUEST['input']['issue']);
+
 $closed_issues = $pad->getClosedIssues_ordByClosed();
 
 ?>
-- 
cgit v1.2.3