Continue with getter/setter cleanup

This commit is contained in:
Dennis Eichhorn 2023-05-30 15:44:19 +02:00
parent cc92c59281
commit 7b47847e42
5 changed files with 20 additions and 21 deletions

View File

@ -49,15 +49,14 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response);
$view->setData('employees', EmployeeMapper::getAll()
$view->data['employees'] = EmployeeMapper::getAll()
->with('profile')
->with('profile/account')
->with('companyHistory')
->with('companyHistory/unit')
->execute()
);
->execute();
return $view;
}
@ -78,10 +77,10 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-create');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response);
$accSelector = new \Modules\Profile\Theme\Backend\Components\AccountGroupSelector\BaseView($this->app->l11nManager, $request, $response);
$view->addData('accSelector', $accSelector);
$view->data['accSelector'] = $accSelector;
return $view;
}
@ -102,7 +101,7 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-profile');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response);
$employee = EmployeeMapper::get()
->with('profile')
@ -125,7 +124,7 @@ final class BackendController extends Controller
->sort('workHistory/start', OrderType::DESC)
->execute();
$view->addData('employee', $employee);
$view->data['employee'] = $employee;
return $view;
}
@ -146,9 +145,9 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/department-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002403001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002403001, $request, $response);
$view->setData('departments', DepartmentMapper::getAll());
$view->data['departments'] = DepartmentMapper::getAll();
return $view;
}
@ -169,9 +168,9 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/position-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002403001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002403001, $request, $response);
$view->setData('departments', DepartmentMapper::getAll());
$view->data['departments'] = DepartmentMapper::getAll();
return $view;
}
@ -192,10 +191,10 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/position-create');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response));
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response);
$accSelector = new \Modules\Profile\Theme\Backend\Components\AccountGroupSelector\BaseView($this->app->l11nManager, $request, $response);
$view->addData('accSelector', $accSelector);
$view->data['accSelector'] = $accSelector;
return $view;
}

View File

@ -25,9 +25,9 @@ $footerView->setPages(25);
$footerView->setPage(1);
$footerView->setResults(1);
$departments = $this->getData('departments');
$departments = $this->data['departments'];
echo $this->getData('nav')->render(); ?>
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">

View File

@ -18,7 +18,7 @@ use \Modules\HumanResourceManagement\Models\EmployeeActivityStatus;
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render();
echo $this->data['nav']->render();
?>
<div class="row">

View File

@ -19,9 +19,9 @@ use phpOMS\Uri\UriFactory;
* @var \phpOMS\Views\View $this
*/
$employees = $this->getData('employees');
$employees = $this->data['employees'];
echo $this->getData('nav')->render(); ?>
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">

View File

@ -14,13 +14,13 @@ declare(strict_types=1);
use phpOMS\Uri\UriFactory;
$employee = $this->getData('employee');
$employee = $this->data['employee'];
$history = $employee->getHistory();
$educationHistory = $employee->getEducationHistory();
$workHistory = $employee->getWorkHistory();
$recentHistory = $employee->getNewestHistory();
echo $this->getData('nav')->render(); ?>
echo $this->data['nav']->render(); ?>
<div class="tabview tab-2">
<div class="box wf-100 col-xs-12">