Skip to content
Code-Schnipsel Gruppen Projekte
Commit bed38475 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

Merge branch 'next' into 'master'

Next

See merge request !16
Übergeordnete 9c68eaca 6822fbda
No related branches found
No related tags found
2 Merge Requests!140Update 'next-4.x' with latest changes from 'main',!16Next
Pipeline #4573 bestanden mit Phase
in 32 Sekunden
werden angezeigt mit 89 Ergänzungen und 77 Löschungen
......@@ -22,7 +22,7 @@
function ($price, $formatted, $vat) {
$price = QUI\ERP\Money\Price::validatePrice($price);
if (empty($vat)) {
if (empty($vat) && !is_numeric($vat)) {
$Area = QUI\ERP\Defaults::getArea();
try {
......
......@@ -13,7 +13,7 @@
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_frontend_showB2BB2CWindow',
function () {
$User = QUI::getUserBySession();
$User = QUI::getUserBySession();
$Package = QUI::getPackage('quiqqer/erp');
// user dont get the window
......
<?php
use QUI\ERP\Manufacturers;
/**
* Get details of manufacturer groups
*
* @return array
*/
use QUI\ERP\Manufacturers;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_manufacturers_create_getGroups',
function () {
......@@ -17,7 +18,7 @@ function () {
$Group = $Groups->get($groupId);
$groups[] = [
'id' => $Group->getId(),
'id' => $Group->getId(),
'name' => $Group->getName()
];
}
......
<?php
use QUI\ERP\Manufacturers;
use QUI\Utils\Security\Orthos;
use QUI\ERP\Exception as ERPException;
/**
* Create a new manufacturer users
*
......@@ -12,11 +8,16 @@
* @param array $groups
* @return integer - New user ID
*/
use QUI\ERP\Exception as ERPException;
use QUI\ERP\Manufacturers;
use QUI\Utils\Security\Orthos;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_manufacturers_create_newManufacturer',
function ($manufacturerId, $address, $groupIds) {
$address = Orthos::clearArray(\json_decode($address, true));
$groupIds = Orthos::clearArray(\json_decode($groupIds, true));
$address = Orthos::clearArray(\json_decode($address, true));
$groupIds = Orthos::clearArray(\json_decode($groupIds, true));
$manufacturerId = Orthos::clear($manufacturerId);
try {
......
<?php
use QUI\ERP\Manufacturers;
/**
* Format a price for the admin
*
* @param string|int|float $value
* @return string
*/
use QUI\ERP\Manufacturers;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_manufacturers_getGroupIds',
function () {
......
<?php
use QUI\Utils\Security\Orthos;
use QUI\Utils\Grid;
use QUI\ERP\Manufacturers;
/**
* Execute the customer search
*
* @return array
*/
use QUI\ERP\Manufacturers;
use QUI\Utils\Grid;
use QUI\Utils\Security\Orthos;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_manufacturers_search',
function ($params) {
$searchParams = Orthos::clearArray(\json_decode($params, true));
$results = Manufacturers::search($searchParams);
$Grid = new Grid($searchParams);
$Grid = new Grid($searchParams);
return $Grid->parseResult(
Manufacturers::parseListForGrid($results),
......
<?php
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Utils\Security\Orthos;
/**
* Returns basic entity data used in OutputDialog
*
......@@ -10,6 +7,10 @@
* @param string $entityType
* @return array|false - Entity data or false
*/
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Utils\Security\Orthos;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_output_getEntityData',
function ($entityId, $entityType) {
......@@ -22,7 +23,7 @@ function ($entityId, $entityType) {
$hideSystemDefaultTemplate = false;
try {
$Conf = QUI::getPackage('quiqqer/erp')->getConfig();
$Conf = QUI::getPackage('quiqqer/erp')->getConfig();
$defaultTemplates = $Conf->get('output', 'default_templates');
if (!empty($defaultTemplates)) {
......@@ -37,7 +38,7 @@ function ($entityId, $entityType) {
}
return [
'email' => $OutputProvider::getEmailAddress(Orthos::clear($entityId)),
'email' => $OutputProvider::getEmailAddress(Orthos::clear($entityId)),
'hideSystemDefaultTemplate' => $hideSystemDefaultTemplate
];
},
......
<?php
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Utils\Security\Orthos;
/**
* Returns e-mail data for an output document
*
* @return array
*/
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Utils\Security\Orthos;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_output_getMailData',
function ($entityId, $entityType) {
$OutputProvider = ERPOutput::getOutputProviderByEntityType(Orthos::clear($entityType));
$mailData = [
$mailData = [
'subject' => '',
'content' => ''
];
......
<?php
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Utils\Security\Orthos;
/**
* Returns the invoice templates
*
* @return array
*/
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Utils\Security\Orthos;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_output_getPreview',
function ($entity, $template) {
$entity = Orthos::clearArray(\json_decode($entity, true));
$entity = Orthos::clearArray(\json_decode($entity, true));
$template = Orthos::clearArray(\json_decode($template, true));
if (!isset($template['provider'])) {
......
<?php
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Utils\Security\Orthos;
/**
* Returns available output templates
*
* @param string $entityType (optional) - Restrict templates to those for $entityType
* @return array
*/
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Utils\Security\Orthos;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_output_getTemplates',
function ($entityType = null) {
......
<?php
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Permissions\Permission;
use QUI\Utils\Security\Orthos;
/**
* Returns e-mail data for an output document
*
......@@ -18,6 +14,11 @@
*
* @return void
*/
use QUI\ERP\Output\Output as ERPOutput;
use QUI\Permissions\Permission;
use QUI\Utils\Security\Orthos;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_output_sendMail',
function (
......@@ -33,7 +34,7 @@ function (
try {
$entityType = Orthos::clear($entityType);
$OutputProvider = ERPOutput::getOutputProviderByEntityType($entityType);
$OutputProvider = ERPOutput::getOutputProviderByEntityType($entityType);
$TemplateProvider = ERPOutput::getOutputTemplateProviderByPackage(Orthos::clear($templateProvider));
if (empty($TemplateProvider)) {
......@@ -42,9 +43,11 @@ function (
$attachedMediaFiles = [];
if (!empty($mailAttachmentMediaFileIds) &&
Permission::hasPermission(ERPOutput::PERMISSION_ATTACH_EMAIL_FILES)) {
$Media = QUI::getRewrite()->getProject()->getMedia();
if (
!empty($mailAttachmentMediaFileIds) &&
Permission::hasPermission(ERPOutput::PERMISSION_ATTACH_EMAIL_FILES)
) {
$Media = QUI::getRewrite()->getProject()->getMedia();
$mailAttachmentMediaFileIds = json_decode($mailAttachmentMediaFileIds, true);
foreach ($mailAttachmentMediaFileIds as $fileId) {
......
......@@ -7,19 +7,16 @@
use QUI\ERP\Products\Controls\Products\ProductEdit;
use QUI\ERP\Products\Handler\Products;
/**
*
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_products_getProductEdit',
function ($productId, $user) {
$Product = Products::getProduct($productId);
$Control = new ProductEdit([
'Product' => $Product
]);
$css = QUI\Control\Manager::getCSS();
$css = QUI\Control\Manager::getCSS();
$html = $Control->create();
return $css . $html;
......
......@@ -13,11 +13,11 @@
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_products_parseProductToArticle',
function ($productId, $attributes, $user, $fields) {
$user = json_decode($user, true);
$fields = json_decode($fields, true);
$user = json_decode($user, true);
$fields = json_decode($fields, true);
$attributes = json_decode($attributes, true);
$User = null;
$Locale = QUI::getLocale();
$User = null;
$Locale = QUI::getLocale();
if (!empty($user)) {
try {
......
<?php
use QUI\ERP\BankAccounts\Handler;
/**
* Get list of bank accounts.
*
* @return array
*/
use QUI\ERP\BankAccounts\Handler;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_settings_bankAccounts_getList',
function () {
......
<?php
use QUI\ERP\Customer\Utils;
/**
* Get contact email address.
*
* @param int $userId
* @return string
*/
use QUI\ERP\Customer\Utils;
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_userData_getContactEmailAddress',
function ($userId) {
......
......@@ -6,6 +6,7 @@
* @param int $userId
* @return string
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_userData_getUserEmailAddresses',
function ($userId) {
......
......@@ -6,6 +6,7 @@
* @param string $description
* @return string
*/
QUI::$Ajax->registerFunction(
'package_quiqqer_erp_ajax_utils_sanitizeArticleDescription',
function ($description) {
......
......@@ -8,7 +8,7 @@
define('QUIQQER_SYSTEM', true);
define('QUIQQER_AJAX', true);
require_once dirname(__FILE__, 6).'/header.php';
require_once dirname(__FILE__, 6) . '/header.php';
use QUI\ERP\Output\Output;
use QUI\Utils\Security\Orthos;
......@@ -19,12 +19,12 @@
exit;
}
$Request = QUI::getRequest();
$entityId = Orthos::clear($Request->query->get('id'));
$entityType = Orthos::clear($Request->query->get('t'));
$template = Orthos::clear($Request->query->get('tpl'));
$Request = QUI::getRequest();
$entityId = Orthos::clear($Request->query->get('id'));
$entityType = Orthos::clear($Request->query->get('t'));
$template = Orthos::clear($Request->query->get('tpl'));
$templateProvider = Orthos::clear($Request->query->get('tplpr'));
$quiId = Orthos::clear($Request->query->get('oid'));
$quiId = Orthos::clear($Request->query->get('oid'));
$errorOutput = function ($message) use ($quiId) {
echo '
......@@ -34,10 +34,10 @@
if (typeof parent.require !== "undefined") {
parent.require(["qui/QUI"], function(QUI) {
QUI.getMessageHandler().then(function(MH) {
MH.addError("'.$message.'");
MH.addError("' . $message . '");
});
var Control = QUI.Controls.getById(\''.$quiId.'\');
var Control = QUI.Controls.getById(\'' . $quiId . '\');
if (Control) {
Control.Loader.hide();
......
......@@ -3,7 +3,7 @@
define('QUIQQER_SYSTEM', true);
define('QUIQQER_AJAX', true);
require_once dirname(__FILE__, 6).'/header.php';
require_once dirname(__FILE__, 6) . '/header.php';
use QUI\ERP\Output\Output;
use QUI\Utils\Security\Orthos;
......@@ -14,15 +14,15 @@
exit;
}
$Request = QUI::getRequest();
$entityId = Orthos::clear($Request->query->get('id'));
$entityType = Orthos::clear($Request->query->get('t'));
$template = Orthos::clear($Request->query->get('tpl'));
$Request = QUI::getRequest();
$entityId = Orthos::clear($Request->query->get('id'));
$entityType = Orthos::clear($Request->query->get('t'));
$template = Orthos::clear($Request->query->get('tpl'));
$templateProvider = Orthos::clear($Request->query->get('tplpr'));
$quiId = Orthos::clear($Request->query->get('oid'));
$quiId = Orthos::clear($Request->query->get('oid'));
$requestHash = \hash('sha256', \implode('', [$entityId, $entityType, $template, $templateProvider]));
$cacheName = 'quiqqer/erp/print/'.$requestHash;
$cacheName = 'quiqqer/erp/print/' . $requestHash;
try {
$HtmlPdfDocument = Output::getDocumentPdf(
......@@ -55,9 +55,9 @@
QUI::getSession()->set($cacheName, \json_encode($imageFiles));
$baseUrl = URL_OPT_DIR.'quiqqer/erp/bin/output/backend/printStream.php?';
$baseUrl = URL_OPT_DIR . 'quiqqer/erp/bin/output/backend/printStream.php?';
$queryParams = [
'hash' => $cacheName,
'hash' => $cacheName,
'index' => 0
];
......@@ -65,7 +65,7 @@
$printImageSources = [];
foreach ($imageFiles as $imageFile) {
$streamFile = $baseUrl.\http_build_query($queryParams);
$streamFile = $baseUrl . \http_build_query($queryParams);
$printImageSources[] = $streamFile;
$queryParams['index']++;
......@@ -90,7 +90,7 @@
foreach ($printImageSources as $imgContent) {
echo '<img
class="pdfDocument"
src="'.$imgContent.'"
src="' . $imgContent . '"
style="width: 100%; width: 21cm; height: 29.7cm; padding: 1cm;"
/>';
}
......
......@@ -3,7 +3,7 @@
define('QUIQQER_SYSTEM', true);
define('QUIQQER_AJAX', true);
require_once dirname(__FILE__, 6).'/header.php';
require_once dirname(__FILE__, 6) . '/header.php';
use QUI\Utils\Security\Orthos;
......@@ -14,8 +14,8 @@
}
$Request = QUI::getRequest();
$hash = Orthos::clear($Request->query->get('hash'));
$index = (int)$Request->query->get('index');
$hash = Orthos::clear($Request->query->get('hash'));
$index = (int)$Request->query->get('index');
if (empty($hash)) {
exit;
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren