Files and documents everywhere else: asset and contact quick looks list their documents and files with the same tiles and rows as the document page, files opening their quick look instead of a raw download; client overview share links show document and file tiles and open the document page or file quick look; service quick look shows linked documents as tiles and leaves out archived ones, service add and edit document pickers carry an icon and summary; global search shows file and document type tiles in the palette and on the results page, and a file result opens its folder narrowed to that file; quote attachments show their tile and size, open the file quick look and download through file.php instead of linking straight into the uploads folder; ticket attachments show their file type tile; client portal documents list shows the document tile, folder and summary with the last updated date; removed unused modals/asset/asset_documents.php

This commit is contained in:
johnnyq
2026-10-14 20:47:30 -04:00
parent 1a613eab7b
commit 6ff9dbe9a4
15 changed files with 124 additions and 145 deletions

View File

@@ -133,7 +133,7 @@ if (isset($_GET['quote_id'])) {
// Quote File Attachments
$sql_quote_files = mysqli_query(
$mysqli,
"SELECT file_reference_name, file_name, file_created_at FROM quote_files LEFT JOIN files ON quote_files.file_id = files.file_id WHERE quote_id = $quote_id"
"SELECT files.file_id, file_name, file_ext, file_size, file_created_at FROM quote_files JOIN files ON quote_files.file_id = files.file_id WHERE quote_id = $quote_id AND file_archived_at IS NULL ORDER BY file_name ASC"
);
?>
@@ -526,30 +526,31 @@ if (isset($_GET['quote_id'])) {
</div>
</div>
<div class="card-body">
<table class="table">
<thead>
<?php /* Through the file quick look and agent/file.php, which check access -
not a link straight into the uploads folder */ ?>
<table class="table table-hover align-middle mb-0">
<thead class="table-light">
<tr>
<th>File Name</th>
<th>Upload date</th>
<th>File</th>
<th>Uploaded</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while ($quote_file = mysqli_fetch_assoc($sql_quote_files)) {
$name = escapeHtml($quote_file['file_name']);
$ref_name = escapeHtml($quote_file['file_reference_name']);
$created = escapeHtml($quote_file['file_created_at']);
?>
<?php while ($quote_file = mysqli_fetch_assoc($sql_quote_files)) {
$quote_file_id = intval($quote_file['file_id']); ?>
<tr>
<td><a target="_blank" href="../uploads/clients/<?= $client_id ?>/<?= $ref_name ?>"><?= $name ?></a></td>
<td><?= $created ?></td>
<td>
<div class="d-flex align-items-center gap-2">
<?= fileTypeTile($quote_file['file_ext'], 'sm') ?>
<a class="ajax-modal text-break" href="#" data-modal-size="lg" data-modal-url="modals/file/file.php?id=<?= $quote_file_id ?>"><?= escapeHtml($quote_file['file_name']) ?></a>
<span class="small text-body-secondary text-nowrap"><?= formatBytes(intval($quote_file['file_size'])) ?></span>
</div>
</td>
<td class="small text-nowrap" title="<?= escapeHtml($quote_file['file_created_at']) ?>"><?= timeAgo($quote_file['file_created_at']) ?></td>
<td class="text-end"><a class="btn btn-sm btn-light" href="file.php?file_id=<?= $quote_file_id ?>" title="Download"><i class="fas fa-fw fa-download"></i></a></td>
</tr>
<?php
}
?>
<?php } ?>
</tbody>
</table>
</div>