Group by Owner display

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
smegnl
Posts: 24
Joined: Wed Jun 20, 2012 8:40 pm

Group by Owner display

Post by smegnl »

Script URL: internal
Version of script: 2.4 RC
Hosting company: internal
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: Group Owner

Write your message below:
When using Group by Owner, is there a way to have the logged in owners tickets be the top group below the unassigned? So if Steve logs in, his tickets are the top group. If Ted logs in, then Ted's tickets are the top group and not have to scroll down the page to see his tickets. I dont care if "unassigned" are the top most group.
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Group by Owner display

Post by Klemen »

Good idea!

Now, I haven't had time to test this thoroughly, but it seems to work just fine:

1. open file "inc/prepare_ticket_search.inc.php"

2. find this code

Code: Select all

    if ($group == 'priority' && isset($_GET['sort']) && $_GET['sort'] == 'priority')
    {
		// No need to group by priority if we are already sorting by priority
    }
3. just BELOW that code paste

Code: Select all

    elseif ($group == 'owner')
    {
		$sql .= " CASE WHEN `owner` = '".hesk_dbEscape($_SESSION['id'])."' THEN 1 ELSE 0 END DESC, ";
    }
4. Save, upload and test.
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
smegnl
Posts: 24
Joined: Wed Jun 20, 2012 8:40 pm

Re: Group by Owner display

Post by smegnl »

Close....
It did group the owner at the top, but all the other tickets not owned by him were scattered below. The unassigned or owned by other people were not grouped together. Made it hard to find unassigned tickets.Image
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Group by Owner display

Post by Klemen »

How about

Code: Select all

    elseif ($group == 'owner')
    {
		$sql .= " CASE WHEN `owner` = '".hesk_dbEscape($_SESSION['id'])."' THEN 1 ELSE 0 END DESC, `owner` ASC, ";
    }
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
smegnl
Posts: 24
Joined: Wed Jun 20, 2012 8:40 pm

Re: Group by Owner display

Post by smegnl »

With the two logins I had to test with look good. This will be the icing on the cake!!!
Post Reply