diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/Base.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/Base.php
index c1a95d841..4b04af113 100755
--- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/Base.php
+++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/Base.php
@@ -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));
}
-}
\ No newline at end of file
+}
diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PostPrintJob.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PostPrintJob.php
index 94d6923c3..cee1daa69 100755
--- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PostPrintJob.php
+++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PostPrintJob.php
@@ -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',
]
]],
diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PostUpload.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PostUpload.php
index 00b11ab65..c3f06b142 100755
--- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PostUpload.php
+++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Api/PostUpload.php
@@ -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)
diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Confirm.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Confirm.php
index bb5b514d7..7c30947e6 100755
--- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Confirm.php
+++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Confirm.php
@@ -1,4 +1,5 @@
_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);
diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Export.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Export.php
index 49b66d77b..29ed31464 100755
--- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Export.php
+++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Export.php
@@ -1,4 +1,5 @@
_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);
diff --git a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Upload.php b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Upload.php
index d44093354..1717e5461 100755
--- a/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Upload.php
+++ b/src/new/var/plugins/Custom/PSC/Saxoprint_API_R1/Queue/Upload.php
@@ -1,4 +1,5 @@
_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);
diff --git a/src/old/application/articles/Market/Article.php b/src/old/application/articles/Market/Article.php
index 05228342c..0266a559b 100755
--- a/src/old/application/articles/Market/Article.php
+++ b/src/old/application/articles/Market/Article.php
@@ -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 '';
+ if(isset($design['previews'][$site - 1])) {
+ return '
';
+ }
+ return '';
} elseif ($articleSess->getLayouterModus() == 101) {
$layoutData = Doctrine_Query::create()
->from('LayouterDesignData c')
diff --git a/src/old/application/design/vorlagen/bootstrap4_api/config/user/registercontact.ini b/src/old/application/design/vorlagen/bootstrap4_api/config/user/registercontact.ini
index e650a3e3f..9159d9c0e 100755
--- a/src/old/application/design/vorlagen/bootstrap4_api/config/user/registercontact.ini
+++ b/src/old/application/design/vorlagen/bootstrap4_api/config/user/registercontact.ini
@@ -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"
\ No newline at end of file
+user.liefersubmit.elements.submit.options.label = "Use Delivery"
diff --git a/src/old/application/design/vorlagen/bootstrap4_api/templates/basket/review.phtml b/src/old/application/design/vorlagen/bootstrap4_api/templates/basket/review.phtml
index 735e45fe9..be045b364 100755
--- a/src/old/application/design/vorlagen/bootstrap4_api/templates/basket/review.phtml
+++ b/src/old/application/design/vorlagen/bootstrap4_api/templates/basket/review.phtml
@@ -135,18 +135,10 @@ a.editAddress.btn.btn-info.btn-xs {
-
+
-
-
-
-
-
-
-
-
-
+