Based on the fine work of (xrat)

blank

Result report:

blank

FIRST STEP

To add this, first create a file print.css with the following content:

/* print.css for osTicket by Andreas Schamanek v0.02 (c) public domain */

body { color: black; background-color: white;

font-family: arial, helvetica, sans-serif;

}

/**** elements to hide ****/

#header,

#nav,

table.ticketoptions,

#content div + table, /* SCP tabber after ticketthread */

.Icon, /* all icons */

input.button, /* all buttons */

img, /* all images */

input, /* all input fields, checkboxes, etc. */

#reply /* client reply */

{ display: none; }

#basic, #advance /* SCP search/query */

{ display: none !important; }

/* If we exclude .Icon we need to make some visible, though */

a.otherTicket, a.phoneTicket, a.emailTicket, a.webTicket,

a.assignedTicket, a.lockedTicket, a.overdueTicket { display: inline; }

/**** Margins + Padding ****/

/* osTicket unfortunately uses tables for the layout */

td { padding: 0.2em; }

#ticketnotes, #ticketthread { margin: 1em 0; }

#ticketnotes { margin-bottom: 2em; }

#ticketnotes table,

#ticketthread table { margin-top: 1em; }

/**** Ticket number + Subject ****/

td.msg, div.msg { font-size: 1.4em; padding: 0.3em; }

/**** Borders ****/

table.ticketinfo,

table.infotable,

#ticketnotes,

#ticketthread { padding: 0.4em; border: 1px solid gray; }

#ticketnotes table,

#ticketthread table { padding-top: 1em; border-top: 1px solid black; }

#ticketnotes table-child,

#ticketthread table-child { padding-top: 0; border-top: 0; }

/**** Miscellaneous ****/

a { color: navy; text-decoration: underline; }

th { text-align: left; }

/**** Ticket lists ****/

/* Borders in ticket lists */

#content div > table table td

{ padding: 0.2em; border-bottom: 1px solid gray; padding-top: 0.4em; }

#content div > table table th

{ padding: 0.3em; border-bottom: 2px solid black;

border-top: 1px solid black; padding-top: 0.5em;

}

#content div > table table a { color: black; text-decoration: none; }

Copy the print.css to following paths:

osTicketRootFolder/scp/css

osTicketRootFolder/styles

SECOND STEP

make the following modifications:

File: include/clientheader.inc.php.

FIND

<link rel="stylesheet" href="./styles/main.css" media="screen">

<link rel="stylesheet" href="./styles/colors.css" media="screen">

ADD

<link rel="stylesheet" href="./styles/print.css" media="print">

File: include/staffheader.inc.php.

FIND

<link rel="stylesheet" href="css/main.css" media="screen">

<link rel="stylesheet" href="css/style.css" media="screen">

ADD

<link rel="stylesheet" href="css/print.css" media="print">

THIRD STEP

File: scp/cssmain.css

FIND:

#nav a.closedTickets { background(../images/icons/closed_tickets.gif) 0 5px no-repeat #ececec; }

#nav a.newTicket { background(../images/icons/new_ticket.gif) 0 5px no-repeat #ececec; }

ADD:

/** START MOD08 print button **/

#nav a.printTicket { background(../images/icons/print_ticket.gif) 0 5px no-repeat #ececec; }

/** END MOD08 print button **/

File: scptickets.php

FIND:

$nav->addSubMenu(array('desc'=>'New Ticket','href'=>'tickets.php?a=open','iconclass'=>'newTicket'));

ADD:

// START MOD08 add print button to staff page

$nav->addSubMenu(array('desc'=>'Print Ticket','href'=>'javascript.print()','iconclass'=>'printTicket'));

// END MOD08 add print button to staff page

FOURTH STEP

Save the attached image to scp\images\icons with the name print_ticket.gif

print_ticket.gif

great work! A handy thing to have.

Based on the fine work of (xrat)

Thanks!

hay i wanna edit in the report style how can i do this ?

hay i wanna edit in the report style how can i do this ?

You need to have knowledge in css (cascade Styling Sheets) you can try to download an css editor..

OMG....thanks JoseLuis

am diaa ur friend from Egypt

Excellent work! Thank you!

4 days later

Sweet :)

Works like a charm on 1.6 ST

-j

Now that' what I call a smart option. Thanks!:

This mod looks great, but I am not having much luck in getting it to work. When I click the print button, it simply prints the webpage. Any thoughts?

This mod looks great, but I am not having much luck in getting it to work. When I click the print button, it simply prints the webpage. Any thoughts?

Try all the steps from the beginning! They work fine you are missing something..

1st are you on View Ticket page ?

if yes, on your Browser do the following steps:

View >> Source-Code

On the tag search this:

<link rel="stylesheet" href="css/main.css" media="screen">

<link rel="stylesheet" href="css/style.css" media="screen">

<link rel="stylesheet" href="css/print.css" media="print">

Is it like the code above ? No? try making the 2nd step again.

Is it like the code above ? Yes? try making the 1st step again.

JoseLuis,

Thanks for the reply dude, after verifing everything in your post, you inspired me to check the painfully obvious. I decided to check the permissions on the files, sure enough no read permission. It works now!

Thanks bro.

-perfectsine

image not showing up

Hi,

I got it all working, except the gif icon doesn't show up.

I did this 3 times and same issue. The reference is correct and all, and it is uploaded, but it does not show up

Hi,

I got it all working, except the gif icon doesn't show up.

I did this 3 times and same issue. The reference is correct and all, and it is uploaded, but it does not show up

1st Check this:

File: scp/cssmain.css

FIND:

#nav a.printTicket { background(../images/icons/print_ticket.gif) 0 5px no-repeat #ececec; }

You found it ? It is ok ?

2nd On your Browser go to this page: http://YourDomain/scp/tickets.php(http://YourDomain/scp/tickets.php)

View >> Source code

FIND:

<li><a class="newTicket" href="tickets.php?a=open" title="">New Ticket</a></li>

<li><a class="printTicket" href="javascript.print()" title="">Print Ticket</a></li>

</ul>

</div>

You found it ? It is ok ?

3rd On your Browser go to this page: http://YourDomain/scp/tickets.php(http://YourDomain/scp/tickets.php)

If your browser is Firefox, Tools >> Page Info >> Media

And try to find this:

blank

update

I thought I updated my status on this before.

Basically it showed up the next day. No idea why. Thanks for

the help

4 days later

Printing works without issue

Awesome! Awesome! Awesome!

Thank you very much!

nice! thank you very much for this...

is there a way to add a additional line a the end of this printout like a signature-line for my customers?

nice! thank you very much for this...

is there a way to add a additional line a the end of this printout like a signature-line for my customers?

Yes, it is.

Go to include/staff/footer.inc.php. Include your desired Element in a new DIV-Tag - i choosed to place it directly below the Tag.

<div id="printfooter">

This is your print-only footer! Change it to whatever you like...

</div>

Include the following CSS to your /scp/css/main.css

#printfooter { display: none; }

and to your /scp/css/print.css make sure the original #footer will be hidden:

/**** elements to hide ****/

#header,

#nav,

table.ticketoptions,

#content div + table, /* SCP tabber after ticketthread */

.Icon, /* all icons */

input.button, /* all buttons */

img, /* all images */

input, /* all input fields, checkboxes, etc. */

#reply, /* client reply */

#footer /* <-- this has to be added! */

{ display: none; }

Worked for me...