public function init() { $this->name = \Yii::t('skeeks/shop/app', 'Tax rates'); $this->modelShowAttribute = "id"; $this->modelClassName = ShopTaxRate::className(); parent::init(); }
/** * @inheritdoc */ public function actions() { $actions = parent::actions(); unset($actions['create']); unset($actions['update']); return $actions; }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => [['class' => CreatedAtColumn::className()], 'id', ['class' => DataColumn::className(), 'attribute' => 'status_code', 'format' => 'raw', 'filter' => ArrayHelper::map(ShopOrderStatus::find()->all(), 'code', 'name'), 'value' => function (ShopOrder $order) { return Html::label($order->status->name, null, ['style' => "background: {$order->status->color}", 'class' => "label"]) . "<br />" . Html::tag("small", \Yii::$app->formatter->asDatetime($order->status_at) . " (" . \Yii::$app->formatter->asRelativeTime($order->status_at) . ")"); }], ['class' => BooleanColumn::className(), 'attribute' => 'payed', 'format' => 'raw'], ['class' => DataColumn::className(), 'attribute' => "canceled", 'format' => "raw", 'filter' => ['Y' => \Yii::t('app', 'Yes'), 'N' => \Yii::t('app', 'No')], 'value' => function (ShopOrder $shopOrder) { return $shopOrder->canceled == "Y" ? \Yii::t('app', 'Yes') : \Yii::t('app', 'No'); }], ['class' => DataColumn::className(), 'attribute' => "user_id", 'label' => \skeeks\cms\shop\Module::t('app', 'Buyer'), 'format' => "raw", 'value' => function (ShopOrder $shopOrder) { return (new \skeeks\cms\shop\widgets\AdminBuyerUserWidget(['user' => $shopOrder->user]))->run(); }], ['class' => DataColumn::className(), 'filter' => false, 'format' => 'raw', 'label' => \skeeks\cms\shop\Module::t('app', 'Good'), 'value' => function (ShopOrder $model) { if ($model->shopBaskets) { $result = []; foreach ($model->shopBaskets as $shopBasket) { $money = \Yii::$app->money->intlFormatter()->format($shopBasket->money); $result[] = Html::a($shopBasket->name, $shopBasket->product->cmsContentElement->url, ['target' => '_blank']) . <<<HTML — {$shopBasket->quantity} {$shopBasket->measure_name} HTML; } return implode('<hr style="margin: 0px;"/>', $result); } }], ['class' => DataColumn::className(), 'format' => 'raw', 'attribute' => 'price', 'label' => \skeeks\cms\shop\Module::t('app', 'Sum'), 'value' => function (ShopOrder $model) { return \Yii::$app->money->intlFormatter()->format($model->money); }], ['class' => DataColumn::className(), 'filter' => ArrayHelper::map(CmsSite::find()->active()->all(), 'id', 'name'), 'attribute' => 'site_id', 'format' => 'raw', 'visible' => false, 'label' => \skeeks\cms\shop\Module::t('app', 'Site'), 'value' => function (ShopOrder $model) { return $model->site->name . " [{$model->site->code}]"; }]]], "view" => ['class' => AdminOneModelEditAction::className(), "name" => \Yii::t('app', "Информация"), "icon" => "glyphicon glyphicon-eye-open", "priority" => 5, "callback" => [$this, 'view']]]); }
public function init() { $this->name = \Yii::t('skeeks/shop/app', 'Surcharges'); $this->modelShowAttribute = "name"; $this->modelClassName = ShopExtra::className(); parent::init(); }
public function init() { $this->name = \Yii::t('skeeks/shop/app', 'Pyramid'); $this->modelShowAttribute = "id"; $this->modelClassName = ShopAffiliateTier::className(); parent::init(); }
public function init() { $this->name = \Yii::t('v3toys/skeeks', 'Статусы заказов'); $this->modelShowAttribute = "id"; $this->modelClassName = V3toysOrderStatus::className(); parent::init(); }
public function init() { $this->name = \Yii::t('skeeks/shop/app', 'Plans affiliate commissions'); $this->modelShowAttribute = "name"; $this->modelClassName = ShopAffiliatePlan::className(); parent::init(); }
public function init() { $this->name = "Управление email адресами"; $this->modelShowAttribute = "value"; $this->modelClassName = CmsUserEmail::className(); parent::init(); }
public function init() { $this->name = \Yii::t('skeeks/shop/app', 'Types of payers'); $this->modelShowAttribute = "name"; $this->modelClassName = ShopPersonType::className(); parent::init(); }
public function init() { $this->name = "Управление значениями свойств пользователя"; $this->modelShowAttribute = "value"; $this->modelClassName = CmsUserUniversalPropertyEnum::className(); parent::init(); }
public function init() { $this->name = \Yii::t('skeeks/shop/app', 'Delivery services'); $this->modelShowAttribute = "name"; $this->modelClassName = ShopDelivery::className(); parent::init(); }
public function init() { $this->name = \Yii::t('skeeks/shop/app', 'VAT rates'); $this->modelShowAttribute = "name"; $this->modelClassName = ShopVat::className(); parent::init(); }
public function init() { $this->name = "Управление значениями свойств"; $this->modelShowAttribute = "value"; $this->modelClassName = CmsContentPropertyEnum::className(); parent::init(); }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['name', 'code', ['value' => function (\skeeks\cms\models\CmsContentType $model) { $contents = \yii\helpers\ArrayHelper::map($model->cmsContents, 'id', 'name'); return implode(', ', $contents); }, 'label' => 'Контент'], 'priority']]]); }
public function init() { $this->name = \Yii::t('skeeks/form2/app', 'Control of properties'); $this->modelShowAttribute = "value"; $this->modelClassName = Form2FormPropertyEnum::className(); parent::init(); }
public function init() { $this->name = \Yii::t('v3toys/skeeks', 'Заказы в 1 клик'); $this->modelShowAttribute = "id"; $this->modelClassName = V3toysMessage::className(); parent::init(); }
public function init() { $this->name = \skeeks\cms\shop\Module::t('app', 'Control of property values payer'); $this->modelShowAttribute = "value"; $this->modelClassName = ShopPersonTypePropertyEnum::className(); parent::init(); }
public function init() { $this->name = "Управление доменами"; $this->modelShowAttribute = "domain"; $this->modelClassName = CmsSiteDomain::className(); parent::init(); }
public function init() { $this->name = \Yii::t('skeeks/shop/app', 'Discount goods'); $this->modelShowAttribute = "id"; $this->modelClassName = ShopDiscount::className(); parent::init(); }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ['columns' => [['attribute' => 'status', 'class' => \yii\grid\DataColumn::className(), 'filter' => \skeeks\cms\comments2\models\Comments2Message::$statuses, 'format' => 'raw', 'value' => function (\skeeks\cms\comments2\models\Comments2Message $model) { if ($model->status == \skeeks\cms\comments2\models\Comments2Message::STATUS_NEW) { $class = "default"; } else { if ($model->status == \skeeks\cms\comments2\models\Comments2Message::STATUS_PROCESSED) { $class = "warning"; } else { if ($model->status == \skeeks\cms\comments2\models\Comments2Message::STATUS_CANCELED) { $class = "danger"; } else { if ($model->status == \skeeks\cms\comments2\models\Comments2Message::STATUS_ALLOWED) { $class = "success"; } } } } return '<span class="label label-' . $class . '">' . \yii\helpers\ArrayHelper::getValue(\skeeks\cms\comments2\models\Comments2Message::$statuses, $model->status) . '</span>'; }], ['class' => \skeeks\cms\grid\CreatedAtColumn::className(), 'label' => 'Добавлен'], ['class' => \skeeks\cms\grid\CreatedByColumn::className()], ['attribute' => 'site_code', 'class' => \yii\grid\DataColumn::className(), 'filter' => \yii\helpers\ArrayHelper::map(\skeeks\cms\models\CmsSite::find()->all(), 'code', 'name'), 'value' => function (\skeeks\cms\comments2\models\Comments2Message $model) { return $model->site->name; }], ['attribute' => 'element_id', 'relation' => 'element', 'class' => \skeeks\cms\grid\CmsContentElementColumn::className()], ['filter' => \yii\helpers\ArrayHelper::map(\skeeks\cms\models\CmsContent::find()->all(), 'id', 'name'), 'attribute' => 'content_id', 'class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\comments2\models\Comments2Message $model) { return $model->element->cmsContent->name; }]]], "status-allowed-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\comments2\Module::t('app', 'Approve'), "eachCallback" => [$this, 'eachMultiStatusAllowed']], "status-canceled-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\comments2\Module::t('app', 'Reject'), "eachCallback" => [$this, 'eachMultiStatusCanceled']], "status-processed-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\comments2\Module::t('app', 'In progress'), "eachCallback" => [$this, 'eachMultiStatusProcessed']]]); }
public function init() { $this->name = "Управление телефонами"; $this->modelShowAttribute = "value"; $this->modelClassName = CmsUserPhone::className(); parent::init(); }
public function init() { $this->name = "Управление контентом"; $this->modelShowAttribute = "name"; $this->modelClassName = CmsContent::className(); parent::init(); }
public function init() { $this->name = \Yii::t('skeeks/shop/app', 'Order statuses'); $this->modelShowAttribute = "name"; $this->modelClassName = ShopOrderStatus::className(); parent::init(); }
public function init() { $this->name = \Yii::t('v3toys/skeeks', 'Города доставки'); $this->modelShowAttribute = "id"; $this->modelClassName = V3toysShippingCity::className(); parent::init(); }
public function init() { if (!$this->controller instanceof AdminModelEditorController) { throw new InvalidParamException(\Yii::t('app', 'This action is designed to work with the controller: ') . AdminModelEditorController::className()); } parent::init(); }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => ['value', ['class' => DataColumn::className(), 'value' => function (ShopTaxRate $model) { return $model->tax->name . " (" . $model->tax->site->name . ")"; }, 'attribute' => "tax_id"], ['class' => DataColumn::className(), 'value' => function (ShopTaxRate $model) { return $model->personType->name; }, 'attribute' => "person_type_id"], ['class' => BooleanColumn::className(), 'attribute' => "is_in_price"], ['class' => BooleanColumn::className(), 'attribute' => "active"], ['attribute' => "priority"]]]]); }
/** * @return string */ public function renderAfterTable() { $id = $this->id; GridViewStandartAsset::register($this->view); $checkbox = Html::checkbox('sx-select-full-all', false, ['class' => 'sx-select-full-all']); $multiActions = []; if ($this->adminController) { $multiActions = $this->adminController->getMultiActions(); } if (!$multiActions) { return parent::renderAfterTable(); } $options = ['id' => $this->id, 'enabledPjax' => $this->enabledPjax, 'pjaxId' => $this->pjax->id, 'requestPkParamName' => $this->adminController->requestPkParamName]; $optionsString = Json::encode($options); $gridJsObject = $this->getGridJsObject(); $this->view->registerJs(<<<JS {$gridJsObject} = new sx.classes.grid.Standart({$optionsString}); JS ); $buttons = ""; $additional = []; foreach ($multiActions as $action) { $additional[] = $action->registerForGrid($this); $buttons .= <<<HTML <button class="btn btn-default btn-sm sx-grid-multi-btn" data-id="{$action->id}"> <i class="{$action->icon}"></i> {$action->name} </button> HTML; } $additional = implode("", $additional); $this->afterTableLeft = <<<HTML {$checkbox} для всех <span class="sx-grid-multi-controlls"> {$buttons} </span> <span style="display: none;">{$additional}</span> HTML; $this->view->registerCss(<<<CSS .sx-grid-multi-controlls { margin-left: 20px; } CSS ); return parent::renderAfterTable(); }
/** * @inheritdoc */ public function actions() { $actions = ArrayHelper::merge(parent::actions(), ['update' => ['name' => \Yii::t('skeeks/form2/app', 'View'), "icon" => "glyphicon glyphicon-eye-open", "priority" => 0]]); ArrayHelper::remove($actions, 'create'); ArrayHelper::remove($actions, 'system'); ArrayHelper::remove($actions, 'related-properties'); return $actions; }
/** * @inheritdoc */ public function actions() { return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['name', 'priority', ['class' => DataColumn::className(), 'attribute' => "shopPaySystems", 'filter' => false, 'value' => function (ShopDelivery $model) { return implode(", ", ArrayHelper::map($model->shopPaySystems, 'id', 'name')); }], ['class' => DataColumn::className(), 'attribute' => "price", 'format' => 'raw', 'filter' => false, 'value' => function (ShopDelivery $model) { return \Yii::$app->money->intlFormatter()->format($model->money); }], ['class' => BooleanColumn::className(), 'attribute' => "active"]]]]); }
/** * @inheritdoc */ public function actions() { $actions = parent::actions(); unset($actions['create']); unset($actions['delete']); if (isset($actions['related-properties'])) { unset($actions['related-properties']); } return $actions; }