diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 12236ba..6051baf 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -26,7 +26,23 @@ "from": "Sales", "permission": { "permission": 2, "type": null, "element": null }, "parent": 1001601001, - "children": [] + "children": [ + { + "id": 1001602002, + "pid": "/sales/analysis", + "type": 3, + "subtype": 1, + "name": "Dashboard", + "uri": "{/prefix}sales/analysis?{?}", + "target": "self", + "icon": null, + "order": 1, + "from": "Sales", + "permission": { "permission": 2, "type": null, "element": null }, + "parent": 1001602001, + "children": [] + } + ] } ] } diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index f0b60b4..411bef2 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -1,3 +1,20 @@ [ + [ + 'dest' => '\Modules\Sales\Controller\BackendController:viewDashboard', + 'verb' => RouteVerb::GET, + 'permission' => [ + 'module' => BackendController::MODULE_NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionState::ANALYSIS, + ], + ], + ], +]; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 0beac62..2b0bca1 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -24,4 +24,15 @@ namespace Modules\Sales\Controller; */ final class BackendController extends Controller { + /** + * {@inheritdoc} + */ + public function viewDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app->l11nManager, $request, $response); + $view->setTemplate('/Modules/Sales/Theme/Backend/sales-analysis-dashboard'); + $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response)); + + return $view; + } } diff --git a/Models/PermissionState.php b/Models/PermissionState.php new file mode 100644 index 0000000..035917e --- /dev/null +++ b/Models/PermissionState.php @@ -0,0 +1,32 @@ +getData('nav')->render(); ?> \ No newline at end of file