diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b98d78af..f0e80b8c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,9 @@ This file documents all notable changes made to ITFlow. ### Upgrading to 26.11 -Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's database changes (2.7.9 to 3.2.4) in the same pass. Nothing else is required. +Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's database changes (2.7.9 to 3.2.5) in the same pass. Nothing else is required. -This is a big release, with forty-five database steps in one go, so take a backup before you update. +This is a big release, with forty-six database steps in one go, so take a backup before you update. The update also clears out data that deletes in older versions left behind, all of it pointing at something that no longer exists: @@ -47,6 +47,8 @@ Ticket templates keep their subject, details and tasks, and set nothing else on Canned responses keep their names, what they say and their ticket category. One whose category had been deleted is offered on every ticket, as it already was. How often each is used is counted from the update. None sets up anything on the reply until you give it a reply type, status or time worked on its Sets up tab. Every canned response already there is shared - offered to everyone, as before - and none has files. +Document templates keep their names, summaries, what they say and their images. Documents made from a template before the update don't know which one, so a template's use is counted from the update. + If you are coming from 26.08 or earlier, the database update still has to be run from the command line one time, exactly as described under Upgrading to 26.09 below. ### Breaking Changes and Notes @@ -523,6 +525,12 @@ If you are coming from 26.08 or earlier, the database update still has to be run - Export and import: Admin > Canned Responses exports every current shared one, the ones picked (archived ones too, if you like), or one from its menu, as a file to import into another ITFlow or keep. Each goes with what it says, the ticket categories it is offered on and what it sets up, and its files unless you leave them out. Importing brings them in shared, matches the categories by name and makes the ones missing, matches the status after the reply by name, and for one already here by name leaves yours, adds the file's as well under a name of its own, or replaces yours with it - keeping how often yours has been used. What comes in is made safe, and a file of a kind a ticket doesn't take is left out and said. - Starter Content has a Canned Responses pack for an MSP: received, waiting on you, following up, resolved, closing with no reply, a remote session, an onsite visit, escalated to the vendor, an internal handover, billable work, password reset, multi-factor sign-in set up again, account unlocked, licence assigned, phishing reported (phishing or safe), a possible security incident, a new starter ready, a leaver done, warranty repair, printer fixed, file restored, a monitoring alert cleared, internet down with the provider, voicemail PIN reset, a quote sent and an invoice question. Each is filled in from the ticket, sets the reply up (who sees it, the status after it, time worked), and the ones for one kind of ticket are offered on its category. Update brings the ones you added before up to the current version. - The New Canned Response button's menu has Import, Export, the report and the starter ones. +- **Document templates** (rebuilt) + - Admin > Document Templates lists what each is for, how many documents have been made from it and for how many clients, when it was last used and when it last changed, and by whom - searched by name, summary or what it says, sorted from the column headings, a page at a time, with Active and Archived tabs. + - A template's page shows what it says, with the words in square brackets left to fill in marked and listed, who made it and last changed it, its images, and the latest documents made from it with their client. New document for a client, from there or the list, makes one for the client you pick and opens it. + - Templates can be copied (with their images), archived - not offered for new documents, while the documents made from them stay - restored and deleted. A document made from one remembers it, and its page says which template it came from. + - The template window has its icons, a summary, and Draft it with AI when an AI model is set up for documentation. + - Document from template in a client's Files shows each template's summary and how often it has been used. A document made with no name or summary given takes the template's. - **Assets** - The asset list has: - type icons, colored status pills and OS icons @@ -1496,6 +1504,11 @@ If you are coming from 26.08 or earlier, the database update still has to be run - Export and import: new `functions/canned_response_transfer.php` - `cannedResponsesExport($ids, $archived, $with_files)` (the file's contents: `format` itflow-canned-responses, `version` 1, `responses`, each with `name`, `body`, `categories` by name, `reply_type` - `internal`, `public`, `email` or null - `status` by name, `minutes` and, when exported with them, `files` as `name` and base64 `data`, each up to `CANNED_RESPONSE_TRANSFER_FILE_MAX`), `cannedResponsesExportFileName()`, `cannedResponsesImportRead($contents, &$error)` (checks and tidies a file - the body through `documentHtmlPurify()`, statuses matched to `cannedResponseStatuses()`, files to `TICKET_ATTACHMENT_EXTENSIONS` - and takes the starter pack's array the same way), `cannedResponsesImport($responses, $existing, $only_existing)` (`skip`, `copy` or `replace`, against shared ones only; a response without `files` keeps its own), `cannedResponseImportCategory()`, `cannedResponseAddFileData($id, $name, $bytes)` and `cannedResponsesImportSummary()`. Handlers in `admin/post/canned_response.php`: POST `export_canned_responses` (`canned_response_ids[]`, `archived`, `files`), GET `export_canned_response` and POST `import_canned_responses` (`file`, `existing`), with `admin/modals/canned_response/canned_response_export.php` and `canned_response_import.php`. Audit entries are Canned Response Export and Import. - Starter Content: a pack can say how its ones already here are updated (`update` - `button`, `confirm` - in `starterContentPacks()`), which draws the Update button. New `canned_responses` pack: `starterContentCannedResponses()` in the file format, `starterLoadCannedResponses()` through `cannedResponsesImport()`, and `starterUpdateCannedResponses()` with the `update_starter_canned_responses` handler. - Report: `agent/reports/canned_responses.php` (`client_id`, `agent` - who used it - and the period; `export=csv` by response, `table=agents` by agent), `canned_responses` in `reportCatalog()` under Service Desk. +- Document templates: + - Database 3.2.5: `documents.document_template_id` (indexed; 0 for none) - the template a document was made from. + - New `functions/document_template.php`: `documentTemplateDir()`, `documentTemplateRow($id)` (with `created_by_name` and `updated_by_name`), `documentTemplateUsage($ids)` (`count`, `clients`, `last` - documents not archived), `documentTemplateFields($post, &$error)` (`name`, `description`, `content`), `documentTemplateSave($id, $fields)` (images through `saveBase64Images()`, the unused ones through `cleanupUnusedImages()`; a new one's first save leaves `document_template_updated_at` empty), `documentTemplateCopyImages()`, `documentTemplateCopy($id)`, `documentTemplateDelete($id)` (clears the template from its documents and takes its folder away), `documentTemplateMakeDocument($id, $client_id, $name, $description, $folder_id)` (the template's name and summary when none given), `documentTemplatePreview()`, `documentTemplateBracketsIn()` and `documentTemplateMarkBrackets()`. + - Admin: `admin/document_templates.php` takes `q`, `sort` - `document_template_name`, `used_count`, `last_used` or `changed_at` - `order`, `page` and `show=archived`. `admin/document_template.php` is rebuilt on the ticket template page's layout. `admin/modals/document_template/document_template_form.php` is shared by `document_template_add.php` and `document_template_edit.php` (`id`); new `document_template_use.php` (`id`) posts `add_document_from_template` to `agent/post.php`. `admin/post/document_template.php`: `add_document_template` (redirects to its page), `edit_document_template`, GET `copy_document_template`, `archive_document_template`, `restore_document_template` and `delete_document_template` (`from_page`). Audit entries are Document Template Create, Edit, Archive, Restore and Delete. + - `add_document_from_template` makes the document with `documentTemplateMakeDocument()`, checks the client exists and redirects to `/agent/document.php`. `agent/modals/document/document_add_from_template.php` takes `document_template_id` to pick one, and shows each one's use. - Empty states: every list page sets `$empty_state` before including `includes/filter_footer.php`, and `includes/inc_empty_state.php` draws it with `emptyStateHtml()` (`functions/format.php`) when the list has nothing - `thing`, `icon`, `title`, `text`, `actions` (`label`, `modal` or `href`, `size`, `icon`; the first is the main one), `archived`, `view`, `filtered`, `views`, `match_title`, `match_text` and `clear_url`. `emptyStateFiltered($views)` reads the GET string for a search or filter, leaving out paging, sorting, `client_id`, `archived` and the page's views, and `emptyStateClearUrl($views)` is the page without them. `emptyStatePill($pills, $key, $default, $good)` builds a pill's own state from the page's pill array (`label`, `icon`, `title`, `alarm`), with a tick for `alarm` pills and the keys in `$good`. Files, notifications and racks call `emptyStateHtml()` in their own layout; files and notifications set `$empty_state_skip`. A page that sets nothing still gets one, worded from `$page_title`. The pages' own empty blocks (`.itflow-asset-empty` under a list) are gone. CSS: `.itflow-empty-state` with `-icon` (a grey round tile), `-title`, `-text` and `-actions`. - Removed unused helpers and files: - `credentialLink()`, `projectLink()`, `linkCounts()`, `assetContactAvatar()`, `clientOverviewPersonInitials()`, and `getMonthlyTax()` and `getQuarterlyTax()`, which looked a tax up by name diff --git a/admin/database_updates/3.2.5.php b/admin/database_updates/3.2.5.php new file mode 100644 index 000000000..1a0105596 --- /dev/null +++ b/admin/database_updates/3.2.5.php @@ -0,0 +1,13 @@ +set('Cache.DefinitionImpl', null); // Disable cache by setting a non-existent directory or an invalid one -$purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'http' => true, 'https' => true]); -$purifier = new HTMLPurifier($purifier_config); - -if (isset($_GET['document_template_id'])) { - $document_template_id = intval($_GET['document_template_id']); -} - -$sql_document = mysqli_query($mysqli, "SELECT document_template_content, document_template_created_at, document_template_description, - document_template_name, document_template_updated_at FROM document_templates WHERE document_template_id = $document_template_id LIMIT 1"); - -if (mysqli_num_rows($sql_document) == 0) { - echo "