Optimize hr templates

This commit is contained in:
Dennis Eichhorn 2017-09-30 11:04:00 +02:00
parent 95cdff502c
commit fca9e23636
9 changed files with 100 additions and 183 deletions

View File

@ -47,6 +47,7 @@ class Installer extends InstallerAbstract
`hr_staff_unit` int(11) DEFAULT NULL, `hr_staff_unit` int(11) DEFAULT NULL,
`hr_staff_department` int(11) DEFAULT NULL, `hr_staff_department` int(11) DEFAULT NULL,
`hr_staff_position` int(11) DEFAULT NULL, `hr_staff_position` int(11) DEFAULT NULL,
`hr_staff_active` int(1) NOT NULL,
PRIMARY KEY (`hr_staff_id`), PRIMARY KEY (`hr_staff_id`),
KEY `hr_staff_account` (`hr_staff_account`), KEY `hr_staff_account` (`hr_staff_account`),
KEY `hr_staff_unit` (`hr_staff_unit`), KEY `hr_staff_unit` (`hr_staff_unit`),

View File

@ -137,6 +137,10 @@ class Controller extends ModuleAbstract implements WebInterface
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-single'); $view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-single');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response)); $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; return $view;
} }

View File

@ -43,6 +43,8 @@ class Employee {
private $position = null; private $position = null;
private $isActive = true;
private $history = []; private $history = [];
private $status = []; private $status = [];
@ -56,6 +58,16 @@ class Employee {
return $this->account; return $this->account;
} }
public function setActivity(bool $active)
{
$this->active = $active;
}
public function isActive() : bool
{
return $this->isActive;
}
public function setUnit($unit) public function setUnit($unit)
{ {
$this->unit = $unit; $this->unit = $unit;

View File

@ -35,6 +35,7 @@ class EmployeeMapper extends DataMapperAbstract
'hr_staff_unit' => ['name' => 'hr_staff_unit', 'type' => 'int', 'internal' => 'unit'], 'hr_staff_unit' => ['name' => 'hr_staff_unit', 'type' => 'int', 'internal' => 'unit'],
'hr_staff_department' => ['name' => 'hr_staff_department', 'type' => 'int', 'internal' => 'department'], 'hr_staff_department' => ['name' => 'hr_staff_department', 'type' => 'int', 'internal' => 'department'],
'hr_staff_position' => ['name' => 'hr_staff_position', 'type' => 'int', 'internal' => 'position'], '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 = [ static protected $belongsTo = [

View File

@ -1,45 +0,0 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
declare(strict_types=1);
namespace Modules\HumanResourceManagement\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Position type enum.
*
* @category Module
* @package Modules\HumanResources
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
abstract class PositionType extends Enum
{
/* public */ const INTERN = 0;
/* public */ const APPRENTICE = 1;
/* public */ const JUNIOR = 2;
/* public */ const REGULAR = 3;
/* public */ const SENIOR = 4;
/* public */ const ASSISTANT = 5;
/* public */ const TEAMLEADER = 6;
/* public */ const HEAD = 7;
}

View File

@ -12,9 +12,13 @@
* @link http://orange-management.com * @link http://orange-management.com
*/ */
return ['HumanResourceManagement' => [ return ['HumanResourceManagement' => [
'Birthday' => 'Birthday',
'Clocking' => 'Clocking',
'Department' => 'Department', 'Department' => 'Department',
'Departments' => 'Departments', 'Departments' => 'Departments',
'Email' => 'Email',
'Employees' => 'Employees', 'Employees' => 'Employees',
'History' => 'History',
'Name' => 'Name', 'Name' => 'Name',
'Parent' => 'Parent', 'Parent' => 'Parent',
'Personnel' => 'Personnel', 'Personnel' => 'Personnel',
@ -22,5 +26,6 @@ return ['HumanResourceManagement' => [
'Shifts' => 'Shifts', 'Shifts' => 'Shifts',
'Staff' => 'Staff', 'Staff' => 'Staff',
'Status' => 'Status', 'Status' => 'Status',
'Unit' => 'Unit',
'Vacation' => 'Vacation', 'Vacation' => 'Vacation',
]]; ]];

View File

@ -42,7 +42,7 @@ echo $this->getData('nav')->render(); ?>
<tbody> <tbody>
<?php $c = 0; foreach ($departments as $key => $value) : $c++; <?php $c = 0; foreach ($departments as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/hr/department/single?{?}&id=' . $value->getId()); ?> $url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/hr/department/single?{?}&id=' . $value->getId()); ?>
<tr> <tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
<td> <td>

View File

@ -42,7 +42,7 @@ echo $this->getData('nav')->render(); ?>
<tr><td colspan="5"><?= $footerView->render(); ?> <tr><td colspan="5"><?= $footerView->render(); ?>
<tbody> <tbody>
<?php $c = 0; foreach ($employees as $key => $value) : $c++; <?php $c = 0; foreach ($employees as $key => $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()); ?>
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getAccount()->getName1()); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getAccount()->getName1()); ?></a>

View File

@ -11,147 +11,86 @@
* @version 1.0.0 * @version 1.0.0
* @link http://orange-management.com * @link http://orange-management.com
*/ */
$employee = $this->getData('employee');
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<section itemscope itemtype="http://schema.org/Person" class="box w-33"> <div class="row">
<header><h1><?= $this->getHtml('Employee') ?></h1></header> <div class="col-xs-12 col-md-6">
<div class="inner"> <section itemscope itemtype="http://schema.org/Person" class="box wf-100">
<!-- @formatter:off --> <header><h1><span itemprop="familyName"><?= $this->printHtml($employee->getAccount()->getName3()); ?></span>, <span itemprop="givenName"><?= $this->printHtml($employee->getAccount()->getName1()); ?></span></h1></header>
<table class="list"> <div class="inner">
<tr> <!-- @formatter:off -->
<th><?= $this->getHtml('Name') ?> <table class="list">
<td><span itemprop="familyName"><?= $this->printHtml($account->getName3()); ?></span>, <span itemprop="givenName"><?= $this->printHtml($account->getName1()); ?></span> <tr>
<tr> <th><?= $this->getHtml('Position') ?>
<th><?= $this->getHtml('Position') ?> <td itemprop="jobTitle"><?= $this->printHtml($employee->getPosition()->getName()); ?>
<td itemprop="jobTitle">Sailor <tr>
<tr> <th><?= $this->getHtml('Department') ?>
<th><?= $this->getHtml('Department') ?> <td itemprop="jobTitle"><?= $this->printHtml($employee->getDepartment()->getName()); ?>
<td itemprop="jobTitle">Sailor <tr>
<tr> <th><?= $this->getHtml('Unit') ?>
<th><?= $this->getHtml('Birthday') ?> <td itemprop="jobTitle"><?= $this->printHtml($employee->getUnit()->getName()); ?>
<td itemprop="birthDate">06.09.1934 <tr>
<tr> <th><?= $this->getHtml('Birthday') ?>
<th><?= $this->getHtml('Email') ?> <td itemprop="birthDate">06.09.1934
<td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $this->printHtml($account->getEmail()); ?></a> <tr>
<tr> <th><?= $this->getHtml('Email') ?>
<th>Address <td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $this->printHtml($employee->getAccount()->getEmail()); ?></a>
<td> <tr>
<tr> <th>Address
<th class="vT">Private <td>
<td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA <tr>
<tr> <th class="vT">Private
<th class="vT">Work <td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA
<td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA <tr>
<tr> <th class="vT">Work
<th><?= $this->getHtml('Phone') ?> <td itemprop="address">SMALLSYS INC<br>795 E DRAGRAM<br>TUCSON AZ 85705<br>USA
<td> <tr>
<tr> <th><?= $this->getHtml('Phone') ?>
<th>Private <td>
<td itemprop="telephone">+01 12345-4567 <tr>
<tr> <th>Private
<th>Mobile <td itemprop="telephone">+01 12345-4567
<td itemprop="telephone">+01 12345-4567 <tr>
<tr> <th>Mobile
<th>Work <td itemprop="telephone">+01 12345-4567
<td itemprop="telephone">+01 12345-4567 <tr>
<tr> <th>Work
<th><?= $this->getHtml('Status') ?> <td itemprop="telephone">+01 12345-4567
<td><span class="tag green"><?= $this->printHtml($account->getStatus()); ?></span> <tr>
</table> <th><?= $this->getHtml('Status') ?>
<!-- @formatter:on --> <td><span class="tag green"><?= $this->printHtml($employee->getAccount()->getStatus()); ?></span>
</table>
<!-- @formatter:on -->
</div>
</section>
</div> </div>
</section>
<section class="box w-33"> <div class="col-xs-12 col-md-6">
<header><h1><?= $this->getHtml('Overview') ?></h1></header> <section class="box wf-100">
<div class="inner"> <header><h1><?= $this->getHtml('Clocking') ?></h1></header>
<!-- @formatter:off --> <div class="inner">
<table class="list"> </div>
<tr> </section>
<th><?= $this->getHtml('Start') ?>
<td><span itemprop="familyName"><?= $this->printHtml($account->getName3()); ?></span>
<tr>
<th><?= $this->getHtml('End') ?>
<td><span itemprop="familyName"><?= $this->printHtml($account->getName3()); ?></span>
<tr>
<th><?= $this->getHtml('Hours') ?>
<td><span itemprop="familyName"><?= $this->printHtml($account->getName3()); ?></span>
<tr>
<th><?= $this->getHtml('Vacation') ?>
<td><span itemprop="familyName"><?= $this->printHtml($account->getName3()); ?></span>
<tr>
<th><?= $this->getHtml('Salary') ?>
<td><span itemprop="familyName"><?= $this->printHtml($account->getName3()); ?></span>
</table>
<!-- @formatter:on -->
</div> </div>
</section>
<div class="box w-100">
<table class="table red">
<caption><?= $this->getHtml('Working') ?></caption>
<thead>
<tr>
<td><?= $this->getHtml('Start') ?>
<td><?= $this->getHtml('End') ?>
<td><?= $this->getHtml('Position') ?>
<td><?= $this->getHtml('Department') ?>
<td><?= $this->getHtml('Salary') ?>
<tfoot>
<tr><td colspan="4"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ($employees as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getNewestHistory()->getPosition()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getNewestHistory()->getPosition()); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div> </div>
<div class="box w-100"> <div class="row">
<table class="table red"> <div class="col-xs-12 col-md-6">
<caption><?= $this->getHtml('Timing') ?></caption> <section class="box wf-100">
<thead> <header><h1><?= $this->getHtml('Clocking') ?></h1></header>
<tr> <div class="inner">
<td><?= $this->getHtml('Start') ?> </div>
<td><?= $this->getHtml('End') ?> </section>
<td class="wf-100"><?= $this->getHtml('Type') ?>
<tfoot>
<tr><td colspan="4"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ($employees as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getId()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getNewestHistory()->getPosition()); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getNewestHistory()->getPosition()); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>
<section class="box w-33">
<header><h1><?= $this->getHtml('Salary') ?></h1></header>
<div class="inner">
<!-- @formatter:off -->
<table class="list">
<tr>
<th><?= $this->getHtml('Date') ?>
<td><span itemprop="familyName"><?= $this->printHtml($account->getName3()); ?></span>
<tr>
<th><?= $this->getHtml('SalaryType') ?>
<td><span itemprop="familyName"><?= $this->printHtml($account->getName3()); ?></span>
<tr>
<th><?= $this->getHtml('Amount') ?>
<td><span itemprop="familyName"><?= $this->printHtml($account->getName3()); ?></span>
</table>
<!-- @formatter:on -->
</div> </div>
</section>
<div class="col-xs-12 col-md-6">
<section class="box wf-100">
<header><h1><?= $this->getHtml('History') ?></h1></header>
<div class="inner">
</div>
</section>
</div>
</div>