コード例 #1
0
 /**
  * @return TaskList\TaskListControl
  */
 public function createComponentUserTasks()
 {
     $incomplete = $this->tasks->findIncompleteByUser($this->getUser()->getId());
     $control = new TaskList\TaskListControl($incomplete, $this->tasks);
     $control->displayTaskList = TRUE;
     $control->displayUser = FALSE;
     return $control;
 }
コード例 #2
0
 /**
  * @param Nette\Application\UI\Form $form
  */
 public function taskFormSubmitted(Form $form)
 {
     $this->tasks->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();
 }