Exemplo n.º 1
0
 function adminSupportTabs_End()
 {
     $output = "";
     $departments = SupportHelper::getDepartments();
     $class = "";
     foreach ($departments as $dept) {
         $class = "";
         if (JRequest::getVar('department') == $dept->id) {
             $class = "active";
         }
         $output[] = '<li class="' . $class . '">';
         $output[] = '<a href="' . JRoute::_('index.php?option=com_fss&view=admin_support&what=search&searchtype=advanced&showbasic=1&department=' . $dept->id) . '">';
         $output[] = $dept->title;
         $output[] = '	</a>';
         $output[] = '</li> ';
     }
     return implode("\n", $output);
 }
Exemplo n.º 2
0
 static function prep_custom_rules($form, $field_id, $type, $key, $label)
 {
     $xml = '<field name="' . $field_id . '" type="fssrules" label=""
     translate_label="false" class="inputbox" filter="rules"
     component="com_fss" section="" validate="rules" tab_id="' . $label . '">';
     switch ($type) {
         case 'products':
             $items = SupportHelper::getProducts();
             break;
         case 'departments':
             $items = SupportHelper::getDepartments();
             break;
         case 'categories':
             $items = SupportHelper::getCategories();
             break;
         case 'reports':
             $xml .= '<action name="fss.reports" title="VIEW_REPORTS" description="" />';
             $xml .= '<action name="fss.reports.all" title="VIEW_ALL_REPORTS" description="" />';
             $items = self::getReports();
             break;
     }
     $first = true;
     foreach ($items as $item) {
         if ($type == "reports" && $first) {
             $xml .= '<action name="' . $key . '.' . htmlspecialchars($item->id) . '" title="' . htmlspecialchars($item->title) . '" description="" heading="Reports" />';
             $first = false;
         } else {
             $xml .= '<action name="' . $key . '.' . htmlspecialchars($item->id) . '" title="' . htmlspecialchars($item->title) . '" description="" />';
         }
     }
     $xml .= '</field>';
     $field = new JFormFieldRules();
     $field = $form->getField("{$field_id}");
     $field->setup(simplexml_load_string($xml), $form->getValue($field_id));
     return $field;
 }
Exemplo n.º 3
0
    }
    ?>
	

		<?php 
    echo FSS_Translate_Helper::TrF('title', $this->ticket->product, $this->ticket->prtr);
    ?>
	</td>
<?php 
    FSS_Table::ColEnd();
}
?>


<?php 
if (count(SupportHelper::getDepartments()) > 0) {
    FSS_Table::ColStart("tr_department");
    ?>
	<th><?php 
    echo JText::_("DEPARTMENT");
    ?>
</th>
	<td>		
		<?php 
    if ($this->can_ChangeTicket() && $this->can_Forward()) {
        ?>
			<a class="pull-right padding-left-small" href='<?php 
        echo FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=reply&type=product&ticketid=' . $this->ticket->id);
        ?>
'>
				<i class="icon-arrow-right fssTip" title="<?php 
Exemplo n.º 4
0
 function loadPDC()
 {
     $this->products = SupportHelper::getProducts();
     $this->departments = SupportHelper::getDepartments();
     $this->categories = SupportHelper::getCategories();
     $prods = array();
     $prods[] = JHTML::_('select.option', '0', JText::_("SELECT_PRODUCT"), 'id', 'title');
     $prods = array_merge($prods, $this->products);
     $this->products_select = JHTML::_('select.genericlist', $prods, 'prodid', 'class="input-medium" size="1" onchange="document.mainform.submit( );"', 'id', 'title', $this->prodid);
     $depts = array();
     $depts[] = JHTML::_('select.option', '0', JText::_("SELECT_DEPARTMENT"), 'id', 'title');
     $depts = array_merge($depts, $this->departments);
     $this->departments_select = JHTML::_('select.genericlist', $depts, 'deptid', 'class="input-medium" size="1" onchange="document.mainform.submit( );"', 'id', 'title', $this->deptid);
     $cats = array();
     $cats[] = JHTML::_('select.option', '0', JText::_("SELECT_CATEGORY"), 'id', 'title');
     $cats = array_merge($cats, $this->categories);
     $this->categories_select = JHTML::_('select.genericlist', $cats, 'catid', 'class="input-medium" size="1" onchange="document.mainform.submit( );"', 'id', 'title', $this->catid);
     $modes = array();
     $modes[] = JHTML::_('select.option', '0', JText::_("VIEW_TICKETS"), 'id', 'title');
     $modes[] = JHTML::_('select.option', '1', JText::_("ASSIGN_TICKETS"), 'id', 'title');
     $this->mode_select = JHTML::_('select.genericlist', $modes, 'mode', 'class="input-medium" size="1" onchange="document.mainform.submit( );"', 'id', 'title', $this->mode);
     $this->statuss = SupportHelper::getStatuss();
     FSS_Translate_Helper::Tr($this->statuss);
     $this->status_select = JHTML::_('select.genericlist', $this->statuss, 'status', 'class="input-medium hide" size="1" onchange="document.mainform.submit( );" id="cur_status"', 'id', 'title', $this->status);
     $this->status_obj = FSS_Ticket_Helper::GetStatusByID($this->status);
     FSS_Translate_Helper::TrSingle($this->status_obj);
 }
Exemplo n.º 5
0
 static function getDepartment($ticket)
 {
     $depts = SupportHelper::getDepartments(false);
     if (array_key_exists($ticket->ticket_dept_id, $depts)) {
         return $depts[$ticket->ticket_dept_id];
     }
     return null;
 }
Exemplo n.º 6
0
 static function getAdminWhere()
 {
     $user = self::getUser();
     if (!FSS_Permission::auth("fss.handler", "com_fss.support_admin")) {
         return "0";
     }
     // can always view own tickets
     $where = " (t.admin_id = {$user->id} OR ";
     $where .= " t.id IN (SELECT ticket_id FROM #__fss_ticket_cc WHERE user_id = {$user->id} AND isadmin = 1) OR ";
     $where .= " (";
     // now need to filter by handler. we have several and sections here
     $inner = array();
     // users
     $can_see_unassigned = FSS_Permission::auth("fss.handler.seeunassigned", "com_fss.support_admin");
     $can_see_others = FSS_Permission::auth("fss.handler.seeothers", "com_fss.support_admin");
     if (!$can_see_unassigned && !$can_see_others) {
         $inner[] = "0";
     } elseif (!$can_see_unassigned && $can_see_others) {
         // only others, not unassigned
         $inner[] = "t.admin_id > 0";
     } elseif ($can_see_unassigned && !$can_see_others) {
         $inner[] = "t.admin_id = 0";
     }
     // products
     if (!FSS_Permission::auth("fss.handler.view.products", "com_fss.support_admin")) {
         $prod_ids = array();
         $prod_ids[0] = "0";
         $products = SupportHelper::getProducts();
         foreach ($products as $product) {
             if (FSS_Permission::auth("fss.handler.view.product." . $product->id, "com_fss.support_admin")) {
                 $prod_ids[$product->id] = $product->id;
             }
         }
         $inner[] = " t.prod_id IN (" . implode(", ", $prod_ids) . ")";
     }
     // departments
     if (!FSS_Permission::auth("fss.handler.view.departments", "com_fss.support_admin")) {
         $dept_ids = array();
         $dept_ids[0] = "0";
         $depts = SupportHelper::getDepartments();
         foreach ($depts as $dept) {
             if (FSS_Permission::auth("fss.handler.view.department." . $dept->id, "com_fss.support_admin")) {
                 $dept_ids[$dept->id] = $dept->id;
             }
         }
         $inner[] = " t.ticket_dept_id IN (" . implode(", ", $dept_ids) . ")";
     }
     // categories
     if (!FSS_Permission::auth("fss.handler.view.categories", "com_fss.support_admin")) {
         $cat_ids = array();
         $cat_ids[0] = "0";
         $cats = SupportHelper::getCategories();
         foreach ($cats as $cat) {
             if (FSS_Permission::auth("fss.handler.view.category." . $cat->id, "com_fss.support_admin")) {
                 $cat_ids[$cat->id] = $cat->id;
             }
         }
         $inner[] = " t.ticket_cat_id IN (" . implode(", ", $cat_ids) . ")";
     }
     if (count($inner) == 0) {
         $inner[] = "1";
     }
     $where .= implode(" AND ", $inner);
     $where .= " ))";
     return $where;
 }
Exemplo n.º 7
0
 function displayTicketList()
 {
     $this->getDBTime();
     // load in data for search forms
     $this->handlers = SupportUsers::getHandlers(false, false);
     $this->products = SupportHelper::getProducts();
     $this->statuss = SupportHelper::getStatuss();
     $this->departments = SupportHelper::getDepartments();
     $this->categories = SupportHelper::getCategories();
     $this->priorities = SupportHelper::getPriorities();
     $this->ticketgroups = SupportHelper::getTicketGroups();
     $this->taglist = SupportHelper::getTags();
     // load extra data for the list of tickets we have
     $this->ticket_list->loadTags();
     $this->ticket_list->loadAttachments();
     $this->ticket_list->loadGroups();
     $this->ticket_list->loadLockedUsers();
     $this->ticket_list->loadCustomFields();
     if (FSS_Settings::get('support_show_msg_counts')) {
         $this->ticket_list->loadMessageCounts();
     }
     // load in custom fields
     $this->customfields = FSSCF::GetAllCustomFields(true);
     // set the list of tickets to this->tickets
     $this->tickets = $this->ticket_list->tickets;
     $session = JFactory::getSession();
     $preview = FSS_Input::getInt('preview');
     if ($preview == -1) {
         $preview = "";
         $session->clear('preview');
     }
     if ($preview == 1 || $session->Get('preview') == 1) {
         $this->enablePreview();
     }
     if ($this->refresh == 2) {
         include $this->snippet(JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'views' . DS . 'admin_support' . DS . 'snippet' . DS . '_ticket_list.php');
         return;
     } elseif ($this->refresh) {
         ob_start();
         include $this->snippet(JPATH_SITE . DS . 'components' . DS . 'com_fss' . DS . 'views' . DS . 'admin_support' . DS . 'snippet' . DS . '_ticket_list.php');
         $contents = ob_get_clean();
         $output = array();
         $output['count'] = $this->count;
         $output['tickets'] = $contents;
         header("Content-Type: application/json");
         echo json_encode($output);
         return;
     }
     return $this->_display();
 }
Exemplo n.º 8
0
				<label class="control-label"><?php 
    echo JText::_("NEW_PRODUCT");
    ?>
</label>
				<div class="controls">
					<?php 
    echo JHTML::_('select.genericlist', $products, 'new_product_id', 'class="inputbox" size="1" ', 'id', 'title', $this->ticket->prod_id);
    ?>
				</div>
			</div>
		<?php 
}
?>

		<?php 
$departments = SupportHelper::getDepartments();
?>
		<?php 
if (count($departments) > 0) {
    ?>
			
			<div class="control-group">
				<label class="control-label"><?php 
    echo JText::_("NEW_DEPARTMENT");
    ?>
</label>
				<div class="controls">
					<?php 
    echo JHTML::_('select.genericlist', $departments, 'new_department_id', 'class="inputbox" size="1" ', 'id', 'title', $this->ticket->ticket_dept_id);
    ?>
				</div>