Page 1 of 1

Default Sort order of tickets

Posted: Mon Jul 13, 2009 7:52 pm
by Amphicar770
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:
sort
Write your message below:

Hello,

How do I change the default order so that newest tickets show first instead of oldest tickets. I did do a search but the solve appears to be for an older version.

Thanks,

Mike

Posted: Mon Jul 13, 2009 8:04 pm
by Klemen
Open file print_tickets.inc.php located inside "inc" folder in Notepad and change

Code: Select all

$sql .= ' ORDER BY `status` ASC, `priority`';
to

Code: Select all

$sql .= ' ORDER BY `lastchange` ';
This will sort the tickets by "Last updated" by default. If you wish to order them by date submitted by default try this instead:

Code: Select all

$sql .= ' ORDER BY `dt` ';

Re: Default Sort order of tickets

Posted: Tue Nov 16, 2010 1:06 am
by scudd
Hello, does this apply to the latest version? I cant see that line..

I''d like to sort them by the last update, descending..

Re: Default Sort order of tickets

Posted: Tue Nov 16, 2010 4:23 pm
by Klemen
It should work with 2.2 too, but that code is now in the "prepare_ticket_search.inc.php" file.

I'm working on letting each staff choose their default sort order for future versions to avoid having to manually modify files.

Re: Default Sort order of tickets

Posted: Tue Nov 16, 2010 8:04 pm
by scudd
many thanks..

Re: Default Sort order of tickets

Posted: Thu Sep 22, 2011 3:52 pm
by sloscheider
I'd like to add that near the bottom of the file is a line like this:

$sql .= ' ASC ' ;

changing ASC to DESC in that line will change the sort from ASCending to DESCending - This seemed to do the trick for me but I don't know enough programming to say for sure it wont cause some other problem.

Thanks for the great product!

Re: Default Sort order of tickets

Posted: Sun Sep 25, 2011 2:22 pm
by Klemen
Upgrade to version 2.3 - it supports selecting default settings for each individual user.

Re: Default Sort order of tickets

Posted: Wed Apr 18, 2012 11:07 am
by Mazurizi
Hello Klemen,

I hate to bump old threads - but could you give me instructions of how to set the default search order by user? I'm guessing it is in the settings section? Although I can't see an option that relates to it.

Running version 2.3.

Thanks.

Re: Default Sort order of tickets

Posted: Wed Apr 18, 2012 12:12 pm
by Klemen
Hi,

On the admin main page scroll down to "Show tickets" and click "More options".

Select your desired sorting options, select the "Make this my default view" option and click "Show tickets".

This should remember your settings.

Re: Default Sort order of tickets

Posted: Wed Apr 18, 2012 1:05 pm
by Mazurizi
Spot on Klemen, you're a legend.

Thanks for the prompt reply.