Templating

This commit is contained in:
Dennis Eichhorn 2016-01-09 19:46:27 +01:00
parent fefddd601f
commit 0ee6bbfeee
4 changed files with 97 additions and 2 deletions

View File

@ -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": [
]
}
]
}
]

View File

@ -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 <d.eichhorn@oms.com>
*/
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;
}

View File

@ -0,0 +1,54 @@
<?php
/**
* Orange Management
*
* PHP Version 7.0
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @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(); ?>
<section class="box w-100">
<table class="table">
<caption><?= $this->l11n->lang['HumanResourceManagement']['Departments']; ?></caption>
<thead>
<tr>
<td><?= $this->l11n->lang[0]['ID']; ?>
<td class="wf-100"><?= $this->l11n->lang['HumanResourceManagement']['Name']; ?>
<td><?= $this->l11n->lang['HumanResourceManagement']['Employees']; ?>
<td><?= $this->l11n->lang['HumanResourceManagement']['Parent']; ?>
<tfoot>
<tr><td colspan="4"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->l11n->lang[0]['Empty']; ?>
<?php endif; ?>
</table>
</section>

View File

@ -13,4 +13,9 @@
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>