diff --git a/CHANGELOG.md b/CHANGELOG.md index a3cd78e32..f586e83db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ This file documents all notable changes made to ITFlow. ### Upgrading to 26.12 -Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's thirty-two database changes (3.6.6 to 3.9.9) in the same pass. They add four tables for RMM providers and their alerts, a setting for API keys in the address, a column marking the emails the mail queue clears once sent, a column and a table for agent banners, two columns for ticket statuses with a setting for the "ticket assigned" message, a column on tickets with a setting for the "no response" message, a table for who a ticket's email replies go to, the settings for Quick tickets, columns on recurring tickets and recurring invoices for booking and making them ahead, two columns on ticket replies for when their time was worked, the settings for cron alerts, a table and a setting for labor costs, a column on users for API / service accounts, columns on tickets and recurring tickets for how long booked work takes, a column each on recurring tickets and calendar events for repeating on a weekday, three columns on agents' settings for their calendar color, what their calendar shows and their own time zone, a table for the agents helping on a ticket, three columns on quote lines with three settings for what a quote line costs and how it is priced, a column each on quote lines and products with a setting for their pictures, two settings and a column on tickets for keeping project tickets apart, a table for your other offices with a column each on agents and invites for which one they work from, three settings for the emails and notices your agents get about their tickets, three settings for sending and reading Microsoft 365 mail through Microsoft Graph, five tables, four settings and a role permission for purchase orders, five settings for switching Dispatch, Bookkeeping, Purchasing, Trips and the calendar on and off, and eight tables, three columns and two settings for the Knowledge Base, who can read its articles, what its readers think of them and their files, a column on documents for how often each is reviewed, and change nothing that is there. Nothing else is required, but it is a big release, so take a backup before you update. Purchasing starts off - switch it on in Admin > Settings > Modules - and so does the Knowledge Base's public help center, in Admin > Settings > Knowledge Base. This release has thirteen security fixes - see Security. On Apache, ITFlow's own .htaccess now sends security headers: if you show ITFlow inside a frame on another website, it will now refuse to load there. On nginx, add the same headers to your server block if you want them - see Developer Updates. +Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's thirty-three database changes (3.6.6 to 4.0.0) in the same pass. They add four tables for RMM providers and their alerts, a setting for API keys in the address, a column marking the emails the mail queue clears once sent, a column and a table for agent banners, two columns for ticket statuses with a setting for the "ticket assigned" message, a column on tickets with a setting for the "no response" message, a table for who a ticket's email replies go to, the settings for Quick tickets, columns on recurring tickets and recurring invoices for booking and making them ahead, two columns on ticket replies for when their time was worked, the settings for cron alerts, a table and a setting for labor costs, a column on users for API / service accounts, columns on tickets and recurring tickets for how long booked work takes, a column each on recurring tickets and calendar events for repeating on a weekday, three columns on agents' settings for their calendar color, what their calendar shows and their own time zone, a table for the agents helping on a ticket, three columns on quote lines with three settings for what a quote line costs and how it is priced, a column each on quote lines and products with a setting for their pictures, two settings and a column on tickets for keeping project tickets apart, a table for your other offices with a column each on agents and invites for which one they work from, three settings for the emails and notices your agents get about their tickets, three settings for sending and reading Microsoft 365 mail through Microsoft Graph, five tables, four settings and a role permission for purchase orders, five settings for switching Dispatch, Bookkeeping, Purchasing, Trips and the calendar on and off, and eight tables, three columns and two settings for the Knowledge Base, who can read its articles, what its readers think of them and their files, a column on documents for how often each is reviewed, a column on agents' settings for compact rows, and change nothing that is there. Nothing else is required, but it is a big release, so take a backup before you update. Purchasing starts off - switch it on in Admin > Settings > Modules - and so does the Knowledge Base's public help center, in Admin > Settings > Knowledge Base. This release has thirteen security fixes - see Security. On Apache, ITFlow's own .htaccess now sends security headers: if you show ITFlow inside a frame on another website, it will now refuse to load there. On nginx, add the same headers to your server block if you want them - see Developer Updates. ### Security @@ -137,6 +137,11 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Invoices: an invoice a recurring invoice's autopay pays now says so - beside its number and under Payment on its page, and under its due date in the invoices list: which card and when (Autopay Dec 1), once it's sent for a draft, Autopay won't charge when the card runs out before the due date or the payment provider is turned off, and Autopay didn't pay it for one still owed after its due date, with why when the card was declined. An invoice that fell due before autopay was set up isn't marked. The client's link to the invoice says autopay will pay it, and when, so they don't pay it twice - as the client portal already did. - Documents: how often a document is reviewed can be set on the document itself, from How often beside its review - every 3 months to every 2 years, never, or as its template says. A document with no template can be reviewed on a schedule too; it shows Review due on Files, its client's overview and the reports like any other. Changing it doesn't count as reviewing it. - Files: drag a file or document onto a folder on the left to move it there - tick several first and drag one of them to move them all. A folder drags onto another to go inside it, with everything in it, or onto Top level to come out. Holding over a closed folder opens it, and the folders in the path above the list take a drop too. Files from your computer dropped on a folder on the left upload into it. Each move goes in the audit log. +- Windows ask before closing when something typed in them hasn't been saved. A click outside the window, Escape, its X and Cancel all ask first; saving doesn't. +- Long lists keep their column names at the top of the screen as you scroll down. Sorting and Select all still work from there. +- A list's filters that are on now stand out with a yellow edge, and an x at the end of the search box clears the search and every filter at once. +- Shift-click a list's tick boxes to tick, or untick, every row between two clicks. +- Compact rows: Your account > Preferences can show lists with tighter rows, so more fit on screen. - Modules: Admin > Settings > Modules has five more switches, to take out of ITFlow what your business doesn't use - Dispatch, which comes with Ticketing; Bookkeeping, Purchasing and Trips, which come with invoicing; and the Calendar. Each part is off while the one it comes with is, and shows faded under it. Switched off, a part leaves the menus, the dashboard, search, the reports and the API, and its pages and windows say it is off. Nothing in it is deleted - switched back on, it is all there. Dispatch, Bookkeeping, Trips and the Calendar start on, as before. - Bookkeeping: switch it off when your books are kept somewhere else. Accounts, Transactions, Transfers, Reconcile and the statement imports go, and nobody picks an account: payments and income go into the default payment account, and expenses come out of the default expense account - both in Admin > Settings > Defaults, or the first account when there's no default. An expense is paid by The business or Paid personally. The dashboard leaves out the account balances, and the Tax Package its Accounts section. - Calendar: switched off, the calendar, its events and the calendar feeds go - a subscribed calendar stops getting them. Tickets are still booked from the ticket and on Dispatch, and booked work still shows on the dashboard. @@ -305,6 +310,11 @@ Update from Maintenance > Update — Queue Update hands the job to cron, which u - Stripe customers Stripe no longer has: new `billingStripeCustomerGone($e)` in `functions/billing_pay.php` - an `InvalidRequestException` with code `resource_missing` on the `customer` parameter ("No such customer: 'cus_...'") - and `billingStripeCustomerForget($client_id, $customer_id)`, which deletes the `client_payment_provider` row only while it still holds that customer, removes the client's saved cards through `paymentCardRemove()` (so the autopay on them goes with each recurring invoice's history saying why), and logs, audits and `appNotify()`s it. Used where the stored customer goes to Stripe: `billingStripeCheckoutIntent()` and the guest pay page's PaymentIntent (`guest/guest_ajax.php`) retry once without a customer; `billingStripeChargeSaved()` returns a message for the client; the portal's `create_stripe_checkout` answers `{reload: true}` with a flash, and `js/portal_stripe.js` reloads into the Add a card step; `stripe_save_card`, Charge Saved Card (`agent/post/payment.php`) and the nightly autopay (`cron/nightly_tasks.php`) record what happened. Any other Stripe error is handled as before. `js/autopay_setup_stripe.js` is gone - nothing has loaded it since `js/portal_stripe.js` took over the portal's card form, and it was the version that never checked the server's answer. - `Clients-Template.csv` is gone from the top folder - nothing linked to it, and the Import window gives each kind's template. - Files: `agent/js/files.js` drags list rows and grid cards (`[data-files-item]`, with `data-id` and `data-folder-id`) and tree folders (`[data-folder-drag]`) onto `[data-folder-drop]` - the tree's rows and the path's crumbs, only for agents with Modify on Support. Files and documents post `bulk_move_files`, which now leaves an item already in the folder alone rather than logging a move. A folder posts the new `move_folder` (`agent/post/folder.php`) with `folder_id` and `parent_folder`, refused for a folder that isn't the client's or one inside the folder moved; the same parent is a no-op. Files from the computer dropped on a tree folder open Upload with that folder (`[data-files-upload]`). +- Windows: `js/app.js` asks before a `.modal` closes with unsaved typing, but only when the close came from the person - a mousedown on the shade, Escape or a `[data-bs-dismiss="modal"]` click in the last 1.5 seconds - so a script's `hide()` after a save never asks. Typing counts in text fields and textareas of `method="post"` forms whose value differs from when they were first focused (not hidden, checkbox, radio, search, file, readonly, `[data-no-guard]` or picker fields), and in TinyMCE editors by `isDirty()`. The question is SweetAlert2 with `target` set to the window, so Bootstrap's focus trap leaves it alone; Discard sets `data-itflow-discard` and hides again. +- Lists: `js/sticky_table_head.js` (every page) shows a fixed copy of the header row of each `.app-main .table-responsive > table` once the real one scrolls off, with column widths copied from the real cells and moved with the table's sideways scroll. CSS sticky can't do it: `.table-responsive` and `.app-main` are scroll boxes. Clicks on the copy (sort links, Select all) are passed to the same element in the real header by position. Tables in windows are left alone. +- Lists: `js/list_filters.js` (every page) reads which filters are applied from the address - the GET form in a card header, its selects, text and search fields, and hidden fields inside its `.collapse` - and gives their fields `.itflow-filter-on`. The x it adds to the search's input group links to the same address without them and `page`. Hidden fields outside the collapse, `show_column`, `view`, `show`, `sort` and `order` are kept. Lists with their own "Clear all" get no x. +- Lists: `js/bulk_actions.js` ticks a shift-clicked range of `.bulk-select` boxes within one form, firing `change` on each box it changes. +- Database 4.0.0 adds `user_settings.user_config_compact_rows` (`compactRowsReady()` in `functions/user.php`), which puts `itflow-compact` on `
`. ## [26.11.8] diff --git a/admin/database_updates/4.0.0.php b/admin/database_updates/4.0.0.php new file mode 100644 index 000000000..d965a1cde --- /dev/null +++ b/admin/database_updates/4.0.0.php @@ -0,0 +1,20 @@ + Preferences > Compact rows: lists drawn + * with tighter rows, so more fit on screen (the itflow-compact class on ). Off to start. + * + * Re-runnable: the column is added only where it isn't there yet. + */ + +defined('FROM_DB_UPDATER') || die("Direct file access is not allowed"); + + $itflow_compact_column = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'user_settings' AND COLUMN_NAME = 'user_config_compact_rows' LIMIT 1"); + + if ($itflow_compact_column && mysqli_num_rows($itflow_compact_column) === 0) { + mysqli_query($mysqli, "ALTER TABLE `user_settings` ADD `user_config_compact_rows` tinyint(1) NOT NULL DEFAULT 0 AFTER `user_config_theme_dark`"); + } diff --git a/agent/user/post/profile.php b/agent/user/post/profile.php index 1fa73c267..4fd2f3ea7 100644 --- a/agent/user/post/profile.php +++ b/agent/user/post/profile.php @@ -123,6 +123,10 @@ if (isset($_POST['edit_your_user_preferences'])) { mysqli_query($mysqli, "INSERT INTO user_settings SET user_id = $session_user_id, user_config_calendar_first_day = $calendar_first_day, user_config_theme_dark = $dark_mode, user_config_records_per_page = $per_page ON DUPLICATE KEY UPDATE user_config_calendar_first_day = $calendar_first_day, user_config_theme_dark = $dark_mode, user_config_records_per_page = $per_page"); + if (compactRowsReady()) { + $compact_rows = intval($_POST['compact_rows'] ?? 0) === 1 ? 1 : 0; + mysqli_query($mysqli, "UPDATE user_settings SET user_config_compact_rows = $compact_rows WHERE user_id = $session_user_id"); + } calendarAgentColorSave($session_user_id, $_POST); timezoneSave($session_user_id, $_POST); diff --git a/agent/user/user_preferences.php b/agent/user/user_preferences.php index 102f33c97..dbb8dbc6a 100644 --- a/agent/user/user_preferences.php +++ b/agent/user/user_preferences.php @@ -2,8 +2,8 @@ /* * Your account > Preferences - how ITFlow looks and behaves for you: light - * or dark, the day calendars start on, your time zone, your colour on the - * calendar, and how many rows a list shows. + * or dark, compact rows, the day calendars start on, your time zone, your + * colour on the calendar, and how many rows a list shows. */ require_once "includes/inc_all_user.php"; @@ -11,6 +11,7 @@ require_once "includes/inc_all_user.php"; $me = userRow($session_user_id); $calendar_first_day = intval($me['user_config_calendar_first_day']); $per_page = intval($me['user_config_records_per_page']) ?: 10; +$compact_rows = intval($me['user_config_compact_rows'] ?? 0); ?> @@ -37,6 +38,17 @@ $per_page = intval($me['user_config_records_per_page']) ?: 10; + +