Пример #1
0
 function deleteCommentAction()
 {
     @($ticket_id = DevblocksPlatform::importGPC($_REQUEST['ticket_id'], 'integer', 0));
     @($comment_id = DevblocksPlatform::importGPC($_REQUEST['comment_id'], 'integer', 0));
     //		@$worker_id = CerberusApplication::getActiveWorker()->id;
     if (empty($ticket_id) || empty($comment_id)) {
         // empty($worker_id) ||
         DevblocksPlatform::redirect(new DevblocksHttpResponse(array('display', $ticket_id)));
     }
     @($active_worker = CerberusApplication::getActiveWorker());
     $comment = DAO_TicketComment::get($comment_id);
     if (!empty($active_worker) && ($active_worker->is_superuser || $comment->getAddress()->email == $active_worker->email)) {
         DAO_TicketComment::delete($comment_id);
     }
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('display', $ticket_id, 'comments')));
 }
Пример #2
0
 private function _deleteIdAction($path)
 {
     $in_id = array_shift($path);
     if (empty($in_id)) {
         $this->_error("ID was not provided.");
     }
     if (null == ($note = DAO_TicketComment::get($in_id))) {
         $this->_error("ID is not valid.");
     }
     DAO_TicketComment::delete($note->id);
     $out_xml = new SimpleXMLElement('<success></success>');
     $this->_render($out_xml->asXML());
 }