function handleTaskGroupChange($filter_task_text, $filter_task_group_id, $taskGroupId, $taskId) { $taskGroup = $this->taskGroupRepository->getById($taskGroupId); $task = $this->taskRepository->getById(intval($taskId)); $task->setTaskGroup($taskGroup); $this->taskRepository->updateEntity($task); $this->template->tasks = $this->taskRepository->getTasksFilteredByName($filter_task_text, intval($filter_task_group_id)); $this->template->taskGroups = $this->getTaskGroups(); $this->redrawControl('tasks'); }
/** * @param Form $form * @param $values */ public function insertTaskFromSuccess(Form $form, $values) { $taskGroup = $this->taskGroupRepository->getById($values->idTaskGroup); $taskEntity = new Task(); $taskEntity->setName($values->name); $taskEntity->setDate($values->date); $taskEntity->setTaskGroup($taskGroup); $this->taskRepository->insert($taskEntity); $this->presenter->flashMessage('Task was created', 'success'); $this->redirect('this'); }