mirror of
https://github.com/Karaka-Management/oms-InvestmentManagement.git
synced 2026-02-17 20:58:42 +00:00
commit
6f634f7f35
33
Admin/Install/Navigation.install.json
Normal file
33
Admin/Install/Navigation.install.json
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1007101001,
|
||||||
|
"pid": "/backend",
|
||||||
|
"type": 2,
|
||||||
|
"subtype": 1,
|
||||||
|
"name": "Investment",
|
||||||
|
"uri": "/{/lang}/backend/controlling/investment/dashboard?{?}",
|
||||||
|
"target": "self",
|
||||||
|
"icon": null,
|
||||||
|
"order": 1,
|
||||||
|
"from": "InvestmentManagement",
|
||||||
|
"permission": { "type": null, "element": null },
|
||||||
|
"parent": 1002801001,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": 1007102001,
|
||||||
|
"pid": "/backend/controlling/investment",
|
||||||
|
"type": 3,
|
||||||
|
"subtype": 1,
|
||||||
|
"name": "Dashboard",
|
||||||
|
"uri": "/{/lang}/backend/controlling/investment/dashboard?{?}",
|
||||||
|
"target": "self",
|
||||||
|
"icon": null,
|
||||||
|
"order": 1,
|
||||||
|
"from": "InvestmentManagement",
|
||||||
|
"permission": { "type": null, "element": null },
|
||||||
|
"parent": 1007101001,
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
47
Admin/Install/Navigation.php
Normal file
47
Admin/Install/Navigation.php
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin\Install
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\InvestmentManagement\Admin\Install;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation class.
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin\Install
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class Navigation
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Install navigation providing
|
||||||
|
*
|
||||||
|
* @param string $path Path to some file
|
||||||
|
* @param DatabasePool $dbPool Database pool for database interaction
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public static function install(string $path = null, DatabasePool $dbPool = null) : void
|
||||||
|
{
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
}
|
||||||
45
Admin/Installer.php
Normal file
45
Admin/Installer.php
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\InvestmentManagement\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabaseType;
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
use phpOMS\Module\InstallerAbstract;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Budgeting install class.
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class Installer extends InstallerAbstract
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public static function install(DatabasePool $dbPool, InfoManager $info) : void
|
||||||
|
{
|
||||||
|
parent::install($dbPool, $info);
|
||||||
|
|
||||||
|
switch ($dbPool->get()->getType()) {
|
||||||
|
case DatabaseType::MYSQL:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
Admin/Routes/Web/Backend.php
Normal file
20
Admin/Routes/Web/Backend.php
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use phpOMS\Router\RouteVerb;
|
||||||
|
use phpOMS\Account\PermissionType;
|
||||||
|
use Modules\InvestmentManagement\Models\PermissionState;
|
||||||
|
use Modules\InvestmentManagement\Controller;
|
||||||
|
|
||||||
|
return [
|
||||||
|
'^.*/backend/controlling/investment/dashboard.*$' => [
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\InvestmentManagement\Controller:viewInvestmentDashboard',
|
||||||
|
'verb' => RouteVerb::GET,
|
||||||
|
'permission' => [
|
||||||
|
'module' => Controller::MODULE_NAME,
|
||||||
|
'type' => PermissionType::READ,
|
||||||
|
'state' => PermissionState::INVESTMENT,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
32
Admin/Status.php
Normal file
32
Admin/Status.php
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\InvestmentManagement\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
use phpOMS\Module\StatusAbstract;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation class.
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class Status extends StatusAbstract
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
32
Admin/Uninstaller.php
Normal file
32
Admin/Uninstaller.php
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\InvestmentManagement\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
use phpOMS\Module\UninstallerAbstract;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Navigation class.
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class Uninstaller extends UninstallerAbstract
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
33
Admin/Updater.php
Normal file
33
Admin/Updater.php
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\InvestmentManagement\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
use phpOMS\Module\UpdaterAbstract;
|
||||||
|
use phpOMS\System\File\Directory;
|
||||||
|
use phpOMS\Module\InfoManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updater class.
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement\Admin
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class Updater extends UpdaterAbstract
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
104
Controller.php
Normal file
104
Controller.php
Normal file
|
|
@ -0,0 +1,104 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\InvestmentManagement;
|
||||||
|
|
||||||
|
use Modules\Navigation\Models\Navigation;
|
||||||
|
use Modules\Navigation\Views\NavigationView;
|
||||||
|
use phpOMS\Contract\RenderableInterface;
|
||||||
|
use phpOMS\Message\RequestAbstract;
|
||||||
|
use phpOMS\Message\ResponseAbstract;
|
||||||
|
use phpOMS\Module\ModuleAbstract;
|
||||||
|
use phpOMS\Module\WebInterface;
|
||||||
|
use phpOMS\Views\View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Investmenting controller class.
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
final 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 = 'InvestmentManagement';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module id.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public const MODULE_ID = 1007100000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 RenderableInterface
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
|
public function viewInvestmentDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable
|
||||||
|
{
|
||||||
|
$view = new View($this->app, $request, $response);
|
||||||
|
$view->setTemplate('/Modules/InvestmentManagement/Theme/Backend/investment-dashboard');
|
||||||
|
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004601001, $request, $response));
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
Models/PermissionState.php
Normal file
30
Models/PermissionState.php
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\InvestmentManagement\Models;
|
||||||
|
|
||||||
|
use phpOMS\Stdlib\Base\Enum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permision state enum.
|
||||||
|
*
|
||||||
|
* @package Modules\InvestmentManagement
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
abstract class PermissionState extends Enum
|
||||||
|
{
|
||||||
|
public const INVESTMENT = 1;
|
||||||
|
}
|
||||||
16
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
16
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package TBD
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
return ['Navigation' => [
|
||||||
|
'Investment' => 'Investment',
|
||||||
|
'Dashboard' => 'Dashboard',
|
||||||
|
]];
|
||||||
14
Theme/Backend/Lang/en.lang.php
Normal file
14
Theme/Backend/Lang/en.lang.php
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package TBD
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
return ['InvestmentManagement' => [
|
||||||
|
]];
|
||||||
13
Theme/Backend/investment-dashboard.tpl.php
Normal file
13
Theme/Backend/investment-dashboard.tpl.php
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.2
|
||||||
|
*
|
||||||
|
* @package TBD
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link http://website.orange-management.de
|
||||||
|
*/
|
||||||
|
echo $this->getData('nav')->render();
|
||||||
45
info.json
Normal file
45
info.json
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{
|
||||||
|
"name": {
|
||||||
|
"id": 1007100000,
|
||||||
|
"internal": "InvestmentManagement",
|
||||||
|
"external": "Investment Management"
|
||||||
|
},
|
||||||
|
"category": "Finance",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"requirements": {
|
||||||
|
"phpOMS": "1.0.0",
|
||||||
|
"phpOMS-db": "1.0.0"
|
||||||
|
},
|
||||||
|
"creator": {
|
||||||
|
"name": "Orange Management",
|
||||||
|
"website": "www.spl1nes.com"
|
||||||
|
},
|
||||||
|
"description": "Investment Management module.",
|
||||||
|
"directory": "InvestmentManagement",
|
||||||
|
"dependencies": {
|
||||||
|
"Controlling": "*"
|
||||||
|
},
|
||||||
|
"providing": {
|
||||||
|
"Navigation": "*"
|
||||||
|
},
|
||||||
|
"load": [
|
||||||
|
{
|
||||||
|
"pid": [
|
||||||
|
"/backend/controlling/investment"
|
||||||
|
],
|
||||||
|
"type": 4,
|
||||||
|
"for": 0,
|
||||||
|
"from": "InvestmentManagement",
|
||||||
|
"file": "InvestmentManagement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pid": [
|
||||||
|
"/backend"
|
||||||
|
],
|
||||||
|
"type": 5,
|
||||||
|
"from": "InvestmentManagement",
|
||||||
|
"for": "Navigation",
|
||||||
|
"file": "Navigation"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user