From df64d82f3a9c41d7c9bc1a55755bd76e044126cd Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 20 Nov 2026 23:46:36 -0500 Subject: [PATCH] Archive clients, ticket replies, accounts and SLAs and restore anything without an Are you sure prompt, with Undo added for ticket replies and accounts, real plurals and bold counts in bulk messages, and flashAlert for asset and contact note messages --- CHANGELOG.md | 6 ++- admin/ai_usage.php | 2 +- admin/api_keys.php | 2 +- admin/app_logs.php | 2 +- admin/audit_logs.php | 2 +- admin/backup.php | 8 ++-- admin/cron.php | 2 +- admin/document_template.php | 6 +-- admin/document_templates.php | 2 +- admin/managed_by.php | 2 +- admin/modals/api/api_key_usage.php | 4 +- admin/modals/app_log/app_log.php | 8 ++-- admin/modals/audit_log/audit_log.php | 4 +- admin/modals/user/user.php | 4 +- admin/post/sla.php | 4 +- admin/rmm_clients.php | 6 +-- admin/rmm_providers.php | 2 +- admin/saved_payment_methods.php | 2 +- admin/settings_notification.php | 2 +- admin/sign_ins.php | 2 +- admin/sla.php | 16 +------ admin/software_template.php | 4 +- admin/software_templates.php | 2 +- admin/text_messaging.php | 2 +- admin/update.php | 4 +- admin/users.php | 4 +- admin/vendor_template.php | 6 +-- admin/vendor_templates.php | 2 +- agent/accounts.php | 5 +-- agent/ajax.php | 6 +-- agent/archived.php | 2 +- agent/asset.php | 20 ++++----- agent/audit_log.php | 2 +- agent/certificates.php | 4 +- agent/client_overview.php | 2 +- agent/clients.php | 6 +-- agent/contact.php | 10 ++--- agent/contacts.php | 4 +- agent/contract.php | 4 +- agent/credentials.php | 2 +- agent/document.php | 6 +-- agent/domains.php | 2 +- agent/expenses.php | 2 +- agent/includes/client_actions_menu.php | 4 +- agent/income.php | 2 +- agent/invoice.php | 6 +-- agent/invoices.php | 4 +- agent/js/calendar.js | 6 +-- agent/js/dispatch.js | 8 ++-- agent/js/ticket_schedule_modal.js | 2 +- agent/kb.php | 2 +- agent/kb_article.php | 10 ++--- agent/license.php | 6 +-- agent/location.php | 2 +- agent/modals/asset/asset.php | 2 +- agent/modals/asset/asset_form.php | 2 +- agent/modals/certificate/certificate.php | 4 +- agent/modals/contact/contact.php | 2 +- agent/modals/credential/credential.php | 6 +-- agent/modals/document/document_changes.php | 4 +- .../modals/document/document_version_view.php | 2 +- agent/modals/domain/domain.php | 2 +- agent/modals/expense/expense.php | 4 +- .../modals/expense/expense_reimbursement.php | 4 +- agent/modals/file/file.php | 2 +- agent/modals/invoice/invoice_add_expenses.php | 2 +- agent/modals/invoice/invoice_add_ticket.php | 2 +- agent/modals/invoice/invoice_add_trips.php | 2 +- agent/modals/invoice/invoice_assets.php | 2 +- agent/modals/invoice/invoice_email.php | 2 +- agent/modals/invoice/invoice_payments.php | 2 +- .../modals/invoice/invoice_recurring_add.php | 2 +- agent/modals/kb/kb_article_version.php | 2 +- agent/modals/kb/kb_search_misses.php | 2 +- agent/modals/payment/payment.php | 6 +-- agent/modals/payment/payment_add.php | 2 +- agent/modals/project/project.php | 6 +-- agent/modals/quote/quote_email.php | 2 +- .../recurring_expense/recurring_expense.php | 2 +- agent/modals/revenue/revenue.php | 2 +- agent/modals/revenue/revenue_edit.php | 2 +- agent/modals/share/share.php | 2 +- agent/modals/ticket/ticket.php | 2 +- agent/modals/ticket/ticket_quote_add.php | 6 +-- agent/modals/transfer/transfer.php | 2 +- agent/modals/transfer/transfer_edit.php | 2 +- agent/modals/trip/trip.php | 2 +- agent/modals/trip/trip_edit.php | 2 +- agent/modals/vendor/vendor.php | 2 +- agent/network.php | 4 +- agent/post/account.php | 2 + agent/post/asset.php | 12 +++--- agent/post/billing.php | 4 +- agent/post/client.php | 4 +- agent/post/contact.php | 8 ++-- agent/post/document.php | 2 +- agent/post/invoice.php | 2 +- agent/post/kb.php | 2 +- agent/post/network_ip.php | 2 +- agent/post/product.php | 8 ++-- agent/post/project.php | 2 +- agent/post/recurring_expense.php | 2 +- agent/post/software.php | 6 +-- agent/post/ticket.php | 2 + agent/product.php | 18 ++++---- agent/project.php | 10 ++--- agent/purchase_order.php | 4 +- agent/quote.php | 10 ++--- agent/quotes.php | 4 +- agent/rack.php | 4 +- agent/racks.php | 2 +- agent/reconcile.php | 4 +- agent/recurring_expenses.php | 2 +- agent/recurring_invoice.php | 20 ++++----- agent/recurring_invoices.php | 6 +-- agent/recurring_tickets.php | 4 +- agent/reports/asset_lifecycle.php | 2 +- agent/reports/audit_activity.php | 2 +- agent/reports/credential_rotation.php | 4 +- agent/reports/inventory.php | 2 +- agent/reports/profit_loss.php | 2 +- agent/reports/tax_package.php | 2 +- agent/reports/ticket_aging.php | 2 +- agent/service.php | 4 +- agent/shares.php | 6 +-- agent/software.php | 2 +- agent/ticket.php | 31 ++++++------- agent/ticket_kanban.php | 2 +- agent/ticket_list.php | 2 +- agent/to_order.php | 2 +- agent/transactions.php | 2 +- agent/trips.php | 2 +- agent/unbilled_time.php | 6 +-- agent/user/user_activity.php | 2 +- agent/user/user_security.php | 2 +- agent/vendor.php | 8 ++-- api/v1/contracts/renew.php | 2 +- api/v1/recurring_expenses/move_on.php | 2 +- api/v1/software/renew.php | 2 +- client/quote.php | 2 +- client/receipt.php | 2 +- functions/asset.php | 2 +- functions/audit_log.php | 2 +- functions/billing.php | 14 +++--- functions/billing_email.php | 3 +- functions/billing_pdf.php | 16 +++---- functions/calendar.php | 6 +-- functions/client_export.php | 4 +- functions/client_overview.php | 2 +- functions/contract.php | 6 +-- functions/dashboard.php | 2 +- functions/dispatch.php | 4 +- functions/email.php | 4 +- functions/expense_import.php | 2 +- functions/expenses.php | 6 +-- functions/export.php | 2 +- functions/format.php | 43 +++++++++++++++++++ functions/reports.php | 2 +- functions/sign_in.php | 2 +- functions/sms.php | 4 +- functions/software.php | 2 +- functions/ticket.php | 16 +++---- functions/ticket_helpers.php | 2 +- functions/trips.php | 2 +- functions/user.php | 6 +-- guest/guest_download_file.php | 2 +- guest/guest_view_invoice.php | 8 ++-- guest/guest_view_quote.php | 4 +- guest/share_ajax.php | 8 ++-- includes/billing_paper.php | 8 ++-- includes/load_global_settings.php | 2 +- js/contract_form.js | 2 +- js/notifications.js | 4 +- 173 files changed, 405 insertions(+), 369 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea03a586a..d42b14349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -188,7 +188,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Projects: a project has a Timeline - its booked tickets as bars in time, from its start to its due date, with now marked. A booking that is past and still open shows in amber, and two of the same agent's at the same time are flagged. Its open tickets with no booking are listed under it, with Book. - Pickers: long lists of clients, contacts, vendors, categories, locations, assets, technicians, projects, accounts and products start with the last five you picked in a field like it, under Recent, above All. Typing searches everything as before. - Archived: Tools > Archived lists what was archived lately - clients, contacts, locations, vendors, assets, credentials, documents, files, domains, certificates, networks, racks, services, licenses, projects and products - newest first, with who archived each one, to restore one or several at once. The last 30 days to start with, or pick another time, a kind or a client. -- Undo: archiving no longer asks "Are you sure?" - the message that says it's done has Undo instead, as do moves and changes to several records at once. The message stays up for ten seconds, or as long as the pointer is on it, and only its x closes it - set apart from Undo, so a click that just misses Undo doesn't lose it. Undo covers archiving one or several of every kind Archived lists, bringing back what archiving took with it - a contact's roles, a document's links, a client's recurring invoices; moving files, documents and folders, dragged or with Move; dragging kit on a rack; and the bulk changes to a ticket's priority, category or project, an asset's location, physical location, contact or status, a contact's location, department, phone number or roles, a client's industry or referral, a project's manager or due date, an invoice's or product's category, and an IP address's type. In Admin, Undo is on archiving tags and categories (one or several), canned responses, ticket, project, document, vendor, license and contract templates, roles, payment methods (a default it stopped being comes back with it), SLAs, custom links, portal announcements and banners, on archiving a tax, and on switching off a ticket status - those last two when nothing was moved to another. A payment method is archived without asking first now. In Admin, as everywhere else, the message after archiving, removing, unlinking or cancelling something is red and the one after restoring it or Undo is green. Undo works once and only for whoever made the change, and leaves anything changed again since as it is, saying how many. Archiving a client still asks first, and has no Undo when it withdrew a contract out for signing. +- Undo: archiving no longer asks "Are you sure?" - the message that says it's done has Undo instead, as do moves and changes to several records at once. The message stays up for ten seconds, or as long as the pointer is on it, and only its x closes it - set apart from Undo, so a click that just misses Undo doesn't lose it. Undo covers archiving one or several of every kind Archived lists, bringing back what archiving took with it - a contact's roles, a document's links, a client's recurring invoices; moving files, documents and folders, dragged or with Move; dragging kit on a rack; and the bulk changes to a ticket's priority, category or project, an asset's location, physical location, contact or status, a contact's location, department, phone number or roles, a client's industry or referral, a project's manager or due date, an invoice's or product's category, and an IP address's type. In Admin, Undo is on archiving tags and categories (one or several), canned responses, ticket, project, document, vendor, license and contract templates, roles, payment methods (a default it stopped being comes back with it), SLAs, custom links, portal announcements and banners, on archiving a tax, and on switching off a ticket status - those last two when nothing was moved to another. A payment method is archived without asking first now. In Admin, as everywhere else, the message after archiving, removing, unlinking or cancelling something is red and the one after restoring it or Undo is green. Undo works once and only for whoever made the change, and leaves anything changed again since as it is, saying how many. Archiving a client still asks first, and has no Undo when it withdrew a contract out for signing. Archiving a client (one or several), a ticket reply, an account or an SLA, and restoring anything archived, no longer asks first either - the ticket reply and the account have Undo too. - Client portal: one Search box in the top bar looks through the client's tickets - their subject, number and what was said on them - the documents you share with them and your Help articles at once, the first eight of each with See all. Nothing found offers Ask us, and a search with no Help article goes on the Knowledge Base's Not found list. - Client portal: a ticket says when to expect your first reply - We'll reply by and the time, from its SLA - until you reply, while it isn't on hold and the time is still ahead. New ticket says how soon you reply to each priority, beside the priority and under What happens next. Without SLAs nothing is promised. - Users: Invite several, beside New User, invites a list of people at once with one role (and office, and whether two-step sign-in is required) - one per line, as a name and email or just the email. Each gets their own invite email; anyone who already has an account is skipped and named. It needs email set up. @@ -217,6 +217,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Sign-in codes: the 6-digit code - signing in with two-step sign-in, setting it up (yours, or a contact's in the client portal), and the code emailed for a shared link - goes in six boxes, three and three. Paste or let your phone or password manager fill it, "123 456" too, and it goes as soon as the sixth digit is in - no need to click the button. A wrong code turns the boxes red. On the sign-in page Remember this browser now comes before the code, so tick it first. - Browser autofill: Chrome, Edge and other Chromium browsers no longer offer your own name, email, phone or address in forms about clients - a new client's contact, a contact, a location - and Bitwarden, 1Password, LastPass and Dashlane no longer offer your ITFlow login in a credential's username and password, or anywhere else you type someone else's details or secrets, nor ask to save them. Your own profile, password change and two-step sign-in still work with your password manager. - Tickets: the first technician to reply to a ticket nobody is assigned to - with a public note, an email reply or a text reply - is assigned it, as Assign to me would, and the message after sending says so. An internal note doesn't assign it, so a ticket can be looked into, or someone @mentioned on it, without taking it, and a ticket already assigned keeps its technician. Admin > Settings > Tickets > Assigning switches it off - for a shop where someone answers new tickets before handing them on. +- Dates: every date reads one way - Nov 13, 2026, with times as 2:30 PM and the day of the week as Fri, Nov 13 where it shows. The invoice, quote, recurring invoice, expense, income, trip and transaction lists and pages, an asset's and a license's dates, certificates, domains, invoice and quote PDFs, statements and the guest invoice and quote pages showed 2026-11-13; some times read 2:30pm or 14:30, and some emails put the day first, 13 Nov. Pointing at a "3 days ago" shows the date and time the same way. Date fields, exports and file names keep 2026-11-13. ### Bug Fixes @@ -272,6 +273,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Windows: opening one put a focus ring round its X in the corner. Focus now goes to the window itself. - Tickets: the tickets list and board showed how long ago a ticket's SLA was due, in grey, until cron next marked it breached, and showed the time left on one that had already missed its first response. A ticket past its deadline or that missed a target now says Breached, as the SLA breached view counts it. - Dashboard: in Open and assigned to you, the SLA, status and last activity didn't line up from one ticket to the next - each row moved them by the width of its own status or time, and by whether it had an SLA. They now sit in columns down the card. +- Messages: archiving, restoring, deleting, favoriting or setting the category of several contacts, clients, assets or products said contact(s), client(s) and so on, an import of network IPs said IP(s), and the message after restoring clients started "You restored". They now say 1 contact, 3 contacts, with the number in bold, like the rest. ### Developer Updates @@ -429,6 +431,8 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Code boxes: `otpCodeInput()` in `functions/user.php` draws a 6-digit code field (options: id, label, class, autofocus, submit, invalid) and `js/otp_input.js` (loaded by `includes/footer.php`, `client/includes/footer.php`, `login.php`, `agent/user/mfa_enforcement.php` and `guest/share.php`) lays the one see-through input over six `.itflow-otp-slot` boxes - typing, paste and autofill go to the input, the boxes only show it. Non-digits are stripped (a pasted "123 456" fills them all), the caret stays at the end, a value set from script redraws them (the input's own `value` property), and the `is-invalid` class on the input turns them red until the next digit. `data-otp-submit` sends the form with `requestSubmit()` and its first submit button once the sixth digit is in; `window.itflowOtp(input)` does one added later. One with `autofocus` is focused (without scrolling) when its modal opens (`shown.bs.modal`), and on load when the browser skipped it - a page opened at a `#fragment`. `login.php` (agent and client steps), `agent/user/includes/mfa_setup.php`, `client/profile.php` and `guest/share.php` use it; `.itflow-mfa-code` is gone. - Autofill: `js/autofill_off.js` (loaded by `includes/footer.php` on agent and admin pages, not the guest portal) gives every input, textarea and select whose autocomplete is missing, `off` or `new-password` an unrecognised `autocomplete="itflow-none"` (Chromium offers no autofill or past entries for one, where it ignores `off` for names and addresses) - `new-password` on password fields, so the saved ITFlow login isn't offered - plus `data-1p-ignore`, `data-lpignore`, `data-bwignore` and `data-form-type="other"`, and marks it `data-autofill-off`. Fields added later are done by a `MutationObserver`, which also puts it back when a script sets `autocomplete="off"` again (`js/autocomplete.js`). Left alone: `current-password`, `username`, `one-time-code`, any other real autofill value, and anything inside `[data-autofill]` - `#profileForm` and `#passwordForm` in Your account. - First reply assigns: database 4.0.9 adds `settings.config_ticket_reply_assigns` (on to start with), read by `ticketReplyAssigns()` in `functions/ticket_fields.php` (on before the update). In `add_ticket_reply` (`agent/post/ticket.php`), a Public reply on a ticket with `ticket_assigned_to = 0` calls `ticketChangeAssignee($ticket_id, $session_user_id)` after the first response is set - so moving New to Open sends no "ticket assigned" message - with its internal note, history, audit and `ticket_assign` custom action. Bulk replies, AI notes and the no-response resolve leave the assignee alone. +- Dates: `formatDate()`, `formatDateTime()` (with `$seconds` for logs), `formatTime()` and `formatDay()` in `functions/format.php` show a stored date or time (or a timestamp) as `M j, Y`, `M j, Y g:i A`, `g:i A` and `D, M j, Y`, and give '' for nothing or a zero date. Raw `Y-m-d` values printed on pages, windows, `includes/billing_paper.php`, `functions/billing_pdf.php` and the guest pages now go through them, as do the `title` hovers beside `timeAgo()`; `billingEmailDate()` calls `formatDate()`; the odd `date()` formats (`g:ia`, `M d, Y • g:i A`, `D j M`, `F j, Y`, `m/d/Y`, `M y` and the like) are the standard ones; `$config_date_format` is `M j, Y`; and the scripts' `toLocale*String()` calls pass `en-US` so they match. New code uses the helpers. +- Messages: a note added to an asset or a contact sets its message with `flashAlert()`, its names escaped, rather than writing `$_SESSION['alert_message']` itself; the `archive_ticket_reply` and `archive_account` handlers offer Undo through `undoArchivedBefore()` / `undoOfferArchived()`; and the SLA list no longer builds the archive prompt's text. ## [26.11.8] diff --git a/admin/ai_usage.php b/admin/ai_usage.php index 6d25a213c..cfe7f1a70 100644 --- a/admin/ai_usage.php +++ b/admin/ai_usage.php @@ -220,7 +220,7 @@ $ms_text = function ($ms) { $feature = (string) $row['ai_usage_feature']; ?> - +
diff --git a/admin/api_keys.php b/admin/api_keys.php index fdeea5d7a..f52a4e20a 100644 --- a/admin/api_keys.php +++ b/admin/api_keys.php @@ -152,7 +152,7 @@ $csrf = $_SESSION['csrf_token']; $role = $roles[intval($row['user_role_id'])] ?? null; $expired = apiKeyExpired($row); $agent_name = trim(str_replace(' (archived)', '', (string) $row['user_name'])); - $last_used = $row['api_key_last_used_at'] ? '' . escapeHtml(timeAgo($row['api_key_last_used_at'])) . '' : 'Never'; + $last_used = $row['api_key_last_used_at'] ? '' . escapeHtml(timeAgo($row['api_key_last_used_at'])) . '' : 'Never'; $use = $usage[$api_key_id] ?? null; if ($use && $use['last_ip'] !== '') { $last_used .= '
' . escapeHtml($use['last_ip']) . '
'; diff --git a/admin/app_logs.php b/admin/app_logs.php index 009fccd0e..a826a90ee 100644 --- a/admin/app_logs.php +++ b/admin/app_logs.php @@ -168,7 +168,7 @@ $filters_url = function ($modal) use ($dtf, $dtt, $view, $category_filter) { $short = mb_strlen($details) > 240 ? rtrim(mb_substr($details, 0, 240)) . '…' : $details; ?> - +
diff --git a/admin/audit_logs.php b/admin/audit_logs.php index 96907df31..db4c6b1a4 100644 --- a/admin/audit_logs.php +++ b/admin/audit_logs.php @@ -231,7 +231,7 @@ $view_empty = [ $from = implode(' · ', array_filter([(string) $row['log_ip'], $device])); ?> - +
diff --git a/admin/backup.php b/admin/backup.php index b8c3248ca..62d70a2b8 100644 --- a/admin/backup.php +++ b/admin/backup.php @@ -357,7 +357,7 @@ $status_looks = [ $type_as_noun = $type_noun($backup['backup_type']); $type_look = $type_looks[$backup['backup_type']] ?? ['icon' => 'fa-file-archive', 'tone' => 'itflow-asset-tone-other']; $status_look = $status_looks[$status] ?? ['label' => $status, 'tone' => 'secondary']; - $made_at = substr((string) $backup['backup_created_at'], 0, 16); + $made_at = formatDateTime($backup['backup_created_at']); $backup_path = $status === 'Complete' ? backupResolvePath((string) $backup['backup_file_name']) : false; // A finished one is deleted, file and all; one still waiting is taken off the queue; the rest are only rows $remove = [ @@ -374,12 +374,12 @@ $status_looks = [
-
+
-
+
0 ? escapeHtml(backupFormatBytes($backup['backup_size'])) : '—' ?> @@ -390,7 +390,7 @@ $status_looks = [
Its file is no longer on this server
-
Downloaded
+
Downloaded
diff --git a/admin/cron.php b/admin/cron.php index 841b1b881..a9017e0fe 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -503,7 +503,7 @@ $status_looks = [ Times are in - now + now diff --git a/admin/document_template.php b/admin/document_template.php index 255a51d6e..002238c56 100644 --- a/admin/document_template.php +++ b/admin/document_template.php @@ -191,7 +191,7 @@ $required_url = "modals/document_template/document_template_required.php?id=$doc - + @@ -315,10 +315,10 @@ $required_url = "modals/document_template/document_template_required.php?id=$doc
Made
-
' . escapeHtml($template['created_by_name']) . '
' : '' ?> +
' . escapeHtml($template['created_by_name']) . '' : '' ?>
Last changed
-
' . escapeHtml($template['updated_by_name']) . '' : '' ?>
+
' . escapeHtml($template['updated_by_name']) . '' : '' ?>
Images
diff --git a/admin/document_templates.php b/admin/document_templates.php index 1d36a4fec..e2a8975e0 100644 --- a/admin/document_templates.php +++ b/admin/document_templates.php @@ -196,7 +196,7 @@ $csrf = $_SESSION['csrf_token']; Not yet' ?> > - +
diff --git a/admin/managed_by.php b/admin/managed_by.php index dde7791cd..5658c5b38 100644 --- a/admin/managed_by.php +++ b/admin/managed_by.php @@ -219,7 +219,7 @@ $lock = '' . ($state['update_policy'] === 'auto' ? 'Automatic' : 'From there') . '' . $lock . ($state['update_policy'] === 'auto' ? '
' . ($state['update_delay_days'] > 0 ? $state['update_delay_days'] . ' day' . ($state['update_delay_days'] === 1 ? '' : 's') . ' after a release' : 'As soon as a release is out') . ', security fixes straight away
' : '')) ?> ' . escapeHtml(timeAgo($last_support['log_created_at'])) . '' + ? 'Last ' . escapeHtml(timeAgo($last_support['log_created_at'])) . '' : 'Not yet') ?> diff --git a/admin/modals/api/api_key_usage.php b/admin/modals/api/api_key_usage.php index 9610ad377..a8f4b3ff0 100644 --- a/admin/modals/api/api_key_usage.php +++ b/admin/modals/api/api_key_usage.php @@ -72,7 +72,7 @@ if (!$row) { ?> - + @@ -88,7 +88,7 @@ if (!$row) { ?>
  • - +
  • diff --git a/admin/modals/app_log/app_log.php b/admin/modals/app_log/app_log.php index 9b7de0556..5866da84d 100644 --- a/admin/modals/app_log/app_log.php +++ b/admin/modals/app_log/app_log.php @@ -55,7 +55,7 @@ ob_start();
    -
    ·
    +
    ·
    @@ -90,7 +90,7 @@ ob_start();
    - +
    @@ -106,7 +106,7 @@ ob_start();
    - + @@ -131,7 +131,7 @@ ob_start();
    - + diff --git a/admin/modals/audit_log/audit_log.php b/admin/modals/audit_log/audit_log.php index f8e2520a4..571f36663 100644 --- a/admin/modals/audit_log/audit_log.php +++ b/admin/modals/audit_log/audit_log.php @@ -65,7 +65,7 @@ $entry_line = function ($entry, $show_when_as = 'date') { $time = strtotime($entry['log_created_at']); $when = $show_when_as === 'time' ? date('g:i A', $time) : date('M j, Y g:i A', $time); return '' - . '' . escapeHtml($when) . '' + . '' . escapeHtml($when) . '' . '' . auditLogActionPill($entry['log_action']) . '' . '' . escapeHtml($entry['log_description']) . '' . ''; @@ -80,7 +80,7 @@ ob_start();
    -
    ·
    +
    ·
    diff --git a/admin/modals/user/user.php b/admin/modals/user/user.php index 2569c5b26..3b45cea99 100644 --- a/admin/modals/user/user.php +++ b/admin/modals/user/user.php @@ -91,7 +91,7 @@ ob_start();
    Added
    -
    +
    · joined from invite @@ -99,7 +99,7 @@ ob_start();
    Archived
    -
    +
    diff --git a/admin/post/sla.php b/admin/post/sla.php index 8f741b458..a408389c5 100644 --- a/admin/post/sla.php +++ b/admin/post/sla.php @@ -203,7 +203,7 @@ if (isset($_POST['add_holiday'])) { getBusinessHolidays(true); $restamped = restampOpenSlaTickets(); - logAudit("Settings", "Create", "$session_name added SLA closure day $holiday_date - $holiday_name"); + logAudit("Settings", "Create", "$session_name added SLA closure day " . formatDate($holiday_date) . " - $holiday_name"); flashAlert("Closure day added" . ($restamped ? " - targets worked out again on " . $sla_open_tickets_text($restamped) : '')); @@ -230,7 +230,7 @@ if (isset($_POST['delete_holiday'])) { getBusinessHolidays(true); $restamped = restampOpenSlaTickets(); - logAudit("Settings", "Delete", "$session_name removed SLA closure day $holiday_date - $holiday_name"); + logAudit("Settings", "Delete", "$session_name removed SLA closure day " . formatDate($holiday_date) . " - $holiday_name"); flashAlert("Closure day removed" . ($restamped ? " - targets worked out again on " . $sla_open_tickets_text($restamped) : ''), 'error'); diff --git a/admin/rmm_clients.php b/admin/rmm_clients.php index d71602f55..eb573ab17 100644 --- a/admin/rmm_clients.php +++ b/admin/rmm_clients.php @@ -136,9 +136,9 @@ $devices_in = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*) FRO Not synced yet - link a client below and its devices come in straight away. - Synced - + Synced - - The sync didn't work: + The sync didn't work: device in ITFlow
    @@ -236,7 +236,7 @@ $devices_in = intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*) FRO - + diff --git a/admin/rmm_providers.php b/admin/rmm_providers.php index 06aebdc3d..a501e3668 100644 --- a/admin/rmm_providers.php +++ b/admin/rmm_providers.php @@ -184,7 +184,7 @@ $csrf = $_SESSION['csrf_token']; -
    Didn't work,
    +
    Didn't work,
    diff --git a/admin/saved_payment_methods.php b/admin/saved_payment_methods.php index aaf48606c..ec6b26bcd 100644 --- a/admin/saved_payment_methods.php +++ b/admin/saved_payment_methods.php @@ -218,7 +218,7 @@ $page_title = 'Saved Cards'; - + ' : '' ?> +
    ' . escapeHtml($template['updated_by_name']) . '' : '' ?>
    diff --git a/admin/software_templates.php b/admin/software_templates.php index 3b6bbd941..66a0d099b 100644 --- a/admin/software_templates.php +++ b/admin/software_templates.php @@ -225,7 +225,7 @@ $csrf = $_SESSION['csrf_token']; > - +
    diff --git a/admin/text_messaging.php b/admin/text_messaging.php index b30cf76f9..2ea082877 100644 --- a/admin/text_messaging.php +++ b/admin/text_messaging.php @@ -136,7 +136,7 @@ $csrf = $_SESSION['csrf_token']; - + None yet - text the number to try it diff --git a/admin/update.php b/admin/update.php index c055f654a..6bf1015a5 100644 --- a/admin/update.php +++ b/admin/update.php @@ -480,7 +480,7 @@ $hero = [ Last checked - + Never @@ -490,7 +490,7 @@ $hero = [ Last updated - + Failed Not from this page yet diff --git a/admin/users.php b/admin/users.php index 5e2c413e2..7c1745fa4 100644 --- a/admin/users.php +++ b/admin/users.php @@ -625,7 +625,7 @@ $csrf = $_SESSION['csrf_token']; -
    ·
    +
    ·
    Emailed 1 ? " · $invite_sent times" : '' ?> @@ -759,7 +759,7 @@ $csrf = $_SESSION['csrf_token'];
    remembered browser
    -
    +
    diff --git a/admin/vendor_template.php b/admin/vendor_template.php index 26403e737..6b7b5c345 100644 --- a/admin/vendor_template.php +++ b/admin/vendor_template.php @@ -295,7 +295,7 @@ foreach (vendorTemplateFieldLabels() as $field) { - - + ' : '' ?>
    Last changed
    -
    ' . escapeHtml($template['updated_by_name']) . '
    ' : '' ?> +
    ' . escapeHtml($template['updated_by_name']) . '' : '' ?>
    diff --git a/admin/vendor_templates.php b/admin/vendor_templates.php index 8ba1daee1..2c56b11d9 100644 --- a/admin/vendor_templates.php +++ b/admin/vendor_templates.php @@ -260,7 +260,7 @@ $csrf = $_SESSION['csrf_token']; > - +
    diff --git a/agent/accounts.php b/agent/accounts.php index 64f3a3113..fdfc4884a 100644 --- a/agent/accounts.php +++ b/agent/accounts.php @@ -195,7 +195,7 @@ $month_url = 'canned_date=custom&dtf=' . $stats['month_start'] . '&dtt=' . date( -
    line
    +
    line
    Nothing yet @@ -223,8 +223,7 @@ $month_url = 'canned_date=custom&dtf=' . $stats['month_start'] . '&dtt=' . date( - Archive + Archive Archive once it's empty diff --git a/agent/ajax.php b/agent/ajax.php index 251e3b9fe..76c55ab68 100644 --- a/agent/ajax.php +++ b/agent/ajax.php @@ -89,7 +89,7 @@ if (isset($_GET['certificate_check'])) { . certificateExpiryPill($expiry, true) . '' . '
    ' . '
    Issuer
    ' . escapeHtml($check['issuer'] ?: 'Unknown') . ($check['self_signed'] ? ' (self-signed)' : '') . '
    ' - . '
    Valid
    ' . escapeHtml($check['issued_at']) . ' to ' . escapeHtml($check['expire']) . ' (' . $check['days'] . ' days)
    ' + . '
    Valid
    ' . formatDate($check['issued_at']) . ' to ' . formatDate($check['expire']) . ' (' . $check['days'] . ' days)
    ' . '
    Covers
    ' . escapeHtml(implode(', ', array_slice($names, 0, 6))) . (count($names) > 6 ? ' and ' . (count($names) - 6) . ' more' : '') . '
    ' . '
    '; @@ -1051,7 +1051,7 @@ if (isset($_GET['ticket_reply_peek'])) { 'label' => $peek['label'], 'who' => $peek['who'], 'when' => timeAgo($peek['at']), - 'at' => $peek['at'], + 'at' => formatDateTime($peek['at']), 'text' => emailPlainText($peek['html'], 600), ]); exit; @@ -1211,7 +1211,7 @@ if (isset($_POST['share_create'])) { } // "Works until Oct 17 at 9:00 AM, opens once, needs a passphrase, emailed to bob@example.com" - $summary = ['Works until ' . date('M j \a\t g:i A', strtotime($result['expire_at']))]; + $summary = ['Works until ' . date('M j, Y g:i A', strtotime($result['expire_at']))]; if ($type !== 'Request') { $summary[] = $result['views'] ? 'opens ' . strtolower(shareViewOptions()[$result['views']]) : 'opens any number of times'; } diff --git a/agent/archived.php b/agent/archived.php index 6615778a4..c62812328 100644 --- a/agent/archived.php +++ b/agent/archived.php @@ -199,7 +199,7 @@ while ($row = mysqli_fetch_assoc($sql_clients)) { - +
    by
    diff --git a/agent/asset.php b/agent/asset.php index 6011eb906..f4e6096d1 100644 --- a/agent/asset.php +++ b/agent/asset.php @@ -431,7 +431,7 @@ if (mysqli_num_rows($sql) == 0) {
    Status
    - - last seen + - last seen
    @@ -440,7 +440,7 @@ if (mysqli_num_rows($sql) == 0) {
    Up since
    -
    +
    Public IP
    @@ -566,11 +566,11 @@ if (mysqli_num_rows($sql) == 0) {
    Purchased
    -
    old
    +
    old
    Installed
    -
    in service
    +
    in service
    Vendor
    @@ -580,7 +580,7 @@ if (mysqli_num_rows($sql) == 0) {
    Sold on
    $asset_sold_number" : $asset_sold_number ?> -
    Our invoice,
    +
    Our invoice,
    @@ -589,7 +589,7 @@ if (mysqli_num_rows($sql) == 0) {
    Order ref
    -
    Added
    +
    Added
    @@ -974,7 +974,7 @@ if (mysqli_num_rows($sql) == 0) { - + - + @@ -1130,7 +1130,7 @@ if (mysqli_num_rows($sql) == 0) { - + @@ -1196,7 +1196,7 @@ if (mysqli_num_rows($sql) == 0) {
    - · · + · ·
    diff --git a/agent/audit_log.php b/agent/audit_log.php index bf261312b..fd73485cf 100644 --- a/agent/audit_log.php +++ b/agent/audit_log.php @@ -219,7 +219,7 @@ $view_empty = [ $from = implode(' · ', array_filter([(string) $row['log_ip'], $device])); ?> - +
    diff --git a/agent/certificates.php b/agent/certificates.php index c78c519d1..302872e31 100644 --- a/agent/certificates.php +++ b/agent/certificates.php @@ -385,13 +385,13 @@ $export_extra = [ -
    +
    -
    +
    diff --git a/agent/client_overview.php b/agent/client_overview.php index 634cec241..33558b763 100644 --- a/agent/client_overview.php +++ b/agent/client_overview.php @@ -525,7 +525,7 @@ $money_format = function ($amount) use ($currency_format, $client_currency_code,
    -
    +
    diff --git a/agent/clients.php b/agent/clients.php index 106d08141..23ab5dda3 100644 --- a/agent/clients.php +++ b/agent/clients.php @@ -430,7 +430,7 @@ $total_leads = intval($row['leads']); Restore - @@ -727,11 +727,11 @@ $total_leads = intval($row['leads']); - + Restore - + Archive diff --git a/agent/contact.php b/agent/contact.php index 09f506140..c52044121 100644 --- a/agent/contact.php +++ b/agent/contact.php @@ -317,7 +317,7 @@ if (!$can_support) { @@ -646,7 +646,7 @@ if (!$can_support) { - + - · + · @@ -827,7 +827,7 @@ if (!$can_support) {
    - · · + · ·
    diff --git a/agent/contacts.php b/agent/contacts.php index b475f93bb..cfe95e861 100644 --- a/agent/contacts.php +++ b/agent/contacts.php @@ -517,7 +517,7 @@ $search_placeholder = $invites_view ? 'Search invites by email, name or client' Their own tickets
    ' ?> -
    +
    1 ? ' · sent ' . intval($row['invite_sent_count']) . ' times' : '' ?>
    @@ -705,7 +705,7 @@ $search_placeholder = $invites_view ? 'Search invites by email, name or client' - + Restore diff --git a/agent/contract.php b/agent/contract.php index a00f65e9b..0721f68ec 100644 --- a/agent/contract.php +++ b/agent/contract.php @@ -294,7 +294,7 @@ if (!$contract || ($client_url && intval($contract['contract_client_id']) !== in
    By
    -
    Renewed
    +
    Renewed
    Cancelled
    @@ -348,7 +348,7 @@ if (!$contract || ($client_url && intval($contract['contract_client_id']) !== in
    Client
    Contact
    ' . escapeHtml($contract['contact_name']) . '' : 'None' ?>
    Owner
    No one - everyone is reminded' ?>
    -
    Added
    +
    Added
    diff --git a/agent/credentials.php b/agent/credentials.php index 553c4880a..fe49b0531 100644 --- a/agent/credentials.php +++ b/agent/credentials.php @@ -417,7 +417,7 @@ $filter_url = function ($changes) use ($client_url) { -
    ' ?> -
    Used
    +
    Used
    diff --git a/agent/document.php b/agent/document.php index 5d312921f..118e743af 100644 --- a/agent/document.php +++ b/agent/document.php @@ -100,7 +100,7 @@ $page_title = $row['document_name'];
    - Updated + Updated · Created · From template ' . escapeHtml($row['document_template_name']) . '' : escapeHtml($row['document_template_name']) ?> @@ -309,8 +309,8 @@ $page_title = $row['document_name']; $version_id = intval($version['document_version_id']); ?>
  • - - + +
    diff --git a/agent/domains.php b/agent/domains.php index 813142c01..c2317ae53 100644 --- a/agent/domains.php +++ b/agent/domains.php @@ -380,7 +380,7 @@ $bulk_vendor_options = $can_edit ? domainVendorChoices($client_url ? $client_id -
    +
    diff --git a/agent/expenses.php b/agent/expenses.php index 037109268..e2a63fb14 100644 --- a/agent/expenses.php +++ b/agent/expenses.php @@ -362,7 +362,7 @@ $month_change = $stats['last_to_date'] > 0 ? round(($stats['month'] - $stats['la - > + > diff --git a/agent/includes/client_actions_menu.php b/agent/includes/client_actions_menu.php index ef1f03320..c0244f93d 100644 --- a/agent/includes/client_actions_menu.php +++ b/agent/includes/client_actions_menu.php @@ -67,12 +67,12 @@ Offboard - + Archive Client - + Restore Client diff --git a/agent/income.php b/agent/income.php index 2515a6241..cf6934e25 100644 --- a/agent/income.php +++ b/agent/income.php @@ -318,7 +318,7 @@ $invoices_url = 'invoices.php?' . ($client_page ? "client_id=$client_id&" : '')
    - > + >
    diff --git a/agent/invoice.php b/agent/invoice.php index a8bf4308d..6495f91e4 100644 --- a/agent/invoice.php +++ b/agent/invoice.php @@ -158,7 +158,7 @@ echo agentBannersHtml($client_id); From - Created + Created
    @@ -312,7 +312,7 @@ echo agentBannersHtml($client_id);
    Paid
    in ' . count($payments) . ' payment' . (count($payments) === 1 ? '' : 's') . '' : '' ?>
    Due
    - +
    @@ -373,7 +373,7 @@ echo agentBannersHtml($client_id);
    - +
    diff --git a/agent/invoices.php b/agent/invoices.php index 35747a334..e25b7f29e 100644 --- a/agent/invoices.php +++ b/agent/invoices.php @@ -389,9 +389,9 @@ $stat_money = function ($amount) use ($session_company_currency) { - + - +
    Pick the agents to show under Agents.
    '; return; @@ -783,7 +783,7 @@ const now = ymd(today()); let html = '
    '; days.forEach(function (d) { - html += ''; + html += ''; }); html += ''; shownAgents().forEach(function (a) { @@ -975,7 +975,7 @@ const s = json.sla; const from = parseYmd(json.week[0]); const to = parseYmd(json.week[1]); - root.querySelector('[data-dispatch-week]').textContent = from.toLocaleDateString(undefined, {month: 'short', day: 'numeric'}) + ' - ' + to.toLocaleDateString(undefined, {month: 'short', day: 'numeric'}); + root.querySelector('[data-dispatch-week]').textContent = from.toLocaleDateString('en-US', {month: 'short', day: 'numeric'}) + ' - ' + to.toLocaleDateString('en-US', {month: 'short', day: 'numeric'}); const tile = function (label, value, sub) { return '
    ' + esc(label) + '
    ' + esc(value) + '
    ' + sub + '
    '; }; diff --git a/agent/js/ticket_schedule_modal.js b/agent/js/ticket_schedule_modal.js index d41dd4e63..58eb2c4dc 100644 --- a/agent/js/ticket_schedule_modal.js +++ b/agent/js/ticket_schedule_modal.js @@ -34,7 +34,7 @@ } shown = date + '/' + panel.dataset.user; const day = new Date(date + 'T12:00:00'); - title.textContent = panel.dataset.name + "'s day - " + day.toLocaleDateString(undefined, {weekday: 'short', month: 'short', day: 'numeric'}); + title.textContent = panel.dataset.name + "'s day - " + day.toLocaleDateString('en-US', {weekday: 'short', month: 'short', day: 'numeric'}); open.href = 'calendar.php?date=' + date; itflowGet('ajax.php', {calendar_day: 1, date: date, user_id: panel.dataset.user, ticket_id: panel.dataset.ticket}, function (text) { let items = []; diff --git a/agent/kb.php b/agent/kb.php index e70452781..ab7fe1c57 100644 --- a/agent/kb.php +++ b/agent/kb.php @@ -302,7 +302,7 @@ $csrf = $_SESSION['csrf_token']; - + - + @@ -457,7 +457,7 @@ if (!$product) { - + @@ -484,7 +484,7 @@ if (!$product) { - + @@ -537,9 +537,9 @@ if (!$product) { @@ -571,7 +571,7 @@ if (!$product) { $move_type = $stock_types[$move['stock_type']] ?? $stock_types['adjusted']; $qty = floatval($move['stock_qty']); ?> - + @@ -618,7 +618,7 @@ if (!$product) { $price_moved = round($price_new - $price_old, 2); $cost_moved = round(floatval($price_row['price_cost_new']) - floatval($price_row['price_cost_old']), 2); ?> - + - + - + - + - diff --git a/agent/software.php b/agent/software.php index f7d0f648b..9e598715a 100644 --- a/agent/software.php +++ b/agent/software.php @@ -496,7 +496,7 @@ while ($license_type_row = mysqli_fetch_row($sql_license_types)) { - + - + - + - diff --git a/agent/user/user_security.php b/agent/user/user_security.php index db8050a2b..21b8ff7d7 100644 --- a/agent/user/user_security.php +++ b/agent/user/user_security.php @@ -135,7 +135,7 @@ $remember_days = max(1, intval($config_login_remember_me_expire)); This browser
    - Remembered + Remembered from · skips the code until
    diff --git a/agent/vendor.php b/agent/vendor.php index ec10bd8ad..df60babce 100644 --- a/agent/vendor.php +++ b/agent/vendor.php @@ -455,7 +455,7 @@ if (!$vendor || (isset($_GET['client_id']) && $vendor_client_id !== intval($clie Not recorded -
    Added
    +
    Added
    @@ -584,7 +584,7 @@ if (!$vendor || (isset($_GET['client_id']) && $vendor_client_id !== intval($clie - + - + - + '; @@ -466,9 +466,9 @@ function billingStatementPdfRender(array $statement) { '; foreach ($statement['invoices'] as $invoice) { $late = $invoice['balance'] > 0 && $invoice['days'] > 0; - $html .= ' + $html .= ' - + '; diff --git a/functions/calendar.php b/functions/calendar.php index 96c011651..56a81a17e 100644 --- a/functions/calendar.php +++ b/functions/calendar.php @@ -218,9 +218,9 @@ function calendarWhenText($row, $start = null, $end = null) { return date('D, M j', $s) . ' - ' . date('D, M j, Y', $e) . ' (all day)'; } if (date('Y-m-d', $s) === date('Y-m-d', $e)) { - return date('D, M j, Y, g:i A', $s) . ($e > $s ? ' - ' . date('g:i A', $e) : ''); + return date('D, M j, Y g:i A', $s) . ($e > $s ? ' - ' . date('g:i A', $e) : ''); } - return date('D, M j, g:i A', $s) . ' - ' . date('D, M j, Y, g:i A', $e); + return date('D, M j, g:i A', $s) . ' - ' . date('D, M j, Y g:i A', $e); } /** Where an event is as one line - the site's name and address - or the location typed in. */ @@ -1842,7 +1842,7 @@ function calendarLeftBehindTickets($user_id = 0, $client_id = 0, $limit = 50) { 'priority' => $row['ticket_priority'], 'onsite' => intval($row['ticket_onsite']), 'agent' => $row['user_name'] ?: 'Unassigned', - 'booked' => date('D M j', strtotime($row['ticket_schedule'])), + 'booked' => date('D, M j', strtotime($row['ticket_schedule'])), 'days' => intval((strtotime(date('Y-m-d')) - strtotime(substr($row['ticket_schedule'], 0, 10))) / 86400), ]; } diff --git a/functions/client_export.php b/functions/client_export.php index 0e47529bc..5b1fea125 100644 --- a/functions/client_export.php +++ b/functions/client_export.php @@ -1152,10 +1152,10 @@ function clientExportPdf($client_id, $options) { $pdf->Ln(2); $pdf->SetFont('dejavusans', '', 10); $pdf->SetTextColor(73, 80, 87); - $pdf->MultiCell($width, 5, 'Prepared ' . date('F j, Y') . ' by ' . stripslashes((string) $session_name) . ($company['company_name'] ? ', ' . $company['company_name'] : ''), 0, 'L', false, 1); + $pdf->MultiCell($width, 5, 'Prepared ' . date('M j, Y') . ' by ' . stripslashes((string) $session_name) . ($company['company_name'] ? ', ' . $company['company_name'] : ''), 0, 'L', false, 1); $included = array_map(function ($key) use ($sections) { return lcfirst($sections[$key]['label']); }, $options['sections']); - $about = 'This document records ' . $client['name'] . "'s IT environment as documented on " . date('F j, Y') . ': the client details' + $about = 'This document records ' . $client['name'] . "'s IT environment as documented on " . date('M j, Y') . ': the client details' . ($included ? ', ' . implode(', ', array_slice($included, 0, -1)) . (count($included) > 1 ? ' and ' : '') . end($included) : '') . '.'; $pdf->SetY(150); $pdf->SetFont('dejavusans', '', 9); diff --git a/functions/client_overview.php b/functions/client_overview.php index 993b19697..482db4c5a 100644 --- a/functions/client_overview.php +++ b/functions/client_overview.php @@ -694,7 +694,7 @@ function clientOverviewMonthly($client_id) { return [ 'labels' => array_map(function ($m) { - return date('M y', strtotime("$m-01")); + return date('M Y', strtotime("$m-01")); }, $months), 'invoiced' => array_map(function ($v) { return round($v, 2); diff --git a/functions/contract.php b/functions/contract.php index 6810a2ab7..8364580f7 100644 --- a/functions/contract.php +++ b/functions/contract.php @@ -855,13 +855,13 @@ function contractRemind(array $row) { $what = $renews ? 'renews itself on ' . date('M j, Y', strtotime('+1 day', strtotime($end))) : 'ends on ' . date('M j, Y', strtotime($end)); appNotify("Contract", escapeSql("Contract {$row['contract_name']} for {$row['client_name']} $what" . ($notice_open ? ' - notice by ' . date('M j, Y', strtotime($notice)) : '')), $url, $client_id, intval($row['contract_id'])); if (!empty($row['owner_email'])) { - $passed = $notice !== '' && !$notice_open ? ' Its notice date, ' . date('F j, Y', strtotime($notice)) . ', has passed.' : ''; + $passed = $notice !== '' && !$notice_open ? ' Its notice date, ' . date('M j, Y', strtotime($notice)) . ', has passed.' : ''; emailQueue([['email' => $row['owner_email'], 'name' => $row['owner_name'], 'footnote' => 'You look after this contract in ITFlow.']], "Contract " . ($renews ? 'renewal' : 'ending') . ": {$row['contract_name']} - {$row['client_name']}", [ 'kind' => 'Contract', 'tone' => $renews ? 'primary' : 'warning', 'title' => $row['contract_name'] . ' ' . $what, 'intro' => [$renews - ? "It renews for another " . contractTermLabel($row['contract_term_months']) . ($notice_open ? " unless notice is given by " . date('F j, Y', strtotime($notice)) . ". Now is the time to review it with the client." : ".$passed") - : "It doesn't renew itself. Renew it, or let the client know it is ending" . ($notice_open ? " - notice is due by " . date('F j, Y', strtotime($notice)) . "." : ".$passed")], + ? "It renews for another " . contractTermLabel($row['contract_term_months']) . ($notice_open ? " unless notice is given by " . date('M j, Y', strtotime($notice)) . ". Now is the time to review it with the client." : ".$passed") + : "It doesn't renew itself. Renew it, or let the client know it is ending" . ($notice_open ? " - notice is due by " . date('M j, Y', strtotime($notice)) . "." : ".$passed")], 'summary' => array_filter([ 'Client' => (string) $row['client_name'], 'Type' => contractTypeLabel($row['contract_type']), diff --git a/functions/dashboard.php b/functions/dashboard.php index 538deaf6a..5e20c9728 100644 --- a/functions/dashboard.php +++ b/functions/dashboard.php @@ -978,7 +978,7 @@ function dashboardTrips($period) { return [ 'labels' => array_map(function ($m) { - return date('M y', strtotime("$m-01")); + return date('M Y', strtotime("$m-01")); }, $months), 'miles' => dashboardMonthly("SELECT DATE_FORMAT(trip_date, '%Y-%m') AS m, SUM(trip_miles) AS v FROM trips WHERE trip_archived_at IS NULL AND trip_date BETWEEN '$from' AND '$to' GROUP BY m", $months), diff --git a/functions/dispatch.php b/functions/dispatch.php index ca0a0baa2..9028dfee1 100644 --- a/functions/dispatch.php +++ b/functions/dispatch.php @@ -184,7 +184,7 @@ function dispatchQueue($tab, array $filters = []) { 'agent_name' => (string) $row['user_name'], 'age' => timeAgo($row['ticket_created_at']), 'minutes' => ticketScheduleMinutes($row['ticket_schedule'], $row['ticket_schedule_end']), - 'booked' => $row['ticket_schedule'] ? date('D M j', strtotime(timezoneToView($row['ticket_schedule']))) : '', + 'booked' => $row['ticket_schedule'] ? date('D, M j', strtotime(timezoneToView($row['ticket_schedule']))) : '', ]; } return ['tab' => $tab, 'counts' => $counts, 'tickets' => $tickets]; @@ -332,7 +332,7 @@ function dispatchContactTickets($ticket_id) { 'subject' => (string) $other['ticket_subject'], 'status' => (string) $other['ticket_status_name'], 'agent' => (string) ($other['user_name'] ?? ''), - 'booked' => $other['ticket_schedule'] ? date('D M j', strtotime(timezoneToView($other['ticket_schedule']))) : '', + 'booked' => $other['ticket_schedule'] ? date('D, M j', strtotime(timezoneToView($other['ticket_schedule']))) : '', 'url' => ticketUrl($other['ticket_id'], $other['ticket_client_id']), ]; } diff --git a/functions/email.php b/functions/email.php index 78315bf70..7b10866b2 100644 --- a/functions/email.php +++ b/functions/email.php @@ -519,7 +519,7 @@ function emailTestSend($to, $mailbox) { 'kind' => 'Test', 'tone' => 'success', 'preview' => "A test from $which", 'title' => 'Mail is working', 'intro' => ["This is a test email from ITFlow, sent from $which. If you are reading this, it worked."], - 'summary' => ['From' => trim($box['name'] . ' <' . $box['email'] . '>'), 'To' => trim((string) $to), 'Sent' => date('D j M Y, g:i A')], + 'summary' => ['From' => trim($box['name'] . ' <' . $box['email'] . '>'), 'To' => trim((string) $to), 'Sent' => date('D, M j, Y g:i A')], ], ['from' => ['email' => $box['email'], 'name' => $box['name']]]); } @@ -554,7 +554,7 @@ function emailBulkPost(array $recipients, $picked) { flashAlert('None of them has an email address, so nothing was sent', 'error'); redirect(); } - $later = $queued_at !== '' && strtotime($queued_at) > time() ? ' to go ' . date('M j \a\t g:i A', strtotime($queued_at)) : ''; + $later = $queued_at !== '' && strtotime($queued_at) > time() ? ' to go ' . date('M j, Y g:i A', strtotime($queued_at)) : ''; logAudit("Bulk Mail", "Send", "$session_name sent " . escapeSql($subject) . " to $count " . ($count === 1 ? 'contact' : 'contacts') . " via bulk mail" . ($later !== '' ? escapeSql($later) : '')); $left_out = max(0, intval($picked) - $count); flashAlert("$count email" . ($count === 1 ? '' : 's') . " queued$later" . ($left_out ? " - $left_out left out with no email address, or the same one" : '')); diff --git a/functions/expense_import.php b/functions/expense_import.php index fedc035ec..b5445674f 100644 --- a/functions/expense_import.php +++ b/functions/expense_import.php @@ -32,7 +32,7 @@ function expenseImportDateFormats() { return [ 'm/d/Y' => '10/14/2026', 'm/d/y' => '10/14/26', 'Y-m-d' => '2026-10-14', 'd/m/Y' => '14/10/2026', 'd/m/y' => '14/10/26', 'd.m.Y' => '14.10.2026', 'Y/m/d' => '2026/10/14', 'm-d-Y' => '10-14-2026', 'd-M-Y' => '14-Oct-2026', 'd-M-y' => '14-Oct-26', - 'd M Y' => '14 Oct 2026', 'M d, Y' => 'Oct 14, 2026', 'Ymd' => '20261014', + 'd M Y' => '14 Oct 2026', 'M j, Y' => 'Oct 14, 2026', 'Ymd' => '20261014', ]; } diff --git a/functions/expenses.php b/functions/expenses.php index 54f8a5be9..0cceb2387 100644 --- a/functions/expenses.php +++ b/functions/expenses.php @@ -930,9 +930,9 @@ function recurringExpenseRecord($recurring_expense_id, $by_user_id = 0, $run = n $expense_id = mysqli_insert_id($mysqli); $label = recurringExpenseLabel($row); - logAudit("Expense", "Create", escapeSql("$by recorded $label for $due from the recurring expense"), intval($row['recurring_expense_client_id']), $expense_id); + logAudit("Expense", "Create", escapeSql("$by recorded $label for " . formatDate($due) . " from the recurring expense"), intval($row['recurring_expense_client_id']), $expense_id); if ($ends) { - logAudit("Recurring Expense", "End", escapeSql("$label ended after its last run on $due"), intval($row['recurring_expense_client_id']), $id); + logAudit("Recurring Expense", "End", escapeSql("$label ended after its last run on " . formatDate($due)), intval($row['recurring_expense_client_id']), $id); } return $expense_id; } @@ -1088,7 +1088,7 @@ function expenseBillLine(array $expense) { } $description = implode(' - ', array_filter([ $expense['vendor_name'] ?? '', - date('m/d/Y', strtotime((string) $expense['expense_date'])), + date('M j, Y', strtotime((string) $expense['expense_date'])), trim((string) $expense['expense_reference']) !== '' ? '#' . trim((string) $expense['expense_reference']) : '', ])); $rest = trim(implode("\n", $lines)); diff --git a/functions/export.php b/functions/export.php index 869fa337a..1ba0f9863 100644 --- a/functions/export.php +++ b/functions/export.php @@ -1049,7 +1049,7 @@ function finishExport(&$export) { $html .= '

    ' . escapeHtml($export['subtitle']) . '

    '; } - $html .= '

    ' . $export['rows'] . ' record(s) - generated ' . date('Y-m-d H:i') . '


    + $html .= '

    ' . $export['rows'] . ' record' . ($export['rows'] === 1 ? '' : 's') . ' - generated ' . formatDateTime(time()) . '


    Agent' + esc(d.toLocaleDateString(undefined, {weekday: 'short', month: 'short', day: 'numeric'})) + '' + esc(d.toLocaleDateString('en-US', {weekday: 'short', month: 'short', day: 'numeric'})) + '
    - +
    diff --git a/agent/kb_article.php b/agent/kb_article.php index 09f8e6fe9..cacb86d3e 100644 --- a/agent/kb_article.php +++ b/agent/kb_article.php @@ -95,7 +95,7 @@ $page_title = $row['kb_article_title'];
    - Updated + Updated · Written · earlier version
    @@ -274,7 +274,7 @@ $page_title = $row['kb_article_title']; Archived - Published + Published A draft - not finished @@ -349,7 +349,7 @@ $page_title = $row['kb_article_title'];
    - · + · · dealt with
    @@ -376,8 +376,8 @@ $page_title = $row['kb_article_title']; $version_id = intval($version['kb_article_version_id']); ?>
  • - - + +
    diff --git a/agent/license.php b/agent/license.php index 61ac41d20..704b863ed 100644 --- a/agent/license.php +++ b/agent/license.php @@ -243,7 +243,7 @@ if (!$license || ($client_url && intval($license['software_client_id']) !== intv
    Renews
    - +
    No date @@ -251,13 +251,13 @@ if (!$license || ($client_url && intval($license['software_client_id']) !== intv
    Purchased
    -
    ago
    +
    ago
    Order ref
    -
    Added
    +
    Added
    diff --git a/agent/location.php b/agent/location.php index 814cd944c..09bf61f58 100644 --- a/agent/location.php +++ b/agent/location.php @@ -320,7 +320,7 @@ if (!$location || ($client_url && intval($location['location_client_id']) !== in
    Hours
    Not recorded' ?>
    -
    Added
    +
    Added
    diff --git a/agent/modals/asset/asset.php b/agent/modals/asset/asset.php index 3dae48bf8..38eb9b942 100644 --- a/agent/modals/asset/asset.php +++ b/agent/modals/asset/asset.php @@ -434,7 +434,7 @@ ob_start();
    -
    ·
    +
    ·
  • diff --git a/agent/modals/asset/asset_form.php b/agent/modals/asset/asset_form.php index 66f460218..fd0192a4b 100644 --- a/agent/modals/asset/asset_form.php +++ b/agent/modals/asset/asset_form.php @@ -562,7 +562,7 @@ $asset_form_icons = [ -
    ·
    +
    ·
    diff --git a/agent/modals/certificate/certificate.php b/agent/modals/certificate/certificate.php index 3cde74b68..aefba5058 100644 --- a/agent/modals/certificate/certificate.php +++ b/agent/modals/certificate/certificate.php @@ -108,7 +108,7 @@ ob_start();
    Unknown' ?>(self-signed)' : '' ?>
    Issued
    -
    ()
    +
    ()
    Expires
    (' . timeAgo($expiry['date']) . ')' : 'Unknown' ?>
    @@ -221,7 +221,7 @@ ob_start(); changed - + diff --git a/agent/modals/contact/contact.php b/agent/modals/contact/contact.php index 35befbeb5..9f666b1ea 100644 --- a/agent/modals/contact/contact.php +++ b/agent/modals/contact/contact.php @@ -333,7 +333,7 @@ ob_start();
    -
    ·
    +
    ·
    diff --git a/agent/modals/credential/credential.php b/agent/modals/credential/credential.php index 81bc256fb..a7f16a0a4 100644 --- a/agent/modals/credential/credential.php +++ b/agent/modals/credential/credential.php @@ -89,7 +89,7 @@ ob_start();
    - Last looked at by , + Last looked at by ,
    @@ -189,7 +189,7 @@ ob_start(); $old_to = date('Y-m-d', strtotime($old['password_history_replaced_at'])); ?>
  • - + @@ -214,7 +214,7 @@ ob_start();
  • - +
  • diff --git a/agent/modals/document/document_changes.php b/agent/modals/document/document_changes.php index 57e5b984b..a60a9a99e 100644 --- a/agent/modals/document/document_changes.php +++ b/agent/modals/document/document_changes.php @@ -57,8 +57,8 @@ ob_start();
    - of , - + of , +
    diff --git a/agent/modals/document/document_version_view.php b/agent/modals/document/document_version_view.php index f356ed455..389b6d118 100644 --- a/agent/modals/document/document_version_view.php +++ b/agent/modals/document/document_version_view.php @@ -37,7 +37,7 @@ ob_start();
    - Version of + Version of ·
    diff --git a/agent/modals/domain/domain.php b/agent/modals/domain/domain.php index 6b9abb1a0..3f6f00fbd 100644 --- a/agent/modals/domain/domain.php +++ b/agent/modals/domain/domain.php @@ -221,7 +221,7 @@ ob_start(); changed - + diff --git a/agent/modals/expense/expense.php b/agent/modals/expense/expense.php index 6617da84a..7831fa139 100644 --- a/agent/modals/expense/expense.php +++ b/agent/modals/expense/expense.php @@ -181,7 +181,7 @@ ob_start();
    - by + by
    @@ -235,7 +235,7 @@ ob_start(); back · - $refund) { ?> + $refund) { ?> diff --git a/agent/modals/expense/expense_reimbursement.php b/agent/modals/expense/expense_reimbursement.php index 7b3dd33b2..10844aa2b 100644 --- a/agent/modals/expense/expense_reimbursement.php +++ b/agent/modals/expense/expense_reimbursement.php @@ -55,7 +55,7 @@ ob_start();
    - by + by
    @@ -66,7 +66,7 @@ ob_start(); diff --git a/agent/modals/file/file.php b/agent/modals/file/file.php index 3d53b028f..6ef1d82ab 100644 --- a/agent/modals/file/file.php +++ b/agent/modals/file/file.php @@ -98,7 +98,7 @@ ob_start();
    - by + by
    diff --git a/agent/modals/invoice/invoice_add_expenses.php b/agent/modals/invoice/invoice_add_expenses.php index 0a1161d5b..7ba177cab 100644 --- a/agent/modals/invoice/invoice_add_expenses.php +++ b/agent/modals/invoice/invoice_add_expenses.php @@ -54,7 +54,7 @@ ob_start(); diff --git a/agent/modals/invoice/invoice_add_ticket.php b/agent/modals/invoice/invoice_add_ticket.php index b3cb8988d..da919c3c5 100644 --- a/agent/modals/invoice/invoice_add_ticket.php +++ b/agent/modals/invoice/invoice_add_ticket.php @@ -55,7 +55,7 @@ ob_start(); No time logged' ?> - · done + · done 0 ? '· less ' . escapeHtml(contractHoursText($ticket['prepaid'])) . ' prepaid' : '' ?> · ' : '' ?>/hr diff --git a/agent/modals/invoice/invoice_add_trips.php b/agent/modals/invoice/invoice_add_trips.php index 8b9584431..04fe0434e 100644 --- a/agent/modals/invoice/invoice_add_trips.php +++ b/agent/modals/invoice/invoice_add_trips.php @@ -54,7 +54,7 @@ ob_start();
    diff --git a/agent/modals/invoice/invoice_assets.php b/agent/modals/invoice/invoice_assets.php index 86d72b86f..8f2bc0bbb 100644 --- a/agent/modals/invoice/invoice_assets.php +++ b/agent/modals/invoice/invoice_assets.php @@ -74,7 +74,7 @@ ob_start();
    0 ? $doc_state['balance'] : $doc['invoice_amount'], $doc['invoice_currency_code'])) ?>
    -
    0 ? 'due ' . escapeHtml($doc['invoice_due']) : 'total' ?>
    +
    0 ? 'due ' . formatDate($doc['invoice_due']) : 'total' ?>
    diff --git a/agent/modals/invoice/invoice_payments.php b/agent/modals/invoice/invoice_payments.php index 41bb47b5e..cc015e7a8 100644 --- a/agent/modals/invoice/invoice_payments.php +++ b/agent/modals/invoice/invoice_payments.php @@ -56,7 +56,7 @@ ob_start();
    -
    +
    diff --git a/agent/modals/invoice/invoice_recurring_add.php b/agent/modals/invoice/invoice_recurring_add.php index 5bc245b44..794deadc7 100644 --- a/agent/modals/invoice/invoice_recurring_add.php +++ b/agent/modals/invoice/invoice_recurring_add.php @@ -34,7 +34,7 @@ ob_start();
    -
    Dated , due
    +
    Dated , due
    - from a bank statement + from a bank statement
    diff --git a/agent/modals/payment/payment_add.php b/agent/modals/payment/payment_add.php index 5b541ab78..bfce23cb5 100644 --- a/agent/modals/payment/payment_add.php +++ b/agent/modals/payment/payment_add.php @@ -68,7 +68,7 @@ ob_start();
    -
    Due ' . escapeHtml($invoice['invoice_due']) . '' ?>
    +
    Due ' . formatDate($invoice['invoice_due']) . '' ?>
    diff --git a/agent/modals/project/project.php b/agent/modals/project/project.php index 3522acd04..5d8fb20b6 100644 --- a/agent/modals/project/project.php +++ b/agent/modals/project/project.php @@ -75,11 +75,11 @@ ob_start(); -
    Start
    +
    Start
    -
    Due
    -' ?>
    +
    Due
    -' ?>
    -
    Completed
    +
    Completed
    diff --git a/agent/modals/quote/quote_email.php b/agent/modals/quote/quote_email.php index 5899da0e2..35a11a7e9 100644 --- a/agent/modals/quote/quote_email.php +++ b/agent/modals/quote/quote_email.php @@ -82,7 +82,7 @@ ob_start();
    -
    valid until
    +
    valid until
    diff --git a/agent/modals/recurring_expense/recurring_expense.php b/agent/modals/recurring_expense/recurring_expense.php index eaca8d797..a745c5d11 100644 --- a/agent/modals/recurring_expense/recurring_expense.php +++ b/agent/modals/recurring_expense/recurring_expense.php @@ -157,7 +157,7 @@ ob_start();
    - + diff --git a/agent/modals/revenue/revenue.php b/agent/modals/revenue/revenue.php index e3b2402f3..ba26bab05 100644 --- a/agent/modals/revenue/revenue.php +++ b/agent/modals/revenue/revenue.php @@ -77,7 +77,7 @@ ob_start();
    - by from a bank statement + by from a bank statement
    diff --git a/agent/modals/revenue/revenue_edit.php b/agent/modals/revenue/revenue_edit.php index 3878d2c45..0fff065c5 100644 --- a/agent/modals/revenue/revenue_edit.php +++ b/agent/modals/revenue/revenue_edit.php @@ -16,7 +16,7 @@ ob_start(); ?>
    diff --git a/agent/modals/share/share.php b/agent/modals/share/share.php index a2bdb2552..10b6d9b6b 100644 --- a/agent/modals/share/share.php +++ b/agent/modals/share/share.php @@ -199,7 +199,7 @@ ob_start(); - + diff --git a/agent/modals/ticket/ticket.php b/agent/modals/ticket/ticket.php index 9048a8ea2..9ef39f55e 100644 --- a/agent/modals/ticket/ticket.php +++ b/agent/modals/ticket/ticket.php @@ -238,7 +238,7 @@ ob_start();
    'Client', 'Public' => 'Public', 'Internal' => 'Internal note'][$type] ?? escapeHtml($type) ?> - +
    purify($reply['ticket_reply']) ?>
    diff --git a/agent/modals/ticket/ticket_quote_add.php b/agent/modals/ticket/ticket_quote_add.php index 2babd73b0..68a0c953a 100644 --- a/agent/modals/ticket/ticket_quote_add.php +++ b/agent/modals/ticket/ticket_quote_add.php @@ -46,16 +46,16 @@ $ticket_onsite = intval($row['ticket_onsite']); $ticket_created_at = escapeHtml($row['ticket_created_at']); $ticket_created_by = intval($row['ticket_created_by']); -$ticket_date = date('Y-m-d g:i A', strtotime($ticket_created_at)); +$ticket_date = date('M j, Y g:i A', strtotime($ticket_created_at)); $ticket_first_response_at = escapeHtml($row['ticket_first_response_at']); if ($ticket_first_response_at) { - $ticket_first_response_date_time = date('Y-m-d g:i A', strtotime($ticket_first_response_at)); + $ticket_first_response_date_time = date('M j, Y g:i A', strtotime($ticket_first_response_at)); } else { $ticket_first_response_date_time = ''; } $ticket_resolved_at = escapeHtml($row['ticket_resolved_at']); if ($ticket_resolved_at) { - $ticket_resolved_date = date('Y-m-d g:i A', strtotime($ticket_resolved_at)); + $ticket_resolved_date = date('M j, Y g:i A', strtotime($ticket_resolved_at)); } else { $ticket_resolved_date = ''; } diff --git a/agent/modals/transfer/transfer.php b/agent/modals/transfer/transfer.php index f8bc7a4e2..3e1013854 100644 --- a/agent/modals/transfer/transfer.php +++ b/agent/modals/transfer/transfer.php @@ -76,7 +76,7 @@ ob_start();
    - by from a bank statement + by from a bank statement
    diff --git a/agent/modals/transfer/transfer_edit.php b/agent/modals/transfer/transfer_edit.php index 99cfee9af..d0e064b51 100644 --- a/agent/modals/transfer/transfer_edit.php +++ b/agent/modals/transfer/transfer_edit.php @@ -20,7 +20,7 @@ ob_start(); ?> diff --git a/agent/modals/trip/trip.php b/agent/modals/trip/trip.php index 088f8234a..435c5c430 100644 --- a/agent/modals/trip/trip.php +++ b/agent/modals/trip/trip.php @@ -120,7 +120,7 @@ ob_start();
    - by + by
    diff --git a/agent/modals/trip/trip_edit.php b/agent/modals/trip/trip_edit.php index 63da65a20..b42a4a9e7 100644 --- a/agent/modals/trip/trip_edit.php +++ b/agent/modals/trip/trip_edit.php @@ -22,7 +22,7 @@ ob_start(); ?> diff --git a/agent/modals/vendor/vendor.php b/agent/modals/vendor/vendor.php index 7f6c89993..a9e5d8c4f 100644 --- a/agent/modals/vendor/vendor.php +++ b/agent/modals/vendor/vendor.php @@ -233,7 +233,7 @@ ob_start(); diff --git a/agent/network.php b/agent/network.php index 999b72e69..e91967d6e 100644 --- a/agent/network.php +++ b/agent/network.php @@ -294,9 +294,9 @@ if (!$network || ($client_url && intval($network['network_client_id']) !== intva
    -
    Added
    +
    Added
    -
    Updated
    +
    Updated
    diff --git a/agent/post/account.php b/agent/post/account.php index 9ea4f4911..af74ad0e9 100644 --- a/agent/post/account.php +++ b/agent/post/account.php @@ -79,6 +79,7 @@ if (isset($_GET['archive_account'])) { enforceUserPermission('module_financial', 2); + $undo = undoArchivedBefore('accounts', 'account_id', [intval($_GET['archive_account'])]); // for Undo on the message $row = accountArchive(intval($_GET['archive_account']), $error); if (!$row) { flashAlert(escapeHtml($error), 'error'); @@ -88,6 +89,7 @@ if (isset($_GET['archive_account'])) { logAudit("Account", "Archive", "$session_name archived account " . escapeSql($row['account_name']), 0, intval($row['account_id'])); flashAlert("Account " . escapeHtml($row['account_name']) . " archived", 'error'); + undoOfferArchived($undo, 'Account', $row['account_name'], [], 's', 'module_financial', 2); redirect(); diff --git a/agent/post/asset.php b/agent/post/asset.php index 373f1ae23..ee924a62b 100644 --- a/agent/post/asset.php +++ b/agent/post/asset.php @@ -316,7 +316,7 @@ if (isset($_POST['add_asset_note'])) { //Logging logAudit("Asset", "Edit", "$session_name created a $type note for asset $asset_name", $client_id, $asset_id); - $_SESSION['alert_message'] = "Note $type created for $asset_name"; + flashAlert("Note " . escapeHtml(stripslashes($type)) . " created for " . escapeHtml($row['asset_name']) . ""); redirect(); @@ -750,7 +750,7 @@ if (isset($_POST['bulk_favorite_assets'])) { logAudit("Asset", "Bulk Edit", "$session_name favorited $count assets", $client_id); - flashAlert("Favorited $count asset(s)"); + flashAlert("Favorited $count asset" . ($count === 1 ? '' : 's')); } @@ -788,7 +788,7 @@ if (isset($_POST['bulk_unfavorite_assets'])) { logAudit("Asset", "Bulk Edit", "$session_name unfavorited $count assets", $client_id); - flashAlert("Unfavorited $count asset(s)"); + flashAlert("Unfavorited $count asset" . ($count === 1 ? '' : 's')); } @@ -830,7 +830,7 @@ if (isset($_POST['bulk_archive_assets'])) { logAudit("Asset", "Bulk Archive", "$session_name archived $count assets", $client_id); - flashAlert("Archived $count asset(s)", 'error'); + flashAlert("Archived $count asset" . ($count === 1 ? '' : 's'), 'error'); undoOfferArchive($undo); } @@ -873,7 +873,7 @@ if (isset($_POST['bulk_restore_assets'])) { logAudit("Asset", "Bulk Restore", "$session_name restored $count assets"); - flashAlert("Restored $count asset(s)"); + flashAlert("Restored $count asset" . ($count === 1 ? '' : 's')); } @@ -912,7 +912,7 @@ if (isset($_POST['bulk_delete_assets'])) { logAudit("Asset", "Bulk Delete", "$session_name deleted $count assets"); - flashAlert("Deleted $count asset(s)", 'error'); + flashAlert("Deleted $count asset" . ($count === 1 ? '' : 's'), 'error'); } redirect(); diff --git a/agent/post/billing.php b/agent/post/billing.php index ee510b267..06788828e 100644 --- a/agent/post/billing.php +++ b/agent/post/billing.php @@ -447,9 +447,9 @@ if (isset($_GET['recurring_invoice_catch_up'])) { } mysqli_query($mysqli, "UPDATE recurring_invoices SET recurring_invoice_next_date = '" . escapeSql($next) . "' WHERE recurring_invoice_id = $recurring_invoice_id"); billingLog('recurring', $recurring_invoice_id, 'Rescheduled', "Next date moved from {$row['recurring_invoice_next_date']} to $next by $session_name"); - logAudit('Recurring Invoice', 'Edit', escapeSql("$session_name moved recurring invoice $number on to $next"), $client_id, $recurring_invoice_id); + logAudit('Recurring Invoice', 'Edit', escapeSql("$session_name moved recurring invoice $number on to " . formatDate($next)), $client_id, $recurring_invoice_id); - flashAlert("" . escapeHtml($number) . " next runs on " . escapeHtml($next)); + flashAlert("" . escapeHtml($number) . " next runs on " . formatDate($next)); redirect(); diff --git a/agent/post/client.php b/agent/post/client.php index 15952c3e1..f4e4741ed 100644 --- a/agent/post/client.php +++ b/agent/post/client.php @@ -920,7 +920,7 @@ if (isset($_POST['bulk_archive_clients'])) { logAudit("Client", "Bulk Archive", "$session_name archived $count clients", $client_id); - flashAlert("Archived $count client(s)", 'error'); + flashAlert("Archived $count client" . ($count === 1 ? '' : 's'), 'error'); if (empty($undo_withdrawn)) { undoOfferArchive($undo); // a signing request withdrawn can't be put back } @@ -962,7 +962,7 @@ if (isset($_POST['bulk_unarchive_clients'])) { logAudit("Client", "Bulk Restore", "$session_name restored $count client(s)", $client_id); - flashAlert("You restored $count client(s)"); + flashAlert("Restored $count client" . ($count === 1 ? '' : 's')); } diff --git a/agent/post/contact.php b/agent/post/contact.php index a5fc6350c..efb4171ab 100644 --- a/agent/post/contact.php +++ b/agent/post/contact.php @@ -248,7 +248,7 @@ if (isset($_POST['add_contact_note'])) { //Logging logAudit("Contact", "Edit", "$session_name created a $type note for contact $contact_name", $client_id, $contact_id); - $_SESSION['alert_message'] = "Note $type created for $contact_name"; + flashAlert("Note " . escapeHtml(stripslashes($type)) . " created for " . escapeHtml($row['contact_name']) . ""); redirect(); @@ -603,7 +603,7 @@ if (isset($_POST['bulk_archive_contacts'])) { logAudit("Contact", "Bulk Archive", "$session_name archived $count contacts", $client_id); - flashAlert("Archived $count contact(s)", 'error'); + flashAlert("Archived $count contact" . ($count === 1 ? '' : 's'), 'error'); undoOfferArchive($undo); } @@ -649,7 +649,7 @@ if (isset($_POST['bulk_restore_contacts'])) { logAudit("Contact", "Bulk Restore", "$session_name restored $count contacts", $client_id); - flashAlert("Restored $count contact(s)"); + flashAlert("Restored $count contact" . ($count === 1 ? '' : 's')); } @@ -695,7 +695,7 @@ if (isset($_POST['bulk_delete_contacts'])) { logAudit("Contact", "Bulk Delete", "$session_name deleted $count contacts", $client_id); - flashAlert("Deleted $count contact(s)", 'error'); + flashAlert("Deleted $count contact" . ($count === 1 ? '' : 's'), 'error'); } diff --git a/agent/post/document.php b/agent/post/document.php index 5d3bf1b52..6a136084e 100644 --- a/agent/post/document.php +++ b/agent/post/document.php @@ -545,7 +545,7 @@ if (isset($_POST['restore_document_version'])) { document_updated_by = $session_user_id WHERE document_id = $document_id"); - $version_date = date('M j, Y g:ia', strtotime($version['document_version_created_at'])); + $version_date = date('M j, Y g:i A', strtotime($version['document_version_created_at'])); logAudit("Document", "Edit", "$session_name restored document $name to its version of " . escapeSql($version_date) . ", the current one kept", $client_id, $document_id); flashAlert("Document {$version['document_version_name']} restored to the version of $version_date - what it said before is kept as a version"); diff --git a/agent/post/invoice.php b/agent/post/invoice.php index e9eeb11e3..4d177af29 100644 --- a/agent/post/invoice.php +++ b/agent/post/invoice.php @@ -841,7 +841,7 @@ if (isset($_POST['bulk_edit_invoice_category'])) { logAudit("Invoice", "Bulk Edit", "$session_name assigned $count invoices to category $category_name"); - flashAlert("Assigned income category $category_name to $count invoice(s)"); + flashAlert("Assigned income category $category_name to $count invoice" . ($count === 1 ? '' : 's')); undoOfferChanges($undo, "Income category put back on {n} invoice{s}", 'module_sales'); } diff --git a/agent/post/kb.php b/agent/post/kb.php index a96bb835a..dbed1042f 100644 --- a/agent/post/kb.php +++ b/agent/post/kb.php @@ -252,7 +252,7 @@ if (isset($_GET['delete_kb_article_version'])) { mysqli_query($mysqli, "DELETE FROM kb_article_versions WHERE kb_article_version_id = $kb_article_version_id"); - logAudit("Knowledge Base", "Edit", "$session_name deleted the version of " . date('M j, Y g:ia', strtotime($version['kb_article_version_created_at'])) . " of article " . escapeSql($version['kb_article_version_title']), 0, intval($version['kb_article_version_kb_article_id'])); + logAudit("Knowledge Base", "Edit", "$session_name deleted the version of " . date('M j, Y g:i A', strtotime($version['kb_article_version_created_at'])) . " of article " . escapeSql($version['kb_article_version_title']), 0, intval($version['kb_article_version_kb_article_id'])); flashAlert("Version deleted", 'error'); diff --git a/agent/post/network_ip.php b/agent/post/network_ip.php index e45c9e79f..b1960ff5e 100644 --- a/agent/post/network_ip.php +++ b/agent/post/network_ip.php @@ -307,7 +307,7 @@ if (isset($_POST['import_network_ips_csv'])) { logAudit("IP Address", "Import", "$session_name imported $row_count IP(s) to network " . escapeSql($network['network_name']) . ". $skipped_count row(s) skipped", $client_id); - flashAlert("$row_count IP(s) imported, $skipped_count skipped (invalid, outside the subnet or already documented)", $skipped_count ? 'warning' : 'success'); + flashAlert("$row_count IP" . ($row_count === 1 ? '' : 's') . " imported, $skipped_count skipped (invalid, outside the subnet or already documented)", $skipped_count ? 'warning' : 'success'); redirect(); diff --git a/agent/post/product.php b/agent/post/product.php index 668a057da..8ee4e9cbd 100644 --- a/agent/post/product.php +++ b/agent/post/product.php @@ -213,7 +213,7 @@ if (isset($_POST['bulk_edit_product_category'])) { logAudit("Product", "Edit", "$session_name assigned category $category_name to $count product(s)"); - flashAlert("Assigned category " . escapeHtml(stripslashes($category_name)) . " to $count product(s)"); + flashAlert("Assigned category " . escapeHtml(stripslashes($category_name)) . " to $count product" . ($count === 1 ? '' : 's')); undoOfferChanges($undo, "Category put back on {n} product{s}", 'module_sales'); } @@ -246,7 +246,7 @@ if (isset($_POST['bulk_archive_products'])) { logAudit("Product", "Bulk Archive", "$session_name archived $count product(s)"); - flashAlert("Archived $count product(s)", 'error'); + flashAlert("Archived $count product" . ($count === 1 ? '' : 's'), 'error'); undoOfferArchive($undo); } @@ -280,7 +280,7 @@ if (isset($_POST['bulk_restore_products'])) { logAudit("Product", "Bulk Restore", "$session_name restored $count product(s)"); - flashAlert("Restored $count product(s)"); + flashAlert("Restored $count product" . ($count === 1 ? '' : 's')); } @@ -312,7 +312,7 @@ if (isset($_POST['bulk_delete_products'])) { logAudit("Product", "Bulk Delete", "$session_name deleted $count product(s)"); - flashAlert("Deleted $count product(s)", 'error'); + flashAlert("Deleted $count product" . ($count === 1 ? '' : 's'), 'error'); } diff --git a/agent/post/project.php b/agent/post/project.php index 185463230..a79f0bcb6 100644 --- a/agent/post/project.php +++ b/agent/post/project.php @@ -411,7 +411,7 @@ if (isset($_POST['bulk_edit_project_due'])) { continue; } mysqli_query($mysqli, "UPDATE projects SET project_due = $due WHERE project_id = " . intval($row['project_id'])); - logAudit("Project", "Edit", "$session_name set the due date of project " . escapeSql(projectReference($row) . ' - ' . $row['project_name']) . " to " . ($due === 'NULL' ? 'none' : trim($due, "'")), intval($row['project_client_id']), intval($row['project_id'])); + logAudit("Project", "Edit", "$session_name set the due date of project " . escapeSql(projectReference($row) . ' - ' . $row['project_name']) . " to " . ($due === 'NULL' ? 'none' : formatDate(trim($due, "'"))), intval($row['project_client_id']), intval($row['project_id'])); $done++; } diff --git a/agent/post/recurring_expense.php b/agent/post/recurring_expense.php index 7a13cca5b..ba8b7753c 100644 --- a/agent/post/recurring_expense.php +++ b/agent/post/recurring_expense.php @@ -158,7 +158,7 @@ if (isset($_GET['recurring_expense_catch_up'])) { mysqli_query($mysqli, "UPDATE recurring_expenses SET recurring_expense_next_date = '$next'" . ($ends ? ', recurring_expense_status = 0' : '') . " WHERE recurring_expense_id = $recurring_expense_id AND recurring_expense_next_date = '" . escapeSql($from) . "'"); - logAudit("Recurring Expense", "Move On", "$session_name moved the recurring expense " . escapeSql(recurringExpenseLabel($row)) . " on from $from to $next without recording the missed runs", intval($row['recurring_expense_client_id']), $recurring_expense_id); + logAudit("Recurring Expense", "Move On", "$session_name moved the recurring expense " . escapeSql(recurringExpenseLabel($row)) . " on from " . formatDate($from) . " to " . formatDate($next) . " without recording the missed runs", intval($row['recurring_expense_client_id']), $recurring_expense_id); flashAlert("" . escapeHtml(recurringExpenseLabel($row)) . " moved on to " . escapeHtml(date('M j, Y', strtotime($next))) . ($ends ? ' - past its end date, so it has ended' : '')); diff --git a/agent/post/software.php b/agent/post/software.php index d444f2184..ae690d9d7 100644 --- a/agent/post/software.php +++ b/agent/post/software.php @@ -216,9 +216,9 @@ if (isset($_POST['renew_software'])) { mysqli_query($mysqli, "UPDATE software SET software_expire = '$until' $reference_sql WHERE software_id = $software_id"); - $was = $row['software_expire'] ?: 'no date'; - logAudit("Software", "Renew", "$session_name renewed license " . escapeSql($row['software_name']) . " until $until (was $was)" . ($reference !== '' ? ', reference ' . escapeSql($reference) : ''), $client_id, $software_id); - $renewed[] = [$row['software_name'], $until]; + $was = formatDate($row['software_expire']) ?: 'no date'; + logAudit("Software", "Renew", "$session_name renewed license " . escapeSql($row['software_name']) . " until " . formatDate($until) . " (was $was)" . ($reference !== '' ? ', reference ' . escapeSql($reference) : ''), $client_id, $software_id); + $renewed[] = [$row['software_name'], formatDate($until)]; } if (count($renewed) === 1) { diff --git a/agent/post/ticket.php b/agent/post/ticket.php index bf4a90699..6d28675c7 100644 --- a/agent/post/ticket.php +++ b/agent/post/ticket.php @@ -1430,11 +1430,13 @@ if (isset($_GET['archive_ticket_reply'])) { [$reply, $row] = ticketReplyForRequest($_GET['archive_ticket_reply'], 2); $ticket_reply_id = intval($reply['ticket_reply_id']); + $undo = undoArchivedBefore('ticket_replies', 'ticket_reply_id', [$ticket_reply_id]); // for Undo on the message mysqli_query($mysqli, "UPDATE ticket_replies SET ticket_reply_archived_at = NOW() WHERE ticket_reply_id = $ticket_reply_id"); logAudit("Ticket Reply", "Archive", "$session_name archived a reply on ticket " . escapeSql(ticketReference($row)), $client_id, $ticket_reply_id); flashAlert("Ticket reply archived", 'error'); + undoOfferArchived($undo, 'repl', '', [], 'y|ies', 'module_support', 2); redirect(); diff --git a/agent/product.php b/agent/product.php index 3ebf0392e..cc66181d4 100644 --- a/agent/product.php +++ b/agent/product.php @@ -118,7 +118,7 @@ if (!$product) {

    - Archived + Archived

    @@ -299,7 +299,7 @@ if (!$product) { Not set -
    Added
    +
    Added
    @@ -433,7 +433,7 @@ if (!$product) {
    a ' . escapeHtml(recurringInvoicePeriodWord($row['frequency'])) . '' : '' ?>
    -
    +
    - +
    → diff --git a/agent/project.php b/agent/project.php index 6abde4acd..13fe80f3e 100644 --- a/agent/project.php +++ b/agent/project.php @@ -540,7 +540,7 @@ echo agentBannersHtml($project_client_id); - + @@ -665,7 +665,7 @@ echo agentBannersHtml($project_client_id); - + @@ -728,11 +728,11 @@ echo agentBannersHtml($project_client_id);
    Manager
    -
    Start
    +
    Start
    -
    Due
    -' ?>
    +
    Due
    -' ?>
    Budget
    0 ? projectHoursText($budget_hours * 3600) : '-' ?>
    -
    Created
    +
    Created
    Completed
    diff --git a/agent/purchase_order.php b/agent/purchase_order.php index 10fc4ceb7..f206545b9 100644 --- a/agent/purchase_order.php +++ b/agent/purchase_order.php @@ -86,7 +86,7 @@ if (!$po || !poAccessible($po['po_id'])) {
    - Made + Made Approved by @@ -257,7 +257,7 @@ if (!$po || !poAccessible($po['po_id'])) {
    x
    - + · diff --git a/agent/quote.php b/agent/quote.php index ae7c68325..2c83afb9f 100644 --- a/agent/quote.php +++ b/agent/quote.php @@ -114,7 +114,7 @@ echo agentBannersHtml($client_id); For - Created + Created
    @@ -220,7 +220,7 @@ echo agentBannersHtml($client_id);
    - It ran out on without an answer - the client can still see it but can't accept it. + It ran out on without an answer - the client can still see it but can't accept it.
    @@ -259,10 +259,10 @@ echo agentBannersHtml($client_id);
    Status
    -
    Dated
    +
    Dated
    Valid until
    - +
    @@ -317,7 +317,7 @@ echo agentBannersHtml($client_id);
    -
    ·
    +
    ·
    diff --git a/agent/quotes.php b/agent/quotes.php index 2a2dbf0f1..706e39736 100644 --- a/agent/quotes.php +++ b/agent/quotes.php @@ -258,9 +258,9 @@ $stat_monthly = function ($amount) use ($stat_money) {
    - +
    diff --git a/agent/rack.php b/agent/rack.php index 4ecb72394..b38f56d44 100644 --- a/agent/rack.php +++ b/agent/rack.php @@ -145,7 +145,7 @@ if (mysqli_num_rows($sql) == 0) { diff --git a/agent/racks.php b/agent/racks.php index 09148ec80..eef434afd 100644 --- a/agent/racks.php +++ b/agent/racks.php @@ -269,7 +269,7 @@ foreach ($racks as $rack_id => $row) { - + Restore diff --git a/agent/reconcile.php b/agent/reconcile.php index 987509b22..e8d08d586 100644 --- a/agent/reconcile.php +++ b/agent/reconcile.php @@ -356,7 +356,7 @@ $gap_notice = function () use ($opening, $opening_totals, $opening_gap, $account aria-label="Cleared">
    -
    @@ -507,7 +507,7 @@ $gap_notice = function () use ($opening, $opening_totals, $opening_gap, $account
    -
    +
    diff --git a/agent/recurring_expenses.php b/agent/recurring_expenses.php index 3ed83f757..c04a53552 100644 --- a/agent/recurring_expenses.php +++ b/agent/recurring_expenses.php @@ -260,7 +260,7 @@ $any_filter = $q || $vendor_filter || $category_filter || $client_filter;
    -
    Ends
    +
    Ends
    diff --git a/agent/recurring_invoice.php b/agent/recurring_invoice.php index 243cf2c24..e0d45f972 100644 --- a/agent/recurring_invoice.php +++ b/agent/recurring_invoice.php @@ -125,7 +125,7 @@ echo agentBannersHtml($client_id);

    Recurring Invoice - +

    @@ -203,9 +203,9 @@ echo agentBannersHtml($client_id);
    - Its run on was missed - the next nightly run bills it. Invoice Now bills it straight away. + Its run on was missed - the next nightly run bills it. Invoice Now bills it straight away. - Its next date, , is days gone - too far behind to bill by itself. Use Invoice Now for each run it missed, or move it on without billing them. + Its next date, , is days gone - too far behind to bill by itself. Use Invoice Now for each run it missed, or move it on without billing them. Next
    - +
    For
    1 && !$late) { ?> -
    then
    +
    then
    -
    Last
    Not yet' ?>
    +
    Last
    Not yet' ?>
    Margin
    @@ -278,7 +278,7 @@ echo agentBannersHtml($client_id); Made as a draft
    Emailing is off for this one
    -
    Since
    +
    Since
    @@ -399,7 +399,7 @@ echo agentBannersHtml($client_id); $made_state = invoiceState($made, $made['paid']); ?>
    -
    +
    @@ -407,7 +407,7 @@ echo agentBannersHtml($client_id);
    -
    None yet.
    +
    None yet.
    diff --git a/agent/recurring_invoices.php b/agent/recurring_invoices.php index de2040495..cc17d40e5 100644 --- a/agent/recurring_invoices.php +++ b/agent/recurring_invoices.php @@ -303,10 +303,10 @@ $stat_money = function ($amount) use ($session_company_currency) {
    - +
    Not yet' ?>Not yet' ?> -
    +
    -
    +
    None yet diff --git a/agent/reports/asset_lifecycle.php b/agent/reports/asset_lifecycle.php index 35c93ae75..1a549c356 100644 --- a/agent/reports/asset_lifecycle.php +++ b/agent/reports/asset_lifecycle.php @@ -129,7 +129,7 @@ $candidate_columns = [ return $row['age_days'] === null ? '' : number_format($row['age_days'] / 365.25, 1, '.', ''); }, 'html' => function ($row) { return $row['age_days'] === null ? '–' - : '' . reportYears($row['age_days']) . ''; + : '' . reportYears($row['age_days']) . ''; }], 'warranty' => ['label' => 'Warranty', 'sort' => false, 'csv' => function ($row) { return $row['warranty'] ? $row['warranty']['date'] : ''; }, 'csv_label' => 'Warranty ends', 'html' => function ($row) use ($warranty_pill) { return $warranty_pill($row['warranty']); }], diff --git a/agent/reports/audit_activity.php b/agent/reports/audit_activity.php index 55ef3cf76..418710d7f 100644 --- a/agent/reports/audit_activity.php +++ b/agent/reports/audit_activity.php @@ -377,7 +377,7 @@ if ($admin) { - +
    diff --git a/agent/reports/credential_rotation.php b/agent/reports/credential_rotation.php index 7233d80e6..28f474e62 100644 --- a/agent/reports/credential_rotation.php +++ b/agent/reports/credential_rotation.php @@ -100,14 +100,14 @@ $credential_columns = [ if (!$row['age']) { return 'Never recorded'; } - return credentialAgePill($row['age']) . '
    ' . escapeHtml($row['age']['date']) . '
    '; + return credentialAgePill($row['age']) . '
    ' . formatDate($row['age']['date']) . '
    '; }], 'credential_password_changed_at' => ['label' => 'Changed on', 'type' => 'date', 'screen' => false], 'has_otp' => ['label' => '2FA', 'sort' => false, 'csv' => function ($row) { return $row['has_otp'] ? 'Yes' : 'No'; }, 'html' => function ($row) { return $row['has_otp'] ? 'Yes' : '–'; }], 'credential_accessed_at' => ['label' => 'Last opened', 'type' => 'date', 'html' => function ($row) { - return $row['credential_accessed_at'] ? '' . escapeHtml(timeAgo($row['credential_accessed_at'])) . '' + return $row['credential_accessed_at'] ? '' . escapeHtml(timeAgo($row['credential_accessed_at'])) . '' : '–'; }], ]; diff --git a/agent/reports/inventory.php b/agent/reports/inventory.php index 05c596485..1a4d7af9e 100644 --- a/agent/reports/inventory.php +++ b/agent/reports/inventory.php @@ -118,7 +118,7 @@ $product_columns = [ ]; $move_columns = [ 'stock_created_at' => ['label' => 'When', 'type' => 'date', 'class' => 'small text-nowrap', 'html' => function ($row) { - return '' . escapeHtml(date('M j, Y', strtotime($row['stock_created_at']))) . ''; + return '' . escapeHtml(date('M j, Y', strtotime($row['stock_created_at']))) . ''; }], 'product_name' => ['label' => 'Product', 'html' => function ($row) { return '' . escapeHtml($row['product_name']) . ''; diff --git a/agent/reports/profit_loss.php b/agent/reports/profit_loss.php index 972d04fe3..8c656d615 100644 --- a/agent/reports/profit_loss.php +++ b/agent/reports/profit_loss.php @@ -149,7 +149,7 @@ $span = count($columns) + 4; 'year' => [$year, $years], 'controls' => reportSegmentControl('view', $view, ['month' => 'Monthly', 'quarter' => 'Quarterly']), 'subtitle' => $current_year ? "$year to date" : (string) $year, - 'print_meta' => $current_year ? "January 1 to " . date('F j, Y') : "Year $year", + 'print_meta' => $current_year ? "Jan 1 to " . date('M j, Y') : "Year $year", ]); ?>
    -
    This tax year runs to - the figures are the year so far. Pick the year before for the one to file.
    +
    This tax year runs to - the figures are the year so far. Pick the year before for the one to file.
    diff --git a/agent/reports/ticket_aging.php b/agent/reports/ticket_aging.php index d9394f1d9..0e08df40b 100644 --- a/agent/reports/ticket_aging.php +++ b/agent/reports/ticket_aging.php @@ -123,7 +123,7 @@ $ticket_columns = [ 'age_days' => ['label' => 'Open for', 'type' => 'decimal', 'decimals' => 1, 'csv_label' => 'Days open', 'html' => function ($row) { $days = $row['age_days']; $tone = $days > 30 ? 'text-danger-emphasis fw-semibold' : ($days > 7 ? 'text-warning-emphasis fw-semibold' : ''); - return '' . reportDuration($row['age_seconds']) . ''; + return '' . reportDuration($row['age_seconds']) . ''; }], 'last_activity' => ['label' => 'Last activity', 'type' => 'date', 'csv' => function ($row) { return $row['last_activity']; }, 'html' => function ($row) { return '' . escapeHtml(timeAgo($row['last_activity'])) . ''; diff --git a/agent/service.php b/agent/service.php index f2e8da134..3f30d7062 100644 --- a/agent/service.php +++ b/agent/service.php @@ -295,9 +295,9 @@ if (!$service || ($client_url && intval($service['service_client_id']) !== intva
    -
    Added
    +
    Added
    -
    Updated
    +
    Updated
    diff --git a/agent/shares.php b/agent/shares.php index 94088321b..95c751d3d 100644 --- a/agent/shares.php +++ b/agent/shares.php @@ -313,10 +313,10 @@ $filter_url = function ($changes) {
    -
    +
    +
    @@ -327,7 +327,7 @@ $filter_url = function ($changes) {
    -
    Last
    +
    Last
    -
    +
    diff --git a/agent/ticket.php b/agent/ticket.php index f5ca8b9e4..89bb5bf9b 100644 --- a/agent/ticket.php +++ b/agent/ticket.php @@ -568,7 +568,7 @@ if (isset($_GET['ticket_id'])) {
    - ·Updated + ·Updated
    @@ -1169,7 +1169,7 @@ if (isset($_GET['ticket_id'])) { Mentions you -
    +
    (edited)'; } ?> · @@ -1212,10 +1212,7 @@ if (isset($_GET['ticket_id'])) { - + Archive @@ -1410,7 +1407,7 @@ if (isset($_GET['ticket_id'])) {
    " . date('M d, Y • g:i A', strtotime($ticket_due_at)) . ""; + $due_value = "" . date('M j, Y g:i A', strtotime($ticket_due_at)) . ""; ?>
    Due
    @@ -1612,7 +1609,7 @@ if (isset($_GET['ticket_id'])) {
    Same - +
    @@ -1792,7 +1789,7 @@ if (isset($_GET['ticket_id'])) {
    - + @@ -2038,17 +2035,17 @@ if (isset($_GET['ticket_id'])) {
    Created
    -
    +
    First response
    -
    +
    Respond by
    - + " : ""; } ?>
    @@ -2059,7 +2056,7 @@ if (isset($_GET['ticket_id'])) { Paused - + " : ""; } ?> @@ -2072,13 +2069,13 @@ if (isset($_GET['ticket_id'])) {
    Resolved
    -
    +
    Closed
    -
    - +
    +
    -
    +
    diff --git a/agent/ticket_kanban.php b/agent/ticket_kanban.php index 83ab197f3..7d1f201d2 100644 --- a/agent/ticket_kanban.php +++ b/agent/ticket_kanban.php @@ -155,7 +155,7 @@ $tickets_tags = tagsForRecords('ticket', $board_ids);
    - + diff --git a/agent/ticket_list.php b/agent/ticket_list.php index 89e4700d2..843be06e3 100644 --- a/agent/ticket_list.php +++ b/agent/ticket_list.php @@ -175,7 +175,7 @@ $sort_link = function ($column, $label, $class = '') use ($url_query_strings_sor >New from the client:
    - + ') ?> diff --git a/agent/to_order.php b/agent/to_order.php index 117f483db..29fc43fa4 100644 --- a/agent/to_order.php +++ b/agent/to_order.php @@ -230,7 +230,7 @@ $drafts = poReady() ? intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUN
    No cost' ?>
    diff --git a/agent/trips.php b/agent/trips.php index 3894e392c..3e502e513 100644 --- a/agent/trips.php +++ b/agent/trips.php @@ -340,7 +340,7 @@ $add_url = 'modals/trip/trip_add.php' . ($client_page ? "?client_id=$client_id" >>
    diff --git a/agent/unbilled_time.php b/agent/unbilled_time.php index 2260d4d97..eca0565b6 100644 --- a/agent/unbilled_time.php +++ b/agent/unbilled_time.php @@ -217,7 +217,7 @@ $hours_text = function ($hours) {
    -
    +
    @@ -285,7 +285,7 @@ $hours_text = function ($hours) { -
    +
    @@ -398,7 +398,7 @@ $hours_text = function ($hours) { -
    +
    > diff --git a/agent/user/user_activity.php b/agent/user/user_activity.php index a8a268205..be2f97d82 100644 --- a/agent/user/user_activity.php +++ b/agent/user/user_activity.php @@ -150,7 +150,7 @@ $view_empty = [ $from = implode(' · ', array_filter([(string) $row['log_ip'], $device])); ?>
    +
    - -' ?>-' ?>-' ?> @@ -751,7 +751,7 @@ if (!$vendor || (isset($_GET['client_id']) && $vendor_client_id !== intval($clie
    -' ?>
    @@ -787,7 +787,7 @@ if (!$vendor || (isset($_GET['client_id']) && $vendor_client_id !== intval($clie
    'Month', 'quarter' => 'Quarter', 'year' => 'Year'][$recurring_expense['recurring_expense_frequency']] ?? 'Month' ?>
    -' ?>
    diff --git a/api/v1/contracts/renew.php b/api/v1/contracts/renew.php index 4caae417c..9b3888709 100644 --- a/api/v1/contracts/renew.php +++ b/api/v1/contracts/renew.php @@ -27,7 +27,7 @@ if ($contract) { contractHoursSync($contract_id); $return_arr['recurring'] = contractRecurringFollow($contract_id, 'The API'); $update_count = 1; - logAudit("Contract", "Edit", "Renewed contract $contract_label to " . escapeSql($end) . " via API ($api_key_name)", $client_id, $contract_id); + logAudit("Contract", "Edit", "Renewed contract $contract_label to " . formatDate($end) . " via API ($api_key_name)", $client_id, $contract_id); logAudit("API", "Success", "Renewed contract $contract_label via API ($api_key_name)", $client_id); } diff --git a/api/v1/recurring_expenses/move_on.php b/api/v1/recurring_expenses/move_on.php index 8c4f46e47..b99806b29 100644 --- a/api/v1/recurring_expenses/move_on.php +++ b/api/v1/recurring_expenses/move_on.php @@ -32,7 +32,7 @@ if ($re_row) { $return_arr['next_date'] = $next; $label = escapeSql(recurringExpenseLabel($re_row)); - logAudit("Recurring Expense", "Move On", "Moved the recurring expense $label on from $from to $next without recording the missed runs via API ($api_key_name)", intval($re_row['recurring_expense_client_id']), $recurring_expense_id); + logAudit("Recurring Expense", "Move On", "Moved the recurring expense $label on from " . formatDate($from) . " to " . formatDate($next) . " without recording the missed runs via API ($api_key_name)", intval($re_row['recurring_expense_client_id']), $recurring_expense_id); logAudit("API", "Success", "Moved the recurring expense $label on via API ($api_key_name)", intval($re_row['recurring_expense_client_id'])); } diff --git a/api/v1/software/renew.php b/api/v1/software/renew.php index e4f61b7a1..3ab88f47c 100644 --- a/api/v1/software/renew.php +++ b/api/v1/software/renew.php @@ -48,7 +48,7 @@ if ($software) { $return_arr['software_expire'] = $until; $was = $software['software_expire'] ?: 'no date'; - $label = escapeSql($software['software_name']) . " until $until (was " . escapeSql($was) . ")" . ($reference !== '' ? ', reference ' . escapeSql($reference) : ''); + $label = escapeSql($software['software_name']) . " until " . formatDate($until) . " (was " . escapeSql(formatDate($was) ?: $was) . ")" . ($reference !== '' ? ', reference ' . escapeSql($reference) : ''); logAudit("Software", "Renew", "Renewed license $label via API ($api_key_name)", $client_id, $software_id); logAudit("API", "Success", "Renewed license " . escapeSql($software['software_name']) . " via API ($api_key_name)", $client_id); } diff --git a/client/quote.php b/client/quote.php index 6339740f5..e31c4492e 100644 --- a/client/quote.php +++ b/client/quote.php @@ -162,7 +162,7 @@ $paper = [
    - +
    diff --git a/client/receipt.php b/client/receipt.php index 9ff6b3134..36792124e 100644 --- a/client/receipt.php +++ b/client/receipt.php @@ -61,7 +61,7 @@ $currency = $receipt['currency'];
    Received from
    -
    Date
    +
    Date
    Paid by
    Reference
    diff --git a/functions/asset.php b/functions/asset.php index c86a2f13a..6d4eaf39b 100644 --- a/functions/asset.php +++ b/functions/asset.php @@ -141,7 +141,7 @@ function assetWarranty($warranty_expire, $soon_days = 90) { $left = $days === 0 ? 'today' : ($days === 1 ? '1 day left' : "$days days left"); return ['tone' => 'warning', 'short' => $left, 'text' => $days === 0 ? 'Expires today' : "Expires in $days day" . ($days === 1 ? '' : 's'), 'days' => $days, 'date' => $date]; } - return ['tone' => 'success', 'short' => 'Covered', 'text' => "Until $date", 'days' => $days, 'date' => $date]; + return ['tone' => 'success', 'short' => 'Covered', 'text' => 'Until ' . formatDate($date), 'days' => $days, 'date' => $date]; } /** "3 yrs 2 mos" since a date, or '' without one. For purchase / install dates. */ diff --git a/functions/audit_log.php b/functions/audit_log.php index 395ca2762..e6645f90a 100644 --- a/functions/audit_log.php +++ b/functions/audit_log.php @@ -514,7 +514,7 @@ function auditLogHistoryHtml(array $history, array $opts = []) { . '
    ' . '
    ' . escapeHtml(auditLogDescription($row)) . '
    ' . '
    ' . $who['html'] - . '' . escapeHtml(timeAgo($row['log_created_at'])) . '' + . '' . escapeHtml(timeAgo($row['log_created_at'])) . '' . (!empty($session_is_admin) && empty($opts['compact']) && $ip !== '' ? '' . escapeHtml($ip) . '' : '') . '
    '; } diff --git a/functions/billing.php b/functions/billing.php index 7776648c6..c3bbdcaa7 100644 --- a/functions/billing.php +++ b/functions/billing.php @@ -1225,7 +1225,7 @@ function billingUnbilledCount() { /** A ticket's invoice line description - "Ticket TCK-123 - Subject - 10/14/2026". */ function billingTimeDescription(array $ticket) { - return 'Ticket ' . $ticket['ticket_prefix'] . $ticket['ticket_number'] . ' - ' . $ticket['ticket_subject'] . ' - ' . date('m/d/Y', strtotime((string) $ticket['ticket_created_at'])); + return 'Ticket ' . $ticket['ticket_prefix'] . $ticket['ticket_number'] . ' - ' . $ticket['ticket_subject'] . ' - ' . date('M j, Y', strtotime((string) $ticket['ticket_created_at'])); } /** @@ -2110,9 +2110,11 @@ function recurringInvoiceResumePaused() { continue; } $number = billingNumber('recurring', $row); - $moved = $next !== $row['recurring_invoice_next_date'] ? ", next runs on $next (the runs while it was paused skipped)" : ", next runs on $next"; - billingLog('recurring', $id, 'Active', "Resumed by itself, its pause until {$row['recurring_invoice_paused_until']} over$moved"); - logAudit('Recurring Invoice', 'Edit', escapeSql("Cron resumed recurring invoice $number, paused until {$row['recurring_invoice_paused_until']}$moved"), intval($row['recurring_invoice_client_id']), $id); + $next_day = formatDate($next); + $paused_until = formatDate($row['recurring_invoice_paused_until']); + $moved = $next !== $row['recurring_invoice_next_date'] ? ", next runs on $next_day (the runs while it was paused skipped)" : ", next runs on $next_day"; + billingLog('recurring', $id, 'Active', "Resumed by itself, its pause until $paused_until over$moved"); + logAudit('Recurring Invoice', 'Edit', escapeSql("Cron resumed recurring invoice $number, paused until $paused_until$moved"), intval($row['recurring_invoice_client_id']), $id); $resumed++; } return $resumed; @@ -2531,7 +2533,7 @@ function recurringInvoiceGenerate($recurring_invoice_id, $by = 'Cron', $early = $invoice_number = billingNumber('invoice', $invoice); $recurring_number = billingNumber('recurring', $row); billingLog('invoice', $invoice_id, 'Draft', "Made from $recurring_number by $by, for {$period['{period}']}" . ($seat_changes ? ' - seats updated' : '')); - billingLog('recurring', $recurring_invoice_id, 'Invoiced', "$invoice_number made by $by, for {$period['{period}']} - next on $next"); + billingLog('recurring', $recurring_invoice_id, 'Invoiced', "$invoice_number made by $by, for {$period['{period}']} - next on " . formatDate($next)); // Send it, when it sends itself - to the primary and billing contacts, on the billing email (functions/billing_email.php) $sent_to = []; @@ -2613,7 +2615,7 @@ function billingHistoryHtml(array $rows) { $description = trim(preg_replace('/[ \t]+/', ' ', strip_tags((string) $row['history_description']))); $html .= '
  • ' . nl2br(escapeHtml($description)) . '
    ' . '
    ' . escapeHtml($row['history_status']) - . ' · ' . escapeHtml(timeAgo($row['history_created_at'])) . '
  • '; + . ' · ' . escapeHtml(timeAgo($row['history_created_at'])) . '
    '; } return $html . ''; } diff --git a/functions/billing_email.php b/functions/billing_email.php index 1d6c040b5..a5e4875b1 100644 --- a/functions/billing_email.php +++ b/functions/billing_email.php @@ -156,8 +156,7 @@ function billingReminderWhen($days) { /** A date for an email - "Oct 20, 2026". */ function billingEmailDate($date) { - $time = strtotime((string) $date); - return $time ? date('M j, Y', $time) : (string) $date; + return formatDate($date) ?: (string) $date; } /** diff --git a/functions/billing_pdf.php b/functions/billing_pdf.php index 9c193a886..f08731507 100644 --- a/functions/billing_pdf.php +++ b/functions/billing_pdf.php @@ -117,13 +117,13 @@ function billingPdfRender($type, array $row, $variant = 'document') { ]), $packing ? [] : billingTaxRegistrationLines($totals)); $logo = !empty($company['logo_path']) ? '
    ' : ''; if ($packing) { - $dates = ['Invoice' => $number, 'Date' => $row['invoice_date']]; + $dates = ['Invoice' => $number, 'Date' => formatDate($row['invoice_date'])]; } elseif ($type === 'invoice') { - $dates = ['Invoice date' => $row['invoice_date'], 'Due' => $row['invoice_due']]; + $dates = ['Invoice date' => formatDate($row['invoice_date']), 'Due' => formatDate($row['invoice_due'])]; } elseif ($type === 'quote') { - $dates = ['Quote date' => $row['quote_date'], 'Valid until' => $row['quote_expire']]; + $dates = ['Quote date' => formatDate($row['quote_date']), 'Valid until' => formatDate($row['quote_expire'])]; } else { - $dates = ['Billed' => recurringInvoiceFrequencies()[$row['recurring_invoice_frequency']] ?? $row['recurring_invoice_frequency'], 'Next invoice' => $row['recurring_invoice_next_date']]; + $dates = ['Billed' => recurringInvoiceFrequencies()[$row['recurring_invoice_frequency']] ?? $row['recurring_invoice_frequency'], 'Next invoice' => formatDate($row['recurring_invoice_next_date'])]; } $dates_html = ''; foreach ($dates as $date_label => $value) { @@ -159,7 +159,7 @@ function billingPdfRender($type, array $row, $variant = 'document') { } elseif ($type === 'invoice') { $done = in_array($status, ['Paid', 'Cancelled', 'Non-Billable'], true); $amount_html = $label($done ? 'Balance' : 'Amount due') . '
    ' . $money($state['balance']) . '' - . (!$done && $status !== 'Draft' && $state['balance'] > 0 ? '
    by ' . $e($row['invoice_due']) . '' : ''); + . (!$done && $status !== 'Draft' && $state['balance'] > 0 ? '
    by ' . $e(formatDate($row['invoice_due'])) . '' : ''); } elseif ($type === 'quote' && $shown_groups) { $amount_html = ''; foreach (array_values($shown_groups) as $i => $group) { @@ -416,7 +416,7 @@ function billingStatementPdfRender(array $statement) { $company['company_website'] ?? '', ]); $logo = !empty($company['logo_path']) ? '
    ' : ''; - $dates = ['Statement date' => date('Y-m-d'), 'Period' => $statement['from'] !== '' ? $statement['from'] . ' to ' . $statement['to'] : 'Up to ' . $statement['to']]; + $dates = ['Statement date' => formatDate(time()), 'Period' => $statement['from'] !== '' ? formatDate($statement['from']) . ' to ' . formatDate($statement['to']) : 'Up to ' . formatDate($statement['to'])]; $dates_html = ''; foreach ($dates as $date_label => $value) { $dates_html .= '
    ' . $e($date_label) . '' . $e($value) . '
    TOTALPAIDBALANCE
    ' . $e($invoice['invoice_date']) . '
    ' . $e(formatDate($invoice['invoice_date'])) . ' ' . $e(billingNumber('invoice', $invoice)) . '' . (trim((string) $invoice['invoice_scope']) !== '' ? '
    ' . $e($invoice['invoice_scope']) . '' : '') . '
    ' . $e($invoice['invoice_due']) . ($late ? '
    ' . intval($invoice['days']) . ' days late' : '') . '
    ' . $e(formatDate($invoice['invoice_due'])) . ($late ? '
    ' . intval($invoice['days']) . ' days late' : '') . '
    ' . $money($invoice['invoice_amount']) . ' ' . (floatval($invoice['paid']) > 0 ? $money($invoice['paid']) : '-') . ' ' . ($invoice['balance'] > 0 ? $money($invoice['balance']) : 'Paid') . '
    ' . $head . '' . $export['body'] . ' diff --git a/functions/format.php b/functions/format.php index 86b9e38b1..a1ba0484c 100644 --- a/functions/format.php +++ b/functions/format.php @@ -227,6 +227,49 @@ function formatAssignee($user_id, $user_name, $user_avatar, $highlight_unassigne } +/* + * Dates and times the way ITFlow shows them - Nov 13, 2026, 2:30 PM, and + * Nov 13, 2026 2:30 PM - on its pages, windows, PDFs, emails and portals. + * Give them what is stored (2026-11-13, 2026-11-13 14:30:00) or a timestamp; + * nothing, or a zero date, gives ''. The stored form, 2026-11-13, is only for + * date fields, exports and file names. Safe to print as they are. + */ +function formatDate($date) { + $time = formatDateTimestamp($date); + return $time === null ? '' : date('M j, Y', $time); +} + +/* With the time - $seconds for a log, where the second matters. */ +function formatDateTime($datetime, $seconds = false) { + $time = formatDateTimestamp($datetime); + return $time === null ? '' : date($seconds ? 'M j, Y g:i:s A' : 'M j, Y g:i A', $time); +} + +/* The time of day alone - 2:30 PM. */ +function formatTime($datetime) { + $time = formatDateTimestamp($datetime); + return $time === null ? '' : date('g:i A', $time); +} + +/* With the day of the week - Fri, Nov 13, 2026 - for bookings and schedules. */ +function formatDay($date) { + $time = formatDateTimestamp($date); + return $time === null ? '' : date('D, M j, Y', $time); +} + +/* The timestamp behind a stored date or time - null for nothing or a zero date. */ +function formatDateTimestamp($value) { + if (is_int($value)) { + return $value; + } + $value = trim((string) $value); + if ($value === '' || strpos($value, '0000-00-00') === 0) { + return null; + } + $time = strtotime($value); + return $time === false ? null : $time; +} + function timeAgo($datetime) { if (is_null($datetime)) { return "-"; diff --git a/functions/reports.php b/functions/reports.php index d397b9900..3f76e73e5 100644 --- a/functions/reports.php +++ b/functions/reports.php @@ -1823,7 +1823,7 @@ function reportHeatmap(array $counts, $noun = 'ticket') { } $html = '
    '; for ($h = 0; $h < 24; $h++) { - $html .= ''; + $html .= ''; } $html .= ''; for ($d = 1; $d <= 7; $d++) { diff --git a/functions/sign_in.php b/functions/sign_in.php index 8d0d7fc3a..0adc9b8a6 100644 --- a/functions/sign_in.php +++ b/functions/sign_in.php @@ -194,7 +194,7 @@ function signInMailAlert($name, $email, $title, $text, array $summary, $url) { 'kind' => 'Security', 'tone' => 'danger', 'preview' => $text, 'title' => 'Failed sign-ins', 'intro' => [$text], - 'summary' => ['When' => date('D j M Y, g:i A')] + $summary, + 'summary' => ['When' => date('D, M j, Y g:i A')] + $summary, 'callout' => "$app turns an IP address away after " . SIGN_IN_LOCKOUT . " failed sign-ins in " . SIGN_IN_WINDOW_MINUTES . " minutes. If an account is being guessed at, make sure it has a strong password and multi-factor authentication.", 'button' => ['label' => 'See the sign-ins', 'url' => "https://$config_base_url$url"], ]); diff --git a/functions/sms.php b/functions/sms.php index bdfaafcde..81afd7c65 100644 --- a/functions/sms.php +++ b/functions/sms.php @@ -1211,7 +1211,7 @@ function smsLogState(array $row): array $error = trim((string) $row['sms_message_error']); // Waiting for the morning - says when if ($status === 'queued' && !empty($row['sms_message_send_after']) && strtotime($row['sms_message_send_after']) > time() && $error === '') { - $error = 'Waiting until ' . date('g:ia', strtotime($row['sms_message_send_after'])) . ' - it would land at night'; + $error = 'Waiting until ' . date('g:i A', strtotime($row['sms_message_send_after'])) . ' - it would land at night'; } return ['key' => $status, 'label' => $label, 'badge' => $badge, 'icon' => $icon, 'error' => $error]; } @@ -1478,7 +1478,7 @@ function smsTicketSubject(array $row): string function smsWhenText(string $datetime): string { $at = strtotime($datetime); - $time = date('g:ia', $at); + $time = date('g:i A', $at); if (date('Y-m-d', $at) === date('Y-m-d')) { return "today at $time"; } diff --git a/functions/software.php b/functions/software.php index 6a7f5d760..339fd298c 100644 --- a/functions/software.php +++ b/functions/software.php @@ -356,7 +356,7 @@ function softwareHeldTable($rows, $kind, $holder_id, $can_edit) { $key_html = softwareKeyHtml($row['software_key']) . '
    License key
    '; } $renew_html = $renewal - ? escapeHtml($renewal['date']) . '
    ' . escapeHtml($renewal['text']) . '
    ' + ? formatDate($renewal['date']) . '
    ' . escapeHtml($renewal['text']) . '
    ' : '-'; $unlink = $can_edit ? '' diff --git a/functions/ticket.php b/functions/ticket.php index c00c4473b..ed2e45cff 100644 --- a/functions/ticket.php +++ b/functions/ticket.php @@ -434,7 +434,7 @@ function ticketEmailSla($ticket_id) { $callout = "This ticket is marked High priority. If it is holding up your business, calling us on $phone gets you the fastest answer."; } return [ - 'summary' => ['We will respond' => 'within ' . formatSlaMinutes(intval($row['sla_response_minutes'])) . ', by ' . date('D j M, g:i A', strtotime($row['ticket_response_due_at']))], + 'summary' => ['We will respond' => 'within ' . formatSlaMinutes(intval($row['sla_response_minutes'])) . ', by ' . date('D, M j, g:i A', strtotime($row['ticket_response_due_at']))], 'callout' => $callout, ]; } @@ -490,7 +490,7 @@ function ticketEmailHistory(array $row, array $opts = []) { $items[] = [ 'by' => $client ? ((string) $reply['contact_name'] ?: 'Client') : ((string) $reply['user_name'] ?: $company_name), 'org' => $client ? '' : $company_name, - 'when' => date('D j M, g:i A', strtotime($reply['ticket_reply_created_at'])), + 'when' => date('D, M j, g:i A', strtotime($reply['ticket_reply_created_at'])), 'text' => $text, 'client' => $client, ]; @@ -508,7 +508,7 @@ function ticketEmailHistory(array $row, array $opts = []) { $items[] = [ 'by' => $asked_by !== '' ? $asked_by : 'The request', 'action' => $asked_by !== '' ? 'the request' : '', - 'when' => date('D j M, g:i A', strtotime($row['ticket_created_at'])), + 'when' => date('D, M j, g:i A', strtotime($row['ticket_created_at'])), 'text' => $text, 'client' => true, ]; @@ -1039,7 +1039,7 @@ function ticketAgentEmailContent(array $row, $kind, array $opts = []) { } } elseif ($kind === 'sla') { $track = ($opts['track'] ?? 'response') === 'resolution' ? 'resolution' : 'response'; - $due = !empty($opts['due']) ? date('D j M, g:i A', strtotime($opts['due'])) : ''; + $due = !empty($opts['due']) ? date('D, M j, g:i A', strtotime($opts['due'])) : ''; $breached = !empty($opts['breached']); $email['kind'] = ucfirst($track) . ($breached ? ' SLA missed' : ' SLA at risk'); $email['tone'] = $breached ? 'danger' : 'warning'; @@ -2255,7 +2255,7 @@ function recurringTicketAheadText($row) { $bits = []; if (!empty($row['recurring_ticket_schedule_time'])) { $minutes = intval($row['recurring_ticket_schedule_minutes'] ?? 0); - $bits[] = date('g:i a', strtotime('2000-01-01 ' . $row['recurring_ticket_schedule_time'])) . ($minutes && $minutes !== CALENDAR_TICKET_MINUTES ? ' for ' . ticketScheduleLengthText($minutes) : '') + $bits[] = date('g:i A', strtotime('2000-01-01 ' . $row['recurring_ticket_schedule_time'])) . ($minutes && $minutes !== CALENDAR_TICKET_MINUTES ? ' for ' . ticketScheduleLengthText($minutes) : '') . (intval($row['recurring_ticket_schedule_onsite']) ? ' onsite' : ' remote'); } $days = intval($row['recurring_ticket_lead_days'] ?? 0); @@ -2490,7 +2490,7 @@ function ticketScheduleWhenText($start, $end = null) { $end = ticketScheduleEnd($start, $end); $from = strtotime($start); $to = strtotime($end); - return date('l, F j, Y, g:ia', $from) . ' - ' . (date('Y-m-d', $from) === date('Y-m-d', $to) ? date('g:ia', $to) : date('l, F j, Y, g:ia', $to)); + return date('l, F j, Y, g:i A', $from) . ' - ' . (date('Y-m-d', $from) === date('Y-m-d', $to) ? date('g:i A', $to) : date('l, F j, Y, g:i A', $to)); } /** "Oct 20, 2026 · 1:00 PM - 3:00 PM", for the ticket page - on the viewer's own clock, with its zone, when they work away from the company's. */ @@ -2541,12 +2541,12 @@ function ticketScheduleConflicts($user_id, $start, $end, $ticket_id = 0) { // Only when someone is signed in - the nightly job books recurring tickets with nobody's client access to check $hidden = !empty($GLOBALS['session_user_id']) && intval($row['ticket_client_id']) && !hasClientAccess($row['ticket_client_id']); $what = $hidden ? 'Another booking (a client you can\'t see)' : ticketReference($row) . ' - ' . $row['ticket_subject']; - $conflicts[] = $what . ' @ ' . date('g:ia', strtotime($row['ticket_schedule'])) . '-' . date('g:ia', strtotime(ticketScheduleEnd($row['ticket_schedule'], $row['ticket_schedule_end']))); + $conflicts[] = $what . ' @ ' . date('g:i A', strtotime($row['ticket_schedule'])) . '-' . date('g:i A', strtotime(ticketScheduleEnd($row['ticket_schedule'], $row['ticket_schedule_end']))); } if (function_exists('calendarEventItems') && function_exists('calendarList')) { foreach (calendarEventItems(array_keys(calendarList()), $start, $end, ['client_id' => 0, 'user_id' => $user_id]) as $item) { if (empty($item['allDay']) && !empty($item['end']) && $item['end'] > $start && $item['start'] < $end) { - $conflicts[] = $item['title'] . ' @ ' . date('g:ia', strtotime($item['start'])) . '-' . date('g:ia', strtotime($item['end'])); + $conflicts[] = $item['title'] . ' @ ' . date('g:i A', strtotime($item['start'])) . '-' . date('g:i A', strtotime($item['end'])); } } } diff --git a/functions/ticket_helpers.php b/functions/ticket_helpers.php index c8abd59a5..f4b0a63c7 100644 --- a/functions/ticket_helpers.php +++ b/functions/ticket_helpers.php @@ -510,7 +510,7 @@ function ticketHelperConflicts($user_id, $start, $end, $ticket_id = 0) { while ($row = mysqli_fetch_assoc($sql)) { $hidden = !empty($GLOBALS['session_user_id']) && intval($row['ticket_client_id']) && !hasClientAccess($row['ticket_client_id']); $what = $hidden ? 'Another booking (a client you can\'t see)' : ticketReference($row) . ' - ' . $row['ticket_subject']; - $lines[] = "$what (helping) @ " . date('g:ia', strtotime($row['start'])) . '-' . date('g:ia', strtotime(ticketScheduleEnd($row['start'], $row['end']))); + $lines[] = "$what (helping) @ " . date('g:i A', strtotime($row['start'])) . '-' . date('g:i A', strtotime(ticketScheduleEnd($row['start'], $row['end']))); } return $lines; } diff --git a/functions/trips.php b/functions/trips.php index 33eec1e28..b9e10c816 100644 --- a/functions/trips.php +++ b/functions/trips.php @@ -937,7 +937,7 @@ function tripBillLine(array $trip) { $description = trim((string) $trip['trip_purpose']); $detail = implode(' - ', array_filter([ $trip['trip_source'] . ' to ' . $trip['trip_destination'], - date('m/d/Y', strtotime((string) $trip['trip_date'])), + date('M j, Y', strtotime((string) $trip['trip_date'])), tripDistanceText($trip['trip_miles']) . (intval($trip['round_trip']) ? ' round trip' : ''), intval($trip['trip_ticket_id']) && ($trip['ticket_number'] ?? null) !== null ? ticketReference($trip) : '', ])); diff --git a/functions/user.php b/functions/user.php index 63e673989..0f38a0e35 100644 --- a/functions/user.php +++ b/functions/user.php @@ -437,7 +437,7 @@ function userLoginLineHtml($log) { } return '
    ' . '' - . '
    ' . escapeHtml(timeAgo($log['log_created_at'])) . '' + . '
    ' . escapeHtml(timeAgo($log['log_created_at'])) . '' . ($ok ? '' : ' ' . escapeHtml($why) . '') . '
    ' . userDeviceHtml($log['log_user_agent']) . ' · ' . escapeHtml($log['log_ip']) . '
    ' . '
    '; @@ -502,7 +502,7 @@ function userLoginHtml($log, $with_ip = true) { if (!$log) { return 'Never signed in'; } - return '' . escapeHtml(timeAgo($log['log_created_at'])) . '' + return '' . escapeHtml(timeAgo($log['log_created_at'])) . '' . '
    ' . userDeviceHtml($log['log_user_agent']) . ($with_ip ? ' · ' . escapeHtml($log['log_ip']) . '' : '') . '
    '; } @@ -628,7 +628,7 @@ function userMailSignInAlert($name, $email, $kind, $ip, $user_agent) { 'intro' => [$mfa ? "Someone signed in to your $app account with your password, but the multi-factor code was wrong, so they were stopped." : "Someone signed in to your $app account from a device and address it hasn't seen before. If that was you, there is nothing to do."], - 'summary' => ['When' => date('D j M Y, g:i A'), 'Device' => $device !== '' ? $device : 'Unknown device', 'IP address' => (string) $ip], + 'summary' => ['When' => date('D, M j, Y g:i A'), 'Device' => $device !== '' ? $device : 'Unknown device', 'IP address' => (string) $ip], 'callout' => $mfa ? 'If that was not you, your password is known to someone else - change it now.' : 'If that was not you, change your password now and tell your administrator.', 'button' => ['label' => 'Review your sign in security', 'url' => "https://$config_base_url/agent/user/user_security.php"], ]); diff --git a/guest/guest_download_file.php b/guest/guest_download_file.php index c8e0aceb2..dfc7c2fd7 100644 --- a/guest/guest_download_file.php +++ b/guest/guest_download_file.php @@ -92,7 +92,7 @@ $after_row = shareRow($row['item_id']); $left = intval($after_row['item_view_limit']) - intval($after_row['item_views']); $after = intval($after_row['item_view_limit']) && $left <= 0 ? 'That was the last download this link allows.' - : (intval($after_row['item_view_limit']) ? "It can be downloaded $left more " . ($left === 1 ? 'time' : 'times') . '.' : 'The link keeps working until ' . date('M j \a\t g:i A', strtotime($after_row['item_expire_at'])) . '.'); + : (intval($after_row['item_view_limit']) ? "It can be downloaded $left more " . ($left === 1 ? 'time' : 'times') . '.' : 'The link keeps working until ' . date('M j, Y g:i A', strtotime($after_row['item_expire_at'])) . '.'); $name = str_replace(["\r", "\n", '"'], ['', '', "'"], (string) $file['file_name']); $ascii = preg_replace('/[^\x20-\x7E]/', '_', $name); diff --git a/guest/guest_view_invoice.php b/guest/guest_view_invoice.php index bbe42bd96..f90075765 100644 --- a/guest/guest_view_invoice.php +++ b/guest/guest_view_invoice.php @@ -85,7 +85,7 @@ $paper = [
    Paid in full
    -
    +
    @@ -99,7 +99,7 @@ $paper = [
    Amount due
    -
    Due ' . escapeHtml($invoice['invoice_due']) . '' ?>
    +
    Due ' . formatDate($invoice['invoice_due']) . '' ?>
    @@ -129,7 +129,7 @@ $paper = [
    - + @@ -151,7 +151,7 @@ $paper = [ href="guest_view_invoice.php?invoice_id=&url_key=">
    -
    +
    diff --git a/guest/guest_view_quote.php b/guest/guest_view_quote.php index 10fc0ecab..d571592f6 100644 --- a/guest/guest_view_quote.php +++ b/guest/guest_view_quote.php @@ -74,7 +74,7 @@ $paper = [

    - Good until . + Good until . Let us know whether to go ahead.

    @@ -95,7 +95,7 @@ $paper = [
    This quote has run out
    -
    It was good until - ask us for an updated one.
    +
    It was good until - ask us for an updated one.
    diff --git a/guest/share_ajax.php b/guest/share_ajax.php index c008783f0..1373f4849 100644 --- a/guest/share_ajax.php +++ b/guest/share_ajax.php @@ -58,7 +58,7 @@ function shareGuestGone($reason) { /** Why a link in this state no longer works, in words for the person holding it. */ function shareGuestReason($row, $state) { $reasons = [ - 'expired' => 'It expired ' . date('M j \a\t g:i A', strtotime((string) $row['item_expire_at'])) . '.', + 'expired' => 'It expired ' . date('M j, Y g:i A', strtotime((string) $row['item_expire_at'])) . '.', 'used' => intval($row['item_view_limit']) === 1 ? 'It could be opened once, and it has been.' : 'It has been opened as many times as it allowed.', 'revoked' => 'It was turned off.', 'locked' => 'It was locked after too many wrong tries.', @@ -80,7 +80,7 @@ function shareGuestMaskEmail($email) { function shareGuestLimits($row) { $limit = intval($row['item_view_limit']); $left = $limit - intval($row['item_views']); - $text = 'Works until ' . date('M j \a\t g:i A', strtotime((string) $row['item_expire_at'])) . '. '; + $text = 'Works until ' . date('M j, Y g:i A', strtotime((string) $row['item_expire_at'])) . '. '; if ($row['item_type'] === 'Request') { return $text . 'It can be used once.'; } @@ -103,9 +103,9 @@ function shareGuestAfter($row, $again) { return "That was the last time this link opens - copy what you need now. On this device you can come back to it for $grace minutes."; } if ($limit) { - return "It can be opened $left more " . ($left === 1 ? 'time' : 'times') . ' before ' . date('M j \a\t g:i A', strtotime((string) $row['item_expire_at'])) . '.'; + return "It can be opened $left more " . ($left === 1 ? 'time' : 'times') . ' before ' . date('M j, Y g:i A', strtotime((string) $row['item_expire_at'])) . '.'; } - return 'It keeps working until ' . date('M j \a\t g:i A', strtotime((string) $row['item_expire_at'])) . '.'; + return 'It keeps working until ' . date('M j, Y g:i A', strtotime((string) $row['item_expire_at'])) . '.'; } /** Log it against the link, with this request's address - and tell whoever made it, when there is something to tell. */ diff --git a/includes/billing_paper.php b/includes/billing_paper.php index 6180c5bbe..8f1fd02eb 100644 --- a/includes/billing_paper.php +++ b/includes/billing_paper.php @@ -60,12 +60,12 @@ if ($paper_type === 'invoice' && $paper_status === 'Paid') { $paper_dates = []; if ($paper_type === 'invoice') { - $paper_dates = ['Invoice date' => $paper_row['invoice_date'], 'Due' => $paper_row['invoice_due']]; + $paper_dates = ['Invoice date' => formatDate($paper_row['invoice_date']), 'Due' => formatDate($paper_row['invoice_due'])]; } elseif ($paper_type === 'quote') { - $paper_dates = ['Quote date' => $paper_row['quote_date'], 'Valid until' => $paper_row['quote_expire']]; + $paper_dates = ['Quote date' => formatDate($paper_row['quote_date']), 'Valid until' => formatDate($paper_row['quote_expire'])]; } else { $paper_dates = ['Billed' => recurringInvoiceFrequencies()[$paper_row['recurring_invoice_frequency']] ?? ucfirst((string) $paper_row['recurring_invoice_frequency']), - 'Next invoice' => $paper_row['recurring_invoice_next_date']]; + 'Next invoice' => formatDate($paper_row['recurring_invoice_next_date'])]; } // A recurring invoice's seat lines - what each counts now, and whether the line is off @@ -150,7 +150,7 @@ $paper_bill_lines = array_filter([
    0) { ?> -
    by
    +
    by
    ' . ($h % 3 === 0 ? date('ga', mktime($h, 0, 0)) : '') . '' . ($h % 3 === 0 ? date('g A', mktime($h, 0, 0)) : '') . '