Skip to content
Code-Schnipsel Gruppen Projekte
Commit 7715c080 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix: candyman-gmbh/projektplanung#113

Übergeordneter f8bac5eb
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -336,6 +336,21 @@ public static function onFrontendUserAddressCreateBegin(Collector $Collector, $U
return;
}
try {
$Conf = QUI::getPackage('quiqqer/frontend-users')->getConfig();
$settings = $Conf->getValue('profile', 'addressFields');
if (!empty($settings)) {
$settings = \json_decode($settings, true);
} else {
$settings = [];
}
$Engine->assign('settings', QUI\FrontendUsers\Controls\Address\Address::checkSettingsArray($settings));
} catch (QUI\Exception $Exception) {
$Engine->assign('settings', QUI\FrontendUsers\Controls\Address\Address::checkSettingsArray([]));
}
$Engine->assign([
'User' => $User,
......@@ -343,6 +358,7 @@ public static function onFrontendUserAddressCreateBegin(Collector $Collector, $U
'isB2C' => QUI\ERP\Utils\Shop::isB2C(),
'isB2B' => QUI\ERP\Utils\Shop::isB2B(),
'isOnlyB2B' => QUI\ERP\Utils\Shop::isOnlyB2B(),
'isOnlyB2C' => QUI\ERP\Utils\Shop::isOnlyB2C(),
]);
try {
......@@ -372,6 +388,21 @@ public static function onFrontendUserAddressCreateEnd(Collector $Collector, $Use
return;
}
try {
$Conf = QUI::getPackage('quiqqer/frontend-users')->getConfig();
$settings = $Conf->getValue('profile', 'addressFields');
if (!empty($settings)) {
$settings = \json_decode($settings, true);
} else {
$settings = [];
}
$Engine->assign('settings', QUI\FrontendUsers\Controls\Address\Address::checkSettingsArray($settings));
} catch (QUI\Exception $Exception) {
$Engine->assign('settings', QUI\FrontendUsers\Controls\Address\Address::checkSettingsArray([]));
}
$Engine->assign([
'User' => $User,
......@@ -379,6 +410,7 @@ public static function onFrontendUserAddressCreateEnd(Collector $Collector, $Use
'isB2C' => QUI\ERP\Utils\Shop::isB2C(),
'isB2B' => QUI\ERP\Utils\Shop::isB2B(),
'isOnlyB2B' => QUI\ERP\Utils\Shop::isOnlyB2B(),
'isOnlyB2C' => QUI\ERP\Utils\Shop::isOnlyB2C(),
]);
try {
......@@ -409,6 +441,21 @@ public static function onFrontendUserAddressEditBegin(Collector $Collector, $Use
return;
}
try {
$Conf = QUI::getPackage('quiqqer/frontend-users')->getConfig();
$settings = $Conf->getValue('profile', 'addressFields');
if (!empty($settings)) {
$settings = \json_decode($settings, true);
} else {
$settings = [];
}
$Engine->assign('settings', QUI\FrontendUsers\Controls\Address\Address::checkSettingsArray($settings));
} catch (QUI\Exception $Exception) {
$Engine->assign('settings', QUI\FrontendUsers\Controls\Address\Address::checkSettingsArray([]));
}
// business type
$businessType = 'b2c';
$company = $Address->getAttribute('company');
......@@ -431,6 +478,7 @@ public static function onFrontendUserAddressEditBegin(Collector $Collector, $Use
'isB2C' => QUI\ERP\Utils\Shop::isB2C(),
'isB2B' => QUI\ERP\Utils\Shop::isB2B(),
'isOnlyB2B' => QUI\ERP\Utils\Shop::isOnlyB2B(),
'isOnlyB2C' => QUI\ERP\Utils\Shop::isOnlyB2C(),
]);
try {
......@@ -453,6 +501,21 @@ public static function onFrontendUserAddressEditEnd(Collector $Collector, $User,
return;
}
try {
$Conf = QUI::getPackage('quiqqer/frontend-users')->getConfig();
$settings = $Conf->getValue('profile', 'addressFields');
if (!empty($settings)) {
$settings = \json_decode($settings, true);
} else {
$settings = [];
}
$Engine->assign('settings', QUI\FrontendUsers\Controls\Address\Address::checkSettingsArray($settings));
} catch (QUI\Exception $Exception) {
$Engine->assign('settings', QUI\FrontendUsers\Controls\Address\Address::checkSettingsArray([]));
}
try {
$Engine = QUI::getTemplateManager()->getEngine();
} catch (QUI\Exception $Exception) {
......@@ -469,6 +532,7 @@ public static function onFrontendUserAddressEditEnd(Collector $Collector, $User,
'isB2C' => QUI\ERP\Utils\Shop::isB2C(),
'isB2B' => QUI\ERP\Utils\Shop::isB2B(),
'isOnlyB2B' => QUI\ERP\Utils\Shop::isOnlyB2B(),
'isOnlyB2C' => QUI\ERP\Utils\Shop::isOnlyB2C(),
]);
try {
......
......@@ -15,14 +15,17 @@
{/if}
{if $isB2B}
{assign var=r value=""}
<label class="quiqqer-order-customerData-edit-company" {if $isOnlyB2B === false}style="display: none"{/if}>
<span class="quiqqer-frontendUsers-userdata-label">
{locale group="quiqqer/erp" var="control.profile.CustomerData.company"}
{if $settings.company.required}{assign var=r value="required"}*{/if}
</span>
<input type="text"
name="company"
class="quiqqer-frontendUsers-userdata-field"
autocomplete="organization"
{$r}
/>
</label>
{/if}
......@@ -21,6 +21,7 @@
<label class="quiqqer-order-customerData-edit-company">
<span class="quiqqer-frontendUsers-userdata-label">
{locale group="quiqqer/erp" var="control.profile.CustomerData.company"}
{if $settings.company.required}{assign var=r value="required"}{/if}
</span>
<input type="text"
name="company"
......
......@@ -15,15 +15,18 @@
{/if}
{if $isB2B}
{assign var=r value=""}
<label class="quiqqer-order-customerData-edit-company" {if $isOnlyB2B === false}style="display: none"{/if}>
<span class="quiqqer-frontendUsers-userdata-label">
{locale group="quiqqer/erp" var="control.profile.CustomerData.company"}
{if $settings.company.required}{assign var=r value="required"}*{/if}
</span>
<input type="text"
name="company"
class="quiqqer-frontendUsers-userdata-field"
autocomplete="organization"
value="{$Address->getAttribute('company')|escape:'html'}"
{$r}
/>
</label>
{/if}
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren