Creation of reopen request feature (#68)

* Creation of button and SQL

* Movement of buttons

* Changes to authorisation requirements

* Update to errors

* 🎨 Tidy up a little

Signed-off-by: Luke Tainton <luke@tainton.uk>

* 🎨 Fix comment

Signed-off-by: Luke Tainton <luke@tainton.uk>

Co-authored-by: Luke Tainton <luke@tainton.uk>
This commit was merged in pull request #68.
This commit is contained in:
Alexander Davis
2020-08-10 18:16:50 +01:00
committed by GitHub
parent 47f8750fd7
commit 07fb834c90
3 changed files with 63 additions and 27 deletions

View File

@@ -51,37 +51,38 @@
<p style="color: gray; font-style: italic;"><?php echo("#" . sprintf("%'.05d\n", $request["id"])); ?></p>
<p class="lead text-muted"><?php echo($request['description']); ?></p>
<p>
<?php if ($_SESSION['uuid'] == $request['created_by']) { ?>
<a href='/editsub?rid=<?php echo($request["uuid"]); ?>' class='btn btn-secondary my-2'>Manage subscribers</a>
<?php } ?>
<?php if ($request['status'] != 'Closed') { ?>
<a href='/update?rid=<?php echo($request["uuid"]); ?>' class='btn btn-primary my-2'>Update the request</a>
<a href='/upload?rid=<?php echo($request["uuid"]); ?>' class='btn btn-primary my-2'>Add attachment(s)</a>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#closeModal">Close the request</button>
<?php } ?>
<?php if ($_SESSION['uuid'] == $request['created_by']) { ?>
<a href='/editsub?rid=<?php echo($request["uuid"]); ?>' class='btn btn-secondary my-2'>Manage subscribers</a>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#closeModal">Close the request</button>
<div class="modal fade" id="closeModal" tabindex="-1" aria-labelledby="closeModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="closeModalLabel">Close the request?</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to close request <b><?php echo($request['title']); ?></b>? This action is irreversible.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<a href='/actions/close?rid=<?php echo($request["uuid"]); ?>' class='btn btn-danger'>Close request</a>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } elseif ($request['status'] == 'Closed') { ?>
<?php if ($_SESSION['uuid'] == $request['created_by']) { ?>
<a href='/reopen?rid=<?php echo($request["uuid"]); ?>' class='btn btn-success my-2'>Reopen request</a>
<?php } } ?>
</p>
</div>
<div class="modal fade" id="closeModal" tabindex="-1" aria-labelledby="closeModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="closeModalLabel">Close the request?</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to close request <b><?php echo($request['title']); ?></b>? This action is irreversible.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<a href='/actions/close?rid=<?php echo($request["uuid"]); ?>' class='btn btn-danger'>Close request</a>
</div>
</div>
</div>
</div>
</section>
<section>
<div class="container-fluid">