diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8aaa78e..a28b94a98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -130,6 +130,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Purchasing: an agent who can only see some clients only sees the purchase orders whose lines are all for clients they can see. A purchase order's History shows who made, sent, approved, ordered, received and billed it, and it is in the audit log. From Mountaineer IT's build of ITFlow. - Menu: fewer entries to scroll past. Recurring Expenses is now a tab on Expenses, and Transfers a tab on Transactions, with the tabs across the top of each page. Purchasing is one entry with its pages as tabs, and its number is the purchase orders waiting for your approval - otherwise the items waiting to be ordered. - Client menu: Calendar, Racks, Certificates, Shared Links, Services and Trips stay out of a client's menu while the client has none of them, when two or more are empty, so the menu is shorter for most clients. More, at the bottom of the menu, shows them - to add a client's first rack, say. Each comes back as soon as the client has one, and always shows on its own page. +- Admin menu: eight entries shorter, nine with texting set up. Templates is one entry under Lists & Templates, with Tickets, Projects, Canned Responses, Contracts, Vendors, Licenses and Documents as tabs across its pages. Logs, under Maintenance, has Audit Logs, Sign-ins and App Logs as tabs. Text Messaging has Setup and, once texting is set up, Messages, with the texts that failed to send in the last week counted on the menu. Where ITFlow points you to one of these pages, it now says where it is - Admin > Templates > Tickets, say. ### Bug Fixes @@ -273,6 +274,7 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Microsoft Graph mail: database 3.9.2 adds `config_mail_graph_token`, `config_mail_graph_token_expires_at` and `config_mail_graph_scopes` to `settings`. New `functions/mail_graph.php`: `mailGraphToken($permission, $fresh)` trades the mailbox's refresh token for a Graph token (scope `offline_access https://graph.microsoft.com/.default`), keeps it with the scopes it carries and the new refresh token Microsoft hands back, and returns it when it carries `Mail.Send` or `Mail.ReadWrite` - otherwise null, and SMTP or IMAP are used. An app that can't use Graph is asked again after `MAIL_GRAPH_RECHECK_MINUTES` (60), or after `mailGraphForget()` (the OAuth tab's save and Connect). When the cached scopes already had a mail permission and the renewal fails, it throws with Microsoft's reason, so the email or the run stops with it rather than falling back. `mailGraphSend()` posts the finished MIME to `/me/sendMail`, or past `MAIL_GRAPH_MIME_LIMIT` (3 MB) makes a draft, adds the attachments (upload sessions over 3 MB) and sends it, deleting the draft on failure. `mailGraphMailbox()` returns `MailGraphMailbox` (`functions/mail_graph_mailbox.php`), standing in for the parts of ImapEngine `cron/ticket_email_parser.php` uses: unread, unflagged mail oldest first, each read by ImapEngine's `FileMessage` from its MIME, with read, flagged and move done through Graph. `mailGraphMailboxTest()` and `mailGraphState()` serve the Tests and OAuth tabs. The Exchange token renewals (`cron/mail_queue.php`, `cron/ticket_email_parser.php` and the Tests tab) now send `scope` (`MAIL_MICROSOFT_EXCHANGE_SCOPE`), so a refresh token last renewed for Graph still gives an Exchange token. `MAIL_GRAPH_URL` and `MAIL_MICROSOFT_LOGIN_URL` can be defined in config.php to point at a test server. From Mountaineer IT's build of ITFlow. - Purchase orders: database 3.9.3 adds `order_items` (the To Order list - `order_item_status` waiting / ordered / received, `order_item_source` manual / reorder), `purchase_orders` (UNIQUE `po_prefix`, `po_number`; `po_ship_to_office_id` NULL for another address in `po_ship_to`; `po_expense_id` for the vendor bill), and `po_items`, `po_receipts` and `po_tracking`, each cascading from its purchase order. `settings` gets `config_po_prefix` ('PO-'), `config_po_next_number`, `config_po_approval` (0) and `config_po_approval_over`, and `modules` gets `module_procurement` - the name and the `product_vendor_id` link match Mountaineer IT's build. Everything is in the new `functions/purchase_orders.php`: `poReady()` is false until the update has run and `poLevel()` is 0 while invoicing is off; `poRequireLevel()` and `poForRequest()` stop a page, handler or window with the reason (`poOffReason()`) or the role refusal, and `poForRequest()` also refuses a PO with a line for a client the agent can't reach (`poAccessible()`; lists use `poScopeSql()`). Numbers come from `poNextNumber()` under `GET_LOCK`, with `poCreate()` retrying on a duplicate. `poMarkOrdered()` approves a draft itself when `poNeedsApproval()` says no, noting why; `poSendForApproval()` and `poDecide()` notify through `poTell()` (bell and `emailQueue()`), and `poMayApprove()` keeps a non-admin from approving their own unless they are the only approver. `poReceive()` puts own-stock lines of a tracked product on the shelf with `productStockMove(..., 'received')` (Sales at 2) and turns client lines into assets - an asset, its primary interface '01', an asset_history row and an audit entry each, up to `PO_ASSETS_MAX` (50) a line (Support at 2) - and `poUndoReceipt()` reverses one receipt. `poRecordBill()` records the expense with `expenseSave()` and sets `stock_expense_id` on the stock it received. `poPdf()` draws on `BillingPdf`, and `poEmail()` attaches it with `billingEmailPdf()` and queues it with `emailQueue()`. History is the 'Purchase Order' kind in `auditLogKinds()`. `permissionRefusedText()` reads an optional `full` from `roleModuleInfo()` for a module whose Full level isn't deleting. Pages: `agent/to_order.php`, `purchase_orders.php`, `purchase_order.php`, `receiving.php`; windows in `agent/modals/purchasing/`; handlers in `agent/post/purchase_order.php`; settings in `admin/settings_purchase_order.php`; `js/purchase_orders.js`. From Mountaineer IT's build of ITFlow. - Menus: `pageTabsHtml()` (`functions/format.php`) draws tabs across pages that share one side nav entry - `expenseTabsHtml()` for Expenses and Recurring, `poTabsHtml()` for To Order, Purchase Orders and Receiving. The side nav drops Recurring Expenses (and `$num_recurring_expenses` from `get_side_nav_counts.php`), Transfers and the PURCHASING header; the BILLING header shows for roles with Sales or Purchasing. `client_side_nav.php` marks a quiet item `data-nav-quiet hidden` when its count is 0, it isn't the page open and two or more are quiet, and adds More (`data-nav-more`, handled in `js/app.js`). `inc_all_client.php` adds `$num_calendar_bookings` - open tickets booked from today - when a client has no upcoming events, so its Calendar still shows booked work. +- Admin menu: `adminNavGroups()` (`functions/settings.php`) lists the admin pages that share one side nav entry - logs, templates and text messaging - with each page's file, icon, label, record pages and badge count, leaving out pages for modules that are off and Messages until a texting provider is active. `adminNavGroupItemHtml()` draws the entry and `adminNavGroupTabsHtml()` the tabs atop each page (none for a group of one). The TEMPLATES and Sign-ins entries and the separate Audit Logs, App Logs and Text Messages entries are gone from `admin/includes/side_nav.php`, and the on-screen paths to those pages - in the import windows, onboarding, API errors and AI errors - say Admin > Templates > ..., Admin > Logs > ... or Admin > Text Messaging > Messages. ## [26.11.8] diff --git a/admin/app_logs.php b/admin/app_logs.php index 9395d9baf..009fccd0e 100644 --- a/admin/app_logs.php +++ b/admin/app_logs.php @@ -85,6 +85,8 @@ $filters_url = function ($modal) use ($dtf, $dtt, $view, $category_filter) { ?> + +

App Logs

diff --git a/admin/audit_logs.php b/admin/audit_logs.php index e6c7d25b6..96907df31 100644 --- a/admin/audit_logs.php +++ b/admin/audit_logs.php @@ -97,6 +97,8 @@ $view_empty = [ ?> + +

Audit Logs

diff --git a/admin/canned_responses.php b/admin/canned_responses.php index 012b29d55..ddd8c39fb 100644 --- a/admin/canned_responses.php +++ b/admin/canned_responses.php @@ -95,6 +95,8 @@ $csrf = $_SESSION['csrf_token']; ?> + +

Canned Responses

diff --git a/admin/contract_templates.php b/admin/contract_templates.php index 92c256d73..1ac19e5ac 100644 --- a/admin/contract_templates.php +++ b/admin/contract_templates.php @@ -70,6 +70,8 @@ $csrf = $_SESSION['csrf_token']; ?> + +

Contract Templates

diff --git a/admin/document_templates.php b/admin/document_templates.php index 73f555b0f..1d36a4fec 100644 --- a/admin/document_templates.php +++ b/admin/document_templates.php @@ -93,6 +93,8 @@ $csrf = $_SESSION['csrf_token']; ?> + +

Document Templates

diff --git a/admin/includes/side_nav.php b/admin/includes/side_nav.php index e89bdbedf..a353349ea 100644 --- a/admin/includes/side_nav.php +++ b/admin/includes/side_nav.php @@ -53,14 +53,8 @@

API Keys

- - + + + @@ -133,12 +129,8 @@

AI Providers

- + + - - - - - - - - - - - - - - - - - @@ -253,32 +193,8 @@

- - - - - + + '; +} + +/* The tabs atop a group's pages, the one open lit - nothing when the group has just one page. HTML. */ +function adminNavGroupTabsHtml($key) { + $group = adminNavGroups()[$key] ?? null; + if (!$group || count($group['pages']) < 2) { + return ''; + } + $here = basename($_SERVER['PHP_SELF'] ?? ''); + return pageTabsHtml(array_map(function ($page) use ($here) { + return ['url' => $page['file'], 'icon' => $page['icon'], 'label' => $page['label'], 'active' => $here === $page['file'], + 'count' => $page['count'] ?? 0, 'title' => $page['title'] ?? '', 'tone' => $page['tone'] ?? '']; + }, $group['pages'])); +} + /* The theme colours there are - each has its .theme- block in css/itflow_custom.css. */ function settingsThemes() { return ['lightblue' => 'Light blue', 'blue' => 'Blue', 'navy' => 'Navy', 'indigo' => 'Indigo', 'purple' => 'Purple', 'fuchsia' => 'Fuchsia', 'pink' => 'Pink', diff --git a/functions/software_template_transfer.php b/functions/software_template_transfer.php index 39f47fef9..ab476e00d 100644 --- a/functions/software_template_transfer.php +++ b/functions/software_template_transfer.php @@ -93,7 +93,7 @@ function softwareTemplateFileNotes($value, $max = 20000) { function softwareTemplatesImportRead($contents, &$error = '') { $data = is_array($contents) ? $contents : json_decode((string) $contents, true); if (!is_array($data) || ($data['format'] ?? '') !== SOFTWARE_TEMPLATE_FILE_FORMAT || !isset($data['templates']) || !is_array($data['templates'])) { - $error = "That isn't a license templates file - export one from Admin > License Templates."; + $error = "That isn't a license templates file - export one from Admin > Templates > Licenses."; return null; } if (intval($data['version'] ?? 0) > SOFTWARE_TEMPLATE_FILE_VERSION) { diff --git a/functions/ticket_template_transfer.php b/functions/ticket_template_transfer.php index 78f0e1006..0c87fb382 100644 --- a/functions/ticket_template_transfer.php +++ b/functions/ticket_template_transfer.php @@ -100,7 +100,7 @@ function ticketTemplateFileText($value, $max) { function ticketTemplatesImportRead($contents, &$error = '') { $data = is_array($contents) ? $contents : json_decode((string) $contents, true); if (!is_array($data) || ($data['format'] ?? '') !== TICKET_TEMPLATE_FILE_FORMAT || !isset($data['templates']) || !is_array($data['templates'])) { - $error = "That isn't a ticket templates file - export one from Admin > Ticket Templates."; + $error = "That isn't a ticket templates file - export one from Admin > Templates > Tickets."; return null; } if (intval($data['version'] ?? 0) > TICKET_TEMPLATE_FILE_VERSION) { diff --git a/functions/vendor_template_transfer.php b/functions/vendor_template_transfer.php index 3060f3a0d..7c0f426e3 100644 --- a/functions/vendor_template_transfer.php +++ b/functions/vendor_template_transfer.php @@ -93,7 +93,7 @@ function vendorTemplateFileValue($field, $value, $max) { function vendorTemplatesImportRead($contents, &$error = '') { $data = is_array($contents) ? $contents : json_decode((string) $contents, true); if (!is_array($data) || ($data['format'] ?? '') !== VENDOR_TEMPLATE_FILE_FORMAT || !isset($data['templates']) || !is_array($data['templates'])) { - $error = "That isn't a vendor templates file - export one from Admin > Vendor Templates."; + $error = "That isn't a vendor templates file - export one from Admin > Templates > Vendors."; return null; } if (intval($data['version'] ?? 0) > VENDOR_TEMPLATE_FILE_VERSION) {