Ticket timer (forum #3237): with Start the timer on opening a ticket on, a reply or note stops the timer instead of a new one starting by itself as the ticket comes back, it stays stopped on reloads and other changes on the ticket until play is pressed or the ticket is opened again from elsewhere, saying Stopped with your reply, choosing On Hold, Resolved or Closed for after the reply pauses it by status id, and a ticket opened with autostart off no longer keeps an empty time that stopped autostart later; 26.12.3 changelog

This commit is contained in:
johnnyq
2026-12-01 15:46:09 -05:00
parent 25dac4cee2
commit 1ba1ffdfd1
4 changed files with 76 additions and 11 deletions

View File

@@ -1008,6 +1008,8 @@ if (isset($_GET['ticket_id'])) {
<button type="button" class="btn btn-light border" id="startStopTimer" title="Start / pause the timer"><i class="fas fa-play"></i></button>
<button type="button" class="btn btn-light border" id="resetTimer" title="Reset the timer"><i class="fas fa-redo-alt"></i></button>
</div>
<!-- Sending a reply stops the timer - said when the page comes back (agent/js/ticket_time_tracking.js) -->
<div class="form-text mt-1" data-timer-replied title="Press play to time more" hidden><i class="fas fa-fw fa-stopwatch me-1"></i>Stopped with your reply</div>
<!-- Add a block of time in one click - the timer stops at the new total (agent/js/ticket_reply_extras.js) -->
<div class="d-flex flex-wrap gap-1 mt-1" data-time-add>
<?php foreach ([15 => '+15m', 30 => '+30m', 60 => '+1h'] as $minutes => $label) { ?>
@@ -1036,7 +1038,7 @@ if (isset($_GET['ticket_id'])) {
<div class="row g-2 align-items-end">
<div class="col-md-5">
<label class="form-label small text-secondary mb-1" for="ticket_reply_status">Status after this</label>
<select class="form-select select2" name="status" id="ticket_reply_status" required>
<select class="form-select select2" name="status" id="ticket_reply_status" required data-timer-pause="<?= implode(',', [TICKET_STATUS_ON_HOLD, TICKET_STATUS_RESOLVED, TICKET_STATUS_CLOSED]) ?>">
<!-- Resolved stays on offer here (reply and resolve in one go) unless open tasks block it -->
<?php foreach ($ticket_status_options as $status_option) {
$ticket_status_id_select = intval($status_option['ticket_status_id']);