diff --git a/CHANGELOG.md b/CHANGELOG.md index 034956f42..c151d39e2 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.6) 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.7) in the same pass. Nothing else is required. -This is a big release, with forty-seven database steps in one go, so take a backup before you update. +This is a big release, with forty-eight 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,7 +47,7 @@ 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. Words in square brackets already in them are now filled in when a document is made: [Client], [Site], [Contact], [Date] and the others listed under New Features (Document templates) from the client, and the rest are asked for as plain, optional text until you set them up on the template's page - one left blank stays as it is, as before. Documents made from a template before the update don't know which one, so a template's use is counted from the update. +Document templates keep their names, summaries, what they say and their images. Words in square brackets already in them are now filled in when a document is made: [Client], [Site], [Contact], [Date] and the others listed under New Features (Document templates) from the client, and the rest are asked for as plain, optional text until you set them up on the template's page - one left blank stays as it is, as before. Documents made from a template before the update don't know which one, so a template's use is counted from the update - link one to its template from the document's page to count it. No template is required of anyone, and none asks for reviews, until you set it up on its page. 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. @@ -532,6 +532,11 @@ If you are coming from 26.08 or earlier, the database update still has to be run - Tables of records: [Contacts], [Locations], [Assets], [Servers], [Workstations], [Network Equipment], [Printers], [Networks], [Domains], [Certificates], [Licenses], [Vendors] and [Services] put in the client's records as they are when the document is made. On a line of its own, it becomes a table - [Networks] gives each network's VLAN, network, gateway, DHCP range and site, [Servers] each server's operating system, IP address and site, [Domains] each domain's registrar and expiry - with an empty row to fill in when the client has none. In a sentence, it becomes their names. The template's page lists the ones it uses and what each holds, and the template window has a button for each placeholder and table to put it in. - Fill-ins: any other word in square brackets in a template's name, summary or what it says - [Firewall Model], [Review Date] - is asked for when a document is made, and the answer goes in wherever it is. On the template's page each fill-in can be made a date, a choice from a list or yes or no, made required, given a line of help, renamed (it is renamed in the template too) and dragged into the order it is asked in. One left blank stays for whoever writes the document. - New document for a client and Document from template show what the template fills in from the client, the site and contact to use, and its fill-ins, as soon as the template and client are picked. A copied template keeps its fill-ins. + - Who should have one: a template can be required of every client, or of the clients with a client tag you pick (Managed, say) - leads and archived clients don't count. Its page shows how many of them have a document from it, with a bar, and lists the ones missing one, each with a Make button. Admin > Document Templates shows how many have one on each, and a Required tab lists them. + - Several clients at once: New documents for several clients, from the template's page or the list, makes one for each client picked - or for every client missing one - each filled in from its own client with its primary site and contact, the fill-ins answered once for all of them. Clients that already have one are skipped unless you say otherwise. + - A client's Files lists the documents it should have across the top, each a click from making it, and its overview counts them under Documents missing. Document from template lists them first. + - Reviews: a template can say its documents are reviewed every 3 or 6 months, every year or every 2 years. A document is due once it hasn't been edited or marked as reviewed for that long. It says so on its page - Review due, or when the next review is and who last reviewed it - with Mark reviewed. Files marks the ones due and has a Review due tab listing them from every folder, the client's overview counts them, and the template's page and the list show how many are due. An archived template's documents aren't counted. + - A document can be linked to the template it counts as made from, from its page - one written before the template, say - so it counts towards who has one and is reviewed as the template says. What it says stays as it is. - 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. A draft uses the placeholders and tables of records, and puts what else is to be filled in in square brackets. - 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. @@ -1407,6 +1412,7 @@ If you are coming from 26.08 or earlier, the database update still has to be run - Removed: `agent/post/tag.php` and `agent/post/tag_model.php` (an older copy of `add_tag` for the window opened from agent pages), and `admin/post/tag_model.php`. - `agent/modals/billing/billing_item.php` adds a seat line's own tag to its choices when `recurringSeatOptions()` leaves it out. - CSS: `.itflow-tag` takes its text color from `--itflow-tag-text`; new `.itflow-tag-swatch`, `.itflow-tag-icons`, `.itflow-tag-icon` and `.itflow-tag-icon-custom`. + - `tagMerge()` moves `ticket_template_tags` and `document_template_required_tags` to the tag merged into, so a ticket template keeps its tags and a document template the clients it is required of. - Tags on more records (database 3.1.4): - New link tables `software_tags`, `service_tags`, `network_tags`, `document_tags` and `ticket_tags` - the record's id and `tag_id`, keyed together and on `tag_id`, gone with the record or the tag. Tag types 8 (license - the `software` table), 9 (service), 10 (network), 11 (document) and 12 (ticket) in `tagKinds()` and `tagEntity()`; a document's `client_list` says its list (`files.php`) is one client's. - `functions/tags.php`: `tagListUrl($entity, $tag)` (the list filtered by it, or `global_search.php?query=` for documents), `tagFilterIds()` (`?tags[]=`), `tagFilterSql($entity, $ids, $column)`, `tagSearchSql($entity, $like, $column)`, `tagFilterOptionsHtml($entity, $selected, $records_where)` (the tags on records the list can show, its client joined, plus those chosen), `tagOptionHtml($row, $selected)`, `tagFormFieldHtml($entity, $selected, $placeholder)` (with the `tags_form` marker), `tagIdsForRecord()`, `tagChangeText($before, $after)`, `tagExportFieldHtml()`, `tagNamesSql()` and `tagExportFilterSql($entity, $values, &$summary, $column)`, `tagMatchSql()` and `tagSearchSpec()` for search, and `tagApiRow()` and `tagApiAttach($rows, $entity)` for the API. `tagsForRecords()` adds `tag_type`. @@ -1517,6 +1523,10 @@ If you are coming from 26.08 or earlier, the database update still has to be run - `functions/document_template.php`: `DOCUMENT_TEMPLATE_PLACEHOLDERS`, `DOCUMENT_TEMPLATE_SITE_PLACEHOLDERS`, `DOCUMENT_TEMPLATE_CONTACT_PLACEHOLDERS` and `DOCUMENT_TEMPLATE_TABLES` (name => what it is); `documentFillInName()` ('' for a placeholder's or table's name), `documentTemplateWordKind($word)` (`placeholder`, `table` or `fill_in`), `documentTemplateBracketsInAll($template)` and `documentTemplateWordsUsed($template)` (its name, summary and content), `documentTemplateFillInRowsFor($ids)`, `documentTemplateFillIns($template, $rows)` and `documentTemplateFillInsFor($id)` (the ones set up, then the rest in the text as optional text, each with `in_text`) - in the shape `ticketFillInAnswers()` and `ticketFillInFieldHtml()` take - `documentTemplateRenameFillIn()`, `documentTemplateClientLocations()` and `documentTemplateClientContacts()` (primary first), `documentTemplateValues($client_id, $location_id, $contact_id, $agent_name)` (-1 for none, 0 or another client's for the primary), `documentTemplateTableData($table, $client_id)` (`head`, `rows`, `names`), `documentTemplateTableHtml()` and `documentTemplateFill($html, $client_id, $values)`. `documentTemplateMakeDocument()` takes `$location_id`, `$contact_id` and `$answers` (from `ticketFillInAnswers()`) after `$folder_id`, and fills the name, summary and content. `documentTemplateCopy()` copies the fill-ins, and `documentTemplateMarkBrackets()` marks each kind in its own color. - Admin: new `admin/modals/document_template/document_template_fill_in.php` (`document_template_id`, `name`). `admin/post/document_template.php`: `save_document_template_fill_in` (`original_name` to change or rename one), GET `delete_document_template_fill_in` (reset while still in the text, otherwise removed) and POST `reorder_document_template_fill_ins` (`names[]`, answers JSON). Audit entries are Document Template Edit. - `agent/ajax.php?document_template_asks=ID&client_id=ID` returns `{html}` - what the template fills in, the `location_id` and `contact_id` pickers when it uses them, and its fill-ins as `fill_ins[Name]` - or '' without Support at edit level, access to the client, or a live template. `add_document_from_template` checks the answers with `ticketFillInAnswers()` and takes `location_id` and `contact_id`. New `agent/js/document_template_make.js` draws it in a form with `data-doc-template-make`, from its `data-doc-template-select` and `data-doc-template-client` fields into `data-doc-template-asks`; new `js/document_template_form.js` puts a `data-document-template-word` button's word in the editor (on a line of its own with `data-document-template-table`). `ai_create_document_template` tells the model the placeholders and tables. + - Database 3.2.7: `document_templates.document_template_required` (0 no one, 1 every client, 2 the clients with one of its tags - none with no tags left) and `document_template_review_months` (0 never); new `document_template_required_tags` (`document_template_id`, `tag_id` - client tags, deleted with either); `documents.document_reviewed_at` and `document_reviewed_by`. + - `functions/document_template.php`: `DOCUMENT_TEMPLATE_REQUIRED_NONE`, `_EVERY` and `_TAGGED`, `DOCUMENT_TEMPLATE_REVIEW_MONTHS`; `documentTemplateRequiredTags($ids)`, `documentTemplateSetRequired($id, $required, $tag_ids, $months)` (leaves `document_template_updated_at` alone), `documentTemplateScopeSql($required, $tag_ids)` (SQL on clients - current, not leads), `documentTemplateScopeText()`, `documentTemplateCoverage($id, $required, $tag_ids)` (`clients`, `covered`, `missing`), `documentTemplatesMissingFor($client_id)`, `documentReviewedAtSql()` (the latest of made, edited and reviewed), `documentReviewDueSql()` (on documents joined to document_templates), `documentsReviewDue($where)`, `documentTemplateDueCounts($ids)`, `documentReviewState($row)` (`last`, `reviewed`, `next`, `due`) and `documentTemplateMakeForClients($id, $client_ids, $answers, $skip_existing)`. `documentTemplateRow()` returns the two new columns; `documentTemplateCopy()` copies the review period and tags, not required; `documentTemplateDelete()` no longer touches its documents' `document_updated_at`. + - Admin: new `admin/modals/document_template/document_template_required.php` (`id`) and `document_template_use_several.php` (`id`, `missing=1`); `document_template_use.php` takes `client_id`; `admin/document_templates.php` takes `show=required`. `admin/post/document_template.php`: `save_document_template_required` (`required`, `tags[]`, `review_months`) and `make_documents_from_template` (`client_ids[]`, `skip_existing`, `fill_ins`; a Document Create audit entry per document, under its client). + - Agent: `agent/post/document.php` - GET `mark_document_reviewed` and POST `set_document_template` (`document_template_id`, 0 for none; an archived one only if it is already the one), both Support at edit level, neither touching `document_updated_at`; new `agent/modals/document/document_template_link.php` (`id`). `agent/files.php` takes `type=due`. `clientOverviewAttention()` adds Documents missing and Document reviews due. - 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.7.php b/admin/database_updates/3.2.7.php new file mode 100644 index 000000000..635f3860b --- /dev/null +++ b/admin/database_updates/3.2.7.php @@ -0,0 +1,29 @@ + @@ -68,7 +82,16 @@ $use_url = "modals/document_template/document_template_use.php?id=$document_temp