mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-02-10 21:38:40 +00:00
Renaming business to organization
This commit is contained in:
commit
6009d573e4
43
Admin/Activate.php
Normal file
43
Admin/Activate.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?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\Organization\Admin;
|
||||
|
||||
|
||||
use phpOMS\DataStorage\Database\Pool;
|
||||
use phpOMS\Module\ActivateAbstract;
|
||||
|
||||
/**
|
||||
* 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(Pool $dbPool, array $info)
|
||||
{
|
||||
parent::activate($dbPool, $info);
|
||||
}
|
||||
}
|
||||
43
Admin/Deactivate.php
Normal file
43
Admin/Deactivate.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?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\Organization\Admin;
|
||||
|
||||
|
||||
use phpOMS\DataStorage\Database\Pool;
|
||||
use phpOMS\Module\DeactivateAbstract;
|
||||
|
||||
/**
|
||||
* 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(Pool $dbPool, array $info)
|
||||
{
|
||||
parent::deactivate($dbPool, $info);
|
||||
}
|
||||
}
|
||||
156
Admin/Install/Navigation.install.json
Normal file
156
Admin/Install/Navigation.install.json
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
[
|
||||
{
|
||||
"id": 1004701001,
|
||||
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||
"type": 2,
|
||||
"subtype": 0,
|
||||
"name": "Organization",
|
||||
"uri": null,
|
||||
"target": "self",
|
||||
"icon": "fa fa-database",
|
||||
"order": 2,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 0,
|
||||
"children": [
|
||||
{
|
||||
"id": 1004702001,
|
||||
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Units",
|
||||
"uri": "/{/lang}/backend/organization/unit/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 1004701001,
|
||||
"children": [
|
||||
{
|
||||
"id": 1004702101,
|
||||
"pid": "88fc57eb9222e9a8eab2c6b165cb93eac7891f2e",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "/{/lang}/backend/organization/unit/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 1004702001,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": 1004702102,
|
||||
"pid": "88fc57eb9222e9a8eab2c6b165cb93eac7891f2e",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "/{/lang}/backend/organization/unit/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 25,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 1004702001,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1004703001,
|
||||
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Departments",
|
||||
"uri": "/{/lang}/backend/organization/department/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 1004701001,
|
||||
"children": [
|
||||
{
|
||||
"id": 1004703101,
|
||||
"pid": "15cb2fef4a6e948711453fc1d5522842ee9452c4",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "/{/lang}/backend/organization/department/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 1004703001,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": 1004703102,
|
||||
"pid": "15cb2fef4a6e948711453fc1d5522842ee9452c4",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "/{/lang}/backend/organization/department/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 25,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 1004703001,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1004704001,
|
||||
"pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd",
|
||||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Positions",
|
||||
"uri": "/{/lang}/backend/organization/position/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 20,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 1004701001,
|
||||
"children": [
|
||||
{
|
||||
"id": 1004704101,
|
||||
"pid": "be240e5a87cf255e73a2ae91aaf4af5930a3604b",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "/{/lang}/backend/organization/position/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 1004704001,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": 1004704102,
|
||||
"pid": "be240e5a87cf255e73a2ae91aaf4af5930a3604b",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "/{/lang}/backend/organization/position/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 25,
|
||||
"from": "Organization",
|
||||
"permission": null,
|
||||
"parent": 1004704001,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
40
Admin/Install/Navigation.php
Normal file
40
Admin/Install/Navigation.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?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\Organization\Admin\Install;
|
||||
use phpOMS\DataStorage\Database\Pool;
|
||||
|
||||
/**
|
||||
* 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(Pool $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);
|
||||
}
|
||||
}
|
||||
113
Admin/Installer.php
Normal file
113
Admin/Installer.php
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
<?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\Organization\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabaseType;
|
||||
use phpOMS\DataStorage\Database\Pool;
|
||||
use phpOMS\Module\InstallerAbstract;
|
||||
|
||||
/**
|
||||
* Organization install class.
|
||||
*
|
||||
* @category Modules
|
||||
* @package Modules\Business
|
||||
* @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 . 'organization_unit` (
|
||||
`organization_unit_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`organization_unit_status` tinyint(2) DEFAULT NULL,
|
||||
`organization_unit_matchcode` varchar(50) DEFAULT NULL,
|
||||
`organization_unit_name` varchar(50) DEFAULT NULL,
|
||||
`organization_unit_description` varchar(255) DEFAULT NULL,
|
||||
`organization_unit_parent` int(11) DEFAULT NULL,
|
||||
`organization_unit_created` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`organization_unit_id`),
|
||||
KEY `organization_unit_parent` (`organization_unit_parent`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'organization_unit`
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'organization_unit_ibfk_1` FOREIGN KEY (`organization_unit_parent`) REFERENCES `' . $dbPool->get('core')->prefix . 'organization_unit` (`organization_unit_id`);'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'organization_department` (
|
||||
`organization_department_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`organization_department_name` varchar(30) DEFAULT NULL,
|
||||
`organization_department_description` varchar(255) DEFAULT NULL,
|
||||
`organization_department_parent` int(11) DEFAULT NULL,
|
||||
`organization_department_unit` int(11) NOT NULL,
|
||||
PRIMARY KEY (`organization_department_id`),
|
||||
KEY `organization_department_parent` (`organization_department_parent`),
|
||||
KEY `organization_department_unit` (`organization_department_unit`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'organization_department`
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'organization_department_ibfk_1` FOREIGN KEY (`organization_department_parent`) REFERENCES `' . $dbPool->get('core')->prefix . 'organization_department` (`organization_department_id`),
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'organization_department_ibfk_2` FOREIGN KEY (`organization_department_unit`) REFERENCES `' . $dbPool->get('core')->prefix . 'organization_unit` (`organization_unit_id`);'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'organization_address` (
|
||||
`organization_address_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`organization_address_status` tinyint(2) DEFAULT NULL,
|
||||
`organization_address_matchcode` varchar(50) DEFAULT NULL,
|
||||
`organization_address_name` varchar(50) DEFAULT NULL,
|
||||
`organization_address_fao` varchar(30) DEFAULT NULL,
|
||||
`organization_address_addr` varchar(50) DEFAULT NULL,
|
||||
`organization_address_city` varchar(20) DEFAULT NULL,
|
||||
`organization_address_zip` varchar(20) DEFAULT NULL,
|
||||
`organization_address_state` varchar(20) DEFAULT NULL,
|
||||
`organization_address_country` varchar(30) DEFAULT NULL,
|
||||
`organization_address_unit` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`organization_address_id`),
|
||||
KEY `organization_address_unit` (`organization_address_unit`)
|
||||
)ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'ALTER TABLE `' . $dbPool->get('core')->prefix . 'organization_address`
|
||||
ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'organization_address_ibfk_1` FOREIGN KEY (`organization_address_unit`) REFERENCES `' . $dbPool->get('core')->prefix . 'organization_unit` (`organization_unit_id`);'
|
||||
)->execute();
|
||||
|
||||
$dbPool->get('core')->con->prepare(
|
||||
'INSERT INTO `' . $dbPool->get('core')->prefix . 'organization_unit` (`organization_unit_status`, `organization_unit_matchcode`, `organization_unit_name`, `organization_unit_description`, `organization_unit_parent`) VALUES
|
||||
(1, \'default\', \'Default\', \'Default unit.\', NULL);'
|
||||
)->execute();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Admin/Uninstall.php
Normal file
54
Admin/Uninstall.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
|
||||
*/
|
||||
namespace Modules\Organization\Admin;
|
||||
|
||||
|
||||
use phpOMS\DataStorage\Database\Pool;
|
||||
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(Pool $dbPool, array $info)
|
||||
{
|
||||
parent::uninstall($dbPool, $info);
|
||||
|
||||
$query = new Builder($dbPool->get());
|
||||
|
||||
$query->prefix($dbPool->get('core')->getPrefix())->drop(
|
||||
'organization_address',
|
||||
'organization_department',
|
||||
'organization_unit'
|
||||
);
|
||||
|
||||
$dbPool->get()->con->prepare($query->toSql())->execute();
|
||||
}
|
||||
}
|
||||
46
Admin/Update.php
Normal file
46
Admin/Update.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?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\Organization\Admin;
|
||||
|
||||
|
||||
use phpOMS\DataStorage\Database\Pool;
|
||||
use phpOMS\Module\UpdateAbstract;
|
||||
use phpOMS\System\FileSystem;
|
||||
|
||||
/**
|
||||
* 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(Pool $dbPool, array $info)
|
||||
{
|
||||
FileSystem::deletePath(__DIR__ . '/Update');
|
||||
mkdir('Update');
|
||||
parent::update($dbPool, $info);
|
||||
}
|
||||
}
|
||||
305
Controller.php
Normal file
305
Controller.php
Normal file
|
|
@ -0,0 +1,305 @@
|
|||
<?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\Organization;
|
||||
|
||||
use Modules\Organization\Models\DepartmentMapper;
|
||||
use Modules\Organization\Models\UnitMapper;
|
||||
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;
|
||||
|
||||
/**
|
||||
* Organization Controller class.
|
||||
*
|
||||
* @category Modules
|
||||
* @package Modules\Organization
|
||||
* @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
|
||||
*/
|
||||
const MODULE_PATH = __DIR__;
|
||||
|
||||
/**
|
||||
* Module version.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
const MODULE_VERSION = '1.0.0';
|
||||
|
||||
/**
|
||||
* Module name.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
const MODULE_NAME = 'Organization';
|
||||
|
||||
/**
|
||||
* Localization files.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $localization = [
|
||||
RequestDestination::BACKEND => [''],
|
||||
];
|
||||
|
||||
/**
|
||||
* Providing.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $providing = [];
|
||||
|
||||
/**
|
||||
* Dependencies.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $dependencies = [
|
||||
];
|
||||
|
||||
/**
|
||||
* Routing elements.
|
||||
*
|
||||
* @var array
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $routes = [
|
||||
'^.*/backend/business/unit/list.*$' => [['dest' => '\Modules\Organization\Controller:viewUnitList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/business/unit/profile.*$' => [['dest' => '\Modules\Organization\Controller:viewUnitProfile', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/business/unit/create.*$' => [['dest' => '\Modules\Organization\Controller:viewUnitCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
|
||||
'^.*/backend/business/department/list.*$' => [['dest' => '\Modules\Organization\Controller:viewDepartmentList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/business/department/profile.*$' => [['dest' => '\Modules\Organization\Controller:viewDepartmentProfile', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/business/department/create.*$' => [['dest' => '\Modules\Organization\Controller:viewDepartmentCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
|
||||
'^.*/backend/business/position/list.*$' => [['dest' => '\Modules\Organization\Controller:viewPositionList', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/business/position/profile.*$' => [['dest' => '\Modules\Organization\Controller:viewPositionProfile', 'method' => 'GET', 'type' => ViewLayout::MAIN],],
|
||||
'^.*/backend/business/position/create.*$' => [['dest' => '\Modules\Organization\Controller:viewPositionCreate', '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 viewUnitList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Organization/Theme/Backend/unit-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004702001, $request, $response));
|
||||
|
||||
$unitMapper = new UnitMapper($this->app->dbPool->get());
|
||||
$view->addData('list:elements', $unitMapper->getAll());
|
||||
|
||||
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 viewUnitProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Organization/Theme/Backend/unit-profile');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004702001, $request, $response));
|
||||
|
||||
$unitMapper = new UnitMapper($this->app->dbPool->get());
|
||||
$view->addData('unit', $unitMapper->get((int) $request->getData('id')));
|
||||
|
||||
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 viewUnitCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Organization/Theme/Backend/unit-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004702001, $request, $response));
|
||||
|
||||
$unitMapper = new UnitMapper($this->app->dbPool->get());
|
||||
$view->addData('unit', $unitMapper->get((int) $request->getData('id')));
|
||||
|
||||
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 viewDepartmentList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Organization/Theme/Backend/department-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004703001, $request, $response));
|
||||
|
||||
$departmentMapper = new DepartmentMapper($this->app->dbPool->get());
|
||||
$view->addData('list:elements', $departmentMapper->getAll());
|
||||
|
||||
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 viewDepartmentProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Organization/Theme/Backend/department-profile');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004703001, $request, $response));
|
||||
|
||||
$departmentMapper = new DepartmentMapper($this->app->dbPool->get());
|
||||
$view->addData('unit', $departmentMapper->get((int) $request->getData('id')));
|
||||
|
||||
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 viewDepartmentCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Organization/Theme/Backend/department-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004703001, $request, $response));
|
||||
|
||||
$unitMapper = new UnitMapper($this->app->dbPool->get());
|
||||
$view->addData('unit', $unitMapper->get((int) $request->getData('id')));
|
||||
|
||||
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 viewPositionList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Organization/Theme/Backend/position-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004704001, $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 viewPositionProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Organization/Theme/Backend/position-profile');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004704001, $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 viewPositionCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app, $request, $response);
|
||||
$view->setTemplate('/Modules/Organization/Theme/Backend/position-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004704001, $request, $response));
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
}
|
||||
54
Models/Department.php
Normal file
54
Models/Department.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
|
||||
*/
|
||||
namespace Modules\Organization\Models;
|
||||
|
||||
class Department
|
||||
{
|
||||
protected $id = 0;
|
||||
|
||||
protected $name = '';
|
||||
|
||||
protected $parent = 0;
|
||||
|
||||
protected $unit = 0;
|
||||
|
||||
protected $description = '';
|
||||
|
||||
public function getId() : int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName() : string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getParent() : int
|
||||
{
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
public function getUnit() : int
|
||||
{
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
public function getDescription() : string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
}
|
||||
52
Models/DepartmentMapper.php
Normal file
52
Models/DepartmentMapper.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?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\Organization\Models;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
|
||||
class DepartmentMapper extends DataMapperAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* Columns.
|
||||
*
|
||||
* @var array<string, array>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $columns = [
|
||||
'organization_department_id' => ['name' => 'organization_department_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'organization_department_name' => ['name' => 'organization_department_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'organization_department_description' => ['name' => 'organization_department_description', 'type' => 'string', 'internal' => 'description'],
|
||||
'organization_department_parent' => ['name' => 'organization_department_parent', 'type' => 'int', 'internal' => 'parent'],
|
||||
'organization_department_unit' => ['name' => 'organization_department_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Primary table.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $table = 'organization_department';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $primaryField = 'organization_department_id';
|
||||
}
|
||||
47
Models/Unit.php
Normal file
47
Models/Unit.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?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\Organization\Models;
|
||||
|
||||
class Unit
|
||||
{
|
||||
protected $id = 0;
|
||||
|
||||
protected $name = '';
|
||||
|
||||
protected $parent = 0;
|
||||
|
||||
protected $description = '';
|
||||
|
||||
public function getId() : int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName() : string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getParent() : int
|
||||
{
|
||||
return $this->parent;
|
||||
}
|
||||
|
||||
public function getDescription() : string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
}
|
||||
62
Models/UnitMapper.php
Normal file
62
Models/UnitMapper.php
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
<?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\Organization\Models;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
|
||||
class UnitMapper extends DataMapperAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
* Columns.
|
||||
*
|
||||
* @var array<string, array>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $columns = [
|
||||
'organization_unit_id' => ['name' => 'organization_unit_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'organization_unit_status' => ['name' => 'organization_unit_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'organization_unit_matchcode' => ['name' => 'organization_unit_matchcode', 'type' => 'string', 'internal' => 'matchcode'],
|
||||
'organization_unit_name' => ['name' => 'organization_unit_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'organization_unit_description' => ['name' => 'organization_unit_description', 'type' => 'string', 'internal' => 'description'],
|
||||
'organization_unit_parent' => ['name' => 'organization_unit_parent', 'type' => 'int', 'internal' => 'parent'],
|
||||
'organization_unit_created' => ['name' => 'organization_unit_created', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Primary table.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $table = 'organization_unit';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $primaryField = 'organization_unit_id';
|
||||
|
||||
/**
|
||||
* Created at column
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $createdAt = 'organization_unit_created';
|
||||
}
|
||||
21
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
21
Theme/Backend/Lang/Navigation.en.lang.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?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'] = [
|
||||
'Business' => 'Business',
|
||||
'Departments' => 'Departments',
|
||||
'Positions' => 'Positions',
|
||||
'Units' => 'Units',
|
||||
];
|
||||
27
Theme/Backend/Lang/en.lang.php
Normal file
27
Theme/Backend/Lang/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['Business'] = [
|
||||
'Active' => 'Active',
|
||||
'Department' => 'Department',
|
||||
'Departments' => 'Departments',
|
||||
'Description' => 'Description',
|
||||
'Inactive' => 'Inactive',
|
||||
'Name' => 'Name',
|
||||
'Parent' => 'Parent',
|
||||
'Status' => 'Status',
|
||||
'Unit' => 'Unit',
|
||||
'Units' => 'Units',
|
||||
];
|
||||
40
Theme/Backend/department-create.tpl.php
Normal file
40
Theme/Backend/department-create.tpl.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?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
|
||||
*/
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-33">
|
||||
<h1><?= $this->l11n->lang['Business']['Department']; ?></h1>
|
||||
<div class="inner">
|
||||
<form>
|
||||
<table class="layout wf-100">
|
||||
<tr><td><label for="iName"><?= $this->l11n->lang['Business']['Name']; ?></label>
|
||||
<tr><td><input type="text" name="name" id="iName" placeholder=" R&D" required>
|
||||
<tr><td><label for="iParent"><?= $this->l11n->lang['Business']['Parent']; ?></label>
|
||||
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent"></span>
|
||||
<tr><td><label for="iUnit"><?= $this->l11n->lang['Business']['Unit']; ?></label>
|
||||
<tr><td><select name="unit" id="iUnit">
|
||||
</select>
|
||||
<tr><td><label for="iDescription"><?= $this->l11n->lang['Business']['Description']; ?></label>
|
||||
<tr><td><textarea name="description" id="iDescription" placeholder=""></textarea>
|
||||
<tr><td><input type="submit" value="<?= $this->l11n->lang[0]['Create'] ?>">
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
54
Theme/Backend/department-list.tpl.php
Normal file
54
Theme/Backend/department-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['Business']['Departments']; ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang[0]['ID']; ?>
|
||||
<td class="wf-100"><?= $this->l11n->lang['Business']['Name']; ?>
|
||||
<td><?= $this->l11n->lang['Business']['Parent']; ?>
|
||||
<td><?= $this->l11n->lang['Business']['Unit']; ?>
|
||||
<tfoot>
|
||||
<tr><td colspan="4"><?= $footerView->render(); ?>
|
||||
<tbody>
|
||||
<?php $c = 0; foreach ($this->getData('list:elements') as $key => $value) : $c++;
|
||||
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/business/department/profile?id=' . $value->getId()); ?>
|
||||
<tr>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getParent(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getUnit(); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if($c === 0) : ?>
|
||||
<tr>
|
||||
<td colspan="4" class="empty"><?= $this->l11n->lang[0]['Empty']; ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</section>
|
||||
0
Theme/Backend/department-profile.php
Normal file
0
Theme/Backend/department-profile.php
Normal file
42
Theme/Backend/position-create.tpl.php
Normal file
42
Theme/Backend/position-create.tpl.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?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
|
||||
*/
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-33">
|
||||
<h1><?= $this->l11n->lang['Business']['Position']; ?></h1>
|
||||
<div class="inner">
|
||||
<form>
|
||||
<table class="layout wf-100">
|
||||
<tr><td><label for="iName"><?= $this->l11n->lang['Business']['Name']; ?></label>
|
||||
<tr><td><input type="text" name="name" id="iName" placeholder=" Orange Management" required>
|
||||
<tr><td><label for="iParent"><?= $this->l11n->lang['Business']['Parent']; ?></label>
|
||||
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent"></span>
|
||||
<tr><td><label for="iStatus"><?= $this->l11n->lang['Business']['Status']; ?></label>
|
||||
<tr><td><select name="status" id="iStatus">
|
||||
<option><?= $this->l11n->lang['Business']['Active']; ?>
|
||||
<option><?= $this->l11n->lang['Business']['Inactive']; ?>
|
||||
</select>
|
||||
<tr><td><label for="iDescription"><?= $this->l11n->lang['Business']['Description']; ?></label>
|
||||
<tr><td><textarea name="description" id="iDescription" placeholder=""></textarea>
|
||||
<tr><td><input type="submit" value="<?= $this->l11n->lang[0]['Create'] ?>">
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
48
Theme/Backend/position-list.tpl.php
Normal file
48
Theme/Backend/position-list.tpl.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
|
||||
*/
|
||||
/**
|
||||
* @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['Business']['Positions']; ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang[0]['ID']; ?>
|
||||
<td class="wf-100"><?= $this->l11n->lang['Business']['Name']; ?>
|
||||
<td><?= $this->l11n->lang['Business']['Parent']; ?>
|
||||
<tfoot>
|
||||
<tr><td colspan="3"><?= $footerView->render(); ?>
|
||||
<tbody>
|
||||
<?php foreach ($this->getData('list:elements') as $key => $value) :
|
||||
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/business/unit/profile?id=' . $value->getId()); ?>
|
||||
<tr>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getParent(); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</section>
|
||||
44
Theme/Backend/position-profile.tpl.php
Normal file
44
Theme/Backend/position-profile.tpl.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?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
|
||||
*/
|
||||
|
||||
$unit = $this->getData('unit');
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-33">
|
||||
<h1><?= $this->l11n->lang['Business']['Position']; ?></h1>
|
||||
<div class="inner">
|
||||
<form>
|
||||
<table class="layout wf-100">
|
||||
<tr><td><label for="iName"><?= $this->l11n->lang['Business']['Name']; ?></label>
|
||||
<tr><td><input type="text" name="name" id="iName" value="<?= $unit->getName(); ?>">
|
||||
<tr><td><label for="iParent"><?= $this->l11n->lang['Business']['Parent']; ?></label>
|
||||
<tr><td><input type="text" name="parent" id="iParent" value="<?= $unit->getParent(); ?>">
|
||||
<tr><td><label for="iStatus"><?= $this->l11n->lang['Business']['Status']; ?></label>
|
||||
<tr><td><select name="status" id="iStatus">
|
||||
<option><?= $this->l11n->lang['Business']['Active']; ?>
|
||||
<option><?= $this->l11n->lang['Business']['Inactive']; ?>
|
||||
</select>
|
||||
<tr><td><label for="iDescription"><?= $this->l11n->lang['Business']['Description']; ?></label>
|
||||
<tr><td><textarea name="description" id="iDescription"><?= $unit->getDescription(); ?></textarea>
|
||||
<tr><td><input type="submit" value="<?= $this->l11n->lang[0]['Save'] ?>">
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
42
Theme/Backend/unit-create.tpl.php
Normal file
42
Theme/Backend/unit-create.tpl.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?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
|
||||
*/
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-33">
|
||||
<h1><?= $this->l11n->lang['Business']['Unit']; ?></h1>
|
||||
<div class="inner">
|
||||
<form>
|
||||
<table class="layout wf-100">
|
||||
<tr><td><label for="iName"><?= $this->l11n->lang['Business']['Name']; ?></label>
|
||||
<tr><td><input type="text" name="name" id="iName" placeholder=" Orange Management" required>
|
||||
<tr><td><label for="iParent"><?= $this->l11n->lang['Business']['Parent']; ?></label>
|
||||
<tr><td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" name="parent" id="iParent"></span>
|
||||
<tr><td><label for="iStatus"><?= $this->l11n->lang['Business']['Status']; ?></label>
|
||||
<tr><td><select name="status" id="iStatus">
|
||||
<option><?= $this->l11n->lang['Business']['Active']; ?>
|
||||
<option><?= $this->l11n->lang['Business']['Inactive']; ?>
|
||||
</select>
|
||||
<tr><td><label for="iDescription"><?= $this->l11n->lang['Business']['Description']; ?></label>
|
||||
<tr><td><textarea name="description" id="iDescription" placeholder=""></textarea>
|
||||
<tr><td><input type="submit" value="<?= $this->l11n->lang[0]['Create'] ?>">
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
48
Theme/Backend/unit-list.tpl.php
Normal file
48
Theme/Backend/unit-list.tpl.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
|
||||
*/
|
||||
/**
|
||||
* @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['Business']['Units']; ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->l11n->lang[0]['ID']; ?>
|
||||
<td class="wf-100"><?= $this->l11n->lang['Business']['Name']; ?>
|
||||
<td><?= $this->l11n->lang['Business']['Parent']; ?>
|
||||
<tfoot>
|
||||
<tr><td colspan="3"><?= $footerView->render(); ?>
|
||||
<tbody>
|
||||
<?php foreach ($this->getData('list:elements') as $key => $value) :
|
||||
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/business/unit/profile?id=' . $value->getId()); ?>
|
||||
<tr>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getParent(); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</section>
|
||||
44
Theme/Backend/unit-profile.tpl.php
Normal file
44
Theme/Backend/unit-profile.tpl.php
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?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
|
||||
*/
|
||||
|
||||
$unit = $this->getData('unit');
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
|
||||
<section class="box w-33">
|
||||
<h1><?= $this->l11n->lang['Business']['Unit']; ?></h1>
|
||||
<div class="inner">
|
||||
<form>
|
||||
<table class="layout wf-100">
|
||||
<tr><td><label for="iName"><?= $this->l11n->lang['Business']['Name']; ?></label>
|
||||
<tr><td><input type="text" name="name" id="iName" value="<?= $unit->getName(); ?>">
|
||||
<tr><td><label for="iParent"><?= $this->l11n->lang['Business']['Parent']; ?></label>
|
||||
<tr><td><input type="text" name="parent" id="iParent" value="<?= $unit->getParent(); ?>">
|
||||
<tr><td><label for="iStatus"><?= $this->l11n->lang['Business']['Status']; ?></label>
|
||||
<tr><td><select name="status" id="iStatus">
|
||||
<option><?= $this->l11n->lang['Business']['Active']; ?>
|
||||
<option><?= $this->l11n->lang['Business']['Inactive']; ?>
|
||||
</select>
|
||||
<tr><td><label for="iDescription"><?= $this->l11n->lang['Business']['Description']; ?></label>
|
||||
<tr><td><textarea name="description" id="iDescription"><?= $unit->getDescription(); ?></textarea>
|
||||
<tr><td><input type="submit" value="<?= $this->l11n->lang[0]['Save'] ?>">
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
53
info.json
Normal file
53
info.json
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"name": {
|
||||
"id": 1004700000,
|
||||
"internal": "Organization",
|
||||
"external": "OMS Organization"
|
||||
},
|
||||
"version": "1.0.0",
|
||||
"requirements": {
|
||||
"phpOMS": "1.0.0",
|
||||
"phpOMS-db": "1.0.0"
|
||||
},
|
||||
"creator": {
|
||||
"name": "Orange Management",
|
||||
"website": "www.spl1nes.com"
|
||||
},
|
||||
"description": "The buisness module.",
|
||||
"directory": "Organization",
|
||||
"dependencies": {
|
||||
"Admin" : "1.0.0"
|
||||
},
|
||||
"providing": {
|
||||
"Navigation": "*"
|
||||
},
|
||||
"load": [
|
||||
{
|
||||
"pid": [
|
||||
"d22b06b478e3622168a943f8df016bf745dfdccc"
|
||||
],
|
||||
"type": 4,
|
||||
"for": "Organization",
|
||||
"file": "Organization",
|
||||
"from": "Admin"
|
||||
},
|
||||
{
|
||||
"pid": [
|
||||
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
|
||||
],
|
||||
"type": 5,
|
||||
"for": "Organization",
|
||||
"file": "",
|
||||
"from": "Admin"
|
||||
},
|
||||
{
|
||||
"pid": [
|
||||
"754a08ddf8bcb1cf22f310f09206dd783d42f7dd"
|
||||
],
|
||||
"type": 5,
|
||||
"from": "Organization",
|
||||
"for": "Navigation",
|
||||
"file": "Navigation"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user