Fixes
This commit is contained in:
parent
cba13f9b54
commit
633a042136
@ -2433,7 +2433,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* length?: scalar|Param|null, // Default: 5
|
* length?: scalar|Param|null, // Default: 5
|
||||||
* width?: scalar|Param|null, // Default: 130
|
* width?: scalar|Param|null, // Default: 130
|
||||||
* height?: scalar|Param|null, // Default: 50
|
* height?: scalar|Param|null, // Default: 50
|
||||||
* font?: scalar|Param|null, // Default: "/data/www/new/vendor/gregwar/captcha-bundle/DependencyInjection/../Generator/Font/captcha.ttf"
|
* font?: scalar|Param|null, // Default: "/application/src/new/vendor/gregwar/captcha-bundle/DependencyInjection/../Generator/Font/captcha.ttf"
|
||||||
* keep_value?: scalar|Param|null, // Default: false
|
* keep_value?: scalar|Param|null, // Default: false
|
||||||
* charset?: scalar|Param|null, // Default: "abcdefhjkmnprstuvwxyz23456789"
|
* charset?: scalar|Param|null, // Default: "abcdefhjkmnprstuvwxyz23456789"
|
||||||
* as_file?: scalar|Param|null, // Default: false
|
* as_file?: scalar|Param|null, // Default: false
|
||||||
|
|||||||
@ -3,4 +3,9 @@ PSC\Shop\EntityBundle\Entity\Account:
|
|||||||
title: No Account
|
title: No Account
|
||||||
|
|
||||||
account_2:
|
account_2:
|
||||||
title: Bestes von Hier - Bio BGmbH
|
title: Bestes von Hier - Bio BGmbH
|
||||||
|
|
||||||
|
account_3:
|
||||||
|
title: Admin Account
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ PSC\Shop\EntityBundle\Entity\Contact:
|
|||||||
zip: "17506"
|
zip: "17506"
|
||||||
street: "Musterstraße"
|
street: "Musterstraße"
|
||||||
house_number: "24b"
|
house_number: "24b"
|
||||||
account: '@account_1'
|
account: '@account_3'
|
||||||
|
|
||||||
contact_2:
|
contact_2:
|
||||||
username: test@shop.de
|
username: test@shop.de
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class Xml extends AbstractController
|
|||||||
$engine->calc();
|
$engine->calc();
|
||||||
|
|
||||||
$output = new ContentOutput();
|
$output = new ContentOutput();
|
||||||
$output->json = json_decode($engine->generateJson(), true);
|
$output->json = $engine->generateJson();
|
||||||
$output->xml = $engine->generateXML(true);
|
$output->xml = $engine->generateXML(true);
|
||||||
$output->jsonGraph = json_decode($engine->getCalcGraph()->generateJsonGraph(), true);
|
$output->jsonGraph = json_decode($engine->getCalcGraph()->generateJsonGraph(), true);
|
||||||
|
|
||||||
|
|||||||
@ -14,6 +14,6 @@ class VersionTest extends WebTestCase
|
|||||||
$this->assertResponseIsSuccessful();
|
$this->assertResponseIsSuccessful();
|
||||||
|
|
||||||
$data = json_decode($client->getResponse()->getContent(), true);
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
$this->assertSame('2.3.5', $data['release']);
|
$this->assertSame('2.3.6', $data['release']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,126 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Plugins\Custom\PSC\CollectLayouter\Api;
|
||||||
|
|
||||||
|
use PSC\Shop\ContactBundle\Repository\ContactRepository;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
|
use Tests\RefreshDatabaseTrait;
|
||||||
|
|
||||||
|
class SaveContactTest extends WebTestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabaseTrait;
|
||||||
|
|
||||||
|
private const PRODUCT_UUID = '01938686-0e4d-7da9-bae3-b2e1b1681f9f';
|
||||||
|
|
||||||
|
public function testSaveContactAsLoggedInUser(): void
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
$userRepository = static::getContainer()->get(ContactRepository::class);
|
||||||
|
$testUser = $userRepository->loadUserByUsername('admin@shop.de');
|
||||||
|
$client->loginUser($testUser, 'api');
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'PUT',
|
||||||
|
'/api/plugin/custom/psc/collectlayouter/savecontact/' . self::PRODUCT_UUID,
|
||||||
|
[
|
||||||
|
'data' => [
|
||||||
|
['name' => 'data[firstname][value]', 'value' => 'Max'],
|
||||||
|
['name' => 'data[firstname][enable]', 'value' => '1'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertResponseIsSuccessful();
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
self::assertTrue($data['success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSaveContactWithoutUserStillReturnsSuccess(): void
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'PUT',
|
||||||
|
'/api/plugin/custom/psc/collectlayouter/savecontact/' . self::PRODUCT_UUID,
|
||||||
|
['data' => []],
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertResponseIsSuccessful();
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
self::assertTrue($data['success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSaveCollectForExistingContact(): void
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
$userRepository = static::getContainer()->get(ContactRepository::class);
|
||||||
|
$adminUser = $userRepository->loadUserByUsername('admin@shop.de');
|
||||||
|
$client->loginUser($adminUser, 'api');
|
||||||
|
|
||||||
|
$targetContact = $userRepository->loadUserByUsername('test@shop.de');
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'PUT',
|
||||||
|
'/api/plugin/custom/psc/collectlayouter/savecontactcollect/' . self::PRODUCT_UUID . '/'
|
||||||
|
. $targetContact->getUuid(),
|
||||||
|
[
|
||||||
|
'data' => [
|
||||||
|
['name' => 'data[lastname][value]', 'value' => 'Mustermann'],
|
||||||
|
['name' => 'data[lastname][enable]', 'value' => '1'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertResponseIsSuccessful();
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
self::assertTrue($data['success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSaveNewContact(): void
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'PUT',
|
||||||
|
'/api/plugin/custom/psc/collectlayouter/savenewcontact/' . self::PRODUCT_UUID,
|
||||||
|
[
|
||||||
|
'data' => [
|
||||||
|
['name' => 'data[firstname][value]', 'value' => 'Neuer'],
|
||||||
|
['name' => 'data[firstname][enable]', 'value' => '1'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertResponseIsSuccessful();
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
self::assertTrue($data['success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSaveNewContactWithLogin(): void
|
||||||
|
{
|
||||||
|
$client = static::createClient();
|
||||||
|
$userRepository = static::getContainer()->get(ContactRepository::class);
|
||||||
|
$testUser = $userRepository->loadUserByUsername('admin@shop.de');
|
||||||
|
$client->loginUser($testUser, 'api');
|
||||||
|
|
||||||
|
$client->jsonRequest(
|
||||||
|
'PUT',
|
||||||
|
'/api/plugin/custom/psc/collectlayouter/savenewcontact/' . self::PRODUCT_UUID,
|
||||||
|
[
|
||||||
|
'data' => [
|
||||||
|
['name' => 'data[firstname][value]', 'value' => 'Neuer'],
|
||||||
|
['name' => 'data[firstname][enable]', 'value' => '1'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertResponseIsSuccessful();
|
||||||
|
$data = json_decode($client->getResponse()->getContent(), true);
|
||||||
|
self::assertTrue($data['success']);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,6 +14,7 @@ use PSC\Shop\EntityBundle\Document\Country;
|
|||||||
use PSC\Shop\EntityBundle\Document\Instance;
|
use PSC\Shop\EntityBundle\Document\Instance;
|
||||||
use PSC\Shop\EntityBundle\Document\Order;
|
use PSC\Shop\EntityBundle\Document\Order;
|
||||||
use PSC\Shop\EntityBundle\Document\Position;
|
use PSC\Shop\EntityBundle\Document\Position;
|
||||||
|
use PSC\Shop\EntityBundle\Document\Product;
|
||||||
use PSC\Shop\EntityBundle\Document\Shop;
|
use PSC\Shop\EntityBundle\Document\Shop;
|
||||||
use PSC\Shop\MediaBundle\Document\Folder;
|
use PSC\Shop\MediaBundle\Document\Folder;
|
||||||
use PSC\Shop\MediaBundle\Document\Media;
|
use PSC\Shop\MediaBundle\Document\Media;
|
||||||
@ -79,34 +80,19 @@ trait RefreshDatabaseTrait
|
|||||||
'namespace' => '\\Plugin\\Custom\\PSC\\FormBuilder\\Plugin',
|
'namespace' => '\\Plugin\\Custom\\PSC\\FormBuilder\\Plugin',
|
||||||
'pluginId' => '19ff3fd21de9dbd7452fd0a67c928759',
|
'pluginId' => '19ff3fd21de9dbd7452fd0a67c928759',
|
||||||
]);
|
]);
|
||||||
|
$bulk->insert([
|
||||||
|
'name' => 'Form Based Layouter',
|
||||||
|
'installed' => true,
|
||||||
|
'shouldBeDeInstalled' => false,
|
||||||
|
'shouldBeInstalled' => false,
|
||||||
|
'path' => 'Custom/PSC/CollectLayouter',
|
||||||
|
'namespace' => '\\Plugin\\Custom\\PSC\\CollectLayouter\\Plugin',
|
||||||
|
'pluginId' => '51db3f03e98a9db1de5cf5e19dfe955c',
|
||||||
|
]);
|
||||||
$doc->getClient()->getManager()->executeBulkWrite('psc_test.Plugin', $bulk);
|
$doc->getClient()->getManager()->executeBulkWrite('psc_test.Plugin', $bulk);
|
||||||
|
|
||||||
$doc->getSchemaManager()->dropDocumentCollection(Layout::class);
|
$doc->getSchemaManager()->dropDocumentCollection(Layout::class);
|
||||||
|
|
||||||
if (!$doc->getRepository(Plugin::class)->findOneBy(['pluginId' => '19ff3fd21de9dbd7452fd0a67c928758'])) {
|
|
||||||
$plugin = new Plugin();
|
|
||||||
$plugin->setInstalled(true);
|
|
||||||
$plugin->setPluginId('19ff3fd21de9dbd7452fd0a67c928758');
|
|
||||||
$plugin->setName('XML Kalkulations Produkt');
|
|
||||||
$plugin->setNamespace('\Plugin\System\PSC\XmlCalc\Plugin');
|
|
||||||
$plugin->setPath('System/PSC/XmlCalc');
|
|
||||||
$doc->persist($plugin);
|
|
||||||
$doc->flush();
|
|
||||||
$doc->clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$doc->getRepository(Plugin::class)->findOneBy(['pluginId' => '19ff3fd21de9dbd7452fd0a67c928759'])) {
|
|
||||||
$plugin = new Plugin();
|
|
||||||
$plugin->setInstalled(true);
|
|
||||||
$plugin->setPluginId('19ff3fd21de9dbd7452fd0a67c928759');
|
|
||||||
$plugin->setName('FormBuilder');
|
|
||||||
$plugin->setNamespace('\Plugin\Custom\PSC\FormBuilder\Plugin');
|
|
||||||
$plugin->setPath('Custom/PSC/FormBuilder');
|
|
||||||
$doc->persist($plugin);
|
|
||||||
$doc->flush();
|
|
||||||
$doc->clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
$instance = new Instance();
|
$instance = new Instance();
|
||||||
$instance->setAppId('1');
|
$instance->setAppId('1');
|
||||||
$instance->setInvoiceNumberStart(1);
|
$instance->setInvoiceNumberStart(1);
|
||||||
@ -213,6 +199,20 @@ trait RefreshDatabaseTrait
|
|||||||
$doc->flush();
|
$doc->flush();
|
||||||
$doc->clear();
|
$doc->clear();
|
||||||
|
|
||||||
|
$product = $em->getRepository(\PSC\Shop\EntityBundle\Entity\Product::class)->findOneBy([
|
||||||
|
'uuid' => '01938686-0e4d-7da9-bae3-b2e1b1681f9f',
|
||||||
|
]);
|
||||||
|
|
||||||
|
$productDoc = $doc->getRepository(Product::class)->findOneBy([
|
||||||
|
'uid' => $product->getUid(),
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (!$productDoc) {
|
||||||
|
$productDoc = new Product();
|
||||||
|
$productDoc->setUid($product->getUid());
|
||||||
|
$doc->persist($productDoc);
|
||||||
|
$doc->flush();
|
||||||
|
}
|
||||||
return $kernel;
|
return $kernel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ use OpenApi\Attributes\Response;
|
|||||||
use OpenApi\Attributes\Tag;
|
use OpenApi\Attributes\Tag;
|
||||||
use Plugin\Custom\PSC\CollectLayouter\Dto\SaveContact\Input;
|
use Plugin\Custom\PSC\CollectLayouter\Dto\SaveContact\Input;
|
||||||
use Plugin\Custom\PSC\CollectLayouter\Model\Setting;
|
use Plugin\Custom\PSC\CollectLayouter\Model\Setting;
|
||||||
|
use PSC\Shop\AccountBundle\Model\Account;
|
||||||
use PSC\Shop\ContactBundle\Model\Role;
|
use PSC\Shop\ContactBundle\Model\Role;
|
||||||
use PSC\Shop\ContactBundle\Transformer\Model\Contact;
|
use PSC\Shop\ContactBundle\Transformer\Model\Contact;
|
||||||
use PSC\Shop\EntityBundle\Entity\Contact as PSCContact;
|
use PSC\Shop\EntityBundle\Entity\Contact as PSCContact;
|
||||||
@ -124,12 +125,17 @@ class SaveContact extends AbstractController
|
|||||||
$contact->setLocked(false);
|
$contact->setLocked(false);
|
||||||
$contact->addRole(new Role(id: 1));
|
$contact->addRole(new Role(id: 1));
|
||||||
$contact->addRole(new Role(id: 5));
|
$contact->addRole(new Role(id: 5));
|
||||||
|
if ($user = $this->getUser()) {
|
||||||
|
$account = new Account();
|
||||||
|
$account->setUid($this->getUser()->getAccount()->getUid());
|
||||||
|
$contact->setAccount($account);
|
||||||
|
}
|
||||||
|
|
||||||
$this->saveContactHelper->setSetting($setting);
|
$this->saveContactHelper->setSetting($setting);
|
||||||
$this->saveContactHelper->setContact($contact);
|
$this->saveContactHelper->setContact($contact);
|
||||||
$this->saveContactHelper->setData($data);
|
$this->saveContactHelper->setData($data);
|
||||||
$this->saveContactHelper->saveData();
|
$this->saveContactHelper->saveData();
|
||||||
|
|
||||||
return $this->json(['success' => true]);
|
return $this->json(['success' => true, 'account' => $contact->getAccount()->getUid()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
info:
|
info:
|
||||||
datum: 20.04.2026
|
datum: 24.04.2026
|
||||||
release: 2.3.6
|
release: 2.3.6
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
- version: 2.3.6
|
- version: 2.3.6
|
||||||
datum: 20.04.2026
|
datum: 24.04.2026
|
||||||
changes:
|
changes:
|
||||||
|
- "Form Based Layouter speichert jetzt die Firma vom angemeldeten Benutzer"
|
||||||
- "Kalk kann jetzt mit $Vxxx_staffel_value$V umgehen. Mit staffelCalc=\"$Vauflage$V\" kann in der Option die Grundlage der Staffel aus der Papierdatenbank übergeben werden."
|
- "Kalk kann jetzt mit $Vxxx_staffel_value$V umgehen. Mit staffelCalc=\"$Vauflage$V\" kann in der Option die Grundlage der Staffel aus der Papierdatenbank übergeben werden."
|
||||||
- "Papierdatenbank Kommawerte"
|
- "Papierdatenbank Kommawerte"
|
||||||
- version: 2.3.5
|
- version: 2.3.5
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user