diff --git a/src/controllers/AdminShopBrandController.php b/src/controllers/AdminShopBrandController.php index 7e1c390..daf0485 100644 --- a/src/controllers/AdminShopBrandController.php +++ b/src/controllers/AdminShopBrandController.php @@ -10,7 +10,9 @@ use skeeks\cms\backend\controllers\BackendModelStandartController; use skeeks\cms\grid\BooleanColumn; +use skeeks\cms\grid\DateTimeColumnData; use skeeks\cms\grid\ImageColumn2; +use skeeks\cms\grid\UserColumnData; use skeeks\cms\helpers\Image; use skeeks\cms\models\CmsCountry; use skeeks\cms\queryfilters\QueryFiltersEvent; @@ -40,15 +42,15 @@ public function init() $this->modelShowAttribute = "name"; $this->modelClassName = ShopBrand::class; - $this->generateAccessActions = false; - $this->permissionName = CmsManager::PERMISSION_ADMIN_ACCESS; + $this->generateAccessActions = true; + /*$this->permissionName = CmsManager::PERMISSION_ADMIN_ACCESS;*/ - $this->accessCallback = function () { + /*$this->accessCallback = function () { if (!\Yii::$app->skeeks->site->is_default) { return false; } return \Yii::$app->user->can(CmsManager::PERMISSION_ROLE_ADMIN_ACCESS); - }; + };*/ parent::init(); @@ -126,7 +128,7 @@ public function actions() ], 'grid' => [ 'defaultOrder' => [ - 'name' => SORT_ASC, + 'created_at' => SORT_DESC, ], /*'sortAttributes' => [ 'countProducts' => [ @@ -141,18 +143,28 @@ public function actions() 'checkbox', 'actions', + 'created_at', 'custom', 'country_alpha2', 'countProducts', 'is_active', - 'priority', + 'created_by', 'view', ], 'columns' => [ + 'created_at' => [ + 'class' => DateTimeColumnData::class + ], + 'updated_at' => [ + 'class' => DateTimeColumnData::class + ], + 'created_by' => [ + 'class' => UserColumnData::class + ], 'countProducts' => [ 'format' => 'raw', 'value' => function (ShopBrand $shopBrand) { diff --git a/src/controllers/AdminShopCollectionController.php b/src/controllers/AdminShopCollectionController.php index c4daaf7..e5c9b4b 100644 --- a/src/controllers/AdminShopCollectionController.php +++ b/src/controllers/AdminShopCollectionController.php @@ -10,7 +10,9 @@ use skeeks\cms\backend\controllers\BackendModelStandartController; use skeeks\cms\grid\BooleanColumn; +use skeeks\cms\grid\DateTimeColumnData; use skeeks\cms\grid\ImageColumn2; +use skeeks\cms\grid\UserColumnData; use skeeks\cms\helpers\Image; use skeeks\cms\models\CmsCountry; use skeeks\cms\queryfilters\QueryFiltersEvent; @@ -42,15 +44,15 @@ public function init() $this->modelShowAttribute = "name"; $this->modelClassName = ShopCollection::class; - $this->generateAccessActions = false; - $this->permissionName = CmsManager::PERMISSION_ROLE_ADMIN_ACCESS; + $this->generateAccessActions = true; + /*$this->permissionName = CmsManager::PERMISSION_ROLE_ADMIN_ACCESS;*/ - $this->accessCallback = function () { + /*$this->accessCallback = function () { if (!\Yii::$app->skeeks->site->is_default) { return false; } return \Yii::$app->user->can(CmsManager::PERMISSION_ROLE_ADMIN_ACCESS); - }; + };*/ parent::init(); @@ -127,7 +129,7 @@ public function actions() ], 'grid' => [ 'defaultOrder' => [ - 'name' => SORT_ASC, + 'created_at' => SORT_DESC, ], /*'sortAttributes' => [ 'countProducts' => [ @@ -142,18 +144,29 @@ public function actions() 'checkbox', 'actions', + 'created_at', 'custom', 'brand', 'countProducts', 'is_active', - 'priority', + 'created_by', 'view', ], 'columns' => [ + 'created_at' => [ + 'class' => DateTimeColumnData::class + ], + 'updated_at' => [ + 'class' => DateTimeColumnData::class + ], + 'created_by' => [ + 'class' => UserColumnData::class + ], + 'countProducts' => [ 'format' => 'raw', 'value' => function (ShopCollection $shopBrand) {