Newer
Older
<?php
//Note that ticket obj is initiated in tickets.php.
if(!defined('OSTSCPINC') || !$thisstaff || !is_object($ticket) || !$ticket->getId()) die('Invalid path');
//Make sure the staff is allowed to access the page.
if(!@$thisstaff->isStaff() || !$ticket->checkStaffAccess($thisstaff)) die('Access Denied');
//Re-use the post info on error...savekeyboards.org (Why keyboard? -> some people care about objects than users!!)
$info=($_POST && $errors)?Format::input($_POST):array();
//Auto-lock the ticket if locking is enabled.. If already locked by the user then it simply renews.
if($cfg->getLockTime() && !$ticket->acquireLock($thisstaff->getId(),$cfg->getLockTime()))
$warn.=__('Unable to obtain a lock on the ticket');
//Get the goodies.
$dept = $ticket->getDept(); //Dept
$role = $thisstaff->getRole($dept);
$staff = $ticket->getStaff(); //Assigned or closed by..
$user = $ticket->getOwner(); //Ticket User (EndUser)
$team = $ticket->getTeam(); //Assigned team.
$lock = $ticket->getLock(); //Ticket lock obj
$id = $ticket->getId(); //Ticket ID.
//Useful warnings and errors the user might want to know!
if ($ticket->isClosed() && !$ticket->isReopenable())
$warn = sprintf(
__('Current ticket status (%s) does not allow the end user to reply.'),
$ticket->getStatus());
elseif ($ticket->isAssigned()
&& (($staff && $staff->getId()!=$thisstaff->getId())
|| ($team && !$team->hasMember($thisstaff))
))
$warn.= sprintf(' <span class="Icon assignedTicket">%s</span>',
sprintf(__('Ticket is assigned to %s'),
implode('/', $ticket->getAssignees())
));
if (!$errors['err']) {
if ($lock && $lock->getStaffId()!=$thisstaff->getId())
$errors['err'] = sprintf(__('This ticket is currently locked by %s'),
$lock->getStaffName());
elseif (($emailBanned=TicketFilter::isBanned($ticket->getEmail())))
$errors['err'] = __('Email is in banlist! Must be removed before any reply/response');
}
$unbannable=($emailBanned) ? BanList::includes($ticket->getEmail()) : false;
if($ticket->isOverdue())
$warn.=' <span class="Icon overdueTicket">'.__('Marked overdue!').'</span>';
?>
<table width="940" cellpadding="2" cellspacing="0" border="0">
<tr>
<td width="20%" class="has_bottom_border">
<h2><a href="tickets.php?id=<?php echo $ticket->getId(); ?>"
title="<?php echo __('Reload'); ?>"><i class="icon-refresh"></i>
<?php echo sprintf(__('Ticket #%s'), $ticket->getNumber()); ?></a></h2>
</td>
<td width="auto" class="flush-right has_bottom_border">
<?php
if ($role->canBanEmails()
|| $role->canEditTickets()
|| ($dept && $dept->isManager($thisstaff))) { ?>
<span class="action-button pull-right" data-dropdown="#action-dropdown-more">
<i class="icon-caret-down pull-right"></i>
<span ><i class="icon-cog"></i> <?php echo __('More');?></span>
</span>
<?php
// Status change options
echo TicketStatus::status_options();
if ($role->canEditTickets()) { ?>
<a class="action-button pull-right" href="tickets.php?id=<?php echo $ticket->getId(); ?>&a=edit"><i class="icon-edit"></i> <?php
<?php
if ($ticket->isOpen() && !$ticket->isAssigned() && $role->canAssignTickets()) {?>
<a id="ticket-claim" class="action-button pull-right confirm-action" href="#claim"><i class="icon-user"></i> <?php
<?php
}?>
<span class="action-button pull-right" data-dropdown="#action-dropdown-print">
<i class="icon-caret-down pull-right"></i>
<a id="ticket-print" href="tickets.php?id=<?php echo $ticket->getId(); ?>&a=print"><i class="icon-print"></i> <?php
echo __('Print'); ?></a>
</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¬es=0"><i
class="icon-file-alt"></i> <?php echo __('Ticket Thread'); ?></a>
<li><a class="no-pjax" target="_blank" href="tickets.php?id=<?php echo $ticket->getId(); ?>&a=print¬es=1"><i
class="icon-file-text-alt"></i> <?php echo __('Thread + Internal Notes'); ?></a>
<div id="action-dropdown-more" class="action-dropdown anchor-right">
<ul>
if ($role->canEditTickets()) { ?>
<li><a class="change-user" href="#tickets/<?php
echo $ticket->getId(); ?>/change-user"><i class="icon-user"></i> <?php
echo __('Change Owner'); ?></a></li>
<?php
}
if ($role->canDeleteTickets()) {
echo $ticket->getId(); ?>/status/delete"
data-href="tickets.php"><i class="icon-trash"></i> <?php
if($ticket->isOpen() && ($dept && $dept->isManager($thisstaff))) {
if($ticket->isAssigned()) { ?>
<li><a class="confirm-action" id="ticket-release" href="#release"><i class="icon-user"></i> <?php
echo __('Release (unassign) Ticket'); ?></a></li>
<?php
}
if(!$ticket->isOverdue()) { ?>
<li><a class="confirm-action" id="ticket-overdue" href="#overdue"><i class="icon-bell"></i> <?php
echo __('Mark as Overdue'); ?></a></li>
<?php
}
if($ticket->isAnswered()) { ?>
<li><a class="confirm-action" id="ticket-unanswered" href="#unanswered"><i class="icon-circle-arrow-left"></i> <?php
echo __('Mark as Unanswered'); ?></a></li>
<?php
} else { ?>
<li><a class="confirm-action" id="ticket-answered" href="#answered"><i class="icon-circle-arrow-right"></i> <?php
echo __('Mark as Answered'); ?></a></li>
<?php
}
} ?>
<li><a href="#ajax.php/tickets/<?php echo $ticket->getId();
?>/forms/manage" onclick="javascript:
$.dialog($(this).attr('href').substr(1), 201);
return false"
><i class="icon-paste"></i> <?php echo __('Manage Forms'); ?></a></li>
<?php if ($role->canBanEmails()) {
if(!$emailBanned) {?>
<li><a class="confirm-action" id="ticket-banemail"
href="#banemail"><i class="icon-ban-circle"></i> <?php echo sprintf(
Format::htmlchars(__('Ban Email <%s>')),
$ticket->getEmail()); ?></a></li>
} elseif($unbannable) { ?>
<li><a class="confirm-action" id="ticket-banemail"
href="#unbanemail"><i class="icon-undo"></i> <?php echo sprintf(
Format::htmlchars(__('Unban Email <%s>')),
$ticket->getEmail()); ?></a></li>
<?php
}
}?>
</ul>
</div>
</td>
</tr>
</table>
<table class="ticket_info" cellspacing="0" cellpadding="0" width="940" border="0">
<tr>
<table border="0" cellspacing="" cellpadding="4" width="100%">
<tr>
<th width="100"><?php echo __('Status');?>:</th>
<td><?php echo ($S = $ticket->getStatus()) ? $S->getLocalName() : ''; ?></td>
</tr>
<tr>
<th><?php echo __('Priority');?>:</th>
<td><?php echo $ticket->getPriority(); ?></td>
</tr>
<tr>
<th><?php echo __('Department');?>:</th>
<td><?php echo Format::htmlchars($ticket->getDeptName()); ?></td>
</tr>
<tr>
<th><?php echo __('Create Date');?>:</th>
<td><?php echo Format::datetime($ticket->getCreateDate()); ?></td>
</tr>
</table>
</td>
<td width="50%" style="vertical-align:top">
<table border="0" cellspacing="" cellpadding="4" width="100%">
<tr>
<th width="100"><?php echo __('User'); ?>:</th>
<td><a href="#tickets/<?php echo $ticket->getId(); ?>/user"
$.userLookup('ajax.php/tickets/<?php echo $ticket->getId(); ?>/user',
function (user) {
$('#user-'+user.id+'-name').text(user.name);
$('#user-'+user.id+'-email').text(user.email);
$('#user-'+user.id+'-phone').text(user.phone);
$('select#emailreply option[value=1]').text(user.name+' <'+user.email+'>');
Loading
Loading full blame...