Esempio n. 1
0
 public function handleDeleteOutline($id, $order)
 {
     $data = $this->model->get($id);
     if ($data && $data->works == 0 && ($this->user->isInRole("administrator") || $this->user->id == $data->user_id)) {
         try {
             $this->model->deleteOutline($id, $order);
             $this->flashMessage("Bod osnovy {$order} byl odstraněn.", "success");
         } catch (Exception $e) {
             $this->flashMessage("Odstranění bodu osnovy {$order} se nepodařilo.", "success");
         }
     } else {
         $this->flashMessage("Bod osnovy nelze smazat.", "danger");
     }
     $this->template->outline = $this->model->getOutline($id);
     if ($this->isAjax()) {
         $this->redrawControl('outlineList');
         $this->redrawControl('flashMessages');
     }
 }
Esempio n. 2
0
 public function handleDeleteOutline($id, $order)
 {
     $data = $this->model->get($id);
     if ($this->checkAvailability($data)) {
         try {
             $this->model->deleteOutline($id, $order);
             $this->flashMessage("Bod osnovy {$order} byl odstraněn.", "success");
         } catch (Exception $e) {
             $this->flashMessage("Odstranění bodu osnovy {$order} se nepodařilo.", "success");
         }
     } else {
         $this->flashMessage("Bod osnovy nelze smazat.", "danger");
     }
     $this->template->outline = $this->model->getOutline($id);
     if ($this->isAjax()) {
         $this->redrawControl('outlineList');
         $this->redrawControl('flashMessages');
     }
 }