Esempio n. 1
0
 public function getShortInfo()
 {
     $str = '<b>' . $this->project->title . '</b>: ' . Html::a($this->subject, ['/issue/view', 'id' => $this->id]);
     if (in_array($this->status_id, StatusEnum::getOpenStatuses())) {
         if ($this->commentsCount) {
             $str .= ' <sup class="text-muted">' . $this->commentsCount . '<i class="fa fa-comments" title="Комментарии"></i></sup>';
         }
         if ($this->assignee_id == \Yii::$app->user->id) {
             $str .= ' <sup><i class="fa fa-get-pocket text-success" title="назначена мне"></i></sup>';
         }
         $str .= '<span class="pull-right text-muted text-sm">' . $this->created_date . '</span>';
     }
     if ($this->status_id == StatusEnum::IN_WORK) {
         $str .= ' <i class="text-muted">(' . $this->assignee->getFullName() . ')</i>';
     }
     return $str;
 }
Esempio n. 2
0
 public function actionGetIssuesJson()
 {
     \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
     return ['New' => Issue::find()->where('status_id IN (' . implode(',', StatusEnum::getOpenStatuses()) . ')')->orderBy('id DESC')->limit(self::ISSUE_LIMIT)->all(), 'In work' => Issue::find()->where(['status_id' => StatusEnum::IN_WORK])->orderBy('id DESC')->limit(self::ISSUE_LIMIT)->all(), 'Closed' => Issue::find()->where('status_id IN (' . implode(',', StatusEnum::getClosedStatuses()) . ')')->orderBy('id DESC')->limit(self::ISSUE_LIMIT)->all()];
 }