commit 9b7500858ae3530fe6e77fdcfd8c38d5f8c8f054 Author: Dennis Eichhorn Date: Sun Nov 29 21:57:18 2015 +0100 Init diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php new file mode 100644 index 0000000..6c3b62b --- /dev/null +++ b/Admin/Install/Navigation.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\ClientManagement\Admin\Install; + +/** + * 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 +{ + public static function install($dbPool) + { + $navData = json_decode(file_get_contents(__DIR__ . '/nav.install.json'), true); + + $class = '\\Modules\\Navigation\\Admin\\Installer'; + $class::installExternal($dbPool, $navData); + } +} diff --git a/Admin/Install/nav.install.json b/Admin/Install/nav.install.json new file mode 100644 index 0000000..f199b28 --- /dev/null +++ b/Admin/Install/nav.install.json @@ -0,0 +1,139 @@ +[ + { + "id": 1003102001, + "pid": "754a08ddf8bcb1cf22f310f09206dd783d42f7dd", + "type": 2, + "subtype": 1, + "name": "Clients", + "uri": "/{/lang}/backend/sales/client/list", + "target": "self", + "icon": null, + "order": 1, + "from": 1003100000, + "permission": null, + "parent": 1001601001, + "children": [ + { + "id": 1003102101, + "pid": "25a25434541197e2ca3ff0164a8b02173c5fcd8b", + "type": 3, + "subtype": 1, + "name": "List", + "uri": "/{/lang}/backend/sales/client/list", + "target": "self", + "icon": null, + "order": 1, + "from": 1003100000, + "permission": null, + "parent": 1003102001, + "children": [ + { + "id": 1003103001, + "pid": "734f84316536b783ab45b9777a4cdefa56ba6aa0", + "type": 5, + "subtype": 1, + "name": "Create", + "uri": "/{/lang}/backend/sales/client/create", + "target": "self", + "icon": null, + "order": 1, + "from": 1003100000, + "permission": null, + "parent": 1003102101, + "children": [] + }, + { + "id": 1003103004, + "pid": "734f84316536b783ab45b9777a4cdefa56ba6aa0", + "type": 5, + "subtype": 1, + "name": "Profile", + "uri": "/{/lang}/backend/sales/client/profile", + "target": "self", + "icon": null, + "order": 1, + "from": 1003100000, + "permission": null, + "parent": 1003102101, + "children": [] + }, + { + "id": 1003103005, + "pid": "734f84316536b783ab45b9777a4cdefa56ba6aa0", + "type": 5, + "subtype": 1, + "name": "Turnover", + "uri": "/{/lang}/backend/sales/client/turnover", + "target": "self", + "icon": null, + "order": 1, + "from": 1003100000, + "permission": null, + "parent": 1003102101, + "children": [] + }, + { + "id": 1003103201, + "pid": "734f84316536b783ab45b9777a4cdefa56ba6aa0", + "type": 3, + "subtype": 1, + "name": "Invoices", + "uri": "/{/lang}/backend/sales/client/invoice/list", + "target": "self", + "icon": null, + "order": 1, + "from": 1003100000, + "permission": null, + "parent": 1003102101, + "children": [] + }, + { + "id": 1003103301, + "pid": "734f84316536b783ab45b9777a4cdefa56ba6aa0", + "type": 3, + "subtype": 1, + "name": "Articles", + "uri": "/{/lang}/backend/sales/client/article/list", + "target": "self", + "icon": null, + "order": 1, + "from": 1003100000, + "permission": null, + "parent": 1003102101, + "children": [] + }, + { + "id": 1003103401, + "pid": "734f84316536b783ab45b9777a4cdefa56ba6aa0", + "type": 3, + "subtype": 1, + "name": "Analysis", + "uri": "/{/lang}/backend/sales/client/profile/analysis", + "target": "self", + "icon": null, + "order": 1, + "from": 1003100000, + "permission": null, + "parent": 1003102101, + "children": [] + } + ] + }, + { + "id": 1003102201, + "pid": "25a25434541197e2ca3ff0164a8b02173c5fcd8b", + "type": 3, + "subtype": 1, + "name": "Create", + "uri": "/{/lang}/backend/sales/client/create", + "target": "self", + "icon": null, + "order": 1, + "from": 1003100000, + "permission": null, + "parent": 1003102001, + "children": [] + } + ] + } +] diff --git a/Admin/Installer.php b/Admin/Installer.php new file mode 100644 index 0000000..4eebea5 --- /dev/null +++ b/Admin/Installer.php @@ -0,0 +1,49 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\ClientManagement\Admin; + +use phpOMS\DataStorage\Database\DatabaseType; +use phpOMS\DataStorage\Database\Pool; +use phpOMS\Module\InstallerAbstract; + +/** + * Client Management install 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 Installer extends InstallerAbstract +{ + + /** + * {@inheritdoc} + */ + public static function install(Pool $dbPool, array $info) + { + parent::install($dbPool, $info); + + switch ($dbPool->get('core')->getType()) { + case DatabaseType::MYSQL: + + break; + } + } +} diff --git a/Controller.php b/Controller.php new file mode 100644 index 0000000..efc2d18 --- /dev/null +++ b/Controller.php @@ -0,0 +1,170 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\ClientManagement; + +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; + +/** + * ClientManagement class. + * + * @category Modules + * @package Modules\ClientManagement + * @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 name. + * + * @var \string + * @since 1.0.0 + */ + protected static $module = 'ClientManagement'; + + /** + * Localization files. + * + * @var \string + * @since 1.0.0 + */ + protected static $localization = [ + RequestDestination::BACKEND => ['backend'], + ]; + + /** + * Providing. + * + * @var \string + * @since 1.0.0 + */ + protected static $providing = [ + 'Content', + ]; + + /** + * Dependencies. + * + * @var \string + * @since 1.0.0 + */ + protected static $dependencies = []; + + /** + * Routing elements. + * + * @var array + * @since 1.0.0 + */ + protected static $routes = [ + '^.*/backend/sales/client/list.*$' => [['dest' => '\Modules\ClientManagement\Controller:viewClientManagementClientList', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/sales/client/create.*$' => [['dest' => '\Modules\ClientManagement\Controller:viewClientManagementClientCreate', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/sales/client/profile.*$' => [['dest' => '\Modules\ClientManagement\Controller:viewClientManagementClientProfile', 'method' => 'GET', 'type' => ViewLayout::MAIN],], + '^.*/backend/sales/client/analysis.*$' => [['dest' => '\Modules\ClientManagement\Controller:viewClientManagementClientAnalysis', '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 + */ + public function viewClientManagementClientList(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/ClientManagement/Theme/backend/clients-list'); + $view->addData('nav', $this->createNavigation(1003102001, $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 + */ + public function viewClientManagementClientCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/ClientManagement/Theme/backend/clients-create'); + $view->addData('nav', $this->createNavigation(1003102001, $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 + */ + public function viewClientManagementClientProfile(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface + { + $view = new View($this->app, $request, $response); + $view->setTemplate('/Modules/ClientManagement/Theme/backend/clients-profile'); + $view->addData('nav', $this->createNavigation(1003102001, $request, $response)); + + return $view; + } + + /** + * @param int $pageId Page/parent Id for navigation + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * + * @return RenderableInterface + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + private function createNavigation(\int $pageId, RequestAbstract $request, ResponseAbstract $response) + { + $nav = Navigation::getInstance($request, $this->app->dbPool); + $navView = new NavigationView($this->app, $request, $response); + $navView->setTemplate('/Modules/Navigation/Theme/backend/mid'); + $navView->setNav($nav->getNav()); + $navView->setLanguage($request->getL11n()->language); + $navView->setParent($pageId); + + return $navView; + } +} 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/clients-create.tpl.php b/Theme/backend/clients-create.tpl.php new file mode 100644 index 0000000..4907318 --- /dev/null +++ b/Theme/backend/clients-create.tpl.php @@ -0,0 +1,229 @@ + + * @author Dennis Eichhorn + * @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(); ?> + +
+
+ +
+
+ +
+
+

l11n->lang['ClientManagement']['Client'] ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

l11n->lang['ClientManagement']['Contact'] ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

l11n->lang['ClientManagement']['Address'] ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

l11n->lang['ClientManagement']['PaymentTerm'] ?>

+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

l11n->lang['ClientManagement']['Payment'] ?>

+
+
+ +
+
+
+
+
+
+
+
+ +
+
+

l11n->lang['ClientManagement']['Price'] ?>

+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

l11n->lang['ClientManagement']['AreaManager'] ?>

+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
diff --git a/Theme/backend/clients-list.tpl.php b/Theme/backend/clients-list.tpl.php new file mode 100644 index 0000000..3ea7871 --- /dev/null +++ b/Theme/backend/clients-list.tpl.php @@ -0,0 +1,85 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ + +$footerView = new \Web\Views\Lists\PaginationView($this->app, $this->request, $this->response); +$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); +$footerView->setPages(20); +$footerView->setPage(1); + +echo $this->getData('nav')->render(); ?> + + + +
+ + + + + + + + $value) : $count++; ?> + + +
l11n->lang['ClientManagement']['Clients'] ?>
l11n->lang[0]['ID']; ?> + l11n->lang['ClientManagement']['Name1']; ?> + l11n->lang['ClientManagement']['Name2']; ?> + l11n->lang['ClientManagement']['Name3']; ?> + l11n->lang['ClientManagement']['City']; ?> + l11n->lang['ClientManagement']['Zip']; ?> + l11n->lang['ClientManagement']['Address']; ?> + l11n->lang['ClientManagement']['Country']; ?> +
render(); ?> +
l11n->lang[0]['Empty']; ?> + +
+
diff --git a/Theme/backend/clients-single.tpl.php b/Theme/backend/clients-single.tpl.php new file mode 100644 index 0000000..9dd9c79 --- /dev/null +++ b/Theme/backend/clients-single.tpl.php @@ -0,0 +1,19 @@ + + * @author Dennis Eichhorn + * @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(); ?> diff --git a/Theme/lang/backend.en.lang.php b/Theme/lang/backend.en.lang.php new file mode 100644 index 0000000..a69e30e --- /dev/null +++ b/Theme/lang/backend.en.lang.php @@ -0,0 +1,64 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +$MODLANG['ClientManagement'] = [ + 'Accounting' => 'Accounting', + 'Address' => 'Address', + 'Addresses' => 'Addresses', + 'AreaManager' => 'Area Manager', + 'Articlegroup' => 'Articlegroup', + 'Bonus' => 'Bonus', + 'Business' => 'Business', + 'City' => 'City', + 'Client' => 'Client', + 'Clients' => 'Clients', + 'Contact' => 'Contact', + 'Country' => 'Country', + 'Creditcard' => 'Creditcard', + 'Default' => 'Default', + 'Delivery' => 'Delivery', + 'Discount' => 'Discount', + 'DiscountP' => 'Discount %', + 'Email' => 'Email', + 'Fax' => 'Fax', + 'Files' => 'Files', + 'Freightage' => 'Freightage', + 'Group' => 'Group', + 'Info' => 'Info', + 'Invoice' => 'Invoice', + 'IsDefault' => 'Is default?', + 'Master' => 'Master', + 'Name' => 'Name', + 'Name1' => 'Name1', + 'Name2' => 'Name2', + 'Name3' => 'Name3', + 'Office' => 'Office', + 'Payment' => 'Payment', + 'PaymentTerm' => 'Payment Term', + 'Phone' => 'Phone', + 'Prices' => 'Prices', + 'Price' => 'Price', + 'Private' => 'Private', + 'Productgroup' => 'Productgroup', + 'Purchase' => 'Purchase', + 'Quantity' => 'Quantity', + 'Sales' => 'Sales', + 'Segment' => 'Segment', + 'Subtype' => 'Subtype', + 'Support' => 'Support', + 'Type' => 'Type', + 'Wire' => 'Wire', + 'Zip' => 'Zip', +]; diff --git a/Theme/lang/nav.backend.en.lang.php b/Theme/lang/nav.backend.en.lang.php new file mode 100644 index 0000000..a2fa112 --- /dev/null +++ b/Theme/lang/nav.backend.en.lang.php @@ -0,0 +1,17 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +$MODLANG['Navigation'] = [ +]; diff --git a/info.json b/info.json new file mode 100644 index 0000000..198c0df --- /dev/null +++ b/info.json @@ -0,0 +1,51 @@ +{ + "name": { + "id": 1003100000, + "internal": "ClientManagement", + "external": "OMS Client Management" + }, + "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": "ClientManagement", + "dependencies": {}, + "providing": { + "Navigation": "*" + }, + "load": [ + { + "pid": [ + "25a25434541197e2ca3ff0164a8b02173c5fcd8b" + ], + "type": 4, + "for": 0, + "from": "ClientManagement", + "file": "ClientManagement" + }, + { + "pid": [ + "754a08ddf8bcb1cf22f310f09206dd783d42f7dd" + ], + "type": 5, + "from": "ClientManagement", + "for": "Navigation", + "file": "nav.backend" + }, + { + "pid": [ + "25a25434541197e2ca3ff0164a8b02173c5fcd8b" + ], + "type": 5, + "for": "Content", + "file": "backend", + "from": "ClientManagement" + } + ] +}