mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Fix Ticket Watchers not getting emails when No Contact is selected on a ticket, and add the ability to link files in contact details
This commit is contained in:
@@ -98,7 +98,7 @@ if (isset($_GET['contact_id'])) {
|
||||
$sql_related_notes = mysqli_query($mysqli, "SELECT * FROM contact_notes LEFT JOIN users ON contact_note_created_by = user_id WHERE contact_note_contact_id = $contact_id AND contact_note_archived_at IS NULL ORDER BY contact_note_created_at DESC");
|
||||
$note_count = mysqli_num_rows($sql_related_notes);
|
||||
|
||||
// Documents
|
||||
// Linked Documents
|
||||
$sql_linked_documents = mysqli_query($mysqli, "SELECT * FROM contact_documents, documents
|
||||
LEFT JOIN users ON document_created_by = user_id
|
||||
WHERE contact_documents.contact_id = $contact_id
|
||||
@@ -111,6 +111,17 @@ if (isset($_GET['contact_id'])) {
|
||||
|
||||
$linked_documents = array();
|
||||
|
||||
// Linked Files
|
||||
$sql_linked_files = mysqli_query($mysqli, "SELECT * FROM contact_files, files
|
||||
WHERE contact_files.contact_id = $contact_id
|
||||
AND contact_files.file_id = files.file_id
|
||||
AND file_archived_at IS NULL
|
||||
ORDER BY file_name ASC"
|
||||
);
|
||||
$file_count = mysqli_num_rows($sql_linked_files);
|
||||
|
||||
$linked_files = array();
|
||||
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
@@ -237,7 +248,7 @@ if (isset($_GET['contact_id'])) {
|
||||
<i class="fa fa-fw fa-folder mr-2"></i>Document
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#createContactNoteModal<?php echo $contact_id; ?>">
|
||||
<a class="dropdown-item text-dark" href="#" data-toggle="modal" data-target="#linkFileModal">
|
||||
<i class="fa fa-fw fa-paperclip mr-2"></i>File
|
||||
</a>
|
||||
|
||||
@@ -733,6 +744,69 @@ if (isset($_GET['contact_id'])) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-dark <?php if ($file_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header py-2">
|
||||
<h3 class="card-title mt-2"><i class="fa fa-fw fa-folder mr-2"></i>Linked Files</h3>
|
||||
<div class="card-tools">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#linkFileModal">
|
||||
<i class="fas fa-link mr-2"></i>Link File
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive-sm">
|
||||
<table class="table table-striped table-borderless table-hover dataTables" style="width:100%">
|
||||
<thead class="text-dark">
|
||||
<tr>
|
||||
<th>File Name</th>
|
||||
<th>Type</th>
|
||||
<th>Size</th>
|
||||
<th>Uploaded</th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
while ($row = mysqli_fetch_array($sql_linked_files)) {
|
||||
$file_id = intval($row['file_id']);
|
||||
$file_name = nullable_htmlentities($row['file_name']);
|
||||
$file_description = nullable_htmlentities($row['file_description']);
|
||||
$file_size = nullable_htmlentities($row['file_size']);
|
||||
$file_size_KB = round($file_size / 1024);
|
||||
$file_reference_name = nullable_htmlentities($row['file_reference_name']);
|
||||
$file_mime_type = nullable_htmlentities($row['file_mime_type']);
|
||||
$file_created_at = nullable_htmlentities($row['file_created_at']);
|
||||
|
||||
$linked_files[] = $file_id;
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div><a href="uploads/clients/<?php echo $client_id; ?>/<?php echo $file_reference_name; ?>"><?php echo $file_name; ?></a></div>
|
||||
<div class="text-secondary"><?php echo $file_description; ?></div>
|
||||
</td>
|
||||
<td><?php echo $file_mime_type; ?></td>
|
||||
<td><?php echo $file_size_KB; ?> KB</td>
|
||||
<td><?php echo $file_created_at; ?></td>
|
||||
<td class="text-center">
|
||||
<a href="post.php?unlink_contact_from_file&contact_id=<?php echo $contact_id; ?>&file_id=<?php echo $file_id; ?>" class="btn btn-secondary btn-sm" title="Unlink"><i class="fas fa-fw fa-unlink"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-dark <?php if ($note_count == 0) { echo "d-none"; } ?>">
|
||||
<div class="card-header py-2">
|
||||
@@ -876,7 +950,8 @@ if (isset($_GET['contact_id'])) {
|
||||
require_once "client_contact_create_note_modal.php";
|
||||
require_once "ticket_add_modal.php";
|
||||
require_once "client_contact_link_asset_modal.php";
|
||||
require_once "client_contact_link_document_modal.php";
|
||||
require_once "client_contact_link_credential_modal.php";
|
||||
require_once "client_contact_link_document_modal.php";
|
||||
require_once "client_contact_link_file_modal.php";
|
||||
|
||||
require_once "footer.php";
|
||||
|
||||
Reference in New Issue
Block a user