<?php FSS_Table::ColEnd(); ?> <?php $st = FSS_Ticket_Helper::GetStatusByID($this->ticket->ticket_status_id); if ($st->is_closed && strtotime($this->ticket->closed) > 0) { FSS_Table::ColStart(); ?> <th><?php echo JText::_("CLOSED"); ?> </th> <td> <?php echo FSS_Helper::TicketTime($this->ticket->closed, FSS_DATETIME_MID); ?> </td> <?php FSS_Table::ColEnd(); } ?> <?php if (FSS_Settings::get('support_hide_handler') != 1) { ?> <?php FSS_Table::ColStart("tr_handler"); ?> <th><?php echo JText::_("HANDLER");
?> </td> <?php if ($st->is_closed && strtotime($this->ticket['closed']) > 0) { ?> <?php $mc->Item(); ?> <td><?php echo JText::_("CLOSED"); ?> </td> <td colspan="2" class="no-border"> <?php echo FSS_Helper::TicketTime($this->ticket['closed'], FSS_DATETIME_MID); ?> </td> <?php } ?> <?php } ?> <?php if (!FSS_Settings::get('support_hide_handler') && !FSS_Settings::get('user_hide_handler')) { ?> <?php $mc->Item(); ?>
</strong> </td> </tr> <tr class="fss_ticket_row_<?php echo $rowclass; ?> fss_ticket_row_<?php echo $rowclass; ?> _body"> <td style="overflow-x: auto"> <div class="pull-right" style="margin-bottom: 8px;margin-left: 8px;"> <i> <?php echo FSS_Helper::TicketTime($message['posted'], FSS_DATETIME_MID); ?> </i> </div> <?php if (strpos($message['body'], "[cid:") !== false) { require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'cron' . DS . 'emailcheck.php'; $ec = new FSSCronEMailCheck(); $message['body'] = $ec->processInlineImages($message['id']); } $msg = $message['body']; $msg = FSS_Helper::ParseBBCode($msg, $message, false, false, true); echo $msg; ?>
static function core(&$parser, $ticket, $custom_fields = null) { if ($ticket) { $parser->SetVar('ref', $ticket->reference); $parser->SetVar("status", "<span style='color:" . $ticket->color . ";'>" . $ticket->status . "</span>"); $parser->SetVar("status_text", $ticket->status); $parser->SetVar("status_color", $ticket->color); if ($ticket->user_id == 0) { $name = $ticket->unregname . " (" . JText::_("UNREG") . ")"; } else { $name = $ticket->name; } $parser->SetVar("name", $name); $parser->SetVar("lastactivity", FSS_Helper::TicketTime($ticket->lastupdate, FSS_DATETIME_SHORT)); $parser->SetVar("opened", FSS_Helper::TicketTime($ticket->opened, FSS_DATETIME_SHORT)); $parser->SetVar("closed", FSS_Helper::TicketTime($ticket->closed, FSS_DATETIME_SHORT)); $parser->SetVar("department", $ticket->department); $parser->SetVar("category", $ticket->category); $parser->SetVar("product", $ticket->product); $parser->SetVar("priority", "<span style='color:" . $ticket->pricolor . ";'>" . $ticket->priority . "</span>"); $parser->SetVar("priority_text", $ticket->priority); $parser->SetVar("priority_color", $ticket->pricolor); if (FSS_Settings::get('time_tracking') != "") { if ($ticket->timetaken > 0) { $hours = floor($ticket->timetaken / 60); $mins = sprintf("%02d", $ticket->timetaken % 60); $parser->SetVar("time_taken", "<i class='icon-clock'></i>" . JText::sprintf("TIME_TAKEN_DISP", $hours, $mins)); } else { $parser->SetVar("time_taken", "<i class='icon-clock'></i>" . JText::sprintf("TIME_TAKEN_DISP", "0", "00")); } } else { $parser->SetVar("time_taken", ''); } $group_names = array(); if (isset($ticket->groups)) { foreach ($ticket->groups as $group) { $group_names[] = $group->groupname; } } $parser->SetVar('groups', implode(", ", $group_names)); if (empty($ticket->custom) && !empty($ticket->fields)) { $ticket->custom = $ticket->fields; } if (isset($ticket->customfields)) { foreach ($ticket->customfields as $field) { if ($field['type'] != "plugin") { continue; } $aparams = FSSCF::GetValues($field); $plugin = FSSCF::get_plugin($aparams['plugin']); $id = $field['id']; $value = ""; if (isset($ticket->custom) && array_key_exists($field['id'], $ticket->custom)) { $value = $ticket->custom[$field['id']]; } if (is_array($value)) { $value = $value['value']; } $text = $plugin->Display($value, $aparams['plugindata'], array('ticketid' => $ticket->id, 'userid' => $ticket->user_id, 'ticket' => $ticket, 'inlist' => 1), $field['id']); $parser->SetVar("custom" . $id, $text); $parser->SetVar("custom_" . $id, $text); $cf_alias = $field['alias']; $parser->SetVar("custom_" . $cf_alias, $text); $parser->SetVar("custom_" . $id . "_name", $field['description']); } } if (isset($ticket->custom)) { $allcustom = array(); if (count($ticket->custom) > 0) { foreach ($ticket->custom as $id => $value) { if (is_array($value)) { $value = $value['value']; } if (isset($ticket->customfields) && array_key_exists($id, $ticket->customfields)) { $field = $ticket->customfields[$id]; if ($field['inlist'] < 1) { continue; } if ($field['type'] == "plugin") { $aparams = FSSCF::GetValues($field); if (array_key_exists("plugin", $aparams) && array_key_exists("plugindata", $aparams)) { $plugin = FSSCF::get_plugin($aparams['plugin']); $value = $plugin->Display($value, $aparams['plugindata'], array('ticketid' => $ticket->id, 'userid' => $ticket->user_id, 'ticket' => $ticket, 'inlist' => 1), $field['id']); } } $prefix = "<span class='cust_field_label cust_field_label_{$cf_alias} cust_field_label_{$id}'>" . $ticket->customfields[$id]['description'] . ":</span> "; if ($ticket->customfields[$id]['type'] == "checkbox") { if ($value == "on") { $text = JText::_("Yes"); } else { $text = JText::_("No"); } } else { $text = $value; } $parser->SetVar("custom" . $id, $text); $parser->SetVar("custom_" . $id, $text); $cf_alias = $ticket->customfields[$id]['alias']; $parser->SetVar("custom_" . $cf_alias, $text); $parser->SetVar("custom_" . $id . "_name", $ticket->customfields[$id]['description']); $allcustom[] = $prefix . "<span class='cust_field_value cust_field_value_{$cf_alias} cust_field_value_{$id}'>" . $text . "</span>"; } } } $parser->SetVar("custom", implode(", ", $allcustom)); } if ($ticket->assigned == '') { $parser->SetVar('handlername', JText::_("UNASSIGNED")); } else { $parser->SetVar('handlername', $ticket->assigned); } $parser->SetVar('username', $ticket->username); $parser->SetVar('email', $ticket->useremail); $parser->SetVar('handlerusername', $ticket->handlerusername); $parser->SetVar('handleremail', $ticket->handleremail); // product image $prod = self::getProduct($ticket); if ($prod) { $parser->SetVar('product_img', JURI::root(true) . "/images/fss/products/" . $prod->image); } $dept = self::getDepartment($ticket); if ($dept) { $parser->SetVar('department_img', JURI::root(true) . "/images/fss/departments/" . $dept->image); } if (strpos($parser->template, "{last_poster}") !== false || strpos($parser->template, "{last_poster_username}") !== false) { $parser->SetVar('last_poster', ''); $parser->SetVar('last_poster_username', ''); $db = JFactory::getDBO(); $qry = "SELECT user_id, posted FROM #__fss_ticket_messages WHERE ticket_ticket_id = " . $db->escape($ticket->id) . " AND admin IN (0, 1) ORDER BY posted DESC LIMIT 1"; $db->setQuery($qry); $rows = $db->loadObjectList(); if ($rows) { $row = reset($rows); if ($row) { $user_id = $row->user_id; $user = JFactory::getUser($user_id); $parser->SetVar('last_poster', $user->name); $parser->SetVar('last_poster_username', $user->username); } } } } }
<!--<tr class="ticket_message_body <?php if ($message->admin == TICKET_MESSAGE_PRIVATE) { echo "warning"; } ?> ticket_message_id_<?php echo (int) $message->id; ?> "> <td style="overflow-x: auto">--> <div class="ticket_message_date pull-right" style="margin-bottom: 8px;margin-left: 8px;"> <i> <?php echo FSS_Helper::TicketTime($message->posted, FSS_DATETIME_MID); ?> </i> </div> <div class="ticket_message_message" id="message_<?php echo (int) $message->id; ?> "> <?php $msg = $message->body; $msg = FSS_Helper::ParseBBCode($msg, $message); echo $msg; ?> </div>