Exemplo n.º 1
0
 function display($tpl = NULL)
 {
     $action = FSS_Input::getCmd('action');
     if ($action == "cancel") {
         $mainframe = JFactory::getApplication();
         $link = FSSRoute::_('index.php?option=com_fss&view=admin_support', false);
         $mainframe->redirect($link);
         return;
     }
     if ($action == "save" || $action == "apply") {
         $all = array('per_page', 'group_products', 'group_departments', 'group_cats', 'group_group', 'group_pri', 'return_on_reply', 'return_on_close', 'reverse_order', 'reports_separator');
         $values = array();
         $values = SupportUsers::getAllSettings();
         foreach ($all as $setting) {
             $new = FSS_Input::getString($setting, 0);
             $values->{$setting} = $new;
         }
         SupportUsers::updateUserSettings($values);
         if ($action == "save") {
             $link = FSSRoute::_('index.php?option=com_fss&view=admin_support', false);
         } else {
             $link = FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=settings', false);
         }
         $mainframe = JFactory::getApplication();
         $mainframe->redirect($link, JText::_('SETTINGS_SAVED'));
         return;
     }
     $this->_display();
 }
Exemplo n.º 2
0
    function navigateFail()
    {
        $session = JFactory::getSession();
        $last_url = $session->get("last_admin_list");
        $posted = $session->get("last_admin_post");
        if ($last_url == "") {
            $last_url = FSSRoute::_("index.php?option=com_fss&view=admin_support");
            $posted = array();
        }
        ?>
<form action='<?php 
        echo $last_url;
        ?>
' method='post' name='frm'>
	<?php 
        foreach ($posted as $a => $b) {
            echo "<input type='hidden' name='" . htmlentities($a, ENT_QUOTES, "utf-8") . "' value='" . htmlentities($b, ENT_QUOTES, "utf-8") . "'>";
        }
        ?>
</form>
<script language="JavaScript">
	document.frm.submit();
</script>
<?php 
        exit;
    }
Exemplo n.º 3
0
 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     $document = JFactory::getDocument();
     $document->addScriptDeclaration("\nvar fss_settings_url = '" . JRoute::_('index.php?option=com_fss&view=settings', false) . "';\n");
     $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/settings.js');
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSSRoute::_('index.php?option=com_fss&view=fsss', false);
         $mainframe->redirect($link);
         return;
     }
     $settings = FSS_Settings::GetAllViewSettings();
     // CHANGE
     $db = JFactory::getDBO();
     if ($what == "save") {
         $data = JRequest::get('POST', JREQUEST_ALLOWRAW);
         foreach ($data as $setting => $value) {
             if (array_key_exists($setting, $settings)) {
                 $settings[$setting] = $value;
             }
         }
         foreach ($settings as $setting => $value) {
             if (!array_key_exists($setting, $data)) {
                 $settings[$setting] = 0;
                 $value = 0;
             }
             $qry = "REPLACE INTO #__fss_settings_view (setting, value) VALUES ('";
             $qry .= FSSJ3Helper::getEscaped($db, $setting) . "','";
             $qry .= FSSJ3Helper::getEscaped($db, $value) . "')";
             $db->setQuery($qry);
             $db->Query();
         }
         $link = 'index.php?option=com_fss&view=settingsview#' . $this->tab;
         if (JRequest::getVar('task') == "save") {
             $link = 'index.php?option=com_fss';
         }
         $mainframe = JFactory::getApplication();
         $mainframe->redirect($link, JText::_("View_Settings_Saved"));
         exit;
     } else {
         $document = JFactory::getDocument();
         $document->addStyleSheet(JURI::root() . 'administrator/components/com_fss/assets/css/js_color_picker_v2.css');
         $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/color_functions.js');
         $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/js_color_picker_v2.js');
         $this->settings = $settings;
         JToolBarHelper::title(JText::_("FREESTYLE_SUPPORT_PORTAL") . ' - ' . JText::_("VIEW_SETTINGS"), 'fss_viewsettings');
         JToolBarHelper::apply();
         JToolBarHelper::save();
         JToolBarHelper::cancel('cancellist');
         FSSAdminHelper::DoSubToolbar();
         parent::display($tpl);
     }
 }
Exemplo n.º 4
0
 function display($tpl = NULL)
 {
     // view a ticket!
     $this->ticketid = FSS_Input::getInt('ticketid');
     $document = JFactory::getDocument();
     $document->addScript(JURI::root() . 'components/com_fss/assets/js/bootstrap/bootstrap-timepicker.min.js');
     $this->ticket = new SupportTicket();
     if (!$this->ticket->load($this->ticketid)) {
         if ($this->ticket->checkExist($this->ticketid)) {
             return $this->_display("noperm");
         } else {
             return JError::raiseWarning(404, JText::_('Ticket not found'));
         }
     }
     if ($this->ticket->merged > 0 && FSS_Input::getInt('no_redirect') != '1') {
         JFactory::getApplication()->redirect(FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=' . $this->ticket->merged . "&Itemid=" . FSS_Input::getInt('Itemid'), false));
     }
     $reverse = JRequest::getInt('sort', null);
     if ($reverse !== null) {
         if ($reverse) {
             // we want messages in opposite order to normal
             if (SupportUsers::getSetting("reverse_order")) {
                 $reverse = true;
             } else {
                 $reverse = false;
             }
         } else {
             // we want messages in normal order
             $reverse = null;
         }
     }
     $this->ticket->loadAll($reverse);
     $this->loadMerged();
     $pathway = JFactory::getApplication()->getPathway();
     $pathway->addItem(JText::_("SUPPORT"), FSSRoute::_('index.php?option=com_fss&view=admin_support&tickets=' . $this->ticket_view));
     $pathway->addItem(JText::_("VIEW_TICKET") . " : " . $this->ticket->reference . " - " . $this->ticket->title);
     $this->assignOnOpen();
     $this->tryLock();
     if ($this->ticket->admin_id > 0) {
         $this->adminuser = SupportUsers::getUser($this->ticket->admin_id);
     }
     $this->ticket_view = $this->ticket->ticket_status_id;
     $this->HandleRefresh();
     if (FSS_Settings::get('time_tracking') == "auto") {
         $session = JFactory::getSession();
         $session->set('ticket_' . $this->ticket->id . "_opened", time());
     }
     FSS_Helper::IncludeModal();
     FSS_Helper::AddSCEditor();
     $this->HandleRefresh();
     $this->print = FSS_Input::getCmd('print');
     if ($this->print) {
         return $this->_display("print");
     }
     $this->_display();
 }
Exemplo n.º 5
0
 function ClearCronLog()
 {
     $db = JFactory::getDBO();
     $qry = "TRUNCATE #__fss_cron_log";
     $db->SetQuery($qry);
     $db->Query($qry);
     $mainframe = JFactory::getApplication();
     $link = FSSRoute::_('index.php?option=com_fss&view=cronlog', false);
     $mainframe->redirect($link);
 }
Exemplo n.º 6
0
 static function CannedDropdown($editorid, $hascontainer = true)
 {
     if ($hascontainer) {
         $html[] = '<div class="canned_list" editid="' . $editorid . '">';
     }
     $html[] = '<div class="btn-group pull-right">';
     $html[] = '<a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#">';
     $html[] = JText::_('Insert');
     $html[] = '&nbsp;<span class="caret"></span>';
     $html[] = '</a>';
     $html[] = '<ul class="dropdown-menu">';
     $output = false;
     $group_replies = array();
     foreach (self::GetCannedReplies() as $reply) {
         if ($reply->grouping) {
             $group_replies[$reply->grouping][] = $reply;
         } else {
             $html[] = '<li><a href="#" onclick="insertCanned(' . $reply->id . ', \'' . $editorid . '\'); return false;">' . $reply->description . '</a></li>';
         }
         $output = true;
     }
     foreach ($group_replies as $key => $replies) {
         $html[] = '<li class="dropdown-submenu pull-left">';
         $html[] = '<a>' . $key . '</a>';
         $html[] = '<ul class="dropdown-menu">';
         foreach ($replies as $reply) {
             $html[] = '<li><a href="#" onclick="insertCanned(' . $reply->id . ', \'' . $editorid . '\'); return false;">' . $reply->description . '</a></li>';
         }
         $html[] = '</ul>';
         $html[] = '</li>';
         $output = true;
     }
     if ($output) {
         $html[] = '<li class="divider"></li>';
     }
     $html[] = '<li class="dropdown-submenu pull-left"><a>' . JText::_('SITE_LINK') . '</a>';
     $html[] = '<ul class="dropdown-menu">';
     $plugins = self::getInsertPlugins();
     foreach ($plugins as $plugin) {
         $html[] = '<li><a class="show_modal_iframe" href="' . FSSRoute::_("index.php?option=com_fss&view=admin_insert&tmpl=component&type=" . $plugin->name . "&editor=" . $editorid) . '" data_modal_width="800">' . JText::_($plugin->title) . '</a></li>';
     }
     $html[] = '</ul></li>';
     $html[] = '<li class="divider"></li>';
     $html[] = '<li><a class="show_modal_iframe" href="' . FSSRoute::_("index.php?option=com_fss&view=admin_support&tmpl=component&layout=canned") . '"><i class="icon-edit"></i> ' . JText::_('EDIT') . '</a></li>';
     $html[] = '</ul>';
     $html[] = '</div>';
     if ($hascontainer) {
         $html[] = '</div>';
     }
     return implode($html);
 }
Exemplo n.º 7
0
 function display($tpl = null)
 {
     $layout = FSS_Input::getCmd('layout');
     if ($layout == "support") {
         return JFactory::getApplication()->redirect(FSSRoute::_('index.php?option=com_fss&view=admin_support', false));
     }
     if ($layout == "content") {
         return JFactory::getApplication()->redirect(FSSRoute::_('index.php?option=com_fss&view=admin_content', false));
     }
     if ($layout == "moderate") {
         return JFactory::getApplication()->redirect(FSSRoute::_('index.php?option=com_fss&view=admin_moderate', false));
     }
     if ($layout == "shortcut") {
         return JFactory::getApplication()->redirect(FSSRoute::_('index.php?option=com_fss&view=admin_shortcut', false));
     }
     $can_view = false;
     $view = array();
     if (FSS_Permission::PermAnyContent()) {
         $view[] = FSSRoute::_('index.php?option=com_fss&view=admin_content', false);
         $can_view = true;
     }
     if (FSS_Permission::AdminGroups()) {
         $view[] = FSSRoute::_('index.php?option=com_fss&view=admin_groups', false);
         $can_view = true;
     }
     if (FSS_Permission::auth("fss.reports", "com_fss.reports")) {
         $view[] = FSSRoute::_('index.php?option=com_fss&view=admin_report', false);
         $can_view = true;
     }
     if (FSS_Permission::auth("fss.handler", "com_fss.support_admin")) {
         $view[] = FSSRoute::_('index.php?option=com_fss&view=admin_support', false);
         $can_view = true;
     }
     if (FSS_Permission::CanModerate()) {
         $view[] = FSSRoute::_('index.php?option=com_fss&view=admin_moderate', false);
         $can_view = true;
     }
     if (!$can_view) {
         return FSS_Admin_Helper::NoPerm();
     }
     // if only 1 section visible, then view that section only
     if (count($view) == 1) {
         $mainframe = JFactory::getApplication();
         $link = reset($view);
         $mainframe->redirect($link);
     }
     $this->comments = new FSS_Comments(null, null);
     $this->artcounts = FSS_ContentEdit::getArticleCounts();
     parent::display();
 }
Exemplo n.º 8
0
 function delete()
 {
     if (!$this->view->can_EditTicket()) {
         return;
     }
     // load in tickets to do
     $ticketid = FSS_Input::getInt('ticketid');
     $fileid = FSS_Input::getInt('fileid');
     $ticket = new SupportTicket();
     if ($ticket->load($ticketid)) {
         $ticket->deleteAttach($fileid);
     }
     JFactory::getApplication()->redirect(FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=' . $ticketid, false));
     exit;
 }
Exemplo n.º 9
0
 function display($tpl = null)
 {
     $sc = FSS_Input::getCmd('shortcut');
     $status = FSS_Input::getCmd('status');
     $link = "index.php?option=com_fss&view=admin";
     switch ($sc) {
         case "create.registered":
             $link = "index.php?option=com_fss&view=admin_support&layout=new&type=registered";
             break;
         case "create.unregistered":
             $link = "index.php?option=com_fss&view=admin_support&layout=new&type=unregistered";
             break;
             // Lookup status from advanced tab for these!
         // Lookup status from advanced tab for these!
         case "tickets.mine":
             $link = "index.php?option=com_fss&view=admin_support&tickets=-1&what=search&searchtype=advanced&showbasic=1&handler=-1&status={$status}";
             break;
         case "tickets.other":
             $link = "index.php?option=com_fss&view=admin_support&tickets=-1&what=search&searchtype=advanced&showbasic=1&handler=-2&status={$status}";
             break;
         case "tickets.unassigned":
             $link = "index.php?option=com_fss&view=admin_support&tickets=-1&what=search&searchtype=advanced&showbasic=1&handler=-3&status={$status}";
             break;
         case "tickets.status":
             $link = "index.php?option=com_fss&view=admin_support&tickets={$status}";
             break;
         case "myadminsettings":
             $link = "index.php?option=com_fss&view=admin_support&layout=settings";
             break;
         case "content.announcements":
             $link = "index.php?option=com_fss&view=admin_content&type=announce";
             break;
         case "content.faqs":
             $link = "index.php?option=com_fss&view=admin_content&type=faqs";
             break;
         case "content.kb":
             $link = "index.php?option=com_fss&view=admin_content&type=kb";
             break;
         case "content.glossary":
             $link = "index.php?option=com_fss&view=admin_content&type=glossary";
             break;
     }
     $link = FSSRoute::_($link, false);
     //$link = JRoute::_($link, false);
     $mainframe = JFactory::getApplication();
     $mainframe->redirect($link);
 }
Exemplo n.º 10
0
 function SaveAPI()
 {
     $username = JRequest::getVar('username');
     $apikey = JRequest::getVar('apikey');
     $db = JFactory::getDBO();
     $qry = "REPLACE INTO #__fss_settings (setting, value) VALUES ('fsj_username','" . FSSJ3Helper::getEscaped($db, $username) . "')";
     $db->setQuery($qry);
     $db->Query();
     $qry = "REPLACE INTO #__fss_settings (setting, value) VALUES ('fsj_apikey','" . FSSJ3Helper::getEscaped($db, $apikey) . "')";
     $db->setQuery($qry);
     $db->Query();
     // update url links
     $updater = new FSSUpdater();
     $updater->SortAPIKey($username, $apikey);
     $mainframe = JFactory::getApplication();
     $link = FSSRoute::_('index.php?option=com_fss&view=backup', false);
     $mainframe->redirect($link);
 }
Exemplo n.º 11
0
 static function NoPerm()
 {
     if (array_key_exists('REQUEST_URI', $_SERVER)) {
         $url = $_SERVER['REQUEST_URI'];
         //JURI::current() . "?" . $_SERVER['QUERY_STRING'];
     } else {
         $option = FSS_Input::getCmd('option', '');
         $view = FSS_Input::getCmd('view', '');
         $layout = FSS_Input::getCmd('layout', '');
         $Itemid = FSS_Input::getInt('Itemid', 0);
         $url = FSSRoute::_("index.php?option=" . $option . "&view=" . $view . "&layout=" . $layout . "&Itemid=" . $Itemid);
     }
     $url = str_replace("&what=find", "", $url);
     $url = base64_encode($url);
     $return = $url;
     require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'views' . DS . 'admin' . DS . 'tmpl' . DS . 'noperm.php';
     return false;
 }
Exemplo n.º 12
0
 function ticket_status_id()
 {
     // update status in ticket
     // redirect if the config is set to
     $ticketid = FSS_Input::getInt('ticketid');
     $ticket_status_id = FSS_Input::getInt('ticket_status_id');
     if ($ticketid < 1) {
         exit;
     }
     if ($ticket_status_id < 1) {
         exit;
     }
     $link = FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=' . $ticketid, false);
     // check permission for new status
     $statuss = SupportHelper::getStatuss();
     $new_status = $statuss[$ticket_status_id];
     if ($new_status->is_closed && !$this->view->can_Close()) {
         JFactory::getApplication()->redirect($link);
         exit;
     }
     $ticket = new SupportTicket();
     if ($ticket->Load($ticketid)) {
         $old_st = $ticket->getStatus();
         $ticket->updateStatus($ticket_status_id);
         $new_st = $ticket->getStatus();
         // if we have closed the ticket, and return on close is set, then we should do a redirect dependant on the setting
         if ($new_st->is_closed && SupportUsers::getSetting("return_on_close")) {
             $link = SupportHelper::parseRedirectType($old_st->id, SupportUsers::getSetting("return_on_close"));
         }
         if ($new_st->is_closed && !$old_st->is_closed) {
             // SEND CLOSED EMAIL HERE!
             if (!FSS_Settings::get('support_email_on_close_no_dropdown')) {
                 FSS_EMail::Admin_Close($ticket, $ticket->title, '', array());
             }
         }
     }
     JFactory::getApplication()->redirect($link);
     exit;
 }
Exemplo n.º 13
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $faq = $this->get('Data');
     $isNew = $faq->id < 1;
     $text = $isNew ? JText::_("NEW") : JText::_("EDIT");
     JToolBarHelper::title(JText::_("FAQ") . ': <small><small>[ ' . $text . ' ]</small></small>', 'fss_faqs');
     JToolBarHelper::apply();
     JToolBarHelper::save();
     JToolBarHelper::save2new();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancel', 'Close');
     }
     FSSAdminHelper::DoSubToolbar();
     $this->faq = $faq;
     $query = 'SELECT id, title' . ' FROM #__fss_faq_cat' . ' ORDER BY ordering';
     $db = JFactory::getDBO();
     $db->setQuery($query);
     $sections = $db->loadObjectList();
     if (count($sections) < 1) {
         $link = FSSRoute::_('index.php?option=com_fss&view=faqs', false);
         $mainframe->redirect($link, "You must create a FAQ category first");
         return;
     }
     if ($faq->id > 0) {
         $qry = "SELECT * FROM #__fss_faq_tags WHERE faq_id = " . FSSJ3Helper::getEscaped($db, $faq->id) . " ORDER BY tag";
         $db->setQuery($qry);
         $this->tags = $db->loadObjectList();
     } else {
         $this->tags = array();
     }
     $lists['catid'] = JHTML::_('select.genericlist', $sections, 'faq_cat_id', 'class="inputbox" size="1" ', 'id', 'title', intval($faq->faq_cat_id));
     $this->lists = $lists;
     parent::display($tpl);
 }
Exemplo n.º 14
0
    function Item($title, $link, $icon, $help)
    {
        ?>
		<div class="fss_main_item fssTip" title="<?php 
        echo JText::_($help);
        ?>
">	
			<div class="fss_main_icon">
				<a href="<?php 
        echo FSSRoute::_($link);
        // OK
        ?>
">
					<img src="<?php 
        echo JURI::root(true);
        ?>
/administrator/components/com_fss/assets/images/<?php 
        echo $icon;
        ?>
-48x48.png" width="48" height="48">
				</a>
			</div>
			<div class="fss_main_text">
				<a href="<?php 
        echo FSSRoute::_($link);
        // OK
        ?>
">
					<?php 
        echo JText::_($title);
        ?>
				</a>
			</div>
		</div>	
<?php 
    }
Exemplo n.º 15
0
 function GetCaptcha($setting = 'captcha_type', $direct = '')
 {
     $usecaptcha = FSS_Settings::get($setting);
     if ($direct != "") {
         $usecaptcha = $direct;
     }
     if ($usecaptcha == "") {
         return "";
     }
     if ($usecaptcha == "fsj") {
         return "<img src='" . FSSRoute::_("index.php?option=com_fss&task=captcha_image&random=" . rand(0, 65535)) . "' /><input id='security_code' name='security_code' type='text' style='position: relative; left: 3px;'/>";
     }
     if ($usecaptcha == "recaptcha") {
         $document = JFactory::getDocument();
         $document->addScript("https://www.google.com/recaptcha/api.js");
         $fss_publickey = FSS_Settings::get('recaptcha_public');
         if (!$fss_publickey) {
             $fss_publickey = "12345";
         }
         $html = '<div class="g-recaptcha" data-sitekey="' . $fss_publickey . '"></div>';
         return $html;
     }
     return "";
 }
Exemplo n.º 16
0
 static function CheckTicketLink()
 {
     $ticket_id = FSS_Input::getInt('t');
     $ticket_pass = FSS_Input::getString('p');
     if ($ticket_pass && $ticket_id > 0) {
         $db = JFactory::getDBO();
         $qry = "SELECT * FROM #__fss_ticket_ticket WHERE id = " . $db->escape($ticket_id) . " AND password = '******'";
         $db->setQuery($qry);
         $ticket = $db->loadObject();
         if ($ticket) {
             $session = JFactory::getSession();
             $session->Set('ticket_pass', $ticket_pass);
             $session->Set('ticket_email', $ticket->email);
             $link = FSSRoute::_("index.php?option=com_fss&view=ticket&layout=view&ticketid=" . $ticket_id, false);
             JFactory::getApplication()->redirect($link);
         }
     }
 }
Exemplo n.º 17
0
_cont faq_<?php 
echo $faq['id'];
?>
_cont">
	<div class="pull-right">
		<?php 
echo $this->content->EditPanel($faq);
?>
	</div>
	<div class="media-body">
		<h5 class="media-heading" data-toggle="collapse" data-target="#faq_<?php 
echo $cat['id'] . "_" . $faq['id'];
?>
" style='cursor: pointer;'>
			<a href="<?php 
echo FSSRoute::_('index.php?option=com_fss&view=faq&faqid=' . $faq['id']);
?>
" onclick='return false;'><?php 
echo $faq['question'];
?>
</a>
		</h5>
				
		<div class="collapse" id="faq_<?php 
echo $cat['id'] . "_" . $faq['id'];
?>
">
			<?php 
if (FSS_Settings::get('glossary_faqs')) {
    echo FSS_Glossary::ReplaceGlossary($faq['answer']);
    if ($faq['fullanswer']) {
Exemplo n.º 18
0
 static function ReplaceGlossary($text)
 {
     if (stripos($text, "id='XXX_GLOSSARY_DONE_XXX'") !== FALSE) {
         return $text;
     }
     self::GetGlossary();
     FSS_Settings::GetAllViewSettings();
     if (count(self::$glossary) == 0) {
         return $text;
     }
     // build a rough list of terms in the document in question. This means less stuff for the preg to check later on
     self::$glo_ref = array();
     foreach (self::$glossary as $offset => &$data) {
         $data->limit = 999;
         if (FSS_Settings::get('glossary_word_limit') > 0) {
             $data->limit = FSS_Settings::get('glossary_word_limit');
         }
         if (empty($data->linkword)) {
             $data->linkword = $data->word;
         }
         $data->anc = self::MakeAnchor($data->word);
         $data->ref = $data->id . "-" . $data->anc;
         $linkanc = self::MakeAnchor($data->linkword);
         $linkref = $data->id . "-" . $data->anc;
         $data->href = "#";
         $data->cs = self::isWordCS($data);
         // word for regex
         $rword = preg_quote($data->word);
         $rword = str_replace("/", "\\/", $rword);
         $data->regex = "/\\b({$rword})\\b/";
         if (!$data->cs) {
             $data->regex .= "i";
         }
         if (FSS_Settings::get('glossary_link')) {
             if (FSS_Settings::$fss_view_settings['glossary_long_desc'] == 1 && $data->longdesc) {
                 // link directly to the item
                 $data->href = FSSRoute::_("index.php?option=com_fss&view=glossary&layout=word&word=" . $linkref, false);
             } else {
                 $data->href = FSSRoute::_('index.php?option=com_fss&view=glossary&letter=' . strtolower(substr($data->linkword, 0, 1)) . '#' . $linkanc, false);
             }
         }
         if (stripos($text, $data->word) !== FALSE) {
             self::$glo_ref[$data->ref] = $offset;
             $data->inuse = true;
         }
     }
     // setup empty dom object
     libxml_use_internal_errors(TRUE);
     $dom = new DOMDocument('1.0', 'UTF-8');
     FSS_Glossary::$cdom = $dom;
     $dom->substituteEntities = false;
     $dom->recover = true;
     $dom->strictErrorChecking = false;
     $dom->resolveExternals = false;
     // load the xml file. Add padding tags as the dom adds crap to the start of the output
     $dom->loadHTML('<?xml version="1.0" encoding="UTF-8"?><meta http-equiv="content-type" content="text/html; charset=utf-8"><xxxglossaryxxx>' . $text . "</xxxglossaryxxx>");
     // get list of html tags to ignore
     $tag_ignore = FSS_Settings::get('glossary_exclude');
     $tag_ignore = explode(",", $tag_ignore);
     $tags = array();
     $tags[] = "a";
     foreach ($tag_ignore as $tag) {
         $tag = trim($tag);
         if (!$tag) {
             continue;
         }
         $tags[] = $tag;
     }
     // replace all glossary terms
     FSS_Glossary::preg_replace_dom($dom->documentElement, $tags);
     // get resultant html
     $result = $dom->saveHTML();
     //$result = str_replace("&amp;","&", $result);
     // use padding added earlier to remove appended content
     $pos1 = strpos($result, "<xxxglossaryxxx>") + 16;
     $pos2 = strrpos($result, "</xxxglossaryxxx>");
     $result = substr($result, $pos1, $pos2 - $pos1) . "<div style='display: none' id='XXX_GLOSSARY_DONE_XXX'></div>";
     return $result;
 }
Exemplo n.º 19
0
 * @copyright (C) 2013 Freestyle Joomla
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
defined('_JEXEC') or die;
FSS_Translate_Helper::TrSingle($product);
?>

<div class='media kb_prod_<?php 
echo $product['id'];
?>
 test_prod_accordion'>

	<?php 
$link = "#";
if ($this->test_show_prod_mode != "inline" && $this->test_show_prod_mode != "accordian") {
    $link = FSSRoute::_('index.php?option=com_fss&view=test&prodid=' . $product['id']);
}
// FIX LINK
?>
	
	<?php 
if ($product['image']) {
    ?>
	<div class='pull-left'>
		<a href="<?php 
    echo $link;
    ?>
" <?php 
    if ($link == "#") {
        echo "onclick='return false;'";
    }
Exemplo n.º 20
0
 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     $document = JFactory::getDocument();
     $document->addScriptDeclaration("\nvar fss_settings_url = '" . JRoute::_('index.php?option=com_fss&view=settings', false) . "';\n");
     $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/settings.js');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSSRoute::_('index.php?option=com_fss&view=fsss', false);
         $mainframe->redirect($link);
         return;
     }
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     $settings = FSS_Settings::GetAllSettings();
     $db = JFactory::getDBO();
     if ($what == "testref") {
         return $this->TestRef();
     } else {
         if ($what == "save") {
             $large = FSS_Settings::GetLargeList();
             $templates = FSS_Settings::GetTemplateList();
             $intpltable = FSS_Settings::StoreInTemplateTable();
             // save support custom setting
             $head = JRequest::getVar('support_list_head', '', 'post', 'string', JREQUEST_ALLOWRAW);
             $row = JRequest::getVar('support_list_row', '', 'post', 'string', JREQUEST_ALLOWRAW);
             $qry = "REPLACE INTO #__fss_templates (template, tpltype, value) VALUES ('custom', 1, '" . FSSJ3Helper::getEscaped($db, $head) . "')";
             $db->setQuery($qry);
             $db->Query();
             $qry = "REPLACE INTO #__fss_templates (template, tpltype, value) VALUES ('custom', 0, '" . FSSJ3Helper::getEscaped($db, $row) . "')";
             $db->setQuery($qry);
             $db->Query();
             unset($_POST['support_list_head']);
             unset($_POST['support_list_row']);
             $head = JRequest::getVar('support_user_head', '', 'post', 'string', JREQUEST_ALLOWRAW);
             $row = JRequest::getVar('support_user_row', '', 'post', 'string', JREQUEST_ALLOWRAW);
             $qry = "REPLACE INTO #__fss_templates (template, tpltype, value) VALUES ('usercustom', 1, '" . FSSJ3Helper::getEscaped($db, $head) . "')";
             $db->setQuery($qry);
             $db->Query();
             $qry = "REPLACE INTO #__fss_templates (template, tpltype, value) VALUES ('usercustom', 0, '" . FSSJ3Helper::getEscaped($db, $row) . "')";
             $db->setQuery($qry);
             $db->Query();
             unset($_POST['support_user_head']);
             unset($_POST['support_user_row']);
             // save templates
             $intpltable = FSS_Settings::StoreInTemplateTable();
             foreach ($intpltable as $template) {
                 $value = JRequest::getVar($template, '', 'post', 'string', JREQUEST_ALLOWRAW);
                 $qry = "REPLACE INTO #__fss_templates (template, tpltype, value) VALUES ('" . FSSJ3Helper::getEscaped($db, $template) . "', 2, '" . FSSJ3Helper::getEscaped($db, $value) . "')";
                 $db->setQuery($qry);
                 $db->Query();
             }
             // large settings
             foreach ($large as $setting) {
                 if (!array_key_exists($setting, $templates)) {
                     continue;
                 }
                 $value = JRequest::getVar($setting, '', 'post', 'string', JREQUEST_ALLOWRAW);
                 $qry = "REPLACE INTO #__fss_settings_big (setting, value) VALUES ('";
                 $qry .= FSSJ3Helper::getEscaped($db, $setting) . "','";
                 $qry .= FSSJ3Helper::getEscaped($db, $value) . "')";
                 //echo $qry."<br>";
                 $db->setQuery($qry);
                 $db->Query();
                 $qry = "DELETE FROM #__fss_settings WHERE setting = '" . FSSJ3Helper::getEscaped($db, $setting) . "'";
                 //echo $qry."<br>";
                 $db->setQuery($qry);
                 $db->Query();
                 unset($_POST[$setting]);
             }
             $data = JRequest::get('POST', JREQUEST_ALLOWRAW);
             foreach ($data as $setting => $value) {
                 if (array_key_exists($setting, $settings)) {
                     $settings[$setting] = $value;
                 }
             }
             foreach ($settings as $setting => $value) {
                 if (!array_key_exists($setting, $data)) {
                     $settings[$setting] = 0;
                     $value = 0;
                 }
                 if (!array_key_exists($setting, $templates)) {
                     continue;
                 }
                 if (array_key_exists($setting, $large)) {
                     continue;
                 }
                 $qry = "REPLACE INTO #__fss_settings (setting, value) VALUES ('";
                 $qry .= FSSJ3Helper::getEscaped($db, $setting) . "','";
                 $qry .= FSSJ3Helper::getEscaped($db, $value) . "')";
                 $db->setQuery($qry);
                 $db->Query();
                 //echo $qry."<br>";
             }
             //exit;
             $link = 'index.php?option=com_fss&view=templates#' . $this->tab;
             if (JRequest::getVar('task') == "save") {
                 $link = 'index.php?option=com_fss';
             }
             $mainframe = JFactory::getApplication();
             $mainframe->redirect($link, JText::_("Settings_Saved"));
             exit;
         } else {
             if ($what == "customtemplate") {
                 $this->CustomTemplate();
                 exit;
             } else {
                 // load other templates
                 $intpltable = FSS_Settings::StoreInTemplateTable();
                 $tpls = array();
                 foreach ($intpltable as $template) {
                     $settings[$template] = '';
                     $settings[$template . '_default'] = '';
                     $tpls[] = FSSJ3Helper::getEscaped($db, $template);
                 }
                 $tpllist = "'" . implode("', '", $tpls) . "'";
                 $qry = "SELECT * FROM #__fss_templates WHERE template IN ({$tpllist})";
                 $db->setQuery($qry);
                 $rows = $db->loadAssocList();
                 if (count($rows) > 0) {
                     foreach ($rows as $row) {
                         if ($row['tpltype'] == 2) {
                             $settings[$row['template']] = $row['value'];
                         } else {
                             if ($row['tpltype'] == 3) {
                                 $settings[$row['template'] . '_default'] = $row['value'];
                             }
                         }
                     }
                 }
                 // load ticket template stuff
                 $qry = "SELECT * FROM #__fss_templates WHERE template = 'custom'";
                 $db->setQuery($qry);
                 $rows = $db->loadAssocList();
                 if (count($rows) > 0) {
                     foreach ($rows as $row) {
                         if ($row['tpltype'] == 1) {
                             $settings['support_list_head'] = $row['value'];
                         } else {
                             if ($row['tpltype'] == 0) {
                                 $settings['support_list_row'] = $row['value'];
                             }
                         }
                     }
                 } else {
                     $settings['support_list_head'] = '';
                     $settings['support_list_row'] = '';
                 }
                 $qry = "SELECT * FROM #__fss_templates WHERE template = 'usercustom'";
                 $db->setQuery($qry);
                 $rows = $db->loadAssocList();
                 if (count($rows) > 0) {
                     foreach ($rows as $row) {
                         if ($row['tpltype'] == 1) {
                             $settings['support_user_head'] = $row['value'];
                         } else {
                             if ($row['tpltype'] == 0) {
                                 $settings['support_user_row'] = $row['value'];
                             }
                         }
                     }
                 } else {
                     $settings['support_user_head'] = '';
                     $settings['support_user_row'] = '';
                 }
                 $qry = "SELECT * FROM #__fss_templates WHERE tpltype = 2";
                 $db->setQuery($qry);
                 $rows = $db->loadAssocList();
                 if (count($rows) > 0) {
                     foreach ($rows as $row) {
                         $settings[$row['template']] = $row['value'];
                     }
                 }
                 $document = JFactory::getDocument();
                 $document->addStyleSheet(JURI::root() . 'administrator/components/com_fss/assets/css/js_color_picker_v2.css');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/color_functions.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/js_color_picker_v2.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/codemirror.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/modes/css/css.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/modes/javascript/javascript.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/modes/xml/xml.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fss/assets/js/codemirror/modes/htmlmixed/htmlmixed.js');
                 $document->addStyleSheet(JURI::root() . 'administrator/components/com_fss/assets/css/codemirror/codemirror.css');
                 $this->settings = $settings;
                 JToolBarHelper::title(JText::_("FREESTYLE_SUPPORT_PORTAL") . ' - ' . JText::_("TEMPLATES"), 'fss_templates');
                 JToolBarHelper::apply();
                 JToolBarHelper::save();
                 JToolBarHelper::cancel('cancellist');
                 FSSAdminHelper::DoSubToolbar();
                 parent::display($tpl);
             }
         }
     }
 }
Exemplo n.º 21
0
	jQuery('#tags').html("<?php 
echo JText::_('PLEASE_WAIT');
?>
");
	var url = '<?php 
echo FSSRoute::x("&task=update.add_tag", false);
?>
&tag=' + encodeURIComponent(tagname);
	jQuery('#tags').load(url);
	return false;
}

function cancelReply()
{
	window.location.href = '<?php 
echo FSSRoute::_("index.php?option=com_fss&view=admin_support&ticketid=" . $this->ticket->id, false);
?>
';
}

function sigsRefresh()
{
	jQuery('#signature_container').html("<?php 
echo JText::_('PLEASE_WAIT');
?>
");
	var url = '<?php 
echo JRoute::_('index.php?option=com_fss&view=admin_support&tmpl=component&layout=signature&task=signature.dropdown', false);
?>
';
	jQuery('#signature_container').load(url);
Exemplo n.º 22
0
            echo JText::_("EDIT_FIELD");
            ?>
"></i> 
				</a>
			<?php 
        }
        ?>

			<?php 
        if ($field['advancedsearch'] == 1) {
            ?>
				<?php 
            if (array_key_exists($field['id'], $this->ticket->custom)) {
                ?>
					<a class='pull-right padding-left-small' href="<?php 
                echo FSSRoute::_("index.php?option=com_fss&view=admin_support&what=search&searchtype=advanced&custom_" . $field['id'] . "=" . $this->ticket->custom[$field['id']]['value']);
                ?>
">
						<i class="icon-search fssTip" title="<?php 
                echo JText::_("SIMILAR_TICKETS");
                ?>
"></i> 
					</a>
				<?php 
            }
            ?>
			<?php 
        }
        ?>
			
			<?php 
Exemplo n.º 23
0
					<?php 
        $msg = $message['body'];
        $msg = FSS_Helper::ParseBBCode($msg, $message);
        echo $msg;
        ?>
				</div>
				
				<?php 
        if (array_key_exists("attach", $message)) {
            ?>
					<?php 
            foreach ($message['attach'] as &$attach) {
                ?>
						<div class="padding-mini">
							<a href='<?php 
                echo FSSRoute::_('index.php?option=com_fss&view=ticket&fileid=' . $attach['id']);
                ?>
'>
								<img src='<?php 
                echo JURI::root(true);
                ?>
/components/com_fss/assets/images/download-16x16.png'>
								<?php 
                echo $attach['filename'];
                ?>
							</a>
						</div>
					<?php 
            }
            ?>
				<?php 
Exemplo n.º 24
0
<div class="form-horizontal form-condensed">
	<div class="control-group">
		<label class="control-label"><?php 
    echo JText::_("CREATE_TICKET_FOR");
    ?>
</label>
		<div class="controls">
			<a class="btn btn-default btn-small" href="<?php 
    echo FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=new&type=registered');
    ?>
"><?php 
    echo JText::_("REGISTERED_USER");
    ?>
</a>
			<a class="btn btn-default btn-small" href="<?php 
    echo FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=new&type=unregistered');
    ?>
"><?php 
    echo JText::_("UNREGISTERED_USER");
    ?>
</a>	
			<div style="line-height: 25px;display: inline-block;">&nbsp;</div>
		</div>
	</div>
</div>

<?php 
}
?>

<?php 
Exemplo n.º 25
0
					<?php 
        echo JText::_('NO_USERS_FOUND_ENTER');
        ?>
				<?php 
    }
    ?>
			</td>
		</tr>
	</tbody>
<?php 
}
$k = 0;
for ($i = 0, $n = count($this->users); $i < $n; $i++) {
    $row = $this->users[$i];
    $checked = JHTML::_('grid.id', $i, $row->id);
    $link = FSSRoute::_('index.php?option=com_fss&view=admin_groups&what=adduser&cid[]=' . $row->id . '&groupid=' . FSS_Input::getInt('groupid'));
    ?>
        <tr class="<?php 
    echo "row{$k}";
    ?>
">
            <td>
                <?php 
    echo $row->id;
    ?>
            </td>
           	<td>
   				<?php 
    echo $checked;
    ?>
			</td>
Exemplo n.º 26
0
			    <a href="<?php 
    echo $link;
    ?>
"><?php 
    echo $row->groupname;
    ?>
</a>
			</td>
			<td>
			    <?php 
    echo $row->description;
    ?>
			</td>
			<td>
				<a href="<?php 
    echo FSSRoute::_("index.php?option=com_fss&view=members&groupid={$row->id}");
    ?>
" style="position:relative;top:-3px;" title="Edit Members">
				<img src="<?php 
    echo JURI::root(true);
    ?>
/administrator/components/com_fss/assets/members.png" width="16" height="16" style="position:relative;top:3px;">	
				<?php 
    if ($row->cnt == 0) {
        echo JText::_("NO_MEMBERS");
    } else {
        if ($row->cnt == 1) {
            echo JText::sprintf("X_MEMBER", $row->cnt);
        } else {
            echo JText::sprintf("X_MEMBERS", $row->cnt);
        }
Exemplo n.º 27
0
    ?>
		<item>
		<title><?php 
    echo $announce['title'];
    ?>
</title>
		<description><?php 
    echo htmlspecialchars($announce['body']);
    ?>
</description>
		<link><?php 
    echo $baseUrl;
    echo htmlentities(FSSRoute::_('index.php?option=com_fss&view=announce&announceid=' . $announce['id']));
    ?>
</link>
		<guid><?php 
    echo $baseUrl;
    echo htmlentities(FSSRoute::_('index.php?option=com_fss&view=announce&announceid=' . $announce['id']));
    ?>
</guid>
		<pubDate><?php 
    echo date('r', strtotime($announce['added']));
    ?>
</pubDate>
</item>
<?php 
}
?>
    </channel>
</rss>
Exemplo n.º 28
0
		
		<tbody>
			<?php 
    foreach ($this->data as &$item) {
        ?>
				<tr>
					<?php 
        foreach ($this->list as $list) {
            $field = $this->fields[$list];
            ?>
						<td>
							<?php 
            if ($field->link) {
                ?>
								<a href='<?php 
                echo FSSRoute::_('index.php?option=com_fss&view=admin_content&type=' . $this->id . '&what=edit&id=' . $item['id']);
                ?>
'>
							<?php 
            }
            ?>
							<?php 
            if ($field->type == "lookup") {
                ?>
								<?php 
                echo $this->GetLookupText($field, $item[$field->field]);
                ?>
							<?php 
            } elseif ($field->type == "checkbox") {
                ?>
								<?php 
Exemplo n.º 29
0
<?php 
}
if ($params->get('show_add') && $comments->can_add) {
    ?>
	<?php 
    if ($params->get('addlink')) {
        ?>
		<div class='fss_mod_test_add'><a href='<?php 
        echo JRoute::_($params->get('addlink'));
        ?>
'><?php 
        echo JText::_("ADD_A_TESTIMONIAL");
        ?>
</a></div>
	<?php 
    } else {
        ?>
		<div class='fss_mod_test_add'><a class='show_modal_iframe' data_modal_width="650" href='<?php 
        echo FSSRoute::_('index.php?tmpl=component&option=com_fss&view=test&layout=create&onlyprodid=' . $prodid);
        ?>
'><?php 
        echo JText::_("ADD_A_TESTIMONIAL");
        ?>
</a></div>
	<?php 
    }
}
?>

<?php 
FSS_Helper::ModuleEnd();
Exemplo n.º 30
0
<?php

/**
 * @package Freestyle Joomla
 * @author Freestyle Joomla
 * @copyright (C) 2013 Freestyle Joomla
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
defined('_JEXEC') or die;
echo FSS_Helper::PageStylePopup(true);
echo FSS_Helper::PageTitlePopup(JText::_("Select related article"));
?>

<form method="post" action="<?php 
echo FSSRoute::x('&');
?>
" id="fssForm" name="fssForm">
	
	<div class="pull-right">
		<?php 
echo $this->filter_html['published'];
?>
		<?php 
if (FSS_Permission::auth("core.edit", "com_fss.kb")) {
    ?>
			<?php 
    echo $this->filter_html['userid'];
    ?>
		<?php 
}
?>