mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-10 18:08:42 +00:00
Show departments from organization
This commit is contained in:
parent
e05709a5f0
commit
a9fc6e942e
|
|
@ -19,7 +19,9 @@ use phpOMS\Message\ResponseAbstract;
|
||||||
use phpOMS\Module\ModuleAbstract;
|
use phpOMS\Module\ModuleAbstract;
|
||||||
use phpOMS\Module\WebInterface;
|
use phpOMS\Module\WebInterface;
|
||||||
use phpOMS\Views\View;
|
use phpOMS\Views\View;
|
||||||
|
|
||||||
use Modules\HumanResourceManagement\Models\EmployeeMapper;
|
use Modules\HumanResourceManagement\Models\EmployeeMapper;
|
||||||
|
use Modules\Organization\Models\DepartmentMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Human Resources controller class.
|
* Human Resources controller class.
|
||||||
|
|
@ -127,6 +129,8 @@ class Controller extends ModuleAbstract implements WebInterface
|
||||||
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/department-list');
|
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/department-list');
|
||||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002403001, $request, $response));
|
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002403001, $request, $response));
|
||||||
|
|
||||||
|
$view->setData('departments', DepartmentMapper::getAll());
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ $footerView->setPages(1 / 25);
|
||||||
$footerView->setPage(1);
|
$footerView->setPage(1);
|
||||||
$footerView->setResults(1);
|
$footerView->setResults(1);
|
||||||
|
|
||||||
|
$departments = $this->getData('departments');
|
||||||
|
|
||||||
echo $this->getData('nav')->render(); ?>
|
echo $this->getData('nav')->render(); ?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
@ -38,14 +40,13 @@ echo $this->getData('nav')->render(); ?>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr><td colspan="4"><?= $footerView->render(); ?>
|
<tr><td colspan="4"><?= $footerView->render(); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $c = 0; foreach ([] as $key => $value) : $c++;
|
<?php $c = 0; foreach ($departments as $key => $value) : $c++;
|
||||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
|
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getId(), ENT_COMPAT, 'utf-8'); ?></a>
|
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getId(), ENT_COMPAT, 'utf-8'); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getName(), ENT_COMPAT, 'utf-8'); ?></a>
|
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getName(), ENT_COMPAT, 'utf-8'); ?></a>
|
||||||
<td>
|
<td>
|
||||||
<td>
|
<td><a href="<?= $url; ?>"><?= htmlspecialchars($value->getParent()->getName(), ENT_COMPAT, 'utf-8'); ?></a>
|
||||||
<td>
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if($c === 0) : ?>
|
<?php if($c === 0) : ?>
|
||||||
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
|
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user