Page 1 of 2

Changing print.php

Posted: Thu Oct 30, 2014 8:05 am
by jones
Hello :) ,

How do I change the sizes of the fields in print.php?

When I print a ticket from Hesk, see the not so pretty.
Try and see a photo here: https://www.dropbox.com/s/9rhj6e3emek9h ... v.jpg?dl=0


I would like that there are only 3 fields on each line, can I change it so "custom" fields do not fill 6 fields on one line

Is it possible that i can insert "custom" fields somewhere else in print.php?

Re: Changing print.php

Posted: Thu Oct 30, 2014 12:55 pm
by mkoch227
The column issue is actually a bug in NuMods, as HESK (I believe) just prints each item on one line. In print.php, find:

Code: Select all

<?php
     }
} 
On lines 219-221. Change it so it reads

Code: Select all

<?php
    }
$num_cols++;
}
So the row count actually updates. If you want to move where the custom fields appear, move lines 205-221 wherever you want them to appear.

Re: Changing print.php

Posted: Thu Oct 30, 2014 1:39 pm
by jones
Hi Mike,

Thanks :)
After and have changed it in print.php, Works also print font size in NuMods.
As you yourself can change in Settings> Help Desk

So that you just have changed. Before version 1.6 :wink:
Jones

Re: Changing print.php - custom

Posted: Tue Nov 04, 2014 12:52 pm
by jones
Hello,

How do I insert custom fields in print.php?

I would like the various "custom" fields set in various locations in print.php

Jones

Re: Changing print.php

Posted: Tue Nov 04, 2014 3:46 pm
by jones
Hello,
How do I insert "website title" from Hesk into print.php?

Jones

Re: Changing print.php

Posted: Fri Nov 07, 2014 10:17 am
by jones
Hi Klemen,

Can you help me with the above ??

Jones

Re: Changing print.php

Posted: Fri Nov 07, 2014 12:41 pm
by Klemen
You can use the $hesk_settings['site_title'] variable, as found in the hesk_settings.inc.php file.

If within PHP:

Code: Select all

echo $hesk_settings['site_title'];
If within pure HTML:

Code: Select all

<?php echo $hesk_settings['site_title']; ?>
But please note, that teaching PHP is not something this forum is for. You should consider searching Google for PHP tutorial and learning a bit there :wink:

Re: Changing print.php

Posted: Fri Nov 07, 2014 12:49 pm
by jones
Hi Klemen,

Thanks, will not learn anything about php :)

I just want to know what your code is called for custom fields :wink:
So I can modify and insert them elsewhere in print.php

Jones

Re: Changing print.php

Posted: Fri Nov 07, 2014 2:40 pm
by Klemen
Hmm, give a man a fish... :roll:

I have a better idea :twisted: - why don't you see how the settings file is setup, read a bit on Google on PHP arrays and how to print an array element and see if you can get it to work. If not you can still come back, show what you tried and we can guide you to the solution. :wink:

Re: Changing print.php

Posted: Fri Nov 07, 2014 4:12 pm
by jones
Hi Klemen!

That's not helping anything.
Because I can not see in settings.php what you have called the custom field no. 2

I would like to insert the custom fields differently in print.php
As I can set up under (Settings> Custom Fields).
But I can not find any places what they are called?

Because if I want to insert all the custom fields in the same table, I use this code:
<? php echo $hesk_settings ['custom_fields']; ?>

But if I only want to add the custom fields no. 2 (Custom2) and 4 (Custom4)

I have tried with this code:
<? php echo $hesk_settings ['custom_fields2']; ?>
<? php echo $hesk_settings ['custom_fields4']; ?>

And this code:
<? php echo $hesk_settings ['Custom2']; ?>
<? php echo $hesk_settings ['Custom4']; ?>

But no luck.

Re: Changing print.php

Posted: Sat Nov 08, 2014 8:51 am
by Klemen
How is ticket name inserted into the print.php?

Re: Changing print.php

Posted: Sat Nov 08, 2014 12:16 pm
by jones
Hi Klemen,

Is it that you mean:

echo '
<td bgcolor="#EEE"><b>' . $hesklang['name'] . ':</b></td>
<td bgcolor="#DDD">' . $ticket['name'] . '</td>
';
echo '</tr>';

Re: Changing print.php

Posted: Sat Nov 08, 2014 4:34 pm
by Klemen
Yes.

So, if "name" is printed out with $ticket['name'], then "custom1" will be printed out like...

Re: Changing print.php

Posted: Fri Nov 14, 2014 4:16 pm
by jones
Hi Klemen and Mike,

Thanks for the reply.
Here you can see the finished result after and have changed in print.php:

https://www.dropbox.com/s/k1cvzjf2hjnui ... p.pdf?dl=0

Jones :-)

Sequential number - print.php

Posted: Fri Nov 14, 2014 6:57 pm
by jones
Hi :)
How do I insert sequential number in print.php?

Jones