Fixes
This commit is contained in:
parent
36229bd2bc
commit
ae6713a490
@ -2,14 +2,17 @@
|
||||
|
||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Api;
|
||||
|
||||
use PSC\Shop\EntityBundle\Entity\Contact;
|
||||
use PSC\System\SettingsBundle\Document\LogEntry;
|
||||
use PSC\System\SettingsBundle\Service\Log;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
use Plugin\Custom\PSC\Saxoprint_API_R1\Form\Group\Saxoprint;
|
||||
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
|
||||
use Symfony\Contracts\Cache\CacheInterface;
|
||||
use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
|
||||
class Base
|
||||
{
|
||||
|
||||
protected $baseUrlTest = 'https://sri1.staging.saxoprint.com/api/v3/';
|
||||
protected $baseUrlLive = 'https://sri.saxoprint.com/api/v3/';
|
||||
|
||||
@ -22,10 +25,16 @@ class Base
|
||||
|
||||
protected bool $test = false;
|
||||
|
||||
|
||||
protected \PSC\Shop\EntityBundle\Document\Shop $shop;
|
||||
protected \PSC\Shop\EntityBundle\Entity\Shop $shopEntity;
|
||||
|
||||
public function __construct(private readonly HttpClientInterface $client, private readonly CacheInterface $cache)
|
||||
|
||||
public function setShopEntity(\PSC\Shop\EntityBundle\Entity\Shop $shop): void
|
||||
{
|
||||
$this->shopEntity = $shop;
|
||||
}
|
||||
|
||||
public function __construct(private readonly HttpClientInterface $client, private readonly CacheInterface $cache, protected readonly Log $logService)
|
||||
{
|
||||
}
|
||||
|
||||
@ -43,6 +52,8 @@ class Base
|
||||
,
|
||||
'json' => $data,
|
||||
]);
|
||||
|
||||
$this->logService->createLogEntry($this->shopEntity, new Contact(), LogEntry::INFO, Saxoprint::class, "saxoprint", "SaxoPrint PrintShop Response", ['content' => $response->getContent(), 'status' => $response->getStatusCode()]);
|
||||
$content = $response->toArray();
|
||||
|
||||
return $content;
|
||||
@ -114,6 +125,7 @@ class Base
|
||||
'body' => $data,
|
||||
]);
|
||||
|
||||
$this->logService->createLogEntry($this->shopEntity, new Contact(), LogEntry::INFO, Saxoprint::class, "saxoprint", "SaxoPrint Upload Response", ['content' => $response->getContent(), 'status' => $response->getStatusCode()]);
|
||||
return $response;
|
||||
}
|
||||
public function postUploadConfirm($url, $data)
|
||||
@ -126,7 +138,7 @@ class Base
|
||||
'headers' => $this->buildHeaders(),
|
||||
'body' => $data,
|
||||
]);
|
||||
|
||||
$this->logService->createLogEntry($this->shopEntity, new Contact(), LogEntry::INFO, Saxoprint::class, "saxoprint", "SaxoPrint UploadConfirm Response", ['content' => $response->getContent(), 'status' => $response->getStatusCode()]);
|
||||
return $response;
|
||||
}
|
||||
|
||||
@ -195,9 +207,9 @@ class Base
|
||||
return $this->cache;
|
||||
}
|
||||
|
||||
protected function buildQuery(Array $data): string
|
||||
protected function buildQuery(array $data): string
|
||||
{
|
||||
return base64_encode(json_encode($data));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,10 @@
|
||||
|
||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Api;
|
||||
|
||||
use PSC\Shop\EntityBundle\Entity\Contact;
|
||||
use PSC\System\SettingsBundle\Document\LogEntry;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
use Plugin\Custom\PSC\Saxoprint_API_R1\Form\Group\Saxoprint;
|
||||
|
||||
class PostPrintJob extends Base
|
||||
{
|
||||
@ -14,6 +17,7 @@ class PostPrintJob extends Base
|
||||
|
||||
public function call()
|
||||
{
|
||||
$this->logService->createLogEntry($this->shopEntity, new Contact(), LogEntry::INFO, Saxoprint::class, "saxoprint", "SaxoPrint PostJob Data", $this->buildData());
|
||||
return $this->post('printjob', $this->buildData());
|
||||
}
|
||||
|
||||
@ -35,11 +39,10 @@ class PostPrintJob extends Base
|
||||
|
||||
$productGroup = $this->position->getAdditionalInfo('saxoprint')['saxoprintProductId'];
|
||||
$auflage = 0;
|
||||
foreach($infos as $row)
|
||||
{
|
||||
if($row['name'] == "" || $row['name'] == 'property[auflage]' || $row['name'] == 'auflage') {
|
||||
$auflage = (int)$row['value'];
|
||||
continue;
|
||||
foreach($infos as $row) {
|
||||
if($row['name'] == "" || $row['name'] == 'property[auflage]' || $row['name'] == 'auflage') {
|
||||
$auflage = (int)$row['value'];
|
||||
continue;
|
||||
}
|
||||
if($row['name'] == 'property[6]' || $row['name'] == '6') {
|
||||
$productGroup = intval($row['value']);
|
||||
@ -51,7 +54,7 @@ class PostPrintJob extends Base
|
||||
}
|
||||
|
||||
/**
|
||||
* @var \TP_Basket_Item $objPosition
|
||||
* @var \TP_Basket_Item $objPosition
|
||||
*/
|
||||
$objPosition = unserialize(($this->position->getData()));
|
||||
|
||||
@ -60,12 +63,12 @@ class PostPrintJob extends Base
|
||||
'ResellerAddress' => [
|
||||
'Salutation' => 'None',
|
||||
'CompanyName' => $this->order->getSenderAddress()->getCompany(),
|
||||
'FirstName' => $this->order->getSenderAddress()->getFirstname()?: '',
|
||||
'LastName' => $this->order->getSenderAddress()->getLastname()?: '',
|
||||
'FirstName' => $this->order->getSenderAddress()->getFirstname() ?: '',
|
||||
'LastName' => $this->order->getSenderAddress()->getLastname() ?: '',
|
||||
'Street' => $this->order->getSenderAddress()->getStreet() . ' ' . $this->order->getSenderAddress()->getHouseNumber(),
|
||||
'Zipcode' => $this->order->getSenderAddress()->getZip(),
|
||||
'City' => $this->order->getSenderAddress()->getCity(),
|
||||
'TelephoneNumber' => (string)$this->order->getSenderAddress()->getPhone()?: '0000000',
|
||||
'TelephoneNumber' => (string)$this->order->getSenderAddress()->getPhone() ?: '0000000',
|
||||
'CountryCodeISO' => 'DE',
|
||||
],
|
||||
'DeliveryAddresses' => [[
|
||||
@ -79,7 +82,7 @@ class PostPrintJob extends Base
|
||||
'LastName' => $this->order->getDeliveryAddress()->getLastname(),
|
||||
'FirstName' => $this->order->getDeliveryAddress()->getFirstname(),
|
||||
'City' => $this->order->getDeliveryAddress()->getCity(),
|
||||
'TelephoneNumber' => $this->order->getDeliveryAddress()->getPhone()?: '0000000',
|
||||
'TelephoneNumber' => $this->order->getDeliveryAddress()->getPhone() ?: '0000000',
|
||||
'CountryCodeISO' => 'DE',
|
||||
]
|
||||
]],
|
||||
|
||||
@ -8,7 +8,6 @@ use Symfony\Component\Mime\Part\DataPart;
|
||||
|
||||
class PostUpload extends Base
|
||||
{
|
||||
|
||||
private \PSC\Shop\OrderBundle\Model\Order\Position $position;
|
||||
private \PSC\Shop\OrderBundle\Model\Base $order;
|
||||
|
||||
@ -20,6 +19,7 @@ class PostUpload extends Base
|
||||
|
||||
public function call()
|
||||
{
|
||||
$return = false;
|
||||
if(count($this->position->getUploads()) > 0) {
|
||||
|
||||
$temp = [];
|
||||
@ -31,6 +31,7 @@ class PostUpload extends Base
|
||||
'/' . $this->position->getExternalOrderNumber() . '/link',
|
||||
$this->buildDataLink($temp)
|
||||
);
|
||||
$return = true;
|
||||
}
|
||||
|
||||
if($this->position->getProduct()->getUploadProvidedFile() && $this->position->getProduct()->getUploadProvidedFile()->getUrl() != "") {
|
||||
@ -38,6 +39,7 @@ class PostUpload extends Base
|
||||
'/' . $this->position->getExternalOrderNumber() . '/link',
|
||||
$this->buildDataLink(['https://' . $this->domain . $this->position->getProduct()->getUploadProvidedFile()->getUrl()])
|
||||
);
|
||||
$return = true;
|
||||
}
|
||||
|
||||
$outfile = '/data/www/old/market/steplayouter/basket/' . $this->order->getUid() . '/' . $this->position->getPos() . '/'.$this->order->getAlias() . '_' . $this->position->getPos().'.pdf';
|
||||
@ -47,8 +49,10 @@ class PostUpload extends Base
|
||||
'/' . $this->position->getExternalOrderNumber() . '/link',
|
||||
$this->buildDataLink(['https://' . $this->domain . '/apps/market/steplayouter/basket/' . $this->order->getUid() . '/' . $this->position->getPos() . '/'.$this->order->getAlias() . '_' . $this->position->getPos().'.pdf'])
|
||||
);
|
||||
$return = true;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
private function buildDataLink(array $links)
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Queue;
|
||||
|
||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||
@ -41,15 +42,16 @@ class Confirm implements QueueInterface, ConfigurableElementInterface
|
||||
*/
|
||||
private Manager $_eventManager;
|
||||
|
||||
function __construct(FormFactoryInterface $formFactory,
|
||||
EntityManagerInterface $entityManager,
|
||||
DocumentManager $doctrine_mongodb,
|
||||
Status $statusService,
|
||||
PostConfirm $postConfirm,
|
||||
Shop $shopService,
|
||||
Order $orderService,
|
||||
Manager $eventManager)
|
||||
{
|
||||
public function __construct(
|
||||
FormFactoryInterface $formFactory,
|
||||
EntityManagerInterface $entityManager,
|
||||
DocumentManager $doctrine_mongodb,
|
||||
Status $statusService,
|
||||
PostConfirm $postConfirm,
|
||||
Shop $shopService,
|
||||
Order $orderService,
|
||||
Manager $eventManager
|
||||
) {
|
||||
$this->_formFactory = $formFactory;
|
||||
$this->_entityManager = $entityManager;
|
||||
$this->_doctrine_mongodb = $doctrine_mongodb;
|
||||
@ -123,7 +125,8 @@ class Confirm implements QueueInterface, ConfigurableElementInterface
|
||||
* @return bool
|
||||
* @internal param Queue $doc
|
||||
*/
|
||||
public function execute(EventInterface $event, Queue $queue) {
|
||||
public function execute(EventInterface $event, Queue $queue)
|
||||
{
|
||||
|
||||
/** @var \Plugin\Custom\PSC\Saxoprint_API_R1\Document\Export $settings */
|
||||
$settings = $queue->getQueueDocument();
|
||||
@ -135,6 +138,7 @@ class Confirm implements QueueInterface, ConfigurableElementInterface
|
||||
|
||||
$order = $this->_orderService->getCurrentOrder();
|
||||
|
||||
$this->_postConfirm->setShopEntity($this->_shopService->getShopByUid($order->getShop()->getId()));
|
||||
$this->_postConfirm->setShop($this->_shopService->getMongoShopByUid($order->getShop()->getId()));
|
||||
$this->_postConfirm->setPosition($position);
|
||||
$this->_postConfirm->setOrder($order);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Queue;
|
||||
|
||||
use DirectoryIterator;
|
||||
@ -58,15 +59,16 @@ class Export implements QueueInterface, ConfigurableElementInterface
|
||||
*/
|
||||
private Manager $_eventManager;
|
||||
|
||||
function __construct(FormFactoryInterface $formFactory,
|
||||
EntityManagerInterface $entityManager,
|
||||
DocumentManager $doctrine_mongodb,
|
||||
Status $statusService,
|
||||
PostPrintJob $postPrintJob,
|
||||
Shop $shopService,
|
||||
Order $orderService,
|
||||
Manager $eventManager)
|
||||
{
|
||||
public function __construct(
|
||||
FormFactoryInterface $formFactory,
|
||||
EntityManagerInterface $entityManager,
|
||||
DocumentManager $doctrine_mongodb,
|
||||
Status $statusService,
|
||||
PostPrintJob $postPrintJob,
|
||||
Shop $shopService,
|
||||
Order $orderService,
|
||||
Manager $eventManager
|
||||
) {
|
||||
$this->_formFactory = $formFactory;
|
||||
$this->_entityManager = $entityManager;
|
||||
$this->_doctrine_mongodb = $doctrine_mongodb;
|
||||
@ -140,7 +142,8 @@ class Export implements QueueInterface, ConfigurableElementInterface
|
||||
* @return bool
|
||||
* @internal param Queue $doc
|
||||
*/
|
||||
public function execute(EventInterface $event, Queue $queue) {
|
||||
public function execute(EventInterface $event, Queue $queue)
|
||||
{
|
||||
|
||||
/** @var \Plugin\Custom\PSC\Saxoprint_API_R1\Document\Export $settings */
|
||||
$settings = $queue->getQueueDocument();
|
||||
@ -153,6 +156,7 @@ class Export implements QueueInterface, ConfigurableElementInterface
|
||||
$order = $this->_orderService->getCurrentOrder();
|
||||
|
||||
$this->_postPrintJob->setShop($this->_shopService->getMongoShopByUid($order->getShop()->getId()));
|
||||
$this->_postPrintJob->setShopEntity($this->_shopService->getShopByUid($order->getShop()->getId()));
|
||||
$this->_postPrintJob->setPosition($position);
|
||||
$this->_postPrintJob->setOrder($order);
|
||||
|
||||
@ -160,7 +164,7 @@ class Export implements QueueInterface, ConfigurableElementInterface
|
||||
if($result && isset($result['Ordernumber'])) {
|
||||
$position->setExternalOrderNumber($result['Ordernumber']);
|
||||
$position->setStatus($settings->getStatusSuccess());
|
||||
}else{
|
||||
} else {
|
||||
$position->setStatus($settings->getStatusError());
|
||||
}
|
||||
$this->_orderService->storeOrder($order);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Plugin\Custom\PSC\Saxoprint_API_R1\Queue;
|
||||
|
||||
use DirectoryIterator;
|
||||
@ -60,15 +61,16 @@ class Upload implements QueueInterface, ConfigurableElementInterface
|
||||
*/
|
||||
private Manager $_eventManager;
|
||||
|
||||
function __construct(FormFactoryInterface $formFactory,
|
||||
EntityManagerInterface $entityManager,
|
||||
DocumentManager $doctrine_mongodb,
|
||||
Status $statusService,
|
||||
PostUpload $postUpload,
|
||||
Shop $shopService,
|
||||
Order $orderService,
|
||||
Manager $eventManager)
|
||||
{
|
||||
public function __construct(
|
||||
FormFactoryInterface $formFactory,
|
||||
EntityManagerInterface $entityManager,
|
||||
DocumentManager $doctrine_mongodb,
|
||||
Status $statusService,
|
||||
PostUpload $postUpload,
|
||||
Shop $shopService,
|
||||
Order $orderService,
|
||||
Manager $eventManager
|
||||
) {
|
||||
$this->_formFactory = $formFactory;
|
||||
$this->_entityManager = $entityManager;
|
||||
$this->_doctrine_mongodb = $doctrine_mongodb;
|
||||
@ -142,7 +144,8 @@ class Upload implements QueueInterface, ConfigurableElementInterface
|
||||
* @return bool
|
||||
* @internal param Queue $doc
|
||||
*/
|
||||
public function execute(EventInterface $event, Queue $queue) {
|
||||
public function execute(EventInterface $event, Queue $queue)
|
||||
{
|
||||
|
||||
/** @var \Plugin\Custom\PSC\Saxoprint_API_R1\Document\Export $settings */
|
||||
$settings = $queue->getQueueDocument();
|
||||
@ -161,17 +164,20 @@ class Upload implements QueueInterface, ConfigurableElementInterface
|
||||
$domains = $this->_entityManager
|
||||
->getRepository(Domain::class)->createQueryBuilder('domain')
|
||||
->andWhere('domain.shop = :shop_id')
|
||||
->setParameter("shop_id",$order->getShop()->getId())->getQuery()->execute();
|
||||
->setParameter("shop_id", $order->getShop()->getId())->getQuery()->execute();
|
||||
|
||||
if (count($domains) > 0) {
|
||||
$domain = array_pop($domains)->getHost();
|
||||
}else{
|
||||
} else {
|
||||
$domain = false;
|
||||
}
|
||||
|
||||
$this->_postUpload->setShopEntity($this->_shopService->getShopByUid($order->getShop()->getId()));
|
||||
$this->_postUpload->setDomain($domain);
|
||||
$this->_postUpload->call();
|
||||
|
||||
$return = $this->_postUpload->call();
|
||||
if(!$return) {
|
||||
return false;
|
||||
}
|
||||
$position->setStatus($settings->getStatusSuccess());
|
||||
|
||||
$this->_orderService->storeOrder($order);
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
|
||||
class market_article
|
||||
{
|
||||
|
||||
public $id = "6";
|
||||
public $articlegroups;
|
||||
public $private;
|
||||
@ -151,7 +150,7 @@ class market_article
|
||||
} elseif(count($upload) == 1 && ($view->view->upload_possible[0] == 'provided' || $view->view->upload_possible[0] == 'center' || $view->view->upload_possible[0] == 'mail' || $view->view->upload_possible[0] == 'post')) {
|
||||
$_POST['upload_mode'] = $view->view->upload_possible[0];
|
||||
$view->getRequest()->setParam('upload_mode', $view->view->upload_possible[0]);
|
||||
}else {
|
||||
} else {
|
||||
$_POST['upload_mode'] = 'none';
|
||||
$view->getRequest()->setParam('upload_mode', 'none');
|
||||
}
|
||||
@ -603,7 +602,10 @@ class market_article
|
||||
->where('c.uuid = ?', array((string)$layouterPreviewId))
|
||||
->fetchOne();
|
||||
$design = json_decode($layoutData->design, true);
|
||||
return '<img src="' . $design['previews'][0]['url'] .'" class="layouter_10" />';
|
||||
if(isset($design['previews'][$site - 1])) {
|
||||
return '<img src="' . $design['previews'][$site - 1] .'" class="layouter_10" />';
|
||||
}
|
||||
return '';
|
||||
} elseif ($articleSess->getLayouterModus() == 101) {
|
||||
$layoutData = Doctrine_Query::create()
|
||||
->from('LayouterDesignData c')
|
||||
|
||||
@ -37,6 +37,9 @@ user.login.elements.password_re.options.validators.1.options = "password"
|
||||
; firstname element
|
||||
user.rech.legend = "Rechnungsadresse"
|
||||
|
||||
user.rech.elements.is_company.type = "checkbox"
|
||||
user.rech.elements.is_company.options.label = "Gewerblich?"
|
||||
|
||||
user.rech.elements.self_anrede.type = "select"
|
||||
user.rech.elements.self_anrede.options.label = "Anrede"
|
||||
user.rech.elements.self_anrede.options.required = false
|
||||
@ -143,4 +146,4 @@ user.submit.elements.submit.options.label = "Jetzt registrieren"
|
||||
user.liefersubmit.elements.submit.type = "submit"
|
||||
user.liefersubmit.elements.submit.options.class = "green"
|
||||
user.liefersubmit.elements.submit.options.name = "st"
|
||||
user.liefersubmit.elements.submit.options.label = "Use Delivery"
|
||||
user.liefersubmit.elements.submit.options.label = "Use Delivery"
|
||||
|
||||
@ -135,18 +135,10 @@ a.editAddress.btn.btn-info.btn-xs {
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<input id="delivery" type="hidden" name="delivery" value="custom" />
|
||||
<input id="delivery" type="hidden" name="delivery" value="<?php echo $this->delivery ?>" />
|
||||
<input id="sender" type="hidden" name="sender" value="<?php echo $this->sender ?>" />
|
||||
<input id="invoice" type="hidden" name="invoice" value="<?php echo $this->invoice ?>" />
|
||||
<input type="text" name="delivery_firstname" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['firstname'] ?>"/>
|
||||
<input type="text" name="delivery_lastname" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['lastname'] ?>"/>
|
||||
<input type="text" name="delivery_street" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['street'] ?>"/>
|
||||
<input type="text" name="delivery_houseNumber" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['houseNumber'] ?>"/>
|
||||
<input type="text" name="delivery_zip" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['zip'] ?>"/>
|
||||
<input type="text" name="delivery_city" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['city'] ?>"/>
|
||||
<input type="text" name="delivery_email" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['email'] ?>"/>
|
||||
<input type="text" name="delivery_company" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['company'] ?>"/>
|
||||
<input type="text" name="delivery_company2" value="<?php echo TP_Basket::getBasket()->getDeliveryAddress()['company2'] ?>"/>
|
||||
|
||||
|
||||
|
||||
<div class="col-xs-12"><input id="review_next" type="submit" value="<?php echo $this->translate('Weiter') ?>" class="btn btn-success btn-lg pull-right" style="margin-right: 15px;" /></div>
|
||||
@ -303,20 +295,20 @@ a.editAddress.btn.btn-info.btn-xs {
|
||||
<div class="row">
|
||||
<?php
|
||||
$this->form->removeElement('submit');
|
||||
EasyBib_Form_Decorator::setFormDecorator($this->form, \EasyBib_Form_Decorator::BOOTSTRAP, 'submit');
|
||||
?>
|
||||
EasyBib_Form_Decorator::setFormDecorator($this->form, \EasyBib_Form_Decorator::BOOTSTRAP, 'submit');
|
||||
?>
|
||||
<form id="register" enctype="application/x-www-form-urlencoded" action="" method="post" role="form" style="padding:0 2em">
|
||||
<div class="col-sm-6">
|
||||
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($this->form->getElements() as $element) : ?>
|
||||
$i = 0;
|
||||
foreach ($this->form->getElements() as $element) : ?>
|
||||
<?php if ($i == 7) : ?></div>
|
||||
<div class="col-sm-6"><?php endif; ?>
|
||||
<?php echo str_replace(array('control-group', 'control-label', 'class="controls"'), array('form-group', 'form-label', 'class="form-controls"'), $element->render()); ?>
|
||||
<?php
|
||||
$i++;
|
||||
endforeach; ?>
|
||||
$i++;
|
||||
endforeach; ?>
|
||||
</div>
|
||||
</form>
|
||||
<br class="clearfix">
|
||||
@ -346,22 +338,22 @@ a.editAddress.btn.btn-info.btn-xs {
|
||||
<div class="row">
|
||||
<?php
|
||||
$this->editform->removeElement('update');
|
||||
EasyBib_Form_Decorator::setFormDecorator($this->editform, \EasyBib_Form_Decorator::BOOTSTRAP, 'update');
|
||||
?>
|
||||
EasyBib_Form_Decorator::setFormDecorator($this->editform, \EasyBib_Form_Decorator::BOOTSTRAP, 'update');
|
||||
?>
|
||||
<input type="hidden" value="" name="editaddressuuid" id="editaddressuuid" />
|
||||
|
||||
<form id="updateaddress" name="updateaddress" enctype="application/x-www-form-urlencoded" class="form-horizontal" action="" method="post" role="form" style="padding:0 2em">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($this->editform->getElements() as $element) : ?>
|
||||
$i = 0;
|
||||
foreach ($this->editform->getElements() as $element) : ?>
|
||||
<?php if ($i == 7) : ?></div>
|
||||
<div class="col-sm-6"><?php endif; ?>
|
||||
<?php echo str_replace(array('control-group', 'control-label', 'class="controls"'), array('form-group', 'form-label', 'class="form-controls"'), $element->render()); ?>
|
||||
<?php
|
||||
$i++;
|
||||
endforeach; ?>
|
||||
$i++;
|
||||
endforeach; ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -3283,7 +3283,9 @@ class BasketController extends TP_Controller_Action
|
||||
}
|
||||
|
||||
$basket->setDeliveryIsSame(true);
|
||||
//$basket->setSender(0);
|
||||
$basket->setDeliveryUstid($this->view->sender_address->ustid);
|
||||
$basket->setDeliveryPLZ($this->view->sender_address->zip);
|
||||
//$basket->setSender(0);
|
||||
$this->redirectSpeak('/basket/finish');
|
||||
} elseif ($this->getRequest()->getParam('delivery') != '' && $this->getRequest()->getParam('delivery') != 's'
|
||||
&& $this->getRequest()->getParam('sender') != '' && $this->getRequest()->getParam('invoice') != ''
|
||||
@ -3293,10 +3295,14 @@ class BasketController extends TP_Controller_Action
|
||||
$basket->setDelivery($this->getRequest()->getParam('delivery'));
|
||||
$basket->setInvoice($this->getRequest()->getParam('invoice'));
|
||||
$basket->setSender($this->getRequest()->getParam('sender'));
|
||||
$basket->setDeliveryUstid($this->view->delivery_address->ustid);
|
||||
$basket->setDeliveryPLZ($this->view->delivery_address->zip);
|
||||
$this->redirectSpeak('/basket/finish');
|
||||
} elseif ($this->getRequest()->getParam('delivery') != '' && $this->getRequest()->getParam('delivery') != 's') {
|
||||
$basket->setDeliveryIsSame(false);
|
||||
$basket->setDelivery($this->getRequest()->getParam('delivery'));
|
||||
$basket->setDeliveryUstid($this->view->delivery_address->ustid);
|
||||
$basket->setDeliveryPLZ($this->view->delivery_address->zip);
|
||||
$this->redirectSpeak('/basket/finish');
|
||||
}
|
||||
|
||||
@ -4549,7 +4555,6 @@ class BasketController extends TP_Controller_Action
|
||||
|
||||
$this->view->gutschein = $gutscheincode;
|
||||
}
|
||||
|
||||
$basket->setWithTax(TP_Country::getTaxForCountry($basket->getDeliveryCountry(), $basket->getDeliveryUstId()));
|
||||
|
||||
$this->view->withTax = $basket->isWithTax();
|
||||
|
||||
@ -3023,7 +3023,10 @@ class UserController extends TP_Controller_Action
|
||||
}
|
||||
|
||||
if ($this->_request->isPost()) {
|
||||
|
||||
if($form->getSubForm('rech')->getElement('is_company')->isChecked()) {
|
||||
$form->get('rech')->get('self_department')->setRequired(true);
|
||||
$form->get('rech')->get('ustid')->setRequired(true);
|
||||
}
|
||||
$externalValidation = true;
|
||||
if($this->shop->getPluginSettings(module: 'friendlycaptcha', name: 'secret')) {
|
||||
$externalValidation = false;
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
class TP_Country {
|
||||
|
||||
public static function getCountrysAsArray() {
|
||||
class TP_Country
|
||||
{
|
||||
public static function getCountrysAsArray(): array
|
||||
{
|
||||
|
||||
$shop = Zend_Registry::get('shop');
|
||||
$statusCollection = TP_Mongo::getInstance()->Country;
|
||||
@ -17,9 +18,9 @@ class TP_Country {
|
||||
|
||||
}
|
||||
|
||||
public static function getTaxForCountry($code, $ustid)
|
||||
public static function getTaxForCountry($code, $ustid): bool
|
||||
{
|
||||
if($code === NULL || $code == '') {
|
||||
if($code === null || $code == '') {
|
||||
return true;
|
||||
}
|
||||
$shop = Zend_Registry::get('shop');
|
||||
@ -27,16 +28,16 @@ class TP_Country {
|
||||
|
||||
$country = $statusCollection->findOne(array('shop' => (string)$shop['id'], 'code' => $code));
|
||||
|
||||
if($country === NULL) {
|
||||
if($country === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if($ustid == NULL || $ustid == "") {
|
||||
if($ustid == null || $ustid == "") {
|
||||
return $country['withTaxWithoutUstNr'];
|
||||
}else{
|
||||
} else {
|
||||
return $country['withTaxWithUstNr'];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ class TP_Image {
|
||||
if($resize == "-resize 0x0") {
|
||||
exec("convert -density 140 '".$image->path."[0]' -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
||||
}else{
|
||||
var_dump("convert -density 140 '".$image->path."[0]' ".$resize." -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
||||
exec("convert -density 140 '".$image->path."[0]' ".$resize." -quality 75 -background white -alpha remove -colorspace sRGB ". PUBLIC_PATH.'/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png');
|
||||
}
|
||||
return '/temp/thumb/'.$shop['uid'].'/'.$image->id.'_'.$mode.'.png';
|
||||
}elseif($finfo == 'image/png') {
|
||||
|
||||
@ -446,7 +446,7 @@ class Zend_Barcode_Renderer_Image extends Zend_Barcode_Renderer_RendererAbstract
|
||||
require_once 'Zend/Barcode/Renderer/Exception.php';
|
||||
throw new Zend_Barcode_Renderer_Exception(
|
||||
'A font was provided, but this instance of PHP does not have TTF (FreeType) support'
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
$box = imagettfbbox($size, 0, $font, $text);
|
||||
|
||||
@ -46,7 +46,7 @@ class Zend_Form_Element_Captcha extends Zend_Form_Element_Xhtml
|
||||
/**
|
||||
* Captcha plugin type constant
|
||||
*/
|
||||
const CAPTCHA = 'CAPTCHA';
|
||||
public const CAPTCHA = 'CAPTCHA';
|
||||
|
||||
/**
|
||||
* Captcha adapter
|
||||
@ -90,7 +90,7 @@ class Zend_Form_Element_Captcha extends Zend_Form_Element_Xhtml
|
||||
|
||||
$name = $this->getPluginLoader(self::CAPTCHA)->load($name);
|
||||
if (empty($options)) {
|
||||
$instance = new $name;
|
||||
$instance = new $name();
|
||||
} else {
|
||||
$r = new ReflectionClass($name);
|
||||
if ($r->hasMethod('__construct')) {
|
||||
@ -234,7 +234,7 @@ class Zend_Form_Element_Captcha extends Zend_Form_Element_Xhtml
|
||||
switch ($type) {
|
||||
case null:
|
||||
$loader = $this->getPluginLoader(self::CAPTCHA);
|
||||
$nsSeparator = (false !== strpos($prefix, '\\'))?'\\':'_';
|
||||
$nsSeparator = (false !== strpos($prefix, '\\')) ? '\\' : '_';
|
||||
$cPrefix = rtrim($prefix, $nsSeparator) . $nsSeparator . 'Captcha';
|
||||
$cPath = rtrim($path, '/\\') . '/Captcha';
|
||||
$loader->addPrefixPath($cPrefix, $cPath);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user