Compare commits
34 Commits
asset-mapp
...
plugin-lau
| Author | SHA1 | Date | |
|---|---|---|---|
| 9937165710 | |||
| a2fc107f26 | |||
| a2187a48b8 | |||
| d598a9214f | |||
| 3a0019a1b9 | |||
| 7e46c1fc5d | |||
| 47057ea7a3 | |||
| e9ca2223e4 | |||
| 91ba43510b | |||
| 6d6241576d | |||
| 1ff03906c2 | |||
| 7e7628bbd3 | |||
| 1cc2bc57ba | |||
| c504f9e4de | |||
| e044a424fa | |||
| 0c00d36236 | |||
| e320761ff5 | |||
| 0e1ae9a1a7 | |||
| 4db2d79207 | |||
| beb6450338 | |||
| 4be0f5a39d | |||
| a65ecc8d47 | |||
| 75caff77f1 | |||
| ff9978d103 | |||
| deca028334 | |||
| 3fc04a4373 | |||
| d30ffb4981 | |||
| b6e25299cd | |||
| 2bc45b89c4 | |||
| 1021f70a8b | |||
| fe28e238be | |||
| 60a41b5f14 | |||
| 3f14580904 | |||
| fbd0cbf43e |
@ -100,8 +100,14 @@ RUN docker-php-ext-install -j$(nproc) ldap
|
||||
RUN pecl install imap \
|
||||
&& docker-php-ext-enable imap
|
||||
|
||||
# rsvg und pdfmerge für creativelayouter
|
||||
COPY ./src/new/assets/fonts /usr/local/share/fonts/custom
|
||||
RUN fc-cache -fv
|
||||
RUN apt-get update && apt-get install cairosvg -y
|
||||
|
||||
# COPY ./.docker/images/php/base/pdf/php_pdflib.so /pdflib.so
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
poppler-utils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# make bash default shell
|
||||
RUN sed -e 's;/bin/ash$;/bin/bash;g' -i /etc/passwd
|
||||
|
||||
Binary file not shown.
@ -10,3 +10,7 @@ symfony-init: ## init Symfony
|
||||
$(EXECUTE_IN_APPLICATION_CONTAINER) php "/application/src/new/bin/console" importmap:install;
|
||||
$(EXECUTE_IN_APPLICATION_CONTAINER) php "/application/src/new/bin/console" asset-map:compile;
|
||||
$(EXECUTE_IN_APPLICATION_CONTAINER) php "/application/src/new/bin/console" assets:install;
|
||||
|
||||
.PHONY: php-stan
|
||||
php-stan: ## init Symfony
|
||||
$(EXECUTE_IN_APPLICATION_CONTAINER) php "vendor/bin/phpstan" analyse ;
|
||||
|
||||
Binary file not shown.
@ -306,7 +306,7 @@ CREATE TABLE `article` (
|
||||
`a4_auflagen` text DEFAULT NULL,
|
||||
`a4_sponsoring` int(1) DEFAULT NULL,
|
||||
`a4_prodzeit` varchar(255) DEFAULT NULL,
|
||||
`a4_abpreis` float(8,2) DEFAULT 0.00,
|
||||
`a4_abpreis` varchar(20) DEFAULT NULL,
|
||||
`a5_buy` int(1) DEFAULT NULL,
|
||||
`a5_xml` text DEFAULT NULL,
|
||||
`layouterid` varchar(255) DEFAULT NULL,
|
||||
@ -933,7 +933,7 @@ CREATE TABLE `contact_address` (
|
||||
`email` varchar(255) DEFAULT NULL,
|
||||
`type` int(1) NOT NULL,
|
||||
`company` varchar(100) DEFAULT NULL,
|
||||
`anrede` varchar(100) NOT NULL,
|
||||
`anrede` varchar(100) DEFAULT NULL,
|
||||
`country` varchar(100) DEFAULT NULL,
|
||||
`fax` varchar(255) DEFAULT NULL,
|
||||
`company2` varchar(255) DEFAULT NULL,
|
||||
@ -1712,7 +1712,7 @@ CREATE TABLE `papierdb` (
|
||||
`huelsendurchmesser` varchar(60) DEFAULT NULL,
|
||||
`kleber` varchar(60) DEFAULT NULL,
|
||||
`abdeckpapier` varchar(60) DEFAULT NULL,
|
||||
`laufrichtung` varchar(2) DEFAULT NULL,
|
||||
`laufrichtung` varchar(60) DEFAULT NULL,
|
||||
`mengenangabe` int(10) DEFAULT NULL,
|
||||
`mengenangabe_palette` int(10) DEFAULT NULL,
|
||||
`inhalt` varchar(60) DEFAULT NULL,
|
||||
@ -2114,7 +2114,7 @@ CREATE TABLE `shop` (
|
||||
`smtphostname` varchar(255) DEFAULT NULL,
|
||||
`smtpusername` varchar(255) DEFAULT NULL,
|
||||
`smtppassword` varchar(255) DEFAULT NULL,
|
||||
`smtpusethis` int(1) NOT NULL,
|
||||
`smtpusethis` int(1) NULL DEFAULT 0,
|
||||
`useemailaslogin` int(1) NOT NULL,
|
||||
`noverify` int(1) NOT NULL,
|
||||
`keywords` longtext DEFAULT NULL,
|
||||
|
||||
Binary file not shown.
@ -31,4 +31,3 @@ JWT_PASSPHRASE=f7754c7a99638fe7162a144825ddaea7
|
||||
# postgresql+advisory://db_user:db_password@localhost/db_name
|
||||
LOCK_DSN=flock
|
||||
###< symfony/lock ###
|
||||
|
||||
|
||||
2
src/new/.env.dev
Normal file
2
src/new/.env.dev
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
MAILER_DSN=smtp://smtp4dev:25
|
||||
@ -1,27 +1,40 @@
|
||||
const Order_List_Detail = ({ uuid, basketField1, customerInfo, basketField2, pos, price, product, status, allNet, reOrder, reOrderOrder, reOrderPos }, orderUuid) => `
|
||||
<div style="${psc.order.get_pos_bg_color(status)}" class="row ${psc.order.get_pos_bg_color_class(status)}" id="row-${uuid}">
|
||||
<div class="col-1 p-1">${pos}</div>
|
||||
<div class="col-4 p-1">
|
||||
<tr style="${psc.order.get_pos_bg_color(status)}" class="border-t border-stroke ${psc.order.get_pos_bg_color_class(status)}" id="row-${uuid}">
|
||||
<td class="px-2 py-3"></td>
|
||||
<td class="px-2 py-3 font-medium">${pos}</td>
|
||||
<td class="px-2 py-3" colspan="2"></td>
|
||||
<td class="px-2 py-3" colspan="2"></td>
|
||||
<td class="px-2 py-3"></td>
|
||||
<td class="px-2 py-3">
|
||||
${
|
||||
(product => product.originalProduct ? `<a href="/apps/backend/product/edit/index/${product.originalProduct.uuid}">${product.originalProduct.title}</a>` : `<a href="/apps/backend/product/edit/index/${product.uuid}">${product.title}</a>` )(product) //call the anonymous inline with the data we care about
|
||||
(product => product.originalProduct ? `<a href="/apps/backend/product/edit/index/${product.originalProduct.uuid}" class="text-psc-500 hover:underline">${product.originalProduct.title}</a>` : `<a href="/apps/backend/product/edit/index/${product.uuid}" class="text-psc-500 hover:underline">${product.title}</a>` )(product)
|
||||
}
|
||||
<br/>ArtNr intern: ${product.nrIntern}<br/>
|
||||
${psc.order.get_special_product_options(product.specialProductTypeObject)}</div>
|
||||
<div class="col-1 p-1">Auflage: ${price.count}</div>
|
||||
<div class="col-1 p-1">Kunden Info: ${customerInfo}${(reOrder? `<br/><strong>Ist eine Nachbestellung</strong>`:``)}</div>
|
||||
<div class="col-1 p-1">${basketField1}</div>
|
||||
<div class="col-1 p-1">${basketField2}</div>
|
||||
<div class="col-1 p-1 text-end">${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allNet/100)} <strong>(${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allGross/100)})</strong></div>
|
||||
<div class="col-2 p-2 text-end"><div class="btn-group btn-group-sm w-100">
|
||||
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<br/><span class="text-xs text-gray-600">ArtNr intern: ${product.nrIntern}</span><br/>
|
||||
${psc.order.get_special_product_options(product.specialProductTypeObject)}
|
||||
</td>
|
||||
<td class="px-2 py-3">
|
||||
<span class="text-xs">Auflage: ${price.count}</span>
|
||||
</td>
|
||||
<td class="px-2 py-3">
|
||||
<span class="text-xs">Kunden Info: ${customerInfo}${(reOrder? `<br/><strong class="text-yellow-600">Ist eine Nachbestellung</strong>`:``)}</span>
|
||||
</td>
|
||||
<td class="px-2 py-3 text-right whitespace-nowrap">
|
||||
${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allNet/100)} <br/><strong>(${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allGross/100)})</strong>
|
||||
</td>
|
||||
<td class="px-2 py-3 text-right">
|
||||
<div class="relative inline-block text-left">
|
||||
<button type="button" class="inline-flex justify-between items-center w-full px-3 py-1.5 text-xs font-medium text-white bg-psc-500 hover:bg-psc-600 rounded-sm shadow-sm min-w-[120px]">
|
||||
${psc.order.get_pos_status(status).internalName}
|
||||
<svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<div class="hidden absolute right-0 z-10 mt-1 w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5">
|
||||
${psc.order.get_pos_status_loop(orderUuid, uuid)}
|
||||
</div>
|
||||
</div></div>
|
||||
<div class="col-1 p-1"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
|
||||
const Order_List_Detail_Simple = ({ uuid, basketField1, customerInfo, basketField2, pos, price, product, status, allNet }, orderUuid) => `
|
||||
@ -45,7 +58,7 @@ const Order_List_Detail_Simple = ({ uuid, basketField1, customerInfo, basketFiel
|
||||
`;
|
||||
|
||||
const Order_List_Pos_Status = (status, orderUuid, posUuid) => `
|
||||
<button type="button" class="dropdown-item switch_pos" data-order-uuid="${orderUuid}" data-pos-uuid="${posUuid}" data-status="${status.code}">${status.internalName}</button>
|
||||
<button type="button" class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 switch_pos" data-order-uuid="${orderUuid}" data-pos-uuid="${posUuid}" data-status="${status.code}">${status.internalName}</button>
|
||||
`;
|
||||
|
||||
const Order_List_Pos_Calc_Option = (elm) => `
|
||||
@ -92,20 +105,26 @@ export class order {
|
||||
$('.toogle_list_detail_view').off();
|
||||
$('.toogle_list_detail_view').on('click', function() {
|
||||
var uuid = $(this).data().uuid;
|
||||
if($('#rows-' + uuid + ' > div').length > 0) {
|
||||
var $icon = $(this);
|
||||
if($('#rows-' + uuid).children().length > 0) {
|
||||
$('#rows-' + uuid).html('');
|
||||
$icon.removeClass('fa-minus').addClass('fa-plus');
|
||||
}else{
|
||||
psc.order.load_detail(uuid);
|
||||
$icon.removeClass('fa-plus').addClass('fa-minus');
|
||||
}
|
||||
});
|
||||
|
||||
$('.toogle_list_simple_detail_view').off();
|
||||
$('.toogle_list_simple_detail_view').on('click', function() {
|
||||
var uuid = $(this).data().uuid;
|
||||
if($('#rows-' + uuid + ' > tr').length > 0) {
|
||||
var $icon = $(this);
|
||||
if($('#rows-' + uuid).children().length > 0) {
|
||||
$('#rows-' + uuid).html('');
|
||||
$icon.removeClass('fa-minus').addClass('fa-plus');
|
||||
}else{
|
||||
psc.order.load_detail(uuid, true);
|
||||
$icon.removeClass('fa-plus').addClass('fa-minus');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -2,16 +2,27 @@ import "./css/backend.css"
|
||||
import Alpine from 'alpinejs';
|
||||
import persist from '@alpinejs/persist'
|
||||
import $ from 'jquery'
|
||||
window.$ = window.jQuery = $;
|
||||
import 'summernote/dist/summernote-lite.js'
|
||||
import 'summernote/dist/summernote-lite.min.css'
|
||||
import '../backend/dashboard/js/summernote/mediabundle.plugin.js'
|
||||
import { initTabs } from 'david-ai';
|
||||
import { registerVueControllerComponents } from '@symfony/ux-vue';
|
||||
import { startStimulusApp } from '@symfony/stimulus-bundle';
|
||||
import { order } from './js/order.js';
|
||||
import { multiselect } from './js/multiselect.js';
|
||||
|
||||
window.$ = window.jQuery = $;
|
||||
// Initialize tabs functionality
|
||||
initTabs();
|
||||
import { registerVueControllerComponents } from '@symfony/ux-vue';
|
||||
registerVueControllerComponents()
|
||||
import { startStimulusApp } from '@symfony/stimulus-bundle';
|
||||
const app = startStimulusApp();
|
||||
Alpine.plugin(persist)
|
||||
|
||||
// Initialize PSC global object
|
||||
window.psc = window.psc || {};
|
||||
window.psc.order = new order();
|
||||
window.psc.multiselect = new multiselect();
|
||||
|
||||
Alpine.store('theme', {
|
||||
theme: Alpine.$persist("light").as('theme'),
|
||||
|
||||
@ -36,3 +47,43 @@ Alpine.store('sideBar', {
|
||||
}
|
||||
})
|
||||
Alpine.start();
|
||||
|
||||
// Initialize PSC modules
|
||||
window.psc.order.init();
|
||||
window.psc.multiselect.init();
|
||||
|
||||
const initSummernote = () => {
|
||||
if (!$.fn?.summernote) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(document).on('blur', '.note-codable', function () {
|
||||
const codeviewHtml = $(this).val();
|
||||
const $summernoteTextarea = $(this).closest('.note-editor').siblings('textarea');
|
||||
$summernoteTextarea.val(codeviewHtml);
|
||||
});
|
||||
|
||||
const toolbar = [
|
||||
['style', ['style']],
|
||||
['font', ['bold', 'italic', 'underline', 'clear']],
|
||||
['fontsize', ['fontsize']],
|
||||
['color', ['color']],
|
||||
['para', ['ul', 'ol', 'paragraph']],
|
||||
['height', ['height']],
|
||||
['table', ['table']],
|
||||
['insert', ['link', 'hr', 'image']],
|
||||
['view', ['fullscreen', 'codeview']],
|
||||
['help', ['help']],
|
||||
];
|
||||
|
||||
if (typeof window.mediaBundleBrowser === 'function') {
|
||||
toolbar.push(['media', ['media']]);
|
||||
}
|
||||
|
||||
$('.summernote').summernote({
|
||||
height: 400,
|
||||
toolbar,
|
||||
});
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', initSummernote);
|
||||
|
||||
@ -57,10 +57,10 @@
|
||||
}
|
||||
|
||||
.badge-yes {
|
||||
@apply inline-flex rounded-sm bg-lime-500 px-2 py-1 text-sm font-medium text-white hover:bg-opacity-90 justify-center shadow-xl;
|
||||
@apply inline-flex items-center rounded-full bg-lime-500 px-2 py-1 text-xs font-medium text-white hover:bg-opacity-90 justify-center shadow-xl;
|
||||
}
|
||||
.badge-no {
|
||||
@apply inline-flex rounded-sm bg-orange-500 px-2 py-1 text-sm font-medium text-white hover:bg-opacity-90 justify-center shadow-xl;
|
||||
@apply inline-flex items-center rounded-full bg-orange-500 px-2 py-1 text-xs font-medium text-white hover:bg-opacity-90 justify-center shadow-xl;
|
||||
}
|
||||
|
||||
.table-icon, .button-icon {
|
||||
@ -68,11 +68,11 @@
|
||||
}
|
||||
|
||||
.psc-button-save {
|
||||
@apply inline-flex items-center justify-center py-1 gap-1 font-medium rounded-sm px-4 text-sm text-white shadow-lg bg-psc-500 hover:bg-psc-600 hover:ring-2 hover:ring-psc-500 hover:ring-offset-2 min-h-[2.25rem];
|
||||
@apply inline-flex items-center justify-center py-1 gap-2 font-medium rounded-md px-4 text-sm text-white shadow-lg bg-psc-500 hover:bg-psc-600 hover:ring-2 hover:ring-psc-500 hover:ring-offset-2 min-h-[2.25rem];
|
||||
}
|
||||
|
||||
.psc-button-secondary {
|
||||
@apply inline-flex items-center justify-center py-1 gap-1 font-medium rounded-sm px-4 text-xs text-white shadow-lg bg-psc-500 hover:bg-psc-600 hover:ring-2 hover:ring-psc-500 hover:ring-offset-2 min-h-[1.8rem];
|
||||
@apply inline-flex items-center justify-center py-1 gap-2 font-medium rounded-md px-4 text-xs text-white shadow-lg bg-psc-500 hover:bg-psc-600 hover:ring-2 hover:ring-psc-500 hover:ring-offset-2 min-h-[1.8rem];
|
||||
}
|
||||
|
||||
.form-label {
|
||||
|
||||
74
src/new/assets/tailwind/js/multiselect.js
Normal file
74
src/new/assets/tailwind/js/multiselect.js
Normal file
@ -0,0 +1,74 @@
|
||||
export class multiselect {
|
||||
|
||||
init() {
|
||||
this.bindMultiSelectButtons();
|
||||
}
|
||||
|
||||
bindMultiSelectButtons() {
|
||||
// Find all multiselect widgets
|
||||
$('[data-multiselect-widget]').each(function() {
|
||||
const $widget = $(this);
|
||||
const $from = $widget.find('select[name$="_from"]');
|
||||
const $to = $widget.find('select[name]:not([name$="_from"])');
|
||||
|
||||
// Get base ID (without _from or _to suffix)
|
||||
const fromId = $from.attr('id');
|
||||
|
||||
// Right All button
|
||||
$widget.find('button[id$="_rightAll"]').off('click').on('click', function() {
|
||||
$from.find('option').each(function() {
|
||||
const $option = $(this).clone();
|
||||
$to.append($option);
|
||||
});
|
||||
$from.empty();
|
||||
});
|
||||
|
||||
// Right Selected button
|
||||
$widget.find('button[id$="_rightSelected"]').off('click').on('click', function() {
|
||||
$from.find('option:selected').each(function() {
|
||||
const $option = $(this).clone();
|
||||
$to.append($option);
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
|
||||
// Left Selected button
|
||||
$widget.find('button[id$="_leftSelected"]').off('click').on('click', function() {
|
||||
$to.find('option:selected').each(function() {
|
||||
const $option = $(this).clone();
|
||||
$from.append($option);
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
|
||||
// Left All button
|
||||
$widget.find('button[id$="_leftAll"]').off('click').on('click', function() {
|
||||
$to.find('option').each(function() {
|
||||
const $option = $(this).clone();
|
||||
$from.append($option);
|
||||
});
|
||||
$to.empty();
|
||||
});
|
||||
|
||||
// Double click to move items
|
||||
$from.off('dblclick').on('dblclick', 'option', function() {
|
||||
const $option = $(this).clone();
|
||||
$to.append($option);
|
||||
$(this).remove();
|
||||
});
|
||||
|
||||
$to.off('dblclick').on('dblclick', 'option', function() {
|
||||
const $option = $(this).clone();
|
||||
$from.append($option);
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
|
||||
// Before form submit, select all options in the "to" select
|
||||
$('form').on('submit', function() {
|
||||
$(this).find('[data-multiselect-widget]').each(function() {
|
||||
$(this).find('select[name]:not([name$="_from"]) option').prop('selected', true);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
307
src/new/assets/tailwind/js/order.js
Normal file
307
src/new/assets/tailwind/js/order.js
Normal file
@ -0,0 +1,307 @@
|
||||
const Order_List_Detail = ({ uuid, basketField1, customerInfo, basketField2, pos, price, product, status, allNet, reOrder, reOrderOrder, reOrderPos }, orderUuid) => `
|
||||
<div class="px-6 py-4 bg-gray-50" style="${psc.order.get_pos_bg_color(status)}">
|
||||
<div class="grid grid-cols-12 gap-4 w-full" id="row-${uuid}">
|
||||
<div class="col-span-1">
|
||||
<span class="text-xs font-semibold text-gray-700">Pos:</span>
|
||||
<div class="font-medium">${pos}</div>
|
||||
</div>
|
||||
<div class="col-span-4">
|
||||
<span class="text-xs font-semibold text-gray-700">Produkt:</span>
|
||||
<div>
|
||||
${(product => product.originalProduct ? `<a href="/apps/backend/product/edit/index/${product.originalProduct.uuid}" class="text-psc-500 hover:underline">${product.originalProduct.title}</a>` : `<a href="/apps/backend/product/edit/index/${product.uuid}" class="text-psc-500 hover:underline">${product.title}</a>`)(product)
|
||||
}
|
||||
<br/><span class="text-xs text-gray-600">ArtNr intern: ${product.nrIntern}</span><br/>
|
||||
${psc.order.get_special_product_options(product.specialProductTypeObject)}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-2">
|
||||
<span class="text-xs font-semibold text-gray-700">Auflage:</span>
|
||||
<div>${price.count}</div>
|
||||
</div>
|
||||
<div class="col-span-2">
|
||||
<span class="text-xs font-semibold text-gray-700">Kunden Info:</span>
|
||||
<div class="text-sm">${customerInfo}${(reOrder ? `<br/><strong class="text-yellow-600">Ist eine Nachbestellung</strong>` : ``)}</div>
|
||||
</div>
|
||||
<div class="col-span-2">
|
||||
<span class="text-xs font-semibold text-gray-700">Preis:</span>
|
||||
<div class="text-right whitespace-nowrap">
|
||||
${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allNet / 100)}<br/>
|
||||
<strong>(${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allGross / 100)})</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-1">
|
||||
<span class="text-xs font-semibold text-gray-700">Status:</span>
|
||||
<div class="relative inline-block text-left w-full">
|
||||
<button type="button" class="inline-flex justify-between items-center w-full px-3 py-1.5 text-xs font-medium text-white bg-psc-500 hover:bg-psc-600 rounded-sm shadow-sm">
|
||||
${psc.order.get_pos_status(status).internalName}
|
||||
<svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
|
||||
</svg>
|
||||
</button>
|
||||
<div class="hidden absolute right-0 z-10 mt-1 w-56 rounded-sm shadow-xl bg-white border border-gray-200 py-1">
|
||||
${psc.order.get_pos_status_loop(orderUuid, uuid)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
const Order_List_Detail_Simple = ({ uuid, basketField1, customerInfo, basketField2, pos, price, product, status, allNet }, orderUuid) => `
|
||||
<td colspan="12" class="px-6 py-4 bg-gray-50" style="${psc.order.get_pos_bg_color(status)}">
|
||||
<div class="flex gap-4 w-full">
|
||||
<div class="flex-none w-16">
|
||||
<span class="text-xs font-semibold text-gray-700">Pos:</span>
|
||||
<div class="font-medium">${pos}</div>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<span class="text-xs font-semibold text-gray-700">Produkt:</span>
|
||||
<div>
|
||||
${(product => product.originalProduct ? `<a href="/apps/backend/product/edit/index/${product.originalProduct.uuid}" class="text-psc-500 hover:underline">${product.originalProduct.title}</a>` : `<a href="/apps/backend/product/edit/index/${product.uuid}" class="text-psc-500 hover:underline">${product.title}</a>`)(product)
|
||||
}
|
||||
<br/><span class="text-xs text-gray-600">ArtNr intern: ${product.nrIntern}</span><br/>
|
||||
${psc.order.get_special_product_options(product.specialProductTypeObject)}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-none w-32">
|
||||
<span class="text-xs font-semibold text-gray-700">Auflage:</span>
|
||||
<div>${price.count}</div>
|
||||
</div>
|
||||
<div class="flex-none w-48">
|
||||
<span class="text-xs font-semibold text-gray-700">Kunden Info:</span>
|
||||
<div class="text-sm">${customerInfo}</div>
|
||||
</div>
|
||||
<div class="flex-none w-32 text-right">
|
||||
<span class="text-xs font-semibold text-gray-700">Preis:</span>
|
||||
<div class="whitespace-nowrap">${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allNet / 100)} <strong>(${new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(price.allGross / 100)})</strong></div>
|
||||
</div>
|
||||
<div class="flex-none w-24">
|
||||
<span class="text-xs font-semibold text-gray-700">Status:</span>
|
||||
<div>${psc.order.get_pos_status(status).internalName}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
`;
|
||||
|
||||
const Order_List_Pos_Status = (status, orderUuid, posUuid) => `
|
||||
<button type="button" class="flex items-center w-full px-3 py-1.5 text-xs text-gray-700 hover:bg-psc-50 hover:text-psc-700 transition-colors switch_pos" data-order-uuid="${orderUuid}" data-pos-uuid="${posUuid}" data-status="${status.code}">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-3.5 h-3.5 mr-2 text-gray-400">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||
</svg>
|
||||
${status.internalName}
|
||||
</button>
|
||||
`;
|
||||
|
||||
const Order_List_Pos_Calc_Option = (elm) => `
|
||||
<tr><td>${elm.name}</td><td>${elm.value}</td></tr>
|
||||
`;
|
||||
|
||||
export class order {
|
||||
|
||||
init() {
|
||||
this.load_status();
|
||||
this.bind_buttons();
|
||||
this.init_dropdowns();
|
||||
}
|
||||
|
||||
init_dropdowns() {
|
||||
// Initialize all status dropdowns (both in main table and details)
|
||||
$(document).off('click.orderDropdown');
|
||||
$(document).on('click.orderDropdown', '.relative.inline-block button', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var $dropdown = $(this).next('div');
|
||||
|
||||
// Close all other dropdowns
|
||||
$('.relative.inline-block div[class*="hidden"]').addClass('hidden');
|
||||
|
||||
// Toggle this dropdown
|
||||
$dropdown.toggleClass('hidden');
|
||||
});
|
||||
|
||||
// Close dropdowns when clicking outside
|
||||
$(document).on('click.orderDropdown', function (e) {
|
||||
if (!$(e.target).closest('.relative.inline-block').length) {
|
||||
$('.relative.inline-block div[class*="absolute"]').addClass('hidden');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
get_special_product_options(specialProductTypeObject) {
|
||||
if (specialProductTypeObject.typ != 6) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return '<table>' + specialProductTypeObject.options.map(elm => {
|
||||
if (elm.type != 'hidden') {
|
||||
return Order_List_Pos_Calc_Option(elm);
|
||||
}
|
||||
}).join('') + '</table>';
|
||||
}
|
||||
|
||||
load_status() {
|
||||
if (jwt_token != "") {
|
||||
$.ajax({
|
||||
url: "/apps/api/system/status",
|
||||
contentType: "application/json",
|
||||
headers: {
|
||||
"Authorization": "Bearer " + jwt_token
|
||||
},
|
||||
method: 'GET',
|
||||
success: function (result) {
|
||||
psc.order.status_order = result.order;
|
||||
psc.order.status_pos = result.position;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
bind_buttons() {
|
||||
$('.toogle_list_detail_view').off();
|
||||
$('.toogle_list_detail_view').on('click', function () {
|
||||
var uuid = $(this).data().uuid;
|
||||
var $icon = $(this);
|
||||
if ($('#rows-' + uuid + ' td').children().length > 0) {
|
||||
$('#rows-' + uuid + ' td').html('');
|
||||
$icon.removeClass('fa-minus').addClass('fa-plus');
|
||||
} else {
|
||||
psc.order.load_detail(uuid);
|
||||
$icon.removeClass('fa-plus').addClass('fa-minus');
|
||||
}
|
||||
});
|
||||
|
||||
$('.toogle_list_simple_detail_view').off();
|
||||
$('.toogle_list_simple_detail_view').on('click', function () {
|
||||
var uuid = $(this).data().uuid;
|
||||
var $icon = $(this);
|
||||
if ($('#rows-' + uuid + ' td').children().length > 0) {
|
||||
$('#rows-' + uuid + ' td').html('');
|
||||
$icon.removeClass('fa-minus').addClass('fa-plus');
|
||||
} else {
|
||||
psc.order.load_detail(uuid, true);
|
||||
$icon.removeClass('fa-plus').addClass('fa-minus');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
load_detail(orderUuid, simple = false) {
|
||||
$.ajax({
|
||||
url: "/apps/api/order/getonebyuuid",
|
||||
contentType: "application/json",
|
||||
headers: {
|
||||
"Authorization": "Bearer " + jwt_token
|
||||
},
|
||||
method: 'POST',
|
||||
data: JSON.stringify({
|
||||
uuid: orderUuid
|
||||
}),
|
||||
success: function (result) {
|
||||
psc.order.build_details(orderUuid, result, simple);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
build_details(orderUuid, result, simple = false) {
|
||||
if (simple) {
|
||||
$('#rows-' + result.uuid + ' td').html(result.positions.map(x => Order_List_Detail_Simple(x, orderUuid)).join(''));
|
||||
} else {
|
||||
$('#rows-' + result.uuid + ' td').html(result.positions.map(x => Order_List_Detail(x, orderUuid)).join(''));
|
||||
result.positions.map(x => this.loadPluginDetails(x));
|
||||
|
||||
}
|
||||
|
||||
this.bind_status_buttons();
|
||||
}
|
||||
|
||||
loadPluginDetails(pos) {
|
||||
$.ajax({
|
||||
url: "/apps/api/position/getpluginlistdetails/" + pos.uuid,
|
||||
contentType: "application/json",
|
||||
headers: {
|
||||
"Authorization": "Bearer " + jwt_token
|
||||
},
|
||||
method: 'GET',
|
||||
success: function (result) {
|
||||
$('#row-' + pos.uuid).append(result.html);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
bind_status_buttons() {
|
||||
// Bind status change buttons for positions
|
||||
$('.switch_pos').off();
|
||||
$('.switch_pos').on('click', function () {
|
||||
|
||||
var orderUuid = $(this).data().orderUuid;
|
||||
var posUuid = $(this).data().posUuid;
|
||||
var status = $(this).data().status;
|
||||
|
||||
$.ajax({
|
||||
url: "/apps/api/position/status/change",
|
||||
contentType: "application/json",
|
||||
headers: {
|
||||
"Authorization": "Bearer " + jwt_token
|
||||
},
|
||||
data: JSON.stringify({
|
||||
position: posUuid,
|
||||
status: status,
|
||||
}),
|
||||
method: 'POST',
|
||||
success: function (result) {
|
||||
$('#rows-' + orderUuid + ' td').html('');
|
||||
psc.order.load_detail(orderUuid);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
get_pos_bg_color(status) {
|
||||
|
||||
/*
|
||||
{% if orderStatuse.getPosStatusColor(pos.status) != '' %}background-color: {{ orderStatuse.getPosStatusColor(pos.status) }}{% endif %}"
|
||||
*/
|
||||
const found = psc.order.status_pos.find(stat => stat.code == status);
|
||||
|
||||
if (found && found.color != "") {
|
||||
return 'background-color: ' + found.color;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
get_pos_status(status) {
|
||||
|
||||
/*
|
||||
{% if orderStatuse.getPosStatusColor(pos.status) != '' %}background-color: {{ orderStatuse.getPosStatusColor(pos.status) }}{% endif %}"
|
||||
*/
|
||||
const found = psc.order.status_pos.find(stat => stat.code == status);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
|
||||
return { internalName: 'notFound' };
|
||||
|
||||
}
|
||||
|
||||
get_pos_bg_color_class(status) {
|
||||
|
||||
/*
|
||||
class="{% if pos.status == 170 %}bg-lightdark{% elseif pos.status == 200 or pos.status == 210 %}bg-lightsuccess{% else %}bg-lightdanger{% endif %}
|
||||
*/
|
||||
|
||||
if (status == 170) {
|
||||
return 'bg-lightdark';
|
||||
}
|
||||
if (status == 200 || status == 210) {
|
||||
return 'bg-lightsuccess';
|
||||
}
|
||||
|
||||
return 'bg-lightdanger';
|
||||
}
|
||||
|
||||
get_pos_status_loop(orderUuid, posUuid) {
|
||||
return psc.order.status_pos.map(x => Order_List_Pos_Status(x, orderUuid, posUuid)).join('');
|
||||
}
|
||||
|
||||
}
|
||||
@ -25,11 +25,10 @@
|
||||
"cocur/slugify": "v3.1",
|
||||
"composer/package-versions-deprecated": "^1.8",
|
||||
"ddeboer/imap": "1.21.*",
|
||||
"doctrine/annotations": "^2",
|
||||
"doctrine/cache": "^2",
|
||||
"doctrine/doctrine-bundle": "^2",
|
||||
"doctrine/doctrine-bundle": "^3",
|
||||
"doctrine/mongodb-odm-bundle": "^5",
|
||||
"doctrine/orm": "^2.7",
|
||||
"doctrine/orm": "^3",
|
||||
"gabrielbull/ups-api": "dev-master",
|
||||
"gesdinet/jwt-refresh-token-bundle": "^1.5",
|
||||
"gregwar/captcha-bundle": "^2.2",
|
||||
@ -37,12 +36,11 @@
|
||||
"horstoeko/zugferd": "^1.0",
|
||||
"incenteev/composer-parameter-handler": "^2.0",
|
||||
"jms/serializer-bundle": "5.*",
|
||||
"knplabs/knp-gaufrette-bundle": "0.7.*",
|
||||
"knplabs/knp-gaufrette-bundle": "0.9.*",
|
||||
"knplabs/knp-menu-bundle": "^3",
|
||||
"knplabs/knp-paginator-bundle": "5.9.*",
|
||||
"lexik/form-filter-bundle": "^7",
|
||||
"knplabs/knp-paginator-bundle": "6.10.*",
|
||||
"lexik/jwt-authentication-bundle": "^3",
|
||||
"liip/imagine-bundle": "2.9.*",
|
||||
"liip/imagine-bundle": "2.16.*",
|
||||
"mistic100/randomcolor": "^1.1",
|
||||
"mobiledetect/mobiledetectlib": "^2.8",
|
||||
"mpdf/mpdf": "dev-qrcode",
|
||||
@ -50,10 +48,11 @@
|
||||
"nelmio/api-doc-bundle": "^4",
|
||||
"nelmio/cors-bundle": "^2.2",
|
||||
"nicolab/php-ftp-client": "^1.4",
|
||||
"oneup/uploader-bundle": "^3",
|
||||
"oneup/uploader-bundle": "^5",
|
||||
"oyejorge/less.php": "~1.5",
|
||||
"paypal/paypal-checkout-sdk": "dev-master",
|
||||
"paypal/rest-api-sdk-php": "dev-master",
|
||||
"paypal/paypal-checkout-sdk": "^1.0",
|
||||
"paypal/paypal-server-sdk": "^2",
|
||||
"phenx/php-font-lib": "^1.0",
|
||||
"phpoffice/phpspreadsheet": "^1.28",
|
||||
"phpseclib/phpseclib": "~3.0",
|
||||
"picqer/sendcloud-php-client": "v2.8.1",
|
||||
@ -64,26 +63,27 @@
|
||||
"ramsey/uuid": "4.5.1",
|
||||
"sauladam/shipment-tracker": "dev-master",
|
||||
"scssphp/scssphp": "v1.11.1",
|
||||
"sensio/framework-extra-bundle": "^6.1",
|
||||
"setasign/fpdi-tcpdf": "^2.3",
|
||||
"sofort/sofortlib-php": "3.3.2",
|
||||
"spatie/array-to-xml": "^3.4",
|
||||
"spiriitlabs/form-filter-bundle": "12.0.1",
|
||||
"symfony/asset": "*",
|
||||
"symfony/asset-mapper": "6.4.*",
|
||||
"symfony/asset-mapper": "7.4.*",
|
||||
"symfony/console": "*",
|
||||
"symfony/dotenv": "*",
|
||||
"symfony/expression-language": "*",
|
||||
"symfony/flex": "^1.3.1",
|
||||
"symfony/flex": "^2",
|
||||
"symfony/form": "*",
|
||||
"symfony/framework-bundle": "*",
|
||||
"symfony/http-client": "*",
|
||||
"symfony/intl": "*",
|
||||
"symfony/lock": "6.4.*",
|
||||
"symfony/lock": "7.4.*",
|
||||
"symfony/mailer": "*",
|
||||
"symfony/mime": "*",
|
||||
"symfony/monolog-bundle": "^3.8",
|
||||
"symfony/monolog-bundle": "^4",
|
||||
"symfony/notifier": "*",
|
||||
"symfony/process": "*",
|
||||
"symfony/property-access": "6.4.4",
|
||||
"symfony/property-access": "7.4.*",
|
||||
"symfony/property-info": "*",
|
||||
"symfony/proxy-manager-bridge": "*",
|
||||
"symfony/runtime": "*",
|
||||
@ -116,9 +116,8 @@
|
||||
"maglnet/composer-require-checker": "4.*",
|
||||
"mockery/mockery": "^1.5",
|
||||
"php-parallel-lint/php-parallel-lint": "dev-develop",
|
||||
"phpstan/phpstan": "^1",
|
||||
"phpstan/phpstan": "^2.1",
|
||||
"phpunit/phpunit": "^10",
|
||||
"rector/rector": "0.19.2",
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"symfony/browser-kit": "*",
|
||||
"symfony/css-selector": "*",
|
||||
@ -198,7 +197,7 @@
|
||||
"extra": {
|
||||
"symfony": {
|
||||
"allow-contrib": false,
|
||||
"require": "6.4.*"
|
||||
"require": "7.4.*"
|
||||
},
|
||||
"public-dir": "web/"
|
||||
}
|
||||
|
||||
5239
src/new/composer.lock
generated
5239
src/new/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -7,13 +7,11 @@ return [
|
||||
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
|
||||
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
|
||||
Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true],
|
||||
Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle::class => ['all' => true],
|
||||
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
|
||||
Oneup\UploaderBundle\OneupUploaderBundle::class => ['all' => true],
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
||||
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
|
||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
@ -63,4 +61,5 @@ return [
|
||||
Symfonycasts\TailwindBundle\SymfonycastsTailwindBundle::class => ['all' => true],
|
||||
Symfonycasts\SassBundle\SymfonycastsSassBundle::class => ['all' => true],
|
||||
Symfony\UX\Vue\VueBundle::class => ['all' => true],
|
||||
Spiriit\Bundle\FormFilterBundle\SpiriitFormFilterBundle::class => ['all' => true],
|
||||
];
|
||||
|
||||
@ -6,23 +6,21 @@ use PSC\Libraries\DoctrineBundle\ORM\Query\AST\Functions\SimpleFunction;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension(
|
||||
'doctrine',
|
||||
[
|
||||
$containerConfigurator->extension('doctrine', [
|
||||
'dbal' => [
|
||||
'url' => '%env(resolve:DATABASE_URL)%',
|
||||
'charset' => 'utf8mb4',
|
||||
'default_table_options' => ['collate' => 'utf8mb4_unicode_ci']],
|
||||
'default_table_options' => ['collate' => 'utf8mb4_unicode_ci'],
|
||||
'server_version' => '8.0',
|
||||
],
|
||||
'orm' => [
|
||||
'auto_generate_proxy_classes' => true,
|
||||
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
|
||||
'auto_mapping' => true,
|
||||
'dql' => [
|
||||
'numeric_functions' => [
|
||||
'month' => SimpleFunction::class
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
);
|
||||
'month' => SimpleFunction::class,
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
};
|
||||
|
||||
@ -5,7 +5,14 @@ declare(strict_types=1);
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('doctrine', ['orm' => ['auto_generate_proxy_classes' => false, 'metadata_cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.system_cache_pool'], 'query_cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.system_cache_pool'], 'result_cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.result_cache_pool']]]);
|
||||
$containerConfigurator->extension('doctrine', ['orm' => [
|
||||
'metadata_cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.system_cache_pool'],
|
||||
'query_cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.system_cache_pool'],
|
||||
'result_cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.result_cache_pool'],
|
||||
]]);
|
||||
|
||||
$containerConfigurator->extension('framework', ['cache' => ['pools' => ['doctrine.result_cache_pool' => ['adapter' => 'cache.app'], 'doctrine.system_cache_pool' => ['adapter' => 'cache.system']]]]);
|
||||
$containerConfigurator->extension('framework', ['cache' => ['pools' => [
|
||||
'doctrine.result_cache_pool' => ['adapter' => 'cache.app'],
|
||||
'doctrine.system_cache_pool' => ['adapter' => 'cache.system'],
|
||||
]]]);
|
||||
};
|
||||
|
||||
@ -5,11 +5,56 @@ declare(strict_types=1);
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('psc_shop_media', ['default_context' => 'default', 'contexts' => ['default' => ['providers' => ['psc.shop.media.provider.image', 'psc.shop.media.provider.file'], 'formats' => ['small' => ['width' => 100, 'quality' => 70], 'big' => ['width' => 500, 'quality' => 70]]]], 'providers' => ['image' => ['thumbnail' => 'psc.shop.media.thumbnail.liip_imagine', 'allowed_extensions' => ['jpg', 'png', 'gif', 'jpeg'], 'allowed_mime_types' => ['image/pjpeg', 'image/jpeg', 'image/png', 'image/x-png', 'image/gif']]], 'cdn' => ['server' => ['path' => '/uploads/media']], 'filesystem' => ['local' => ['directory' => '%kernel.project_dir%/web/uploads/media', 'create' => false]]]);
|
||||
$containerConfigurator->extension('psc_shop_media', [
|
||||
'default_context' => 'default',
|
||||
'contexts' => ['default' => [
|
||||
'providers' => ['psc.shop.media.provider.image', 'psc.shop.media.provider.file'],
|
||||
'formats' => ['small' => ['width' => 100, 'quality' => 70], 'big' => ['width' => 500, 'quality' => 70]],
|
||||
]],
|
||||
'providers' => ['image' => [
|
||||
'thumbnail' => 'psc.shop.media.thumbnail.liip_imagine',
|
||||
'allowed_extensions' => ['jpg', 'png', 'gif', 'jpeg'],
|
||||
'allowed_mime_types' => ['image/pjpeg', 'image/jpeg', 'image/png', 'image/x-png', 'image/gif'],
|
||||
]],
|
||||
'cdn' => ['server' => ['path' => '/uploads/media']],
|
||||
'filesystem' => ['local' => ['directory' => '%kernel.project_dir%/web/uploads/media', 'create' => false]],
|
||||
]);
|
||||
|
||||
$containerConfigurator->extension('knp_gaufrette', ['stream_wrapper' => null, 'adapters' => ['backend_articles' => ['safe_local' => ['directory' => '%kernel.project_dir%/web/uploads/backend_articles', 'create' => true]], 'steplayouter_motiv_guest' => ['local' => ['directory' => '%kernel.project_dir%/web/uploads/steplayouter_motiv_guest', 'create' => true]], 'steplayouter_motiv' => ['local' => ['directory' => '%kernel.project_dir%/web/market/motive/', 'create' => true]]], 'filesystems' => ['backend_articles' => ['adapter' => 'backend_articles', 'alias' => 'backend_articles_filesystem'], 'steplayouter_motiv_guest' => ['adapter' => 'steplayouter_motiv_guest'], 'steplayouter_motiv' => ['adapter' => 'steplayouter_motiv']]]);
|
||||
$containerConfigurator->extension('knp_gaufrette', [
|
||||
'stream_wrapper' => null,
|
||||
'adapters' => [
|
||||
'backend_articles' => ['safe_local' => [
|
||||
'directory' => '%kernel.project_dir%/web/uploads/backend_articles',
|
||||
'create' => true,
|
||||
]],
|
||||
'steplayouter_motiv_guest' => ['local' => [
|
||||
'directory' => '%kernel.project_dir%/web/uploads/steplayouter_motiv_guest',
|
||||
'create' => true,
|
||||
]],
|
||||
'steplayouter_motiv' => ['local' => [
|
||||
'directory' => '%kernel.project_dir%/web/market/motive/',
|
||||
'create' => true,
|
||||
]],
|
||||
],
|
||||
'filesystems' => [
|
||||
'backend_articles' => ['adapter' => 'backend_articles', 'alias' => 'backend_articles_filesystem'],
|
||||
'steplayouter_motiv_guest' => ['adapter' => 'steplayouter_motiv_guest'],
|
||||
'steplayouter_motiv' => ['adapter' => 'steplayouter_motiv'],
|
||||
],
|
||||
]);
|
||||
|
||||
$containerConfigurator->extension('knp_paginator', ['page_range' => 5, 'default_options' => ['page_name' => 'page', 'sort_field_name' => 'sort', 'sort_direction_name' => 'direction', 'distinct' => true], 'template' => ['pagination' => '@PSCBackendDashboard/pagination/bootstrap4.html.twig']]);
|
||||
$containerConfigurator->extension('knp_paginator', [
|
||||
'page_range' => 5,
|
||||
'default_options' => [
|
||||
'page_name' => 'page',
|
||||
'sort_field_name' => 'sort',
|
||||
'sort_direction_name' => 'direction',
|
||||
'distinct' => true,
|
||||
],
|
||||
'template' => ['pagination' => '@PSCBackendDashboard/pagination/bootstrap4.html.twig'],
|
||||
]);
|
||||
|
||||
$containerConfigurator->extension('lexik_form_filter', ['listeners' => ['doctrine_orm' => true, 'doctrine_dbal' => true, 'doctrine_mongodb' => true]]);
|
||||
$containerConfigurator->extension('spiriit_form_filter', ['listeners' => [
|
||||
'doctrine_orm' => true,
|
||||
]]);
|
||||
};
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('sensio_framework_extra', ['router' => ['annotations' => false], 'request' => ['converters' => true, 'disable' => ['doctrine.orm', 'datetime']]]);
|
||||
};
|
||||
2873
src/new/config/reference.php
Normal file
2873
src/new/config/reference.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -53,14 +53,14 @@ return static function (RoutingConfigurator $routingConfigurator): void {
|
||||
|
||||
$routingConfigurator->import('@PSCShopCreateBundle/Resources/config/routing.yml');
|
||||
|
||||
$routingConfigurator->import('@PSCComponentSteplayouterBundle/Controller/', 'annotation')->prefix('/');
|
||||
$routingConfigurator->import('@PSCComponentSteplayouterBundle/Controller/', 'attribute')->prefix('/');
|
||||
|
||||
$routingConfigurator
|
||||
->import('@PSCComponentSteplayouterBundle/Controller/System', 'annotation')
|
||||
->import('@PSCComponentSteplayouterBundle/Controller/System', 'attribute')
|
||||
->prefix('/step/system');
|
||||
|
||||
$routingConfigurator
|
||||
->import('@PSCComponentConfigurationlayouterBundle/Controller/', 'annotation')
|
||||
->import('@PSCComponentConfigurationlayouterBundle/Controller/', 'attribute')
|
||||
->prefix('/psc/component');
|
||||
|
||||
$routingConfigurator->import('.', 'plugin');
|
||||
|
||||
2
src/new/config/routes/annotations.php → src/new/config/routes/attributes.php
Executable file → Normal file
2
src/new/config/routes/annotations.php → src/new/config/routes/attributes.php
Executable file → Normal file
@ -5,5 +5,5 @@ declare(strict_types=1);
|
||||
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||
|
||||
return static function (RoutingConfigurator $routingConfigurator): void {
|
||||
$routingConfigurator->import('../../src/PSC/Kernel.php', 'annotation');
|
||||
$routingConfigurator->import('../../src/PSC/Kernel.php', 'attribute');
|
||||
};
|
||||
@ -20,11 +20,11 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->defaults()
|
||||
->autowire()
|
||||
->autoconfigure();
|
||||
$services->defaults()->autowire()->autoconfigure();
|
||||
|
||||
$services->set('liip_imagine.data.loader.stream.steplayouter_motiv_guest', StreamLoader::class)
|
||||
->args([service('liip_imagine'), 'gaufrette://steplayouter_motiv_guest/'])
|
||||
->tag('liip_imagine.data.loader', ['loader' => 'stream.steplayouter_motiv_guest']);
|
||||
/* $services
|
||||
* ->set('liip_imagine.data.loader.stream.steplayouter_motiv_guest', StreamLoader::class)
|
||||
* ->args([service('liip_imagine'), 'gaufrette://steplayouter_motiv_guest/'])->tag('liip_imagine.data.loader', [
|
||||
* 'loader' => 'stream.steplayouter_motiv_guest',
|
||||
* ]);*/
|
||||
};
|
||||
|
||||
2577
src/new/docs/design-system.md
Normal file
2577
src/new/docs/design-system.md
Normal file
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,7 @@ PSC\Shop\EntityBundle\Entity\Product:
|
||||
pos: <numberBetween(1, 200)>
|
||||
notEdit: false
|
||||
private: false
|
||||
taxClass: 19
|
||||
mwert: 19
|
||||
price: 0
|
||||
set_config: '{}'
|
||||
shop: '@shop_1'
|
||||
@ -23,7 +23,7 @@ PSC\Shop\EntityBundle\Entity\Product:
|
||||
notEdit: false
|
||||
pos: <numberBetween(1, 200)>
|
||||
private: false
|
||||
taxClass: 19
|
||||
mwert: 19
|
||||
price: 0
|
||||
set_config: '{}'
|
||||
shop: '@shop_1'
|
||||
@ -37,7 +37,7 @@ PSC\Shop\EntityBundle\Entity\Product:
|
||||
notEdit: false
|
||||
pos: <numberBetween(1, 200)>
|
||||
private: false
|
||||
taxClass: 19
|
||||
mwert: 19
|
||||
price: 0
|
||||
set_config: '\[{"article_id": "7996f00d-a5e6-4915-970d-9f7c4287cd92"}, {"article_id": "7996f00d-a5e6-4915-970d-9f7c4287cd91"} ]'
|
||||
shop: '@shop_1'
|
||||
@ -51,7 +51,7 @@ PSC\Shop\EntityBundle\Entity\Product:
|
||||
type: 2
|
||||
pos: <numberBetween(1, 200)>
|
||||
private: false
|
||||
taxClass: 19
|
||||
mwert: 19
|
||||
price: 20
|
||||
set_config: '{}'
|
||||
shop: '@shop_1'
|
||||
@ -65,7 +65,7 @@ PSC\Shop\EntityBundle\Entity\Product:
|
||||
pos: <numberBetween(1, 200)>
|
||||
notEdit: false
|
||||
private: false
|
||||
taxClass: 19
|
||||
mwert: 19
|
||||
set_config: '{}'
|
||||
shop: '@shop_1'
|
||||
calcXml: >
|
||||
@ -116,7 +116,7 @@ PSC\Shop\EntityBundle\Entity\Product:
|
||||
pos: <numberBetween(1, 200)>
|
||||
notEdit: false
|
||||
private: false
|
||||
taxClass: 19
|
||||
mwert: 19
|
||||
set_config: '{}'
|
||||
shop: '@shop_1'
|
||||
calcXml: >
|
||||
|
||||
@ -9,7 +9,7 @@ PSC\Shop\EntityBundle\Entity\Voucher:
|
||||
code: 5f
|
||||
mode: 1
|
||||
fromDate: <(new DateTime("2023-12-12"))>
|
||||
toDate: <(new DateTime("2025-12-12"))>
|
||||
toDate: <(new DateTime("2026-12-12"))>
|
||||
value: 5
|
||||
shop: '@shop_1'
|
||||
voucher_2:
|
||||
@ -22,7 +22,7 @@ PSC\Shop\EntityBundle\Entity\Voucher:
|
||||
code: 5p
|
||||
mode: 1
|
||||
fromDate: <(new DateTime("2023-12-12"))>
|
||||
toDate: <(new DateTime("2025-12-12"))>
|
||||
toDate: <(new DateTime("2026-12-12"))>
|
||||
value: 5
|
||||
shop: '@shop_1'
|
||||
voucher_3:
|
||||
@ -37,7 +37,7 @@ PSC\Shop\EntityBundle\Entity\Voucher:
|
||||
zeroShipping: false
|
||||
mode: 1
|
||||
fromDate: <(new DateTime("2023-12-12"))>
|
||||
toDate: <(new DateTime("2025-12-12"))>
|
||||
toDate: <(new DateTime("2026-12-12"))>
|
||||
value: 0
|
||||
shop: '@shop_1'
|
||||
voucher_4:
|
||||
@ -52,7 +52,7 @@ PSC\Shop\EntityBundle\Entity\Voucher:
|
||||
zeroShipping: true
|
||||
mode: 1
|
||||
fromDate: <(new DateTime("2023-12-12"))>
|
||||
toDate: <(new DateTime("2025-12-12"))>
|
||||
toDate: <(new DateTime("2026-12-12"))>
|
||||
value: 0
|
||||
shop: '@shop_1'
|
||||
|
||||
|
||||
5
src/new/phpstan.neon
Normal file
5
src/new/phpstan.neon
Normal file
@ -0,0 +1,5 @@
|
||||
parameters:
|
||||
level: 7
|
||||
paths:
|
||||
- src
|
||||
|
||||
@ -1780,7 +1780,7 @@ CREATE TABLE `shop` (
|
||||
`smtphostname` varchar(255) NOT NULL,
|
||||
`smtpusername` varchar(255) NOT NULL,
|
||||
`smtppassword` varchar(255) NOT NULL,
|
||||
`smtpusethis` int(1) NOT NULL,
|
||||
`smtpusethis` int(1) NULL DEFAULT 0,
|
||||
`useemailaslogin` int(1) NOT NULL,
|
||||
`noverify` int(1) NOT NULL,
|
||||
`keywords` longtext,
|
||||
|
||||
@ -20,11 +20,11 @@ use PSC\Shop\QueueBundle\Service\Queue\Manager;
|
||||
use PSC\System\SettingsBundle\Service\Instance;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
use PSC\System\UpdateBundle\Service\Migration;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Intl\NumberFormatter\NumberFormatter;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\UX\Chartjs\Builder\ChartBuilderInterface;
|
||||
use Symfony\UX\Chartjs\Model\Chart;
|
||||
|
||||
@ -47,24 +47,52 @@ class DashboardController extends AbstractController
|
||||
* @return array|View|\Symfony\Component\HttpFoundation\RedirectResponse
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
#[Route(path: '/dashboard', name: 'psc_backend_dashboard_index')]
|
||||
#[Template]
|
||||
public function indexAction(Migration $migration, Shop $shop, EntityManagerInterface $entityManager, Manager $queueService, Instance $instanceService, ChartBuilderInterface $chartBuilder, ContactRepository $contactRepository, Order $orderService)
|
||||
{
|
||||
|
||||
#[Template('@PSCBackendDashboard/dashboard/index.html.twig')]
|
||||
public function indexAction(
|
||||
Migration $migration,
|
||||
Shop $shop,
|
||||
EntityManagerInterface $entityManager,
|
||||
Manager $queueService,
|
||||
Instance $instanceService,
|
||||
ChartBuilderInterface $chartBuilder,
|
||||
ContactRepository $contactRepository,
|
||||
Order $orderService,
|
||||
) {
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */
|
||||
$selectedShop = $shop->getSelectedShop();
|
||||
$year1 = date("Y");
|
||||
$year2 = date("Y") - 1;
|
||||
$year3 = date("Y") - 2;
|
||||
$tempSales1 = array_column($entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop($selectedShop->getUid(), $year1), 'brutto', 'monat');
|
||||
$tempSales2 = array_column($entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop($selectedShop->getUid(), $year2), 'brutto', 'monat');
|
||||
$tempSales3 = array_column($entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop($selectedShop->getUid(), $year3), 'brutto', 'monat');
|
||||
$year1 = date('Y');
|
||||
$year2 = date('Y') - 1;
|
||||
$year3 = date('Y') - 2;
|
||||
$tempSales1 = array_column(
|
||||
$entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop(
|
||||
$selectedShop->getUid(),
|
||||
$year1,
|
||||
),
|
||||
'brutto',
|
||||
'monat',
|
||||
);
|
||||
$tempSales2 = array_column(
|
||||
$entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop(
|
||||
$selectedShop->getUid(),
|
||||
$year2,
|
||||
),
|
||||
'brutto',
|
||||
'monat',
|
||||
);
|
||||
$tempSales3 = array_column(
|
||||
$entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Order')->getIncomeByShop(
|
||||
$selectedShop->getUid(),
|
||||
$year3,
|
||||
),
|
||||
'brutto',
|
||||
'monat',
|
||||
);
|
||||
$fmt = new \NumberFormatter(locale_get_default(), \NumberFormatter::CURRENCY);
|
||||
$sales1 = array();
|
||||
$sales2 = array();
|
||||
$sales3 = array();
|
||||
$sales1 = [];
|
||||
$sales2 = [];
|
||||
$sales3 = [];
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
if (isset($tempSales1[$i])) {
|
||||
$sales1[] = round($tempSales1[$i]);
|
||||
@ -84,7 +112,20 @@ class DashboardController extends AbstractController
|
||||
}
|
||||
$chart = $chartBuilder->createChart(Chart::TYPE_LINE);
|
||||
$chart->setData([
|
||||
'labels' => ['Januar', 'Februar', 'März', 'April', 'May', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
|
||||
'labels' => [
|
||||
'Januar',
|
||||
'Februar',
|
||||
'März',
|
||||
'April',
|
||||
'May',
|
||||
'Juni',
|
||||
'Juli',
|
||||
'August',
|
||||
'September',
|
||||
'Oktober',
|
||||
'November',
|
||||
'Dezember',
|
||||
],
|
||||
'datasets' => [
|
||||
[
|
||||
'label' => $year1,
|
||||
@ -113,19 +154,18 @@ class DashboardController extends AbstractController
|
||||
'maintainAspectRatio' => false,
|
||||
]);
|
||||
|
||||
|
||||
if ($migration->checkIfMigrationMustRun()) {
|
||||
return $this->redirectToRoute('psc_system_update_migration_do');
|
||||
}
|
||||
|
||||
return array(
|
||||
return [
|
||||
'user' => $this->getUser(),
|
||||
'shop' => $selectedShop,
|
||||
'lastContacts' => $contactRepository->getLastCreatedContacts($selectedShop, 10),
|
||||
'lastOrders' => $orderService->getLastOrders(),
|
||||
'queueErrorCount' => $queueService->getErrorJobCount(),
|
||||
'instance' => $instanceService->getInstance(),
|
||||
'chart' => $chart
|
||||
);
|
||||
'chart' => $chart,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,9 +15,9 @@ namespace PSC\Backend\DashboardBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Security\Core\SecurityContext;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
/**
|
||||
* DefaultController fürs ProductionBundle
|
||||
@ -34,7 +34,7 @@ class DefaultController extends AbstractController
|
||||
* @return View
|
||||
*/
|
||||
#[Route(path: '/', name: 'psc_backend_default_index')]
|
||||
#[Template]
|
||||
#[Template('@PSCBackendDashboard/default/index.html.twig')]
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->redirect($this->generateUrl("psc_backend_dashboard_index"));
|
||||
|
||||
@ -16,16 +16,16 @@ namespace PSC\Backend\DashboardBundle\Controller;
|
||||
use Http\Message\Authentication;
|
||||
use PSC\System\UpdateBundle\Service\Migration;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||
|
||||
class LoginController extends AbstractController
|
||||
{
|
||||
|
||||
#[Route(path: '/login', name: 'psc_backend_login')]
|
||||
#[Template]
|
||||
#[Template('@PSCBackendDashboard/login/index.html.twig')]
|
||||
public function indexAction(Migration $migration, AuthenticationUtils $authenticationUtils)
|
||||
{
|
||||
if ($migration->checkIfMigrationMustRun()) {
|
||||
|
||||
@ -17,103 +17,97 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface;
|
||||
use PSC\Shop\EntityBundle\Entity\Domain;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
/**
|
||||
* ShopController fürs ProductionBundle
|
||||
*
|
||||
* @package PSC\Backend\Production
|
||||
* @subpackage Controller
|
||||
*/
|
||||
class ShopController extends AbstractController
|
||||
{
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[Template]
|
||||
public function myEditableShopsAction(Request $request, Shop $shop, JWTTokenManagerInterface $jwtManager, EntityManagerInterface $entityManager)
|
||||
{
|
||||
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
#[Template('@PSCBackendDashboard/shop/my_editable_shops.html.twig')]
|
||||
public function myEditableShopsAction(
|
||||
Request $request,
|
||||
Shop $shop,
|
||||
JWTTokenManagerInterface $jwtManager,
|
||||
EntityManagerInterface $entityManager,
|
||||
) {
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */
|
||||
$selectedShop = $shop->getSelectedShop();
|
||||
$shops = $shop->getMyEditableShops();
|
||||
|
||||
$domains = $entityManager
|
||||
->getRepository(Domain::class)->getAllByShopId($selectedShop);
|
||||
$domains = $entityManager->getRepository(Domain::class)->getAllByShopId($selectedShop);
|
||||
if (count($domains) > 0) {
|
||||
$domain = array_pop($domains)->getHost();
|
||||
} else {
|
||||
$domain = false;
|
||||
}
|
||||
|
||||
return array('domain' => $domain, 'shops' => $shops, 'jwt' => $jwtManager->create($this->getUser()), 'selectedShop' => $selectedShop, 'displayDeletedShop' => $request->getSession()->get('displayDeletedShop', false));
|
||||
return [
|
||||
'domain' => $domain,
|
||||
'shops' => $shops,
|
||||
'jwt' => $jwtManager->create($this->getUser()),
|
||||
'selectedShop' => $selectedShop,
|
||||
'displayDeletedShop' => $request->getSession()->get('displayDeletedShop', false),
|
||||
];
|
||||
}
|
||||
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[Template]
|
||||
public function myEditableShopsTailwindAction(Request $request, Shop $shop, JWTTokenManagerInterface $jwtManager, EntityManagerInterface $entityManager)
|
||||
{
|
||||
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
#[Template('@PSCBackendDashboard/shop/my_editable_shops_tailwind.html.twig')]
|
||||
public function myEditableShopsTailwindAction(
|
||||
Request $request,
|
||||
Shop $shop,
|
||||
JWTTokenManagerInterface $jwtManager,
|
||||
EntityManagerInterface $entityManager,
|
||||
) {
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */
|
||||
$selectedShop = $shop->getSelectedShop();
|
||||
$shops = $shop->getMyEditableShops();
|
||||
|
||||
$domains = $entityManager
|
||||
->getRepository(Domain::class)->getAllByShopId($selectedShop);
|
||||
$domains = $entityManager->getRepository(Domain::class)->getAllByShopId($selectedShop);
|
||||
if (count($domains) > 0) {
|
||||
$domain = array_pop($domains)->getHost();
|
||||
} else {
|
||||
$domain = false;
|
||||
}
|
||||
|
||||
return array('domain' => $domain, 'shops' => $shops, 'jwt' => $jwtManager->create($this->getUser()), 'selectedShop' => $selectedShop, 'displayDeletedShop' => $request->getSession()->get('displayDeletedShop', false));
|
||||
return [
|
||||
'domain' => $domain,
|
||||
'shops' => $shops,
|
||||
'jwt' => $jwtManager->create($this->getUser()),
|
||||
'selectedShop' => $selectedShop,
|
||||
'displayDeletedShop' => $request->getSession()->get('displayDeletedShop', false),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change Shop
|
||||
*
|
||||
*
|
||||
* @param Request $request
|
||||
* @param EntityManagerInterface $em
|
||||
* @param \Symfony\Component\Security\Core\Security $security
|
||||
* @param $shop_uuid
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
#[Route(path: '/shop/change/{shop_uuid}', name: 'psc_backend_dashboard_shop_change')]
|
||||
public function changeShopAction(Request $request, EntityManagerInterface $em, \Symfony\Component\Security\Core\Security $security, $shop_uuid)
|
||||
public function changeShopAction(Request $request, EntityManagerInterface $em, Security $security, $shop_uuid)
|
||||
{
|
||||
$em
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\ShopContact')
|
||||
->changeSelectedShop($security->getUser(), $shop_uuid);
|
||||
$em->getRepository('PSC\Shop\EntityBundle\Entity\ShopContact')->changeSelectedShop(
|
||||
$security->getUser(),
|
||||
$shop_uuid,
|
||||
);
|
||||
$request->getSession()->set('selectedShop', $shop_uuid);
|
||||
return $this->redirect($this->generateUrl('psc_backend_dashboard_index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Change Shop
|
||||
*
|
||||
*
|
||||
* @param Request $request
|
||||
* @param EntityManagerInterface $em
|
||||
* @param \Symfony\Component\Security\Core\Security $security
|
||||
* @param Shop $shopService
|
||||
* @return RedirectResponse
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
#[Route(path: '/shop/deleted/toogle', name: 'psc_backend_dashboard_toogle_deleted_shop')]
|
||||
public function toogleDisplayDeletedShopAction(Request $request, EntityManagerInterface $em, \Symfony\Component\Security\Core\Security $security, Shop $shopService)
|
||||
{
|
||||
public function toogleDisplayDeletedShopAction(
|
||||
Request $request,
|
||||
EntityManagerInterface $em,
|
||||
Security $security,
|
||||
Shop $shopService,
|
||||
) {
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */
|
||||
$selectedShop = $shopService->getSelectedShop();
|
||||
if (!!$request->getSession()->get('displayDeletedShop', false) && $selectedShop->isDeleted()) {
|
||||
$shops = $em
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\ShopContact')->myEditableShopsWithNoDeleted($security->getUser());
|
||||
$shops = $em->getRepository(
|
||||
'PSC\Shop\EntityBundle\Entity\ShopContact',
|
||||
)->myEditableShopsWithNoDeleted($security->getUser());
|
||||
$request->getSession()->set('selectedShop', $shops[0]->getUid());
|
||||
}
|
||||
$request->getSession()->set('displayDeletedShop', !$request->getSession()->get('displayDeletedShop', false));
|
||||
|
||||
@ -11,17 +11,17 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class IconButtonExtension extends AbstractTypeExtension
|
||||
{
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
public function buildView(FormView $view, FormInterface $form, array $options): void
|
||||
{
|
||||
$view->vars['icon_before'] = $options['icon_before'] ? $options['icon_before'] : '';
|
||||
$view->vars['icon_after'] = $options['icon_after'] ? $options['icon_after'] : '';
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'icon_before' => null,
|
||||
'icon_after' => null
|
||||
'icon_after' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
psc_backend_dashboard:
|
||||
resource: "@PSCBackendDashboardBundle/Controller/"
|
||||
type: annotation
|
||||
type: attribute
|
||||
prefix: /backend
|
||||
@ -30,9 +30,9 @@ use Symfony\Component\Form\FormError;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Security\Core\SecurityContext;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
@ -65,8 +65,8 @@ class ListController extends \Symfony\Bundle\FrameworkBundle\Controller\Abstract
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Route(path: '/list/index', name: 'psc_backend_domain_list_index')]
|
||||
#[Template]
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[Template('@PSCBackendDomain/backend/list/index.html.twig')]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
public function indexAction(Request $request, Shop $shopService, DocumentManager $mongoService, EntityManagerInterface $em, DomainSync $sync)
|
||||
{
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */
|
||||
@ -101,7 +101,7 @@ class ListController extends \Symfony\Bundle\FrameworkBundle\Controller\Abstract
|
||||
*
|
||||
*/
|
||||
#[Route(path: '/list/sync', name: 'psc_backend_domain_list_sync')]
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
public function syncAction(DomainSync $sync)
|
||||
{
|
||||
$sync->syncDomains();
|
||||
@ -120,7 +120,7 @@ class ListController extends \Symfony\Bundle\FrameworkBundle\Controller\Abstract
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Route(path: '/list/delete/{uid}', name: 'psc_backend_domain_list_delete')]
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
public function deleteAction(Shop $shopService, EntityManagerInterface $entityManager, DocumentManager $mongoManager, $uid)
|
||||
{
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
psc_backend_domain:
|
||||
resource: "@PSCBackendDomainBundle/Controller/Backend"
|
||||
type: annotation
|
||||
type: attribute
|
||||
prefix: /backend/domain
|
||||
@ -4,9 +4,9 @@ namespace PSC\Backend\ToolsBundle\Controller\Backend;
|
||||
|
||||
use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface;
|
||||
use PSC\Backend\ToolsBundle\Service\ExporterRegistry;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -25,9 +25,9 @@ class ExporterController extends AbstractController
|
||||
* @param ExporterRegistry $registry
|
||||
* @return array
|
||||
*/
|
||||
#[Template]
|
||||
#[Template('@PSCBackendTools/backend/exporter/list.html.twig')]
|
||||
#[Route(path: '/list', name: 'psc_backend_tools_exporter_list_index')]
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
public function listAction(ExporterRegistry $registry)
|
||||
{
|
||||
return array('exporters' => $registry->all());
|
||||
@ -41,8 +41,8 @@ class ExporterController extends AbstractController
|
||||
* @return array
|
||||
*/
|
||||
#[Route(path: '/{type}/export', name: 'psc_backend_tools_exporter_form')]
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[Template]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
#[Template('@PSCBackendTools/backend/exporter/form.html.twig')]
|
||||
public function formAction(Request $request, ExporterRegistry $registry, $type)
|
||||
{
|
||||
if (!$registry->has($type)) {
|
||||
|
||||
@ -5,9 +5,9 @@ namespace PSC\Backend\ToolsBundle\Controller\Backend;
|
||||
use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface;
|
||||
use PSC\Backend\ToolsBundle\Service\ImporterRegistry;
|
||||
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -23,9 +23,9 @@ class ImporterController extends AbstractController
|
||||
dump($importer);die();
|
||||
}
|
||||
|
||||
#[Template]
|
||||
#[Template('@PSCBackendTools/backend/importer/list.html.twig')]
|
||||
#[Route(path: '/list', name: 'psc_backend_tools_importer_list_index')]
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
public function listAction(ImporterRegistry $registry)
|
||||
{
|
||||
return array('exporters' => $registry->all());
|
||||
|
||||
@ -8,6 +8,7 @@ use LogicException;
|
||||
use Port\Csv\CsvWriter;
|
||||
use Port\Reader\ArrayReader;
|
||||
use PSC\Backend\ToolsBundle\Export\Writer\ExcelWriter;
|
||||
use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface;
|
||||
use PSC\Backend\ToolsBundle\Interfaces\ExporterInterface;
|
||||
use PSC\Backend\ToolsBundle\Service\ExporterRegistry;
|
||||
use PSC\Shop\EntityBundle\Entity\Contact;
|
||||
@ -22,15 +23,19 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
|
||||
use Symfony\Component\Validator\Constraints\Date;
|
||||
use Symfony\Component\Validator\Constraints\DateTime;
|
||||
|
||||
class ContactExporter implements ExporterInterface
|
||||
class ContactExporter implements ExporterInterface, ConfigurableElementInterface
|
||||
{
|
||||
private $_formFactory = null;
|
||||
private $_entityManager = null;
|
||||
private $_shopService = null;
|
||||
/** @var Form */
|
||||
private $_form = null;
|
||||
public function __construct(FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, Shop $shopService)
|
||||
{
|
||||
|
||||
public function __construct(
|
||||
FormFactoryInterface $formFactory,
|
||||
EntityManagerInterface $entityManager,
|
||||
Shop $shopService,
|
||||
) {
|
||||
$this->_formFactory = $formFactory;
|
||||
$this->_entityManager = $entityManager;
|
||||
$this->_shopService = $shopService;
|
||||
@ -51,6 +56,11 @@ class ContactExporter implements ExporterInterface
|
||||
|
||||
public function getForm(FormBuilderInterface $builder, $form_options)
|
||||
{
|
||||
$builder->add('fotos', CheckboxType::class, ['required' => false, 'label' => 'Fotos mit exportieren?']);
|
||||
$builder->add('fotosFolder', TextType::class, [
|
||||
'required' => false,
|
||||
'label' => 'Pfad für die Fotos z.B.: /data/www/old/data/packages/fotos/{{ media.uuid }}.{{media.extension}}',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getGroup()
|
||||
@ -68,9 +78,12 @@ class ContactExporter implements ExporterInterface
|
||||
*/
|
||||
public function export()
|
||||
{
|
||||
$rows = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->getContactsByShop($this->_shopService->getSelectedShop());
|
||||
$temp = array();
|
||||
$temp[] = array(
|
||||
$formData = $this->_form->getData();
|
||||
$rows = $this->_entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Contact')
|
||||
->getContactsByShop($this->_shopService->getSelectedShop());
|
||||
$temp = [];
|
||||
$temp[] = [
|
||||
'id' => 'id',
|
||||
'uid' => 'uid',
|
||||
'account_id' => 'account_id',
|
||||
@ -108,16 +121,18 @@ class ContactExporter implements ExporterInterface
|
||||
'alternativAppendix' => 'alternativAppendix',
|
||||
'alternativ' => 'alternativ',
|
||||
'alternativType' => 'alternativType',
|
||||
'birthday' => 'birthday'
|
||||
);
|
||||
'birthday' => 'birthday',
|
||||
'image1' => 'image1',
|
||||
'image2' => 'image2',
|
||||
];
|
||||
foreach ($rows as $row) {
|
||||
/** @var Contact $contact */
|
||||
$contact = $row->getContact();
|
||||
$temp[] = array(
|
||||
$temp[] = [
|
||||
'id' => $contact->getId(),
|
||||
'uid' => $contact->getId(),
|
||||
'account_id' => ($contact->getAccount() ? (string)$contact->getAccount()->getId() : 0),
|
||||
'account_title' => ($contact->getAccount() ? (string)$contact->getAccount()->getTitle() : 0),
|
||||
'account_id' => $contact->getAccount() ? ((string) $contact->getAccount()->getId()) : 0,
|
||||
'account_title' => $contact->getAccount() ? ((string) $contact->getAccount()->getTitle()) : 0,
|
||||
'enable' => (int) $contact->isEnable(),
|
||||
'locked' => (int) $contact->isLocked(),
|
||||
'virtual' => (int) $contact->isVirtual(),
|
||||
@ -151,15 +166,22 @@ class ContactExporter implements ExporterInterface
|
||||
'alternativAppendix' => $contact->getAlternativAppendix(),
|
||||
'alternativ' => $contact->getAlternativ(),
|
||||
'alternativType' => $contact->getAlternativType(),
|
||||
'birthday' => $contact->getBirthday()
|
||||
);
|
||||
'birthday' => $contact->getBirthday(),
|
||||
'image1' => $contact->getImage1() ?? '',
|
||||
'image2' => $contact->getImage2() ?? '',
|
||||
];
|
||||
if ($formData['fotos'] && $contact->getImage1() != '') {
|
||||
$this->mediaManager->copyMediaToFolder($contact->getImage1(), $formData['fotosFolder']);
|
||||
}
|
||||
if ($formData['fotos'] && $contact->getImage2() != '') {
|
||||
$this->mediaManager->copyMediaToFolder($contact->getImage2(), $formData['fotosFolder']);
|
||||
}
|
||||
}
|
||||
|
||||
$reader = new ArrayReader($temp);
|
||||
$writer = new CsvWriter();
|
||||
$writer->setStream(fopen('php://output', 'w'));
|
||||
$response = new StreamedResponse(function () use ($reader, $writer) {
|
||||
|
||||
foreach ($reader as $row) {
|
||||
$writer->writeItem($row);
|
||||
}
|
||||
|
||||
@ -4,19 +4,25 @@ namespace PSC\Backend\ToolsBundle\Exporter\Excel;
|
||||
|
||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use MongoDB\BSON\ObjectId;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface;
|
||||
use PSC\Backend\ToolsBundle\Interfaces\ExporterInterface;
|
||||
use PSC\Backend\ToolsBundle\Service\ExporterRegistry;
|
||||
use PSC\Shop\EntityBundle\Document\Contact as PSCContact;
|
||||
use PSC\Shop\EntityBundle\Entity\Contact;
|
||||
use PSC\Shop\MediaBundle\Document\Media;
|
||||
use PSC\Shop\MediaBundle\Service\MediaManager;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
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\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
class ContactExporter implements ExporterInterface
|
||||
class ContactExporter implements ExporterInterface, ConfigurableElementInterface
|
||||
{
|
||||
/** @var Form */
|
||||
private $_form = null;
|
||||
@ -25,6 +31,7 @@ class ContactExporter implements ExporterInterface
|
||||
private FormFactoryInterface $formFactory,
|
||||
private EntityManagerInterface $entityManager,
|
||||
private DocumentManager $mongoManager,
|
||||
private MediaManager $mediaManager,
|
||||
private Shop $shopService,
|
||||
) {}
|
||||
|
||||
@ -43,6 +50,11 @@ class ContactExporter implements ExporterInterface
|
||||
|
||||
public function getForm(FormBuilderInterface $builder, $form_options)
|
||||
{
|
||||
$builder->add('fotos', CheckboxType::class, ['required' => false, 'label' => 'Fotos mit exportieren?']);
|
||||
$builder->add('fotosFolder', TextType::class, [
|
||||
'required' => false,
|
||||
'label' => 'Pfad für die Fotos z.B.: /data/www/old/data/packages/fotos/{{ media.uuid }}.{{media.extension}}',
|
||||
]);
|
||||
}
|
||||
|
||||
public function getGroup()
|
||||
@ -60,6 +72,7 @@ class ContactExporter implements ExporterInterface
|
||||
*/
|
||||
public function export()
|
||||
{
|
||||
$formData = $this->_form->getData();
|
||||
$rows = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Contact')
|
||||
->getContactsByShop($this->shopService->getSelectedShop());
|
||||
@ -128,6 +141,8 @@ class ContactExporter implements ExporterInterface
|
||||
'custom22' => $shop->getCustomerFieldName22(),
|
||||
'custom23' => $shop->getCustomerFieldName23(),
|
||||
'custom24' => $shop->getCustomerFieldName24(),
|
||||
'image1' => 'image1',
|
||||
'image2' => 'image2',
|
||||
];
|
||||
foreach ($rows as $row) {
|
||||
/** @var Contact $contact */
|
||||
@ -200,9 +215,17 @@ class ContactExporter implements ExporterInterface
|
||||
'custom22' => $contactDoc ? $contactDoc->getCustom22() : '',
|
||||
'custom23' => $contactDoc ? $contactDoc->getCustom23() : '',
|
||||
'custom24' => $contactDoc ? $contactDoc->getCustom24() : '',
|
||||
'image1' => $contact->getImage1() ?? '',
|
||||
'image2' => $contact->getImage2() ?? '',
|
||||
];
|
||||
}
|
||||
|
||||
if ($formData['fotos'] && $contact->getImage1() != '') {
|
||||
$this->mediaManager->copyMediaToFolder($contact->getImage1(), $formData['fotosFolder']);
|
||||
}
|
||||
if ($formData['fotos'] && $contact->getImage2() != '') {
|
||||
$this->mediaManager->copyMediaToFolder($contact->getImage2(), $formData['fotosFolder']);
|
||||
}
|
||||
}
|
||||
$spreadsheet = new Spreadsheet();
|
||||
|
||||
$spreadsheet->getActiveSheet()->fromArray(
|
||||
|
||||
@ -2,15 +2,15 @@
|
||||
|
||||
namespace PSC\Backend\ToolsBundle\Exporter\Excel;
|
||||
|
||||
require_once(__DIR__ . '/../../../../Shop/EntityBundle/Lagacy/TP_Basket_Item.php');
|
||||
require_once __DIR__ . '/../../../../Shop/EntityBundle/Lagacy/TP_Basket_Item.php';
|
||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface;
|
||||
use PSC\Backend\ToolsBundle\Interfaces\ExporterInterface;
|
||||
use PSC\Backend\ToolsBundle\Service\ExporterRegistry;
|
||||
use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface;
|
||||
use PSC\Library\Calc\Engine;
|
||||
use PSC\Library\Calc\PaperContainer;
|
||||
use PSC\Shop\EntityBundle\Document\Position;
|
||||
@ -25,6 +25,7 @@ use Symfony\Component\Form\Form;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\FormFactoryInterface;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
class PositionExporter implements ExporterInterface, ConfigurableElementInterface
|
||||
{
|
||||
private $_formFactory = null;
|
||||
@ -41,8 +42,14 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
* @var DocumentManager
|
||||
*/
|
||||
private DocumentManager $_mongoDb;
|
||||
function __construct(FormFactoryInterface $formFactory, EntityManagerInterface $entityManager, Shop $shopService, PaperDB $paperDbService, DocumentManager $mongodb)
|
||||
{
|
||||
|
||||
function __construct(
|
||||
FormFactoryInterface $formFactory,
|
||||
EntityManagerInterface $entityManager,
|
||||
Shop $shopService,
|
||||
PaperDB $paperDbService,
|
||||
DocumentManager $mongodb,
|
||||
) {
|
||||
$this->_formFactory = $formFactory;
|
||||
$this->_entityManager = $entityManager;
|
||||
$this->_shopService = $shopService;
|
||||
@ -68,8 +75,8 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
$builder->add('product', EntityType::class, array(
|
||||
'class' => Product::class,
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
|
||||
return $er->createQueryBuilder('g')
|
||||
return $er
|
||||
->createQueryBuilder('g')
|
||||
->andWhere('g.shop = :shop and g.originalProduct = 0')
|
||||
->setParameter('shop', $this->_shopService->getSelectedShop()->getUid())
|
||||
->orderBy('g.title', 'ASC');
|
||||
@ -77,11 +84,15 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
'choice_label' => 'title',
|
||||
'required' => false,
|
||||
'placeholder' => 'Alle',
|
||||
'label' => 'Vorgänger'
|
||||
'label' => 'Vorgänger',
|
||||
));
|
||||
$builder->add('from', DateType::class, array('label' => 'Von', 'attr' => array('class' => 'form-element')));
|
||||
$builder->add('to', DateType::class, array('label' => 'Bis', 'attr' => array('class' => 'form-element')));
|
||||
$builder->add('calc_options', TextType::class, array(
|
||||
'label' => 'Kalkulationsoptionen (auflage,papier)',
|
||||
'required' => false,
|
||||
'attr' => array('class' => 'form-element'),
|
||||
));
|
||||
$builder->add("from", DateType::class, array('label' => 'Von', 'attr' => array('class' => 'form-element')));
|
||||
$builder->add("to", DateType::class, array('label' => 'Bis', 'attr' => array('class' => 'form-element')));
|
||||
$builder->add("calc_options", TextType::class, array('label' => 'Kalkulationsoptionen (auflage,papier)', 'required' => false, 'attr' => array('class' => 'form-element')));
|
||||
}
|
||||
|
||||
public function getGroup()
|
||||
@ -102,15 +113,17 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
$formData = $this->_form->getData();
|
||||
$orderRepository = $this->_entityManager->getRepository('PSC\Shop\EntityBundle\Entity\Orderpos');
|
||||
if ($formData['product'] === null) {
|
||||
$qb = $orderRepository->createQueryBuilder('o')
|
||||
->where("o.createdDate >= :from and o.createdDate <= :to and o.shop = :shop")
|
||||
$qb = $orderRepository
|
||||
->createQueryBuilder('o')
|
||||
->where('o.createdDate >= :from and o.createdDate <= :to and o.shop = :shop')
|
||||
->setParameter('from', $formData['from'])
|
||||
->setParameter('to', $formData['to'])
|
||||
->setParameter('shop', $this->_shopService->getSelectedShop()->getId())
|
||||
->getQuery();
|
||||
} else {
|
||||
$qb = $orderRepository->createQueryBuilder('o')
|
||||
->where("o.createdDate >= :from and o.createdDate <= :to and o.shop = :shop AND o.product = :product")
|
||||
$qb = $orderRepository
|
||||
->createQueryBuilder('o')
|
||||
->where('o.createdDate >= :from and o.createdDate <= :to and o.shop = :shop AND o.product = :product')
|
||||
->setParameter('from', $formData['from'])
|
||||
->setParameter('to', $formData['to'])
|
||||
->setParameter('shop', $this->_shopService->getSelectedShop()->getId())
|
||||
@ -119,7 +132,7 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
}
|
||||
|
||||
$rows = $qb->getResult();
|
||||
$calcOptions = explode(",", $formData['calc_options']);
|
||||
$calcOptions = explode(',', $formData['calc_options']);
|
||||
$data[] = array();
|
||||
$temp = array(
|
||||
'order' => 'order',
|
||||
@ -144,7 +157,7 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
'productId' => 'articleId',
|
||||
'productTitle' => 'articleName',
|
||||
'weight' => 'weight',
|
||||
'articleName' => 'articleName'
|
||||
'articleName' => 'articleName',
|
||||
);
|
||||
foreach ($calcOptions as $key) {
|
||||
$temp[$key] = $key;
|
||||
@ -152,20 +165,26 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
|
||||
$data[] = $temp;
|
||||
$paperContainer = new PaperContainer();
|
||||
$paperContainer->parse(simplexml_load_string($this->_shopService->getSelectedShop()->getInstall()->getPaperContainer()));
|
||||
$paperContainer->parse(simplexml_load_string(
|
||||
$this->_shopService
|
||||
->getSelectedShop()
|
||||
->getInstall()
|
||||
->getPaperContainer(),
|
||||
));
|
||||
$engine = new Engine();
|
||||
$engine->setPaperRepository($this->_paperDbService);
|
||||
$engine->setPaperContainer($paperContainer);
|
||||
if ($this->_shopService->getSelectedShop()->getInstall()->getCalcTemplates()) {
|
||||
$engine->setTemplates('<root>' . $this->_shopService->getSelectedShop()->getInstall()->getCalcTemplates() . '</root>');
|
||||
$engine->setTemplates('<root>' . $this->_shopService
|
||||
->getSelectedShop()
|
||||
->getInstall()
|
||||
->getCalcTemplates() . '</root>');
|
||||
}
|
||||
|
||||
/** @var Orderpos $row */
|
||||
foreach ($rows as $row) {
|
||||
/** @var Position $objDoc */
|
||||
$objDoc = $this->_mongoDb
|
||||
->getRepository(Position::class)
|
||||
->findOneBy(['uid' => (string)$row->getId()]);
|
||||
$objDoc = $this->_mongoDb->getRepository(Position::class)->findOneBy(['uid' => (string) $row->getId()]);
|
||||
$temp = array(
|
||||
'order' => (string) $row->getOrder()->getAlias(),
|
||||
'pos' => (string) $row->getPos(),
|
||||
@ -190,7 +209,7 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
'productTitle' => (string) $row->getProduct()->getTitle(),
|
||||
'weight' => (string) $row->getWeight(),
|
||||
);
|
||||
$objPosition = unserialize(($row->getData()));
|
||||
$objPosition = unserialize($row->getData());
|
||||
if ($row->hasCalcXml()) {
|
||||
$engine->loadString($row->getCalcXml());
|
||||
$engine->setVariables($objPosition->getOptions());
|
||||
@ -207,7 +226,7 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
$articleCalc = new \PSC\Library\Calc\Article($objPosition->getOptions()['kalk_artikel']);
|
||||
$temp['articleName'] = $objPosition->getOptions()['kalk_artikel'];
|
||||
} else {
|
||||
$articleCalc = new \PSC\Library\Calc\Article("test");
|
||||
$articleCalc = new \PSC\Library\Calc\Article('test');
|
||||
$temp['articleName'] = '';
|
||||
}
|
||||
}
|
||||
@ -216,7 +235,7 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
if ($articleCalc->getOptionById($key)) {
|
||||
$temp[$key] = (string) $articleCalc->getOptionById($key)->getValue();
|
||||
} else {
|
||||
$temp[$key] = "";
|
||||
$temp[$key] = '';
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,11 +244,10 @@ class PositionExporter implements ExporterInterface, ConfigurableElementInterfac
|
||||
|
||||
$spreadsheet = new Spreadsheet();
|
||||
|
||||
$spreadsheet->getActiveSheet()
|
||||
->fromArray(
|
||||
$spreadsheet->getActiveSheet()->fromArray(
|
||||
$data, // The data to set
|
||||
NULL, // Array values with this value will not be set
|
||||
'A1' // Top left coordinate of the worksheet range where
|
||||
null, // Array values with this value will not be set
|
||||
'A1', // Top left coordinate of the worksheet range where
|
||||
// we want to set these values (default is A1)
|
||||
);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
psc_backend_tools:
|
||||
resource: "@PSCBackendToolsBundle/Controller/Backend"
|
||||
type: annotation
|
||||
type: attribute
|
||||
prefix: /backend/tools
|
||||
|
||||
|
||||
|
||||
@ -3,66 +3,65 @@
|
||||
namespace PSC\Component\ApiBundle\Api\Account;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input;
|
||||
use PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Component\ApiBundle\Dto\Shop\Shops;
|
||||
use PSC\Component\ApiBundle\Model\Shop;
|
||||
use PSC\Component\ApiBundle\Model\Shop\Domain;
|
||||
use PSC\Shop\EntityBundle\Entity\Account;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Response as HttpResponse;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
|
||||
class GetParentByTitle extends AbstractController
|
||||
{
|
||||
private EntityManagerInterface $entityManager;
|
||||
private \PSC\System\SettingsBundle\Service\Shop $shopService;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService)
|
||||
{
|
||||
public function __construct(
|
||||
EntityManagerInterface $entityManager,
|
||||
\PSC\System\SettingsBundle\Service\Shop $shopService,
|
||||
) {
|
||||
$this->entityManager = $entityManager;
|
||||
$this->shopService = $shopService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check account parents by title
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="account",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output::class))
|
||||
* )
|
||||
* @OA\RequestBody(
|
||||
* description="This is a request body",
|
||||
* @Model(type=\PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input::class))
|
||||
* )
|
||||
* @OA\Tag(name="Account")
|
||||
* @IsGranted("ROLE_API")
|
||||
* @Security(name="ApiKeyAuth")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'account',
|
||||
content: new JsonContent(
|
||||
ref: new Model(type: PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output::class),
|
||||
),
|
||||
)]
|
||||
#[RequestBody(
|
||||
description: 'This is a request body',
|
||||
content: new Model(type: PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input::class),
|
||||
)]
|
||||
#[Tag(name: 'Account')]
|
||||
#[IsGranted('ROLE_API')]
|
||||
#[Security(name: 'ApiKeyAuth')]
|
||||
#[Route(path: '/account/getparentbytitle', methods: ['POST'])]
|
||||
#[ParamConverter('data', class: '\PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input', converter: 'psc_rest.request_body')]
|
||||
public function existsAction(Input $data): JsonResponse
|
||||
public function existsAction(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
$output = new Output();
|
||||
$account = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Account')
|
||||
->getAccountByTitle(
|
||||
$data->title
|
||||
);
|
||||
|
||||
|
||||
->getAccountByTitle($data->title);
|
||||
|
||||
if (!$account) {
|
||||
$output->parent = "";
|
||||
$output->parent = '';
|
||||
$output->parent_id = 0;
|
||||
return $this->json($output);
|
||||
}
|
||||
@ -77,14 +76,7 @@ class GetParentByTitle extends AbstractController
|
||||
return $this->json($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Parent Account
|
||||
*
|
||||
* @param \PSC\Shop\EntityBundle\Entity\Account $account
|
||||
*
|
||||
* @return \PSC\Shop\EntityBundle\Entity\Account
|
||||
*/
|
||||
protected function recursiveParent(\PSC\Shop\EntityBundle\Entity\Account $account)
|
||||
protected function recursiveParent(\PSC\Shop\EntityBundle\Entity\Account $account): Account
|
||||
{
|
||||
if ($account->getParent()) {
|
||||
$account = $this->recursiveParent($account->getParent());
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
namespace PSC\Component\ApiBundle\Api\Cms;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Cms\Cms\Output;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Component\ApiBundle\Dto\Shop\Shops;
|
||||
@ -14,11 +16,11 @@ use PSC\Component\ApiBundle\Model\Shop;
|
||||
use PSC\Component\ApiBundle\Model\Shop\Domain;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Response as HttpResponse;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
|
||||
class Get extends AbstractController
|
||||
{
|
||||
@ -26,27 +28,24 @@ class Get extends AbstractController
|
||||
private Cms $hydrateCms;
|
||||
private \PSC\System\SettingsBundle\Service\Shop $shopService;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService, Cms $hydrateCms)
|
||||
{
|
||||
public function __construct(
|
||||
EntityManagerInterface $entityManager,
|
||||
\PSC\System\SettingsBundle\Service\Shop $shopService,
|
||||
Cms $hydrateCms,
|
||||
) {
|
||||
$this->entityManager = $entityManager;
|
||||
$this->hydrateCms = $hydrateCms;
|
||||
$this->shopService = $shopService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cms
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="cms",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Cms\Cms\Output::class))
|
||||
* )
|
||||
* @OA\Tag(name="Cms")
|
||||
*/
|
||||
#[Response(response: 200, description: 'cms', content: new JsonContent(ref: new Model(type: Output::class)))]
|
||||
#[Tag(name: 'Cms')]
|
||||
#[Route(path: '/cms', methods: ['GET'])]
|
||||
public function allAction(): JsonResponse
|
||||
{
|
||||
$cmss = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Cms::class)->findAllByShop($this->shopService->getShopByDomain());
|
||||
$cmss = $this->entityManager
|
||||
->getRepository(\PSC\Shop\EntityBundle\Entity\Cms::class)
|
||||
->findAllByShop($this->shopService->getShopByDomain());
|
||||
|
||||
$data = [];
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Cms $cms */
|
||||
@ -57,21 +56,17 @@ class Get extends AbstractController
|
||||
return $this->json(new Output($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get One Cms
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="found cms",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Cms::class))
|
||||
* )
|
||||
* @OA\Response(
|
||||
* response=404,
|
||||
* description="not found",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Error\NotFound::class))
|
||||
* )
|
||||
* @OA\Tag(name="Cms")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'found cms',
|
||||
content: new JsonContent(ref: new Model(type: \PSC\Component\ApiBundle\Model\Cms::class)),
|
||||
)]
|
||||
#[Response(
|
||||
response: 404,
|
||||
description: 'not found',
|
||||
content: new JsonContent(ref: new Model(type: NotFound::class)),
|
||||
)]
|
||||
#[Tag(name: 'Cms')]
|
||||
#[Route(path: '/cms/{id}', methods: ['GET'])]
|
||||
public function one($id): JsonResponse
|
||||
{
|
||||
|
||||
@ -4,9 +4,11 @@ namespace PSC\Component\ApiBundle\Api\Plugin;
|
||||
|
||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||
use MongoDB\BSON\ObjectId;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Component\ApiBundle\Dto\Shop\Shops;
|
||||
use PSC\Component\ApiBundle\Model\Shop;
|
||||
@ -14,11 +16,11 @@ use PSC\Component\ApiBundle\Model\Shop\Domain;
|
||||
use PSC\System\PluginBundle\Interfaces\Plugin;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Response as HttpResponse;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
|
||||
class Get extends AbstractController
|
||||
{
|
||||
@ -29,16 +31,12 @@ class Get extends AbstractController
|
||||
$this->documentManager = $documentManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Layouter Plugins
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="shops",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class))
|
||||
* )
|
||||
* @OA\Tag(name="Plugin")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'shops',
|
||||
content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class)),
|
||||
)]
|
||||
#[Tag(name: 'Plugin')]
|
||||
#[Route(path: '/plugins/layouter', methods: ['GET'])]
|
||||
public function layouterAction(): JsonResponse
|
||||
{
|
||||
@ -61,17 +59,13 @@ class Get extends AbstractController
|
||||
return $this->json(new Shops\Output($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugins
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="shops",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class))
|
||||
* )
|
||||
* @OA\Tag(name="Plugin")
|
||||
* @Security(name="ApiKeyAuth")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'shops',
|
||||
content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class)),
|
||||
)]
|
||||
#[Tag(name: 'Plugin')]
|
||||
#[Security(name: 'ApiKeyAuth')]
|
||||
#[Route(path: '/plugins', methods: ['GET'])]
|
||||
#[IsGranted('ROLE_API')]
|
||||
public function allAction(): JsonResponse
|
||||
@ -90,27 +84,25 @@ class Get extends AbstractController
|
||||
return $this->json(new Shops\Output($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get one plugin
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="found plugin",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Plugin::class))
|
||||
* )
|
||||
* @OA\Response(
|
||||
* response=404,
|
||||
* description="not found",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Error\NotFound::class))
|
||||
* )
|
||||
* @OA\Tag(name="Plugin")
|
||||
* @Security(name="ApiKeyAuth")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'found plugin',
|
||||
content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Model\Plugin::class)),
|
||||
)]
|
||||
#[Response(
|
||||
response: 404,
|
||||
description: 'not found',
|
||||
content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Error\NotFound::class)),
|
||||
)]
|
||||
#[Tag(name: 'Plugin')]
|
||||
#[Security(name: 'ApiKeyAuth')]
|
||||
#[Route(path: '/plugins/{uuid}', methods: ['GET'])]
|
||||
#[IsGranted('ROLE_API')]
|
||||
public function one($uuid): JsonResponse
|
||||
{
|
||||
$plugin = $this->documentManager->getRepository(\PSC\System\PluginBundle\Document\Plugin::class)->findOneBy(['id' => new ObjectId($uuid)]);
|
||||
$plugin = $this->documentManager
|
||||
->getRepository(\PSC\System\PluginBundle\Document\Plugin::class)
|
||||
->findOneBy(['id' => new ObjectId($uuid)]);
|
||||
if (!$plugin) {
|
||||
return $this->json(new NotFound());
|
||||
}
|
||||
|
||||
@ -3,44 +3,44 @@
|
||||
namespace PSC\Component\ApiBundle\Api\Shop;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Component\ApiBundle\Dto\Shop\Shops;
|
||||
use PSC\Component\ApiBundle\Model\Shop;
|
||||
use PSC\Component\ApiBundle\Model\Shop\Domain;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Response as HttpResponse;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
|
||||
class Get extends AbstractController
|
||||
{
|
||||
private EntityManagerInterface $entityManager;
|
||||
private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager, \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop)
|
||||
{
|
||||
public function __construct(
|
||||
EntityManagerInterface $entityManager,
|
||||
\PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop,
|
||||
) {
|
||||
$this->entityManager = $entityManager;
|
||||
$this->hydrateShop = $hydrateShop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shops
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="shops",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Shop\Shops\Output::class))
|
||||
* )
|
||||
* @OA\Tag(name="Shops")
|
||||
* @Security(name="ApiKeyAuth")
|
||||
* @Security(name="Bearer")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'shops',
|
||||
content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Shop\Shops\Output::class)),
|
||||
)]
|
||||
#[Tag(name: 'Shops')]
|
||||
#[Security(name: 'ApiKeyAuth')]
|
||||
#[Security(name: 'Bearer')]
|
||||
#[Route(path: '/shops', methods: ['GET'])]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
public function allAction(): JsonResponse
|
||||
@ -56,27 +56,25 @@ class Get extends AbstractController
|
||||
return $this->json(new Shops\Output($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get One Shop
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="found shop",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Shop::class))
|
||||
* )
|
||||
* @OA\Response(
|
||||
* response=404,
|
||||
* description="not found",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Error\NotFound::class))
|
||||
* )
|
||||
* @OA\Tag(name="Shops")
|
||||
* @Security(name="ApiKeyAuth")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'found shop',
|
||||
content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Model\Shop::class)),
|
||||
)]
|
||||
#[Response(
|
||||
response: 404,
|
||||
description: 'not found',
|
||||
content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Error\NotFound::class)),
|
||||
)]
|
||||
#[Tag(name: 'Shops')]
|
||||
#[Security(name: 'ApiKeyAuth')]
|
||||
#[Route(path: '/shops/{id}', methods: ['GET'])]
|
||||
#[IsGranted('ROLE_API')]
|
||||
public function one($id): JsonResponse
|
||||
{
|
||||
$shop = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Shop::class)->findOneBy(['uid' => $id]);
|
||||
$shop = $this->entityManager
|
||||
->getRepository(\PSC\Shop\EntityBundle\Entity\Shop::class)
|
||||
->findOneBy(['uid' => $id]);
|
||||
|
||||
if ($shop) {
|
||||
return $this->json($this->hydrateShop->hydrateToModel($shop));
|
||||
|
||||
@ -3,9 +3,12 @@
|
||||
namespace PSC\Component\ApiBundle\Api\Stockbooking;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Component\ApiBundle\Dto\Error\PersistFailure;
|
||||
use PSC\Component\ApiBundle\Dto\Shop\Shops;
|
||||
@ -17,56 +20,58 @@ use PSC\Component\ApiBundle\Model\Shop\Domain;
|
||||
use PSC\Component\ApiBundle\Model\Stockbooking;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Response as HttpResponse;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
|
||||
class CreateByNr extends AbstractController
|
||||
{
|
||||
private EntityManagerInterface $entityManager;
|
||||
private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager, \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop)
|
||||
{
|
||||
public function __construct(
|
||||
EntityManagerInterface $entityManager,
|
||||
\PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop,
|
||||
) {
|
||||
$this->entityManager = $entityManager;
|
||||
$this->hydrateShop = $hydrateShop;
|
||||
}
|
||||
|
||||
/**
|
||||
* create by nr
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="stockbooking",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Output::class))
|
||||
* )
|
||||
* @OA\RequestBody(
|
||||
* description="This is a request body",
|
||||
* @Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Input::class))
|
||||
* )
|
||||
* @OA\Tag(name="Stockbooking")
|
||||
* @IsGranted("ROLE_API")
|
||||
* @Security(name="ApiKeyAuth")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'stockbooking',
|
||||
content: new JsonContent(
|
||||
ref: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Output::class),
|
||||
),
|
||||
)]
|
||||
#[RequestBody(
|
||||
description: 'This is a request body',
|
||||
content: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Input::class),
|
||||
)]
|
||||
#[Tag(name: 'Stockbooking')]
|
||||
#[IsGranted('ROLE_API')]
|
||||
#[Security(name: 'ApiKeyAuth')]
|
||||
#[Route(path: '/stockbooking/createbynr', methods: ['POST'])]
|
||||
#[ParamConverter('data', class: '\PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Input', converter: 'psc_rest.request_body')]
|
||||
public function create(Input $data): JsonResponse
|
||||
public function create(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
$product = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')->createQueryBuilder('product')
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->createQueryBuilder('product')
|
||||
->andWhere('product.nrIntern = :nr or product.nrExtern = :nr')
|
||||
->setParameter('nr', $data->product_nr)
|
||||
->getQuery()->getOneOrNullResult();
|
||||
->getQuery()
|
||||
->getOneOrNullResult();
|
||||
|
||||
if ($product) {
|
||||
$contact = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(['uid' => $data->contact_id]);
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Contact')
|
||||
->findOneBy(['uid' => $data->contact_id]);
|
||||
|
||||
if (!$contact) {
|
||||
return $this->json(new NotFound("Contact not found"));
|
||||
return $this->json(new NotFound('Contact not found'));
|
||||
}
|
||||
|
||||
$stBooking = new \PSC\Shop\EntityBundle\Entity\Stockbooking($product);
|
||||
@ -90,6 +95,6 @@ class CreateByNr extends AbstractController
|
||||
return $this->json(new Output());
|
||||
}
|
||||
|
||||
return $this->json(new NotFound("Product not found"));
|
||||
return $this->json(new NotFound('Product not found'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,9 +3,12 @@
|
||||
namespace PSC\Component\ApiBundle\Api\Stockbooking;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Component\ApiBundle\Dto\Shop\Shops;
|
||||
use PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input;
|
||||
@ -16,56 +19,55 @@ use PSC\Component\ApiBundle\Model\Shop\Domain;
|
||||
use PSC\Component\ApiBundle\Model\Stockbooking;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Response as HttpResponse;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
|
||||
class GetByNr extends AbstractController
|
||||
{
|
||||
private EntityManagerInterface $entityManager;
|
||||
private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager, \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop)
|
||||
{
|
||||
public function __construct(
|
||||
EntityManagerInterface $entityManager,
|
||||
\PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop,
|
||||
) {
|
||||
$this->entityManager = $entityManager;
|
||||
$this->hydrateShop = $hydrateShop;
|
||||
}
|
||||
|
||||
/**
|
||||
* get all by nr
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="account",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Output::class))
|
||||
* )
|
||||
* @OA\RequestBody(
|
||||
* description="This is a request body",
|
||||
* @Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input::class))
|
||||
* )
|
||||
* @OA\Tag(name="Stockbooking")
|
||||
* @IsGranted("ROLE_API")
|
||||
* @Security(name="ApiKeyAuth")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'account',
|
||||
content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Output::class)),
|
||||
)]
|
||||
#[RequestBody(
|
||||
description: 'This is a request body',
|
||||
content: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input::class),
|
||||
)]
|
||||
#[Tag(name: 'Stockbooking')]
|
||||
#[IsGranted('ROLE_API')]
|
||||
#[Security(name: 'ApiKeyAuth')]
|
||||
#[Route(path: '/stockbooking/getallbynr', methods: ['POST'])]
|
||||
#[ParamConverter('data', class: '\PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input', converter: 'psc_rest.request_body')]
|
||||
public function allAction(Input $data): JsonResponse
|
||||
public function allAction(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
$product = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')->createQueryBuilder('product')
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->createQueryBuilder('product')
|
||||
->andWhere('product.nrIntern = :nr or product.nrExtern = :nr')
|
||||
->setParameter('nr', $data->nr)
|
||||
->getQuery()->getOneOrNullResult();
|
||||
->getQuery()
|
||||
->getOneOrNullResult();
|
||||
|
||||
if ($product) {
|
||||
$bookings = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Stockbooking')
|
||||
->findByProduct($product);
|
||||
|
||||
$bookingsTemp = array();
|
||||
$bookingsTemp = [];
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Stockbooking $booking */
|
||||
foreach ($bookings as $booking) {
|
||||
$contact = new Contact();
|
||||
@ -86,6 +88,6 @@ class GetByNr extends AbstractController
|
||||
return $this->json(new Output($bookingsTemp));
|
||||
}
|
||||
|
||||
return $this->json(new NotFound("Product not found"));
|
||||
return $this->json(new NotFound('Product not found'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,32 +3,28 @@
|
||||
namespace PSC\Component\ApiBundle\Api\System;
|
||||
|
||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Model\Instance;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Response as HttpResponse;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
|
||||
class Info extends AbstractController
|
||||
{
|
||||
/**
|
||||
* Get system info.
|
||||
*
|
||||
*
|
||||
* @Security(name="ApiKeyAuth")
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="Returns system info",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Instance::class))
|
||||
* )
|
||||
* @OA\Tag(name="System")
|
||||
*/
|
||||
#[Tag(name: 'System')]
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'Returns system info',
|
||||
content: new JsonContent(ref: new Model(type: Instance::class)),
|
||||
)]
|
||||
#[Route(path: '/system/info', methods: ['GET'])]
|
||||
#[IsGranted('ROLE_API')]
|
||||
public function infoAction(DocumentManager $documentManager): JsonResponse
|
||||
@ -38,7 +34,6 @@ class Info extends AbstractController
|
||||
->getRepository(\PSC\Shop\EntityBundle\Document\Instance::class)
|
||||
->findOneBy(['appId' => '1']);
|
||||
|
||||
|
||||
$data = new Instance();
|
||||
$data->sftpHost = getenv('ftpIp');
|
||||
$data->ip = getenv('ftpIp');
|
||||
|
||||
@ -2,14 +2,16 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Api\System;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Response as HttpResponse;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class Version extends AbstractController
|
||||
@ -21,17 +23,12 @@ class Version extends AbstractController
|
||||
$this->kernel = $kernel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Release version.
|
||||
*
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="release version",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Version::class))
|
||||
* )
|
||||
* @OA\Tag(name="System")
|
||||
*/
|
||||
#[Response(
|
||||
response: 200,
|
||||
description: 'release version',
|
||||
content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Model\Version::class)),
|
||||
)]
|
||||
#[Tag(name: 'System')]
|
||||
#[Route(path: '/system/version', methods: ['GET'])]
|
||||
public function versionAction(): JsonResponse
|
||||
{
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
<?php
|
||||
namespace PSC\Component\ApiBundle\Converter;
|
||||
|
||||
|
||||
use JMS\Serializer\Exception\UnsupportedFormatException;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInterface;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Serializer\Annotation\Context;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
final class RequestBody implements ParamConverterInterface
|
||||
{
|
||||
private $serializer;
|
||||
private $context = [];
|
||||
|
||||
/**
|
||||
* @param string[]|null $groups
|
||||
*/
|
||||
public function __construct(
|
||||
SerializerInterface $serializer,
|
||||
?array $groups = null,
|
||||
?string $version = null,
|
||||
?string $validationErrorsArgument = null
|
||||
) {
|
||||
$this->serializer = $serializer;
|
||||
|
||||
if (!empty($groups)) {
|
||||
$this->context['groups'] = (array) $groups;
|
||||
}
|
||||
|
||||
if (!empty($version)) {
|
||||
$this->context['version'] = $version;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function apply(Request $request, ParamConverter $configuration): bool
|
||||
{
|
||||
$format = $request->getContentType();
|
||||
if (null === $format) {
|
||||
return $this->throwException(new UnsupportedMediaTypeHttpException(), $configuration);
|
||||
}
|
||||
|
||||
try {
|
||||
$object = $this->serializer->deserialize(
|
||||
$request->getContent(),
|
||||
$configuration->getClass(),
|
||||
$format,
|
||||
);
|
||||
} catch (UnsupportedFormatException $e) {
|
||||
return $this->throwException(new UnsupportedMediaTypeHttpException($e->getMessage(), $e), $configuration);
|
||||
}
|
||||
|
||||
$request->attributes->set($configuration->getName(), $object);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function supports(ParamConverter $configuration): bool
|
||||
{
|
||||
return null !== $configuration->getClass() && 'psc_rest.request_body' === $configuration->getConverter();
|
||||
}
|
||||
|
||||
private function throwException(\Exception $exception, ParamConverter $configuration): bool
|
||||
{
|
||||
if ($configuration->isOptional()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
throw $exception;
|
||||
}
|
||||
}
|
||||
@ -2,15 +2,12 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Dto\Account\GetParentByTitle;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
final class Input
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $title;
|
||||
}
|
||||
|
||||
@ -2,22 +2,15 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Dto\Account\GetParentByTitle;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
final class Output
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $parent;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $parent_id;
|
||||
}
|
||||
|
||||
@ -3,8 +3,10 @@
|
||||
namespace PSC\Component\ApiBundle\Dto\Cms\Cms;
|
||||
|
||||
use PSC\Component\ApiBundle\Model\Cms;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
use OpenApi\Attributes\Items;
|
||||
|
||||
class Output
|
||||
{
|
||||
@ -14,17 +16,9 @@ class Output
|
||||
$this->count = count($cms);
|
||||
}
|
||||
|
||||
/**
|
||||
* @var Cms[]
|
||||
*
|
||||
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Cms::class)))
|
||||
*/
|
||||
#[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Cms::class)))]
|
||||
public array $data = [];
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $count = 0;
|
||||
}
|
||||
|
||||
@ -3,8 +3,9 @@
|
||||
namespace PSC\Component\ApiBundle\Dto\Error;
|
||||
|
||||
use PSC\Component\ApiBundle\Model\Shop;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class NotFound
|
||||
{
|
||||
@ -13,8 +14,6 @@ class NotFound
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $message = "";
|
||||
}
|
||||
|
||||
@ -3,8 +3,9 @@
|
||||
namespace PSC\Component\ApiBundle\Dto\Error;
|
||||
|
||||
use PSC\Component\ApiBundle\Model\Shop;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class PersistFailure
|
||||
{
|
||||
@ -13,8 +14,6 @@ class PersistFailure
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $message = "";
|
||||
}
|
||||
|
||||
@ -2,8 +2,10 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Dto\Plugin\Plugins;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
use OpenApi\Attributes\Items;
|
||||
use PSC\Component\ApiBundle\Model\Plugin;
|
||||
|
||||
class Output
|
||||
@ -14,17 +16,9 @@ class Output
|
||||
$this->count = count($plugins);
|
||||
}
|
||||
|
||||
/**
|
||||
* @var Plugin[]
|
||||
*
|
||||
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Plugin::class)))
|
||||
*/
|
||||
#[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Plugin::class)))]
|
||||
public array $data = [];
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $count = 0;
|
||||
}
|
||||
|
||||
@ -3,8 +3,10 @@
|
||||
namespace PSC\Component\ApiBundle\Dto\Shop\Shops;
|
||||
|
||||
use PSC\Component\ApiBundle\Model\Shop;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
use OpenApi\Attributes\Items;
|
||||
|
||||
class Output
|
||||
{
|
||||
@ -14,17 +16,9 @@ class Output
|
||||
$this->count = count($shops);
|
||||
}
|
||||
|
||||
/**
|
||||
* @var Shop[]
|
||||
*
|
||||
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Shop::class)))
|
||||
*/
|
||||
#[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Shop::class)))]
|
||||
public array $data = [];
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $count = 0;
|
||||
}
|
||||
|
||||
@ -2,43 +2,24 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Input
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $product_nr = "";
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $description = "";
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $amount = 0;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $delivery_nr = "";
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $contact_id = 0;
|
||||
}
|
||||
|
||||
@ -2,16 +2,13 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
use PSC\Component\ApiBundle\Model\Stockbooking;
|
||||
|
||||
class Output
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*
|
||||
* @OA\Property(type="boolean")
|
||||
*/
|
||||
#[Property(type: 'boolean')]
|
||||
public bool $success = true;
|
||||
}
|
||||
|
||||
@ -2,15 +2,12 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Input
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
public string $nr = "";
|
||||
}
|
||||
|
||||
@ -2,8 +2,10 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
use OpenApi\Attributes\Items;
|
||||
use PSC\Component\ApiBundle\Model\Stockbooking;
|
||||
|
||||
class Output
|
||||
@ -14,17 +16,9 @@ class Output
|
||||
$this->count = count($shops);
|
||||
}
|
||||
|
||||
/**
|
||||
* @var Stockbooking[]
|
||||
*
|
||||
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Stockbooking::class)))
|
||||
*/
|
||||
#[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Stockbooking::class)))]
|
||||
public array $data = [];
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $count = 0;
|
||||
}
|
||||
|
||||
@ -13,25 +13,18 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Model;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Cms
|
||||
{
|
||||
/**
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $id;
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
public string $title = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
public string $text = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
public string $shopId = "";
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $title = '';
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $text = '';
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $shopId = '';
|
||||
}
|
||||
|
||||
@ -13,34 +13,23 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Model;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Instance
|
||||
{
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $sftpUserName = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $sftpPassword;
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $sftpPort;
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $sftpHost;
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $ip;
|
||||
|
||||
/**
|
||||
* @OA\Property(type="boolean")
|
||||
*/
|
||||
#[Property(type: 'boolean')]
|
||||
public bool $smtpOwn = false;
|
||||
}
|
||||
|
||||
@ -13,8 +13,9 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Model;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Plugin
|
||||
{
|
||||
@ -24,16 +25,10 @@ class Plugin
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $uuid = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $title = "";
|
||||
/**
|
||||
* @OA\Property(type="boolean")
|
||||
*/
|
||||
#[Property(type: 'boolean')]
|
||||
public bool $installed = false;
|
||||
}
|
||||
|
||||
@ -13,62 +13,38 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Model;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
use OpenApi\Attributes\Items;
|
||||
|
||||
class Shop
|
||||
{
|
||||
/**
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $id = 0;
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $uuid = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $name = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $basketField1 = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $basketField2 = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $logo1 = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $logo2 = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $browsericon = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $basketPosField1 = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $basketPosField2 = "";
|
||||
/**
|
||||
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Shop\Domain::class)))
|
||||
*/
|
||||
#[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Shop\Domain::class)))]
|
||||
public array $domains = [];
|
||||
/**
|
||||
* @OA\Property(type="boolean")
|
||||
*/
|
||||
#[Property(type: 'boolean')]
|
||||
public bool $disabled = false;
|
||||
/**
|
||||
* @OA\Property(type="boolean")
|
||||
*/
|
||||
#[Property(type: 'boolean')]
|
||||
public bool $private = false;
|
||||
|
||||
/**
|
||||
|
||||
@ -13,8 +13,9 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Model\Shop;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Domain
|
||||
{
|
||||
@ -25,16 +26,10 @@ class Domain
|
||||
$this->ssl = $ssl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $id;
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $name = "";
|
||||
/**
|
||||
* @OA\Property(type="boolean")
|
||||
*/
|
||||
#[Property(type: 'boolean')]
|
||||
public bool $ssl = false;
|
||||
}
|
||||
|
||||
@ -13,37 +13,24 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Model;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Stockbooking
|
||||
{
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $id;
|
||||
/**
|
||||
* @OA\Property(type="object")
|
||||
*/
|
||||
#[Property(type: 'object')]
|
||||
public Contact $contact;
|
||||
/**
|
||||
* @OA\Property(type="object")
|
||||
*/
|
||||
#[Property(type: 'object')]
|
||||
public Product $product;
|
||||
/**
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
public int $amount = 0;
|
||||
/**
|
||||
* @OA\Property(type="date")
|
||||
*/
|
||||
#[Property(type: 'date')]
|
||||
public \DateTime $created;
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $deliveryNumber;
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $description;
|
||||
}
|
||||
|
||||
@ -13,17 +13,15 @@
|
||||
|
||||
namespace PSC\Component\ApiBundle\Model;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Version
|
||||
{
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $datum = "";
|
||||
/**
|
||||
* @OA\Property(type="string", maxLength=255)
|
||||
*/
|
||||
|
||||
#[Property(type: 'string', maxLength: 255)]
|
||||
public string $release = "";
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
psc_component_api_system:
|
||||
resource: "@PSCComponentApiBundle/Api"
|
||||
prefix: /api
|
||||
type: annotation
|
||||
type: attribute
|
||||
|
||||
@ -5,7 +5,3 @@ services:
|
||||
|
||||
PSC\Component\ApiBundle\:
|
||||
resource: '../../*/*'
|
||||
|
||||
PSC\Component\ApiBundle\Converter\RequestBody:
|
||||
tags:
|
||||
- { name: request.param_converter, converter: "psc_rest.request_body" }
|
||||
|
||||
@ -26,8 +26,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
|
||||
/**
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
namespace PSC\Component\SteplayouterBundle\Calendar\Type;
|
||||
|
||||
use PSC\Component\SteplayouterBundle\Calendar\Type;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
/**
|
||||
* DefaultController fürs ProductionBundle
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
namespace PSC\Component\SteplayouterBundle\Calendar\Type;
|
||||
|
||||
use PSC\Component\SteplayouterBundle\Calendar\Type;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class Hochvariable extends Type
|
||||
{
|
||||
|
||||
@ -14,9 +14,9 @@
|
||||
namespace PSC\Component\SteplayouterBundle\Calendar\Type;
|
||||
|
||||
use PSC\Component\SteplayouterBundle\Calendar\Type;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
/**
|
||||
* DefaultController fürs ProductionBundle
|
||||
|
||||
@ -21,28 +21,14 @@ class PrintPdfCommand extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('component:steplayouter:pdf:print')
|
||||
$this->setName('component:steplayouter:pdf:print')
|
||||
->setDescription('Create Print PDF')
|
||||
->addArgument(
|
||||
'outputDir',
|
||||
InputArgument::REQUIRED,
|
||||
'Layouter Id'
|
||||
)
|
||||
->addArgument(
|
||||
'layouterUid',
|
||||
InputArgument::REQUIRED,
|
||||
'Layouter Id'
|
||||
)
|
||||
->addArgument(
|
||||
'aliasUid',
|
||||
InputArgument::REQUIRED,
|
||||
'Alias Id'
|
||||
)
|
||||
;
|
||||
->addArgument('outputDir', InputArgument::REQUIRED, 'Layouter Id')
|
||||
->addArgument('layouterUid', InputArgument::REQUIRED, 'Layouter Id')
|
||||
->addArgument('aliasUid', InputArgument::REQUIRED, 'Alias Id');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$layouter_uuid = $input->getArgument('layouterUid');
|
||||
$outfilename = $input->getArgument('outputDir');
|
||||
@ -52,5 +38,7 @@ class PrintPdfCommand extends Command
|
||||
$pdfService = $this->getContainer()->get('psc.component.steplayouter.pdf');
|
||||
|
||||
$pdfService->create($outfilename, $layouter_uuid, $aliasUid);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,11 +18,11 @@ use PSC\Component\SteplayouterBundle\Calendar\Type\Quer;
|
||||
use PSC\Component\SteplayouterBundle\Calendar\Type\Hoch;
|
||||
use PSC\Component\SteplayouterBundle\Calendar\Design;
|
||||
use PSC\Component\SteplayouterBundle\Calendar\Generator;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
/**
|
||||
* CalendarController fürs SteplayouterBundle
|
||||
|
||||
@ -13,9 +13,9 @@
|
||||
|
||||
namespace PSC\Component\SteplayouterBundle\Controller;
|
||||
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
||||
/**
|
||||
@ -33,7 +33,7 @@ class DefaultController extends AbstractController
|
||||
* @return View
|
||||
*/
|
||||
#[Route(path: '/component/steplayouter', name: 'component_steplayouter')]
|
||||
#[Template]
|
||||
#[Template('@PSCComponentSteplayouter/default/index.html.twig')]
|
||||
public function indexAction()
|
||||
{
|
||||
return array('stylePath' => '{{stylePath}}');
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -23,8 +23,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
use PSC\Component\SteplayouterBundle\Config\Converter\ToArray;
|
||||
|
||||
|
||||
@ -25,8 +25,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Translation\Exception\NotFoundResourceException;
|
||||
|
||||
/**
|
||||
|
||||
@ -24,9 +24,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormError;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
@ -45,8 +45,8 @@ class CheckController extends AbstractController
|
||||
* @return View
|
||||
*/
|
||||
#[Route(path: '/check/index', name: 'psc_component_steplayouter_system_check_index')]
|
||||
#[Template]
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[Template('@PSCComponentSteplayouter/system/check/index.html.twig')]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
public function indexAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, EntityManagerInterface $entityManager)
|
||||
{
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */
|
||||
|
||||
@ -24,9 +24,9 @@ use Symfony\Component\Form\FormError;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Security\Core\SecurityContext;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
@ -49,8 +49,8 @@ class SettingsController extends AbstractController
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Route(path: '/settings/index', name: 'psc_component_steplayouter_system_settings_index')]
|
||||
#[Template]
|
||||
#[Security("is_granted('ROLE_SHOP')")]
|
||||
#[Template('@PSCComponentSteplayouter/system/settings/index.html.twig')]
|
||||
#[IsGranted('ROLE_SHOP')]
|
||||
public function indexAction(Request $request, \PSC\System\SettingsBundle\Service\Shop $shopService, DocumentManager $documentManager)
|
||||
{
|
||||
/** @var \PSC\Shop\EntityBundle\Entity\Shop $selectedShop */
|
||||
|
||||
@ -2,8 +2,6 @@ services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
bind:
|
||||
$pdflib_lic: 'L900202-010091-135115-PPD3D2-EHE432'
|
||||
|
||||
PSC\Component\SteplayouterBundle\:
|
||||
resource: '../../*/*'
|
||||
@ -15,27 +13,3 @@ services:
|
||||
PSC\Component\SteplayouterBundle\Queue\Render:
|
||||
tags:
|
||||
- { name: queues }
|
||||
|
||||
# tp.component.steplayouter.upload_listener:
|
||||
# class: PSC\Component\SteplayouterBundle\EventListener\PostUploadListener
|
||||
# tags:
|
||||
# - { name: kernel.event_listener, event: oneup_uploader.post_upload, method: postUpload }
|
||||
# arguments: ['@doctrine']
|
||||
#
|
||||
# psc.component.steplayouter.calendargenerator:
|
||||
# class: PSC\Component\SteplayouterBundle\Calendar\Generator
|
||||
# arguments: ['@service_container']
|
||||
#
|
||||
# psc.component.steplayouter.configure_menu_listener:
|
||||
# class: PSC\Component\SteplayouterBundle\EventListener\ConfigureMenuListener
|
||||
# tags:
|
||||
# - { name: kernel.event_listener, event: psc.backend.system, method: onMenuConfigureSystem }
|
||||
#
|
||||
# psc.component.steplayouter.pdf:
|
||||
# class: PSC\Component\SteplayouterBundle\Service\Pdf
|
||||
# arguments: ['@doctrine.orm.entity_manager', '%pdflib_lic%', '@kernel', '@psc.component.steplayouter.converter.toArray', '@doctrine_mongodb', '@service_container']
|
||||
#
|
||||
# psc.component.steplayouter.converter.toArray:
|
||||
# class: PSC\Component\SteplayouterBundle\Config\Converter\ToArray
|
||||
# arguments: ['@PSC\\System\\SettingsBundle\\Service\\Color', '@security.authorization_checker', '@security.token_storage', '@doctrine_mongodb']
|
||||
#
|
||||
|
||||
@ -24,28 +24,31 @@ use Twig\Environment;
|
||||
class Pdf
|
||||
{
|
||||
protected $entityManager;
|
||||
protected $pdf_lic;
|
||||
protected $kernel;
|
||||
protected $mongoDb;
|
||||
protected $converter;
|
||||
protected $twig;
|
||||
|
||||
public function __construct(EntityManagerInterface $em, $pdflib_lic, KernelInterface $kernel, ToArray $converter, DocumentManager $mongoDb, Environment $twig)
|
||||
{
|
||||
public function __construct(
|
||||
EntityManagerInterface $em,
|
||||
KernelInterface $kernel,
|
||||
ToArray $converter,
|
||||
DocumentManager $mongoDb,
|
||||
Environment $twig,
|
||||
) {
|
||||
$this->entityManager = $em;
|
||||
$this->pdf_lic = $pdflib_lic;
|
||||
$this->kernel = $kernel;
|
||||
$this->converter = $converter;
|
||||
$this->mongoDb = $mongoDb;
|
||||
$this->twig = $twig;
|
||||
}
|
||||
|
||||
public function create($outfilename, $layouter_uuid, $alias = "")
|
||||
public function create($outfilename, $layouter_uuid, $alias = '')
|
||||
{
|
||||
|
||||
/** @var Layoutdesigndata $layoutData */
|
||||
$layoutData = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')->findOneBy(array('uuid' => $layouter_uuid));
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Layoutdesigndata')
|
||||
->findOneBy(['uuid' => $layouter_uuid]);
|
||||
|
||||
if (!$layoutData) {
|
||||
return;
|
||||
@ -58,32 +61,16 @@ class Pdf
|
||||
$dynamicSizeHeight = $layoutData->getDynamicHeight();
|
||||
|
||||
if (empty($datatable)) {
|
||||
$datatable[] = array();
|
||||
$datatable[] = [];
|
||||
}
|
||||
|
||||
$product = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')->findOneBy(array('uuid' => $layoutData->getArticleUuid()));
|
||||
|
||||
$p = new \PDFlib();
|
||||
$p->set_option("errorpolicy=return");
|
||||
$p->set_option("stringformat=utf8");
|
||||
if ($this->pdf_lic && $this->pdf_lic != "") {
|
||||
@$p->set_parameter("license", $this->pdf_lic);
|
||||
}
|
||||
$p->set_option("SearchPath=" . $this->kernel->getProjectDir() . "/assets/fonts");
|
||||
|
||||
|
||||
|
||||
if ($p->begin_document($outfilename, "") == 0) {
|
||||
die("Error: " . $p->get_errmsg());
|
||||
}
|
||||
|
||||
$p->set_info("Creator", "PDFlib starter sample");
|
||||
$p->set_info("Title", "starter_path");
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Product')
|
||||
->findOneBy(['uuid' => $layoutData->getArticleUuid()]);
|
||||
|
||||
$dataArray = $this->converter->fromXml($product);
|
||||
|
||||
$tempFiles = array();
|
||||
$tempFiles = [];
|
||||
|
||||
foreach ($datatable as $row) {
|
||||
$pageOpen = false;
|
||||
@ -94,306 +81,75 @@ class Pdf
|
||||
continue;
|
||||
}
|
||||
|
||||
$svgContent = $this->utf8_for_xml($site['fabricSVG']);
|
||||
$svg = $this->utf8_for_xml($site['fabricSVG']);
|
||||
|
||||
if ($dynamicSize) {
|
||||
$site['width'] = $dynamicSizeWidth;
|
||||
$site['height'] = $dynamicSizeHeight;
|
||||
}
|
||||
|
||||
$xml = simplexml_load_string($svgContent);
|
||||
$tps = $xml->xpath('//*[string(@templatePrintBinding)]');
|
||||
|
||||
foreach ($tps as $tp) {
|
||||
$tp->{0} = $tp['templatePrintBinding'];
|
||||
}
|
||||
$svgContent = $xml->asXML();
|
||||
preg_match_all('/(image|xlink:href)=(")[^">]+/i', $svgContent, $media);
|
||||
$urls = preg_replace('/(image|xlink:href)("|=")(.*)/i', "$3", $media[0]);
|
||||
preg_match_all('/(image|xlink:href)=(")[^">]+/i', $svg, $media);
|
||||
$urls = preg_replace('/(image|xlink:href)("|=")(.*)/i', '$3', $media[0]);
|
||||
$cal = false;
|
||||
foreach ($urls as $url) {
|
||||
$matches = array();
|
||||
$matches = [];
|
||||
|
||||
$found = preg_match("/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/", $url, $matches);
|
||||
$found = preg_match(
|
||||
'/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/',
|
||||
$url,
|
||||
$matches,
|
||||
);
|
||||
|
||||
if ($found == 0) {
|
||||
$found = preg_match("/[a-fA-F0-9]{4}-[a-fA-F0-9]{8}-[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{8}/", $url, $matches);
|
||||
$found = preg_match(
|
||||
'/[a-fA-F0-9]{4}-[a-fA-F0-9]{8}-[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{8}/',
|
||||
$url,
|
||||
$matches,
|
||||
);
|
||||
}
|
||||
if ($found == 0) {
|
||||
$found = preg_match("/\/[a-fA-F0-9]{24}/", $url, $matches);
|
||||
if (isset($matches[0])) {
|
||||
$matches[0] = str_replace("/", "", $matches[0]);
|
||||
$matches[0] = str_replace('/', '', $matches[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($found) {
|
||||
$motiv = $this->mongoDb
|
||||
->getRepository(Motiv::class)
|
||||
->find($matches[0]);
|
||||
$motiv = $this->mongoDb->getRepository(Motiv::class)->find($matches[0]);
|
||||
|
||||
if (!$motiv) {
|
||||
$motiv = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Motiv')->findOneByUuid($matches[0]);
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Motiv')
|
||||
->findOneByUuid($matches[0]);
|
||||
}
|
||||
if ($motiv) {
|
||||
$svgContent = str_replace($url, "../market/motive/" . $motiv->getFileOrginal(), $svgContent);
|
||||
$svg = str_replace($url, '/data/www/old/market/motive/' . $motiv->getFileOrginal(), $svg);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ($found == 0) {
|
||||
$found = preg_match("/calendar\/render\/[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,4}\/[0-9]{1,6}\/[0-9]{1,6}\/[0-9]{1,3}\/[0-9]{1,3}\/[a-fA-F0-9]{6}\/[a-fA-F0-9]{6}\/[a-fA-F0-9]{6}\/[a-fA-F0-9]{1}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/.{1,40}/", $url, $matches);
|
||||
} elseif ($found == 0) {
|
||||
$found = preg_match("/calendar\/render\/[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,4}\/[0-9]{1,6}\/[0-9]{1,6}\/[0-9]{1,3}\/[0-9]{1,3}\/[a-fA-F0-9]{6}\/[a-fA-F0-9]{6}\/[a-fA-F0-9]{6}\/[a-fA-F0-9]{1}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}\/[0-9]{1,3}/", $url, $matches);
|
||||
}
|
||||
|
||||
if ($found) {
|
||||
$matches = explode("/", $matches[0]);
|
||||
$template = $this->twig->createTemplate($svg);
|
||||
$svg = $template->render([
|
||||
'row' => $row,
|
||||
]);
|
||||
$tmpSvg = tempnam(sys_get_temp_dir(), 'svg_') . '.svg';
|
||||
$tmpPdf = tempnam(sys_get_temp_dir(), 'pdf_') . '.pdf';
|
||||
file_put_contents($tmpSvg, $svg);
|
||||
$cmd =
|
||||
'cairosvg ' . escapeshellarg($tmpSvg) . ' -f pdf -o ' . escapeshellarg($tmpPdf) . ' --unsafe 2>&1';
|
||||
exec($cmd, $output, $ret);
|
||||
|
||||
$calendarDesign = new Design();
|
||||
unlink($tmpSvg);
|
||||
|
||||
switch ($matches[2]) {
|
||||
case 4:
|
||||
$calendarType = new Hoch($this->container);
|
||||
$calendarDesign->setHeight($matches[6]);
|
||||
break;
|
||||
case 8:
|
||||
$calendarType = new Hochvariable($this->container);
|
||||
$calendarDesign->setHeight($matches[6]);
|
||||
break;
|
||||
case 7:
|
||||
default:
|
||||
$calendarType = new Quer($this->container);
|
||||
}
|
||||
|
||||
$calendarDesign->setRenderMonth($matches[3]);
|
||||
$calendarDesign->setStartYear($matches[4]);
|
||||
$calendarDesign->setWidth($matches[5]);
|
||||
$calendarDesign->setMonthSize($matches[7]);
|
||||
$calendarDesign->setDaySize($matches[8]);
|
||||
$calendarDesign->setMonthColor('#' . $matches[9]);
|
||||
$calendarDesign->setDayColor('#' . $matches[10]);
|
||||
$calendarDesign->setSunColor('#' . $matches[11]);
|
||||
$calendarDesign->setDisplayYear($matches[12]);
|
||||
$calendarDesign->setDisplayHeightMounthCal($matches[13]);
|
||||
$calendarDesign->setDisplayMarginCal($matches[14]);
|
||||
$calendarDesign->setCalendarX($matches[15]);
|
||||
$calendarDesign->setCalendarY($matches[16]);
|
||||
$calendarDesign->setYearX($matches[17]);
|
||||
$calendarDesign->setYearY($matches[18]);
|
||||
$calendarDesign->setCalendarWidth($matches[19]);
|
||||
$calendarDesign->setCalendarHeight($matches[20]);
|
||||
$calendarDesign->setMonthX($matches[21]);
|
||||
$calendarDesign->setMonthY($matches[22]);
|
||||
$calendarDesign->setYearSize($matches[23]);
|
||||
if (isset($matches[24])) {
|
||||
$calendarDesign->setFontFamily(urldecode($matches[24]));
|
||||
}
|
||||
$calendarType->setDesign($calendarDesign);
|
||||
$calendarGenerator = new Generator();
|
||||
$calendarGenerator->setType($calendarType);
|
||||
$cal = $calendarGenerator->render();
|
||||
|
||||
//$svgContent = preg_replace('/<image.*calendar.+<\/image>/', $cal, $svgContent);
|
||||
$svgContent = str_replace($url, $cal, $svgContent);
|
||||
$tempFiles[] = $tmpPdf;
|
||||
}
|
||||
}
|
||||
|
||||
$template = $this->twig->createTemplate($svgContent);
|
||||
$svgContent = $template->render(array(
|
||||
'row' => $row
|
||||
));
|
||||
file_put_contents($this->kernel->getProjectDir() . "/web/temp/" . $layouter_uuid . '_' . $key . ".svg", $svgContent);
|
||||
|
||||
$width = $site['width'] + $dataArray['sites'][$key + 1]['trimLeft'] + $dataArray['sites'][$key + 1]['trimRight'];
|
||||
$height = $site['height'] + $dataArray['sites'][$key + 1]['trimTop'] + $dataArray['sites'][$key + 1]['trimBottom'];
|
||||
|
||||
if (isset($dataArray['pdfPrintMerge']['sites']) && $key == 0) {
|
||||
$p->begin_page_ext(0, 0, "width=" . $dataArray['pdfPrintMerge']['width'] . " height=" . $dataArray['pdfPrintMerge']['height']);
|
||||
$pageOpen = true;
|
||||
} elseif (isset($dataArray['pdfPrintMerge']['sites']) && $key > 0 && in_array($key + 1, $dataArray['pdfPrintMerge']['sites'])) {
|
||||
} else {
|
||||
$p->begin_page_ext(0, 0, "width=" . $width . " height=" . $height . " trimbox={" . $dataArray['sites'][$key + 1]['trimLeft'] . " "
|
||||
. $dataArray['sites'][$key + 1]['trimTop'] . " " . ($site['width'] + $dataArray['sites'][$key + 1]['trimLeft']) . " " . ($site['height'] + $dataArray['sites'][$key + 1]['trimTop']) . "}");
|
||||
$pageOpen = true;
|
||||
}
|
||||
|
||||
$graphics = $p->load_graphics("auto", $this->kernel->getProjectDir() . "/web/temp/" . $layouter_uuid . '_' . $key . ".svg", "");
|
||||
|
||||
$optlist = "boxsize={" . $width . " " . $height . "} position={top left} fitmethod=meet";
|
||||
|
||||
if ($p->info_graphics($graphics, "fittingpossible", $optlist) == 1) {
|
||||
if (isset($dataArray['pdfPrintMerge']['sites']) && in_array($key + 1, $dataArray['pdfPrintMerge']['sites'])) {
|
||||
if ($dataArray['sites'][$key + 1]['clipBox']) {
|
||||
$clipBox = explode(" ", $dataArray['sites'][$key + 1]['clipBox']);
|
||||
$p->save();
|
||||
$p->rect($dataArray['sites'][$key + 1]['mergePosX'] + $clipBox[0], $dataArray['sites'][$key + 1]['mergePosY'] + $clipBox[1], $clipBox[2], $clipBox[3]);
|
||||
$p->clip();
|
||||
}
|
||||
$p->fit_graphics($graphics, $dataArray['sites'][$key + 1]['mergePosX'], $dataArray['sites'][$key + 1]['mergePosY'], $optlist);
|
||||
if ($dataArray['sites'][$key + 1]['clipBox']) {
|
||||
$p->restore();
|
||||
}
|
||||
} else {
|
||||
$p->fit_graphics($graphics, 0, 0, $optlist);
|
||||
}
|
||||
}
|
||||
$p->close_graphics($graphics);
|
||||
$p->end_layer();
|
||||
|
||||
if ($cal) {
|
||||
$indocCal = $p->open_pdi_document($cal, "");
|
||||
if ($indocCal == 0) {
|
||||
throw new \Exception("Error: " . $p->get_errmsg());
|
||||
}
|
||||
|
||||
$pageCal = $p->open_pdi_page($indocCal, 1, "");
|
||||
if ($pageCal == 0) {
|
||||
throw new \Exception("Error: " . $p->get_errmsg());
|
||||
}
|
||||
|
||||
$layerCal = $p->define_layer("cal", "");
|
||||
$p->begin_layer($layerCal);
|
||||
|
||||
$p->fit_pdi_page($pageCal, $dataArray['sites'][$key + 1]['calendar']['x'] + $dataArray['sites'][$key + 1]['trimLeft'], $dataArray['sites'][$key + 1]['trimBottom'] + $site['height'] - $dataArray['sites'][$key + 1]['calendar']['y'] - $dataArray['sites'][$key + 1]['calendar']['height'], "");
|
||||
|
||||
$p->close_pdi_page($pageCal);
|
||||
|
||||
$p->end_layer();
|
||||
}
|
||||
|
||||
if ($dataArray['sites'][$key + 1]['elements']) {
|
||||
foreach ($dataArray['sites'][$key + 1]['elements'] as $element) {
|
||||
if ($element['type'] == "stanze") {
|
||||
$stanze = $this->mongoDb
|
||||
->getRepository(Motiv::class)
|
||||
->find($element['value']);
|
||||
|
||||
if (!$stanze) {
|
||||
$stanze = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Motiv')->findOneByUuid($element['value']);
|
||||
}
|
||||
|
||||
$indocStanze = $p->open_pdi_document($this->kernel->getProjectDir() . "/web/market/motive/" . $stanze->getFileOrginal(), "");
|
||||
if ($indocStanze == 0) {
|
||||
throw new \Exception("Error: " . $p->get_errmsg());
|
||||
}
|
||||
|
||||
$pageStanze = $p->open_pdi_page($indocStanze, 1, "");
|
||||
if ($pageStanze == 0) {
|
||||
throw new \Exception("Error: " . $p->get_errmsg());
|
||||
}
|
||||
|
||||
$layerStanze = $p->define_layer("stanze", "");
|
||||
$p->begin_layer($layerStanze);
|
||||
|
||||
/* Place the imported page on the German layer of the output page */
|
||||
if (isset($dataArray['pdfPrintMerge']['sites']) && in_array($key + 1, $dataArray['pdfPrintMerge']['sites'])) {
|
||||
$p->fit_pdi_page($pageStanze, $dataArray['sites'][$key + 1]['mergePosX'] + $element['x'], $dataArray['sites'][$key + 1]['mergePosY'] + $element['y'], "");
|
||||
} else {
|
||||
$p->fit_pdi_page($pageStanze, 0, 0, "");
|
||||
}
|
||||
|
||||
$p->close_pdi_page($pageStanze);
|
||||
|
||||
$p->end_layer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($dataArray['sites'][$key + 1]['elements']) {
|
||||
foreach ($dataArray['sites'][$key + 1]['elements'] as $element) {
|
||||
if ($element['type'] == "barcode") {
|
||||
$barcodefont = $p->load_font("fre3of9x", "unicode", "embedding");
|
||||
$font = $p->load_font("Verdana", "unicode", "");
|
||||
if ($barcodefont == 0) {
|
||||
throw new Exception("Error: " . $p->get_errmsg());
|
||||
}
|
||||
|
||||
if (isset($dataArray['pdfPrintMerge']['sites']) && in_array($key + 1, $dataArray['pdfPrintMerge']['sites'])) {
|
||||
$p->fit_textline($alias, $dataArray['sites'][$key + 1]['mergePosX'] + $element['x'], $dataArray['sites'][$key + 1]['mergePosY'] + $element['y'], "font=" . $barcodefont .
|
||||
" rotate=90 fontsize=" . $element['fontSize']);
|
||||
$p->fit_textline($alias, $dataArray['sites'][$key + 1]['mergePosX'] + $element['x'] + 10, $dataArray['sites'][$key + 1]['mergePosY'] + $element['y'], "font=" . $font .
|
||||
" rotate=90 fontsize=10");
|
||||
} else {
|
||||
$p->fit_textline($alias, $element['x'], $element['y'], "font=" . $barcodefont .
|
||||
" rotate=" . $element['rotate'] . " fontsize=" . $element['fontSize'] . " " .
|
||||
"fillcolor={black 1} " .
|
||||
"matchbox={fillcolor={white 1} " .
|
||||
"boxheight={ascender descender} " .
|
||||
"offsetleft=-8 offsetright=8 offsettop=8 offsetbottom=-12}");
|
||||
if (isset($element['addTextX'])) {
|
||||
$p->fit_textline($alias, $element['x'], $element['y'] - 12, "font=" . $font .
|
||||
" rotate=" . $element['rotate'] . " fontsize=10 " .
|
||||
"fillcolor={black 1} " .
|
||||
"matchbox={fillcolor={white 1} " .
|
||||
"boxheight={ascender descender} " .
|
||||
"offsetleft=-8 offsetright=8 offsettop=0 offsetbottom=0}");
|
||||
$p->fit_textline($element['addText'], $element['addTextX'], $element['addTextY'], "font=" . $font .
|
||||
" rotate=" . $element['rotate'] . " fontsize=10 " .
|
||||
"fillcolor={black 1} " .
|
||||
"matchbox={fillcolor={white 1} " .
|
||||
"boxheight={ascender descender} " .
|
||||
"offsetleft=-8 offsetright=8 offsettop=0 offsetbottom=0}");
|
||||
} else {
|
||||
$p->fit_textline($alias . $element['addText'], $element['x'], $element['y'] - 12, "font=" . $font .
|
||||
" rotate=" . $element['rotate'] . " fontsize=10 " .
|
||||
"fillcolor={black 1} " .
|
||||
"matchbox={fillcolor={white 1} " .
|
||||
"boxheight={ascender descender} " .
|
||||
"offsetleft=-8 offsetright=8 offsettop=0 offsetbottom=0}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$dataArray['pdfPrintMerge']) {
|
||||
$p->end_page_ext("");
|
||||
$pageOpen = false;
|
||||
} elseif (isset($dataArray['pdfPrintMerge']['sites']) && $key > 0 && !in_array($key + 1, $dataArray['pdfPrintMerge']['sites'])) {
|
||||
$p->end_page_ext("");
|
||||
$pageOpen = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($pageOpen) {
|
||||
if (isset($dataArray['pdfPrintMerge']['stanze'])) {
|
||||
$stanze = $this->mongoDb
|
||||
->getRepository(Motiv::class)
|
||||
->find((string)$dataArray['pdfPrintMerge']['stanze']);
|
||||
|
||||
if (!$stanze) {
|
||||
$stanze = $this->entityManager
|
||||
->getRepository('PSC\Shop\EntityBundle\Entity\Motiv')->findOneByUuid((string)$dataArray['pdfPrintMerge']['stanze']);
|
||||
}
|
||||
|
||||
$indocStanze = $p->open_pdi_document($this->kernel->getProjectDir() . "/web/market/motive/" . $stanze->getFileOrginal(), "");
|
||||
if ($indocStanze == 0) {
|
||||
throw new \Exception("Error: " . $p->get_errmsg());
|
||||
}
|
||||
|
||||
$pageStanze = $p->open_pdi_page($indocStanze, 1, "");
|
||||
if ($pageStanze == 0) {
|
||||
throw new \Exception("Error: " . $p->get_errmsg());
|
||||
}
|
||||
|
||||
$layerStanze = $p->define_layer("stanze", "");
|
||||
$p->begin_layer($layerStanze);
|
||||
|
||||
/* Place the imported page on the German layer of the output page */
|
||||
$p->fit_pdi_page($pageStanze, 0, 0, "");
|
||||
|
||||
$p->close_pdi_page($pageStanze);
|
||||
|
||||
$p->end_layer();
|
||||
}
|
||||
|
||||
$p->end_page_ext("");
|
||||
}
|
||||
}
|
||||
|
||||
$p->end_document("");
|
||||
$allPdfs = implode(' ', array_map('escapeshellarg', $tempFiles));
|
||||
|
||||
$cmd = 'pdfunite ' . $allPdfs . ' ' . escapeshellarg($outfilename) . ' 2>&1';
|
||||
exec($cmd, $out, $ret);
|
||||
|
||||
foreach ($tempFiles as $file) {
|
||||
unlink($file);
|
||||
|
||||
@ -8,7 +8,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class PSCLibrariesAutoRegistryBundle extends Bundle
|
||||
{
|
||||
public function build(ContainerBuilder $container)
|
||||
public function build(ContainerBuilder $container): void
|
||||
{
|
||||
parent::build($container);
|
||||
$container->addCompilerPass(new AutoRegistryCompilerPass());
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace PSC\Libraries\DoctrineBundle\DBAL\Platform;
|
||||
|
||||
use Doctrine\DBAL\Platforms\MariaDBPlatform as BaseMariaDBPlatform;
|
||||
|
||||
/**
|
||||
* Custom MariaDB Platform to support all MariaDB versions
|
||||
*/
|
||||
class MariaDBPlatform extends BaseMariaDBPlatform
|
||||
{
|
||||
// This class extends the base MariaDB platform
|
||||
// and can be used to add custom functionality if needed
|
||||
}
|
||||
@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
|
||||
@ -30,9 +30,9 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\Security\Core\SecurityContext;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
@ -70,7 +70,7 @@ class EditController extends AbstractController
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Route(path: '/edit/create', name: 'psc_shop_account_backend_create')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopAccount/backend/edit/create.html.twig')]
|
||||
public function createAction(
|
||||
Request $request,
|
||||
Field $fieldService,
|
||||
@ -145,7 +145,7 @@ class EditController extends AbstractController
|
||||
* @throws \Doctrine\ODM\MongoDB\MongoDBException
|
||||
*/
|
||||
#[Route(path: '/edit/edit/{uuid}', name: 'psc_shop_account_backend_edit')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopAccount/backend/edit/edit.html.twig')]
|
||||
public function editAction(
|
||||
Request $request,
|
||||
Field $fieldService,
|
||||
|
||||
@ -16,7 +16,7 @@ namespace PSC\Shop\AccountBundle\Controller\Backend;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface;
|
||||
use Spiriit\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface;
|
||||
use PSC\Shop\AccountBundle\Form\Backend\SearchType;
|
||||
use PSC\Shop\EntityBundle\Entity\Motiv;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
@ -26,9 +26,9 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\Security\Core\SecurityContext;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Bridge\Twig\Attribute\Template;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
@ -53,9 +53,9 @@ class ListController extends AbstractController
|
||||
* @return array
|
||||
* @throws \Doctrine\ORM\ORMException
|
||||
*/
|
||||
#[Security("is_granted('ROLE_ADMIN')")]
|
||||
#[IsGranted('ROLE_ADMIN')]
|
||||
#[Route(path: '/list/index', name: 'psc_shop_account_backend_list')]
|
||||
#[Template]
|
||||
#[Template('@PSCShopAccount/backend/list/index.html.twig')]
|
||||
public function indexAction(Request $request, Shop $shopService, EntityManagerInterface $entityManager, PaginatorInterface $paginator, FilterBuilderUpdaterInterface $filterBuilderUpdater, SessionInterface $session)
|
||||
{
|
||||
|
||||
|
||||
@ -3,15 +3,13 @@
|
||||
namespace PSC\Shop\AccountBundle\Dto\All;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
use OpenApi\Attributes\Items;
|
||||
use PSC\Shop\ContactBundle\Model\Contact;
|
||||
|
||||
class Output
|
||||
{
|
||||
/**
|
||||
* @var Contact[]
|
||||
*
|
||||
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\AccountBundle\Model\Account::class)))
|
||||
*/
|
||||
#[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\AccountBundle\Model\Account::class)))]
|
||||
public array $data = [];
|
||||
}
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
|
||||
namespace PSC\Shop\AccountBundle\Form\Backend;
|
||||
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
|
||||
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
||||
use Spiriit\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
|
||||
use Spiriit\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
|
||||
use PSC\System\SettingsBundle\Service\Shop;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
@ -3,33 +3,24 @@
|
||||
namespace PSC\Shop\AccountBundle\Model;
|
||||
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Annotations as OA;
|
||||
use OpenApi\Attributes as OA;
|
||||
use OpenApi\Attributes\Property;
|
||||
|
||||
class Account
|
||||
{
|
||||
/**
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
private int $id = 0;
|
||||
|
||||
/**
|
||||
* @OA\Property(type="integer")
|
||||
*/
|
||||
#[Property(type: 'integer')]
|
||||
private int $uid = 0;
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
private string $uuid = "";
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
private string $appendix;
|
||||
|
||||
/**
|
||||
* @OA\Property(type="string")
|
||||
*/
|
||||
#[Property(type: 'string')]
|
||||
private string $title;
|
||||
|
||||
public function getUuid(): string
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
psc_shop_account_backend:
|
||||
resource: "@PSCShopAccountBundle/Controller/Backend"
|
||||
type: annotation
|
||||
type: attribute
|
||||
prefix: /backend/account
|
||||
|
||||
psc_shop_account_api:
|
||||
resource: "@PSCShopAccountBundle/Api"
|
||||
type: annotation
|
||||
type: attribute
|
||||
prefix: /api/account
|
||||
@ -3,9 +3,11 @@
|
||||
namespace PSC\Shop\BasketBundle\Api\Basket\Legacy;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Input;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Output;
|
||||
@ -13,40 +15,30 @@ use PSC\Shop\BasketBundle\Event\Legacy\Add as PSCAdd;
|
||||
use PSC\Shop\EntityBundle\Entity\Product;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
class Add extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EventDispatcherInterface $eventDispatcher, private readonly TokenStorageInterface $tokenStorage)
|
||||
{
|
||||
}
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly TokenStorageInterface $tokenStorage,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* change temp basketitem
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="basket",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Output::class))
|
||||
* )
|
||||
* @OA\RequestBody(
|
||||
* description="This is a request body",
|
||||
* @Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Input::class))
|
||||
* )
|
||||
* @OA\Tag(name="Basket")
|
||||
*/
|
||||
#[Tag(name: 'Basket')]
|
||||
#[Response(response: 200, description: 'basket', content: new JsonContent(ref: new Model(type: Output::class)))]
|
||||
#[RequestBody(description: 'This is a request body', content: new Model(type: Input::class))]
|
||||
#[Route(path: '/legacy/add', methods: ['POST'])]
|
||||
#[ParamConverter('data', class: '\PSC\Shop\BasketBundle\Dto\Legacy\Input', converter: 'psc_rest.request_body')]
|
||||
public function add(Input $data): JsonResponse
|
||||
public function add(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php';
|
||||
include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php';
|
||||
@ -60,25 +52,24 @@ class Add extends AbstractController
|
||||
$this->eventDispatcher->dispatch($event, PSCAdd::NAME);
|
||||
}
|
||||
|
||||
|
||||
$articles = $_SESSION['Basket']['Articles'];
|
||||
/**
|
||||
* @var \TP_Basket_Item $basketItem
|
||||
*/
|
||||
$basketItem = clone($_SESSION['Basket']['TempProduct'][$data->productUUId]);
|
||||
$basketItem = clone $_SESSION['Basket']['TempProduct'][$data->productUUId];
|
||||
$basketItem->setDeliveryDate((string) $data->deliveryDate);
|
||||
$basketItem->setDeliveryInfo((string) $data->deliveryInfo);
|
||||
if ((string)$data->ref != "") {
|
||||
if (((string) $data->ref) != '') {
|
||||
$basketItem->setRef($data->ref);
|
||||
}
|
||||
if ((string)$data->basketField1 != "") {
|
||||
if (((string) $data->basketField1) != '') {
|
||||
$basketItem->setRef($data->basketField1);
|
||||
}
|
||||
if ((string)$data->basketField2 != "") {
|
||||
if (((string) $data->basketField2) != '') {
|
||||
$basketItem->setKst($data->basketField2);
|
||||
}
|
||||
$basketItem->setXmlProduct((string) $data->xmlProduct);
|
||||
if ((string)$data->layouterUuid != "") {
|
||||
if (((string) $data->layouterUuid) != '') {
|
||||
$basketItem->setLayouterId((string) $data->layouterUuid);
|
||||
}
|
||||
$itemId = $articles->addItem($basketItem);
|
||||
@ -92,6 +83,6 @@ class Add extends AbstractController
|
||||
return $this->json(new Output());
|
||||
}
|
||||
|
||||
return $this->json(new NotFound("order not found"));
|
||||
return $this->json(new NotFound('order not found'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
namespace PSC\Shop\BasketBundle\Api\Basket\Legacy;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Input;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Output;
|
||||
@ -13,12 +15,11 @@ use PSC\Shop\BasketBundle\Event\Legacy\Temp as PSCTemp;
|
||||
use PSC\Shop\EntityBundle\Entity\Product;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
class Temp extends AbstractController
|
||||
@ -33,27 +34,17 @@ class Temp extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* change temp basketitem
|
||||
* @deprecated
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="basket",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Output::class))
|
||||
* )
|
||||
* @OA\RequestBody(
|
||||
* description="This is a request body",
|
||||
* @Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Input::class))
|
||||
* )
|
||||
* @OA\Tag(name="Basket")
|
||||
*/
|
||||
#[Tag(name: 'Basket')]
|
||||
#[Response(response: 200, description: 'basket', content: new JsonContent(ref: new Model(type: Output::class)))]
|
||||
#[RequestBody(description: 'This is a request body', content: new Model(type: Input::class))]
|
||||
#[Route(path: '/legacy/temp', methods: ['POST'])]
|
||||
#[ParamConverter('data', class: '\PSC\Shop\BasketBundle\Dto\Legacy\Input', converter: 'psc_rest.request_body')]
|
||||
public function temp(Input $data): JsonResponse
|
||||
public function temp(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php');
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php');
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php');
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php';
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php';
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php';
|
||||
|
||||
$product = $this->entityManager->getRepository(Product::class)->findOneBy(['uuid' => $data->productUUId]);
|
||||
|
||||
@ -71,6 +62,6 @@ class Temp extends AbstractController
|
||||
return $this->json(new Output());
|
||||
}
|
||||
|
||||
return $this->json(new NotFound("order not found"));
|
||||
return $this->json(new NotFound('order not found'));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,9 +3,11 @@
|
||||
namespace PSC\Shop\BasketBundle\Api\Basket\Legacy;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use Nelmio\ApiDocBundle\Annotation\Security;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Component\ApiBundle\Dto\Error\NotFound;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Input;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Output;
|
||||
@ -13,12 +15,11 @@ use PSC\Shop\BasketBundle\Event\Legacy\Update as PSCUpdate;
|
||||
use PSC\Shop\EntityBundle\Entity\Product;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
class Update extends AbstractController
|
||||
@ -33,27 +34,17 @@ class Update extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* change temp basketitem
|
||||
* @deprecated
|
||||
*
|
||||
* @OA\Response(
|
||||
* response=200,
|
||||
* description="basket",
|
||||
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Output::class))
|
||||
* )
|
||||
* @OA\RequestBody(
|
||||
* description="This is a request body",
|
||||
* @Model(type=\PSC\Shop\BasketBundle\Dto\Legacy\Input::class))
|
||||
* )
|
||||
* @OA\Tag(name="Basket")
|
||||
*/
|
||||
#[Tag(name: 'Basket')]
|
||||
#[Response(response: 200, description: 'basket', content: new JsonContent(ref: new Model(type: Output::class)))]
|
||||
#[RequestBody(description: 'This is a request body', content: new Model(type: Input::class))]
|
||||
#[Route(path: '/legacy/update', methods: ['POST'])]
|
||||
#[ParamConverter('data', class: '\PSC\Shop\BasketBundle\Dto\Legacy\Input', converter: 'psc_rest.request_body')]
|
||||
public function update(Input $data): JsonResponse
|
||||
public function update(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php');
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php');
|
||||
require_once(__DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php');
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php';
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php';
|
||||
require_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php';
|
||||
|
||||
$product = $this->entityManager->getRepository(Product::class)->findOneBy(['uuid' => $data->productUUId]);
|
||||
|
||||
@ -77,6 +68,6 @@ class Update extends AbstractController
|
||||
return $this->json(new Output());
|
||||
}
|
||||
|
||||
return $this->json(new NotFound("order not found"));
|
||||
return $this->json(new NotFound('order not found'));
|
||||
}
|
||||
}
|
||||
|
||||
91
src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Save.php
Normal file
91
src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Save.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace PSC\Shop\BasketBundle\Api\Layouter;
|
||||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Nelmio\ApiDocBundle\Annotation\Model;
|
||||
use OpenApi\Attributes\JsonContent;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Shop\BasketBundle\Dto\Layouter\Input;
|
||||
use PSC\Shop\BasketBundle\Dto\Legacy\Output;
|
||||
use PSC\Shop\EntityBundle\Entity\LayouterSession;
|
||||
use PSC\Shop\EntityBundle\Repository\LayouterSessionRepository;
|
||||
use PSC\Shop\EntityBundle\Repository\ProductRepository;
|
||||
use Ramsey\Uuid\Nonstandard\Uuid;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
use TP_Layouter_Item;
|
||||
|
||||
class Save extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly LayouterSessionRepository $layouterSessionRepository,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly ProductRepository $productRepository,
|
||||
private readonly TokenStorageInterface $tokenStorage,
|
||||
) {}
|
||||
|
||||
#[Tag(name: 'Basket')]
|
||||
#[Response(response: 200, description: 'basket', content: new JsonContent(ref: new Model(type: Output::class)))]
|
||||
#[RequestBody(description: 'This is a request body', content: new Model(type: Input::class))]
|
||||
#[Route(path: '/layouter/save', methods: ['POST'])]
|
||||
public function save(#[MapRequestPayload] Input $data): JsonResponse
|
||||
{
|
||||
include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Basket_Item.php';
|
||||
include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Basket_Collection.php';
|
||||
include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Util.php';
|
||||
include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Layouter_Item.php';
|
||||
include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Layoutersession.php';
|
||||
|
||||
$product = $this->productRepository->findOneBy(['uuid' => $data->productUUId]);
|
||||
|
||||
if ($this->tokenStorage->getToken()) {
|
||||
$row = new LayouterSession();
|
||||
$row->setUuid(Uuid::uuid4()->toString());
|
||||
$row->setContactId(
|
||||
$this->tokenStorage
|
||||
->getToken()
|
||||
->getUser()
|
||||
->getId(),
|
||||
);
|
||||
$row->setProductId($data->productUUId);
|
||||
$row->setTitle($product->getTitle());
|
||||
$row->setLayouterModus($data->layouterModus);
|
||||
// TODO: Store uploadedFiles in session data
|
||||
$this->entityManager->persist($row);
|
||||
|
||||
return $this->json([
|
||||
'success' => true,
|
||||
'layouterUUId' => $row->getUuid(),
|
||||
'auth' => true,
|
||||
'user' => $this->tokenStorage
|
||||
->getToken()
|
||||
->getUser()
|
||||
->getUsername(),
|
||||
]);
|
||||
}
|
||||
|
||||
$session = new TP_Layouter_Item();
|
||||
$session->setTitle($product->getTitle());
|
||||
$session->setArticleId(Uuid::uuid4()->toString());
|
||||
$session->setOrgArticleId($data->productUUId);
|
||||
$session->setIsEdit(true);
|
||||
$session->setUpdated(date('Y-m-d H:i:s'));
|
||||
$session->setLayouterModus($data->layouterModus);
|
||||
// Store uploaded files in session
|
||||
$_SESSION['Layoutersession']['data'][$session->getArticleId()] = $session;
|
||||
|
||||
return $this->json([
|
||||
'success' => true,
|
||||
'auth' => false,
|
||||
'layouterUUId' => $session->getArticleId(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
91
src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Upload.php
Normal file
91
src/new/src/PSC/Shop/BasketBundle/Api/Layouter/Upload.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace PSC\Shop\BasketBundle\Api\Layouter;
|
||||
|
||||
use Doctrine\ODM\MongoDB\DocumentManager;
|
||||
use Nelmio\ApiDocBundle\Attribute\Security;
|
||||
use OpenApi\Attributes\MediaType;
|
||||
use OpenApi\Attributes\Property;
|
||||
use OpenApi\Attributes\RequestBody;
|
||||
use OpenApi\Attributes\Response;
|
||||
use OpenApi\Attributes\Schema;
|
||||
use OpenApi\Attributes\Tag;
|
||||
use PSC\Shop\MediaBundle\Document\Folder;
|
||||
use PSC\Shop\MediaBundle\Document\Media;
|
||||
use PSC\Shop\MediaBundle\Helper\MediaManager;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class Upload extends AbstractController
|
||||
{
|
||||
#[RequestBody(description: 'PDF file for layouter', content: [
|
||||
new MediaType(
|
||||
'multipart/form-data',
|
||||
new Schema(
|
||||
properties: [
|
||||
new Property(
|
||||
property: 'file',
|
||||
format: 'binary',
|
||||
type: 'file',
|
||||
description: 'PDF file',
|
||||
),
|
||||
new Property(
|
||||
property: 'fileName',
|
||||
type: 'string',
|
||||
description: 'Original file name',
|
||||
),
|
||||
new Property(
|
||||
property: 'folder',
|
||||
type: 'string',
|
||||
description: 'Folder',
|
||||
),
|
||||
],
|
||||
required: ['file'],
|
||||
),
|
||||
),
|
||||
])]
|
||||
#[Response(response: 200, description: 'File uploaded successfully')]
|
||||
#[Response(response: 400, description: 'Bad request - no file provided')]
|
||||
#[Route(path: '/layouter/upload', methods: ['POST'])]
|
||||
#[Tag(name: 'Basket')]
|
||||
public function upload(MediaManager $mediaManager, DocumentManager $documentManager, Request $req): JsonResponse
|
||||
{
|
||||
$file = $req->files->get('file');
|
||||
|
||||
if (!$file) {
|
||||
return $this->json(
|
||||
data: ['error' => 'No file provided'],
|
||||
status: JsonResponse::HTTP_BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
$selectedFolder = $documentManager->getRepository(Folder::class)->findOneBy(['_id' => $req->get('folder')]);
|
||||
|
||||
$handler = $mediaManager->getHandlerForType('pdf');
|
||||
$media = new Media();
|
||||
$media->setContent($file);
|
||||
$media->setFolder($selectedFolder);
|
||||
$handler->prepareMedia($media);
|
||||
|
||||
// Store additional metadata
|
||||
$media->setTitle($req->get('fileName', $file->getClientOriginalName()));
|
||||
|
||||
$documentManager->persist($media);
|
||||
$documentManager->flush();
|
||||
|
||||
return $this->json([
|
||||
'success' => true,
|
||||
'uuid' => $media->getId(),
|
||||
'url' => $media->getUrl(),
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
return $this->json(
|
||||
data: ['error' => 'Upload failed: ' . $e->getMessage()],
|
||||
status: JsonResponse::HTTP_INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user