-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
- {{ $t('headline') }}
-
-
-
- {{ $t('text') }}
-
-
-
- {{ $t('fieldset') }}
-
-
-
- {{ $t('media') }}
-
-
-
- {{ $t('textarea') }}
-
-
-
- {{ $t('input') }}
-
-
-
- {{ $t('select') }}
-
-
-
- {{ $t('hidden') }}
-
-
-
-
{{ $t('row') }}
+
+
+
{{ $t(group.category) }}
+
+
+ {{ $t(element.name) }}
+
+
\ No newline at end of file
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/i18n/de.json b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/i18n/de.json
index 3e5789e84..e440133d7 100644
--- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/i18n/de.json
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/i18n/de.json
@@ -47,5 +47,8 @@
"parameter_view": "Parameter Ansicht",
"paperdb_view": "PapierDB Ansicht",
"syncing": "Synchronisiere...",
- "sync": "Synchronisieren"
+ "sync": "Synchronisieren",
+ "cms_elements": "CMS-Elemente",
+ "form_elements": "Formular-Elemente",
+ "structure_elements": "Struktur-Elemente"
}
\ No newline at end of file
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/i18n/en.json b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/i18n/en.json
index 2c802ab59..51eb548a6 100644
--- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/i18n/en.json
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/i18n/en.json
@@ -47,5 +47,8 @@
"parameter_view": "Parameter View",
"paperdb_view": "PaperDB View",
"syncing": "Syncing...",
- "sync": "Sync"
+ "sync": "Sync",
+ "cms_elements": "CMS Elements",
+ "form_elements": "Form Elements",
+ "structure_elements": "Structure Elements"
}
\ No newline at end of file
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/BaseElement.ts b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/BaseElement.ts
index e482451fe..36521773e 100644
--- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/BaseElement.ts
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/BaseElement.ts
@@ -35,7 +35,9 @@ export default class BaseElement {
}, [])
}
}
+ getIdRecursiv(list: []) {
+ }
fromJSON(obj: any) {
this.id = obj.id
this.type = obj.type
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Column.ts b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Column.ts
index 9bfc94703..b54e0824c 100644
--- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Column.ts
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Column.ts
@@ -32,7 +32,13 @@ export default class Column extends BaseElement {
this.items.push(item)
})
}
+ getIdRecursiv(list: []) {
+ this.items.forEach((item) => {
+ list.push(item.id);
+ item.getIdRecursiv(list)
+ })
+ }
cutItem(existingUuid: string) {
let item: BaseElement | null = null;
this.items.forEach((element: BaseElement, indexArray: number) => {
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/FieldsetElement.ts b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/FieldsetElement.ts
index f2eb7eedd..71b17bba2 100644
--- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/FieldsetElement.ts
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/FieldsetElement.ts
@@ -34,7 +34,13 @@ export default class FieldsetElement extends BaseElement {
this.items.push(item)
})
}
+ getIdRecursiv(list: []) {
+ this.items.forEach((item) => {
+ list.push(item.id);
+ item.getIdRecursiv(list)
+ })
+ }
cutItem(existingUuid: string) {
let item: BaseElement | null = null;
this.items.forEach((element: BaseElement, indexArray: number) => {
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Mode.ts b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Mode.ts
new file mode 100644
index 000000000..e5f94ee10
--- /dev/null
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Mode.ts
@@ -0,0 +1,7 @@
+enum Mode {
+ Product = 1,
+ CMS = 2,
+ News = 3,
+}
+
+export default Mode
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Row.ts b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Row.ts
index 97504548c..bd8cb091b 100644
--- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Row.ts
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/model/Row.ts
@@ -16,6 +16,11 @@ export default class Row extends BaseElement {
addColumnAtTheBeginning(column: Column) {
this.columns.unshift(column)
}
+ getIdRecursiv(list: []) {
+ this.columns.forEach((column) => {
+ column.getIdRecursiv(list)
+ })
+ }
deleteColumnAt(targetUuid: string): boolean {
return this.columns.some((element: BaseElement, indexArray: number) => {
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/stores/Global.ts b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/stores/Global.ts
index 66cc975e3..0adaa28f9 100644
--- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/stores/Global.ts
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/stores/Global.ts
@@ -1,5 +1,6 @@
import { defineStore } from 'pinia'
import BaseElement from '../model/BaseElement'
+import Mode from '../model/Mode'
import { saveProductToApi, saveFomulasAndParameterToApi, loadJsonFromApi, loadPriceFromApi, savePaperContainerToApi, saveDesignToApi, saveXmlToApi } from '../lib/api'
import { useItemStore } from './Items'
@@ -22,6 +23,7 @@ export const useGlobalStore = defineStore('global', {
paperContainer: "",
parameter: "",
shopUuid: "",
+ mode: Mode.Product,
saving: false,
syncing: false,
currentTab: 'designer' as string | number,
@@ -50,6 +52,9 @@ export const useGlobalStore = defineStore('global', {
setParameter(value: string) {
this.parameter = value
},
+ setMode(value: Number) {
+ this.mode = value
+ },
setJson(value: string) {
this.json = value
},
@@ -77,6 +82,9 @@ export const useGlobalStore = defineStore('global', {
setDragMode(mode: string) {
this.dragMode = mode
},
+ setShopUuid(value: string) {
+ this.shopUuid = value
+ },
async loadConfigFromProductApi(uuid: string) {
const data: any = await loadJsonFromApi(uuid)
this.json = data.json
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/stores/Items.ts b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/stores/Items.ts
index d76802151..82522de4a 100644
--- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/stores/Items.ts
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/src/stores/Items.ts
@@ -11,6 +11,14 @@ export const useItemStore = defineStore('items', {
}),
getters: {
getCount: (state) => state.items.length,
+ getIdRecursiv(state) {
+ let list = []
+ state.items.forEach((item) => {
+ list.push(item.id);
+ item.getIdRecursiv(list)
+ })
+ return list
+ },
getItems: (state) => state.items,
getUuid: (state) => state.uuid,
},
diff --git a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/vite.config.ts b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/vite.config.ts
index e7ab6cb0a..d7705b471 100644
--- a/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/vite.config.ts
+++ b/src/new/var/plugins/Custom/PSC/FormBuilder/FormBuilderTS/vite.config.ts
@@ -33,7 +33,7 @@ export default defineConfig({
changeOrigin: true,
configure: (proxy) => {
proxy.on('proxyReq', (proxyReq) => {
- proxyReq.setHeader('Authorization', 'Bearer eyJ0eXAiO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ldGUiLCJST0xFX1BTQ19Db2xsZWN0X0NvbnRhY3RfTG9jayIsIlJPTEVfUFNDX1IyX1NlbmRjbG91ZF9TaG93Il0sInVpZCI6MX0.JQV0pGK1C_9sL4-0zLlXBzwMV8tUwCLis9KDUC_5DVOZf8Ujb0Yqgmie9B9DISAGvjtWUSvuUzcbcsV4m2gkNN-6dar-Y6XCC54KbkVCAOhssMp3KsZ1pbCiZ_VdUt78WbAFMkvhToHjjdpD4KqhetQjqFlGF1jYXfJmFzRDHh0YnUfYZDsqgun423JeUXbRYB0sJ3FLQzCuyUDWFvdsQVwCGsgs0ffkro42qMbLXZtdRPaAPZTlEYbE5H-wck1iKvAeEgNuqGJEnk-oEy6UQ1mGUHz7NT5N7NmXhkca2byInCMXhDPn2tmQvte5AKUAte0GELt3FjF5rhk1Iu2rZw');
});
},
},
diff --git a/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/Preview.php b/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/Preview.php
new file mode 100644
index 000000000..399e29f1e
--- /dev/null
+++ b/src/new/var/plugins/System/PSC/XmlCalc/Api/Product/Preview.php
@@ -0,0 +1,287 @@
+shopService = $shopService;
+ $this->documentManager = $documentManager;
+ $this->entityManager = $entityManager;
+ $this->tokenStorage = $tokenStorage;
+ $this->paperDB = $paperDB;
+ $this->contactTransformer = $contactTransformer;
+ $this->helpService = $helpService;
+ }
+
+ /**
+ * get price
+ *
+ * @OA\Response(
+ * response=200,
+ * description="orders",
+ * @OA\JsonContent(ref=@Model(type=\Plugin\System\PSC\XmlCalc\Dto\Output\PriceOutput::class))
+ * )
+ * @OA\RequestBody(
+ *
+ * @Model(type=\Plugin\System\PSC\XmlCalc\Dto\Input\PriceInput::class))
+ * )
+ * @OA\Tag(name="Plugin/System/psc/Xmlcalc/Price")
+ */
+ #[Route(path: '/product/preview', methods: ['POST'])]
+ #[ParamConverter(
+ 'data',
+ class: '\Plugin\System\PSC\XmlCalc\Dto\Input\PriceInput',
+ converter: 'psc_rest.request_body',
+ )]
+ public function preview(PriceInput $data)
+ {
+ $output = new \Plugin\System\PSC\XmlCalc\Dto\Output\PriceOutput();
+ $output->product = $data->product;
+
+ /**
+ * @var Product $product
+ */
+ $product = $this->entityManager
+ ->getRepository('PSC\Shop\EntityBundle\Entity\Product')
+ ->findOneBy(['uuid' => $data->product]);
+
+ $paperContainer = new PaperContainer();
+ $paperContainer->parse(simplexml_load_string($product->getShop()->getInstall()->getPaperContainer()));
+ $engine = new Engine();
+ $engine->setPaperRepository($this->paperDB);
+ $engine->setPaperContainer($paperContainer);
+ if ($product->getShop()->getInstall()->getCalcTemplates() && !$data->test) {
+ $engine->setTemplates('
' . $product->getShop()->getInstall()->getCalcTemplates() . '');
+ }
+ if ($product->getShop()->getInstall()->getCalcTemplatesTest() && $data->test) {
+ $engine->setTemplates('
' . $product->getShop()->getInstall()->getCalcTemplatesTest() . '');
+ }
+ $engine->loadString($product->getCalcXml());
+ if (!$data->test) {
+ $engine->setFormulas($product->getShop()->getFormel());
+ $engine->setParameters($product->getShop()->getParameter());
+ }
+ if ($data->test) {
+ $engine->setFormulas($product->getShop()->getTestFormel());
+ $engine->setParameters($product->getShop()->getTestParameter());
+ }
+ $engine->setVariables($data->values);
+ $engine->setTax($product->getMwert());
+ if ($this->tokenStorage->getToken()) {
+ $contact = new Contact();
+ $this->contactTransformer->fromDb($contact, $this->tokenStorage->getToken()->getUser());
+ $engine->setVariable('contact.accountType', $contact->getAccountType()->value);
+ $engine->setVariable('contact.account', $contact->getAccount()->getUid());
+ }
+ if ($data->xmlProduct != '') {
+ $engine->setActiveArticle($data->xmlProduct);
+ }
+
+ foreach ($engine->getArticle()->getDisplayGroups() as $group) {
+ $groupObj = new DisplayGroup();
+ $groupObj->id = $group->getId();
+ $groupObj->name = $group->getName();
+ $output->displayGroups[] = $groupObj;
+ }
+
+ $output->netto = $engine->getPrice() * 100;
+ $output->steuer = $engine->getTaxPrice() * 100;
+ $output->brutto = $engine->getCompletePrice() * 100;
+ $output->xmlProduct = $engine->getArticle()->getName();
+ $output->weight = $engine->getWeight();
+ $output->weightSingle = $engine->getWeightSingle();
+
+ foreach ($engine->getArticles() as $article) {
+ $output->xmlProductTypes[] = $article->getName();
+ }
+
+ /**
+ * @var Base $option
+ */
+ foreach ($engine->getArticle()->getOptions() as $option) {
+ $tmp = new Element();
+ $tmp->name = $option->getName();
+ $tmp->required = $option->isRequire();
+ if (is_array($option->getRawValue())) {
+ $tmp->rawValues = $option->getRawValue();
+ } else {
+ $tmp->rawValue = $option->getRawValue();
+ }
+ if ($option->getDefault()) {
+ $tmp->defaultValue = $option->getDefault();
+ }
+ $tmp->value = $option->getValue();
+
+ if ($help = $this->helpService->getHelp((string) $product->getUid(), $option->getId())) {
+ $tmp->help = $help->helpText;
+ $tmp->helpTitle = $help->helpTitle;
+ } else {
+ $tmp->help = $option->getHelp();
+ $tmp->helpLink = $option->getHelpLink();
+ }
+ $tmp->id = $option->getId();
+ $tmp->valid = $option->isValid();
+ $tmp->htmlType = $option->type;
+ $tmp->displayGroup = $option->getDisplayGroup();
+
+ if ($option->type == 'select' || $option->type == 'checkbox' || $option->type == 'radio') {
+ /**
+ * @var Opt $option
+ */
+ if ($option instanceof ColorDBSelect) {
+ $tmp->colorSystem = $option->getColorSystem();
+ if (!isset($output->colorDb[$option->getColorSystem()])) {
+ $output->colorDb[$option->getColorSystem()] = [];
+ foreach ($option->getOptions() as $opt) {
+ $element = array_find((array) $option->getSelectedOptions(), function (Opt $o1) use ($opt) {
+ return $o1->getId() === $opt->getId();
+ });
+ $tmpOpt = new Option();
+ $tmpOpt->id = $opt->getId();
+ $tmpOpt->name = $opt->getLabel();
+ $tmpOpt->prefix = $opt->getPrefix();
+ $tmpOpt->suffix = $opt->getSuffix();
+ $tmpOpt->valid = $opt->isValid();
+ $tmpOpt->selected = $element ? true : false;
+ $output->colorDb[$option->getColorSystem()][] = $tmpOpt;
+ }
+ }
+ } else {
+ foreach ($option->getOptions() as $opt) {
+ $element = array_find((array) $option->getSelectedOptions(), function (Opt $o1) use ($opt) {
+ return $o1->getId() === $opt->getId();
+ });
+
+ if ($option instanceof DeliverySelect) {
+ $tmpOpt = new Option();
+ $tmpOpt->id = $opt->getId();
+ $tmpOpt->name = $opt->getLabel();
+ $tmpOpt->valid = $opt->isValid();
+ $tmpOpt->selected = $element ? true : false;
+ $tmpOpt->info = $opt->getInfo();
+ $tmpOpt->deliveryDate = $opt->getDeliveryDateAsString();
+ } else {
+ $tmpOpt = new Option();
+ $tmpOpt->id = $opt->getId();
+ $tmpOpt->name = $opt->getLabel();
+ $tmpOpt->valid = $opt->isValid();
+ $tmpOpt->selected = $element ? true : false;
+ }
+ $tmp->options[] = $tmpOpt;
+ }
+ }
+ }
+ if ($option->type == 'input') {
+ $tmp->minValue = $option->getMinValue();
+ $tmp->maxValue = $option->getMaxValue();
+ $tmp->placeHolder = $option->getPlaceHolder();
+ $tmp->pattern = $option->getPattern();
+ foreach ($option->getValidationErrors() as $error) {
+ if ($error instanceof PSCMin) {
+ $tmp->validationErrors[] = new Min($tmp->value, $option->getMinValue());
+ }
+ if ($error instanceof Max) {
+ $tmp->validationErrors[] = new PluginMax($tmp->value, $option->getMaxValue());
+ }
+ }
+ }
+
+ $output->elements[] = $tmp;
+ }
+
+ foreach ($engine->getArticle()->getPreCalc()->getGroups() as $group) {
+ $groupObj = new Group();
+ $groupObj->name = $group->getName();
+ foreach ($group->getVariants() as $variant) {
+ $variantObj = new Variant();
+ $variantObj->name = $variant->getName();
+ $variantObj->text = $variant->getText();
+ $variantObj->data = $variant->getData();
+ foreach ($variant->getValues() as $value) {
+ $valueObj = new Value();
+ $valueObj->key = $value->getKey();
+ $valueObj->value = $value->getValue();
+ $variantObj->values[] = $valueObj;
+ }
+ $groupObj->variants[] = $variant;
+ }
+ $output->preCalc[] = $groupObj;
+ }
+
+ $output->displayValues = $engine->getDisplayVariables();
+ $output->exportValues = $engine->getAjaxVariables();
+
+ if ($this->isGranted('ROLE_SHOP')) {
+ $output->debug['formels'] = $engine->getDebugCalcFormel();
+ $output->debug['flatPrice'] = $engine->getDebugFlatPrice();
+ $output->debug['price'] = $engine->getDebugPrice();
+ $output->debug['calcValues'] = $engine->getDebugCalcVariables();
+ $output->debug['graphJson'] = $engine->getCalcGraph()->generateJsonGraph();
+ }
+ return $this->json($output);
+ }
+}
diff --git a/src/old/application/modules/default/controllers/UserController.php b/src/old/application/modules/default/controllers/UserController.php
index 3c6389884..f2a9b7630 100755
--- a/src/old/application/modules/default/controllers/UserController.php
+++ b/src/old/application/modules/default/controllers/UserController.php
@@ -4182,7 +4182,11 @@ class UserController extends TP_Controller_Action
$_authAdapter->setIdentity($vars[0]);
$result = Zend_Auth::getInstance()->authenticate($_authAdapter);
- Zend_Registry::set('browser_form_post_url', urldecode($vars[2]));
+ $_SESSION['browser_form_post_url'] = urldecode($vars[2]);
+ $_SESSION['from_identity'] = urldecode($vars[3]);
+ $_SESSION['to_identity'] = urldecode($vars[4]);
+ $_SESSION['sender_domain'] = urldecode($vars[5]);
+ $_SESSION['sender_identity'] = urldecode($vars[6]);
if ($result->isValid()) {
return $this->redirectSpeak('/');
@@ -4228,8 +4232,18 @@ class UserController extends TP_Controller_Action
$basepath .
'/user/xmllogin?contact=' .
$contact->id .
- '*nsWXSoLmx8TNEjdE8fbn*' .
+ '*' .
+ 'nsWXSoLmx8TNEjdE8fbn' .
+ '*' .
urlencode((string) $xml->Request->PunchOutSetupRequest->BrowserFormPost->URL) .
+ '*' .
+ urlencode((string) $xml->Header->From->Credential->Identity) .
+ '*' .
+ urlencode((string) $xml->Header->To->Credential->Identity) .
+ '*' .
+ urlencode((string) $xml->Header->Sender->Credential['domain']) .
+ '*' .
+ urlencode((string) $xml->Header->Sender->Credential->Identity) .
'' .
'' .
'' .