diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index 46e91dd..1c28373 100644 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -1,31 +1,31 @@ - [ - [ - 'dest' => '\Modules\Exchange\Controller\ApiController:apiExchangeImport', - 'verb' => RouteVerb::SET, - 'permission' => [ - 'module' => ApiController::MODULE_NAME, - 'type' => PermissionType::CREATE, - 'state' => PermissionState::IMPORT, - ], - ], - ], - '^.*/admin/exchange/export/profile.*$' => [ - [ - 'dest' => '\Modules\Exchange\Controller\ApiController:apiExchangeExport', - 'verb' => RouteVerb::SET, - 'permission' => [ - 'module' => ApiController::MODULE_NAME, - 'type' => PermissionType::CREATE, - 'state' => PermissionState::EXPORT, - ], - ], - ], -]; + [ + [ + 'dest' => '\Modules\Exchange\Controller\ApiController:apiExchangeImport', + 'verb' => RouteVerb::SET, + 'permission' => [ + 'module' => ApiController::MODULE_NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionState::IMPORT, + ], + ], + ], + '^.*/admin/exchange/export/profile.*$' => [ + [ + 'dest' => '\Modules\Exchange\Controller\ApiController:apiExchangeExport', + 'verb' => RouteVerb::SET, + 'permission' => [ + 'module' => ApiController::MODULE_NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionState::EXPORT, + ], + ], + ], +]; diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 0a14e9f..26a150b 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -1,4 +1,4 @@ -set($request->getUri()->__toString(), [ 'status' => $status, 'title' => 'Exchange', - 'message' => $message + 'message' => $message, ]); } diff --git a/Interfaces/GSD/Model/GSDCostCenterMapper.php b/Interfaces/GSD/Model/GSDCostCenterMapper.php index 49fa710..3fe12eb 100644 --- a/Interfaces/GSD/Model/GSDCostCenterMapper.php +++ b/Interfaces/GSD/Model/GSDCostCenterMapper.php @@ -1,67 +1,67 @@ -> - * @since 1.0.0 - */ - protected static $columns = [ - 'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'], - 'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTime', 'internal' => 'createdAt'], - 'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'], - 'KST' => ['name' => 'KST', 'type' => 'string', 'internal' => 'costcenter'], - 'Bezeichnung' => ['name' => 'Bezeichnung', 'type' => 'string', 'internal' => 'description'], - ]; - - /** - * Primary table. - * - * @var string - * @since 1.0.0 - */ - protected static $table = 'FiKostenstellen'; - - /** - * Created at. - * - * @var string - * @since 1.0.0 - */ - protected static $createdAt = 'row_create_time'; - - /** - * Primary field name. - * - * @var string - * @since 1.0.0 - */ - protected static $primaryField = 'ROW_ID'; -} +> + * @since 1.0.0 + */ + protected static $columns = [ + 'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'], + 'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTime', 'internal' => 'createdAt'], + 'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'], + 'KST' => ['name' => 'KST', 'type' => 'string', 'internal' => 'costcenter'], + 'Bezeichnung' => ['name' => 'Bezeichnung', 'type' => 'string', 'internal' => 'description'], + ]; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + protected static $table = 'FiKostenstellen'; + + /** + * Created at. + * + * @var string + * @since 1.0.0 + */ + protected static $createdAt = 'row_create_time'; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + protected static $primaryField = 'ROW_ID'; +} diff --git a/Interfaces/GSD/Model/GSDCostObjectMapper.php b/Interfaces/GSD/Model/GSDCostObjectMapper.php index 6cd4db4..e25b1eb 100644 --- a/Interfaces/GSD/Model/GSDCostObjectMapper.php +++ b/Interfaces/GSD/Model/GSDCostObjectMapper.php @@ -1,67 +1,67 @@ -> - * @since 1.0.0 - */ - protected static $columns = [ - 'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'], - 'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTime', 'internal' => 'createdAt'], - 'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'], - 'KTR' => ['name' => 'KTR', 'type' => 'string', 'internal' => 'costobject'], - 'Bezeichnung' => ['name' => 'Bezeichnung', 'type' => 'string', 'internal' => 'description'], - ]; - - /** - * Primary table. - * - * @var string - * @since 1.0.0 - */ - protected static $table = 'FiKostentraeger'; - - /** - * Created at. - * - * @var string - * @since 1.0.0 - */ - protected static $createdAt = 'row_create_time'; - - /** - * Primary field name. - * - * @var string - * @since 1.0.0 - */ - protected static $primaryField = 'ROW_ID'; -} +> + * @since 1.0.0 + */ + protected static $columns = [ + 'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'], + 'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTime', 'internal' => 'createdAt'], + 'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'], + 'KTR' => ['name' => 'KTR', 'type' => 'string', 'internal' => 'costobject'], + 'Bezeichnung' => ['name' => 'Bezeichnung', 'type' => 'string', 'internal' => 'description'], + ]; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + protected static $table = 'FiKostentraeger'; + + /** + * Created at. + * + * @var string + * @since 1.0.0 + */ + protected static $createdAt = 'row_create_time'; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + protected static $primaryField = 'ROW_ID'; +} diff --git a/Interfaces/GSD/en.lang.php b/Interfaces/GSD/en.lang.php index 381a57a..1f04288 100644 --- a/Interfaces/GSD/en.lang.php +++ b/Interfaces/GSD/en.lang.php @@ -1,22 +1,22 @@ - 'Accounts', - 'Articles' => 'Articles', - 'CostCenters' => 'Cost Centers', - 'CostObjects' => 'Cost Objects', - 'Customers' => 'Customers', - 'Invoices' => 'Invoices', - 'Options' => 'Options', - 'Suppliers' => 'Suppliers', -]; + 'Accounts', + 'Articles' => 'Articles', + 'CostCenters' => 'Cost Centers', + 'CostObjects' => 'Cost Objects', + 'Customers' => 'Customers', + 'Invoices' => 'Invoices', + 'Options' => 'Options', + 'Suppliers' => 'Suppliers', +]; diff --git a/Models/InterfaceManager.php b/Models/InterfaceManager.php index c9589da..8bc7056 100644 --- a/Models/InterfaceManager.php +++ b/Models/InterfaceManager.php @@ -1,206 +1,206 @@ - - * @since 1.0.0 - */ - private $info = []; - - /** - * Object constructor. - * - * @param string $path Info file path - * - * @since 1.0.0 - */ - public function __construct(string $path = '') - { - $this->path = $path; - } - - /** - * Get id - * - * @return int - * - * @since 1.0.0 - */ - public function getId() : int - { - return $this->id; - } - - /** - * Get info path - * - * @return string - * - * @since 1.0.0 - */ - public function getPath() : string - { - return $this->path; - } - - /** - * Get info path - * - * @return string - * - * @since 1.0.0 - */ - public function getInterfacePath() : string - { - return $this->info['path']; - } - - /** - * Get info name - * - * @return string - * - * @since 1.0.0 - */ - public function getName() : string - { - return $this->info['name']; - } - - /** - * Provides import interface - * - * @return bool - * - * @since 1.0.0 - */ - public function hasImport() : bool - { - return $this->info['import']; - } - - /** - * Provides export interface - * - * @return bool - * - * @since 1.0.0 - */ - public function hasExport() : bool - { - return $this->info['export']; - } - - /** - * Load info data from path. - * - * @return void - * - * @throws PathException This exception is thrown in case the info file path doesn't exist. - * - * @since 1.0.0 - */ - public function load() : void - { - if (!\file_exists($this->path)) { - throw new PathException($this->path); - } - - $content = \file_get_contents($this->path); - $this->info = \json_decode($content !== false ? $content : '[]', true); - } - - /** - * Update info file - * - * @return void - * - * @since 1.0.0 - */ - public function update() : void - { - if (!\file_exists($this->path)) { - throw new PathException($this->path); - } - - \file_put_contents($this->path, \json_encode($this->info, JSON_PRETTY_PRINT)); - } - - /** - * Set data - * - * @param string $path Value path - * @param mixed $data Scalar or array of data to set - * @param string $delim Delimiter of path - * - * @return void - * - * @since 1.0.0 - */ - public function set(string $path, $data, string $delim = '/') : void - { - if (!\is_scalar($data) && !\is_array($data) && !($data instanceof \JsonSerializable)) { - throw new \InvalidArgumentException('Type of $data "' . \gettype($data) . '" is not supported.'); - } - - ArrayUtils::setArray($path, $this->info, $data, $delim, true); - } - - /** - * Get info data. - * - * @return array - * - * @since 1.0.0 - */ - public function get() : array - { - return $this->info; - } -} + + * @since 1.0.0 + */ + private $info = []; + + /** + * Object constructor. + * + * @param string $path Info file path + * + * @since 1.0.0 + */ + public function __construct(string $path = '') + { + $this->path = $path; + } + + /** + * Get id + * + * @return int + * + * @since 1.0.0 + */ + public function getId() : int + { + return $this->id; + } + + /** + * Get info path + * + * @return string + * + * @since 1.0.0 + */ + public function getPath() : string + { + return $this->path; + } + + /** + * Get info path + * + * @return string + * + * @since 1.0.0 + */ + public function getInterfacePath() : string + { + return $this->info['path']; + } + + /** + * Get info name + * + * @return string + * + * @since 1.0.0 + */ + public function getName() : string + { + return $this->info['name']; + } + + /** + * Provides import interface + * + * @return bool + * + * @since 1.0.0 + */ + public function hasImport() : bool + { + return $this->info['import']; + } + + /** + * Provides export interface + * + * @return bool + * + * @since 1.0.0 + */ + public function hasExport() : bool + { + return $this->info['export']; + } + + /** + * Load info data from path. + * + * @return void + * + * @throws PathException this exception is thrown in case the info file path doesn't exist + * + * @since 1.0.0 + */ + public function load() : void + { + if (!\file_exists($this->path)) { + throw new PathException($this->path); + } + + $content = \file_get_contents($this->path); + $this->info = \json_decode($content !== false ? $content : '[]', true); + } + + /** + * Update info file + * + * @return void + * + * @since 1.0.0 + */ + public function update() : void + { + if (!\file_exists($this->path)) { + throw new PathException($this->path); + } + + \file_put_contents($this->path, \json_encode($this->info, \JSON_PRETTY_PRINT)); + } + + /** + * Set data + * + * @param string $path Value path + * @param mixed $data Scalar or array of data to set + * @param string $delim Delimiter of path + * + * @return void + * + * @since 1.0.0 + */ + public function set(string $path, $data, string $delim = '/') : void + { + if (!\is_scalar($data) && !\is_array($data) && !($data instanceof \JsonSerializable)) { + throw new \InvalidArgumentException('Type of $data "' . \gettype($data) . '" is not supported.'); + } + + ArrayUtils::setArray($path, $this->info, $data, $delim, true); + } + + /** + * Get info data. + * + * @return array + * + * @since 1.0.0 + */ + public function get() : array + { + return $this->info; + } +} diff --git a/Models/InterfaceManagerMapper.php b/Models/InterfaceManagerMapper.php index 5d130fa..655bb96 100644 --- a/Models/InterfaceManagerMapper.php +++ b/Models/InterfaceManagerMapper.php @@ -1,61 +1,61 @@ -> - * @since 1.0.0 - */ - protected static $columns = [ - 'exchange_id' => ['name' => 'exchange_id', 'type' => 'int', 'internal' => 'id'], - 'exchange_title' => ['name' => 'exchange_title', 'type' => 'string', 'internal' => 'info/name'], - 'exchange_path' => ['name' => 'exchange_path', 'type' => 'string', 'internal' => 'info/path'], - 'exchange_version' => ['name' => 'exchange_version', 'type' => 'string', 'internal' => 'info/version'], - 'exchange_export' => ['name' => 'exchange_export', 'type' => 'bool', 'internal' => 'info/export'], - 'exchange_import' => ['name' => 'exchange_import', 'type' => 'bool', 'internal' => 'info/import'], - 'exchange_website' => ['name' => 'exchange_website', 'type' => 'string', 'internal' => 'info/website'], - ]; - - /** - * Primary table. - * - * @var string - * @since 1.0.0 - */ - protected static $table = 'exchange'; - - /** - * Primary field name. - * - * @var string - * @since 1.0.0 - */ - protected static $primaryField = 'exchange_id'; -} +> + * @since 1.0.0 + */ + protected static $columns = [ + 'exchange_id' => ['name' => 'exchange_id', 'type' => 'int', 'internal' => 'id'], + 'exchange_title' => ['name' => 'exchange_title', 'type' => 'string', 'internal' => 'info/name'], + 'exchange_path' => ['name' => 'exchange_path', 'type' => 'string', 'internal' => 'info/path'], + 'exchange_version' => ['name' => 'exchange_version', 'type' => 'string', 'internal' => 'info/version'], + 'exchange_export' => ['name' => 'exchange_export', 'type' => 'bool', 'internal' => 'info/export'], + 'exchange_import' => ['name' => 'exchange_import', 'type' => 'bool', 'internal' => 'info/import'], + 'exchange_website' => ['name' => 'exchange_website', 'type' => 'string', 'internal' => 'info/website'], + ]; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + protected static $table = 'exchange'; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + protected static $primaryField = 'exchange_id'; +} diff --git a/Models/PermissionState.php b/Models/PermissionState.php index 34e7d80..885acbe 100644 --- a/Models/PermissionState.php +++ b/Models/PermissionState.php @@ -1,32 +1,32 @@ -getData('nav')->render(); ?> +echo $this->getData('nav')->render(); diff --git a/Theme/Backend/exchange-export-list.tpl.php b/Theme/Backend/exchange-export-list.tpl.php index b7cc019..80afc3f 100644 --- a/Theme/Backend/exchange-export-list.tpl.php +++ b/Theme/Backend/exchange-export-list.tpl.php @@ -1,4 +1,4 @@ -getData('nav')->render(); ?> + */ +echo $this->getData('nav')->render(); diff --git a/Theme/Backend/exchange-import-list.tpl.php b/Theme/Backend/exchange-import-list.tpl.php index e1163bb..cc3aa77 100644 --- a/Theme/Backend/exchange-import-list.tpl.php +++ b/Theme/Backend/exchange-import-list.tpl.php @@ -1,4 +1,4 @@ -getData('lang'); - -/** +getData('lang'); + +/** * @var \phpOMS\Views\View $this - */ -echo $this->getData('nav')->render(); - -include __DIR__ . '/../../Interfaces/' . $this->getData('interface')->getInterfacePath() . '/import.tpl.php'; + */ +echo $this->getData('nav')->render(); + +include __DIR__ . '/../../Interfaces/' . $this->getData('interface')->getInterfacePath() . '/import.tpl.php';