Beispiel #1
0
    function Item($title, $link, $icon, $help)
    {
        ?>
		<div class="fst_main_item fsj_tip" title="<?php 
        echo JText::_($help);
        ?>
">	
			<div class="fst_main_icon">
				<a href="<?php 
        echo FSTRoute::x($link);
        ?>
">
					<img src="<?php 
        echo JURI::root(true);
        ?>
/administrator/components/com_fst/assets/images/<?php 
        echo $icon;
        ?>
-48x48.png" width="48" height="48">
				</a>
			</div>
			<div class="fst_main_text">
				<a href="<?php 
        echo FSTRoute::x($link);
        ?>
">
					<?php 
        echo JText::_($title);
        ?>
				</a>
			</div>
		</div>	
<?php 
    }
Beispiel #2
0
 function _buildDataObject()
 {
     if (empty($this->_viewall)) {
         $this->_viewall = false;
     }
     // Initialize variables
     $data = new stdClass();
     $data->all = new JPaginationObject(JText::_("VIEW_ALL"));
     if (!$this->_viewall) {
         $data->all->base = '0';
         $data->all->link = FSTRoute::x("&limitstart=");
     }
     // Set the start and previous data objects
     $data->start = new JPaginationObject(JText::_("START"));
     $data->previous = new JPaginationObject(JText::_("PREV"));
     if ($this->get('pages.current') > 1) {
         $page = ($this->get('pages.current') - 2) * $this->limit;
         $page = $page == 0 ? '' : $page;
         //set the empty for removal from route
         $data->start->base = '0';
         $data->start->link = "javascript:ChangePage(0);";
         $data->previous->base = $page;
         $data->previous->link = "javascript:ChangePage({$page});";
     }
     // Set the next and end data objects
     $data->next = new JPaginationObject(JText::_("NEXT"));
     $data->end = new JPaginationObject(JText::_("END"));
     if ($this->get('pages.current') < $this->get('pages.total')) {
         $next = $this->get('pages.current') * $this->limit;
         $end = ($this->get('pages.total') - 1) * $this->limit;
         $data->next->base = $next;
         $data->next->link = "javascript:ChangePage({$next});";
         $data->end->base = $end;
         $data->end->link = "javascript:ChangePage({$end});";
     }
     $data->pages = array();
     $stop = $this->get('pages.stop');
     for ($i = $this->get('pages.start'); $i <= $stop; $i++) {
         $offset = ($i - 1) * $this->limit;
         $offset = $offset == 0 ? '' : $offset;
         //set the empty for removal from route
         $data->pages[$i] = new JPaginationObject($i);
         if ($i != $this->get('pages.current') || $this->_viewall) {
             $data->pages[$i]->base = $offset;
             $data->pages[$i]->link = "javascript:ChangePage({$offset});";
         }
     }
     return $data;
 }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 function GetCaptcha()
 {
     $usecaptcha = FST_Settings::get('captcha_type');
     if ($usecaptcha == "") {
         return "";
     }
     if ($usecaptcha == "fsj") {
         return "<img src='" . FSTRoute::x("index.php?option=com_fst&task=captcha_image&random=" . rand(0, 65535)) . "' /><input id='security_code' name='security_code' type='text' style='position: relative; left: 3px;'/>";
     }
     if ($usecaptcha == "recaptcha") {
         require_once JPATH_SITE . DS . 'components' . DS . 'com_fst' . DS . 'helper' . DS . 'recaptcha.php';
         $error = "";
         global $fst_publickey, $fst_privatekey;
         return fst_recaptcha_get_html($fst_publickey, $error);
     }
     return "";
 }
Beispiel #5
0
 function NoPerm()
 {
     //echo "needLogin : Current Layout : " . $this->getLayout() . "<br>";
     if (array_key_exists('REQUEST_URI', $_SERVER)) {
         $url = $_SERVER['REQUEST_URI'];
         //JURI::current() . "?" . $_SERVER['QUERY_STRING'];
     } else {
         $option = JRequest::getString('option', '');
         $view = JRequest::getString('view', '');
         $layout = JRequest::getString('layout', '');
         $Itemid = JRequest::getInt('Itemid', 0);
         $url = FSTRoute::x("index.php?option=" . $option . "&view=" . $view . "&layout=" . $layout . "&Itemid=" . $Itemid);
     }
     $url = str_replace("&what=find", "", $url);
     $url = base64_encode($url);
     $this->assignRef('return', $url);
     $this->setLayout("noperm");
     parent::display();
 }
Beispiel #6
0
 function SaveAPI()
 {
     $username = JRequest::getVar('username');
     $apikey = JRequest::getVar('apikey');
     $db =& JFactory::getDBO();
     $qry = "REPLACE INTO #__fst_settings (setting, value) VALUES ('fsj_username','" . FSTJ3Helper::getEscaped($db, $username) . "')";
     $db->setQuery($qry);
     $db->Query();
     $qry = "REPLACE INTO #__fst_settings (setting, value) VALUES ('fsj_apikey','" . FSTJ3Helper::getEscaped($db, $apikey) . "')";
     $db->setQuery($qry);
     $db->Query();
     // update url links
     if (FSTAdminHelper::Is16()) {
         $updater = new FSTUpdater();
         $updater->SortAPIKey($username, $apikey);
     }
     $mainframe = JFactory::getApplication();
     $link = FSTRoute::x('index.php?option=com_fst&view=backup', false);
     $mainframe->redirect($link);
 }
Beispiel #7
0
<?php 
        if ($this->errors['captcha'] || $this->errors['name'] || $this->errors['body']) {
            echo "<script>\n\t\t\tjQuery('#commentadd').css('display','block');\n\t\t\tjQuery('#commentaddbutton').css('display','none');\n\t</script>";
        }
        ?>

<?php 
    }
    ?>

	<?php 
    echo FST_Helper::PageSubTitle2($this->add_a_comment);
    ?>
	<form id='addcommentform' action="<?php 
    echo FSTRoute::x('&tmpl=component&task=commentpost');
    ?>
" method="post">
	<input type='hidden' name='comment' value='add' >
	<input type='hidden' name='uid' value='<?php 
    echo $this->uid;
    ?>
' >
	<input type='hidden' name='ident' value='<?php 
    echo $this->ident;
    ?>
' >
	<?php 
    if ($this->itemid) {
        ?>
	<input type='hidden' name='itemid' value='<?php 
Beispiel #8
0
	{
		ShowTab(location.hash.replace('#',''));
	}
	else
	{
		ShowTab('general');
	}
	
<?php 
if (FST_Helper::Is16()) {
    ?>
	jQuery('#test_date_formats').click(function (ev) {
		ev.preventDefault();
			
		var url = '<?php 
    echo FSTRoute::x("index.php?option=com_fst&view=settings&what=testdates", false);
    ?>
';

		url += '&date_dt_short=' + encodeURIComponent(jQuery('#date_dt_short').val());
		url += '&date_dt_long=' + encodeURIComponent(jQuery('#date_dt_long').val());
		url += '&date_d_short=' + encodeURIComponent(jQuery('#date_d_short').val());
		url += '&date_d_long=' + encodeURIComponent(jQuery('#date_d_long').val());

		jQuery.get(url, function (data) {
			var result = jQuery.parseJSON(data);
			jQuery('#test_date_dt_short').html("<?php 
    echo JText::_('DATE_TEST_RESULT');
    ?>
" + ": " + result.date_dt_short);
			jQuery('#test_date_dt_long').html("<?php 
Beispiel #9
0
    }
}
// do version check
$ver_inst = FSTAdminHelper::GetInstalledVersion();
$ver_files = FSTAdminHelper::GetVersion();
if (FST_Helper::Is16()) {
    if (!JFactory::getUser()->authorise('core.manage', 'com_fst')) {
        return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
    }
}
// if bad version display warning message
if ($ver_files != $ver_inst) {
    $task = JRequest::getVar('task');
    $view = JRequest::getVar('view');
    if ($task != "update" || $view != "backup") {
        JError::raiseWarning(100, JText::sprintf('INCORRECT_VERSION', FSTRoute::x('index.php?option=com_fst&view=backup&task=update')));
    }
    if ($view != "" && $view != "backup") {
        JRequest::setVar('view', '');
    }
}
// if bad version and controller is not fsts dont display
// Create the controller
$controllername = $controller;
$classname = 'FstsController' . $controller;
$controller = new $classname();
$css = JRoute::_(JURI::root() . "index.php?option=com_fst&view=css");
$document = JFactory::getDocument();
$document->addStyleSheet($css);
$document->addStyleSheet(JURI::root() . 'administrator/components/com_fst/assets/css/main.css');
$document->addStyleSheet(JURI::root() . 'components/com_fst/assets/css/popup.css');
Beispiel #10
0
		<?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();
Beispiel #11
0
        ?>
	<?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>
Beispiel #12
0
 function IncludeJS()
 {
     global $fst_comments_js;
     if (empty($fst_comments_js)) {
         //echo "<script>\n";
         //include JPATH_SITE.DS.'components'.DS.'com_fst'.DS.'assets'.DS.'js'.DS.'comments.js';
         //echo "</script>\n";
         $document = JFactory::getDocument();
         $document->addScript(JURI::root() . 'components/com_fst/assets/js/comments.js');
         $fst_comments_js = 1;
         echo "<div id='comments_urls' ";
         echo "url='" . htmlentities(FSTRoute::x('&task=XXTASKXX&commentid=XXCIDXX&uid=XXUIDXX', false)) . "' ";
         echo "refresh='" . htmlentities(FSTRoute::x('&task=modinner&ident=XXXIDXX&published=XXPXX', false)) . "' ";
         echo "wait='" . htmlentities(JText::_('PLEASE_WAIT')) . "' ";
         echo "ident='" . JRequest::getVar("ident", 0) . "' ";
         echo "published='" . JRequest::getVar("published", 0) . "' ";
         echo "deleted='" . JText::_("COMMENT_DELETED") . "' ";
         echo "></div>";
     }
 }
Beispiel #13
0
 function displayAllProducts()
 {
     $this->products = $this->get('Products');
     if (!is_array($this->products)) {
         $this->products = array();
     }
     FST_Helper::Tr($this->products);
     $this->showresult = 1;
     $mainframe = JFactory::getApplication();
     $pathway =& $mainframe->getPathway();
     if (FST_Helper::NeedBaseBreadcrumb($pathway, array('view' => 'test'))) {
         $pathway->addItem(JText::_('TESTIMONIALS'), FSTRoute::x('index.php?option=com_fst&view=test'));
     }
     if (FST_Settings::get('test_allow_no_product')) {
         $noproduct = array();
         $noproduct['id'] = 0;
         $noproduct['title'] = JText::_('GENERAL_TESTIMONIALS');
         $noproduct['description'] = '';
         $noproduct['image'] = '/components/com_fst/assets/images/generaltests.png';
         $this->products = array_merge(array($noproduct), $this->products);
     }
     if ($this->test_show_prod_mode != "list") {
         $idlist = array();
         if (count($this->products) > 0) {
             foreach ($this->products as &$prod) {
                 $prod['comments'] = array();
                 $idlist[] = $prod['id'];
             }
         }
         // not in normal list mode, get comments for each product
         $this->comments->itemid = $idlist;
         $this->comments->GetComments();
         foreach ($this->comments->_data as &$data) {
             if ($data['itemid'] > 0) {
                 $this->products[$data['itemid']]['comments'][] =& $data;
             }
         }
     }
     parent::display();
 }
Beispiel #14
0
 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'] . "&nbsp;</td><td nowrap style='border:0px;'>&nbsp;" . 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);
 }
Beispiel #15
0
 * @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>

Beispiel #16
0
require_once JPATH_COMPONENT . DS . 'controller.php';
require_once JPATH_COMPONENT . DS . 'helper' . DS . 'helper.php';
require_once JPATH_COMPONENT . DS . 'helper' . DS . 'settings.php';
// Require specific controller if requested
if ($controller = JRequest::getWord('controller')) {
    $path = JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php';
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}
// Create the controller
$classname = 'FstController' . $controller;
$controller = new $classname();
$css = FSTRoute::x("index.php?option=com_fst&view=css&layout=default");
$document = JFactory::getDocument();
$document->addStyleSheet($css);
FST_Helper::IncludeJQuery();
// Perform the Request task
$task = JRequest::getVar('task');
if ($task == "captcha_image") {
    ob_clean();
    require_once JPATH_SITE . DS . 'components' . DS . 'com_fst' . DS . 'helper' . DS . 'captcha.php';
    $cap = new FST_Captcha();
    $cap->GetImage();
    exit;
} else {
    $controller->execute($task);
    // Redirect if set by the controller
    $controller->redirect();
Beispiel #17
0
</form>

<script>
jQuery(document).ready(function () {
	jQuery('.toggle_me').click(function (ev) {
		ev.preventDefault();
		var val = jQuery(this).attr('value');
		var field = jQuery(this).attr('field');
		var rowid = jQuery(this).attr('row');
		val = 1 - val;
		var t = this;

		jQuery(this).attr('value',val);

		var url = '<?php 
echo FSTRoute::x('index.php?option=com_fst&view=prods&what=togglefield', false);
?>
&id=' + rowid + '&val=' + val + '&field=' + field;
		jQuery(t).html('--');
		jQuery.ajax({
			url: url,
			context: document.body,
			success: function(result){
				jQuery(t).html(result);
			}
		});
	});
});

</script>
Beispiel #18
0
 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;
 }
Beispiel #19
0
 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSTRoute::x('index.php?option=com_fst&view=fsts', false);
         $mainframe->redirect($link);
         return;
     }
     $settings = FST_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;
             }
             // skip any setting that is in the templates list
             if (array_key_exists($setting, $templates)) {
                 continue;
             }
             if (array_key_exists($setting, $large)) {
                 continue;
             }
             $qry = "REPLACE INTO #__fst_settings_view (setting, value) VALUES ('";
             $qry .= FSTJ3Helper::getEscaped($db, $setting) . "','";
             $qry .= FSTJ3Helper::getEscaped($db, $value) . "')";
             $db->setQuery($qry);
             $db->Query();
             //echo $qry."<br>";
         }
         $link = 'index.php?option=com_fst&view=settingsview#' . $this->tab;
         if (JRequest::getVar('task') == "save") {
             $link = 'index.php?option=com_fst';
         }
         //exit;
         $mainframe = JFactory::getApplication();
         $mainframe->redirect($link, JText::_("View_Settings_Saved"));
         exit;
     } else {
         $document = JFactory::getDocument();
         $document->addStyleSheet(JURI::root() . 'administrator/components/com_fst/assets/css/js_color_picker_v2.css');
         $document->addScript(JURI::root() . 'administrator/components/com_fst/assets/js/color_functions.js');
         $document->addScript(JURI::root() . 'administrator/components/com_fst/assets/js/js_color_picker_v2.js');
         $this->assignRef('settings', $settings);
         JToolBarHelper::title(JText::_("FREESTYLE_TESTIMONIALS") . ' - ' . JText::_("VIEW_SETTINGS"), 'fst_viewsettings');
         JToolBarHelper::apply();
         JToolBarHelper::save();
         JToolBarHelper::cancel('cancellist');
         FSTAdminHelper::DoSubToolbar();
         parent::display($tpl);
     }
 }
Beispiel #20
0
<h1><?php 
    echo JText::_("RESTORE_DATABASE");
    ?>
</h1>
<div style="color:red; font-size:150%"><?php 
    echo JText::_("PLEASE_NOTE_THE_WILL_OVERWRITE_AND_EXISTING_DATA_FOR_FREESTYLE_TESTIMONIALS");
    ?>
</div>

<?php 
    //
    ?>

<form action="<?php 
    echo FSTRoute::x("index.php?option=com_fst&view=backup&task=restore");
    ?>
"  method="post" name="adminForm2" id="adminForm2" enctype="multipart/form-data"></::>
<input type="file" id="filedata" name="filedata" /><input type="submit" name="Restore" value="<?php 
    echo JText::_("RESTORE");
    ?>
">
</form>

<form action="index.php" method="post" name="adminForm" id="adminForm">
<input type="hidden" name="option" value="com_fst" />
<input type="hidden" name="task" id="task" value="" />
<input type="hidden" name="view" value="backup" />
</form>
<?php 
}
Beispiel #21
0
    if (FSTAdminHelper::IsFAQs()) {
        ?>
	<h3>If you like Freestyle FAQs please vote or review us at the <a href='http://extensions.joomla.org/extensions/directory-a-documentation/faq/11910' target="_blank">Joomla extensions directory</a></h3>
<?php 
    } elseif (FSTAdminHelper::IsTests()) {
        ?>
<h3>If you like Freestyle Testimonials please vote or review us at the <a href='http://extensions.joomla.org/extensions/contacts-and-feedback/testimonials-a-suggestions/11911' target="_blank">Joomla extensions directory</a></h3>
<?php 
    } else {
        ?>
<h3>If you like Freestyle Testimonials, please vote or review us at the <a href='http://extensions.joomla.org/extensions/clients-a-communities/help-desk/11912' target="_blank">Joomla extensions directory</a></h3>
<?php 
    }
    echo "<h4>Currently Installed Verison : <b>{$ver_files}</b></h4>";
    if ($ver_files != $ver_inst) {
        echo "<h4>" . JText::sprintf('INCORRECT_VERSION', FSTRoute::x('index.php?option=com_fst&view=backup&task=update')) . "</h4>";
    }
    ?>
<div id="please_wait">Please wait while fetching latest version information...</div>

<iframe id="frame_version" height="300" width="100%" frameborder="0" border="0"></iframe>	
<?php 
    echo $pane->endPanel();
    $title = "Announcements";
    echo $pane->startPanel($title, 'cpanel-panel-' . $title);
    ?>
<iframe id="frame_announce" height="600" width="100%" frameborder="0" border="0"></iframe>
<?php 
    echo $pane->endPanel();
    $title = "Help";
    echo $pane->startPanel($title, 'cpanel-panel-' . $title);
Beispiel #22
0
	
	var curimg = src.split("/").pop();
	src = src.replace(curimg, "declined.png");
	img.attr('src',src);
	
	var url = "<?php 
echo FSTRoute::x('index.php?option=com_fst&view=tests&task=removecomment&commentid=XXCIDXX', false);
?>
";
	url = url.replace("XXCIDXX",commentid);
	jQuery.get(url);
}
function fst_approve_comment(commentid) {
	var obj = jQuery('#comment_' + commentid);
	obj.attr('current',1);
	var img = jQuery('#comment_' + commentid + ' img');
	var src = img.attr('src');
	
	var curimg = src.split("/").pop();
	src = src.replace(curimg, "accepted.png");
	img.attr('src',src);
	
	var url = "<?php 
echo FSTRoute::x('index.php?option=com_fst&view=tests&task=approvecomment&commentid=XXCIDXX', false);
?>
";
	url = url.replace("XXCIDXX",commentid);
	jQuery.get(url);
}

</script>
Beispiel #23
0
 function GetItemLink($itemid)
 {
     return FSTRoute::x(str_replace("{id}", $itemid, $this->article_link));
 }
Beispiel #24
0
	jQuery('#toolbar-save a').attr('onclick','');
	jQuery('#toolbar-save a').click(function (ev) {
		ev.preventDefault();
		ev.stopPropagation();
		if (checkFormOK())
			submitbutton('save');
	});
});

function change_section()
{
	var ident = jQuery('#ident');
	var newval = ident.val();
	
	var url = '<?php 
echo FSTRoute::x('index.php?option=com_fst&controller=test&task=ident&ident=XXX', false);
?>
';
	url = url.replace("XXX",newval);
	jQuery('#type_label').html("");
	jQuery('#tr_items').html("<?php 
echo JText::_('PLEASE_WAIT');
?>
");
	jQuery.get(url, function (data) {
		jsonObj = JSON.decode(data); 		
		jQuery('#type_label').html(jsonObj.title + ":");
		jQuery('#tr_items').html(jsonObj.select);
		
	});
}
Beispiel #25
0
 static function _($url, $xhtml = true, $ssl = null)
 {
     if (FST_Helper::Is16()) {
         return FSTRoute::_16($url, $xhtml, $ssl);
     } else {
         return FSTRoute::_15($url, $xhtml, $ssl);
     }
 }
Beispiel #26
0
</p>

<?php 
$user = JFactory::getUser();
if ($user->id == 0) {
    ?>
<div class="fst_ticket_login_head"><?php 
    echo JText::_("LOGIN");
    ?>
</div>
<div class="fst_ticket_login_subtext"><?php 
    echo JText::_("LOG_IN_TO_AN_EXISTING_ACCOUNT");
    ?>
</div>
<form action="<?php 
    echo FSTRoute::x("index.php?option=com_user");
    ?>
"  method="post" name="fst_login" id="fst_login">
<table class="fst_table" cellpadding="0" cellspacing="0">
	<tr>
		<th><?php 
    echo JText::_("USERNAME");
    ?>
</th>
		<td><input name="username" id="username" class="inputbox" alt="username" size="18" type="text" /></td>
	</tr>
	<tr>
		<th><?php 
    echo JText::_("PASSWORD");
    ?>
</th>
Beispiel #27
0
            </th>
<!--  -->
            <th width="8%">
                <?php 
echo JHTML::_('grid.sort', 'MODERATOR', 'mod_kb', @$this->lists['order_Dir'], @$this->lists['order']);
?>
			</th>
<!--  -->
		</tr>
    </thead>
    <?php 
$k = 0;
for ($i = 0, $n = count($this->data); $i < $n; $i++) {
    $row =& $this->data[$i];
    $checked = JHTML::_('grid.id', $i, $row->id);
    $link = FSTRoute::x('index.php?option=com_fst&controller=fuser&task=edit&cid[]=' . $row->id);
    if ($row->mod_kb) {
        $kb_img = "tick";
    } else {
        $kb_img = "cross";
    }
    if ($row->mod_test) {
        $test_img = "tick";
    } else {
        $test_img = "cross";
    }
    if ($row->support) {
        $supp_img = "tick";
    } else {
        $supp_img = "cross";
    }
Beispiel #28
0
 function display($tpl = null)
 {
     JHTML::_('behavior.modal');
     if (JRequest::getVar('task') == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSTRoute::x('index.php?option=com_fst&view=fsts', false);
         $mainframe->redirect($link);
         return;
     }
     $what = JRequest::getString('what', '');
     $this->tab = JRequest::getVar('tab');
     $settings = FST_Settings::GetAllSettings();
     $db =& JFactory::getDBO();
     if ($what == "testref") {
         return $this->TestRef();
     } else {
         if ($what == "save") {
             $large = FST_Settings::GetLargeList();
             $templates = FST_Settings::GetTemplateList();
             $intpltable = FST_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 #__fst_templates (template, tpltype, value) VALUES ('custom', 1, '" . FSTJ3Helper::getEscaped($db, $head) . "')";
             $db->setQuery($qry);
             $db->Query();
             $qry = "REPLACE INTO #__fst_templates (template, tpltype, value) VALUES ('custom', 0, '" . FSTJ3Helper::getEscaped($db, $row) . "')";
             $db->setQuery($qry);
             $db->Query();
             unset($_POST['support_list_head']);
             unset($_POST['support_list_row']);
             // save templates
             $intpltable = FST_Settings::StoreInTemplateTable();
             foreach ($intpltable as $template) {
                 $value = JRequest::getVar($template, '', 'post', 'string', JREQUEST_ALLOWRAW);
                 $qry = "REPLACE INTO #__fst_templates (template, tpltype, value) VALUES ('" . FSTJ3Helper::getEscaped($db, $template) . "', 2, '" . FSTJ3Helper::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 #__fst_settings_big (setting, value) VALUES ('";
                 $qry .= FSTJ3Helper::getEscaped($db, $setting) . "','";
                 $qry .= FSTJ3Helper::getEscaped($db, $value) . "')";
                 //echo $qry."<br>";
                 $db->setQuery($qry);
                 $db->Query();
                 $qry = "DELETE FROM #__fst_settings WHERE setting = '" . FSTJ3Helper::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 #__fst_settings (setting, value) VALUES ('";
                 $qry .= FSTJ3Helper::getEscaped($db, $setting) . "','";
                 $qry .= FSTJ3Helper::getEscaped($db, $value) . "')";
                 $db->setQuery($qry);
                 $db->Query();
                 //echo $qry."<br>";
             }
             //exit;
             $link = 'index.php?option=com_fst&view=templates#' . $this->tab;
             if (JRequest::getVar('task') == "save") {
                 $link = 'index.php?option=com_fst';
             }
             $mainframe = JFactory::getApplication();
             $mainframe->redirect($link, JText::_("Settings_Saved"));
             exit;
         } else {
             if ($what == "customtemplate") {
                 $this->CustomTemplate();
                 exit;
             } else {
                 // load other templates
                 $intpltable = FST_Settings::StoreInTemplateTable();
                 $tpls = array();
                 foreach ($intpltable as $template) {
                     $settings[$template] = '';
                     $settings[$template . '_default'] = '';
                     $tpls[] = FSTJ3Helper::getEscaped($db, $template);
                 }
                 $tpllist = "'" . implode("', '", $tpls) . "'";
                 $qry = "SELECT * FROM #__fst_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 #__fst_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 #__fst_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_fst/assets/css/js_color_picker_v2.css');
                 $document->addScript(JURI::root() . 'administrator/components/com_fst/assets/js/color_functions.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fst/assets/js/js_color_picker_v2.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fst/assets/js/codemirror/codemirror.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fst/assets/js/codemirror/modes/css/css.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fst/assets/js/codemirror/modes/javascript/javascript.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fst/assets/js/codemirror/modes/xml/xml.js');
                 $document->addScript(JURI::root() . 'administrator/components/com_fst/assets/js/codemirror/modes/htmlmixed/htmlmixed.js');
                 $document->addStyleSheet(JURI::root() . 'administrator/components/com_fst/assets/css/codemirror/codemirror.css');
                 $this->assignRef('settings', $settings);
                 JToolBarHelper::title(JText::_("FREESTYLE_TESTIMONIALS") . ' - ' . JText::_("TEMPLATES"), 'fst_templates');
                 JToolBarHelper::apply();
                 JToolBarHelper::save();
                 JToolBarHelper::cancel('cancellist');
                 FSTAdminHelper::DoSubToolbar();
                 parent::display($tpl);
             }
         }
     }
 }
Beispiel #29
0
    ?>
<div class="fst_edit_comment"><?php 
    echo JText::_('EDIT_COMMENT');
    ?>
</div>
<script type="text/javascript">
 var RecaptchaOptions = {
    theme : '<?php 
    echo FST_Settings::get('recaptcha_theme');
    ?>
'
 };
</script>

	<form id='editcommentform' action="<?php 
    echo FSTRoute::x('&tmpl=component&task=savecomment');
    ?>
" method="post">
	<input type='hidden' name='comment' value='add' >
	<input type='hidden' name='ident' value='<?php 
    echo $this->ident;
    ?>
' >
	<?php 
    if ($this->itemid) {
        ?>
	<input type='hidden' name='itemid' value='<?php 
        echo $this->itemid;
        ?>
' >
	<?php 
Beispiel #30
0
		<?php 
    $endlink = false;
    if (empty($hideprodlink)) {
        ?>
			<?php 
        if ($this->test_show_prod_mode == "accordian") {
            ?>
		<a class="fst_highlight" href="#" onclick='return false;'>
				<?php 
            $endlink = true;
            ?>
			<?php 
        } elseif ($this->test_show_prod_mode != "inline") {
            ?>
				<a class='fst_highlight' href='<?php 
            echo FSTRoute::x('&prodid=' . $product['id']);
            ?>
'>
				<?php 
            $endlink = true;
            ?>
			<?php 
        }
        ?>
	
		<?php 
    }
    ?>
	
			<?php 
    echo $product['title'];