From 7ee98f6ab7ede139bd280ad1cc0f4c7885891b89 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 12 Feb 2017 21:43:10 +0100 Subject: [PATCH] Bulkl path fix reverse --- Admin/Activate.php | 44 +++ Admin/Deactivate.php | 44 +++ Admin/Install/Navigation.install.json | 156 +++++++++ Admin/Install/Navigation.php | 43 +++ Admin/Installer.php | 130 ++++++++ Admin/Routes/Web/Api.php | 24 ++ Admin/Routes/Web/Backend.php | 60 ++++ Admin/Routes/console.php | 3 + Admin/Routes/socket.php | 3 + Admin/Uninstall.php | 54 +++ Admin/Update.php | 46 +++ Controller.php | 382 ++++++++++++++++++++++ Models/Department.php | 122 +++++++ Models/DepartmentMapper.php | 59 ++++ Models/Position.php | 111 +++++++ Models/PositionMapper.php | 59 ++++ Models/Status.php | 38 +++ Models/Unit.php | 111 +++++++ Models/UnitMapper.php | 58 ++++ README.md | 1 + Theme/Backend/Lang/Navigation.en.lang.php | 21 ++ Theme/Backend/Lang/en.lang.php | 29 ++ Theme/Backend/department-create.tpl.php | 44 +++ Theme/Backend/department-list.tpl.php | 58 ++++ Theme/Backend/department-profile.tpl.php | 48 +++ Theme/Backend/position-create.tpl.php | 46 +++ Theme/Backend/position-list.tpl.php | 57 ++++ Theme/Backend/position-profile.tpl.php | 48 +++ Theme/Backend/unit-create.tpl.php | 46 +++ Theme/Backend/unit-list.tpl.php | 52 +++ Theme/Backend/unit-profile.tpl.php | 48 +++ info.json | 44 +++ 32 files changed, 2089 insertions(+) create mode 100644 Admin/Activate.php create mode 100644 Admin/Deactivate.php create mode 100644 Admin/Install/Navigation.install.json create mode 100644 Admin/Install/Navigation.php create mode 100644 Admin/Installer.php create mode 100644 Admin/Routes/Web/Api.php create mode 100644 Admin/Routes/Web/Backend.php create mode 100644 Admin/Routes/console.php create mode 100644 Admin/Routes/socket.php create mode 100644 Admin/Uninstall.php create mode 100644 Admin/Update.php create mode 100644 Controller.php create mode 100644 Models/Department.php create mode 100644 Models/DepartmentMapper.php create mode 100644 Models/Position.php create mode 100644 Models/PositionMapper.php create mode 100644 Models/Status.php create mode 100644 Models/Unit.php create mode 100644 Models/UnitMapper.php create mode 100644 README.md create mode 100644 Theme/Backend/Lang/Navigation.en.lang.php create mode 100644 Theme/Backend/Lang/en.lang.php create mode 100644 Theme/Backend/department-create.tpl.php create mode 100644 Theme/Backend/department-list.tpl.php create mode 100644 Theme/Backend/department-profile.tpl.php create mode 100644 Theme/Backend/position-create.tpl.php create mode 100644 Theme/Backend/position-list.tpl.php create mode 100644 Theme/Backend/position-profile.tpl.php create mode 100644 Theme/Backend/unit-create.tpl.php create mode 100644 Theme/Backend/unit-list.tpl.php create mode 100644 Theme/Backend/unit-profile.tpl.php create mode 100644 info.json diff --git a/Admin/Activate.php b/Admin/Activate.php new file mode 100644 index 0000000..a813def --- /dev/null +++ b/Admin/Activate.php @@ -0,0 +1,44 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Organization\Admin; + + +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Module\ActivateAbstract; +use phpOMS\Module\InfoManager; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @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); + } +} diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php new file mode 100644 index 0000000..3ccb90b --- /dev/null +++ b/Admin/Deactivate.php @@ -0,0 +1,44 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Organization\Admin; + + +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Module\DeactivateAbstract; +use phpOMS\Module\InfoManager; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @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); + } +} diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json new file mode 100644 index 0000000..4225a7a --- /dev/null +++ b/Admin/Install/Navigation.install.json @@ -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": "bed7df3aff1a2bcb0b5e761764a93f84c2793daf", + "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": "bed7df3aff1a2bcb0b5e761764a93f84c2793daf", + "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": "fab21c089971de13f680a30c8fdd0a8edc97af6a", + "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": "fab21c089971de13f680a30c8fdd0a8edc97af6a", + "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": "67b1a05950026df723a6c35c7801234c978e85f2", + "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": "67b1a05950026df723a6c35c7801234c978e85f2", + "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": [] + } + ] + } + ] + } +] diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php new file mode 100644 index 0000000..225bde5 --- /dev/null +++ b/Admin/Install/Navigation.php @@ -0,0 +1,43 @@ + + * @author Dennis Eichhorn + * @copyright 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\DatabasePool; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class Navigation +{ + /** + * {@inheritdoc} + */ + 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); + } +} diff --git a/Admin/Installer.php b/Admin/Installer.php new file mode 100644 index 0000000..9fdc8c1 --- /dev/null +++ b/Admin/Installer.php @@ -0,0 +1,130 @@ + + * @author Dennis Eichhorn + * @copyright 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\DatabasePool; +use phpOMS\Module\InfoManager; +use phpOMS\Module\InstallerAbstract; + +/** + * Organization install class. + * + * @category Modules + * @package Modules\Organization + * @author OMS Development Team + * @author Dennis Eichhorn + * @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($path, $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_name` varchar(50) DEFAULT NULL, + `organization_unit_description` varchar(255) DEFAULT NULL, + `organization_unit_parent` int(11) DEFAULT NULL, + `organization_unit_status` int(3) 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_status` int(3) 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_position` ( + `organization_position_id` int(11) NOT NULL AUTO_INCREMENT, + `organization_position_name` varchar(50) DEFAULT NULL, + `organization_position_description` varchar(255) DEFAULT NULL, + `organization_position_parent` int(11) DEFAULT NULL, + `organization_position_status` int(3) DEFAULT NULL, + PRIMARY KEY (`organization_position_id`), + KEY `organization_position_parent` (`organization_position_parent`) + )ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;' + )->execute(); + + $dbPool->get('core')->con->prepare( + 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'organization_position` + ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'organization_position_ibfk_1` FOREIGN KEY (`organization_position_parent`) REFERENCES `' . $dbPool->get('core')->prefix . 'organization_position` (`organization_position_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_name`, `organization_unit_description`, `organization_unit_parent`) VALUES + (\'Default\', \'Default unit.\', NULL);' + )->execute(); + break; + } + } +} diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php new file mode 100644 index 0000000..cff7c8e --- /dev/null +++ b/Admin/Routes/Web/Api.php @@ -0,0 +1,24 @@ + [ + [ + 'dest' => '\Modules\Organization\Controller:apiPositionCreate', + 'verb' => RouteVerb::SET, + ], + ], + '^.*/api/organization/department.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:apiDepartmentCreate', + 'verb' => RouteVerb::SET, + ], + ], + '^.*/api/organization/unit.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:apiUnitCreate', + 'verb' => RouteVerb::SET, + ], + ], +]; diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php new file mode 100644 index 0000000..47b2ee1 --- /dev/null +++ b/Admin/Routes/Web/Backend.php @@ -0,0 +1,60 @@ + [ + [ + 'dest' => '\Modules\Organization\Controller:viewUnitList', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/organization/unit/profile.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:viewUnitProfile', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/organization/unit/create.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:viewUnitCreate', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/organization/department/list.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:viewDepartmentList', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/organization/department/profile.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:viewDepartmentProfile', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/organization/department/create.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:viewDepartmentCreate', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/organization/position/list.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:viewPositionList', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/organization/position/profile.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:viewPositionProfile', + 'verb' => RouteVerb::GET, + ], + ], + '^.*/backend/organization/position/create.*$' => [ + [ + 'dest' => '\Modules\Organization\Controller:viewPositionCreate', + 'verb' => RouteVerb::GET, + ], + ], +]; diff --git a/Admin/Routes/console.php b/Admin/Routes/console.php new file mode 100644 index 0000000..1ecbfac --- /dev/null +++ b/Admin/Routes/console.php @@ -0,0 +1,3 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Organization\Admin; + + +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\DataStorage\Database\Schema\Builder; +use phpOMS\Module\UninstallAbstract; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @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); + + $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(); + } +} diff --git a/Admin/Update.php b/Admin/Update.php new file mode 100644 index 0000000..059998a --- /dev/null +++ b/Admin/Update.php @@ -0,0 +1,46 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Organization\Admin; + + +use phpOMS\DataStorage\Database\DatabasePool; +use phpOMS\Module\UpdateAbstract; +use phpOMS\System\File\Directory; + +/** + * Navigation class. + * + * @category Modules + * @package Modules\Admin + * @author OMS Development Team + * @author Dennis Eichhorn + * @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); + } +} diff --git a/Controller.php b/Controller.php new file mode 100644 index 0000000..dfc4f66 --- /dev/null +++ b/Controller.php @@ -0,0 +1,382 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Organization; + +use Model\Message\FormValidation; +use Modules\Organization\Models\Department; +use Modules\Organization\Models\DepartmentMapper; +use Modules\Organization\Models\Position; +use Modules\Organization\Models\PositionMapper; +use Modules\Organization\Models\Status; +use Modules\Organization\Models\Unit; +use Modules\Organization\Models\UnitMapper; +use phpOMS\Message\RequestAbstract; +use phpOMS\Message\ResponseAbstract; +use phpOMS\Module\ModuleAbstract; +use phpOMS\Module\WebInterface; +use phpOMS\Views\View; + +/** + * Organization Controller class. + * + * @category Modules + * @package Modules\Organization + * @author OMS Development Team + * @author Dennis Eichhorn + * @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 = 'Organization'; + + /** + * 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 + * @author Dennis Eichhorn + */ + public function viewUnitList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $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)); + + $view->addData('list:elements', UnitMapper::getAll()); + + return $view; + } + + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return \Serializable + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewUnitProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $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)); + + $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 \Serializable + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewUnitCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $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)); + + return $view; + } + + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return \Serializable + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewDepartmentList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $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)); + + $view->addData('list:elements', DepartmentMapper::getAll()); + + return $view; + } + + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return \Serializable + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewDepartmentProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $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)); + + $view->addData('department', DepartmentMapper::get((int) $request->getData('id'))); + + return $view; + } + + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return \Serializable + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewDepartmentCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $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)); + + return $view; + } + + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return \Serializable + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewPositionList(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $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)); + + $view->addData('list:elements', PositionMapper::getAll()); + + return $view; + } + + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return \Serializable + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewPositionProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $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)); + + $view->addData('position', PositionMapper::get((int) $request->getData('id'))); + + return $view; + } + + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return \Serializable + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function viewPositionCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : \Serializable + { + $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; + } + + private function validateUnitCreate(RequestAbstract $request) : array + { + $val = []; + if ( + ($val['name'] = empty($request->getData('name'))) + || ($val['parent'] = ( + !empty($request->getData('parent')) + && !is_numeric($request->getData('parent')) + )) + || ($val['status'] = ( + $request->getData('status') === null + || !Status::isValidValue((int) $request->getData('status')) + )) + ) { + return $val; + } + + return []; + } + + public function apiUnitCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) + { + if (!empty($val = $this->validateUnitCreate($request))) { + $response->set('unit_create', new FormValidation($val)); + + return; + } + + $unit = new Unit(); + $unit->setName($request->getData('name')); + $unit->setDescription($request->getData('description') ?? ''); + $unit->setStatus((int) $request->getData('status')); + + UnitMapper::create($unit); + + $response->set('unit', $unit->jsonSerialize()); + } + + private function validatePositionCreate(RequestAbstract $request) : array + { + $val = []; + if ( + ($val['name'] = empty($request->getData('name'))) + || ($val['parent'] = ( + !empty($request->getData('parent')) + && !is_numeric($request->getData('parent')) + )) + || ($val['status'] = ( + $request->getData('status') === null + || !Status::isValidValue((int) $request->getData('status')) + )) + ) { + return $val; + } + + return []; + } + + public function apiPositionCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) + { + if (!empty($val = $this->validatePositionCreate($request))) { + $response->set('position_create', new FormValidation($val)); + + return; + } + + $position = new Position(); + $position->setName($request->getData('name')); + $position->setStatus((int) $request->getData('status')); + $position->setDescription($request->getData('description') ?? ''); + + PositionMapper::create($position); + + $response->set('position', $position->jsonSerialize()); + } + + private function validateDepartmentCreate(RequestAbstract $request) : array + { + $val = []; + if ( + ($val['name'] = empty($request->getData('name'))) + || ($val['parent'] = ( + !empty($request->getData('parent')) + && !is_numeric($request->getData('parent')) + )) + || ($val['unit'] = ( + !is_numeric((int) $request->getData('unit')) + )) + ) { + return $val; + } + + return []; + } + + public function apiDepartmentCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) + { + if (!empty($val = $this->validateDepartmentCreate($request))) { + $response->set('department_create', new FormValidation($val)); + + return; + } + + $department = new Department(); + $department->setName($request->getData('name')); + $department->setStatus((int) $request->getData('status')); + $department->setDescription($request->getData('description') ?? ''); + + DepartmentMapper::create($department); + + $response->set('department', $department->jsonSerialize()); + } +} diff --git a/Models/Department.php b/Models/Department.php new file mode 100644 index 0000000..ecb1c1d --- /dev/null +++ b/Models/Department.php @@ -0,0 +1,122 @@ + + * @author Dennis Eichhorn + * @copyright 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 = null; + + protected $status = Status::INACTIVE; + + protected $unit = 1; + + protected $description = ''; + + public function getId() : int + { + return $this->id; + } + + public function getName() : string + { + return $this->name; + } + + public function setName(string $name) + { + return $this->name = $name; + } + + public function getParent() + { + return $this->parent; + } + + public function setParent(int $parent) + { + $this->parent = $parent; + } + + public function getStatus() : int + { + return $this->status; + } + + public function setStatus(int $status) + { + $this->status = $status; + } + + public function getUnit() : int + { + return $this->unit; + } + + public function setUnit(int $unit) + { + $this->unit = $unit; + } + + public function getDescription() : string + { + return $this->description; + } + + public function setDescription(string $desc) + { + $this->description = $desc; + } + + public function toArray() : array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'description' => $this->description, + 'unit' => $this->unit, + ]; + } + + /** + * Get string representation. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function __toString() + { + return json_encode($this->toArray()); + } + + /** + * Json serialize. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function jsonSerialize() + { + return $this->toArray(); + } +} diff --git a/Models/DepartmentMapper.php b/Models/DepartmentMapper.php new file mode 100644 index 0000000..60f5c33 --- /dev/null +++ b/Models/DepartmentMapper.php @@ -0,0 +1,59 @@ + + * @author Dennis Eichhorn + * @copyright 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 + * @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_status' => ['name' => 'organization_department_status', 'type' => 'int', 'internal' => 'status'], + 'organization_department_unit' => ['name' => 'organization_department_unit', 'type' => 'int', 'internal' => 'unit'], + ]; + + protected static $belongsTo = [ + 'account' => [ + 'mapper' => UnitMapper::class, + 'dest' => 'organization_department_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'; +} diff --git a/Models/Position.php b/Models/Position.php new file mode 100644 index 0000000..a68ee8b --- /dev/null +++ b/Models/Position.php @@ -0,0 +1,111 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Organization\Models; + +use phpOMS\Contract\ArrayableInterface; + +class Position implements ArrayableInterface, \JsonSerializable +{ + private $id = 0; + + private $name = ''; + + private $parent = null; + + private $description = ''; + + protected $status = Status::INACTIVE; + + public function getId() : int + { + return $this->id; + } + + public function getName() : string + { + return $this->name; + } + + public function setName(string $name) + { + $this->name = $name; + } + + public function getParent() + { + return $this->parent; + } + + public function setParent(int $parent) + { + $this->parent = $parent; + } + + public function getStatus() : int + { + return $this->status; + } + + public function setStatus(int $status) + { + $this->status = $status; + } + + public function getDescription() : string + { + return $this->description; + } + + public function setDescription(string $desc) + { + $this->description = $desc; + } + + public function toArray() : array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'description' => $this->description, + ]; + } + + /** + * Get string representation. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function __toString() + { + return json_encode($this->toArray()); + } + + /** + * Json serialize. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function jsonSerialize() + { + return $this->toArray(); + } +} diff --git a/Models/PositionMapper.php b/Models/PositionMapper.php new file mode 100644 index 0000000..5898d73 --- /dev/null +++ b/Models/PositionMapper.php @@ -0,0 +1,59 @@ + + * @author Dennis Eichhorn + * @copyright 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 PositionMapper extends DataMapperAbstract +{ + + /** + * Columns. + * + * @var array + * @since 1.0.0 + */ + protected static $columns = [ + 'organization_position_id' => ['name' => 'organization_position_id', 'type' => 'int', 'internal' => 'id'], + 'organization_position_name' => ['name' => 'organization_position_name', 'type' => 'string', 'internal' => 'name'], + 'organization_position_description' => ['name' => 'organization_position_description', 'type' => 'string', 'internal' => 'description'], + 'organization_position_parent' => ['name' => 'organization_position_parent', 'type' => 'int', 'internal' => 'parent'], + 'organization_position_status' => ['name' => 'organization_position_status', 'type' => 'int', 'internal' => 'status'], + ]; + + protected static $belongsTo = [ + 'account' => [ + 'mapper' => PositionMapper::class, + 'dest' => 'organization_position_parent', + ], + ]; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + protected static $table = 'organization_position'; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + protected static $primaryField = 'organization_position_id'; +} diff --git a/Models/Status.php b/Models/Status.php new file mode 100644 index 0000000..04ca91e --- /dev/null +++ b/Models/Status.php @@ -0,0 +1,38 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Organization\Models; + +use phpOMS\Datatypes\Enum; + +/** + * Accept status enum. + * + * @category Calendar + * @package Modules + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +abstract class Status extends Enum +{ + /* public */ const ACTIVE = 1; + + /* public */ const INACTIVE = 2; + + /* public */ const HIDDEN = 4; +} diff --git a/Models/Unit.php b/Models/Unit.php new file mode 100644 index 0000000..1073027 --- /dev/null +++ b/Models/Unit.php @@ -0,0 +1,111 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Organization\Models; + +use phpOMS\Contract\ArrayableInterface; + +class Unit implements ArrayableInterface, \JsonSerializable +{ + private $id = 0; + + private $name = ''; + + private $parent = null; + + private $description = ''; + + protected $status = Status::INACTIVE; + + public function getId() : int + { + return $this->id; + } + + public function getName() : string + { + return $this->name; + } + + public function setName(string $name) + { + $this->name = $name; + } + + public function getParent() + { + return $this->parent; + } + + public function setParent(int $parent) + { + $this->parent = $parent; + } + + public function getStatus() : int + { + return $this->status; + } + + public function setStatus(int $status) + { + $this->status = $status; + } + + public function getDescription() : string + { + return $this->description; + } + + public function setDescription(string $desc) + { + $this->description = $desc; + } + + public function toArray() : array + { + return [ + 'id' => $this->id, + 'name' => $this->name, + 'description' => $this->description, + ]; + } + + /** + * Get string representation. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function __toString() + { + return json_encode($this->toArray()); + } + + /** + * Json serialize. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function jsonSerialize() + { + return $this->toArray(); + } +} diff --git a/Models/UnitMapper.php b/Models/UnitMapper.php new file mode 100644 index 0000000..94ce265 --- /dev/null +++ b/Models/UnitMapper.php @@ -0,0 +1,58 @@ + + * @author Dennis Eichhorn + * @copyright 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 + * @since 1.0.0 + */ + protected static $columns = [ + 'organization_unit_id' => ['name' => 'organization_unit_id', 'type' => 'int', 'internal' => 'id'], + '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_status' => ['name' => 'organization_unit_status', 'type' => 'int', 'internal' => 'status'], + ]; + + protected static $belongsTo = [ + 'account' => [ + 'mapper' => UnitMapper::class, + 'dest' => 'organization_uni_parent', + ], + ]; + + /** + * 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'; +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..0722c4c --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Business # diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php new file mode 100644 index 0000000..3c9279b --- /dev/null +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -0,0 +1,21 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +return ['Navigation' => [ + 'Departments' => 'Departments', + 'Organization' => 'Organization', + 'Positions' => 'Positions', + 'Units' => 'Units', +]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php new file mode 100644 index 0000000..b1a48b2 --- /dev/null +++ b/Theme/Backend/Lang/en.lang.php @@ -0,0 +1,29 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +return ['Organization' => [ + 'Active' => 'Active', + 'Department' => 'Department', + 'Departments' => 'Departments', + 'Description' => 'Description', + 'Inactive' => 'Inactive', + 'Name' => 'Name', + 'Parent' => 'Parent', + 'Position' => 'Position', + 'Positions' => 'Positions', + 'Status' => 'Status', + 'Unit' => 'Unit', + 'Units' => 'Units', +]]; diff --git a/Theme/Backend/department-create.tpl.php b/Theme/Backend/department-create.tpl.php new file mode 100644 index 0000000..e40bfe0 --- /dev/null +++ b/Theme/Backend/department-create.tpl.php @@ -0,0 +1,44 @@ + + * @author Dennis Eichhorn + * @copyright 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(); ?> + +
+
+
+

getText('Department'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/Theme/Backend/department-list.tpl.php b/Theme/Backend/department-list.tpl.php new file mode 100644 index 0000000..b748fd0 --- /dev/null +++ b/Theme/Backend/department-list.tpl.php @@ -0,0 +1,58 @@ + + * @author Dennis Eichhorn + * @copyright 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(); ?> + +
+
+
+ + + + + + + getData('list:elements') as $key => $value) : $c++; + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/organization/department/profile?{?}&id=' . $value->getId()); ?> + + +
getText('Departments'); ?>
getText('ID', 0, 0); ?> + getText('Name'); ?> + getText('Parent'); ?> + getText('Unit'); ?> +
render(); ?> +
getId(); ?> + getName(); ?> + getParent(); ?> + getUnit(); ?> + + +
getText('Empty', 0, 0); ?> + +
+
+
+
\ No newline at end of file diff --git a/Theme/Backend/department-profile.tpl.php b/Theme/Backend/department-profile.tpl.php new file mode 100644 index 0000000..bd1545b --- /dev/null +++ b/Theme/Backend/department-profile.tpl.php @@ -0,0 +1,48 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +/** + * @var \phpOMS\Views\View $this + */ + +$department = $this->getData('department'); + +echo $this->getData('nav')->render(); ?> + +
+
+
+

getText('Department'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/Theme/Backend/position-create.tpl.php b/Theme/Backend/position-create.tpl.php new file mode 100644 index 0000000..4f6eb84 --- /dev/null +++ b/Theme/Backend/position-create.tpl.php @@ -0,0 +1,46 @@ + + * @author Dennis Eichhorn + * @copyright 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(); ?> + +
+
+
+

getText('Position'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Theme/Backend/position-list.tpl.php b/Theme/Backend/position-list.tpl.php new file mode 100644 index 0000000..4064107 --- /dev/null +++ b/Theme/Backend/position-list.tpl.php @@ -0,0 +1,57 @@ + + * @author Dennis Eichhorn + * @copyright 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); + +$listElements = $this->getData('list:elements') ?? []; + +echo $this->getData('nav')->render(); ?> + +
+
+
+ + + + + + + $value) : $count++; + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/organization/position/profile?{?}&id=' . $value->getId()); ?> + +
getText('Positions'); ?>
getText('ID', 0, 0); ?> + getText('Name'); ?> + getText('Parent'); ?> +
render(); ?> +
getId(); ?> + getName(); ?> + getParent(); ?> + + +
getText('Empty', 0, 0); ?> + +
+
+
+
diff --git a/Theme/Backend/position-profile.tpl.php b/Theme/Backend/position-profile.tpl.php new file mode 100644 index 0000000..65b6d88 --- /dev/null +++ b/Theme/Backend/position-profile.tpl.php @@ -0,0 +1,48 @@ + + * @author Dennis Eichhorn + * @copyright Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +/** + * @var \phpOMS\Views\View $this + */ + +$position = $this->getData('position'); + +echo $this->getData('nav')->render(); ?> + +
+
+
+

getText('Position'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Theme/Backend/unit-create.tpl.php b/Theme/Backend/unit-create.tpl.php new file mode 100644 index 0000000..ccc7a9e --- /dev/null +++ b/Theme/Backend/unit-create.tpl.php @@ -0,0 +1,46 @@ + + * @author Dennis Eichhorn + * @copyright 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(); ?> + +
+
+
+

getText('Unit'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Theme/Backend/unit-list.tpl.php b/Theme/Backend/unit-list.tpl.php new file mode 100644 index 0000000..4b6d4a0 --- /dev/null +++ b/Theme/Backend/unit-list.tpl.php @@ -0,0 +1,52 @@ + + * @author Dennis Eichhorn + * @copyright 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(); ?> + +
+
+
+ + + + + + + getData('list:elements') as $key => $value) : + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/organization/unit/profile?{?}&id=' . $value->getId()); ?> + +
getText('Units'); ?>
getText('ID', 0, 0); ?> + getText('Name'); ?> + getText('Parent'); ?> +
render(); ?> +
getId(); ?> + getName(); ?> + getParent(); ?> + +
+
+
+
diff --git a/Theme/Backend/unit-profile.tpl.php b/Theme/Backend/unit-profile.tpl.php new file mode 100644 index 0000000..97278fa --- /dev/null +++ b/Theme/Backend/unit-profile.tpl.php @@ -0,0 +1,48 @@ + + * @author Dennis Eichhorn + * @copyright 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(); ?> + +
+
+
+

getText('Unit'); ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/info.json b/info.json new file mode 100644 index 0000000..8797feb --- /dev/null +++ b/info.json @@ -0,0 +1,44 @@ +{ + "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": [ + "4b04e005b108e41e107bf2e16b858588275200f3" + ], + "type": 4, + "for": "Organization", + "file": "Organization", + "from": "Admin" + }, + { + "pid": [ + "754a08ddf8bcb1cf22f310f09206dd783d42f7dd" + ], + "type": 5, + "from": "Organization", + "for": "Navigation", + "file": "Navigation" + } + ] +}