From 99fbff1f7c1b76124cc63fbfc23327de375a67eb Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 20 Feb 2021 10:59:06 +0100 Subject: [PATCH] mode changes --- .gitignore | 0 Admin/Installer.php | 16 ++++++++++ Docs/Dev/en/structure.md | 0 Models/Contact.php | 0 Models/ContactMapper.php | 0 Models/ContactType.php | 0 Models/GenderType.php | 0 Models/NullContact.php | 0 Models/SexType.php | 0 Theme/Backend/Lang/de.lang.php | 0 Theme/Backend/Lang/en.lang.php | 0 Theme/Backend/profile-single.tpl.php | 46 +++++++++++++++++---------- tests/Autoloader.php | 0 tests/Bootstrap.php | 0 tests/Controller/icon.png | Bin tests/Models/NullProfileTest.php | 0 tests/phpunit_default.xml | 0 17 files changed, 46 insertions(+), 16 deletions(-) mode change 100644 => 100755 .gitignore create mode 100644 Docs/Dev/en/structure.md mode change 100644 => 100755 Models/Contact.php mode change 100644 => 100755 Models/ContactMapper.php mode change 100644 => 100755 Models/ContactType.php mode change 100644 => 100755 Models/GenderType.php mode change 100644 => 100755 Models/NullContact.php mode change 100644 => 100755 Models/SexType.php mode change 100644 => 100755 Theme/Backend/Lang/de.lang.php mode change 100644 => 100755 Theme/Backend/Lang/en.lang.php mode change 100644 => 100755 tests/Autoloader.php mode change 100644 => 100755 tests/Bootstrap.php mode change 100644 => 100755 tests/Controller/icon.png mode change 100644 => 100755 tests/Models/NullProfileTest.php mode change 100644 => 100755 tests/phpunit_default.xml diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Admin/Installer.php b/Admin/Installer.php index 8632568..cac5568 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -14,7 +14,13 @@ declare(strict_types=1); namespace Modules\Profile\Admin; +use Modules\Admin\Models\AccountMapper; +use Modules\Profile\Models\Profile; +use Modules\Profile\Models\ProfileMapper; +use phpOMS\Config\SettingsInterface; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\InstallerAbstract; +use phpOMS\Module\ModuleInfo; /** * Installer class. @@ -26,4 +32,14 @@ use phpOMS\Module\InstallerAbstract; */ final class Installer extends InstallerAbstract { + /** + * {@inheritdoc} + */ + public static function install(DatabasePool $dbPool, ModuleInfo $info, SettingsInterface $cfgHandler) : void + { + parent::install($dbPool, $info, $cfgHandler); + + $profile = new Profile(AccountMapper::get(1)); + ProfileMapper::create($profile); + } } diff --git a/Docs/Dev/en/structure.md b/Docs/Dev/en/structure.md new file mode 100644 index 0000000..e69de29 diff --git a/Models/Contact.php b/Models/Contact.php old mode 100644 new mode 100755 diff --git a/Models/ContactMapper.php b/Models/ContactMapper.php old mode 100644 new mode 100755 diff --git a/Models/ContactType.php b/Models/ContactType.php old mode 100644 new mode 100755 diff --git a/Models/GenderType.php b/Models/GenderType.php old mode 100644 new mode 100755 diff --git a/Models/NullContact.php b/Models/NullContact.php old mode 100644 new mode 100755 diff --git a/Models/SexType.php b/Models/SexType.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/profile-single.tpl.php b/Theme/Backend/profile-single.tpl.php index 6898d99..e885e94 100755 --- a/Theme/Backend/profile-single.tpl.php +++ b/Theme/Backend/profile-single.tpl.php @@ -13,9 +13,21 @@ declare(strict_types=1); use Modules\Media\Models\NullMedia; +use Modules\Profile\Models\ContactType; use phpOMS\Localization\ISO3166NameEnum; use phpOMS\Localization\ISO3166TwoEnum; use phpOMS\Uri\UriFactory; +use phpOMS\System\File\Local\Directory; +use phpOMS\Localization\TimeZoneEnumArray; +use phpOMS\Localization\ISO8601EnumArray; +use phpOMS\Localization\ISO639Enum; +use phpOMS\Localization\ISO4217Enum; +use phpOMS\Utils\Converter\WeightType; +use phpOMS\Utils\Converter\SpeedType; +use phpOMS\Utils\Converter\AreaType; +use phpOMS\Utils\Converter\LengthType; +use phpOMS\Utils\Converter\VolumeType; +use phpOMS\Utils\Converter\TemperatureType; /** @var \phpOMS\Views\View $this */ /** @var \Modules\Profile\Models\Profile $profile */ @@ -91,7 +103,7 @@ echo $this->getData('nav')->render(); ?> - No address specified + getHtml('NoAddressSpecified'); ?> getHtml('aType' . $location->getType()); ?> @@ -115,11 +127,13 @@ echo $this->getData('nav')->render(); ?> - No contact specified + getHtml('NoContactSpecified'); ?> getHtml('cType' . $contact->getType()); ?> - getContent(); ?> + getType() === ContactType::WEBSITE ? '' : ''; ?> + getContent(); ?> + getType() === ContactType::WEBSITE ? '' : ''; ?> getHtml('Registered'); ?> @@ -150,20 +164,20 @@ echo $this->getData('nav')->render(); request->header->account === $account->getId()) : - $countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants(); - $countries = \phpOMS\Localization\ISO3166NameEnum::getConstants(); - $timezones = \phpOMS\Localization\TimeZoneEnumArray::getConstants(); - $timeformats = \phpOMS\Localization\ISO8601EnumArray::getConstants(); - $languages = \phpOMS\Localization\ISO639Enum::getConstants(); - $currencies = \phpOMS\Localization\ISO4217Enum::getConstants(); - $l11nDefinitions = \phpOMS\System\File\Local\Directory::list(__DIR__ . '/../../../../phpOMS/Localization/Defaults/Definitions'); + $countryCodes = ISO3166TwoEnum::getConstants(); + $countries = ISO3166NameEnum::getConstants(); + $timezones = TimeZoneEnumArray::getConstants(); + $timeformats = ISO8601EnumArray::getConstants(); + $languages = ISO639Enum::getConstants(); + $currencies = ISO4217Enum::getConstants(); + $l11nDefinitions = Directory::list(__DIR__ . '/../../../../phpOMS/Localization/Defaults/Definitions'); - $weights = \phpOMS\Utils\Converter\WeightType::getConstants(); - $speeds = \phpOMS\Utils\Converter\SpeedType::getConstants(); - $areas = \phpOMS\Utils\Converter\AreaType::getConstants(); - $lengths = \phpOMS\Utils\Converter\LengthType::getConstants(); - $volumes = \phpOMS\Utils\Converter\VolumeType::getConstants(); - $temperatures = \phpOMS\Utils\Converter\TemperatureType::getConstants(); + $weights = WeightType::getConstants(); + $speeds = SpeedType::getConstants(); + $areas = AreaType::getConstants(); + $lengths = LengthType::getConstants(); + $volumes = VolumeType::getConstants(); + $temperatures = TemperatureType::getConstants(); ?> request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
diff --git a/tests/Autoloader.php b/tests/Autoloader.php old mode 100644 new mode 100755 diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php old mode 100644 new mode 100755 diff --git a/tests/Controller/icon.png b/tests/Controller/icon.png old mode 100644 new mode 100755 diff --git a/tests/Models/NullProfileTest.php b/tests/Models/NullProfileTest.php old mode 100644 new mode 100755 diff --git a/tests/phpunit_default.xml b/tests/phpunit_default.xml old mode 100644 new mode 100755