Here is a print view for single tickets.
The following edits will be in /include/staff/viewticket.inc.php
Note: I have included a line or two in front and behind my mod.
Around line 30
<td colspan=2 class="msg">
Ticket #<?=$ticket->getExtId()?> <a href="tickets.php?id=<?=$id?>" title="Reload"><span class="Icon refresh"> </span></a>
<?php if (basename($_SERVER) != "print.php"){ ?><a href="print.php?id=<?=$id?>" title="Print View" target="_blank"><span style="background-image(images/icons/printer.png); padding-left;"> </span></a>
<?php } //PRINT MOD ?>
</td>
Around line 250
<tr> <td align="center">
<?php if (basename($_SERVER) != "print.php"){ ?>
<div class="tabber">
Around line 449
<?}?>
</div>
<?php } //end print.php if statement MOD printview?>
</td>
</tr>
Also, copy and paste the following code in a new file and call it print.php and place it in the /scp directory.
print.php
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>osTicket :: Staff Control Panel</title>
<link rel="stylesheet" href="css/main.css" media="screen">
<link rel="stylesheet" href="css/style.css" media="screen">
<script type="text/javascript" src="js/scp.js"></script>
</head>
<body>
<?php
require('staff.inc.php');
require_once(INCLUDE_DIR.'class.ticket.php');
$ticket=null; //clean start.
//LOCKDOWN...See if the id provided is actually valid and if the user has access.
if(($id=$_REQUEST?$_REQUEST:$_POST) && is_numeric($id)) {
$deptID=0;
$ticket= new Ticket($id);
if(!$ticket or !$ticket->getDeptId())
$err='Unknown ticket ID#'.$id; //Sucker...invalid id
elseif(!$thisuser->isAdmin() && (!$thisuser->canAccessDept($ticket->getDeptId()) && $thisuser->getId()!=$ticket->getStaffId()))
$err='Access denied. Contact admin if you believe this is in error';
if(!$err && $ticket->getId()==$id)
require_once(STAFFINC_DIR.'viewticket.inc.php');
}
?>
</body>
</html>
Also, included is an icon, place it in /scp/images/icons. It is named printer.png.txt because it would not attach. Get rid of the .txt extension after you download it.
The only thing I would change with this mod, is this should probably use it's own css file versus using the ticket css.
[printer.png.txt](https://forum.osticket.com/assets/files/migrated/f/66b9da7c61547e95457d3877da7b38f.txt)