When sorting ticket, they are sorted numerically.
How can we sort the statuses by their name?
Here is an example
Status 1 = Open
Status 2 = Closed
Status 3 = Monitor
So if i sort by status, they will list as open, closed, monitor or the other way around which obviously is not alphabetical.
Sort tickets by Status
Moderator: mkoch227
Re: Sort tickets by Status
Since the status names aren't in the database but numbers representing statuses, you would need a custom ORDER BY CASE query. Something like
This would sort by status 3, 4, 1, 0 and last status 2.
Of course, you will need to modify this to fit your needs/exact status values and names.
Code: Select all
ORDER BY CASE status
WHEN '3' THEN 1
WHEN '4' THEN 2
WHEN '1' THEN 3
WHEN '0' THEN 4
WHEN '2' THEN 5
END
Of course, you will need to modify this to fit your needs/exact status values and names.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
Re: Sort tickets by Status
The order by code is generated inside inc/prepare_ticket_search.inc.php, you will need to do some tweaking to fit the required order by correctly. The exact code is up to you I'm afraid as it's not officially supported.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
-
- Posts: 94
- Joined: Wed Feb 29, 2012 2:00 am
Re: Sort tickets by Status
The status and priority value are not stored in the table, made it difficult to manage it.
Eagle
Life is a journey.
Life is a journey.
Re: Sort tickets by Status
Of course they are, just not as words (because these change with translations), but as digits representing them.
If you look inside "inc/print_tickets.inc.php" you will find these matching values:
Statuses:
Priority:
If you look inside "inc/print_tickets.inc.php" you will find these matching values:
Statuses:
Code: Select all
0 => 'NEW'
1 => 'WAITING REPLY'
2 => 'REPLIED'
3 => 'RESOLVED (CLOSED)'
4 => 'IN PROGRESS'
5 => 'ON HOLD'
Code: Select all
0 => 'CRITICAL'
1 => 'HIGH'
2 => 'MEDIUM'
3 => 'LOW'
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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