Fixes
This commit is contained in:
parent
f67cbd5f3e
commit
bd0489e206
@ -29,7 +29,7 @@ class ContactAddress
|
|||||||
#[Field(type: 'string')]
|
#[Field(type: 'string')]
|
||||||
protected $homepage;
|
protected $homepage;
|
||||||
#[Field(type: 'string')]
|
#[Field(type: 'string')]
|
||||||
protected $steuerid;
|
protected $steuerId;
|
||||||
#[Field(type: 'string')]
|
#[Field(type: 'string')]
|
||||||
protected $lid;
|
protected $lid;
|
||||||
|
|
||||||
@ -45,12 +45,12 @@ class ContactAddress
|
|||||||
|
|
||||||
public function getSteuerId(): string
|
public function getSteuerId(): string
|
||||||
{
|
{
|
||||||
return (string)$this->steuerid;
|
return (string)$this->steuerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSteuerId(string $var): void
|
public function setSteuerId(string $var): void
|
||||||
{
|
{
|
||||||
$this->steuerid = $var;
|
$this->steuerId = $var;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHomepage()
|
public function getHomepage()
|
||||||
|
|||||||
@ -112,7 +112,7 @@ class ContactAddress
|
|||||||
#[Field(type: 'string')]
|
#[Field(type: 'string')]
|
||||||
private $ustid;
|
private $ustid;
|
||||||
#[Field(type: 'string')]
|
#[Field(type: 'string')]
|
||||||
private $steuerid;
|
private $steuerId;
|
||||||
#[Field(type: 'string')]
|
#[Field(type: 'string')]
|
||||||
private $iban;
|
private $iban;
|
||||||
#[Field(type: 'string')]
|
#[Field(type: 'string')]
|
||||||
@ -519,12 +519,12 @@ class ContactAddress
|
|||||||
|
|
||||||
public function getSteuerId(): string
|
public function getSteuerId(): string
|
||||||
{
|
{
|
||||||
return (string)$this->steuerid;
|
return (string)$this->steuerId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSteuerId(string $var): void
|
public function setSteuerId(string $var): void
|
||||||
{
|
{
|
||||||
$this->steuerid = $var;
|
$this->steuerId = $var;
|
||||||
}
|
}
|
||||||
public function getLId(): string
|
public function getLId(): string
|
||||||
{
|
{
|
||||||
|
|||||||
@ -130,7 +130,9 @@ class Form extends AbstractController
|
|||||||
return $el;
|
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") {
|
if (count($elmEnable) === 1 && $elmEnable[0]['value'] === "1") {
|
||||||
$setting->setOptionalDefault(true);
|
$setting->setOptionalDefault(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,7 +81,6 @@ class SaveContact extends AbstractController
|
|||||||
$contactEntity = $this->entityManager->getRepository(PSCContact::class)->findOneBy(['uuid' => $contactuuid]);
|
$contactEntity = $this->entityManager->getRepository(PSCContact::class)->findOneBy(['uuid' => $contactuuid]);
|
||||||
$contact = new \PSC\Shop\ContactBundle\Model\Contact();
|
$contact = new \PSC\Shop\ContactBundle\Model\Contact();
|
||||||
$this->contactTransformer->fromDb($contact, $contactEntity);
|
$this->contactTransformer->fromDb($contact, $contactEntity);
|
||||||
|
|
||||||
if ($contact->getUuid() != "") {
|
if ($contact->getUuid() != "") {
|
||||||
$this->saveContactHelper->setSetting($setting);
|
$this->saveContactHelper->setSetting($setting);
|
||||||
$this->saveContactHelper->setContact($contact);
|
$this->saveContactHelper->setContact($contact);
|
||||||
@ -124,4 +123,3 @@ class SaveContact extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -113,8 +113,6 @@
|
|||||||
$.each($("input:checkbox"), function(i, e) {
|
$.each($("input:checkbox"), function(i, e) {
|
||||||
if(!$(this).is(':checked')) {
|
if(!$(this).is(':checked')) {
|
||||||
arr.push({name: e.name, value: "0"});
|
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) {
|
$.each($("input:checkbox"), function(i, e) {
|
||||||
if(!$(this).is(':checked')) {
|
if(!$(this).is(':checked')) {
|
||||||
arr.push({name: e.name, value: "0"});
|
arr.push({name: e.name, value: "0"});
|
||||||
}else{
|
|
||||||
arr.push({name: e.name, value: "1"});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -36,8 +36,8 @@
|
|||||||
|
|
||||||
class ContactAddress extends BaseContactAddress
|
class ContactAddress extends BaseContactAddress
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $kundenNr = '';
|
protected $kundenNr = '';
|
||||||
|
protected $steuerId = '';
|
||||||
protected $homepage = '';
|
protected $homepage = '';
|
||||||
protected $mongoLoaded = false;
|
protected $mongoLoaded = false;
|
||||||
|
|
||||||
@ -45,7 +45,8 @@ class ContactAddress extends BaseContactAddress
|
|||||||
* Empty template method to provide concrete Record classes with the possibility
|
* Empty template method to provide concrete Record classes with the possibility
|
||||||
* to hook into the saving procedure.
|
* to hook into the saving procedure.
|
||||||
*/
|
*/
|
||||||
public function preSave($event) {
|
public function preSave($event)
|
||||||
|
{
|
||||||
|
|
||||||
if ($this->identifier()) {
|
if ($this->identifier()) {
|
||||||
$this->updated = date('Y-m-d H:i:s');
|
$this->updated = date('Y-m-d H:i:s');
|
||||||
@ -64,7 +65,8 @@ class ContactAddress extends BaseContactAddress
|
|||||||
TP_Util::clearCache();
|
TP_Util::clearCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAnrede() {
|
public function getAnrede()
|
||||||
|
{
|
||||||
|
|
||||||
if ($this->anrede == 1) {
|
if ($this->anrede == 1) {
|
||||||
return 'Herr';
|
return 'Herr';
|
||||||
@ -91,7 +93,8 @@ class ContactAddress extends BaseContactAddress
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAddressString() {
|
public function getAddressString()
|
||||||
|
{
|
||||||
|
|
||||||
$str = '';
|
$str = '';
|
||||||
if ($this->company != "") {
|
if ($this->company != "") {
|
||||||
@ -124,7 +127,8 @@ class ContactAddress extends BaseContactAddress
|
|||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAddressStringWithBreak() {
|
public function getAddressStringWithBreak()
|
||||||
|
{
|
||||||
|
|
||||||
$str = '';
|
$str = '';
|
||||||
if ($this->company != "") {
|
if ($this->company != "") {
|
||||||
@ -155,109 +159,133 @@ class ContactAddress extends BaseContactAddress
|
|||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFirstname() {
|
public function getFirstname()
|
||||||
|
{
|
||||||
return $this->firstname;
|
return $this->firstname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCompany() {
|
public function getCompany()
|
||||||
|
{
|
||||||
return ($this->company);
|
return ($this->company);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCompany2() {
|
public function getCompany2()
|
||||||
|
{
|
||||||
return ($this->company2);
|
return ($this->company2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCountry() {
|
public function getCountry()
|
||||||
|
{
|
||||||
return $this->country;
|
return $this->country;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLastname() {
|
public function getLastname()
|
||||||
|
{
|
||||||
return $this->lastname;
|
return $this->lastname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStreet() {
|
public function getStreet()
|
||||||
|
{
|
||||||
return $this->street;
|
return $this->street;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHouseNumber() {
|
public function getHouseNumber()
|
||||||
|
{
|
||||||
return $this->house_number;
|
return $this->house_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getZip() {
|
public function getZip()
|
||||||
|
{
|
||||||
return $this->zip;
|
return $this->zip;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCity() {
|
public function getCity()
|
||||||
|
{
|
||||||
return $this->city;
|
return $this->city;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPhone() {
|
public function getPhone()
|
||||||
|
{
|
||||||
return $this->phone;
|
return $this->phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMail() {
|
public function getMail()
|
||||||
|
{
|
||||||
return $this->email;
|
return $this->email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getKostenstellung() {
|
public function getKostenstellung()
|
||||||
|
{
|
||||||
return $this->kostenstellung;
|
return $this->kostenstellung;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAbteilung() {
|
public function getAbteilung()
|
||||||
|
{
|
||||||
return $this->abteilung;
|
return $this->abteilung;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPosition() {
|
public function getPosition()
|
||||||
|
{
|
||||||
return $this->position;
|
return $this->position;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUstId() {
|
public function getUstId()
|
||||||
|
{
|
||||||
return $this->ustid;
|
return $this->ustid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFax() {
|
public function getFax()
|
||||||
|
{
|
||||||
return $this->fax;
|
return $this->fax;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getZusatz1() {
|
public function getZusatz1()
|
||||||
|
{
|
||||||
return $this->zusatz1;
|
return $this->zusatz1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getZusatz2() {
|
public function getZusatz2()
|
||||||
|
{
|
||||||
return $this->zusatz2;
|
return $this->zusatz2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadData() {
|
public function loadData()
|
||||||
if($this->mongoLoaded) {
|
{
|
||||||
|
if ($this->mongoLoaded) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$dbMongo = TP_Mongo::getInstance();
|
$dbMongo = TP_Mongo::getInstance();
|
||||||
$obj = $dbMongo->ContactAddress->findOne(array('uid' => (string)$this->id));
|
$obj = $dbMongo->ContactAddress->findOne(array('uid' => (string)$this->id));
|
||||||
if(!$obj) {
|
if (!$obj) {
|
||||||
$obj = $dbMongo->ContactAddress->findOne(array('uid' => $this->id));
|
$obj = $dbMongo->ContactAddress->findOne(array('uid' => $this->id));
|
||||||
}
|
}
|
||||||
if($obj) {
|
if ($obj) {
|
||||||
$this->kundenNr = $obj['kundenNr'];
|
$this->kundenNr = $obj['kundenNr'];
|
||||||
|
$this->steuerId = $obj['steuerId'];
|
||||||
$this->homepage = $obj['homepage'];
|
$this->homepage = $obj['homepage'];
|
||||||
$this->mongoLoaded = true;
|
$this->mongoLoaded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getArray() {
|
public function getArray()
|
||||||
|
{
|
||||||
return array(
|
return array(
|
||||||
'uid' => $this->id,
|
'uid' => $this->id,
|
||||||
'kundenNr' => $this->kundenNr,
|
'kundenNr' => $this->kundenNr,
|
||||||
|
'steuerId' => $this->steuerId,
|
||||||
'homepage' => $this->homepage
|
'homepage' => $this->homepage
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOrderSaveArray() {
|
public function getOrderSaveArray()
|
||||||
|
{
|
||||||
|
|
||||||
$arr = $this->toArray();
|
$arr = $this->toArray();
|
||||||
$arr['kundenNr'] = $this->getKundenNr();
|
$arr['kundenNr'] = $this->getKundenNr();
|
||||||
|
$arr['steuerId'] = $this->getSteuerId();
|
||||||
$arr['homepage'] = $this->getHomepage();
|
$arr['homepage'] = $this->getHomepage();
|
||||||
$arr['houseNumber'] = $arr['house_number'];
|
$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;
|
return $arr;
|
||||||
}
|
}
|
||||||
@ -279,6 +307,21 @@ class ContactAddress extends BaseContactAddress
|
|||||||
$this->kundenNr = $kundenNr;
|
$this->kundenNr = $kundenNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSteuerId()
|
||||||
|
{
|
||||||
|
$this->loadData();
|
||||||
|
return $this->steuerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $kundenNr
|
||||||
|
*/
|
||||||
|
public function setSteuerId($steuerId)
|
||||||
|
{
|
||||||
|
$this->steuerId = $steuerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getHomepage()
|
public function getHomepage()
|
||||||
{
|
{
|
||||||
$this->loadData();
|
$this->loadData();
|
||||||
@ -290,12 +333,13 @@ class ContactAddress extends BaseContactAddress
|
|||||||
$this->homepage = $value;
|
$this->homepage = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveMongo() {
|
public function saveMongo()
|
||||||
|
{
|
||||||
$dbMongo = TP_Mongo::getInstance();
|
$dbMongo = TP_Mongo::getInstance();
|
||||||
$obj = $dbMongo->ContactAddress->findOne(array('uid' => $this->id));
|
$obj = $dbMongo->ContactAddress->findOne(array('uid' => $this->id));
|
||||||
if($obj) {
|
if ($obj) {
|
||||||
$dbMongo->ContactAddress->updateOne(array('uid' => $this->id), [ '$set' => $this->getArray()]);
|
$dbMongo->ContactAddress->updateOne(array('uid' => $this->id), [ '$set' => $this->getArray()]);
|
||||||
}else{
|
} else {
|
||||||
$dbMongo->ContactAddress->insertOne($this->getArray());
|
$dbMongo->ContactAddress->insertOne($this->getArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
if($this->shop->registration AND $this->shop->isGuestEnable()) {
|
if($this->shop->registration and $this->shop->isGuestEnable()) {
|
||||||
$col = 4;
|
$col = 4;
|
||||||
} else if(!$this->shop->registration AND !$this->shop->isGuestEnable()) {
|
} elseif(!$this->shop->registration and !$this->shop->isGuestEnable()) {
|
||||||
$col = 12;
|
$col = 12;
|
||||||
} else if($this->shop->registration AND !$this->shop->isGuestEnable()) {
|
} elseif($this->shop->registration and !$this->shop->isGuestEnable()) {
|
||||||
$col = 6;
|
$col = 6;
|
||||||
} else if(!$this->shop->registration) {
|
} elseif(!$this->shop->registration) {
|
||||||
$col = 12;
|
$col = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -25,16 +25,18 @@ if($this->shop->registration AND $this->shop->isGuestEnable()) {
|
|||||||
<div id="userreg" class="login" style="padding: 3em;">
|
<div id="userreg" class="login" style="padding: 3em;">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<?php
|
<?php
|
||||||
EasyBib_Form_Decorator::setFormDecorator($this->form, \EasyBib_Form_Decorator::BOOTSTRAP, 'submit');
|
EasyBib_Form_Decorator::setFormDecorator($this->form, \EasyBib_Form_Decorator::BOOTSTRAP, 'submit');
|
||||||
//echo $this->form->render();
|
//echo $this->form->render();
|
||||||
|
|
||||||
$owd_FORM = $this->form->setAttrib('class', 'niceform form-horizontal')->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'),
|
echo str_replace(
|
||||||
array('form-group','form-label','class="form-controls"', '<input type="text" class="form-control"', '<input type="password" class="form-control"', '<select class="form-control"'),
|
array('control-group','control-label','class="controls"', '<input type="text"', '<input type="password"', '<select'),
|
||||||
$owd_FORM );
|
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>
|
<a id="passwordreset" href="/user/resetpassword"><?php echo $this->translate('Forget password') ?></a>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
@ -58,7 +60,9 @@ if($this->shop->registration AND $this->shop->isGuestEnable()) {
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div style="clear:both"></div>
|
<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>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
@ -83,7 +87,9 @@ if($this->shop->registration AND $this->shop->isGuestEnable()) {
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div style="clear:both"></div>
|
<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>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|||||||
@ -3372,6 +3372,10 @@ class UserController extends TP_Controller_Action
|
|||||||
|
|
||||||
$contactaddress->save();
|
$contactaddress->save();
|
||||||
$contactaddress->setKundenNr($contact->getKundenNr());
|
$contactaddress->setKundenNr($contact->getKundenNr());
|
||||||
|
if (isset($formData ['rech'] ['steuerId'])) {
|
||||||
|
$contactaddress->setSteuerId($formData ['rech'] ['steuerId']);
|
||||||
|
}
|
||||||
|
$contactaddress->setKundenNr($contact->getKundenNr());
|
||||||
$contactaddress->saveMongo();
|
$contactaddress->saveMongo();
|
||||||
|
|
||||||
$shopcontact = new ShopContact ();
|
$shopcontact = new ShopContact ();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user