mirror of
https://github.com/Karaka-Management/oms-HumanResourceTimeRecording.git
synced 2026-01-25 18:18:42 +00:00
Continue with getter/setter cleanup
This commit is contained in:
parent
853ec600b5
commit
5abc13dfdd
|
|
@ -108,7 +108,7 @@ final class Application
|
|||
$pageView = new TimerecordingView($this->app->l11nManager, $request, $response);
|
||||
$head = new Head();
|
||||
|
||||
$pageView->setData('head', $head);
|
||||
$pageView->data['head'] = $head;
|
||||
$response->set('Content', $pageView);
|
||||
|
||||
/* Timerecording only allows GET */
|
||||
|
|
@ -433,7 +433,7 @@ final class Application
|
|||
private function createDefaultPageView(HttpRequest $request, HttpResponse $response, TimerecordingView $pageView) : void
|
||||
{
|
||||
$pageView->setOrganizations(UnitMapper::getAll()->execute());
|
||||
$pageView->setProfile(ProfileMapper::get()->where('account', $request->header->account)->execute());
|
||||
$pageView->profile = ProfileMapper::get()->where('account', $request->header->account)->execute();
|
||||
$pageView->setData('nav', $this->getNavigation($request, $response));
|
||||
|
||||
$pageView->setTemplate('/Web/Timerecording/index');
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class TimerecordingView extends View
|
|||
* @var Profile
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected $profile = null;
|
||||
public $profile = null;
|
||||
|
||||
/**
|
||||
* Organizations.
|
||||
|
|
@ -69,21 +69,6 @@ class TimerecordingView extends View
|
|||
$this->nav = $nav;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set user profile.
|
||||
*
|
||||
* @param Profile $profile user account
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setProfile(Profile $profile) : void
|
||||
{
|
||||
$this->profile = $profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get profile image
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ $nav->setTemplate('/Modules/Navigation/Theme/Backend/top');
|
|||
$top = $nav->render();
|
||||
|
||||
/** @var phpOMS\Model\Html\Head $head */
|
||||
$head = $this->getData('head');
|
||||
$head = $this->head;
|
||||
|
||||
/** @var array $dispatch */
|
||||
$dispatch = $this->getData('dispatch') ?? [];
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ declare(strict_types=1);
|
|||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
$head = $this->getData('head');
|
||||
$head = $this->head;
|
||||
?>
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="<?= $this->printHtml($this->response->header->l11n->language); ?>">
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/HumanResourceTimeRecording/Theme/Backend/dashboard');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response);
|
||||
|
||||
/** @var \Modules\HumanResourceTimeRecording\Models\Session[] $list */
|
||||
$list = SessionMapper::getLastSessionsFromAllEmployees();
|
||||
$view->addData('sessions', $list);
|
||||
$view->data['sessions'] = $list;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -68,7 +68,7 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/HumanResourceTimeRecording/Theme/Backend/private-dashboard');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006303001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006303001, $request, $response);
|
||||
|
||||
/** @var \Modules\HumanResourceManagement\Models\Employee $employee */
|
||||
$employee = EmployeeMapper::get()
|
||||
|
|
@ -91,9 +91,9 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
->sort('id', OrderType::DESC)
|
||||
->execute();
|
||||
|
||||
$view->addData('sessions', $list);
|
||||
$view->addData('lastSession', $lastOpenSession);
|
||||
$view->addData('date', $limit);
|
||||
$view->data['sessions'] = $list;
|
||||
$view->data['lastSession'] = $lastOpenSession;
|
||||
$view->data['date'] = $limit;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/HumanResourceTimeRecording/Theme/Backend/private-session');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006303001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006303001, $request, $response);
|
||||
|
||||
/** @var \Modules\HumanResourceTimeRecording\Models\Session $session */
|
||||
$session = SessionMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
|
|
@ -127,9 +127,9 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
->execute();
|
||||
|
||||
if ($session->employee->id !== $employee->id) {
|
||||
$view->addData('session', new NullSession());
|
||||
$view->data['session'] = new NullSession();
|
||||
} else {
|
||||
$view->addData('session', $session);
|
||||
$view->data['session'] = $session;
|
||||
}
|
||||
|
||||
return $view;
|
||||
|
|
@ -151,11 +151,11 @@ final class BackendController extends Controller implements DashboardElementInte
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/HumanResourceTimeRecording/Theme/Backend/hr-stats');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response);
|
||||
|
||||
/** @var \Modules\HumanResourceTimeRecording\Models\Session[] $list */
|
||||
$list = SessionMapper::getLastSessionsFromAllEmployees();
|
||||
$view->addData('sessions', $list);
|
||||
$view->data['sessions'] = $list;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,10 +47,10 @@ final class TimerecordingController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/HumanResourceTimeRecording/Theme/Timeterminal/overview');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006301001, $request, $response);
|
||||
|
||||
$list = SessionMapper::getAll()->sort('id', OrderType::DESC)->limit(50)->execute();
|
||||
$view->addData('sessions', $list);
|
||||
$view->data['sessions'] = $list;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
$sessions = $this->getData('sessions');
|
||||
$sessions = $this->data['sessions'];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ use \phpOMS\Stdlib\Base\SmartDateTime;
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var Session[] $sessions */
|
||||
$sessions = $this->getData('sessions');
|
||||
$sessions = $this->data['sessions'];
|
||||
$sessionCount = \count($sessions);
|
||||
|
||||
/** @var Session $lastOpenSession */
|
||||
$lastOpenSession = $this->getData('lastSession');
|
||||
$lastOpenSession = $this->data['lastSession'];
|
||||
|
||||
$type = $lastOpenSession !== null ? $lastOpenSession->getType() : ClockingType::OFFICE;
|
||||
$status = $lastOpenSession !== null ? $lastOpenSession->getStatus() : ClockingStatus::END;
|
||||
|
|
@ -42,7 +42,7 @@ $busy = [
|
|||
'week' => 0,
|
||||
];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<section class="portlet">
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
/** @var \Modules\HumanResourceTimeRecording\Models\Session $session */
|
||||
$session = $this->getData('session');
|
||||
$session = $this->data['session'];
|
||||
$elements = $session->getSessionElements();
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ declare(strict_types=1);
|
|||
use \Modules\HumanResourceTimeRecording\Models\ClockingStatus;
|
||||
use \Modules\HumanResourceTimeRecording\Models\ClockingType;
|
||||
|
||||
$sessions = $this->getData('sessions');
|
||||
$sessions = $this->data['sessions'];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-xs-12">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user