diff --git a/Admin/Installer.php b/Admin/Installer.php index 7c8ed27..a0ba84b 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -47,6 +47,7 @@ class Installer extends InstallerAbstract `hr_staff_unit` int(11) DEFAULT NULL, `hr_staff_department` int(11) DEFAULT NULL, `hr_staff_position` int(11) DEFAULT NULL, + `hr_staff_active` int(1) NOT NULL, PRIMARY KEY (`hr_staff_id`), KEY `hr_staff_account` (`hr_staff_account`), KEY `hr_staff_unit` (`hr_staff_unit`), diff --git a/Controller.php b/Controller.php index 14d9333..a12bda0 100644 --- a/Controller.php +++ b/Controller.php @@ -137,6 +137,10 @@ class Controller extends ModuleAbstract implements WebInterface $view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-single'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response)); + $employee = EmployeeMapper::get((int) $request->getData('id')); + + $view->addData('employee', $employee); + return $view; } diff --git a/Models/Employee.php b/Models/Employee.php index ae57371..53a618f 100644 --- a/Models/Employee.php +++ b/Models/Employee.php @@ -43,6 +43,8 @@ class Employee { private $position = null; + private $isActive = true; + private $history = []; private $status = []; @@ -56,6 +58,16 @@ class Employee { return $this->account; } + public function setActivity(bool $active) + { + $this->active = $active; + } + + public function isActive() : bool + { + return $this->isActive; + } + public function setUnit($unit) { $this->unit = $unit; diff --git a/Models/EmployeeMapper.php b/Models/EmployeeMapper.php index 0afb47b..c488e81 100644 --- a/Models/EmployeeMapper.php +++ b/Models/EmployeeMapper.php @@ -35,6 +35,7 @@ class EmployeeMapper extends DataMapperAbstract 'hr_staff_unit' => ['name' => 'hr_staff_unit', 'type' => 'int', 'internal' => 'unit'], 'hr_staff_department' => ['name' => 'hr_staff_department', 'type' => 'int', 'internal' => 'department'], 'hr_staff_position' => ['name' => 'hr_staff_position', 'type' => 'int', 'internal' => 'position'], + 'hr_staff_active' => ['name' => 'hr_staff_active', 'type' => 'bool', 'internal' => 'isActive'], ]; static protected $belongsTo = [ diff --git a/Models/PositionType.php b/Models/PositionType.php deleted file mode 100644 index 384c3dd..0000000 --- a/Models/PositionType.php +++ /dev/null @@ -1,45 +0,0 @@ - [ + 'Birthday' => 'Birthday', + 'Clocking' => 'Clocking', 'Department' => 'Department', 'Departments' => 'Departments', + 'Email' => 'Email', 'Employees' => 'Employees', + 'History' => 'History', 'Name' => 'Name', 'Parent' => 'Parent', 'Personnel' => 'Personnel', @@ -22,5 +26,6 @@ return ['HumanResourceManagement' => [ 'Shifts' => 'Shifts', 'Staff' => 'Staff', 'Status' => 'Status', + 'Unit' => 'Unit', 'Vacation' => 'Vacation', ]]; diff --git a/Theme/Backend/department-list.tpl.php b/Theme/Backend/department-list.tpl.php index ebf8900..ff45bbc 100644 --- a/Theme/Backend/department-list.tpl.php +++ b/Theme/Backend/department-list.tpl.php @@ -42,7 +42,7 @@ echo $this->getData('nav')->render(); ?>
$value) : $c++; $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/hr/department/single?{?}&id=' . $value->getId()); ?> -| = $this->getHtml('Name') ?> - | = $this->printHtml($account->getName3()); ?>, = $this->printHtml($account->getName1()); ?> - |
|---|---|
| = $this->getHtml('Position') ?> - | Sailor - |
| = $this->getHtml('Department') ?> - | Sailor - |
| = $this->getHtml('Birthday') ?> - | 06.09.1934 - |
| = $this->getHtml('Email') ?> - | = $this->printHtml($account->getEmail()); ?> - |
| Address - | - |
| Private - | SMALLSYS INC 795 E DRAGRAM TUCSON AZ 85705 USA - |
| Work - | SMALLSYS INC 795 E DRAGRAM TUCSON AZ 85705 USA - |
| = $this->getHtml('Phone') ?> - | - |
| Private - | +01 12345-4567 - |
| Mobile - | +01 12345-4567 - |
| Work - | +01 12345-4567 - |
| = $this->getHtml('Status') ?> - | = $this->printHtml($account->getStatus()); ?> - |
| = $this->getHtml('Position') ?> + | = $this->printHtml($employee->getPosition()->getName()); ?> + |
|---|---|
| = $this->getHtml('Department') ?> + | = $this->printHtml($employee->getDepartment()->getName()); ?> + |
| = $this->getHtml('Unit') ?> + | = $this->printHtml($employee->getUnit()->getName()); ?> + |
| = $this->getHtml('Birthday') ?> + | 06.09.1934 + |
| = $this->getHtml('Email') ?> + | = $this->printHtml($employee->getAccount()->getEmail()); ?> + |
| Address + | + |
| Private + | SMALLSYS INC 795 E DRAGRAM TUCSON AZ 85705 USA + |
| Work + | SMALLSYS INC 795 E DRAGRAM TUCSON AZ 85705 USA + |
| = $this->getHtml('Phone') ?> + | + |
| Private + | +01 12345-4567 + |
| Mobile + | +01 12345-4567 + |
| Work + | +01 12345-4567 + |
| = $this->getHtml('Status') ?> + | = $this->printHtml($employee->getAccount()->getStatus()); ?> + |
| = $this->getHtml('Start') ?> - | = $this->printHtml($account->getName3()); ?> - |
|---|---|
| = $this->getHtml('End') ?> - | = $this->printHtml($account->getName3()); ?> - |
| = $this->getHtml('Hours') ?> - | = $this->printHtml($account->getName3()); ?> - |
| = $this->getHtml('Vacation') ?> - | = $this->printHtml($account->getName3()); ?> - |
| = $this->getHtml('Salary') ?> - | = $this->printHtml($account->getName3()); ?> - |
| = $this->getHtml('Start') ?> - | = $this->getHtml('End') ?> - | = $this->getHtml('Position') ?> - | = $this->getHtml('Department') ?> - | = $this->getHtml('Salary') ?> - |
| = $footerView->render(); ?> - | ||||
| = $this->printHtml($value->getId()); ?> - | = $this->printHtml($value->getNewestHistory()->getPosition()); ?> - | = $this->printHtml($value->getNewestHistory()->getPosition()); ?> - - - | ||
| = $this->getHtml('Empty', 0, 0); ?> - - | ||||
| = $this->getHtml('Start') ?> - | = $this->getHtml('End') ?> - | = $this->getHtml('Type') ?> - | |
| = $footerView->render(); ?> - | |||
| = $this->printHtml($value->getId()); ?> - | = $this->printHtml($value->getNewestHistory()->getPosition()); ?> - | = $this->printHtml($value->getNewestHistory()->getPosition()); ?> - - - | |
| = $this->getHtml('Empty', 0, 0); ?> - - | |||
| = $this->getHtml('Date') ?> - | = $this->printHtml($account->getName3()); ?> - |
|---|---|
| = $this->getHtml('SalaryType') ?> - | = $this->printHtml($account->getName3()); ?> - |
| = $this->getHtml('Amount') ?> - | = $this->printHtml($account->getName3()); ?> - |