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()); ?> - + printHtml($value->getId()); ?> printHtml($value->getName()); ?> diff --git a/Theme/Backend/staff-list.tpl.php b/Theme/Backend/staff-list.tpl.php index 24468fe..ab8cba8 100644 --- a/Theme/Backend/staff-list.tpl.php +++ b/Theme/Backend/staff-list.tpl.php @@ -42,7 +42,7 @@ echo $this->getData('nav')->render(); ?> render(); ?> $value) : $c++; - $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/hr/staff/single?{?}&id=' . $value->getId()); ?> + $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/hr/staff/profile?{?}&id=' . $value->getId()); ?> printHtml($value->getId()); ?> printHtml($value->getAccount()->getName1()); ?> diff --git a/Theme/Backend/staff-single.tpl.php b/Theme/Backend/staff-single.tpl.php index 42ffa69..920c0c3 100644 --- a/Theme/Backend/staff-single.tpl.php +++ b/Theme/Backend/staff-single.tpl.php @@ -11,147 +11,86 @@ * @version 1.0.0 * @link http://orange-management.com */ + +$employee = $this->getData('employee'); + echo $this->getData('nav')->render(); ?> -
-

getHtml('Employee') ?>

-
- - - - - - - - - - - - - - - -
getHtml('Name') ?> - printHtml($account->getName3()); ?>, printHtml($account->getName1()); ?> -
getHtml('Position') ?> - Sailor -
getHtml('Department') ?> - Sailor -
getHtml('Birthday') ?> - 06.09.1934 -
getHtml('Email') ?> - printHtml($account->getEmail()); ?> -
Address - -
Private - SMALLSYS INC
795 E DRAGRAM
TUCSON AZ 85705
USA -
Work - SMALLSYS INC
795 E DRAGRAM
TUCSON AZ 85705
USA -
getHtml('Phone') ?> - -
Private - +01 12345-4567 -
Mobile - +01 12345-4567 -
Work - +01 12345-4567 -
getHtml('Status') ?> - printHtml($account->getStatus()); ?> -
- +
+
+
+

printHtml($employee->getAccount()->getName3()); ?>, printHtml($employee->getAccount()->getName1()); ?>

+
+ + + + + + + + + + + + + + + +
getHtml('Position') ?> + printHtml($employee->getPosition()->getName()); ?> +
getHtml('Department') ?> + printHtml($employee->getDepartment()->getName()); ?> +
getHtml('Unit') ?> + printHtml($employee->getUnit()->getName()); ?> +
getHtml('Birthday') ?> + 06.09.1934 +
getHtml('Email') ?> + 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 +
getHtml('Phone') ?> + +
Private + +01 12345-4567 +
Mobile + +01 12345-4567 +
Work + +01 12345-4567 +
getHtml('Status') ?> + printHtml($employee->getAccount()->getStatus()); ?> +
+ +
+
-
-
-

getHtml('Overview') ?>

-
- - - - - - - -
getHtml('Start') ?> - printHtml($account->getName3()); ?> -
getHtml('End') ?> - printHtml($account->getName3()); ?> -
getHtml('Hours') ?> - printHtml($account->getName3()); ?> -
getHtml('Vacation') ?> - printHtml($account->getName3()); ?> -
getHtml('Salary') ?> - printHtml($account->getName3()); ?> -
- +
+
+

getHtml('Clocking') ?>

+
+
+
-
- -
- - - - - - - $value) : $c++; - $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?> - -
getHtml('Working') ?>
getHtml('Start') ?> - getHtml('End') ?> - getHtml('Position') ?> - getHtml('Department') ?> - getHtml('Salary') ?> -
render(); ?> -
printHtml($value->getId()); ?> - printHtml($value->getNewestHistory()->getPosition()); ?> - printHtml($value->getNewestHistory()->getPosition()); ?> - - -
getHtml('Empty', 0, 0); ?> - -
-
- - - - - - - $value) : $c++; - $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?> - -
getHtml('Timing') ?>
getHtml('Start') ?> - getHtml('End') ?> - getHtml('Type') ?> -
render(); ?> -
printHtml($value->getId()); ?> - printHtml($value->getNewestHistory()->getPosition()); ?> - printHtml($value->getNewestHistory()->getPosition()); ?> - - -
getHtml('Empty', 0, 0); ?> - -
-
- -
-

getHtml('Salary') ?>

-
- - - - - -
getHtml('Date') ?> - printHtml($account->getName3()); ?> -
getHtml('SalaryType') ?> - printHtml($account->getName3()); ?> -
getHtml('Amount') ?> - printHtml($account->getName3()); ?> -
- +
+
+
+

getHtml('Clocking') ?>

+
+
+
-
+ +
+
+

getHtml('History') ?>

+
+
+
+
+ \ No newline at end of file