Page 1 of 2

Configuring columns in the open ticket view

Posted: Mon Jun 17, 2013 6:17 pm
by profdelapaz
Script URL:
Version of script: 2.4.2
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: hesk open tickets columns

Write your message below:
Is it possible to add/remove/rearrange columns on the open tickets page? We're using HESK as an internal ticket system for ongoing projects, and the person submitting the ticket isn't necessarily the one who is working on it. I'd like to be able to view the name of the owner of the ticket, rather than the name of the person who submitted the ticket.
I looked through the inc files but couldn't figure out exactly what needs to be modified. I'm sure it can be done by changing the SQL query but my SQL skills aren't great.

Thanks.

Re: Configuring columns in the open ticket view

Posted: Mon Jun 17, 2013 7:19 pm
by profdelapaz
Ok, digging a bit more, it looks like HESK records the ticket owner as an integer which correlates to the user's ID.
So I'm trying to run this from ticket_list.inc.php inside the while($ticket=...") loop right before the info is written to the page:

$sql_name = "SELECT `name` from `hesk_users` where `id`=" . $ticket[owner];
$result_name = hesk_dbQuery($SQL);

but the page fails with "Can't execute SQL, please notify webmaster..."

Any idea what I'm doing wrong here?

Re: Configuring columns in the open ticket view

Posted: Mon Jun 17, 2013 7:25 pm
by profdelapaz
Whoops, that second line should have been

Code: Select all

$result_name = hesk_dbQuery($sql_name);
Now it runs without error but it's not returning the name...

Re: Configuring columns in the open ticket view

Posted: Mon Jun 17, 2013 7:45 pm
by Klemen
Staff names are already defined in an array, so you could try just using

Code: Select all

$admins[$ticket[owner]]
to show the name in the while loop.

So instead of

Code: Select all

<td class="$color">$ticket[name]</td>
you can try

Code: Select all

<td class="$color">$admins[$ticket[owner]]</td>

Re: Configuring columns in the open ticket view

Posted: Mon Jun 17, 2013 7:50 pm
by profdelapaz
That actually causes the page to come up blank... I got it working with the following code:

Code: Select all

$sql_name = "SELECT `name` from `hesk_users` where `id`=" . $ticket[owner];
$result_name = hesk_dbQuery($sql_name);
$result_name2 = hesk_dbFetchAssoc($result_name);
and then a bit lower

Code: Select all

<td class="$color">$result_name2[name]</td>
Seems to work well, though your way would be more straightforward and require less SQL queries.

Re: Configuring columns in the open ticket view

Posted: Mon Jun 17, 2013 7:53 pm
by profdelapaz
I'd also like to be able to sort the rows by owner name... do you have another quick solution before I spend hours trying to figure it out?

Re: Configuring columns in the open ticket view

Posted: Mon Jun 17, 2013 8:02 pm
by profdelapaz
One more thing, what's going to happen when we update to the next version? Will I lose these changes?

Re: Configuring columns in the open ticket view

Posted: Tue Jun 18, 2013 2:31 pm
by Klemen
I'm afraid I don't have any code/guide written to modify sorting.

And yes, a new version will overwrite any changes you make, so I would recommend keeping notes on exactly what you have changed, so you can apply that to a future version if you decide to upgrade.

Re: Configuring columns in the open ticket view

Posted: Tue Jun 18, 2013 3:06 pm
by profdelapaz
Will do. Maybe you can work these changes into the next version :D

Re: Configuring columns in the open ticket view

Posted: Tue Jun 18, 2013 3:10 pm
by Klemen
It won't be available in 2.5.0, because this version is almost ready for release. But maybe in one of the future ones :wink:

Re: Configuring columns in the open ticket view

Posted: Sun Jun 23, 2013 1:25 pm
by bastiaan.c
Hello, The Owner is now a number for me (user id):

Tracking ID Created on Updated Name Subject Status Owner Last replier Sort by Priority
JZU-2NE-9ZVQ 6-Jun-2013
14:28:36 1d5h Bas * Backup Management Replied 1 Bret

What can I do to make the user id a name (this should be the assigned user)

Re: Configuring columns in the open ticket view

Posted: Wed Jun 26, 2013 12:28 pm
by akwil
Hi Bastiaan,
I actually have the same question to Klemen.
I renamed the Last replier to Owner. I need to have information who is the owner of the ticket.
When i put owner in few places it shows me the number not the owner name...
I dont need to order by it i only need to see the owner...

Klemen we need your help cheers.

Re: Configuring columns in the open ticket view

Posted: Wed Jun 26, 2013 1:57 pm
by Klemen
A working solution has been posted a few replies up.

This should also work: in inc/ticket_list.inc.php find

Code: Select all

echo <<<EOC
Just ABOVE that code add

Code: Select all

$ticket['owner'] = isset($admins[$ticket['owner']]) ? $admins[$ticket['owner']] : '<i>'.$hesklang['unas'].'</i>';
Then the $ticket[owner] variable should display the name instead of number.

Re: Configuring columns in the open ticket view

Posted: Wed Jun 26, 2013 2:16 pm
by bastiaan.c
Thanks so much for this, but the page go's blank!

Please help :-)

Re: Configuring columns in the open ticket view

Posted: Wed Jun 26, 2013 4:21 pm
by Klemen
The last one I posted works for me - tested.

After echo <<<EOC make sure you use $ticket[owner] (without quotes around "owner" - this will not work: $ticket['owner'] ).