From e8adec8e0d15c2bc55c6df966d07361d0220792d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 29 Mar 2024 15:25:59 +0000 Subject: [PATCH] started with template fixes --- Admin/Routes/Web/Backend.php | 10 ++-- Controller/BackendController.php | 3 + Theme/Backend/asset-list.tpl.php | 2 +- Theme/Backend/asset-view.tpl.php | 2 +- Theme/Backend/attribute-type-list.tpl.php | 71 ----------------------- 5 files changed, 10 insertions(+), 78 deletions(-) delete mode 100644 Theme/Backend/attribute-type-list.tpl.php diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index b9f0cc1..c5f63dc 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -6,9 +6,9 @@ use phpOMS\Account\PermissionType; use phpOMS\Router\RouteVerb; return [ - '^.*/accounting/attribute/type/list(\?.*$|$)' => [ + '^.*/accounting/asset/attribute/type/list(\?.*$|$)' => [ [ - 'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeTypeList', + 'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementAttributeTypeList', 'verb' => RouteVerb::GET, 'permission' => [ 'module' => BackendController::NAME, @@ -17,9 +17,9 @@ return [ ], ], ], - '^.*/accounting/attribute/type(\?.*$|$)' => [ + '^.*/accounting/asset/attribute/type/view(\?.*$|$)' => [ [ - 'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeType', + 'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementAttributeType', 'verb' => RouteVerb::GET, 'permission' => [ 'module' => BackendController::NAME, @@ -79,7 +79,7 @@ return [ 'verb' => RouteVerb::GET, 'permission' => [ 'module' => BackendController::MODULE_NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::CREATE, 'state' => PermissionCategory::ASSET, ], ], diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 9c4f2ab..7939184 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -86,8 +86,11 @@ final class BackendController extends Controller /** @var \Modules\Attribute\Models\AttributeType $attribute */ $attribute = AssetAttributeTypeMapper::get() ->with('l11n') + ->with('defaults') + ->with('defaults/l11n') ->where('id', (int) $request->getData('id')) ->where('l11n/language', $response->header->l11n->language) + ->where('defaults/l11n/language', [$response->header->l11n->language, null]) ->execute(); $l11ns = AssetAttributeTypeL11nMapper::getAll() diff --git a/Theme/Backend/asset-list.tpl.php b/Theme/Backend/asset-list.tpl.php index d2c6aa3..96ba322 100644 --- a/Theme/Backend/asset-list.tpl.php +++ b/Theme/Backend/asset-list.tpl.php @@ -85,7 +85,7 @@ echo $this->data['nav']->render(); ?> ?> - printHtml((string) $value->id); ?> + id; ?> getHtml(':status' . $value->status); ?> printHtml($value->name); ?> printHtml($value->type->getL11n()); ?> diff --git a/Theme/Backend/asset-view.tpl.php b/Theme/Backend/asset-view.tpl.php index 3b3eff4..1d03aa6 100644 --- a/Theme/Backend/asset-view.tpl.php +++ b/Theme/Backend/asset-view.tpl.php @@ -144,7 +144,7 @@ echo $this->data['nav']->render(); $asset->attributes, $this->data['attributeTypes'] ?? [], $this->data['units'] ?? [], - '{/api}fleet/asset/attribute', + '{/api}fleet/asset/attribute?csrf={$CSRF}', $asset->id ); ?> diff --git a/Theme/Backend/attribute-type-list.tpl.php b/Theme/Backend/attribute-type-list.tpl.php deleted file mode 100644 index 7963f8a..0000000 --- a/Theme/Backend/attribute-type-list.tpl.php +++ /dev/null @@ -1,71 +0,0 @@ -data['attributes']; - -echo $this->data['nav']->render(); ?> - -
-
-
-
getHtml('AttributeTypes', 'Attribute', 'Backend'); ?>download
-
- - - - - $value) : ++$count; - $url = UriFactory::build('{/base}/accounting/asset/attribute/type?{?}&id=' . $value->id); - ?> - -
getHtml('ID', '0', '0'); ?> - - - - getHtml('Name'); ?> - - - -
id; ?> - printHtml($value->getL11n()); ?> - - -
getHtml('Empty', '0', '0'); ?> - -
-
-
-
-