From 1675e6f827c916ce09eed5dd7c8c19b167062ac3 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 2 Oct 2016 12:07:05 +0200 Subject: [PATCH 01/13] Core adjustments for pending issues --- Admin/Installer.php | 1 + Admin/Routes/Web/Api.php | 62 ++++++++++++++++++++++++++++++++++++ Admin/Routes/Web/Backend.php | 56 -------------------------------- Controller.php | 25 +++++++++++++-- Models/GroupMapper.php | 1 + 5 files changed, 86 insertions(+), 59 deletions(-) create mode 100644 Admin/Routes/Web/Api.php diff --git a/Admin/Installer.php b/Admin/Installer.php index d6c6385..ed17332 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -50,6 +50,7 @@ class Installer extends InstallerAbstract 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'group` ( `group_id` int(11) NOT NULL AUTO_INCREMENT, `group_name` varchar(50) NOT NULL, + `group_status` int(11) NOT NULL, `group_desc` varchar(100) DEFAULT NULL, `group_created` datetime DEFAULT NULL, PRIMARY KEY (`group_id`) diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php new file mode 100644 index 0000000..f14f21f --- /dev/null +++ b/Admin/Routes/Web/Api.php @@ -0,0 +1,62 @@ + [ + [ + 'dest' => '\Modules\Admin\Controller:apiSettingsSet', + 'verb' => RouteVerb::SET, + ], + [ + 'dest' => '\Modules\Admin\Controller:apiSettingsGet', + 'verb' => RouteVerb::GET, + ], + ], + + '^.*/api/admin/group.*$' => [ + [ + 'dest' => '\Modules\Admin\Controller:apiGroupCreate', + 'verb' => RouteVerb::PUT, + ], + [ + 'dest' => '\Modules\Admin\Controller:apiGroupUpdate', + 'verb' => RouteVerb::SET, + ], + [ + 'dest' => '\Modules\Admin\Controller:apiGroupDelete', + 'verb' => RouteVerb::DELETE, + ], + [ + 'dest' => '\Modules\Admin\Controller:apiGroupGet', + 'verb' => RouteVerb::GET, + ], + ], + + '^.*/api/admin/account.*$' => [ + [ + 'dest' => '\Modules\Admin\Controller:apiAccountCreate', + 'verb' => RouteVerb::PUT, + ], + [ + 'dest' => '\Modules\Admin\Controller:apiAccountUpdate', + 'verb' => RouteVerb::SET, + ], + [ + 'dest' => '\Modules\Admin\Controller:apiAccountDelete', + 'verb' => RouteVerb::DELETE, + ], + [ + 'dest' => '\Modules\Admin\Controller:apiAccountGet', + 'verb' => RouteVerb::GET, + ], + ], + + '^.*/api/admin/module/status.*$' => [ + [ + 'dest' => '\Modules\Admin\Controller:apiModuleStatusUpdate', + 'verb' => RouteVerb::SET, + ], + ], +]; diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 89aacc5..cb99b59 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -57,60 +57,4 @@ return [ 'verb' => RouteVerb::GET, ], ], - - '^.*/api/admin/settings.*$' => [ - [ - 'dest' => '\Modules\Admin\Controller:apiSettingsSet', - 'verb' => RouteVerb::SET, - ], - [ - 'dest' => '\Modules\Admin\Controller:apiSettingsGet', - 'verb' => RouteVerb::GET, - ], - ], - - '^.*/api/admin/group.*$' => [ - [ - 'dest' => '\Modules\Admin\Controller:apiGroupCreate', - 'verb' => RouteVerb::PUT, - ], - [ - 'dest' => '\Modules\Admin\Controller:apiGroupUpdate', - 'verb' => RouteVerb::SET, - ], - [ - 'dest' => '\Modules\Admin\Controller:apiGroupDelete', - 'verb' => RouteVerb::DELETE, - ], - [ - 'dest' => '\Modules\Admin\Controller:apiGroupGet', - 'verb' => RouteVerb::GET, - ], - ], - - '^.*/api/admin/account.*$' => [ - [ - 'dest' => '\Modules\Admin\Controller:apiAccountCreate', - 'verb' => RouteVerb::PUT, - ], - [ - 'dest' => '\Modules\Admin\Controller:apiAccountUpdate', - 'verb' => RouteVerb::SET, - ], - [ - 'dest' => '\Modules\Admin\Controller:apiAccountDelete', - 'verb' => RouteVerb::DELETE, - ], - [ - 'dest' => '\Modules\Admin\Controller:apiAccountGet', - 'verb' => RouteVerb::GET, - ], - ], - - '^.*/api/admin/module/status.*$' => [ - [ - 'dest' => '\Modules\Admin\Controller:apiModuleStatusUpdate', - 'verb' => RouteVerb::SET, - ], - ], ]; diff --git a/Controller.php b/Controller.php index 87d0c82..a31f8ce 100644 --- a/Controller.php +++ b/Controller.php @@ -15,10 +15,12 @@ */ namespace Modules\Admin; +use Model\Message\FormValidation; use Modules\Admin\Models\Account; use Modules\Admin\Models\AccountMapper; -use Modules\Admin\Models\GroupMapper; use Modules\Admin\Models\Group; +use Modules\Admin\Models\GroupMapper; +use phpOMS\Account\GroupStatus; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; use phpOMS\Module\ModuleAbstract; @@ -298,8 +300,25 @@ class Controller extends ModuleAbstract implements WebInterface public function apiGroupCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) { + $val = []; + if ( + $val['name'] = empty($request->getData('name')) + || $val['parent'] = ( + $request->getData('parent') !== null + && !is_numeric($request->getData('parent')) + ) + || $val['status'] = ( + $request->getData('status') === null + || !GroupStatus::isValidValue((int) $request->getData('status')) + ) + ) { + $response->set('group_create_validation', new FormValidation($val)); + + return; + } $group = new Group(); $group->setName($request->getData('name')); + $group->setName((int) $request->getData('status')); $group->setDescription($request->getData('desc')); GroupMapper::create($group); @@ -365,11 +384,11 @@ class Controller extends ModuleAbstract implements WebInterface $module = $request->getData('module'); $status = $request->getData('status'); - if(!$module || !$status) { + if (!$module || !$status) { // todo: create failure response } - switch($status) { + switch ($status) { case 'activate': $done = $this->app->moduleManager->activate($module); break; diff --git a/Models/GroupMapper.php b/Models/GroupMapper.php index 1f0a505..8f275a2 100644 --- a/Models/GroupMapper.php +++ b/Models/GroupMapper.php @@ -30,6 +30,7 @@ class GroupMapper extends DataMapperAbstract protected static $columns = [ 'group_id' => ['name' => 'group_id', 'type' => 'int', 'internal' => 'id'], 'group_name' => ['name' => 'group_name', 'type' => 'string', 'internal' => 'name'], + 'group_status' => ['name' => 'group_status', 'type' => 'int', 'internal' => 'status'], 'group_desc' => ['name' => 'group_desc', 'type' => 'string', 'internal' => 'description'], 'group_created' => ['name' => 'group_created', 'type' => 'DateTime', 'internal' => 'createdAt'], ]; From 240d7ff853c1ec69a600c53422cd72039870db64 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 9 Oct 2016 20:07:30 +0200 Subject: [PATCH 02/13] Fix install --- Admin/Install/Navigation.php | 2 +- Admin/Installer.php | 4 ++-- Controller.php | 10 +++++----- Theme/Backend/settings-general.tpl.php | 6 +++--- Theme/backend/settings-general.tpl.php | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 52b8cfe..a3b2d55 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -29,7 +29,7 @@ use phpOMS\DataStorage\Database\Pool; */ class Navigation { - public static function install(Pool $dbPool) + public static function install(string $path, Pool $dbPool) { $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); diff --git a/Admin/Installer.php b/Admin/Installer.php index ed17332..344c200 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -37,9 +37,9 @@ class Installer extends InstallerAbstract /** * {@inheritdoc} */ - public static function install(Pool $dbPool, InfoManager $info) + public static function install(string $path, Pool $dbPool, InfoManager $info) { - parent::install($dbPool, $info); + parent::install($path, $dbPool, $info); switch ($dbPool->get('core')->getType()) { case DatabaseType::MYSQL: diff --git a/Controller.php b/Controller.php index a31f8ce..2e84286 100644 --- a/Controller.php +++ b/Controller.php @@ -302,15 +302,15 @@ class Controller extends ModuleAbstract implements WebInterface { $val = []; if ( - $val['name'] = empty($request->getData('name')) - || $val['parent'] = ( + ($val['name'] = empty($request->getData('name'))) + || ($val['parent'] = ( $request->getData('parent') !== null && !is_numeric($request->getData('parent')) - ) - || $val['status'] = ( + )) + || ($val['status'] = ( $request->getData('status') === null || !GroupStatus::isValidValue((int) $request->getData('status')) - ) + )) ) { $response->set('group_create_validation', new FormValidation($val)); diff --git a/Theme/Backend/settings-general.tpl.php b/Theme/Backend/settings-general.tpl.php index 2db817a..e58109e 100644 --- a/Theme/Backend/settings-general.tpl.php +++ b/Theme/Backend/settings-general.tpl.php @@ -27,11 +27,11 @@ $_thousands_sep = $this->getData('thousands_sep') ?? ''; $_password = $this->getData('password') ?? ''; $_country = $this->getData('country') ?? ''; -$countries = \phpOMS\Localization\ISO3166EnumArray::getConstants(); +$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants(); $timezones = \phpOMS\Localization\TimeZoneEnumArray::getConstants(); $timeformats = \phpOMS\Localization\ISO8601EnumArray::getConstants(); -$languages = \phpOMS\Localization\ISO639EnumArray::getConstants(); -$currencies = \phpOMS\Localization\ISO4217EnumArray::getConstants(); +$languages = \phpOMS\Localization\ISO639Enum::getConstants(); +$currencies = \phpOMS\Localization\ISO4217Enum::getConstants(); ?>
diff --git a/Theme/backend/settings-general.tpl.php b/Theme/backend/settings-general.tpl.php index 2db817a..e58109e 100644 --- a/Theme/backend/settings-general.tpl.php +++ b/Theme/backend/settings-general.tpl.php @@ -27,11 +27,11 @@ $_thousands_sep = $this->getData('thousands_sep') ?? ''; $_password = $this->getData('password') ?? ''; $_country = $this->getData('country') ?? ''; -$countries = \phpOMS\Localization\ISO3166EnumArray::getConstants(); +$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants(); $timezones = \phpOMS\Localization\TimeZoneEnumArray::getConstants(); $timeformats = \phpOMS\Localization\ISO8601EnumArray::getConstants(); -$languages = \phpOMS\Localization\ISO639EnumArray::getConstants(); -$currencies = \phpOMS\Localization\ISO4217EnumArray::getConstants(); +$languages = \phpOMS\Localization\ISO639Enum::getConstants(); +$currencies = \phpOMS\Localization\ISO4217Enum::getConstants(); ?>
From e2f81eb07a9eba66a6709906fed4bdf3f15ea35c Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 17 Oct 2016 22:00:09 +0200 Subject: [PATCH 03/13] Localization fix --- Theme/backend/modules-single.tpl.php | 2 +- Theme/backend/settings-general.tpl.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Theme/backend/modules-single.tpl.php b/Theme/backend/modules-single.tpl.php index 6b84b9e..6f55395 100644 --- a/Theme/backend/modules-single.tpl.php +++ b/Theme/backend/modules-single.tpl.php @@ -55,7 +55,7 @@ $id = $this->request->getData('id') ?? 1; - + diff --git a/Theme/backend/settings-general.tpl.php b/Theme/backend/settings-general.tpl.php index e58109e..e2c5d77 100644 --- a/Theme/backend/settings-general.tpl.php +++ b/Theme/backend/settings-general.tpl.php @@ -44,7 +44,7 @@ $currencies = \phpOMS\Localization\ISO4217Enum::getConstants(); - + @@ -91,7 +91,7 @@ $currencies = \phpOMS\Localization\ISO4217Enum::getConstants(); - + From ecc7ec63dad7b27b59dbee9b88b730cba02a8139 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 17 Oct 2016 22:00:24 +0200 Subject: [PATCH 04/13] Path fix --- Theme/Backend/modules-single.tpl.php | 2 +- Theme/Backend/settings-general.tpl.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Theme/Backend/modules-single.tpl.php b/Theme/Backend/modules-single.tpl.php index 6b84b9e..6f55395 100644 --- a/Theme/Backend/modules-single.tpl.php +++ b/Theme/Backend/modules-single.tpl.php @@ -55,7 +55,7 @@ $id = $this->request->getData('id') ?? 1; - + diff --git a/Theme/Backend/settings-general.tpl.php b/Theme/Backend/settings-general.tpl.php index e58109e..e2c5d77 100644 --- a/Theme/Backend/settings-general.tpl.php +++ b/Theme/Backend/settings-general.tpl.php @@ -44,7 +44,7 @@ $currencies = \phpOMS\Localization\ISO4217Enum::getConstants(); - + @@ -91,7 +91,7 @@ $currencies = \phpOMS\Localization\ISO4217Enum::getConstants(); - + From 3c4fe4836c9e9e3ede2e402efa16bf1694405a99 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 29 Oct 2016 20:44:52 +0200 Subject: [PATCH 05/13] Adjust database pool name --- Admin/Activate.php | 4 ++-- Admin/Deactivate.php | 4 ++-- Admin/Install/Navigation.php | 4 ++-- Admin/Installer.php | 4 ++-- Admin/Uninstall.php | 4 ++-- Admin/Update.php | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Admin/Activate.php b/Admin/Activate.php index 9fe1d25..d8a1caa 100644 --- a/Admin/Activate.php +++ b/Admin/Activate.php @@ -16,7 +16,7 @@ namespace Modules\Admin\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\ActivateAbstract; use phpOMS\Module\InfoManager; @@ -37,7 +37,7 @@ class Activate extends ActivateAbstract /** * {@inheritdoc} */ - public static function activate(Pool $dbPool, InfoManager $info) + public static function activate(DatabasePool $dbPool, InfoManager $info) { parent::activate($dbPool, $info); } diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php index 4055e7a..77b5c2c 100644 --- a/Admin/Deactivate.php +++ b/Admin/Deactivate.php @@ -16,7 +16,7 @@ namespace Modules\Admin\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\DeactivateAbstract; use phpOMS\Module\InfoManager; @@ -37,7 +37,7 @@ class Deactivate extends DeactivateAbstract /** * {@inheritdoc} */ - public static function deactivate(Pool $dbPool, InfoManager $info) + public static function deactivate(DatabasePool $dbPool, InfoManager $info) { parent::deactivate($dbPool, $info); } diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index a3b2d55..7202824 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -14,7 +14,7 @@ * @link http://orange-management.com */ namespace Modules\Admin\Admin\Install; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; /** * Navigation class. @@ -29,7 +29,7 @@ use phpOMS\DataStorage\Database\Pool; */ class Navigation { - public static function install(string $path, Pool $dbPool) + public static function install(string $path, DatabasePool $dbPool) { $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); diff --git a/Admin/Installer.php b/Admin/Installer.php index 344c200..0620cd3 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -16,7 +16,7 @@ namespace Modules\Admin\Admin; use phpOMS\DataStorage\Database\DatabaseType; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\InfoManager; use phpOMS\Module\InstallerAbstract; @@ -37,7 +37,7 @@ class Installer extends InstallerAbstract /** * {@inheritdoc} */ - public static function install(string $path, Pool $dbPool, InfoManager $info) + public static function install(string $path, DatabasePool $dbPool, InfoManager $info) { parent::install($path, $dbPool, $info); diff --git a/Admin/Uninstall.php b/Admin/Uninstall.php index 1c33497..2a37054 100644 --- a/Admin/Uninstall.php +++ b/Admin/Uninstall.php @@ -16,7 +16,7 @@ namespace Modules\Admin\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\UninstallAbstract; /** @@ -36,7 +36,7 @@ class Uninstall extends UninstallAbstract /** * {@inheritdoc} */ - public static function uninstall(Pool $dbPool, InfoManager $info) + public static function uninstall(DatabasePool $dbPool, InfoManager $info) { parent::uninstall($dbPool, $info); } diff --git a/Admin/Update.php b/Admin/Update.php index 5f81b1f..4ba0a21 100644 --- a/Admin/Update.php +++ b/Admin/Update.php @@ -16,7 +16,7 @@ namespace Modules\Admin\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\UpdateAbstract; use phpOMS\System\File\Directory; @@ -37,7 +37,7 @@ class Update extends UpdateAbstract /** * {@inheritdoc} */ - public static function update(Pool $dbPool, array $info) + public static function update(DatabasePool $dbPool, array $info) { Directory::deletePath(__DIR__ . '/Update'); mkdir('Update'); From cdf1679633e896d4374fca2f1850dc7d112aecb3 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 6 Nov 2016 14:41:44 +0100 Subject: [PATCH 06/13] Implementd group create --- Controller.php | 34 +++++++++++++++++------------ Theme/Backend/groups-create.tpl.php | 6 ++++- Theme/backend/groups-create.tpl.php | 6 ++++- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/Controller.php b/Controller.php index 2e84286..115ebf5 100644 --- a/Controller.php +++ b/Controller.php @@ -298,28 +298,34 @@ class Controller extends ModuleAbstract implements WebInterface $response->set('group', GroupMapper::getByRequest($request)); } - public function apiGroupCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) + private function validateGroupCreate(RequestAbstract $request) : array { $val = []; if ( - ($val['name'] = empty($request->getData('name'))) - || ($val['parent'] = ( - $request->getData('parent') !== null - && !is_numeric($request->getData('parent')) - )) - || ($val['status'] = ( - $request->getData('status') === null - || !GroupStatus::isValidValue((int) $request->getData('status')) - )) + ($val['name'] = empty($request->getData('name'))) + || ($val['status'] = ( + $request->getData('status') === null + || !GroupStatus::isValidValue((int) $request->getData('status')) + )) ) { - $response->set('group_create_validation', new FormValidation($val)); + return $val; + } + + return []; + } + + public function apiGroupCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) + { + if (!empty($val = $this->validateGroupCreate($request))) { + $response->set('group_create', new FormValidation($val)); return; } + $group = new Group(); - $group->setName($request->getData('name')); - $group->setName((int) $request->getData('status')); - $group->setDescription($request->getData('desc')); + $group->setName($request->getData('name') ?? ''); + $group->setStatus((int) $request->getData('status')); + $group->setDescription($request->getData('description') ?? ''); GroupMapper::create($group); diff --git a/Theme/Backend/groups-create.tpl.php b/Theme/Backend/groups-create.tpl.php index d1374e1..bf5c6a6 100644 --- a/Theme/Backend/groups-create.tpl.php +++ b/Theme/Backend/groups-create.tpl.php @@ -25,8 +25,12 @@ echo $this->getData('nav')->render(); ?>
+
+
-
+
diff --git a/Theme/backend/groups-create.tpl.php b/Theme/backend/groups-create.tpl.php index d1374e1..bf5c6a6 100644 --- a/Theme/backend/groups-create.tpl.php +++ b/Theme/backend/groups-create.tpl.php @@ -25,8 +25,12 @@ echo $this->getData('nav')->render(); ?> +
+
-
+
From 52f10e736cd7d0df22584cac9e3caaa6288676c1 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 6 Nov 2016 22:22:07 +0100 Subject: [PATCH 07/13] Fixing doc blocks --- Models/AccountMapper.php | 2 +- Models/GroupMapper.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Models/AccountMapper.php b/Models/AccountMapper.php index fc0e500..243c8b9 100644 --- a/Models/AccountMapper.php +++ b/Models/AccountMapper.php @@ -23,7 +23,7 @@ class AccountMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array * @since 1.0.0 */ protected static $columns = [ diff --git a/Models/GroupMapper.php b/Models/GroupMapper.php index 8f275a2..4801541 100644 --- a/Models/GroupMapper.php +++ b/Models/GroupMapper.php @@ -24,7 +24,7 @@ class GroupMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array * @since 1.0.0 */ protected static $columns = [ From 43cd7cbaf709aa66f6087e673d435fcd1d222c8a Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 13 Nov 2016 23:14:43 +0100 Subject: [PATCH 08/13] Localization tpl draft --- Theme/Backend/Lang/en.lang.php | 28 +++ Theme/backend/Lang/en.lang.php | 28 +++ Theme/backend/settings-general.tpl.php | 295 ++++++++++++++++++++----- 3 files changed, 290 insertions(+), 61 deletions(-) diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 64e1f73..f8363cc 100644 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -21,6 +21,7 @@ return ['Admin' => [ 'Activity' => 'Activity', 'Available' => 'Available', 'All' => 'All', + 'Area' => 'Area', 'Banned' => 'Banned', 'Cache' => 'Cache', 'Children' => 'Children', @@ -34,19 +35,28 @@ return ['Admin' => [ 'Deactivate' => 'Deactivate', 'Email' => 'Email', 'EmailAdmin' => 'Email Admin', + 'Fast' => 'Fast', 'Features' => 'Features', 'File' => 'File', + 'General' => 'General', + 'Glass' => 'Glass', 'Group' => 'Group', 'Groups' => 'Groups', + 'Heavy' => 'Heavy', 'Inactive' => 'Inactive', 'Install' => 'Install', 'Installed' => 'Installed', 'LAddress' => 'Local Address', 'Language' => 'Language', + 'Large' => 'Large', + 'Length' => 'Length', + 'Light' => 'Light', 'Localization' => 'Localization', + 'Long' => 'Long', 'Loginname' => 'Login Name', 'Lowercase' => 'Lowercase', 'Maintenance' => 'Maintenance', + 'Medium' => 'Medium', 'Member' => 'Member', 'Members' => 'Members', 'Memcache' => 'Memcache', @@ -74,13 +84,21 @@ return ['Admin' => [ 'RAddress' => 'Remote Address', 'ReCache' => 'Re-Cache', 'Running' => 'Running', + 'Short' => 'Short', + 'Sea' => 'Sea', 'Settings' => 'Settings', 'SettingsGeneral' => 'Settings - General', 'Single' => 'Single', + 'Slow' => 'Slow', + 'Small' => 'Small', + 'Speed' => 'Speed', 'Specialchar' => 'Special character', 'Status' => 'Status', 'Total' => 'Total', 'Release' => 'Release', + 'Tablespoon' => 'Tablespoon', + 'Teaspoon' => 'Teaspoon', + 'Temperature' => 'Temperature', 'Theme' => 'Theme', 'ThousandsSeparator' => 'Thousands Separator', 'Time' => 'Time', @@ -93,8 +111,18 @@ return ['Admin' => [ 'Uppercase' => 'Uppercase', 'Username' => 'Username', 'Version' => 'Version', + 'VeryFast' => 'Very Fast', + 'VeryHeavy' => 'Very Heavy', + 'VeryLarge' => 'Very Large', + 'VeryLight' => 'Very Light', + 'VeryLong' => 'Very Long', + 'VerySlow' => 'Very Slow', + 'VeryShort' => 'Very Short', + 'VerySmall' => 'Very Small', + 'Volume' => 'Volume', 'Warnings' => 'Warnings', 'Website' => 'Website', + 'Weight' => 'Weight', 'i:loc' => 'IP address or URL for remote access.', 'i:mail' => 'Email address.', 'i:oname' => 'Organization name.', diff --git a/Theme/backend/Lang/en.lang.php b/Theme/backend/Lang/en.lang.php index 64e1f73..f8363cc 100644 --- a/Theme/backend/Lang/en.lang.php +++ b/Theme/backend/Lang/en.lang.php @@ -21,6 +21,7 @@ return ['Admin' => [ 'Activity' => 'Activity', 'Available' => 'Available', 'All' => 'All', + 'Area' => 'Area', 'Banned' => 'Banned', 'Cache' => 'Cache', 'Children' => 'Children', @@ -34,19 +35,28 @@ return ['Admin' => [ 'Deactivate' => 'Deactivate', 'Email' => 'Email', 'EmailAdmin' => 'Email Admin', + 'Fast' => 'Fast', 'Features' => 'Features', 'File' => 'File', + 'General' => 'General', + 'Glass' => 'Glass', 'Group' => 'Group', 'Groups' => 'Groups', + 'Heavy' => 'Heavy', 'Inactive' => 'Inactive', 'Install' => 'Install', 'Installed' => 'Installed', 'LAddress' => 'Local Address', 'Language' => 'Language', + 'Large' => 'Large', + 'Length' => 'Length', + 'Light' => 'Light', 'Localization' => 'Localization', + 'Long' => 'Long', 'Loginname' => 'Login Name', 'Lowercase' => 'Lowercase', 'Maintenance' => 'Maintenance', + 'Medium' => 'Medium', 'Member' => 'Member', 'Members' => 'Members', 'Memcache' => 'Memcache', @@ -74,13 +84,21 @@ return ['Admin' => [ 'RAddress' => 'Remote Address', 'ReCache' => 'Re-Cache', 'Running' => 'Running', + 'Short' => 'Short', + 'Sea' => 'Sea', 'Settings' => 'Settings', 'SettingsGeneral' => 'Settings - General', 'Single' => 'Single', + 'Slow' => 'Slow', + 'Small' => 'Small', + 'Speed' => 'Speed', 'Specialchar' => 'Special character', 'Status' => 'Status', 'Total' => 'Total', 'Release' => 'Release', + 'Tablespoon' => 'Tablespoon', + 'Teaspoon' => 'Teaspoon', + 'Temperature' => 'Temperature', 'Theme' => 'Theme', 'ThousandsSeparator' => 'Thousands Separator', 'Time' => 'Time', @@ -93,8 +111,18 @@ return ['Admin' => [ 'Uppercase' => 'Uppercase', 'Username' => 'Username', 'Version' => 'Version', + 'VeryFast' => 'Very Fast', + 'VeryHeavy' => 'Very Heavy', + 'VeryLarge' => 'Very Large', + 'VeryLight' => 'Very Light', + 'VeryLong' => 'Very Long', + 'VerySlow' => 'Very Slow', + 'VeryShort' => 'Very Short', + 'VerySmall' => 'Very Small', + 'Volume' => 'Volume', 'Warnings' => 'Warnings', 'Website' => 'Website', + 'Weight' => 'Weight', 'i:loc' => 'IP address or URL for remote access.', 'i:mail' => 'Email address.', 'i:oname' => 'Organization name.', diff --git a/Theme/backend/settings-general.tpl.php b/Theme/backend/settings-general.tpl.php index e2c5d77..260d1ab 100644 --- a/Theme/backend/settings-general.tpl.php +++ b/Theme/backend/settings-general.tpl.php @@ -32,67 +32,240 @@ $timezones = \phpOMS\Localization\TimeZoneEnumArray::getConstants(); $timeformats = \phpOMS\Localization\ISO8601EnumArray::getConstants(); $languages = \phpOMS\Localization\ISO639Enum::getConstants(); $currencies = \phpOMS\Localization\ISO4217Enum::getConstants(); - ?> -
-

getText('Settings') ?>

-
- - - -
-
-
-
-
-
- -
-
-
-

getText('Localization') ?>

-
-
- - -
-
-
-
-
-
-
-
-
-
-

getText('Numberformat') ?>

-
- -
- -
-
-
+
+
+
-
+
+ +
+
+

getText('Settings') ?>

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

getText('Localization') ?>

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

getText('Numeric') ?>

+
+
+ +
+
+

getText('Numberformat') ?>

+
+ +
+ +
+
+
+
+ +
+

getText('Weight') ?>

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

getText('Speed') ?>

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

getText('Length') ?>

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

getText('Area') ?>

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

getText('Volume') ?>

+
+
+ + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ From 399f9fe315be63e119647539cec5b3d60dfac9d4 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 13 Nov 2016 23:14:55 +0100 Subject: [PATCH 09/13] Change path --- Theme/Backend/settings-general.tpl.php | 295 ++++++++++++++++++++----- 1 file changed, 234 insertions(+), 61 deletions(-) diff --git a/Theme/Backend/settings-general.tpl.php b/Theme/Backend/settings-general.tpl.php index e2c5d77..260d1ab 100644 --- a/Theme/Backend/settings-general.tpl.php +++ b/Theme/Backend/settings-general.tpl.php @@ -32,67 +32,240 @@ $timezones = \phpOMS\Localization\TimeZoneEnumArray::getConstants(); $timeformats = \phpOMS\Localization\ISO8601EnumArray::getConstants(); $languages = \phpOMS\Localization\ISO639Enum::getConstants(); $currencies = \phpOMS\Localization\ISO4217Enum::getConstants(); - ?> -
-

getText('Settings') ?>

-
-
- - -
-
-
-
-
-
-
-
-
-
-

getText('Localization') ?>

-
-
- - -
-
-
-
-
-
-
-
-
-
-

getText('Numberformat') ?>

-
- -
- -
-
-
+
+
+
-
+
+ +
+
+

getText('Settings') ?>

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

getText('Localization') ?>

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

getText('Numeric') ?>

+
+
+ +
+
+

getText('Numberformat') ?>

+
+ +
+ +
+
+
+
+ +
+

getText('Weight') ?>

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

getText('Speed') ?>

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

getText('Length') ?>

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

getText('Area') ?>

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

getText('Volume') ?>

+
+
+ + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ From 4fb6dca657716ecd55d3eea22e16f023c2861359 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 7 Dec 2016 20:23:04 +0100 Subject: [PATCH 10/13] Prepare const visibility --- Controller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Controller.php b/Controller.php index 115ebf5..0478b68 100644 --- a/Controller.php +++ b/Controller.php @@ -48,7 +48,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_PATH = __DIR__; + /* public */ const MODULE_PATH = __DIR__; /** * Module version. @@ -56,7 +56,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_VERSION = '1.0.0'; + /* public */ const MODULE_VERSION = '1.0.0'; /** * Module name. @@ -64,7 +64,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_NAME = 'Admin'; + /* public */ const MODULE_NAME = 'Admin'; /** * Providing. From 3ccfaf607aef0b4d221cfc47e676a9e11354faa6 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 7 Dec 2016 20:56:15 +0100 Subject: [PATCH 11/13] Increase php version requirement --- Admin/Activate.php | 2 +- Admin/Deactivate.php | 2 +- Admin/Install/Navigation.php | 2 +- Admin/Installer.php | 2 +- Admin/Uninstall.php | 2 +- Admin/Update.php | 2 +- Controller.php | 2 +- Models/Account.php | 2 +- Models/AccountMapper.php | 2 +- Models/Group.php | 2 +- Models/GroupMapper.php | 2 +- Models/NullAccount.php | 2 +- Models/NullGroup.php | 2 +- Theme/Backend/Lang/Navigation.en.lang.php | 2 +- Theme/Backend/Lang/api.en.lang.php | 2 +- Theme/Backend/Lang/en.lang.php | 2 +- Theme/Backend/accounts-create.tpl.php | 2 +- Theme/Backend/accounts-list.tpl.php | 2 +- Theme/Backend/accounts-single.tpl.php | 2 +- Theme/Backend/groups-create.tpl.php | 2 +- Theme/Backend/groups-list.tpl.php | 2 +- Theme/Backend/groups-single.tpl.php | 2 +- Theme/Backend/modules-list.tpl.php | 2 +- Theme/Backend/modules-single.tpl.php | 2 +- Theme/Backend/settings-general.tpl.php | 2 +- Theme/backend/Lang/Navigation.en.lang.php | 2 +- Theme/backend/Lang/api.en.lang.php | 2 +- Theme/backend/Lang/en.lang.php | 2 +- Theme/backend/accounts-create.tpl.php | 2 +- Theme/backend/accounts-list.tpl.php | 2 +- Theme/backend/accounts-single.tpl.php | 2 +- Theme/backend/groups-create.tpl.php | 2 +- Theme/backend/groups-list.tpl.php | 2 +- Theme/backend/groups-single.tpl.php | 2 +- Theme/backend/modules-list.tpl.php | 2 +- Theme/backend/modules-single.tpl.php | 2 +- Theme/backend/settings-general.tpl.php | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Admin/Activate.php b/Admin/Activate.php index d8a1caa..7f01a76 100644 --- a/Admin/Activate.php +++ b/Admin/Activate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php index 77b5c2c..3ffe561 100644 --- a/Admin/Deactivate.php +++ b/Admin/Deactivate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 7202824..841596b 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Installer.php b/Admin/Installer.php index 0620cd3..70fc437 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Uninstall.php b/Admin/Uninstall.php index 2a37054..ef76dfb 100644 --- a/Admin/Uninstall.php +++ b/Admin/Uninstall.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Update.php b/Admin/Update.php index 4ba0a21..9ea0eb6 100644 --- a/Admin/Update.php +++ b/Admin/Update.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Controller.php b/Controller.php index 0478b68..a23c805 100644 --- a/Controller.php +++ b/Controller.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/Account.php b/Models/Account.php index 5deece2..76b5c3f 100644 --- a/Models/Account.php +++ b/Models/Account.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/AccountMapper.php b/Models/AccountMapper.php index 243c8b9..84c2050 100644 --- a/Models/AccountMapper.php +++ b/Models/AccountMapper.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/Group.php b/Models/Group.php index 7ed78d0..7edc037 100644 --- a/Models/Group.php +++ b/Models/Group.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/GroupMapper.php b/Models/GroupMapper.php index 4801541..d41eadd 100644 --- a/Models/GroupMapper.php +++ b/Models/GroupMapper.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/NullAccount.php b/Models/NullAccount.php index 53b4195..f473212 100644 --- a/Models/NullAccount.php +++ b/Models/NullAccount.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/NullGroup.php b/Models/NullGroup.php index 5ea4693..a2d3fe8 100644 --- a/Models/NullGroup.php +++ b/Models/NullGroup.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index b7821a0..20a764e 100644 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/Lang/api.en.lang.php b/Theme/Backend/Lang/api.en.lang.php index d53f90f..f8e29de 100644 --- a/Theme/Backend/Lang/api.en.lang.php +++ b/Theme/Backend/Lang/api.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index f8363cc..70e668b 100644 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/accounts-create.tpl.php b/Theme/Backend/accounts-create.tpl.php index 369e497..bfcdc2a 100644 --- a/Theme/Backend/accounts-create.tpl.php +++ b/Theme/Backend/accounts-create.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/accounts-list.tpl.php b/Theme/Backend/accounts-list.tpl.php index d9cf6f3..2c8a653 100644 --- a/Theme/Backend/accounts-list.tpl.php +++ b/Theme/Backend/accounts-list.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/accounts-single.tpl.php b/Theme/Backend/accounts-single.tpl.php index 4aa7661..f9acb48 100644 --- a/Theme/Backend/accounts-single.tpl.php +++ b/Theme/Backend/accounts-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/groups-create.tpl.php b/Theme/Backend/groups-create.tpl.php index bf5c6a6..3eb8eee 100644 --- a/Theme/Backend/groups-create.tpl.php +++ b/Theme/Backend/groups-create.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/groups-list.tpl.php b/Theme/Backend/groups-list.tpl.php index 9b7c170..537bf4a 100644 --- a/Theme/Backend/groups-list.tpl.php +++ b/Theme/Backend/groups-list.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/groups-single.tpl.php b/Theme/Backend/groups-single.tpl.php index 03ccbc9..c39de44 100644 --- a/Theme/Backend/groups-single.tpl.php +++ b/Theme/Backend/groups-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/modules-list.tpl.php b/Theme/Backend/modules-list.tpl.php index 33af2e5..7e2fad4 100644 --- a/Theme/Backend/modules-list.tpl.php +++ b/Theme/Backend/modules-list.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/modules-single.tpl.php b/Theme/Backend/modules-single.tpl.php index 6f55395..33c539b 100644 --- a/Theme/Backend/modules-single.tpl.php +++ b/Theme/Backend/modules-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/settings-general.tpl.php b/Theme/Backend/settings-general.tpl.php index 260d1ab..54fe6c0 100644 --- a/Theme/Backend/settings-general.tpl.php +++ b/Theme/Backend/settings-general.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/Lang/Navigation.en.lang.php b/Theme/backend/Lang/Navigation.en.lang.php index b7821a0..20a764e 100644 --- a/Theme/backend/Lang/Navigation.en.lang.php +++ b/Theme/backend/Lang/Navigation.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/Lang/api.en.lang.php b/Theme/backend/Lang/api.en.lang.php index d53f90f..f8e29de 100644 --- a/Theme/backend/Lang/api.en.lang.php +++ b/Theme/backend/Lang/api.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/Lang/en.lang.php b/Theme/backend/Lang/en.lang.php index f8363cc..70e668b 100644 --- a/Theme/backend/Lang/en.lang.php +++ b/Theme/backend/Lang/en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/accounts-create.tpl.php b/Theme/backend/accounts-create.tpl.php index 369e497..bfcdc2a 100644 --- a/Theme/backend/accounts-create.tpl.php +++ b/Theme/backend/accounts-create.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/accounts-list.tpl.php b/Theme/backend/accounts-list.tpl.php index d9cf6f3..2c8a653 100644 --- a/Theme/backend/accounts-list.tpl.php +++ b/Theme/backend/accounts-list.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/accounts-single.tpl.php b/Theme/backend/accounts-single.tpl.php index 4aa7661..f9acb48 100644 --- a/Theme/backend/accounts-single.tpl.php +++ b/Theme/backend/accounts-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/groups-create.tpl.php b/Theme/backend/groups-create.tpl.php index bf5c6a6..3eb8eee 100644 --- a/Theme/backend/groups-create.tpl.php +++ b/Theme/backend/groups-create.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/groups-list.tpl.php b/Theme/backend/groups-list.tpl.php index 9b7c170..537bf4a 100644 --- a/Theme/backend/groups-list.tpl.php +++ b/Theme/backend/groups-list.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/groups-single.tpl.php b/Theme/backend/groups-single.tpl.php index 03ccbc9..c39de44 100644 --- a/Theme/backend/groups-single.tpl.php +++ b/Theme/backend/groups-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/modules-list.tpl.php b/Theme/backend/modules-list.tpl.php index 33af2e5..7e2fad4 100644 --- a/Theme/backend/modules-list.tpl.php +++ b/Theme/backend/modules-list.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/modules-single.tpl.php b/Theme/backend/modules-single.tpl.php index 6f55395..33c539b 100644 --- a/Theme/backend/modules-single.tpl.php +++ b/Theme/backend/modules-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/settings-general.tpl.php b/Theme/backend/settings-general.tpl.php index 260d1ab..54fe6c0 100644 --- a/Theme/backend/settings-general.tpl.php +++ b/Theme/backend/settings-general.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD From 4c0fc1ec3803ffddfe9cbac0bdd1ff191f2a92d0 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 30 Dec 2016 19:59:24 +0100 Subject: [PATCH 12/13] Template, comment and path fixes --- Controller.php | 30 ++++++++++++++++- Models/AccountMapper.php | 46 +++++++++++++++++++++++++++ Theme/Backend/accounts-create.tpl.php | 14 ++++---- Theme/Backend/accounts-list.tpl.php | 2 +- Theme/backend/accounts-create.tpl.php | 14 ++++---- Theme/backend/accounts-list.tpl.php | 2 +- 6 files changed, 91 insertions(+), 17 deletions(-) diff --git a/Controller.php b/Controller.php index a23c805..734f0b4 100644 --- a/Controller.php +++ b/Controller.php @@ -17,6 +17,8 @@ namespace Modules\Admin; use Model\Message\FormValidation; use Modules\Admin\Models\Account; +use phpOMS\Account\AccountStatus; +use phpOMS\Account\AccountType; use Modules\Admin\Models\AccountMapper; use Modules\Admin\Models\Group; use Modules\Admin\Models\GroupMapper; @@ -356,11 +358,37 @@ class Controller extends ModuleAbstract implements WebInterface $response->set('account', AccountMapper::getByRequest($request)); } + private function validateAccountCreate(RequestAbstract $request) : array + { + $val = []; + if ( + ($val['name'] = empty($request->getData('name'))) + || ($val['name1'] = empty($request->getData('name1'))) + || ($val['type'] = !AccountType::isValidValue((int) $request->getData('type'))) + || ($val['status'] = !AccountStatus::isValidValue((int) $request->getData('status'))) + ) { + return $val; + } + + return []; + } + public function apiAccountCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) { + if (!empty($val = $this->validateAccountCreate($request))) { + $response->set('account_create', new FormValidation($val)); + + return; + } + $account = new Account(); + $account->setStatus($request->getData('status')); + $account->setType($request->getData('type')); $account->setName($request->getData('name')); - $account->setDescription($request->getData('desc')); + $account->setName1($request->getData('name1')); + $account->setName2($request->getData('name2')); + $account->setName3($request->getData('name3')); + $account->setEmail($request->getData('email')); AccountMapper::create($account); diff --git a/Models/AccountMapper.php b/Models/AccountMapper.php index 84c2050..1e87413 100644 --- a/Models/AccountMapper.php +++ b/Models/AccountMapper.php @@ -15,7 +15,10 @@ */ namespace Modules\Admin\Models; +use Modules\Media\Models\MediaMapper; use phpOMS\DataStorage\Database\DataMapperAbstract; +use phpOMS\DataStorage\Database\Query\Builder; +use phpOMS\DataStorage\Database\Query\Column; use phpOMS\DataStorage\Database\RelationType; class AccountMapper extends DataMapperAbstract @@ -66,6 +69,49 @@ class AccountMapper extends DataMapperAbstract */ protected static $createdAt = 'account_created_at'; + /** + * Create object. + * + * @param mixed $obj Object + * @param int $relations Behavior for relations creation + * + * @return mixed + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public static function create($obj, int $relations = RelationType::ALL) + { + try { + $objId = parent::create($obj, $relations); + $query = new Builder(self::$db); + + $query->prefix(self::$db->getPrefix()) + ->insert( + 'account_permission_account', + 'account_permission_from', + 'account_permission_for', + 'account_permission_id1', + 'account_permission_id2', + 'account_permission_r', + 'account_permission_w', + 'account_permission_m', + 'account_permission_d', + 'account_permission_p' + ) + ->into('account_permission') + ->values(1, 'account', 'account', 1, $objId, 1, 1, 1, 1, 1); + + self::$db->con->prepare($query->toSql())->execute(); + } catch (\Exception $e) { + var_dump($e->getMessage()); + + return false; + } + } + + + /** * Get object. * diff --git a/Theme/Backend/accounts-create.tpl.php b/Theme/Backend/accounts-create.tpl.php index bfcdc2a..f64650d 100644 --- a/Theme/Backend/accounts-create.tpl.php +++ b/Theme/Backend/accounts-create.tpl.php @@ -18,20 +18,20 @@ echo $this->getData('nav')->render(); ?>

getText('Account') ?>

-
+ -
diff --git a/Theme/Backend/accounts-list.tpl.php b/Theme/Backend/accounts-list.tpl.php index 2c8a653..f67bfb7 100644 --- a/Theme/Backend/accounts-list.tpl.php +++ b/Theme/Backend/accounts-list.tpl.php @@ -44,8 +44,8 @@ echo $this->getData('nav')->render(); getData('list:elements') as $key => $value) : $c++; $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/account/settings?id=' . $value->getId()); ?>
getStatus(); ?> getId(); ?> + getStatus(); ?> getName1(); ?> getLastActive()->format('Y-m-d H:i:s'); ?> getCreatedAt()->format('Y-m-d H:i:s'); ?> diff --git a/Theme/backend/accounts-create.tpl.php b/Theme/backend/accounts-create.tpl.php index bfcdc2a..f64650d 100644 --- a/Theme/backend/accounts-create.tpl.php +++ b/Theme/backend/accounts-create.tpl.php @@ -18,20 +18,20 @@ echo $this->getData('nav')->render(); ?>

getText('Account') ?>

- + -
diff --git a/Theme/backend/accounts-list.tpl.php b/Theme/backend/accounts-list.tpl.php index 2c8a653..f67bfb7 100644 --- a/Theme/backend/accounts-list.tpl.php +++ b/Theme/backend/accounts-list.tpl.php @@ -44,8 +44,8 @@ echo $this->getData('nav')->render(); getData('list:elements') as $key => $value) : $c++; $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/admin/account/settings?id=' . $value->getId()); ?>
getStatus(); ?> getId(); ?> + getStatus(); ?> getName1(); ?> getLastActive()->format('Y-m-d H:i:s'); ?> getCreatedAt()->format('Y-m-d H:i:s'); ?> From 8a7bb125863d8668a5da7d93034edf4f3b8d5f0f Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 22 Jan 2017 21:08:46 +0100 Subject: [PATCH 13/13] Fixing json serialization and reporter --- Controller.php | 1 + Models/AccountMapper.php | 4 ++-- Theme/Backend/accounts-create.tpl.php | 2 +- Theme/Backend/accounts-single.tpl.php | 6 +++--- Theme/backend/accounts-create.tpl.php | 2 +- Theme/backend/accounts-single.tpl.php | 6 +++--- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Controller.php b/Controller.php index 734f0b4..fe4f3f1 100644 --- a/Controller.php +++ b/Controller.php @@ -389,6 +389,7 @@ class Controller extends ModuleAbstract implements WebInterface $account->setName2($request->getData('name2')); $account->setName3($request->getData('name3')); $account->setEmail($request->getData('email')); + $account->generatePassword($request->getData('password')); AccountMapper::create($account); diff --git a/Models/AccountMapper.php b/Models/AccountMapper.php index 1e87413..35054d0 100644 --- a/Models/AccountMapper.php +++ b/Models/AccountMapper.php @@ -108,9 +108,9 @@ class AccountMapper extends DataMapperAbstract return false; } - } - + return $objId; + } /** * Get object. diff --git a/Theme/Backend/accounts-create.tpl.php b/Theme/Backend/accounts-create.tpl.php index f64650d..716d624 100644 --- a/Theme/Backend/accounts-create.tpl.php +++ b/Theme/Backend/accounts-create.tpl.php @@ -44,7 +44,7 @@ echo $this->getData('nav')->render(); ?>
-
+
diff --git a/Theme/Backend/accounts-single.tpl.php b/Theme/Backend/accounts-single.tpl.php index f9acb48..1f5fdc0 100644 --- a/Theme/Backend/accounts-single.tpl.php +++ b/Theme/Backend/accounts-single.tpl.php @@ -26,7 +26,7 @@ echo $this->getData('nav')->render(); ?>
-
+
-
+
@@ -52,7 +52,7 @@ echo $this->getData('nav')->render(); ?>
-
+
diff --git a/Theme/backend/accounts-create.tpl.php b/Theme/backend/accounts-create.tpl.php index f64650d..716d624 100644 --- a/Theme/backend/accounts-create.tpl.php +++ b/Theme/backend/accounts-create.tpl.php @@ -44,7 +44,7 @@ echo $this->getData('nav')->render(); ?>
-
+
diff --git a/Theme/backend/accounts-single.tpl.php b/Theme/backend/accounts-single.tpl.php index f9acb48..1f5fdc0 100644 --- a/Theme/backend/accounts-single.tpl.php +++ b/Theme/backend/accounts-single.tpl.php @@ -26,7 +26,7 @@ echo $this->getData('nav')->render(); ?>
-
+
-
+
@@ -52,7 +52,7 @@ echo $this->getData('nav')->render(); ?>
-
+