function display_edit()
 {
     $editid = FSS_Input::getInt('sigid');
     if ($editid > 0) {
         $db = JFactory::getDBO();
         $qry = "SELECT * FROM #__fss_ticket_fragments WHERE id = " . FSSJ3Helper::getEscaped($db, $editid);
         $db->setQuery($qry);
         $this->sig_item = $db->loadObject();
         $this->sig_item->params = json_decode($this->sig_item->params, true);
         if (is_string($this->sig_item->params)) {
             $this->sig_item->params = array();
         }
         $this->sig_item->personal = 0;
         $userid = JFactory::getUser()->id;
         if (isset($this->sig_item->params['userid'])) {
             if ($this->sig_item->params['userid'] > 0 && $userid != $this->sig_item->params['userid']) {
                 $mainframe = JFactory::getApplication();
                 $link = JRoute::_('index.php?option=com_fss&view=admin_support&layout=signature&tmpl=component');
                 $mainframe->redirect($link);
             }
             $this->sig_item->personal = 1;
         }
     } else {
         $this->sig_item = new stdClass();
         $this->sig_item->id = 0;
         $this->sig_item->description = "";
         $this->sig_item->content = "";
         $this->sig_item->personal = 1;
     }
     return $this->_display("edit");
 }
Exemple #2
0
 function &getAnnounce()
 {
     $db = JFactory::getDBO();
     $announceid = FSS_Input::getInt('announceid', 0);
     $query = "SELECT * FROM #__fss_announce";
     $where = array();
     $where[] = "id = '" . FSSJ3Helper::getEscaped($db, $announceid) . "'";
     if (FSS_Permission::auth("core.edit", "com_fss.announce")) {
     } else {
         if (FSS_Permission::auth("core.edit.own", "com_fss.announce")) {
             $where[] = " ( published = 1 OR author = {$this->content->userid} ) ";
         } else {
             $where[] = "published = 1";
         }
     }
     $db = JFactory::getDBO();
     $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);
     }
     $db->setQuery($query);
     $rows = $db->loadAssoc();
     return $rows;
 }
Exemple #3
0
 function display($tpl = null)
 {
     $db = JFactory::getDBO();
     $test = FSS_Input::getInt('test');
     if ($test > 0) {
         error_reporting(E_ALL);
         ini_set('display_errors', 1);
         $qry = "SELECT * FROM #__fss_cron WHERE id = " . FSSJ3Helper::getEscaped($db, $test);
     } else {
         $qry = "SELECT * FROM #__fss_cron WHERE published = 1 AND ((UNIX_TIMESTAMP() - lastrun) - (`interval` * 60)) > 0";
     }
     $db->setQuery($qry);
     $rows = $db->loadObjectList();
     if (!$rows) {
         exit;
     }
     foreach ($rows as $row) {
         $db->setQuery("UPDATE #__fss_cron SET lastrun=UNIX_TIMESTAMP() WHERE id='{$row->id}' LIMIT 1");
         $db->query();
         $class = "FSSCron" . $row->class;
         $file = strtolower($row->class) . ".php";
         $path = JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'cron' . DS;
         if (file_exists($path . $file)) {
             require_once $path . $file;
             $inst = new $class();
             $inst->Execute($this->ParseParams($row->params));
             if ($test > 0) {
                 echo "<pre>" . $inst->_log . "</pre>";
             } else {
                 $inst->SaveLog();
             }
         }
     }
     exit;
 }
Exemple #4
0
 function dolist()
 {
     $ticketid = FSS_Input::getInt('ticketid');
     $ticket = new SupportTicket();
     $ticket->load($ticketid);
     echo SupportCanned::CannedList($ticket);
     exit;
 }
Exemple #5
0
 function &getProduct()
 {
     $db = JFactory::getDBO();
     $prodid = FSS_Input::getInt('prodid');
     $query = "SELECT * FROM #__fss_prod WHERE id = '" . FSSJ3Helper::getEscaped($db, $prodid) . "'";
     $db->setQuery($query);
     $rows = $db->loadAssoc();
     return $rows;
 }
 function parseRequest()
 {
     $this->prodid = FSS_Input::getInt('prodid');
     $this->deptid = FSS_Input::getInt('deptid');
     $this->catid = FSS_Input::getInt('catid');
     $this->mode = FSS_Input::getInt('mode');
     $def_open = FSS_Ticket_Helper::GetStatusID("def_open");
     $this->status = FSS_Input::getCmd('status', $def_open);
 }
 function getLimits()
 {
     $mainframe = JFactory::getApplication();
     $limit = $mainframe->getUserStateFromRequest('global.list.limit_ticket', 'limit', SupportUsers::getSetting('per_page'), 'int');
     $limitstart = FSS_Input::getInt('limitstart');
     $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
     $this->limit = $limit;
     $this->limitstart = $limitstart;
 }
 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;
     }
 }
Exemple #9
0
 function Save($id, $params)
 {
     $params = $this->parseParams($params);
     $value = FSS_Input::getInt("custom_{$id}");
     if ($value < $params->min) {
         $value = $params->min;
     }
     if ($value > $params->max) {
         $value = $params->max;
     }
     return $value;
 }
 function preview()
 {
     $this->ticketid = FSS_Input::getInt('ticketid');
     $this->sigid = FSS_Input::getInt('sigid');
     $ticket = new SupportTicket();
     $ticket->load($this->ticketid);
     $ticket->loadAll();
     $this->ticket = $ticket;
     $this->signature = SupportCanned::AppendSig($this->sigid, $this->ticket);
     include $this->view->snippet(JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'views' . DS . 'admin_support' . DS . 'snippet' . DS . '_signature_preview.php');
     return true;
 }
Exemple #11
0
 function Save($id, $params)
 {
     $checked = array();
     $posted = FSS_Input::getInt("custom_{$id}_count");
     if ($posted) {
         for ($i = 1; $i <= $posted; $i++) {
             $val = FSS_Input::getString("custom_{$id}_{$i}");
             if ($val) {
                 $checked[] = $val;
             }
         }
     }
     return json_encode($checked);
 }
Exemple #12
0
 function process()
 {
     $posted = JRequest::get('post');
     $ticket_ids = array();
     foreach ($posted as $var => $value) {
         if (substr($var, 0, 7) == "ticket_") {
             $ticket_id = (int) substr($var, 7);
             if ($ticket_id > 0) {
                 $ticket_ids[$ticket_id] = $ticket_id;
             }
         }
     }
     if (count($ticket_ids) == 0) {
         return;
     }
     $db = JFactory::getDBO();
     $tickets = array();
     foreach ($ticket_ids as $ticketid) {
         $ticket = new SupportTicket();
         if ($ticket->Load($ticketid)) {
             $ticket->is_batch = true;
             $tickets[$ticketid] = $ticket;
         } else {
             unset($ticket_ids[$ticket_id]);
         }
     }
     $new_pri = FSS_Input::getInt('batch_priority');
     if ($new_pri > 0) {
         foreach ($ticket_ids as $ticketid) {
             $tickets[$ticketid]->updatePriority($new_pri);
         }
     }
     $new_status = FSS_Input::getInt('batch_status');
     if ($new_status > 0) {
         foreach ($ticket_ids as $ticketid) {
             $tickets[$ticketid]->updateStatus($new_status);
         }
     }
     if (FSS_Input::getString('batch_handler') != "") {
         foreach ($ticket_ids as $ticketid) {
             $tickets[$ticketid]->assignHandler(FSS_Input::getInt('batch_handler'));
         }
     }
     $should_delete = FSS_Input::getCmd('batch_status');
     if ($should_delete == "delete") {
         foreach ($ticket_ids as $ticketid) {
             $tickets[$ticketid]->delete();
         }
     }
 }
 function in()
 {
     $current_user = JFactory::getUser()->id;
     $manager = FSS_Permission::auth("fss.ticket_admin.ooo", "com_fss.support_admin", JFactory::getUser()->id);
     $user_id = FSS_Input::getInt('user_id');
     if (!$manager && $current_user != $user_id) {
         return $this->cancel();
     }
     // update the current users setting
     $values = SupportUsers::getAllSettings($user_id);
     $values->out_of_office = 0;
     SupportUsers::updateUserSettings($values, $user_id);
     JFactory::getApplication()->redirect(FSSRoute::_("index.php?option=com_fss&view=admin_support&layout=listhandlers", false));
 }
Exemple #14
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;
 }
 function display($tpl = NULL)
 {
     $this->current_userid = JFactory::getUser()->id;
     $this->userid = FSS_Input::getInt('user_id', $this->current_userid);
     if (!FSS_Permission::auth("fss.ticket_admin.ooo", "com_fss.support_admin", JFactory::getUser()->id)) {
         $this->userid = $this->current_userid;
     }
     $this->user = JFactory::getUser($this->userid);
     $this->loadTicketList();
     $values = SupportUsers::getAllSettings($this->userid);
     if ($values->out_of_office) {
         return $this->showUserOut();
     } else {
         return $this->showUserIn();
     }
     //
 }
Exemple #16
0
 function display($tpl = null)
 {
     FSS_Helper::StylesAndJS(array('accordion'));
     $mainframe = JFactory::getApplication();
     $user = JFactory::getUser();
     $userid = $user->id;
     $db = JFactory::getDBO();
     $this->params = FSS_Settings::GetViewSettingsObj('test');
     $this->test_show_prod_mode = $this->params->get('test_show_prod_mode', 'accordian');
     $this->test_always_prod_select = $this->params->get('test_always_prod_select', '0');
     $layout = FSS_Input::getCmd('layout');
     $this->prodid = FSS_Input::getInt('prodid');
     if ($this->prodid == "") {
         $this->prodid = -1;
     }
     $this->products = $this->get('Products');
     //print_p($this->products);
     if (count($this->products) == 0) {
         $this->prodid = 0;
     }
     $this->comments = new FSS_Comments("test", $this->prodid);
     if ($this->prodid == -1) {
         $this->comments->opt_show_posted_message_only = 1;
     }
     $onlyprodid = FSS_Input::getCmd('onlyprodid', 'x');
     if ($onlyprodid != 'x' && $onlyprodid != -1) {
         $this->comments->itemid = (int) $onlyprodid;
         $this->comments->show_item_select = false;
     }
     if ($this->params->get('hide_add', 0)) {
         $this->comments->can_add = 0;
     }
     if ($layout == "create") {
         $this->setupCommentsCreate();
     }
     if ($this->comments->Process()) {
         return;
     }
     if ($layout == "create") {
         return $this->displayCreate();
     }
     if ($this->prodid != -1) {
         return $this->displaySingleProduct();
     }
     return $this->displayAllProducts();
 }
Exemple #17
0
 function display($tpl = null)
 {
     $fileid = FSS_Input::getInt('fileid');
     $key = FSS_Input::getCmd('key');
     $decoded = FSS_Helper::decrypt(FSS_Helper::base64url_decode($key), FSS_Helper::getEncKey("file"));
     if ($fileid != $decoded) {
         exit;
     }
     $db = JFactory::getDBO();
     $sql = "SELECT * FROM #__fss_ticket_attach WHERE id = " . $fileid;
     $db->setQuery($sql);
     $attach = $db->loadObject();
     $image = in_array(strtolower(pathinfo($attach->filename, PATHINFO_EXTENSION)), array('jpg', 'jpeg', 'png', 'gif'));
     $image_file = JPATH_SITE . DS . FSS_Settings::get('attach_location') . DS . "support" . DS . $attach->diskfile;
     require_once JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'helper' . DS . 'files.php';
     FSS_File_Helper::OutputImage($image_file, pathinfo($attach->filename, PATHINFO_EXTENSION));
 }
Exemple #18
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;
 }
Exemple #19
0
 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();
 }
Exemple #20
0
 function &getFaq()
 {
     $db = JFactory::getDBO();
     $faqid = FSS_Input::getInt('faqid', 0);
     $query = "SELECT f.id, f.question, f.answer, f.fullanswer, f.published, f.ordering, c.title, f.faq_cat_id, f.author, f.featured FROM #__fss_faq_faq as f LEFT JOIN #__fss_faq_cat as c ON f.faq_cat_id = c.id";
     $where = array();
     $where[] = "f.id = " . FSSJ3Helper::getEscaped($db, $faqid);
     $where[] = 'f.language in (' . $db->Quote(JFactory::getLanguage()->getTag()) . ',' . $db->Quote('*') . ')';
     $user = JFactory::getUser();
     $where[] = 'f.access IN (' . implode(',', $user->getAuthorisedViewLevels()) . ')';
     if (FSS_Permission::auth("core.edit", "com_fss.faq")) {
     } else {
         if (FSS_Permission::auth("core.edit.own", "com_fss.faq")) {
             $where[] = " ( f.published = 1 OR f.author = {$this->content->userid} ) ";
         } else {
             $where[] = "f.published = 1";
         }
     }
     $query .= " WHERE " . implode(" AND ", $where);
     //echo $query."<br>";
     $db->setQuery($query);
     $rows = $db->loadAssoc();
     return $rows;
 }
Exemple #21
0
 function delete()
 {
     // load in tickets to do
     $ticketid = FSS_Input::getInt('ticketid');
     $tickets = FSS_Input::getCmd('tickets');
     $def_archive = FSS_Ticket_Helper::GetStatusID('def_archive');
     if ($ticketid > 0) {
         $ticket = new SupportTicket();
         if ($ticket->load($ticketid)) {
             $ticket->delete();
         }
     } else {
         if ($tickets != '') {
             $tickets = new SupportTickets();
             $tickets->limitstart = 0;
             $tickets->limit = 100;
             $tickets->loadTicketsByStatus($tickets);
             foreach ($tickets->tickets as $ticket) {
                 $ticket->delete();
             }
         }
     }
     JFactory::getApplication()->redirect($_SERVER['HTTP_REFERER']);
 }
	<tfoot>
		<tr>
			<td colspan="9"><?php 
    echo $footer;
    ?>
</td>
		</tr>
	</tfoot>
	<?php 
}
?>

    </table>

<input type="hidden" name="groupid" value="<?php 
echo FSS_Input::getInt('groupid');
?>
" />
<input type="hidden" name="what" value="pickuser" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php 
echo FSS_Helper::escape($this->order);
?>
" />
<input type="hidden" name="filter_order_Dir" value="<?php 
echo FSS_Helper::escape($this->order_Dir);
?>
" />
<input type="hidden" name="limit_start" id="limitstart" value="<?php 
echo (int) $this->limit_start;
?>
Exemple #23
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);
         }
     }
 }
Exemple #24
0
    echo JText::_('TICKET_MERGED_NOTICE_INTO');
    ?>
</p>
		<ul>
			<?php 
    $db = JFactory::getDBO();
    $qry = "SELECT * FROM #__fss_ticket_ticket WHERE id = " . $db->escape($this->ticket['merged']);
    $db->setQuery($qry);
    $merged = $db->loadObject();
    ?>
				<li>	
					<?php 
    if (JFactory::getUser()->id > 0) {
        ?>
						<a href="<?php 
        echo FSSRoute::_('index.php?option=com_fss&view=ticket&ticketid=' . $merged->id . "&Itemid=" . FSS_Input::getInt('Itemid'), false);
        ?>
">
							<?php 
        echo $merged->reference;
        ?>
 - <?php 
        echo $merged->title;
        ?>
						</a>
					<?php 
    } else {
        ?>
						<?php 
        echo $merged->reference;
        ?>
Exemple #25
0
?>
</a>
		</div>
	</div>

</form>


<div id="canned_replies" style="display: none;">
<?php 
echo SupportCanned::CannedList($this->ticket);
?>
</div>

<ul class="nav nav-tabs <?php 
if (FSS_Input::getInt('ticketid') > 0) {
    echo "nav-always";
}
?>
">

	<li class="active">
		<a href='#messages' data-toggle="tab">
			<?php 
echo JText::_('MESSAGES');
?>
		</a>
	</li>

	<li>
		<a href='#details' data-toggle="tab">
Exemple #26
0
		<?php 
        if ($use_prod) {
            ?>
	
			<a class='btn btn-default backprod' href="<?php 
            echo FSSRoute::_('index.php?option=com_fss&view=ticket&layout=open&prodid=' . $this->prodid . '&admincreate=' . FSS_Input::getInt('admincreate'));
            ?>
"><?php 
            echo JText::_("BACK");
            ?>
</a>
		<?php 
        } else {
            ?>
			<a class='btn btn-default backprod' href="<?php 
            echo FSSRoute::_('index.php?option=com_fss&view=ticket&layout=open&admincreate=' . FSS_Input::getInt('admincreate'));
            ?>
"><?php 
            echo JText::_("BACK");
            ?>
</a>
		<?php 
        }
        ?>
	<?php 
    } else {
        ?>
		<?php 
        if ($use_prod) {
            ?>
	
Exemple #27
0
 function display($tpl = NULL)
 {
     parent::init();
     $this->plugins = $this->load_plugins();
     $this->mode = FSS_Input::getcmd('mode', 'pick');
     $this->usergroup = FSS_Input::getInt('usergroup');
     foreach ($this->plugins as $plugin) {
         $plugin->mode = $this->mode;
     }
     $limitstart = FSS_Input::getInt('limitstart');
     $mainframe = JFactory::getApplication();
     $limit = $mainframe->getUserStateFromRequest('users.limit', 'limit', 10, 'int');
     $search = FSS_Input::getString('search');
     $this->lists = array();
     $this->lists['order_Dir'] = FSS_Input::getCmd('filter_order_Dir');
     $this->lists['order'] = FSS_Input::getCmd('filter_order');
     $ticket_has_groups = false;
     // load in ticket if there is one
     $this->ticketid = FSS_Input::getInt("ticketid");
     if ($this->mode == "user" || $this->mode == "admin") {
         $this->ticket = new SupportTicket();
         $this->ticket->load($this->ticketid);
         $this->ticket->loadCC();
         $this->ticket->loadGroups();
         if (count($this->ticket->groups) > 0) {
             $ticket_has_groups = true;
         }
     }
     // ticket group, default to t if we are in user or admin mode
     $this->ticketgroup = null;
     if ($ticket_has_groups && $this->mode == "user") {
         $this->ticketgroup = "t";
     }
     $this->ticketgroup = FSS_Input::getcmd('ticketgroup', $this->ticketgroup);
     $db = JFactory::getDBO();
     $qry = "SELECT * FROM #__users ";
     $where = array();
     if ($search != "") {
         $search_parts = array();
         $search_parts[] = "username LIKE '%" . $db->escape($search) . "%'";
         $search_parts[] = "name LIKE '%" . $db->escape($search) . "%'";
         $search_parts[] = "email LIKE '%" . $db->escape($search) . "%'";
         $this->searchFields($search_parts);
         foreach ($this->plugins as $plugin) {
             $ids = $plugin->search($search);
             if (count($ids) > 0) {
                 $search_parts[] = "id IN ('" . implode("', '", $ids) . "')";
             }
         }
         $where[] = "( " . implode(" OR ", $search_parts) . " )";
     }
     // filter by usergroup
     if ($this->usergroup > 0) {
         $where[] = "id IN (SELECT user_id FROM #__user_usergroup_map WHERE group_id = " . $db->escape($this->usergroup) . ")";
     }
     // filter by ticket group
     if ($this->ticketgroup == "t") {
         $group_ids = array();
         $group_ids[] = 0;
         foreach ($this->ticket->groups as $group) {
             $group_ids[] = $group->id;
         }
         $where[] = "id IN (SELECT user_id FROM #__fss_ticket_group_members WHERE group_id IN (" . implode(", ", $group_ids) . "))";
     } elseif ($this->ticketgroup > 0) {
         $where[] = "id IN (SELECT user_id FROM #__fss_ticket_group_members WHERE group_id = " . $db->escape($this->ticketgroup) . ")";
     }
     if ($this->mode == "admin") {
         $handlers = SupportUsers::getHandlers(false, false);
         $ids = array();
         $ids[] = 0;
         foreach ($handlers as $handler) {
             $ids[] = $handler->id;
         }
         $where[] = "id IN (" . implode(", ", $ids) . ")";
     }
     // add where
     if (count($where) > 0) {
         $qry .= " WHERE " . implode(" AND ", $where);
     }
     $order = FSS_Input::getCmd('filter_order');
     $dir = FSS_Input::getCmd('filter_order_Dir', 'asc');
     if ($order == "username" || $order == "name" || $order == "email") {
         // Sort ordering
         $qry .= " ORDER BY {$order} {$dir} ";
     } else {
         $qry .= " ORDER BY name ";
     }
     //echo $qry . "<br>";
     // get max items
     $db->setQuery($qry);
     $db->query();
     $maxitems = $db->getNumRows();
     // select picked items
     $db->setQuery($qry, $limitstart, $limit);
     $this->users = $db->loadObjectList();
     //print_p(reset($this->users));
     // build pagination
     $this->pagination = new JPaginationEx($maxitems, $limitstart, $limit);
     $this->search = $search;
     if ($this->mode != "admin") {
         // load in joomla user groups
         $qry = "SELECT * FROM #__usergroups ORDER BY lft";
         $db->setQuery($qry);
         $this->groups = $db->loadObjectList();
         $group_index = array();
         foreach ($this->groups as &$group) {
             $group_index[$group->id] =& $group;
             if ($group->parent_id == 0) {
                 $group->level = 0;
             } else {
                 $group->level = $group_index[$group->parent_id]->level + 1;
             }
             $group->display = str_repeat("- ", $group->level) . $group->title;
         }
         array_unshift($this->groups, JHTML::_('select.option', '', JText::_("JOOMLA_USERGROUP"), 'id', 'display'));
         $this->jgroup_select = JHTML::_('select.genericlist', $this->groups, 'usergroup', 'class="inputbox" size="1" onchange="document.fssForm.submit( );"', 'id', 'display', $this->usergroup);
         // load ticket groups
         $qry = "SELECT * FROM #__fss_ticket_group ORDER BY groupname";
         $db->setQuery($qry);
         $this->ticketgroups = $db->loadObjectList();
         if ($this->ticketid > 0 && $ticket_has_groups) {
             array_unshift($this->ticketgroups, JHTML::_('select.option', 't', JText::_("CURRENT_TICKET"), 'id', 'groupname'));
         }
         array_unshift($this->ticketgroups, JHTML::_('select.option', '', JText::_("ALL_TICKET_GROUPS"), 'id', 'groupname'));
         $this->ticketgroup_select = JHTML::_('select.genericlist', $this->ticketgroups, 'ticketgroup', 'class="inputbox" size="1" onchange="document.fssForm.submit( );"', 'id', 'groupname', $this->ticketgroup);
     }
     $this->_display();
 }
Exemple #28
0
 function LoadData()
 {
     if (!$this->xml) {
         return;
     }
     $qry = (string) $this->xml->sql;
     $where = array();
     if ($this->xml->where) {
         foreach ($this->xml->where as $w) {
             $where[] = (string) $w;
         }
     }
     if ($this->xml->addbtntext) {
         $this->addbtntext = (string) $this->xml->addbtntext;
     }
     if ($this->xml->use_auth) {
         // sort out which articles the user can view here, based on published, access, author
         // sort published out here
         $published = (string) $this->xml->use_auth->attributes()->published;
         $access = (string) $this->xml->use_auth->attributes()->access;
         $author = (string) $this->xml->use_auth->attributes()->author;
         $where[] = "{$published} = 1";
     }
     $this->search = FSS_Input::getString('search');
     if ($this->search != "") {
         foreach ($this->xml->filters->search->field as $field) {
             $field = (string) $field;
             $where[] = "{$field} LIKE '%" . FSSJ3Helper::getEscaped($db, $this->search) . "%'";
         }
     }
     foreach ($this->xml->filters->filter as $filter) {
         $type = (string) $filter->attributes()->type;
         $field = (string) $filter->attributes()->field;
         $filter_id = (string) $filter->attributes()->id;
         if ($type == "lookup") {
             $key = (string) $filter->key;
             $display = (string) $filter->display;
             $var = "filter_" . $filter_id;
             $value = trim(FSS_Input::getString($var));
             $this->{$var} = FSS_Input::getString($var);
             if ($value != "") {
                 $where[] = "{$field} = '" . FSSJ3Helper::getEscaped($db, $value) . "'";
             }
         }
     }
     if (count($where) > 0) {
         $qry .= " WHERE " . implode(" AND ", $where);
     }
     $this->order = FSS_Input::getCmd('filter_order');
     $this->orderdir = FSS_Input::getCmd('filter_order_Dir', 'ASC');
     if ($this->order == "" && $this->xml->ordering) {
         $this->order = (string) $this->xml->ordering;
     }
     if ($this->order) {
         $qry .= " ORDER\tBY {$this->order} {$this->orderdir} ";
     }
     $db = JFactory::getDBO();
     $db->setQuery($qry);
     //echo "Qry : $qry<br>";
     $db->query();
     $this->num_rows = $db->getNumRows();
     $mainframe = JFactory::getApplication();
     $this->limit = $mainframe->getUserStateFromRequest('global.list.limitpick', 'limit', 10, 'int');
     $this->limitstart = FSS_Input::getInt('limitstart');
     $this->limitstart = $this->limit != 0 ? floor($this->limitstart / $this->limit) * $this->limit : 0;
     $this->pagination = new JPaginationEx($this->num_rows, $this->limitstart, $this->limit);
     $db->setQuery($qry, $this->limitstart, $this->limit);
     $this->data = $db->loadObjectList();
     //echo $qry."<br>";
     //print_p($this->data);
 }
Exemple #29
0
 function removecc()
 {
     $this->loadTicket();
     if ($this->ticket) {
         $ids = FSS_Input::getString('ids');
         $is_admin = FSS_Input::getInt('is_admin');
         $ids = explode(",", $ids);
         $this->ticket->removeCC($ids, $is_admin);
     }
     if (FSS_Input::getInt('nr') != 1) {
         $link = FSSRoute::_("index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=" . $this->ticket->id, false);
         JFactory::getApplication()->redirect($link);
     } else {
         exit;
     }
 }
defined('_JEXEC') or die;
?>
	<form action="<?php 
echo FSSRoute::_("index.php?option=com_fss&view=ticket&tmpl=component&ticketid=" . FSS_Input::getInt('ticketid'));
?>
" method="post" class="form-horizontal" id="fssForm">

	<?php 
echo FSS_Helper::PageStylePopup(true);
?>
	<?php 
echo FSS_Helper::PageTitlePopup("SUPPORT", "EDIT_TICKET");
?>

	<?php 
$input = FSSCF::FieldInput($this->field, $this->errors, "ticket", array('ticketid' => FSS_Input::getInt('ticketid', 0), 'userid' => $this->ticket['user_id'], 'ticket' => $this->ticket));
?>

	<div class="control-group" style="min-height:<?php 
echo $this->field['min_popup_height'];
?>
px;">
		<label class="control-label">
		
			<?php 
echo FSSCF::FieldHeader($this->field, false, false);
?>
		</label>
		<div class="controls">
			<?php 
echo $input;