Changing print.php

Helpdesk for my helpdesk software

Moderator: mkoch227

jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Changing print.php

Post 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?
mkoch227
Posts: 666
Joined: Wed Jul 04, 2012 3:37 pm

Re: Changing print.php

Post 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.
Mike, Lead Developer of Image HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Re: Changing print.php

Post 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
jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Re: Changing print.php - custom

Post 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
jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Re: Changing print.php

Post by jones »

Hello,
How do I insert "website title" from Hesk into print.php?

Jones
jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Re: Changing print.php

Post by jones »

Hi Klemen,

Can you help me with the above ??

Jones
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Changing print.php

Post 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:
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
jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Re: Changing print.php

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

Re: Changing print.php

Post 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:
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
jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Re: Changing print.php

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

Re: Changing print.php

Post by Klemen »

How is ticket name inserted into the print.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
jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Re: Changing print.php

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

Re: Changing print.php

Post by Klemen »

Yes.

So, if "name" is printed out with $ticket['name'], then "custom1" will be printed out like...
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
jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Re: Changing print.php

Post 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 :-)
jones
Posts: 75
Joined: Sat Jul 20, 2013 6:41 pm

Sequential number - print.php

Post by jones »

Hi :)
How do I insert sequential number in print.php?

Jones
Post Reply