Bulkl path fix reverse

This commit is contained in:
Dennis Eichhorn 2017-02-12 21:43:10 +01:00
parent 80c9b7ea3e
commit b2a167242a
33 changed files with 1464 additions and 0 deletions

44
Admin/Activate.php Normal file
View File

@ -0,0 +1,44 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\ActivateAbstract;
use phpOMS\Module\InfoManager;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Activate extends ActivateAbstract
{
/**
* {@inheritdoc}
*/
public static function activate(DatabasePool $dbPool, InfoManager $info)
{
parent::activate($dbPool, $info);
}
}

44
Admin/Deactivate.php Normal file
View File

@ -0,0 +1,44 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\DeactivateAbstract;
use phpOMS\Module\InfoManager;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Deactivate extends DeactivateAbstract
{
/**
* {@inheritdoc}
*/
public static function deactivate(DatabasePool $dbPool, InfoManager $info)
{
parent::deactivate($dbPool, $info);
}
}

View File

@ -0,0 +1,98 @@
[
{
"id": 1002401001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 0,
"name": "HumanResourceManagement",
"uri": null,
"target": "self",
"icon": "fa fa-user",
"order": 90,
"from": "HumanResourceManagement",
"permission": null,
"parent": 0,
"children": [
{
"id": 1002402001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "Employees",
"uri": "/{/lang}/backend/hr/staff/list?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "HumanResourceManagement",
"permission": null,
"parent": 1002401001,
"children": [
{
"id": 1002402101,
"pid": "29a67db2902a784f66b5e896efd84b0004be2087",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "/{/lang}/backend/hr/staff/list?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "HumanResourceManagement",
"permission": null,
"parent": 1002402001,
"children": [
]
},
{
"id": 1002402201,
"pid": "29a67db2902a784f66b5e896efd84b0004be2087",
"type": 3,
"subtype": 1,
"name": "Create",
"uri": "/{/lang}/backend/hr/staff/create?{?}",
"target": "self",
"icon": null,
"order": 5,
"from": "HumanResourceManagement",
"permission": null,
"parent": 1002402001,
"children": [
]
}
]
},
{
"id": 1002403001,
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
"type": 2,
"subtype": 1,
"name": "Departments",
"uri": "/{/lang}/backend/hr/department/list?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "HumanResourceManagement",
"permission": null,
"parent": 1002401001,
"children": [
{
"id": 1002403101,
"pid": "5696bf086bb04c219b1a2654ad9df177c35be669",
"type": 3,
"subtype": 1,
"name": "List",
"uri": "/{/lang}/backend/hr/department/list?{?}",
"target": "self",
"icon": null,
"order": 1,
"from": "HumanResourceManagement",
"permission": null,
"parent": 1002403001,
"children": [
]
}
]
}
]
}
]

View File

@ -0,0 +1,40 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Admin\Install;
use phpOMS\DataStorage\Database\DatabasePool;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Navigation
{
public static function install(string $path, DatabasePool $dbPool)
{
$navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true);
$class = '\\Modules\\Navigation\\Admin\\Installer';
/** @var $class \Modules\Navigation\Admin\Installer */
$class::installExternal($dbPool, $navData);
}
}

153
Admin/Installer.php Normal file
View File

@ -0,0 +1,153 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Admin;
use phpOMS\DataStorage\Database\DatabaseType;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\InfoManager;
use phpOMS\Module\InstallerAbstract;
/**
* Human Resources install class.
*
* @category Modules
* @package Modules\HumanResourceManagement
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Installer extends InstallerAbstract
{
/**
* {@inheritdoc}
*/
public static function install(string $path, DatabasePool $dbPool, InfoManager $info)
{
parent::install($path, $dbPool, $info);
switch ($dbPool->get('core')->getType()) {
case DatabaseType::MYSQL:
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'hr_staff` (
`hr_staff_id` int(11) NOT NULL AUTO_INCREMENT,
`hr_staff_account` int(11) DEFAULT NULL,
PRIMARY KEY (`hr_staff_id`),
KEY `hr_staff_account` (`hr_staff_account`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'hr_staff`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'hr_staff_ibfk_1` FOREIGN KEY (`hr_staff_account`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
)->execute();
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'hr_staff_history` (
`hr_staff_history_id` int(11) NOT NULL AUTO_INCREMENT,
`hr_staff_history_staff` int(11) DEFAULT NULL,
`hr_staff_history_position` int(11) DEFAULT NULL,
`hr_staff_history_department` int(11) DEFAULT NULL,
`hr_staff_history_start` datetime DEFAULT NULL,
`hr_staff_history_end` datetime DEFAULT NULL,
PRIMARY KEY (`hr_staff_history_id`),
KEY `hr_staff_history_staff` (`hr_staff_history_staff`),
KEY `hr_staff_history_department` (`hr_staff_history_department`),
KEY `hr_staff_history_position` (`hr_staff_history_position`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'hr_staff_history`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'hr_staff_history_ibfk_1` FOREIGN KEY (`hr_staff_history_staff`) REFERENCES `' . $dbPool->get('core')->prefix . 'hr_staff` (`hr_staff_id`),
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'hr_staff_history_ibfk_2` FOREIGN KEY (`hr_staff_history_department`) REFERENCES `' . $dbPool->get('core')->prefix . 'organization_department` (`organization_department_id`),
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'hr_staff_history_ibfk_3` FOREIGN KEY (`hr_staff_history_position`) REFERENCES `' . $dbPool->get('core')->prefix . 'organization_position` (`organization_position_id`);'
)->execute();
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'hr_staff_contract` (
`hr_staff_contract_id` int(11) NOT NULL AUTO_INCREMENT,
`hr_staff_contract_stype` tinyint(1) DEFAULT NULL,
`hr_staff_contract_salary` decimal(8,2) DEFAULT NULL,
`hr_staff_contract_cformingbenefits` decimal(8,2) DEFAULT NULL,
`hr_staff_contract_working_hours` int(11) DEFAULT NULL,
`hr_staff_contract_vacation` tinyint(3) DEFAULT NULL,
`hr_staff_contract_vtype` tinyint(3) DEFAULT NULL,
`hr_staff_contract_personal_time` tinyint(3) DEFAULT NULL,
`hr_staff_contract_start` datetime DEFAULT NULL,
`hr_staff_contract_end` datetime DEFAULT NULL,
`hr_staff_contract_employee` int(11) DEFAULT NULL,
PRIMARY KEY (`hr_staff_contract_id`),
KEY `hr_staff_contract_employee` (`hr_staff_contract_employee`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'hr_staff_contract`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'hr_staff_contract_ibfk_1` FOREIGN KEY (`hr_staff_contract_employee`) REFERENCES `' . $dbPool->get('core')->prefix . 'hr_staff` (`hr_staff_id`);'
)->execute();
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'hr_planning_shift` (
`HRPlanningShiftID` int(11) NOT NULL AUTO_INCREMENT,
`amount` int(11) DEFAULT NULL,
`position` int(11) DEFAULT NULL,
`department` int(11) DEFAULT NULL,
`start` datetime DEFAULT NULL,
`end` datetime DEFAULT NULL,
PRIMARY KEY (`HRPlanningShiftID`),
KEY `department` (`department`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;'
)->execute();
/*
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'hr_planning_shift`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'hr_planning_shift_ibfk_1` FOREIGN KEY (`department`) REFERENCES `' . $dbPool->get('core')->prefix . 'organization_department` (`organization_department_id`);'
)->execute();*/
$dbPool->get('core')->con->prepare(
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'hr_planning_staff` (
`HRPlanningStaffID` int(11) NOT NULL AUTO_INCREMENT,
`person` int(11) DEFAULT NULL,
`start` datetime DEFAULT NULL,
`end` datetime DEFAULT NULL,
`status` tinyint(1) NOT NULL,
`type` tinyint(1) NOT NULL,
`repeat` tinyint(1) NOT NULL,
`rep_interval` tinyint(3) NOT NULL,
`rep_monday` tinyint(1) NOT NULL,
`rep_tuesday` tinyint(1) NOT NULL,
`rep_wednesday` tinyint(1) NOT NULL,
`rep_thursday` tinyint(1) NOT NULL,
`rep_friday` tinyint(1) NOT NULL,
`rep_saturday` tinyint(1) NOT NULL,
`rep_sunday` tinyint(1) NOT NULL,
PRIMARY KEY (`HRPlanningStaffID`),
KEY `person` (`person`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;'
)->execute();
$dbPool->get('core')->con->prepare(
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'hr_planning_staff`
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'hr_planning_staff_ibfk_1` FOREIGN KEY (`person`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);'
)->execute();
break;
}
}
}

View File

@ -0,0 +1,24 @@
<?php
use phpOMS\Router\RouteVerb;
return [
'^.*/backend/hr/staff/list.*$' => [
[
'dest' => '\Modules\HumanResourceManagement\Controller:viewHrList',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/hr/staff/create.*$' => [
[
'dest' => '\Modules\HumanResourceManagement\Controller:viewHrCreate',
'verb' => RouteVerb::GET,
],
],
'^.*/backend/hr/department/list.*$' => [
[
'dest' => '\Modules\HumanResourceManagement\Controller:viewHrDepartmentList',
'verb' => RouteVerb::GET,
],
],
];

3
Admin/Routes/console.php Normal file
View File

@ -0,0 +1,3 @@
<?php
$moduleRoutes = [];

3
Admin/Routes/socket.php Normal file
View File

@ -0,0 +1,3 @@
<?php
$moduleRoutes = [];

56
Admin/Uninstall.php Normal file
View File

@ -0,0 +1,56 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\DataStorage\Database\Schema\Builder;
use phpOMS\Module\UninstallAbstract;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Uninstall extends UninstallAbstract
{
/**
* {@inheritdoc}
*/
public static function uninstall(DatabasePool $dbPool, InfoManager $info)
{
parent::uninstall($dbPool, $info);
$query = new Builder($dbPool->get());
$query->prefix($dbPool->get('core')->getPrefix())->drop(
'hr_planning_staff',
'hr_planning_shift',
'hr_staff_contract',
'hr_staff_history',
'hr_staff'
);
$dbPool->get()->con->prepare($query->toSql())->execute();
}
}

46
Admin/Update.php Normal file
View File

@ -0,0 +1,46 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Admin;
use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Module\UpdateAbstract;
use phpOMS\System\File\Directory;
/**
* Navigation class.
*
* @category Modules
* @package Modules\Admin
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Update extends UpdateAbstract
{
/**
* {@inheritdoc}
*/
public static function update(DatabasePool $dbPool, array $info)
{
Directory::deletePath(__DIR__ . '/Update');
mkdir('Update');
parent::update($dbPool, $info);
}
}

139
Controller.php Normal file
View File

@ -0,0 +1,139 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Module\ModuleAbstract;
use phpOMS\Module\WebInterface;
use phpOMS\Views\View;
use Modules\HumanResourceManagement\Models\EmployeeMapper;
/**
* Human Resources controller class.
*
* @category Modules
* @package Modules\HumanResourceManagement
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Controller extends ModuleAbstract implements WebInterface
{
/**
* Module path.
*
* @var string
* @since 1.0.0
*/
/* public */ const MODULE_PATH = __DIR__;
/**
* Module version.
*
* @var string
* @since 1.0.0
*/
/* public */ const MODULE_VERSION = '1.0.0';
/**
* Module name.
*
* @var string
* @since 1.0.0
*/
/* public */ const MODULE_NAME = 'HumanResourceManagement';
/**
* Providing.
*
* @var string
* @since 1.0.0
*/
protected static $providing = [];
/**
* Dependencies.
*
* @var string
* @since 1.0.0
*/
protected static $dependencies = [
];
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return \Serializable
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewHrList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response));
$view->setData('employees', EmployeeMapper::getAll());
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return \Serializable
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewHrCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/staff-create');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002402001, $request, $response));
return $view;
}
/**
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return \Serializable
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function viewHrDepartmentList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
{
$view = new View($this->app, $request, $response);
$view->setTemplate('/Modules/HumanResourceManagement/Theme/Backend/department-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1002403001, $request, $response));
return $view;
}
}

0
Models/Department.php Normal file
View File

60
Models/Employee.php Normal file
View File

@ -0,0 +1,60 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Models;
use Modules\Admin\Models\Account;
/**
* Employee class.
*
* @category HumanResources
* @package Framework
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class Employee {
/**
* Employee ID.
*
* @var int
* @since 1.0.0
*/
private $id = 0;
private $account = null;
private $history = [];
private $status = [];
public function setAccount(Account $account)
{
$this->account = $account;
}
public function getAccount() : Account {
return $this->account;
}
public function getId() : int
{
return $this->id;
}
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Models;
/**
* Employee class.
*
* @category HumanResources
* @package Framework
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class EmployeeHistory {
}

View File

@ -0,0 +1,22 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;
class EmployeeHistoryMapper extends DataMapperAbstract
{
}

57
Models/EmployeeMapper.php Normal file
View File

@ -0,0 +1,57 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Models;
use Modules\Admin\Models\AccountMapper;
use phpOMS\DataStorage\Database\DataMapperAbstract;
class EmployeeMapper extends DataMapperAbstract
{
/**
* Columns.
*
* @var array
* @since 1.0.0
*/
protected static $columns = [
'hr_staff_id' => ['name' => 'hr_staff_id', 'type' => 'int', 'internal' => 'id'],
'hr_staff_account' => ['name' => 'hr_staff_account', 'type' => 'int', 'internal' => 'account'],
];
protected static $ownsOne = [
'account' => [
'mapper' => AccountMapper::class,
'src' => 'hr_staff_account',
],
];
/**
* Primary table.
*
* @var string
* @since 1.0.0
*/
protected static $table = 'hr_staff';
/**
* Primary field name.
*
* @var string
* @since 1.0.0
*/
protected static $primaryField = 'hr_staff_id';
}

48
Models/PositionType.php Normal file
View File

@ -0,0 +1,48 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Models;
use phpOMS\Datatypes\Enum;
/**
* Position type enum.
*
* @category Module
* @package Modules\HumanResources
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @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;
}

107
Models/StaffList.php Normal file
View File

@ -0,0 +1,107 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
namespace Modules\HumanResourceManagement\Models;
use phpOMS\DataStorage\Database\DatabaseType;
/**
* Staff list class.
*
* @category Modules
* @package HumanResources
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0
* @link http://orange-management.com
* @since 1.0.0
*/
class StaffList
{
/**
* Database instance.
*
* @var \phpOMS\DataStorage\Database\Pool
* @since 1.0.0
*/
private $dbPool = null;
/**
* Constructor.
*
* @param \phpOMS\DataStorage\Database\DatabasePool $dbPool Database pool instance
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function __construct($dbPool)
{
$this->dbPool = $dbPool;
}
/**
* Get all staff members.
*
* This function gets all accounts in a range
*
* @param array $filter Filter for search results
* @param int $offset Offset for first account
* @param int $limit Limit for results
*
* @return array
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getList($filter = null, $offset = 0, $limit = 100)
{
$result = null;
switch ($this->dbPool->get('core')->getType()) {
case DatabaseType::MYSQL:
$search = $this->dbPool->get('core')->generate_sql_filter($filter, true);
$sth = $this->dbPool->get('core')->con->prepare('SELECT
`' . $this->dbPool->get('core')->prefix . 'hr_staff`.*
FROM
`' . $this->dbPool->get('core')->prefix . 'hr_staff` '
. $search . 'LIMIT ' . $offset . ',' . $limit);
$sth->execute();
$result['list'] = $sth->fetchAll();
$sth = $this->dbPool->get('core')->con->prepare('SELECT FOUND_ROWS();');
$sth->execute();
$result['count'] = $sth->fetchAll()[0][0];
break;
}
return $result;
}
/**
* Get task stats.
*
* @return array
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getStats()
{
}
}

1
README.md Normal file
View File

@ -0,0 +1 @@
# Human Resources #

View File

@ -0,0 +1,27 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
return ['Navigation' => [
'Departments' => 'Departments',
'Employees' => 'Employees',
'HumanResources' => 'Human Resources',
'HumanResourceManagement' => 'Human Resources',
'List' => 'List',
'Planning' => 'Planning',
'Positions' => 'Positions',
'Shifts' => 'Shifts',
'Staff' => 'Staff',
'Structure' => 'Structure',
]];

View File

@ -0,0 +1,28 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
return ['HumanResourceManagement' => [
'Department' => 'Department',
'Departments' => 'Departments',
'Employees' => 'Employees',
'Name' => 'Name',
'Parent' => 'Parent',
'Personnel' => 'Personnel',
'Position' => 'Position',
'Shifts' => 'Shifts',
'Staff' => 'Staff',
'Status' => 'Status',
'Vacation' => 'Vacation',
]];

View File

View File

@ -0,0 +1,54 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(1 / 25);
$footerView->setPage(1);
$footerView->setResults(1);
echo $this->getData('nav')->render(); ?>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('Departments'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Employees'); ?>
<td><?= $this->getText('Parent'); ?>
<tfoot>
<tr><td colspan="4"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ([] as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
<td>
<td>
<td>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>

View File

View File

@ -0,0 +1,98 @@
<div class="b b-1 c24-1 c24" id="i24-1-1">
<header><h1><?= $this->app->accountManager->get($request->getAccount())->getL11n()->lang['HumanResourceManagement']['Vacation'] ?></h1></header>
<div class="bc-1">
<div class="cT">
<i class="fa fa-5x fa-tree"></i>
</div>
<!-- @formatter:off -->
<table class="tc-1" style="margin-top: 5px">
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
</table>
<!-- @formatter:on -->
<div class="cT">
<a href="<?= \phpOMS\Uri\UriFactory::build('/{/lang}/backend/sales/analysis/clients/dashboard'); ?>"
class="button"><?= $this->app->accountManager->get($request->getAccount())->getL11n()->lang[0]['More'] ?></a>
</div>
</div>
</div>
<div class="b b-1 c24-1 c24" id="i24-1-1">
<header><h1><?= $this->app->accountManager->get($request->getAccount())->getL11n()->lang['HumanResourceManagement']['Shifts'] ?></h1></header>
<div class="bc-1">
<div class="cT">
<i class="fa fa-5x fa-clock-o"></i>
</div>
<!-- @formatter:off -->
<table class="tc-1" style="margin-top: 5px">
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
</table>
<!-- @formatter:on -->
<div class="cT">
<a href=""
class="button"><?= $this->app->accountManager->get($request->getAccount())->getL11n()->lang[0]['More'] ?></a>
</div>
</div>
</div>
<div class="b b-1 c24-1 c24" id="i24-1-1">
<header><h1><?= $this->app->accountManager->get($request->getAccount())->getL11n()->lang['HumanResourceManagement']['Personnel'] ?></h1></header>
<div class="bc-1">
<div class="cT">
<i class="fa fa-5x fa-users"></i>
</div>
<!-- @formatter:off -->
<table class="tc-1" style="margin-top: 5px">
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
<tr>
<th><label>Test string</label>
<td>asldkf
</table>
<!-- @formatter:on -->
<div class="cT">
<a href=""
class="button"><?= $this->app->accountManager->get($request->getAccount())->getL11n()->lang[0]['More'] ?></a>
</div>
</div>
</div>

View File

View File

View File

View File

@ -0,0 +1,21 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
echo $this->getData('nav')->render(); ?>

View File

@ -0,0 +1,56 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
/**
* @var \phpOMS\Views\View $this
*/
$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(1 / 25);
$footerView->setPage(1);
$footerView->setResults(1);
$employees = $this->getData('employees');
echo $this->getData('nav')->render(); ?>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('Staff'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('ID', 0, 0); ?>
<td class="wf-100"><?= $this->getText('Name'); ?>
<td><?= $this->getText('Position'); ?>
<td><?= $this->getText('Department'); ?>
<td><?= $this->getText('Status'); ?>
<tfoot>
<tr><td colspan="5"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ($employees as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getNewestHistory()->getPosition(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getNewestHistory()->getPosition(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getNewestStatus()->getStatus(); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="5" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>

View File

@ -0,0 +1,159 @@
<?php
/**
* Orange Management
*
* PHP Version 7.1
*
* @category TBD
* @package TBD
* @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link http://orange-management.com
*/
echo $this->getData('nav')->render(); ?>
<section itemscope itemtype="http://schema.org/Person" class="box w-33">
<header><h1><?= $this->getText('Employee'); ?></h1></header>
<div class="inner">
<!-- @formatter:off -->
<table class="list">
<tr>
<th><?= $this->getText('Name'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>, <span itemprop="givenName"><?= $account->getName1(); ?></span>
<tr>
<th><?= $this->getText('Position'); ?>
<td itemprop="jobTitle">Sailor
<tr>
<th><?= $this->getText('Department'); ?>
<td itemprop="jobTitle">Sailor
<tr>
<th><?= $this->getText('Birthday'); ?>
<td itemprop="birthDate">06.09.1934
<tr>
<th><?= $this->getText('Email'); ?>
<td itemprop="email"><a href="mailto:>donald.duck@email.com<"><?= $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->getText('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->getText('Status'); ?>
<td><span class="tag green"><?= $account->getStatus(); ?></span>
</table>
<!-- @formatter:on -->
</div>
</section>
<section class="box w-33">
<header><h1><?= $this->getText('Overview'); ?></h1></header>
<div class="inner">
<!-- @formatter:off -->
<table class="list">
<tr>
<th><?= $this->getText('Start'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>
<tr>
<th><?= $this->getText('End'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>
<tr>
<th><?= $this->getText('Hours'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>
<tr>
<th><?= $this->getText('Vacation'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>
<tr>
<th><?= $this->getText('Salary'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>
</table>
<!-- @formatter:on -->
</div>
</section>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('Working'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('Start'); ?>
<td><?= $this->getText('End'); ?>
<td><?= $this->getText('Position'); ?>
<td><?= $this->getText('Department'); ?>
<td><?= $this->getText('Salary'); ?>
<tfoot>
<tr><td colspan="4"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ($employees as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getNewestHistory()->getPosition(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getNewestHistory()->getPosition(); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>
<div class="box w-100">
<table class="table">
<caption><?= $this->getText('Timing'); ?></caption>
<thead>
<tr>
<td><?= $this->getText('Start'); ?>
<td><?= $this->getText('End'); ?>
<td class="wf-100"><?= $this->getText('Type'); ?>
<tfoot>
<tr><td colspan="4"><?= $footerView->render(); ?>
<tbody>
<?php $c = 0; foreach ($employees as $key => $value) : $c++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/group/settings?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getNewestHistory()->getPosition(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->getNewestHistory()->getPosition(); ?></a>
<?php endforeach; ?>
<?php if($c === 0) : ?>
<tr><td colspan="4" class="empty"><?= $this->getText('Empty', 0, 0); ?>
<?php endif; ?>
</table>
</div>
<section class="box w-33">
<header><h1><?= $this->getText('Salary'); ?></h1></header>
<div class="inner">
<!-- @formatter:off -->
<table class="list">
<tr>
<th><?= $this->getText('Date'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>
<tr>
<th><?= $this->getText('SalaryType'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>
<tr>
<th><?= $this->getText('Amount'); ?>
<td><span itemprop="familyName"><?= $account->getName3(); ?></span>
</table>
<!-- @formatter:on -->
</div>
</section>

BIN
img/module_teaser_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

45
info.json Normal file
View File

@ -0,0 +1,45 @@
{
"name": {
"id": 1002400000,
"internal": "HumanResourceManagement",
"external": "OMS Human Resources"
},
"version": "1.0.0",
"requirements": {
"phpOMS": "1.0.0",
"phpOMS-db": "1.0.0"
},
"creator": {
"name": "Orange Management",
"website": "www.spl1nes.com"
},
"description": "Human Resources module.",
"directory": "HumanResourceManagement",
"dependencies": {
"Admin" : "1.0.0",
"Organization" : "1.0.0"
},
"providing": {
"Navigation": "*"
},
"load": [
{
"pid": [
"41e01e60d64554c69eef1d1f6a45b0d1609c0345"
],
"type": 4,
"for": 0,
"from": "HumanResourceManagement",
"file": "HumanResourceManagement"
},
{
"pid": [
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
],
"type": 5,
"from": "HumanResourceManagement",
"for": "Navigation",
"file": "Navigation"
}
]
}