mirror of
https://github.com/Karaka-Management/oms-HumanResourceTimeRecording.git
synced 2026-02-12 10:58:39 +00:00
Use default database connection
This commit is contained in:
commit
43f66eeae7
40
Admin/Activate.php
Normal file
40
Admin/Activate.php
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?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\HumanResourceTimeRecording\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
use phpOMS\Module\ActivateAbstract;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation class.
|
||||||
|
*
|
||||||
|
* @category Modules
|
||||||
|
* @package Modules\Admin
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
}
|
||||||
40
Admin/Deactivate.php
Normal file
40
Admin/Deactivate.php
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
<?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\HumanResourceTimeRecording\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
use phpOMS\Module\DeactivateAbstract;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation class.
|
||||||
|
*
|
||||||
|
* @category Modules
|
||||||
|
* @package Modules\Admin
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
}
|
||||||
33
Admin/Install/Navigation.install.json
Normal file
33
Admin/Install/Navigation.install.json
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1006301001,
|
||||||
|
"pid": "/backend",
|
||||||
|
"type": 2,
|
||||||
|
"subtype": 1,
|
||||||
|
"name": "TimeRecording",
|
||||||
|
"uri": "{/base}/{/lang}/backend/hr/timerecording/dashboard?{?}",
|
||||||
|
"target": "self",
|
||||||
|
"icon": null,
|
||||||
|
"order": 70,
|
||||||
|
"from": "HumanResourceTimeRecording",
|
||||||
|
"permission": null,
|
||||||
|
"parent": 1002401001,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": 1006302001,
|
||||||
|
"pid": "/backend/hr/timerecording",
|
||||||
|
"type": 3,
|
||||||
|
"subtype": 1,
|
||||||
|
"name": "List",
|
||||||
|
"uri": "{/base}/{/lang}/backend/hr/timerecording/dashboard?{?}",
|
||||||
|
"target": "self",
|
||||||
|
"icon": null,
|
||||||
|
"order": 1,
|
||||||
|
"from": "HumanResourceTimeRecording",
|
||||||
|
"permission": null,
|
||||||
|
"parent": 1006301001,
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
37
Admin/Install/Navigation.php
Normal file
37
Admin/Install/Navigation.php
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?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\HumanResourceTimeRecording\Admin\Install;
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation class.
|
||||||
|
*
|
||||||
|
* @category Modules
|
||||||
|
* @package Modules\Admin
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
}
|
||||||
46
Admin/Installer.php
Normal file
46
Admin/Installer.php
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?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\HumanResourceTimeRecording\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabaseType;
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
use phpOMS\Module\InstallerAbstract;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calendar install class.
|
||||||
|
*
|
||||||
|
* @category Modules
|
||||||
|
* @package Modules\Calendar
|
||||||
|
* @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(__DIR__ . '/..', $dbPool, $info);
|
||||||
|
|
||||||
|
switch ($dbPool->get()->getType()) {
|
||||||
|
case DatabaseType::MYSQL:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Admin/Routes/Web/Backend.php
Normal file
12
Admin/Routes/Web/Backend.php
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use phpOMS\Router\RouteVerb;
|
||||||
|
|
||||||
|
return [
|
||||||
|
'^.*/backend/hr/timerecording/dashboard.*$' => [
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\HumanResourceTimeRecording\Controller:viewDashboard',
|
||||||
|
'verb' => RouteVerb::GET,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
3
Admin/Routes/console.php
Normal file
3
Admin/Routes/console.php
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$moduleRoutes = [];
|
||||||
3
Admin/Routes/socket.php
Normal file
3
Admin/Routes/socket.php
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$moduleRoutes = [];
|
||||||
39
Admin/Uninstall.php
Normal file
39
Admin/Uninstall.php
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?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\HumanResourceTimeRecording\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
use phpOMS\Module\UninstallAbstract;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation class.
|
||||||
|
*
|
||||||
|
* @category Modules
|
||||||
|
* @package Modules\Admin
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
}
|
||||||
42
Admin/Update.php
Normal file
42
Admin/Update.php
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?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\HumanResourceTimeRecording\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
use phpOMS\Module\UpdateAbstract;
|
||||||
|
use phpOMS\System\File\Directory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation class.
|
||||||
|
*
|
||||||
|
* @category Modules
|
||||||
|
* @package Modules\Admin
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
}
|
||||||
140
Controller.php
Normal file
140
Controller.php
Normal file
|
|
@ -0,0 +1,140 @@
|
||||||
|
<?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\HumanResourceTimeRecording;
|
||||||
|
|
||||||
|
use phpOMS\Asset\AssetType;
|
||||||
|
use phpOMS\Message\RequestAbstract;
|
||||||
|
use phpOMS\Message\ResponseAbstract;
|
||||||
|
use phpOMS\Model\Html\Head;
|
||||||
|
use phpOMS\Module\ModuleAbstract;
|
||||||
|
use phpOMS\Module\WebInterface;
|
||||||
|
use phpOMS\Views\View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Database controller class.
|
||||||
|
*
|
||||||
|
* @category Modules
|
||||||
|
* @package Database
|
||||||
|
* @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 = 'HumanResourceTimeRecording';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module id.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
/* public */ const MODULE_ID = 1006300000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
*/
|
||||||
|
public function viewDatabaseList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||||
|
{
|
||||||
|
$view = new View($this->app, $request, $response);
|
||||||
|
$view->setTemplate('/Modules/Database/Theme/Backend/database-list');
|
||||||
|
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005201001, $request, $response));
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param RequestAbstract $request Request
|
||||||
|
* @param ResponseAbstract $response Response
|
||||||
|
* @param mixed $data Generic data
|
||||||
|
*
|
||||||
|
* @return \Serializable
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function viewDatabaseCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||||
|
{
|
||||||
|
$view = new View($this->app, $request, $response);
|
||||||
|
$view->setTemplate('/Modules/Database/Theme/Backend/database-generator');
|
||||||
|
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005201001, $request, $response));
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param RequestAbstract $request Request
|
||||||
|
* @param ResponseAbstract $response Response
|
||||||
|
* @param mixed $data Generic data
|
||||||
|
*
|
||||||
|
* @return \Serializable
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function viewDatabaseResult(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||||
|
{
|
||||||
|
$view = new View($this->app, $request, $response);
|
||||||
|
$view->setTemplate('/Modules/Database/Theme/Backend/database-query-result');
|
||||||
|
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1005201001, $request, $response));
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
18
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
18
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?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
|
||||||
|
*/
|
||||||
|
return ['Navigation' => [
|
||||||
|
'Create' => 'Create',
|
||||||
|
'TimeRecording' => 'Time Recording',
|
||||||
|
'List' => 'List',
|
||||||
|
]];
|
||||||
19
Theme/Backend/Lang/en.lang.php
Normal file
19
Theme/Backend/Lang/en.lang.php
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?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
|
||||||
|
*/
|
||||||
|
return ['Database' => [
|
||||||
|
'Created' => 'Created',
|
||||||
|
'Creator' => 'Creator',
|
||||||
|
'Database' => 'Database',
|
||||||
|
'Query' => 'Query',
|
||||||
|
]];
|
||||||
45
info.json
Normal file
45
info.json
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{
|
||||||
|
"name": {
|
||||||
|
"id": 1006300000,
|
||||||
|
"internal": "HumanResourceTimeRecording",
|
||||||
|
"external": "Human Resource Time Recording"
|
||||||
|
},
|
||||||
|
"category": "Tools",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"requirements": {
|
||||||
|
"phpOMS": "1.0.0",
|
||||||
|
"phpOMS-db": "1.0.0"
|
||||||
|
},
|
||||||
|
"creator": {
|
||||||
|
"name": "Orange Management",
|
||||||
|
"website": "www.spl1nes.com"
|
||||||
|
},
|
||||||
|
"description": "The administration module.",
|
||||||
|
"directory": "HumanResourceTimeRecording",
|
||||||
|
"dependencies": {
|
||||||
|
"Admin" : "1.0.0"
|
||||||
|
},
|
||||||
|
"providing": {
|
||||||
|
"Navigation": "*"
|
||||||
|
},
|
||||||
|
"load": [
|
||||||
|
{
|
||||||
|
"pid": [
|
||||||
|
"/backend/database"
|
||||||
|
],
|
||||||
|
"type": 4,
|
||||||
|
"for": "Content",
|
||||||
|
"file": "HumanResourceTimeRecording",
|
||||||
|
"from": "HumanResourceTimeRecording"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pid": [
|
||||||
|
"/backend"
|
||||||
|
],
|
||||||
|
"type": 5,
|
||||||
|
"from": "HumanResourceTimeRecording",
|
||||||
|
"for": "Navigation",
|
||||||
|
"file": "Navigation"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user