Media News§
All checks were successful
Gitea Actions / Run-Tests-On-Arm64 (push) Successful in 5m38s
Gitea Actions / Run-Tests-On-Amd64 (push) Successful in 15m30s

This commit is contained in:
Thomas 2025-03-17 20:20:10 +01:00
parent 3e9aff64ac
commit 0a34cdefb7
6 changed files with 29 additions and 32 deletions

View File

@ -62,4 +62,5 @@ return [
Symfony\UX\Chartjs\ChartjsBundle::class => ['all' => true], Symfony\UX\Chartjs\ChartjsBundle::class => ['all' => true],
Symfonycasts\TailwindBundle\SymfonycastsTailwindBundle::class => ['all' => true], Symfonycasts\TailwindBundle\SymfonycastsTailwindBundle::class => ['all' => true],
Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true], Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true],
Dunglas\DoctrineJsonOdm\Bundle\DunglasDoctrineJsonOdmBundle::class => ['all' => true]
]; ];

View File

@ -87,7 +87,7 @@ class News
#[ORM\Column(name: 'to_date', type: 'datetime')] #[ORM\Column(name: 'to_date', type: 'datetime')]
protected ?\DateTime $toDate; protected ?\DateTime $toDate;
#[ORM\Column(name: 'media', type: 'json')] #[ORM\Column(name: 'media', type: 'json_document', options: ['jsonb' => true])]
public $media = []; public $media = [];
/** /**
* enable * enable

View File

@ -42,7 +42,7 @@ class Base
{ {
$baseUrl = $this->baseUrlLive; $baseUrl = $this->baseUrlLive;
if($this->test) { if ($this->test) {
$baseUrl = $this->baseUrlTest; $baseUrl = $this->baseUrlTest;
} }
@ -63,7 +63,7 @@ class Base
{ {
$baseUrl = $this->baseUrlLive; $baseUrl = $this->baseUrlLive;
if($this->test) { if ($this->test) {
$baseUrl = $this->baseUrlTest; $baseUrl = $this->baseUrlTest;
} }
@ -82,7 +82,7 @@ class Base
{ {
$baseUrl = $this->baseUrlLive; $baseUrl = $this->baseUrlLive;
if($this->test) { if ($this->test) {
$baseUrl = $this->baseUrlTest; $baseUrl = $this->baseUrlTest;
} }
@ -100,7 +100,7 @@ class Base
$apiSecret = $this->apiKey; $apiSecret = $this->apiKey;
$baseUrl = $this->baseUrlUploadLive; $baseUrl = $this->baseUrlUploadLive;
if($this->test) { if ($this->test) {
$baseUrl = $this->baseUrlUploadTest; $baseUrl = $this->baseUrlUploadTest;
} }
$formData = new FormDataPart($data); $formData = new FormDataPart($data);
@ -117,7 +117,7 @@ class Base
public function postUploadLinks($url, $data) public function postUploadLinks($url, $data)
{ {
$baseUrl = $this->baseUrlUploadLive; $baseUrl = $this->baseUrlUploadLive;
if($this->test) { if ($this->test) {
$baseUrl = $this->baseUrlUploadTest; $baseUrl = $this->baseUrlUploadTest;
} }
$response = $this->client->request('POST', $baseUrl . $url, [ $response = $this->client->request('POST', $baseUrl . $url, [
@ -131,7 +131,7 @@ class Base
public function postUploadConfirm($url, $data) public function postUploadConfirm($url, $data)
{ {
$baseUrl = $this->baseUrlUploadLive; $baseUrl = $this->baseUrlUploadLive;
if($this->test) { if ($this->test) {
$baseUrl = $this->baseUrlUploadTest; $baseUrl = $this->baseUrlUploadTest;
} }
$response = $this->client->request('POST', $baseUrl . $url, [ $response = $this->client->request('POST', $baseUrl . $url, [
@ -145,7 +145,7 @@ class Base
public function get($url) public function get($url)
{ {
$baseUrl = $this->baseUrlLive; $baseUrl = $this->baseUrlLive;
if($this->test) { if ($this->test) {
$baseUrl = $this->baseUrlTest; $baseUrl = $this->baseUrlTest;
} }
@ -173,7 +173,6 @@ class Base
$this->buildHeaders() $this->buildHeaders()
, ,
]); ]);
var_dump($response->getContent(true));
$content = $response->toArray(); $content = $response->toArray();
return $content; return $content;
@ -192,7 +191,7 @@ class Base
*/ */
public function setShop(\PSC\Shop\EntityBundle\Document\Shop $shop): void public function setShop(\PSC\Shop\EntityBundle\Document\Shop $shop): void
{ {
if($shop->getPluginSettingModule('saxoprint', 'sriAPIKey')) { if ($shop->getPluginSettingModule('saxoprint', 'sriAPIKey')) {
$this->apiKey = $shop->getPluginSettingModule('saxoprint', 'sriAPIKey'); $this->apiKey = $shop->getPluginSettingModule('saxoprint', 'sriAPIKey');
$this->customerNumber = $shop->getPluginSettingModule('saxoprint', 'customerNumber'); $this->customerNumber = $shop->getPluginSettingModule('saxoprint', 'customerNumber');
$this->test = $shop->getPluginSettingModule('saxoprint', 'useTestSystem'); $this->test = $shop->getPluginSettingModule('saxoprint', 'useTestSystem');

View File

@ -13,19 +13,21 @@ class PutConfig extends Base
public function call() public function call()
{ {
if(!$this->apiKey&& !$this->customerNumber) { if (!$this->apiKey && !$this->customerNumber) {
return []; return [];
} }
$resultLangPropertyValues = $this->getCache()->get( $resultLangPropertyValues = $this->getCache()->get(
'saxoprint_result_lang_property_values', function (ItemInterface $item) { 'saxoprint_result_lang_property_values',
function (ItemInterface $item) {
// $item->expiresAfter(3600); // $item->expiresAfter(3600);
return $this->get('config/' . $this->customerNumber .'/texts/propertyvalue/de-DE'); return $this->get('config/' . $this->customerNumber .'/texts/propertyvalue/de-DE');
} }
); );
$resultLangProperty = $this->getCache()->get( $resultLangProperty = $this->getCache()->get(
'saxoprint_result_lang_property', function (ItemInterface $item) { 'saxoprint_result_lang_property',
function (ItemInterface $item) {
// $item->expiresAfter(3600); // $item->expiresAfter(3600);
return $this->get('config/' . $this->customerNumber . '/texts/property/de-DE'); return $this->get('config/' . $this->customerNumber . '/texts/property/de-DE');
} }
@ -33,22 +35,21 @@ class PutConfig extends Base
$result = $this->put(sprintf("config/%s/%s/configurations", $this->customerNumber, $this->getProductId()), $this->buildData()); $result = $this->put(sprintf("config/%s/%s/configurations", $this->customerNumber, $this->getProductId()), $this->buildData());
var_dump($result);
$tmp = ['property' => [], 'custom' => []]; $tmp = ['property' => [], 'custom' => []];
foreach($result['ValidOptions'] as $key => $value) { foreach ($result['ValidOptions'] as $key => $value) {
$item = [ $item = [
'defaultValue' => $result['ValidConfiguration'][$key]??null, 'defaultValue' => $result['ValidConfiguration'][$key] ?? null,
'type' => 'select', 'type' => 'select',
'values' => [], 'values' => [],
'label' => $resultLangProperty[$key], 'label' => $resultLangProperty[$key],
'id' => $key 'id' => $key
]; ];
foreach($value as $arrValue) { foreach ($value as $arrValue) {
if($arrValue == 0) { if ($arrValue == 0) {
$item['values'][] = ['id' => 0]; $item['values'][] = ['id' => 0];
}else{ } else {
$item['values'][] = ['id' => $arrValue, 'label' => $resultLangPropertyValues[$arrValue]]; $item['values'][] = ['id' => $arrValue, 'label' => $resultLangPropertyValues[$arrValue]];
} }
} }
@ -56,9 +57,9 @@ class PutConfig extends Base
$tmp['property'][] = $item; $tmp['property'][] = $item;
} }
foreach($result['ValidCustomOptions'] as $key => $value) { foreach ($result['ValidCustomOptions'] as $key => $value) {
$item = [ $item = [
'defaultValue' => $result['ValidCustomConfiguration'][$key]??null, 'defaultValue' => $result['ValidCustomConfiguration'][$key] ?? null,
'type' => 'input', 'type' => 'input',
'label' => $resultLangProperty[$key], 'label' => $resultLangProperty[$key],
'id' => $key 'id' => $key
@ -74,19 +75,17 @@ class PutConfig extends Base
{ {
$temp = []; $temp = [];
$tempCustom = []; $tempCustom = [];
foreach($this->config['property'] as $key => $value) foreach ($this->config['property'] as $key => $value) {
{ if ($key == '102' || $key == 'auflage') {
if($key == '102' || $key == 'auflage') {
continue; continue;
} }
if($value != 0) { if ($value != 0) {
$temp[$key] = intval($value); $temp[$key] = intval($value);
} }
} }
if(isset($this->config['custom'])) { if (isset($this->config['custom'])) {
foreach($this->config['custom'] as $key => $value) foreach ($this->config['custom'] as $key => $value) {
{ if ($value != 0) {
if($value != 0) {
$tempCustom[$key] = intval($value); $tempCustom[$key] = intval($value);
} }
} }

View File

@ -126,8 +126,6 @@ class SaxoprintController extends AbstractController
$putConfig->setConfig($reqConfig); $putConfig->setConfig($reqConfig);
$config = $putConfig->call(); $config = $putConfig->call();
} }
var_dump($config);
die();
$getPrices->setShop($shop->getMongoShopByUid($product->getShop()->getUid())); $getPrices->setShop($shop->getMongoShopByUid($product->getShop()->getUid()));
$getPrices->setProductId((int)$request->get('saxoprintProductId')); $getPrices->setProductId((int)$request->get('saxoprintProductId'));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB