From bd0489e2063bcced28a08c7a567151e3167cd2b0 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 17 Jan 2025 15:19:17 +0100 Subject: [PATCH] Fixes --- .../EntityBundle/Document/ContactAddress.php | 6 +- .../Document/Embed/ContactAddress.php | 6 +- .../Custom/PSC/CollectLayouter/Api/Form.php | 4 +- .../PSC/CollectLayouter/Api/SaveContact.php | 2 - .../views/frontend/designer/collect.html.twig | 4 - .../data/models/ContactAddress.php | 110 ++++++++++++------ .../bootstrap4_api/config/user/login.ini | 2 +- .../bootstrap4_api/templates/user/login.phtml | 48 ++++---- .../tailwindcss/config/user/login.ini | 2 +- .../default/controllers/UserController.php | 4 + 10 files changed, 119 insertions(+), 69 deletions(-) diff --git a/src/new/src/PSC/Shop/EntityBundle/Document/ContactAddress.php b/src/new/src/PSC/Shop/EntityBundle/Document/ContactAddress.php index 168150bcc..c2e2a633e 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Document/ContactAddress.php +++ b/src/new/src/PSC/Shop/EntityBundle/Document/ContactAddress.php @@ -29,7 +29,7 @@ class ContactAddress #[Field(type: 'string')] protected $homepage; #[Field(type: 'string')] - protected $steuerid; + protected $steuerId; #[Field(type: 'string')] protected $lid; @@ -45,12 +45,12 @@ class ContactAddress public function getSteuerId(): string { - return (string)$this->steuerid; + return (string)$this->steuerId; } public function setSteuerId(string $var): void { - $this->steuerid = $var; + $this->steuerId = $var; } public function getHomepage() diff --git a/src/new/src/PSC/Shop/EntityBundle/Document/Embed/ContactAddress.php b/src/new/src/PSC/Shop/EntityBundle/Document/Embed/ContactAddress.php index dd6c4a57b..a78b8bbbb 100755 --- a/src/new/src/PSC/Shop/EntityBundle/Document/Embed/ContactAddress.php +++ b/src/new/src/PSC/Shop/EntityBundle/Document/Embed/ContactAddress.php @@ -112,7 +112,7 @@ class ContactAddress #[Field(type: 'string')] private $ustid; #[Field(type: 'string')] - private $steuerid; + private $steuerId; #[Field(type: 'string')] private $iban; #[Field(type: 'string')] @@ -519,12 +519,12 @@ class ContactAddress public function getSteuerId(): string { - return (string)$this->steuerid; + return (string)$this->steuerId; } public function setSteuerId(string $var): void { - $this->steuerid = $var; + $this->steuerId = $var; } public function getLId(): string { diff --git a/src/new/var/plugins/Custom/PSC/CollectLayouter/Api/Form.php b/src/new/var/plugins/Custom/PSC/CollectLayouter/Api/Form.php index f023b4c8b..9f0c1db23 100755 --- a/src/new/var/plugins/Custom/PSC/CollectLayouter/Api/Form.php +++ b/src/new/var/plugins/Custom/PSC/CollectLayouter/Api/Form.php @@ -130,7 +130,9 @@ class Form extends AbstractController return $el; } })); - + if (count($elmEnable) === 2 && $elmEnable[0]['value'] === "1" && $elmEnable[1]['value'] === "1") { + $setting->setOptionalDefault(true); + } if (count($elmEnable) === 1 && $elmEnable[0]['value'] === "1") { $setting->setOptionalDefault(true); } diff --git a/src/new/var/plugins/Custom/PSC/CollectLayouter/Api/SaveContact.php b/src/new/var/plugins/Custom/PSC/CollectLayouter/Api/SaveContact.php index 106961f4a..e714569ad 100755 --- a/src/new/var/plugins/Custom/PSC/CollectLayouter/Api/SaveContact.php +++ b/src/new/var/plugins/Custom/PSC/CollectLayouter/Api/SaveContact.php @@ -81,7 +81,6 @@ class SaveContact extends AbstractController $contactEntity = $this->entityManager->getRepository(PSCContact::class)->findOneBy(['uuid' => $contactuuid]); $contact = new \PSC\Shop\ContactBundle\Model\Contact(); $this->contactTransformer->fromDb($contact, $contactEntity); - if ($contact->getUuid() != "") { $this->saveContactHelper->setSetting($setting); $this->saveContactHelper->setContact($contact); @@ -124,4 +123,3 @@ class SaveContact extends AbstractController } } - diff --git a/src/new/var/plugins/Custom/PSC/CollectLayouter/Resources/views/frontend/designer/collect.html.twig b/src/new/var/plugins/Custom/PSC/CollectLayouter/Resources/views/frontend/designer/collect.html.twig index 022676b45..897b72345 100755 --- a/src/new/var/plugins/Custom/PSC/CollectLayouter/Resources/views/frontend/designer/collect.html.twig +++ b/src/new/var/plugins/Custom/PSC/CollectLayouter/Resources/views/frontend/designer/collect.html.twig @@ -113,8 +113,6 @@ $.each($("input:checkbox"), function(i, e) { if(!$(this).is(':checked')) { arr.push({name: e.name, value: "0"}); - }else{ - arr.push({name: e.name, value: "1"}); } }); @@ -164,8 +162,6 @@ $.each($("input:checkbox"), function(i, e) { if(!$(this).is(':checked')) { arr.push({name: e.name, value: "0"}); - }else{ - arr.push({name: e.name, value: "1"}); } }); diff --git a/src/old/application/data/models/ContactAddress.php b/src/old/application/data/models/ContactAddress.php index 74604ca19..919ec0ad3 100755 --- a/src/old/application/data/models/ContactAddress.php +++ b/src/old/application/data/models/ContactAddress.php @@ -36,8 +36,8 @@ class ContactAddress extends BaseContactAddress { - protected $kundenNr = ''; + protected $steuerId = ''; protected $homepage = ''; protected $mongoLoaded = false; @@ -45,7 +45,8 @@ class ContactAddress extends BaseContactAddress * Empty template method to provide concrete Record classes with the possibility * to hook into the saving procedure. */ - public function preSave($event) { + public function preSave($event) + { if ($this->identifier()) { $this->updated = date('Y-m-d H:i:s'); @@ -64,7 +65,8 @@ class ContactAddress extends BaseContactAddress TP_Util::clearCache(); } - public function getAnrede() { + public function getAnrede() + { if ($this->anrede == 1) { return 'Herr'; @@ -91,7 +93,8 @@ class ContactAddress extends BaseContactAddress } - public function getAddressString() { + public function getAddressString() + { $str = ''; if ($this->company != "") { @@ -124,7 +127,8 @@ class ContactAddress extends BaseContactAddress return $str; } - public function getAddressStringWithBreak() { + public function getAddressStringWithBreak() + { $str = ''; if ($this->company != "") { @@ -155,109 +159,133 @@ class ContactAddress extends BaseContactAddress return $str; } - public function getFirstname() { + public function getFirstname() + { return $this->firstname; } - public function getCompany() { + public function getCompany() + { return ($this->company); } - public function getCompany2() { + public function getCompany2() + { return ($this->company2); } - public function getCountry() { + public function getCountry() + { return $this->country; } - public function getLastname() { + public function getLastname() + { return $this->lastname; } - public function getStreet() { + public function getStreet() + { return $this->street; } - public function getHouseNumber() { + public function getHouseNumber() + { return $this->house_number; } - public function getZip() { + public function getZip() + { return $this->zip; } - public function getCity() { + public function getCity() + { return $this->city; } - public function getPhone() { + public function getPhone() + { return $this->phone; } - public function getMail() { + public function getMail() + { return $this->email; } - public function getKostenstellung() { + public function getKostenstellung() + { return $this->kostenstellung; } - public function getAbteilung() { + public function getAbteilung() + { return $this->abteilung; } - public function getPosition() { + public function getPosition() + { return $this->position; } - public function getUstId() { + public function getUstId() + { return $this->ustid; } - public function getFax() { + public function getFax() + { return $this->fax; } - public function getZusatz1() { + public function getZusatz1() + { return $this->zusatz1; } - public function getZusatz2() { + public function getZusatz2() + { return $this->zusatz2; } - public function loadData() { - if($this->mongoLoaded) { + public function loadData() + { + if ($this->mongoLoaded) { return true; } $dbMongo = TP_Mongo::getInstance(); $obj = $dbMongo->ContactAddress->findOne(array('uid' => (string)$this->id)); - if(!$obj) { + if (!$obj) { $obj = $dbMongo->ContactAddress->findOne(array('uid' => $this->id)); } - if($obj) { + if ($obj) { $this->kundenNr = $obj['kundenNr']; + $this->steuerId = $obj['steuerId']; $this->homepage = $obj['homepage']; $this->mongoLoaded = true; } } - public function getArray() { + public function getArray() + { return array( 'uid' => $this->id, 'kundenNr' => $this->kundenNr, + 'steuerId' => $this->steuerId, 'homepage' => $this->homepage ); } - public function getOrderSaveArray() { + public function getOrderSaveArray() + { $arr = $this->toArray(); $arr['kundenNr'] = $this->getKundenNr(); + $arr['steuerId'] = $this->getSteuerId(); $arr['homepage'] = $this->getHomepage(); $arr['houseNumber'] = $arr['house_number']; - $arr['_doctrine_class_name']= "PSC\\Shop\\EntityBundle\\Document\\Embed\\ContactAddress"; + $arr['_doctrine_class_name'] = "PSC\\Shop\\EntityBundle\\Document\\Embed\\ContactAddress"; return $arr; } @@ -279,6 +307,21 @@ class ContactAddress extends BaseContactAddress $this->kundenNr = $kundenNr; } + public function getSteuerId() + { + $this->loadData(); + return $this->steuerId; + } + + /** + * @param string $kundenNr + */ + public function setSteuerId($steuerId) + { + $this->steuerId = $steuerId; + } + + public function getHomepage() { $this->loadData(); @@ -290,12 +333,13 @@ class ContactAddress extends BaseContactAddress $this->homepage = $value; } - public function saveMongo() { + public function saveMongo() + { $dbMongo = TP_Mongo::getInstance(); $obj = $dbMongo->ContactAddress->findOne(array('uid' => $this->id)); - if($obj) { + if ($obj) { $dbMongo->ContactAddress->updateOne(array('uid' => $this->id), [ '$set' => $this->getArray()]); - }else{ + } else { $dbMongo->ContactAddress->insertOne($this->getArray()); } diff --git a/src/old/application/design/vorlagen/bootstrap4_api/config/user/login.ini b/src/old/application/design/vorlagen/bootstrap4_api/config/user/login.ini index a9825d167..667e86d47 100755 --- a/src/old/application/design/vorlagen/bootstrap4_api/config/user/login.ini +++ b/src/old/application/design/vorlagen/bootstrap4_api/config/user/login.ini @@ -22,4 +22,4 @@ user.login.elements.password.options.class = "required" ; submit element user.login.elements.submit.type = "submit" -user.login.elements.submit.options.label = "Login" \ No newline at end of file +user.login.elements.submit.options.label = "Login" diff --git a/src/old/application/design/vorlagen/bootstrap4_api/templates/user/login.phtml b/src/old/application/design/vorlagen/bootstrap4_api/templates/user/login.phtml index c1648523e..b46248562 100755 --- a/src/old/application/design/vorlagen/bootstrap4_api/templates/user/login.phtml +++ b/src/old/application/design/vorlagen/bootstrap4_api/templates/user/login.phtml @@ -1,12 +1,12 @@ shop->registration AND $this->shop->isGuestEnable()) { - $col = 4; -} else if(!$this->shop->registration AND !$this->shop->isGuestEnable()) { - $col = 12; -} else if($this->shop->registration AND !$this->shop->isGuestEnable()) { - $col = 6; -} else if(!$this->shop->registration) { - $col = 12; +if($this->shop->registration and $this->shop->isGuestEnable()) { + $col = 4; +} elseif(!$this->shop->registration and !$this->shop->isGuestEnable()) { + $col = 12; +} elseif($this->shop->registration and !$this->shop->isGuestEnable()) { + $col = 6; +} elseif(!$this->shop->registration) { + $col = 12; } ?> @@ -24,17 +24,19 @@ if($this->shop->registration AND $this->shop->isGuestEnable()) {

translate('Please fill out the Form') ?>

- form, \EasyBib_Form_Decorator::BOOTSTRAP, 'submit'); - //echo $this->form->render(); + form, \EasyBib_Form_Decorator::BOOTSTRAP, 'submit'); +//echo $this->form->render(); - $owd_FORM = $this->form->setAttrib('class', 'niceform form-horizontal')->render(); - - echo str_replace( array('control-group','control-label','class="controls"', ' +$owd_FORM = $this->form->setAttrib('class', 'niceform form-horizontal')->render(); + +echo str_replace( + array('control-group','control-label','class="controls"', ' translate('Forget password') ?>
@@ -58,7 +60,9 @@ if($this->shop->registration AND $this->shop->isGuestEnable()) {
-

translate('Registrieren Sie sich jetzt als Neukunde') ?>

+

translate('Registrieren Sie sich jetzt als Neukunde') ?>

@@ -83,8 +87,10 @@ if($this->shop->registration AND $this->shop->isGuestEnable()) {
-

translate('Weiter als Gast') ?>

+

translate('Weiter als Gast') ?>

- \ No newline at end of file + diff --git a/src/old/application/design/vorlagen/tailwindcss/config/user/login.ini b/src/old/application/design/vorlagen/tailwindcss/config/user/login.ini index 1ad256cdb..5ee7ffd1c 100755 --- a/src/old/application/design/vorlagen/tailwindcss/config/user/login.ini +++ b/src/old/application/design/vorlagen/tailwindcss/config/user/login.ini @@ -22,4 +22,4 @@ user.login.elements.password.options.class = "required" ; submit element user.login.elements.submit.type = "submit" -user.login.elements.submit.options.label = "Login" \ No newline at end of file +user.login.elements.submit.options.label = "Login" diff --git a/src/old/application/modules/default/controllers/UserController.php b/src/old/application/modules/default/controllers/UserController.php index 0a04a5883..df0b4670a 100755 --- a/src/old/application/modules/default/controllers/UserController.php +++ b/src/old/application/modules/default/controllers/UserController.php @@ -3372,6 +3372,10 @@ class UserController extends TP_Controller_Action $contactaddress->save(); $contactaddress->setKundenNr($contact->getKundenNr()); + if (isset($formData ['rech'] ['steuerId'])) { + $contactaddress->setSteuerId($formData ['rech'] ['steuerId']); + } + $contactaddress->setKundenNr($contact->getKundenNr()); $contactaddress->saveMongo(); $shopcontact = new ShopContact ();