Backup
This commit is contained in:
parent
fbd0cbf43e
commit
3f14580904
@ -178,9 +178,13 @@ class Preview extends AbstractController
|
||||
}
|
||||
|
||||
if ($element->getType() == ElementType::Image && $formData[$element->getId()]['value'] instanceof Media) {
|
||||
if ($element->getImage()->aspectRatio == null) {
|
||||
$formData[$element->getId()]['value'] = $formData[$element->getId()]['value'];
|
||||
} else {
|
||||
$formData[$element->getId()]['value'] = $formData[$element->getId()]['value']->getVariant($element->getImage()->aspectRatio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->mpdf->setData($formData);
|
||||
$this->mpdf->generate($type == 2);
|
||||
|
||||
@ -165,8 +165,12 @@ class Save extends AbstractController
|
||||
if ($elm = $data->getElement($element, $contact)) {
|
||||
if ($element->getType() == ElementType::Image && $elm['value'] != '') {
|
||||
$media = $this->mediaManager->getModelByUuid($elm['value']);
|
||||
if ($element->getImage()->aspectRatio == null) {
|
||||
$formData[$element->getId()] = ['value' => $media, 'enable' => (bool) $elm['enable']];
|
||||
} else {
|
||||
$elmMedia = $media->getVariant($element->getImage()->aspectRatio);
|
||||
$formData[$element->getId()] = ['value' => $elmMedia, 'enable' => (bool) $elm['enable']];
|
||||
}
|
||||
} else {
|
||||
$formData[$element->getId()] = ['value' => $elm['value'], 'enable' => (bool) $elm['enable']];
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@ use Doctrine\ODM\MongoDB\DocumentManager;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface;
|
||||
use OpenApi\Attributes\Response;
|
||||
use PSC\Shop\MediaBundle\Service\MediaManager;
|
||||
use Plugin\Custom\PSC\CollectLayouter\Dto\Preview\Input;
|
||||
use Plugin\Custom\PSC\CollectLayouter\Helper\MPDF;
|
||||
use Plugin\Custom\PSC\CollectLayouter\Model\Element;
|
||||
@ -16,6 +15,7 @@ use Plugin\Custom\PSC\CollectLayouter\Model\Setting;
|
||||
use PSC\Shop\ContactBundle\Repository\ContactRepository;
|
||||
use PSC\Shop\ContactBundle\Transformer\Model\Contact;
|
||||
use PSC\Shop\EntityBundle\Entity\Product;
|
||||
use PSC\Shop\MediaBundle\Service\MediaManager;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@ -27,31 +27,35 @@ use Symfony\Component\Serializer\SerializerInterface;
|
||||
class DesignerController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
readonly private Contact $contactTransformer,
|
||||
readonly private MPDF $mpdf,
|
||||
readonly private EntityManagerInterface $entityManager,
|
||||
readonly private DocumentManager $documentManager,
|
||||
readonly private SerializerInterface $serializer,
|
||||
readonly private RequestStack $requestStack,
|
||||
readonly private MediaManager $mediaManager
|
||||
private readonly Contact $contactTransformer,
|
||||
private readonly MPDF $mpdf,
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly DocumentManager $documentManager,
|
||||
private readonly SerializerInterface $serializer,
|
||||
private readonly RequestStack $requestStack,
|
||||
private readonly MediaManager $mediaManager,
|
||||
) {}
|
||||
|
||||
#[Template]
|
||||
#[Route('/start/{productUuid}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_start', defaults: [
|
||||
'contactUuid' => '',
|
||||
])]
|
||||
public function start(
|
||||
ContactRepository $contactRepository,
|
||||
\PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer,
|
||||
JWTTokenManagerInterface $JWTTokenManager,
|
||||
string $productUuid,
|
||||
string $contactUuid = '',
|
||||
) {
|
||||
}
|
||||
|
||||
#[Template()]
|
||||
#[Route('/start/{productUuid}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_start', defaults: ['contactUuid' => ''])]
|
||||
public function start(ContactRepository $contactRepository, \PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer, JWTTokenManagerInterface $JWTTokenManager, string $productUuid, string $contactUuid = "")
|
||||
{
|
||||
|
||||
/** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */
|
||||
$product = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->findOneBy(array('uuid' => $productUuid));
|
||||
|
||||
->findOneBy(['uuid' => $productUuid]);
|
||||
|
||||
/** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */
|
||||
$productDoc = $this->documentManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Document\Product')
|
||||
->findOneBy(array('uid' => (string)$product->getUid()));
|
||||
->findOneBy(['uid' => (string) $product->getUid()]);
|
||||
|
||||
$token = null;
|
||||
if ($contactUuid) {
|
||||
@ -59,36 +63,52 @@ class DesignerController extends AbstractController
|
||||
$token = $JWTTokenManager->create($user);
|
||||
}
|
||||
/** @var Setting $settings */
|
||||
$settings = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json');
|
||||
$settings = $this->serializer->deserialize(
|
||||
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
|
||||
Setting::class,
|
||||
'json',
|
||||
);
|
||||
return [
|
||||
'product' => $product,
|
||||
'productDoc' => $productDoc,
|
||||
'contactUuid' => $contactUuid,
|
||||
'settings' => $settings,
|
||||
'jwt' => $token ?: ''
|
||||
'jwt' => $token ?: '',
|
||||
];
|
||||
}
|
||||
|
||||
#[Template()]
|
||||
#[Route('/startcollect/{productUuid}/{mode}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_collect', defaults: ['contactUuid' => '', 'mode' => 1])]
|
||||
public function collect(ContactRepository $contactRepository, \PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer, JWTTokenManagerInterface $JWTTokenManager, string $productUuid, string $contactUuid = "", int $mode = 1)
|
||||
{
|
||||
|
||||
#[Template]
|
||||
#[Route(
|
||||
'/startcollect/{productUuid}/{mode}/{contactUuid}',
|
||||
name: 'plugin_custom_psc_collectlayouter_collect',
|
||||
defaults: ['contactUuid' => '', 'mode' => 1],
|
||||
)]
|
||||
public function collect(
|
||||
ContactRepository $contactRepository,
|
||||
\PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer,
|
||||
JWTTokenManagerInterface $JWTTokenManager,
|
||||
string $productUuid,
|
||||
string $contactUuid = '',
|
||||
int $mode = 1,
|
||||
) {
|
||||
/** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */
|
||||
$product = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->findOneBy(array('uuid' => $productUuid));
|
||||
|
||||
->findOneBy(['uuid' => $productUuid]);
|
||||
|
||||
/** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */
|
||||
$productDoc = $this->documentManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Document\Product')
|
||||
->findOneBy(array('uid' => (string)$product->getUid()));
|
||||
->findOneBy(['uid' => (string) $product->getUid()]);
|
||||
|
||||
$token = $JWTTokenManager->create($this->getUser());
|
||||
|
||||
/** @var Setting $settings */
|
||||
$settings = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json');
|
||||
$settings = $this->serializer->deserialize(
|
||||
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
|
||||
Setting::class,
|
||||
'json',
|
||||
);
|
||||
return [
|
||||
'product' => $product,
|
||||
'productDoc' => $productDoc,
|
||||
@ -96,31 +116,40 @@ class DesignerController extends AbstractController
|
||||
'settings' => $settings,
|
||||
'jwt' => $token ?: '',
|
||||
'layouterUuid' => Uuid::uuid4(),
|
||||
'mode' => $mode
|
||||
'mode' => $mode,
|
||||
];
|
||||
}
|
||||
|
||||
#[Template()]
|
||||
#[Route('/loadcollect/{productId}/{layouterId}', name: 'plugin_custom_psc_collectlayouter_loadcollect', defaults: ['contactUuid' => ''])]
|
||||
public function loadCollect(ContactRepository $contactRepository, \PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer, JWTTokenManagerInterface $JWTTokenManager, string $productId, string $layouterId)
|
||||
{
|
||||
|
||||
#[Template]
|
||||
#[Route('/loadcollect/{productId}/{layouterId}', name: 'plugin_custom_psc_collectlayouter_loadcollect', defaults: [
|
||||
'contactUuid' => '',
|
||||
])]
|
||||
public function loadCollect(
|
||||
ContactRepository $contactRepository,
|
||||
\PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer,
|
||||
JWTTokenManagerInterface $JWTTokenManager,
|
||||
string $productId,
|
||||
string $layouterId,
|
||||
) {
|
||||
/** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */
|
||||
$product = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->findOneBy(array('uuid' => $productId));
|
||||
|
||||
->findOneBy(['uuid' => $productId]);
|
||||
|
||||
/** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */
|
||||
$productDoc = $this->documentManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Document\Product')
|
||||
->findOneBy(array('uid' => (string)$product->getUid()));
|
||||
|
||||
->findOneBy(['uid' => (string) $product->getUid()]);
|
||||
|
||||
/** @var Setting $settings */
|
||||
$settings = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json');
|
||||
$settings = $this->serializer->deserialize(
|
||||
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
|
||||
Setting::class,
|
||||
'json',
|
||||
);
|
||||
$layoutDesignData = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')->findOneBy(array('uuid' => $layouterId));
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')
|
||||
->findOneBy(['uuid' => $layouterId]);
|
||||
|
||||
$token = $JWTTokenManager->create($this->getUser());
|
||||
|
||||
@ -131,31 +160,41 @@ class DesignerController extends AbstractController
|
||||
'settings' => $settings,
|
||||
'jwt' => $token ?: '',
|
||||
'layouterId' => $layouterId,
|
||||
'data' => $layoutDesignData->getDesign()['data']
|
||||
'data' => $layoutDesignData->getDesign()['data'],
|
||||
];
|
||||
}
|
||||
|
||||
#[Template()]
|
||||
#[Route('/load/{productId}/{layouterId}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_load', defaults: ['contactUuid' => ''])]
|
||||
public function load(ContactRepository $contactRepository, \PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer, JWTTokenManagerInterface $JWTTokenManager, string $productId, string $layouterId, string $contactUuid = "")
|
||||
{
|
||||
|
||||
#[Template]
|
||||
#[Route('/load/{productId}/{layouterId}/{contactUuid}', name: 'plugin_custom_psc_collectlayouter_load', defaults: [
|
||||
'contactUuid' => '',
|
||||
])]
|
||||
public function load(
|
||||
ContactRepository $contactRepository,
|
||||
\PSC\Shop\ContactBundle\Transformer\Model\Contact $contactTransformer,
|
||||
JWTTokenManagerInterface $JWTTokenManager,
|
||||
string $productId,
|
||||
string $layouterId,
|
||||
string $contactUuid = '',
|
||||
) {
|
||||
/** @var \Plugin\Custom\PSC\Pitchprint\Controller\Frontend\Product $product */
|
||||
$product = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->findOneBy(array('uuid' => $productId));
|
||||
|
||||
->findOneBy(['uuid' => $productId]);
|
||||
|
||||
/** @var \PSC\Shop\EntityBundle\Document\Product $productDoc */
|
||||
$productDoc = $this->documentManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Document\Product')
|
||||
->findOneBy(array('uid' => (string)$product->getUid()));
|
||||
|
||||
->findOneBy(['uid' => (string) $product->getUid()]);
|
||||
|
||||
/** @var Setting $settings */
|
||||
$settings = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json');
|
||||
$settings = $this->serializer->deserialize(
|
||||
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
|
||||
Setting::class,
|
||||
'json',
|
||||
);
|
||||
$layoutDesignData = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')->findOneBy(array('uuid' => $layouterId));
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')
|
||||
->findOneBy(['uuid' => $layouterId]);
|
||||
|
||||
$token = null;
|
||||
if ($contactUuid) {
|
||||
@ -170,7 +209,7 @@ class DesignerController extends AbstractController
|
||||
'settings' => $settings,
|
||||
'jwt' => $token ?: '',
|
||||
'layouterId' => $layouterId,
|
||||
'data' => $layoutDesignData->getDesign()['data']
|
||||
'data' => $layoutDesignData->getDesign()['data'],
|
||||
];
|
||||
}
|
||||
|
||||
@ -178,32 +217,50 @@ class DesignerController extends AbstractController
|
||||
public function preview(string $uuid, string $contact, int $type = 1): Response
|
||||
{
|
||||
$product = $this->entityManager->getRepository(Product::class)->findOneBy(['uuid' => $uuid]);
|
||||
$contactEntity = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Contact::class)->findOneBy(['uuid' => $contact]);
|
||||
|
||||
$productDoc = $this->documentManager->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)->findOneBy(['uid' => $product->getUID()]);
|
||||
$setting = $this->serializer->deserialize($productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}', Setting::class, 'json');
|
||||
$contactEntity = $this->entityManager
|
||||
->getRepository(\PSC\Shop\EntityBundle\Entity\Contact::class)
|
||||
->findOneBy(['uuid' => $contact]);
|
||||
|
||||
$productDoc = $this->documentManager
|
||||
->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)
|
||||
->findOneBy(['uid' => $product->getUID()]);
|
||||
$setting = $this->serializer->deserialize(
|
||||
$productDoc->getPluginSettingModule('collectlayouter', 'config') ?? '{}',
|
||||
Setting::class,
|
||||
'json',
|
||||
);
|
||||
|
||||
$contact = new \PSC\Shop\ContactBundle\Model\Contact();
|
||||
$this->contactTransformer->fromDb($contact, $contactEntity);
|
||||
|
||||
$this->mpdf->setSetting($setting);
|
||||
$data = $this->serializer->deserialize($this->requestStack->getSession()->get('collectLayouterData', '{}'), Input::class, 'json');
|
||||
$data = $this->serializer->deserialize(
|
||||
$this->requestStack->getSession()->get('collectLayouterData', '{}'),
|
||||
Input::class,
|
||||
'json',
|
||||
);
|
||||
$formData = [];
|
||||
|
||||
/** @var Element $element */
|
||||
foreach ($setting->getCustomerForm() as $element) {
|
||||
$value = match ($element->getBinding()) {
|
||||
ElementBinding::none => $element->getDefaultForTypePreview(),
|
||||
ElementBinding::StreetHouseNumber => ['street' => $contact->getLayouterData()->getStreet() ?? $element->getDefault1(), 'houseNumber' => $contact->getLayouterData()->getHouseNumber() ?? $element->getDefault2()],
|
||||
ElementBinding::ZipCity => ['zip' => $contact->getLayouterData()->getZip() ?? $element->getDefault1(), 'city' => $contact->getLayouterData()->getCity() ?? $element->getDefault2()],
|
||||
ElementBinding::StreetHouseNumber => [
|
||||
'street' => $contact->getLayouterData()->getStreet() ?? $element->getDefault1(),
|
||||
'houseNumber' => $contact->getLayouterData()->getHouseNumber() ?? $element->getDefault2(),
|
||||
],
|
||||
ElementBinding::ZipCity => [
|
||||
'zip' => $contact->getLayouterData()->getZip() ?? $element->getDefault1(),
|
||||
'city' => $contact->getLayouterData()->getCity() ?? $element->getDefault2(),
|
||||
],
|
||||
ElementBinding::Firstname => $contact->getLayouterData()->getFirstname() ?? $element->getDefault1(),
|
||||
ElementBinding::Lastname => $contact->getLayouterData()->getLastname() ?? $element->getDefault1(),
|
||||
ElementBinding::Mobile => [
|
||||
'areacode' => $contact->getLayouterData()->getMobileAreaCode() ?? $element->getDefault1(),
|
||||
'appendix' => $contact->getLayouterData()->getMobileAppendix() ?? $element->getDefault2(),
|
||||
'number' => $contact->getLayouterData()->getMobile() ?? $element->getDefault3(),
|
||||
'prefix' => $contact->getLayouterData()->getMobilePrefix() ?? $element->getDefault4()],
|
||||
'prefix' => $contact->getLayouterData()->getMobilePrefix() ?? $element->getDefault4(),
|
||||
],
|
||||
ElementBinding::UsernameLogin => $contact->getEmail() ?? $element->getDefault1(),
|
||||
ElementBinding::Company => $contact->getLayouterData()->getCompany() ?? $element->getDefault1(),
|
||||
ElementBinding::Company2 => $contact->getLayouterData()->getCompany2() ?? $element->getDefault1(),
|
||||
@ -215,12 +272,14 @@ class DesignerController extends AbstractController
|
||||
'areacode' => $contact->getLayouterData()->getPhoneAreaCode() ?? $element->getDefault1(),
|
||||
'appendix' => $contact->getLayouterData()->getPhoneAppendix() ?? $element->getDefault2(),
|
||||
'number' => $contact->getLayouterData()->getPhone() ?? $element->getDefault3(),
|
||||
'prefix' => $contact->getLayouterData()->getPhonePrefix() ?? $element->getDefault4()],
|
||||
'prefix' => $contact->getLayouterData()->getPhonePrefix() ?? $element->getDefault4(),
|
||||
],
|
||||
ElementBinding::Fax => [
|
||||
'areacode' => $contact->getLayouterData()->getFaxAreaCode() ?? $element->getDefault1(),
|
||||
'appendix' => $contact->getLayouterData()->getFaxPrefix() ?? $element->getDefault2(),
|
||||
'number' => $contact->getLayouterData()->getFax() ?? $element->getDefault3(),
|
||||
'prefix' => $contact->getLayouterData()->getFaxAppendix() ?? $element->getDefault4()],
|
||||
'prefix' => $contact->getLayouterData()->getFaxAppendix() ?? $element->getDefault4(),
|
||||
],
|
||||
ElementBinding::Abteilung => $contact->getLayouterData()->getAbteilung() ?? $element->getDefault1(),
|
||||
ElementBinding::Custom1 => $contact->getCustom1() ?? $element->getDefault1(),
|
||||
ElementBinding::Custom2 => $contact->getCustom2() ?? $element->getDefault1(),
|
||||
@ -247,8 +306,12 @@ class DesignerController extends AbstractController
|
||||
ElementBinding::Custom23 => $contact->getCustom23() ?? $element->getDefault1(),
|
||||
ElementBinding::Custom24 => $contact->getCustom24() ?? $element->getDefault1(),
|
||||
ElementBinding::LayouterMail => $contact->getLayouterData()->getEmail() ?? $element->getDefault1(),
|
||||
ElementBinding::LayouterCountryName => $contact->getLayouterData()->getCountryName() ?? $element->getDefault1(),
|
||||
ElementBinding::LayouterCountryCode => $contact->getLayouterData()->getCountryCode() ?? $element->getDefault1(),
|
||||
ElementBinding::LayouterCountryName => $contact
|
||||
->getLayouterData()
|
||||
->getCountryName() ?? $element->getDefault1(),
|
||||
ElementBinding::LayouterCountryCode => $contact
|
||||
->getLayouterData()
|
||||
->getCountryCode() ?? $element->getDefault1(),
|
||||
ElementBinding::Birthday => $contact->getLayouterData()->getBirthday() ?? $element->getDefault1(),
|
||||
ElementBinding::Homepages => $contact->getLayouterData()->getHomepage() ?? $element->getDefault1(),
|
||||
ElementBinding::Salutation => $contact->getLayouterData()->getSalutation() ?? $element->getDefault1(),
|
||||
@ -261,17 +324,23 @@ class DesignerController extends AbstractController
|
||||
};
|
||||
|
||||
if ($elm = $data->getElement($element, $contact)) {
|
||||
if ($element->getType() == ElementType::Image && $elm['value'] != "") {
|
||||
if ($element->getType() == ElementType::Image && $elm['value'] != '') {
|
||||
$media = $this->mediaManager->getModelByUuid($elm['value']);
|
||||
if ($element->getImage()->aspectRatio == null) {
|
||||
$formData[$element->getId()] = ['value' => $media, 'enable' => (bool) $elm['enable']];
|
||||
} else {
|
||||
$elmMedia = $media->getVariant($element->getImage()->aspectRatio);
|
||||
$formData[$element->getId()] = ['value' => $elmMedia, 'enable' => (bool) $elm['enable']];
|
||||
}
|
||||
} else {
|
||||
$formData[$element->getId()] = ['value' => $elm['value'], 'enable' => $elm['enable']];
|
||||
}
|
||||
} else {
|
||||
$formData[$element->getId()] = ['value' => $value, 'enable' => $element->getOptional() ? $element->getOptionalDefault() : true];
|
||||
$formData[$element->getId()] = [
|
||||
'value' => $value,
|
||||
'enable' => $element->getOptional() ? $element->getOptionalDefault() : true,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->mpdf->setData($formData);
|
||||
@ -279,7 +348,6 @@ class DesignerController extends AbstractController
|
||||
$outfilename = $this->mpdf->getPdfFile();
|
||||
$response = new \Symfony\Component\HttpFoundation\Response();
|
||||
|
||||
|
||||
$filename = '';
|
||||
if (isset($formData['firstname'])) {
|
||||
$filename = $formData['firstname']['value'] . '_';
|
||||
|
||||
@ -5,15 +5,14 @@ namespace Plugin\System\PSC\Bootstrap4\Form\Field;
|
||||
use DirectoryIterator;
|
||||
use PSC\Shop\EntityBundle\Entity\Shop;
|
||||
use PSC\System\PluginBundle\Form\Interfaces\Field;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
class Formulare extends AbstractController implements Field
|
||||
{
|
||||
|
||||
private $options;
|
||||
|
||||
public function getTemplate()
|
||||
@ -31,13 +30,11 @@ class Formulare extends AbstractController implements Field
|
||||
*/
|
||||
public function formPreSubmit(FormEvent $event)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$txt = "";
|
||||
$txt = '';
|
||||
$this->options = $options;
|
||||
|
||||
/** @var Shop $shopEntity */
|
||||
@ -45,89 +42,118 @@ class Formulare extends AbstractController implements Field
|
||||
$tempLayouts = [];
|
||||
if ($shopEntity->isCustomTemplates() == 1) {
|
||||
foreach (new DirectoryIterator('/data/www/old/application/design/vorlagen') as $file) {
|
||||
if ($file == '.' || $file == '..' || $file == 'config' || $file == '.svn' || $file == 'datapacks' || $file == '.DS_Store') {
|
||||
if (
|
||||
$file == '.' ||
|
||||
$file == '..' ||
|
||||
$file == 'config' ||
|
||||
$file == '.svn' ||
|
||||
$file == 'datapacks' ||
|
||||
$file == '.DS_Store'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$tempLayouts[$file->getFileName()] = $file->getFileName();
|
||||
}
|
||||
} else {
|
||||
if (file_exists('/data/www/old/application/design/clients/' . $shopEntity->getUID())) {
|
||||
foreach (new DirectoryIterator('/data/www/old/application/design/clients/' . $shopEntity->getUID()) as $file) {
|
||||
if ($file == '.' || $file == '..' || $file == 'config' || $file == '.svn' || $file == 'datapacks' || $file == '.DS_Store') {
|
||||
foreach (new DirectoryIterator('/data/www/old/application/design/clients/' .
|
||||
$shopEntity->getUID()) as $file) {
|
||||
if (
|
||||
$file == '.' ||
|
||||
$file == '..' ||
|
||||
$file == 'config' ||
|
||||
$file == '.svn' ||
|
||||
$file == 'datapacks' ||
|
||||
$file == '.DS_Store'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$tempLayouts[$file->getFileName()] = $file->getFileName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
|
||||
if (isset($_POST['settings']['bootstrap4Images']['layout'])) {
|
||||
header('location: /apps/backend/theme/settings');
|
||||
|
||||
//die();
|
||||
} else {
|
||||
//copy("/data/www/old/public/styles/vorlagen/" . $shopEntity->getLayout() . "/bootstrap/css/style.css","/data/www/old/public/styles/vorlagen/" . $shopEntity->getLayout() . "/bootstrap/css/style_bakup.css");
|
||||
$filenamelogin = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/login.ini";
|
||||
$filenamelogin =
|
||||
'/data/www/old/application/design/vorlagen/' . $shopEntity->getLayout() . '/config/user/login.ini';
|
||||
if (file_exists($filenamelogin)) {
|
||||
$handlelogin = fopen($filenamelogin, 'r');
|
||||
$txtlogin = fread($handlelogin, filesize($filenamelogin));
|
||||
fclose($handlelogin);
|
||||
} else {
|
||||
$txtlogin = '';
|
||||
}
|
||||
|
||||
$filenameregister = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/registercontact.ini";
|
||||
$filenameregister =
|
||||
'/data/www/old/application/design/vorlagen/' .
|
||||
$shopEntity->getLayout() .
|
||||
'/config/user/registercontact.ini';
|
||||
$handleregister = fopen($filenameregister, 'r');
|
||||
$txtregister = fread($handleregister, filesize($filenameregister));
|
||||
fclose($handleregister);
|
||||
|
||||
$filenamepass = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/resetpassword.ini";
|
||||
$filenamepass =
|
||||
'/data/www/old/application/design/vorlagen/' .
|
||||
$shopEntity->getLayout() .
|
||||
'/config/user/resetpassword.ini';
|
||||
$handlepass = fopen($filenamepass, 'r');
|
||||
$txtpass = fread($handlepass, filesize($filenamepass));
|
||||
fclose($handlepass);
|
||||
|
||||
$filenameaddress = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/updatecontact.ini";
|
||||
$filenameaddress =
|
||||
'/data/www/old/application/design/vorlagen/' .
|
||||
$shopEntity->getLayout() .
|
||||
'/config/user/updatecontact.ini';
|
||||
$handleaddress = fopen($filenameaddress, 'r');
|
||||
$txtaddress = fread($handleaddress, filesize($filenameaddress));
|
||||
fclose($handleaddress);
|
||||
|
||||
$filenameaddaddress = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/user/address.ini";
|
||||
$filenameaddaddress =
|
||||
'/data/www/old/application/design/vorlagen/' . $shopEntity->getLayout() . '/config/user/address.ini';
|
||||
$handleaddaddress = fopen($filenameaddaddress, 'r');
|
||||
$txtaddaddress = fread($handleaddaddress, filesize($filenameaddaddress));
|
||||
fclose($handleaddaddress);
|
||||
}
|
||||
|
||||
$builder
|
||||
->add('formularelogin', TextareaType::class, array(
|
||||
->add('formularelogin', TextareaType::class, [
|
||||
'label' => 'login ini',
|
||||
'data' => $txtlogin,
|
||||
'required' => false,
|
||||
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formularelogin');")
|
||||
))
|
||||
->add('formulareloginedit', HiddenType::class, array('required' => false, 'data' => 0))
|
||||
->add('formulareregister', TextareaType::class, array(
|
||||
'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formularelogin');"],
|
||||
])
|
||||
->add('formulareloginedit', HiddenType::class, ['required' => false, 'data' => 0])
|
||||
->add('formulareregister', TextareaType::class, [
|
||||
'label' => 'registercontact ini',
|
||||
'data' => $txtregister,
|
||||
'required' => false,
|
||||
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formulareregister');")
|
||||
))
|
||||
->add('formulareregisteredit', HiddenType::class, array('required' => false, 'data' => 0))
|
||||
->add('formularepass', TextareaType::class, array(
|
||||
'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formulareregister');"],
|
||||
])
|
||||
->add('formulareregisteredit', HiddenType::class, ['required' => false, 'data' => 0])
|
||||
->add('formularepass', TextareaType::class, [
|
||||
'label' => 'resetpassword ini',
|
||||
'data' => $txtpass,
|
||||
'required' => false,
|
||||
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formularepass');")
|
||||
))
|
||||
->add('formularepassedit', HiddenType::class, array('required' => false, 'data' => 0))
|
||||
->add('formulareaddress', TextareaType::class, array(
|
||||
'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formularepass');"],
|
||||
])
|
||||
->add('formularepassedit', HiddenType::class, ['required' => false, 'data' => 0])
|
||||
->add('formulareaddress', TextareaType::class, [
|
||||
'label' => 'updatecontact ini',
|
||||
'data' => $txtaddress,
|
||||
'required' => false,
|
||||
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formulareaddress');")
|
||||
))
|
||||
->add('formulareaddressedit', HiddenType::class, array('required' => false, 'data' => 0))
|
||||
->add('formulareaddaddress', TextareaType::class, array(
|
||||
'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formulareaddress');"],
|
||||
])
|
||||
->add('formulareaddressedit', HiddenType::class, ['required' => false, 'data' => 0])
|
||||
->add('formulareaddaddress', TextareaType::class, [
|
||||
'label' => 'Address ini',
|
||||
'data' => $txtaddaddress,
|
||||
'required' => false,
|
||||
'attr' => array('rows' => 50, 'onclick' => "onchangeformulare('formulareaddaddress');")
|
||||
))
|
||||
->add('formulareaddaddressedit', HiddenType::class, array('required' => false, 'data' => 0))
|
||||
;
|
||||
'attr' => ['rows' => 50, 'onclick' => "onchangeformulare('formulareaddaddress');"],
|
||||
])
|
||||
->add('formulareaddaddressedit', HiddenType::class, ['required' => false, 'data' => 0]);
|
||||
|
||||
return $builder;
|
||||
}
|
||||
@ -142,7 +168,11 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
|
||||
/** @var Shop $shopEntity */
|
||||
$shopEntity = $this->options['shopEntity'];
|
||||
$layoutSettings = json_decode($shopEntity->getLayoutSettings(), true);
|
||||
$event->getForm()->get('bootstrap4General')->get('displayArticleCount')->setData($shopEntity->getDisplayArticleCount());
|
||||
$event
|
||||
->getForm()
|
||||
->get('bootstrap4General')
|
||||
->get('displayArticleCount')
|
||||
->setData($shopEntity->getDisplayArticleCount());
|
||||
$event->getForm()->get('bootstrap4General')->get('basketField1')->setData($shopEntity->getBasketfield1());
|
||||
$event->getForm()->get('bootstrap4General')->get('basketField2')->setData($shopEntity->getBasketfield2());
|
||||
$event->getForm()->get('bootstrap4General')->get('basketPosField1')->setData($shopEntity->getBasketposfield1());
|
||||
@ -151,51 +181,88 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
|
||||
$event->getForm()->get('bootstrap4General')->get('displayDelivery')->setData($shopEntity->getDisplayDelivery());
|
||||
$event->getForm()->get('bootstrap4General')->get('layout')->setData($shopEntity->getLayout());
|
||||
$event->getForm()->get('bootstrap4General')->get('customTemplates')->setData($shopEntity->isCustomTemplates());
|
||||
$event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->setData($shopEntity->getGoogleanalyticscode());
|
||||
$event
|
||||
->getForm()
|
||||
->get('bootstrap4General')
|
||||
->get('googleanalyticscode')
|
||||
->setData($shopEntity->getGoogleanalyticscode());
|
||||
$event->getForm()->get('bootstrap4General')->get('defaultFunc')->setData($shopEntity->getDefaultFunc());
|
||||
$event->getForm()->get('bootstrap4General')->get('defaultParam')->setData($shopEntity->getDefaultParam());
|
||||
$event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->setData($shopEntity->isTemplateDisplayProductsCrossselling());
|
||||
$event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->setData($shopEntity->isTemplateDisplayUserApproval());
|
||||
|
||||
$event
|
||||
->getForm()
|
||||
->get('bootstrap4General')
|
||||
->get('templateDisplayProductsCrossselling')
|
||||
->setData($shopEntity->isTemplateDisplayProductsCrossselling());
|
||||
$event
|
||||
->getForm()
|
||||
->get('bootstrap4General')
|
||||
->get('templateDisplayUserApproval')
|
||||
->setData($shopEntity->isTemplateDisplayUserApproval());
|
||||
}
|
||||
|
||||
public function formPostSubmit(FormEvent $event)
|
||||
{
|
||||
/** @var Shop $shopEntity */
|
||||
$shopEntity = $this->options['shopEntity'];
|
||||
if($event->getForm()->get('bootstrap4Style')->get('write')->getData() == "1") {
|
||||
if($event->getForm()->get('bootstrap4Formulare')->get('formulareloginedit')->getData() == "1") {
|
||||
$filenamelogin = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/login.ini";
|
||||
if ($event->getForm()->get('bootstrap4Style')->get('write')->getData() == '1') {
|
||||
if ($event->getForm()->get('bootstrap4Formulare')->get('formulareloginedit')->getData() == '1') {
|
||||
$filenamelogin =
|
||||
'/data/www/old/application/design/vorlagen/' .
|
||||
$_POST['settings']['bootstrap4General']['layout'] .
|
||||
'/config/user/login.ini';
|
||||
$handlelogin = fopen($filenamelogin, 'w');
|
||||
fputs($handlelogin, $event->getForm()->get('bootstrap4Formulare')->get('formularelogin')->getData());
|
||||
\fwrite($handlelogin, $event->getForm()->get('bootstrap4Formulare')->get('formularelogin')->getData());
|
||||
fclose($handlelogin);
|
||||
}
|
||||
if($event->getForm()->get('bootstrap4Formulare')->get('formulareregisteredit')->getData() == "1") {
|
||||
$filenameregister = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/registercontact.ini";
|
||||
if ($event->getForm()->get('bootstrap4Formulare')->get('formulareregisteredit')->getData() == '1') {
|
||||
$filenameregister =
|
||||
'/data/www/old/application/design/vorlagen/' .
|
||||
$_POST['settings']['bootstrap4General']['layout'] .
|
||||
'/config/user/registercontact.ini';
|
||||
$handleregister = fopen($filenameregister, 'w');
|
||||
fputs($handleregister, $event->getForm()->get('bootstrap4Formulare')->get('formulareregister')->getData());
|
||||
\fwrite(
|
||||
$handleregister,
|
||||
$event->getForm()->get('bootstrap4Formulare')->get('formulareregister')->getData(),
|
||||
);
|
||||
fclose($handleregister);
|
||||
}
|
||||
if($event->getForm()->get('bootstrap4Formulare')->get('formularepassedit')->getData() == "1") {
|
||||
$filenamepass = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/resetpassword.ini";
|
||||
if ($event->getForm()->get('bootstrap4Formulare')->get('formularepassedit')->getData() == '1') {
|
||||
$filenamepass =
|
||||
'/data/www/old/application/design/vorlagen/' .
|
||||
$_POST['settings']['bootstrap4General']['layout'] .
|
||||
'/config/user/resetpassword.ini';
|
||||
$handlepass = fopen($filenamepass, 'w');
|
||||
fputs($handlepass, $event->getForm()->get('bootstrap4Formulare')->get('formularepass')->getData());
|
||||
\fwrite($handlepass, $event->getForm()->get('bootstrap4Formulare')->get('formularepass')->getData());
|
||||
fclose($handlepass);
|
||||
}
|
||||
if($event->getForm()->get('bootstrap4Formulare')->get('formulareaddressedit')->getData() == "1") {
|
||||
$filenameaddress = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/updatecontact.ini";
|
||||
if ($event->getForm()->get('bootstrap4Formulare')->get('formulareaddressedit')->getData() == '1') {
|
||||
$filenameaddress =
|
||||
'/data/www/old/application/design/vorlagen/' .
|
||||
$_POST['settings']['bootstrap4General']['layout'] .
|
||||
'/config/user/updatecontact.ini';
|
||||
$handleaddress = fopen($filenameaddress, 'w');
|
||||
fputs($handleaddress, $event->getForm()->get('bootstrap4Formulare')->get('formulareaddress')->getData());
|
||||
\fwrite(
|
||||
$handleaddress,
|
||||
$event->getForm()->get('bootstrap4Formulare')->get('formulareaddress')->getData(),
|
||||
);
|
||||
fclose($handleaddress);
|
||||
}
|
||||
if($event->getForm()->get('bootstrap4Formulare')->get('formulareaddaddressedit')->getData() == "1") {
|
||||
$filenameaddaddress = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/user/address.ini";
|
||||
if ($event->getForm()->get('bootstrap4Formulare')->get('formulareaddaddressedit')->getData() == '1') {
|
||||
$filenameaddaddress =
|
||||
'/data/www/old/application/design/vorlagen/' .
|
||||
$_POST['settings']['bootstrap4General']['layout'] .
|
||||
'/config/user/address.ini';
|
||||
$handleaddaddress = fopen($filenameaddaddress, 'w');
|
||||
fputs($handleaddaddress, $event->getForm()->get('bootstrap4Formulare')->get('formulareaddaddress')->getData());
|
||||
\fwrite(
|
||||
$handleaddaddress,
|
||||
$event->getForm()->get('bootstrap4Formulare')->get('formulareaddaddress')->getData(),
|
||||
);
|
||||
fclose($handleaddaddress);
|
||||
}
|
||||
}
|
||||
$shopEntity->setDisplayArticleCount($event->getForm()->get('bootstrap4General')->get('displayArticleCount')->getData());
|
||||
$shopEntity->setDisplayArticleCount(
|
||||
$event->getForm()->get('bootstrap4General')->get('displayArticleCount')->getData(),
|
||||
);
|
||||
$shopEntity->setBasketfield1($event->getForm()->get('bootstrap4General')->get('basketField1')->getData());
|
||||
$shopEntity->setBasketfield2($event->getForm()->get('bootstrap4General')->get('basketField2')->getData());
|
||||
$shopEntity->setBasketposfield1($event->getForm()->get('bootstrap4General')->get('basketPosField1')->getData());
|
||||
@ -204,15 +271,21 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
|
||||
$shopEntity->setDisplayDelivery($event->getForm()->get('bootstrap4General')->get('displayDelivery')->getData());
|
||||
$shopEntity->setCustomTemplates($event->getForm()->get('bootstrap4General')->get('customTemplates')->getData());
|
||||
$shopEntity->setLayout($event->getForm()->get('bootstrap4General')->get('layout')->getData());
|
||||
$shopEntity->setGoogleanalyticscode($event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->getData());
|
||||
$shopEntity->setGoogleanalyticscode(
|
||||
$event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->getData(),
|
||||
);
|
||||
$shopEntity->setDefaultFunc($event->getForm()->get('bootstrap4General')->get('defaultFunc')->getData());
|
||||
$shopEntity->setDefaultParam($event->getForm()->get('bootstrap4General')->get('defaultParam')->getData());
|
||||
$shopEntity->setTemplateDisplayProductsCrossselling($event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->getData());
|
||||
$shopEntity->setTemplateDisplayUserApproval($event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->getData());
|
||||
$shopEntity->setTemplateDisplayProductsCrossselling(
|
||||
$event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->getData(),
|
||||
);
|
||||
$shopEntity->setTemplateDisplayUserApproval(
|
||||
$event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->getData(),
|
||||
);
|
||||
}
|
||||
|
||||
public function formPreSetData(FormEvent $event)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -5,15 +5,14 @@ namespace Plugin\System\PSC\Bootstrap4\Form\Field;
|
||||
use DirectoryIterator;
|
||||
use PSC\Shop\EntityBundle\Entity\Shop;
|
||||
use PSC\System\PluginBundle\Form\Interfaces\Field;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormEvent;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
class Images extends AbstractController implements Field
|
||||
{
|
||||
|
||||
private $options;
|
||||
|
||||
public function getTemplate()
|
||||
@ -31,13 +30,11 @@ class Images extends AbstractController implements Field
|
||||
*/
|
||||
public function formPreSubmit(FormEvent $event)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$txt = "";
|
||||
$txt = '';
|
||||
$this->options = $options;
|
||||
|
||||
/** @var Shop $shopEntity */
|
||||
@ -45,41 +42,54 @@ class Images extends AbstractController implements Field
|
||||
$tempLayouts = [];
|
||||
if ($shopEntity->isCustomTemplates() == 1) {
|
||||
foreach (new DirectoryIterator('/data/www/old/application/design/vorlagen') as $file) {
|
||||
if ($file == '.' || $file == '..' || $file == 'config' || $file == '.svn' || $file == 'datapacks' || $file == '.DS_Store') {
|
||||
if (
|
||||
$file == '.' ||
|
||||
$file == '..' ||
|
||||
$file == 'config' ||
|
||||
$file == '.svn' ||
|
||||
$file == 'datapacks' ||
|
||||
$file == '.DS_Store'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$tempLayouts[$file->getFileName()] = $file->getFileName();
|
||||
}
|
||||
} else {
|
||||
if (file_exists('/data/www/old/application/design/clients/' . $shopEntity->getUID())) {
|
||||
foreach (new DirectoryIterator('/data/www/old/application/design/clients/' . $shopEntity->getUID()) as $file) {
|
||||
if ($file == '.' || $file == '..' || $file == 'config' || $file == '.svn' || $file == 'datapacks' || $file == '.DS_Store') {
|
||||
foreach (new DirectoryIterator('/data/www/old/application/design/clients/' .
|
||||
$shopEntity->getUID()) as $file) {
|
||||
if (
|
||||
$file == '.' ||
|
||||
$file == '..' ||
|
||||
$file == 'config' ||
|
||||
$file == '.svn' ||
|
||||
$file == 'datapacks' ||
|
||||
$file == '.DS_Store'
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
$tempLayouts[$file->getFileName()] = $file->getFileName();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
|
||||
if (isset($_POST['settings']['bootstrap4Images']['layout'])) {
|
||||
header('location: /apps/backend/theme/settings');
|
||||
//die();
|
||||
} else {
|
||||
//copy("/data/www/old/public/styles/vorlagen/" . $shopEntity->getLayout() . "/bootstrap/css/style.css","/data/www/old/public/styles/vorlagen/" . $shopEntity->getLayout() . "/bootstrap/css/style_bakup.css");
|
||||
$filename = "/data/www/old/application/design/vorlagen/" . $shopEntity->getLayout() . "/config/images.ini";
|
||||
$filename = '/data/www/old/application/design/vorlagen/' . $shopEntity->getLayout() . '/config/images.ini';
|
||||
$txt = '';
|
||||
if (file_exists($filename)) {
|
||||
$handle = fopen($filename, 'r');
|
||||
$txt = fread($handle, filesize($filename));
|
||||
fclose($handle);
|
||||
}
|
||||
}
|
||||
|
||||
$builder
|
||||
->add('imagesini', TextareaType::class, array(
|
||||
$builder->add('imagesini', TextareaType::class, [
|
||||
'label' => 'Images ini',
|
||||
'data' => $txt,
|
||||
'required' => false,
|
||||
'attr' => array('rows' => 50, 'onclick' => "onchangeimages('imagesini');")
|
||||
))
|
||||
->add('imagesiniedit', HiddenType::class, array('required' => false, 'data' => 0))
|
||||
;
|
||||
'attr' => ['rows' => 50, 'onclick' => "onchangeimages('imagesini');"],
|
||||
])->add('imagesiniedit', HiddenType::class, ['required' => false, 'data' => 0]);
|
||||
|
||||
return $builder;
|
||||
}
|
||||
@ -94,7 +104,11 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
|
||||
/** @var Shop $shopEntity */
|
||||
$shopEntity = $this->options['shopEntity'];
|
||||
$layoutSettings = json_decode($shopEntity->getLayoutSettings(), true);
|
||||
$event->getForm()->get('bootstrap4General')->get('displayArticleCount')->setData($shopEntity->getDisplayArticleCount());
|
||||
$event
|
||||
->getForm()
|
||||
->get('bootstrap4General')
|
||||
->get('displayArticleCount')
|
||||
->setData($shopEntity->getDisplayArticleCount());
|
||||
$event->getForm()->get('bootstrap4General')->get('basketField1')->setData($shopEntity->getBasketfield1());
|
||||
$event->getForm()->get('bootstrap4General')->get('basketField2')->setData($shopEntity->getBasketfield2());
|
||||
$event->getForm()->get('bootstrap4General')->get('basketPosField1')->setData($shopEntity->getBasketposfield1());
|
||||
@ -103,27 +117,43 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
|
||||
$event->getForm()->get('bootstrap4General')->get('displayDelivery')->setData($shopEntity->getDisplayDelivery());
|
||||
$event->getForm()->get('bootstrap4General')->get('layout')->setData($shopEntity->getLayout());
|
||||
$event->getForm()->get('bootstrap4General')->get('customTemplates')->setData($shopEntity->isCustomTemplates());
|
||||
$event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->setData($shopEntity->getGoogleanalyticscode());
|
||||
$event
|
||||
->getForm()
|
||||
->get('bootstrap4General')
|
||||
->get('googleanalyticscode')
|
||||
->setData($shopEntity->getGoogleanalyticscode());
|
||||
$event->getForm()->get('bootstrap4General')->get('defaultFunc')->setData($shopEntity->getDefaultFunc());
|
||||
$event->getForm()->get('bootstrap4General')->get('defaultParam')->setData($shopEntity->getDefaultParam());
|
||||
$event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->setData($shopEntity->isTemplateDisplayProductsCrossselling());
|
||||
$event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->setData($shopEntity->isTemplateDisplayUserApproval());
|
||||
|
||||
$event
|
||||
->getForm()
|
||||
->get('bootstrap4General')
|
||||
->get('templateDisplayProductsCrossselling')
|
||||
->setData($shopEntity->isTemplateDisplayProductsCrossselling());
|
||||
$event
|
||||
->getForm()
|
||||
->get('bootstrap4General')
|
||||
->get('templateDisplayUserApproval')
|
||||
->setData($shopEntity->isTemplateDisplayUserApproval());
|
||||
}
|
||||
|
||||
public function formPostSubmit(FormEvent $event)
|
||||
{
|
||||
/** @var Shop $shopEntity */
|
||||
$shopEntity = $this->options['shopEntity'];
|
||||
if($event->getForm()->get('bootstrap4Style')->get('write')->getData() == "1") {
|
||||
if($event->getForm()->get('bootstrap4Images')->get('imagesiniedit')->getData() == "1") {
|
||||
$filename = "/data/www/old/application/design/vorlagen/" . $_POST["settings"]["bootstrap4General"]["layout"] . "/config/images.ini";
|
||||
if ($event->getForm()->get('bootstrap4Style')->get('write')->getData() == '1') {
|
||||
if ($event->getForm()->get('bootstrap4Images')->get('imagesiniedit')->getData() == '1') {
|
||||
$filename =
|
||||
'/data/www/old/application/design/vorlagen/' .
|
||||
$_POST['settings']['bootstrap4General']['layout'] .
|
||||
'/config/images.ini';
|
||||
$handle = fopen($filename, 'w');
|
||||
fputs($handle, $event->getForm()->get('bootstrap4Images')->get('imagesini')->getData());
|
||||
\fwrite($handle, $event->getForm()->get('bootstrap4Images')->get('imagesini')->getData());
|
||||
fclose($handle);
|
||||
}
|
||||
}
|
||||
$shopEntity->setDisplayArticleCount($event->getForm()->get('bootstrap4General')->get('displayArticleCount')->getData());
|
||||
$shopEntity->setDisplayArticleCount(
|
||||
$event->getForm()->get('bootstrap4General')->get('displayArticleCount')->getData(),
|
||||
);
|
||||
$shopEntity->setBasketfield1($event->getForm()->get('bootstrap4General')->get('basketField1')->getData());
|
||||
$shopEntity->setBasketfield2($event->getForm()->get('bootstrap4General')->get('basketField2')->getData());
|
||||
$shopEntity->setBasketposfield1($event->getForm()->get('bootstrap4General')->get('basketPosField1')->getData());
|
||||
@ -132,15 +162,21 @@ if(isset($_POST["settings"]["bootstrap4Images"]["layout"])) {
|
||||
$shopEntity->setDisplayDelivery($event->getForm()->get('bootstrap4General')->get('displayDelivery')->getData());
|
||||
$shopEntity->setCustomTemplates($event->getForm()->get('bootstrap4General')->get('customTemplates')->getData());
|
||||
$shopEntity->setLayout($event->getForm()->get('bootstrap4General')->get('layout')->getData());
|
||||
$shopEntity->setGoogleanalyticscode($event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->getData());
|
||||
$shopEntity->setGoogleanalyticscode(
|
||||
$event->getForm()->get('bootstrap4General')->get('googleanalyticscode')->getData(),
|
||||
);
|
||||
$shopEntity->setDefaultFunc($event->getForm()->get('bootstrap4General')->get('defaultFunc')->getData());
|
||||
$shopEntity->setDefaultParam($event->getForm()->get('bootstrap4General')->get('defaultParam')->getData());
|
||||
$shopEntity->setTemplateDisplayProductsCrossselling($event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->getData());
|
||||
$shopEntity->setTemplateDisplayUserApproval($event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->getData());
|
||||
$shopEntity->setTemplateDisplayProductsCrossselling(
|
||||
$event->getForm()->get('bootstrap4General')->get('templateDisplayProductsCrossselling')->getData(),
|
||||
);
|
||||
$shopEntity->setTemplateDisplayUserApproval(
|
||||
$event->getForm()->get('bootstrap4General')->get('templateDisplayUserApproval')->getData(),
|
||||
);
|
||||
}
|
||||
|
||||
public function formPreSetData(FormEvent $event)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -2682,7 +2682,6 @@ class BasketController extends TP_Controller_Action
|
||||
));
|
||||
|
||||
if (
|
||||
count($creditSystemArticleGroupId) == 0 && count($creditSystemArticleId) == 0 ||
|
||||
in_array($article->id, $creditSystemArticleId) ||
|
||||
count(array_intersect($articleGroups, $creditSystemArticleGroupId)) > 0
|
||||
) {
|
||||
@ -2880,7 +2879,7 @@ class BasketController extends TP_Controller_Action
|
||||
if ($versand > 0 || $versandpos > 0) {
|
||||
$versand = $versand + $versandpos;
|
||||
}
|
||||
if ($creditSystemRest > 0 && $creditSystemShipping) {
|
||||
if (false && $creditSystemRest > 0 && $creditSystemShipping) {
|
||||
$mwert =
|
||||
$mwert + round(($versand / 100) * ((float) str_replace('%', '', $shippingtype['mwert'])), 2);
|
||||
if (
|
||||
@ -3028,7 +3027,7 @@ class BasketController extends TP_Controller_Action
|
||||
$versand = $versand + $versandpos;
|
||||
}
|
||||
|
||||
if ($creditSystemRest > 0 && $creditSystemShipping) {
|
||||
if (false && $creditSystemRest > 0 && $creditSystemShipping) {
|
||||
$mwert =
|
||||
$mwert + round(($versand / 100) * ((float) str_replace('%', '', $shippingtype['mwert'])), 2);
|
||||
if (
|
||||
@ -3239,7 +3238,7 @@ class BasketController extends TP_Controller_Action
|
||||
$this->view->paymentwert = $paymenttype['wert'];
|
||||
}
|
||||
}
|
||||
if ($creditSystemRest > 0 && $creditSystemPayment) {
|
||||
if (false && $creditSystemRest > 0 && $creditSystemPayment) {
|
||||
$mwert = $mwert + round(($this->view->paymentwert / 100) * $paymenttype['mwert'], 2);
|
||||
if ($creditSystemRest > round(($this->view->paymentwert / 100) * $paymenttype['mwert'], 2)) {
|
||||
$basket->setGutscheinAbzug(
|
||||
@ -3294,15 +3293,18 @@ class BasketController extends TP_Controller_Action
|
||||
$this->view->articles = $temp;
|
||||
|
||||
$this->_helper->layout->setLayout('default');
|
||||
$summenUeberAlleSteuersaetze = $mwertalle;
|
||||
$tmpMwertAlle = [];
|
||||
foreach ($mwertalle as $key => $wert) {
|
||||
$tmpMwertAlle[$key] = round(($wert / 100) * ((float) $key), 2);
|
||||
}
|
||||
$mwertalle = $tmpMwertAlle;
|
||||
|
||||
foreach ($basket->getGutscheinAbzugMwSt() as $key => $value) {
|
||||
$mwertalle[$key] = $mwertalle[$key] - $value;
|
||||
var_dump($summenUeberAlleSteuersaetze);
|
||||
$voucherMwert = [];
|
||||
foreach ($summenUeberAlleSteuersaetzer as $key => $value) {
|
||||
}
|
||||
|
||||
$this->view->productbruttogutschein = 0;
|
||||
if (count($this->view->articles) == 0) {
|
||||
$this->view->netto = 0;
|
||||
@ -3337,6 +3339,7 @@ class BasketController extends TP_Controller_Action
|
||||
$this->view->paymentwertbrutto,
|
||||
$this->view->versandbrutto,
|
||||
$mwertalle,
|
||||
$voucherMwert,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
class TP_Basket
|
||||
{
|
||||
/**
|
||||
@ -17,7 +18,6 @@ class TP_Basket
|
||||
|
||||
public function setTempProduct($article, $options, $netto)
|
||||
{
|
||||
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
$this->_Warenkorb->unLock();
|
||||
}
|
||||
@ -28,9 +28,9 @@ class TP_Basket
|
||||
$this->_Warenkorb->LastTempProductId = $article->uuid;
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function clearTempProduct()
|
||||
{
|
||||
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
$this->_Warenkorb->unLock();
|
||||
}
|
||||
@ -39,7 +39,6 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
|
||||
public static function getBasket()
|
||||
{
|
||||
return new TP_Basket();
|
||||
@ -48,8 +47,7 @@ class TP_Basket
|
||||
public function getWeight()
|
||||
{
|
||||
$weight = 0;
|
||||
foreach ( $this->_Warenkorb->Articles as $Artikel )
|
||||
{
|
||||
foreach ($this->_Warenkorb->Articles as $Artikel) {
|
||||
$weight = $weight + $Artikel->getWeight();
|
||||
}
|
||||
return $weight;
|
||||
@ -58,8 +56,7 @@ class TP_Basket
|
||||
public function getWeightLargestOnRoll()
|
||||
{
|
||||
$weight = 0;
|
||||
foreach ( $this->_Warenkorb->Articles as $Artikel )
|
||||
{
|
||||
foreach ($this->_Warenkorb->Articles as $Artikel) {
|
||||
if ($weight == 0 || $weight < $Artikel->getWeight()) {
|
||||
$weight = $Artikel->getWeight();
|
||||
}
|
||||
@ -76,6 +73,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->LastTempProductId = $basketArticle->getArticleId();
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt das Basket Item
|
||||
*
|
||||
@ -94,7 +92,6 @@ class TP_Basket
|
||||
}
|
||||
|
||||
if (!isset($this->_Warenkorb->TempProduct[$uuid])) {
|
||||
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
$this->_Warenkorb->unLock();
|
||||
}
|
||||
@ -102,7 +99,6 @@ class TP_Basket
|
||||
$this->_Warenkorb->TempProduct[$uuid] = new TP_Basket_Item();
|
||||
$this->_Warenkorb->LastTempProductId = $uuid;
|
||||
$this->_Warenkorb->lock();
|
||||
|
||||
}
|
||||
if (isset($this->_Warenkorb->TempProduct[$this->_Warenkorb->LastTempProductId])) {
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -113,6 +109,7 @@ class TP_Basket
|
||||
}
|
||||
return $this->_Warenkorb->TempProduct[$uuid];
|
||||
}
|
||||
|
||||
/**
|
||||
* Konstruiert das Model für den Warenkorb
|
||||
*
|
||||
@ -129,7 +126,6 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fuegt einen Artikel hinzu
|
||||
*
|
||||
@ -166,7 +162,10 @@ class TP_Basket
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
$this->_Warenkorb->unLock();
|
||||
}
|
||||
$this->_Warenkorb->Articles->updateItem($this->_Warenkorb->TempProduct[$uuid]->getInLoad(), $this->_Warenkorb->TempProduct[$uuid]);
|
||||
$this->_Warenkorb->Articles->updateItem(
|
||||
$this->_Warenkorb->TempProduct[$uuid]->getInLoad(),
|
||||
$this->_Warenkorb->TempProduct[$uuid],
|
||||
);
|
||||
|
||||
//Optionen eintragen
|
||||
$this->_Warenkorb->TempProduct[$uuid] = new TP_Basket_Item();
|
||||
@ -203,6 +202,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getPaymenttype()
|
||||
{
|
||||
// unlocking read-only lock
|
||||
@ -214,6 +214,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $paymentid;
|
||||
}
|
||||
|
||||
public function setShippingtype($shippingid)
|
||||
{
|
||||
// unlocking read-only lock
|
||||
@ -225,6 +226,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getShippingtype()
|
||||
{
|
||||
// unlocking read-only lock
|
||||
@ -236,6 +238,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $shippingid;
|
||||
}
|
||||
|
||||
/**
|
||||
* L<EFBFBD>scht einen Artikel aus dem Warenkorb
|
||||
*
|
||||
@ -254,6 +257,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt einige Informationen <EFBFBD>ber den Warenkorb zur<EFBFBD>ck
|
||||
*
|
||||
@ -267,43 +271,39 @@ class TP_Basket
|
||||
$ArtikelAnzahl = $this->_Warenkorb->ArtikelAnzahl;
|
||||
if ($ArtikelAnzahl < 1) {
|
||||
return array(
|
||||
|
||||
"WarenkorbPreis" => $WarenkorbPreis ,
|
||||
"Artikelanzahl" => $ArtikelAnzahl
|
||||
'WarenkorbPreis' => $WarenkorbPreis,
|
||||
'Artikelanzahl' => $ArtikelAnzahl,
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ( $this->_Warenkorb->Artikel as $Artikel )
|
||||
{
|
||||
} else {
|
||||
foreach ($this->_Warenkorb->Artikel as $Artikel) {
|
||||
// DB-Prefix & Adapter auslesen
|
||||
$db = Zend_registry::get('db');
|
||||
$prefix = Zend_Registry::get('config')->db->prefix;
|
||||
//Zend_Db_Select aufbauen
|
||||
//Wir joinen die tables von Hand zusammen da dies einfacher ist :)
|
||||
$select = $db->select()->from($prefix . '_shop_artikel', 'shop_artikel_preis')->where('shop_artikel_id = "' . $this->_Warenkorb->Artikel["ArtikelID"] . '"');
|
||||
$select = $db
|
||||
->select()
|
||||
->from($prefix . '_shop_artikel', 'shop_artikel_preis')
|
||||
->where('shop_artikel_id = "' . $this->_Warenkorb->Artikel['ArtikelID'] . '"');
|
||||
//Query abschicken
|
||||
$stmt = $db->query($select);
|
||||
$result = $stmt->fetchOne();
|
||||
$WarenkorbPreis += $result->shop_artikel_preis * $Artikel["Anzahl"];
|
||||
$WarenkorbPreis += $result->shop_artikel_preis * $Artikel['Anzahl'];
|
||||
}
|
||||
}
|
||||
return array(
|
||||
|
||||
"WarenkorbPreis" => $WarenkorbPreis ,
|
||||
"Artikelanzahl" => $ArtikelAnzahl
|
||||
'WarenkorbPreis' => $WarenkorbPreis,
|
||||
'Artikelanzahl' => $ArtikelAnzahl,
|
||||
);
|
||||
}
|
||||
|
||||
public function checkIsLayouterIdInUse($id)
|
||||
{
|
||||
|
||||
foreach ($this->_Warenkorb->Articles as $article) {
|
||||
if ($id == $article->getLayouterId()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -315,18 +315,22 @@ class TP_Basket
|
||||
{
|
||||
return $this->_Warenkorb->Articles;
|
||||
}
|
||||
|
||||
public function getBasketArtikel($uuid)
|
||||
{
|
||||
return $this->_Warenkorb->Articles->getItemById($uuid);
|
||||
}
|
||||
|
||||
public function getBasketArtikelId($uuid, $getKey = false)
|
||||
{
|
||||
return $this->_Warenkorb->Articles->getItemByArticleId($uuid, $getKey);
|
||||
}
|
||||
|
||||
public function getAllCount()
|
||||
{
|
||||
return $this->_Warenkorb->Articles->count();
|
||||
}
|
||||
|
||||
public function setPreisNetto($preis)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -336,6 +340,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setGutschein($id)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -345,6 +350,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setGutscheinAbzug($value)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -400,6 +406,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setVersandkosten($value)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -409,6 +416,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getVersandkosten()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -438,6 +446,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getZahlkosten()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -448,6 +457,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $ids;
|
||||
}
|
||||
|
||||
public function getGutschein()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -458,6 +468,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $ids;
|
||||
}
|
||||
|
||||
public function getGutscheinAbzug()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -511,6 +522,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setPreisBrutto($preis)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -520,6 +532,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getPreisNetto()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -530,6 +543,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $preis;
|
||||
}
|
||||
|
||||
public function getPreisSteuer()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -540,6 +554,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $steuer;
|
||||
}
|
||||
|
||||
public function getPreisBrutto()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -550,6 +565,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $brutto;
|
||||
}
|
||||
|
||||
public function getBasketField1()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -560,6 +576,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $bs1;
|
||||
}
|
||||
|
||||
public function setBasketField1($bs1)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -569,6 +586,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getBasketField2()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -579,6 +597,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $bs2;
|
||||
}
|
||||
|
||||
public function setBasketField2($bs2)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -588,6 +607,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getPaymentZusatz()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -598,6 +618,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $bs2;
|
||||
}
|
||||
|
||||
public function setPaymentZusatz($bs2)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -607,6 +628,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getBic()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -617,6 +639,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $bs2;
|
||||
}
|
||||
|
||||
public function setBic($bs2)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -626,6 +649,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getIban()
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -636,15 +660,17 @@ class TP_Basket
|
||||
$this->_Warenkorb->lock();
|
||||
return $bs2;
|
||||
}
|
||||
|
||||
public function setIban($bs2)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
$this->_Warenkorb->unLock();
|
||||
}
|
||||
$this->_Warenkorb->iban = str_replace(" ", "", $bs2);
|
||||
$this->_Warenkorb->iban = str_replace(' ', '', $bs2);
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setDeliveryIsSame($val)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -654,6 +680,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setDelivery($val)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -663,6 +690,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setInvoiceIsSame($val)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -672,6 +700,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setInvoice($val)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -681,6 +710,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setSenderIsSame($val)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -690,6 +720,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setSender($val)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -699,14 +730,17 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getDeliveryIsSame()
|
||||
{
|
||||
return $this->_Warenkorb->deliverysame;
|
||||
}
|
||||
|
||||
public function getPaymentRef()
|
||||
{
|
||||
return $this->_Warenkorb->paymentRef;
|
||||
}
|
||||
|
||||
public function setPaymentRef($value)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -721,6 +755,7 @@ class TP_Basket
|
||||
{
|
||||
return $this->_Warenkorb->paymentGateway;
|
||||
}
|
||||
|
||||
public function setPaymentGateway($value)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -730,30 +765,37 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getDelivery()
|
||||
{
|
||||
return $this->_Warenkorb->delivery;
|
||||
}
|
||||
|
||||
public function getInvoiceIsSame()
|
||||
{
|
||||
return $this->_Warenkorb->invoicesame;
|
||||
}
|
||||
|
||||
public function getInvoice()
|
||||
{
|
||||
return $this->_Warenkorb->invoice;
|
||||
}
|
||||
|
||||
public function getSenderIsSame()
|
||||
{
|
||||
return $this->_Warenkorb->sendersame;
|
||||
}
|
||||
|
||||
public function getSender()
|
||||
{
|
||||
return $this->_Warenkorb->sender;
|
||||
}
|
||||
|
||||
public function getToken()
|
||||
{
|
||||
return $this->_Warenkorb->token;
|
||||
}
|
||||
|
||||
public function setToken($value)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -768,6 +810,7 @@ class TP_Basket
|
||||
{
|
||||
return $this->_Warenkorb->plz;
|
||||
}
|
||||
|
||||
public function getOfferNumber()
|
||||
{
|
||||
return $this->_Warenkorb->offerNumber;
|
||||
@ -797,6 +840,7 @@ class TP_Basket
|
||||
{
|
||||
return $this->_Warenkorb->delivery_plz;
|
||||
}
|
||||
|
||||
public function setDeliveryPLZ($value)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -806,6 +850,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setDeliveryCountry($value)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -815,6 +860,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function setDeliveryUstId($value)
|
||||
{
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
@ -824,17 +870,25 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getDeliveryCountry()
|
||||
{
|
||||
return $this->_Warenkorb->delivery_country;
|
||||
}
|
||||
|
||||
public function getDeliveryUstId()
|
||||
{
|
||||
return $this->_Warenkorb->delivery_ustid;
|
||||
}
|
||||
|
||||
public function setAdditional($productpreisNetto, $productpreisBrutto, $zahlart, $versandart, $mwert)
|
||||
{
|
||||
public function setAdditional(
|
||||
$productpreisNetto,
|
||||
$productpreisBrutto,
|
||||
$zahlart,
|
||||
$versandart,
|
||||
$mwert,
|
||||
$gutscheinMwert,
|
||||
) {
|
||||
if ($this->_Warenkorb->isLocked()) {
|
||||
$this->_Warenkorb->unLock();
|
||||
}
|
||||
@ -843,6 +897,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->ZahlkostenBrutto = $zahlart;
|
||||
$this->_Warenkorb->VersandkostenBrutto = $versandart;
|
||||
$this->_Warenkorb->mwert = $mwert;
|
||||
$this->_Warenkorb->vouchermwert = $vouchermwert;
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
@ -896,10 +951,12 @@ class TP_Basket
|
||||
{
|
||||
if (Zend_Auth::getInstance()->hasIdentity()) {
|
||||
$user = Zend_Auth::getInstance()->getIdentity();
|
||||
$user = Doctrine_Query::create()->from('Contact c')->where('c.id = ?')->fetchOne(
|
||||
array(
|
||||
$user['id'])
|
||||
);
|
||||
$user = Doctrine_Query::create()
|
||||
->from('Contact c')
|
||||
->where('c.id = ?')
|
||||
->fetchOne(array(
|
||||
$user['id'],
|
||||
));
|
||||
if (!$user['mwert']) {
|
||||
return false;
|
||||
}
|
||||
@ -931,6 +988,7 @@ class TP_Basket
|
||||
{
|
||||
return $this->_Warenkorb->offerContact;
|
||||
}
|
||||
|
||||
public function getDeliveryMode()
|
||||
{
|
||||
return $this->_Warenkorb->deliveryMode;
|
||||
@ -945,6 +1003,7 @@ class TP_Basket
|
||||
//Namespace wieder sperren
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
public function getDeliveryAddress()
|
||||
{
|
||||
return $this->_Warenkorb->deliveryAddress;
|
||||
@ -995,6 +1054,11 @@ class TP_Basket
|
||||
return $this->_Warenkorb->mwert;
|
||||
}
|
||||
|
||||
public function getVoucherMWert()
|
||||
{
|
||||
return $this->_Warenkorb->vouchermwert;
|
||||
}
|
||||
|
||||
public function clearBasketItems()
|
||||
{
|
||||
$this->_Warenkorb->unlock();
|
||||
@ -1016,7 +1080,6 @@ class TP_Basket
|
||||
}
|
||||
|
||||
$this->removeProduct($removeAble);
|
||||
|
||||
}
|
||||
|
||||
public function clear()
|
||||
@ -1025,7 +1088,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->ArtikelAnzahl = 0;
|
||||
$this->_Warenkorb->Paymenttype = 0;
|
||||
$this->_Warenkorb->Articles->clear();
|
||||
$this->_Warenkorb->Gutschein = "";
|
||||
$this->_Warenkorb->Gutschein = '';
|
||||
$this->_Warenkorb->GutscheinAbzug = 0;
|
||||
$this->_Warenkorb->GutscheinAbzugNetto = 0;
|
||||
$this->_Warenkorb->GutscheinAbzugMwSt = [];
|
||||
@ -1039,6 +1102,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->ZahlkostenBrutto = 0;
|
||||
$this->_Warenkorb->VersandkostenBrutto = 0;
|
||||
$this->_Warenkorb->mwert = array();
|
||||
$this->_Warenkorb->vouchermwert = array();
|
||||
|
||||
$this->_Warenkorb->Zahlkosten = 0;
|
||||
$this->_Warenkorb->Versandkosten = 0;
|
||||
@ -1055,22 +1119,23 @@ class TP_Basket
|
||||
$this->_Warenkorb->invoice = 0;
|
||||
$this->_Warenkorb->sendersame = true;
|
||||
$this->_Warenkorb->sender = 0;
|
||||
$this->_Warenkorb->token = "";
|
||||
$this->_Warenkorb->token = '';
|
||||
$this->_Warenkorb->plz = false;
|
||||
$this->_Warenkorb->delivery_plz = false;
|
||||
$this->_Warenkorb->delivery_country = false;
|
||||
$this->_Warenkorb->delivery_ustid = null;
|
||||
|
||||
$this->_Warenkorb->shippingtype_extra_label = "";
|
||||
$this->_Warenkorb->shippingtype_extra_label = '';
|
||||
$this->_Warenkorb->info = array();
|
||||
$this->_Warenkorb->paymentRef = substr(md5(rand()), 0, 7);
|
||||
$this->_Warenkorb->paymentGateway = "";
|
||||
$this->_Warenkorb->paymentGateway = '';
|
||||
$this->_Warenkorb->TempProduct = array();
|
||||
$this->_Warenkorb->LastTempProductId = false;
|
||||
$this->_Warenkorb->offerNumber = time();
|
||||
$this->_Warenkorb->withTax = true;
|
||||
$this->_Warenkorb->lock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialisiert den Warenkorb
|
||||
*/
|
||||
@ -1079,7 +1144,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->ArtikelAnzahl = 0;
|
||||
|
||||
$this->_Warenkorb->Articles = new TP_Basket_Collection();
|
||||
$this->_Warenkorb->Gutschein = "";
|
||||
$this->_Warenkorb->Gutschein = '';
|
||||
$this->_Warenkorb->GutscheinAbzug = 0;
|
||||
$this->_Warenkorb->GutscheinAbzugNetto = 0;
|
||||
$this->_Warenkorb->GutscheinAbzugMwSt = [];
|
||||
@ -1090,7 +1155,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->invoicesame = true;
|
||||
$this->_Warenkorb->deliveryAddress = [];
|
||||
$this->_Warenkorb->deliveryMode = self::DELIVERY_MODE_NORMAL;
|
||||
$this->_Warenkorb->shippingtype_extra_label = "";
|
||||
$this->_Warenkorb->shippingtype_extra_label = '';
|
||||
$this->_Warenkorb->invoice = 0;
|
||||
$this->_Warenkorb->offerContact = array();
|
||||
$this->_Warenkorb->sendersame = true;
|
||||
@ -1102,7 +1167,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->preis = 0;
|
||||
$this->_Warenkorb->steuer = 0;
|
||||
$this->_Warenkorb->brutto = 0;
|
||||
$this->_Warenkorb->token = "";
|
||||
$this->_Warenkorb->token = '';
|
||||
$this->_Warenkorb->basketfield1 = '';
|
||||
$this->_Warenkorb->basketfield2 = '';
|
||||
$this->_Warenkorb->payment_zusatz = '';
|
||||
@ -1111,7 +1176,7 @@ class TP_Basket
|
||||
$this->_Warenkorb->delivery_country = false;
|
||||
$this->_Warenkorb->info = array();
|
||||
$this->_Warenkorb->paymentRef = substr(md5(rand()), 0, 7);
|
||||
$this->_Warenkorb->paymentGateway = "";
|
||||
$this->_Warenkorb->paymentGateway = '';
|
||||
$this->_Warenkorb->TempProduct = array();
|
||||
$this->_Warenkorb->LastTempProductId = false;
|
||||
$this->_Warenkorb->offerNumber = time();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user