public function actionDelete()
 {
     $object = CBaseManager::getWorkPlanGoal(CRequest::getInt("id"));
     $plan = $object->plan_id;
     $object->remove();
     $this->redirect("workplans.php?action=edit&id=" . $plan);
 }
 public function actionDelete()
 {
     $object = CBaseManager::getWorkPlanTask(CRequest::getInt("id"));
     if (!is_null($object)) {
         $goal = $object->goal;
         $object->remove();
         $order = 1;
         foreach ($goal->tasks as $task) {
             $task->ordering = $order++;
             $task->save();
         }
         $this->redirect("workplangoals.php?action=edit&id=" . $goal->getId());
     }
     $items = CRequest::getArray("selectedInView");
     $goal = CBaseManager::getWorkPlanGoal(CRequest::getInt("goal_id"));
     foreach ($items as $id) {
         $object = CBaseManager::getWorkPlanTask($id);
         $object->remove();
     }
     $order = 1;
     foreach ($goal->tasks as $task) {
         $task->ordering = $order++;
         $task->save();
     }
     $this->redirect("workplangoals.php?action=edit&id=" . $goal->getId());
 }
 public function actionDelete()
 {
     $object = CBaseManager::getWorkPlanGoal(CRequest::getInt("id"));
     $plan = $object->plan;
     $object->remove();
     $order = 1;
     foreach ($plan->goals as $goal) {
         $goal->ordering = $order++;
         $goal->save();
     }
     $this->redirect("workplans.php?action=edit&id=" . $plan->getId());
 }
 public function actionAdd()
 {
     $object = new CWorkPlanTask();
     $goal = CBaseManager::getWorkPlanGoal(CRequest::getInt("id"));
     $object->goal_id = $goal->getId();
     $object->plan_id = $goal->plan->getId();
     $this->setData("object", $object);
     /**
      * Генерация меню
      */
     $this->addActionsMenuItem(array("title" => "Назад", "link" => "workplangoals.php?action=edit&id=" . $object->goal_id, "icon" => "actions/edit-undo.png"));
     /**
      * Отображение представления
      */
     $this->renderView("_corriculum/_workplan/task/add.tpl");
 }