This commit is contained in:
Thomas Peterson 2026-04-08 17:17:59 +02:00
parent 6f65735675
commit 332e8982ec
22 changed files with 328 additions and 85 deletions

View File

@ -6,6 +6,7 @@ COPY ./images/php/cron/bin/ /usr/bin/
COPY ./images/php/fpm/conf.d/policy.xml /etc/ImageMagick-6/policy.xml COPY ./images/php/fpm/conf.d/policy.xml /etc/ImageMagick-6/policy.xml
RUN chmod +x /usr/bin/start-cron.sh RUN chmod +x /usr/bin/start-cron.sh
RUN chmod +x /usr/bin/set-env.sh RUN chmod +x /usr/bin/set-env.sh
RUN chmod +x /usr/bin/psc-cron-run.sh
RUN chmod 0600 /etc/cron.d/psc RUN chmod 0600 /etc/cron.d/psc
RUN apt-get update && apt-get install -y cron rsyslog RUN apt-get update && apt-get install -y cron rsyslog

View File

@ -0,0 +1,9 @@
#!/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
/usr/local/bin/php /data/www/new/bin/clear-cache.php 2>&1
fi
/usr/local/bin/php /data/www/new/bin/console application:queue:doEveryMinute

View File

@ -5,7 +5,7 @@ BASH_ENV=/container.env
* * * * * root chmod -R 0777 /data/www/old/market/steplayouter >> /var/log/cron.log 2>&1 * * * * * root chmod -R 0777 /data/www/old/market/steplayouter >> /var/log/cron.log 2>&1
* * * * * root chmod -R 0777 /data/www/new/web/uploads/media >> /var/log/cron.log 2>&1 * * * * * root chmod -R 0777 /data/www/new/web/uploads/media >> /var/log/cron.log 2>&1
* * * * * root chmod -R 0777 /data/www/new/web/media >> /var/log/cron.log 2>&1 * * * * * root chmod -R 0777 /data/www/new/web/media >> /var/log/cron.log 2>&1
* * * * * www-data cd /data/www/new/web && /usr/local/bin/php /data/www/new/bin/console application:queue:doEveryMinute >> /var/log/cron.log 2>&1 * * * * * www-data cd /data/www/new/web && /usr/bin/psc-cron-run.sh >> /var/log/cron.log 2>&1
@daily www-data cd /data/www/new/web && /usr/local/bin/php /data/www/new/bin/console application:queue:doEveryDay >> /var/log/cronD.log 2>&1 @daily www-data cd /data/www/new/web && /usr/local/bin/php /data/www/new/bin/console application:queue:doEveryDay >> /var/log/cronD.log 2>&1
@hourly www-data cd /data/www/new/web && /usr/local/bin/php /data/www/new/bin/console application:queue:doEveryHour >> /var/log/cronH.log 2>&1 @hourly www-data cd /data/www/new/web && /usr/local/bin/php /data/www/new/bin/console application:queue:doEveryHour >> /var/log/cronH.log 2>&1
# #

View File

@ -0,0 +1,64 @@
#!/usr/bin/env php
<?php
/**
* Cache-Clear Script ohne Symfony-Bootstrap.
*
* Macht einen atomaren Swap des Cache-Verzeichnisses:
* 1. Benennt den aktuellen Cache in ein Temp-Verzeichnis um (atomar, laufende Prozesse behalten ihre File-Handles)
* 2. Führt cache:warmup aus (erzeugt neuen Cache)
* 3. Löscht das alte Verzeichnis im Hintergrund
*/
$env = getenv('APP_ENV') ?: 'prod';
$projectDir = dirname(__DIR__);
$cacheDir = $projectDir . '/var/cache/' . $env;
if (!is_dir($cacheDir)) {
echo "Cache directory does not exist, nothing to clear.\n";
exit(0);
}
// 1. Atomarer Rename des aktuellen Cache
$oldCacheDir = $cacheDir . '_old_' . uniqid();
if (!@rename($cacheDir, $oldCacheDir)) {
echo "Failed to rename cache directory.\n";
exit(1);
}
echo "Cache directory renamed to: $oldCacheDir\n";
// 2. Cache Warmup über console command (eigener Prozess)
$consolePath = $projectDir . '/bin/console';
$command = sprintf(
'%s %s cache:warmup --env=%s 2>&1',
PHP_BINARY,
escapeshellarg($consolePath),
escapeshellarg($env)
);
echo "Running cache:warmup...\n";
$output = [];
$returnCode = 0;
exec($command, $output, $returnCode);
if ($returnCode !== 0) {
echo "cache:warmup failed (exit code $returnCode):\n";
echo implode("\n", $output) . "\n";
// Rollback: alten Cache wiederherstellen
if (!is_dir($cacheDir)) {
@rename($oldCacheDir, $cacheDir);
echo "Rolled back to old cache.\n";
}
exit(1);
}
echo "cache:warmup completed.\n";
// 3. Altes Cache-Verzeichnis im Hintergrund löschen
$rmCommand = sprintf('rm -rf %s &', escapeshellarg($oldCacheDir));
exec($rmCommand);
echo "Old cache cleanup started in background.\n";
echo "Cache clear completed successfully.\n";

View File

@ -476,7 +476,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* datetime?: array{ * datetime?: array{
* default_format?: scalar|Param|null, // Default: "Y-m-d\\TH:i:sP" * default_format?: scalar|Param|null, // Default: "Y-m-d\\TH:i:sP"
* default_deserialization_formats?: list<scalar|Param|null>, * default_deserialization_formats?: list<scalar|Param|null>,
* default_timezone?: scalar|Param|null, // Default: "Europe/Berlin" * default_timezone?: scalar|Param|null, // Default: "UTC"
* cdata?: scalar|Param|null, // Default: true * cdata?: scalar|Param|null, // Default: true
* }, * },
* array_collection?: array{ * array_collection?: array{
@ -576,7 +576,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
* datetime?: array{ * datetime?: array{
* default_format?: scalar|Param|null, // Default: "Y-m-d\\TH:i:sP" * default_format?: scalar|Param|null, // Default: "Y-m-d\\TH:i:sP"
* default_deserialization_formats?: list<scalar|Param|null>, * default_deserialization_formats?: list<scalar|Param|null>,
* default_timezone?: scalar|Param|null, // Default: "Europe/Berlin" * default_timezone?: scalar|Param|null, // Default: "UTC"
* cdata?: scalar|Param|null, // Default: true * cdata?: scalar|Param|null, // Default: true
* }, * },
* array_collection?: array{ * array_collection?: array{

View File

@ -1,16 +1,5 @@
<?php <?php
/**
* PrintshopCreator Suite
*
* PHP Version 5.3
*
* @author Thomas Peterson <info@thomas-peterson.de>
* @copyright 2012-2013 PrintshopCreator GmbH
* @license Private
* @link http://www.printshopcreator.de
*/
namespace PSC\Shop\CmsBundle\Controller\Backend; namespace PSC\Shop\CmsBundle\Controller\Backend;
use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ODM\MongoDB\DocumentManager;
@ -155,7 +144,6 @@ class EditController extends AbstractController
) { ) {
$customFields = $fieldService->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Cms); $customFields = $fieldService->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Cms);
$customGroups = $fieldService->getGroups(\PSC\System\PluginBundle\Form\Interfaces\Field::Cms); $customGroups = $fieldService->getGroups(\PSC\System\PluginBundle\Form\Interfaces\Field::Cms);
dump($customGroups);
$selectedShop = $shopService->getSelectedShop(); $selectedShop = $shopService->getSelectedShop();
/** @var Cms $cms */ /** @var Cms $cms */
@ -210,6 +198,8 @@ class EditController extends AbstractController
$cms->getTitle(), $cms->getTitle(),
'CMS Site saved', 'CMS Site saved',
); );
} else {
dump($form->getErrors());
} }
return array( return array(

View File

@ -23,6 +23,7 @@ use PSC\Shop\ThemeBundle\Core\ThemeHolderInterface;
use PSC\Shop\ThemeBundle\Core\ThemeSource; use PSC\Shop\ThemeBundle\Core\ThemeSource;
use PSC\Shop\ThemeBundle\Core\ThemeSourceInterface; use PSC\Shop\ThemeBundle\Core\ThemeSourceInterface;
use PSC\System\PluginBundle\Form\Chain\Field; use PSC\System\PluginBundle\Form\Chain\Field;
use PSC\System\PluginBundle\Form\Interfaces\CustomFormGroup;
use PSC\System\SettingsBundle\Service\Language; use PSC\System\SettingsBundle\Service\Language;
use PSC\System\SettingsBundle\Service\Shop; use PSC\System\SettingsBundle\Service\Shop;
use Spiriit\Bundle\FormFilterBundle\Filter\Query\QueryInterface; use Spiriit\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
@ -161,9 +162,14 @@ class CmsType extends AbstractType
]); ]);
/** @var \PSC\System\PluginBundle\Form\Interfaces\Field $field */ /** @var \PSC\System\PluginBundle\Form\Interfaces\Field $field */
foreach ($this->fields->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Cms) as $field) { foreach ($this->fields->getFields(\PSC\System\PluginBundle\Form\Interfaces\Field::Cms) as $field) {
$var = $field->buildForm($this->formFactory->createNamedBuilder($field->getGroup(), FormType::class, null, [ $var = $field->buildForm($this->formFactory->createNamedBuilder(
$field instanceof CustomFormGroup ? $field->getCustomFormGroup() : $field->getGroup(),
FormType::class,
null,
[
'mapped' => false, 'mapped' => false,
]), $options); ],
), $options);
if ($var->count() > 0) { if ($var->count() > 0) {
$builder->add($var); $builder->add($var);
} }
@ -210,6 +216,7 @@ class CmsType extends AbstractType
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults([ $resolver->setDefaults([
'allow_extra_fields' => true,
'data_class' => 'PSC\Shop\EntityBundle\Entity\Cms', 'data_class' => 'PSC\Shop\EntityBundle\Entity\Cms',
]); ]);
} }

View File

@ -3,13 +3,14 @@
namespace PSC\Shop\CmsBundle\Form\Field; namespace PSC\Shop\CmsBundle\Form\Field;
use PSC\Libraries\AceEditorBundle\Form\Extension\AceEditorType; use PSC\Libraries\AceEditorBundle\Form\Extension\AceEditorType;
use PSC\System\PluginBundle\Form\Interfaces\CustomFormGroup;
use PSC\System\PluginBundle\Form\Interfaces\Field; use PSC\System\PluginBundle\Form\Interfaces\Field;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
#[AutoconfigureTag('psc.backend.custom.fields')] #[AutoconfigureTag('psc.backend.custom.fields')]
class HtmlTextContent implements Field class HtmlTextContent implements Field, CustomFormGroup
{ {
public function getModule(): int public function getModule(): int
{ {
@ -21,6 +22,11 @@ class HtmlTextContent implements Field
return 'html'; return 'html';
} }
public function getCustomFormGroup(): string
{
return 'text';
}
public function getTemplate(): string public function getTemplate(): string
{ {
return '@PSCShopCms/backend/edit/fields/html_content.html.twig'; return '@PSCShopCms/backend/edit/fields/html_content.html.twig';
@ -55,7 +61,7 @@ class HtmlTextContent implements Field
{ {
$data = $event->getData(); $data = $event->getData();
if ($data->getEditorMode() == 'html') { if ($data->getEditorMode() == 'html') {
$event->getForm()->get('html')->get('text')->setData($data->getText()); $event->getForm()->get('text')->get('text')->setData($data->getText());
} }
} }
@ -67,7 +73,7 @@ class HtmlTextContent implements Field
{ {
$data = $event->getData(); $data = $event->getData();
if ($data->getEditorMode() == 'html') { if ($data->getEditorMode() == 'html') {
$data->setText($event->getForm()->get('html')->get('text')->getData()); $data->setText($event->getForm()->get('text')->get('text')->getData());
} }
} }
} }

View File

@ -2,6 +2,7 @@
namespace PSC\Shop\CmsBundle\Form\Field; namespace PSC\Shop\CmsBundle\Form\Field;
use PSC\System\PluginBundle\Form\Interfaces\CustomFormGroup;
use PSC\System\PluginBundle\Form\Interfaces\Field; use PSC\System\PluginBundle\Form\Interfaces\Field;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag; use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextareaType;
@ -9,7 +10,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
#[AutoconfigureTag('psc.backend.custom.fields')] #[AutoconfigureTag('psc.backend.custom.fields')]
class WysiwygTextContent implements Field class WysiwygTextContent implements Field, CustomFormGroup
{ {
public function getModule(): int public function getModule(): int
{ {
@ -21,6 +22,11 @@ class WysiwygTextContent implements Field
return 'wysiwyg'; return 'wysiwyg';
} }
public function getCustomFormGroup(): string
{
return 'text';
}
public function getTemplate(): string public function getTemplate(): string
{ {
return '@PSCShopCms/backend/edit/fields/text_content.html.twig'; return '@PSCShopCms/backend/edit/fields/text_content.html.twig';
@ -43,7 +49,7 @@ class WysiwygTextContent implements Field
{ {
$data = $event->getData(); $data = $event->getData();
if ($data->getEditorMode() == 'wysiwyg') { if ($data->getEditorMode() == 'wysiwyg') {
$event->getForm()->get('wysiwyg')->get('text')->setData($data->getText()); $event->getForm()->get('text')->get('text')->setData($data->getText());
} }
} }
@ -53,9 +59,10 @@ class WysiwygTextContent implements Field
public function formSubmit(FormEvent $event): void public function formSubmit(FormEvent $event): void
{ {
dump($event);
$data = $event->getData(); $data = $event->getData();
if ($data->getEditorMode() == 'wysiwyg') { if ($data->getEditorMode() == 'wysiwyg') {
$data->setText($event->getForm()->get('wysiwyg')->get('text')->getData()); $data->setText($event->getForm()->get('text')->get('text')->getData());
} }
} }
} }

View File

@ -166,7 +166,19 @@
</div> </div>
{% for customGroup in customGroups %} {% for customGroup in customGroups %}
{% if customGroup.editorMode is defined and customGroup.editorMode %}
{% if cms.editorMode in customGroup.editorMode|split(',') %}
<div id="{{ customGroup.id }}" class="tab-content w-full text-stone-500 text-sm hidden"{% if customGroup.editorMode is defined and customGroup.editorMode %} data-cms-editor-mode="{{ customGroup.editorMode }}"{% endif %}> <div id="{{ customGroup.id }}" class="tab-content w-full text-stone-500 text-sm hidden"{% if customGroup.editorMode is defined and customGroup.editorMode %} data-cms-editor-mode="{{ customGroup.editorMode }}"{% endif %}>
<h6 class="text-sm mt-3 mb-6 font-bold uppercase">{{ customGroup.title|trans }}</h6>
{% for customField in customFields %}
{% if customField.group == customGroup.id and customField.getTemplate %}
{{ include(customField.getTemplate, { 'form': form }) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% else %}
<div id="{{ customGroup.id }}" class="tab-content w-full text-stone-500 text-sm hidden">
<h6 class="text-sm mt-3 mb-6 font-bold uppercase">{{ customGroup.title }}</h6> <h6 class="text-sm mt-3 mb-6 font-bold uppercase">{{ customGroup.title }}</h6>
{% for customField in customFields %} {% for customField in customFields %}
{% if customField.group == customGroup.id and customField.getTemplate %} {% if customField.group == customGroup.id and customField.getTemplate %}
@ -174,15 +186,10 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
{% endfor %}
</div>
</div>
{% for customField in customFields %}
{% if customField.getTemplate %}
{{ include(customField.getTemplate, { 'form': form }) }}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div>
</div>
<div class="text-end my-2"> <div class="text-end my-2">
<button type="submit" name="{{ form.save.vars.full_name }}" class="inline-flex items-center justify-center py-1 gap-1 font-medium rounded-sm px-4 text-sm text-white shadow-lg bg-psc-500 hover:bg-psc-600 hover:ring-2 hover:ring-psc-500 hover:ring-offset-2 min-h-[2.25rem]"> <button type="submit" name="{{ form.save.vars.full_name }}" class="inline-flex items-center justify-center py-1 gap-1 font-medium rounded-sm px-4 text-sm text-white shadow-lg bg-psc-500 hover:bg-psc-600 hover:ring-2 hover:ring-psc-500 hover:ring-offset-2 min-h-[2.25rem]">

View File

@ -182,7 +182,6 @@
<h6 class="text-sm mt-3 mb-6 font-bold uppercase">{{ customGroup.title }}</h6> <h6 class="text-sm mt-3 mb-6 font-bold uppercase">{{ customGroup.title }}</h6>
{% for customField in customFields %} {% for customField in customFields %}
{% if customField.group == customGroup.id and customField.getTemplate %} {% if customField.group == customGroup.id and customField.getTemplate %}
{% dump(customField) %}
{{ include(customField.getTemplate, { 'form': form }) }} {{ include(customField.getTemplate, { 'form': form }) }}
{% endif %} {% endif %}
{% endfor %} {% endfor %}

View File

@ -1,5 +1,5 @@
<div class="flex flex-wrap"> <div class="flex flex-wrap">
<div class="w-full px-4"> <div class="w-full px-4">
{{ form_row(form.html.text, {attr: {'class': 'form-control'}}) }} {{ form_row(form.text.text, {attr: {'class': 'form-control'}}) }}
</div> </div>
</div> </div>

View File

@ -1,5 +1,5 @@
<div class="flex flex-wrap"> <div class="flex flex-wrap">
<div class="w-full px-4"> <div class="w-full px-4">
{{ form_row(form.wysiwyg.text, {attr: {'class': 'form-control summernote'}}) }} {{ form_row(form.text.text, {attr: {'class': 'form-control summernote'}}) }}
</div> </div>
</div> </div>

View File

@ -219,6 +219,13 @@
<button type="button" class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-sm text-xs font-medium text-white bg-red-600 hover:bg-red-700 shadow-sm" @click="showDeleteModal = true"> <button type="button" class="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-sm text-xs font-medium text-white bg-red-600 hover:bg-red-700 shadow-sm" @click="showDeleteModal = true">
{{ 'deleteOrder'|trans }} {{ 'deleteOrder'|trans }}
</button> </button>
{# Löschen - ROT #}
<a href="{{ path("psc_shop_order_backend_upload_deleteAll", {uuid: order.uuid}) }}" title="Uploads löschen" class="inline-flex items-center justify-center gap-1 px-2.5 py-1.5 rounded-md text-xs font-medium text-white bg-red-600 hover:bg-red-700 transition-colors shadow-sm">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
</svg>
Uploads Löschen
</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -135,13 +135,6 @@
</div> </div>
</div> </div>
<div class="flex gap-1.5 justify-end"> <div class="flex gap-1.5 justify-end">
{# Löschen - ROT #}
<a href="{{ path("psc_shop_order_backend_upload_deleteAll", {uuid: order.uuid}) }}" title="Uploads löschen" class="inline-flex items-center justify-center gap-1 px-2.5 py-1.5 rounded-md text-xs font-medium text-white bg-red-600 hover:bg-red-700 transition-colors shadow-sm">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
</svg>
Löschen
</a>
{# Download - GRÜN #} {# Download - GRÜN #}
<a href="{{ path("psc_shop_order_backend_detail_package_download", {uuid: order.uuid}) }}" target="_blank" title="Package Download" class="inline-flex items-center justify-center gap-1 px-2.5 py-1.5 rounded-md text-xs font-medium text-white bg-green-600 hover:bg-green-700 transition-colors shadow-sm"> <a href="{{ path("psc_shop_order_backend_detail_package_download", {uuid: order.uuid}) }}" target="_blank" title="Package Download" class="inline-flex items-center justify-center gap-1 px-2.5 py-1.5 rounded-md text-xs font-medium text-white bg-green-600 hover:bg-green-700 transition-colors shadow-sm">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">

View File

@ -136,8 +136,7 @@ class DoEveryMinuteCommand extends Command
if ($event instanceof ClearCache) { if ($event instanceof ClearCache) {
$fs = new Filesystem(); $fs = new Filesystem();
$fs->dumpFile('/tmp/psc_clear_cache', '1');
//$fs->remove($this->kernel->getCacheDir());
} elseif ($event instanceof InstallPlugin) { } elseif ($event instanceof InstallPlugin) {
$event->setData($job->getData()); $event->setData($job->getData());
$event->setShop($job->getShop()); $event->setShop($job->getShop());

View File

@ -55,6 +55,7 @@ use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\Mailer\Mailer; use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email; use Symfony\Component\Mime\Email;
use Symfony\Component\Mime\Message; use Symfony\Component\Mime\Message;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
@ -365,7 +366,9 @@ class Mail implements QueueInterface, ConfigurableElementInterface
$subject = $this->_template->createTemplate($mailDoc->getSubject()); $subject = $this->_template->createTemplate($mailDoc->getSubject());
$from = $this->_template->createTemplate($mailDoc->getFrom()); $from = $this->_template->createTemplate($mailDoc->getFrom());
$fromName = $this->_template->createTemplate($mailDoc->getFromName());
$to = $this->_template->createTemplate($mailDoc->getTo()); $to = $this->_template->createTemplate($mailDoc->getTo());
$toName = $this->_template->createTemplate($mailDoc->getToName());
$text = null; $text = null;
$html = null; $html = null;
$bcc = null; $bcc = null;
@ -397,8 +400,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new TemplatedEmail() $message = new TemplatedEmail()
->subject($subject->render($params)) ->subject($subject->render($params))
->from($from->render($params)) ->from(
->to(trim($to->render($params))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($params)); $message->text($text->render($params));
} }
@ -479,8 +492,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new TemplatedEmail() $message = new TemplatedEmail()
->subject($subject->render($params)) ->subject($subject->render($params))
->from($from->render($params)) ->from(
->to(trim($to->render($params))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($params)); $message->text($text->render($params));
} }
@ -554,8 +577,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new TemplatedEmail() $message = new TemplatedEmail()
->subject($subject->render($params)) ->subject($subject->render($params))
->from($from->render($params)) ->from(
->to(trim($to->render($params))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($params)); $message->text($text->render($params));
} }
@ -631,8 +664,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new TemplatedEmail() $message = new TemplatedEmail()
->subject($subject->render($params)) ->subject($subject->render($params))
->from($from->render($params)) ->from(
->to(trim($to->render($params))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($params)); $message->text($text->render($params));
} }
@ -705,8 +748,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new TemplatedEmail() $message = new TemplatedEmail()
->subject($subject->render($params)) ->subject($subject->render($params))
->from($from->render($params)) ->from(
->to($to->render($params)); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($params)); $message->text($text->render($params));
} }
@ -749,8 +802,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new TemplatedEmail() $message = new TemplatedEmail()
->subject($subject->render($templateVars->getPosTwigVars($position->getUuid()))) ->subject($subject->render($templateVars->getPosTwigVars($position->getUuid())))
->from($from->render($templateVars->getPosTwigVars($position->getUuid()))) ->from(
->to($to->render($templateVars->getPosTwigVars($position->getUuid()))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($templateVars->getPosTwigVars($position->getUuid()))); $message->text($text->render($templateVars->getPosTwigVars($position->getUuid())));
} }
@ -919,8 +982,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new TemplatedEmail() $message = new TemplatedEmail()
->subject($subject->render($templateVars->getTwigVars())) ->subject($subject->render($templateVars->getTwigVars()))
->from($from->render($templateVars->getTwigVars())) ->from(
->to(trim($to->render($templateVars->getTwigVars()))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($templateVars->getTwigVars())); $message->text($text->render($templateVars->getTwigVars()));
} }
@ -1052,8 +1125,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new Email() $message = new Email()
->subject($subject->render($params)) ->subject($subject->render($params))
->from($from->render($params)) ->from(
->to(trim($to->render($params))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($params)); $message->text($text->render($params));
} }
@ -1120,8 +1203,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new Email() $message = new Email()
->subject($subject->render($params)) ->subject($subject->render($params))
->from($from->render($params)) ->from(
->to(trim($to->render($params))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($params)); $message->text($text->render($params));
} }
@ -1177,8 +1270,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new Email() $message = new Email()
->subject($subject->render($vars)) ->subject($subject->render($vars))
->from($from->render($vars)) ->from(
->to(trim($to->render($vars))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($vars)); $message->text($text->render($vars));
} }
@ -1296,8 +1399,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new Email() $message = new Email()
->subject($subject->render($vars)) ->subject($subject->render($vars))
->from($from->render($vars)) ->from(
->to(trim($to->render($vars))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($vars)); $message->text($text->render($vars));
} }
@ -1411,8 +1524,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new Email() $message = new Email()
->subject($subject->render($vars)) ->subject($subject->render($vars))
->from($from->render($vars)) ->from(
->to(trim($to->render($vars))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($vars)); $message->text($text->render($vars));
} }
@ -1531,8 +1654,18 @@ class Mail implements QueueInterface, ConfigurableElementInterface
try { try {
$message = new Email() $message = new Email()
->subject($subject->render($vars)) ->subject($subject->render($vars))
->from($from->render($vars)) ->from(
->to(trim($to->render($vars))); new Address(
$from->render($templateVars->getTwigVars()),
$fromName->render($templateVars->getTwigVars()),
),
)
->to(
new Address(
$to->render($templateVars->getTwigVars()),
$toName->render($templateVars->getTwigVars()),
),
);
if ($text) { if ($text) {
$message->text($text->render($vars)); $message->text($text->render($vars));
} }

View File

@ -53,12 +53,21 @@ class ListController extends AbstractController
*/ */
#[Route(path: '/cache/clear', name: 'psc_system_plugin_backend_clear_cache')] #[Route(path: '/cache/clear', name: 'psc_system_plugin_backend_clear_cache')]
#[Template('@PSCSystemPlugin/backend/list/clearcache.html.twig')] #[Template('@PSCSystemPlugin/backend/list/clearcache.html.twig')]
public function clearcacheAction(Assets $assetsService) public function clearcacheAction(Assets $assetsService, \PSC\Shop\QueueBundle\Service\Event\Manager $eventManager, KernelInterface $kernel)
{ {
$assetsService->install(); $assetsService->install();
$fs = new Filesystem();
$fs->remove($this->getParameter('kernel.cache_dir')); // Cache atomar über externes Script leeren (ohne laufende Prozesse zu stören)
$script = $kernel->getProjectDir() . '/bin/clear-cache.php';
$command = sprintf('%s %s 2>&1 &', PHP_BINARY, escapeshellarg($script));
exec($command);
// Cron-Container benachrichtigen
$notify = new ClearCache();
$notify->setShop(null);
$eventManager->addJob($notify);
header('location: /apps/backend/plugin/list'); header('location: /apps/backend/plugin/list');
die(); die();
} }

View File

@ -0,0 +1,8 @@
<?php
namespace PSC\System\PluginBundle\Form\Interfaces;
interface CustomFormGroup
{
public function getCustomFormGroup(): string;
}

View File

@ -1,16 +1,19 @@
info: info:
datum: 26.03.2026 datum: 01.04.2026
release: 2.3.5 release: 2.3.5
changelog: changelog:
- version: 2.3.5 - version: 2.3.5
datum: 26.03.2026 datum: 01.04.2026
changes: changes:
- "Aktionen der An und Von Name wird jetzt ans Mailsystem übergeben"
- text: "CMS ContentBuilder Plugin kann aktiviert. (Custom Plugin und das Storefront Template muss die Ausgabe unterstützen)" - text: "CMS ContentBuilder Plugin kann aktiviert. (Custom Plugin und das Storefront Template muss die Ausgabe unterstützen)"
images: images:
- "screen1.png" - "screen1.png"
- "screen2.png" - "screen2.png"
- "CMS Wysiwyg respektieren von h,ul tags" - "CMS Wysiwyg respektieren von h,ul tags"
- "Account kann bei der Registrierung übergeben werden"
- "Clear Cache rewrite"
- "Löschen von Kunden wenn kein Afträge da." - "Löschen von Kunden wenn kein Afträge da."
- version: 2.3.4 - version: 2.3.4
datum: 19.03.2026 datum: 19.03.2026

View File

@ -3696,6 +3696,9 @@ class UserController extends TP_Controller_Action
$contact->enable = false; $contact->enable = false;
$contact->Install = $this->shop->Install; $contact->Install = $this->shop->Install;
$contact->account_id = $this->shop->default_account; $contact->account_id = $this->shop->default_account;
if (isset($formData['rech']['account'])) {
$contact->account_id = $formData['rech']['account'];
}
if ($this->_getParam('hn', false)) { if ($this->_getParam('hn', false)) {
$account = Doctrine_Query::create() $account = Doctrine_Query::create()
@ -5004,9 +5007,7 @@ class UserController extends TP_Controller_Action
$basket->clear(); $basket->clear();
} }
public function cregisterAction() public function cregisterAction() {}
{
}
/** /**
* LayouterLoginaktion * LayouterLoginaktion