Fixes
This commit is contained in:
parent
633a042136
commit
e7d3afbf24
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if a cache clear was requested via flag file
|
||||
if [ -f /tmp/psc_clear_cache ]; then
|
||||
rm -f /tmp/psc_clear_cache
|
||||
if [ -f /data/www/new/watch/psc_clear_cache ]; then
|
||||
rm -f /data/www/new/watch/psc_clear_cache
|
||||
/usr/local/bin/php /data/www/new/bin/clear-cache.php 2>&1
|
||||
fi
|
||||
|
||||
|
||||
@ -476,7 +476,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* datetime?: array{
|
||||
* default_format?: scalar|Param|null, // Default: "Y-m-d\\TH:i:sP"
|
||||
* default_deserialization_formats?: list<scalar|Param|null>,
|
||||
* default_timezone?: scalar|Param|null, // Default: "UTC"
|
||||
* default_timezone?: scalar|Param|null, // Default: "Europe/Berlin"
|
||||
* cdata?: scalar|Param|null, // Default: true
|
||||
* },
|
||||
* array_collection?: array{
|
||||
@ -576,7 +576,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* datetime?: array{
|
||||
* default_format?: scalar|Param|null, // Default: "Y-m-d\\TH:i:sP"
|
||||
* default_deserialization_formats?: list<scalar|Param|null>,
|
||||
* default_timezone?: scalar|Param|null, // Default: "UTC"
|
||||
* default_timezone?: scalar|Param|null, // Default: "Europe/Berlin"
|
||||
* cdata?: scalar|Param|null, // Default: true
|
||||
* },
|
||||
* array_collection?: array{
|
||||
@ -2433,7 +2433,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* length?: scalar|Param|null, // Default: 5
|
||||
* width?: scalar|Param|null, // Default: 130
|
||||
* height?: scalar|Param|null, // Default: 50
|
||||
* font?: scalar|Param|null, // Default: "/application/src/new/vendor/gregwar/captcha-bundle/DependencyInjection/../Generator/Font/captcha.ttf"
|
||||
* font?: scalar|Param|null, // Default: "/data/www/new/vendor/gregwar/captcha-bundle/DependencyInjection/../Generator/Font/captcha.ttf"
|
||||
* keep_value?: scalar|Param|null, // Default: false
|
||||
* charset?: scalar|Param|null, // Default: "abcdefhjkmnprstuvwxyz23456789"
|
||||
* as_file?: scalar|Param|null, // Default: false
|
||||
|
||||
@ -27,15 +27,15 @@ use PSC\Shop\ProductBundle\Form\Backend\Xml\EditType;
|
||||
use PSC\Shop\ProductBundle\PSCShopProductBundle;
|
||||
use PSC\System\SettingsBundle\Document\LogEntry;
|
||||
use PSC\System\SettingsBundle\Service\Log;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Security\Core\SecurityContext;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Core\SecurityContext;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
/**
|
||||
* XmlController für Produkte
|
||||
@ -49,43 +49,52 @@ class TemplateprintController extends AbstractController
|
||||
* @var Log
|
||||
*/
|
||||
private Log $logService;
|
||||
|
||||
public function __construct(Log $logService)
|
||||
{
|
||||
$this->logService = $logService;
|
||||
}
|
||||
/**
|
||||
* delete
|
||||
*
|
||||
* @template()
|
||||
*
|
||||
* @param Request $request Request
|
||||
* @param \PSC\System\SettingsBundle\Service\Shop $shopService
|
||||
* @param EntityManagerInterface $entityManager
|
||||
* @param string $uuid Uuid
|
||||
*
|
||||
* @return array|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
|
||||
#[Template('@PSCShopProduct/backend/product/templateprint/delete.html.twig')]
|
||||
#[Route(path: '/templateprint/delete/{uuid}', name: 'backend_production_product_templateprint_delete')]
|
||||
public function deleteAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, $dirTemplateprint, $uuid)
|
||||
{
|
||||
public function deleteAction(
|
||||
Request $request,
|
||||
\PSC\System\SettingsBundle\Service\Shop $shopService,
|
||||
EntityManagerInterface $entityManager,
|
||||
$dirTemplateprint,
|
||||
$uuid,
|
||||
) {
|
||||
$selectedShop = $shopService->getSelectedShop();
|
||||
$product = $entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('uuid' => $uuid, 'shop' => $selectedShop));
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->findOneBy(array('uuid' => $uuid, 'shop' => $selectedShop));
|
||||
$form = $this->createForm(DeleteType::class, $product);
|
||||
$form->handleRequest($request);
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
if ($form->getClickedButton()->getName() == 'yes') {
|
||||
if (file_exists($dirTemplateprint . 'orginal/' . $product->getTemplatePrintDirectory() . '/product.zip')) {
|
||||
if (file_exists(
|
||||
$dirTemplateprint . 'orginal/' . $product->getTemplatePrintDirectory() . '/product.zip',
|
||||
)) {
|
||||
unlink($dirTemplateprint . 'orginal/' . $product->getTemplatePrintDirectory() . '/product.zip');
|
||||
}
|
||||
if (file_exists($dirTemplateprint . 'orginal/' . $product->getTemplatePrintDirectory() . '/final.pdf')) {
|
||||
if (file_exists(
|
||||
$dirTemplateprint . 'orginal/' . $product->getTemplatePrintDirectory() . '/final.pdf',
|
||||
)) {
|
||||
unlink($dirTemplateprint . 'orginal/' . $product->getTemplatePrintDirectory() . '/final.pdf');
|
||||
}
|
||||
if (file_exists($dirTemplateprint . 'orginal/' . $product->getTemplatePrintDirectory() . '/preview.pdf')) {
|
||||
if (file_exists(
|
||||
$dirTemplateprint . 'orginal/' . $product->getTemplatePrintDirectory() . '/preview.pdf',
|
||||
)) {
|
||||
unlink($dirTemplateprint . 'orginal/' . $product->getTemplatePrintDirectory() . '/preview.pdf');
|
||||
}
|
||||
$this->logService->createLogEntry($selectedShop, $this->getUser(), LogEntry::INFO, PSCShopProductBundle::class, $product->getTitle(), "Templateprint File deleted");
|
||||
$this->logService->createLogEntry(
|
||||
$selectedShop,
|
||||
$this->getUser(),
|
||||
LogEntry::INFO,
|
||||
PSCShopProductBundle::class,
|
||||
$product->getTitle(),
|
||||
'Templateprint File deleted',
|
||||
);
|
||||
return $this->redirectToRoute('backend_production_product_edit', ['uuid' => $uuid]);
|
||||
}
|
||||
return $this->redirectToRoute('backend_production_product_edit', ['uuid' => $uuid]);
|
||||
@ -93,29 +102,22 @@ class TemplateprintController extends AbstractController
|
||||
|
||||
return array(
|
||||
'form' => $form->createView(),
|
||||
'product' => $product
|
||||
'product' => $product,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* upload
|
||||
*
|
||||
* @template()
|
||||
*
|
||||
* @param Request $request Request
|
||||
* @param \PSC\System\SettingsBundle\Service\Shop $shopService
|
||||
* @param EntityManagerInterface $entityManager
|
||||
* @param string $uuid Uuid
|
||||
*
|
||||
* @return array|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Template('@PSCShopProduct/backend/product/templateprint/upload.html.twig')]
|
||||
#[Route(path: '/templateprint/upload/{uuid}', name: 'backend_production_product_templateprint_upload')]
|
||||
public function uploadAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, $uuid)
|
||||
{
|
||||
public function uploadAction(
|
||||
Request $request,
|
||||
\PSC\System\SettingsBundle\Service\Shop $shopService,
|
||||
EntityManagerInterface $entityManager,
|
||||
$uuid,
|
||||
) {
|
||||
$selectedShop = $shopService->getSelectedShop();
|
||||
$product = $entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('uuid' => $uuid, 'shop' => $selectedShop));
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->findOneBy(array('uuid' => $uuid, 'shop' => $selectedShop));
|
||||
$form = $this->createForm(TemplateprintUploadType::class, null);
|
||||
$form->handleRequest($request);
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
@ -129,36 +131,36 @@ class TemplateprintController extends AbstractController
|
||||
$product->setTemplatePrintDirectory(implode('/', $path) . '/');
|
||||
$entityManager->persist($product);
|
||||
$entityManager->flush();
|
||||
$this->logService->createLogEntry($selectedShop, $this->getUser(), LogEntry::INFO, PSCShopProductBundle::class, $product->getTitle(), "Templateprint File uploaded");
|
||||
$this->logService->createLogEntry(
|
||||
$selectedShop,
|
||||
$this->getUser(),
|
||||
LogEntry::INFO,
|
||||
PSCShopProductBundle::class,
|
||||
$product->getTitle(),
|
||||
'Templateprint File uploaded',
|
||||
);
|
||||
$file->move('/data/www/old/market/templateprint/orginal/' . implode('/', $path), 'product.zip');
|
||||
return $this->redirectToRoute('backend_production_product_edit', ['uuid' => $uuid]);
|
||||
}
|
||||
|
||||
return array(
|
||||
'form' => $form->createView(),
|
||||
'product' => $product
|
||||
'product' => $product,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* download
|
||||
*
|
||||
*
|
||||
* @param Request $request Request
|
||||
* @param \PSC\System\SettingsBundle\Service\Shop $shopService
|
||||
* @param EntityManagerInterface $entityManager
|
||||
* @param string $uuid Uuid
|
||||
*
|
||||
* @return Response
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Route(path: '/templateprint/download/{uuid}', name: 'backend_production_product_templateprint_download')]
|
||||
public function downloadAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager, $uuid)
|
||||
{
|
||||
public function downloadAction(
|
||||
Request $request,
|
||||
\PSC\System\SettingsBundle\Service\Shop $shopService,
|
||||
EntityManagerInterface $entityManager,
|
||||
$uuid,
|
||||
) {
|
||||
$selectedShop = $shopService->getSelectedShop();
|
||||
/** @var Product $product */
|
||||
$product = $entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('uuid' => $uuid, 'shop' => $selectedShop));
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->findOneBy(array('uuid' => $uuid, 'shop' => $selectedShop));
|
||||
$path = str_split($product->getUID());
|
||||
$zipName = '/data/www/old/market/templateprint/orginal/' . implode('/', $path) . '/product.zip';
|
||||
$response = new Response(file_get_contents($zipName));
|
||||
|
||||
@ -100,12 +100,12 @@ class DoEveryMinuteCommand extends Command
|
||||
$queue->execute();
|
||||
}
|
||||
|
||||
$queues = $this->mongoDb->getRepository('PSC\Shop\EntityBundle\Document\Queue')->findBy(
|
||||
['eventType' => 'system_plugin_every_run', 'active' => true],
|
||||
[
|
||||
$queues = $this->mongoDb->getRepository('PSC\Shop\EntityBundle\Document\Queue')->findBy([
|
||||
'eventType' => 'system_plugin_every_run',
|
||||
'active' => true,
|
||||
], [
|
||||
'pos' => 'ASC',
|
||||
],
|
||||
);
|
||||
]);
|
||||
|
||||
/**
|
||||
* @var Queue $queue
|
||||
@ -135,8 +135,6 @@ class DoEveryMinuteCommand extends Command
|
||||
$event = $this->eventRegistry->get($job->getEvent());
|
||||
|
||||
if ($event instanceof ClearCache) {
|
||||
$fs = new Filesystem();
|
||||
$fs->dumpFile('/tmp/psc_clear_cache', '1');
|
||||
} elseif ($event instanceof InstallPlugin) {
|
||||
$event->setData($job->getData());
|
||||
$event->setShop($job->getShop());
|
||||
@ -169,16 +167,13 @@ class DoEveryMinuteCommand extends Command
|
||||
$event->setData($job->getData());
|
||||
$event->setShop($job->getShop());
|
||||
|
||||
$queues = $this->mongoDb->getRepository(Queue::class)->findBy(
|
||||
[
|
||||
$queues = $this->mongoDb->getRepository(Queue::class)->findBy([
|
||||
'shop' => $job->getShop(),
|
||||
'active' => true,
|
||||
'eventType' => $job->getEvent(),
|
||||
],
|
||||
[
|
||||
], [
|
||||
'pos' => 'ASC',
|
||||
],
|
||||
);
|
||||
]);
|
||||
|
||||
/**
|
||||
* @var Queue $queue
|
||||
|
||||
@ -400,18 +400,8 @@ class Mail implements QueueInterface, ConfigurableElementInterface
|
||||
try {
|
||||
$message = new TemplatedEmail()
|
||||
->subject($subject->render($params))
|
||||
->from(
|
||||
new Address(
|
||||
$from->render($templateVars->getTwigVars()),
|
||||
$fromName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
)
|
||||
->to(
|
||||
new Address(
|
||||
$to->render($templateVars->getTwigVars()),
|
||||
$toName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
);
|
||||
->from(new Address($from->render($params), $fromName->render($params)))
|
||||
->to(new Address($to->render($params), $toName->render($params)));
|
||||
if ($text) {
|
||||
$message->text($text->render($params));
|
||||
}
|
||||
@ -492,18 +482,8 @@ class Mail implements QueueInterface, ConfigurableElementInterface
|
||||
try {
|
||||
$message = new TemplatedEmail()
|
||||
->subject($subject->render($params))
|
||||
->from(
|
||||
new Address(
|
||||
$from->render($templateVars->getTwigVars()),
|
||||
$fromName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
)
|
||||
->to(
|
||||
new Address(
|
||||
$to->render($templateVars->getTwigVars()),
|
||||
$toName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
);
|
||||
->from(new Address($from->render($params), $fromName->render($params)))
|
||||
->to(new Address($to->render($params), $toName->render($params)));
|
||||
if ($text) {
|
||||
$message->text($text->render($params));
|
||||
}
|
||||
@ -577,18 +557,8 @@ class Mail implements QueueInterface, ConfigurableElementInterface
|
||||
try {
|
||||
$message = new TemplatedEmail()
|
||||
->subject($subject->render($params))
|
||||
->from(
|
||||
new Address(
|
||||
$from->render($templateVars->getTwigVars()),
|
||||
$fromName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
)
|
||||
->to(
|
||||
new Address(
|
||||
$to->render($templateVars->getTwigVars()),
|
||||
$toName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
);
|
||||
->from(new Address($from->render($params), $fromName->render($params)))
|
||||
->to(new Address($to->render($params), $toName->render($params)));
|
||||
if ($text) {
|
||||
$message->text($text->render($params));
|
||||
}
|
||||
@ -664,18 +634,8 @@ class Mail implements QueueInterface, ConfigurableElementInterface
|
||||
try {
|
||||
$message = new TemplatedEmail()
|
||||
->subject($subject->render($params))
|
||||
->from(
|
||||
new Address(
|
||||
$from->render($templateVars->getTwigVars()),
|
||||
$fromName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
)
|
||||
->to(
|
||||
new Address(
|
||||
$to->render($templateVars->getTwigVars()),
|
||||
$toName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
);
|
||||
->from(new Address($from->render($params), $fromName->render($params)))
|
||||
->to(new Address($to->render($params), $toName->render($params)));
|
||||
if ($text) {
|
||||
$message->text($text->render($params));
|
||||
}
|
||||
@ -748,18 +708,8 @@ class Mail implements QueueInterface, ConfigurableElementInterface
|
||||
try {
|
||||
$message = new TemplatedEmail()
|
||||
->subject($subject->render($params))
|
||||
->from(
|
||||
new Address(
|
||||
$from->render($templateVars->getTwigVars()),
|
||||
$fromName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
)
|
||||
->to(
|
||||
new Address(
|
||||
$to->render($templateVars->getTwigVars()),
|
||||
$toName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
);
|
||||
->from(new Address($from->render($params), $fromName->render($params)))
|
||||
->to(new Address($to->render($params), $toName->render($params)));
|
||||
if ($text) {
|
||||
$message->text($text->render($params));
|
||||
}
|
||||
@ -1125,18 +1075,8 @@ class Mail implements QueueInterface, ConfigurableElementInterface
|
||||
try {
|
||||
$message = new Email()
|
||||
->subject($subject->render($params))
|
||||
->from(
|
||||
new Address(
|
||||
$from->render($templateVars->getTwigVars()),
|
||||
$fromName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
)
|
||||
->to(
|
||||
new Address(
|
||||
$to->render($templateVars->getTwigVars()),
|
||||
$toName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
);
|
||||
->from(new Address($from->render($params), $fromName->render($params)))
|
||||
->to(new Address($to->render($params), $toName->render($params)));
|
||||
if ($text) {
|
||||
$message->text($text->render($params));
|
||||
}
|
||||
@ -1203,18 +1143,8 @@ class Mail implements QueueInterface, ConfigurableElementInterface
|
||||
try {
|
||||
$message = new Email()
|
||||
->subject($subject->render($params))
|
||||
->from(
|
||||
new Address(
|
||||
$from->render($templateVars->getTwigVars()),
|
||||
$fromName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
)
|
||||
->to(
|
||||
new Address(
|
||||
$to->render($templateVars->getTwigVars()),
|
||||
$toName->render($templateVars->getTwigVars()),
|
||||
),
|
||||
);
|
||||
->from(new Address($from->render($params), $fromName->render($params)))
|
||||
->to(new Address($to->render($params), $toName->render($params)));
|
||||
if ($text) {
|
||||
$message->text($text->render($params));
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
namespace PSC\System\PluginBundle\Controller\Backend;
|
||||
|
||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||
use Jungi\Bundle\EnvironmentBundle\Theme\Tag as LocalTag;
|
||||
use PSC\Shop\EntityBundle\Entity\Motiv;
|
||||
use PSC\Shop\QueueBundle\Event\EventManager;
|
||||
use PSC\System\PluginBundle\Document\Plugin;
|
||||
@ -21,6 +22,7 @@ use PSC\System\PluginBundle\Event\ClearCache;
|
||||
use PSC\System\PluginBundle\Event\InstallPlugin;
|
||||
use PSC\System\PluginBundle\Service\Manager;
|
||||
use PSC\System\SettingsBundle\Service\Assets;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
@ -28,12 +30,10 @@ use Symfony\Component\Finder\Finder;
|
||||
use Symfony\Component\Finder\SplFileInfo;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Jungi\Bundle\EnvironmentBundle\Theme\Tag as LocalTag;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
@ -53,9 +53,11 @@ class ListController extends AbstractController
|
||||
*/
|
||||
#[Route(path: '/cache/clear', name: 'psc_system_plugin_backend_clear_cache')]
|
||||
#[Template('@PSCSystemPlugin/backend/list/clearcache.html.twig')]
|
||||
public function clearcacheAction(Assets $assetsService, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManager, KernelInterface $kernel)
|
||||
{
|
||||
|
||||
public function clearcacheAction(
|
||||
Assets $assetsService,
|
||||
\PSC\Shop\QueueBundle\Service\Event\Manager $eventManager,
|
||||
KernelInterface $kernel,
|
||||
) {
|
||||
$assetsService->install();
|
||||
|
||||
// Cache atomar über externes Script leeren (ohne laufende Prozesse zu stören)
|
||||
@ -63,10 +65,8 @@ class ListController extends AbstractController
|
||||
$command = sprintf('%s %s 2>&1 &', PHP_BINARY, escapeshellarg($script));
|
||||
exec($command);
|
||||
|
||||
// Cron-Container benachrichtigen
|
||||
$notify = new ClearCache();
|
||||
$notify->setShop(null);
|
||||
$eventManager->addJob($notify);
|
||||
$fs = new Filesystem();
|
||||
$fs->dumpFile('/data/www/new/watch/psc_clear_cache', '1');
|
||||
|
||||
header('location: /apps/backend/plugin/list');
|
||||
die();
|
||||
@ -86,16 +86,11 @@ class ListController extends AbstractController
|
||||
#[Template('@PSCSystemPlugin/backend/list/index.html.twig')]
|
||||
public function indexAction(Request $request, DocumentManager $documentManager, KernelInterface $kernel)
|
||||
{
|
||||
|
||||
$version = Yaml::parse(file_get_contents($kernel->getProjectDir() . '/version.yaml'));
|
||||
$plugins = array();
|
||||
$finder = new Finder();
|
||||
$files = $finder
|
||||
->directories()->depth('== 2')
|
||||
->in($kernel->getProjectDir() . '/var/plugins/');
|
||||
$plugObjs = $documentManager
|
||||
->getRepository('PSC\System\PluginBundle\Document\Plugin')
|
||||
->findAll();
|
||||
$files = $finder->directories()->depth('== 2')->in($kernel->getProjectDir() . '/var/plugins/');
|
||||
$plugObjs = $documentManager->getRepository('PSC\System\PluginBundle\Document\Plugin')->findAll();
|
||||
$plugKeys = array();
|
||||
/** @var Plugin $plugObj */
|
||||
foreach ($plugObjs as $plugObj) {
|
||||
@ -145,12 +140,10 @@ class ListController extends AbstractController
|
||||
->removeByPluginId($key);
|
||||
}
|
||||
|
||||
$plugins = $documentManager
|
||||
->getRepository('PSC\System\PluginBundle\Document\Plugin')
|
||||
->findAll();
|
||||
$plugins = $documentManager->getRepository('PSC\System\PluginBundle\Document\Plugin')->findAll();
|
||||
return array(
|
||||
'plugins' => $plugins,
|
||||
'version' => $version['info']
|
||||
'version' => $version['info'],
|
||||
);
|
||||
}
|
||||
|
||||
@ -169,13 +162,14 @@ class ListController extends AbstractController
|
||||
#[Route(path: '/list/disable/{uuid}', name: 'psc_system_plugin_backend_list_disable')]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
#[Template('@PSCSystemPlugin/backend/list/disable.html.twig')]
|
||||
public function disableAction(Request $request, DocumentManager $documentManager, Manager $pluginManager, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManager, $uuid)
|
||||
{
|
||||
|
||||
|
||||
$qb = $documentManager
|
||||
->getRepository(Plugin::class)
|
||||
->findOneBy(array('id' => (string)$uuid));
|
||||
public function disableAction(
|
||||
Request $request,
|
||||
DocumentManager $documentManager,
|
||||
Manager $pluginManager,
|
||||
\PSC\Shop\QueueBundle\Service\Event\Manager $eventManager,
|
||||
$uuid,
|
||||
) {
|
||||
$qb = $documentManager->getRepository(Plugin::class)->findOneBy(array('id' => (string) $uuid));
|
||||
$qb->setShouldBeDeInstalled(true);
|
||||
$qb = $pluginManager->uninstall($qb);
|
||||
$documentManager->persist($qb);
|
||||
@ -201,11 +195,14 @@ class ListController extends AbstractController
|
||||
#[Route(path: '/list/enable/{uuid}', name: 'psc_system_plugin_backend_list_enable')]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
#[Template('@PSCSystemPlugin/backend/list/enable.html.twig')]
|
||||
public function enableAction(Request $request, DocumentManager $documentManager, Manager $pluginManager, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManager, $uuid)
|
||||
{
|
||||
$qb = $documentManager
|
||||
->getRepository(Plugin::class)
|
||||
->findOneBy(array('id' => (string)$uuid));
|
||||
public function enableAction(
|
||||
Request $request,
|
||||
DocumentManager $documentManager,
|
||||
Manager $pluginManager,
|
||||
\PSC\Shop\QueueBundle\Service\Event\Manager $eventManager,
|
||||
$uuid,
|
||||
) {
|
||||
$qb = $documentManager->getRepository(Plugin::class)->findOneBy(array('id' => (string) $uuid));
|
||||
$qb->setInstalled(true);
|
||||
$qb->setShouldBeInstalled(true);
|
||||
$qb = $pluginManager->install($qb);
|
||||
|
||||
@ -0,0 +1,230 @@
|
||||
<?php
|
||||
|
||||
namespace Plugin\Custom\Ahrweiler\Harry\Controller\Backend;
|
||||
|
||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Plugin\Custom\Ahrweiler\Harry\Form\UploadType;
|
||||
use PSC\Shop\ContactBundle\Repository\AddressRepository;
|
||||
use PSC\Shop\ContactBundle\Repository\ContactRepository;
|
||||
use PSC\Shop\EntityBundle\Entity\Contact;
|
||||
use PSC\Shop\EntityBundle\Entity\ContactAddress;
|
||||
use PSC\Shop\EntityBundle\Repository\ContactAddressRepository;
|
||||
use PSC\Shop\ShippingBundle\Form\Backend\DeleteType;
|
||||
use PSC\System\PluginBundle\Form\Chain\Field;
|
||||
use PSC\System\SettingsBundle\Document\LogEntry;
|
||||
use PSC\System\SettingsBundle\Service\Log;
|
||||
use Role;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class StartController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ContactRepository $contactRepository,
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly AddressRepository $contactAddressRepository,
|
||||
private readonly DocumentManager $documentManager,
|
||||
) {}
|
||||
|
||||
#[Template('@PluginCustomAhrweilerHarry/backend/start/start.html.twig')]
|
||||
#[Route('/start', name: 'plugin_custom_ahrweiler_harry_importer_start')]
|
||||
public function start(
|
||||
Request $request,
|
||||
\PSC\System\SettingsBundle\Service\Shop $shopService,
|
||||
DocumentManager $documentManager,
|
||||
EntityManagerInterface $entityManager,
|
||||
Field $fieldService,
|
||||
SessionInterface $session,
|
||||
Log $logService,
|
||||
) {
|
||||
$selectedShop = $shopService->getSelectedShop();
|
||||
$data = [];
|
||||
$form = $this->createForm(UploadType::class, $data);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$data = $form->getData();
|
||||
|
||||
/** @var Role $shop */
|
||||
$role = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Role')
|
||||
->findOneBy(['level' => 10]);
|
||||
|
||||
/** @var UploadedFile $file */
|
||||
$file = $data['file'];
|
||||
$import_start_row = $data['import_start_row'];
|
||||
$import_stop_row = $data['import_stop_row'];
|
||||
$testAgainstFormats = [
|
||||
\PhpOffice\PhpSpreadsheet\IOFactory::READER_XLS,
|
||||
\PhpOffice\PhpSpreadsheet\IOFactory::READER_XLSX,
|
||||
];
|
||||
|
||||
/** Load $inputFileName to a Spreadsheet Object **/
|
||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($file->getRealPath(), 0, $testAgainstFormats);
|
||||
$workSheet = $spreadsheet->getSheet(0);
|
||||
foreach ($workSheet->getRowIterator($import_start_row, $import_stop_row) as $row) {
|
||||
if ($workSheet->getCell([2, $row->getRowIndex()])->getValue() == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$contactEntity = $this->contactRepository->getContactByEmailAndShop(
|
||||
$workSheet->getCell([16, $row->getRowIndex()])->getValue(),
|
||||
$selectedShop->getId(),
|
||||
);
|
||||
if (!$contactEntity) {
|
||||
$contactEntity = new Contact();
|
||||
$contactDoc = new \PSC\Shop\EntityBundle\Document\Contact();
|
||||
$contactInvoiceAddress = new ContactAddress();
|
||||
$contactDeliveryAddress = new ContactAddress();
|
||||
} else {
|
||||
$contactEntity = $contactEntity->getContact();
|
||||
$contactInvoiceAddress = $this->contactAddressRepository->findOneBy([
|
||||
'contact' => $contactEntity,
|
||||
'type' => 1,
|
||||
]);
|
||||
$contactDeliveryAddress = $this->contactAddressRepository->findOneBy([
|
||||
'contact' => $contactEntity,
|
||||
'type' => 2,
|
||||
]);
|
||||
|
||||
$contactDoc = $this->documentManager
|
||||
->getRepository(\PSC\Shop\EntityBundle\Document\Contact::class)
|
||||
->findOneBy(['uid' => $contactEntity->getUid()]);
|
||||
}
|
||||
|
||||
$contactEntity->setSalutation(1);
|
||||
|
||||
$contactEntity->setCollectingOrders(1);
|
||||
$contactEntity->setEmail($workSheet->getCell([16, $row->getRowIndex()])->getValue());
|
||||
$contactEntity->setEnable(true);
|
||||
$contactEntity->setShops([$selectedShop]);
|
||||
$contactEntity->setPassword(rand());
|
||||
$contactEntity->setFirstname((string) $workSheet->getCell([2, $row->getRowIndex()])->getValue());
|
||||
$contactEntity->setLastname((string) $workSheet->getCell([3, $row->getRowIndex()])->getValue());
|
||||
$contactEntity->setStreet($workSheet->getCell([10, $row->getRowIndex()])->getValue());
|
||||
$contactEntity->setZip($workSheet->getCell([11, $row->getRowIndex()])->getValue());
|
||||
$contactEntity->setCity($workSheet->getCell([12, $row->getRowIndex()])->getValue());
|
||||
$contactEntity->setCompany($workSheet->getCell([8, $row->getRowIndex()])->getValue());
|
||||
|
||||
$contactEntity->setTitle($workSheet->getCell([1, $row->getRowIndex()])->getValue());
|
||||
$contactEntity->setPosition($workSheet->getCell([6, $row->getRowIndex()])->getValue());
|
||||
$contactEntity->setFunction($workSheet->getCell([7, $row->getRowIndex()])->getValue());
|
||||
$contactEntity->setAbteilung($workSheet->getCell([9, $row->getRowIndex()])->getValue());
|
||||
|
||||
$telefon = $workSheet->getCell([13, $row->getRowIndex()])->getValue();
|
||||
$fax = $workSheet->getCell([14, $row->getRowIndex()])->getValue();
|
||||
$mobil = $workSheet->getCell([15, $row->getRowIndex()])->getValue();
|
||||
|
||||
if ($telefon != null && trim($telefon) != '') {
|
||||
preg_match('/^(\+\d+)\s+(\d+)\s+(\d+)-(\d+)$/', $telefon, $matches);
|
||||
$contactEntity->setPhoneAreaCode($matches[1]);
|
||||
$contactEntity->setPhonePrefix($matches[2]);
|
||||
$contactEntity->setPhone($matches[3]);
|
||||
$contactEntity->setPhoneAppendix($matches[4]);
|
||||
}
|
||||
if ($fax != null && trim($fax) != '') {
|
||||
preg_match('/^(\+\d+)\s+(\d+)\s+(\d+)-(\d+)$/', $fax, $matches);
|
||||
$contactEntity->setFaxAreaCode($matches[1]);
|
||||
$contactEntity->setFaxPrefix($matches[2]);
|
||||
$contactEntity->setFax($matches[3]);
|
||||
$contactEntity->setFaxAppendix($matches[4]);
|
||||
}
|
||||
if ($mobil != null && trim($mobil) != '') {
|
||||
preg_match('/^(\+\d+)\s+(\d+)\s+(\d+)-(\d+)$/', $mobil, $matches);
|
||||
$contactEntity->setMobileAreaCode($matches[1]);
|
||||
$contactEntity->setMobilePrefix($matches[2]);
|
||||
$contactEntity->setMobile($matches[3]);
|
||||
$contactEntity->setMobileAppendix($matches[4]);
|
||||
}
|
||||
|
||||
$contactEntity->setRolesForm([$role]);
|
||||
|
||||
if (!$contactInvoiceAddress) {
|
||||
$contactInvoiceAddress = new ContactAddress();
|
||||
}
|
||||
|
||||
$contactInvoiceAddress->setSalutation(1);
|
||||
$contactInvoiceAddress->setFirstname($contactEntity->getFirstname());
|
||||
$contactInvoiceAddress->setLastname($contactEntity->getLastname());
|
||||
$contactInvoiceAddress->setContact($contactEntity);
|
||||
$contactInvoiceAddress->setType(1);
|
||||
$contactInvoiceAddress->setCompany($contactEntity->getCompany());
|
||||
$contactInvoiceAddress->setStreet($contactEntity->getStreet());
|
||||
$contactInvoiceAddress->setZip($contactEntity->getZip());
|
||||
$contactInvoiceAddress->setCity($contactEntity->getCity());
|
||||
$contactInvoiceAddress->setEmail($contactEntity->getEmail());
|
||||
$contactInvoiceAddress->setCountry($contactEntity->getCountry());
|
||||
$contactInvoiceAddress->setPhone(
|
||||
(string) $workSheet->getCell([17, $row->getRowIndex()])->getValue()
|
||||
. (string) $workSheet->getCell([18, $row->getRowIndex()])->getValue()
|
||||
. (string) $workSheet->getCell([19, $row->getRowIndex()])->getValue()
|
||||
. (string) $workSheet->getCell([20, $row->getRowIndex()])->getValue(),
|
||||
);
|
||||
|
||||
if (!$contactDeliveryAddress) {
|
||||
$contactDeliveryAddress = new ContactAddress();
|
||||
}
|
||||
$contactDeliveryAddress->setSalutation(1);
|
||||
$contactDeliveryAddress->setFirstname($contactEntity->getFirstname());
|
||||
$contactDeliveryAddress->setLastname($contactEntity->getLastname());
|
||||
$contactDeliveryAddress->setContact($contactEntity);
|
||||
$contactDeliveryAddress->setType(2);
|
||||
$contactDeliveryAddress->setCompany($contactEntity->getCompany());
|
||||
$contactDeliveryAddress->setStreet($contactEntity->getStreet());
|
||||
$contactDeliveryAddress->setZip($contactEntity->getZip());
|
||||
$contactDeliveryAddress->setCity($contactEntity->getCity());
|
||||
$contactDeliveryAddress->setEmail($contactEntity->getEmail());
|
||||
$contactDeliveryAddress->setCountry($contactEntity->getCountry());
|
||||
$contactDeliveryAddress->setPhone(
|
||||
(string) $workSheet->getCell([17, $row->getRowIndex()])->getValue()
|
||||
. (string) $workSheet->getCell([18, $row->getRowIndex()])->getValue()
|
||||
. (string) $workSheet->getCell([19, $row->getRowIndex()])->getValue()
|
||||
. (string) $workSheet->getCell([20, $row->getRowIndex()])->getValue(),
|
||||
);
|
||||
|
||||
$this->entityManager->persist($contactEntity);
|
||||
$this->entityManager->persist($contactDeliveryAddress);
|
||||
$this->entityManager->persist($contactInvoiceAddress);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$contactDoc->setUid($contactEntity->getUid());
|
||||
$docData = [];
|
||||
if ($contactEntity->getAbteilung() != '') {
|
||||
$docData[] = [
|
||||
'name' => 'data[grad][enable]',
|
||||
'value' => '1',
|
||||
];
|
||||
}
|
||||
if ($contactEntity->getPhone() != '') {
|
||||
$docData[] = [
|
||||
'name' => 'data[phone][enable]',
|
||||
'value' => '1',
|
||||
];
|
||||
}
|
||||
if ($contactEntity->getMobile() != '') {
|
||||
$docData[] = [
|
||||
'name' => 'data[mobile][enable]',
|
||||
'value' => '1',
|
||||
];
|
||||
}
|
||||
if ($contactEntity->getFax() != '') {
|
||||
$docData[] = [
|
||||
'name' => 'data[fax][enable]',
|
||||
'value' => '1',
|
||||
];
|
||||
}
|
||||
$contactDoc->setLayouterSettings(['collectlayouter' => $docData]);
|
||||
$this->documentManager->persist($contactDoc);
|
||||
$this->documentManager->flush();
|
||||
}
|
||||
}
|
||||
|
||||
return array('form' => $form->createView());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Plugin\Custom\Ahrweiler\Harry\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class UploadType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('file', FileType::class, array(
|
||||
'label' => 'Datei',
|
||||
'required' => true,
|
||||
));
|
||||
$builder->add('import_start_row', TextType::class, array(
|
||||
'label' => 'Import Start Row',
|
||||
'required' => true,
|
||||
));
|
||||
$builder->add('import_stop_row', TextType::class, array(
|
||||
'label' => 'Import Stop Row',
|
||||
'required' => true,
|
||||
));
|
||||
}
|
||||
}
|
||||
26
src/new/var/plugins/Custom/Ahrweiler/Harry/Plugin.php
Normal file
26
src/new/var/plugins/Custom/Ahrweiler/Harry/Plugin.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Plugin\Custom\Ahrweiler\Harry;
|
||||
|
||||
use PSC\System\PluginBundle\Plugin\Base;
|
||||
|
||||
class Plugin extends Base implements \PSC\System\PluginBundle\Interfaces\Plugin
|
||||
{
|
||||
protected $name = 'Contact Importer Ahrweiler Harry Shop';
|
||||
|
||||
public function getType()
|
||||
{
|
||||
return Plugin::Backend;
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
return 'Contact Importer Ahrweiler Harry Shop';
|
||||
}
|
||||
|
||||
public function getVersion()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
plugin_custom_ahrweiler_harry_backend:
|
||||
resource: "@PluginCustomAhrweilerHarry/Controller/Backend"
|
||||
type: attribute
|
||||
prefix: /backend/plugin/custom/ahrweiler/harry
|
||||
@ -0,0 +1,7 @@
|
||||
services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
Plugin\Custom\Ahrweiler\Harry\:
|
||||
resource: '../../*/*'
|
||||
@ -0,0 +1,50 @@
|
||||
{% extends 'backend_base.html.twig' %}
|
||||
{% block body %}
|
||||
<div class="panel">
|
||||
<div class="header">
|
||||
<h4>Import</h4>
|
||||
</div>
|
||||
<div class="body">
|
||||
{{ form_start(form, { 'attr': {'class': 'smart-form'}}) }}
|
||||
{{ form_errors(form) }}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
{{ form_label(form.file ) }}
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="checkbox">
|
||||
{{ form_widget(form.file , {attr: {'class': 'form-control'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
{{ form_label(form.import_start_row ) }}
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
{{ form_widget(form.import_start_row , {attr: {'class': 'form-control'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group row">
|
||||
<div class="col-md-12">
|
||||
{{ form_label(form.import_stop_row ) }}
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
{{ form_widget(form.import_stop_row , {attr: {'class': 'form-control'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-sm btn-primary">Hochladen</button>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@ -8,28 +8,28 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use GuzzleHttp\Client;
|
||||
use LogicException;
|
||||
use PSC\Shop\ContactBundle\Model\Address;
|
||||
use PSC\Shop\EntityBundle\Document\Queue;
|
||||
use PSC\Shop\EntityBundle\Entity\Account;
|
||||
use PSC\Shop\EntityBundle\Entity\Contact;
|
||||
use PSC\Shop\EntityBundle\Entity\ContactRole;
|
||||
use PSC\Shop\EntityBundle\Entity\Role;
|
||||
use PSC\Shop\EntityBundle\Entity\ShopContact;
|
||||
use PSC\Shop\EntityBundle\Entity\Product;
|
||||
use PSC\Shop\EntityBundle\Entity\Productgroup;
|
||||
use PSC\Shop\EntityBundle\Entity\ProductProductgroup;
|
||||
use PSC\Shop\EntityBundle\Entity\Role;
|
||||
use PSC\Shop\EntityBundle\Entity\ShopContact;
|
||||
use PSC\Shop\EntityBundle\Repository\ProductProductgroupRepository;
|
||||
use PSC\Shop\ContactBundle\Model\Address;
|
||||
use PSC\Shop\OrderBundle\Model\Order\Payment;
|
||||
use PSC\Shop\OrderBundle\Model\Order\Position;
|
||||
use PSC\Shop\OrderBundle\Model\Order\Shipping;
|
||||
use PSC\Shop\OrderBundle\Service\Order;
|
||||
use PSC\Shop\ProductBundle\Model\ProductSpecialObject;
|
||||
use PSC\Shop\QueueBundle\Event\EventInterface;
|
||||
use PSC\Shop\QueueBundle\Event\Order\Create;
|
||||
use PSC\Shop\QueueBundle\Event\Position\Printpartner\Notify;
|
||||
use PSC\Shop\QueueBundle\Service\Event\Manager;
|
||||
use PSC\Shop\QueueBundle\Type\ConfigurableElementInterface;
|
||||
use PSC\Shop\QueueBundle\Type\QueueInterface;
|
||||
use PSC\Shop\QueueBundle\Event\Order\Create;
|
||||
use PSC\Shop\QueueBundle\Service\Event\Manager;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
@ -58,7 +58,6 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
||||
private $_productHydration = null;
|
||||
private $_eventManager;
|
||||
|
||||
|
||||
/**
|
||||
* @var Shop
|
||||
*/
|
||||
@ -66,8 +65,14 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
||||
|
||||
function __construct(
|
||||
\PSC\Shop\ProductBundle\Hydrate\Product $productHydration,
|
||||
\PSC\Component\ApiBundle\Transformer\Shop $shopTransformer, FormFactoryInterface $formFactory, TokenStorageInterface $securityContext, Order $orderService, Shop $shopService, EntityManagerInterface $entityManager, Manager $eventManager)
|
||||
{
|
||||
\PSC\Component\ApiBundle\Transformer\Shop $shopTransformer,
|
||||
FormFactoryInterface $formFactory,
|
||||
TokenStorageInterface $securityContext,
|
||||
Order $orderService,
|
||||
Shop $shopService,
|
||||
EntityManagerInterface $entityManager,
|
||||
Manager $eventManager,
|
||||
) {
|
||||
$this->_formFactory = $formFactory;
|
||||
$this->_securityContext = $securityContext;
|
||||
$this->_orderService = $orderService;
|
||||
@ -106,29 +111,38 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
||||
|
||||
public function getForm(FormBuilderInterface $builder, $form_options, EventInterface $event)
|
||||
{
|
||||
$products = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array("shop" => $this->_shopService->getSelectedShop()->getUid(), "enable" => 1));
|
||||
$products = $this->_entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->findBy(array('shop' => $this->_shopService->getSelectedShop()->getUid(), 'enable' => 1));
|
||||
|
||||
$tmp = [];
|
||||
foreach ($products as $product) {
|
||||
$tmp[$product->getTitle() . " (" . $product->getId() . ")"] = $product->getId();
|
||||
$tmp[$product->getTitle() . ' (' . $product->getId() . ')'] = $product->getId();
|
||||
}
|
||||
|
||||
$shippings = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Shipping')->findBy(array("shop" => $this->_shopService->getSelectedShop()->getUid(), "enable" => 1));
|
||||
$shippings = $this->_entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Shipping')
|
||||
->findBy(array('shop' => $this->_shopService->getSelectedShop()->getUid(), 'enable' => 1));
|
||||
|
||||
$tmpShipping = [];
|
||||
foreach ($shippings as $shipping) {
|
||||
$tmpShipping[$shipping->getTitle()] = $shipping->getUid();
|
||||
}
|
||||
|
||||
$payments = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Payment')->findBy(array("shop" => $this->_shopService->getSelectedShop()->getUid(), "enable" => 1));
|
||||
$payments = $this->_entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Payment')
|
||||
->findBy(array('shop' => $this->_shopService->getSelectedShop()->getUid(), 'enable' => 1));
|
||||
|
||||
$tmpPayment = [];
|
||||
foreach ($payments as $payment) {
|
||||
$tmpPayment[$payment->getTitle()] = $payment->getUid();
|
||||
}
|
||||
|
||||
|
||||
$builder->add("folder", TextType::class, array('empty_data' => '/data/www/old/data/packages/import/', 'label' => 'Import Folder', 'attr' => array('class' => 'form-element')));
|
||||
$builder->add('folder', TextType::class, array(
|
||||
'empty_data' => '/data/www/old/data/packages/import/',
|
||||
'label' => 'Import Folder',
|
||||
'attr' => array('class' => 'form-element'),
|
||||
));
|
||||
$builder->add('product', ChoiceType::class, array(
|
||||
'choices' => $tmp,
|
||||
'label' => 'Produkt als Basis',
|
||||
@ -176,22 +190,27 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
||||
*/
|
||||
public function execute(EventInterface $event, Queue $doc)
|
||||
{
|
||||
|
||||
try {
|
||||
/** @var \Plugin\Custom\Huelswitt\Orderimport\Document\Import $queueSettings */
|
||||
$queueSettings = $doc->getQueueDocument();
|
||||
if (file_exists($queueSettings->getFolder() . "/run_oi.txt")) return true;
|
||||
if (file_exists($queueSettings->getFolder() . '/run_oi.txt'))
|
||||
return true;
|
||||
|
||||
file_put_contents($queueSettings->getFolder() . "/run_oi.txt", "import");
|
||||
file_put_contents($queueSettings->getFolder() . '/run_oi.txt', 'import');
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
$finder = new Finder();
|
||||
|
||||
$files = $finder->files()->in($queueSettings->getFolder())->name("*.xml");
|
||||
$files = $finder->files()->in($queueSettings->getFolder())->name('*.xml');
|
||||
|
||||
/** @var SplFileInfo $file */
|
||||
foreach ($files as $file) {
|
||||
if (file_exists($queueSettings->getFolder() . '/../finished/' . $file->getFilename())) {
|
||||
rename($file->getPathname(), $queueSettings->getFolder() . '/../finished/' . $file->getFilename());
|
||||
continue;
|
||||
}
|
||||
|
||||
$xml = simplexml_load_file($file->getPathname());
|
||||
|
||||
$order = $this->_orderService->getNewOrder();
|
||||
@ -210,32 +229,117 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
||||
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->ShipTo)) {
|
||||
$address = new Address();
|
||||
$address->setCompany((string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Name);
|
||||
$address->setCompany(
|
||||
(string) $xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Name,
|
||||
);
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Email)) {
|
||||
$address->setEmail((string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Email);
|
||||
$address->setEmail(
|
||||
(string) $xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Email,
|
||||
);
|
||||
}
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Phone)) {
|
||||
$address->setPhone(
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Phone->TelephoneNumber->CountryCode.
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Phone->TelephoneNumber->AreaOrCityCode .
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Phone->TelephoneNumber->Number
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->ShipTo
|
||||
->Address
|
||||
->Phone
|
||||
->TelephoneNumber
|
||||
->CountryCode
|
||||
. (string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->ShipTo
|
||||
->Address
|
||||
->Phone
|
||||
->TelephoneNumber
|
||||
->AreaOrCityCode
|
||||
. (string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->ShipTo
|
||||
->Address
|
||||
->Phone
|
||||
->TelephoneNumber
|
||||
->Number,
|
||||
);
|
||||
}
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Fax)) {
|
||||
$address->setFax(
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Fax->TelephoneNumber->CountryCode.
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Fax->TelephoneNumber->AreaOrCityCode .
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->Fax->TelephoneNumber->Number
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->ShipTo
|
||||
->Address
|
||||
->Fax
|
||||
->TelephoneNumber
|
||||
->CountryCode
|
||||
. (string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->ShipTo
|
||||
->Address
|
||||
->Fax
|
||||
->TelephoneNumber
|
||||
->AreaOrCityCode
|
||||
. (string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->ShipTo
|
||||
->Address
|
||||
->Fax
|
||||
->TelephoneNumber
|
||||
->Number,
|
||||
);
|
||||
}
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->PostalAddress->City)) {
|
||||
$address->setCity((string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->PostalAddress->City);
|
||||
$address->setCity(
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->ShipTo
|
||||
->Address
|
||||
->PostalAddress
|
||||
->City,
|
||||
);
|
||||
}
|
||||
if(isset($xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->PostalAddress->PostalCode)) {
|
||||
$address->setZip((string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->PostalAddress->PostalCode);
|
||||
if (
|
||||
isset(
|
||||
$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->PostalAddress->PostalCode,
|
||||
)
|
||||
) {
|
||||
$address->setZip(
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->ShipTo
|
||||
->Address
|
||||
->PostalAddress
|
||||
->PostalCode,
|
||||
);
|
||||
}
|
||||
if(isset($xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->PostalAddress->Street)) {
|
||||
$address->setStreet((string)$xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->PostalAddress->Street);
|
||||
if (
|
||||
isset($xml->Request->OrderRequest->OrderRequestHeader->ShipTo->Address->PostalAddress->Street)
|
||||
) {
|
||||
$address->setStreet(
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->ShipTo
|
||||
->Address
|
||||
->PostalAddress
|
||||
->Street,
|
||||
);
|
||||
}
|
||||
|
||||
$order->setDeliveryAddress($address);
|
||||
@ -243,44 +347,128 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
||||
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->BillTo)) {
|
||||
$address = new Address();
|
||||
$address->setCompany((string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Name);
|
||||
$address->setCompany(
|
||||
(string) $xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Name,
|
||||
);
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Email)) {
|
||||
$address->setEmail((string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Email);
|
||||
$address->setEmail(
|
||||
(string) $xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Email,
|
||||
);
|
||||
}
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Phone)) {
|
||||
$address->setPhone(
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Phone->TelephoneNumber->CountryCode.
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Phone->TelephoneNumber->AreaOrCityCode .
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Phone->TelephoneNumber->Number
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->BillTo
|
||||
->Address
|
||||
->Phone
|
||||
->TelephoneNumber
|
||||
->CountryCode
|
||||
. (string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->BillTo
|
||||
->Address
|
||||
->Phone
|
||||
->TelephoneNumber
|
||||
->AreaOrCityCode
|
||||
. (string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->BillTo
|
||||
->Address
|
||||
->Phone
|
||||
->TelephoneNumber
|
||||
->Number,
|
||||
);
|
||||
}
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Fax)) {
|
||||
$address->setFax(
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Fax->TelephoneNumber->CountryCode.
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Fax->TelephoneNumber->AreaOrCityCode .
|
||||
(string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->Fax->TelephoneNumber->Number
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->BillTo
|
||||
->Address
|
||||
->Fax
|
||||
->TelephoneNumber
|
||||
->CountryCode
|
||||
. (string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->BillTo
|
||||
->Address
|
||||
->Fax
|
||||
->TelephoneNumber
|
||||
->AreaOrCityCode
|
||||
. (string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->BillTo
|
||||
->Address
|
||||
->Fax
|
||||
->TelephoneNumber
|
||||
->Number,
|
||||
);
|
||||
}
|
||||
if (isset($xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->PostalAddress->City)) {
|
||||
$address->setCity((string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->PostalAddress->City);
|
||||
$address->setCity(
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->BillTo
|
||||
->Address
|
||||
->PostalAddress
|
||||
->City,
|
||||
);
|
||||
}
|
||||
if(isset($xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->PostalAddress->PostalCode)) {
|
||||
$address->setZip((string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->PostalAddress->PostalCode);
|
||||
if (
|
||||
isset(
|
||||
$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->PostalAddress->PostalCode,
|
||||
)
|
||||
) {
|
||||
$address->setZip(
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->BillTo
|
||||
->Address
|
||||
->PostalAddress
|
||||
->PostalCode,
|
||||
);
|
||||
}
|
||||
if(isset($xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->PostalAddress->Street)) {
|
||||
$address->setStreet((string)$xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->PostalAddress->Street);
|
||||
if (
|
||||
isset($xml->Request->OrderRequest->OrderRequestHeader->BillTo->Address->PostalAddress->Street)
|
||||
) {
|
||||
$address->setStreet(
|
||||
(string) $xml
|
||||
->Request
|
||||
->OrderRequest
|
||||
->OrderRequestHeader
|
||||
->BillTo
|
||||
->Address
|
||||
->PostalAddress
|
||||
->Street,
|
||||
);
|
||||
}
|
||||
|
||||
$order->setInvoiceAddress($address);
|
||||
}
|
||||
|
||||
foreach ($xml->Request->OrderRequest->ItemOut as $item) {
|
||||
|
||||
if ($queueSettings->getExternalProduct() == (string) $item->ItemDetail->ManufacturerPartID) {
|
||||
|
||||
/** @var \PSC\Shop\ProductBundle\Model\Product $product */
|
||||
$product = $this->_productHydration->hydrateToModel(
|
||||
$this->_entityManager->getRepository(Product::class)->findOneBy(['uid' => $queueSettings->getProduct()]));
|
||||
$product = $this->_productHydration->hydrateToModel($this->_entityManager
|
||||
->getRepository(Product::class)
|
||||
->findOneBy(['uid' => $queueSettings->getProduct()]));
|
||||
$prodSpec = new ProductSpecialObject();
|
||||
$prodSpec->setCount(intval($item['quantity']));
|
||||
$prodSpec->setNet(floatval($item->ItemDetail->UnitPrice->Money) * 100);
|
||||
@ -314,7 +502,6 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
||||
$notify->setShop($order->getShop()->getId());
|
||||
$notify->setOrder($order->getUuid());
|
||||
$this->_eventManager->addJob($notify);
|
||||
|
||||
}
|
||||
|
||||
if ($doc->getPos() == 9) {
|
||||
@ -325,8 +512,7 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
||||
}
|
||||
}
|
||||
|
||||
unlink($queueSettings->getFolder() . "/run_oi.txt");
|
||||
|
||||
unlink($queueSettings->getFolder() . '/run_oi.txt');
|
||||
} catch (\Exception $e) {
|
||||
echo $e->getMessage();
|
||||
return false;
|
||||
@ -339,5 +525,5 @@ class Import implements QueueInterface, ConfigurableElementInterface
|
||||
{
|
||||
return $this->_error;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -89,6 +89,7 @@ class Form extends AbstractController
|
||||
ElementBinding::Title => $contact->getLayouterData()->getTitle(),
|
||||
ElementBinding::Position => $contact->getLayouterData()->getPosition(),
|
||||
ElementBinding::Function => $contact->getLayouterData()->getFunction(),
|
||||
ElementBinding::Street => $contact->getLayouterData()->getStreet(),
|
||||
ElementBinding::StreetHouseNumber => [
|
||||
$contact->getLayouterData()->getStreet(),
|
||||
$contact->getLayouterData()->getHouseNumber(),
|
||||
@ -159,13 +160,13 @@ class Form extends AbstractController
|
||||
};
|
||||
|
||||
$elmEnable = array_values(array_filter($layouterSettings, function ($el) use ($setting) {
|
||||
if ($el['name'] == ('data[' . $setting->getId() . '][enable]')) {
|
||||
if ($el['name'] == 'data[' . $setting->getId() . '][enable]') {
|
||||
return $el;
|
||||
}
|
||||
}));
|
||||
|
||||
$elmValue = array_values(array_filter($layouterSettings, function ($el) use ($setting) {
|
||||
if ($el['name'] == ('data[' . $setting->getId() . '][value]')) {
|
||||
if ($el['name'] == 'data[' . $setting->getId() . '][value]') {
|
||||
return $el;
|
||||
}
|
||||
}));
|
||||
|
||||
@ -164,6 +164,7 @@ class Preview extends AbstractController
|
||||
ElementBinding::Image1 => $contact->getLayouterData()->getImage1() ?? $element->getDefault1(),
|
||||
ElementBinding::Image2 => $contact->getLayouterData()->getImage2() ?? $element->getDefault1(),
|
||||
ElementBinding::Account => $contact->getAccount()->getUuid() ?? $element->getDefault1(),
|
||||
ElementBinding::Street => $contact->getLayouterData()->getStreet() ?? $element->getDefault1(),
|
||||
};
|
||||
|
||||
if ($elm = $data->getElement($element, $contact)) {
|
||||
|
||||
@ -158,6 +158,7 @@ class Save extends AbstractController
|
||||
ElementBinding::District => $contact->getLayouterData()->getDistrict() ?? $element->getDefault1(),
|
||||
ElementBinding::Image1 => $contact->getLayouterData()->getImage1() ?? $element->getDefault1(),
|
||||
ElementBinding::Image2 => $contact->getLayouterData()->getImage2() ?? $element->getDefault1(),
|
||||
ElementBinding::Street => $contact->getLayouterData()->getStreet() ?? $element->getDefault1(),
|
||||
ElementBinding::Account => $contact->getAccount()->getUuid() ?? $element->getDefault1(),
|
||||
};
|
||||
|
||||
@ -216,7 +217,10 @@ class Save extends AbstractController
|
||||
$this->documentManager->flush();
|
||||
|
||||
if ($data->isSek()) {
|
||||
$this->requestStack->getSession()->getFlashBag()->add('success', 'Produkt in den Warenkorb gelegt');
|
||||
$this->requestStack
|
||||
->getSession()
|
||||
->getFlashBag()
|
||||
->add('success', 'Produkt in den Warenkorb gelegt');
|
||||
}
|
||||
|
||||
return $this->json(['success' => true, 'basketField1' => $basketField1, 'basketField2' => $basketField2]);
|
||||
@ -342,6 +346,7 @@ class Save extends AbstractController
|
||||
ElementBinding::District => $contact->getLayouterData()->getDistrict() ?? $element->getDefault1(),
|
||||
ElementBinding::Image1 => $contact->getLayouterData()->getImage1() ?? $element->getDefault1(),
|
||||
ElementBinding::Image2 => $contact->getLayouterData()->getImage2() ?? $element->getDefault1(),
|
||||
ElementBinding::Street => $contact->getLayouterData()->getStreet() ?? $element->getDefault1(),
|
||||
};
|
||||
|
||||
if ($elm = $data->getElement($element, $contact)) {
|
||||
@ -394,7 +399,10 @@ class Save extends AbstractController
|
||||
$this->documentManager->flush();
|
||||
|
||||
if ($data->isSek()) {
|
||||
$this->requestStack->getSession()->getFlashBag()->add('success', 'Produkt in den Warenkorb gelegt');
|
||||
$this->requestStack
|
||||
->getSession()
|
||||
->getFlashBag()
|
||||
->add('success', 'Produkt in den Warenkorb gelegt');
|
||||
}
|
||||
|
||||
return $this->json(['success' => true, 'basketField1' => $basketField1, 'basketField2' => $basketField2]);
|
||||
|
||||
@ -39,9 +39,10 @@ class SaveContact
|
||||
{
|
||||
foreach ($this->setting->getCustomerForm() as $element) {
|
||||
if (
|
||||
$element->getBinding() != ElementBinding::none &&
|
||||
$element->getSaveBack() &&
|
||||
($elm = $this->data->getElement($element, $this->contact))
|
||||
$element->getBinding() != ElementBinding::none && $element->getSaveBack() && ($elm = $this->data->getElement(
|
||||
$element,
|
||||
$this->contact,
|
||||
))
|
||||
) {
|
||||
switch ($element->getBinding()) {
|
||||
case ElementBinding::none:
|
||||
@ -74,6 +75,9 @@ class SaveContact
|
||||
case ElementBinding::Position:
|
||||
$this->contact->getLayouterData()->setPosition($elm['value']);
|
||||
break;
|
||||
case ElementBinding::Street:
|
||||
$this->contact->getLayouterData()->setStreet($elm['value']);
|
||||
break;
|
||||
case ElementBinding::Function:
|
||||
$this->contact->getLayouterData()->setFunction($elm['value']);
|
||||
break;
|
||||
|
||||
@ -71,6 +71,7 @@ class SaveFiles
|
||||
ElementBinding::Company2 => $this->contact->getLayouterData()->getCompany2() ?? $element->getDefault1(),
|
||||
ElementBinding::Title => $this->contact->getLayouterData()->getTitle() ?? $element->getDefault1(),
|
||||
ElementBinding::Position => $this->contact->getLayouterData()->getPosition() ?? $element->getDefault1(),
|
||||
ElementBinding::Steet => $this->contact->getLayouterData()->getStreet() ?? $element->getDefault1(),
|
||||
ElementBinding::Function => $this->contact->getLayouterData()->getFunction() ?? $element->getDefault1(),
|
||||
ElementBinding::UserCountry => $this->contact->getCountryCode() ?? $element->getDefault1(),
|
||||
ElementBinding::Fon => [
|
||||
@ -176,12 +177,9 @@ class SaveFiles
|
||||
if ($contactUUId == '') {
|
||||
$contactUUId = 'guest';
|
||||
}
|
||||
if (
|
||||
!file_exists('/data/www/old/market/collectlayouter/temp/' .
|
||||
$contactUUId .
|
||||
'/' .
|
||||
$this->data->getLayouterUuid())
|
||||
) {
|
||||
if (!file_exists(
|
||||
'/data/www/old/market/collectlayouter/temp/' . $contactUUId . '/' . $this->data->getLayouterUuid(),
|
||||
)) {
|
||||
mkdir(
|
||||
'/data/www/old/market/collectlayouter/temp/' . $contactUUId . '/' . $this->data->getLayouterUuid(),
|
||||
0o777,
|
||||
|
||||
@ -61,6 +61,7 @@ enum ElementBinding: int
|
||||
case Image1 = 50;
|
||||
case Image2 = 51;
|
||||
case Account = 52;
|
||||
case Street = 53;
|
||||
|
||||
public static function getForTypePhone(): array
|
||||
{
|
||||
@ -103,6 +104,7 @@ enum ElementBinding: int
|
||||
self::State->name => self::State,
|
||||
self::District->name => self::District,
|
||||
self::Account->name => self::Account,
|
||||
self::Street->name => self::Street,
|
||||
];
|
||||
|
||||
for ($i = 16; $i <= 39; $i++) {
|
||||
@ -168,6 +170,7 @@ enum ElementBinding: int
|
||||
self::Title => $contact->getLayouterData()->getTitle(),
|
||||
self::Position => $contact->getLayouterData()->getPosition(),
|
||||
self::Function => $contact->getLayouterData()->getFunction(),
|
||||
self::Street => $contact->getLayouterData()->getStreet(),
|
||||
self::StreetHouseNumber => sprintf(
|
||||
'%s %s',
|
||||
$contact->getLayouterData()->getStreet(),
|
||||
@ -239,7 +242,7 @@ enum ElementBinding: int
|
||||
};
|
||||
}
|
||||
|
||||
public function trans(TranslatorInterface $translator, null|string $locale = null): string
|
||||
public function trans(TranslatorInterface $translator, ?string $locale = null): string
|
||||
{
|
||||
return $this->name;
|
||||
return $translator->trans(
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
info:
|
||||
datum: 24.04.2026
|
||||
datum: 12.05.2026
|
||||
release: 2.3.6
|
||||
|
||||
changelog:
|
||||
- version: 2.3.6
|
||||
datum: 24.04.2026
|
||||
datum: 12.05.2026
|
||||
changes:
|
||||
- "Passwort Start und Finish Aktion Absender und Empfänger Bug behoben"
|
||||
- "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."
|
||||
- "Papierdatenbank Kommawerte"
|
||||
- "Cron Cache löschen"
|
||||
- version: 2.3.5
|
||||
datum: 01.04.2026
|
||||
changes:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user