Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     $class = $this->model;
     $class = $class::className();
     $models = Activity::getActivities($this->model->id, $class);
     $model = new Activity(['scenario' => 'create']);
     $model->customNextTypes = $this->customNextTypes;
     if (!is_null($this->allowedNextTypes)) {
         $model->allowed_next_type = $this->allowedNextTypes;
     }
     $model->entity = $class;
     $model->entity_id = $this->model->id;
     $model->type = Activity::TYPE_CALL;
     $model->next_by = \Yii::$app->user->identity->id;
     return $this->render('index', ['models' => $models, 'model' => $model]);
 }
 /**
  * Renders the activities inside a calendar... might be nicer to view
  * @param  [type] $start [description]
  * @param  [type] $end   [description]
  * @param  [type] $_     [description]
  * @return [type]        [description]
  */
 public function actionJsoncalendar($start = NULL, $end = NULL, $entity = NULL, $entity_id = NULL, $_ = NULL, $entityTitleField = NULL)
 {
     \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
     if ($start = null) {
         $startObj = new DateTime();
         $start = $startObj->format('U');
     }
     $events = Activity::getCalendarActivities($start, $end, $entity, $entity_id, $entityTitleField);
     return $events;
 }