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],
Symfonycasts\TailwindBundle\SymfonycastsTailwindBundle::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')]
protected ?\DateTime $toDate;
#[ORM\Column(name: 'media', type: 'json')]
#[ORM\Column(name: 'media', type: 'json_document', options: ['jsonb' => true])]
public $media = [];
/**
* enable

View File

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

View File

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

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB