mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-01-11 12:28:39 +00:00
Init
This commit is contained in:
commit
f4f7a5a235
38
Admin/Install/Navigation.php
Normal file
38
Admin/Install/Navigation.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
namespace Modules\HumanResourceManagement\Admin\Install;
|
||||
|
||||
/**
|
||||
* 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($dbPool)
|
||||
{
|
||||
$navData = json_decode(file_get_contents(__DIR__ . '/nav.install.json'), true);
|
||||
|
||||
$class = '\\Modules\\Navigation\\Admin\\Installer';
|
||||
$class::installExternal($dbPool, $navData);
|
||||
}
|
||||
}
|
||||
82
Admin/Install/nav.install.json
Normal file
82
Admin/Install/nav.install.json
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
[
|
||||
{
|
||||
"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": "29a67db2902a784f66b5e896efd84b0004be2087",
|
||||
"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": [
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
148
Admin/Installer.php
Normal file
148
Admin/Installer.php
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 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\Pool;
|
||||
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(Pool $dbPool, array $info)
|
||||
{
|
||||
parent::install($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_status` tinyint(2) DEFAULT NULL,
|
||||
`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`)
|
||||
)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`);'
|
||||
)->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 . 'business_department` (`business_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;
|
||||
}
|
||||
}
|
||||
}
|
||||
149
Controller.php
Normal file
149
Controller.php
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
namespace Modules\HumanResourceManagement;
|
||||
|
||||
use Modules\Navigation\Models\Navigation;
|
||||
use Modules\Navigation\Views\NavigationView;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\RequestDestination;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Module\ModuleAbstract;
|
||||
use phpOMS\Module\WebInterface;
|
||||
use phpOMS\Views\View;
|
||||
use phpOMS\Views\ViewLayout;
|
||||
|
||||
/**
|
||||
* 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 name.
|
||||
*
|
||||
* @var \string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $module = 'HumanResourceManagement';
|
||||
|
||||
/**
|
||||
* Localization files.
|
||||
*
|
||||
* @var \string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $localization = [
|
||||
RequestDestination::BACKEND => ['backend'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Providing.
|
||||
*
|
||||
* @var \string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $providing = [
|
||||
'Content',
|
||||
];
|
||||
|
||||
/**
|
||||
* Dependencies.
|
||||
*
|
||||
* @var \string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $dependencies = [];
|
||||
|
||||
/**
|
||||
* Routing elements.
|
||||
*
|
||||
* @var array
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $routes = [
|
||||
'^.*/backend/hr/staff/list.*$' => [['dest' => '\Modules\HumanResourceManagement\Controller:viewHrList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/hr/department/list.*$' => [['dest' => '\Modules\HumanResourceManagement\Controller:viewHrDepartmentList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
];
|
||||
|
||||
/**
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function viewHrList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/HumanResourceManagement/Theme/backend/staff-list');
|
||||
$view->addData('nav', $this->createNavigation(1002402001, $request, $response));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function viewHrDepartmentList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/HumanResourceManagement/Theme/backend/department-list');
|
||||
$view->addData('nav', $this->createNavigation(1003001001, $request, $response));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $pageId Page/parent Id for navigation
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
private function createNavigation(\int $pageId, RequestAbstract $request, ResponseAbstract $response)
|
||||
{
|
||||
$nav = Navigation::getInstance($request, $this->app->dbPool);
|
||||
$navView = new NavigationView($this->app, $request, $response);
|
||||
$navView->setTemplate('/Modules/Navigation/Theme/backend/mid');
|
||||
$navView->setNav($nav->getNav());
|
||||
$navView->setLanguage($request->getL11n()->language);
|
||||
$navView->setParent($pageId);
|
||||
|
||||
return $navView;
|
||||
}
|
||||
}
|
||||
0
Models/Department.php
Normal file
0
Models/Department.php
Normal file
107
Models/DepartmentList.php
Normal file
107
Models/DepartmentList.php
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
namespace Modules\HumanResources\Models;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabaseType;
|
||||
|
||||
/**
|
||||
* Department 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 DepartmentList
|
||||
{
|
||||
|
||||
/**
|
||||
* Database instance.
|
||||
*
|
||||
* @var \phpOMS\DataStorage\Database\Database
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $dbPool = null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \phpOMS\DataStorage\Database\Pool $dbPool Database pool instance
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
*/
|
||||
public function __construct($dbPool)
|
||||
{
|
||||
$this->dbPool = $dbPool;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all departments.
|
||||
*
|
||||
* 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_department`.*
|
||||
FROM
|
||||
`' . $this->dbPool->get('core')->prefix . 'hr_department` '
|
||||
. $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()
|
||||
{
|
||||
}
|
||||
}
|
||||
124
Models/Employee.php
Normal file
124
Models/Employee.php
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
namespace Modules\HumanResources\Models;
|
||||
|
||||
use phpOMS\Models\User\User;
|
||||
use phpOMS\Pattern\Multition;
|
||||
|
||||
/**
|
||||
* 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 implements Multition
|
||||
{
|
||||
|
||||
/**
|
||||
* Employee ID.
|
||||
*
|
||||
* @var \int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $id = null;
|
||||
|
||||
/**
|
||||
* User.
|
||||
*
|
||||
* @var User
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $user = null;
|
||||
|
||||
private static $instances = [];
|
||||
|
||||
public function __construct($id)
|
||||
{
|
||||
}
|
||||
|
||||
public function getInstance($id)
|
||||
{
|
||||
if (!isset(self::$instances[$id])) {
|
||||
self::$instances[$id] = new self($id);
|
||||
}
|
||||
|
||||
return self::$instances[$id];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function init($id)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
public function setUser($id)
|
||||
{
|
||||
$this->user = new User($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
// TODO: Implement serialize() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
// TODO: Implement unserialize() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
// TODO: Implement delete() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
// TODO: Implement create() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function update()
|
||||
{
|
||||
// TODO: Implement update() method.
|
||||
}
|
||||
}
|
||||
48
Models/PositionType.php
Normal file
48
Models/PositionType.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
namespace Modules\HumanResources\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
|
||||
{
|
||||
const INTERN = 0;
|
||||
|
||||
const APPRENTICE = 1;
|
||||
|
||||
const JUNIOR = 2;
|
||||
|
||||
const REGULAR = 3;
|
||||
|
||||
const SENIOR = 4;
|
||||
|
||||
const ASSISTANT = 5;
|
||||
|
||||
const TEAMLEADER = 6;
|
||||
|
||||
const HEAD = 7;
|
||||
}
|
||||
107
Models/StaffList.php
Normal file
107
Models/StaffList.php
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
namespace Modules\HumanResources\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\Database
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private $dbPool = null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param \phpOMS\DataStorage\Database\Pool $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()
|
||||
{
|
||||
}
|
||||
}
|
||||
0
Theme/backend/department-create.tpl.php
Normal file
0
Theme/backend/department-create.tpl.php
Normal file
0
Theme/backend/department-list.tpl.php
Normal file
0
Theme/backend/department-list.tpl.php
Normal file
0
Theme/backend/department-single.tpl.php
Normal file
0
Theme/backend/department-single.tpl.php
Normal file
98
Theme/backend/planning-dashboard.tpl.php
Normal file
98
Theme/backend/planning-dashboard.tpl.php
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<div class="b b-1 c24-1 c24" id="i24-1-1">
|
||||
<h1><?= $this->app->accountManager->get($request->getAccount())->getL11n()->lang['HumanResourceManagement']['Vacation'] ?></h1>
|
||||
|
||||
<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">
|
||||
<h1><?= $this->app->accountManager->get($request->getAccount())->getL11n()->lang['HumanResourceManagement']['Shifts'] ?></h1>
|
||||
|
||||
<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">
|
||||
<h1><?= $this->app->accountManager->get($request->getAccount())->getL11n()->lang['HumanResourceManagement']['Personnel'] ?></h1>
|
||||
|
||||
<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>
|
||||
0
Theme/backend/position-create.tpl.php
Normal file
0
Theme/backend/position-create.tpl.php
Normal file
0
Theme/backend/position-list.tpl.php
Normal file
0
Theme/backend/position-list.tpl.php
Normal file
0
Theme/backend/position-single.tpl.php
Normal file
0
Theme/backend/position-single.tpl.php
Normal file
16
Theme/backend/staff-create.tpl.php
Normal file
16
Theme/backend/staff-create.tpl.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
54
Theme/backend/staff-list.tpl.php
Normal file
54
Theme/backend/staff-list.tpl.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 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(); ?>
|
||||
|
||||
<section class="box w-100">
|
||||
<table class="table">
|
||||
<caption><?= $this->l11n->lang['HumanResourceManagement']['Staff']; ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang[0]['ID']; ?>
|
||||
<td class="wf-100"><?= $this->l11n->lang['HumanResourceManagement']['Name']; ?>
|
||||
<td><?= $this->l11n->lang['HumanResourceManagement']['Department']; ?>
|
||||
<td><?= $this->l11n->lang['HumanResourceManagement']['Status']; ?>
|
||||
<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->l11n->lang[0]['Empty']; ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</section>
|
||||
16
Theme/backend/staff-single.tpl.php
Normal file
16
Theme/backend/staff-single.tpl.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
27
Theme/lang/backend.en.lang.php
Normal file
27
Theme/lang/backend.en.lang.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
$MODLANG['HumanResourceManagement'] = [
|
||||
'Department' => 'Department',
|
||||
'Departments' => 'Departments',
|
||||
'Employees' => 'Employees',
|
||||
'Name' => 'Name',
|
||||
'Parent' => 'Parent',
|
||||
'Personnel' => 'Personnel',
|
||||
'Shifts' => 'Shifts',
|
||||
'Staff' => 'Staff',
|
||||
'Status' => 'Status',
|
||||
'Vacation' => 'Vacation',
|
||||
];
|
||||
27
Theme/lang/nav.backend.en.lang.php
Normal file
27
Theme/lang/nav.backend.en.lang.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 7.0
|
||||
*
|
||||
* @category TBD
|
||||
* @package TBD
|
||||
* @author OMS Development Team <dev@oms.com>
|
||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||
* @copyright 2013 Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
$MODLANG['Navigation'] = [
|
||||
'Departments' => 'Departments',
|
||||
'Employees' => 'Employees',
|
||||
'HumanResources' => 'Human Resources',
|
||||
'HumanResourceManagement' => 'Human Resources',
|
||||
'List' => 'List',
|
||||
'Planning' => 'Planning',
|
||||
'Positions' => 'Positions',
|
||||
'Shifts' => 'Shifts',
|
||||
'Staff' => 'Staff',
|
||||
'Structure' => 'Structure',
|
||||
];
|
||||
BIN
img/module_teaser_small.png
Normal file
BIN
img/module_teaser_small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
51
info.json
Normal file
51
info.json
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"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": {},
|
||||
"providing": {
|
||||
"Navigation": "*"
|
||||
},
|
||||
"load": [
|
||||
{
|
||||
"pid": [
|
||||
"41e01e60d64554c69eef1d1f6a45b0d1609c0345"
|
||||
],
|
||||
"type": 4,
|
||||
"for": 0,
|
||||
"from": "HumanResourceManagement",
|
||||
"file": "HumanResourceManagement"
|
||||
},
|
||||
{
|
||||
"pid": [
|
||||
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
|
||||
],
|
||||
"type": 5,
|
||||
"from": "HumanResourceManagement",
|
||||
"for": "Navigation",
|
||||
"file": "nav.backend"
|
||||
},
|
||||
{
|
||||
"pid": [
|
||||
"41e01e60d64554c69eef1d1f6a45b0d1609c0345"
|
||||
],
|
||||
"type": 5,
|
||||
"for": "Content",
|
||||
"file": "backend",
|
||||
"from": "HumanResourceManagement"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user