From 58377a15b45f6f6c2e8f9ed808569ee8210dd1e2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 30 May 2018 13:39:00 +0200 Subject: [PATCH] Use root namespace --- Admin/Install/Navigation.php | 2 +- Controller.php | 4 ++++ Interfaces/GSD/Model/GSDCostCenterMapper.php | 2 +- Interfaces/GSD/Model/GSDCostObjectMapper.php | 2 +- Interfaces/GSD/import.tpl.php | 15 ++++++++++++ Interfaces/GSD/interface.json | 4 ++-- Interfaces/Intrexx/interface.json | 4 ++-- Models/InterfaceManager.php | 24 +++++++++++++++----- Models/InterfaceManagerMapper.php | 2 +- Theme/Backend/exchange-import-list.tpl.php | 2 +- Theme/Backend/exchange-import.tpl.php | 4 +++- 11 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 Interfaces/GSD/import.tpl.php diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 035faa3..71cbb18 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -38,7 +38,7 @@ class Navigation */ public static function install(string $path = null, DatabasePool $dbPool = null) : void { - $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); + $navData = \json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); $class = '\\Modules\\Navigation\\Admin\\Installer'; /** @var $class \Modules\Navigation\Admin\Installer */ diff --git a/Controller.php b/Controller.php index 860125d..9803ba1 100644 --- a/Controller.php +++ b/Controller.php @@ -151,6 +151,10 @@ final class Controller extends ModuleAbstract implements WebInterface $view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-import'); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response)); + $interface = InterfaceManagerMapper::get((int) $request->getData('id')); + + $view->addData('interface', $interface); + return $view; } } diff --git a/Interfaces/GSD/Model/GSDCostCenterMapper.php b/Interfaces/GSD/Model/GSDCostCenterMapper.php index a4d92aa..b17b4b1 100644 --- a/Interfaces/GSD/Model/GSDCostCenterMapper.php +++ b/Interfaces/GSD/Model/GSDCostCenterMapper.php @@ -30,7 +30,7 @@ final class GSDCostCenterMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array> * @since 1.0.0 */ protected static $columns = [ diff --git a/Interfaces/GSD/Model/GSDCostObjectMapper.php b/Interfaces/GSD/Model/GSDCostObjectMapper.php index d238563..17a90e9 100644 --- a/Interfaces/GSD/Model/GSDCostObjectMapper.php +++ b/Interfaces/GSD/Model/GSDCostObjectMapper.php @@ -30,7 +30,7 @@ final class GSDCostObjectMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array> * @since 1.0.0 */ protected static $columns = [ diff --git a/Interfaces/GSD/import.tpl.php b/Interfaces/GSD/import.tpl.php new file mode 100644 index 0000000..0964e28 --- /dev/null +++ b/Interfaces/GSD/import.tpl.php @@ -0,0 +1,15 @@ +
+
+
+

getHtml('Task') ?>

+ +
+
+ + +
+
+
+
+
+
\ No newline at end of file diff --git a/Interfaces/GSD/interface.json b/Interfaces/GSD/interface.json index ab5ad3f..d87e945 100644 --- a/Interfaces/GSD/interface.json +++ b/Interfaces/GSD/interface.json @@ -3,6 +3,6 @@ "version": "1.0.0", "website": "", "path": "GSD", - "export": true, - "import": false + "export": false, + "import": true } \ No newline at end of file diff --git a/Interfaces/Intrexx/interface.json b/Interfaces/Intrexx/interface.json index 6c51a96..8d9b37e 100644 --- a/Interfaces/Intrexx/interface.json +++ b/Interfaces/Intrexx/interface.json @@ -3,6 +3,6 @@ "version": "1.0.0", "website": "", "path": "Intrexx", - "export": true, - "import": false + "export": false, + "import": true } \ No newline at end of file diff --git a/Models/InterfaceManager.php b/Models/InterfaceManager.php index 585f366..891532a 100644 --- a/Models/InterfaceManager.php +++ b/Models/InterfaceManager.php @@ -48,7 +48,7 @@ final class InterfaceManager /** * Info data. * - * @var array + * @var array * @since 1.0.0 */ private $info = []; @@ -89,6 +89,18 @@ final class InterfaceManager return $this->path; } + /** + * Get info path + * + * @return string + * + * @since 1.0.0 + */ + public function getInterfacePath() : string + { + return $this->info['path']; + } + /** * Get info name * @@ -136,11 +148,11 @@ final class InterfaceManager */ public function load() : void { - if (!file_exists($this->path)) { + if (!\file_exists($this->path)) { throw new PathException($this->path); } - $this->info = json_decode(file_get_contents($this->path), true); + $this->info = \json_decode(file_get_contents($this->path), true); } /** @@ -152,11 +164,11 @@ final class InterfaceManager */ public function update() : void { - if (!file_exists($this->path)) { + if (!\file_exists($this->path)) { throw new PathException($this->path); } - file_put_contents($this->path, json_encode($this->info, JSON_PRETTY_PRINT)); + \file_put_contents($this->path, \json_encode($this->info, JSON_PRETTY_PRINT)); } /** @@ -182,7 +194,7 @@ final class InterfaceManager /** * Get info data. * - * @return array + * @return array * * @since 1.0.0 */ diff --git a/Models/InterfaceManagerMapper.php b/Models/InterfaceManagerMapper.php index 0bac3d5..3c5ef10 100644 --- a/Models/InterfaceManagerMapper.php +++ b/Models/InterfaceManagerMapper.php @@ -33,7 +33,7 @@ class InterfaceManagerMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array> * @since 1.0.0 */ protected static $columns = [ diff --git a/Theme/Backend/exchange-import-list.tpl.php b/Theme/Backend/exchange-import-list.tpl.php index a872aaa..6a5eeb5 100644 --- a/Theme/Backend/exchange-import-list.tpl.php +++ b/Theme/Backend/exchange-import-list.tpl.php @@ -28,7 +28,7 @@ echo $this->getData('nav')->render(); getHtml('Title') ?> $value) : $count++; - $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/exchange/export/profile?{?}&id=' . $value->getId()); ?> + $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/exchange/import/profile?{?}&id=' . $value->getId()); ?> printHtml($value->getName()); ?> diff --git a/Theme/Backend/exchange-import.tpl.php b/Theme/Backend/exchange-import.tpl.php index 6450588..ebd3ba2 100644 --- a/Theme/Backend/exchange-import.tpl.php +++ b/Theme/Backend/exchange-import.tpl.php @@ -14,4 +14,6 @@ /** * @var \phpOMS\Views\View $this */ -echo $this->getData('nav')->render(); ?> +echo $this->getData('nav')->render(); + +include __DIR__ . '/../../Interfaces/' . $this->getData('interface')->getInterfacePath() . '/import.tpl.php'; \ No newline at end of file