This commit is contained in:
Thomas 2025-01-17 15:19:17 +01:00
parent f67cbd5f3e
commit bd0489e206
10 changed files with 119 additions and 69 deletions

View File

@ -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()

View File

@ -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
{

View File

@ -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);
}

View File

@ -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
}
}

View File

@ -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"});
}
});

View File

@ -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());
}

View File

@ -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"
user.login.elements.submit.options.label = "Login"

View File

@ -1,12 +1,12 @@
<?php
if($this->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()) {
<p><?php echo $this->translate('Please fill out the Form') ?></p>
<div id="userreg" class="login" style="padding: 3em;">
<fieldset>
<?php
EasyBib_Form_Decorator::setFormDecorator($this->form, \EasyBib_Form_Decorator::BOOTSTRAP, 'submit');
//echo $this->form->render();
<?php
EasyBib_Form_Decorator::setFormDecorator($this->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"', '<input type="text"', '<input type="password"', '<select'),
array('form-group','form-label','class="form-controls"', '<input type="text" class="form-control"', '<input type="password" class="form-control"', '<select class="form-control"'),
$owd_FORM );
?>
$owd_FORM = $this->form->setAttrib('class', 'niceform form-horizontal')->render();
echo str_replace(
array('control-group','control-label','class="controls"', '<input type="text"', '<input type="password"', '<select'),
array('form-group','form-label','class="form-controls"', '<input type="text" class="form-control"', '<input type="password" class="form-control"', '<select class="form-control"'),
$owd_FORM
);
?>
<a id="passwordreset" href="/user/resetpassword"><?php echo $this->translate('Forget password') ?></a>
</fieldset>
</div>
@ -58,7 +60,9 @@ if($this->shop->registration AND $this->shop->isGuestEnable()) {
<?php endif; ?>
<div style="clear:both"></div>
<p><a href="/user/register<?php if($this->mode) echo '?mode='.$this->mode; ?>" id="login_reg"><?php echo $this->translate('Registrieren Sie sich jetzt als Neukunde') ?></a></p>
<p><a href="/user/register<?php if($this->mode) {
echo '?mode='.$this->mode;
} ?>" id="login_reg"><?php echo $this->translate('Registrieren Sie sich jetzt als Neukunde') ?></a></p>
</div>
<?php endif; ?>
@ -83,8 +87,10 @@ if($this->shop->registration AND $this->shop->isGuestEnable()) {
<?php endif; ?>
<div style="clear:both"></div>
<p><a href="/user/guest<?php if($this->mode) echo '?mode='.$this->mode; ?>" id="login_reg"><?php echo $this->translate('Weiter als Gast') ?></a></p>
<p><a href="/user/guest<?php if($this->mode) {
echo '?mode='.$this->mode;
} ?>" id="login_reg"><?php echo $this->translate('Weiter als Gast') ?></a></p>
</div>
<?php endif; ?>
</div>
</div>

View File

@ -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"
user.login.elements.submit.options.label = "Login"

View File

@ -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 ();