mirror of https://github.com/itflow-org/itflow
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:
parent
06cca61354
commit
c6cd1b0be7
|
|
@ -18,23 +18,8 @@
|
|||
<div class="form-group">
|
||||
<textarea class="form-control summernote" name="content"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group ml-auto">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
|
|
@ -56,10 +41,10 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<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>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,10 +2,6 @@
|
|||
|
||||
<?php
|
||||
|
||||
if(isset($_GET['folder_id'])){
|
||||
$folder_id = intval($_GET['folder_id']);
|
||||
}
|
||||
|
||||
if(isset($_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");
|
||||
|
||||
$row = mysqli_fetch_array($sql_document);
|
||||
$folder_name = $row['folder_name'];
|
||||
|
||||
$folder_name = htmlentities($row['folder_name']);
|
||||
$document_name = htmlentities($row['document_name']);
|
||||
$document_content = $row['document_content'];
|
||||
$document_created_at = $row['document_created_at'];
|
||||
|
|
@ -37,9 +33,9 @@ $document_folder_id = $row['document_folder_id'];
|
|||
<li class="breadcrumb-item">
|
||||
<a href="client_documents.php?client_id=<?php echo $client_id; ?>">Documents</a>
|
||||
</li>
|
||||
<?php if($folder_id > 0){ ?>
|
||||
<?php if($document_folder_id > 0){ ?>
|
||||
<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>
|
||||
<?php } ?>
|
||||
<li class="breadcrumb-item active"><i class="fas fa-file"></i> <?php echo "$document_name"; ?></li>
|
||||
|
|
|
|||
|
|
@ -18,24 +18,8 @@
|
|||
<div class="form-group">
|
||||
<textarea class="form-control summernote" name="content"><?php echo $document_content; ?></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<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="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-folder"></i></span>
|
||||
|
|
@ -55,7 +39,9 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer bg-white">
|
||||
<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>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
|||
|
||||
<tr>
|
||||
<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><?php echo $document_created_at; ?></td>
|
||||
<td><?php echo $document_updated_at; ?></td>
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ $config_currency_format = "US_en";
|
|||
|
||||
// Theme
|
||||
$config_theme = $row['config_theme'];
|
||||
$config_enable_dark_mode = "dark_mode";
|
||||
$config_theme_mode = "dark_mode";
|
||||
|
||||
$colors_array = array(
|
||||
'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";
|
||||
|
||||
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_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.
|
||||
$template = intval($_POST['template']);
|
||||
$folder = intval($_POST['folder']);
|
||||
|
||||
// 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
|
||||
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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue