예제 #1
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     $actions = parent::actions();
     unset($actions['create']);
     unset($actions['update']);
     return $actions;
 }
예제 #2
0
    /**
     * @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']]]);
    }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     $actions = ArrayHelper::merge(parent::actions(), ['index' => ["modelSearchClassName" => ShopCmsContentElementSearch::className(), "dataProviderCallback" => function (ActiveDataProvider $dataProvider) {
         $query = $dataProvider->query;
         /**
          * @var ActiveQuery $query
          */
         //$query->select(['app_company.*', 'count(`app_company_officer_user`.`id`) as countOfficer']);
         $query->with('image');
         $query->with('cmsTree');
         $query->with('cmsContentElementTrees');
         $query->with('cmsContent');
         $query->with('relatedProperties');
         $query->with('relatedElementProperties');
         $query->with('cmsContentElementTrees.tree');
         $query->with('shopProduct');
         $query->with('shopProduct.baseProductPrice');
         //$query->with('shopProduct.minProductPrice');
     }], "create" => ['class' => AdminModelEditorCreateAction::className(), "callback" => [$this, 'create']], "update" => ['class' => AdminOneModelEditAction::className(), "callback" => [$this, 'update']], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/shop/app', 'Activate'), "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/shop/app', 'Deactivate'), "eachCallback" => [$this, 'eachMultiInActivate']], "change-tree-multi" => ['class' => AdminMultiDialogModelEditAction::class, "name" => \Yii::t('skeeks/shop/app', 'The main section'), "viewDialog" => "@skeeks/cms/views/admin-cms-content-element/change-tree-form", "eachCallback" => [\Yii::$app->createController('/cms/admin-cms-content-element')[0], 'eachMultiChangeTree']], "change-trees-multi" => ['class' => AdminMultiDialogModelEditAction::class, "name" => \Yii::t('skeeks/shop/app', 'Related topics'), "viewDialog" => "@skeeks/cms/views/admin-cms-content-element/change-trees-form", "eachCallback" => [\Yii::$app->createController('/cms/admin-cms-content-element')[0], 'eachMultiChangeTrees']], "rp" => ['class' => AdminMultiDialogModelEditAction::class, "name" => \Yii::t('skeeks/shop/app', 'Properties'), "viewDialog" => "@skeeks/cms/views/admin-cms-content-element/multi-rp", "eachCallback" => [\Yii::$app->createController('/cms/admin-cms-content-element')[0], 'eachRelatedProperties']]]);
     if (isset($actions['related-properties'])) {
         unset($actions['related-properties']);
     }
     if (isset($actions['shop'])) {
         unset($actions['shop']);
     }
     return $actions;
 }
예제 #4
0
 /**
  * @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']]]);
 }
 /**
  * @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']]]);
 }
예제 #6
0
 public function actions()
 {
     $actions = ArrayHelper::merge(parent::actions(), ['change-password' => ["class" => AdminOneModelEditAction::className(), "name" => "Изменение пароля", "icon" => "glyphicon glyphicon-cog", "callback" => [$this, 'actionChangePassword']], 'file-manager' => ["class" => AdminOneModelEditAction::className(), "name" => "Личные файлы", "icon" => "glyphicon glyphicon-folder-open", "callback" => [$this, 'actionFileManager']]]);
     unset($actions['delete']);
     unset($actions['create']);
     unset($actions['index']);
     return $actions;
 }
 /**
  * @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;
 }
예제 #8
0
 /**
  * @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"]]]]);
 }
예제 #9
0
 /**
  * @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;
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => [['class' => DataColumn::className(), 'attribute' => 'name', 'format' => 'raw', 'value' => function (KladrLocation $model) {
         if ($model->parent_id) {
             return $model->fullName . " <small>(" . implode(", ", ArrayHelper::map($model->parents, 'id', 'fullName')) . ") </small>";
         } else {
             return $model->fullName;
         }
     }], ['class' => DataColumn::className(), 'attribute' => 'type', 'filter' => KladrLocation::possibleTypes(), 'value' => function (KladrLocation $model) {
         return $model->typeName;
     }]]], 'update-database' => ["class" => AdminAction::className(), "name" => "Импорт местоположений", "icon" => "glyphicon glyphicon-paperclip", "callback" => [$this, 'actionUpdateDatabase']]]);
 }
예제 #12
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $activeDataProvider) {
         $activeDataProvider->query->andWhere(['type' => ShopDiscount::TYPE_DEFAULT]);
     }, "gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['id', ['attribute' => 'name'], ['attribute' => 'value', 'class' => DataColumn::className(), 'value' => function (ShopDiscount $shopDiscount) {
         if ($shopDiscount->value_type == ShopDiscount::VALUE_TYPE_P) {
             return \Yii::$app->formatter->asPercent($shopDiscount->value / 100);
         } else {
             $money = Money::fromString((string) $shopDiscount->value, $shopDiscount->currency_code);
             return \Yii::$app->money->intlFormatter()->format($money);
         }
     }], ['attribute' => 'active', 'class' => BooleanColumn::className()], ['attribute' => 'active_from', 'class' => DateTimeColumnData::className()], ['attribute' => 'active_to', 'class' => DateTimeColumnData::className()], ['class' => UpdatedByColumn::className()], ['class' => UpdatedAtColumn::className()], 'priority']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $dataProvider) {
         $query = $dataProvider->query;
         /**
          * @var ActiveQuery $query
          */
         //$query->select(['app_company.*', 'count(`app_company_officer_user`.`id`) as countOfficer']);
         $query->with('image');
         $query->with('cmsTree');
         $query->with('cmsContentElementTrees');
         $query->with('cmsContentElementTrees.tree');
     }], 'settings' => ['class' => AdminModelEditorAction::className(), 'name' => \skeeks\cms\shop\Module::t('app', 'Settings'), "icon" => "glyphicon glyphicon-cog"], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'Activate'), "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'Deactivate'), "eachCallback" => [$this, 'eachMultiInActivate']], "change-tree-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'The main section'), "viewDialog" => "@skeeks/cms/views/admin-cms-content-element/change-tree-form", "eachCallback" => [\Yii::$app->createController('/cms/admin-cms-content-element')[0], 'eachMultiChangeTree']], "change-trees-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'Related topics'), "viewDialog" => "@skeeks/cms/views/admin-cms-content-element/change-trees-form", "eachCallback" => [\Yii::$app->createController('/cms/admin-cms-content-element')[0], 'eachMultiChangeTrees']]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['create' => ['visible' => false], 'update' => ['visible' => false], 'system' => ['visible' => false], 'index' => ["columns" => [['class' => CreatedAtColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'Date views')], ['class' => DataColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'User'), 'value' => function (ShopViewedProduct $shopViewedProduct) {
         if ($shopViewedProduct->shopFuser->user) {
             return $shopViewedProduct->shopFuser->user->displayName;
         }
         return \skeeks\cms\shop\Module::t('app', 'Not authorized') . " [{$shopViewedProduct->shopFuser->id}]";
     }], ['class' => DataColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'Good'), 'value' => function (ShopViewedProduct $shopViewedProduct) {
         if ($shopViewedProduct->shopProduct) {
             return $shopViewedProduct->shopProduct->cmsContentElement->name;
         }
         return null;
     }]]]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $dataProvider) {
         $query = $dataProvider->query;
         /**
          * @var ActiveQuery $query
          */
         //$query->select(['app_company.*', 'count(`app_company_officer_user`.`id`) as countOfficer']);
         $query->with('image');
         $query->with('cmsTree');
         $query->with('cmsContentElementTrees');
         $query->with('cmsContentElementTrees.tree');
     }], 'settings' => ['class' => AdminModelEditorAction::className(), 'name' => 'Настройки', "icon" => "glyphicon glyphicon-cog"], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']], "change-tree-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => "Основной раздел", "viewDialog" => "change-tree-form", "eachCallback" => [$this, 'eachMultiChangeTree']], "change-trees-multi" => ['class' => AdminMultiDialogModelEditAction::className(), "name" => "Дополнительные разделы", "viewDialog" => "change-trees-form", "eachCallback" => [$this, 'eachMultiChangeTrees']]]);
 }
예제 #16
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $dataProvider) {
         $query = $dataProvider->query;
         /**
          * @var \yii\db\ActiveQuery $query
          */
         //$query->select(['app_company.*', 'count(`app_company_officer_user`.`id`) as countOfficer']);
         $query->groupBy([CmsUser::tableName() . '.id']);
         $query->innerJoin(ShopBuyer::tableName(), '`shop_buyer`.`cms_user_id` = `cms_user`.`id`');
     }, "columns" => [['class' => UserColumnData::className(), 'attribute' => 'id', 'label' => \skeeks\cms\shop\Module::t('app', 'Buyer')], 'email', 'phone', ['class' => DateTimeColumnData::className(), 'attribute' => 'created_at', 'label' => \skeeks\cms\shop\Module::t('app', 'Date of registration')], ['class' => DataColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'Date of last order'), 'value' => function (CmsUser $model) {
         if ($order = ShopOrder::find()->where(['user_id' => $model->id])->orderBy(['created_at' => SORT_DESC])->one()) {
             return \Yii::$app->formatter->asDatetime($order->created_at);
         }
         return null;
     }], ['class' => DataColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'The amount paid orders'), 'value' => function (CmsUser $model) {
         return ShopOrder::find()->where(['user_id' => $model->id, 'payed' => Cms::BOOL_Y])->count();
     }]]]]);
 }
예제 #17
0
    /**
     * @inheritdoc
     */
    public function actions()
    {
        return ArrayHelper::merge(parent::actions(), ['index' => ["dataProviderCallback" => function (ActiveDataProvider $dataProvider) {
            $query = $dataProvider->query;
            /**
             * @var ActiveQuery $query
             */
            //$query->select(['app_company.*', 'count(`app_company_officer_user`.`id`) as countOfficer']);
            $query->groupBy(['shop_fuser.id']);
            $query->with('user');
            $query->with('personType');
            $query->with('buyer');
            $query->with('shopBaskets');
            $query->with('shopBaskets.product');
        }, "columns" => [['class' => UpdatedAtColumn::className()], ['class' => DataColumn::className(), 'filter' => false, 'format' => raw, 'label' => \skeeks\cms\shop\Module::t('app', 'User'), 'value' => function (ShopFuser $model) {
            return $model->user ? (new AdminBuyerUserWidget(['user' => $model->user]))->run() : \skeeks\cms\shop\Module::t('app', 'Not authorized');
        }], ['class' => DataColumn::className(), 'filter' => false, 'format' => 'raw', 'label' => \skeeks\cms\shop\Module::t('app', 'Profile of buyer'), 'value' => function (ShopFuser $model) {
            if (!$model->buyer) {
                return null;
            }
            return Html::a($model->buyer->name . " [{$model->buyer->id}]", UrlHelper::construct('shop/admin-buyer/related-properties', ['pk' => $model->buyer->id])->enableAdmin()->toString());
        }], ['class' => DataColumn::className(), 'filter' => ArrayHelper::map(ShopPersonType::find()->active()->all(), 'id', 'name'), 'attribute' => 'person_type_id', 'label' => \skeeks\cms\shop\Module::t('app', 'Profile type'), 'value' => function (ShopFuser $model) {
            return $model->personType->name;
        }], ['class' => DataColumn::className(), 'filter' => false, 'label' => \skeeks\cms\shop\Module::t('app', 'Price of basket'), 'value' => function (ShopFuser $model) {
            return \Yii::$app->money->intlFormatter()->format($model->money);
        }], ['class' => DataColumn::className(), 'filter' => false, 'label' => \skeeks\cms\shop\Module::t('app', 'Number of items'), 'value' => function (ShopFuser $model) {
            return $model->countShopBaskets;
        }], ['class' => DataColumn::className(), 'filter' => false, 'format' => 'raw', 'label' => \skeeks\cms\shop\Module::t('app', 'Good'), 'value' => function (ShopFuser $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}) — {$money}
HTML;
                }
                return implode('<hr />', $result);
            }
        }], ['class' => DataColumn::className(), 'filter' => ArrayHelper::map(CmsSite::find()->active()->all(), 'id', 'name'), 'attribute' => 'site_id', 'format' => 'raw', 'label' => \skeeks\cms\shop\Module::t('app', 'Site'), 'value' => function (ShopFuser $model) {
            return $model->site->name . " [{$model->site->code}]";
        }], ['class' => CreatedAtColumn::className()]]]]);
    }
예제 #18
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => [], "columns" => [['class' => \yii\grid\SerialColumn::className()], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'name', 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
         $widget = new \skeeks\cms\modules\admin\widgets\AdminImagePreviewWidget(['image' => $shopBasket->product->cmsContentElement->image]);
         return $widget->run();
     }], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'name', 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
         if ($shopBasket->product) {
             return Html::a($shopBasket->name, $shopBasket->product->cmsContentElement->url, ['target' => '_blank', 'titla' => \Yii::t('skeeks/shop/app', 'Watch Online'), 'data-pjax' => 0]);
         } else {
             return $shopBasket->name;
         }
     }], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'quantity', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
         return $shopBasket->quantity . " " . $shopBasket->measure_name;
     }], ['class' => \yii\grid\DataColumn::className(), 'label' => \Yii::t('skeeks/shop/app', 'Price'), 'attribute' => 'price', 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
         if ($shopBasket->discount_value) {
             return "<span style='text-decoration: line-through;'>" . \Yii::$app->money->intlFormatter()->format($shopBasket->moneyOriginal) . "</span><br />" . Html::tag('small', $shopBasket->notes) . "<br />" . \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small', \Yii::t('skeeks/shop/app', 'Discount') . ": " . $shopBasket->discount_value);
         } else {
             return \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small', $shopBasket->notes);
         }
     }], ['class' => \yii\grid\DataColumn::className(), 'label' => \Yii::t('skeeks/shop/app', 'Sum'), 'attribute' => 'price', 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
         return \Yii::$app->money->intlFormatter()->format($shopBasket->money->multiply($shopBasket->quantity));
     }]]]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ["update" => ["modelScenario" => RelatedPropertyModel::SCENARIO_UPDATE_CONFIG]]);
 }
예제 #20
0
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ['class' => AdminAction::className(), 'callback' => [$this, 'actionIndex']], 'view' => ["class" => AdminOneModelEditAction::className(), "name" => "Смотреть", "icon" => "glyphicon glyphicon-eye-open", "callback" => [$this, "actionView"]], 'create' => ['class' => AdminAction::className(), 'callback' => [$this, 'actionCreate']], "update-data" => ["class" => AdminAction::className(), "name" => \Yii::t('app', "Update privileges"), "icon" => "glyphicon glyphicon-retweet", "method" => "post", "request" => "ajax", 'callback' => [$this, 'actionUpdateData']]]);
 }
 public function actions()
 {
     $actions = ArrayHelper::merge(parent::actions(), ['update-all' => ["class" => AdminAction::className(), "name" => \Yii::t('skeeks/money', "Update all currencies"), "icon" => "glyphicon glyphicon-paperclip", "callback" => [$this, 'actionUpdateAll']], 'update-course' => ["class" => AdminAction::className(), "name" => \Yii::t('skeeks/money', "Refresh rate"), "icon" => "glyphicon glyphicon-paperclip", "callback" => [$this, 'actionUpdateCourse']], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/money', "Activate"), "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/money', "Deactivate"), "eachCallback" => [$this, 'eachMultiInActivate']]]);
     return $actions;
 }
예제 #22
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => [['class' => \skeeks\cms\grid\ImageColumn2::className()], 'name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "def"], 'priority']], "def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "По умолчанию", "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]);
 }
예제 #23
0
 public function actions()
 {
     $actions = ArrayHelper::merge(parent::actions(), ['index' => ['class' => AdminAction::className(), 'name' => 'Разделы', 'viewParams' => $this->indexData()], 'create' => ['visible' => false], "update" => ['class' => AdminOneModelEditAction::className(), "callback" => [$this, 'update']]]);
     unset($actions['create']);
     return $actions;
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ["def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \Yii::t('skeeks/shop/app', 'Default'), "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0]]);
 }
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['create' => ['callback' => [$this, 'create']], 'update' => ['callback' => [$this, 'update']]]);
 }
예제 #26
0
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => ['displayName', ['class' => \skeeks\cms\grid\UserColumnData::className(), 'attribute' => "user_id"], ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => "created_at"]]], 'create' => ['visible' => false]]);
 }
예제 #27
0
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ['class' => AdminAction::className(), 'callback' => [$this, 'actionIndex']], 'view' => ["class" => AdminOneModelEditAction::className(), "name" => \Yii::t('app', "Watch"), "icon" => "glyphicon glyphicon-eye-open", "callback" => [$this, "actionView"]], 'create' => ['class' => AdminAction::className(), 'callback' => [$this, 'actionCreate']], "update" => ['class' => AdminOneModelEditAction::className(), 'callback' => [$this, 'actionUpdate']]]);
 }
예제 #28
0
 public function actions()
 {
     $actions = parent::actions();
     ArrayHelper::remove($actions, 'create');
     return $actions;
 }
예제 #29
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["gridConfig" => ['settingsData' => ['order' => SORT_ASC, 'orderBy' => "priority"]], "columns" => ['code', 'name', 'priority', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "def"]]], "def-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => \skeeks\cms\shop\Module::t('app', 'Default'), "eachCallback" => [$this, 'eachMultiDef'], "priority" => 0]]);
 }
예제 #30
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['index' => ["columns" => ['id', 'name', 'description', ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => "last_exec_at"], ['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => "next_exec_at"], ['attribute' => "agent_interval"], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => "active"]]], "activate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Активировать", "eachCallback" => [$this, 'eachMultiActivate']], "inActivate-multi" => ['class' => AdminMultiModelEditAction::className(), "name" => "Деактивировать", "eachCallback" => [$this, 'eachMultiInActivate']]]);
 }