This commit is contained in:
Dennis Eichhorn 2024-04-07 17:31:42 +00:00
parent 3d95e798e9
commit de4f7d31cb
16 changed files with 4505 additions and 241 deletions

View File

@ -74,24 +74,7 @@
"from": "HumanResourceManagement",
"permission": { "permission": 2, "category": null, "element": null },
"parent": 1002401001,
"children": [
{
"id": 1002403101,
"pid": "/humanresource/department",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "{/base}/humanresource/department/list?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "HumanResourceManagement",
"permission": { "permission": 2, "category": null, "element": null },
"parent": 1002403001,
"children": [
]
}
]
"children": []
},
{
"id": 1002404001,
@ -106,40 +89,7 @@
"from": "HumanResourceManagement",
"permission": { "permission": 2, "category": null, "element": null },
"parent": 1002401001,
"children": [
{
"id": 1002404101,
"pid": "/humanresource/position",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "{/base}/humanresource/position/list?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "HumanResourceManagement",
"permission": { "permission": 2, "category": null, "element": null },
"parent": 1002404001,
"children": [
]
},
{
"id": 1002404201,
"pid": "/humanresource/position",
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "{/base}/humanresource/position/create?{?}",
"target": "self",
"icon": null,
"order": 5,
"from": "HumanResourceManagement",
"permission": { "permission": 4, "category": null, "element": null },
"parent": 1002404001,
"children": [
]
}
]
"children": []
}
]
}

View File

@ -308,6 +308,115 @@
}
}
},
"hr_salary_type": {
"name": "hr_salary_type",
"fields": {
"hr_salary_type_id": {
"name": "hr_salary_type_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"hr_salary_type_name": {
"name": "hr_salary_type_name",
"type": "VARCHAR(64)",
"null": false,
"unique": true
},
"hr_salary_type_salary": {
"description": "Not all salary types are considered salary by the employee",
"name": "hr_salary_type_salary",
"type": "TINYINT(1)",
"null": false
},
"hr_salary_type_regular": {
"description": "Not all salary types are regular payments. Can be overwritten by salary",
"name": "hr_salary_type_regular",
"type": "TINYINT(1)",
"null": false
}
}
},
"hr_salary_type_l11n": {
"name": "hr_salary_type_l11n",
"fields": {
"hr_salary_type_l11n_id": {
"name": "hr_salary_type_l11n_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"hr_salary_type_l11n_title": {
"name": "hr_salary_type_l11n_title",
"type": "VARCHAR(64)",
"null": false
},
"hr_salary_type_l11n_type": {
"name": "hr_salary_type_l11n_type",
"type": "INT",
"null": false,
"foreignTable": "hr_salary_type",
"foreignKey": "hr_salary_type_id"
},
"hr_salary_type_l11n_language": {
"name": "hr_salary_type_l11n_language",
"type": "VARCHAR(2)",
"default": null,
"null": true,
"foreignTable": "language",
"foreignKey": "language_639_1"
}
}
},
"hr_salary": {
"name": "hr_salary",
"fields": {
"hr_salary_id": {
"name": "hr_salary_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"hr_salary_description": {
"name": "hr_salary_description",
"type": "TEXT",
"null": false
},
"hr_salary_staff": {
"name": "hr_salary_staff",
"type": "INT",
"null": false,
"foreignTable": "hr_staff",
"foreignKey": "hr_staff_id"
},
"hr_salary_amount": {
"name": "hr_salary_amount",
"type": "BIGINT",
"null": false
},
"hr_salary_type": {
"name": "hr_salary_type",
"type": "INT",
"null": false,
"foreignTable": "hr_salary_type",
"foreignKey": "hr_salary_type_id"
},
"hr_salary_date": {
"name": "hr_salary_date",
"type": "DATETIME",
"null": true,
"default": null
},
"hr_salary_regular": {
"name": "hr_salary_regular",
"type": "TINYINT(1)",
"null": false
}
}
},
"hr_position": {
"name": "hr_position",
"fields": {

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@ return [
'dest' => '\Modules\HumanResourceManagement\Controller\ApiController:apiEmployeeCreate',
'verb' => RouteVerb::PUT,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::CREATE,
@ -30,4 +31,76 @@ return [
],
],
],
'^.*/humanresource/staff/history(\?.*$|$)' => [
[
'dest' => '\Modules\HumanResourceManagement\Controller\ApiController:apiEmployeeHistoryCreate',
'verb' => RouteVerb::PUT,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::HR,
],
],
[
'dest' => '\Modules\HumanResourceManagement\Controller\ApiController:apiEmployeeHistoryUpdate',
'verb' => RouteVerb::SET,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionCategory::HR,
],
],
],
'^.*/humanresource/staff/work(\?.*$|$)' => [
[
'dest' => '\Modules\HumanResourceManagement\Controller\ApiController:apiEmployeeWorkHistoryCreate',
'verb' => RouteVerb::PUT,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::HR,
],
],
[
'dest' => '\Modules\HumanResourceManagement\Controller\ApiController:apiEmployeeWorkHistoryUpdate',
'verb' => RouteVerb::SET,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionCategory::HR,
],
],
],
'^.*/humanresource/staff/education(\?.*$|$)' => [
[
'dest' => '\Modules\HumanResourceManagement\Controller\ApiController:apiEmployeeEducationHistoryCreate',
'verb' => RouteVerb::PUT,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::HR,
],
],
[
'dest' => '\Modules\HumanResourceManagement\Controller\ApiController:apiEmployeeEducationHistoryUpdate',
'verb' => RouteVerb::SET,
'csrf' => true,
'active' => true,
'permission' => [
'module' => ApiController::NAME,
'type' => PermissionType::MODIFY,
'state' => PermissionCategory::HR,
],
],
],
];

View File

@ -22,6 +22,7 @@ return [
[
'dest' => '\Modules\HumanResourceManagement\Controller\BackendController:viewHrStaffList',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
@ -33,6 +34,7 @@ return [
[
'dest' => '\Modules\HumanResourceManagement\Controller\BackendController:viewHrStaffView',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
@ -44,6 +46,7 @@ return [
[
'dest' => '\Modules\HumanResourceManagement\Controller\BackendController:viewHrStaffCreate',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::CREATE,
@ -55,6 +58,19 @@ return [
[
'dest' => '\Modules\HumanResourceManagement\Controller\BackendController:viewHrDepartmentList',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
'state' => PermissionCategory::DEPARTMENT,
],
],
],
'^/humanresource/department/view(\?.*$|$)' => [
[
'dest' => '\Modules\HumanResourceManagement\Controller\BackendController:viewHrDepartmentView',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
@ -66,6 +82,7 @@ return [
[
'dest' => '\Modules\HumanResourceManagement\Controller\BackendController:viewHrPositionList',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
@ -73,15 +90,16 @@ return [
],
],
],
'^/humanresource/position/create(\?.*$|$)' => [
'^/humanresource/position/view(\?.*$|$)' => [
[
'dest' => '\Modules\HumanResourceManagement\Controller\BackendController:viewHrPositionCreate',
'dest' => '\Modules\HumanResourceManagement\Controller\BackendController:viewHrPositionView',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::CREATE,
'type' => PermissionType::READ,
'state' => PermissionCategory::POSITION,
],
],
],
]
];

View File

@ -615,7 +615,7 @@ final class ApiController extends Controller
}
/**
* Validate item note create request
* Validate note create request
*
* @param RequestAbstract $request Request
*

View File

@ -14,10 +14,15 @@ declare(strict_types=1);
namespace Modules\HumanResourceManagement\Controller;
use Modules\HumanResourceManagement\Models\EmployeeHistoryMapper;
use Modules\HumanResourceManagement\Models\EmployeeMapper;
use Modules\HumanResourceTimeRecording\Models\SessionMapper;
use Modules\Media\Models\MediaMapper;
use Modules\Organization\Models\Department;
use Modules\Organization\Models\DepartmentMapper;
use Modules\Organization\Models\Position;
use Modules\Organization\Models\PositionMapper;
use Modules\Organization\Models\UnitMapper;
use Modules\Profile\Models\SettingsEnum;
use phpOMS\Contract\RenderableInterface;
use phpOMS\DataStorage\Database\Query\OrderType;
@ -62,6 +67,10 @@ final class BackendController extends Controller
->with('profile/image')
->with('companyHistory')
->with('companyHistory/unit')
->with('companyHistory/department')
->with('companyHistory/position')
->sort('companyHistory/start', OrderType::DESC)
//->limit(1, 'companyHistory') // @todo This is not working since it returns 1 for ALL employees instead of per employee
->executeGetArray();
/** @var \Model\Setting $profileImage */
@ -119,9 +128,11 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-view');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response);
$employee = EmployeeMapper::get()
$view->data['employee'] = EmployeeMapper::get()
->with('profile')
->with('profile/account')
->with('profile/account/address')
->with('profile/account/contacts')
->with('image')
->with('notes')
->with('files')
@ -131,27 +142,23 @@ final class BackendController extends Controller
->with('companyHistory/department')
->with('companyHistory/position')
->with('educationHistory')
->with('educationHistory/unit')
->with('educationHistory/department')
->with('educationHistory/position')
->with('workHistory')
->with('workHistory/unit')
->with('workHistory/department')
->with('workHistory/position')
->where('id', (int) $request->getData('id'))
->sort('companyHistory/start', OrderType::DESC)
->sort('educationHistory/start', OrderType::DESC)
->sort('workHistory/start', OrderType::DESC)
->execute();
$view->data['employee'] = $employee;
$view->data['units'] = UnitMapper::getAll()->executeGetArray();
$view->data['departments'] = DepartmentMapper::getAll()->executeGetArray();
$view->data['positions'] = PositionMapper::getAll()->executeGetArray();
$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);
if ($this->app->moduleManager->isActive('HumanResourceTimeRecording')) {
/** @var \Modules\HumanResourceTimeRecording\Models\Session $lastOpenSession */
$lastOpenSession = SessionMapper::getMostPlausibleOpenSessionForEmployee($employee->id);
$lastOpenSession = SessionMapper::getMostPlausibleOpenSessionForEmployee( $view->data['employee']->id);
$start = new SmartDateTime('now');
$start = $start->getEndOfDay();
@ -160,7 +167,7 @@ final class BackendController extends Controller
$list = SessionMapper::getAll()
->with('sessionElements')
->where('employee', $employee->id)
->where('employee', $view->data['employee']->id)
->where('start', $start, '<=')
->sort('start', OrderType::DESC)
->executeGetArray();
@ -169,6 +176,9 @@ final class BackendController extends Controller
$view->data['lastSession'] = $lastOpenSession;
}
$view->data['address-component'] = new \Modules\Admin\Theme\Backend\Components\AddressEditor\AddressView($this->app->l11nManager, $request, $response);
$view->data['contact-component'] = new \Modules\Admin\Theme\Backend\Components\ContactEditor\ContactView($this->app->l11nManager, $request, $response);
return $view;
}
@ -190,7 +200,25 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/department-list');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002403001, $request, $response);
$view->data['departments'] = DepartmentMapper::getAll();
$view->data['departments'] = DepartmentMapper::getAll()
->with('parent')
->where('unit', $this->app->unitId)
->executeGetArray();
$histories = EmployeeHistoryMapper::getAll()
->where('department', \array_map(function (Department $department) : int { return $department->id; }, $view->data['departments']))
->executeGetArray();
$stats = [];
foreach ($histories as $employee) {
if (!isset($stats[$employee->department->id])) {
$stats[$employee->department->id] = 0;
}
++$stats[$employee->department->id];
}
$view->data['stats'] = $stats;
return $view;
}
@ -211,9 +239,32 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/position-list');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002403001, $request, $response);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002404001, $request, $response);
$view->data['departments'] = DepartmentMapper::getAll();
$departments = DepartmentMapper::getAll()
->where('unit', $this->app->unitId)
->executeGetArray();
$view->data['positions'] = PositionMapper::getAll()
->with('parent')
->where('department', \array_map(function (Department $department) : int { return $department->id; }, $departments))
->executeGetArray();
$histories = EmployeeHistoryMapper::getAll()
->where('department', \array_map(function (Department $department) : int { return $department->id; }, $departments))
->where('position', \array_map(function (Position $position) : int { return $position->id; }, $view->data['positions']))
->executeGetArray();
$stats = [];
foreach ($histories as $employee) {
if (!isset($stats[$employee->department->id])) {
$stats[$employee->department->id] = 0;
}
++$stats[$employee->department->id];
}
$view->data['stats'] = $stats;
return $view;
}

View File

@ -1,27 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\HumanResourceManagement\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\HumanResourceManagement\Models;
/**
* Department class.
*
* @package Modules\HumanResourceManagement\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
class Department
{
}

View File

@ -73,6 +73,9 @@ class EmployeeHistory implements \JsonSerializable
*/
public Position $position;
/** @todo Implement */
public float $fte = 1.0;
/**
* Start date
*

View File

@ -21,7 +21,7 @@ use Modules\Organization\Models\UnitMapper;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
/**
* EmployeHistory mapper class.
* EmployeeHistory mapper class.
*
* @package Modules\HumanResourceManagement\Models
* @license OMS License 2.0

View File

@ -27,6 +27,7 @@ return ['HumanResourceManagement' => [
'Employee' => 'Mitarbeiter',
'Employees' => 'Angestellte',
'End' => 'Ende',
'Score' => 'Note',
'Evaluations' => 'Beurteilungen',
'General' => 'Allgemein',
'History' => 'Geschichte',
@ -34,6 +35,7 @@ return ['HumanResourceManagement' => [
'Name' => 'Name',
'Parent' => 'Elternteil',
'Phone' => 'Telefon',
'Positions' => 'Positions',
'Position' => 'Position',
'ProfileImage' => 'Profilbild',
'Salary' => 'Gehalt',

View File

@ -20,6 +20,8 @@ return ['HumanResourceManagement' => [
'Contracts' => 'Contracts',
'CreateFromAccount' => 'Create from account',
'Department' => 'Department',
'Position' => 'Position',
'Positions' => 'Positions',
'Departments' => 'Departments',
'Documents' => 'Documents',
'Education' => 'Education',
@ -27,6 +29,7 @@ return ['HumanResourceManagement' => [
'Employee' => 'Employee',
'Employees' => 'Employees',
'End' => 'End',
'Score' => 'Score',
'Evaluations' => 'Evaluations',
'General' => 'General',
'History' => 'History',
@ -34,7 +37,6 @@ return ['HumanResourceManagement' => [
'Name' => 'Name',
'Parent' => 'Parent',
'Phone' => 'Phone',
'Position' => 'Position',
'ProfileImage' => 'Profile image',
'Salary' => 'Salary',
'Notes' => 'Notes',

View File

@ -18,13 +18,6 @@ use phpOMS\Uri\UriFactory;
* @var \phpOMS\Views\View $this
*/
$footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(25);
$footerView->setPage(1);
$footerView->setResults(1);
$departments = $this->data['departments'];
echo $this->data['nav']->render(); ?>
@ -43,11 +36,11 @@ echo $this->data['nav']->render(); ?>
<td><?= $this->getHtml('Parent'); ?>
<tbody>
<?php $c = 0; foreach ($departments as $key => $value) : ++$c;
$url = UriFactory::build('{/base}/hr/department/view?{?}&id=' . $value->id); ?>
$url = UriFactory::build('{/base}/humanresource/department/view?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->id; ?></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<td data-label="<?= $this->getHtml('Employees'); ?>">
<td data-label="<?= $this->getHtml('Employees'); ?>"><?= $this->data['stats'][$value->id] ?? 0; ?>
<td data-label="<?= $this->getHtml('Parent'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->parent->name); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>

View File

@ -0,0 +1,53 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\HumanResourceManagement
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory;
/**
* @var \phpOMS\Views\View $this
*/
$positions = $this->data['positions'];
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Positions'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table class="default sticky">
<thead>
<tr>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<td><?= $this->getHtml('Employees'); ?>
<td><?= $this->getHtml('Parent'); ?>
<tbody>
<?php $c = 0; foreach ($positions as $key => $value) : ++$c;
$url = UriFactory::build('{/base}/humanresource/position/view?{?}&id=' . $value->id); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->id; ?></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<td data-label="<?= $this->getHtml('Employees'); ?>"><?= $this->data['stats'][$value->id] ?? 0; ?>
<td data-label="<?= $this->getHtml('Parent'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->parent->name); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>
</div>
</div>

View File

@ -23,65 +23,54 @@ echo $this->data['nav']->render();
<div class="row">
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('Employee'); ?></h1></header>
<div class="inner">
<form id="fEmployee" action="<?= \phpOMS\Uri\UriFactory::build('{/api}humanresource/staff?csrf={$CSRF}'); ?>" method="put">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iStatus"><?= $this->getHtml('Status'); ?></label>
<tr><td><select id="iStatus" name="status">
<option value="<?= EmployeeActivityStatus::ACTIVE; ?>"><?= $this->getHtml('Active'); ?>
<option value="<?= EmployeeActivityStatus::INACTIVE; ?>"><?= $this->getHtml('Inactive'); ?>
</select>
<tr><td><label for="iName1"><?= $this->getHtml('Name1', 'Admin'); ?></label>
<tr><td><input id="iName1" name="name1" type="text" required>
<tr><td><label for="iName2"><?= $this->getHtml('Name2', 'Admin'); ?></label>
<tr><td><input id="iName2" name="name2" type="text">
<tr><td><label for="iName3"><?= $this->getHtml('Name3', 'Admin'); ?></label>
<tr><td><input id="iName3" name="name3" type="text">
<tr><td><label for="iAddress"><?= $this->getHtml('Address', 'Profile'); ?></label>
<tr><td><input type="text" id="iAddress" name="address">
<tr><td><label for="iZip"><?= $this->getHtml('Zip', 'Profile'); ?></label>
<tr><td><input type="text" id="iZip" name="zip">
<tr><td><label for="iCity"><?= $this->getHtml('City', 'Profile'); ?></label>
<tr><td><input type="text" id="iCity" name="city">
<tr><td><label for="iCountry"><?= $this->getHtml('Country', 'Profile'); ?></label>
<tr><td><input type="text" id="iCountry" name="country">
<tr><td><label for="iBirthday"><?= $this->getHtml('Birthday', 'Profile'); ?></label>
<tr><td><input id="iBirthday" name="pirthday" type="text">
<tr><td><label for="iPhone"><?= $this->getHtml('Phone', 'Profile'); ?></label>
<tr><td><input id="iPhone" name="phone" type="text">
<tr><td><label for="iEmail"><?= $this->getHtml('Email', 'Admin'); ?></label>
<tr><td><input id="iEmail" name="email" type="email">
<tr><td><label for="iUnit"><?= $this->getHtml('Unit', 'Organization'); ?></label>
<tr><td><input id="iUnit" name="unit" type="text">
<tr><td><label for="iPosition"><?= $this->getHtml('Position', 'Organization'); ?></label>
<tr><td><input id="iPosition" name="position" type="text">
<tr><td><label for="iStart"><?= $this->getHtml('Start'); ?></label>
<tr><td><input id="iStart" name="start" type="datetime-local">
<tr><td><label for="iEnd"><?= $this->getHtml('End'); ?></label>
<tr><td><input id="iEnd" name="end" type="datetime-local">
<tr><td><input id="employee-create-submit" name="createSubmit" type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</table>
</form>
</div>
<section class="portlet">
<form id="fEmployee" action="<?= \phpOMS\Uri\UriFactory::build('{/api}humanresource/staff?csrf={$CSRF}'); ?>" method="put">
<div class="portlet-head"><?= $this->getHtml('Employee'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iStatus"><?= $this->getHtml('Status'); ?></label>
<select id="iStatus" name="status">
<option value="<?= EmployeeActivityStatus::ACTIVE; ?>"><?= $this->getHtml('Active'); ?>
<option value="<?= EmployeeActivityStatus::INACTIVE; ?>"><?= $this->getHtml('Inactive'); ?>
</select>
</div>
<div class="form-group">
<label for="iName1"><?= $this->getHtml('Name1', 'Admin', 'Backend'); ?></label>
<input type="text" id="iName1" name="name1" value="" required>
</div>
<div class="form-group">
<label for="iName2"><?= $this->getHtml('Name2', 'Admin', 'Backend'); ?></label>
<input type="text" id="iName2" name="name2" value="">
</div>
<div class="form-group">
<label for="iName3"><?= $this->getHtml('Name3', 'Admin', 'Backend'); ?></label>
<input type="text" id="iName3" name="name3" value="">
</div>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>" name="employee-client">
</div>
</form>
</section>
</div>
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('CreateFromAccount'); ?></h1></header>
<div class="inner">
<form id="fAccount" action="<?= \phpOMS\Uri\UriFactory::build('{/api}humanresource/staff?csrf={$CSRF}'); ?>" method="put">
<table class="layout wf-100">
<tbody>
<tr><td><label for="iAccount"><?= $this->getHtml('Account', 'Admin'); ?></label>
<tr><td><?= $this->getData('accSelector')->render('iAccount', 'accounts', true); ?>
<tr><td><input id="employee-create-submit" name="createSubmit" type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
</table>
</form>
</div>
<section class="portlet">
<form id="fAccount" action="<?= \phpOMS\Uri\UriFactory::build('{/api}humanresource/staff?csrf={$CSRF}'); ?>" method="put">
<div class="portlet-head"><?= $this->getHtml('CreateFromAccount'); ?></div>
<div class="portlet-body">
<div class="form-group">
<label for="iAccount"><?= $this->getHtml('Account', 'Admin'); ?></label>
<?= $this->getData('accSelector')->render('iAccount', 'accounts', true); ?>
</div>
</div>
<div class="portlet-foot">
<input type="submit" value="<?= $this->getHtml('Create', '0', '0'); ?>" name="employee-client">
</div>
</form>
</section>
</div>
</div>

View File

@ -17,22 +17,24 @@ use Modules\HumanResourceTimeRecording\Models\ClockingType;
use phpOMS\Stdlib\Base\SmartDateTime;
use phpOMS\Uri\UriFactory;
$employee = $this->data['employee'];
$history = $employee->getHistory();
$educationHistory = $employee->getEducationHistory();
$workHistory = $employee->getWorkHistory();
$recentHistory = $employee->getNewestHistory();
$employee = $this->data['employee'];
$history = $employee->getHistory();
$education = $employee->getEducationHistory();
$work = $employee->getWorkHistory();
$recentHistory = $employee->getNewestHistory();
echo $this->data['nav']->render(); ?>
<div class="tabview tab-2">
<div class="box">
<ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('General'); ?></label>
<li><label for="c-tab-2"><?= $this->getHtml('Clocking'); ?></label>
<li><label for="c-tab-3"><?= $this->getHtml('Documents'); ?></label>
<li><label for="c-tab-2"><?= $this->getHtml('Address'); ?></label>
<li><label for="c-tab-3"><?= $this->getHtml('Clocking'); ?></label>
<li><label for="c-tab-4"><?= $this->getHtml('Documents'); ?></label>
<li><label for="c-tab-5"><?= $this->getHtml('Notes'); ?></label>
<!-- @todo Implement new module called Payroll
<li><label for="c-tab-7"><?= $this->getHtml('Salary'); ?></label>
-->
<li><label for="c-tab-8"><?= $this->getHtml('Education'); ?></label>
<li><label for="c-tab-9"><?= $this->getHtml('Work'); ?></label>
</ul>
@ -69,31 +71,10 @@ echo $this->data['nav']->render(); ?>
<td itemprop="jobTitle"><?= $this->printHtml($recentHistory->unit->name); ?>
<tr>
<th><?= $this->getHtml('Birthday'); ?>
<td itemprop="birthDate">06.09.1934
<td itemprop="birthDate"><?= $employee->profile->birthday?->format('Y-m-d'); ?>
<tr>
<th><?= $this->getHtml('Email'); ?>
<td itemprop="email"><a href="mailto:<?= $this->printHtml($employee->profile->account->getEmail()); ?>"><?= $this->printHtml($employee->profile->account->getEmail()); ?></a>
<tr>
<th>Address
<td>
<tr>
<th class="vT">Private
<td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA
<tr>
<th class="vT">Work
<td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA
<tr>
<th><?= $this->getHtml('Phone'); ?>
<td>
<tr>
<th>Private
<td itemprop="telephone">+01 12345-4567
<tr>
<th>Mobile
<td itemprop="telephone">+01 12345-4567
<tr>
<th>Work
<td itemprop="telephone">+01 12345-4567
<tr>
<th><?= $this->getHtml('Status'); ?>
<td><span class="tag green"><?= $recentHistory->id > 0 ? $this->getHtml('Active') : $this->getHtml('Inactive'); ?></span>
@ -104,31 +85,152 @@ echo $this->data['nav']->render(); ?>
</div>
<div class="row">
<div class="col-xs-12">
<div class="portlet x-overflow">
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="historyForm" action="<?= UriFactory::build('{/api}humanresource/staff/history'); ?>" method="post"
data-ui-container="#historyTable tbody"
data-add-form="historyForm"
data-add-tpl="#historyTable tbody .oms-add-tpl-history">
<div class="portlet-head"><?= $this->getHtml('History'); ?></div>
<div class="portlet-body">
<input type="hidden" id="iHistoryEmployee" name="employee" value="<?= $employee->id; ?>" disabled>
<div class="form-group">
<label for="iHistoryId"><?= $this->getHtml('ID', '0', '0'); ?></label>
<input type="text" id="iHistoryId" name="id" data-tpl-text="/id" data-tpl-value="/id" disabled>
</div>
<div class="form-group">
<label for="iHistoryUnit"><?= $this->getHtml('Unit'); ?></label>
<select id="iHistoryUnit" name="unit" data-tpl-text="/unit" data-tpl-value="/unit">
<option value="">
<?php
foreach ($this->data['units'] as $unit) : ?>
<option value="<?= $unit->id; ?>"><?= $this->printHtml($unit->name); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iHistoryDepartment"><?= $this->getHtml('Department'); ?></label>
<select id="iHistoryDepartment" name="department" data-tpl-text="/department" data-tpl-value="/department">
<option value="">
<?php
foreach ($this->data['departments'] as $department) : ?>
<option value="<?= $department->id; ?>"><?= $this->printHtml($department->name); ?>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="iHistoryPosition"><?= $this->getHtml('Position'); ?></label>
<select id="iHistoryPosition" name="position" data-tpl-text="/position" data-tpl-value="/position">
<option value="">
<?php
foreach ($this->data['positions'] as $position) : ?>
<option value="<?= $position->id; ?>"><?= $this->printHtml($position->name); ?>
<?php endforeach; ?>
</select>
</div>
<div class="flex-line">
<div>
<div class="form-group">
<label for="iHistoryStart"><?= $this->getHtml('Start'); ?></label>
<input id="iHistoryStart" name="start" type="date" data-tpl-text="/start" data-tpl-value="/start">
</div>
</div>
<div>
<div class="form-group">
<label for="iHistoryEnd"><?= $this->getHtml('End'); ?></label>
<input id="iHistoryEnd" name="end" type="date" data-tpl-text="/end" data-tpl-value="/end">
</div>
</div>
</div>
</div>
<div class="portlet-foot">
<input id="bHistoryAdd" formmethod="put" type="submit" class="add-form" value="<?= $this->getHtml('Add', '0', '0'); ?>">
<input id="bHistorySave" formmethod="post" type="submit" class="save-form vh button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
<input id="bHistoryCancel" type="submit" class="cancel-form vh button close" value="<?= $this->getHtml('Cancel', '0', '0'); ?>">
</div>
</form>
</section>
</div>
<div class="col-xs-12 col-md-6">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('History'); ?><i class="g-icon download btn end-xs">download</i></div>
<table id="historyList" class="default sticky">
<div class="slider">
<table id="historyTable" class="default sticky"
data-tag="form"
data-ui-element="tr"
data-add-tpl=".oms-add-tpl-history"
data-update-form="historyForm">
<thead>
<td><?= $this->getHtml('Start'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('End'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Unit'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Department'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Position'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td><?= $this->getHtml('Start'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('End'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Unit'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Department'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Position'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<tbody>
<?php foreach ($history as $hist) : ?>
<tr><td><?= $hist->start->format('Y-m-d'); ?>
<td><?= $hist->end === null ? '' : $hist->end->format('Y-m-d'); ?>
<td><?= $this->printHtml($hist->unit->name); ?>
<td><?= $this->printHtml($hist->department->name); ?>
<td><?= $this->printHtml($hist->position->name); ?>
<?php endforeach; ?>
<template class="oms-add-tpl-history">
<tr class="animated medium-duration greenCircleFade" data-id="" draggable="false">
<td>
<i class="g-icon btn update-form">settings</i>
<input id="historyTable-remove-0" type="checkbox" class="vh">
<label for="historyTable-remove-0" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
<span class="checked-visibility">
<label for="historyTable-remove-0" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
<label for="historyTable-remove-0" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
</span>
<td data-tpl-text="/id" data-tpl-value="/id"></td>
<td data-tpl-text="/start" data-tpl-value="/start"></td>
<td data-tpl-text="/end" data-tpl-value="/end"></td>
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value=""></td>
<td data-tpl-text="/department" data-tpl-value="/department" data-value=""></td>
<td data-tpl-text="/position" data-tpl-value="/position" data-value=""></td>
</tr>
</template>
<?php $c = 0;
foreach ($history as $key => $value) : ++$c; ?>
<tr data-id="<?= $value->id; ?>">
<td>
<i class="g-icon btn update-form">settings</i>
<input id="historyTable-remove-<?= $value->id; ?>" type="checkbox" class="vh">
<label for="historyTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
<span class="checked-visibility">
<label for="historyTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
<label for="historyTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
</span>
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
<td data-tpl-text="/start" data-tpl-value="/start" data-value="<?= $value->start->format('Y-m-d'); ?>"><?= $value->start->format('Y-m-d'); ?>
<td data-tpl-text="/end" data-tpl-value="/end" data-value="<?= $value->end?->format('Y-m-d'); ?>"><?= $value->end === null ? '' : $value->end->format('Y-m-d'); ?>
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value="<?= $value->unit->id; ?>"><?= $this->printHtml($value->unit->name); ?>
<td data-tpl-text="/department" data-tpl-value="/department" data-value="<?= $value->department->id; ?>"><?= $this->printHtml($value->department->name); ?>
<td data-tpl-text="/position" data-tpl-value="/position" data-value="<?= $value->position->id; ?>"><?= $this->printHtml($value->position->name); ?>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr>
<td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>
</section>
</div>
</div>
</div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab">
<?= $this->data['contact-component']->render('employee-contact', 'contacts', $employee->profile->account->contacts); ?>
<?= $this->data['address-component']->render('employee-address', 'addresses', $employee->profile->account->addresses); ?>
</div>
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
<div class="tab">
<?php
$busy = [
@ -270,10 +372,10 @@ echo $this->data['nav']->render(); ?>
<td><a href="<?= $url; ?>"><?= $session->start->format('H:i'); ?></a>
<td><a href="<?= $url; ?>"><?= (int) ($session->getBreak() / 3600); ?>h <?= ((int) ($session->getBreak() / 60) % 60); ?>m</a>
<td><a href="<?= $url; ?>"><?= $session->end?->format('H:i'); ?></a>
<td><a href="<?= $url; ?>"><?= (int) ($session->getBusy() / 3600); ?>h <?= ((int) ($session->getBusy() / 60) % 60); ?>m</a>
<td><a href="<?= $url; ?>"><?= (int) ($session->busy / 3600); ?>h <?= ((int) ($session->busy / 60) % 60); ?>m</a>
<?php
$busy['week'] += $session->getBusy();
$busy['month'] += $session->getBusy();
$busy['week'] += $session->busy;
$busy['month'] += $session->busy;
$session = \next($sessions);
if ($session === false) {
@ -318,7 +420,7 @@ echo $this->data['nav']->render(); ?>
</div>
</div>
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
<div class="tab col-simple">
<?= $this->data['media-upload']->render('employee-file', 'files', '', $employee->files); ?>
</div>
@ -337,50 +439,242 @@ echo $this->data['nav']->render(); ?>
<input type="radio" id="c-tab-8" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-7' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12">
<div class="portlet x-overflow">
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="educationForm" action="<?= UriFactory::build('{/api}humanresource/staff/education'); ?>" method="post"
data-ui-container="#educationTable tbody"
data-add-form="educationForm"
data-add-tpl="#educationTable tbody .oms-add-tpl-education">
<div class="portlet-head"><?= $this->getHtml('Education'); ?></div>
<div class="portlet-body">
<input type="hidden" id="iEducationEmployee" name="employee" value="<?= $employee->id; ?>" disabled>
<div class="form-group">
<label for="iEducationId"><?= $this->getHtml('ID', '0', '0'); ?></label>
<input type="text" id="iEducationId" name="id" data-tpl-text="/id" data-tpl-value="/id" disabled>
</div>
<div class="form-group">
<label for="iEducationTitle"><?= $this->getHtml('Title'); ?></label>
<input type="text" id="iEducationTitle" name="title" data-tpl-text="/title" data-tpl-value="/title">
</div>
<div class="form-group">
<label for="iEducationAddress"><?= $this->getHtml('Address'); ?></label>
<input type="text" id="iEducationAddress" name="address" data-tpl-text="/address" data-tpl-value="/address">
</div>
<div class="form-group">
<label for="iEducationScore"><?= $this->getHtml('Score'); ?></label>
<input type="text" id="iEducationScore" name="score" data-tpl-text="/score" data-tpl-value="/score">
</div>
<div class="flex-line">
<div>
<div class="form-group">
<label for="iEducationStart"><?= $this->getHtml('Start'); ?></label>
<input id="iEducationStart" name="start" type="date" data-tpl-text="/start" data-tpl-value="/start">
</div>
</div>
<div>
<div class="form-group">
<label for="iEducationEnd"><?= $this->getHtml('End'); ?></label>
<input id="iEducationEnd" name="end" type="date" data-tpl-text="/end" data-tpl-value="/end">
</div>
</div>
</div>
</div>
<div class="portlet-foot">
<input id="bEducationAdd" formmethod="put" type="submit" class="add-form" value="<?= $this->getHtml('Add', '0', '0'); ?>">
<input id="bEducationSave" formmethod="post" type="submit" class="save-form vh button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
<input id="bEducationCancel" type="submit" class="cancel-form vh button close" value="<?= $this->getHtml('Cancel', '0', '0'); ?>">
</div>
</form>
</section>
</div>
<div class="col-xs-12 col-md-6">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Education'); ?><i class="g-icon download btn end-xs">download</i></div>
<table id="historyList" class="default sticky">
<div class="slider">
<table id="educationTable" class="default sticky"
data-tag="form"
data-ui-element="tr"
data-add-tpl=".oms-add-tpl-education"
data-update-form="educationForm">
<thead>
<td><?= $this->getHtml('Start'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('End'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Title'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Address'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td><?= $this->getHtml('Start'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('End'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Title'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Address'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Score'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<tbody>
<?php foreach ($educationHistory as $hist) : ?>
<tr><td><?= $hist->start->format('Y-m-d'); ?>
<td><?= $hist->end === null ? '' : $hist->end->format('Y-m-d'); ?>
<td><?= $this->printHtml($hist->educationTitle); ?>
<td><?= $this->printHtml($hist->address->name); ?>
<?php endforeach; ?>
<template class="oms-add-tpl-education">
<tr class="animated medium-duration greenCircleFade" data-id="" draggable="false">
<td>
<i class="g-icon btn update-form">settings</i>
<input id="educationTable-remove-0" type="checkbox" class="vh">
<label for="educationTable-remove-0" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
<span class="checked-visibility">
<label for="educationTable-remove-0" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
<label for="educationTable-remove-0" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
</span>
<td data-tpl-text="/id" data-tpl-value="/id"></td>
<td data-tpl-text="/start" data-tpl-value="/start"></td>
<td data-tpl-text="/end" data-tpl-value="/end"></td>
<td data-tpl-text="/title" data-tpl-value="/title"></td>
<td data-tpl-text="/address" data-tpl-value="/address"></td>
<td data-tpl-text="/score" data-tpl-value="/score"></td>
</tr>
</template>
<?php $c = 0;
foreach ($education as $key => $value) : ++$c; ?>
<tr data-id="<?= $value->id; ?>">
<td>
<i class="g-icon btn update-form">settings</i>
<input id="educationTable-remove-<?= $value->id; ?>" type="checkbox" class="vh">
<label for="educationTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
<span class="checked-visibility">
<label for="educationTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
<label for="educationTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
</span>
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
<td data-tpl-text="/start" data-tpl-value="/start" data-value="<?= $value->start->format('Y-m-d'); ?>"><?= $value->start->format('Y-m-d'); ?>
<td data-tpl-text="/end" data-tpl-value="/end" data-value="<?= $value->end?->format('Y-m-d'); ?>"><?= $value->end === null ? '' : $value->end->format('Y-m-d'); ?>
<td data-tpl-text="/title" data-tpl-value="/title"><?= $this->printHtml($value->educationTitle); ?>
<td data-tpl-text="/address" data-tpl-value="/address"><?= $this->printHtml($value->address->name); ?>
<td data-tpl-text="/score" data-tpl-value="/score"><?= $this->printHtml($value->score); ?>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr>
<td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>
</section>
</div>
</div>
</div>
<input type="radio" id="c-tab-9" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-8' ? ' checked' : ''; ?>>
<div class="tab">
<div class="row">
<div class="col-xs-12">
<div class="portlet x-overflow">
<div class="col-xs-12 col-md-6">
<section class="portlet">
<form id="workForm" action="<?= UriFactory::build('{/api}humanresource/staff/work'); ?>" method="post"
data-ui-container="#workTable tbody"
data-add-form="workForm"
data-add-tpl="#workTable tbody .oms-add-tpl-work">
<div class="portlet-head"><?= $this->getHtml('Work'); ?></div>
<div class="portlet-body">
<input type="hidden" id="iWorkEmployee" name="employee" value="<?= $employee->id; ?>" disabled>
<div class="form-group">
<label for="iWorkId"><?= $this->getHtml('ID', '0', '0'); ?></label>
<input type="text" id="iWorkId" name="id" data-tpl-text="/id" data-tpl-value="/id" disabled>
</div>
<div class="form-group">
<label for="iWorkTitle"><?= $this->getHtml('Title'); ?></label>
<input type="text" id="iWorkTitle" name="title" data-tpl-text="/title" data-tpl-value="/title">
</div>
<div class="form-group">
<label for="iWorkAddress"><?= $this->getHtml('Address'); ?></label>
<input type="text" id="iWorkAddress" name="address" data-tpl-text="/address" data-tpl-value="/address">
</div>
<div class="flex-line">
<div>
<div class="form-group">
<label for="iWorkStart"><?= $this->getHtml('Start'); ?></label>
<input id="iWorkStart" name="start" type="date" data-tpl-text="/start" data-tpl-value="/start">
</div>
</div>
<div>
<div class="form-group">
<label for="iWorkEnd"><?= $this->getHtml('End'); ?></label>
<input id="iWorkEnd" name="end" type="date" data-tpl-text="/end" data-tpl-value="/end">
</div>
</div>
</div>
</div>
<div class="portlet-foot">
<input id="bWorkAdd" formmethod="put" type="submit" class="add-form" value="<?= $this->getHtml('Add', '0', '0'); ?>">
<input id="bWorkSave" formmethod="post" type="submit" class="save-form vh button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
<input id="bWorkCancel" type="submit" class="cancel-form vh button close" value="<?= $this->getHtml('Cancel', '0', '0'); ?>">
</div>
</form>
</section>
</div>
<div class="col-xs-12 col-md-6">
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Work'); ?><i class="g-icon download btn end-xs">download</i></div>
<table id="historyList" class="default sticky">
<div class="slider">
<table id="workTable" class="default sticky"
data-tag="form"
data-ui-element="tr"
data-add-tpl=".oms-add-tpl-work"
data-update-form="workForm">
<thead>
<td><?= $this->getHtml('Start'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('End'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Title'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Address'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td><?= $this->getHtml('Start'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('End'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Title'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<td><?= $this->getHtml('Address'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
<tbody>
<?php foreach ($workHistory as $hist) : ?>
<tr><td><?= $hist->start->format('Y-m-d'); ?>
<td><?= $hist->end === null ? '' : $hist->end->format('Y-m-d'); ?>
<td><?= $this->printHtml($hist->jobTitle); ?>
<td><?= $this->printHtml($hist->address->name); ?>
<?php endforeach; ?>
<template class="oms-add-tpl-work">
<tr class="animated medium-duration greenCircleFade" data-id="" draggable="false">
<td>
<i class="g-icon btn update-form">settings</i>
<input id="workTable-remove-0" type="checkbox" class="vh">
<label for="workTable-remove-0" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
<span class="checked-visibility">
<label for="workTable-remove-0" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
<label for="workTable-remove-0" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
</span>
<td data-tpl-text="/id" data-tpl-value="/id"></td>
<td data-tpl-text="/start" data-tpl-value="/start"></td>
<td data-tpl-text="/end" data-tpl-value="/end"></td>
<td data-tpl-text="/title" data-tpl-value="/title"></td>
<td data-tpl-text="/address" data-tpl-value="/address"></td>
</tr>
</template>
<?php $c = 0;
foreach ($work as $key => $value) : ++$c; ?>
<tr data-id="<?= $value->id; ?>">
<td>
<i class="g-icon btn update-form">settings</i>
<input id="workTable-remove-<?= $value->id; ?>" type="checkbox" class="vh">
<label for="workTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
<span class="checked-visibility">
<label for="workTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
<label for="workTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
</span>
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
<td data-tpl-text="/start" data-tpl-value="/start" data-value="<?= $value->start->format('Y-m-d'); ?>"><?= $value->start->format('Y-m-d'); ?>
<td data-tpl-text="/end" data-tpl-value="/end" data-value="<?= $value->end?->format('Y-m-d'); ?>"><?= $value->end === null ? '' : $value->end->format('Y-m-d'); ?>
<td data-tpl-text="/title" data-tpl-value="/title"><?= $this->printHtml($value->jobTitle); ?>
<td data-tpl-text="/address" data-tpl-value="/address"><?= $this->printHtml($value->address->name); ?>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr>
<td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
</div>