コード例 #1
0
ファイル: task.batch.php プロジェクト: vstorm83/propertease
 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();
         }
     }
 }
コード例 #2
0
ファイル: task.update.php プロジェクト: vstorm83/propertease
 /**
  * Update ticket lock for current user
  */
 function lock()
 {
     $ticketid = FSS_Input::getInt('ticketid');
     if ($ticketid < 1) {
         exit;
     }
     $ticket = new SupportTicket();
     if (!$ticket->Load($ticketid)) {
         exit;
     }
     $ticket->updateLock();
     exit;
 }