Hello,
How do I make the default ticket listing sorted by latest update?
Thanks.
Sort tickets by latest update
Moderator: mkoch227
Re: Sort tickets by latest update
Around line 158, find:
change to:
This will return the oldest ticket on top with the newest update at the bottom. To reverse this, right below that, find:
and change to
Save, upload, and test.
Code: Select all
/* Default sorting by ticket status */
$sql .= ' `status` ';
$sort = 'status';
Code: Select all
/* Default sorting by ticket status */
$sql .= ' `lastchange` ';
$sort = 'lastchange';
Code: Select all
/* Ascending or Descending? */
if (isset($_GET['asc']) && intval($_GET['asc'])==0)
{
$sql .= ' DESC ';
$asc = 0;
$asc_rev = 1;
$sort_possible[$sort] = 1;
}
else
{
$sql .= ' ASC ';
$asc = 1;
$asc_rev = 0;
if (!isset($_GET['asc']))
{
$is_default = 1;
}
$sort_possible[$sort] = 0;
}
Code: Select all
/* Ascending or Descending? */
if (isset($_GET['asc']) && intval($_GET['asc'])==1)
{
$sql .= ' ASC ';
$asc = 1;
$asc_rev = 0;
if (!isset($_GET['asc']))
{
$is_default = 1;
}
$sort_possible[$sort] = 0;
}
else
{
$sql .= ' DESC ';
$asc = 0;
$asc_rev = 1;
$sort_possible[$sort] = 1;
}
Mike, Lead Developer of
HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
Re: Sort tickets by latest update
Thank you for your reply, on which file is this change done?
Re: Sort tickets by latest update
Whoops, that might be helpful. The file is inc/prepare_ticket_search.inc.php
Mike, Lead Developer of
HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
Re: Sort tickets by latest update
Thanks, that was very helpful.