Add Show Ticket Variables [Solved]

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
steve
Posts: 147
Joined: Tue Mar 27, 2012 9:32 pm

Add Show Ticket Variables [Solved]

Post by steve »

Hi,

I am trying to add a field to show_search_form_inc.

In the show ticket form, I want to check a box and click show tickets. I want it to show all tickets where custom10 =1.

Im note sure the code necessary to accomplish this. I want it similar to the code below, when I select this I will see only tickets with status 5.

Code: Select all

<td width="33%"><label><input type="checkbox" name="s5" value="1" <?php if (isset($status[5])) {echo 'checked="checked"';} ?>  /> <span class="onhold"><?php echo $hesklang['on_hold']; ?></span></td>
Last edited by steve on Mon Jun 04, 2012 7:11 pm, edited 1 time in total.
-Steve
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Help with show_search_form_inc

Post by Klemen »

Sorry, but this is another "out of my scope of support" question.

You would have to modify several files in several places (ticket_list.inc.php, print_tickets.inc.php,...)
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
steve
Posts: 147
Joined: Tue Mar 27, 2012 9:32 pm

Re: Help with show_search_form_inc

Post by steve »

Fair enough. Thanks!
-Steve
steve
Posts: 147
Joined: Tue Mar 27, 2012 9:32 pm

Re: Help with show_search_form_inc

Post by steve »

I am stumped, can you give me a hint?

Are the only files that need modification ticket_list.inc.php, print_tickets.inc.php and show_search_form.inc.php?
-Steve
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: Help with show_search_form_inc

Post by Klemen »

See how the "Show only tagged tickets" switch works - yours would probably be very similar.

For starters, try you can try changing

Code: Select all

`archive`=\'1\'
to

Code: Select all

`custom10`=\'1\'
in print_tickets.inc.php and see if selecting "Show tagged only" lists tickets with custom10 set to 1, then work from there.
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
steve
Posts: 147
Joined: Tue Mar 27, 2012 9:32 pm

Re: Help with show_search_form_inc

Post by steve »

Thank you so much. That is exactly what I needed.

On the show tickets portion of the main page, there is a ""Billable" heading with a check box that says "Display only Billable Tickets" When this checkbox is selected, only tickets with the custom10 field value of "Yes" will be shown.

For thoes that are interested this is exactly what I modified.

In Show_search_form.inc.php I added

Code: Select all

<tr>
<td class="borderTop"><b>Billable</b>: &nbsp;</td>
<td class="borderTop"><label><input type="checkbox" name="billable" value="1" <?php if ($billable[1]) echo 'checked="checked"'; ?> /> Display Billable Tickets Only</label></td>
<td width="33%">&nbsp;</td>
</tr>
Under

Code: Select all

<td width="33%">&nbsp;</td>
</tr>
<tr>
<td width="34%"><label><input type="radio" name="g" value="category" <?php if ($group == 'category') {echo 'checked="checked"';} ?> /> <?php echo $hesklang['category']; ?></label></td>
<td width="33%">&nbsp;</td>
</tr>
</table>
</td>
In Print_tickets.inc.php

I changed

Code: Select all

/* Archived */
if (!empty($_GET['archive']))
{
    $archive[1]=1;
    $sql .= '`archive`=\'1\' AND ';
}
To

Code: Select all

/* Billable */
if (!empty($_GET['billable']))
{
    $billable[1]=1;
    $sql .= '`custom10`=\'Yes\' AND ';
}
-Steve
Post Reply