diff options
author | Malf Furious <m@lfurio.us> | 2018-11-05 04:21:49 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-11-05 04:21:49 -0500 |
commit | daa4f7a34e23d18e23d34d4becca752635b2ea38 (patch) | |
tree | b13c4f15ac7f477eba74fcef7dad17f4273fbae1 | |
parent | a78cfba0975eaa45540edca95835f302cbb86cef (diff) | |
download | scrott-daa4f7a34e23d18e23d34d4becca752635b2ea38.tar.gz scrott-daa4f7a34e23d18e23d34d4becca752635b2ea38.zip |
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 <m@lfurio.us>
-rw-r--r-- | app/view/issue.php | 86 |
1 files 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"; </div> <?php } ?> - <form method="post" action="<?=ap()?>" enctype="multipart/form-data"> - <?=\formctrl\formname( "iss-mesg-add" )?> - <?=\formctrl\hidden( "issue", $i->guid )?> - <?=\formctrl\textarea( "New message", "mesg", 5 )?> - - <div class="btn-group pull-right"> - <button type="submit" name="input[postMesg]" class="btn btn-primary" title="Post message"> - <span class="glyphicon glyphicon-envelope"></span> - </button> - - <button type="submit" name="input[closeIssue]" class="btn btn-default" title="Close issue"> - <span class="glyphicon glyphicon-ok"></span> - </button> - - <button type="submit" name="input[advIssue]" class="btn btn-default" title="Advance issue"> - <span class="glyphicon glyphicon-chevron-up"></span> - </button> - - <button type="button" class="btn btn-default" data-toggle="collapse" data-target="#assignCollapse-<?=$i->guid?>" title="Assign issue"> - <span class="glyphicon glyphicon-share-alt"></span> - </button> - </div> - - <div class="collapse" id="assignCollapse-<?=$i->guid?>"> - <div class="form-group"> - <label>Select assignee</label> + <?php if ($i->isOpen()) { ?> + <form method="post" action="<?=ap()?>" enctype="multipart/form-data"> + <?=\formctrl\formname( "iss-mesg-add" )?> + <?=\formctrl\hidden( "issue", $i->guid )?> + <?=\formctrl\textarea( "New message", "mesg", 5 )?> + + <div class="btn-group pull-right"> + <button type="submit" name="input[postMesg]" class="btn btn-primary" title="Post message"> + <span class="glyphicon glyphicon-envelope"></span> + </button> + + <button type="submit" name="input[closeIssue]" class="btn btn-default" title="Close issue"> + <span class="glyphicon glyphicon-ok"></span> + </button> + + <button type="submit" name="input[advIssue]" class="btn btn-default" title="Advance issue"> + <span class="glyphicon glyphicon-chevron-up"></span> + </button> + + <button type="button" class="btn btn-default" data-toggle="collapse" data-target="#assignCollapse-<?=$i->guid?>" title="Assign issue"> + <span class="glyphicon glyphicon-share-alt"></span> + </button> + </div> - <select name="input[assignee]" class="form-control selectpicker"> - <option data-icon="glyphicon-user" value="<?=$i->getParent()->getParent()->getOwner()->guid?>"> - <?=$i->getParent()->getParent()->getOwner()->getDisplayName()?> - </option> + <div class="collapse" id="assignCollapse-<?=$i->guid?>"> + <div class="form-group"> + <label>Select assignee</label> - <?php foreach ($i->getParent()->getParent()->getMembers() as $memb) { ?> - <option data-icon="glyphicon-user" value="<?=$memb->guid?>"> - <?=$memb->getDisplayName()?> + <select name="input[assignee]" class="form-control selectpicker"> + <option data-icon="glyphicon-user" value="<?=$i->getParent()->getParent()->getOwner()->guid?>"> + <?=$i->getParent()->getParent()->getOwner()->getDisplayName()?> </option> - <?php } ?> - </select> - </div> - <button type="submit" name="input[assIssue]" class="btn btn-default"> - <span class="glyphicon glyphicon-share-alt"></span> Post and assign issue - </button> - </div> + <?php foreach ($i->getParent()->getParent()->getMembers() as $memb) { ?> + <option data-icon="glyphicon-user" value="<?=$memb->guid?>"> + <?=$memb->getDisplayName()?> + </option> + <?php } ?> + </select> + </div> + + <button type="submit" name="input[assIssue]" class="btn btn-default"> + <span class="glyphicon glyphicon-share-alt"></span> Post and assign issue + </button> + </div> - <?=\formctrl\file( "Attachment", "attachment" )?> - </form> + <?=\formctrl\file( "Attachment", "attachment" )?> + </form> + <?php } ?> </div> <div class="col-md-4"> |