Default Sort order of tickets

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
Amphicar770
Posts: 15
Joined: Fri Jun 05, 2009 9:33 pm

Default Sort order of tickets

Post 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
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Post 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` ';
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
scudd
Posts: 10
Joined: Tue Nov 16, 2010 1:01 am

Re: Default Sort order of tickets

Post 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..
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Default Sort order of tickets

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
scudd
Posts: 10
Joined: Tue Nov 16, 2010 1:01 am

Re: Default Sort order of tickets

Post by scudd »

many thanks..
sloscheider
Posts: 3
Joined: Fri Sep 11, 2009 6:49 pm

Re: Default Sort order of tickets

Post 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!
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Default Sort order of tickets

Post by Klemen »

Upgrade to version 2.3 - it supports selecting default settings for each individual user.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Mazurizi
Posts: 16
Joined: Wed Apr 18, 2012 9:07 am

Re: Default Sort order of tickets

Post 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.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Default Sort order of tickets

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Mazurizi
Posts: 16
Joined: Wed Apr 18, 2012 9:07 am

Re: Default Sort order of tickets

Post by Mazurizi »

Spot on Klemen, you're a legend.

Thanks for the prompt reply.
Post Reply