From e5b8617a88d2a7e4dbf6dc202ceb7d5711510610 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Thu, 24 Apr 2014 19:43:29 +0000
Subject: [PATCH] Add hot print links to bypass the dialog

Provide quick prints options that bypasses the print dialog modal
---
 include/class.ticket.php          |  7 +++++--
 include/staff/ticket-view.inc.php | 15 ++++++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/include/class.ticket.php b/include/class.ticket.php
index dc298c084..a90f18bf4 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -1895,9 +1895,12 @@ class Ticket {
         global $thisstaff;
 
         require_once(INCLUDE_DIR.'class.pdf.php');
-        if (!is_string($psize))
-            if (!$thisstaff || !($psize = $thisstaff->getDefaultPaperSize()))
+        if (!is_string($psize)) {
+            if ($_SESSION['PAPER_SIZE'])
+                $psize = $_SESSION['PAPER_SIZE'];
+            elseif (!$thisstaff || !($psize = $thisstaff->getDefaultPaperSize()))
                 $psize = 'Letter';
+        }
 
         $pdf = new Ticket2PDF($this, $psize, $notes);
         $name='Ticket-'.$this->getNumber().'.pdf';
diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php
index d155e040c..df3ef92dc 100644
--- a/include/staff/ticket-view.inc.php
+++ b/include/staff/ticket-view.inc.php
@@ -78,9 +78,18 @@ if($ticket->isOverdue())
 
             <?php
             }?>
-
-            <a id="ticket-print" class="action-button" href="tickets.php?id=<?php echo $ticket->getId(); ?>&a=print"><i class="icon-print"></i> Print</a>
-
+            <span class="action-button" data-dropdown="#action-dropdown-print">
+                <a id="ticket-print" href="tickets.php?id=<?php echo $ticket->getId(); ?>&a=print"><i class="icon-print"></i> Print</a>
+                <i class="icon-caret-down"></i>
+            </span>
+            <div id="action-dropdown-print" class="action-dropdown anchor-right">
+              <ul>
+                 <li><a class="no-pjax" target="_blank" href="tickets.php?id=<?php echo $ticket->getId(); ?>&a=print&notes=0"><i
+                 class="icon-file-alt"></i> Ticket Thread</a>
+                 <li><a class="no-pjax" target="_blank" href="tickets.php?id=<?php echo $ticket->getId(); ?>&a=print&notes=1"><i
+                 class="icon-file-text-alt"></i> Thread + Internal Notes</a>
+              </ul>
+            </div>
             <div id="action-dropdown-more" class="action-dropdown anchor-right">
               <ul>
                 <?php
-- 
GitLab