mirror of
https://github.com/itflow-org/itflow
synced 2026-11-18 18:37:23 +00:00
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:
@@ -2,8 +2,11 @@
|
||||
|
||||
/*
|
||||
* New document for a client from a document template - from Admin > Document
|
||||
* Templates and the template's page. It goes in the client's Files, at the
|
||||
* top level, and opens (add_document_from_template, agent/post/document.php).
|
||||
* Templates and the template's page. When the client is picked, what the
|
||||
* template asks for - the site and contact its placeholders come from, and its
|
||||
* fill-ins - is drawn under it (agent/js/document_template_make.js). It goes in
|
||||
* the client's Files, at the top level, and opens (add_document_from_template,
|
||||
* agent/post/document.php).
|
||||
*/
|
||||
|
||||
require_once '../../includes/modal_header.php';
|
||||
@@ -24,16 +27,16 @@ if (!$template || $template['document_template_archived_at']) { ?>
|
||||
<h5 class="modal-title text-truncate"><i class="fa fa-fw fa-file-alt me-2"></i>New document from <strong><?= escapeHtml($template['document_template_name']) ?></strong></h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<form action="/agent/post.php" method="post" autocomplete="off">
|
||||
<form action="/agent/post.php" method="post" autocomplete="off" data-doc-template-make>
|
||||
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
|
||||
<input type="hidden" name="document_template_id" value="<?= intval($template['document_template_id']) ?>">
|
||||
<input type="hidden" name="document_template_id" value="<?= intval($template['document_template_id']) ?>" data-doc-template-select>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Client <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-user"></i></span>
|
||||
<select class="form-select select2" name="client_id" required>
|
||||
<select class="form-select select2" name="client_id" required data-doc-template-client>
|
||||
<option value="">- Pick a client -</option>
|
||||
<?php
|
||||
$sql_clients = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients WHERE client_archived_at IS NULL ORDER BY client_name ASC");
|
||||
@@ -44,6 +47,9 @@ if (!$template || $template['document_template_archived_at']) { ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- What the template asks for, for the client picked - agent/js/document_template_make.js -->
|
||||
<div class="mb-3" data-doc-template-asks hidden></div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name</label>
|
||||
<div class="input-group">
|
||||
@@ -67,6 +73,8 @@ if (!$template || $template['document_template_archived_at']) { ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="/agent/js/document_template_make.js"></script>
|
||||
|
||||
<?php }
|
||||
|
||||
require_once '../../../includes/modal_footer.php';
|
||||
|
||||
Reference in New Issue
Block a user