/** @return Todo\TaskListControl */ public function createComponentUserTasks() { $incomplete = $this->taskRepository->findIncompleteByUser($this->getUser()->getId()); $control = new Todo\TaskListControl($incomplete, $this->taskRepository); $control->displayList = TRUE; $control->displayUser = FALSE; return $control; }
/** * @param Nette\Application\UI\Form $form */ public function taskFormSubmitted(Form $form) { $this->taskRepository->createTask($this->list->id, $form->values->text, $form->values->userId); $this->flashMessage('Úkol přidán.', 'success'); if (!$this->isAjax()) { $this->redirect('this'); } $form->setValues(array('userId' => $form->values->userId), TRUE); $this->invalidateControl('form'); $this['taskList']->invalidateControl(); }