mirror of
https://github.com/itflow-org/itflow
synced 2026-03-01 11:24:52 +00:00
Documents and Document Template Fixes, Fixed issue not displaying foldername in the breadcrumbs under document details. When Creating a document from template didnt redirect to the right place for editing. eliminated folder get var in document details as its unneeded
This commit is contained in:
@@ -18,23 +18,8 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea class="form-control summernote" name="content"></textarea>
|
<textarea class="form-control summernote" name="content"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-footer bg-white">
|
<div class="form-group">
|
||||||
|
|
||||||
<div class="form-group mr-auto">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-info-circle"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control" name="template">
|
|
||||||
<option value="0">Document</option>
|
|
||||||
<option value="1">Template</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group ml-auto">
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||||
@@ -56,10 +41,10 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer bg-white">
|
||||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||||
<button type="submit" name="add_document" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Create</button>
|
<button type="submit" name="add_document" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Create</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(isset($_GET['folder_id'])){
|
|
||||||
$folder_id = intval($_GET['folder_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($_GET['document_id'])){
|
if(isset($_GET['document_id'])){
|
||||||
$document_id = intval($_GET['document_id']);
|
$document_id = intval($_GET['document_id']);
|
||||||
}
|
}
|
||||||
@@ -14,8 +10,8 @@ if(isset($_GET['document_id'])){
|
|||||||
$sql_document = mysqli_query($mysqli,"SELECT * FROM documents LEFT JOIN folders ON document_folder_id = folder_id WHERE document_client_id = $client_id AND document_id = $document_id AND documents.company_id = $session_company_id");
|
$sql_document = mysqli_query($mysqli,"SELECT * FROM documents LEFT JOIN folders ON document_folder_id = folder_id WHERE document_client_id = $client_id AND document_id = $document_id AND documents.company_id = $session_company_id");
|
||||||
|
|
||||||
$row = mysqli_fetch_array($sql_document);
|
$row = mysqli_fetch_array($sql_document);
|
||||||
$folder_name = $row['folder_name'];
|
|
||||||
|
|
||||||
|
$folder_name = htmlentities($row['folder_name']);
|
||||||
$document_name = htmlentities($row['document_name']);
|
$document_name = htmlentities($row['document_name']);
|
||||||
$document_content = $row['document_content'];
|
$document_content = $row['document_content'];
|
||||||
$document_created_at = $row['document_created_at'];
|
$document_created_at = $row['document_created_at'];
|
||||||
@@ -37,9 +33,9 @@ $document_folder_id = $row['document_folder_id'];
|
|||||||
<li class="breadcrumb-item">
|
<li class="breadcrumb-item">
|
||||||
<a href="client_documents.php?client_id=<?php echo $client_id; ?>">Documents</a>
|
<a href="client_documents.php?client_id=<?php echo $client_id; ?>">Documents</a>
|
||||||
</li>
|
</li>
|
||||||
<?php if($folder_id > 0){ ?>
|
<?php if($document_folder_id > 0){ ?>
|
||||||
<li class="breadcrumb-item">
|
<li class="breadcrumb-item">
|
||||||
<a href="client_documents.php?client_id=<?php echo $client_id; ?>&folder_id=<?php echo $folder_id; ?>"><i class="fas fa-folder-open"></i> <?php echo $folder_name; ?></a>
|
<a href="client_documents.php?client_id=<?php echo $client_id; ?>&folder_id=<?php echo $document_folder_id; ?>"><i class="fas fa-folder-open"></i> <?php echo $folder_name; ?></a>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<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"></i> <?php echo "$document_name"; ?></li>
|
||||||
|
|||||||
@@ -19,23 +19,7 @@
|
|||||||
<textarea class="form-control summernote" name="content"><?php echo $document_content; ?></textarea>
|
<textarea class="form-control summernote" name="content"><?php echo $document_content; ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="modal-footer bg-white">
|
|
||||||
|
|
||||||
<div class="form-group mr-auto">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-info-circle"></i></span>
|
|
||||||
</div>
|
|
||||||
<select class="form-control" name="template">
|
|
||||||
<option value="0">Document</option>
|
|
||||||
<option value="1">Template</option>
|
|
||||||
<option value="3">Global Template</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group ml-auto">
|
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||||
@@ -56,6 +40,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer bg-white">
|
||||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
|
||||||
<button type="submit" name="edit_document" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
<button type="submit" name="edit_document" class="btn btn-primary text-bold"><i class="fa fa-check"></i> Save</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="client_document_details.php?client_id=<?php echo $client_id; ?>&folder_id=<?php echo $document_folder_id; ?>&document_id=<?php echo $document_id; ?>"><i class="fas fa-fw fa-file-alt"></i> <?php echo $document_name; ?></a>
|
<a href="client_document_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>
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo $document_created_at; ?></td>
|
<td><?php echo $document_created_at; ?></td>
|
||||||
<td><?php echo $document_updated_at; ?></td>
|
<td><?php echo $document_updated_at; ?></td>
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ $config_currency_format = "US_en";
|
|||||||
|
|
||||||
// Theme
|
// Theme
|
||||||
$config_theme = $row['config_theme'];
|
$config_theme = $row['config_theme'];
|
||||||
$config_enable_dark_mode = "dark_mode";
|
$config_theme_mode = "dark_mode";
|
||||||
|
|
||||||
$colors_array = array(
|
$colors_array = array(
|
||||||
'blue',
|
'blue',
|
||||||
|
|||||||
5
post.php
5
post.php
@@ -6860,7 +6860,7 @@ if(isset($_POST['add_document_from_template'])){
|
|||||||
|
|
||||||
$_SESSION['alert_message'] = "Document created from template";
|
$_SESSION['alert_message'] = "Document created from template";
|
||||||
|
|
||||||
header("Location: client_document_template_details.php?client_id=$client_id&document_id=$document_id");
|
header("Location: client_document_details.php?client_id=$client_id&document_id=$document_id");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6879,11 +6879,10 @@ if(isset($_POST['edit_document'])){
|
|||||||
$content = trim(mysqli_real_escape_string($mysqli,$purifier->purify(html_entity_decode($_POST['content']))));
|
$content = trim(mysqli_real_escape_string($mysqli,$purifier->purify(html_entity_decode($_POST['content']))));
|
||||||
$content_raw = trim(mysqli_real_escape_string($mysqli, strip_tags($_POST['name'] . " " . str_replace("<", " <", $_POST['content']))));
|
$content_raw = trim(mysqli_real_escape_string($mysqli, strip_tags($_POST['name'] . " " . str_replace("<", " <", $_POST['content']))));
|
||||||
// Content Raw is used for FULL INDEX searching. Adding a space before HTML tags to allow spaces between newlines, bulletpoints, etc. for searching.
|
// Content Raw is used for FULL INDEX searching. Adding a space before HTML tags to allow spaces between newlines, bulletpoints, etc. for searching.
|
||||||
$template = intval($_POST['template']);
|
|
||||||
$folder = intval($_POST['folder']);
|
$folder = intval($_POST['folder']);
|
||||||
|
|
||||||
// Document edit query
|
// Document edit query
|
||||||
mysqli_query($mysqli,"UPDATE documents SET document_name = '$name', document_content = '$content', document_content_raw = '$content_raw', document_template = $template, document_folder_id = $folder WHERE document_id = $document_id AND company_id = $session_company_id");
|
mysqli_query($mysqli,"UPDATE documents SET document_name = '$name', document_content = '$content', document_content_raw = '$content_raw', document_folder_id = $folder WHERE document_id = $document_id AND company_id = $session_company_id");
|
||||||
|
|
||||||
//Logging
|
//Logging
|
||||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Modify', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id, company_id = $session_company_id");
|
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Document', log_action = 'Modify', log_description = '$name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id, company_id = $session_company_id");
|
||||||
|
|||||||
Reference in New Issue
Block a user