Configuring columns in the open ticket view

Helpdesk for my helpdesk software

Moderator: mkoch227

profdelapaz
Posts: 11
Joined: Mon Jun 17, 2013 6:10 pm

Configuring columns in the open ticket view

Post 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.
profdelapaz
Posts: 11
Joined: Mon Jun 17, 2013 6:10 pm

Re: Configuring columns in the open ticket view

Post 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?
profdelapaz
Posts: 11
Joined: Mon Jun 17, 2013 6:10 pm

Re: Configuring columns in the open ticket view

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

Re: Configuring columns in the open ticket view

Post 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>
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
profdelapaz
Posts: 11
Joined: Mon Jun 17, 2013 6:10 pm

Re: Configuring columns in the open ticket view

Post 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.
profdelapaz
Posts: 11
Joined: Mon Jun 17, 2013 6:10 pm

Re: Configuring columns in the open ticket view

Post 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?
profdelapaz
Posts: 11
Joined: Mon Jun 17, 2013 6:10 pm

Re: Configuring columns in the open ticket view

Post by profdelapaz »

One more thing, what's going to happen when we update to the next version? Will I lose these changes?
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Configuring columns in the open ticket view

Post 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.
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
profdelapaz
Posts: 11
Joined: Mon Jun 17, 2013 6:10 pm

Re: Configuring columns in the open ticket view

Post by profdelapaz »

Will do. Maybe you can work these changes into the next version :D
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Configuring columns in the open ticket view

Post 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:
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
bastiaan.c
Posts: 142
Joined: Sat Jun 22, 2013 9:24 pm

Re: Configuring columns in the open ticket view

Post 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)
akwil
Posts: 24
Joined: Fri May 24, 2013 10:00 am

Re: Configuring columns in the open ticket view

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

Re: Configuring columns in the open ticket view

Post 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.
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
bastiaan.c
Posts: 142
Joined: Sat Jun 22, 2013 9:24 pm

Re: Configuring columns in the open ticket view

Post by bastiaan.c »

Thanks so much for this, but the page go's blank!

Please help :-)
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Configuring columns in the open ticket view

Post 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'] ).
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
Post Reply