Document templates stage 2, filled in from the client: placeholders [Client], [Website], [Site], [Address], [Site Phone], [Contact], [First Name], [Contact Email], [Contact Phone], [Agent], [Date], [Month], [Quarter] and [Year] are filled in across a template's name, summary and content when a document is made, using the client's primary site and contact unless another or none is picked; tables of records [Contacts], [Locations], [Assets], [Servers], [Workstations], [Network Equipment], [Printers], [Networks], [Domains], [Certificates], [Licenses], [Vendors] and [Services] put in the client's current records, as a table on a line of their own (an empty row when there are none) or as names in a sentence, all made safe; any other bracketed word is a fill-in asked for when a document is made, set up on the template page as text, date, list or yes/no, required or with help, renamed along with the template text, reset or removed, and dragged into order, with answers checked by ticketFillInAnswers and blanks left in the document; the template page gets Fill-ins and Filled in from the client cards with each kind of word marked in its own colour, and the editor gets a button for each placeholder and table to insert it at the cursor (js/document_template_form.js); New document for a client and Document from template draw the site and contact pickers and fill-ins once the template and client are picked (agent/ajax.php document_template_asks, agent/js/document_template_make.js) and open larger; copying a template copies its fill-ins; Draft it with AI is told the placeholders and tables; migration 3.2.6 adds document_template_fill_ins; fixed the fill-in add and reset messages showing raw HTML around the bracketed name on document and ticket templates; changelog updated

This commit is contained in:
johnnyq
2026-10-18 19:47:57 -04:00
parent 9fdc2f7032
commit 3ee183a09a
17 changed files with 1054 additions and 50 deletions

22
db.sql
View File

@@ -1271,6 +1271,28 @@ CREATE TABLE `document_tags` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `document_template_fill_ins`
--
DROP TABLE IF EXISTS `document_template_fill_ins`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `document_template_fill_ins` (
`document_fill_in_id` int(11) NOT NULL AUTO_INCREMENT,
`document_fill_in_document_template_id` int(11) NOT NULL,
`document_fill_in_name` varchar(50) NOT NULL,
`document_fill_in_type` varchar(10) NOT NULL DEFAULT 'text',
`document_fill_in_options` text DEFAULT NULL,
`document_fill_in_required` tinyint(1) NOT NULL DEFAULT 0,
`document_fill_in_help` varchar(255) DEFAULT NULL,
`document_fill_in_order` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`document_fill_in_id`),
UNIQUE KEY `document_fill_in_template_name` (`document_fill_in_document_template_id`,`document_fill_in_name`),
CONSTRAINT `document_template_fill_ins_ibfk_1` FOREIGN KEY (`document_fill_in_document_template_id`) REFERENCES `document_templates` (`document_template_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `document_templates`
--