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.
Moderator: mkoch227
Code: Select all
$res = hesk_dbQuery("SELECT `trackid`, `status`, `subject` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` `tickets`
Code: Select all
$res = hesk_dbQuery("SELECT `dt`,`trackid`, `status`, `subject` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` `tickets`
Code: Select all
<?php echo hesk_date($past_ticket['dt'], true); ?>
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