Files
itflow/admin/modals/document_template/document_template_import.php
johnnyq 5a3f4ba6f5 Document templates stage 4, export, import, starter pack and report: Admin > Document Templates gets a menu beside New with Import, Export, the report and the starter pack, and each template page gets an Export link; the file carries each template's summary, its text with images embedded, its fill-ins and review interval, leaving who should have one to each install; importing a template already there by name can leave it, add the file's copy alongside or replace it (keeping its documents and who should have one), new ones come in required of no one, content goes through the HTML purifier, and images that only point at the other install's uploads are left out with the message saying how many; the MSP starter pack is rebuilt as 14 templates (Asset Inventory and Vendors and Escalation new) that fill in from the client, pull in its sites, networks, equipment, servers, domains, licenses, vendors and contacts as tables, ask for the rest with typed fill-ins, set 6 or 12 month reviews on the ones that go stale, and are required of no one out of the box; Update on Starter Content now covers document templates, bringing older starter templates up to the new versions while keeping their documents and who should have one; new Document Templates report under Clients & Documentation by template (documents made in the period against the period before, current documents, clients with one, coverage of the clients it is required of, documents due a review) and by client (what each should have, has and is missing, and documents due), filtered by client or by the agent who made them, each table exportable as CSV, and client-restricted users seeing only their clients; no database change; changelog updated
2026-10-18 19:50:42 -04:00

55 lines
2.6 KiB
PHP

<?php
/*
* Import document templates from a file exported by ITFlow - and what to do
* with one already here by name (import_document_templates,
* functions/document_template_transfer.php).
*/
require_once '../../includes/modal_header.php';
ob_start();
?>
<div class="modal-header bg-dark">
<h5 class="modal-title"><i class="fa fa-fw fa-file-upload me-2"></i>Import document templates</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
</div>
<form action="post.php" method="post" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
<div class="modal-body">
<p class="small text-secondary">A file exported from Admin > Document Templates in this or another ITFlow. Each comes in with its images, its fill-ins and how often its documents are reviewed. A new one is required of no one until you say who should have one on its page.</p>
<div class="mb-3">
<label class="form-label">File <strong class="text-danger">*</strong></label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-fw fa-file-code"></i></span>
<input type="file" class="form-control" name="file" accept=".json,application/json" required>
</div>
</div>
<div class="mb-1">
<label class="form-label">A document template already here by name</label>
<div class="input-group">
<span class="input-group-text"><i class="fa fa-fw fa-clone"></i></span>
<select class="form-select select2" name="existing">
<option value="skip" data-description="Yours stays as it is">Leave it</option>
<option value="copy" data-description="The file's comes in under a name of its own - Network Overview (2)">Add the file's as well</option>
<option value="replace" data-description="Its name, summary, what it says, images, fill-ins and review become the file's. Its documents and who should have one stay">Replace it with the file's</option>
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" name="import_document_templates" class="btn btn-primary text-bold"><i class="fa fa-upload me-2"></i>Import</button>
<button type="button" class="btn btn-light" data-bs-dismiss="modal"><i class="fa fa-times me-2"></i>Cancel</button>
</div>
</form>
<?php
require_once '../../../includes/modal_footer.php';