Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Custom Print Page possible?

Currently we have a "Check In" sheet that is a small piece of paper with imporant information we tape to computers that come in. Since a lot of this information will be entered into new tickets now since we are starting to use OSTicket I was hoping there could be some way to make a Custom Page that can be populated with the information of certain fields in a ticket that we could just print out rather than having to manually write on the check in sheet. Not trying to print out an entire ticket just parts. I havent seen anything in my searches that anything like this is possible but figured I would ask in case I am missing something. Thanks!


  • I guess that you could create a custom page for each one... but that seems less then productive.
    Maybe use Excel?
  • I have no issue doing some work to set something up but If in the end it was more than a couple clicks for the tech it wouldnt be worth the time. Might as well just have them manually write it out. Its not a lot of info. Since the email/canned response part of the system allows use of variables for the ticket contents I was just hoping that there was some way to pass that same info into a custom page/pdf that could be printed out.
  • After installing the Time Tracking mod I saw they had done what I was trying to do. I found I could add a link in the Print dropdown by editting /var/www/html/include/staff| around line 97. I got that working great. 

    <li><a class="no-pjax" target="_blank" href="tickets_checkin.php?id=<?php echo $ticket->getId(); ?>"><i
    class="icon-file-text-alt"></i> <?php echo __('Check-In Sheet'); ?></a>

    The issue I am running into is I copied their tickets_bill.php > tickets_checkin.php hoping I could comment everything out getting it down to the bare neccessities. However I cant seem to do that, it always breaks. I unfortunately only know enough php to be dangerous. ;) Could someone help me out with this? Id like to get a very simple php page that has ONLY what is needed to do a simple sql query on the ticket id. Once I have that simple page I think I can expand on it to pull what I need and format it in html/css.  Thanks!
  • Just to update this in case anyone else tries to do this, I was finally able to dissect the file down and pull the needed info using the builtin functions in the class.ticket.php file in my tickets_checkin.php file. I am sure its still really ugly and could have been done better but I am not very good at php. Just alot of trial and error. I will also fix it up with some html for printing but this at least shows the info I wanted on a quick print link. 



    $ticket = $user = null; //clean start.
    //LOCKDOWN...See if the id provided is actually valid and if the user has access.
    if($_REQUEST['id']) {
    $errors['err']=sprintf(__('%s: Unknown or invalid ID.'), __('ticket'));
    elseif(!$ticket--->checkStaffAccess($thisstaff)) {
    $errors['err']=__('Access denied. Contact admin if you believe this is in error');
    $ticket=null; //Clear ticket obj.

    if(!$errors) {
    // Retrieve Ticket Information
    $TicketID = $_GET['id'];
    $Subject = $ticket-&gt;getSubject();
    $TicketNo = $ticket-&gt;getNumber();
    $TOwner = $ticket-&gt;getName();
    $CDate = $ticket-&gt;getCreateDate();
    $OPhone = $ticket-&gt;getPhoneNumber();


    echo $TOwner;
    echo $OPhone;
    echo $Subject;
    echo $CDate;
    echo $TicketNo;

  • edited September 2016
    I've been looking to do something similar for a few different possible reasons/options.  I was really surprised that I wasn't able to find more discussion in the forums about doing this.  Here's what I'm hoping to incorporate:

    1.  Customer drop-off receipt (using our Star thermal POS printer 80mm paper roll)
      - Customer Name, Ticket Number, Date/Time, Computer Make/Model, Computer S/N  (the latter 2 are custom fields on a custom form we have set up called "Lab Check-in"  

    2.  Internal Tagging (using our Star thermal POS printer ... OR Dymo label printer for address-sized labels)
       - Used to tag/label every item/piece that the customer drops off so we know what belongs to who
       - Currently, we have a blank Word document that our receptionist manually types the ticket number, customer name, and date into, and prints 2 or 3 copies as needed to tag laptop, A/C adapter, etc.

    Ideally, I'd really like to spit out a barcode on the printed receipt/ticket as well, so when a computer comes up front for checkout, we can just 'scan' the ticket number into the osticket search box and pull the ticket up easily.

    Lastly, to really make this 'awesome' I'd love for it to print via Google Cloud Print.  This way, anyone in the office, on any device, could trigger the print jobs on the USB-connected thermal printer at the front desk.  I have no idea how easy or difficult that would be to accomplish, but I've seen it work in another program before and it was pretty slick.

    I don't know PHP any better than you (probably less, actually).  I attempted to at least re-create what you had done above.  I had no problem adding the button to the print menu, but the output I get is just a blank page/screen.  No error, no text.  I can see that a few right closed brackets were replaced as &gt characters after the copy/paste above, but I corrected those and still had no luck.

    I wouldn't mind chipping in a few dollars if someone with some more experience wants to help make this a reality.  It would be a big time saver and cut down on typos/errors in our office.  I'm happy to help test and do what I can to help figure it out!

  • Sorry I havent had a lot of time to spend on this recently and have had some issues with our brother label thermal printer not printing correctly. But I will soon post how I got my label/barcode system working. Just a couple more issues to work out.
Sign In or Register to comment.