mirror of https://github.com/itflow-org/itflow
Added Confirmation to Close Ticket in Client Portal - Seperated cofirmation modal to a seperate JS file which is now included in the Client Portal
This commit is contained in:
parent
fcfb162ec8
commit
ba9442e6c3
|
|
@ -28,6 +28,7 @@
|
|||
<!-- AdminLTE App -->
|
||||
<script src="dist/js/adminlte.min.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
<script src="js/confirm_modal.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
|||
17
js/app.js
17
js/app.js
|
|
@ -105,20 +105,3 @@ clipboard.on('error', function(e) {
|
|||
$(function () {
|
||||
$('[data-toggle="popover"]').popover()
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$("a.confirm-link").click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Save the link reference to use after confirmation
|
||||
var linkReference = this;
|
||||
|
||||
// Show the confirmation modal
|
||||
$("#confirmationModal").modal('show');
|
||||
|
||||
// When the submission is confirmed via the modal
|
||||
$("#confirmSubmitBtn").off('click').on('click', function() {
|
||||
window.location.href = $(linkReference).attr('href');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
$(document).ready(function() {
|
||||
$("a.confirm-link").click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Save the link reference to use after confirmation
|
||||
var linkReference = this;
|
||||
|
||||
// Show the confirmation modal
|
||||
$("#confirmationModal").modal('show');
|
||||
|
||||
// When the submission is confirmed via the modal
|
||||
$("#confirmSubmitBtn").off('click').on('click', function() {
|
||||
window.location.href = $(linkReference).attr('href');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
<p class="text-center"><?php echo nullable_htmlentities($session_company_name); ?></p>
|
||||
|
||||
<?php require_once "../inc_confirm_modal.php"; ?>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="../plugins/jquery/jquery.min.js"></script>
|
||||
|
||||
|
|
@ -53,3 +55,5 @@
|
|||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script src="../js/confirm_modal.js"></script>
|
||||
|
|
@ -53,7 +53,7 @@ if (isset($_GET['id']) && intval($_GET['id'])) {
|
|||
Ticket <?php echo $ticket_prefix, $ticket_number ?>
|
||||
<?php
|
||||
if ($ticket_status !== "Closed") { ?>
|
||||
<a href="portal_post.php?close_ticket=<?php echo $ticket_id; ?>" class="btn btn-sm btn-outline-success float-right text-white"><i class="fas fa-fw fa-check text-success"></i> Close ticket</a>
|
||||
<a href="portal_post.php?close_ticket=<?php echo $ticket_id; ?>" class="btn btn-sm btn-outline-success float-right text-white confirm-link"><i class="fas fa-fw fa-check text-success"></i> Close ticket</a>
|
||||
<?php } ?>
|
||||
</h4>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue