function onTicketCreated($answer) { try { global $ost; if (!($ticket = Ticket::lookup($answer->object_id))) { die('Unknown or invalid ticket ID.'); } //Slack payload $payload = array('attachments' => array(array('pretext' => "New Ticket <" . $ost->getConfig()->getUrl() . "scp/tickets.php?id=" . $ticket->getId() . "|#" . $ticket->getId() . "> in " . Format::htmlchars($ticket->getDept() instanceof Dept ? $ticket->getDept()->getName() : '') . " via " . $ticket->getSource() . " (" . Format::db_datetime($ticket->getCreateDate()) . ")", 'fallback' => "New Ticket <" . $ost->getConfig()->getUrl() . "scp/tickets.php?id=" . $ticket->getId() . "|#" . $ticket->getId() . "> in " . Format::htmlchars($ticket->getDept() instanceof Dept ? $ticket->getDept()->getName() : '') . " via " . $ticket->getSource() . " (" . Format::db_datetime($ticket->getCreateDate()) . ")", 'color' => "#D00000", 'fields' => array(array('title' => "From: " . mb_convert_case(Format::htmlchars($ticket->getName()), MB_CASE_TITLE) . " (" . $ticket->getEmail() . ")", 'value' => '', 'short' => false))))); //Curl to webhook $data_string = utf8_encode(json_encode($payload)); $url = $this->getConfig()->get('slack-webhook-url'); if (!function_exists('curl_init')) { error_log('osticket slackplugin error: cURL is not installed!'); } $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($ch); if ($result === false) { error_log($url . ' - ' . curl_error($ch)); } else { $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($statusCode != '200') { error_log($url . ' Http code: ' . $statusCode); } } curl_close($ch); } catch (Exception $e) { error_log('Error posting to Slack. ' . $e->getMessage()); } }
<th><?php echo __('Created'); ?> :</th> <td><?php echo Format::db_datetime($user->getCreateDate()); ?> </td> </tr> <tr> <th><?php echo __('Updated'); ?> :</th> <td><?php echo Format::db_datetime($user->getUpdateDate()); ?> </td> </tr> </table> </td> </tr> </table> <br> <div class="clear"></div> <ul class="tabs"> <li><a class="active" id="tickets_tab" href="#tickets"><i class="icon-list-alt"></i> <?php echo __('User Tickets'); ?> </a></li>
<td><?php echo $ticket->getStatus(); ?> </td> </tr> <tr> <th>Department:</th> <td><?php echo Format::htmlchars($dept->getName()); ?> </td> </tr> <tr> <th>Create Date:</th> <td><?php echo Format::db_datetime($ticket->getCreateDate()); ?> </td> </tr> </table> </td> <td width=50% valign="top"> <table align="center" class="infotable" cellspacing="1" cellpadding="3" width="100%" border=0> <tr> <th width="100">Name:</th> <td><?php echo Format::htmlchars($ticket->getName()); ?> </td> </tr> <tr>
if($ids && in_array($row['category_id'],$ids)) $sel=true; $faqs=0; if($row['faqs']) $faqs=sprintf('<a href="faq.php?cid=%d">%d</a>',$row['category_id'],$row['faqs']); ?> <tr id="<?php echo $row['category_id']; ?>"> <td width=7px> <input type="checkbox" name="ids[]" value="<?php echo $row['category_id']; ?>" class="ckb" <?php echo $sel?'checked="checked"':''; ?>> </td> <td><a href="categories.php?id=<?php echo $row['category_id']; ?>"><?php echo Format::truncate($row['name'],200); ?></a> </td> <td><?php echo $row['ispublic']?'<b>'.__('Public').'</b>':__('Internal'); ?></td> <td style="text-align:right;padding-right:25px;"><?php echo $faqs; ?></td> <td> <?php echo Format::db_datetime($row['updated']); ?></td> </tr> <?php } //end of while. endif; ?> <tfoot> <tr> <td colspan="5"> <?php if($res && $num){ ?> <?php echo __('Select');?>: <a id="selectAll" href="#ckb"><?php echo __('All');?></a> <a id="selectNone" href="#ckb"><?php echo __('None');?></a> <a id="selectToggle" href="#ckb"><?php echo __('Toggle');?></a> <?php }else{ echo __('No FAQ categories found.'); } ?>
?> onClick="highLight(this.value,this.checked);"> <td> <?php echo $row['apikey']; ?> </td> <td><?php echo $row['isactive'] ? '<b>Yes</b>' : 'No'; ?> </td> <td> <?php echo $row['ipaddr']; ?> </td> <td> <?php echo Format::db_datetime($row['created']); ?> </td> </tr> <?php $class = $class == 'row2' ? 'row1' : 'row2'; } //end of while. } else { //nothin' found!! ?> <tr class="<?php echo $class; ?> "><td colspan=5><b>Query returned 0 results</b> <a href="admin.php?t=templates">Index list</a></td></tr>
function _print() { if (!($ticket = $this->getTicket())) { return; } $w = $this->w / 2 - $this->lMargin; $l = 35; $c = $w - $l; $this->SetFont('Arial', 'B', 11); $this->cMargin = 0; $this->SetFont('Arial', 'B', 11); $this->SetTextColor(10, 86, 142); $this->Cell($w, 7, 'Ticket #' . $ticket->getNumber(), 0, 0, 'L'); $this->Ln(7); $this->cMargin = 3; $this->SetTextColor(0); $this->SetDrawColor(220, 220, 220); $this->SetFillColor(244, 250, 255); $this->SetX($this->lMargin); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Status', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, $ticket->getStatus(), 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Name', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, $ticket->getName(), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Priority', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, $ticket->getPriority(), 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Email', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, $ticket->getEmail(), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Department', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, $ticket->getDeptName(), 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Phone', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, $ticket->getPhoneNumber(), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Create Date', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, Format::db_datetime($ticket->getCreateDate()), 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Source', 1, 0, 'L', true); $this->SetFont(''); $source = ucfirst($ticket->getSource()); if ($ticket->getIP()) { $source .= ' (' . $ticket->getIP() . ')'; } $this->Cell($c, 7, $source, 1, 0, 'L', true); $this->Ln(15); $this->SetFont('Arial', 'B', 11); if ($ticket->isOpen()) { $this->Cell($l, 7, 'Assigned To', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, $ticket->isAssigned() ? $ticket->getAssigned() : ' -- ', 1, 0, 'L', true); } else { $closedby = 'unknown'; if ($staff = $ticket->getStaff()) { $closedby = $staff->getName(); } $this->Cell($l, 7, 'Closed By', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, $closedby, 1, 0, 'L', true); } $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Help Topic', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, $ticket->getHelpTopic(), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'SLA Plan', 1, 0, 'L', true); $this->SetFont(''); $sla = $ticket->getSLA(); $this->Cell($c, 7, $sla ? $sla->getName() : ' -- ', 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Last Response', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, Format::db_datetime($ticket->getLastRespDate()), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); if ($ticket->isOpen()) { $this->Cell($l, 7, 'Due Date', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, Format::db_datetime($ticket->getEstDueDate()), 1, 0, 'L', true); } else { $this->Cell($l, 7, 'Close Date', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, Format::db_datetime($ticket->getCloseDate()), 1, 0, 'L', true); } $this->SetFont('Arial', 'B', 11); $this->Cell($l, 7, 'Last Message', 1, 0, 'L', true); $this->SetFont(''); $this->Cell($c, 7, Format::db_datetime($ticket->getLastMsgDate()), 1, 1, 'L', true); $this->Ln(5); $this->SetFont('Arial', 'B', 11); $this->cMargin = 0; $this->SetTextColor(10, 86, 142); $this->Cell($w, 7, trim($ticket->getSubject()), 0, 0, 'L'); $this->Ln(7); $this->SetTextColor(0); $this->cMargin = 3; //Table header colors (RGB) $colors = array('M' => array(195, 217, 255), 'R' => array(255, 224, 179), 'N' => array(250, 250, 210)); //Get ticket thread $types = array('M', 'R'); if ($this->includenotes) { $types[] = 'N'; } if ($entries = $ticket->getThreadEntries($types)) { foreach ($entries as $entry) { $color = $colors[$entry['thread_type']]; $this->SetFillColor($color[0], $color[1], $color[2]); $this->SetFont('Arial', 'B', 11); $this->Cell($w / 2, 7, Format::db_datetime($entry['created']), 'LTB', 0, 'L', true); $this->SetFont('Arial', '', 10); $this->Cell($w, 7, $entry['title'], 'TB', 0, 'L', true); $this->Cell($w / 2, 7, $entry['poster'], 'TBR', 1, 'L', true); $this->SetFont(''); $text = $entry['body']; if ($entry['attachments'] && ($tentry = $ticket->getThreadEntry($entry['id'])) && ($attachments = $tentry->getAttachments())) { foreach ($attachments as $attachment) { $files[] = $attachment['name']; } $text .= "\nFiles Attached: [" . implode(', ', $files) . "]\n"; } $this->WriteText($w * 2, $text, 1); $this->Ln(5); } } }
?> ></td> <td><a href="plugins.php?id=<?php echo $p->getId(); ?> " ><?php echo $p->getName(); ?> </a></td> <td><?php echo $p->isActive() ? 'Enabled' : '<strong>Disabled</strong>'; ?> </td> <td><?php echo Format::db_datetime($p->getInstallDate()); ?> </td> </tr> <?php } else { } } ?> </tbody> <tfoot> <tr> <td colspan="4"> <?php if ($count) { ?>
protected function ticketsAction($type, $ticket_id) { $tickets = array(); foreach ($ticket_id as $id) { $ticket = \Ticket::lookup($id['ticket_id']); $equipment = new \model\Equipment($id['equipment_id']); if (isset($ticket) && isset($equipment)) { $ticket_data = array('id' => $ticket->getId(), 'number' => $ticket->getNumber(), 'equipment' => $equipment->getAsset_id(), 'create_date' => \Format::db_datetime($ticket->getCreateDate()), 'subject' => $ticket->getSubject(), 'name' => $ticket->getName()->getFull(), 'priority' => $ticket->getPriority()); if ($type == 'closed') { $ts_open = strtotime($ticket->getCreateDate()); $ts_closed = strtotime($ticket->getCloseDate()); $ticket_data['close_date'] = \Format::db_datetime($ticket->getCloseDate()); $ticket_data['closed_by'] = $ticket->getStaff()->getUserName(); $ticket_data['elapsed'] = $this->elapsedTime($ts_closed - $ts_open); } $tickets[] = $ticket_data; } } return $tickets; }
$ids=($errors && is_array($_POST['ids']))?$_POST['ids']:null; while ($row = db_fetch_array($res)) { $sel=false; if($ids && in_array($row['staff_id'],$ids)) $sel=true; ?> <tr id="<?php echo $row['staff_id']; ?>"> <td width=7px> <input type="checkbox" class="ckb" name="ids[]" value="<?php echo $row['staff_id']; ?>" <?php echo $sel?'checked="checked"':''; ?> > <td><a href="staff.php?id=<?php echo $row['staff_id']; ?>"><?php echo Format::htmlchars($row['name']); ?></a> </td> <td><?php echo $row['username']; ?></td> <td><?php echo $row['isactive']?__('Active'):'<b>'.__('Locked').'</b>'; ?> <?php echo $row['onvacation']?'<small>(<i>'.__('vacation').'</i>)</small>':''; ?></td> <td><a href="groups.php?id=<?php echo $row['group_id']; ?>"><?php echo Format::htmlchars($row['group_name']); ?></a></td> <td><a href="departments.php?id=<?php echo $row['dept_id']; ?>"><?php echo Format::htmlchars($row['dept']); ?></a></td> <td><?php echo Format::db_date($row['created']); ?></td> <td><?php echo Format::db_datetime($row['lastlogin']); ?> </td> </tr> <?php } //end of while. endif; ?> <tfoot> <tr> <td colspan="8"> <?php if($res && $num){ ?> <?php echo __('Select');?>: <a id="selectAll" href="#ckb"><?php echo __('All');?></a> <a id="selectNone" href="#ckb"><?php echo __('None');?></a> <a id="selectToggle" href="#ckb"><?php echo __('Toggle');?></a> <?php }else{ echo __('No agents found!'); } ?>
echo $row['email']; ?> " nowrap> <a class="Icon <?php echo strtolower($row['source']); ?> Ticket ticketPreview" title="Preview Ticket" href="tickets.php?id=<?php echo $row['ticket_id']; ?> "><?php echo $tid; ?> </a></td> <td align="center" nowrap><?php echo Format::db_datetime($row['effective_date']); ?> </td> <td><a <?php if ($flag) { ?> class="Icon <?php echo $flag; ?> Ticket" title="<?php echo ucfirst($flag); ?> Ticket" <?php } ?> href="tickets.php?id=<?php
</td> <td width=50% valign="top"> <table align="center" class="ticketinfo" cellspacing="1" cellpadding="3" width="100%" border=0> <tr><th>Help Topic:</th> <td><? $ht=$ticket->getHelpTopic(); echo Format::htmlchars($ht?$ht:'N/A'); ?> </td> </tr> <tr> <th>IP Address:</th> <td><?=$ticket->getIP()?></td> </tr> <tr><th nowrap>Last Message:</th> <td><?=Format::db_datetime($ticket->getLastMessageDate())?></td> </tr> </table> </td> </tr> </table> <div> <?if($errors['err'] && $_POST['a']=='process') {?> <p align="center" id="errormessage"><?=$errors['err']?></p> <?}elseif($msg && $_POST['a']=='process' || $_POST['a']=='update' ) {?> <p align="center" id="infomessage"><?=$msg?></p> <?}elseif($warn) {?> <p id="warnmessage"><?=$warn?></p> <?}?> </div> <?
<tr> <th>Create Date:</th> <td>%s</td> </tr>', $ticket_state, Format::db_datetime($ticket->getCreateDate())); if ($ticket->isClosed()) { echo sprintf(' <tr> <th>Close Date:</th> <td>%s <span class="faded">by %s</span></td> </tr>', Format::db_datetime($ticket->getCloseDate()), $staff ? $staff->getName() : 'staff'); } elseif ($ticket->getEstDueDate()) { echo sprintf(' <tr> <th>Due Date:</th> <td>%s</td> </tr>', Format::db_datetime($ticket->getEstDueDate())); } echo '</table>'; echo '<hr> <table border="0" cellspacing="" cellpadding="1" width="100%" class="ticket_info">'; if ($ticket->isOpen()) { echo sprintf(' <tr> <th width="100">Assigned To:</th> <td>%s</td> </tr>', $ticket->isAssigned() ? implode('/', $ticket->getAssignees()) : ' <span class="faded">— Unassigned —</span>'); } echo sprintf(' <tr> <th>From:</th> <td><a href="users.php?id=%d" class="no-pjax">%s</a> <span class="faded">%s</span></td>
</tr> </table> </td> <td width="50%" style="vertical-align:top"> <table border="0" cellspacing="" cellpadding="4" width="100%"> <tr> <th width="150">Created:</th> <td><?php echo Format::db_datetime($org->getCreateDate()); ?> </td> </tr> <tr> <th>Updated:</th> <td><?php echo Format::db_datetime($org->getUpdateDate()); ?> </td> </tr> </table> </td> </tr> </table> <br> <div class="clear"></div> <ul class="tabs"> <li><a class="active" id="users_tab" href="#users"><i class="icon-user"></i> Users</a></li> <li><a id="tickets_tab" href="#tickets"><i class="icon-list-alt"></i> Tickets</a></li> <li><a id="notes_tab" href="#notes"><i
function _print() { if (!($ticket = $this->getTicket())) { return; } $w = $this->w / 2 - $this->lMargin; $l = 35; $c = $w - $l; // Setup HTML writing and load default thread stylesheet $this->WriteHtml('<style>' . file_get_contents(ROOT_DIR . 'css/thread.css') . '</style>', 1, true, false); $this->SetFont('Arial', 'B', 11); $this->cMargin = 0; $this->SetFont('Arial', 'B', 11); $this->SetTextColor(10, 86, 142); $this->WriteCell($w, 7, sprintf(__('Ticket #%s'), $ticket->getNumber()), 0, 0, 'L'); $this->Ln(7); $this->cMargin = 3; $this->SetTextColor(0); $this->SetDrawColor(220, 220, 220); $this->SetFillColor(244, 250, 255); $this->SetX($this->lMargin); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Status'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, (string) $ticket->getStatus(), 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Name'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, (string) $ticket->getName(), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Priority'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, $ticket->getPriority(), 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Email'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, $ticket->getEmail(), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Department'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, $ticket->getDeptName(), 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Phone'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, $ticket->getPhoneNumber(), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Create Date'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, Format::db_datetime($ticket->getCreateDate()), 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Source'), 1, 0, 'L', true); $this->SetFont(''); $source = ucfirst($ticket->getSource()); if ($ticket->getIP()) { $source .= ' (' . $ticket->getIP() . ')'; } $this->WriteCell($c, 7, $source, 1, 0, 'L', true); $this->Ln(12); $this->SetFont('Arial', 'B', 11); if ($ticket->isOpen()) { $this->WriteCell($l, 7, __('Assigned To'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, $ticket->isAssigned() ? $ticket->getAssigned() : ' -- ', 1, 0, 'L', true); } else { $closedby = __('unknown'); if ($staff = $ticket->getStaff()) { $closedby = (string) $staff->getName(); } $this->WriteCell($l, 7, __('Closed By'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, $closedby, 1, 0, 'L', true); } $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Help Topic'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, $ticket->getHelpTopic(), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('SLA Plan'), 1, 0, 'L', true); $this->SetFont(''); $sla = $ticket->getSLA(); $this->WriteCell($c, 7, $sla ? $sla->getName() : ' -- ', 1, 0, 'L', true); $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Last Response'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, Format::db_datetime($ticket->getLastRespDate()), 1, 1, 'L', true); $this->SetFont('Arial', 'B', 11); if ($ticket->isOpen()) { $this->WriteCell($l, 7, __('Due Date'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, Format::db_datetime($ticket->getEstDueDate()), 1, 0, 'L', true); } else { $this->WriteCell($l, 7, __('Close Date'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, Format::db_datetime($ticket->getCloseDate()), 1, 0, 'L', true); } $this->SetFont('Arial', 'B', 11); $this->WriteCell($l, 7, __('Last Message'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c, 7, Format::db_datetime($ticket->getLastMsgDate()), 1, 1, 'L', true); $this->SetFillColor(255, 255, 255); foreach (DynamicFormEntry::forTicket($ticket->getId()) as $form) { $idx = 0; foreach ($form->getAnswers() as $a) { if (in_array($a->getField()->get('name'), array('email', 'name', 'subject', 'phone', 'priority'))) { continue; } $this->SetFont('Arial', 'B', 11); if ($idx++ === 0) { $this->Ln(5); $this->SetFillColor(244, 250, 255); $this->WriteCell(($l + $c) * 2, 7, $a->getForm()->get('title'), 1, 0, 'L', true); $this->SetFillColor(255, 255, 255); } if ($val = $a->toString()) { $this->Ln(7); $this->WriteCell($l * 2, 7, $a->getField()->get('label'), 1, 0, 'L', true); $this->SetFont(''); $this->WriteCell($c * 2, 7, $val, 1, 0, 'L', true); } } } $this->SetFillColor(244, 250, 255); $this->Ln(10); $this->SetFont('Arial', 'B', 11); $this->cMargin = 0; $this->SetTextColor(10, 86, 142); $this->WriteCell($w, 7, trim($ticket->getSubject()), 0, 0, 'L'); $this->Ln(7); $this->SetTextColor(0); $this->cMargin = 3; //Table header colors (RGB) $colors = array('M' => array(195, 217, 255), 'R' => array(255, 224, 179), 'N' => array(250, 250, 210)); //Get ticket thread $types = array('M', 'R'); if ($this->includenotes) { $types[] = 'N'; } if ($entries = $ticket->getThreadEntries($types)) { foreach ($entries as $entry) { $color = $colors[$entry['thread_type']]; $this->SetFillColor($color[0], $color[1], $color[2]); $this->SetFont('Arial', 'B', 11); $this->WriteCell($w / 2, 7, Format::db_datetime($entry['created']), 'LTB', 0, 'L', true); $this->SetFont('Arial', '', 10); $this->WriteCell($w, 7, Format::truncate($entry['title'], 50), 'TB', 0, 'L', true); $this->WriteCell($w / 2, 7, $entry['name'] ?: $entry['poster'], 'TBR', 1, 'L', true); $this->SetFont(''); $text = $entry['body']->display('pdf'); if ($entry['attachments'] && ($tentry = $ticket->getThreadEntry($entry['id'])) && ($attachments = $tentry->getAttachments())) { $files = array(); foreach ($attachments as $attachment) { if (!$attachment['inline']) { $files[] = $attachment['name']; } } if ($files) { $text .= "<div>Files Attached: [" . implode(', ', $files) . "]</div>"; } $text .= "<div>" . sprintf(__('Files Attached: [%s]'), implode(', ', $files)) . "</div>"; } $this->WriteHtml('<div class="thread-body">' . $text . '</div>', 2, false, false); $this->Ln(5); } } $this->WriteHtml('', 2, false, true); }
?> " <?php echo $sel ? 'checked' : ''; ?> onClick="highLight(this.value,this.checked);"> <td><?php echo $row['email']; ?> </td> <td><?php echo $row['submitter']; ?> </td> <td><?php echo Format::db_datetime($row['added']); ?> </td> </tr> <?php $class = $class == 'row2' ? 'row1' : 'row2'; } //end of while. } else { //nothin' found!! ?> <tr class="<?php echo $class; ?> "><td colspan=4><b>Query returned 0 results</b> <a href="admin.php?t=banlist">Index list</a></td></tr>
$notes = $notes[0]; ?><tr><td colspan="2"> <a href="#ajax.php/content/<?php echo $id; ?>/manage" onclick="javascript: $.dialog($(this).attr('href').substr(1), 201); return false;" class="pull-left"><i class="icon-file-text icon-2x" style="color:#bbb;"></i> </a> <span style="display:inline-block;width:90%;padding-left:10px;line-height:1.2em"> <a href="#ajax.php/content/<?php echo $id; ?>/manage" onclick="javascript: $.dialog($(this).attr('href').substr(1), 201); return false;"><?php echo Format::htmlchars($title); ?></a><br/> <span class="faded"><?php echo Format::display($notes); ?> <em>(<?php echo sprintf(__('Last Updated %s'), Format::db_datetime($upd)); ?>)</em></span></span></td></tr><?php }; ?> <tr> <th colspan="2"> <em><b><?php echo __( 'Authentication and Registration Templates'); ?></b></em> </th> </tr> <?php $manage_content(__('Agents'), 'pwreset-staff'); ?> <?php $manage_content(__('Clients'), 'pwreset-client'); ?> <?php $manage_content(__('Guest Ticket Access'), 'access-link'); ?> <tr> <th colspan="2"> <em><b><?php echo __('Sign In Pages'); ?></b></em> </th>
<tr><td class="info"><?php echo $links; ?></td></tr> <?php } ?> </table> <?php if($message['responses'] && ($responses=$ticket->getResponses($message['msg_id']))) { foreach($responses as $resp) { $staff=$cfg->hideStaffName()?'staff':Format::htmlchars($resp['staff_name']); ?> <table class="response" cellspacing="0" cellpadding="1" width="100%" border="0"> <tr> <th><?php echo Format::db_datetime($resp['created']);?> - <?php echo $staff; ?></th> </tr> <tr><td><?php echo Format::display($resp['response']); ?></td></tr> <?php if($resp['attachments'] && ($links=$ticket->getAttachmentsLinks($resp['response_id'],'R'))) {?> <tr><td class="info"><?php echo $links; ?></td></tr> <?php }?> </table> <? } } } } ?> </div>
?> </td> </tr> <?php } ?> </table> <?php /* --------- Responses ------------ */ if ($message['responses'] && ($responses = $ticket->getResponses($message['msg_id']))) { foreach ($responses as $resp) { ?> <table class="response" cellspacing="0" cellpadding="1" width="100%" border="0"> <tr> <th><?php echo Format::db_datetime($resp['created']); ?> - <?php echo Format::htmlchars($resp['staff_name']); ?> </th> </tr> <tr> <td><?php echo Format::display($resp['response']); ?> </td> </tr> <?php if ($resp['attachments'] && ($links = $ticket->getAttachmentsLinks($resp['response_id'], 'R'))) { ?>
if (!$info['name']) continue; if (!$current_group || $current_group != $info['group']) { $current_group = $info['group']; ?> <tr> <th colspan="2"> <em><strong><?php echo isset($_groups[$current_group]) ? $_groups[$current_group] : $current_group; ?></strong> :: <?php echo __('Click on the title to edit.'); ?></em> </th> </tr> <?php } # end if ($current_group) if (isset($impl[$cn])) { echo sprintf('<tr><td colspan="2"> <strong><a href="templates.php?id=%d&a=manage">%s</a></strong>, <span class="faded">%s</span><br/> %s</td></tr>', $impl[$cn]->getId(), Format::htmlchars(__($info['name'])), sprintf(__('Updated %s'), Format::db_datetime($impl[$cn]->getLastUpdated())), Format::htmlchars(__($info['desc']))); } else { echo sprintf('<tr><td colspan=2> <strong><a href="templates.php?tpl_id=%d&a=implement&code_name=%s" >%s</a></strong><br/> %s</td></tr>', $template->getid(),$cn,format::htmlchars(__($info['name'])), format::htmlchars(__($info['desc']))); } } # endfor } else { ?> <tr> <td width="180" class="required"> <?php echo __('Template Set To Clone');?>: </td> <td>
else $inactive++; if($sids && in_array($row['id'],$sids)){ $class="$class highlight"; $sel=true; } ?> <tr class="<?=$class?>" id="<?=$row['id']?>"> <td width=7px> <input type="checkbox" name="ids[]" value="<?=$row['id']?>" <?=$sel?'checked':''?> onClick="highLight(this.value,this.checked);"> <td> <?=$row['apikey']?></td> <td><?=$row['isactive']?'<b>Sim</b>':'Não'?></td> <td> <?=$row['ipaddr']?></td> <td> <?=Format::db_datetime($row['created'])?></td> </tr> <? $class = ($class =='row2') ?'row1':'row2'; } //end of while. else: //nothin' found!! ?> <tr class="<?=$class?>"><td colspan=5><b>Consulta retornou 0 resultados</b> <a href="admin.php?t=templates">Índice de lista</a></td></tr> <? endif; ?> </table> </td></tr> <? if(db_num_rows($result)>0): //Show options.. ?> <tr>
function getFormattedTime() { return Format::db_datetime(strpos($this->updated, '0000-') !== 0 ? $this->updated : $this->created); }
</tr> <tr> <th><?php echo __('Account Manager'); ?>:</th> <td><?php echo $org->getAccountManager(); ?> </td> </tr> </table> </td> <td width="50%" style="vertical-align:top"> <table border="0" cellspacing="" cellpadding="4" width="100%"> <tr> <th width="150"><?php echo __('Created'); ?>:</th> <td><?php echo Format::db_datetime($org->getCreateDate()); ?></td> </tr> <tr> <th><?php echo __('Last Updated'); ?>:</th> <td><?php echo Format::db_datetime($org->getUpdateDate()); ?></td> </tr> </table> </td> </tr> </table> <br> <div class="clear"></div> <ul class="tabs"> <li><a class="active" id="users_tab" href="#users"><i class="icon-user"></i> <?php echo __('Users'); ?></a></li> <li><a id="tickets_tab" href="#tickets"><i class="icon-list-alt"></i> <?php echo __('Tickets'); ?></a></li> <li><a id="notes_tab" href="#notes"><i class="icon-pushpin"></i> <?php echo __('Notes'); ?></a></li> </ul>
<?php if($thisstaff->canManageTickets()) { $sel=false; if($ids && in_array($row['ticket_id'], $ids)) $sel=true; ?> <td align="center" class="nohover"> <input class="ckb" type="checkbox" name="tids[]" value="<?php echo $row['ticket_id']; ?>" <?php echo $sel?'checked="checked"':''; ?>> </td> <?php } ?> <td title="<?php echo $row['email']; ?>" nowrap> <a class="Icon <?php echo strtolower($row['source']); ?>Ticket ticketPreview" title="<?php echo __('Preview Ticket'); ?>" href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $tid; ?></a></td> <td align="center" nowrap><?php echo Format::db_datetime($row['effective_date']); ?></td> <td><a <?php if ($flag) { ?> class="Icon <?php echo $flag; ?>Ticket" title="<?php echo ucfirst($flag); ?> Ticket" <?php } ?> href="tickets.php?id=<?php echo $row['ticket_id']; ?>"><?php echo $subject; ?></a> <?php if ($threadcount>1) echo "<small>($threadcount)</small> ".'<i class="icon-fixed-width icon-comments-alt"></i> '; if ($row['collaborators']) echo '<i class="icon-fixed-width icon-group faded"></i> '; if ($row['attachments']) echo '<i class="icon-fixed-width icon-paperclip"></i> '; ?> </td> <td nowrap> <?php echo Format::htmlchars( Format::truncate($row['name'], 22, strpos($row['name'], '@'))); ?> </td> <?php
$ht = $ticket->getHelpTopic(); echo Format::htmlchars($ht ? $ht : 'N/A'); ?> </td> </tr> <tr> <th>IP Address:</th> <td><?php echo $ticket->getIP(); ?> </td> </tr> <tr> <th nowrap>Last Message:</th> <td><?php echo Format::db_datetime($ticket->getLastMessageDate()); ?> </td> </tr> </table> </td> </tr> </table> <div> <?php if ($errors['err'] && $_POST['a'] == 'process') { ?> <p align="center" id="errormessage"> <?php echo $errors['err']; ?>
$threadTypes = array('M' => 'message', 'R' => 'response', 'N' => 'note'); /* -------- Messages & Responses & Notes (if inline)-------------*/ $types = array('M', 'R', 'N'); if ($thread = $ticket->getThreadEntries($types)) { foreach ($thread as $entry) { ?> <table class="thread-entry <?php echo $threadTypes[$entry['thread_type']]; ?> " cellspacing="0" cellpadding="1" width="940" border="0"> <tr> <th colspan="4" width="100%"> <div> <span class="pull-left"> <span style="display:inline-block"><?php echo Format::db_datetime($entry['created']); ?> </span> <span style="display:inline-block;padding:0 1em" class="faded title"><?php echo Format::truncate($entry['title'], 100); ?> </span> </span> <span class="pull-right" style="white-space:no-wrap;display:inline-block"> <span style="vertical-align:middle;" class="textra"></span> <span style="vertical-align:middle;" class="tmeta faded title"><?php echo Format::htmlchars($entry['name'] ?: $entry['poster']); ?> </span> </span>
function previewTicket($tid) { global $thisstaff; if (!$thisstaff || !($ticket = Ticket::lookup($tid)) || !$ticket->checkStaffAccess($thisstaff)) { Http::response(404, 'No such ticket'); } $staff = $ticket->getStaff(); $lock = $ticket->getLock(); $error = $msg = $warn = null; if ($lock && $lock->getStaffId() == $thisstaff->getId()) { $warn .= ' <span class="Icon lockedTicket">Ticket is locked by ' . $lock->getStaffName() . '</span>'; } elseif ($ticket->isOverdue()) { $warn .= ' <span class="Icon overdueTicket">Marked overdue!</span>'; } ob_start(); echo sprintf('<div style="width:500px; padding: 2px 2px 0 5px;"> <h2>%s</h2><br>', Format::htmlchars($ticket->getSubject())); if ($error) { echo sprintf('<div id="msg_error">%s</div>', $error); } elseif ($msg) { echo sprintf('<div id="msg_notice">%s</div>', $msg); } elseif ($warn) { echo sprintf('<div id="msg_warning">%s</div>', $warn); } echo '<table border="0" cellspacing="" cellpadding="1" width="100%" class="ticket_info">'; $ticket_state = sprintf('<span>%s</span>', ucfirst($ticket->getStatus())); if ($ticket->isOpen()) { if ($ticket->isOverdue()) { $ticket_state .= ' — <span>Overdue</span>'; } else { $ticket_state .= sprintf(' — <span>%s</span>', $ticket->getPriority()); } } echo sprintf(' <tr> <th width="100">Ticket State:</th> <td>%s</td> </tr> <tr> <th>Create Date:</th> <td>%s</td> </tr>', $ticket_state, Format::db_datetime($ticket->getCreateDate())); if ($ticket->isClosed()) { echo sprintf(' <tr> <th>Close Date:</th> <td>%s <span class="faded">by %s</span></td> </tr>', Format::db_datetime($ticket->getCloseDate()), $staff ? $staff->getName() : 'staff'); } elseif ($ticket->getDueDate()) { echo sprintf(' <tr> <th>Due Date:</th> <td>%s</td> </tr>', Format::db_datetime($ticket->getDueDate())); } echo '</table>'; echo '<hr> <table border="0" cellspacing="" cellpadding="1" width="100%" class="ticket_info">'; if ($ticket->isOpen()) { echo sprintf(' <tr> <th width="100">Assigned To:</th> <td>%s</td> </tr>', $ticket->isAssigned() ? implode('/', $ticket->getAssignees()) : ' <span class="faded">— Unassigned —</span>'); } echo sprintf(' <tr> <th width="100">Department:</th> <td>%s</td> </tr> <tr> <th>Help Topic:</th> <td>%s</td> </tr> <tr> <th>From:</th> <td>%s <span class="faded">%s</span></td> </tr>', Format::htmlchars($ticket->getDeptName()), Format::htmlchars($ticket->getHelpTopic()), Format::htmlchars($ticket->getName()), $ticket->getEmail()); echo ' </table>'; $options[] = array('action' => 'Thread (' . $ticket->getThreadCount() . ')', 'url' => "tickets.php?id={$tid}"); if ($ticket->getNumNotes()) { $options[] = array('action' => 'Notes (' . $ticket->getNumNotes() . ')', 'url' => "tickets.php?id={$tid}#notes"); } if ($ticket->isOpen()) { $options[] = array('action' => 'Reply', 'url' => "tickets.php?id={$tid}#reply"); } if ($thisstaff->canAssignTickets()) { $options[] = array('action' => $ticket->isAssigned() ? 'Reassign' : 'Assign', 'url' => "tickets.php?id={$tid}#assign"); } if ($thisstaff->canTransferTickets()) { $options[] = array('action' => 'Transfer', 'url' => "tickets.php?id={$tid}#transfer"); } $options[] = array('action' => 'Post Note', 'url' => "tickets.php?id={$tid}#note"); if ($thisstaff->canEditTickets()) { $options[] = array('action' => 'Edit Ticket', 'url' => "tickets.php?id={$tid}&a=edit"); } if ($options) { echo '<ul class="tip_menu">'; foreach ($options as $option) { echo sprintf('<li><a href="%s">%s</a></li>', $option['url'], $option['action']); } echo '</ul>'; } echo '</div>'; $resp = ob_get_contents(); ob_end_clean(); return $resp; }
echo Format::htmlchars($row['group_name']); ?> </a></td> <td><a href="admin.php?t=dept&id=<?php echo $row['dept_id']; ?> "><?php echo Format::htmlchars($row['dept_name']); ?> </a></td> <td><?php echo Format::db_date($row['created']); ?> </td> <td><?php echo Format::db_datetime($row['lastlogin']); ?> </td> </tr> <?php $class = $class == 'row2' ? 'row1' : 'row2'; } //end of while. } else { ?> <tr class="<?php echo $class; ?> "><td colspan=8><b>Query returned 0 results</b></td></tr> <?php
$current_group = $info['group']; ?> <tr> <th colspan="2"> <em><strong><?php echo isset($_groups[$current_group]) ? $_groups[$current_group] : $current_group; ?> </strong> :: Click on the title to edit. </em> </th> </tr> <?php } # end if ($current_group) if (isset($impl[$cn])) { echo sprintf('<tr><td colspan="2"> <strong><a href="templates.php?id=%d&a=manage">%s</a></strong>, <span class="faded">Updated %s</span><br/> %s</td></tr>', $impl[$cn]->getId(), Format::htmlchars($info['name']), Format::db_datetime($impl[$cn]->getLastUpdated()), Format::htmlchars($info['desc'])); } else { echo sprintf('<tr><td colspan=2> <strong><a href="templates.php?tpl_id=%d&a=implement&code_name=%s" >%s</a></strong><br/> %s</td></tr>', $template->getid(), $cn, format::htmlchars($info['name']), format::htmlchars($info['desc'])); } } # endfor } else { ?> <tr> <td width="180" class="required"> Template Set To Clone: </td> <td> <select name="tpl_id" onchange="javascript:
"><?php echo Format::truncate($row['title'], 200); echo " {$files}"; ?> </a> </td> <td><?php echo $row['isenabled'] ? __('Active') : '<b>' . __('Disabled') . '</b>'; ?> </td> <td><?php echo $row['department'] ? $row['department'] : '— ' . __('All Departments') . ' —'; ?> </td> <td> <?php echo Format::db_datetime($row['updated']); ?> </td> </tr> <?php } //end of while. } ?> <tfoot> <tr> <td colspan="5"> <?php if ($res && $num) { ?> <?php
<a href="#ajax.php/content/<?php echo $id; ?> /manage" onclick="javascript: $.dialog($(this).attr('href').substr(1), 200); return false;"><i class="icon-file-text pull-left icon-2x" style="color:#bbb;"></i> <?php echo Format::htmlchars($title); ?> </a><br/> <span class="faded" style="display:inline-block;width:90%"><?php echo Format::display($notes); ?> <em>(Last Updated <?php echo Format::db_datetime($upd); ?> )</em></span></td></tr><?php }; ?> <tr> <th colspan="2"> <em><b>Authentication and Registration Templates</b></em> </th> </tr> <?php $manage_content('Staff Members', 'pwreset-staff'); ?> <?php $manage_content('Clients', 'pwreset-client'); ?>