mirror of
https://github.com/itflow-org/itflow
synced 2026-03-25 23:05:37 +00:00
Merge pull request #959 from ssteeltm/tickets_tasks-progress-bar
Tickets tasks progress bar
This commit is contained in:
25
tickets.php
25
tickets.php
@@ -284,7 +284,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
|||||||
</td>
|
</td>
|
||||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=ticket_number&order=<?php echo $disp; ?>">Number</a>
|
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=ticket_number&order=<?php echo $disp; ?>">Number</a>
|
||||||
</th>
|
</th>
|
||||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=ticket_subject&order=<?php echo $disp; ?>">Subject</a>
|
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=ticket_subject&order=<?php echo $disp; ?>">Subject / Tasks</a>
|
||||||
</th>
|
</th>
|
||||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">Client / Contact</a>
|
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=client_name&order=<?php echo $disp; ?>">Client / Contact</a>
|
||||||
</th>
|
</th>
|
||||||
@@ -395,6 +395,23 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
|||||||
$ticket_reply_created_at_time_ago = timeAgo($ticket_reply_created_at);
|
$ticket_reply_created_at_time_ago = timeAgo($ticket_reply_created_at);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Get Tasks
|
||||||
|
$sql_tasks = mysqli_query( $mysqli, "SELECT * FROM tasks WHERE task_ticket_id = $ticket_id ORDER BY task_created_at ASC");
|
||||||
|
$task_count = mysqli_num_rows($sql_tasks);
|
||||||
|
// Get Completed Task Count
|
||||||
|
$sql_tasks_completed = mysqli_query($mysqli,
|
||||||
|
"SELECT * FROM tasks
|
||||||
|
WHERE task_ticket_id = $ticket_id
|
||||||
|
AND task_completed_at IS NOT NULL"
|
||||||
|
);
|
||||||
|
$completed_task_count = mysqli_num_rows($sql_tasks_completed);
|
||||||
|
|
||||||
|
// Tasks Completed Percent
|
||||||
|
if($task_count) {
|
||||||
|
$tasks_completed_percent = round(($completed_task_count / $task_count) * 100);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr class="<?php if(empty($ticket_closed_at) && empty($ticket_updated_at)) { echo "text-bold"; }?> <?php if (empty($ticket_closed_at) && $ticket_reply_type == "Client") { echo "table-warning"; } ?>">
|
<tr class="<?php if(empty($ticket_closed_at) && empty($ticket_updated_at)) { echo "text-bold"; }?> <?php if (empty($ticket_closed_at) && $ticket_reply_type == "Client") { echo "table-warning"; } ?>">
|
||||||
@@ -418,6 +435,12 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
|||||||
<!-- Ticket Subject -->
|
<!-- Ticket Subject -->
|
||||||
<td>
|
<td>
|
||||||
<a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>"><?php echo $ticket_subject; ?></a>
|
<a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>"><?php echo $ticket_subject; ?></a>
|
||||||
|
|
||||||
|
<?php if($task_count) { ?>
|
||||||
|
<div class="progress mt-2" style="height: 20px;">
|
||||||
|
<div class="progress-bar" style="width: <?php echo $tasks_completed_percent; ?>%;"><?php echo $completed_task_count; ?> / <?php echo $task_count; ?></div>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<!-- Ticket Contact -->
|
<!-- Ticket Contact -->
|
||||||
|
|||||||
Reference in New Issue
Block a user