change the ticket overview columns @ home of the admin panel
Moderator: mkoch227
change the ticket overview columns @ home of the admin panel
Script URL:
Version of script: 2.3
Hosting company: hostgator
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: modify ticket overview columns, modify ticket table, change ticket overview
Write your message below:
Hello,
I have been digging through the code and cannot find out where the columns are being requested for the ticket overview...
Is it possible to modify the homepage for admins to display the category as a column, and then the Ticket Number instead of the tracking ID???? I am fairly confident to go through and modify some code.. I have accomplished several other things I think I will post here.
Version of script: 2.3
Hosting company: hostgator
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution: modify ticket overview columns, modify ticket table, change ticket overview
Write your message below:
Hello,
I have been digging through the code and cannot find out where the columns are being requested for the ticket overview...
Is it possible to modify the homepage for admins to display the category as a column, and then the Ticket Number instead of the tracking ID???? I am fairly confident to go through and modify some code.. I have accomplished several other things I think I will post here.
Re: change the ticket overview columns @ home of the admin p
To modify which columns are shown and to add new ones follow the steps outlined in this thread.
viewtopic.php?f=14&t=3036&p=15624&hilit ... ist#p15624
To list Ticket Number instead of Tracking ID
Open inc/ticket_list.inc.php
Change
To
Also change
To
Also to allow for sorting of the column
Open inc/prepare_ticket_search.inc.php
Under
Add
Where 1 = your desired default sort setting . asc(1)/desc(0)
viewtopic.php?f=14&t=3036&p=15624&hilit ... ist#p15624
To list Ticket Number instead of Tracking ID
Open inc/ticket_list.inc.php
Change
Code: Select all
<td class="$color" style="text-align:left; white-space:nowrap;"><a href="admin_ticket.php?track=$ticket[trackid]&Refresh=$random">$ticket[trackid]</a></td>
Code: Select all
<td class="$color" style="text-align:left; white-space:nowrap;"><a href="admin_ticket.php?track=$ticket[trackid]&Refresh=$random">$ticket[id]</a></td>
Code: Select all
<th class="admin_white" style="text-align:left; white-space:nowrap;"><a href="<?php echo $href . '?' . $query . $sort_possible['trackid'] . '&sort='; ?>trackid"><?php echo $hesklang['trackID']; ?></a></th>
Code: Select all
<th class="admin_white" style="text-align:left; white-space:nowrap;"><a href="<?php echo $href . '?' . $query . $sort_possible['id'] . '&sort='; ?>trackid"><?php echo $hesklang['seqid']; ?></a></th>
Open inc/prepare_ticket_search.inc.php
Under
Code: Select all
$sort_possible = array(
Code: Select all
'id' => 1,
-Steve
Re: change the ticket overview columns @ home of the admin p
thanks man, I will probably get cracking on this today, will come back with my results!
Re: change the ticket overview columns @ home of the admin p
i may be able to figure this out from the code provided.. but what about one of the columns in the ticket list containing "category" instead of "last replier"
Re: change the ticket overview columns @ home of the admin p
I did get the ticket number to show up now instead of tracking ID...
I also have category showing up, ofcourse its the category ID.... Would I have to do a table join to get the actual category name to show up? or is there something i should be using besides "category"
I also have category showing up, ofcourse its the category ID.... Would I have to do a table join to get the actual category name to show up? or is there something i should be using besides "category"
Re: change the ticket overview columns @ home of the admin p
That one is a little beyond me. Maybe Klemen can help you out with that.
I use categories as companies, so it is important to me which company a ticket is in.
I use the group by category (company) option the show tickets box on the admin_main.php, this group all tickets by category (company) which i prefer as I already have a fair bit of information in my admin ticket list.
I use categories as companies, so it is important to me which company a ticket is in.
I use the group by category (company) option the show tickets box on the admin_main.php, this group all tickets by category (company) which i prefer as I already have a fair bit of information in my admin ticket list.
-Steve
Re: change the ticket overview columns @ home of the admin p
cool, ya I appreciate your help Steve. I'm pretty sure I'd have to know how to do a table join in PHP.. as the category ID name is defined by an entirely separate table, the ticket table just knows it's category via a numeric value.
I know you can group by category, so you don't necessarily need it as a column.. I'd like to accomplish this though as it is not a request by me.
I know you can group by category, so you don't necessarily need it as a column.. I'd like to accomplish this though as it is not a request by me.
Re: change the ticket overview columns @ home of the admin p
You should be able to get the category name using $hesk_settings['categories'] array when printing tickets.
As you already know $ticket['category'] contains the ID, to get the name this should work:
As you already know $ticket['category'] contains the ID, to get the name this should work:
Code: Select all
$hesk_settings['categories'][$ticket['category']]
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: change the ticket overview columns @ home of the admin p
Thanks Klemin,
This is how I acccomplished categories instead of last reply changing the ticket_list.inc.php
So I added that line at the end of both instances of
Here is the example where I found that and how it looks now, with no change to the categories column..
This is how I acccomplished categories instead of last reply changing the ticket_list.inc.php
Code: Select all
<td class="$color">$ticket[category]</td>
Code: Select all
[$ticket['category']]
Code: Select all
$hesk_settings['categories']
Code: Select all
/* List of categories */
$hesk_settings['categories'][$ticket['category']] = array();
$sql2 = 'SELECT `id`, `name` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'categories` WHERE ' . hesk_myCategories('id') . ' ORDER BY `cat_order` ASC';
$res2 = hesk_dbQuery($sql2);
while ($row=hesk_dbFetchAssoc($res2))
{
$hesk_settings['categories'][$ticket['category']][$row['id']] = $row['name'];
}
Re: change the ticket overview columns @ home of the admin p
hm i also tried adding it here in the ticket_list.inc.php file but it broked it.
Code: Select all
$ticket['message'] = $first_line . substr(strip_tags($ticket['message']),0,200).'...';
echo <<<EOC
<tr title="$ticket[message]">
<td class="$color" style="text-align:left; white-space:nowrap;"><input type="checkbox" name="id[]" value="$ticket[id]" /> </td>
<td class="$color" style="text-align:left; white-space:nowrap;"><a href="admin_ticket.php?track=$ticket[trackid]&Refresh=$random">$ticket[id]</a></td>
<td class="$color">$ticket[lastchange]</td>
<td class="$color">$ticket[name]</td>
<td class="$color">$tagged$owner<a href="admin_ticket.php?track=$ticket[trackid]&Refresh=$random">$ticket[subject]</a></td>
<td class="$color">$ticket[status] </td>
<td class="$color">$hesk_settings['categories'][$ticket[category]]</td>
<td class="$color" style="text-align:center; white-space:nowrap;">$ticket[priority] </td>
</tr>
Re: change the ticket overview columns @ home of the admin p
Remove quotes from variable names, you can't use single quotes within <<<EOC block.
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: change the ticket overview columns @ home of the admin p
oh whoops, still confused as to where I need to put this..
doing this to the ticket_list.inc.php prefixed the category ID with "array" (2nd to last <td class)

doing this to the ticket_list.inc.php prefixed the category ID with "array" (2nd to last <td class)
Code: Select all
echo <<<EOC
<tr title="$ticket[message]">
<td class="$color" style="text-align:left; white-space:nowrap;"><input type="checkbox" name="id[]" value="$ticket[id]" /> </td>
<td class="$color" style="text-align:left; white-space:nowrap;"><a href="admin_ticket.php?track=$ticket[trackid]&Refresh=$random">$ticket[id]</a></td>
<td class="$color">$ticket[lastchange]</td>
<td class="$color">$ticket[name]</td>
<td class="$color">$tagged$owner<a href="admin_ticket.php?track=$ticket[trackid]&Refresh=$random">$ticket[subject]</a></td>
<td class="$color">$ticket[status] </td>
<td class="$color">$hesk_settings[categories]$ticket[category]</td>
<td class="$color" style="text-align:center; white-space:nowrap;">$ticket[priority] </td>
</tr>

Re: change the ticket overview columns @ home of the admin p
It should be - just remove single quotes from the previous version you had.
Code: Select all
$hesk_settings[categories][$ticket[category]]
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: change the ticket overview columns @ home of the admin p
that is what I have, it switched it from containing just the category ID to prefixing the category Id number with array
this is how it looks now
the category field populates like this

this is how it looks now
Code: Select all
<td class="$color">$hesk_settings[categories]$ticket[category]</td>

Re: change the ticket overview columns @ home of the admin p
also, I tried the code exactly how you have it layed out
that just put's brackets around the category ID.... so it seems $hesk_settings[categories] is just pulling "array" instead of the category name =(.. does it need another line of code to read category id and match it up with the category name?.. I know in the hesk_tickets table all it contains is the category ID,, to pump out the category name in a sql query I have to do a table join with hesk_categories...

This is how i get a table to display the category name instead of ID in mysql query.
Code: Select all
<td class="$color">$hesk_settings[categories][$ticket[category]]</td>

This is how i get a table to display the category name instead of ID in mysql query.
Code: Select all
FROM hesk_tickets, hesk_categories
WHERE ( hesk_categories.id=hesk_tickets.category)