Page 1 of 1
Feature Request: Display Date & Time Next to Subject in "Previous Tickets" Section
Posted: Sat Apr 26, 2025 4:28 am
by arsagor
Version of script: 3.5.2
Hosting company: Local Host
In the
"Previous Tickets" section, currently only the subject is displayed. If the date and time of each ticket could also be shown next to the subject, it would make tracking and reviewing tickets much easier.

Re: Feature Request: Display Date & Time Next to Subject in "Previous Tickets" Section
Posted: Sun Apr 27, 2025 10:40 am
by Klemen
You could add this easily by editing /admin/admin_ticket.php
Find
Code: Select all
$res = hesk_dbQuery("SELECT `trackid`, `status`, `subject` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` `tickets`
and change it to
Code: Select all
$res = hesk_dbQuery("SELECT `dt`,`trackid`, `status`, `subject` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` `tickets`
Then add
Code: Select all
<?php echo hesk_date($past_ticket['dt'], true); ?>
a few lines below where tickets are printed.
Example final code:
Code: Select all
// Get recent tickets, ordered by last change
$res = hesk_dbQuery("SELECT `dt`,`trackid`, `status`, `subject` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` `tickets`
WHERE ".hesk_myCategories()."
AND ".hesk_myOwnership()."
AND `id` <> ".$ticket['id']."
AND EXISTS (
SELECT 1
FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."ticket_to_customer`
WHERE `ticket_id` = `tickets`.`id`
AND `customer_id` = ".intval($first_customer['id'])."
)
ORDER BY `lastchange` DESC
LIMIT " . ($show_previous_tickets+1));
$past_num = hesk_dbNumRows($res);
?>
<section class="params--block details accordion <?php if ($past_num > 0) echo 'visible'; ?>">
<h4 class="accordion-title">
<span><?php echo $hesklang['previous_tickets']; ?></span>
<svg class="icon icon-chevron-down">
<use xlink:href="<?php echo HESK_PATH; ?>img/sprite.svg#icon-chevron-down"></use>
</svg>
</h4>
<div class="accordion-body" <?php if ($past_num > 0) echo 'style="display:block"'; ?>>
<?php
$i = 0;
while ($past_ticket = hesk_dbFetchAssoc($res)) {
$i++;
if ($i > $show_previous_tickets) {
hesk_dbFreeResult($res);
break;
}
?>
<div>
<?php if (isset($hesk_settings['statuses'][$past_ticket['status']]['class'])): ?>
<span class="dot bg-<?php echo $hesk_settings['statuses'][$past_ticket['status']]['class']; ?>" title="<?php echo $hesk_settings['statuses'][$past_ticket['status']]['name']; ?>"></span>
<?php else: ?>
<span class="dot" style="background-color:<?php echo $hesk_settings['statuses'][$past_ticket['status']]['color']; ?>" title="<?php echo $hesk_settings['statuses'][$past_ticket['status']]['name']; ?>"></span>
<?php endif; ?>
<?php echo hesk_date($past_ticket['dt'], true); ?><br>
<a href="admin_ticket.php?track=<?php echo $past_ticket['trackid']; ?>&Refresh=<?php echo rand(10000,99999); ?>"><?php echo $past_ticket['subject']; ?></a>
</div>
<?php
}
if ($past_num > 0 && $i > $show_previous_tickets) {
echo '<br><a href="find_tickets.php?q='.urlencode($first_customer['email']).'&what=email&s_my=1&s_ot=1&s_un=1">'.$hesklang['all_previous'].'</a>';
} elseif ($past_num == 0) {
echo sprintf($hesklang['no_previous'], hesk_htmlspecialchars($first_customer['email']));
}
?>
</div>
</section>
<?php
Re: Feature Request: Display Date & Time Next to Subject in "Previous Tickets" Section
Posted: Sun Apr 27, 2025 11:56 am
by arsagor
Hi Klemen,
Thank you very much for your reply. I made a small edit so that the subject appears first, followed by the date and time, like "Subject | Date Time." The code is working fine.
I hope this feature will be included in a future update.
