This commit is contained in:
Thomas Peterson 2024-10-14 10:19:37 +02:00
parent 22af78dcaa
commit 1a49dc9097
105 changed files with 723789 additions and 16173 deletions

File diff suppressed because one or more lines are too long

6
package-lock.json generated
View File

@ -1,6 +0,0 @@
{
"name": "pscdevmake",
"lockfileVersion": 2,
"requires": true,
"packages": {}
}

View File

@ -1 +0,0 @@
import "./login/login.css";

407
src/new/composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
namespace PSC\Shop\ProductBundle\Controller\Backend\Product;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ORM\EntityManagerInterface;
use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface;
use PSC\Shop\EntityBundle\Entity\Product;
use PSC\Shop\ProductBundle\Form\Backend\Upload\Uploads;
use PSC\Shop\ProductBundle\Model\Upload\Setting;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Serializer\SerializerInterface;
class UploadController extends AbstractController
{
public function __construct(private EntityManagerInterface $entityManager, private DocumentManager $documentManager, private SerializerInterface $serializer)
{
}
#[Template]
#[Route(path: '/upload/index/{uuid}', name: 'backend_production_product_upload_index')]
public function indexAction(
Request $request,
JWTTokenManagerInterface $JWTTokenManager,
$uuid)
{
$product = $this->entityManager->getRepository(Product::class)->findOneBy(['uuid' => $uuid]);
$productDoc = $this->documentManager->getRepository(\PSC\Shop\EntityBundle\Document\Product::class)->findOneBy(['uid' => $product->getUID()]);
$setting = $this->serializer->deserialize($productDoc->getPluginSettingModule('uploads', 'config') ?? '{}', Setting::class, 'json');
$formUploads = $this->createForm(Uploads::class, $setting);
$formUploads->handleRequest($request);
if($formUploads->isSubmitted() && $formUploads->isValid()) {
$productDoc->setPluginSettingModule('uploads', 'config', $this->serializer->serialize($setting, 'json'));
$this->documentManager->persist($productDoc);
$this->documentManager->flush();
}
return array(
'uploadsForm' => $formUploads->createView(),
'product' => $product,
'setting' => $setting,
'contactUuid' => $this->getUser()->getUuid(),
'jwt' => $JWTTokenManager->create($this->getUser())
);
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace PSC\Shop\ProductBundle\Form\Backend\Upload;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class Upload extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('id', TextType::class, [
'label' => 'Id']);
$builder->add('name', TextType::class, [
'label' => 'Name']);
return $builder;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults(['data_class' => \PSC\Shop\ProductBundle\Model\Upload\Upload::class, 'allow_extra_fields' => true]);
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace PSC\Shop\ProductBundle\Form\Backend\Upload;
use PSC\Shop\ProductBundle\Model\Upload\Setting;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\UX\LiveComponent\Form\Type\LiveCollectionType;
class Uploads extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('uploads', LiveCollectionType::class, [
'entry_type' => Upload::class,
'entry_options' => ['label' => false],
'label' => false,
'allow_add' => true,
'allow_delete' => true,
'by_reference' => true,
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults(['data_class' => Setting::class, 'allow_extra_fields' => true]);
}
}

View File

@ -0,0 +1,11 @@
<?php
namespace PSC\Shop\ProductBundle\Model\Upload;
class Setting
{
/**
* @var Upload[]
*/
public array $uploads = [];
}

View File

@ -0,0 +1,10 @@
<?php
namespace PSC\Shop\ProductBundle\Model\Upload;
class Upload
{
public function __construct(public ?string $name = "", public ?string $id = "")
{
}
}

View File

@ -551,6 +551,8 @@ a[href^="#formlayouter"] {display:none;}
</div>
</div>
<div class="panel panel-default">
<div class="row">
<div class="col-6">
<div class="header"><h5>{{ 'Uploadinordermanagement'|trans }}</h5></div>
<div class="body">
<div class="row">
@ -575,7 +577,7 @@ a[href^="#formlayouter"] {display:none;}
</div>
</div>
</div>
<div class="panel panel-default">
<div class="col-6">
<div class="header"><h5>{{ 'Uploadwhileordering'|trans }}</h5></div>
<div class="body">
<div class="row">
@ -600,6 +602,11 @@ a[href^="#formlayouter"] {display:none;}
</div>
</div>
</div>
<div class="col-12">
<a href="{{ path('backend_production_product_upload_index', {uuid: product.uuid }) }}" class="m-2 btn btn-sm btn-success">Uploads bearbeiten</a>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="header"><h5>{{ 'Usethelastprintdata'|trans }}</h5></div>
<div class="body">

View File

@ -0,0 +1,42 @@
{% form_theme form 'bootstrap_5_layout.html.twig' %}
<div
{{ attributes }}
>
{{ form_start(form) }}
<table class="table">
<thead>
<tr>
<td>Id</td>
<td>Name</td>
<td></td>
</tr>
</thead>
<tbody>
{% for key, itemForm in form.uploads %}
<tr>
<td>
{{ form_row(itemForm.id, {
label: false
}) }}
</td>
<td>
{{ form_row(itemForm.name, {
label: false
}) }}
</td>
<td>
{{ form_row(itemForm.vars.button_delete, { label: 'X', attr: { class: 'btn btn-sm btn-danger' } }) }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<hr class="mb-3 mt-3"/>
<div class="">
{{ form_widget(form.uploads.vars.button_add, { label: '+ Add Upload', attr: { class: 'btn btn-sm btn-info' } }) }}
<button type="submit" class="btn btn-sm btn-success" formnovalidate>Save</button>
</div>
{{ form_row(form._token) }}
{{ form_end(form, {'render_rest' : false}) }}
</div>

View File

@ -0,0 +1,25 @@
{% extends 'backend_plugin.html.twig' %}
{% block body %}
<header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
<div class="row header">
<div class="col-md-8">
<h4>
<span id="productTitle">{{ product.title }}</span>
</h4>
</div>
<div class="col-md-4 text-end">
<a href="{{ path("backend_production_product_edit", {uuid: product.uuid}) }}"
class="btn btn-default btn-sm"><i class="fas fa-arrow-left"></i> Zurück</a>
</div>
</div>
</header>
<div class="container-fluid">
<main class="content">
{{ component('UploadsForm', {
form: uploadsForm,
setting: setting
}) }}
</main>
</div>
{% endblock %}

View File

@ -0,0 +1,30 @@
<?php
namespace PSC\Shop\ProductBundle\Twig;
use PSC\Shop\ProductBundle\Form\Backend\Upload\Uploads;
use PSC\Shop\ProductBundle\Model\Upload\Setting;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormInterface;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
use Symfony\UX\LiveComponent\Attribute\LiveProp;
use Symfony\UX\LiveComponent\DefaultActionTrait;
use Symfony\UX\LiveComponent\LiveCollectionTrait;
#[AsLiveComponent(template: '@PSCShopProduct/backend/product/upload/components/UploadsForm.html.twig')]
class UploadsForm extends AbstractController
{
use DefaultActionTrait;
use LiveCollectionTrait;
#[LiveProp(fieldName: 'formValues', useSerializerForHydration: true)]
public Setting $setting;
protected function instantiateForm(): FormInterface
{
return $this->createForm(
Uploads::class,
$this->setting
);
}
}

View File

@ -0,0 +1,101 @@
<?php
namespace PSC\System\SettingsBundle\Controller\Backend;
use Doctrine\ODM\MongoDB\DocumentManager;
use PSC\System\SettingsBundle\Document\Help;
use PSC\System\SettingsBundle\Document\Status;
use PSC\System\SettingsBundle\Form\Backend\DeleteType;
use PSC\System\SettingsBundle\Form\Backend\HelpType;
use Ramsey\Uuid\Uuid;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\HttpFoundation\Request;
class HelpController extends AbstractController
{
#[Route(path: '/help/index', name: 'psc_system_help_list')]
#[Template]
#[Security("is_granted('ROLE_SHOP')")]
public function indexAction(Request $request, DocumentManager $documentManager)
{
$helpItems = $documentManager
->getRepository(Help::class)
->findAll();
return array(
'helpItems' => $helpItems
);
}
#[Route(path: '/help/create', name: 'psc_system_help_create')]
#[Template]
#[Security("is_granted('ROLE_SHOP')")]
public function createAction(Request $request, DocumentManager $documentManager, SessionInterface $session)
{
$help = new Help();
$form = $this->createForm(HelpType::class, $help);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$documentManager->persist($help);
$documentManager->flush();
$session->getFlashBag()->add('success', 'Helptext has been created!');
return $this->redirectToRoute('psc_system_help_list');
}
return array(
'form' => $form->createView()
);
}
#[Route(path: '/help/edit/{uuid}', name: 'psc_system_help_edit')]
#[Template]
#[Security("is_granted('ROLE_SHOP')")]
public function editAction(Request $request, DocumentManager $documentManager, SessionInterface $session, $uuid)
{
$help = $documentManager
->getRepository(help::class)
->findOneBy(array('id' => (string)$uuid));
$form = $this->createForm(HelpType::class, $help);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$documentManager->persist($help);
$documentManager->flush();
$session->getFlashBag()->add('success', 'Helptext has been updated!');
return $this->redirectToRoute('psc_system_help_list');
}
return array(
'form' => $form->createView()
);
}
#[Route(path: '/help/delete/{uuid}', name: 'psc_system_help_delete')]
#[Template]
public function deleteAction(Request $request, DocumentManager $documentManager, SessionInterface $session, $uuid)
{
$help = $documentManager
->getRepository(Help::class)
->findOneBy(array('id' => (string)$uuid));
$form = $this->createForm(DeleteType::class);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
if ($form->getClickedButton()->getName() == 'yes') {
$documentManager->remove($help);
$documentManager->flush();
$session->getFlashBag()->add('success', 'Helptext has been deleted!');
return $this->redirectToRoute('psc_system_help_list');
}
return $this->redirectToRoute('psc_system_help_list');
}
return array(
'help' => $help,
'form' => $form->createView()
);
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace PSC\System\SettingsBundle\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Field;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Id;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedMany;
#[Document]
class Help
{
#[Id]
public $id;
#[Field(type: 'string')]
public $name;
#[Field(type: 'string')]
public $internName;
#[Field(type: 'string')]
public $helpText;
#[Field(type: 'string')]
public $helpFile;
#[Field(type: 'string')]
public $helpLink;
}

View File

@ -26,6 +26,13 @@ class ConfigureMenuListener
'orderNumber' => 20
)
));
$menu->addChild('Hilfetexte', array(
'route' => 'psc_system_help_list',
'extras' => array(
'icon' => 'fas fa-question-circle',
'orderNumber' => 21
)
));
$menu->addChild('Systemeinstellung', array(
'route' => 'psc_backend_system_settings_index',
'extras' => array(

View File

@ -0,0 +1,37 @@
<?php
namespace PSC\System\SettingsBundle\Form\Backend;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class HelpType extends AbstractType
{
public function __construct()
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TextType::class, array('label' => 'Name'))
->add('internName', TextType::class, array('label' => 'interner Name'))
->add('helpText', TextareaType::class, array('label' => 'Helptext'))
;
}
public function getName()
{
return 'status';
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'PSC\System\SettingsBundle\Document\Help',
));
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace PSC\System\SettingsBundle\Model;
class Help
{
public function __construct(public string $id = "", public string $name = "", public string $helpText = "")
{
}
public function asArray(): array
{
return ['id' => $this->id, 'name' => $this->name, 'helpText' => $this->helpText];
}
}

View File

@ -0,0 +1,68 @@
{% extends 'backend_base.html.twig' %}
{% block body %}
<div class="header">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<h3>
<i class="fa fa-question-circle"></i>
Hilfetext <span>>
anlegen </span>
</h3>
</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 text-end">
<a href="{{ path("psc_system_help_list") }}" class="btn btn-default btn-sm"><i class="fa fa-lg fa-fw fa-arrow-left"></i> Zurück</a>
</div>
</div>
</div>
<div class="body">
{{ form_start(form, { 'attr': {'class': ''}}) }}
<div class="panel">
<div class="header">
<h4>Anlegen</h4>
</div>
<div class="body">
<div class="col-md-12">
<div class="row mb-3">
{{ form_label(form.name) }}
<div class="col-md-8">
{{ form_widget(form.name) }}
</div>
{{ form_errors(form.name) }}
</div>
</div>
<div class="col-md-12">
<div class="row mb-3">
{{ form_label(form.internName) }}
<div class="col-md-8">
{{ form_widget(form.internName) }}
</div>
{{ form_errors(form.internName) }}
</div>
</div>
<div class="col-md-12">
<div class="row mb-3">
{{ form_label(form.helpText) }}
<div class="col-md-8">
{{ form_widget(form.helpText, {attr: {'class': 'form-control summernote'}}) }}
</div>
{{ form_errors(form.helpText) }}
</div>
</div>
</div>
</div>
<div class="panel">
<div class="body">
<div class="row mb-3">
<div class="col-md-offset-1 col-md-11">
<button class="btn btn-primary btn-sm">Speichern</button>
</div>
</div>
</div>
</div>
{{ form_end(form) }}
</div>
{% endblock %}

View File

@ -0,0 +1,40 @@
{% extends 'backend_base.html.twig' %}
{% block body %}
<div class="header">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<h3>
<i class="fa-fw fa fa-question-circle"></i>
Helptext <span>>
Löschen</span>
</h3>
</div>
</div>
</div>
<div class="body">
<div class="panel">
<div class="header">
<h4>Helptext löschen?</h4>
</div>
<div class="body">
<h5>{{ help.name }}</h5>
{{ form_start(form, { 'attr': {'class': ''}}) }}
<div class="row mb-3">
<label class="col-md-1 form-control-label"></label>
<div class="col-md-1">
{{ form_widget(form.yes, {attr: {class: 'btn btn-lg btn-warning btn-sm'}}) }}
</div>
<div class="col-md-1">
{{ form_widget(form.no, {attr: {class: 'btn btn-lg btn-primary btn-sm'}}) }}
</div>
</div>
{{ form_end(form) }}
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,68 @@
{% extends 'backend_base.html.twig' %}
{% block body %}
<div class="header">
<div class="row">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<h3>
<i class="fa fa-question-circle"></i>
Hilfetext <span>>
bearbeiten </span>
</h3>
</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 text-end">
<a href="{{ path("psc_system_help_list") }}" class="btn btn-default btn-sm"><i class="fa fa-lg fa-fw fa-arrow-left"></i> Zurück</a>
</div>
</div>
</div>
<div class="body">
{{ form_start(form, { 'attr': {'class': ''}}) }}
<div class="panel">
<div class="header">
<h4>Anlegen</h4>
</div>
<div class="body">
<div class="col-md-12">
<div class="row mb-3">
{{ form_label(form.name) }}
<div class="col-md-8">
{{ form_widget(form.name) }}
</div>
{{ form_errors(form.name) }}
</div>
</div>
<div class="col-md-12">
<div class="row mb-3">
{{ form_label(form.internName) }}
<div class="col-md-8">
{{ form_widget(form.internName) }}
</div>
{{ form_errors(form.internName) }}
</div>
</div>
<div class="col-md-12">
<div class="row mb-3">
{{ form_label(form.helpText) }}
<div class="col-md-8">
{{ form_widget(form.helpText, {attr: {'class': 'form-control summernote'}}) }}
</div>
{{ form_errors(form.helpText) }}
</div>
</div>
</div>
</div>
<div class="panel">
<div class="body">
<div class="row mb-3">
<div class="col-md-offset-1 col-md-11">
<button class="btn btn-primary btn-sm">Speichern</button>
</div>
</div>
</div>
</div>
{{ form_end(form) }}
</div>
{% endblock %}

View File

@ -0,0 +1,55 @@
{% extends 'backend_base.html.twig' %}
{% block body %}
<div class="header">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<h3>
<i class="fa-fw fa fa-question-circle"></i>
Text <span>>
Liste </span>
</h3>
</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 text-end">
</div>
</div>
</div>
<div class="body">
<div class="panel">
<div class="body">
<a class="btn btn-info btn-sm" href="{{ path("psc_system_help_create") }}">Hilfetext
hinzufügen</a>
</div>
</div>
<div class="panel">
<div class="body">
<h2>Hilfetexte</h2>
<table class="table">
<thead class="thead-dark">
<tr>
<th>Name</th>
<th>Interner Name</th>
<th>Hilfetext</th>
<th></th>
</tr>
</thead>
<tbody>
{% for help in helpItems %}
<tr {% if loop.index is odd %}class="color"{% endif %}>
<td>{{ help.name }}</td>
<td>{{ help.internName }}</td>
<td>{{ help.helpText }}</td>
<td class="text-end">
<a href="{{ path("psc_system_help_edit", {uuid: help.id}) }}" class="btn btn-info btn-sm"><span class="fa fa-edit"></span></a>
<a href="{{ path("psc_system_help_delete", {uuid: help.id}) }}" class="btn btn-danger btn-sm"><span class="fa fa-trash"></span></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}

View File

@ -52,7 +52,8 @@ class Assets
try {
$this->filesystem->remove($targetDir);
$this->hardCopy($originDir, $targetDir);
symlink($originDir, $targetDir);
// $this->hardCopy($originDir, $targetDir);
} catch (\Exception $e) {
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace PSC\System\SettingsBundle\Service;
use Doctrine\ODM\MongoDB\DocumentManager;
class Help
{
protected $mongoManager;
public function __construct(DocumentManager $mongoManager)
{
$this->mongoManager = $mongoManager;
}
public function getHelp(string $name): ?\PSC\System\SettingsBundle\Model\Help
{
/** @var \PSC\System\SettingsBundle\Document\Help $doc */
$doc = $this->mongoManager->getRepository(\PSC\System\SettingsBundle\Document\Help::class)->findOneBy(['name' => $name]);
if(null === $doc) {
return null;
}
return new \PSC\System\SettingsBundle\Model\Help($doc->id, $doc->name, $doc->helpText);
}
}

View File

@ -18,31 +18,31 @@ class OrdersController extends AbstractController
public function startAction(Shop $shop, DocumentManager $documentManager, EntityManagerInterface $entityManager, \Symfony\Component\Security\Core\Security $security, $page)
{
$anzprosite = 15;
if(!isset($page) or $page == "0") {
$page=0;
if (!isset($page) or $page == "0") {
$page = 0;
} else {
$page=$page*$anzprosite;
$page = $page * $anzprosite;
}
/** @var \PSC\Shop\EntityBundle\Document\Contact $contactDoc */
$contactDoc = $documentManager->getRepository('PSC\Shop\EntityBundle\Document\Contact')
->findOneBy(array('uid' => (string)$security->getToken()->getUser()->getUid()));
$statusOrder = $documentManager
->getRepository('PSCSystemSettingsBundle:Status')
->getRepository(Status::class)
->findBy(['typ' => Status::$ORDER]);
$statusPos = $documentManager
->getRepository('PSCSystemSettingsBundle:Status')
->getRepository(Status::class)
->findBy(['typ' => Status::$POSITION]);
$selectedShop = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->mySelectedShop($security->getToken()->getUser());
$allCountOrders = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->findBy(array('shop' => $selectedShop),array('uid' => 'DESC'));
$allOrders = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->findBy(array('shop' => $selectedShop),array('uid' => 'DESC'), $anzprosite, $page);
$allCountOrders = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->findBy(array('shop' => $selectedShop), array('uid' => 'DESC'));
$allOrders = $entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->findBy(array('shop' => $selectedShop), array('uid' => 'DESC'), $anzprosite, $page);
$orderOutput = array();
foreach($allOrders as $allOrdersArray) {
foreach ($allOrders as $allOrdersArray) {
$orderOutput[] = $allOrdersArray;
}
$orderDocOutput = array();
$orderPosOutput = array();
foreach($allOrders as $keyone => $allOrders) {
foreach ($allOrders as $keyone => $allOrders) {
$orderDoc = $documentManager
->getRepository('PSC\Shop\EntityBundle\Document\Order')
->findOneBy(array('uid' => (string)$allOrders->getUid()));

View File

@ -10,6 +10,7 @@ use Plugin\Custom\PSC\Saxoprint_API_R1\Api\GetPrices;
use Plugin\Custom\PSC\Saxoprint_API_R1\Api\PutConfig;
use PSC\Shop\EntityBundle\Entity\Product;
use PSC\System\SettingsBundle\Service\Help;
use PSC\System\SettingsBundle\Service\Shop;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
@ -21,7 +22,7 @@ use Symfony\Component\Security\Core\Security;
class SaxoprintController extends AbstractController
{
public function __construct(private readonly Security $security)
public function __construct(private readonly Security $security, private readonly Help $helpService)
{
}
@ -297,6 +298,17 @@ class SaxoprintController extends AbstractController
$sum = $priceSum + ($priceSum / 100 * $aufschlag);
$sum = $sum + $aufschlagFix;
$tmp = [];
foreach($config as $conf) {
if($help = $this->helpService->getHelp($conf['id'])) {
$conf['help'] = $help->asArray();
}else{
$conf['help'] = false;
}
$tmp[] = $conf;
}
$config = $tmp;
if ($this->security->isGranted('ROLE_SHOP')) {
return new JsonResponse(
[

View File

@ -1,4 +1,5 @@
<?php
namespace Plugin\Custom\Rieglerdruck\TpSplit\Queue;
use Doctrine\Bundle\MongoDBBundle\ManagerRegistry;
@ -8,6 +9,9 @@ use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use GuzzleHttp\Client;
use LogicException;
use PSC\Shop\EntityBundle\Entity\Contact;
use PSC\Shop\EntityBundle\Entity\Shop as PSCShop;
use PSC\System\SettingsBundle\Document\LogEntry;
use Plugin\System\PSC\Upload\Helper\UploaderHelper;
use PSC\Library\Calc\Engine;
use PSC\Library\Calc\PaperContainer;
@ -47,9 +51,9 @@ class Split implements QueueInterface, ConfigurableElementInterface
private Shop $_shopService;
private \PSC\Shop\OrderBundle\Service\Order $_orderService;
private $_templatePrintDir;
private Log $logService;
function __construct(FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, DocumentManager $doctrine_mongodb, Shop $shopService, \PSC\Shop\OrderBundle\Service\Order $orderService, $dirTemplateprint)
public function __construct(FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, DocumentManager $doctrine_mongodb, Shop $shopService, \PSC\Shop\OrderBundle\Service\Order $orderService, Log $logService, $dirTemplateprint)
{
$this->_formFactory = $formFactory;
$this->_entityManager = $entityManager;
@ -57,6 +61,7 @@ class Split implements QueueInterface, ConfigurableElementInterface
$this->_shopService = $shopService;
$this->_orderService = $orderService;
$this->_templatePrintDir = $dirTemplateprint;
$this->logService = $logService;
}
/**
@ -92,7 +97,7 @@ class Split implements QueueInterface, ConfigurableElementInterface
$products = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findBy(array("shop" => $this->_shopService->getSelectedShop()->getUid(), "enable" => 1));
$tmp = [];
foreach($products as $product) {
foreach ($products as $product) {
$tmp[$product->getTitle() . " (" . $product->getId() . ")"] = $product->getId();
}
@ -109,7 +114,7 @@ class Split implements QueueInterface, ConfigurableElementInterface
{
/** @var \Plugin\Custom\Rieglerdruck\TpSplit\Document\Split $splitDoc */
$splitDoc = $this->getQueueDocument();
foreach($form->get('product')->getData() as $product) {
foreach ($form->get('product')->getData() as $product) {
$splitDoc->addProduct($product);
}
$splitDoc->setConfig($form->get('config')->getData());
@ -135,14 +140,14 @@ class Split implements QueueInterface, ConfigurableElementInterface
*/
public function execute(EventInterface $event, Queue $queue)
{
if($event instanceof \PSC\Shop\QueueBundle\Event\Order\Status\Change) {
if ($event instanceof \PSC\Shop\QueueBundle\Event\Order\Status\Change) {
$order = $this->_orderService->getOrderByUuid($event->getOrder());
if($order->getStatus() == $event->getStatus()) {
if ($order->getStatus() == $event->getStatus()) {
$this->splitTemplateprint($order, $queue->getQueueDocument());
}
}
if($event instanceof Create) {
if ($event instanceof Create) {
$order = $this->_orderService->getOrderByUuid($event->getOrder());
$this->splitTemplateprint($order, $queue->getQueueDocument());
}
@ -152,14 +157,14 @@ class Split implements QueueInterface, ConfigurableElementInterface
protected function splitTemplateprint(\PSC\Shop\OrderBundle\Model\Order $order, \Plugin\Custom\Rieglerdruck\TpSplit\Document\Split $splitDoc)
{
foreach($order->getPositions() as $position) {
foreach ($order->getPositions() as $position) {
/** @var Product $product */
$product = $this->_entityManager->getRepository(Product::class)->find($position->getProduct()->getUid());
if($product->getOriginalProduct()) {
if ($product->getOriginalProduct()) {
$product = $this->_entityManager->getRepository(Product::class)->find($product->getOriginalProduct());
}
if(in_array($product->getId(), $splitDoc->getProducts()) && file_exists('/data/www/old/market/templateprint/basket/' . $order->getUid() . '/' . $position->getPos() .'/final.pdf')) {
if (in_array($product->getId(), $splitDoc->getProducts()) && file_exists('/data/www/old/market/templateprint/basket/' . $order->getUid() . '/' . $position->getPos() .'/final.pdf')) {
$tmp = [];
@ -171,19 +176,19 @@ class Split implements QueueInterface, ConfigurableElementInterface
}
}
if($position->getProduct()->getSpecialProductTypeObject()->getTyp() == 6) {
if ($position->getProduct()->getSpecialProductTypeObject()->getTyp() == 6) {
$sites = [];
foreach($position->getProduct()->getSpecialProductTypeObject()->getOptions() as $option) {
foreach ($position->getProduct()->getSpecialProductTypeObject()->getOptions() as $option) {
if(isset($tmp[$option->getId()])) {
if (isset($tmp[$option->getId()])) {
$eva = $tmp[$option->getId()][1];
$result = false;
$str = '$result = $option->getRawValue() '. $eva . ';';
eval($str);
if($result) {
if ($result) {
$sites[] = $tmp[$option->getId()][0];
}
}
@ -191,9 +196,12 @@ class Split implements QueueInterface, ConfigurableElementInterface
$execString = "mutool clean /data/www/old/market/templateprint/basket/" . $order->getUid() . "/" . $position->getPos() ."/final.pdf /data/www/old/market/templateprint/basket/" . $order->getUid() . "/" . $position->getPos() ."/final_cut.pdf '".implode(",", $sites)."'";
$this->logService->createLogEntry(new PSCShop(), new Contact(), LogEntry::INFO, "tpsplit", "split", "Split", [
'exec' => $execString,
]);
exec($execString);
unlink("/data/www/old/market/templateprint/basket/" . $order->getUid() . "/" . $position->getPos() ."/final.pdf");
// unlink("/data/www/old/market/templateprint/basket/" . $order->getUid() . "/" . $position->getPos() ."/final.pdf");
}
}

View File

@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@ -0,0 +1,50 @@
# React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level `parserOptions` property like this:
```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
```js
// eslint.config.js
import react from 'eslint-plugin-react'
export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)

View File

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@ -0,0 +1,34 @@
{
"name": "invoiceapp",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"autoprefixer": "^10.4.20",
"axios": "^1.7.7",
"postcss": "^8.4.47",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.27.0",
"tailwindcss": "^3.4.13"
},
"devDependencies": {
"@eslint/js": "^9.11.1",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.2",
"eslint": "^9.11.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0",
"typescript": "^5.5.3",
"typescript-eslint": "^8.7.0",
"vite": "^5.4.8"
}
}

View File

@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View File

@ -0,0 +1,33 @@
import { useState } from 'react'
import { createContext } from 'react';
import './assets/App.css'
import { BrowserRouter, Route, Routes } from "react-router-dom"
import Login from "./components/login/login"
interface AuthContextType {
jwt: string;
}
const AuthContext = createContext<AuthContextType|null>(null);
function App() {
const [jwt, setJWt] = useState(null)
return (
<>
<BrowserRouter>
<AuthContext.Provider value={{
auth: [jwt, setJWt],
}}>
<Routes>
<Route path='/' element={<Login />} />
<Route path='/create' element={<Login />} />
<Route path='/edit' element={<Login />} />
</Routes>
</AuthContext.Provider>
</BrowserRouter>
</>
)
}
export default App

View File

@ -0,0 +1,42 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}
@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}
.card {
padding: 2em;
}
.read-the-docs {
color: #888;
}

View File

@ -0,0 +1,5 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -0,0 +1,58 @@
import React, { useState, useContext } from "react";
import axios from "axios";
function Login() {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const [errorMessage, setErrorMessage] = useState(null);
const { setToken } = useContext(AuthContext);
const navigate = useNavigate();
const handleSubmit = async (e) => {
e.preventDefault();
try {
const response = await axios.post("/apps/api/contact/login", {
username,
password,
});
setToken(response.data.token);
localStorage.setItem("token", response.data.token);
navigate("/dashboard");
} catch (error) {
console.error("Authentication failed:", error);
setToken(null);
localStorage.removeItem("token");
if (error.response && error.response.data) {
setErrorMessage(error.response.data); // Set the error message if present in the error response
} else {
setErrorMessage("An unexpected error occurred. Please try again.");
}
}
};
return (
<>
<div className='bg-black/50 fixed top-0 left-0 w-full h-screen'></div>
<div className='fixed w-full px-4 py-24 z-50'>
<div className='max-w-[450px] h-[600px] mx-auto bg-black/80 text-white'>
<div className='max-w-[320px] mx-auto py-16'>
<h1>Sign Up Here</h1>
<form className='w-full flex flex-col py-4'>
<p className='text-white font-bold'>UserName</p>
<input type="text" required className='p-3 my-2 rounded text-black' placeholder='JohnDoe'/>
<p className='text-white font-bold'>PassWord</p>
<input type="password" required className='p-3 my-2 rounded text-black' placeholder='Please enter a strong password'/>
<button type="submit" className='bg-red-700 py-3 my-6 rounded font-bold px-4'>Submit</button>
<div>
<p><input type="checkbox" />Remember Me</p>
</div>
</form>
</div>
</div>
</div>
</>
)
}
export default Login

View File

@ -0,0 +1,10 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import App from './App.tsx'
import './assets/index.css'
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
)

View File

@ -0,0 +1 @@
/// <reference types="vite/client" />

View File

@ -0,0 +1,9 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [ "./src/**/*.{js,ts,jsx,tsx}", ],
theme: {
extend: {},
},
plugins: [],
}

View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}

View File

@ -0,0 +1 @@
{"root":["./src/App.tsx","./src/main.tsx","./src/vite-env.d.ts"],"version":"5.6.3"}

View File

@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}

View File

@ -0,0 +1,22 @@
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["vite.config.ts"]
}

View File

@ -0,0 +1 @@
{"root":["./vite.config.ts"],"version":"5.6.3"}

View File

@ -0,0 +1,22 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
base: '',
plugins: [react()],
server: {
proxy: {
'/apps/api': {
target: "http://localhost:80",
changeOrigin: true,
secure: false,
}
}
},
build: {
outDir: '../Resources/public',
emptyOutDir: true, // also necessary
}
})

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="./vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<script type="module" crossorigin src="./assets/index-0CZfAX1X.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-DiwrgTda.css">
</head>
<body>
<div id="root"></div>
</body>
</html>

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
import * as Eta from 'eta'
import { Token } from '../services/token'
import {container} from "tsyringe"
import * as React from 'react'
import * as ReactDOM from 'react-dom/client'
import React from 'react'
import ReactDOM from 'react-dom/client'
import NiceModal from "@ebay/nice-modal-react"
import BaseComponent from '../modules/base/BaseComponent'
import {Route, HashRouter as Router, Routes, useSearchParams} from "react-router-dom"

View File

@ -7,7 +7,7 @@ import * as PropTypes from 'prop-types'
import { Shop } from '../../model/shop'
import {Order} from "../../model/order"
import { SelectLabel } from "../base/SelectLabel"
import React from 'react'
const AccountSelectComponent = ({shop, order}) => {
const [shopUuid, setShopUuid] = useState(null)

View File

@ -6,7 +6,7 @@ import { BsXCircle } from "@react-icons/all-files/bs/BsXCircle"
import { Button as BaseButton } from "flowbite-react"
import React from 'react'
const Button = ({ type: number, variant: string, onClick }) => {
const Button = ({ type , variant , onClick }) => {
return (
<BaseButton color={variant} pill onClick={onClick}>
{ type == 1 && <BsPlus/> }

View File

@ -1,7 +1,7 @@
import * as PropTypes from 'prop-types'
import { Address } from '../../model/address'
import React from 'react'
const AddressDetail = ({address: Address}) => {
const AddressDetail = ({address}) => {
return (
<small>{address.company} {address.firstname} {address.lastname} {address.street} {address.houseNumber} {address.country} {address.zip} {address.city}</small>

View File

@ -16,14 +16,13 @@ const ContactModalComponent = ({shop, handleAdd, handleEdit, contact}) => {
const contactModal = useModal(ContactModal)
const showAddModal = useCallback(() => {
contactModal.show({title: 'Add Contact', action: 'Save', shop: shop}).then((formData) => {
contactModal.show({title: 'Add Contact', action: 'Save', shop: shop, contact: new Contact()}).then((formData) => {
addContact(formData)
})
},[contactModal])
const showEditModal = useCallback((contact) => {
contact = contact
console.log(contact)
contactModal.show({ title: 'Edit Contact', action: 'Save', contact: contact, shop: shop }).then((formData) => {
contact.parseFromFormData(formData)
updateContact(contact)

View File

@ -3,6 +3,10 @@
"jsx": "react-jsx",
"module": "commonjs",
"experimentalDecorators": true,
"esModuleInterop": true,
"noUnusedLocals": false,
"strict": false,
"noImplicitAny": true,
"emitDecoratorMetadata": true,
"lib": [
"dom",

View File

@ -0,0 +1,86 @@
<?php
namespace Plugin\System\PSC\SecuPay\Api;
use PSC\System\SettingsBundle\Service\Shop;
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
use Symfony\Contracts\HttpClient\HttpClientInterface;
class Base
{
protected $baseUrlTest = 'https://connect-testing.secupay-ag.de/';
protected $baseUrlLive = 'https://connect.secucard.com/';
protected \PSC\Shop\EntityBundle\Document\Shop $shop;
/**
* @var HttpClientInterface
*/
protected HttpClientInterface $client;
public $isProduction = false;
public $client_id = "";
public $client_secret = "";
public $contract_id = "";
public function __construct(HttpClientInterface $client)
{
$this->client = $client;
}
protected function buildHeaders(): array
{
return [
'Accept' => 'application/json',
];
}
protected function buildTokenHeaders(string $token): array
{
return [
'Accept' => 'application/json',
'Authorization' => 'Bearer ' . $token
];
}
protected function generateToken(): array
{
$baseUrl = $this->baseUrlTest;
if ($this->isProduction) {
$baseUrl = $this->baseUrlLive;
}
$response = $this->client->request('POST', $baseUrl . 'oauth/token', [
'headers' =>
$this->buildHeaders()
,
'json' => [
'grant_type' => 'client_credentials',
'client_id' => $this->client_id,
'client_secret' => $this->client_secret
],
]);
$content = $response->toArray();
return $content;
}
public function setShop(\PSC\Shop\EntityBundle\Document\Shop $shop): void
{
$this->shop = $shop;
}
protected function buildQuery(array $data): string
{
return base64_encode(json_encode($data));
}
/**
* @param bool $isProduction
*/
public function setIsProduction(bool $isProduction): void
{
$this->isProduction = $isProduction;
}
}

View File

@ -0,0 +1,67 @@
<?php
namespace Plugin\System\PSC\SecuPay\Api;
use PSC\Shop\EntityBundle\Entity\Contact;
use PSC\Shop\EntityBundle\Entity\ContactAddress;
class CreatePayment extends Base
{
public function generatePayment(Contact $contact, ContactAddress $invoiceAddress, $amount, string $successUrl, string $errorUrl, string $abortUrl): array
{
$token = $this->generateToken();
$accessToken = $token['access_token'];
$baseUrl = $this->baseUrlTest;
if ($this->isProduction) {
$baseUrl = $this->baseUrlLive;
}
$basket = $_SESSION['Basket'];
$response = $this->client->request('POST', $baseUrl . 'api/v2/Smart/Transactions', [
'headers' =>
$this->buildTokenHeaders($accessToken)
,
'json' => [
"is_demo" => true,
"contract" => [
"id" => $this->contract_id,
],
"transactionRef" => $basket['paymentRef'],
"customer" => [
"contact" => [
"forename" => $invoiceAddress->getFirstname(),
"surname" => $invoiceAddress->getLastname(),
"address" => [
"street" => $invoiceAddress->getStreet(),
"street_number" => $invoiceAddress->getHouseNumber(),
"postal_code" => $invoiceAddress->getZip(),
"city" => $invoiceAddress->getCity(),
"country" => $invoiceAddress->getCountry()
],
"email" => $invoiceAddress->getEmail()
]
],
"intent" => "sale",
"basket_info" => [
"currency" => "EUR",
"sum" => round($basket['brutto'], 2) * 100
],
"application_context" => [
"checkout_template" => "COT_WD0DE66HN2XWJHW8JM88003YG0NEA2",
"language" => "de",
"return_urls" => [
"url_success" => $successUrl,
"url_error" => $errorUrl,
"url_abort" => $abortUrl
]
]
],
]);
return $response->toArray();
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace Plugin\System\PSC\SecuPay\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations\EmbeddedDocument;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Field;
#[EmbeddedDocument]
class SecuPay
{
#[Field(type: 'string')]
public ?string $client_id = "";
#[Field(type: 'string')]
public ?string $client_secret = "";
#
#[Field(type: 'string')]
public ?string $contract_id = "";
#[Field(type: 'bool')]
public bool $production = true;
}

View File

@ -0,0 +1,198 @@
<?php
namespace Plugin\System\PSC\SecuPay\Payment;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ORM\EntityManagerInterface;
use PSC\Shop\EntityBundle\Entity\Contact;
use PSC\Shop\EntityBundle\Entity\ContactAddress;
use PSC\Shop\PaymentBundle\Document\Gatewaysettings;
use PSC\Shop\PaymentBundle\Provider\PaymentProvider;
use PSC\Shop\QueueBundle\Event\Order\Payed;
use PSC\Shop\QueueBundle\Service\Event\Manager;
use Plugin\System\PSC\SecuPay\Api\CreatePayment;
use Plugin\System\PSC\SecuPay\Document\SecuPay;
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
#[AutoconfigureTag(name: 'paymentProvider')]
class Provider extends PaymentProvider
{
/** @var Form */
private $_formFactory = null;
private $_entityManager = null;
private $_doctrine_mongodb = null;
private $_error = null;
private \PSC\System\SettingsBundle\Service\Shop $shopService;
/**
* @var Manager
*/
private Manager $eventManager;
/**
* @var SessionInterface
*/
private SessionInterface $session;
public function __construct(RequestStack $requestStack, Manager $eventManager, FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, DocumentManager $doctrine_mongodb, \PSC\System\SettingsBundle\Service\Shop $shopService, private CreatePayment $api)
{
$this->_formFactory = $formFactory;
$this->_entityManager = $entityManager;
$this->_doctrine_mongodb = $doctrine_mongodb;
$this->shopService = $shopService;
$this->eventManager = $eventManager;
$this->session = $requestStack->getSession();
}
public function getName()
{
return 'SecuPay';
}
public function getType()
{
return 'secupay';
}
public function saveDocument(Gatewaysettings $settings, Form $form)
{
$doc = new SecuPay();
$doc->client_id = $form->get('secupay')->get('client_id')->getData();
$doc->client_secret = $form->get('secupay')->get('client_secret')->getData();
$doc->contract_id = $form->get('secupay')->get('contract_id')->getData();
$doc->production = $form->get('secupay')->get('production')->getData();
$settings->setGatewayDocument($doc);
return $settings;
}
public function getSubForm(Gatewaysettings $settings, FormBuilder $builder)
{
if (!$settings->getGatewayDocument()) {
$settings->setGatewayDocument(new SecuPay());
}
$builder
->add('production', CheckboxType::class, array('label' => 'Production?', 'required' => false))
->add('client_id', TextType::class, array('label' => 'Client Id', 'required' => false))
->add('contract_id', TextType::class, array('label' => 'Contract Id', 'required' => false))
->add('client_secret', TextType::class, array('label' => 'Client Secret', 'required' => false));
$builder->get('production')->setData($settings->getGatewayDocument()->production);
$builder->get('client_id')->setData($settings->getGatewayDocument()->client_id);
$builder->get('client_secret')->setData($settings->getGatewayDocument()->client_secret);
$builder->get('contract_id')->setData($settings->getGatewayDocument()->contract_id);
return $builder;
}
public function getTemplate()
{
return '@PluginSystemPSCSecuPay/settings.html.twig';
}
public function handlePayment(Request $request)
{
$this->api->setIsProduction($this->getGatewaySettings()->getGatewayDocument()->production);
$this->api->client_id = $this->getGatewaySettings()->getGatewayDocument()->client_id;
$this->api->client_secret = $this->getGatewaySettings()->getGatewayDocument()->client_secret;
$this->api->contract_id = $this->getGatewaySettings()->getGatewayDocument()->contract_id;
$contact = $request->get('contact');
$invoice = $request->get('invoiceAddress');
$delivery = $request->get('deliveryAddress');
/** @var Contact $contact */
$contact = $this->_entityManager->getRepository(Contact::class)->findOneBy(['uuid' => $contact]);
/** @var ContactAddress $invoiceAddress */
$invoiceAddress = $this->_entityManager->getRepository(ContactAddress::class)->findOneBy(['uuid' => $invoice]);
try {
$response = $this->api->generatePayment(
$contact,
$invoiceAddress,
$request->get('amount'),
$this->getHost().'/basket/finish?Data=finish&token='.$request->get('hash'),
$this->getHost().'/basket/finish?error=Fehler',
$this->getHost().'/basket/finish?error=Abruch'
);
return new RedirectResponse($response['payment_links']['general']);
} catch (\Exception $e) {
var_dump($e->getMessage());
}
die();
}
public function handleNotify(Request $request)
{
$request = $request->getContent();
$request = json_decode($request, true);
if (isset($request['resource']) && isset($request['resource']['state']) && $request['resource']['state'] == 'completed') {
/** @var \PSC\Shop\EntityBundle\Document\Order $orderDoc */
$orderDoc = $this->_doctrine_mongodb
->getRepository('PSC\Shop\EntityBundle\Document\Order')
->findOneBy(array('paymentRef' => (string)$request['resource']['parent_payment']));
}
/** @var \PSC\Shop\EntityBundle\Entity\Order $order */
$order = $this->_entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Order')
->findOneBy(array('uid' => $orderDoc->getUid()));
$order->setStatus(145);
$this->_entityManager->persist($order);
$this->_entityManager->flush();
$notify = new Payed();
$notify->setShop($this->getShopEntity()->getUID());
$notify->setOrder($order->getUuid());
$this->eventManager->addJob($notify);
}
public function doPayment(Request $request)
{
if ($this->getGatewaySettings()->getGatewayDocument()->isProduction()) {
$environment = new ProductionEnvironment(
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret()
);
} else {
$environment = new SandboxEnvironment(
$this->getGatewaySettings()->getGatewayDocument()->getClientId(),
$this->getGatewaySettings()->getGatewayDocument()->getClientSecret()
);
}
$client = new PayPalHttpClient($environment);
$requestPaypal = new CreateDoPayRequest($this->session->get('plugin_system_psc_paypalplus_paymentId'));
$requestPaypal->buildRequestBody($request->get('PayerID'));
$response = $client->execute($requestPaypal);
if ($response->statusCode == 200) {
return new RedirectResponse($this->getHost().'/basket/finish?token='.$request->get('hash').'&paymentRef='.$response->result->id);
}
return new RedirectResponse($this->getHost().'/basket/finish?error=DoPayment');
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace Plugin\System\PSC\SecuPay;
use PSC\System\PluginBundle\Plugin\Base;
class Plugin extends Base implements \PSC\System\PluginBundle\Interfaces\Plugin
{
protected $name = 'SecuPay';
public function getType()
{
return Plugin::Payment;
}
public function getDescription()
{
return 'Stellt Unterstützung für SecuPay bereit';
}
public function getVersion()
{
return 1;
}
}

View File

@ -0,0 +1,11 @@
services:
_defaults:
autowire: true
autoconfigure: true
Plugin\System\PSC\SecuPay\:
resource: '../../*/*'
Plugin\System\PSC\SecuPay\Payment\Provider:
tags:
- { name: paymentProvider }

View File

@ -0,0 +1,32 @@
<div style="display:none;" id="alert" class="alert alert-danger" role="alert"></div>
<div style="display:none;" id="alertsuccess" class="alert alert-success" role="alert"></div>
<div class="form-group row">
<label class="col-md-4 form-control-label">{{ form_label(form.secupay.production) }}</label>
<div class="col-md-8">
{{ form_widget(form.secupay.production, {attr: {'class': 'form-control'}}) }}
</div>
</div>
<div class="form-group row">
<label class="col-md-4 form-control-label">{{ form_label(form.secupay.client_id) }}</label>
<div class="col-md-8">
{{ form_widget(form.secupay.client_id, {attr: {'class': 'form-control'}}) }}
</div>
</div>
<div class="form-group row">
<label class="col-md-4 form-control-label">{{ form_label(form.secupay.contract_id) }}</label>
<div class="col-md-8">
{{ form_widget(form.secupay.contract_id, {attr: {'class': 'form-control'}}) }}
</div>
</div>
<div class="form-group row">
<label class="col-md-4 form-control-label">{{ form_label(form.secupay.client_secret) }}</label>
<div class="col-md-8">
{{ form_widget(form.secupay.client_secret, {attr: {'class': 'form-control'}}) }}
</div>
</div>

File diff suppressed because one or more lines are too long

View File

@ -5,13 +5,12 @@
/*!*********************************!*\
!*** ./assets/backend/login.ts ***!
\*********************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _login_login_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./login/login.css */ "./assets/backend/login/login.css");
exports.__esModule = true;
__webpack_require__(/*! ./login/login.css */ "./assets/backend/login/login.css");
/***/ }),
/***/ "./assets/backend/login/login.css":
@ -32,4 +31,4 @@ __webpack_require__.r(__webpack_exports__);
/******/ var __webpack_exports__ = (__webpack_exec__("./assets/backend/login.ts"));
/******/ }
]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFja2VuZC9sb2dpbi5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBYTs7QUFDYkEsa0JBQWtCLEdBQUcsSUFBSTtBQUN6QkUsbUJBQU8sQ0FBQywyREFBbUIsQ0FBQzs7Ozs7Ozs7Ozs7QUNGNUIiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvYmFja2VuZC9sb2dpbi50cyIsIndlYnBhY2s6Ly8vLi9hc3NldHMvYmFja2VuZC9sb2dpbi9sb2dpbi5jc3M/MDZmMSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcbmV4cG9ydHMuX19lc01vZHVsZSA9IHRydWU7XG5yZXF1aXJlKFwiLi9sb2dpbi9sb2dpbi5jc3NcIik7XG4iLCIvLyBleHRyYWN0ZWQgYnkgbWluaS1jc3MtZXh0cmFjdC1wbHVnaW5cbmV4cG9ydCB7fTsiXSwibmFtZXMiOlsiZXhwb3J0cyIsIl9fZXNNb2R1bGUiLCJyZXF1aXJlIl0sInNvdXJjZVJvb3QiOiIifQ==
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFja2VuZC9sb2dpbi5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FDQUEiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvYmFja2VuZC9sb2dpbi50cyIsIndlYnBhY2s6Ly8vLi9hc3NldHMvYmFja2VuZC9sb2dpbi9sb2dpbi5jc3M/MDZmMSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgXCIuL2xvZ2luL2xvZ2luLmNzc1wiO1xuIiwiLy8gZXh0cmFjdGVkIGJ5IG1pbmktY3NzLWV4dHJhY3QtcGx1Z2luXG5leHBvcnQge307Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9

View File

@ -25,7 +25,7 @@
"js": [
"/apps/build/runtime.js",
"/apps/build/vendors-node_modules_core-js_modules_es_array_concat_js-node_modules_core-js_modules_es_array-fb37e9.js",
"/apps/build/vendors-var_plugins_System_PSC_Invoice_Webpack_node_modules_ebay_nice-modal-react_lib_esm_ind-73e7df.js",
"/apps/build/vendors-var_plugins_System_PSC_Invoice_Webpack_node_modules_ebay_nice-modal-react_lib_esm_ind-ced46e.js",
"/apps/build/plugins/system/psc/invoice.js"
],
"css": [

View File

@ -1,15 +1,15 @@
{
"/apps/backend/login.css": "/apps/build/backend/login.css",
"/apps/backend/login.js": "/apps/build/backend/login.js",
"/apps/backend/dashboard.css": "/apps/build/backend/dashboard.css",
"/apps/backend/dashboard.js": "/apps/build/backend/dashboard.js",
"/apps/plugins/system/psc/invoice.css": "/apps/build/plugins/system/psc/invoice.css",
"/apps/plugins/system/psc/invoice.js": "/apps/build/plugins/system/psc/invoice.js",
"/apps/runtime.js": "/apps/build/runtime.js",
"/apps/vendors-node_modules_core-js_modules_es_array_concat_js-node_modules_core-js_modules_es_array-fb37e9.js": "/apps/build/vendors-node_modules_core-js_modules_es_array_concat_js-node_modules_core-js_modules_es_array-fb37e9.js",
"/apps/vendors-var_plugins_System_PSC_Invoice_Webpack_node_modules_ebay_nice-modal-react_lib_esm_ind-73e7df.js": "/apps/build/vendors-var_plugins_System_PSC_Invoice_Webpack_node_modules_ebay_nice-modal-react_lib_esm_ind-73e7df.js",
"/apps/vendors-node_modules_popperjs_core_dist_cjs_popper_js-node_modules_symfony_stimulus-bridge_di-f31401.css": "/apps/build/vendors-node_modules_popperjs_core_dist_cjs_popper_js-node_modules_symfony_stimulus-bridge_di-f31401.css",
"/apps/vendors-node_modules_popperjs_core_dist_cjs_popper_js-node_modules_symfony_stimulus-bridge_di-f31401.js": "/apps/build/vendors-node_modules_popperjs_core_dist_cjs_popper_js-node_modules_symfony_stimulus-bridge_di-f31401.js",
"/apps/backend/login.css": "/apps/build/backend/login.3c16c469.css",
"/apps/backend/login.js": "/apps/build/backend/login.13bc26d7.js",
"/apps/backend/dashboard.css": "/apps/build/backend/dashboard.1bdabc5b.css",
"/apps/backend/dashboard.js": "/apps/build/backend/dashboard.ac36556b.js",
"/apps/plugins/system/psc/invoice.css": "/apps/build/plugins/system/psc/invoice.19592370.css",
"/apps/plugins/system/psc/invoice.js": "/apps/build/plugins/system/psc/invoice.ee8e44d3.js",
"/apps/runtime.js": "/apps/build/runtime.18918ec8.js",
"/apps/560.268023de.js": "/apps/build/560.268023de.js",
"/apps/892.0a894e2a.js": "/apps/build/892.0a894e2a.js",
"/apps/72.e053f864.css": "/apps/build/72.e053f864.css",
"/apps/72.7a11b953.js": "/apps/build/72.7a11b953.js",
"/apps/fonts/summernote.eot": "/apps/build/fonts/summernote.7a3f9776.eot",
"/apps/fonts/summernote.ttf": "/apps/build/fonts/summernote.eb23b6b7.ttf",
"/apps/fonts/summernote.woff": "/apps/build/fonts/summernote.f2bec4f2.woff",

File diff suppressed because one or more lines are too long

View File

@ -55,8 +55,6 @@ if ($teile[5] == "") {
function loadFile(link, file, title) {
if (file == "pic") {
$('.thumbnail').html('<a href="' + link + '" data-lightbox="article_detail"><img id="layouter" src="' + link + '" class="articlelistimg " alt="' + title + '" title="' + title + '"></a>');
} else if (file == "youtube") {
$('.thumbnail').html('<iframe style="width:100%;" src="' + link + '" frameborder="0" allowfullscreen=""></iframe>');
}
}
@ -87,14 +85,6 @@ if ($teile[5] == "") {
}
}
// Get the modal
function closeModal() {
$(".youtubemodal").css("display", "none");
}
function openModal(what) {
$(".youtubemodal").css("display", "block");
}
</script>
<style>
div#finish_upload_booklet a {
@ -190,64 +180,8 @@ if ($teile[5] == "") {
height: auto;
}
.youtubemodal {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
padding-top: 100px;
/* Location of the box */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
}
/* Modal Content */
.modal-contentyoutube {
background-color: #fefefe;
margin: auto;
padding: 40px;
border: 1px solid #888;
width: 800px;
height: 800px;
position: relative;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
</style>
<div onclick="closeModal()" id="myYoutubeModal" class="youtubemodal">
<!-- Modal content -->
<div class="modal-contentyoutube">
<label style="width:100%;text-align:right;"><span onclick="closeModal()" style="cursor: pointer;font-size: 20px;">X</span></label>
<p id="help"><iframe style="width:90%;position: absolute; height: 80%;" src="//www.youtube.com/embed/<?php echo $this->article->getYoutubeId(); ?>" frameborder="0" allowfullscreen=""></iframe></p>
</div>
</div>
<!-- Modal -->
<div class="modal fade bd-example-modal-xl" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
@ -390,7 +324,7 @@ if ($teile[5] == "") {
<div class="clearfix"></div>
<!-- vorschau-bilder -->
<?php if ($this->article->file1 != "" || $this->article->file2 != "" || $this->article->file3 != "" || $this->article->file4 != "" || $this->article->file5 != "" || $this->article->file6 != "" || $this->article->file7 != "" || $this->article->getYoutubeId() != '') : ?>
<?php if ($this->article->file1 != "" || $this->article->file2 != "" || $this->article->file3 != "" || $this->article->file4 != "" || $this->article->file5 != "" || $this->article->file6 != "" || $this->article->file7 != "") : ?>
<div class="vorschau-bilder-klein">
<?php if ($this->article->file1 != "") : ?>
@ -428,11 +362,6 @@ if ($teile[5] == "") {
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file7, true); ?>" class="img-fluid">
</a>
<?php endif; ?>
<?php if ($this->article->getYoutubeId() != '') : ?>
<label style="width: 100px;height: 100px;text-align: center;background:url(<?php echo 'https://img.youtube.com/vi/' . $this->article->getYoutubeId() . '/1.jpg'; ?>);background-position: center top;background-size: 100% auto;" class="minipics" data-lightbox="article_detail" onclick="openModal('standard')">
<img style="width: 30%;margin-top: 40px;" src="/<?php echo $this->designPath ?>bootstrap/img/miniplay.png" alt="" class="img-fluid" />
</label>
<?php endif; ?>
<!--
<?php if($this->article->file1 != ""): ?>
@ -483,9 +412,6 @@ if ($teile[5] == "") {
</a>
<?php endif; ?>
<a href="//www.youtube.com/embed/<?php echo $this->article->getYoutubeId(); ?>" data-lightbox="article_detail">
<img src="<?php echo 'https://img.youtube.com/vi/' . $this->article->getYoutubeId() . '/1.jpg'; ?>" style="max-width:50px;" />
</a>-->
</div>
<?php endif; ?>

View File

@ -77,8 +77,6 @@ if ($teile[5] == "") {
function loadFile(link, file, title) {
if (file == "pic") {
$('.thumbnail').html('<a href="' + link + '" data-lightbox="article_detail"><img id="layouter" src="' + link + '" class="articlelistimg " alt="' + title + '" title="' + title + '"></a>');
} else if (file == "youtube") {
$('.thumbnail').html('<iframe style="width:100%;" src="' + link + '" frameborder="0" allowfullscreen=""></iframe>');
}
}
@ -109,14 +107,7 @@ if ($teile[5] == "") {
}
}
// Get the modal
function closeModal() {
$(".youtubemodal").css("display", "none");
}
function openModal(what) {
$(".youtubemodal").css("display", "block");
}
</script>
<style>
div#finish_upload_booklet a {
@ -212,64 +203,8 @@ if ($teile[5] == "") {
height: auto;
}
.youtubemodal {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
padding-top: 100px;
/* Location of the box */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
}
/* Modal Content */
.modal-contentyoutube {
background-color: #fefefe;
margin: auto;
padding: 40px;
border: 1px solid #888;
width: 800px;
height: 800px;
position: relative;
}
/* The Close Button */
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
</style>
<div onclick="closeModal()" id="myYoutubeModal" class="youtubemodal">
<!-- Modal content -->
<div class="modal-contentyoutube">
<label style="width:100%;text-align:right;"><span onclick="closeModal()" style="cursor: pointer;font-size: 20px;">X</span></label>
<p id="help"><iframe style="width:90%;position: absolute; height: 80%;" src="//www.youtube.com/embed/<?php echo $this->article->getYoutubeId(); ?>" frameborder="0" allowfullscreen=""></iframe></p>
</div>
</div>
<!-- Modal -->
<div class="modal fade bd-example-modal-xl" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myExtraLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl">
@ -408,7 +343,7 @@ if ($teile[5] == "") {
<div class="clearfix"></div>
<!-- vorschau-bilder -->
<?php if ($this->article->file1 != "" || $this->article->file2 != "" || $this->article->file3 != "" || $this->article->file4 != "" || $this->article->file5 != "" || $this->article->file6 != "" || $this->article->file7 != "" || $this->article->getYoutubeId() != '') : ?>
<?php if ($this->article->file1 != "" || $this->article->file2 != "" || $this->article->file3 != "" || $this->article->file4 != "" || $this->article->file5 != "" || $this->article->file6 != "" || $this->article->file7 != "") : ?>
<div class="vorschau-bilder-klein">
<?php if ($this->article->file1 != "") : ?>
@ -446,11 +381,7 @@ if ($teile[5] == "") {
<img src="<?php echo $this->image()->thumbnailImage($this->article->title, 'little', $this->article->file7, true); ?>" class="img-fluid">
</a>
<?php endif; ?>
<?php if ($this->article->getYoutubeId() != '') : ?>
<label style="width: 100px;height: 100px;text-align: center;background:url(<?php echo 'https://img.youtube.com/vi/' . $this->article->getYoutubeId() . '/1.jpg'; ?>);background-position: center top;background-size: 100% auto;" class="minipics" data-lightbox="article_detail" onclick="openModal('standard')">
<img style="width: 30%;margin-top: 40px;" src="/<?php echo $this->designPath ?>bootstrap/img/miniplay.png" alt="" class="img-fluid" />
</label>
<?php endif; ?>
<!--
<?php if ($this->article->file1 != "") : ?>
@ -501,9 +432,7 @@ if ($teile[5] == "") {
</a>
<?php endif; ?>
<a href="//www.youtube.com/embed/<?php echo $this->article->getYoutubeId(); ?>" data-lightbox="article_detail">
<img src="<?php echo 'https://img.youtube.com/vi/' . $this->article->getYoutubeId() . '/1.jpg'; ?>" style="max-width:50px;" />
</a>-->
</div>
<?php endif; ?>

View File

@ -67,7 +67,7 @@ span.btn.btn-success.fileinput-button {
<!--<h4>Position: <?php echo $i; ?> - <?php $keys[] = $article['orderpos']->id; echo $article['article']['title'] ?></h4>-->
<div class="well">
<?php foreach ($article['preflight_uploads'] as $upload): ?>
<h4>Druckdaten für <span style="font-weight:900"><?php $keys[] = $article['orderpos']->id; echo $article['article']['title'] ?></span> auswählen</h4>
<h4>Druckdaten für <span style="font-weight:900"><?php $keys[] = $article['orderpos']->id; echo $upload['name'] ?></span> auswählen</h4>
<div id="uploads-<?php echo $article['orderpos']->id; ?>_<?php echo $upload['id'] ?>" class="uploads">
<form id="fileupload"
action="/service/upload/uploadcenterbootstrap?id=<?php echo $article['orderpos']->id ?>&format=json"

View File

@ -1472,9 +1472,7 @@ class BasketController extends TP_Controller_Action
}
if ($this->getRequest()->isPost()) {
if ($this->getRequest()->getParam('step') == 1) {
$basket->generateOfferNumber();
if($this->getRequest()->getParam('company', false)) {
$basket->setOfferContact(
array(
'company' => $this->getRequest()->getParam('company', ''),
@ -1490,6 +1488,9 @@ class BasketController extends TP_Controller_Action
'title' => $this->getRequest()->getParam('title', '')
)
);
}
if ($this->getRequest()->getParam('step') == 1) {
$basket->generateOfferNumber();
$this->view->step1 = false;
$this->view->step2 = true;
}
@ -3916,6 +3917,9 @@ class BasketController extends TP_Controller_Action
)
)->fetchOne();
$article->used = $article->used + 1;
$article->save();
$art = new Orderspos();
$art->Shop = $this->shop;
$art->Account = $user->Account;
@ -4120,6 +4124,7 @@ class BasketController extends TP_Controller_Action
$article->a6_org_article = $orgid;
$article->contact_id = $user->id;
$article->private = true;
$article->used = 1;
$article->url = $article->url . '_'.time();
$article->file = "";
$article->file1 = "";
@ -4270,7 +4275,6 @@ class BasketController extends TP_Controller_Action
$art->setSetConfig(json_decode($article->set_config, true));
}
$article->used = $article->used + 1;
$article->save();
$art->count = $artikel->getCount();

View File

@ -1007,6 +1007,8 @@ class PreflightController extends TP_Controller_Action
$xml = file_get_contents(APPLICATION_PATH . '/articles/' . $this->frontend, null);
}
if($article->typ == 100) {
$xml = $article->getPluginSettings('saxoprint', 'uploadXML');
}
@ -1018,8 +1020,27 @@ class PreflightController extends TP_Controller_Action
$xml = new SimpleXMLElement($xml, null, false);
$uploads = array();
$params = $this->_getAllParams();
foreach ($xml as $article) {
if($config = $article->getPluginSettings('uploads', 'config')) {
$config = json_decode($config, true);
if(is_array($config['uploads'])) {
foreach ($config['uploads'] as $upload) {
$up[] = array(
'id' => (string)$upload['id'],
'name' => (string)$upload['name'],
'description' => (string)$upload['description']??''
);
if($this->_getParam('which', false)) {
$uploads[$this->_getParam('which', 'false')] = $up;
}else{
$uploads['Kalk'] = $up;
}
}
}
}
if(empty($uploads)) {
foreach ($xml as $article) {
$up = array();
foreach ($article->uploads->children() as $upload) {
if (isset($upload['select']) && $params[(string)$upload['select']] != (string)$upload['value']) {
@ -1034,6 +1055,8 @@ class PreflightController extends TP_Controller_Action
$uploads[(string)$article->name] = $up;
}
}
$this->view->clearVars();
if($this->_getParam('which', false)) {

View File

@ -115,7 +115,25 @@ class UploadcenterController extends TP_Controller_Action
$xml = array();
}
$uploads = array();
if($config = $article->getPluginSettings('uploads', 'config')) {
$config = json_decode($config, true);
if(is_array($config['uploads'])) {
foreach ($config['uploads'] as $upload) {
$up[] = array(
'id' => (string)$upload['id'],
'name' => (string)$upload['name'],
'description' => (string)$upload['description']??''
);
if($this->_getParam('which', false)) {
$uploads[$this->_getParam('which', 'false')] = $up;
}else{
$uploads['Kalk'] = $up;
}
}
}
}
if(empty($uploads)) {
foreach ($xml as $article_xml) {
$up = array();
@ -133,6 +151,7 @@ class UploadcenterController extends TP_Controller_Action
$uploads[(string)$article_xml->name] = $up;
}
}
if($xml_product != "") {
$params['kalk_artikel'] = $xml_product;
}

View File

@ -3023,10 +3023,6 @@ class UserController extends TP_Controller_Action
}
if ($this->_request->isPost()) {
if($form->getSubForm('rech')->getElement('is_company') && $form->getSubForm('rech')->getElement('is_company')->isChecked()) {
$form->get('rech')->get('self_department')->setRequired(true);
$form->get('rech')->get('ustid')->setRequired(true);
}
$externalValidation = true;
if($this->shop->getPluginSettings(module: 'friendlycaptcha', name: 'secret')) {
$externalValidation = false;

View File

@ -1 +0,0 @@
<li class="nav-item"><a class="nav-link" href="/overview/shop-bestellen">Shop - Bestellen</a></li>

View File

@ -1,7 +0,0 @@
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="/overview/druckshop" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Druckshop</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="/overview/druckshop" id="navbarDropdownMenuLink"><strong>Druckshop</strong></a><li class="nav-item"><a class="dropdown-item" href="/overview/falzflyer">Falzflyer</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/textildrucke">Textildrucke</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/planobogen">Planobogen</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/visitenkarten">Visitenkarten</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/bachelor-master-studium">Bachelor Master Studium</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/banner">Banner</a></li><li class="dropdown-submenu"><a class="dropdown-item dropdown-toggle" href="/overview/buecher-broschueren">Bücher & Broschüren</a><ul class="dropdown-menu"><li class="nav-item"><a class="dropdown-item" href="/overview/hardcoverbuch">Hardcoverbuch</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/kataloge">Kataloge</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/zeitung">Zeitung</a></li></ul></li><li class="nav-item"><a class="dropdown-item" href="/overview/cd-dvd">CD & DVD </a></li><li class="nav-item"><a class="dropdown-item" href="/overview/etiketten-aufkleber">Etiketten & Aufkleber</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/karten">Karten</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/fotogeschenke">Fotogeschenke</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/geschaeftsausstattung">Geschäftsausstattung</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/leinwanddruck">Leinwanddruck</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/loseblattsammlung">Loseblattsammlung</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/plotarbeiten">Plotarbeiten</a></li><li class="dropdown-submenu"><a class="dropdown-item dropdown-toggle" href="/overview/poster-plakate">Poster & Plakate</a><ul class="dropdown-menu"><li class="nav-item"><a class="dropdown-item" href="/overview/fototapete">Fototapete</a></li></ul></li><li class="dropdown-submenu"><a class="dropdown-item dropdown-toggle" href="/overview/praesentationssysteme">Präsentationssysteme</a><ul class="dropdown-menu"><li class="nav-item"><a class="dropdown-item" href="/overview/roll-up">Roll Up</a></li></ul></li><li class="nav-item"><a class="dropdown-item" href="/overview/werbetechnik-displays">Werbetechnik / Displays</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/folien">Folien</a></li></ul></li></li><li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="/overview/online-gestalten" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Online gestalten</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" href="/overview/online-gestalten" id="navbarDropdownMenuLink"><strong>Online gestalten</strong></a><li class="nav-item"><a class="dropdown-item" href="/overview/poster-plakate-1">Poster & Plakate</a></li><li class="nav-item"><a class="dropdown-item" href="/overview/kalender-1">Kalender</a></li></ul></li></li>

View File

@ -684,6 +684,10 @@ span.glyphicon.glyphicon-info-sign {
border-top-left-radius: calc(.3rem - 1px) !important;
border-top-right-radius: calc(.3rem - 1px) !important;
}
.popover-body {
padding-left: 2rem !important;
}
/* Modal / Tooltip */
/* user mysettings */
#mysettings fieldset#fieldset-login legend, #mysettings fieldset#fieldset-rech legend {

File diff suppressed because it is too large Load Diff

View File

@ -128,16 +128,22 @@ class Saxoprint {
'" class="col-sm-4 control-label">' +
item.label +
"</label>\n" +
' <div class="col-sm-8">\n' +
' <div class="col-sm-8 input-group">\n' +
' <select data-label="' + item.label + '" class="form-control" id="saxo_' +
item.id +
'" name="property[' +
item.id +
']">' +
options +
"</select>" +
" </div>\n" +
" </div>";
"</select>";
if(item.help) {
form += '<div class="input-group-append">' +
'<button type="button" class="btn btn-secondary popover-button" data-container="body" data-toggle="popover" data-placement="right" data-content="' + item.help.helpText + '">?</button>' +
'</div>';
}
form += '</div>' +
"</div>";
}
}
@ -233,6 +239,7 @@ class Saxoprint {
}
storePrice(price) {
$('.popover-button').popover({animation: false, html: true});
var options = { auflage: $("#auflage").val() };
var infos = [];

View File

@ -1,299 +0,0 @@
var productXml = "";
loadCalc = function () {};
class Saxoprint {
price = 0
options = []
info = []
constructor(productId, saxoprintProductId, auflage, mwert) {
this.productId = productId;
this.saxoprintProductId = saxoprintProductId;
this.auflage = auflage;
this.mwert = mwert;
}
init() {
this.getProduct();
var self = this;
$(".printOffer").click(function(event) {
window.open('/apps/product/offer/' + productUUId);
});
}
getProduct() {
$(".loading").show();
var self = this;
$.post(
"/apps/plugin/custom/psc/saxoprint/config",
{
saxoprintProductId: this.saxoprintProductId,
productId: self.productId,
config: $("#calc_saxoprint").serialize(),
},
function (data, status) {
self.buildUi(data.config);
self.buildPrice(data.price);
},
);
}
changeAuflage() {
$(".loading").show();
var self = this;
$.post(
"/apps/plugin/custom/psc/saxoprint/price",
{
saxoprintProductId: this.saxoprintProductId,
productId: self.productId,
config: $("#calc_saxoprint").serialize(),
},
function (data, status) {
//self.buildUi(data.config);
self.buildPrice(data.price);
},
);
}
buildUi(productOptions) {
var form = "";
var options = "";
var selected = "";
$.each(productOptions, function (index, item) {
if (item.type == "select") {
options = "";
$.each(item.values, function (i, value) {
selected = "";
if (parseInt(item.defaultValue) == value.id) {
selected = 'selected="selected"';
}
if (value.id == 0) {
options +=
'<option value="' +
value.id +
'" ' +
selected +
">----------------</option>";
} else {
options +=
'<option value="' +
value.id +
'" ' +
selected +
">" +
value.label +
"</option>";
}
});
if ($("#saxo_" + item.id).length > 0) {
$("#saxo_" + item.id).html(options);
} else {
if (item.disabled) {
form +=
'<div class="form-group form-group-sm ' +
(item.values.length > 0 ? "show" : "hide") +
'">\n' +
' <label for="' +
item.id +
'" class="col-sm-4 control-label">' +
item.label +
"</label>\n" +
' <div class="col-sm-8">\n' +
' <select class="form-control" disabled id="saxo_' +
item.id +
'" name="proptery[' +
item.id +
']">' +
options +
"</select>" +
' <input type="hidden" name="property[' +
item.id +
']" id="disabled_input_' +
item.id +
'" value="' +
item.defaultValue +
'"/>' +
" </div>\n" +
" </div>";
} else {
form +=
'<div class="form-group form-group-sm ' +
(item.values.length > 0 ? "show" : "hide") +
'">\n' +
' <label for="' +
item.id +
'" class="col-sm-4 control-label">' +
item.label +
"</label>\n" +
' <div class="col-sm-8">\n' +
' <select class="form-control" id="saxo_' +
item.id +
'" name="property[' +
item.id +
']">' +
options +
"</select>" +
" </div>\n" +
" </div>";
}
}
if (item.values.length > 0) {
$("#saxo_" + item.id)
.parent()
.parent()
.removeClass("hide");
} else {
$("#saxo_" + item.id)
.parent()
.parent()
.addClass("hide");
}
}
if (item.type == "input") {
if ($("#saxo_" + item.id).length > 0) {
} else {
if (item.disabled) {
form +=
'<div class="form-group form-group-sm show">\n' +
' <label for="' +
item.id +
'" class="col-sm-4 control-label">' +
item.label +
"</label>\n" +
' <div class="col-sm-8">\n' +
' <div class="input-group">\n' +
' <input class="form-control" disabled id="saxo_' +
item.id +
'" name="custom[' +
item.id +
']" value="' +
item.defaultValue +
'" />' +
' <input type="hidden" name="custom[' +
item.id +
']" id="disabled_input_' +
item.id +
'" value="' +
item.defaultValue +
'" >' +
' <div class="input-group-append">' +
' <span class="input-group-text">mm</span>' +
" </div>" +
" </div>" +
" </div>\n" +
" </div>";
} else {
form +=
'<div class="form-group form-group-sm show">\n' +
' <label for="' +
item.id +
'" class="col-sm-4 control-label">' +
item.label +
"</label>\n" +
' <div class="col-sm-8">\n' +
' <div class="input-group">\n' +
' <input class="form-control " id="saxo_' +
item.id +
'" name="custom[' +
item.id +
']" value="' +
item.defaultValue +
'">' +
' <div class="input-group-append">' +
' <span class="input-group-text">mm</span>' +
" </div>" +
" </div>" +
" </div>\n" +
" </div>";
}
}
}
});
$("#selextender").append(form);
}
bindUi() {
var self = this;
$("#in_basket").removeClass("disabled");
$("#calc_saxoprint #saxo_auflage").unbind();
$("#calc_saxoprint #saxo_auflage").change(function () {
self.changeAuflage();
});
$("#calc_saxoprint select, #calc_saxoprint input").not("#saxo_auflage").unbind();
$("#calc_saxoprint select, #calc_saxoprint input")
.not("#saxo_auflage")
.change(function () {
self.getProduct();
});
}
storePrice(price) {
var options = { auflage: $("#auflage").val() };
var infos = [];
$("#calc_saxoprint select").each(function () {
if ($(this).find("option:selected").val() == "") {
return;
}
infos.push({
name: this.name,
label: $(this).data('label'),
value: $(this).find("option:selected").val(),
text: $(this).find("option:selected").text(),
});
options[this.name] = $(this).find("option:selected").text();
});
this.price = price;
this.options = options;
this.infos = infos;
$.post(
"/apps/plugin/custom/psc/saxoprint/storePrice",
{
saxoprintProductId: this.saxoprintProductId,
productId: this.productId,
netto: price,
steuer: (price / 100) * this.mwert,
brutto: price + (price / 100) * this.mwert,
options: JSON.stringify(options),
infos: JSON.stringify(infos),
},
function (data, status) {
$(".loading").hide();
},
);
}
buildPrice(price) {
var self = this;
$("#netto").html(
new Intl.NumberFormat("de-DE", {
style: "currency",
currency: "EUR",
}).format(price),
);
$("#mwert").html(
new Intl.NumberFormat("de-DE", {
style: "currency",
currency: "EUR",
}).format((price / 100) * self.mwert),
);
$("#brutto").html(
new Intl.NumberFormat("de-DE", {
style: "currency",
currency: "EUR",
}).format(price + (price / 100) * self.mwert),
);
self.bindUi();
self.storePrice(price);
}
}

Some files were not shown because too many files have changed in this diff Show More