mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-01-11 12:28:39 +00:00
general fixes
This commit is contained in:
parent
a14b555342
commit
c6d80cf309
|
|
@ -124,15 +124,6 @@ final class BackendController extends Controller
|
||||||
public function viewHrStaffView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
public function viewHrStaffView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
if (!$request->hasData('id')) {
|
|
||||||
$response->header->status = RequestStatusCode::R_404;
|
|
||||||
$view->setTemplate('/Web/Backend/Error/404');
|
|
||||||
|
|
||||||
return $view;
|
|
||||||
}
|
|
||||||
|
|
||||||
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-view');
|
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response);
|
|
||||||
|
|
||||||
$view->data['employee'] = EmployeeMapper::get()
|
$view->data['employee'] = EmployeeMapper::get()
|
||||||
->with('profile')
|
->with('profile')
|
||||||
|
|
@ -155,6 +146,16 @@ final class BackendController extends Controller
|
||||||
->sort('workHistory/start', OrderType::DESC)
|
->sort('workHistory/start', OrderType::DESC)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
|
if ($view->data['employee']->id === 0) {
|
||||||
|
$response->header->status = RequestStatusCode::R_404;
|
||||||
|
$view->setTemplate('/Web/Backend/Error/404');
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
|
||||||
|
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-view');
|
||||||
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response);
|
||||||
|
|
||||||
$view->data['units'] = UnitMapper::getAll()->executeGetArray();
|
$view->data['units'] = UnitMapper::getAll()->executeGetArray();
|
||||||
$view->data['departments'] = DepartmentMapper::getAll()->executeGetArray();
|
$view->data['departments'] = DepartmentMapper::getAll()->executeGetArray();
|
||||||
$view->data['positions'] = PositionMapper::getAll()->executeGetArray();
|
$view->data['positions'] = PositionMapper::getAll()->executeGetArray();
|
||||||
|
|
@ -162,6 +163,13 @@ final class BackendController extends Controller
|
||||||
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||||
$view->data['employee-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
$view->data['employee-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
||||||
|
|
||||||
|
/** @var \Model\Setting $profileImage */
|
||||||
|
$profileImage = $this->app->appSettings->get(names: SettingsEnum::DEFAULT_PROFILE_IMAGE, module: 'Profile');
|
||||||
|
|
||||||
|
$view->data['defaultImage'] = MediaMapper::get()
|
||||||
|
->where('id', (int) $profileImage->content)
|
||||||
|
->execute();
|
||||||
|
|
||||||
if ($this->app->moduleManager->isActive('HumanResourceTimeRecording')) {
|
if ($this->app->moduleManager->isActive('HumanResourceTimeRecording')) {
|
||||||
/** @var \Modules\HumanResourceTimeRecording\Models\Session $lastOpenSession */
|
/** @var \Modules\HumanResourceTimeRecording\Models\Session $lastOpenSession */
|
||||||
$lastOpenSession = SessionMapper::getMostPlausibleOpenSessionForEmployee($view->data['employee']->id);
|
$lastOpenSession = SessionMapper::getMostPlausibleOpenSessionForEmployee($view->data['employee']->id);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
<td><a href="<?= $url; ?>"><img alt="<?= $this->getHtml('IMG_alt_user'); ?>" width="30" loading="lazy" class="profile-image"
|
<td><a href="<?= $url; ?>"><img alt="<?= $this->getHtml('IMG_alt_user'); ?>" width="30" loading="lazy" class="profile-image"
|
||||||
src="<?= $value->image->id === 0
|
src="<?= $value->image->id === 0
|
||||||
? ($value->profile->image->id === 0
|
? ($value->profile->image->id === 0
|
||||||
? UriFactory::build($this->getData('defaultImage')->getPath())
|
? UriFactory::build($this->data['defaultImage']->getPath())
|
||||||
: UriFactory::build($value->profile->image->getPath()))
|
: UriFactory::build($value->profile->image->getPath()))
|
||||||
: UriFactory::build($value->image->getPath()); ?>"></a>
|
: UriFactory::build($value->image->getPath()); ?>"></a>
|
||||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
src="<?=
|
src="<?=
|
||||||
$employee->image->id === 0
|
$employee->image->id === 0
|
||||||
? ($employee->profile->image->id === 0
|
? ($employee->profile->image->id === 0
|
||||||
? UriFactory::build($this->getData('defaultImage')->getPath())
|
? UriFactory::build($this->data['defaultImage']->getPath())
|
||||||
: UriFactory::build($employee->profile->image->getPath()))
|
: UriFactory::build($employee->profile->image->getPath()))
|
||||||
: UriFactory::build($employee->image->getPath()); ?>"
|
: UriFactory::build($employee->image->getPath()); ?>"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user