diff options
author | Malfurious <m@lfurio.us> | 2021-10-18 21:05:27 -0400 |
---|---|---|
committer | Malfurious <m@lfurio.us> | 2021-10-18 21:05:27 -0400 |
commit | 2b5ea48b854e4441cc89666d5c1d5fb30f8453ea (patch) | |
tree | 2a1c1d14f5d92ab56df8bb9049b77a48b5b43c5b | |
parent | 00f0fcc8895df860aaec0421385b6be7c8d8f7db (diff) | |
parent | a2f522583ef35e009f1f0be7086fc511d52c2b36 (diff) | |
download | scrott-2b5ea48b854e4441cc89666d5c1d5fb30f8453ea.tar.gz scrott-2b5ea48b854e4441cc89666d5c1d5fb30f8453ea.zip |
Merge branch 'issue-view-improvements'
Some changes pertaining to issue management workflow enhancement
* issue-view-improvements:
Keep issue modal open after closing an issue
Automatically call-up issue modal for newly-opened issues
Add stage/guid information to issue modal title bar
Add additional info / controls to issueListItem
-rw-r--r-- | app/model/datamods.php | 2 | ||||
-rw-r--r-- | app/model/issue.php | 10 | ||||
-rw-r--r-- | app/model/pad.php | 5 | ||||
-rw-r--r-- | app/view/datalsts.php | 43 | ||||
-rw-r--r-- | app/view/issue.php | 13 | ||||
-rw-r--r-- | app/view/pad.php | 2 | ||||
-rw-r--r-- | app/view/pad_closed.php | 2 |
7 files changed, 63 insertions, 14 deletions
diff --git a/app/model/datamods.php b/app/model/datamods.php index 0b7f3da..b3384a7 100644 --- a/app/model/datamods.php +++ b/app/model/datamods.php @@ -114,7 +114,7 @@ if (isAction("dm-issue-add")) $issue = issue::initNew($mesg, $user, $stages[0]); $log = mesg::initNewLog("%s opened issue", $user, $issue); - location(); // bug mitigation + setAutoModal("#issueModal-" . $issue->guid); } ?> diff --git a/app/model/issue.php b/app/model/issue.php index dd904e4..41392e8 100644 --- a/app/model/issue.php +++ b/app/model/issue.php @@ -25,6 +25,7 @@ if (isAction("iss-mesg-add")) $form->text("issue"); $form->text("mesg", false); $form->text("assignee"); + $form->flag("nopop"); if (!$form->populate(input())) return; @@ -48,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'])) @@ -69,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); } } @@ -101,12 +103,12 @@ 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); } /* automatically redisplay issue modal */ - setAutoModal("#issueModal-" . $issue->guid); + if ($form->nopop != "1") + setAutoModal("#issueModal-" . $issue->guid); } ?> 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(); ?> diff --git a/app/view/datalsts.php b/app/view/datalsts.php index ba9021b..b80de78 100644 --- a/app/view/datalsts.php +++ b/app/view/datalsts.php @@ -17,6 +17,7 @@ namespace datalsts; require_once "class/obj.class.php"; require_once "class/stage.class.php"; require_once "class/issue.class.php"; +require_once "view/formctrl.php"; ?> <?php function objHeadCircle(\obj $obj, int $height) : void { ?> @@ -130,12 +131,46 @@ require_once "class/issue.class.php"; </div> <?php } ?> -<?php function issueListItem(\issue $i) : void { ?> +<?php function issueListItem(\issue $i, bool $show_ctrls = true) : void { ?> + + <?php $assigns = $i->getAssignees(); ?> <tr class="issueListItem" data-guid="<?=$i->guid?>"> - <!-- TODO --> - <td class="col-md-2"><?=$i->guid?> (#<?=$i->numb?>)</td> - <td class="col-md-10"><?=$i->name?></td> + <td class="col-md-1">#<?=$i->numb?></td> + + <td class="col-md-11"> + <?=$i->name?> + + <span class="pull-right"> + <form method="post" action="<?=ap()?>"> + <?=\formctrl\formname( "iss-mesg-add" )?> + <?=\formctrl\hidden( "issue", $i->guid )?> + <?=\formctrl\hidden( "assignee", " " )?> + <?=\formctrl\hidden( "nopop", "1" )?> + + <?php if (count($assigns) == 0) { ?> + <span class="glyphicon glyphicon-ban-circle"></span> + <?php } foreach ($assigns as $assign) { ?> + <?=objHeadCircle($assign->assignee, 20)?> + <?php } ?> + <span class="glyphicon glyphicon-share-alt"></span> + <?=objHeadCircle($i->getOwner(), 20)?> + + <?php if ($show_ctrls) { ?> + + <div class="btn-group" role="group"> + <button type="submit" name="input[advIssue]" class="btn btn-sm btn-default" title="Advance issue"> + <span class="glyphicon glyphicon-chevron-up"></span> + </button> + + <button type="submit" name="input[closeIssue]" class="btn btn-sm btn-default" title="Close issue"> + <span class="glyphicon glyphicon-ok"></span> + </button> + </div> + <?php } ?> + </form> + </span> + </td> </tr> <?php } ?> diff --git a/app/view/issue.php b/app/view/issue.php index 01a9f5f..4ca0e3b 100644 --- a/app/view/issue.php +++ b/app/view/issue.php @@ -51,6 +51,7 @@ require_once "class/issue.class.php"; <?php function issue(\issue $i) : void { ?> <?php $m = $i->getOPMesg(); ?> + <?php $s = $i->getParent(); ?> <div id="issueModal-<?=$i->guid?>" class="modal fade" tabindex="-1" role="dialog"> <div class="modal-dialog modal-lg" role="document"> @@ -61,9 +62,15 @@ require_once "class/issue.class.php"; </button> <h4 class="modal-title"> - <span class="glyphicon glyphicon-inbox"></span> - <?=$i->name?> - <small>#<?=$i->numb?></small> + <span class="glyphicon glyphicon-inbox"></span> <?=$i->name?> + + <small> + <?php if ($s->objtype == "stage") { ?> + <span class="glyphicon glyphicon-tasks"></span> <?=$s->name?> + <?php } ?> + + #<?=$i->numb?> <?=$i->guid?> + </small> </h4> </div> diff --git a/app/view/pad.php b/app/view/pad.php index 4408df2..f47b2e7 100644 --- a/app/view/pad.php +++ b/app/view/pad.php @@ -12,10 +12,10 @@ * For more information, please refer to UNLICENSE */ -require_once "model/pad.php"; require_once "view/stdpage.php"; require_once "view/datalsts.php"; require_once "view/issue.php"; +require_once "model/pad.php"; ?> diff --git a/app/view/pad_closed.php b/app/view/pad_closed.php index 412ce4f..c0678e3 100644 --- a/app/view/pad_closed.php +++ b/app/view/pad_closed.php @@ -64,7 +64,7 @@ require_once "view/issue.php"; <table class="table table-hover"> <?php foreach ($closed_issues as $i) { ?> - <?=datalsts\issueListItem($i)?> + <?=datalsts\issueListItem($i, false)?> <?php } ?> </table> </div> |