From 0ee6bbfeee34b3211c23f46c440175b0f568c7b9 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 9 Jan 2016 19:46:27 +0100 Subject: [PATCH] Templating --- Admin/Install/Navigation.install.json | 18 ++++++++- Controller.php | 22 ++++++++++- Theme/backend/department-list.tpl.php | 54 +++++++++++++++++++++++++++ Theme/backend/staff-create.tpl.php | 5 +++ 4 files changed, 97 insertions(+), 2 deletions(-) diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index eefd435..e173810 100644 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -63,7 +63,7 @@ }, { "id": 1002403001, - "pid": "29a67db2902a784f66b5e896efd84b0004be2087", + "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", "type": 2, "subtype": 1, "name": "Departments", @@ -75,6 +75,22 @@ "permission": null, "parent": 1002401001, "children": [ + { + "id": 1002403101, + "pid": "5696bf086bb04c219b1a2654ad9df177c35be669", + "type": 3, + "subtype": 1, + "name": "List", + "uri": "/{/lang}/backend/hr/department/list", + "target": "self", + "icon": null, + "order": 1, + "from": "HumanResourceManagement", + "permission": null, + "parent": 1002403001, + "children": [ + ] + } ] } ] diff --git a/Controller.php b/Controller.php index e2975d3..9af34e0 100644 --- a/Controller.php +++ b/Controller.php @@ -98,6 +98,7 @@ class Controller extends ModuleAbstract implements WebInterface */ protected static $routes = [ '^.*/backend/hr/staff/list.*$' => [['dest' => '\Modules\HumanResourceManagement\Controller:viewHrList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/hr/staff/create.*$' => [['dest' => '\Modules\HumanResourceManagement\Controller:viewHrCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],], '^.*/backend/hr/department/list.*$' => [['dest' => '\Modules\HumanResourceManagement\Controller:viewHrDepartmentList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], ]; @@ -120,6 +121,25 @@ class Controller extends ModuleAbstract implements WebInterface return $view; } + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewHrCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-create'); + $view->addData('nav', $this->createNavigation(1002402001, $request, $response)); + + return $view; + } + /** * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -134,7 +154,7 @@ class Controller extends ModuleAbstract implements WebInterface { $view = new View($this->app, $request, $response); $view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/department-list'); - $view->addData('nav', $this->createNavigation(1003001001, $request, $response)); + $view->addData('nav', $this->createNavigation(1002403001, $request, $response)); return $view; } diff --git a/Theme/backend/department-list.tpl.php b/Theme/backend/department-list.tpl.php index e69de29..cac3101 100644 --- a/Theme/backend/department-list.tpl.php +++ b/Theme/backend/department-list.tpl.php @@ -0,0 +1,54 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +/** + * @var \phpOMS\Views\View $this + */ + +$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response); +$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); + +$footerView->setPages(1 / 25); +$footerView->setPage(1); +$footerView->setResults(1); + +echo $this->getData('nav')->render(); ?> + +
+ + + + + + + $value) : $c++; + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?id=' . $value->getId()); ?> + +
l11n->lang['HumanResourceManagement']['Departments']; ?>
l11n->lang[0]['ID']; ?> + l11n->lang['HumanResourceManagement']['Name']; ?> + l11n->lang['HumanResourceManagement']['Employees']; ?> + l11n->lang['HumanResourceManagement']['Parent']; ?> +
render(); ?> +
getId(); ?> + getName(); ?> + + + + + +
l11n->lang[0]['Empty']; ?> + +
+
diff --git a/Theme/backend/staff-create.tpl.php b/Theme/backend/staff-create.tpl.php index ac22ab8..3b9344c 100644 --- a/Theme/backend/staff-create.tpl.php +++ b/Theme/backend/staff-create.tpl.php @@ -13,4 +13,9 @@ * @version 1.0.0 * @link http://orange-management.com */ +/** + * @var \phpOMS\Views\View $this + */ + echo $this->getData('nav')->render(); ?> +