示例#1
0
 protected function deleteAction()
 {
     if ($this->sheet_model->deleteById($this->sheet_id)) {
         $this->response['sheet_id'] = $this->sheet_id;
         // Delete rights
         $right_model = new waContactRightsModel();
         $right_model->deleteByField(array('app_id' => wa()->getApp(), 'name' => 'sheet.' . $this->sheet_id));
         $this->log('board_delete', 1);
     } else {
         $this->errors = _w("Not enough rights to work with current board");
     }
 }
 public function execute()
 {
     $id = (int) $this->post('id', true);
     $sheet_model = new stickiesSheetModel();
     if ($sheet_model->available($id)) {
         if ($sheet_model->deleteById($id)) {
             $this->response = true;
         } else {
             throw new waAPIException('server_error', 500);
         }
     } else {
         throw new waAPIException('access_denied', "Not enough rights to work with current board", 403);
     }
 }