Page 1 of 1

Change Sort Default

Posted: Sat Mar 17, 2007 3:47 pm
by RazorElite
Hi, is there anyway to change how tickets are sorted by default. The default sort method is to sort by Priority. However, I rather sort my tickets by date, but it is time consuming to sort them each time I answer a ticket. So is there anyway to always have the tickets sorted by another option?

Thanks

Posted: Sun Mar 18, 2007 11:40 am
by Klemen
In the file inc/print_tickets.inc.php line 54 assigns the default value for sorting:

Code: Select all

$sort = hesk_input($_GET['sort']) or $sort='priority';
You can change 'priority' to some other default option:
trackid (ticket tracking ID)
dt (date)
and also name, subject, status

Note though that date is the date of creation of ticket, not last reply. That's coming in next version, but too complicated in this one to explain
viewtopic.php?t=1325

Posted: Sun Mar 18, 2007 10:12 pm
by RazorElite
Worked great. Thanks. Now Hesk is perfect for me. Way better than my last helpdesk software.

Posted: Tue Mar 27, 2007 3:26 pm
by gavking
What exactly needs to be done to make it sort descending? I've done the above and that works, but i'd like to see the oldest open tickets first.

Regards,
Gavin.

Posted: Tue Mar 27, 2007 4:23 pm
by Klemen
Hmm, try changing

Code: Select all

if (isset($_GET['asc']) && $_GET['asc']==0) {$sql .= " DESC ";$asc=0;$asc_rev=1;}
else {$sql .= " ASC ";$asc=1;$asc_rev=0;}
to

Code: Select all

if (isset($_GET['asc']) && $_GET['asc']==0) {$sql .= " ASC ";$asc=0;$asc_rev=1;}
else {$sql .= " DESC ";$asc=1;$asc_rev=0;}
Didn't test it though