mirror of
https://github.com/Karaka-Management/oms-BudgetManagement.git
synced 2026-02-14 15:28:42 +00:00
Init
This commit is contained in:
commit
4dd25783c8
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\BudgetManagement\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);
|
||||||
|
}
|
||||||
|
}
|
||||||
33
Admin/Install/nav.install.json
Normal file
33
Admin/Install/nav.install.json
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1004601001,
|
||||||
|
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||||
|
"type": 2,
|
||||||
|
"subtype": 1,
|
||||||
|
"name": "Budgeting",
|
||||||
|
"uri": "/{/lang}/backend/controlling/budgeting/dashboard",
|
||||||
|
"target": "self",
|
||||||
|
"icon": null,
|
||||||
|
"order": 1,
|
||||||
|
"from": 1004600000,
|
||||||
|
"permission": null,
|
||||||
|
"parent": 1002801001,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": 1004602001,
|
||||||
|
"pid": "1179e5f06ef09c6ba4a87f656b41fe6145de9b5a",
|
||||||
|
"type": 3,
|
||||||
|
"subtype": 1,
|
||||||
|
"name": "Dashboard",
|
||||||
|
"uri": "/{/lang}/backend/controlling/budgeting/dashboard",
|
||||||
|
"target": "self",
|
||||||
|
"icon": null,
|
||||||
|
"order": 1,
|
||||||
|
"from": 1004600000,
|
||||||
|
"permission": null,
|
||||||
|
"parent": 1004601001,
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
49
Admin/Installer.php
Normal file
49
Admin/Installer.php
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?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\BudgetManagement\Admin;
|
||||||
|
|
||||||
|
use phpOMS\DataStorage\Database\DatabaseType;
|
||||||
|
use phpOMS\DataStorage\Database\Pool;
|
||||||
|
use phpOMS\Module\InstallerAbstract;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Budgeting install class.
|
||||||
|
*
|
||||||
|
* @category Modules
|
||||||
|
* @package Modules\Budgeting
|
||||||
|
* @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:
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
129
Controller.php
Normal file
129
Controller.php
Normal file
|
|
@ -0,0 +1,129 @@
|
||||||
|
<?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\BudgetManagement;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Budgeting controller class.
|
||||||
|
*
|
||||||
|
* @category Modules
|
||||||
|
* @package Modules\Budgeting
|
||||||
|
* @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 = 'BudgetManagement';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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/controlling/budgeting/dashboard.*$' => [['dest' => '\Modules\BudgetManagement\Controller:viewBudgetingDashboard', '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 viewBudgetingDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||||
|
{
|
||||||
|
$view = new View($this->app, $request, $response);
|
||||||
|
$view->setTemplate('/Modules/BudgetManagement/Theme/backend/budgeting-dashboard');
|
||||||
|
$view->addData('nav', $this->createNavigation(1004601001, $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;
|
||||||
|
}
|
||||||
|
}
|
||||||
16
Theme/backend/budgeting-dashboard.tpl.php
Normal file
16
Theme/backend/budgeting-dashboard.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(); ?>
|
||||||
17
Theme/lang/backend.en.lang.php
Normal file
17
Theme/lang/backend.en.lang.php
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?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['BudgetManagement'] = [
|
||||||
|
];
|
||||||
19
Theme/lang/nav.backend.en.lang.php
Normal file
19
Theme/lang/nav.backend.en.lang.php
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?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'] = [
|
||||||
|
'Budgeting' => 'Budgeting',
|
||||||
|
'Dashboard' => 'Dashboard',
|
||||||
|
];
|
||||||
53
info.json
Normal file
53
info.json
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
{
|
||||||
|
"name": {
|
||||||
|
"id": 1004600000,
|
||||||
|
"internal": "BudgetManagement",
|
||||||
|
"external": "OMS Budget Management"
|
||||||
|
},
|
||||||
|
"version": "1.0.0",
|
||||||
|
"requirements": {
|
||||||
|
"phpOMS": "1.0.0",
|
||||||
|
"phpOMS-db": "1.0.0"
|
||||||
|
},
|
||||||
|
"creator": {
|
||||||
|
"name": "Orange Management",
|
||||||
|
"website": "www.spl1nes.com"
|
||||||
|
},
|
||||||
|
"description": "Budget Management module.",
|
||||||
|
"directory": "BudgetManagement",
|
||||||
|
"dependencies": {
|
||||||
|
"Controlling": "*"
|
||||||
|
},
|
||||||
|
"providing": {
|
||||||
|
"Navigation": "*"
|
||||||
|
},
|
||||||
|
"load": [
|
||||||
|
{
|
||||||
|
"pid": [
|
||||||
|
"1179e5f06ef09c6ba4a87f656b41fe6145de9b5a"
|
||||||
|
],
|
||||||
|
"type": 4,
|
||||||
|
"for": 0,
|
||||||
|
"from": "BudgetManagement",
|
||||||
|
"file": "BudgetManagement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pid": [
|
||||||
|
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
|
||||||
|
],
|
||||||
|
"type": 5,
|
||||||
|
"from": "BudgetManagement",
|
||||||
|
"for": "Navigation",
|
||||||
|
"file": "nav.backend"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pid": [
|
||||||
|
"1179e5f06ef09c6ba4a87f656b41fe6145de9b5a"
|
||||||
|
],
|
||||||
|
"type": 5,
|
||||||
|
"for": "Content",
|
||||||
|
"file": "backend",
|
||||||
|
"from": "BudgetManagement"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user