Help Desk Software & Beyond
May 22, 2012, 01:07:40 AM *
Welcome, Guest. Please login or register.
To post messages you need to register. We apologize for inconvenience, but this is to prevent spam.
Registration is instant (no email verification) and we do not ask for any personal information.

Login with username, password and session length
News: Welcome to Help Desk Software forum!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: [MOD] OFFICIAL - Printer Friendly Version of Ticket, TTX v2.24  (Read 4298 times)
cozilla
Jr. Member
**

Karma: 1
Posts: 57


View Profile
« on: May 23, 2008, 02:08:24 PM »

Is it possible to add a print button on this page to print out the ticket with everything except for the message pane?
I want the top three blocks but not the bottom where you can enter text.

here is the page
« Last Edit: May 24, 2008, 08:49:40 PM by sparky672 » Logged
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #1 on: May 23, 2008, 02:51:45 PM »

It would be nice.

I considered working on such a thing but just haven't got around to it yet.

Shouldn't be too difficult...

1.  Add a "print" link to the ticket page.
2.  Add a new print command to TTX.
3.  Create a new Print module which is a stripped down version of the Ticket module.

I've been holding off since this may be a future feature of TTX anyway.  I wouldn't know what Alex has planned but there are already traces of code for such a feature in TTX.



Here's an idea for folks who are better at DHTML and CSS than Perl:

Create & reference a print stylesheet that ignores certain elements on the page when printing.  You'd have to add <div> blocks with unique names or something similar to the ticket.html template.  Then in the stylesheet, you designate these items as invisible.

Personally, I like the results you can get with CSS but I hate testing it as every browser seems to have its own quirks.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Alex
Administrator
Hero Member
*****

Karma: 22
Posts: 605



View Profile WWW
« Reply #2 on: May 24, 2008, 04:36:26 AM »

The feature will be available with 2.25. Want it right now? Here is how:

1) make sure you have latest (2.24) version installed. May work with 2.23 as well, but I am not so sure Shocked)

2) upload the TTXPrint.pm and TTXImage.pm to your TTX scripts folder. Here is the link:

http://www.troubleticketexpress.com/download/print.zip

3) edit TTXTicket.pm, insert the following

  $data->{PRINTANNOTATE} = "<tr><td colspan=6 align=right class=sm><a href=\"$ENV{SCRIPT_NAME}?cmd=print&sid=".
                           $query->param('sid').
                           '&key='.$query->param('key').'&style='.$query->param('style').
                           '">[%Print%]</a></td></tr>';

into sub ticket, after these lines:

  my $tickets = TTXCommon::dbtik();
  if ($tickets eq undef || $tickets->error() ne undef) {
    $data->{ERROR_MESSAGE} = $tickets->errortext();
    return undef;
  }

4) (optional) Install Image::Size from CPAN if you want the print page to show image attachments.

perl -MCPAN -e shell
cpan>install Image::Size

use the above on Linux or Mac OSX. Enjoy mouse click exercise through ActiveState package manager interface on Windows.
 
Logged

Follow me on: LinkedIn
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #3 on: May 24, 2008, 09:15:00 AM »

Very nice!   Smiley

Thanks, Alex.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #4 on: May 24, 2008, 01:37:15 PM »

Also, to set the width of this printable version...

In the ttxcfg.cgi configuration file, add this line...

PRINTBASEWIDTH=X

Where X equals a number (pixels) or a percentage... 800 or 75% for example.
« Last Edit: May 24, 2008, 02:17:04 PM by sparky672 » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
cozilla
Jr. Member
**

Karma: 1
Posts: 57


View Profile
« Reply #5 on: May 27, 2008, 09:02:20 AM »

O yea thats great thank you very much.  I have 2 questions. 

1. how do I make the word print larger?

2. I did the mod so that the ip addresses would not show under the usernames on the ticket but when i do the print ticket they appear.

Thanks again

colin
Logged
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #6 on: May 27, 2008, 10:07:55 AM »

1. how do I make the word print larger?

There's already a CSS stylesheet built into the print.html template.  Edit that or create your own.

Quote
<style type="text/css">
body, td { font-family: Verdana, Helvetica, sans-serif; font-size: 10pt;}

For most precise control, I recommend a stylesheet assigned just to printer output.  Google "print stylesheet" and look how to specify media="print"
 
2. I did the mod so that the ip addresses would not show under the usernames on the ticket but when i do the print ticket they appear.

You'd have to apply the same mod to the TTXPrint.pm module.

Or remove this...

Quote
if ($isoper) {
      if ($header{IP} ne undef) {
        $fromtag .= "<br>[$header{IP}]";
      }
    }

FYI:  IP addresses only show when logged in as an Operator.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
cozilla
Jr. Member
**

Karma: 1
Posts: 57


View Profile
« Reply #7 on: May 27, 2008, 10:25:39 AM »

I want to make the word "print" larger on the ticket page.  Is that possible. I think you think I want to make the text on the printer friendly view bigger.

thanks
colin
Logged
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #8 on: May 27, 2008, 10:40:27 AM »

Quote
I want to make the word "print" larger on the ticket page.

In Alex's step three,

Remove the class=sm from the HTML code....

Quote
$data->{PRINTANNOTATE} = "<tr><td colspan=6 align=right class=sm><a href=\"$ENV{SCRIPT_NAME}?cmd=print&sid=".$query->param('sid').'&key='.$query->param('key').'&style='.$query->param('style').'">[%Print%]</a></td></tr>';
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
cozilla
Jr. Member
**

Karma: 1
Posts: 57


View Profile
« Reply #9 on: May 27, 2008, 10:56:06 AM »

i did that and it didnt do anything.  where is the style sheet for that particular page?

colin
Logged
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #10 on: May 27, 2008, 11:05:38 AM »

i did that and it didnt do anything.  where is the style sheet for that particular page?

colin

Typically, you have to reload the page several times to see CSS changes take effect.

There are no CSS pages in TTX unless you create them yourself.  The CSS for the Ticket page is in the header.shtml file and changes there will effect all TTX pages that use the header.

If you want more precise control, you could create and place CSS within the HTML attributes or create external sheets and reference them from the templates.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
cozilla
Jr. Member
**

Karma: 1
Posts: 57


View Profile
« Reply #11 on: May 27, 2008, 01:47:45 PM »

I figured it out by just adding a class in the header shtml file

colin
Logged
John
Newbie
*

Karma: 0
Posts: 17


View Profile
« Reply #12 on: April 04, 2009, 01:07:54 AM »

Hi there,

I am using the printer friendly version of a ticket as a read-only view for all the closed tickets, because the customer do not have the option to add more comments or change the status of a ticket in this view. The only missing feature in the print friendly version for me is the link to file attachments of the ticket. How can I add these links, so that a customer can click them to download the files attached to a ticket?

Thank you,
John
Logged
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #13 on: April 04, 2009, 01:29:26 AM »

Hi there,

I am using the printer friendly version of a ticket as a read-only view for all the closed tickets, because the customer do not have the option to add more comments or change the status of a ticket in this view. The only missing feature in the print friendly version for me is the link to file attachments of the ticket. How can I add these links, so that a customer can click them to download the files attached to a ticket?

Thank you,
John

It would be so much easier to use the printer-friendly version as intended and just disable the customer's ability to add comments & change status on closed tickets.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
John
Newbie
*

Karma: 0
Posts: 17


View Profile
« Reply #14 on: April 04, 2009, 02:16:09 AM »

Hi Sparky,

Thanks for your reply. It would be great if I could use the standard customer page with disabled status & comments fields. Currently I receive alot of 'thank you' replies to closed tickets, which will either reopen the closed ticket or create a new ticket. I do not see a way remove the ability to comment/change status on closed tickets for customers on your mods list or forum search, do you know if this is possible?
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!
Page created in 0.035 seconds with 19 queries.