Пример #1
0
 /**
  * Lists all Task models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new TaskSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $model = new Task();
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'model' => $model]);
 }
 /**
  * Lists all Task models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new TaskSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     $dataProvider->setSort(['defaultOrder' => ['created_at' => SORT_DESC]]);
     $searchModelTaskDefined = new TaskDefinedSearch();
     $dataProviderTaskDefined = $searchModelTaskDefined->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'searchModelTaskDefined' => $searchModelTaskDefined, 'dataProviderTaskDefined' => $dataProviderTaskDefined]);
 }
Пример #3
0
 /**
  * Lists all Task models.
  * @return mixed
  * @throws UserException
  */
 public function actionIndex()
 {
     $searchModel = new TaskSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     if (!$searchModel->goal_id) {
         throw new UserException('Goal id is not provided');
     }
     if (!$searchModel->goal) {
         throw new UserException("Goal [{$searchModel->goal_id}] not found");
     }
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'goal' => $searchModel->goal]);
 }
Пример #4
0
 /**
  * Lists all Task models.
  * @return mixed
  */
 public function actionIndex()
 {
     $course_id = Yii::$app->request->get('course_id');
     $searchModel = new TaskSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $course_id);
     $chapterName = $courseName = null;
     if (!empty($course_id)) {
         $chapterName = Course::findModel($course_id)->name;
         $courseName = Course::findRoot($course_id)->name;
     }
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'courseId' => $course_id, 'chapterName' => $chapterName, 'courseName' => $courseName]);
 }
Пример #5
0
 public function actionIndex()
 {
     $taskSearchRequest["TaskSearch"] = Yii::$app->request->get("TaskSearch");
     $taskSearchRequestLate["TaskSearch"] = Yii::$app->request->get("TaskSearchLate");
     $taskSearchRequestTomorrow["TaskSearch"] = Yii::$app->request->get("TaskSearchTomorrow");
     $taskSearch = new TaskSearch();
     $activeDataProvider = $taskSearch->search($taskSearchRequest, "=", date("Y-m-d"), true);
     $taskSearchLate = new TaskSearch();
     $activeDataProviderLate = $taskSearchLate->search($taskSearchRequestLate, "<", date("Y-m-d"), true);
     $taskSearchTomorrow = new TaskSearch();
     $activeDataProviderTomorrow = $taskSearchTomorrow->search($taskSearchRequestTomorrow, "=", date("Y-m-d", strtotime("tomorrow")), true);
     return $this->render("index", ["dataProviders" => ["taskSearch" => $taskSearch, "taskSearchLate" => $taskSearchLate, "taskSearchTomorrow" => $taskSearchTomorrow, "activeDataProvider" => $activeDataProvider, "activeDataProviderLate" => $activeDataProviderLate, "activeDataProviderTomorrow" => $activeDataProviderTomorrow]]);
 }
Пример #6
0
 public function actionHomy()
 {
     $user = \yii::$app->user->identity;
     if (!$user->family_login_user) {
         throw new \yii\base\Exception("Não é um utilizador familiar.");
     }
     self::updateAccess();
     $user_pref = $user->preferences;
     $task_filter = "";
     $searchModel = new TaskSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->get());
     $dataProvider->query->filterWhere(['family_id' => $user->family_login_user])->orderBy(['start' => SORT_ASC]);
     if ($user_pref) {
         $task_filter = $user_pref->task_filter;
     }
     switch ($task_filter) {
         case "waiting":
             $title = 'Tarefas que aguardam resposta';
             $dataProvider = self::applyFilter($user, $dataProvider, ['homy_family_tasks', 'status_open', 'waiting_for_response']);
             break;
         case 'open':
             $title = 'Tarefas em aberto';
             $dataProvider = self::applyFilter($user, $dataProvider, ['homy_family_tasks', 'status_open']);
             break;
         case 'all':
         default:
             $title = 'Todas as tarefas da familia';
             $dataProvider = self::applyFilter($user, $dataProvider, ['homy_family_tasks']);
     }
     $this->layout = 'main_homy';
     return $this->render('homy', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'title' => $title]);
 }
Пример #7
0
 /**
  * Displays a single Project model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($id)
 {
     $searchModel = new TaskSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('view', ['model' => $this->findModel($id), 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }
Пример #8
0
 public function actionIndex()
 {
     $taskSearch = new TaskSearch();
     $activeDataProvider = $taskSearch->search(Yii::$app->request->get());
     return $this->render("index", ["dataProviders" => ["taskSearch" => $taskSearch, "activeDataProvider" => $activeDataProvider]]);
 }