diff --git a/Admin/Install/db.json b/Admin/Install/db.json index ad9bbcf..f974112 100755 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -183,6 +183,11 @@ "type": "TINYINT(1)", "null": false }, + "address_attr_type_repeatable": { + "name": "address_attr_type_repeatable", + "type": "TINYINT(1)", + "null": false + }, "address_attr_type_required": { "description": "Every address must have this attribute type if set to true.", "name": "address_attr_type_required", @@ -861,6 +866,11 @@ "type": "TINYINT(1)", "null": false }, + "unit_attr_type_repeatable": { + "name": "unit_attr_type_repeatable", + "type": "TINYINT(1)", + "null": false + }, "unit_attr_type_required": { "description": "Every unit must have this attribute type if set to true.", "name": "unit_attr_type_required", @@ -1384,6 +1394,11 @@ "type": "TINYINT(1)", "null": false }, + "account_attr_type_repeatable": { + "name": "account_attr_type_repeatable", + "type": "TINYINT(1)", + "null": false + }, "account_attr_type_required": { "description": "Every account must have this attribute type if set to true.", "name": "account_attr_type_required", diff --git a/Admin/Settings/Theme/Backend/settings.tpl.php b/Admin/Settings/Theme/Backend/settings.tpl.php index 5a38bc2..7b8e1a2 100755 --- a/Admin/Settings/Theme/Backend/settings.tpl.php +++ b/Admin/Settings/Theme/Backend/settings.tpl.php @@ -37,7 +37,7 @@ $temperatures = \phpOMS\Utils\Converter\TemperatureType::getConstants(); $serverModes = ApplicationStatus::getConstants(); -$l11n = $this->getData('defaultlocalization') ?? new NullLocalization(); +$l11n = $this->getData('default_localization') ?? new NullLocalization(); echo $this->data['nav']->render(); ?> diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 62493bc..4fd87cb 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -806,7 +806,7 @@ final class BackendController extends Controller ); $view->data['generalSettings'] = $generalSettings; - $view->data['defaultlocalization'] = LocalizationMapper::get()->where('id', (int) $generalSettings[SettingsEnum::DEFAULT_LOCALIZATION]->content)->execute(); + $view->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $generalSettings[SettingsEnum::DEFAULT_LOCALIZATION]->content)->execute(); return $view; } diff --git a/Theme/Backend/Components/AddressEditor/AddressView.php b/Theme/Backend/Components/AddressEditor/AddressView.php new file mode 100644 index 0000000..26ee9dd --- /dev/null +++ b/Theme/Backend/Components/AddressEditor/AddressView.php @@ -0,0 +1,87 @@ +setTemplate('/Modules/Admin/Theme/Backend/Components/AddressEditor/addresses'); + } + + /** + * {@inheritdoc} + */ + public function render(mixed ...$data) : string + { + /** @var array{0:\phpOMS\Stdlib\Base\Address[]} $data */ + $this->addresses = $data[0]; + $this->units = $data[1]; + $this->apiUri = $data[2]; + $this->refId = $data[3]; + + return parent::render(); + } +} diff --git a/Theme/Backend/Components/AddressEditor/addresses.tpl.php b/Theme/Backend/Components/AddressEditor/addresses.tpl.php new file mode 100644 index 0000000..79fcf86 --- /dev/null +++ b/Theme/Backend/Components/AddressEditor/addresses.tpl.php @@ -0,0 +1,135 @@ +addresses; +$languages = ISO639Enum::getConstants(); +$types = AddressType::getConstants(); +$units = $this->units; +?> + +
+
+
+
getHtml('Address', 'Admin', 'Backend'); ?>
+
+ + +
+ + +
+ +
+ + +
+ + + +
+ +

+                
+
+
+ + + +
+
+
+
+ +
+
+
getHtml('Address', 'Admin', 'Backend'); ?>download
+
+ + + + + + $value) : ++$c; ?> + + +
+ getHtml('ID', '0', '0'); ?> + getHtml('Name', 'Admin', 'Backend'); ?>expand_lessexpand_more + getHtml('Value', 'Admin', 'Backend'); ?>expand_lessexpand_more + getHtml('Unit', 'Admin', 'Backend'); ?>expand_lessexpand_more +
+ settings + type->isRequired) : ?> + + + + + + + + id; ?> + printHtml($value->type->getL11n()); ?> + value->getValue() instanceof \DateTime ? $value->value->getValue()->format('Y-m-d') : $this->printHtml((string) $value->value->getValue()); ?> + printHtml($value->value->unit); ?> + + +
getHtml('Empty', '0', '0'); ?> + +
+
+
+
diff --git a/Theme/Backend/settings-general.tpl.php b/Theme/Backend/settings-general.tpl.php index 3fb0684..22f7700 100755 --- a/Theme/Backend/settings-general.tpl.php +++ b/Theme/Backend/settings-general.tpl.php @@ -37,7 +37,7 @@ $lengths = \phpOMS\Utils\Converter\LengthType::getConstants(); $volumes = \phpOMS\Utils\Converter\VolumeType::getConstants(); $temperatures = \phpOMS\Utils\Converter\TemperatureType::getConstants(); -$l11n = $this->getData('defaultlocalization') ?? new NullLocalization(); +$l11n = $this->getData('default_localization') ?? new NullLocalization(); ?>