Exemple #1
0
 function delete_message()
 {
     if (!$this->view->can_EditTicket()) {
         exit;
     }
     $messageid = FSS_Input::getInt('messageid');
     $subject = FSS_Input::getString('subject');
     $body = FSS_Input::getBBCode('body');
     $body = urldecode($body);
     $subject = urldecode($subject);
     $db = JFactory::getDBO();
     $qry = "SELECT * FROM #__fss_ticket_messages WHERE id = " . FSSJ3Helper::getEscaped($db, $messageid);
     $db->setQuery($qry);
     $row = $db->LoadAssoc();
     $ticket = new SupportTicket();
     if ($ticket->load($row['ticket_ticket_id'])) {
         $ticket->deleteMessage($messageid, $subject, $body);
         if ($row['time'] > 0) {
             $ticket->addTime(-$row['time']);
         }
     }
     exit;
 }