public static function defaultColumns() { return array_merge(parent::defaultColumns(), ['tech_details' => ['format' => 'raw', 'label' => Yii::t('hipanel:finance:change', 'Operation details'), 'value' => function ($model) { $params = $model->params; return OSFormatter::widget(['osimages' => ServerHelper::getOsimages($params['tariff_type']), 'imageName' => $params['osimage'], 'infoCircle' => false]); }], 'user_comment' => ['filterAttribute' => 'user_comment_like', 'value' => function ($model) { return $model->user_comment; }], 'tech_comment' => ['attribute' => 'tech_comment'], 'time' => ['value' => function ($model) { return Yii::$app->formatter->asDatetime($model->time); }], 'actions' => ['class' => ActionColumn::class, 'template' => '{view}', 'header' => Yii::t('hipanel', 'Actions')]]); }
/** {@inheritdoc} */ private function ensureRelatedData() { $this->_model = ServerHelper::getAvailablePackages(null, $this->tariff_id); if ($this->_model === null) { throw new InvalidConfigException('Failed to find tariff'); } $this->_image = Osimage::find()->where(['osimage' => $this->osimage, 'type' => $this->_model->getType()])->one(); if ($this->_image === null) { throw new InvalidConfigException('Failed to find osimage'); } $this->name = $this->_model->getName(); $this->description = Yii::t('hipanel:server:order', 'Order'); }
public function actionOpenVz() { return $this->render('open_vz', ['packages' => ServerHelper::getAvailablePackages(Tariff::TYPE_OPENVZ), 'tariffTypes' => Yii::$app->params['vdsproduct']]); }
protected function getPanelTypes() { return ServerHelper::getPanels(); }