mirror of
https://github.com/itflow-org/itflow
synced 2026-03-06 05:44:52 +00:00
Project Details: Add Bulk Actions to tickets and allow tickets to be sorted
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Default Column Sortby Filter
|
||||||
|
$sort = "ticket_number";
|
||||||
|
$order = "DESC";
|
||||||
|
|
||||||
// If client_id is in URI then show client Side Bar and client header
|
// If client_id is in URI then show client Side Bar and client header
|
||||||
if (isset($_GET['client_id'])) {
|
if (isset($_GET['client_id'])) {
|
||||||
require_once "includes/inc_all_client.php";
|
require_once "includes/inc_all_client.php";
|
||||||
@@ -86,7 +90,8 @@ if (isset($_GET['project_id'])) {
|
|||||||
LEFT JOIN ticket_statuses ON ticket_status = ticket_status_id
|
LEFT JOIN ticket_statuses ON ticket_status = ticket_status_id
|
||||||
LEFT JOIN clients ON ticket_client_id = client_id
|
LEFT JOIN clients ON ticket_client_id = client_id
|
||||||
LEFT JOIN users ON ticket_assigned_to = user_id
|
LEFT JOIN users ON ticket_assigned_to = user_id
|
||||||
WHERE ticket_project_id = $project_id ORDER BY ticket_number ASC"
|
WHERE ticket_project_id = $project_id
|
||||||
|
ORDER BY $sort $order"
|
||||||
);
|
);
|
||||||
$ticket_count = mysqli_num_rows($sql_tickets);
|
$ticket_count = mysqli_num_rows($sql_tickets);
|
||||||
|
|
||||||
@@ -275,19 +280,90 @@ if (isset($_GET['project_id'])) {
|
|||||||
|
|
||||||
<!-- Tickets card -->
|
<!-- Tickets card -->
|
||||||
<?php if (mysqli_num_rows($sql_tickets) > 0) { ?>
|
<?php if (mysqli_num_rows($sql_tickets) > 0) { ?>
|
||||||
<div class="card card-body card-outline card-dark mb-3">
|
<div class="card card-outline card-dark mb-3">
|
||||||
|
<div class="card-header py-2">
|
||||||
|
|
||||||
<h5 class="text-secondary"><i class="fa fa-fw fa-life-ring mr-2"></i>Project Tickets</h5>
|
<h5 class="card-title mt-2 mb-2"><i class="fa fa-fw fa-life-ring mr-2"></i>Project Tickets</h5>
|
||||||
|
|
||||||
|
<div class="card-tools">
|
||||||
|
<?php if (lookupUserPermission("module_support") >= 2) { ?>
|
||||||
|
<div class="dropdown ml-2" id="bulkActionButton" hidden>
|
||||||
|
<button class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">
|
||||||
|
<i class="fas fa-fw fa-layer-group mr-2"></i>Bulk Action (<span id="selectedCount">0</span>)
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#bulkAssignTicketModal">
|
||||||
|
<i class="fas fa-fw fa-user-check mr-2"></i>Assign Tech
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#bulkEditCategoryTicketModal">
|
||||||
|
<i class="fas fa-fw fa-layer-group mr-2"></i>Set Category
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#bulkEditPriorityTicketModal">
|
||||||
|
<i class="fas fa-fw fa-thermometer-half mr-2"></i>Update Priority
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#bulkReplyTicketModal">
|
||||||
|
<i class="fas fa-fw fa-paper-plane mr-2"></i>Bulk Update/Reply
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#bulkMergeTicketModal">
|
||||||
|
<i class="fas fa-fw fa-clone mr-2"></i>Merge
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#bulkCloseTicketsModal">
|
||||||
|
<i class="fas fa-fw fa-check mr-2"></i>Resolve
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body p-0">
|
||||||
|
<form id="bulkActions" action="post.php" method="post">
|
||||||
|
<input type="hidden" name="csrf_token" value="<?php echo $_SESSION['csrf_token'] ?>">
|
||||||
<div class="table-responsive-sm">
|
<div class="table-responsive-sm">
|
||||||
<table class="table table-striped table-borderless table-hover">
|
<table class="table table-striped table-borderless table-hover">
|
||||||
<thead class="text-dark">
|
<thead class="thead-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Ticket</th>
|
<td class="bg-light pr-0">
|
||||||
<th>Priority</th>
|
<div class="form-check">
|
||||||
<th>Status</th>
|
<input class="form-check-input" id="selectAllCheckbox" type="checkbox" onclick="checkAll(this)" onkeydown="checkAll(this)">
|
||||||
<th>Assigned</th>
|
</div>
|
||||||
<th>Last Response</th>
|
</td>
|
||||||
<th>Client</th>
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=ticket_number&order=<?php echo $disp; ?>">
|
||||||
|
Ticket <?php if ($sort == 'ticket_number') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=ticket_priority&order=<?php echo $disp; ?>">
|
||||||
|
Priority <?php if ($sort == 'ticket_priority') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=ticket_status&order=<?php echo $disp; ?>">
|
||||||
|
Status <?php if ($sort == 'ticket_status') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=user_name&order=<?php echo $disp; ?>">
|
||||||
|
Assigned <?php if ($sort == 'user_name') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=ticket_updated_at&order=<?php echo $disp; ?>">
|
||||||
|
Last Response <?php if ($sort == 'ticket_updated_at') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<a class="text-secondary" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">
|
||||||
|
Client <?php if ($sort == 'client_name') { echo $order_icon; } ?>
|
||||||
|
</a>
|
||||||
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -382,7 +458,14 @@ if (isset($_GET['project_id'])) {
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="pr-0 bg-light">
|
||||||
|
<!-- Ticket Bulk Select (for open tickets) -->
|
||||||
|
<?php if (empty($ticket_closed_at)) { ?>
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input bulk-select" type="checkbox" name="ticket_ids[]" value="<?php echo $ticket_id ?>">
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
<!-- Ticket Number / Subject -->
|
<!-- Ticket Number / Subject -->
|
||||||
<td>
|
<td>
|
||||||
<a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>">
|
<a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>">
|
||||||
@@ -415,6 +498,14 @@ if (isset($_GET['project_id'])) {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<?php require_once "modals/ticket_bulk_assign_modal.php"; ?>
|
||||||
|
<?php require_once "modals/ticket_bulk_edit_category_modal.php"; ?>
|
||||||
|
<?php require_once "modals/ticket_bulk_edit_priority_modal.php"; ?>
|
||||||
|
<?php require_once "modals/ticket_bulk_reply_modal.php"; ?>
|
||||||
|
<?php require_once "modals/ticket_bulk_merge_modal.php"; ?>
|
||||||
|
<?php require_once "modals/ticket_bulk_resolve_modal.php"; ?>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
@@ -465,4 +556,6 @@ require_once "includes/footer.php";
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<script src="js/bulk_actions.js"></script>
|
||||||
|
|
||||||
<script src="js/pretty_content.js"></script>
|
<script src="js/pretty_content.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user