From 81ba021468e38de09ac292115bb2f15c9d4deec0 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Mon, 5 Nov 2018 03:10:32 -0500 Subject: Add function pad::getClosedIssues_ordByClosed() This returns an array of all issues which directly parent the pad object. These are the pad's closed issues. Most recently closed issues are first in the array. Signed-off-by: Malf Furious --- app/class/pad.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/class/pad.class.php b/app/class/pad.class.php index dcf2b32..0c69385 100644 --- a/app/class/pad.class.php +++ b/app/class/pad.class.php @@ -108,6 +108,24 @@ class pad extends obj $stage->saveObj(); $this->saveObj(); } + + /* + * Get an array of all closed issues under this pad. Ordered by + * datetime closed. + */ + public function getClosedIssues_ordByClosed() : array + { + $query = "SELECT o.guid FROM objects o JOIN issues i ON o.guid = i.guid " . + "WHERE o.parent = '" . database::esc($this->guid) . "' ORDER BY i.closed DESC"; + $res = database::query($query); + + $issues = array(); + + foreach ($res as $i) + $issues[] = new issue($i['guid']); + + return $issues; + } } ?> -- cgit v1.2.3 From 434ebff8466ead8f9bb4c0f00037a107cbf842c4 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Mon, 5 Nov 2018 03:32:06 -0500 Subject: Add pad closed issues view This view is routable from app//closed. It is a separate view for displaying the closed issues of a pad. index.php as well as the pad model code is also updated to support this view. This view currently *does not* support paging. This will very likely be added in the future. Signed-off-by: Malf Furious --- app/index.php | 5 +++- app/model/pad.php | 2 ++ app/view/pad_closed.php | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 app/view/pad_closed.php diff --git a/app/index.php b/app/index.php index 21f3036..4607351 100644 --- a/app/index.php +++ b/app/index.php @@ -111,7 +111,10 @@ function main(array $argv) : void $obj = new pad($argv[0]); setPageObj($obj); setPageName($obj->name); - require "view/pad.php"; + if (isset($argv[1]) && $argv[1] == "closed") + require "view/pad_closed.php"; + else + require "view/pad.php"; break; } } diff --git a/app/model/pad.php b/app/model/pad.php index d7cfb23..0090c27 100644 --- a/app/model/pad.php +++ b/app/model/pad.php @@ -26,4 +26,6 @@ foreach ($stages as $s) $issues = array_merge($issues, $i); } +$closed_issues = $pad->getClosedIssues_ordByClosed(); + ?> diff --git a/app/view/pad_closed.php b/app/view/pad_closed.php new file mode 100644 index 0000000..19864cd --- /dev/null +++ b/app/view/pad_closed.php @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + +
+
+
+
+

+ + name?> + + + View open issues + +

+
+
+
+ +
+ + + + +
+
+
+ + + + -- cgit v1.2.3 From a78cfba0975eaa45540edca95835f302cbb86cef Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Mon, 5 Nov 2018 03:45:48 -0500 Subject: Add link to closed issues view Signed-off-by: Malf Furious --- app/view/pad.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/view/pad.php b/app/view/pad.php index a9c8508..bf626bf 100644 --- a/app/view/pad.php +++ b/app/view/pad.php @@ -42,9 +42,15 @@ require_once "view/issue.php"; name?> - +
+ + + + View closed issues + +
-- cgit v1.2.3 From daa4f7a34e23d18e23d34d4becca752635b2ea38 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Mon, 5 Nov 2018 04:21:49 -0500 Subject: Only display 'iss-mesg-add' form for open issues Disallow posting to closed issues. This is a temporary soultion and will likely be reverted in the future. The main reason this is being done now is because this form, as written, depends on an open issue state. To aid diff comprehension, note that most lines are only indented one level, the code area affected is wrapped in a PHP if. Note that form submissions are still allowed for closed issues. This commit only disable the _displaying_ of the form. Signed-off-by: Malf Furious --- app/view/issue.php | 86 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/app/view/issue.php b/app/view/issue.php index 5f1c518..6edf7cf 100644 --- a/app/view/issue.php +++ b/app/view/issue.php @@ -109,53 +109,55 @@ require_once "class/issue.class.php"; -
- - guid )?> - - -
- - - - - - - -
- -
-
- + isOpen()) { ?> + + + guid )?> + + +
+ + + + + + + +
- + - - -
- -
+ getParent()->getParent()->getMembers() as $memb) { ?> + + + + + + + - -
+ + +
-- cgit v1.2.3