function display($tpl = null) { $mainframe = JFactory::getApplication(); $option = JRequest::getVar('option'); if ($option == "com_fst") { $link = FSTRoute::_('index.php?option=com_fst&view=test', false); } else { if ($option == "com_fsf") { $link = FSTRoute::_('index.php?option=com_fst&view=faq', false); } else { $link = FSTRoute::_('index.php?option=com_fst&view=main', false); } } $mainframe->redirect($link); }
?> <?php if ($params->get('addlink')) { ?> <a href='<?php echo JRoute::_($params->get('addlink')); ?> ' class='showall'><?php echo JText::_("ADD_A_TESTIMONIAL"); ?> </a> <?php } else { ?> <a href='<?php echo FSTRoute::_('index.php?tmpl=component&option=com_fst&view=test&layout=create&onlyprodid=' . $prodid); ?> ' class='showall' rel="{handler: 'iframe', size: {x: 500, y: 500}}"><?php echo JText::_("ADD_A_TESTIMONIAL"); ?> </a> <?php } } ?> </h3> <?php $comments->DisplayComments($dispcount, $listtype, $maxlength); ?> </div>
function ParserPopulateTicket(&$parser, $row) { $parser->Clear(); if ($row) { $parser->SetVar('ref', $row['reference']); $parser->SetVar('subject', "<a href='" . FSTRoute::_('index.php?option=com_fst&view=admin&layout=support&ticketid=' . $row['id']) . "'>" . $row['title'] . "</a>"); $parser->SetVar("status", "<span style='color:" . $row['color'] . ";'>" . $row['status'] . "</span>"); if ($row['user_id'] == 0) { $name = $row['unregname'] . " (" . JText::_("UNREG") . ")"; } else { $name = $row['name']; } $parser->SetVar("name", $name); $parser->SetVar("lastactivity", FST_Helper::Date($row['lastupdate'], FST_DATETIME_SHORT)); $parser->SetVar("opened", FST_Helper::Date($row['opened'], FST_DATETIME_SHORT)); $parser->SetVar("closed", FST_Helper::Date($row['closed'], FST_DATETIME_SHORT)); $parser->SetVar("department", $row['department']); $parser->SetVar("category", $row['category']); $parser->SetVar("product", $row['product']); $parser->SetVar("priority", "<span style='color:" . $row['pricolor'] . ";'>" . $row['priority'] . "</span>"); $groups = implode(", ", $row['groups']); $parser->SetVar('groups', $groups); $parser->SetVar('deletebutton', 'deletebutton'); $parser->SetVar('archivebutton', 'archivebutton'); if (array_key_exists("custom", $row)) { $allcustom = array(); if (count($row['custom']) > 0) { foreach ($row['custom'] as $id => $value) { if (array_key_exists($id, $this->customfields)) { $field = $this->customfields[$id]; if ($field['type'] == "plugin") { $aparams = FSTCF::GetValues($field); if (array_key_exists("plugin", $aparams) && array_key_exists("plugindata", $aparams)) { $plugin = FSTCF::get_plugin($aparams['plugin']); $value = $plugin->Display($value, $aparams['plugindata'], array('ticketid' => $row['id'], 'userid' => $row['user_id'], 'ticket' => $row), $field['id']); } } $text = "<span class='fst_support_fieldname'>" . $this->customfields[$id]['description'] . "</span>"; if ($this->customfields[$id]['type'] == "checkbox") { if ($value == "on") { $text .= ": " . JText::_("Yes"); } else { $text .= ": " . JText::_("No"); } } else { $text .= ": " . $value; } $parser->SetVar("custom" . $id, $text); $allcustom[] = $text; } } } //echo "All custom : " . implode(", ",$allcustom) . "<br>"; $parser->SetVar("custom", implode(", ", $allcustom)); } if ($row['assigned'] == '') { $parser->SetVar('handlername', JText::_("UNASSIGNED")); } else { $parser->SetVar('handlername', $row['assigned']); } $parser->SetVar('username', $row['username']); $parser->SetVar('email', $row['useremail']); $parser->SetVar('handlerusername', $row['handlerusername']); $parser->SetVar('handleremail', $row['handleremail']); $icons = ""; if (FST_Settings::get('support_show_msg_counts')) { $icons .= "<span>"; $icons .= "<span style='font-weight:normal;top:-2px;position:relative;padding-right:2px;'>" . $row['msgcount']['total'] . "</span><span style='font-weight:normal;top:-2px;position:relative;padding-right:2px;'>x</span><img src='" . JURI::root(true) . "/components/com_fst/assets/images/messages.png'>"; $icons .= "</span>"; } $cotime = $this->db_time - strtotime($row['checked_out_time']); if ($cotime < FST_Settings::get('support_lock_time') && $row['checked_out'] != $this->userid && $row['checked_out'] > 0) { $html = "<div class='fst_user_tt'>" . $row['co_user']->name . " (" . $row['co_user']->email . ")</div>"; $icons .= "<img class='fsj_tip' src='" . JURI::root(true) . "/components/com_fst/assets/images/lock.png' title=\"" . JText::_('TICKET_LOCKED') . "::" . $html . "\">"; } else { $icons .= "<img src='" . JURI::root(true) . "/components/com_fst/assets/images/blank_16.png'>"; } if (!FST_Settings::get('support_hide_tags')) { if (isset($row['tags'])) { $html = ""; foreach ($row['tags'] as $tag) { $html .= "<div class='fst_tag_tt'>" . $tag['tag'] . "</div>"; } $icons .= "<img class='fsj_tip' src='" . JURI::root(true) . "/components/com_fst/assets/images/tag.png' title=\"" . JText::_('TICKET_TAGS') . "::" . $html . "\">"; } else { $icons .= "<img src='" . JURI::root(true) . "/components/com_fst/assets/images/blank_16.png'>"; } } if (isset($row['attach'])) { $html = "<table class='fst_attach_tt'>"; foreach ($row['attach'] as $attach) { $html .= "<tr style='border:0px;'><td nowrap style='border:0px;'>" . $attach['filename'] . " </td><td nowrap style='border:0px;'> " . FST_Helper::display_filesize($attach['size']) . "</td></tr>"; } $html .= "<table>"; $icons .= "<img class='fsj_tip' src='" . JURI::root(true) . "/components/com_fst/assets/images/attach.png' title=\"" . JText::_('TICKET_ATTACHMENTS') . "::" . $html . "\">"; } else { $icons .= "<img src='" . JURI::root(true) . "/components/com_fst/assets/images/blank_16.png'>"; } $parser->SetVar('icons', $icons); $delete = "<a href='" . FSTRoute::x('index.php?option=com_fst&view=admin&layout=support&tickets=' . JRequest::getVar('tickets') . '&delete=' . $row['id']) . "'>"; $delete .= "<img src='" . JURI::root(true) . "/components/com_fst/assets/images/delete_ticket.png'>"; $delete .= JText::_("DELETE") . "</a>"; $archive = "<a href='" . FSTRoute::x('index.php?option=com_fst&view=admin&layout=support&tickets=' . JRequest::getVar('tickets') . '&archive=' . $row['id']) . "'>"; $archive .= "<img src='" . JURI::root(true) . "/components/com_fst/assets/images/archive_ticket.png'>"; $archive .= JText::_("ARCHIVE") . "</a>"; $parser->SetVar('archivebutton', $archive); $parser->SetVar('deletebutton', $delete); // TODO: trhl /*id='ticket_<?php echo $ticket['id'];?>' onmouseover="$('ticket_<?php echo $ticket['id'];?>').style.background = '<?php echo FST_Settings::get('css_hl'); ?>';$('ticket_<?php echo $ticket['id'];?>_2').style.background = '<?php echo FST_Settings::get('css_hl'); ?>';" onmouseout="$('ticket_<?php echo $ticket['id'];?>').style.background = '';$('ticket_<?php echo $ticket['id'];?>_2').style.background = '';"*/ $this->_permissions = FST_Ticket_Helper::getAdminPermissions(); $type = "unassigned"; if ($row['admin_id'] == $this->_permissions['id']) { $type = "mine"; } else { if ($row['admin_id'] > 0) { $type = "other"; } } $style = ""; if (array_key_exists($row['ticket_pri_id'], $this->priorities)) { $pri = $this->priorities[$row['ticket_pri_id']]; if ($pri['backcolor']) { $style .= "background-color: {$pri['backcolor']};"; } } $handler_highlight = "ticket_type_{$type}"; $parser->SetVar('handler_highlight', $handler_highlight); $trhl = " class='ticket_{$row['id']} ' onmouseover='highlightticket({$row['id']})' onmouseout='unhighlightticket({$row['id']})' "; if (FST_Settings::get('support_entire_row')) { $style .= "cursor: pointer;"; $trhl .= " onclick='window.location=\"" . FSTRoute::x('&limitstart=&ticketid=' . $row['id']) . "\"' "; } $trhl .= " style='{$style}' "; $parser->SetVar('trhl', $trhl); } $parser->SetVar("showassigned", $this->showassigned); $parser->SetVar("hidehandler", FST_Settings::get('support_hide_handler')); $parser->SetVar("candelete", FST_Settings::get('support_delete')); $parser->SetVar("view", $this->ticket_view); }
<?php if ($offset > $end) { continue; } ?> <?php include $this->tmplpath . DS . 'comment.php'; ?> <?php } ?> </div> <?php $pages = ceil(count($this->_data) / $perpage); if ($pages > 1) { echo JText::_("PAGE") . ": "; for ($i = 1; $i <= $pages; $i++) { if ($i == $page) { echo "<b>{$i}</b> "; } else { echo "<a href='" . FSTRoute::_('&comm_page=' . $i) . "#{$comm_ref}'>{$i}</a> "; } } } ?> <?php $this->IncludeJS();
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html **/ defined('_JEXEC') or die; ?> <div class="fst_moderate_status"> <ul> <?php if (is_array($this->_moderatecounts)) { foreach ($this->_moderatecounts as $ident => $count) { ?> <li><?php echo $this->handlers[$ident]->GetDesc(); ?> : <b><?php echo $count['count']; ?> </b> - <a href="<?php echo FSTRoute::_('index.php?option=com_fst&view=admin&layout=moderate&ident=' . $ident); ?> "><?php echo JText::_('VIEW_NOW'); ?> </a></li> <?php } } ?> </ul> </div>
static function &ParseTemplate($template, &$ticket, $subject, $body, $ishtml) { $handler = FST_EMail::GetHandler($ticket['admin_id']); $custrec = FST_EMail::GetUser($ticket['user_id']); $subject = trim(str_ireplace("re:", "", $subject)); $vars[] = FST_EMail::BuildVar('subject', $subject); /*if ($ishtml) { $body = str_replace("\n","<br />\n",$body); }*/ $body = FST_Helper::ParseBBCode($body); $vars[] = FST_EMail::BuildVar('body', $body); $vars[] = FST_EMail::BuildVar('reference', $ticket['reference']); $vars[] = FST_EMail::BuildVar('password', $ticket['password']); if ($ticket['user_id'] == 0) { $vars[] = FST_EMail::BuildVar('user_name', $ticket['unregname']); $vars[] = FST_EMail::BuildVar('user_username', JText::_("UNREGISTERED")); $vars[] = FST_EMail::BuildVar('user_email', $ticket['email']); } else { $vars[] = FST_EMail::BuildVar('user_name', $custrec['name']); $vars[] = FST_EMail::BuildVar('user_username', $custrec['username']); $vars[] = FST_EMail::BuildVar('user_email', $custrec['email']); } $vars[] = FST_EMail::BuildVar('handler_name', $handler['name']); $vars[] = FST_EMail::BuildVar('handler_username', $handler['username']); $vars[] = FST_EMail::BuildVar('handler_email', $handler['email']); $vars[] = FST_EMail::BuildVar('ticket_id', $ticket['id']); $vars[] = FST_EMail::BuildVar('status', FST_EMail::GetStatus($ticket['ticket_status_id'])); $vars[] = FST_EMail::BuildVar('priority', FST_EMail::GetPriority($ticket['ticket_pri_id'])); $vars[] = FST_EMail::BuildVar('category', FST_EMail::GetCategory($ticket['ticket_cat_id'])); $vars[] = FST_EMail::BuildVar('department', FST_EMail::GetDepartment($ticket['ticket_dept_id'])); $vars[] = FST_EMail::BuildVar('product', FST_EMail::GetProduct($ticket['prod_id'])); if (strpos($template['body'], "{messagehistory}") > 0) { //echo "Get message history<br>"; $messages = FST_EMail::GetMessageHist($ticket['id']); // need to load in the messagerow template and parse it $text = FST_EMail::ParseMessageRows($messages, $ishtml); $vars[] = FST_EMail::BuildVar('messagehistory', $text); //print_p($messages); } $uri = JURI::getInstance(); $baseUrl = $uri->toString(array('scheme', 'host', 'port')); $vars[] = FST_EMail::BuildVar('ticket_link', $baseUrl . FSTRoute::_('index.php?option=com_fst&view=ticket&ticketid=' . $ticket['id'], false)); $vars[] = FST_EMail::BuildVar('admin_link', $baseUrl . FSTRoute::_('index.php?option=com_fst&view=admin&layout=support&ticketid=' . $ticket['id'], false)); $config = JFactory::getConfig(); if (FSTJ3Helper::IsJ3()) { $sitename = $config->get('sitename'); } else { $sitename = $config->getValue('sitename'); } if (FST_Settings::get('support_email_site_name') != "") { $sitename = FST_Settings::get('support_email_site_name'); } $vars[] = FST_EMail::BuildVar('websitetitle', $sitename); // need to add the tickets custom fields to the output here $fields = FSTCF::GetAllCustomFields(true); $values = FSTCF::GetTicketValues($ticket['id'], $ticket); foreach ($fields as $fid => &$field) { $name = "custom_" . $fid; $value = ""; if (array_key_exists($fid, $values)) { $value = $values[$fid]['value']; } //echo "$name -> $value<br>"; $fieldvalues = array(); $fieldvalues[0]['field_id'] = $fid; $fieldvalues[0]['value'] = $value; // only do area output processing if we are in html mode if ($field['type'] != "area" || $ishtml) { $value = FSTCF::FieldOutput($field, $fieldvalues, ''); } $vars[] = FST_EMail::BuildVar($name, $value); } $email['subject'] = FST_EMail::ParseText($template['subject'], $vars); $email['body'] = FST_EMail::ParseText($template['body'], $vars); //print_p($vars); //print_p($email); if ($template['ishtml']) { //$email['subject'] = str_replace("\n","<br />\n",$email['subject']); $email['body'] = FST_EMail::MaxLineLength($email['body']); } else { // strip bbcode out of subject or parse it to html depending on template type $email['body'] = str_replace("<br />", "\n", $email['body']); $email['body'] = html_entity_decode($email['body']); $email['body'] = preg_replace_callback("/(&#[0-9]+;)/", array($this, "email_decode_utf8"), $email['body']); $email['body'] = strip_tags($email['body']); } return $email; }