diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 406331a..a30350b 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -29,7 +29,7 @@ "children": [ { "id": 1004802002, - "pid": "/item", + "pid": "/item/attribute", "type": 3, "subtype": 1, "name": "Types", @@ -44,7 +44,7 @@ }, { "id": 1004802003, - "pid": "/item", + "pid": "/item/attribute", "type": 3, "subtype": 1, "name": "Values", @@ -134,7 +134,38 @@ "from": "ItemManagement", "permission": { "permission": 2, "category": null, "element": null }, "parent": 1004801001, - "children": [] + "children": [ + { + "id": 1004804002, + "pid": "/item/material", + "type": 3, + "subtype": 1, + "name": "List", + "uri": "{/base}/item/material/list?{?}", + "target": "self", + "icon": null, + "order": 5, + "from": "ItemManagement", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1004802001, + "children": [] + }, + { + "id": 1004804003, + "pid": "/item/material", + "type": 3, + "subtype": 1, + "name": "Create", + "uri": "{/base}/item/material/create?{?}", + "target": "self", + "icon": null, + "order": 10, + "from": "ItemManagement", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1004802001, + "children": [] + } + ] } ] }, @@ -340,7 +371,7 @@ "children": [ { "id": 1004808101, - "pid": "ac2ed3d0212c51b3ba19a5c862eca728c3cb9d18", + "pid": "/production/item", "type": 3, "subtype": 1, "name": "List", @@ -354,7 +385,7 @@ "children": [ { "id": 1004808301, - "pid": "ac2ed3d0212c51b3ba19a5c862eca728c3cb9d18", + "pid": "/production/item", "type": 3, "subtype": 1, "name": "Item", @@ -371,7 +402,7 @@ }, { "id": 1004808201, - "pid": "ac2ed3d0212c51b3ba19a5c862eca728c3cb9d18", + "pid": "/production/item", "type": 3, "subtype": 1, "name": "Create", diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index bfe7f72..6561f87 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -197,6 +197,41 @@ return [ ], ], ], + + '^.*/production/item/list(\?.*$|$)' => [ + [ + 'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementProductionList', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::READ, + 'state' => PermissionCategory::SALES_ITEM, + ], + ], + ], + '^.*/production/item/create(\?.*$|$)' => [ + [ + 'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementProductionCreate', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::SALES_ITEM, + ], + ], + ], + '^.*/production/item/view(\?.*$|$)' => [ + [ + 'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementProductionItem', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::READ, + 'state' => PermissionCategory::SALES_ITEM, + ], + ], + ], + '^.*/item/material/list(\?.*$|$)' => [ [ 'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemMaterialList', diff --git a/Controller/BackendController.php b/Controller/BackendController.php index a3fff9e..cd500ad 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -75,7 +75,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/ItemManagement/Theme/Backend/attribute-type-list'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004802001, $request, $response); /** @var \Modules\Attribute\Models\AttributeType[] $attributes */ $attributes = ItemAttributeTypeMapper::getAll() @@ -104,7 +104,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/ItemManagement/Theme/Backend/attribute-value-list'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004802001, $request, $response); /** @var \Modules\Attribute\Models\AttributeValue[] $attributes */ $attributes = ItemAttributeValueMapper::getAll() @@ -133,7 +133,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/ItemManagement/Theme/Backend/attribute-type'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004802001, $request, $response); /** @var \Modules\Attribute\Models\AttributeType $attribute */ $attribute = ItemAttributeTypeMapper::get() @@ -146,8 +146,10 @@ final class BackendController extends Controller ->where('ref', $attribute->id) ->execute(); - $view->data['attribute'] = $attribute; - $view->data['l11ns'] = $l11ns; + $view->data['attribute'] = $attribute; + $view->data['l11nValues'] = $l11ns; + + $view->data['l11nView'] = new \Web\Backend\Views\L11nView($this->app->l11nManager, $request, $response); return $view; } @@ -168,7 +170,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/ItemManagement/Theme/Backend/attribute-value'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004802001, $request, $response); /** @var \Modules\Attribute\Models\AttributeValue $attribute */ $attribute = ItemAttributeValueMapper::get() @@ -198,7 +200,7 @@ final class BackendController extends Controller { $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-list'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004803001, $request, $response); /** @var \Modules\ItemManagement\Models\Item[] $items */ $items = ItemMapper::getAll() @@ -273,6 +275,23 @@ final class BackendController extends Controller return $this->viewItemManagementItemList($request, $response, $data); } + /** + * Routing end-point for application behavior. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param array $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewItemManagementProductionList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface + { + return $this->viewItemManagementItemList($request, $response, $data); + } + /** * Routing end-point for application behavior. * @@ -349,6 +368,27 @@ final class BackendController extends Controller return $view; } + /** + * Routing end-point for application behavior. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param array $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewItemManagementProductionCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface + { + $view = new View($this->app->l11nManager, $request, $response); + $view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-create'); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004806001, $request, $response); + + return $view; + } + /** * Routing end-point for application behavior. * @@ -571,6 +611,23 @@ final class BackendController extends Controller return $this->viewItemManagementItem($request, $response, $data); } + /** + * Routing end-point for application behavior. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param array $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewItemManagementProductionItem(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface + { + return $this->viewItemManagementItem($request, $response, $data); + } + /** * Routing end-point for application behavior. * diff --git a/Theme/Backend/attribute-type.tpl.php b/Theme/Backend/attribute-type.tpl.php index 59c9afc..ebe5736 100755 --- a/Theme/Backend/attribute-type.tpl.php +++ b/Theme/Backend/attribute-type.tpl.php @@ -13,22 +13,24 @@ declare(strict_types=1); use Modules\Attribute\Models\AttributeValueType; -use phpOMS\Localization\ISO639Enum; +use Modules\Attribute\Models\NullAttributeType; +use phpOMS\Uri\UriFactory; $types = AttributeValueType::getConstants(); -$attribute = $this->data['attribute']; -$l11ns = $this->data['l11ns']; +$attribute = $this->data['attribute'] ?? new NullAttributeType(); + +$isNew = $attribute->id === 0; echo $this->data['nav']->render(); ?>
+
getHtml('Attribute', 'Attribute', 'Backend'); ?>
-
-
+
@@ -68,31 +70,23 @@ echo $this->data['nav']->render(); ?>
+
+ + + + + +
+
- -
-
-
getHtml('Language', '0', '0'); ?>download
- - - - - $value) : ++$c; ?> - -
- - getHtml('Language', '0', '0'); ?> - getHtml('Title', 'Attribute', 'Backend'); ?> -
close - settings - language)); ?> - content; ?> - - -
getHtml('Empty', '0', '0'); ?> - -
-
-
+ +
+ data['l11nView']->render( + $this->data['l11nValues'], + [], + '{/api}item/attribute/l11n' + ); + ?> +
\ No newline at end of file diff --git a/Theme/Backend/item-view.tpl.php b/Theme/Backend/item-view.tpl.php index 445413c..c87f851 100644 --- a/Theme/Backend/item-view.tpl.php +++ b/Theme/Backend/item-view.tpl.php @@ -547,32 +547,32 @@ echo $this->data['nav']->render();
- +
- +
- +
- +
- +
- +
@@ -704,7 +704,7 @@ echo $this->data['nav']->render();
- +
@@ -712,7 +712,7 @@ echo $this->data['nav']->render();
- +
@@ -721,21 +721,21 @@ echo $this->data['nav']->render();
- +
- +
- +
@@ -1104,7 +1104,7 @@ echo $this->data['nav']->render();
- +
@@ -1112,7 +1112,7 @@ echo $this->data['nav']->render();
- +
@@ -1121,21 +1121,21 @@ echo $this->data['nav']->render();
- +
- +
- +
diff --git a/Theme/Backend/material-view.tpl.php b/Theme/Backend/material-view.tpl.php index e417f66..0c73992 100644 --- a/Theme/Backend/material-view.tpl.php +++ b/Theme/Backend/material-view.tpl.php @@ -12,20 +12,20 @@ */ declare(strict_types=1); +use phpOMS\Localization\NullBaseStringL11nType; use phpOMS\Uri\UriFactory; /** @var \phpOMS\Localization\BaseStringL11nType */ -$type = $this->data['type']; +$type = $this->data['type'] ?? new NullBaseStringL11nType(); + +$isNew = $type->id === 0; /** @var \phpOMS\Views\View $this */ echo $this->data['nav']->render(); ?>
-
+
getHtml('Material'); ?>
@@ -36,7 +36,11 @@ echo $this->data['nav']->render(); ?>
- + + + + +