diff --git a/CHANGELOG.md b/CHANGELOG.md index f7d33b655..ee356b6b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -224,6 +224,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Capitals: page and window titles, menu items and buttons are in Title Case - New Ticket, Mark Reviewed, Back Up Now, Turn Off Portal Access - and field labels, section headings, tabs and help are in sentence case - Postal code, Tax rate, Physical location - in the agent pages, Admin and the client portal alike. The settings pages in the menu are now Company Details, Invoices and Billing, Purchase Orders, Client Portal and Single Sign-on. - Lists: the first click on a column you aren't sorting by sorts names A-Z and dates, money and counts newest or largest first, and a second click flips it. It used to go the opposite way to the column you were on, so the first click could go either way. - Badges and blanks: every badge is a rounded pill, the menu counts included, and an empty value shows as a grey dash everywhere. A request that can't be done - credit over the balance, say - shows in red like every other error, and the client portal's search boxes read Search ... like the agent pages'. +- Lengths of time: booking lengths, the dispatch board and how long a cron job ran are written 1h 30m like time logged everywhere else - they read 1 hour 30 min and 2 min 5 s - and hours as a number are 12.5 h, project hours included. ### Bug Fixes diff --git a/admin/cron.php b/admin/cron.php index 12064c892..7e575f6e0 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -189,16 +189,16 @@ $took = function ($seconds) { return 'under 0.1 s'; } if ($seconds < 10) { - return rtrim(rtrim(number_format($seconds, 1), '0'), '.') . ' s'; + return rtrim(rtrim(number_format($seconds, 1), '0'), '.') . 's'; } if ($seconds < 60) { - return round($seconds) . ' s'; + return round($seconds) . 's'; } $minutes = intdiv(intval(round($seconds)), 60); if ($minutes < 60) { - return $minutes . ' min ' . (intval(round($seconds)) % 60) . ' s'; + return $minutes . 'm ' . (intval(round($seconds)) % 60) . 's'; } - return intdiv($minutes, 60) . ' h ' . ($minutes % 60) . ' min'; + return intdiv($minutes, 60) . 'h ' . ($minutes % 60) . 'm'; }; // Job names in a sentence - "Mail Queue", "Mail Queue and Backup", "Mail Queue, Backup and Nightly Tasks" - each a link to its row $job_names = function ($list) { diff --git a/agent/js/dispatch.js b/agent/js/dispatch.js index 758962cc4..342f4956d 100644 --- a/agent/js/dispatch.js +++ b/agent/js/dispatch.js @@ -82,7 +82,7 @@ function lengthText(minutes) { const h = Math.floor(minutes / 60); const m = minutes % 60; - return ((h ? h + (h > 1 ? ' hours' : ' hour') : '') + (m ? ' ' + m + ' min' : '')).trim(); + return ((h ? h + 'h' : '') + (m ? ' ' + m + 'm' : '')).trim(); } function minutesBetween(start, end) { const a = parseDateTime(start); @@ -886,7 +886,7 @@ function bar(minutes, capacity) { const pct = capacity ? Math.min(100, Math.round(minutes / capacity * 100)) : 0; const tone = capacity && minutes > capacity ? 'bg-danger' : (pct >= 85 ? 'bg-warning' : 'bg-primary'); - return '
' + esc(lengthText(minutes) || '0 min') + (capacity ? ' of ' + esc(lengthText(capacity)) + '' : '') + '
' + return '
' + esc(lengthText(minutes) || '0m') + (capacity ? ' of ' + esc(lengthText(capacity)) + '' : '') + '
' + '
'; } diff --git a/functions/client_export.php b/functions/client_export.php index 5b1fea125..6e315281e 100644 --- a/functions/client_export.php +++ b/functions/client_export.php @@ -1232,7 +1232,7 @@ function clientExportPdf($client_id, $options) { $chapter('Service levels', 'Targets run in business hours.', 1); $minutes = function ($m) { $m = intval($m); - return $m >= 60 ? round($m / 60, 1) . ' h' : $m . ' min'; + return $m >= 60 ? round($m / 60, 1) . ' h' : $m . 'm'; }; $write(clientExportPdfTable(['Priority' => 20, 'SLA' => 40, 'First reply within' => 20, 'Resolved within' => 20], array_map(function ($s) use ($e, $minutes) { return [$e($s['priority']), $e($s['sla']), $e($minutes($s['response_minutes'])), $e($minutes($s['resolution_minutes']))]; diff --git a/functions/project.php b/functions/project.php index bd9fe23f9..357abd487 100644 --- a/functions/project.php +++ b/functions/project.php @@ -211,13 +211,13 @@ function projectDuePill($row) { return ''; } -/** Hours for people: "45m", "3h", "12.5h". */ +/** Hours for people: "45m", "3 h", "12.5 h". */ function projectHoursText($seconds) { $seconds = max(0, intval($seconds)); if ($seconds < 3600) { return round($seconds / 60) . 'm'; } - return rtrim(rtrim(number_format($seconds / 3600, 1, '.', ''), '0'), '.') . 'h'; + return rtrim(rtrim(number_format($seconds / 3600, 1, '.', ''), '0'), '.') . ' h'; } /** A budget in hours as posted - a positive number up to 999999, or null for none. */ diff --git a/functions/ticket.php b/functions/ticket.php index a3b76dcf3..6aa8d9b98 100644 --- a/functions/ticket.php +++ b/functions/ticket.php @@ -2477,12 +2477,12 @@ function ticketScheduleLengths($keep = 0) { return $lengths; } -/** "1 hour 30 min", "45 min". */ +/** "1h 30m", "45m" - how every length of time is written. */ function ticketScheduleLengthText($minutes) { $minutes = intval($minutes); $hours = intdiv($minutes, 60); $rest = $minutes % 60; - return trim(($hours ? $hours . ' hour' . ($hours > 1 ? 's' : '') : '') . ($rest ? " $rest min" : '')); + return trim(($hours ? "{$hours}h" : '') . ($rest ? " {$rest}m" : '')); } /** "Tuesday, October 20, 2026, 1:00pm - 3:00pm" - both dates in full when it runs past midnight. */