Example #1
0
 function archive()
 {
     // 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->updateStatus($def_archive);
         }
     } else {
         if ($tickets != '') {
             $tickets = new SupportTickets();
             $tickets->limitstart = 0;
             $tickets->limit = 100;
             $tickets->loadTicketsByStatus($tickets);
             foreach ($tickets->tickets as $ticket) {
                 $ticket->updateStatus($def_archive);
             }
         }
     }
     JFactory::getApplication()->redirect($_SERVER['HTTP_REFERER']);
 }
Example #2
0
 function ticket_status_id()
 {
     // update status in ticket
     // redirect if the config is set to
     $ticketid = FSS_Input::getInt('ticketid');
     $ticket_status_id = FSS_Input::getInt('ticket_status_id');
     if ($ticketid < 1) {
         exit;
     }
     if ($ticket_status_id < 1) {
         exit;
     }
     $link = FSSRoute::_('index.php?option=com_fss&view=admin_support&layout=ticket&ticketid=' . $ticketid, false);
     // check permission for new status
     $statuss = SupportHelper::getStatuss();
     $new_status = $statuss[$ticket_status_id];
     if ($new_status->is_closed && !$this->view->can_Close()) {
         JFactory::getApplication()->redirect($link);
         exit;
     }
     $ticket = new SupportTicket();
     if ($ticket->Load($ticketid)) {
         $old_st = $ticket->getStatus();
         $ticket->updateStatus($ticket_status_id);
         $new_st = $ticket->getStatus();
         // if we have closed the ticket, and return on close is set, then we should do a redirect dependant on the setting
         if ($new_st->is_closed && SupportUsers::getSetting("return_on_close")) {
             $link = SupportHelper::parseRedirectType($old_st->id, SupportUsers::getSetting("return_on_close"));
         }
         if ($new_st->is_closed && !$old_st->is_closed) {
             // SEND CLOSED EMAIL HERE!
             if (!FSS_Settings::get('support_email_on_close_no_dropdown')) {
                 FSS_EMail::Admin_Close($ticket, $ticket->title, '', array());
             }
         }
     }
     JFactory::getApplication()->redirect($link);
     exit;
 }