Esempio n. 1
0
 /**
  * Manages all models.
  */
 public function actionAdmin()
 {
     $model = new Task('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Task'])) {
         $model->attributes = $_GET['Task'];
     }
     $this->render('admin', array('model' => $model));
 }
Esempio n. 2
0
 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionView($id)
 {
     if ($this->loadModel($id)->deleted == 1) {
         throw new CHttpException(403, 'The page you are requested are invalid');
     }
     $tasks = new Task('search');
     $tasks->unsetAttributes();
     // clear any default values
     $tasks->parent_id = $id;
     if (isset($_GET['Task'])) {
         $tasks->attributes = $_GET['Task'];
     }
     $this->render('view', array('model' => $this->loadModel($id), 'tasks' => $tasks));
 }
Esempio n. 3
0
    /**
     * Manages all models.
     */
    public function actionAdmin()
    {
        $this->pageTitle = get_class( Task::model() );
        $model = new Task( 'search' );
        $model->unsetAttributes();  // clear any default values
        if ( isset( $_GET['Task'] ) )
            $model->attributes = $_GET['Task'];

        $this->render( 'admin', array(
            'model' => $model,
        ) );
    }
Esempio n. 4
0
 public function actionPeriod($periodId)
 {
     $period = Period::model()->findByPk($periodId);
     if ($period === NULL) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     if ($this->_user()->role == User::ROLE_USER) {
         return $this->actionUser($periodId);
     }
     $model = new Task('search');
     $model->unsetAttributes();
     // clear any default values
     $model->period_id = $periodId;
     if (isset($_GET['Task'])) {
         $model->attributes = $_GET['Task'];
     }
     $this->render('period', array('model' => $model, 'period' => $period));
 }