Fix Last Reponse Column under tickets and client tickets use the ticket_reply_created_at instead of ticket_updated_at

This commit is contained in:
johnnyq 2024-03-27 23:12:17 -04:00
parent ee308453db
commit 08fc72ded7
2 changed files with 10 additions and 7 deletions

View File

@ -201,7 +201,7 @@ $total_scheduled_tickets = intval($row['total_scheduled_tickets']);
// Get who last updated the ticket - to be shown in the last Response column // Get who last updated the ticket - to be shown in the last Response column
$ticket_reply_type = "Client"; // Default to client for unreplied tickets $ticket_reply_type = "Client"; // Default to client for unreplied tickets
$ticket_reply_by_display = ""; // Default none $ticket_reply_by_display = ""; // Default none
$sql_ticket_reply = mysqli_query($mysqli, "SELECT ticket_reply_type, contact_name, user_name FROM ticket_replies $sql_ticket_reply = mysqli_query($mysqli, "SELECT ticket_reply_type, ticket_reply_created_at, contact_name, user_name FROM ticket_replies
LEFT JOIN users ON ticket_reply_by = user_id LEFT JOIN users ON ticket_reply_by = user_id
LEFT JOIN contacts ON ticket_reply_by = contact_id LEFT JOIN contacts ON ticket_reply_by = contact_id
WHERE ticket_reply_ticket_id = $ticket_id WHERE ticket_reply_ticket_id = $ticket_id
@ -217,11 +217,13 @@ $total_scheduled_tickets = intval($row['total_scheduled_tickets']);
} else { } else {
$ticket_reply_by_display = nullable_htmlentities($row['user_name']); $ticket_reply_by_display = nullable_htmlentities($row['user_name']);
} }
$ticket_reply_created_at = nullable_htmlentities($row['ticket_reply_created_at']);
$ticket_reply_created_at_time_ago = timeAgo($ticket_reply_created_at);
} }
?> ?>
<tr class="<?php if(empty($ticket_updated_at)) { echo "text-bold"; }?> <?php if ($ticket_reply_type == "Client") { echo "table-warning"; } ?>"> <tr class="<?php if(empty($ticket_reply_created_at)) { echo "text-bold"; }?> <?php if ($ticket_reply_type == "Client") { echo "table-warning"; } ?>">
<!-- Ticket Number --> <!-- Ticket Number -->
<td> <td>
@ -269,7 +271,7 @@ $total_scheduled_tickets = intval($row['total_scheduled_tickets']);
<!-- Ticket Last Response --> <!-- Ticket Last Response -->
<td> <td>
<div><?php echo $ticket_updated_at_display; ?></div> <div title="<?php echo $ticket_reply_created_at; ?>"><?php echo $ticket_reply_created_at_time_ago; ?></div>
<div><?php echo $ticket_reply_by_display; ?></div> <div><?php echo $ticket_reply_by_display; ?></div>
</td> </td>

View File

@ -374,7 +374,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
// Get who last updated the ticket - to be shown in the last Response column // Get who last updated the ticket - to be shown in the last Response column
$ticket_reply_type = "Client"; // Default to client for unreplied tickets $ticket_reply_type = "Client"; // Default to client for unreplied tickets
$ticket_reply_by_display = ""; // Default none $ticket_reply_by_display = ""; // Default none
$sql_ticket_reply = mysqli_query($mysqli, "SELECT ticket_reply_type, contact_name, user_name FROM ticket_replies $sql_ticket_reply = mysqli_query($mysqli, "SELECT ticket_reply_type, ticket_reply_created_at, contact_name, user_name FROM ticket_replies
LEFT JOIN users ON ticket_reply_by = user_id LEFT JOIN users ON ticket_reply_by = user_id
LEFT JOIN contacts ON ticket_reply_by = contact_id LEFT JOIN contacts ON ticket_reply_by = contact_id
WHERE ticket_reply_ticket_id = $ticket_id WHERE ticket_reply_ticket_id = $ticket_id
@ -391,11 +391,12 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
$ticket_reply_by_display = nullable_htmlentities($row['user_name']); $ticket_reply_by_display = nullable_htmlentities($row['user_name']);
} }
$ticket_reply_created_at = nullable_htmlentities($row['ticket_reply_created_at']); $ticket_reply_created_at = nullable_htmlentities($row['ticket_reply_created_at']);
$ticket_reply_created_at_time_ago = timeAgo($ticket_reply_created_at);
} }
?> ?>
<tr class="<?php if(empty($ticket_updated_at)) { echo "text-bold"; }?> <?php if ($ticket_reply_type == "Client") { echo "table-warning"; } ?>"> <tr class="<?php if(empty($ticket_reply_created_at)) { echo "text-bold"; }?> <?php if ($ticket_reply_type == "Client") { echo "table-warning"; } ?>">
<!-- Ticket Bulk Select --> <!-- Ticket Bulk Select -->
<td> <td>
@ -456,13 +457,13 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
<!-- Ticket Last Response --> <!-- Ticket Last Response -->
<td> <td>
<div><?php echo $ticket_updated_at_display; ?></div> <div title="<?php echo $ticket_reply_created_at; ?>"><?php echo $ticket_reply_created_at_time_ago; ?></div>
<div><?php echo $ticket_reply_by_display; ?></div> <div><?php echo $ticket_reply_by_display; ?></div>
</td> </td>
<!-- Ticket Created At --> <!-- Ticket Created At -->
<td> <td>
<?php echo $ticket_created_at_time_ago; ?> <?php echo $ticket_created_at; ?>
<br> <br>
<small class="text-secondary"><?php echo $ticket_created_at; ?></small> <small class="text-secondary"><?php echo $ticket_created_at; ?></small>
</td> </td>