mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 09:09:01 +00:00
Write portal documents in Markdown too: New Document in the client portal gets the Rich text and Markdown switch with the Markdown toolbar, Preview and help, converting either way as it is written and remembering the way used last, and its rich text editor shows the document as it will read with headings, quotes, code, tables and lines on its toolbar; both editors and the switch are now one shared include for agents and the portal, the portal converts Markdown at its own post.php for contacts who can write documents, Markdown documents from the portal open in Markdown for agents, and an empty document is refused in either mode; 26.12.3 changelog entries
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
* Client Portal
|
||||
* New document - written in the editor, or ?upload=1 a file (a PDF, Word or
|
||||
* text document) with a name and a line on what it is. Both are shared with
|
||||
* the agents straight away and show in Documents.
|
||||
* New document - written in the editor or in Markdown, picked above it and
|
||||
* switched either way as it is written (includes/document_editors.php, as an
|
||||
* agent's New Document has), or ?upload=1 a file (a PDF, Word or text
|
||||
* document) with a name and a line on what it is. Both are shared with the
|
||||
* agents straight away and show in Documents.
|
||||
*
|
||||
* No Content-Security-Policy here: the editor needs inline styles.
|
||||
* No Content-Security-Policy here: the editor needs inline styles, and the
|
||||
* Markdown box an inline script.
|
||||
*
|
||||
* SCOPING: primary and technical contacts (portalItGate()); post.php
|
||||
* (client_add_document, client_upload_document) checks the same.
|
||||
@@ -16,6 +19,9 @@ require_once "includes/inc_all.php";
|
||||
portalItGate();
|
||||
|
||||
$upload = !empty($_GET['upload']);
|
||||
|
||||
// Writing it - Markdown turned into HTML and back at post.php (client/includes/footer.php)
|
||||
$portal_document_writer = !$upload;
|
||||
?>
|
||||
|
||||
<a class="itflow-portal-back" href="documents.php"><i class="fas fa-chevron-left"></i>Documents</a>
|
||||
@@ -66,8 +72,13 @@ $upload = !empty($_GET['upload']);
|
||||
<?php } else { ?>
|
||||
<div class="mb-4">
|
||||
<label class="form-label">What it says <strong class="text-danger">*</strong></label>
|
||||
<textarea class="form-control tinymce" name="document_content" data-required></textarea>
|
||||
<div class="invalid-feedback d-block" data-editor-required-note hidden>Write something in the document.</div>
|
||||
<?php
|
||||
$document_content = '';
|
||||
$document_markdown = null;
|
||||
$document_format_remember = true;
|
||||
$document_editor_required = true;
|
||||
require __DIR__ . '/../includes/document_editors.php';
|
||||
?>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" name="client_add_document"><i class="fas fa-check me-2"></i>Save Document</button>
|
||||
<?php } ?>
|
||||
|
||||
Reference in New Issue
Block a user