mirror of https://github.com/itflow-org/itflow
Moved Document Templates to settings
This commit is contained in:
parent
c8d1d4d5e1
commit
f6d032f1d2
|
|
@ -53,11 +53,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<h3 class="card-title mt-2">
|
||||
<i class="fa fa-fw fa-folder mr-2"></i>Documents
|
||||
</h3>
|
||||
<button type="button" class="btn btn-dark dropdown-toggle ml-1" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="client_document_templates.php?client_id=<?php echo $client_id; ?>">Templates</a>
|
||||
</div>
|
||||
|
||||
<div class="card-tools">
|
||||
|
||||
<div class="btn-group">
|
||||
|
|
|
|||
|
|
@ -2,22 +2,25 @@
|
|||
<div class="modal-dialog modal-xl">
|
||||
<div class="modal-content bg-dark">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-file-alt mr-2"></i>New Document Template</h5>
|
||||
<h5 class="modal-title"><i class="fa fa-fw fa-file-alt mr-2"></i>Creating Document Template</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="name" placeholder="Template name" required autofocus>
|
||||
<input type="text" class="form-control" name="name" placeholder="Template name">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<textarea class="form-control tinymce" name="content"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="description" placeholder="Enter a short summary">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal-footer bg-white">
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
require_once("inc_all_settings.php");
|
||||
|
||||
//Initialize the HTML Purifier to prevent XSS
|
||||
require("plugins/htmlpurifier/HTMLPurifier.standalone.php");
|
||||
|
|
@ -17,8 +17,8 @@ $sql_document = mysqli_query($mysqli, "SELECT * FROM documents WHERE document_te
|
|||
$row = mysqli_fetch_array($sql_document);
|
||||
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
$document_content = $purifier->purify($row['document_content']);
|
||||
//$document_content = $row['document_content'];
|
||||
$document_created_at = nullable_htmlentities($row['document_created_at']);
|
||||
$document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
||||
|
||||
|
|
@ -26,24 +26,17 @@ $document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
|||
|
||||
<ol class="breadcrumb d-print-none">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="invoices.php">Home</a>
|
||||
<a href="clients.php">Home</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="clients.php">Clients</a>
|
||||
<a href="users.php">Settings</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="client_overview.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a>
|
||||
<a href="settings_document_templates.php">Document Templates</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="client_documents.php?client_id=<?php echo $client_id; ?>">Documents</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
<a href="client_document_templates.php?client_id=<?php echo $client_id; ?>">Templates</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-file"></i> <?php echo $document_name; ?></li>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-file mr-2"></i><?php echo $document_name; ?></li>
|
||||
</ol>
|
||||
|
||||
|
||||
<div class="card card-dark">
|
||||
<div class="card-header">
|
||||
|
||||
|
|
@ -53,9 +46,6 @@ $document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
|||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#editDocumentTemplateModal<?php echo $document_id; ?>">
|
||||
<i class="fas fa-edit mr-2"></i>Edit
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#editDocumentModal">
|
||||
<i class="fas fa-copy mr-2"></i>Copy
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
|
@ -65,6 +55,6 @@ $document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
|||
|
||||
<?php
|
||||
|
||||
require_once("client_document_template_edit_modal.php");
|
||||
require_once("document_template_edit_modal.php");
|
||||
|
||||
require_once("footer.php");
|
||||
|
|
@ -19,6 +19,10 @@
|
|||
<textarea class="form-control tinymce" name="content"><?php echo $document_content; ?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="description" value="<?php echo $document_description; ?>" placeholder="Short summary">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<button type="submit" name="edit_document_template" class="btn btn-primary text-bold"><i class="fa fa-check mr-2"></i>Save</button>
|
||||
|
|
@ -382,7 +382,7 @@ if (isset($_POST['edit_document_template'])) {
|
|||
// Content Raw is used for FULL INDEX searching. Adding a space before HTML tags to allow spaces between newlines, bulletpoints, etc. for searching.
|
||||
|
||||
// Document edit query
|
||||
mysqli_query($mysqli,"UPDATE documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw' WHERE document_id = $document_id");
|
||||
mysqli_query($mysqli,"UPDATE documents SET document_name = '$name', document_description = '$description', document_content = '$content', document_content_raw = '$content_raw', document_updated_by = $session_user_id WHERE document_id = $document_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document Template', log_action = 'Modify', log_description = '$session_name modified document template $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id, log_entity_id = $document_id");
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
$sort = "document_name";
|
||||
$order = "ASC";
|
||||
|
||||
require_once("inc_all_client.php");
|
||||
require_once("inc_all_settings.php");
|
||||
|
||||
// Search query SQL snippet
|
||||
if (!empty($q)) {
|
||||
|
|
@ -31,10 +31,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="card card-dark">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-file mr-2"></i>Document Templates</h3>
|
||||
<button type="button" class="btn btn-dark dropdown-toggle ml-1" data-toggle="dropdown"></button>
|
||||
<div class="dropdown-menu">
|
||||
<a class="dropdown-item text-dark" href="client_documents.php?client_id=<?php echo $client_id; ?>">Documents</a>
|
||||
</div>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addDocumentTemplateModal">
|
||||
<i class="fas fa-plus mr-2"></i>New Template
|
||||
|
|
@ -44,7 +40,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
<div class="card-body">
|
||||
|
||||
<form autocomplete="off">
|
||||
<input type="hidden" name="client_id" value="<?php echo $client_id; ?>">
|
||||
<div class="input-group">
|
||||
<input type="search" class="form-control " name="q" value="<?php if (isset($q)) { echo stripslashes(nullable_htmlentities($q)); } ?>" placeholder="Search templates">
|
||||
<div class="input-group-append">
|
||||
|
|
@ -78,6 +73,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
while ($row = mysqli_fetch_array($sql)) {
|
||||
$document_id = intval($row['document_id']);
|
||||
$document_name = nullable_htmlentities($row['document_name']);
|
||||
$document_description = nullable_htmlentities($row['document_description']);
|
||||
$document_content = nullable_htmlentities($row['document_content']);
|
||||
$document_created_at = nullable_htmlentities($row['document_created_at']);
|
||||
$document_updated_at = nullable_htmlentities($row['document_updated_at']);
|
||||
|
|
@ -87,7 +83,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<tr>
|
||||
<td>
|
||||
<a href="client_document_template_details.php?client_id=<?php echo $client_id; ?>&document_id=<?php echo $document_id; ?>"><i class="fas fa-fw fa-file-alt"></i> <?php echo $document_name; ?></a>
|
||||
<a href="document_template_details.php?document_id=<?php echo $document_id; ?>"><i class="fas fa-fw fa-file-alt"></i> <?php echo $document_name; ?></a>
|
||||
<small class="text-secondary mt-1"><?php echo $document_description; ?></small>
|
||||
</td>
|
||||
<td><?php echo $document_created_at; ?></td>
|
||||
<td><?php echo $document_updated_at; ?></td>
|
||||
|
|
@ -113,7 +110,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
|
||||
<?php
|
||||
|
||||
include("client_document_template_edit_modal.php");
|
||||
include("document_template_edit_modal.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -127,6 +124,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
|
|||
</div>
|
||||
|
||||
|
||||
<?php include("client_document_template_add_modal.php"); ?>
|
||||
<?php include("document_template_add_modal.php"); ?>
|
||||
|
||||
<?php include("footer.php"); ?>
|
||||
|
|
@ -128,6 +128,13 @@
|
|||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a href="settings_document_templates.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "settings_document_templates.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-file"></i>
|
||||
<p>Document Templates</p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-header mt-3">SETTINGS</li>
|
||||
|
||||
<li class="nav-item">
|
||||
|
|
|
|||
Loading…
Reference in New Issue