function __construct() { parent::__construct(); $mainframe = JFactory::getApplication(); global $option; $aparams = FSS_Settings::GetViewSettingsObj('kb'); $this->_enable_prod_pages = $aparams->get('main_prod_pages', 0); if ($this->_enable_prod_pages == 1) { $limit = $mainframe->getUserStateFromRequest('global.list.limit_prod', 'limit', FSS_Settings::Get('kb_prod_per_page'), 'int'); $limitstart = FSS_Input::getInt('limitstart'); // In case limit has been changed, adjust it $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; $this->setState('limit_prod', $limit); $this->setState('limitstart', $limitstart); } $this->_enable_art_pages = $aparams->get('cat_art_pages', 0); if ($this->_enable_art_pages == 1) { $limit = $mainframe->getUserStateFromRequest('global.list.limit_art', 'limit', FSS_Settings::Get('kb_art_per_page'), 'int'); $limitstart = FSS_Input::getInt('limitstart'); // In case limit has been changed, adjust it $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; $this->setState('limit_art', $limit); $this->setState('limitstart', $limitstart); } //$aparams = new stdClass(); }
public function onContentPrepare($context, &$row, &$params, $page = 0) { if (is_object($row)) { if (property_exists($row, "id")) { $context .= "." . $row->id; } } else { if (is_array($row)) { if (array_key_exists("id", $row)) { $context .= "." . $row['id']; } } } FSS_Glossary::$context = $context; $ignore = FSS_Settings::Get('glossary_ignore'); $option = FSS_Input::getCmd('option'); if (trim($ignore) != "") { $ignore = explode("\n", $ignore); foreach ($ignore as $ign) { $ign = trim($ign); if ($ign == "") { continue; } if (stripos($context, $ign) !== FALSE) { return true; } if ($option) { if (stripos($option, $ign) !== FALSE) { return true; } } } } // skip plugin on freestyle components if (strpos($context, "_fss") > 0) { return true; } // Don't run this plugin when the content is being indexed if (strpos($context, 'finder.indexer') > 0) { return true; } if (is_object($row)) { if (!empty($row->noglossary)) { // skip glossary plugin on fss content return true; } //$row->text .= "\n\n\n<div style='display:none;' id='fss_glossary_context'>$context</div>\n\n\n"; return $this->_glossary($row->text, $params); } else { if (is_array($row)) { //$row['text'] .= "\n\n\n<div style='display:none;' id='fss_glossary_context'>$context</div>\n\n\n"; return $this->_glossary($row['text'], $params); } } //$row .= "<div style='display:none;' id='fss_glossary_context'>$context</div>"; return $this->_glossary($row, $params); }
function HandleRefresh() { $this->do_refresh = FSS_Settings::Get('support_admin_refresh'); if (FSS_Input::getInt("refresh") > 0) { $output = array(); $output['count'] = $this->count; header("Content-Type: application/json"); echo json_encode($output); exit; } }
function __construct() { parent::__construct(); $mainframe = JFactory::getApplication(); global $option; $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', FSS_Settings::Get('announce_per_page'), 'int'); $limitstart = FSS_Input::getInt('limitstart', 0); // In case limit has been changed, adjust it $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; $this->setState('limit', $limit); $this->setState('limitstart', $limitstart); }
function display($tpl = null) { if (FSS_Settings::Get('support_only_admin_open')) { return $this->noPermission("Access Denied", "CREATING_NEW_TICKETS_BY_USERS_IS_CURRENTLY_DISABLED"); } if (!FSS_Permission::auth("fss.ticket.open", "com_fss.support_user")) { return FSS_Helper::NoPerm(); } $mainframe = JFactory::getApplication(); $user = JFactory::getUser(); $userid = $user->get('id'); $this->assign('userid', $userid); $this->assign('email', ''); // defaults for blank ticket $this->ticket = new stdClass(); $this->ticket->prodid = FSS_Input::getInt('prodid'); $this->ticket->deptid = FSS_Input::getInt('deptid'); $this->ticket->catid = FSS_Input::getInt('catid'); $this->ticket->priid = FSS_Input::getInt('priid'); $this->ticket->subject = FSS_Input::getString('subject'); $this->ticket->body = FSS_Input::getBBCode('body'); $this->errors['subject'] = ''; $this->errors['body'] = ''; $this->errors['cat'] = ''; $what = FSS_Input::getCmd('what'); // done with ticket, try and save, if not, display any errors if ($what == "add") { if ($this->saveTicket()) { echo "Saved OK!"; exit; $link = 'index.php?option=com_fss&view=ticket&layout=view&Itemid=' . FSS_Input::getInt('Itemid') . '&ticketid=' . $this->ticketid; $mainframe->redirect($link); return; } } $this->product = $this->get('Product'); $this->dept = $this->get('Department'); $this->cats = SupportHelper::getCategories(); $this->pris = SupportHelper::getPriorities(); $this->support_user_attach = FSS_Settings::get('support_user_attach'); $this->fields = FSSCF::GetCustomFields(0, $prodid, $deptid); parent::display(); }
function __construct() { parent::__construct(); $mainframe = JFactory::getApplication(); global $option; // Get pagination request variables $aparams = FSS_Settings::GetViewSettingsObj('faqs'); $this->_enable_pages = $aparams->get('enable_pages', 1); $limit = $mainframe->getUserStateFromRequest('global.list.limit', 'limit', FSS_Settings::Get('faq_per_page'), 'int'); if ($this->_enable_pages == 0) { $limit = 999999; } $limitstart = FSS_Input::getInt('limitstart', 0); // In case limit has been changed, adjust it $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; $this->setState('limit', $limit); $this->setState('limitstart', $limitstart); $this->_curcatid = FSS_Input::getInt('catid', ''); $this->_search = FSS_Input::getString('search', ''); $this->_catlist = $this->_getCatList(); if ($this->_search != "") { $this->_curcattitle = JText::_("SEARCH_RESULTS"); $this->_curcatid = -1; $this->_curcatimage = "/components/com_fss/assets/images/search.png"; } else { if ($this->_curcatid == "0") { $this->_curcattitle = JText::_("ALL_FAQS"); $this->_curcatimage = "/components/com_fss/assets/images/allfaqs.png"; } else { foreach ($this->_catlist as $cat) { if ($cat['id'] == $this->_curcatid) { $this->_curcattitle = $cat['title']; $this->_curcatimage = $cat['image']; $this->_curcatdesc = $cat['description']; } } } } }
function Admin_ForwardHandler($ticket, $params) { $handler_msg = $params['handler_message']; $user_msg = $params['user_message']; if (FSS_Settings::Get('support_email_send_empty_handler')) { if (!$user_msg) { $user_msg = JText::_("THIS_TICKET_HAS_BEEN_FORWARDED_TO_ANOTHER_HANDLER"); } // translation message missing, provide english version just in case if (!$user_msg || $user_msg == "THIS_TICKET_HAS_BEEN_FORWARDED_TO_ANOTHER_HANDLER") { $user_msg = 'This ticket has been forwarded to another handler'; } } if ($handler_msg) { FSS_EMail::Admin_Forward($ticket, $params['subject'], $handler_msg, $params['files']); } else { if ($user_msg) { FSS_EMail::Admin_Forward($ticket, $params['subject'], $user_msg, $params['files']); } } if ($user_msg) { FSS_EMail::Admin_Reply($ticket, $params['subject'], $user_msg, $params['files']); } }
function listTickets() { // load list of tickets to display and then do the generic ticket list page $pathway = JFactory::getApplication()->getPathway(); $pathway->addItem(JText::_("SUPPORT")); $def_open = FSS_Ticket_Helper::GetStatusID('def_open'); $tickets = FSS_Input::getCmd('tickets', $def_open); $this->ticket_list = new SupportTickets(); $this->ticket_list->limitstart = $this->limitstart; $this->ticket_list->limit = $this->limit; $this->ticket_list->loadTicketsByStatus($tickets); $this->ticket_count = $this->ticket_list->ticket_count; // get refresh settings $this->refresh = FSS_Input::getInt("refresh"); $this->do_refresh = FSS_Settings::Get('support_admin_refresh'); $this->pagination = new JPaginationEx($this->ticket_count, $this->limitstart, $this->limit); if (!$this->refresh) { FSS_Helper::IncludeModal(); } $this->displayTicketList(); if ($this->refresh) { exit; } }
<ul class="nav nav-tabs"> <?php if (FSS_Input::getString('search') != "") { ?> <li class="active"> <a href='#' onclick="return false;"> Search </a> </li> <?php } ?> <?php if (!FSS_Settings::Get('support_only_admin_open')) { ?> <li class='<?php if (FSS_Input::getCmd('layout') == 'open') { echo 'active'; } ?> '> <a href='<?php echo FSSRoute::_('index.php?option=com_fss&view=ticket&layout=open'); ?> ' style="color: #0049b7 !important;"> <?php echo JText::_("OPEN_NEW_TICKET"); ?> </a>
function saveReply() { $this->removeDraft(FSS_Input::getInt('draft')); // get posted data $ticketid = FSS_Input::getInt('ticketid'); $reply_type = FSS_Input::getCmd('reply_type'); $user_message = FSS_Input::getBBCode('body'); $handler_message = FSS_Input::getBBCode('body2'); $subject = FSS_Input::getString('subject'); // load ticket $ticket = new SupportTicket(); if (!$ticket->load($ticketid)) { exit; } // set up some variables $user_id = JFactory::getUser()->id; $handler_id = $user_id; $old_st = $ticket->getStatus(); $action_name = ""; $action_params = array(); $message_id = 0; $files_private = 0; // add signatures to messages if (FSS_Input::getInt('signature')) { if ($user_message) { $user_message .= SupportCanned::AppendSig(FSS_Input::getInt('signature'), $ticket); } if ($handler_message) { $handler_message .= SupportCanned::AppendSig(FSS_Input::getInt('signature'), $ticket); } } $extra_time = 0; $timestart = 0; $timeend = 0; if (FSS_Settings::Get('time_tracking') != "") { if (FSS_Settings::get('time_tracking_type') == 'se') { $timestart = strtotime("1970-01-01 " . FSS_Input::getString('timetaken_start')); $timeend = strtotime("1970-01-01 " . FSS_Input::getString('timetaken_end')); $extra_time = (int) (($timeend - $timestart) / 60); } elseif (FSS_Settings::get('time_tracking_type') == 'tm') { $timestart = strtotime(FSS_Input::getString('timetaken_start')); $timeend = strtotime(FSS_Input::getString('timetaken_end')); $extra_time = (int) (($timeend - $timestart) / 60); } else { $extra_time = (int) (FSS_Input::getInt('timetaken_hours') * 60 + FSS_Input::getInt('timetaken_mins')); } } // different reply types switch ($reply_type) { case 'reply': // post reply to user if ($user_message) { $message_id = $ticket->addMessage($user_message, $subject, $user_id, TICKET_MESSAGE_ADMIN, $extra_time, $timestart, $timeend); $ticket->addTime($extra_time); } elseif ($extra_time > 0) { // no message, add time if needed $ticket->addTime($extra_time, "", true, $timestart, $timeend); } // update status $new_status = FSS_Input::getInt('reply_status'); $ticket->updateStatus($new_status); // reassign ticket if needed if (FSS_Settings::get('support_assign_reply') == 1 && FSS_Input::getInt('dontassign') == 0) { $ticket->assignHandler($handler_id, TICKET_ASSIGN_TOOK_OWNER); } elseif (FSS_Settings::get('support_autoassign') == 3 && $ticket->admin_id == 0 && FSS_Input::getInt('dontassign') == 0) { $ticket->assignHandler($handler_id, TICKET_ASSIGN_ASSIGNED); } // call SupportActions handler for admin reply $action_name = "Admin_Reply"; $action_params = array('subject' => $subject, 'user_message' => $user_message, 'status' => $new_status); break; case 'private': // add message to ticket if ($handler_message) { $message_id = $ticket->addMessage($handler_message, $subject, $user_id, TICKET_MESSAGE_PRIVATE, $extra_time, $timestart, $timeend); $ticket->addTime($extra_time); } else { if ($extra_time > 0) { $ticket->addTime($extra_time, "", true, $timestart, $timeend); } } $files_private = 1; // call support actions for private comment $action_name = "Admin_Private"; $action_params = array('subject' => $subject, 'handler_message' => $handler_message); break; case 'user': // update user on ticket $new_user_id = FSS_Input::getInt("user_id"); $ticket->updateUser($new_user_id); if ($user_message) { $message_id = $ticket->addMessage($user_message, $subject, $user_id, TICKET_MESSAGE_ADMIN, $extra_time, $timestart, $timeend); $ticket->addTime($extra_time); } else { if ($extra_time > 0) { $ticket->addTime($extra_time, "", true, $timestart, $timeend); $extra_time = 0; } } $action_name = "Admin_ForwardUser"; $action_params = array('subject' => $subject, 'user_message' => $user_message, 'user_id' => $new_user_id); // break; case 'product': $new_handler_id = FSS_Input::getInt('new_handler'); // update product and department $new_product_id = FSS_Input::getInt("new_product_id"); $new_department_id = FSS_Input::getInt("new_department_id"); $ticket->updateProduct($new_product_id); $ticket->updateDepartment($new_department_id); /** * -2 - Auto Assign * -1 - Unchanged * 0 - Unassigned * X - Hander **/ if ($new_handler_id == -1) { //$ticket->assignHandler($new_handler_id, TICKET_ASSIGN_FORWARD); } else { if ($new_handler_id == 0) { $ticket->assignHandler(0, -1); } else { if ($new_handler_id > 0) { $ticket->assignHandler($new_handler_id, TICKET_ASSIGN_FORWARD); } else { if ($new_handler_id == -2) { // auto assign new handler $admin_id = FSS_Ticket_Helper::AssignHandler($new_product_id, $new_department_id, $ticket->ticket_cat_id, true); $ticket->assignHandler($admin_id, TICKET_ASSIGN_FORWARD); } } } } if ($user_message) { $message_id = $ticket->addMessage($user_message, $subject, $user_id, TICKET_MESSAGE_ADMIN, $extra_time, $timestart, $timeend); $ticket->addTime($extra_time); $extra_time = 0; } if ($handler_message) { $ticket->addMessage($handler_message, $subject, $user_id, TICKET_MESSAGE_PRIVATE, $extra_time, $timestart, $timeend); $ticket->addTime($extra_time); $extra_time = 0; } if ($extra_time > 0) { $ticket->addTime($extra_time, "", true, $timestart, $timeend); } $action_name = "Admin_ForwardProduct"; $action_params = array('subject' => $subject, 'user_message' => $user_message, 'handler_message' => $handler_message, 'product_id' => $new_product_id, 'department_id' => $new_department_id); break; case 'handler': $new_handler_id = FSS_Input::getInt('new_handler'); if ($new_handler_id == -2) { // auto assign new handler $admin_id = FSS_Ticket_Helper::AssignHandler($ticket->prod_id, $ticket->ticket_dept_id, $ticket->ticket_cat_id, true); $ticket->assignHandler($admin_id, TICKET_ASSIGN_FORWARD); } else { if ($new_handler_id != -1) { $ticket->assignHandler($new_handler_id, TICKET_ASSIGN_FORWARD); } } // update status $new_status = FSS_Input::getCmd('reply_status'); $ticket->updateStatus($new_status); if ($user_message) { $message_id = $ticket->addMessage($user_message, $subject, $user_id, TICKET_MESSAGE_ADMIN, $extra_time, $timestart, $timeend); $ticket->addTime($extra_time); $extra_time = 0; } if ($handler_message) { $ticket->addMessage($handler_message, $subject, $user_id, TICKET_MESSAGE_PRIVATE, $extra_time, $timestart, $timeend); $ticket->addTime($extra_time); $extra_time = 0; } if ($extra_time > 0) { $ticket->addTime($extra_time, "", true, $timestart, $timeend); } $action_name = "Admin_ForwardHandler"; $action_params = array('subject' => $subject, 'user_message' => $user_message, 'handler_message' => $handler_message, 'handler_id' => $new_handler_id); break; } // add posted files $files = $ticket->addFilesFromPost($message_id, -1, $files_private); $ticket->stripImagesFromMessage($message_id); $action_params['files'] = $files; // call action handler SupportActions::DoAction($action_name, $ticket, $action_params); // Redirect to new page $link = FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=' . $ticket->id, false); $new_st = $ticket->getStatus(); if ($reply_type == "reply") { if ($new_st->is_closed && SupportUsers::getSetting("return_on_close")) { $link = SupportHelper::parseRedirectType($old_st->id, SupportUsers::getSetting("return_on_close")); } else { if (SupportUsers::getSetting("return_on_reply")) { $link = SupportHelper::parseRedirectType($old_st->id, SupportUsers::getSetting("return_on_reply")); } } } JFactory::getApplication()->redirect($link); }
static function AddSCEditor() { if (!FSS_Helper::$sceditor) { if (FSS_Settings::Get('support_sceditor')) { $document = JFactory::getDocument(); $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/sceditor/jquery.sceditor.bbcode.js'); $document->addScript(JURI::root(true) . '/components/com_fss/assets/js/sceditor/include.sceditor.js'); $document->addScriptDeclaration("var sceditor_emoticons_root = '" . JURI::root(true) . "/components/com_fss/assets/';"); $document->addScriptDeclaration("var sceditor_style_root = '" . JURI::root(true) . "/components/com_fss/assets/js/sceditor/';"); $document->addScriptDeclaration("var sceditor_style_type = '" . FSS_Settings::get('sceditor_content') . "';"); $button_exclude = array(); if (!FSS_Settings::get('sceditor_emoticons')) { $button_exclude[] = "emoticon"; } if (FSS_Settings::get('sceditor_buttonhide')) { $button_exclude[] = str_replace(" ", "", FSS_Settings::get('sceditor_buttonhide')); } $document->addScriptDeclaration("var sceditor_toolbar_exclude = '" . implode(",", $button_exclude) . "';"); $document->addStyleSheet(JURI::root(true) . '/components/com_fss/assets/js/sceditor/themes/' . FSS_Settings::get('sceditor_theme') . '.css'); //$document->addStyleSheet(JURI::root(true).'/components/com_fss/assets/js/sceditor/themes/square.css'); } FSS_Helper::$sceditor = true; } }
function doOpenTicket() { if (!FSS_Permission::auth("fss.ticket.open", "com_fss.support_user")) { return FSS_Helper::NoPerm(); } $mainframe = JFactory::getApplication(); $user = JFactory::getUser(); $userid = $user->get('id'); $this->userid = $userid; $this->email = ''; $this->admin_create = 0; $session = JFactory::getSession(); if (FSS_Input::getInt('admincreate') > 0) { $session->Set("admin_create", FSS_Input::getInt('admincreate')); if ($session->Get("admin_create") == 1 && FSS_Input::getInt('user_id') > 0) { $session->Set('admin_create_user_id', FSS_Input::getInt('user_id')); } else { if ($session->Get("admin_create") == 2 && (FSS_Input::getString('admin_create_email') || FSS_Input::getString('admin_create_name'))) { $session->Set('ticket_email', FSS_Input::getEMail('admin_create_email')); $session->Set('ticket_name', FSS_Input::getString('admin_create_name')); } } } if ($session->Get("admin_create") == 1) { $this->admin_create = 1; $model = $this->getModel(); $this->user = $model->getUser($session->Get('admin_create_user_id')); } else { if ($session->Get("admin_create") == 2) { $this->unreg_email = $session->Get('ticket_email'); $this->unreg_name = $session->Get('ticket_name'); $this->admin_create = 2; } } if (FSS_Settings::Get('support_only_admin_open') && $this->admin_create < 1) { return $this->noPermission("Access Denied", "CREATING_NEW_TICKETS_BY_USERS_IS_CURRENTLY_DISABLED"); } // store in session and data for an unregistered ticket $type = FSS_Input::getCmd('type'); if ($type == "without") { $email = FSS_Input::getEMail('email'); $name = FSS_Input::getString('name'); if ($name == "") { $name = $email; } if ($email != "") { $session->Set('ticket_email', $email); $session->Set('ticket_name', $name); } } if (!$this->ValidateUser('open')) { return; } // defaults for blank ticket $ticket['priid'] = FSS_Input::getInt('priid', FSS_Settings::get('support_default_priority')); $ticket['body'] = FSS_Input::GetString('body'); $ticket['subject'] = FSS_Input::GetString('subject'); $ticket['handler'] = FSS_Input::getInt('handler', 0); $this->ticket = $ticket; $errors['subject'] = ''; $errors['body'] = ''; $errors['cat'] = ''; $errors['captcha'] = ''; $this->errors = $errors; $prodid = FSS_Input::getInt('prodid'); // prod id not set, should we display product list??? if ($prodid < 1) { $this->products = $this->get('Products'); if (count($this->products) > 1) { $this->search = ""; $pagination = $this->get('ProdPagination'); $this->pagination = $pagination; $this->limit = $this->get("ProdLimit"); parent::display("product"); return; } else { if (count($this->products) == 1) { $prodid = $this->products[0]['id']; JRequest::setVar('prodid', $prodid); //echo "Setting prodid to $prodid<br>"; } } } $this->assign('prodid', $prodid); $deptid = FSS_Input::getInt('deptid'); // dept id not set, should we display department list? if ($deptid < 1) { $this->search = ""; $this->depts = $this->get('Departments'); $this->limit = $this->get("ProdLimit"); if (count($this->depts) > 1) { $this->pagination = $this->get('DeptPagination'); $this->product = $this->get('Product'); parent::display("department"); return; } else { if (count($this->depts) == 1) { $deptid = $this->depts[0]['id']; JRequest::setVar('deptid', $deptid); //echo "Setting deptid to $deptid<br>"; } } } $what = FSS_Input::getCmd('what'); // done with ticket, try and save, if not, display any errors if ($what == "add") { if ($this->saveTicket()) { $message = FSS_Helper::HelpText("support_open_thanks", true); if ($message != "") { FSS_Helper::enqueueMessage($message, "success"); } //exit; if ($this->admin_create > 0) { $link = 'index.php?option=com_fss&view=admin_support&Itemid=' . FSS_Input::getInt('Itemid', '') . '&ticketid=' . $this->ticketid; $mainframe->redirect(FSSRoute::_($link, false)); } else { // need to set the session info that will display the ticket to the user here! $link = 'index.php?option=com_fss&view=ticket&layout=view&Itemid=' . FSS_Input::getInt('Itemid', '') . '&ticketid=' . $this->ticketid; $mainframe->redirect(FSSRoute::_($link, false)); } return; } else { //echo "Error saving ticket<br>"; } } // load handlers if required. This depends on what product and department have been selected if (FSS_Settings::get('support_choose_handler') != "none") { $allow_no_auto = 0; if ($this->admin_create > 0) { $allow_no_auto = 1; $this->autohandlers = SupportUsers::getHandlersTicket($prodid, $deptid, 0); } $handlers = SupportUsers::getHandlersTicket($prodid, $deptid, 0, $allow_no_auto); /** * I DONT KNOW IF THIS IS A GOOD CHANGE OR NOT, BUT IT MAKES IT CONSISTANT EVERYWHERE I THINK **/ // if the hide super users checkbox is tickets, hide them all from the dropdown if (FSS_Settings::get('support_hide_super_users')) { foreach ($handlers as $offset => $handler) { $fssuser = SupportUsers::getUser($handler); $juser = JFactory::getUser($handler); if ($juser->get('isRoot') && $userid != $juser->id) { unset($handlers[$offset]); } } } if (count($handlers) == 0) { $handlers[] = 0; } $qry = "SELECT * FROM #__users WHERE id IN (" . implode(", ", $handlers) . ")"; $db = JFactory::getDBO(); $db->setQuery($qry); $handlers = $db->loadAssocList(); $this->handlers = array(); $h = array(); $h['id'] = 0; $h['name'] = JText::_('AUTO_ASSIGN'); $this->handlers[] = $h; if (is_array($handlers)) { foreach ($handlers as $handler) { $this->handlers[] = $handler; } } } $this->assign('deptid', $deptid); $this->product = $this->get('Product'); $this->dept = $this->get('Department'); $this->cats = $this->get('Cats'); $this->pris = $this->get('Priorities'); $this->support_user_attach = FSS_Settings::get('support_user_attach'); $this->fields = FSSCF::GetCustomFields(0, $prodid, $deptid); // load in captch and display if needed $this->sortCaptchaType(); $captcha = new FSS_Captcha(); $this->captcha = $captcha->GetCaptcha('support_captcha_type'); parent::display(); }
require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'j3helper.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'helper.php'; require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'parser.php'; FSS_Helper::StylesAndJS(array('autoscroll')); $db = JFactory::getDBO(); jimport('joomla.utilities.date'); $query = "SELECT * FROM #__fss_announce"; $where = array(); $where[] = "published = 1"; $where[] = 'language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')'; $user = JFactory::getUser(); $where[] = 'access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')'; if (count($where) > 0) { $query .= " WHERE " . implode(" AND ", $where); } $query .= " ORDER BY added DESC "; if ($params->get('listall') == 0) { $query .= " LIMIT " . $params->get('dispcount'); } $maxheight = (int) $params->get('maxheight'); $db->setQuery($query); $rows = $db->loadAssocList(); $parser = new FSSParser(); $type = FSS_Settings::Get('announcemod_use_custom') ? 2 : 3; $parser->Load("announcemod", $type); $parser->SetVar('showdate', $params->get('show_date')); if ($params->get('viewannounce')) { $parser->SetVar('readmore', JText::_("READ_MORE")); } require JModuleHelper::getLayoutPath('mod_fss_announce'); }
<div class="fss_spacer"></div> <div class="media"> <a class="pull-left" href="#" onclick="return false;"> <img class="media-object" src='<?php echo JURI::root(true); ?> /components/com_fss/assets/images/tags-64x64.png' width='64' height='64'> </a> <div class="media-body"> <div style="min-height: 64px"> <h4 class="media-heading"> <?php if (FSS_Settings::Get('faq_cat_prefix')) { ?> <?php echo JText::_("FAQS"); ?> <?php } ?> <?php echo JText::_('TAGS'); ?> </h4> </div>
function display($tpl = null) { if (!FSS_Permission::auth("fss.view", "com_fss.announce")) { return FSS_Helper::NoPerm(); } $mainframe = JFactory::getApplication(); $aparams = $mainframe->getPageParameters('com_fss'); $announceid = FSS_Input::getInt('announceid'); require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'content' . DS . 'announce.php'; $this->content = new FSS_ContentEdit_Announce(); $this->content->Init(); $model = $this->getModel(); $model->content = $this->content; if ($announceid) { $tmpl = FSS_Input::getCmd('tmpl'); $this->tmpl = $tmpl; $this->setLayout("announce"); $this->announce = $this->get("Announce"); if (!$this->announce) { $mainframe->redirect(FSSRoute::_("index.php?option=com_fss&view=announce", false)); } $pathway = $mainframe->getPathway(); if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'announce'))) { $pathway->addItem(JText::_("ANNOUNCEMENTS"), FSSRoute::_('&limitstart=announceid=')); } // FIX LINK $pathway->addItem($this->announce['title']); $this->comments = new FSS_Comments('announce', $announceid); $this->comments->PerPage(FSS_Settings::Get('announce_comments_per_page')); if ($this->comments->Process()) { return; } if (FSS_Settings::get('announce_use_content_plugins')) { // apply plugins to article body $dispatcher = JDispatcher::getInstance(); JPluginHelper::importPlugin('content'); $art = new stdClass(); $art->text = $this->announce['body']; $art->noglossary = 1; $this->params = $mainframe->getParams('com_fss'); $results = $dispatcher->trigger('onContentPrepare', array('com_fss.announce', &$art, &$this->params, 0)); $this->announce['body'] = $art->text; if ($this->announce['fulltext']) { $art->text = $this->announce['fulltext']; $art->noglossary = 1; $results = $dispatcher->trigger('onContentPrepare', array('com_fss.announce.fulltext', &$art, &$this->params, 0)); $this->announce['fulltext'] = $art->text; } } $this->parser = new FSSParser(); $type = FSS_Settings::Get('announcesingle_use_custom') ? 2 : 3; $this->parser->Load("announcesingle", $type); parent::display($tpl); return; } $pathway = $mainframe->getPathway(); if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'announce'))) { $pathway->addItem(JText::_("ANNOUNCEMENTS")); } $this->announces = $this->get('Announces'); $this->pagination = $this->get('Pagination'); if (FSS_Settings::get('announce_use_content_plugins_list')) { // apply plugins to article body $dispatcher = JDispatcher::getInstance(); JPluginHelper::importPlugin('content'); $art = new stdClass(); foreach ($this->announces as &$item) { $art->text = $item['body']; $art->noglossary = 1; $this->params = $mainframe->getParams('com_fss'); $results = $dispatcher->trigger('onContentPrepare', array('com_fss.announce', &$art, &$this->params, 0)); $item['body'] = $art->text; } } $this->comments = new FSS_Comments('announce', null, $this->announces); $this->parser = new FSSParser(); $type = FSS_Settings::Get('announce_use_custom') ? 2 : 3; $this->parser->Load("announce", $type); if (FSS_Input::getCmd('feed') == "rss") { //header("Content-Type: text/xml"); header("Content-Type: application/xml; charset=UTF-8"); parent::display("rss"); exit; } else { parent::display($tpl); } }
function displaySingleProduct() { $this->product = $this->get('Product'); $this->products = $this->get('Products'); FSS_Translate_Helper::TrSingle($this->product); FSS_Translate_Helper::Tr($this->products); $mainframe = JFactory::getApplication(); $pathway = $mainframe->getPathway(); if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'test'))) { $pathway->addItem(JText::_('TESTIMONIALS'), FSSRoute::_('index.php?option=com_fss&view=test')); } $pathway->addItem($this->product['title']); // no product then general testimonials if (!$this->product && count($this->products) > 0) { $this->product = array(); $this->product['title'] = JText::_('GENERAL_TESTIMONIALS'); $this->product['id'] = 0; $this->product['description'] = ''; $this->product['image'] = '/components/com_fss/assets/images/generaltests.png'; } if ($this->test_always_prod_select) { $this->comments->show_item_select = 1; } else { $this->comments->show_item_select = 0; } $this->comments->PerPage(FSS_Settings::Get('test_comments_per_page')); parent::display("single"); }
function showArt() { $mainframe = JFactory::getApplication(); $kbartid = FSS_Input::getInt('kbartid'); $this->comments = new FSS_Comments('kb', $kbartid); $this->comments->PerPage(FSS_Settings::Get('kb_comments_per_page')); if ($this->comments->Process()) { return; } $this->assign('kb_rate', FSS_Settings::get('kb_rate')); $this->assign('kb_comments', FSS_Settings::get('kb_comments')); //$this->assign( 'kb_comments_captcha', FSS_Settings::get( 'kb_comments_captcha' )); //$this->assign( 'kb_comments_moderate', FSS_Settings::get( 'kb_comments_moderate' )); $error = ""; $rate = FSS_Input::getCmd('rate'); if ($rate != "") { $this->RateArticle($kbartid, $rate); return; } $this->setLayout("article"); $this->art = $this->get("Article"); if (!$this->art) { return JError::raiseError(404, 'Article Not Found'); return; } $this->handlePages(); if (FSS_Settings::get('kb_use_content_plugins')) { // apply plugins to article body $dispatcher = JDispatcher::getInstance(); JPluginHelper::importPlugin('content'); $art = new stdClass(); $art->text = $this->art['body']; $art->noglossary = 1; $this->params = $mainframe->getParams('com_fss'); $results = $dispatcher->trigger('onContentPrepare', array('com_fss.kb', &$art, &$this->params, 0)); $this->art['body'] = $art->text; } $this->artattach = $this->get("ArticleAttach"); $this->products = $this->get("Products"); $this->applies = $this->get("AppliesTo"); $this->related = $this->get("Related"); $document = JFactory::getDocument(); $document->setTitle(JText::_("KNOWLEDGE_BASE") . ' - ' . $this->art['title']); $pathway = $mainframe->getPathway(); if (FSS_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'kb'))) { $pathway->addItem(JText::_('KNOWLEDGE_BASE'), FSSRoute::_('index.php?option=com_fss&view=kb')); } $this->product = $this->get("Product"); $prodid = ""; if ($this->product['title']) { $prodid = $this->product['id']; $pathway->addItem($this->product['title'], FSSRoute::_('index.php?option=com_fss&view=kb&prodid=' . $this->product['id'])); } JRequest::setVar('catid', $this->art['kb_cat_id']); $this->cat = $this->get("Cat"); if ($this->art['kb_cat_id'] > 0 && !$this->cat) { // unable to load the cat, so 404! return JError::raiseError(404, 'Article Not Found'); } if ($this->cat['title']) { $cat = $this->cat; $max = 3; while ($cat['parcatid'] > 0 && $max-- > 0) { JRequest::setVar('catid', $cat['parcatid']); $cat = $this->get("Cat"); $pathway->addItem($cat['title'], FSSRoute::_("index.php?option=com_fss&view=kb&prodid={$prodid}&catid={$cat['id']}")); } //print_p($this->cat); $pathway->addItem($this->cat['title'], FSSRoute::_("index.php?option=com_fss&view=kb&prodid={$prodid}&catid={$this->cat['id']}")); } $pathway->addItem($this->art['title']); // update views if ($this->art['id']) { $db = JFactory::getDBO(); $query = "UPDATE #__fss_kb_art SET views = views + 1 WHERE id = " . FSSJ3Helper::getEscaped($db, $this->art['id']); $db->setQuery($query); $db->Query(); } if (FSS_Input::getCmd('only') == "article") { parent::display('only'); exit; } else { parent::display(); } }
<?php } ?> <div class="media-body"> <div <?php if ($this->curcatimage) { ?> style="min-height: 64px"<?php } ?> > <h4 class="media-heading"> <?php if (FSS_Settings::Get('faq_cat_prefix') || !$this->curcattitle) { ?> <?php echo JText::_("FAQS"); ?> <?php if ($this->curcattitle) { echo " - "; } ?> <?php } ?> <?php echo $this->curcattitle;
function getMailer() { if (!FSS_Settings::Get('email_send_override')) { $mailer = JFactory::getMailer(); $mailer->setSender($this->Get_Sender()); $mailer->CharSet = 'UTF-8'; return $mailer; } $smtpauth = FSS_Settings::Get('email_send_smtp_auth') == 0 ? null : 1; $smtpuser = FSS_Settings::Get('email_send_smtp_username'); // $conf->get('smtpuser'); $smtppass = FSS_Settings::Get('email_send_smtp_password'); // $conf->get('smtppass'); $smtphost = FSS_Settings::Get('email_send_smtp_host'); // $conf->get('smtphost'); $smtpsecure = FSS_Settings::Get('email_send_smtp_security'); // $conf->get('smtpsecure'); $smtpport = FSS_Settings::Get('email_send_smtp_port'); // $conf->get('smtpport'); $mailfrom = FSS_Settings::Get('email_send_from_email'); // $conf->get('mailfrom'); $fromname = FSS_Settings::Get('email_send_from_name'); // $conf->get('fromname'); $mailer = FSS_Settings::Get('email_send_mailer'); // $conf->get('mailer'); // Create a JMail object $mail = new JMail(); // Set default sender without Reply-to $mail->SetFrom(JMailHelper::cleanLine($mailfrom), JMailHelper::cleanLine($fromname), 0); // Default mailer is to use PHP's mail function switch ($mailer) { case 'smtp': $mail->useSMTP($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport); break; case 'sendmail': $mail->IsSendmail(); break; default: $mail->IsMail(); break; } $mail->CharSet = 'UTF-8'; return $mail; }
function &getTickets() { $db = JFactory::getDBO(); $user = JFactory::getUser(); $userid = $user->get('id'); $uidlist = $this->getUIDS($userid); $tidlist = $this->getTIDS($userid); $query = "SELECT t.*, s.title as status, s.color, u.name, au.name as assigned, u.email as useremail, u.username as username, au.email as handleremail, au.username as handlerusername, "; $query .= " dept.title as department, cat.title as category, prod.title as product, pri.title as priority, pri.color as pricolor, "; $query .= " grp.groupname as groupname, grp.id as group_id "; $query .= " , pri.translation as ptl, dept.translation as dtr, s.translation as str, cat.translation as ctr, prod.translation as prtr"; $query .= " FROM #__fss_ticket_ticket as t "; $query .= " LEFT JOIN #__fss_ticket_status as s ON t.ticket_status_id = s.id "; $query .= " LEFT JOIN #__users as u ON t.user_id = u.id "; $query .= " LEFT JOIN #__users as au ON t.admin_id = au.id "; $query .= " LEFT JOIN #__fss_ticket_dept as dept ON t.ticket_dept_id = dept.id "; $query .= " LEFT JOIN #__fss_ticket_cat as cat ON t.ticket_cat_id = cat.id "; $query .= " LEFT JOIN #__fss_prod as prod ON t.prod_id = prod.id "; $query .= " LEFT JOIN #__fss_ticket_pri as pri ON t.ticket_pri_id = pri.id "; $query .= " LEFT JOIN (SELECT group_id, user_id FROM #__fss_ticket_group_members GROUP BY user_id) as mem ON t.user_id = mem.user_id "; $query .= " LEFT JOIN #__fss_ticket_group as grp ON grp.id = mem.group_id "; // add product, department and category $query .= " WHERE ( t.user_id IN (" . implode(", ", $uidlist) . ") OR t.id IN (" . implode(", ", $tidlist) . ") ) "; $query .= " AND " . SupportSource::user_list_sql(); $tickets = FSS_Input::getCmd('tickets', 'open'); if (FSS_Settings::get('support_simple_userlist_tabs')) { $tickets = "all"; } if (FSS_Input::getCmd('search_all')) { $tickets = ""; } if ($tickets == 'open') { $allopen = FSS_Ticket_Helper::GetStatusIDs("is_closed", true); // tickets that arent closed $query .= " AND ticket_status_id IN ( " . implode(", ", $allopen) . ") "; } if ($tickets == 'closed') { $allopen = FSS_Ticket_Helper::GetStatusIDs("is_closed"); // remove the archived tickets from the list to deal with $def_archive = FSS_Ticket_Helper::GetStatusID('def_archive'); foreach ($allopen as $offset => $value) { if ($value == $def_archive) { unset($allopen[$offset]); } } // tickets that are closed $query .= " AND ticket_status_id IN ( " . implode(", ", $allopen) . ") "; } else { if ($tickets > 0) { $statuss = SupportHelper::getStatuss(false); $status_list = array(); $status_list[] = (int) $tickets; foreach ($statuss as $status) { if ($status->combine_with == (int) $tickets) { $status_list[] = $status->id; } } $query .= " AND ticket_status_id IN (" . implode(", ", $status_list) . ")"; } } $search = FSS_Input::getString('search'); if ($search != "") { FSS_Helper::AllowCache(); // We have the nearly full query here, so use it to get a list of ticket ids $db->setQuery($query); $recs = $db->loadObjectList(); $ids = array(); $ids[] = 0; foreach ($recs as $rec) { $ids[] = $rec->id; } $mode = ""; if (FSS_Helper::contains($search, array('*', '+', '-', '<', '>', '(', ')', '~', '"'))) { $mode = "IN BOOLEAN MODE"; } $msgsrch = "SELECT ticket_ticket_id FROM #__fss_ticket_messages WHERE ticket_ticket_id IN (" . implode(", ", $ids) . ") AND admin < 3 AND "; $msgsrch .= " MATCH (body) AGAINST ('" . $db->escape($search) . "' {$mode}) "; $db->setQuery($msgsrch); $results = $db->loadObjectList(); $ids = array(); $ids[] = 0; foreach ($results as $rec) { $ids[] = $rec->ticket_ticket_id; } // search custom fields that are set to be searched $fields = FSSCF::GetAllCustomFields(true); foreach ($fields as $field) { if (!$field["basicsearch"]) { continue; } if ($field['permissions'] > 1 && $field['permissions'] < 5) { continue; } $fieldid = $field['id']; if ($field['type'] == "checkbox") { if ($search == "1") { $search = "on"; } else { $search = ""; } } if ($field['peruser']) { continue; } if ($field['type'] == "plugin") { // try to do a plugin based search $data = array(); foreach ($field['values'] as $item) { list($key, $value) = explode("=", $item, 2); $data[$key] = $value; } if (array_key_exists("plugin", $data)) { $plugins = FSSCF::get_plugins(); if (array_key_exists($data['plugin'], $plugins)) { $po = $plugins[$data['plugin']]; if (method_exists($po, "Search")) { $res = $po->Search($data['plugindata'], $search, false, false); if ($res !== false) { foreach ($res as $item) { $ids[] = (int) $item->ticket_id; } continue; } } } } } $qry = "SELECT ticket_id FROM #__fss_ticket_field WHERE field_id = '" . FSSJ3Helper::getEscaped($db, $fieldid) . "' AND value LIKE '%" . FSSJ3Helper::getEscaped($db, $search) . "%'"; $db->setQuery($qry); $data = $db->loadObjectList(); foreach ($data as $item) { $id = (int) $item->ticket_id; if ($id > 0) { $ids[] = $id; } } } //"MATCH (question, answer) AGAINST ('" . $db->escape($search) . "')" $query .= " AND ( t.id IN (" . implode(", ", $ids) . ") OR MATCH (t.title) AGAINST ('" . $db->escape($search) . "' {$mode}) OR t.reference LIKE '%" . $db->escape($search) . "%' ) "; } $order = FSS_Input::getCmd('order'); $order_dir = FSS_Input::getCmd('order_dir', 'asc'); $order_dir_allowed = array('asc', 'desc'); if (!in_array($order_dir, $order_dir_allowed)) { $order_dir = 'asc'; } $order_allowed = array('t.title', 'lastupdate', 'status', 'assigned', 'lastupdate', 'u.name'); if (!in_array($order, $order_allowed)) { $order = ''; } if ($order != "") { $query .= " ORDER BY {$order} {$order_dir}"; } else { $query .= " ORDER BY lastupdate DESC "; } $mainframe = JFactory::getApplication(); $limit = $mainframe->getUserStateFromRequest('global.list.limit_ticket', 'limit', FSS_Settings::Get('ticket_per_page'), 'int'); $limitstart = FSS_Input::getInt('limitstart'); $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0; $db->setQuery($query); $db->query(); //echo $query . "<br>"; $count = $db->getNumRows(); $result['pagination'] = new JPaginationJs($count, $limitstart, $limit); $db->setQuery($query, $limitstart, $limit); $result['tickets'] = $db->loadObjectList(); foreach ($result['tickets'] as &$ticket) { $fields = FSSCF::GetCustomFields($ticket->id, $ticket->prod_id, $ticket->ticket_dept_id); $values = FSSCF::GetTicketValues($ticket->id, $ticket); $ticket->fields = array(); foreach ($fields as &$field) { $ticket->fields[$field['id']] = array(); $ticket->fields[$field['id']]['name'] = $field['description']; $ticket->fields[$field['id']]['value'] = ''; if (isset($values[$field['id']])) { $ticket->fields[$field['id']]['value'] = $values[$field['id']]['value']; } } } return $result; }
if (FSS_Settings::Get('support_sceditor')) { ?> jQuery('#' + id).sceditor('instance').insert(bbcode); <?php } else { ?> jQuery('#' + id).val(jQuery('#' + id).val() + bbcode); <?php } ?> } function insertLink(url, title, id) { <?php if (FSS_Settings::Get('support_sceditor')) { ?> var bbcode = "[url=" + url + "]" + title + "[/url]"; jQuery('#' + id).sceditor('instance').insert(bbcode); <?php } else { ?> jQuery('#' + id).val(jQuery('#' + id).val() + url); <?php } ?> fss_modal_hide(); } function cannedRefresh() {
echo JURI::base(); ?> /components/com_fss/assets/images/rate_down.png'> <?php echo JText::_("NOT_HELPFULL"); ?> </a> </li> </ul> </div> <?php } ?> <?php if (FSS_Settings::Get('kb_print')) { ?> <a class="btn btn-default" href="<?php echo JRoute::_('index.php?option=com_fss&view=kb&kbartid=' . $this->art['id'] . "&tmpl=component&print=1"); ?> " target="_blank"> <i class='icon-print'></i> <?php echo JText::_("PRINT"); ?> </a> <?php } ?>
?> <div id="tags"> <?php include $this->snippet(JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'views' . DS . 'admin_support' . DS . 'snippet' . DS . '_tags.php'); ?> </div> </td> <?php FSS_Table::ColEnd(); } ?> <?php if (FSS_Settings::Get('time_tracking') != "") { ?> <?php FSS_Table::ColStart("tr_time"); ?> <th><?php echo JText::_("TIME_TAKEN"); ?> </th> <td style="border-right:none;"> <?php if ($this->can_ChangeTicket() && $this->can_EditMisc()) { ?> <a class="pull-right padding-left-small" href="#" onclick="jQuery('#time_take_popup').modal();return false;"> <i class="icon-new fssTip" title="<?php
</h4> <?php } ?> </p> </td> </tr> </table> </div> <?php } ?> <?php if (FSS_Permission::CanModerate() && FSS_Settings::Get('mainmenu_moderate')) { ?> <div class="<?php if ($this->info_well) { ?> well well-mini<?php } else { ?> margin-medium<?php } ?> fss_mainmenu_moderate_panel"> <table class="table-borderless"> <tr> <td valign="middle" width="52" style="vertical-align: middle;" class="hidden-phone">