/**
  * @throws \HttpInvalidParamException
  *
  * @return string
  */
 public function actionModalContactsBody()
 {
     $ids = ArrayHelper::csplit(Yii::$app->request->post('ids'));
     $domainContactModels = [];
     if ($ids) {
         $domainContacts = Domain::perform('GetContacts', ArrayHelper::make_sub($ids, 'id'), true);
         foreach ($domainContacts as $item) {
             $domainContactModels[] = Domain::find()->populate([$item]);
         }
         $modelContactInfo = Contact::perform('GetList', ['domain_ids' => $ids, 'limit' => 1000], true);
         return $this->renderAjax('_modalContactsBody', ['domainContacts' => $domainContacts, 'modelContactInfo' => $modelContactInfo]);
     } else {
         return Yii::t('hipanel', 'No items selected');
     }
 }
 public function actionIndex()
 {
     $options = ['model' => ClientController::findModel(['id' => Yii::$app->user->identity->id, 'with_tickets_count' => true, 'with_domains_count' => Yii::getAlias('@domain', false) ? true : false, 'with_servers_count' => true, 'with_hosting_count' => true, 'with_contacts_count' => true]), 'totalCount' => []];
     if (Yii::$app->user->can('manage')) {
         if (Yii::getAlias('@domain', false)) {
             $options['totalCount']['domains'] = Domain::find()->count();
         }
         if (Yii::getAlias('@server', false)) {
             $options['totalCount']['servers'] = Server::find()->count();
         }
         if (Yii::getAlias('@ticket', false)) {
             $options['totalCount']['tickets'] = Thread::find()->count();
         }
     }
     return $this->render('index', $options);
 }