Page 1 of 1

All Modification found in One Place

Posted: Tue Oct 13, 2015 11:08 pm
by ey4fun
Im going to post here all modification i found in one place.
there is a lot of content on this forum that requires a lot of time to search.

Required Field in admin + Red Asterik

Klemen wrote:Fields are not required from admin panel because staff may not always have all the information you can request from a customer.

To make it required, you would need to modify file "admin/admin_submit_ticket.php".

I haven't tested it, but:

1. find line

Code: Select all

$tmpvar[$k]=hesk_makeURL(nl2br(hesk_input($_POST[$k])))
2. find the first else ABOVE that line.
3. ABOVE that "else" add

Code: Select all

		elseif ($v['req'])
        {
        	$tmpvar[$k]=hesk_makeURL(nl2br(hesk_input($_POST[$k])));
            if (!strlen($tmpvar[$k]))
            {
            	$hesk_error_buffer[$k]=$hesklang['fill_all'].': '.$v['name'];
            }
        }
Klemen wrote:Also, to show the red asterisk, in "admin/new_ticket.php" replace

Code: Select all

$v['req'] = '';
with

Code: Select all

$v['req'] = $v['req'] ? '<font class="important">*</font>' : ''; 
Twice!

Re: All Modification found

Posted: Tue Oct 13, 2015 11:14 pm
by ey4fun
Adding Ticket ID to Print
Klemen wrote:Nice, good job :D

The sequential ID is in the "id" column, so

Code: Select all

$ticket['id']
Which means adding this line

Code: Select all

<td bgcolor="#EEE"><b>' . $hesklang['id'] . ':</b></td><td bgcolor="#DDD">' . $ticket['id'] . '</td>

Re: All Modification found

Posted: Tue Oct 13, 2015 11:18 pm
by ey4fun
Hide IP Addres in Print
Klemen wrote:To hide the IP address you need to delete this code from the "print.php" file:

Code: Select all

	<tr>
		<td>' . $hesklang['ip'] . ':</td>
		<td>' . $ticket['ip'] . '</td>
	</tr>

Re: All Modification found

Posted: Tue Oct 13, 2015 11:27 pm
by ey4fun
Hide Category From Customer
Klemen wrote:Something like this should work:

1. Open index.php in a text editor

2. find this code

Code: Select all

    if (hesk_dbNumRows($res) == 1)
    {
    	/* Only 1 public category, no need for select box */
    	$row = hesk_dbFetchAssoc($res);
		echo '<input type="hidden" name="category" value="'.$row['id'].'" />';
    }
3. just BELOW add this

Code: Select all

    elseif ( ! empty($_GET['catid']) )
    {
		echo '<input type="hidden" name="category" value="'.intval($_GET['catid']).'" />';
    }
4. Save, upload and test!

Re: All Modification found

Posted: Tue Oct 13, 2015 11:30 pm
by ey4fun
Excel For Mac doesnt display information
Klemen wrote:I am able to open your report normally.

Looks like Excel on Mac doesn't support CDATA in XML files.

Try uploading this file to your "admin" folder and see if you can open new reports generated:
http://www.hesk.com/extras/export_mac_253.zip

Re: All Modification found in One Place

Posted: Tue Oct 13, 2015 11:43 pm
by ey4fun
Hiding a customized field from end user eyes
you can find this thread here - posting.php?mode=quote&f=13&p=14166
Klemen wrote:Open ticket.php in notepad and find

Code: Select all

$v['use'] && $v['place']==0
and change it to

Code: Select all

$v['use'] && $v['place']==0 && !in_array($k,array('custom1','custom2','custom3'))
Similarly change

Code: Select all

$v['use'] && $v['place']
to

Code: Select all

$v['use'] && $v['place'] && !in_array($k,array('custom1','custom2','custom3'))
This should hide the first, second and third custom field from the customer. You can change the list by modifying 'custom1', 'custom2','custom3'.
Klemen wrote:Try modifying the same code in the index.php - so you have that code modified in both index.php and ticket.php
Klemen wrote:Should be the same code in both files (the code I posted few replies back).

In index.php it will hide the fields from the "submit a ticket" form and in ticket.php it will hide the fields when the customer is looking at the ticket.

Re: All Modification found in One Place

Posted: Fri Oct 16, 2015 6:46 pm
by Klemen
Nice idea, but could get a bit confusing because not all modifications posted on the forum are for the same HESK version.