Exemplo n.º 1
0
 function display($tpl = NULL)
 {
     FSS_Helper::AddSCEditor();
     if (FSS_Input::getInt('sigid')) {
         return $this->display_edit();
     }
     $this->sigs = SupportCanned::GetAllSigs(null);
     $this->_display("list");
 }
Exemplo n.º 2
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.º 3
0
 function display($tpl = null)
 {
     $autologin = FSS_Input::getCmd('login');
     if ($autologin != "") {
         FSS_Helper::AutoLogin($autologin);
     }
     if (!FSS_Permission::auth("fss.ticket.view", "com_fss.support_user") && !FSS_Permission::auth("fss.ticket.open", "com_fss.support_user")) {
         return FSS_Helper::NoPerm();
     }
     $session = JFactory::getSession();
     $user = JFactory::getUser();
     $this->userid = $user->get('id');
     $this->ticket = null;
     $this->assign('tmpl', '');
     $what = FSS_Input::getCmd('what');
     $layout = FSS_Input::getCmd('layout');
     $this->ticket_view = FSS_Input::getCmd('tickets');
     if (!$this->ticket_view && FSS_Settings::get('support_simple_userlist_tabs')) {
         $this->ticket_view = "all";
     }
     // reset the login and password
     if ($what == "reset") {
         $session->clear('ticket_email');
         $session->clear('ticket_reference');
         $session->clear('ticket_name');
         $session->clear('ticket_pass');
     }
     if ($what == "unreg_passlist") {
         return $this->Unreg_Passlist();
     }
     if ($what == "addccuser") {
         return $this->AddCCUser();
     }
     if ($what == "removeccuser") {
         return $this->RemoveCCUser();
     }
     if ($what == "pickccuser") {
         return $this->PickCCUser();
     }
     // should we display the edit field screen
     if ($what == 'editfield') {
         return $this->EditField();
     }
     // save an edited field and continue what we were doing afterwards
     if ($what == 'savefield') {
         if ($this->SaveField()) {
             return;
         }
     }
     FSS_Helper::AddSCEditor();
     // check for product search ajax display
     if (FSS_Input::getString('prodsearch') != "") {
         return $this->searchProducts();
     }
     if (FSS_Input::getString('deptsearch') != "") {
         return $this->searchDepartments();
     }
     // page to hunt for unregistered ticket
     if ($what == "find") {
         return $this->findTicket();
     }
     // save status changes
     if ($what == "statuschange") {
         return $this->saveStatusChanges();
     }
     // save any replys
     if ($what == 'savereply') {
         return $this->saveReply();
     }
     // save any replys
     if ($what == 'messages') {
         return $this->showMessages();
     }
     // process any file downloads
     $fileid = FSS_Input::getInt('fileid');
     if ($fileid > 0) {
         $ticketid = FSS_Input::GetInt('ticketid');
         if ($what == 'attach_thumb') {
             return SupportHelper::attachThumbnail($ticketid, $fileid, true);
         } else {
             return SupportHelper::attachDownload($ticketid, $fileid, true);
         }
     }
     $this->count = $this->get('TicketCount');
     // handle opening ticket
     if ($layout == "open") {
         return $this->doOpenTicket();
     }
     // handel ticket reply
     if ($layout == "reply") {
         return $this->doUserReply();
     }
     // display ticket list / ticket
     return $this->doDisplayTicket();
 }
Exemplo n.º 4
0
 function display($tpl = NULL)
 {
     FSS_Helper::AddSCEditor();
     $editid = FSS_Input::getInt('cannedid', -2);
     if ($editid != -2) {
         if ($editid > 0) {
             $db = JFactory::getDBO();
             $qry = "SELECT * FROM #__fss_ticket_fragments WHERE id = " . FSSJ3Helper::getEscaped($db, $editid);
             $db->setQuery($qry);
             $this->canned_item = $db->loadObject();
         } else {
             $this->canned_item = new stdClass();
             $this->canned_item->id = 0;
             $this->canned_item->description = "";
             $this->canned_item->grouping = "";
             $this->canned_item->content = "";
         }
         return $this->_display("edit");
     }
     // if we are saving, then save
     $saveid = FSS_Input::getInt('saveid', -2);
     if ($saveid != -2) {
         $description = FSS_Input::getString('description');
         $grouping = FSS_Input::getString('grouping');
         $content = FSS_Input::getHTML('content');
         if ($saveid == 0) {
             $qry = "INSERT INTO #__fss_ticket_fragments (description, grouping, content, type) VALUES (";
             $qry .= "'" . FSSJ3Helper::getEscaped($db, $description) . "',";
             $qry .= "'" . FSSJ3Helper::getEscaped($db, $grouping) . "',";
             $qry .= "'" . FSSJ3Helper::getEscaped($db, $content) . "', 0)";
             $db = JFactory::getDBO();
             $db->setQuery($qry);
             $db->Query();
         } else {
             $qry = "UPDATE #__fss_ticket_fragments SET description = '" . FSSJ3Helper::getEscaped($db, $description) . "', ";
             $qry .= "grouping = '" . FSSJ3Helper::getEscaped($db, $grouping) . "', ";
             $qry .= "content = '" . FSSJ3Helper::getEscaped($db, $content) . "' WHERE id = " . FSSJ3Helper::getEscaped($db, $saveid);
             $db = JFactory::getDBO();
             $db->setQuery($qry);
             $db->Query();
         }
         $mainframe = JFactory::getApplication();
         $link = JRoute::_('index.php?option=com_fss&view=admin_support&layout=canned&tmpl=component', false);
         $mainframe->redirect($link);
     }
     // if we are editing then show edit
     // otherwise show list
     $deleteid = FSS_Input::getInt('deleteid');
     if ($deleteid > 0) {
         $qry = "DELETE FROM #__fss_ticket_fragments WHERE id = " . FSSJ3Helper::getEscaped($db, $deleteid);
         $db = JFactory::getDBO();
         $db->setQuery($qry);
         $db->Query();
     }
     $search = FSS_Input::getString('search');
     if ($search) {
         $db = JFactory::getDBO();
         $qry = "SELECT * FROM #__fss_ticket_fragments WHERE type = 0 AND (description LIKE '%" . $db->escape($search) . "%' OR content LIKE '%" . $db->escape($search) . "%')";
         $db->setQuery($qry);
         $this->canned = $db->loadObjectList();
     } else {
         $this->canned = SupportCanned::GetCannedReplies();
     }
     $this->_display("list");
 }
Exemplo n.º 5
0
 function doReply()
 {
     $this->ticketid = FSS_Input::getInt('ticketid');
     $this->ticket = new SupportTicket();
     if (!$this->ticket->load($this->ticketid)) {
         return JError::raiseWarning(404, JText::_('Ticket not found'));
     }
     $this->ticket->loadAll();
     if (FSS_Settings::get('time_tracking') != "") {
         if (FSS_Settings::get('time_tracking_type') == 'se') {
             $this->time_start = FSS_Helper::Date(time(), FSS_DATE_CUSTOM, "H:i:s");
             $this->time_end = FSS_Helper::Date(time(), FSS_DATE_CUSTOM, "H:i:s");
         } elseif (FSS_Settings::get('time_tracking_type') == 'tm') {
             $this->time_start = FSS_Helper::Date(time(), FSS_DATE_CUSTOM, FSS_Helper::getFormat());
             $this->time_end = FSS_Helper::Date(time(), FSS_DATE_CUSTOM, FSS_Helper::getFormat());
         } else {
             $this->taken_hours = 0;
             $this->taken_mins = 0;
         }
     }
     if (FSS_Settings::get('time_tracking') == "auto") {
         $session = JFactory::getSession();
         $taken = $session->get('ticket_' . $this->ticket->id . "_opened");
         if (FSS_Settings::get('time_tracking_type') == 'se') {
             $document = JFactory::getDocument();
             $document->addScript(JURI::root() . 'components/com_fss/assets/js/bootstrap/bootstrap-timepicker.min.js');
             $document->addScriptDeclaration("jQuery(document).ready(function () {jQuery('#timetaken_start').timepicker({minuteStep:5, showMeridian: false});jQuery('#timetaken_end').timepicker({minuteStep:5, showMeridian: false});});");
             $this->time_start = FSS_Helper::Date($taken, FSS_DATE_CUSTOM, "H:i:s");
         } else {
             if ($taken > 0) {
                 $taken = time() - $taken;
             }
             $this->time_taken = $taken;
             $taken = ceil($taken / 60);
             $this->taken_hours = floor($taken / 60);
             $this->taken_mins = $taken % 60 + 1;
         }
     }
     $this->fields = FSSCF::GetCustomFields($this->ticket->id, $this->ticket->prod_id, $this->ticket->ticket_dept_id, 3);
     $this->fieldvalues = FSSCF::GetTicketValues($this->ticket->id, $this->ticket);
     $pathway = JFactory::getApplication()->getPathway();
     $pathway->addItem(JText::_("SUPPORT"), FSSRoute::_('index.php?option=com_fss&view=admin_support&tickets=' . $this->ticket_view, false));
     $pathway->addItem(JText::_("VIEW_TICKET") . " : " . $this->ticket->reference . " - " . $this->ticket->title, FSSRoute::_('index.php?option=com_fss&view=admin_support&tickets=' . $this->ticket_view . "&ticketid=" . $this->ticket->id, false));
     $this->reply_type = FSS_Input::getCmd('type', 'reply');
     if ($this->reply_type == "") {
         $this->reply_type = "reply";
     }
     switch ($this->reply_type) {
         case 'reply':
             $this->reply_title = "REPLY_TO_SUPORT_TICKET";
             $this->reply_button = "POST_REPLY";
             $pathway->addItem(JText::_("POST_REPLY"));
             break;
         case 'private':
             $this->reply_title = "ADD_HANDLER_COMMENT_TO_TICKET";
             $this->reply_button = "POST_COMMENT";
             $pathway->addItem(JText::_("ADD_COMMENT"));
             break;
         case 'user':
             $this->reply_title = "FORWARD_TICKET_TO_A_DIFFERENT_USER";
             $this->reply_button = "FORWARD_TICKET";
             if ($this->ticket->user_id > 0) {
                 $user = JFactory::getUser($this->ticket->user_id);
             } else {
                 $user = new stdClass();
                 $user->username = $this->ticket->email;
                 $user->name = $this->ticket->unregname;
             }
             $this->user = $user;
             $pathway->addItem(JText::_("FORWARD_TO_USER"));
             break;
         case 'product':
             $this->reply_title = "FORWARD_TICKET_TO_A_DIFFERENT_DEPARTMENT";
             $this->reply_button = "FORWARD_TICKET";
             $this->handlers = SupportUsers::getHandlers(false, true);
             $pathway->addItem(JText::_("FORWARD_TO_DEPARTMENT"));
             break;
         case 'handler':
             $this->reply_title = "FORWARD_TICKET_TO_A_DIFFERENT_HANDLER";
             $this->reply_button = "FORWARD_TICKET";
             $this->handlers = SupportUsers::getHandlers(false, true);
             $pathway->addItem(JText::_("FORWARD_TO_HANDLER"));
             break;
     }
     $this->draft = FSS_Input::getInt('draft');
     $this->user_message = $this->loadDraft($this->draft);
     $this->support_assign_reply = FSS_Settings::get('support_assign_reply');
     FSS_Helper::IncludeModal();
     FSS_Helper::AddSCEditor();
     parent::_display();
 }
Exemplo n.º 6
0
 function showUserIn()
 {
     FSS_Helper::AddSCEditor();
     $this->handlers = SupportUsers::getHandlers(false, true);
     $this->_display("in");
 }