mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2025-03-03 13:29:24 +01:00
Merge branch 'OpenXE-org:master' into master
This commit is contained in:
commit
8ec0d46501
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@ -0,0 +1,6 @@
|
||||
database
|
||||
node_modules
|
||||
www/cache
|
||||
www/dist
|
||||
userdata
|
||||
!userdata/wiki
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,4 +2,7 @@ conf/user.inc.php
|
||||
conf/user_defined.php
|
||||
userdata
|
||||
www/cache/
|
||||
node_modules/
|
||||
www/themes/new/css/custom.css
|
||||
docker-compose.override.yml
|
||||
.idea
|
17
README.md
17
README.md
@ -13,22 +13,16 @@ OpenXE ist eine umfassende webbasierte Anwendung zur Abwicklung aller kaufmänni
|
||||
* Aufgaben- und Terminverwaltung
|
||||
* Zeitabrechnung
|
||||
|
||||
# Neue Community-Seite: https://openxe.org/
|
||||
# Community-Seite: [https://openxe.org/](https://openxe.org/community/)
|
||||
|
||||
An alle Interessenten:
|
||||
|
||||
Dieses Projekt startet mit einer leistungsfähigen Software, aber gerade am Anfang ist es schwierig, die potenziellen Anwender abzuschätzen. Das ist jedoch eine wichtige Information und auch Motivation für alle, die sich aktiv am Projekt beteiligen. Wir bitten daher, alle Interessenten für OpenXE, sich hier anzumelden. Die Anmeldung ist kostenfrei und mit keinerlei Verpflichtungen versehen. Ausserdem habt Ihr den Vorteil, Euch bei Fragen direkt im Communitybereich zu melden oder selber aktiv mitzugestalten.
|
||||
Dieses Projekt basiert auf einer leistungsfähigen Software, die auf freiwilliger Basis kostenfrei weiterentwickelt und gepflegt wird. Wir bitten daher alle Interessenten für OpenXE, sich in der Community anzumelden. Die Anmeldung ist kostenfrei und mit keinerlei Verpflichtungen versehen. Ausserdem habt Ihr den Vorteil, Euch bei Fragen direkt im Communitybereich zu melden oder selber aktiv mitzugestalten.
|
||||
|
||||
Wir freuen uns über Eure Teilnahme, egal ob als stiller Mitleser oder aktiver User.
|
||||
|
||||
# Letzte Änderungen: Ticket System
|
||||
|
||||
Neu in [V.1.3](https://github.com/openxe-org/OpenXE/releases/tag/V.1.3):
|
||||
Neuimplementierung des Xentral 20 Enterprise Ticketsystems mit vielen Verbesserungen, z.B.:
|
||||
- Anhänge werden auch bei ausgehenden Nachrichten gespeichert
|
||||
- Verbesserte Kommentarfunktion
|
||||
- Unterstützung mehrerer Empfänger und CC
|
||||
- Verbesserte Stapelverarbeitung
|
||||
# Releases
|
||||
https://github.com/OpenXE-org/OpenXE/releases
|
||||
|
||||
# Installation
|
||||
|
||||
@ -37,5 +31,4 @@ Neuimplementierung des Xentral 20 Enterprise Ticketsystems mit vielen Verbesseru
|
||||
[Hier gehts zur OpenXE Installation](INSTALL.md)
|
||||
|
||||
OpenXE ist freie Software, lizensiert unter der EGPL 3.1.
|
||||
Diese Software ist eine Ableitung und Veränderung von WaWision ERP. WaWision ERP wurde von embedded projects GmbH entwickelt und steht unter der EGPLv3.1-Lizenz als Open Source Software. Informationen zu WaWision und der Open-Source Version findet man unter http://www.wawision.de
|
||||
|
||||
Diese Software ist eine Ableitung und Veränderung von Xentral ERP, Opensource Version. Xentral ERP wurde von embedded projects GmbH als Wawision und später Xentral entwickelt und steht unter der EGPLv3.1-Lizenz als Open Source Software. Informationen zu Xentral findet man unter http://www.xentral.de
|
||||
|
24
classes/Carrier/Go/Data/Address.php
Normal file
24
classes/Carrier/Go/Data/Address.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
class NeutralAddress {
|
||||
public string $name1 = '';
|
||||
public string $name2 = '';
|
||||
public string $name3 = '';
|
||||
public string $street = '';
|
||||
public string $houseNumber = '';
|
||||
public string $zipCode = '';
|
||||
public string $city = '';
|
||||
public string $country = '';
|
||||
|
||||
}
|
||||
class Address extends NeutralAddress {
|
||||
public string $phoneNumber = '';
|
||||
public string $remarks = '';
|
||||
public string $email = '';
|
||||
}
|
31
classes/Carrier/Go/Data/CreateOrderRequest.php
Normal file
31
classes/Carrier/Go/Data/CreateOrderRequest.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
use Xentral\Carrier\SendCloud\Data\Label;
|
||||
|
||||
class CreateOrderRequest {
|
||||
public string $responsibleStation;
|
||||
public string $customerId;
|
||||
public Shipment $shipment;
|
||||
public Address $consignorAddress;
|
||||
public NeutralAddress $neutralAddress;
|
||||
public Address $consigneeAddress;
|
||||
public LabelType $label;
|
||||
/***
|
||||
* @var Package[]
|
||||
*/
|
||||
public array $packages;
|
||||
|
||||
public function __construct() {
|
||||
$this->shipment = new Shipment();
|
||||
$this->consignorAddress = new Address();
|
||||
$this->consigneeAddress = new Address();
|
||||
$this->neutralAddress = new NeutralAddress();
|
||||
$this->packages = [new Package()];
|
||||
}
|
||||
}
|
17
classes/Carrier/Go/Data/CreateOrderResponse.php
Normal file
17
classes/Carrier/Go/Data/CreateOrderResponse.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
class CreateOrderResponse {
|
||||
public string $hwbNumber;
|
||||
public OrderStatus $orderStatus;
|
||||
public \DateTime $pickupDate;
|
||||
public \DateTime $deliveryDate;
|
||||
public string $hwbOrPackageLabel;
|
||||
|
||||
public array $barcodes;
|
||||
}
|
27
classes/Carrier/Go/Data/Delivery.php
Normal file
27
classes/Carrier/Go/Data/Delivery.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
class Delivery implements \JsonSerializable {
|
||||
public \DateTime $dateFrom;
|
||||
public \DateTime $dateTill;
|
||||
public bool $dateIsAvis = false;
|
||||
public bool $deliveryOnSaturday = false;
|
||||
public bool $deliveryOnHoliday = false;
|
||||
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return [
|
||||
'date' => isset($this->dateFrom) ? $this->dateFrom->format('d.m.Y') : '',
|
||||
'timeFrom' => !$this->dateIsAvis && isset($this->dateFrom) ? $this->dateFrom->format('H:i') : '',
|
||||
'timeTill' => !$this->dateIsAvis && isset($this->dateTill) ? $this->dateTill->format('H:i') : '',
|
||||
'avisFrom' => $this->dateIsAvis && isset($this->dateFrom) ? $this->dateFrom->format('H:i') : '',
|
||||
'avisTill' => $this->dateIsAvis && isset($this->dateTill) ? $this->dateTill->format('H:i') : '',
|
||||
'weekendOrHolidayIndicator' => $this->deliveryOnHoliday ? 'H' : ($this->deliveryOnSaturday ? 'S' : '')
|
||||
];
|
||||
}
|
||||
}
|
14
classes/Carrier/Go/Data/ErrorResponse.php
Normal file
14
classes/Carrier/Go/Data/ErrorResponse.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
class ErrorResponse {
|
||||
public string $message;
|
||||
public int $errorCode;
|
||||
public int $status;
|
||||
public \DateTime $timeStamp;
|
||||
}
|
14
classes/Carrier/Go/Data/LabelType.php
Normal file
14
classes/Carrier/Go/Data/LabelType.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
enum LabelType: string {
|
||||
case ZPL = '1';
|
||||
case PDF_A6 = '2';
|
||||
case PDF_A4 = '4';
|
||||
case TPCL = '5';
|
||||
}
|
20
classes/Carrier/Go/Data/MoneyValue.php
Normal file
20
classes/Carrier/Go/Data/MoneyValue.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
class MoneyValue implements \JsonSerializable {
|
||||
public float $amount = 0;
|
||||
public string $currency = 'EUR';
|
||||
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return [
|
||||
'amount' => $this->amount > 0 ? (string)$this->amount : '',
|
||||
'currency' => $this->amount > 0 ? $this->currency : '',
|
||||
];
|
||||
}
|
||||
}
|
13
classes/Carrier/Go/Data/OrderStatus.php
Normal file
13
classes/Carrier/Go/Data/OrderStatus.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
enum OrderStatus : string {
|
||||
case New = 'New';
|
||||
case Released = 'Released';
|
||||
case Cancelled = 'Cancelled';
|
||||
}
|
22
classes/Carrier/Go/Data/Package.php
Normal file
22
classes/Carrier/Go/Data/Package.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
class Package implements \JsonSerializable {
|
||||
public int $length = 0;
|
||||
public int $width = 0;
|
||||
public int $height = 0;
|
||||
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return [
|
||||
'length' => $this->length ? (string) $this->length : '',
|
||||
'width' => $this->width ? (string) $this->width : '',
|
||||
'height' => $this->height ? (string) $this->height : '',
|
||||
];
|
||||
}
|
||||
}
|
21
classes/Carrier/Go/Data/Pickup.php
Normal file
21
classes/Carrier/Go/Data/Pickup.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
class Pickup implements \JsonSerializable {
|
||||
public \DateTime $dateFrom;
|
||||
public \DateTime $dateTill;
|
||||
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return [
|
||||
'date' => $this->dateFrom->format('d.m.Y'),
|
||||
'timeFrom' => $this->dateFrom->format('H:i'),
|
||||
'timeTill' => $this->dateTill->format('H:i'),
|
||||
];
|
||||
}
|
||||
}
|
57
classes/Carrier/Go/Data/Shipment.php
Normal file
57
classes/Carrier/Go/Data/Shipment.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
class Shipment implements \JsonSerializable {
|
||||
public string $hwbNumber = '';
|
||||
public OrderStatus $orderStatus;
|
||||
public bool $validation = true;
|
||||
public ShipmentService $service;
|
||||
public float $weight;
|
||||
public string $content = '';
|
||||
public string $customerReference = '';
|
||||
public ?string $costCenter;
|
||||
public bool $selfPickup = false;
|
||||
public bool $selfDelivery = false;
|
||||
public int $width;
|
||||
public int $length;
|
||||
public int $height;
|
||||
public int $packageCount = 1;
|
||||
public bool $freightCollect = false;
|
||||
public bool $identCheck = false;
|
||||
public bool $receiptNotice = false;
|
||||
public bool $isNeutralPickup = false;
|
||||
public Pickup $pickup;
|
||||
public Delivery $delivery;
|
||||
public ?MoneyValue $insurance;
|
||||
public ?MoneyValue $valueOfGoods;
|
||||
public ?MoneyValue $cashOnDelivery;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->pickup = new Pickup();
|
||||
$this->delivery = new Delivery();
|
||||
$this->insurance = new MoneyValue();
|
||||
$this->valueOfGoods = new MoneyValue();
|
||||
$this->cashOnDelivery = new MoneyValue();
|
||||
}
|
||||
|
||||
public function SetService(string $service) {
|
||||
$this->service = ShipmentService::from($service);
|
||||
}
|
||||
|
||||
public function jsonSerialize()
|
||||
{
|
||||
$array = (array) $this;
|
||||
$array['dimensions'] = '';
|
||||
return array_map(function ($value) {
|
||||
if (is_bool($value))
|
||||
return $value ? 'Yes' : 'No';
|
||||
return $value;
|
||||
}, $array);
|
||||
}
|
||||
}
|
17
classes/Carrier/Go/Data/ShipmentService.php
Normal file
17
classes/Carrier/Go/Data/ShipmentService.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go\Data;
|
||||
|
||||
enum ShipmentService: string {
|
||||
case Overnight = 'ON';
|
||||
case Worldwide = 'INT';
|
||||
case OvernightLetter = 'LET';
|
||||
case WorldwideLetter = 'INL';
|
||||
case OvernightCodedDelivery = 'ONC';
|
||||
case OvernightCodedLetter = 'LEC';
|
||||
case DirectShipment = 'DI';
|
||||
}
|
58
classes/Carrier/Go/GoApi.php
Normal file
58
classes/Carrier/Go/GoApi.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2025 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Carrier\Go;
|
||||
|
||||
use Xentral\Carrier\Go\Data\CreateOrderRequest;
|
||||
use Xentral\Carrier\Go\Data\CreateOrderResponse;
|
||||
use Xentral\Carrier\Go\Data\OrderStatus;
|
||||
|
||||
class GoApi {
|
||||
const BASE_URL_PROD = 'https://ws.api.general-overnight.com/external/ci/order/api/v1/';
|
||||
const BASE_URL_TEST = 'https://ws-tst.api.general-overnight.com/external/ci/order/api/v1/';
|
||||
|
||||
protected string $baseUrl;
|
||||
|
||||
public function __construct(protected string $username, protected string $password, bool $testMode = true) {
|
||||
if ($testMode)
|
||||
$this->baseUrl = self::BASE_URL_TEST;
|
||||
else
|
||||
$this->baseUrl = self::BASE_URL_PROD;
|
||||
}
|
||||
|
||||
public function createOrder(CreateOrderRequest $request): CreateOrderResponse|string {
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, [
|
||||
CURLOPT_RETURNTRANSFER => 1,
|
||||
CURLOPT_URL => $this->baseUrl.'createOrder',
|
||||
CURLOPT_POST => 1,
|
||||
CURLOPT_USERNAME => $this->username,
|
||||
CURLOPT_PASSWORD => $this->password,
|
||||
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
|
||||
CURLOPT_POSTFIELDS => json_encode($request, JSON_THROW_ON_ERROR),
|
||||
]);
|
||||
|
||||
$response = json_decode(curl_exec($curl));
|
||||
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
curl_close($curl);
|
||||
|
||||
if ($code == 200) {
|
||||
$ret = new CreateOrderResponse();
|
||||
$ret->hwbNumber = $response->hwbNumber;
|
||||
$ret->orderStatus = OrderStatus::from($response->orderStatus);
|
||||
$ret->pickupDate = new \DateTime($response->pickupDate);
|
||||
$ret->deliveryDate = new \DateTime($response->deliveryDate);
|
||||
$ret->hwbOrPackageLabel = $response->hwbOrPackageLabel;
|
||||
$ret->barcodes = array_map(function ($item) { return $item->barcode; }, $response->package);
|
||||
return $ret;
|
||||
}
|
||||
if (isset($response->message))
|
||||
return $response->message;
|
||||
if (isset($response->Message))
|
||||
return $response->Message;
|
||||
return print_r($response, TRUE);
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Andreas Palm
|
||||
* SPDX-FileCopyrightText: 2022-2024 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
@ -14,6 +14,7 @@ use Xentral\Carrier\SendCloud\Data\ParcelCreation;
|
||||
use Xentral\Carrier\SendCloud\Data\ParcelResponse;
|
||||
use Xentral\Carrier\SendCloud\Data\SenderAddress;
|
||||
use Xentral\Carrier\SendCloud\Data\ShippingProduct;
|
||||
use Xentral\Modules\ShippingMethod\Model\ShipmentStatus;
|
||||
|
||||
class SendCloudApi
|
||||
{
|
||||
@ -118,6 +119,32 @@ class SendCloudApi
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SendcloudApiException
|
||||
*/
|
||||
public function GetTrackingStatus(string $trackingNumber): ShipmentStatus|null
|
||||
{
|
||||
$uri = self::PROD_BASE_URI . '/tracking/' . $trackingNumber;
|
||||
$response = $this->sendRequest($uri);
|
||||
$highest = null;
|
||||
foreach ($response['body']->statuses as $status) {
|
||||
switch ($status->parent_status) {
|
||||
case 'announcing':
|
||||
case 'ready-to-send':
|
||||
if ($highest === null) $highest = ShipmentStatus::Announced;
|
||||
break;
|
||||
case 'to-sorting':
|
||||
case 'at-sorting-centre':
|
||||
case 'shipment-on-route':
|
||||
case 'driver-on-route':
|
||||
$highest = ShipmentStatus::EnRoute;
|
||||
break;
|
||||
case 'delivered': return ShipmentStatus::Delivered;
|
||||
}
|
||||
}
|
||||
return $highest;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SendcloudApiException
|
||||
*/
|
||||
|
@ -44,14 +44,6 @@ class Bootstrap
|
||||
/** @var LegacyApplication $app */
|
||||
$app = $container->get('LegacyApplication');
|
||||
|
||||
if (!class_exists('License')) {
|
||||
$test = dirname(__DIR__, 3) . '/phpwf/plugins/class.license.php';
|
||||
$file = new SplFileInfo($test);
|
||||
if ($file->isFile()) {
|
||||
include $test;
|
||||
}
|
||||
}
|
||||
|
||||
return new EnvironmentConfigProvider(new License(), $app->Conf);
|
||||
return new EnvironmentConfigProvider($app->Conf);
|
||||
}
|
||||
}
|
||||
|
@ -34,11 +34,6 @@ final class EnvironmentConfig
|
||||
*/
|
||||
private $userdataDirectoryPath;
|
||||
|
||||
/**
|
||||
* @var array|null $ioncubeSystemInformation
|
||||
*/
|
||||
private $ioncubeSystemInformation;
|
||||
|
||||
/**
|
||||
* @param string $databaseHost
|
||||
* @param string $databaseName
|
||||
@ -46,7 +41,6 @@ final class EnvironmentConfig
|
||||
* @param string $databasePassword
|
||||
* @param int $databasePort
|
||||
* @param string $userdataDirectoryPath
|
||||
* @param array $ioncubeSystemInformation
|
||||
*/
|
||||
public function __construct(
|
||||
string $databaseHost,
|
||||
@ -54,8 +48,7 @@ final class EnvironmentConfig
|
||||
string $databaseUser,
|
||||
string $databasePassword,
|
||||
int $databasePort,
|
||||
string $userdataDirectoryPath,
|
||||
?array $ioncubeSystemInformation
|
||||
string $userdataDirectoryPath
|
||||
) {
|
||||
$this->databaseHost = $databaseHost;
|
||||
$this->databaseName = $databaseName;
|
||||
@ -63,7 +56,6 @@ final class EnvironmentConfig
|
||||
$this->databasePassword = $databasePassword;
|
||||
$this->databasePort = $databasePort;
|
||||
$this->userdataDirectoryPath = $userdataDirectoryPath;
|
||||
$this->ioncubeSystemInformation = $ioncubeSystemInformation;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -113,121 +105,4 @@ final class EnvironmentConfig
|
||||
{
|
||||
return $this->userdataDirectoryPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ?array
|
||||
*/
|
||||
public function getIoncubeSystemInformation(): ?array
|
||||
{
|
||||
return $this->ioncubeSystemInformation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isSystemHostedOnCloud(): bool
|
||||
{
|
||||
return !empty($this->ioncubeSystemInformation['iscloud']['value']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isSystemFlaggedAsDevelopmentVersion(): bool
|
||||
{
|
||||
return !empty($this->ioncubeSystemInformation['isdevelopmentversion']['value']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isSystemFlaggedAsTestVersion(): bool
|
||||
{
|
||||
return !empty($this->ioncubeSystemInformation['testlizenz']['value']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxUser(): int
|
||||
{
|
||||
if (!isset($this->ioncubeSystemInformation['maxuser']['value'])) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int)$this->ioncubeSystemInformation['maxuser']['value'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxLightUser(): int
|
||||
{
|
||||
if (!isset($this->ioncubeSystemInformation['maxlightuser']['value'])) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int)$this->ioncubeSystemInformation['maxlightuser']['value'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getExpirationTimeStamp(): ?int
|
||||
{
|
||||
if (!isset($this->ioncubeSystemInformation['expdate']['value'])) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int)$this->ioncubeSystemInformation['expdate']['value'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getValueOfSpecificIoncubeSystemInformation(string $name): ?string
|
||||
{
|
||||
if ($this->ioncubeSystemInformation === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (array_key_exists($name, $this->ioncubeSystemInformation)) {
|
||||
return $this->ioncubeSystemInformation[$name]['value'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getSystemFallbackEmailAddresses(): array
|
||||
{
|
||||
$emailAddresses = [];
|
||||
$mailAddressSelfBuyCustomer = (string)$this->getValueOfSpecificIoncubeSystemInformation('buyemail');
|
||||
if ($mailAddressSelfBuyCustomer !== '') {
|
||||
$emailAddresses[] = $mailAddressSelfBuyCustomer;
|
||||
}
|
||||
|
||||
$mailAddressCustomerLicence = (string)$this->getValueOfSpecificIoncubeSystemInformation('emaillicence');
|
||||
if ($mailAddressCustomerLicence !== ''
|
||||
&& strpos($mailAddressCustomerLicence, '@') !== false
|
||||
&& strpos($mailAddressCustomerLicence, '@xentral.com') === false
|
||||
&& strpos($mailAddressCustomerLicence, '@xentral.biz') === false) {
|
||||
$emailAddresses[] = $mailAddressCustomerLicence;
|
||||
}
|
||||
|
||||
//in old licences email-address of customer can be insert in name instead email
|
||||
$nameCustomerLicence = (string)$this->getValueOfSpecificIoncubeSystemInformation('namelicence');
|
||||
if ($nameCustomerLicence !== ''
|
||||
&& strpos($nameCustomerLicence, '@') !== false
|
||||
&& strpos($nameCustomerLicence, '@xentral.com') === false
|
||||
&& strpos($nameCustomerLicence, '@xentral.biz') === false) {
|
||||
$emailAddresses[] = $nameCustomerLicence;
|
||||
}
|
||||
|
||||
return $emailAddresses;
|
||||
}
|
||||
}
|
||||
|
@ -7,19 +7,14 @@ use License;
|
||||
|
||||
final class EnvironmentConfigProvider
|
||||
{
|
||||
/** @var License $license */
|
||||
private $license;
|
||||
|
||||
/** @var Config $config */
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* @param License $license
|
||||
* @param Config $config
|
||||
*/
|
||||
public function __construct(License $license, Config $config)
|
||||
public function __construct(Config $config)
|
||||
{
|
||||
$this->license = $license;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
@ -30,8 +25,7 @@ final class EnvironmentConfigProvider
|
||||
{
|
||||
$environmentConfig = new EnvironmentConfig(
|
||||
$this->config->WFdbhost, $this->config->WFdbname, $this->config->WFdbuser,
|
||||
$this->config->WFdbpass, $this->config->WFdbport, $this->config->WFuserdata,
|
||||
(array)$this->license->getProperties()
|
||||
$this->config->WFdbpass, $this->config->WFdbport, $this->config->WFuserdata
|
||||
);
|
||||
|
||||
return $environmentConfig;
|
||||
|
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019 Xentral ERP Software GmbH, Fuggerstrasse 11, D-86150 Augsburg
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
*/
|
||||
|
||||
namespace Xentral\Components\Http;
|
||||
|
||||
@ -9,8 +15,8 @@ class JsonResponse extends Response
|
||||
{
|
||||
/**
|
||||
* @param array|JsonSerializable $data
|
||||
* @param int $statusCode
|
||||
* @param array $headers
|
||||
* @param int $statusCode
|
||||
* @param array $headers
|
||||
*/
|
||||
public function __construct($data = [], $statusCode = self::HTTP_OK, array $headers = [])
|
||||
{
|
||||
@ -29,4 +35,19 @@ class JsonResponse extends Response
|
||||
|
||||
parent::__construct($content, $statusCode, $headers);
|
||||
}
|
||||
|
||||
public static function NoContent(array $headers = []): JsonResponse
|
||||
{
|
||||
return new JsonResponse([], Response::HTTP_NO_CONTENT, $headers);
|
||||
}
|
||||
|
||||
public static function BadRequest(array|JsonSerializable $data = [], array $headers = []): JsonResponse
|
||||
{
|
||||
return new JsonResponse($data, Response::HTTP_BAD_REQUEST, $headers);
|
||||
}
|
||||
|
||||
public static function NotFound(array|JsonSerializable $data = [], array $headers = []): JsonResponse
|
||||
{
|
||||
return new JsonResponse($data, Response::HTTP_NOT_FOUND, $headers);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
* SPDX-FileCopyrightText: 2019 Xentral ERP Software GmbH, Fuggerstrasse 11, D-86150 Augsburg
|
||||
* SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
*/
|
||||
|
||||
namespace Xentral\Components\Http;
|
||||
|
||||
@ -488,6 +493,16 @@ class Request
|
||||
return !empty($this->content) ? $this->content : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a JSON request body as php object
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function getJson() : object
|
||||
{
|
||||
return json_decode($this->getContent());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the content type of the request.
|
||||
*
|
||||
|
@ -10,6 +10,15 @@ use Xentral\Components\Logger\Handler\LogHandlerInterface;
|
||||
|
||||
final class Logger extends AbstractLogger
|
||||
{
|
||||
const EMERGENCY = 'emergency';
|
||||
const ALERT = 'alert';
|
||||
const CRITICAL = 'critical';
|
||||
const ERROR = 'error';
|
||||
const WARNING = 'warning';
|
||||
const NOTICE = 'notice';
|
||||
const INFO = 'info';
|
||||
const DEBUG = 'debug';
|
||||
|
||||
/** @var LogHandlerInterface[] $levelHandlers */
|
||||
private $logHandlers;
|
||||
|
||||
|
@ -84,10 +84,6 @@ final class ErrorHandler
|
||||
public function handleException($exception)
|
||||
{
|
||||
$title = null;
|
||||
if ($this->isIoncubeError($exception)) {
|
||||
$title = $this->handleIoncubeError($exception);
|
||||
}
|
||||
|
||||
$data = new ErrorPageData($exception, $title);
|
||||
$renderer = new ErrorPageRenderer($data);
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
@ -125,96 +121,4 @@ final class ErrorHandler
|
||||
{
|
||||
return in_array((int)$type, self::THROWABLE_ERROR_TYPES, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Throwable $exception
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isIoncubeError($exception)
|
||||
{
|
||||
if ((int)$exception->getCode() !== E_CORE_ERROR) {
|
||||
return false;
|
||||
}
|
||||
if (strpos($exception->getMessage(), 'requires a license file.') !== false) {
|
||||
return true;
|
||||
}
|
||||
if (strpos($exception->getMessage(), 'ionCube Encoder') !== false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Throwable $exception
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
private function handleIoncubeError($exception)
|
||||
{
|
||||
$file = $this->extractFileFromIoncubeError($exception);
|
||||
if (empty($file)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!$this->isDeleteableFile($file)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@unlink($file);
|
||||
if(is_file($file)) {
|
||||
return sprintf('Es wurde eine alte Systemdatei gefunden die nicht manuell gelöscht werden konnte.
|
||||
Bitte löschen Sie die Datei %s', $file);
|
||||
}
|
||||
return 'Es wurde eine alte Systemdatei gefunden und automatisch gelöscht.
|
||||
Bitte führen Sie das Update nochmal durch dann sollte diese Meldung nicht mehr erscheinen.';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $file
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isDeleteableFile(string $file)
|
||||
{
|
||||
if (!is_file($file)) {
|
||||
return false;
|
||||
}
|
||||
$dir = dirname($file);
|
||||
foreach (self::DELETE_FILE_FOLDERS as $folder) {
|
||||
if (substr($dir, -strlen($folder)) === $folder) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @example "<br>The encoded file <b>/var/www/xentral/www/pages/adresse.php</b> requires a license file.<br>"
|
||||
* "The license file <b>/var/www/xentral/key.php</b> is corrupt."
|
||||
*
|
||||
* @param Throwable $exception
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
private function extractFileFromIoncubeError($exception)
|
||||
{
|
||||
$message = strip_tags($exception->getMessage());
|
||||
$theFilePos = stripos($message, 'The File ');
|
||||
if ($theFilePos === false) {
|
||||
$theFilePos = strpos($message, 'The encoded file');
|
||||
if ($theFilePos === false) {
|
||||
return null;
|
||||
}
|
||||
$theFilePos += 16;
|
||||
} else {
|
||||
$theFilePos += 9;
|
||||
}
|
||||
$file = trim(substr($message, $theFilePos));
|
||||
$file = explode(' ', $file);
|
||||
|
||||
return reset($file);
|
||||
}
|
||||
}
|
||||
|
@ -323,15 +323,6 @@ final class ErrorPageData implements JsonSerializable
|
||||
'ldap' => function () {
|
||||
return function_exists('ldap_connect');
|
||||
},
|
||||
'ioncube' => function () {
|
||||
if (!function_exists('ioncube_loader_version')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$ioncubeMajorVersion = (int)@ioncube_loader_version();
|
||||
|
||||
return $ioncubeMajorVersion >= 5;
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -377,11 +377,13 @@ class ShopimportController
|
||||
|
||||
$stats['packages_yesterday'] = $verkaufszahlen->getPackages(
|
||||
" v.versendet_am=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 day),'%Y-%m-%d') '",
|
||||
sprintf('INNER JOIN `auftrag` AS `a` ON l.auftragid = a.id AND a.shop = %d', $shopId)
|
||||
sprintf('INNER JOIN `auftrag` AS `a` ON l.auftragid = a.id AND a.shop = %d', $shopId),
|
||||
false
|
||||
);
|
||||
$stats['packages_today'] = $verkaufszahlen->getPackages(
|
||||
" v.versendet_am=DATE_FORMAT(NOW(),'%Y-%m-%d') '",
|
||||
sprintf('INNER JOIN `auftrag` AS `a` ON l.auftragid = a.id AND a.shop = %d', $shopId)
|
||||
sprintf('INNER JOIN `auftrag` AS `a` ON l.auftragid = a.id AND a.shop = %d', $shopId),
|
||||
false
|
||||
);
|
||||
|
||||
[
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace Xentral\Modules\Article;
|
||||
|
||||
use Xentral\Core\DependencyInjection\ContainerInterface;
|
||||
use Xentral\Modules\Article\Service\ArticleService;
|
||||
use Xentral\Modules\Article\Service\SellingPriceService;
|
||||
use Xentral\Modules\Article\Gateway\ArticleGateway;
|
||||
use Xentral\Modules\Article\Service\CurrencyConversionService;
|
||||
@ -17,6 +18,7 @@ final class Bootstrap
|
||||
{
|
||||
return [
|
||||
'ArticleGateway' => 'onInitArticleGateway',
|
||||
'ArticleService' => 'onInitArticleService',
|
||||
'PurchasePriceService' => 'onInitPurchasePriceService',
|
||||
'SellingPriceService' => 'onInitSellingPriceService',
|
||||
'CurrencyConversionService' => 'onInitCurrencyConversionService',
|
||||
@ -65,4 +67,17 @@ final class Bootstrap
|
||||
|
||||
return new CurrencyConversionService($app->erp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*
|
||||
* @return ArticleService
|
||||
*/
|
||||
public static function onInitArticleService(ContainerInterface $container)
|
||||
{
|
||||
/** @var \ApplicationCore $app */
|
||||
$app = $container->get('LegacyApplication');
|
||||
|
||||
return new ArticleService($app);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
* SPDX-FileCopyrightText: 2019 Xentral (c) Xentral ERP Software GmbH, Fuggerstrasse 11, D-86150 Augsburg, Germany
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
namespace Xentral\Modules\Article\Gateway;
|
||||
|
||||
@ -346,4 +351,13 @@ final class ArticleGateway
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function SetVariantStatus(int $articleId, ?int $variantOfId) : void {
|
||||
$sql = "UPDATE artikel SET variante = :isVariant, variante_von = :variantOfId WHERE id = :articleId";
|
||||
$this->db->perform($sql, [
|
||||
'articleId' => $articleId,
|
||||
'variantOfId' => $variantOfId > 0 ? $variantOfId : null,
|
||||
'isVariant' => $variantOfId > 0
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
131
classes/Modules/Article/Service/ArticleService.php
Normal file
131
classes/Modules/Article/Service/ArticleService.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
namespace Xentral\Modules\Article\Service;
|
||||
use ApplicationCore;
|
||||
use Xentral\Components\Database\Database;
|
||||
|
||||
class ArticleService
|
||||
{
|
||||
private ApplicationCore $app;
|
||||
|
||||
public function __construct(ApplicationCore $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
}
|
||||
|
||||
function CopyArticle(int $id, bool $purchasePrices, bool $sellingPrices, bool $files, bool $properties,
|
||||
bool $instructions, bool $partLists, bool $customFields, string $newArticleNumber = '')
|
||||
{
|
||||
$newArticleNumber = $this->app->DB->real_escape_string($newArticleNumber);
|
||||
$this->app->DB->MysqlCopyRow('artikel','id',$id);
|
||||
|
||||
$idnew = $this->app->DB->GetInsertID();
|
||||
|
||||
$steuersatz = $this->app->DB->Select("SELECT steuersatz FROM artikel WHERE id = '$id' LIMIT 1");
|
||||
if($steuersatz == ''){
|
||||
$steuersatz = -1.00;
|
||||
$this->app->DB->Update("UPDATE artikel SET steuersatz = '$steuersatz' WHERE id = '$idnew' LIMIT 1");
|
||||
}
|
||||
|
||||
$this->app->DB->Update("UPDATE artikel SET nummer='$newArticleNumber', matrixprodukt = 0 WHERE id='$idnew' LIMIT 1");
|
||||
if($this->app->DB->Select("SELECT variante_kopie FROM artikel WHERE id = '$id' LIMIT 1"))
|
||||
$this->app->DB->Update("UPDATE artikel SET variante = 1, variante_von = '$id' WHERE id = '$idnew' LIMIT 1");
|
||||
|
||||
if($partLists){
|
||||
// wenn stueckliste
|
||||
$stueckliste = $this->app->DB->Select("SELECT stueckliste FROM artikel WHERE id='$id' LIMIT 1");
|
||||
if($stueckliste==1)
|
||||
{
|
||||
$artikelarr = $this->app->DB->SelectArr("SELECT * FROM stueckliste WHERE stuecklistevonartikel='$id'");
|
||||
$cartikelarr = $artikelarr?count($artikelarr):0;
|
||||
for($i=0;$i<$cartikelarr;$i++)
|
||||
{
|
||||
$sort = $artikelarr[$i]['sort'];
|
||||
$artikel = $artikelarr[$i]['artikel'];
|
||||
$referenz = $artikelarr[$i]['referenz'];
|
||||
$place = $artikelarr[$i]['place'];
|
||||
$layer = $artikelarr[$i]['layer'];
|
||||
$stuecklistevonartikel = $idnew;
|
||||
$menge = $artikelarr[$i]['menge'];
|
||||
$firma = $artikelarr[$i]['firma'];
|
||||
|
||||
$this->app->DB->Insert("INSERT INTO stueckliste (id,sort,artikel,referenz,place,layer,stuecklistevonartikel,menge,firma) VALUES
|
||||
('','$sort','$artikel','$referenz','$place','$layer','$stuecklistevonartikel','$menge','$firma')");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($purchasePrices){
|
||||
$einkaufspreise = $this->app->DB->SelectArr("SELECT id FROM einkaufspreise WHERE artikel = '$id'");
|
||||
if($einkaufspreise){
|
||||
foreach($einkaufspreise as $preis){
|
||||
$neuereinkaufspreis = $this->app->DB->MysqlCopyRow("einkaufspreise", "id", $preis['id']);
|
||||
$this->app->DB->Update("UPDATE einkaufspreise SET artikel = '$idnew' WHERE id = '$neuereinkaufspreis' LIMIT 1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($sellingPrices){
|
||||
$verkaufspreise = $this->app->DB->SelectArr("SELECT id FROM verkaufspreise WHERE artikel = '$id'");
|
||||
if($verkaufspreise){
|
||||
foreach($verkaufspreise as $preis){
|
||||
$neuerverkaufspreis = $this->app->DB->MysqlCopyRow("verkaufspreise", "id", $preis['id']);
|
||||
$this->app->DB->Update("UPDATE verkaufspreise SET artikel = '$idnew' WHERE id = '$neuerverkaufspreis' LIMIT 1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($files){
|
||||
$dateien = $this->app->DB->SelectArr("SELECT DISTINCT datei FROM datei_stichwoerter WHERE parameter = '$id' AND objekt = 'Artikel'");
|
||||
$datei_stichwoerter = $this->app->DB->SelectArr("SELECT id,datei FROM datei_stichwoerter WHERE parameter = '$id' AND objekt = 'Artikel'");
|
||||
|
||||
if($dateien){
|
||||
foreach($dateien as $datei){
|
||||
$titel = $this->app->DB->Select("SELECT titel FROM datei WHERE id='".$datei['datei']."' LIMIT 1");
|
||||
$beschreibung = $this->app->DB->Select("SELECT beschreibung FROM datei WHERE id='".$datei['datei']."' LIMIT 1");
|
||||
$nummer = $this->app->DB->Select("SELECT nummer FROM datei WHERE id='".$datei['datei']."' LIMIT 1");
|
||||
$name = $this->app->DB->Select("SELECT dateiname FROM datei_version WHERE datei='".$this->app->DB->real_escape_string($datei['datei'])."' ORDER by version DESC LIMIT 1");
|
||||
$ersteller = $this->app->User->GetName();
|
||||
$tmpnewdateiid = $this->app->erp->CreateDatei($name,$titel,$beschreibung,$nummer,$this->app->erp->GetDateiPfad($datei['datei']),$ersteller);
|
||||
$datei_mapping[$datei['datei']] = $tmpnewdateiid;
|
||||
}
|
||||
}
|
||||
|
||||
if($datei_stichwoerter){
|
||||
foreach($datei_stichwoerter as $datei){
|
||||
$neuesstichwort = $this->app->DB->MysqlCopyRow("datei_stichwoerter", "id", $datei['id']);
|
||||
$newdatei = $datei_mapping[$datei['datei']];
|
||||
$this->app->DB->Update("UPDATE datei_stichwoerter SET datei='$newdatei', parameter = '$idnew', objekt = 'Artikel' WHERE id = '$neuesstichwort' LIMIT 1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($properties){
|
||||
$aeigenschaften = $this->app->DB->SelectArr("SELECT id FROM artikeleigenschaftenwerte WHERE artikel = '$id'");
|
||||
if($aeigenschaften){
|
||||
foreach($aeigenschaften as $eigenschaft){
|
||||
$this->app->DB->MysqlCopyRow("artikeleigenschaftenwerte", "id", $eigenschaft['id'], Array('artikel' => $idnew));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($instructions){
|
||||
$arbeitsanweisungen = $this->app->DB->SelectArr("SELECT id FROM artikel_arbeitsanweisung WHERE artikel = '$id'");
|
||||
if($arbeitsanweisungen){
|
||||
foreach($arbeitsanweisungen as $anweisung){
|
||||
$neue_anweisung = $this->app->DB->MysqlCopyRow("artikel_arbeitsanweisung", "id", $anweisung['id']);
|
||||
$this->app->DB->Update("UPDATE artikel_arbeitsanweisung SET artikel = '$idnew' WHERE id = '$neue_anweisung' LIMIT 1");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($customFields){
|
||||
$freifelderuebersetzungen = $this->app->DB->SelectArr("SELECT id FROM artikel_freifelder WHERE artikel = '$id'");
|
||||
if($freifelderuebersetzungen){
|
||||
$this->app->DB->Insert("INSERT INTO artikel_freifelder (artikel, sprache, nummer, wert) SELECT '$idnew', sprache, nummer, wert FROM artikel_freifelder WHERE artikel = '$id'");
|
||||
}
|
||||
}
|
||||
|
||||
return $idnew;
|
||||
}
|
||||
}
|
@ -443,7 +443,11 @@ $(document).ready(function () {
|
||||
"Speichern": function () {
|
||||
var errMsg = '';
|
||||
|
||||
if ($("#datum").val() == "") errMsg = "Geben Sie bitte ein gültiges Datum ein (dd.mm.jjjj)"
|
||||
if ($("#datum").val() == "") errMsg = "Geben Sie bitte ein gültiges Datum ein (dd.mm.jjjj)";
|
||||
if ($("#von").val() == "") $("#von").val("00:00");
|
||||
if ($("#von").val().includes(':') == false) $("#von").val($("#von").val()+":00");
|
||||
if ($("#bis").val() == "") $("#bis").val("23:59");
|
||||
if ($("#bis").val().includes(':') == false) $("#bis").val($("#bis").val()+":00");
|
||||
if ($("#titel").val() == "") errMsg = "Geben Sie bitte einen Titel ein";
|
||||
|
||||
if (errMsg != "")
|
||||
|
@ -6,9 +6,6 @@ namespace Xentral\Modules\GoogleApi;
|
||||
|
||||
final class GoogleScope
|
||||
{
|
||||
/** @var string CLOUDPRINT */
|
||||
public const CLOUDPRINT = 'https://www.googleapis.com/auth/cloudprint';
|
||||
|
||||
/** @var string CALENDAR */
|
||||
public const CALENDAR = 'https://www.googleapis.com/auth/calendar';
|
||||
|
||||
|
@ -213,25 +213,6 @@ final class GoogleAccountGateway
|
||||
return array_values($pairs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will be removed after Dec 31. 2020
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return GoogleAccountData
|
||||
*/
|
||||
public function getCloudPrintAccount(): GoogleAccountData
|
||||
{
|
||||
$accounts = $this->getAccountsByScope(GoogleScope::CLOUDPRINT);
|
||||
if (count($accounts) < 1) {
|
||||
throw new GoogleAccountNotFoundException('No cloud printing account available.');
|
||||
}
|
||||
|
||||
return $accounts[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $accountId
|
||||
*
|
||||
|
@ -1,109 +0,0 @@
|
||||
|
||||
/**
|
||||
* Für die Bedienung der Modul-Oberfläche
|
||||
*/
|
||||
var PrinterGoogleCloudPrint = (function ($) {
|
||||
'use strict';
|
||||
|
||||
var me = {
|
||||
|
||||
isInitialized: false,
|
||||
$apiSelect: null,
|
||||
$printerSelect: null,
|
||||
initApiValue: null,
|
||||
initPrinterValue: null,
|
||||
printercache: {},
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
init: function () {
|
||||
if (me.isInitialized === true) {
|
||||
return;
|
||||
}
|
||||
me.$apiSelect = $('select[name="google_api"]');
|
||||
me.$printerSelect = $('select[name="google_printer"]');
|
||||
me.initApiValue = me.$apiSelect.val();
|
||||
me.initPrinterValue = me.$printerSelect.val();
|
||||
|
||||
var options = {};
|
||||
$('select[name="google_printer"] option').each( function () {
|
||||
options[$(this).attr('value')] = $(this).text();
|
||||
});
|
||||
me.printercache[me.initApiValue] = options;
|
||||
|
||||
me.registerEvents();
|
||||
me.isInitialized = true;
|
||||
},
|
||||
|
||||
setPrinterSelectOptions: function(options, selected) {
|
||||
me.$printerSelect.empty(); // remove old options
|
||||
$.each(options, function(value, display) {
|
||||
me.$printerSelect.append($('<option></option>').attr('value', value).text(display));
|
||||
});
|
||||
if (selected in options) {
|
||||
me.$printerSelect.val(selected);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @return {void}
|
||||
*/
|
||||
registerEvents: function () {
|
||||
me.$apiSelect.change(function () {
|
||||
me.ajaxLoadPrinterOptions(this.value);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {number} fieldId
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
ajaxLoadPrinterOptions: function (apiName) {
|
||||
if (apiName === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (apiName in me.printercache) {
|
||||
me.setPrinterSelectOptions(me.printercache[apiName], me.initPrinterValue);
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?module=googleapi&action=ajaxprinters',
|
||||
data: {
|
||||
api_name: apiName
|
||||
},
|
||||
method: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
me.$printerSelect.prop('disabled', true);
|
||||
me.$apiSelect.prop('disabled', true);
|
||||
App.loading.open();
|
||||
},
|
||||
complete: function() {
|
||||
me.$printerSelect.prop('disabled', false);
|
||||
me.$apiSelect.prop('disabled', false);
|
||||
},
|
||||
error: function (error) {
|
||||
App.loading.close();
|
||||
},
|
||||
success: function (data) {
|
||||
me.printercache[apiName] = data;
|
||||
me.setPrinterSelectOptions(data, me.initPrinterValue);
|
||||
App.loading.close();
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
init: me.init,
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
$(document).ready(function () {
|
||||
PrinterGoogleCloudPrint.init();
|
||||
});
|
47
classes/Modules/MatrixProduct/Bootstrap.php
Normal file
47
classes/Modules/MatrixProduct/Bootstrap.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
* SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
*/
|
||||
|
||||
namespace Xentral\Modules\MatrixProduct;
|
||||
|
||||
use Xentral\Core\DependencyInjection\ContainerInterface;
|
||||
|
||||
final class Bootstrap
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function registerServices()
|
||||
{
|
||||
return [
|
||||
'MatrixProductService' => 'onInitMatrixProductService',
|
||||
'MatrixProductGateway' => 'onInitMatrixProductGateway',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*
|
||||
* @return MatrixProductService
|
||||
*/
|
||||
public static function onInitMatrixProductService(ContainerInterface $container) : MatrixProductService
|
||||
{
|
||||
return new MatrixProductService(
|
||||
$container->get('Database'),
|
||||
$container->get('MatrixProductGateway'),
|
||||
$container->get('ArticleGateway')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ContainerInterface $container
|
||||
*
|
||||
* @return MatrixProductGateway
|
||||
*/
|
||||
public static function onInitMatrixProductGateway(ContainerInterface $container) : MatrixProductGateway
|
||||
{
|
||||
return new MatrixProductGateway($container->get('Database'));
|
||||
}
|
||||
}
|
34
classes/Modules/MatrixProduct/Data/Group.php
Normal file
34
classes/Modules/MatrixProduct/Data/Group.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
namespace Xentral\Modules\MatrixProduct\Data;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
final class Group implements JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public string $name,
|
||||
public ?int $id = null,
|
||||
public bool $active = true,
|
||||
public ?string $nameExternal = null,
|
||||
public int $projectId = 0,
|
||||
public bool $required = false,
|
||||
public ?int $articleId = null,
|
||||
public int $sort = 0
|
||||
)
|
||||
{ }
|
||||
|
||||
public static function fromDbArray(array $data) : self {
|
||||
return new self($data['name'], $data['id'], $data['aktiv'], $data['name_ext'], $data['projekt'], $data['pflicht'],
|
||||
$data['artikel'] ?? null, $data['sort'] ?? 0);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return (array) $this;
|
||||
}
|
||||
}
|
38
classes/Modules/MatrixProduct/Data/Option.php
Normal file
38
classes/Modules/MatrixProduct/Data/Option.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
namespace Xentral\Modules\MatrixProduct\Data;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
final class Option implements JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public string $name,
|
||||
public readonly int $groupId,
|
||||
public ?int $id = null,
|
||||
public bool $active = true,
|
||||
public string $nameExternal = '',
|
||||
public int $sort = 0,
|
||||
public string $articleNumber = '',
|
||||
public string $articleNumberSuffix = '',
|
||||
public readonly ?int $globalOptionId = null,
|
||||
public readonly ?int $articleId = null
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public static function fromDbArray(array $data) : Option {
|
||||
return new self($data['name'], $data['gruppe'], $data['id'], $data['aktiv'], $data['name_ext'], $data['sort'],
|
||||
$data['artikelnummer'], $data['articlenumber_suffix'], $data['matrixprodukt_eigenschaftenoptionen'] ?? null,
|
||||
$data['artikel'] ?? null);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return (array) $this;
|
||||
}
|
||||
}
|
34
classes/Modules/MatrixProduct/Data/Translation.php
Normal file
34
classes/Modules/MatrixProduct/Data/Translation.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
namespace Xentral\Modules\MatrixProduct\Data;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
final class Translation implements JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public string $nameFrom,
|
||||
public string $languageTo,
|
||||
public string $nameTo,
|
||||
public ?int $id = null,
|
||||
public string $nameExternalFrom = '',
|
||||
public string $nameExternalTo = '',
|
||||
public string $languageFrom = 'DE'
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public static function fromDbArray(array $data): Translation {
|
||||
return new self($data['name_from'], $data['language_to'], $data['name_to'], $data['id'],
|
||||
$data['name_external_from'], $data['name_external_to'], $data['language_from']);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return (array) $this;
|
||||
}
|
||||
}
|
350
classes/Modules/MatrixProduct/MatrixProductGateway.php
Normal file
350
classes/Modules/MatrixProduct/MatrixProductGateway.php
Normal file
@ -0,0 +1,350 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
* SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
*/
|
||||
|
||||
namespace Xentral\Modules\MatrixProduct;
|
||||
|
||||
use Xentral\Components\Database\Database;
|
||||
use Xentral\Modules\MatrixProduct\Data\Group;
|
||||
use Xentral\Modules\MatrixProduct\Data\Option;
|
||||
use Xentral\Modules\MatrixProduct\Data\Translation;
|
||||
|
||||
final class MatrixProductGateway
|
||||
{
|
||||
/**
|
||||
* @param Database $db
|
||||
*/
|
||||
public function __construct(private readonly Database $db)
|
||||
{
|
||||
}
|
||||
|
||||
//region Groups
|
||||
public function GetGlobalGroupById(int $id) : Group {
|
||||
$sql = "SELECT * FROM matrixprodukt_eigenschaftengruppen WHERE id = :id";
|
||||
$res = $this->db->fetchRow($sql, ['id' => $id]);
|
||||
return Group::fromDbArray($res);
|
||||
}
|
||||
|
||||
public function GetArticleGroupById(int $id) : Group {
|
||||
$sql = "SELECT * FROM matrixprodukt_eigenschaftengruppen_artikel WHERE id = :id";
|
||||
$res = $this->db->fetchRow($sql, ['id' => $id]);
|
||||
return Group::fromDbArray($res);
|
||||
}
|
||||
|
||||
public function GetArticleGroupIdByName(int $articleId, string $name) : int {
|
||||
$sql = "SELECT id FROM matrixprodukt_eigenschaftengruppen_artikel
|
||||
WHERE name = :name AND artikel = :articleId";
|
||||
return $this->db->fetchValue($sql, [
|
||||
'name' => $name,
|
||||
'articleId' => $articleId
|
||||
]);
|
||||
}
|
||||
|
||||
public function GetArticleGroupsByArticleId(int $articleId) : array {
|
||||
$sql = "SELECT * FROM matrixprodukt_eigenschaftengruppen_artikel WHERE artikel = :articleId";
|
||||
$rows = $this->db->fetchAssoc($sql, ['articleId' => $articleId]);
|
||||
$res = [];
|
||||
foreach ($rows as $row) {
|
||||
$res[] = Group::fromDbArray($row);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function InsertGlobalGroup(Group $obj) : Group {
|
||||
$sql = "INSERT INTO matrixprodukt_eigenschaftengruppen
|
||||
(aktiv, name, name_ext, projekt, pflicht)
|
||||
VALUES
|
||||
(:active, :name, :nameExternal, :projectId, :required)";
|
||||
print_r($obj);
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
$obj->id = $this->db->lastInsertId();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function InsertArticleGroup(Group $obj) : Group {
|
||||
$sql = "INSERT INTO matrixprodukt_eigenschaftengruppen_artikel
|
||||
(artikel, aktiv, name, name_ext, projekt, sort, pflicht)
|
||||
VALUES
|
||||
(:articleId, :active, :name, :nameExternal, :projectId, :sort, :required)";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
$obj->id = $this->db->lastInsertId();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function UpdateGlobalGroup(Group $obj) : Group {
|
||||
$sql = "UPDATE matrixprodukt_eigenschaftengruppen
|
||||
SET aktiv = :active, name = :name, name_ext = :nameExternal, projekt = :projectId, pflicht = :required
|
||||
WHERE id = :id";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function UpdateArticleGroup(Group $obj) : Group {
|
||||
$sql = "UPDATE matrixprodukt_eigenschaftengruppen_artikel
|
||||
SET aktiv = :active, name = :name, name_ext = :nameExternal, projekt = :projectId, sort = :sort, pflicht = :required
|
||||
WHERE id = :id";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function DeleteGlobalGroup(int $id) : void {
|
||||
$sql = "UPDATE matrixprodukt_eigenschaftenoptionen_artikel moa
|
||||
JOIN matrixprodukt_eigenschaftenoptionen mo ON moa.matrixprodukt_eigenschaftenoptionen=mo.id
|
||||
JOIN matrixprodukt_eigenschaftengruppen mg ON mo.gruppe=mg.id
|
||||
SET moa.matrixprodukt_eigenschaftenoptionen=0
|
||||
WHERE mg.id = :id";
|
||||
$this->db->perform($sql, ['id' => $id]);
|
||||
$sql = "DELETE mg, mo
|
||||
FROM matrixprodukt_eigenschaftengruppen mg
|
||||
LEFT OUTER JOIN matrixprodukt_eigenschaftenoptionen mo ON mo.gruppe = mg.id
|
||||
WHERE mg.id = :id";
|
||||
$this->db->perform($sql, ['id' => $id]);
|
||||
}
|
||||
|
||||
public function DeleteArticleGroup(int $id) : void {
|
||||
$sql = "DELETE mga, moa, mota
|
||||
FROM matrixprodukt_eigenschaftengruppen_artikel mga
|
||||
LEFT OUTER JOIN matrixprodukt_eigenschaftenoptionen_artikel moa ON moa.gruppe = mga.id
|
||||
LEFT OUTER JOIN matrixprodukt_optionen_zu_artikel mota ON mota.option_id = moa.id
|
||||
WHERE mga.id = :id";
|
||||
$this->db->perform($sql, ['id' => $id]);
|
||||
}
|
||||
//endregion
|
||||
|
||||
//region Options
|
||||
public function GetGlobalOptionById(int $id) : Option {
|
||||
$sql = "SELECT * FROM matrixprodukt_eigenschaftenoptionen WHERE id = :id";
|
||||
$res = $this->db->fetchRow($sql, ['id' => $id]);
|
||||
return Option::fromDbArray($res);
|
||||
}
|
||||
|
||||
public function GetArticleOptionById(int $id) : Option {
|
||||
$sql = "SELECT * FROM matrixprodukt_eigenschaftenoptionen_artikel WHERE id = :id";
|
||||
$res = $this->db->fetchRow($sql, ['id' => $id]);
|
||||
return Option::fromDbArray($res);
|
||||
}
|
||||
|
||||
public function GetArticleOptionIdsByGroupIds(int|array $groupIds) : array {
|
||||
if (empty($groupIds))
|
||||
return [];
|
||||
$sql = "SELECT id FROM matrixprodukt_eigenschaftenoptionen WHERE gruppe IN (:ids)";
|
||||
return $this->db->fetchCol($sql, ['ids' => $groupIds]);
|
||||
}
|
||||
|
||||
public function GetArticleOptionIdByName(int $articleId, int $groupId, string $name) : int {
|
||||
$sql = "SELECT id FROM matrixprodukt_eigenschaftenoptionen_artikel
|
||||
WHERE name = :name AND artikel = :articleId AND gruppe = :groupId";
|
||||
return $this->db->fetchValue($sql, [
|
||||
'name' => $name,
|
||||
'articleId' => $articleId,
|
||||
'groupId' => $groupId
|
||||
]);
|
||||
}
|
||||
|
||||
public function GetArticleOptionsByArticleId(int $articleId) : array {
|
||||
$sql = "SELECT * FROM matrixprodukt_eigenschaftenoptionen_artikel WHERE artikel = :articleId";
|
||||
$rows = $this->db->fetchAssoc($sql, ['articleId' => $articleId]);
|
||||
$res = [];
|
||||
foreach ($rows as $row) {
|
||||
$res[] = Option::fromDbArray($row);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function GetSelectedOptionIdsByVariantId(int $variantId) : array {
|
||||
$sql = "SELECT option_id FROM matrixprodukt_optionen_zu_artikel WHERE artikel = :variantId";
|
||||
return $this->db->fetchCol($sql, ['variantId' => $variantId]);
|
||||
}
|
||||
|
||||
public function InsertGlobalOption(Option $obj) : Option {
|
||||
$sql = "INSERT INTO matrixprodukt_eigenschaftenoptionen
|
||||
(aktiv, name, name_ext, sort, gruppe, artikelnummer, articlenumber_suffix)
|
||||
VALUES
|
||||
(:active, :name, :nameExternal, :sort, :groupId, :articleNumber, :articleNumberSuffix)";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
$obj->id = $this->db->lastInsertId();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function InsertArticleOption(Option $obj) : Option {
|
||||
$sql = "INSERT INTO matrixprodukt_eigenschaftenoptionen_artikel
|
||||
(artikel, matrixprodukt_eigenschaftenoptionen, aktiv, name, name_ext, sort, gruppe, artikelnummer, articlenumber_suffix)
|
||||
VALUES
|
||||
(:articleId, :globalOptionId, :active, :name, :nameExternal, :sort, :groupId, :articleNumber, :articleNumberSuffix)";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
$obj->id = $this->db->lastInsertId();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function UpdateGlobalOption(Option $obj) : Option {
|
||||
$sql = "UPDATE matrixprodukt_eigenschaftenoptionen
|
||||
SET aktiv = :active, name = :name, name_ext = :nameExternal, sort = :sort, artikelnummer = :articleNumber,
|
||||
articlenumber_suffix = :articleNumberSuffix
|
||||
WHERE id = :id";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function UpdateArticleOption(Option $obj) : Option {
|
||||
$sql = "UPDATE matrixprodukt_eigenschaftenoptionen_artikel
|
||||
SET aktiv = :active, name = :name, name_ext = :nameExternal, sort = :sort, artikelnummer = :articleNumber,
|
||||
articlenumber_suffix = :articleNumberSuffix
|
||||
WHERE id = :id";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function DeleteGlobalOption(int $id) : void {
|
||||
$sql = "UPDATE matrixprodukt_eigenschaftenoptionen_artikel moa
|
||||
JOIN matrixprodukt_eigenschaftenoptionen mo ON moa.matrixprodukt_eigenschaftenoptionen=mo.id
|
||||
SET moa.matrixprodukt_eigenschaftenoptionen=0
|
||||
WHERE mo.id = :id";
|
||||
$this->db->perform($sql, ['id' => $id]);
|
||||
$sql = "DELETE moa
|
||||
FROM matrixprodukt_eigenschaftenoptionen mo
|
||||
WHERE mo.id = :id";
|
||||
$this->db->perform($sql, ['id' => $id]);
|
||||
}
|
||||
|
||||
public function DeleteArticleOption(int $id) : void {
|
||||
$sql = "DELETE moa, mota
|
||||
FROM matrixprodukt_eigenschaftenoptionen_artikel moa
|
||||
LEFT OUTER JOIN matrixprodukt_optionen_zu_artikel mota ON mota.option_id=moa.id
|
||||
WHERE moa.id = :id";
|
||||
$this->db->perform($sql, ['id' => $id]);
|
||||
}
|
||||
//endregion
|
||||
|
||||
//region Variants
|
||||
public function ReplaceVariant(int $oldId, int $newId) : void {
|
||||
$sql = "UPDATE matrixprodukt_optionen_zu_artikel SET artikel = :newId WHERE artikel = :oldId";
|
||||
$this->db->perform($sql, [
|
||||
'oldId' => $oldId,
|
||||
'newId' => $newId]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $variantId
|
||||
* @return int[]
|
||||
*/
|
||||
public function GetOptionIdsByVariant(int $variantId) : array {
|
||||
$sql = "SELECT option_id FROM matrixprodukt_optionen_zu_artikel WHERE artikel = :id";
|
||||
return $this->db->fetchCol($sql, ['id' => $variantId]);
|
||||
}
|
||||
|
||||
public function AddOptionToVariant(int $variantId, int $optionId) : void {
|
||||
$sql = "INSERT INTO matrixprodukt_optionen_zu_artikel (artikel, option_id) VALUES (:variantId, :optionId)";
|
||||
$this->db->perform($sql, [
|
||||
'variantId' => $variantId,
|
||||
'optionId' => $optionId
|
||||
]);
|
||||
}
|
||||
|
||||
public function DeleteOptionFromVariant(int $variantId, int $optionId) : void {
|
||||
$sql = "DELETE FROM matrixprodukt_optionen_zu_artikel WHERE artikel = :variantId AND option_id = :optionId";
|
||||
$this->db->perform($sql, [
|
||||
'variantId' => $variantId,
|
||||
'optionId' => $optionId
|
||||
]);
|
||||
}
|
||||
|
||||
public function GetVariantIdByOptions(array $optionIds) : ?int {
|
||||
if (empty($optionIds))
|
||||
return null;
|
||||
sort($optionIds);
|
||||
$sql = "SELECT artikel
|
||||
FROM matrixprodukt_optionen_zu_artikel
|
||||
WHERE option_id IN (:ids)
|
||||
GROUP BY artikel
|
||||
HAVING group_concat(option_id order by option_id separator ',') = :idList";
|
||||
$res = $this->db->fetchValue($sql, [
|
||||
'ids' => $optionIds,
|
||||
'idList' => join(',', $optionIds)
|
||||
]);
|
||||
return $res ?: null;
|
||||
}
|
||||
|
||||
public function GetVariantIdsByOptions(int|array $optionIds) : array
|
||||
{
|
||||
if (empty($optionIds))
|
||||
return [];
|
||||
$sql = "SELECT artikel FROM matrixprodukt_optionen_zu_artikel WHERE option_id IN (:ids)";
|
||||
return $this->db->fetchCol($sql, ['ids' => $optionIds]);
|
||||
}
|
||||
|
||||
public function DeleteVariantById(int $variantId) : void {
|
||||
$sql = "DELETE FROM matrixprodukt_optionen_zu_artikel WHERE artikel = :id";
|
||||
$this->db->perform($sql, ['id' => $variantId]);
|
||||
}
|
||||
|
||||
public function GetSuffixStringForOptionSet(array $optionIds) : string {
|
||||
$sql = "SELECT GROUP_CONCAT(IFNULL(NULLIF(mao.articlenumber_suffix,''), mao.id) ORDER BY mag.sort, mag.id SEPARATOR '_')
|
||||
FROM matrixprodukt_eigenschaftenoptionen_artikel mao
|
||||
JOIN matrixprodukt_eigenschaftengruppen_artikel mag ON mao.gruppe = mag.id
|
||||
WHERE mao.id IN (:idList)";
|
||||
$res = $this->db->fetchValue($sql, ['idList' => $optionIds]);
|
||||
return $res;
|
||||
}
|
||||
//endregion
|
||||
|
||||
//region Translations
|
||||
public function GetGroupTranslationById(int $id) : Translation {
|
||||
$sql = "SELECT * FROM matrix_article_translation WHERE id = :id";
|
||||
$row = $this->db->fetchRow($sql, ['id' => $id]);
|
||||
return Translation::fromDbArray($row);
|
||||
}
|
||||
|
||||
public function GetOptionTranslationById(int $id) : Translation {
|
||||
$sql = "SELECT * FROM matrix_article_options_translation WHERE id = :id";
|
||||
$row = $this->db->fetchRow($sql, ['id' => $id]);
|
||||
return Translation::fromDbArray($row);
|
||||
}
|
||||
|
||||
public function InsertGroupTranslation(Translation $obj) : Translation {
|
||||
$sql = "INSERT INTO matrix_article_translation
|
||||
(language_from, language_to, name_from, name_to, name_external_from, name_external_to)
|
||||
VALUES (:languageFrom, :languageTo, :nameFrom, :nameTo, :nameExternalFrom, :nameExternalTo)";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
$obj->id = $this->db->lastInsertId();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function InsertOptionTranslation(Translation $obj) : Translation {
|
||||
$sql = "INSERT INTO matrix_article_options_translation
|
||||
(language_from, language_to, name_from, name_to, name_external_from, name_external_to)
|
||||
VALUES (:languageFrom, :languageTo, :nameFrom, :nameTo, :nameExternalFrom, :nameExternalTo)";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
$obj->id = $this->db->lastInsertId();
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function UpdateGroupTranslation(Translation $obj) : Translation {
|
||||
$sql = "UPDATE matrix_article_translation SET language_from = :languageFrom, language_to = :languageTo,
|
||||
name_from = :nameFrom, name_to = :nameTo, name_external_from = :nameExternalFrom,
|
||||
name_external_to = :nameExternalTo WHERE id = :id";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function UpdateOptionTranslation(Translation $obj) : Translation {
|
||||
$sql = "UPDATE matrix_article_options_translation SET language_from = :languageFrom, language_to = :languageTo,
|
||||
name_from = :nameFrom, name_to = :nameTo, name_external_from = :nameExternalFrom,
|
||||
name_external_to = :nameExternalTo WHERE id = :id";
|
||||
$this->db->perform($sql, (array)$obj);
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function DeleteGroupTranslation(int $id) : void {
|
||||
$sql = "DELETE FROM matrix_article_translation WHERE id = :id";
|
||||
$this->db->perform($sql, ['id' => $id]);
|
||||
}
|
||||
|
||||
public function DeleteOptionTranslation(int $id) : void {
|
||||
$sql = "DELETE FROM matrix_article_options_translation WHERE id = :id";
|
||||
$this->db->perform($sql, ['id' => $id]);
|
||||
}
|
||||
//endregion
|
||||
}
|
221
classes/Modules/MatrixProduct/MatrixProductService.php
Normal file
221
classes/Modules/MatrixProduct/MatrixProductService.php
Normal file
@ -0,0 +1,221 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
* SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
*/
|
||||
|
||||
namespace Xentral\Modules\MatrixProduct;
|
||||
|
||||
use Xentral\Components\Database\Database;
|
||||
use Xentral\Modules\Article\Gateway\ArticleGateway;
|
||||
use Xentral\Modules\MatrixProduct\Data\Option;
|
||||
use Xentral\Modules\MatrixProduct\Data\Group;
|
||||
use Xentral\Modules\MatrixProduct\Data\Translation;
|
||||
|
||||
final class MatrixProductService
|
||||
{
|
||||
/**
|
||||
* @param Database $db
|
||||
* @param MatrixProductGateway $gateway
|
||||
* @param ArticleGateway $articleGateway
|
||||
*/
|
||||
public function __construct(
|
||||
private readonly Database $db,
|
||||
private readonly MatrixProductGateway $gateway,
|
||||
private readonly ArticleGateway $articleGateway)
|
||||
{ }
|
||||
|
||||
//region Groups
|
||||
public function GetGlobalGroupById(int $id) : Group {
|
||||
return $this->gateway->GetGlobalGroupById($id);
|
||||
}
|
||||
|
||||
public function GetArticleGroupById(int $id) : Group {
|
||||
return $this->gateway->GetArticleGroupById($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $articleId
|
||||
* @return Group[]
|
||||
*/
|
||||
public function GetArticleGroupsByArticleId(int $articleId) : array {
|
||||
return $this->gateway->GetArticleGroupsByArticleId($articleId);
|
||||
}
|
||||
|
||||
public function SaveGlobalGroup(Group $obj) : void {
|
||||
if ($obj->id > 0)
|
||||
$this->gateway->UpdateGlobalGroup($obj);
|
||||
else
|
||||
$this->gateway->InsertGlobalGroup($obj);
|
||||
}
|
||||
|
||||
public function SaveArticleGroup(Group $obj) : void {
|
||||
if ($obj->id > 0) {
|
||||
$this->gateway->UpdateArticleGroup($obj);
|
||||
} else {
|
||||
$this->gateway->InsertArticleGroup($obj);
|
||||
}
|
||||
}
|
||||
|
||||
public function DeleteGlobalGroup(int $id) : void {
|
||||
$this->gateway->DeleteGlobalGroup($id);
|
||||
}
|
||||
|
||||
public function DeleteArticleGroup(int $id) : bool {
|
||||
$options = $this->gateway->GetArticleOptionIdsByGroupIds($id);
|
||||
$variants = $this->gateway->GetVariantIdsByOptions($options);
|
||||
if (!empty($variants))
|
||||
return false;
|
||||
$this->gateway->DeleteArticleGroup($id);
|
||||
return true;
|
||||
}
|
||||
//endregion
|
||||
|
||||
//region Options
|
||||
public function GetGlobalOptionById(int $id) : Option {
|
||||
return $this->gateway->GetGlobalOptionById($id);
|
||||
}
|
||||
|
||||
public function GetArticleOptionById(int $id) : Option {
|
||||
return $this->gateway->GetArticleOptionById($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $articleId
|
||||
* @return Option[]
|
||||
*/
|
||||
public function GetArticleOptionsByArticleId(int $articleId) : array {
|
||||
return $this->gateway->GetArticleOptionsByArticleId($articleId);
|
||||
}
|
||||
|
||||
public function GetSelectedOptionIdsByVariantId(int $variantId) : array {
|
||||
return $this->gateway->GetSelectedOptionIdsByVariantId($variantId);
|
||||
}
|
||||
|
||||
public function SaveGlobalOption(Option $obj) : void {
|
||||
if ($obj->id > 0) {
|
||||
$this->gateway->UpdateGlobalOption($obj);
|
||||
} else {
|
||||
$this->gateway->InsertGlobalOption($obj);
|
||||
}
|
||||
}
|
||||
|
||||
public function SaveArticleOption(Option $obj) : void {
|
||||
if ($obj->id > 0) {
|
||||
$this->gateway->UpdateArticleOption($obj);
|
||||
} else {
|
||||
$this->gateway->InsertArticleOption($obj);
|
||||
}
|
||||
}
|
||||
|
||||
public function DeleteGlobalOption(int $id) : void {
|
||||
$this->gateway->DeleteGlobalOption($id);
|
||||
}
|
||||
|
||||
public function DeleteArticleOption(int $id) : bool {
|
||||
$variants = $this->gateway->GetVariantIdsByOptions($id);
|
||||
if (!empty($variants))
|
||||
return false;
|
||||
$this->gateway->DeleteArticleOption($id);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function AddGlobalOptionsForArticle(int $articleId, int|array $optionIds): void
|
||||
{
|
||||
$sql = "SELECT mg.name groupname, mg.name_ext groupnameext, mg.projekt as groupprojekt, mg.pflicht as grouprequired, mo.*
|
||||
FROM matrixprodukt_eigenschaftenoptionen mo
|
||||
JOIN matrixprodukt_eigenschaftengruppen mg on mo.gruppe=mg.id
|
||||
WHERE mo.id IN (:optionIds)";
|
||||
$optionArr = $this->db->fetchAll($sql, ['optionIds' => $optionIds]);
|
||||
foreach ($optionArr as $option) {
|
||||
$groupId = $this->gateway->GetArticleGroupIdByName($articleId, $option['groupname']);
|
||||
if (!$groupId) {
|
||||
$obj = new Group(
|
||||
name: $option['groupname'],
|
||||
nameExternal: $option['groupnameext'],
|
||||
projectId: $option['groupprojekt'],
|
||||
required: $option['grouprequired'],
|
||||
articleId: $articleId);
|
||||
$group = $this->gateway->InsertArticleGroup($obj);
|
||||
$groupId = $group->id;
|
||||
}
|
||||
$optionId = $this->gateway->GetArticleOptionIdByName($articleId, $groupId, $option['name']);
|
||||
if (!$optionId) {
|
||||
$obj = new Option(
|
||||
name: $option['name'],
|
||||
groupId: $groupId,
|
||||
nameExternal: $option['name_ext'],
|
||||
sort: $option['sort'],
|
||||
articleNumberSuffix: $option['articlenumber_suffix'],
|
||||
globalOptionId: $option['id'],
|
||||
articleId: $articleId);
|
||||
$this->gateway->InsertArticleOption($obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
//endregion
|
||||
|
||||
//region Variants
|
||||
public function GetVariantIdByOptionSet(array $optionIds) : ?int {
|
||||
return $this->gateway->GetVariantIdByOptions($optionIds);
|
||||
}
|
||||
public function GetSuffixStringForOptionSet(array $optionIds) : string
|
||||
{
|
||||
return $this->gateway->GetSuffixStringForOptionSet($optionIds);
|
||||
}
|
||||
public function SaveVariant(int $articleId, int $variantId, array $optionIds, ?int $oldVariantId = null) : bool|string {
|
||||
if ($oldVariantId != null && $oldVariantId != $variantId) {
|
||||
$this->gateway->ReplaceVariant($oldVariantId, $variantId);
|
||||
$this->articleGateway->SetVariantStatus($oldVariantId, null);
|
||||
}
|
||||
$variantWithOptionSet = $this->gateway->GetVariantIdByOptions($optionIds);
|
||||
if ($variantWithOptionSet != null && $variantWithOptionSet != $variantId)
|
||||
return 'Diese Optionen wurden bereits einer anderen Variante zugewiesen';
|
||||
|
||||
$existingIds = $this->gateway->GetOptionIdsByVariant($variantId);
|
||||
$toDelete = array_diff($existingIds, $optionIds);
|
||||
$toCreate = array_diff($optionIds, $existingIds);
|
||||
foreach ($toDelete as $item)
|
||||
$this->gateway->DeleteOptionFromVariant($variantId, $item);
|
||||
foreach ($toCreate as $item)
|
||||
$this->gateway->AddOptionToVariant($variantId, $item);
|
||||
$this->articleGateway->SetVariantStatus($variantId, $articleId);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function DeleteVariant(int $variantId) : void {
|
||||
$this->gateway->DeleteVariantById($variantId);
|
||||
$this->articleGateway->SetVariantStatus($variantId, null);
|
||||
}
|
||||
//endregion
|
||||
|
||||
//region Translations
|
||||
public function GetGroupTranslation(int $id) : Translation {
|
||||
return $this->gateway->GetGroupTranslationById($id);
|
||||
}
|
||||
|
||||
public function GetOptionTranslation(int $id) : Translation {
|
||||
return $this->gateway->GetOptionTranslationById($id);
|
||||
}
|
||||
|
||||
public function SaveGroupTranslation(Translation $obj) : Translation {
|
||||
if ($obj->id > 0)
|
||||
return $this->gateway->UpdateGroupTranslation($obj);
|
||||
return $this->gateway->InsertGroupTranslation($obj);
|
||||
}
|
||||
|
||||
public function SaveOptionTranslation(Translation $obj) : Translation {
|
||||
if ($obj->id > 0)
|
||||
return $this->gateway->UpdateOptionTranslation($obj);
|
||||
return $this->gateway->InsertOptionTranslation($obj);
|
||||
}
|
||||
|
||||
public function DeleteGroupTranslation(int $id) : void {
|
||||
$this->gateway->DeleteGroupTranslation($id);
|
||||
}
|
||||
|
||||
public function DeleteOptionTranslation(int $id) : void {
|
||||
$this->gateway->DeleteOptionTranslation($id);
|
||||
}
|
||||
//endregion
|
||||
}
|
58
classes/Modules/MatrixProduct/www/js/AddGlobalToArticle.vue
Normal file
58
classes/Modules/MatrixProduct/www/js/AddGlobalToArticle.vue
Normal file
@ -0,0 +1,58 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023-2024 Andreas Palm
|
||||
|
||||
SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
-->
|
||||
|
||||
<script setup>
|
||||
import {ref, onMounted} from "vue";
|
||||
import axios from "axios";
|
||||
import Dialog from "primevue/dialog";
|
||||
import Listbox from "primevue/listbox";
|
||||
import Fluid from "primevue/fluid";
|
||||
import Button from "primevue/button";
|
||||
import {AlertErrorHandler} from '@res/js/ajaxErrorHandler';
|
||||
|
||||
const props = defineProps({
|
||||
articleId: String
|
||||
})
|
||||
const emit = defineEmits(['save', 'close']);
|
||||
|
||||
const model = ref(null);
|
||||
const group = ref(null);
|
||||
const selected = ref([]);
|
||||
onMounted(async () => {
|
||||
model.value = await fetch('index.php?module=matrixprodukt&action=list&cmd=selectoptions')
|
||||
.then(x => x.json())
|
||||
})
|
||||
async function save() {
|
||||
await axios.post('index.php?module=matrixprodukt&action=artikel&cmd=addoptions', {
|
||||
articleId: props.articleId,
|
||||
optionIds: selected.value
|
||||
})
|
||||
.then(() => {emit('save')})
|
||||
.catch(AlertErrorHandler);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog visible modal header="Globale Optionen hinzufügen" style="width: 500px" @update:visible="emit('close')">
|
||||
<Fluid>
|
||||
<div v-if="model" class="grid gap-1" style="grid-template-columns: 25% 75%">
|
||||
<label for="matrixProductOptions" style="padding-top: 5px;">Optionen:</label>
|
||||
<Listbox multiple
|
||||
:options="model"
|
||||
option-group-label="name"
|
||||
option-group-children="options"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
list-style="height: 200px"
|
||||
v-model="selected" />
|
||||
</div>
|
||||
</Fluid>
|
||||
<template #footer>
|
||||
<Button label="ABBRECHEN" @click="emit('close')" />
|
||||
<Button label="HINZUFÜGEN" @click="save" :disabled="selected.length === 0"/>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
82
classes/Modules/MatrixProduct/www/js/App.vue
Normal file
82
classes/Modules/MatrixProduct/www/js/App.vue
Normal file
@ -0,0 +1,82 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
|
||||
SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
-->
|
||||
|
||||
<script setup>
|
||||
import axios from "axios";
|
||||
import {ref} from 'vue';
|
||||
import {reloadDataTables} from "@res/js/jqueryBridge";
|
||||
import AddGlobalToArticle from "./AddGlobalToArticle.vue";
|
||||
import GroupEdit from "./GroupEdit.vue";
|
||||
import OptionEdit from "./OptionEdit.vue";
|
||||
import Variant from "./Variant.vue";
|
||||
import Translation from "./Translation.vue";
|
||||
import CreateMissing from "./CreateMissing.vue";
|
||||
|
||||
const model = ref(null);
|
||||
|
||||
document.getElementById('main').addEventListener('click', async (ev) => {
|
||||
const target = ev.target;
|
||||
if (!target || !target.classList.contains('vueAction'))
|
||||
return;
|
||||
const ds = target.dataset;
|
||||
if (ds.action.endsWith('Delete')) {
|
||||
const cnf = confirm('Wirklich löschen?');
|
||||
if (!cnf)
|
||||
return;
|
||||
let url;
|
||||
switch (ds.action) {
|
||||
case 'groupDelete':
|
||||
url = ds.articleId > 0
|
||||
? 'index.php?module=matrixprodukt&action=artikel&cmd=groupdelete'
|
||||
: 'index.php?module=matrixprodukt&action=list&cmd=delete';
|
||||
await axios.post(url, {groupId: ds.groupId});
|
||||
break;
|
||||
case 'optionDelete':
|
||||
url = ds.articleId > 0
|
||||
? 'index.php?module=matrixprodukt&action=artikel&cmd=optiondelete'
|
||||
: 'index.php?module=matrixprodukt&action=optionenlist&cmd=delete';
|
||||
await axios.post(url, {optionId: ds.optionId});
|
||||
break;
|
||||
case 'variantDelete':
|
||||
url = 'index.php?module=matrixprodukt&action=artikel&cmd=variantdelete';
|
||||
await axios.post(url, {variantId: ds.variantId});
|
||||
break;
|
||||
case 'translationDelete':
|
||||
url = 'index.php?module=matrixprodukt&action=translation&cmd=delete';
|
||||
await axios.post(url, {id: ds.id, type: ds.type});
|
||||
break;
|
||||
}
|
||||
onSave();
|
||||
return;
|
||||
}
|
||||
|
||||
model.value = ds;
|
||||
});
|
||||
|
||||
function onSave() {
|
||||
reloadDataTables();
|
||||
onClose();
|
||||
}
|
||||
|
||||
function onGroupSave() {
|
||||
location.reload();
|
||||
}
|
||||
|
||||
function onClose() {
|
||||
model.value = null;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<template v-if="model">
|
||||
<AddGlobalToArticle v-if="model.action === 'addGlobalToArticle'" v-bind="model" @close="onClose" @save="onGroupSave" />
|
||||
<GroupEdit v-else-if="model.action === 'groupEdit'" v-bind="model" @close="onClose" @save="onGroupSave" />
|
||||
<OptionEdit v-else-if="model.action === 'optionEdit'" v-bind="model" @close="onClose" @save="onSave" />
|
||||
<Variant v-else-if="model.action === 'variantEdit'" v-bind="model" @close="onClose" @save="onSave" />
|
||||
<CreateMissing v-else-if="model.action === 'createMissing'" v-bind="model" @close="onClose" @save="onSave" />
|
||||
<Translation v-else-if="model.action === 'translationEdit'" v-bind="model" @close="onClose" @save="onSave" />
|
||||
</template>
|
||||
</template>
|
62
classes/Modules/MatrixProduct/www/js/CreateMissing.vue
Normal file
62
classes/Modules/MatrixProduct/www/js/CreateMissing.vue
Normal file
@ -0,0 +1,62 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023-2024 Andreas Palm
|
||||
|
||||
SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
-->
|
||||
|
||||
<script setup>
|
||||
import Button from "primevue/button";
|
||||
import Dialog from "primevue/dialog";
|
||||
import MultiSelect from "primevue/multiselect";
|
||||
import Fluid from "primevue/fluid";
|
||||
import InputText from "primevue/inputtext";
|
||||
import {onMounted, ref} from "vue";
|
||||
import axios from "axios";
|
||||
import {AlertErrorHandler} from "@res/js/ajaxErrorHandler";
|
||||
|
||||
const props = defineProps({
|
||||
articleId: String,
|
||||
});
|
||||
const emit = defineEmits(['save', 'close']);
|
||||
|
||||
const model = ref({});
|
||||
|
||||
onMounted(async () => {
|
||||
model.value = await axios.get('index.php?module=matrixprodukt&action=artikel&cmd=createMissing', {
|
||||
params: {...props}
|
||||
}).then(response => {
|
||||
return {...props, ...response.data}
|
||||
})
|
||||
})
|
||||
|
||||
async function save() {
|
||||
await axios.post('index.php?module=matrixprodukt&action=artikel&cmd=createMissing', {...props, ...model.value})
|
||||
.catch(AlertErrorHandler)
|
||||
.then(() => {
|
||||
emit('save')
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog visible modal header="Variante" style="width: 500px" @update:visible="emit('close')">
|
||||
<Fluid>
|
||||
<div class="grid gap-1" style="grid-template-columns: 25% 75%;" autofocus>
|
||||
<label>Trennzeichen:</label>
|
||||
<InputText v-model="model.separator" maxlength="2" />
|
||||
<template v-for="group in model.groups">
|
||||
<label>{{ group.name }}</label>
|
||||
<MultiSelect v-model="group.selected" :options="group.options" option-label="name" option-value="value"/>
|
||||
</template>
|
||||
</div>
|
||||
</Fluid>
|
||||
<template #footer>
|
||||
<Button label="ABBRECHEN" @click="emit('close')"/>
|
||||
<Button label="ERSTELLEN" @click="save"/>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
78
classes/Modules/MatrixProduct/www/js/GroupEdit.vue
Normal file
78
classes/Modules/MatrixProduct/www/js/GroupEdit.vue
Normal file
@ -0,0 +1,78 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023-2024 Andreas Palm
|
||||
|
||||
SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
-->
|
||||
|
||||
<script setup>
|
||||
import {ref, onMounted} from "vue";
|
||||
import axios from "axios";
|
||||
import Dialog from "primevue/dialog";
|
||||
import Button from "primevue/button";
|
||||
import InputText from "primevue/inputtext";
|
||||
import InputNumber from "primevue/inputnumber";
|
||||
import Checkbox from "primevue/checkbox";
|
||||
import Fluid from "primevue/fluid";
|
||||
import {AlertErrorHandler} from "@res/js/ajaxErrorHandler";
|
||||
import AutoComplete from "@res/vue/AutoComplete.vue";
|
||||
|
||||
const props = defineProps({
|
||||
groupId: String,
|
||||
articleId: String
|
||||
});
|
||||
const emit = defineEmits(['save', 'close']);
|
||||
|
||||
const model = ref({});
|
||||
|
||||
onMounted(async () => {
|
||||
if (props.groupId > 0) {
|
||||
const url = props.articleId > 0
|
||||
? 'index.php?module=matrixprodukt&action=artikel&cmd=groupedit'
|
||||
: 'index.php?module=matrixprodukt&action=list&cmd=edit';
|
||||
model.value = await axios.get(url, {
|
||||
params: props
|
||||
}).then(response => response.data)
|
||||
}
|
||||
})
|
||||
|
||||
async function save() {
|
||||
if (!parseInt(props.groupId) > 0)
|
||||
model.value.groupId = 0;
|
||||
const url = props.articleId > 0
|
||||
? 'index.php?module=matrixprodukt&action=artikel&cmd=groupsave'
|
||||
: 'index.php?module=matrixprodukt&action=list&cmd=save';
|
||||
await axios.post(url, {...props, ...model.value})
|
||||
.catch(AlertErrorHandler)
|
||||
.then(() => {emit('save')});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog visible modal header="Gruppe anlegen/bearbeiten" style="width: 500px" @update:visible="emit('close')">
|
||||
<Fluid>
|
||||
<div class="grid gap-1" style="grid-template-columns: 25% 75%">
|
||||
<label for="matrixProduct_group_name">Name:</label>
|
||||
<InputText id="matrixProduct_group_name" v-model="model.name" autofocus required />
|
||||
<label for="matrixProduct_group_nameExternal">Name Extern:</label>
|
||||
<InputText id="matrixProduct_group_nameExternal" v-model="model.nameExternal" />
|
||||
<label for="matrixProduct_group_project">Projekt:</label>
|
||||
<AutoComplete input-id="matrixProduct_group_project"
|
||||
v-model="model.project"
|
||||
:optionLabel="item => [item.abkuerzung, item.name].join(' ')"
|
||||
ajaxFilter="projektname"
|
||||
forceSelection
|
||||
/>
|
||||
<label v-if="articleId" for="matrixProduct_group_sort">Sortierung:</label>
|
||||
<InputNumber v-if="articleId" v-model="model.sort" input-id="matrixProduct_group_sort" show-buttons />
|
||||
<label for="matrixProduct_group_required">Pflicht:</label>
|
||||
<Checkbox v-model="model.required" binary />
|
||||
<label for="matrixProduct_group_active">Aktiv:</label>
|
||||
<Checkbox v-model="model.active" binary />
|
||||
</div>
|
||||
</Fluid>
|
||||
<template #footer>
|
||||
<Button label="ABBRECHEN" @click="emit('close')" />
|
||||
<Button label="SPEICHERN" @click="save" :disabled="!model.name"/>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
69
classes/Modules/MatrixProduct/www/js/OptionEdit.vue
Normal file
69
classes/Modules/MatrixProduct/www/js/OptionEdit.vue
Normal file
@ -0,0 +1,69 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023-2024 Andreas Palm
|
||||
|
||||
SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
-->
|
||||
|
||||
<script setup>
|
||||
import {ref, onMounted} from "vue";
|
||||
import axios from "axios";
|
||||
import Button from "primevue/button";
|
||||
import Dialog from "primevue/dialog";
|
||||
import Fluid from "primevue/fluid";
|
||||
import InputText from "primevue/inputtext";
|
||||
import InputNumber from "primevue/inputnumber";
|
||||
import Checkbox from "primevue/checkbox";
|
||||
import {AlertErrorHandler} from "@res/js/ajaxErrorHandler";
|
||||
|
||||
const props = defineProps({
|
||||
optionId: String,
|
||||
groupId: String,
|
||||
articleId: String
|
||||
});
|
||||
const emit = defineEmits(['save', 'close']);
|
||||
|
||||
const model = ref({});
|
||||
|
||||
onMounted(async () => {
|
||||
if (props.optionId > 0) {
|
||||
const url = props.articleId > 0
|
||||
? 'index.php?module=matrixprodukt&action=artikel&cmd=optionedit'
|
||||
: 'index.php?module=matrixprodukt&action=optionenlist&cmd=edit';
|
||||
model.value = await axios.get(url, {
|
||||
params: props
|
||||
}).then(response => response.data)
|
||||
}
|
||||
})
|
||||
|
||||
async function save() {
|
||||
const url = props.articleId > 0
|
||||
? 'index.php?module=matrixprodukt&action=artikel&cmd=optionsave'
|
||||
: 'index.php?module=matrixprodukt&action=optionenlist&cmd=save';
|
||||
await axios.post(url, {...props, ...model.value})
|
||||
.then(() => {emit('save')})
|
||||
.catch(AlertErrorHandler);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog visible modal header="Option anlegen/bearbeiten" style="width: 500px" @update:visible="emit('close')">
|
||||
<Fluid>
|
||||
<div class="grid gap-1" style="grid-template-columns: 25% 75%">
|
||||
<label for="matrixProduct_option_name">Name:</label>
|
||||
<InputText id="matrixProduct_option_name" v-model="model.name" required autofocus />
|
||||
<label for="matrixProduct_option_nameExternal">Name Extern:</label>
|
||||
<InputText id="matrixProduct_option_nameExternal" v-model="model.nameExternal" />
|
||||
<label for="matrixProduct_option_articleNumberSuffix">Artikelnummer-Suffix:</label>
|
||||
<InputText id="matrixProduct_option_articleNumberSuffix" v-model="model.articleNumberSuffix" />
|
||||
<label for="matrixProduct_option_sort">Sortierung:</label>
|
||||
<InputNumber input-id="matrixProduct_option_sort" v-model="model.sort" show-buttons />
|
||||
<label for="matrixProduct_option_active">Aktiv:</label>
|
||||
<Checkbox input-id="matrixProduct_option_active" v-model="model.active" binary />
|
||||
</div>
|
||||
</Fluid>
|
||||
<template #footer>
|
||||
<Button label="ABBRECHEN" @click="emit('close')" />
|
||||
<Button label="SPEICHERN" @click="save" :disabled="!model.name" />
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
89
classes/Modules/MatrixProduct/www/js/Translation.vue
Normal file
89
classes/Modules/MatrixProduct/www/js/Translation.vue
Normal file
@ -0,0 +1,89 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023-2024 Andreas Palm
|
||||
|
||||
SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
-->
|
||||
|
||||
<script setup>
|
||||
import {ref, onMounted} from "vue";
|
||||
import axios from "axios";
|
||||
import Dialog from "primevue/dialog";
|
||||
import Button from "primevue/button";
|
||||
import Fluid from "primevue/fluid";
|
||||
import InputText from "primevue/inputtext";
|
||||
import Select from "primevue/select";
|
||||
import {AlertErrorHandler} from "@res/js/ajaxErrorHandler";
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
type: String,
|
||||
id: String,
|
||||
});
|
||||
const emit = defineEmits(['save', 'close']);
|
||||
|
||||
const model = ref({});
|
||||
const languages = ref([]);
|
||||
|
||||
onMounted(async () => {
|
||||
if (props.id > 0) {
|
||||
const url = 'index.php?module=matrixprodukt&action=translation&cmd=edit';
|
||||
model.value = await axios.get(url, {
|
||||
params: props
|
||||
}).then(response => response.data)
|
||||
}
|
||||
axios.get('index.php',
|
||||
{
|
||||
params: {
|
||||
module: 'ajax',
|
||||
action: 'filter',
|
||||
filtername: 'activelanguages',
|
||||
object: true
|
||||
}
|
||||
}).then(response => {
|
||||
languages.value = response.data;
|
||||
});
|
||||
})
|
||||
|
||||
async function save() {
|
||||
if (!parseInt(props.id) > 0)
|
||||
model.value.id = 0;
|
||||
const url = 'index.php?module=matrixprodukt&action=translation&cmd=save';
|
||||
await axios.post(url, {...props, ...model.value})
|
||||
.catch(AlertErrorHandler)
|
||||
.then(() => {emit('save')});
|
||||
}
|
||||
|
||||
function ready() {
|
||||
if (model.value.nameExternalFrom && !model.value.nameExternalTo)
|
||||
return false;
|
||||
return model.value.languageTo && model.value.nameFrom && model.value.nameTo;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog visible modal header="Übersetzung anlegen/bearbeiten" style="width: 500px" @update:visible="emit('close')">
|
||||
<Fluid>
|
||||
<div class="grid gap-1" style="grid-template-columns: 25% 75%">
|
||||
<label for="matrixProduct_nameFrom">DE Name:</label>
|
||||
<InputText v-model="model.nameFrom" required autofocus />
|
||||
<label for="matrixProduct_nameExternalFrom">DE Name Extern:</label>
|
||||
<InputText v-model="model.nameExternalFrom" />
|
||||
<label for="matrixProduct_languageTo">Sprache:</label>
|
||||
<Select
|
||||
v-model="model.languageTo"
|
||||
:options="languages"
|
||||
option-label="bezeichnung_de"
|
||||
option-value="iso"
|
||||
/>
|
||||
<label for="matrixProduct_nameTo">Übersetzung Name:</label>
|
||||
<InputText v-model="model.nameTo" required />
|
||||
<label for="matrixProduct_nameTo">Übersetzung Name Extern:</label>
|
||||
<InputText v-model="model.nameExternalTo" :required="model.nameExternalFrom" />
|
||||
</div>
|
||||
</Fluid>
|
||||
<template #footer>
|
||||
<Button label="ABBRECHEN" @click="emit('close')" />
|
||||
<Button label="SPEICHERN" @click="save" :disabled="!ready()"/>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
65
classes/Modules/MatrixProduct/www/js/Variant.vue
Normal file
65
classes/Modules/MatrixProduct/www/js/Variant.vue
Normal file
@ -0,0 +1,65 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023-2024 Andreas Palm
|
||||
|
||||
SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
-->
|
||||
|
||||
<script setup>
|
||||
import AutoComplete from "@res/vue/AutoComplete.vue";
|
||||
import Button from "primevue/button";
|
||||
import Dialog from "primevue/dialog";
|
||||
import Select from "primevue/select";
|
||||
import Fluid from "primevue/fluid";
|
||||
import {onMounted, ref} from "vue";
|
||||
import axios from "axios";
|
||||
import {AlertErrorHandler} from "@res/js/ajaxErrorHandler";
|
||||
|
||||
const props = defineProps({
|
||||
articleId: String,
|
||||
variantId: String,
|
||||
});
|
||||
const emit = defineEmits(['save', 'close']);
|
||||
|
||||
const model = ref({});
|
||||
|
||||
onMounted(async () => {
|
||||
model.value = await axios.get('index.php?module=matrixprodukt&action=artikel&cmd=variantedit', {
|
||||
params: {...props}
|
||||
}).then(response => { return {...props, ...response.data}})
|
||||
})
|
||||
|
||||
async function save() {
|
||||
await axios.post('index.php?module=matrixprodukt&action=artikel&cmd=variantsave', {...props, ...model.value})
|
||||
.catch(AlertErrorHandler)
|
||||
.then(() => {emit('save')});
|
||||
}
|
||||
|
||||
const buttons = {
|
||||
abbrechen: () => emit('close'),
|
||||
speichern: save
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog visible modal header="Variante" style="width: 500px" @update:visible="emit('close')">
|
||||
<Fluid>
|
||||
<div class="grid gap-1" style="grid-template-columns: 25% 75%;">
|
||||
<label>Artikel</label>
|
||||
<AutoComplete v-model="model.variant"
|
||||
:option-label="(item) => [item.nummer, item.name].join(' ')"
|
||||
ajax-filter="artikelnummer"
|
||||
force-selection
|
||||
autofocus
|
||||
/>
|
||||
<template v-for="group in model.groups">
|
||||
<label>{{ group.name }}</label>
|
||||
<Select v-model="group.selected" :options="group.options" option-label="name" option-value="value" />
|
||||
</template>
|
||||
</div>
|
||||
</Fluid>
|
||||
<template #footer>
|
||||
<Button label="ABBRECHEN" @click="emit('close')" />
|
||||
<Button label="SPEICHERN" @click="save" />
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
8
classes/Modules/MatrixProduct/www/js/entry.js
Normal file
8
classes/Modules/MatrixProduct/www/js/entry.js
Normal file
@ -0,0 +1,8 @@
|
||||
// SPDX-FileCopyrightText: 2023-2024 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
|
||||
import App from "./App.vue";
|
||||
import {createVueApp} from "@res/js/vue";
|
||||
|
||||
createVueApp(App).mount('#vueapp')
|
@ -1,86 +0,0 @@
|
||||
$(document).ready(function() {
|
||||
$('a.groupheadline').on('click',function(){
|
||||
if(parseInt($(this).data('id')) > 0) {
|
||||
$('#GroupheadlineDialogGroupId').val($(this).data('id'));
|
||||
$('#GroupheadlineDialogArticleId').val($(this).data('article'));
|
||||
$('#GroupheadlineDialogGroupName').val($(this).data('name'));
|
||||
$('#GroupheadlineDialog').dialog('open');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#GroupheadlineDialog').dialog(
|
||||
{
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
minWidth: 940,
|
||||
title:'',
|
||||
buttons: {
|
||||
'ABBRECHEN': function() {
|
||||
$(this).dialog('close');
|
||||
},
|
||||
'ÄNDERN': function()
|
||||
{
|
||||
if($('#GroupheadlineDialogGroupName').val()+'' !== '') {
|
||||
$.ajax({
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=changegroupname',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
groupId: $('#GroupheadlineDialogGroupId').val(),
|
||||
groupName: $('#GroupheadlineDialogGroupName').val()
|
||||
},
|
||||
success: function (data) {
|
||||
if(typeof data.status != 'undefined' && data.status == 1) {
|
||||
window.location.href = window.location.href.split('#')[0];
|
||||
}
|
||||
},
|
||||
beforeSend: function () {
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
alert('Bitte eine Bezeichnung angeben');
|
||||
}
|
||||
},
|
||||
'LÖSCHEN': function() {
|
||||
$.ajax({
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=deletegroup',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
groupId: $('#GroupheadlineDialogGroupId').val()
|
||||
},
|
||||
success: function(data) {
|
||||
if(typeof data.status != 'undefined' && data.status == 1) {
|
||||
if (typeof data.confirm != 'undefined' && data.confirm == 1) {
|
||||
if(confirm('Die Gruppe enthält Option, sollen die Gruppe mit diesen Optionen wirklich gelöscht werden?'))
|
||||
{
|
||||
$.ajax({
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=deletegroup',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
force:1,groupId: $('#GroupheadlineDialogGroupId').val()
|
||||
},success: function(data) {
|
||||
window.location.href = window.location.href.split('#')[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
window.location.href = window.location.href.split('#')[0];
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeSend: function() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
close: function(event, ui){
|
||||
|
||||
}
|
||||
});
|
@ -1,513 +0,0 @@
|
||||
var MatrixproductListview = function ($) {
|
||||
"use strict";
|
||||
|
||||
var me = {
|
||||
storage:{
|
||||
selectedArticles: '',
|
||||
optionTableloaded: false,
|
||||
groupTableloaded: false,
|
||||
articleTableloaded: false,
|
||||
},
|
||||
selector: {
|
||||
divlistview: 'div.listview',
|
||||
popupGroup: '#popupgroup',
|
||||
popupOption: '#popupoption',
|
||||
popupArticleCreate: '#popuparcticlecreate',
|
||||
popupArticle: '#popuparticle',
|
||||
btnNewGroup: '#newGroup',
|
||||
btnNewOption: '#newOption',
|
||||
articleTable: '#matrixprodukt_list_view',
|
||||
groupTable: '#matrixprodukt_list_view_group',
|
||||
optionTable: '#matrixprodukt_list_view_options',
|
||||
},
|
||||
editArticle: function(id) {
|
||||
if(id > 0) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listgetarticle',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
listid: id
|
||||
},
|
||||
success: function (data) {
|
||||
$('div#options').html(data.optionhtml);
|
||||
$('#articlelistid').val(data.id);
|
||||
$(me.selector.popupArticle).dialog('open');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
editGroup: function(id){
|
||||
$('#groupid').val(id);
|
||||
if(id > 0) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listgetgroup',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
groupid: $('#groupid').val()
|
||||
},
|
||||
success: function (data) {
|
||||
$('#groupname').val(data.name);
|
||||
$(me.selector.popupGroup).dialog('open');
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$(me.selector.popupGroup).dialog('open');
|
||||
},
|
||||
deleteGroup: function(id) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listdeletegroupcheck',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
groupid: id
|
||||
},
|
||||
success: function (data) {
|
||||
if(typeof data.message) {
|
||||
if(!confirm(data.message)) {
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listdeletegroup',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
groupid: data.groupid
|
||||
},
|
||||
success: function (data) {
|
||||
if(typeof data.url !== 'undefined') {
|
||||
window.location.href=data.url;
|
||||
return;
|
||||
}
|
||||
$(me.selector.optionTable).DataTable().ajax.reload();
|
||||
$(me.selector.groupTable).DataTable().ajax.reload();
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
},
|
||||
error: function()
|
||||
{
|
||||
$(me.selector.optionTable).DataTable().ajax.reload();
|
||||
$(me.selector.groupTable).DataTable().ajax.reload();
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteOption: function(id) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listdeleteoptioncheck',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
optionid: id
|
||||
},
|
||||
success: function (data) {
|
||||
if(typeof data.message) {
|
||||
if(!confirm(data.message)) {
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listdeleteoption',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
optionid: data.optionid
|
||||
},
|
||||
success: function () {
|
||||
$(me.selector.optionTable).DataTable().ajax.reload();
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
},
|
||||
error: function() {
|
||||
$(me.selector.optionTable).DataTable().ajax.reload();
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
generateList: function()
|
||||
{
|
||||
$('#tabs-1').loadingOverlay('show');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=generatelist',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid')
|
||||
},
|
||||
success: function (data) {
|
||||
if(typeof data.url != 'undefined') {
|
||||
window.location.href=data.url;
|
||||
return;
|
||||
}
|
||||
$('#tabs-1').loadingOverlay('remove');
|
||||
},
|
||||
error:function()
|
||||
{
|
||||
$('#tabs-1').loadingOverlay('remove');
|
||||
}
|
||||
});
|
||||
},
|
||||
massedit: function(){
|
||||
me.storage.selectedArticles= '';
|
||||
$(me.selector.articleTable).find('input:checked').each(function(){
|
||||
if($(this).data('articleid') > 0) {
|
||||
if (me.storage.selectedArticles !== '') {
|
||||
me.storage.selectedArticles
|
||||
= me.storage.selectedArticles + ';';
|
||||
}
|
||||
me.storage.selectedArticles
|
||||
= me.storage.selectedArticles
|
||||
+ $(this).data('articleid')
|
||||
}
|
||||
|
||||
});
|
||||
if(me.storage.selectedArticles !== '') {
|
||||
matrixproduktedit_open(me.storage.selectedArticles);
|
||||
}
|
||||
else {
|
||||
alert('Kein Artikel ausgwählt');
|
||||
}
|
||||
},
|
||||
createallmissingarticles: function() {
|
||||
me.storage.selectedArticles= 'ALL';
|
||||
$('#listids').val(me.storage.selectedArticles);
|
||||
$(me.selector.popupArticleCreate).dialog('open');
|
||||
},
|
||||
createMissingArticles: function(){
|
||||
me.storage.selectedArticles= '';
|
||||
$(me.selector.articleTable).find('input:checked').each(function(){
|
||||
if(me.storage.selectedArticles !== '') {
|
||||
me.storage.selectedArticles
|
||||
=me.storage.selectedArticles + ';';
|
||||
}
|
||||
me.storage.selectedArticles
|
||||
=me.storage.selectedArticles
|
||||
+$(this).data('id')
|
||||
});
|
||||
if(me.storage.selectedArticles !== '') {
|
||||
$('#listids').val(me.storage.selectedArticles);
|
||||
$(me.selector.popupArticleCreate).dialog('open');
|
||||
}
|
||||
},
|
||||
editOption: function(id){
|
||||
$('#optionid').val(id);
|
||||
if(id > 0) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listgetoption',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
optionid: $('#optionid').val()
|
||||
},
|
||||
success: function (data) {
|
||||
$('#optionname').val(data.name);
|
||||
$('#optiongroup').html(data.groups);
|
||||
$('#optiongroup').val(data.gruppe);
|
||||
$(me.selector.popupOption).dialog('open');
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
else {
|
||||
$('#optionname').val('');
|
||||
}
|
||||
|
||||
$(me.selector.popupOption).dialog('open');
|
||||
|
||||
},
|
||||
|
||||
articeTableAfterReload:function(){
|
||||
$(me.selector.articleTable).find('img.editarticle').on('click',function(){
|
||||
me.editArticle($(this).data('id'));
|
||||
});
|
||||
me.storage.articleTableloaded = true;
|
||||
},
|
||||
groupTableAfterReload:function(){
|
||||
$(me.selector.groupTable).find('img.editgroup').on('click',function(){
|
||||
me.editGroup($(this).data('id'));
|
||||
});
|
||||
$(me.selector.groupTable).find('img.deletegroup').on('click',function(){
|
||||
me.deleteGroup($(this).data('id'));
|
||||
});
|
||||
me.storage.groupTableloaded = true;
|
||||
},
|
||||
optionTableAfterReload:function(){
|
||||
$(me.selector.optionTable).find('img.editoption').on('click',function(){
|
||||
me.editOption($(this).data('id'));
|
||||
});
|
||||
$(me.selector.optionTable).find('img.deleteoption').on('click',function(){
|
||||
me.deleteOption($(this).data('id'));
|
||||
});
|
||||
me.storage.optionTableloaded = true;
|
||||
},
|
||||
createMissingAriclesSave: function()
|
||||
{
|
||||
$(me.selector.popupArticleCreate).parent().loadingOverlay('show');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=createarticles',
|
||||
data: {
|
||||
listids:$('#listids').val(),
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
fromcategory: $('#fromcategory').prop('checked')?1:0,
|
||||
fromoption: $('#fromoption').prop('checked')?1:0,
|
||||
fromsuffix: $('#fromsuffix').prop('checked')?1:0,
|
||||
fromprefix: $('#fromprefix').prop('checked')?1:0,
|
||||
prefixseparator: $('#prefixseparator').val(),
|
||||
prefixcount: $('#prefixcount').val(),
|
||||
prefixnextnumber: $('#prefixnextnumber').val(),
|
||||
appendname: $('#prefixseparator').prop('checked')?1:0,
|
||||
nextprefixnumber: $('#nextprefixnumber').val(),
|
||||
},
|
||||
success: function (data) {
|
||||
$(me.selector.popupArticleCreate).parent().loadingOverlay('remove');
|
||||
|
||||
if(typeof data.continue != 'undefined' && data.continue == 1) {
|
||||
if(typeof data.nextprefixnumber != 'undefined') {
|
||||
$('#nextprefixnumber').val(data.nextprefixnumber);
|
||||
}
|
||||
me.createMissingAriclesSave();
|
||||
return;
|
||||
}
|
||||
$('#nextprefixnumber').val('');
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
$(me.selector.popupArticleCreate).dialog('close');
|
||||
},
|
||||
error: function()
|
||||
{
|
||||
$(me.selector.popupArticleCreate).parent().loadingOverlay('remove');
|
||||
$('#nextprefixnumber').val('');
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
$(me.selector.popupArticleCreate).dialog('close');
|
||||
}
|
||||
});
|
||||
},
|
||||
initListView: function(){
|
||||
$(me.selector.popupGroup).dialog(
|
||||
{
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
minWidth: 940,
|
||||
title: '',
|
||||
buttons: {
|
||||
'ABBRECHEN':function(){
|
||||
$(me.selector.popupGroup).dialog('close');
|
||||
},
|
||||
'SPEICHERN': function () {
|
||||
$(me.selector.popupGroup).parent().loadingOverlay('show');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listsavegroup',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
name: $('#groupname').val(),
|
||||
groupid: $('#groupid').val()
|
||||
},
|
||||
success: function (data) {
|
||||
if(typeof data.url != 'undefined') {
|
||||
window.location.href=data.url;
|
||||
return;
|
||||
}
|
||||
$(me.selector.groupTable).DataTable().ajax.reload();
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
$(me.selector.popupGroup).parent().loadingOverlay('remove');
|
||||
},
|
||||
error: function()
|
||||
{
|
||||
$(me.selector.groupTable).DataTable().ajax.reload();
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
$(me.selector.popupGroup).parent().loadingOverlay('remove');
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
);
|
||||
$(me.selector.popupArticleCreate).dialog(
|
||||
{
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
minWidth: 940,
|
||||
title: '',
|
||||
buttons: {
|
||||
'ABBRECHEN':function(){
|
||||
$(me.selector.popupArticleCreate).dialog('close');
|
||||
},
|
||||
'SPEICHERN': function () {
|
||||
me.createMissingAriclesSave();
|
||||
},
|
||||
}
|
||||
}
|
||||
);
|
||||
$(me.selector.popupArticle).dialog(
|
||||
{
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
minWidth: 940,
|
||||
title: '',
|
||||
buttons: {
|
||||
'ABBRECHEN':function(){
|
||||
$(me.selector.popupArticle).dialog('close');
|
||||
},
|
||||
'SPEICHERN': function () {
|
||||
$(me.selector.popupArticle).parent().loadingOverlay('show');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listsavearticle',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
listid:$('#articlelistid').val(),
|
||||
option1: (typeof $('#option1').val() != 'undefined'?$('#option1').val():0),
|
||||
option2: (typeof $('#option2').val() != 'undefined'?$('#option2').val():0),
|
||||
option3: (typeof $('#option3').val() != 'undefined'?$('#option3').val():0),
|
||||
option4: (typeof $('#option4').val() != 'undefined'?$('#option4').val():0),
|
||||
option5: (typeof $('#option5').val() != 'undefined'?$('#option5').val():0),
|
||||
option6: (typeof $('#option6').val() != 'undefined'?$('#option6').val():0),
|
||||
option7: (typeof $('#option7').val() != 'undefined'?$('#option7').val():0),
|
||||
option8: (typeof $('#option8').val() != 'undefined'?$('#option8').val():0),
|
||||
option9: (typeof $('#option9').val() != 'undefined'?$('#option9').val():0),
|
||||
option10: (typeof $('#option10').val() != 'undefined'?$('#option10').val():0),
|
||||
option11: (typeof $('#option11').val() != 'undefined'?$('#option11').val():0),
|
||||
option12: (typeof $('#option12').val() != 'undefined'?$('#option12').val():0),
|
||||
option13: (typeof $('#option13').val() != 'undefined'?$('#option13').val():0),
|
||||
option14: (typeof $('#option14').val() != 'undefined'?$('#option14').val():0),
|
||||
option15: (typeof $('#option15').val() != 'undefined'?$('#option15').val():0),
|
||||
option16: (typeof $('#option16').val() != 'undefined'?$('#option16').val():0),
|
||||
option17: (typeof $('#option17').val() != 'undefined'?$('#option17').val():0),
|
||||
option18: (typeof $('#option18').val() != 'undefined'?$('#option18').val():0),
|
||||
option19: (typeof $('#option19').val() != 'undefined'?$('#option19').val():0),
|
||||
option20: (typeof $('#option20').val() != 'undefined'?$('#option20').val():0),
|
||||
},
|
||||
success: function () {
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
$(me.selector.popupArticle).parent().loadingOverlay('remove');
|
||||
$(me.selector.popupArticle).dialog('close');
|
||||
},
|
||||
error: function() {
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
$(me.selector.popupArticle).parent().loadingOverlay('remove');
|
||||
$(me.selector.popupArticle).dialog('close');
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
);
|
||||
$(me.selector.popupOption).dialog(
|
||||
{
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
minWidth: 940,
|
||||
title: '',
|
||||
buttons: {
|
||||
'ABBRECHEN':function(){
|
||||
$(me.selector.popupOption).dialog('close');
|
||||
},
|
||||
'SPEICHERN': function () {
|
||||
$(me.selector.popupOption).parent().loadingOverlay('show');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
url: 'index.php?module=matrixprodukt&action=artikel&cmd=listsaveoption',
|
||||
data: {
|
||||
articleid: $(me.selector.popupGroup).data('articleid'),
|
||||
name: $('#optionname').val(),
|
||||
groupid: $('#optiongroup').val(),
|
||||
optionid: $('#optionid').val()
|
||||
},
|
||||
success: function () {
|
||||
$(me.selector.optionTable).DataTable().ajax.reload();
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
$(me.selector.popupOption).parent().loadingOverlay('remove');
|
||||
$(me.selector.popupOption).dialog('close');
|
||||
},
|
||||
error: function(){
|
||||
$(me.selector.optionTable).DataTable().ajax.reload();
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
$(me.selector.popupOption).parent().loadingOverlay('remove');
|
||||
$(me.selector.popupOption).dialog('close');
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(me.selector.popupGroup).toggleClass('hidden', false);
|
||||
$(me.selector.popupOption).toggleClass('hidden', false);
|
||||
$(me.selector.popupArticle).toggleClass('hidden', false);
|
||||
$(me.selector.popupArticleCreate).toggleClass('hidden', false);
|
||||
|
||||
$(me.selector.articleTable).on('afterreload', function(){
|
||||
me.articeTableAfterReload();
|
||||
});
|
||||
$(me.selector.optionTable).on('afterreload', function(){
|
||||
me.optionTableAfterReload();
|
||||
});
|
||||
$(me.selector.groupTable).on('afterreload', function(){
|
||||
me.groupTableAfterReload();
|
||||
});
|
||||
$(me.selector.btnNewGroup).on('click',function(){
|
||||
me.editGroup(0);
|
||||
});
|
||||
$(me.selector.btnNewOption).on('click',function(){
|
||||
me.editOption(0);
|
||||
});
|
||||
$('#changeall').on('change',function(){
|
||||
$(me.selector.articleTable).find('input.select').prop('checked', $('#changeall').prop('checked'));
|
||||
});
|
||||
$('#createmissingarticles').on('click',function () {
|
||||
me.createMissingArticles();
|
||||
});
|
||||
$('#createallmissingarticles').on('click',function () {
|
||||
me.createallmissingarticles();
|
||||
});
|
||||
$('#massedit').on('click',function () {
|
||||
me.massedit();
|
||||
});
|
||||
$('#generatelist').on('click',function () {
|
||||
me.generateList();
|
||||
});
|
||||
if(!me.storage.optionTableloaded) {
|
||||
$(me.selector.optionTable).DataTable().ajax.reload();
|
||||
}
|
||||
if(!me.storage.groupTableloaded) {
|
||||
$(me.selector.groupTable).DataTable().ajax.reload();
|
||||
}
|
||||
if(!me.storage.articleTableloaded) {
|
||||
$(me.selector.articleTable).DataTable().ajax.reload();
|
||||
}
|
||||
},
|
||||
init: function () {
|
||||
if($(me.selector.divlistview).length) {
|
||||
me.initListView();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
init: me.init,
|
||||
}
|
||||
|
||||
}(jQuery);
|
||||
|
||||
$(document).ready(function () {
|
||||
MatrixproductListview.init();
|
||||
});
|
15
classes/Modules/Onlineshop/Data/OrderStatus.php
Normal file
15
classes/Modules/Onlineshop/Data/OrderStatus.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2024 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Modules\Onlineshop\Data;
|
||||
|
||||
enum OrderStatus
|
||||
{
|
||||
case Imported;
|
||||
case InProgress;
|
||||
case Completed;
|
||||
case Cancelled;
|
||||
}
|
48
classes/Modules/Onlineshop/Data/OrderStatusUpdateRequest.php
Normal file
48
classes/Modules/Onlineshop/Data/OrderStatusUpdateRequest.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2024 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Modules\Onlineshop\Data;
|
||||
|
||||
class OrderStatusUpdateRequest
|
||||
{
|
||||
/**
|
||||
* @var int ID of the (primary/imported) order (ERP domain)
|
||||
*/
|
||||
public int $orderId;
|
||||
|
||||
/**
|
||||
* @var string ID of the order (Shop domain)
|
||||
*/
|
||||
public string $shopOrderId;
|
||||
|
||||
/**
|
||||
* @var OrderStatus current order status
|
||||
*/
|
||||
public OrderStatus $orderStatus;
|
||||
|
||||
/**
|
||||
* @var Shipment[] list of shipments for this order
|
||||
*/
|
||||
public array $shipments = array();
|
||||
|
||||
public function getTrackingNumberList() : array {
|
||||
$list = [];
|
||||
foreach ($this->shipments as $shipment) {
|
||||
if (!empty($shipment->trackingNumber))
|
||||
$list[] = $shipment->trackingNumber;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function getTrackingUrlList() : array {
|
||||
$list = [];
|
||||
foreach ($this->shipments as $shipment) {
|
||||
if (!empty($shipment->trackingUrl))
|
||||
$list[] = $shipment->trackingUrl;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
}
|
30
classes/Modules/Onlineshop/Data/Shipment.php
Normal file
30
classes/Modules/Onlineshop/Data/Shipment.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2024 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Modules\Onlineshop\Data;
|
||||
|
||||
class Shipment
|
||||
{
|
||||
/**
|
||||
* @var int ID of the shipment (ERP domain)
|
||||
*/
|
||||
public int $id;
|
||||
|
||||
/**
|
||||
* @var ?string plain tracking number
|
||||
*/
|
||||
public ?string $trackingNumber;
|
||||
|
||||
/**
|
||||
* @var ?string URL to view tracking details
|
||||
*/
|
||||
public ?string $trackingUrl;
|
||||
|
||||
/**
|
||||
* @var ?string shipping method (after mapping to Shop domain)
|
||||
*/
|
||||
public ?string $shippingMethod;
|
||||
}
|
14
classes/Modules/ShippingMethod/Model/ShipmentStatus.php
Normal file
14
classes/Modules/ShippingMethod/Model/ShipmentStatus.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2024 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
namespace Xentral\Modules\ShippingMethod\Model;
|
||||
|
||||
enum ShipmentStatus
|
||||
{
|
||||
case Announced;
|
||||
case EnRoute;
|
||||
case Delivered;
|
||||
}
|
@ -270,7 +270,7 @@ class TOTPLoginService
|
||||
$secret = $this->getTOTPSecret($userId);
|
||||
}
|
||||
|
||||
$query = "otpauth://totp/{$label}?secret=" . $secret . '&issuer=Xentral&algorithm=SHA1&digits=6&period=30';
|
||||
$query = "otpauth://totp/{$label}?secret=" . $secret . '&issuer=OpenXE&algorithm=SHA1&digits=6&period=30';
|
||||
|
||||
return $this->barcodeService->createQrCode($query);
|
||||
}
|
||||
|
@ -799,15 +799,18 @@ class TicketImportHelper
|
||||
$this->logger->debug('Add '.count($attachments).' attachments',['']);
|
||||
|
||||
foreach ($attachments as $attachment) {
|
||||
if ($attachment->getFileName() !== '') {
|
||||
$handle = fopen($ordner . '/' . $attachment->getFileName(), 'wb');
|
||||
|
||||
$dateiname = $attachment->getFileName();
|
||||
$dateiname = str_replace(array('\\','/',':','*','?','"','<','>','|'),' ',$dateiname); // Remove problematic characters
|
||||
|
||||
if ($dateiname !== '') {
|
||||
$handle = fopen($ordner . '/' . $dateiname, 'wb');
|
||||
if ($handle) {
|
||||
fwrite($handle, $attachment->getContent());
|
||||
fclose($handle);
|
||||
}
|
||||
//Schreibe Anhänge in Datei-Tabelle
|
||||
$datei = $ordner . '/' . $attachment->getFileName();
|
||||
$dateiname = $attachment->getFileName();
|
||||
$datei = $ordner . '/' . $dateiname;
|
||||
|
||||
if (stripos(strtoupper($dateiname), '=?UTF-8') !== false) {
|
||||
$dateiname = $this->formatter->encodeToUtf8($dateiname);
|
||||
|
59
composer.json
Normal file
59
composer.json
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"require": {
|
||||
"php": "^7.4|^8",
|
||||
"ext-gd": "*",
|
||||
"aura/sqlquery": "2.7.1",
|
||||
"aws/aws-sdk-php": "3.175.2",
|
||||
"container-interop/container-interop": "1.2.0",
|
||||
"ezyang/htmlpurifier": "v4.13.0",
|
||||
"fiskaly/fiskaly-sdk-php": "1.2.100",
|
||||
"guzzlehttp/guzzle": "6.5.5",
|
||||
"guzzlehttp/promises": "1.4.1",
|
||||
"guzzlehttp/psr7": "1.8.1",
|
||||
"laminas/laminas-loader": "2.6.1",
|
||||
"laminas/laminas-mime": "2.7.4",
|
||||
"laminas/laminas-mail": "2.12.5",
|
||||
"laminas/laminas-stdlib": "3.2.1",
|
||||
"laminas/laminas-validator": "2.13.5",
|
||||
"league/color-extractor": "0.3.2",
|
||||
"league/flysystem": "1.0.70",
|
||||
"league/oauth1-client": "v1.9.0",
|
||||
"league/oauth2-client": "2.6.0",
|
||||
"lfkeitel/phptotp": "v1.0.0",
|
||||
"mtdowling/jmespath.php": "2.6.0",
|
||||
"nikic/fast-route": "v1.3.0",
|
||||
"phpmailer/phpmailer": "v6.3.0",
|
||||
"phpseclib/phpseclib": "2.0.30",
|
||||
"psr/container": "1.1.1",
|
||||
"psr/http-message": "1.0.1",
|
||||
"psr/log": "1.1.3",
|
||||
"rakit/validation": "v0.22.3",
|
||||
"sabre/dav": "3.2.3",
|
||||
"smarty/smarty": "v3.1.39",
|
||||
"swiss-payment-slip/swiss-payment-slip": "0.13.0 as 0.11.1",
|
||||
"swiss-payment-slip/swiss-payment-slip-fpdf": "0.6.0",
|
||||
"symfony/polyfill-intl-idn": "v1.22.1",
|
||||
"symfony/polyfill-intl-normalizer": "v1.22.1",
|
||||
"symfony/polyfill-mbstring": "v1.22.1",
|
||||
"symfony/polyfill-php72": "v1.22.1",
|
||||
"tecnickcom/tcpdf": "6.3.5",
|
||||
"y0lk/oauth1-etsy": "1.1.0"
|
||||
},
|
||||
"replace": {
|
||||
"itbz/fpdf": "*",
|
||||
"laminas/laminas-zendframework-bridge": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Xentral\\": "classes"
|
||||
},
|
||||
"classmap": ["www/lib/versandarten/"]
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.4",
|
||||
"ext-gd": "7.4"
|
||||
},
|
||||
"optimize-autoloader": true
|
||||
}
|
||||
}
|
3104
composer.lock
generated
Normal file
3104
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,198 +1,270 @@
|
||||
<?php
|
||||
/*
|
||||
include(dirname(__FILE__)."/../conf/main.conf.php");
|
||||
include(dirname(__FILE__)."/../phpwf/plugins/class.mysql.php");
|
||||
include(dirname(__FILE__)."/../www/lib/imap.inc.php");
|
||||
include(dirname(__FILE__)."/../www/lib/class.erpapi.php");
|
||||
include(dirname(__FILE__)."/../www/lib/class.erpapi_custom.php");
|
||||
include(dirname(__FILE__)."/../www/lib/class.remote.php");
|
||||
include(dirname(__FILE__)."/../www/lib/class.httpclient.php");
|
||||
include(dirname(__FILE__)."/../www/lib/class.aes.php");
|
||||
|
||||
use Xentral\Components\Logger\Logger;
|
||||
|
||||
/** @var Logger $logger */
|
||||
$logger = $app->Container->get('Logger');
|
||||
|
||||
class app_t {
|
||||
var $DB;
|
||||
var $erp;
|
||||
var $user;
|
||||
var $remote;
|
||||
if (file_exists(dirname(__DIR__) . '/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
||||
}
|
||||
*/
|
||||
//ENDE
|
||||
if(file_exists(dirname(__DIR__).'/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')){
|
||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
||||
if (empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$app->Conf = $conf;
|
||||
}
|
||||
if(empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$app->Conf = $conf;
|
||||
if (empty($app->DB) || empty($app->DB->connection)) {
|
||||
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
|
||||
}
|
||||
if(empty($app->DB) || empty($app->DB->connection)) {
|
||||
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
|
||||
}
|
||||
if(!isset($app->erp) || !$app->erp) {
|
||||
if (class_exists('erpAPICustom')) {
|
||||
$erp = new erpAPICustom($app);
|
||||
} else {
|
||||
$erp = new erpAPI($app);
|
||||
}
|
||||
//$remote = new Remote($app);
|
||||
$app->erp = $erp;
|
||||
//$app->remote= $remote;
|
||||
}
|
||||
if(empty($app->remote)) {
|
||||
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||
if(!class_exists('RemoteCustom')){
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
if (!isset($app->erp) || !$app->erp) {
|
||||
if (class_exists('erpAPICustom')) {
|
||||
$erp = new erpAPICustom($app);
|
||||
} else {
|
||||
$erp = new erpAPI($app);
|
||||
}
|
||||
$app->erp = $erp;
|
||||
}
|
||||
if (empty($app->remote)) {
|
||||
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||
if (!class_exists('RemoteCustom')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
} else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
}
|
||||
else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
}
|
||||
|
||||
$app->erp->LogFile('Cronjob Artikeluebertragung Start');
|
||||
$logger->debug(
|
||||
'Start'
|
||||
);
|
||||
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutexcounter` = `mutexcounter` + 1
|
||||
WHERE `mutex` = 1 AND (`parameter` = 'artikeluebertragen') AND `aktiv` = 1"
|
||||
);
|
||||
|
||||
if($app->DB->Select("SELECT `mutex` FROM `prozessstarter` WHERE (`parameter` = 'artikeluebertragen') LIMIT 1") == 1){
|
||||
return;
|
||||
if ($app->DB->Select("SELECT `mutex` FROM `prozessstarter` WHERE (`parameter` = 'artikeluebertragen') LIMIT 1") == 1) {
|
||||
$logger->debug(
|
||||
'Läuft bereits'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$articles = $app->DB->SelectArr(
|
||||
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id` LIMIT 10'
|
||||
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id`'
|
||||
);
|
||||
if(!empty($articles)) {
|
||||
/** @var Shopexport $objShopexport */
|
||||
$objShopexport = $app->loadModule('shopexport');
|
||||
if($objShopexport !== null && method_exists($objShopexport, 'addChangedArticles')) {
|
||||
$objShopexport->addChangedArticles();
|
||||
}
|
||||
if (!empty($articles)) {
|
||||
/** @var Shopexport $objShopexport */
|
||||
$objShopexport = $app->loadModule('shopexport');
|
||||
if ($objShopexport !== null && method_exists($objShopexport, 'addChangedArticles')) {
|
||||
$objShopexport->addChangedArticles();
|
||||
}
|
||||
}
|
||||
|
||||
$logger->debug(
|
||||
'Prepare',
|
||||
[
|
||||
'articles' => $articles
|
||||
]
|
||||
);
|
||||
|
||||
$anzChecked = [];
|
||||
$anzChanged = [];
|
||||
$lastids = [];
|
||||
while(!empty($articles)) {
|
||||
foreach($articles as $article) {
|
||||
if(empty($anzChanged[$article['shop']])) {
|
||||
$anzChanged[$article['shop']] = 0;
|
||||
while (!empty($articles)) {
|
||||
foreach ($articles as $article) {
|
||||
if (empty($anzChanged[$article['shop']])) {
|
||||
$anzChanged[$article['shop']] = 0;
|
||||
}
|
||||
if (empty($anzChecked[$article['shop']])) {
|
||||
$anzChecked[$article['shop']] = 0;
|
||||
}
|
||||
if (!isset($lastids[$article['shop']])) {
|
||||
$lastids[$article['shop']] = (int) $app->erp->GetKonfiguration(
|
||||
'shopexport_artikeluebertragen_check_lastid_' . $article['shop']
|
||||
);
|
||||
}
|
||||
$changed = $objShopexport->hasArticleHashChanged($article['artikel'], $article['shop']);
|
||||
if ($changed['changed']) {
|
||||
$app->DB->Insert(
|
||||
sprintf(
|
||||
'INSERT INTO `shopexport_artikeluebertragen` (`artikel`, `shop`, `check_nr`) VALUES (%d, %d, %d)',
|
||||
$article['artikel'], $article['shop'], $lastids[$article['shop']]
|
||||
)
|
||||
);
|
||||
$anzChanged[$article['shop']]++;
|
||||
}
|
||||
$anzChecked[$article['shop']]++;
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
'DELETE FROM `shopexport_artikeluebertragen_check` WHERE `id` = %d',
|
||||
$article['id']
|
||||
)
|
||||
);
|
||||
$app->DB->Update(
|
||||
sprintf(
|
||||
"UPDATE `shopexport` SET `autosendarticle_last` = NOW() WHERE `id` = %d",
|
||||
$article['shop']
|
||||
)
|
||||
);
|
||||
}
|
||||
if(empty($anzChecked[$article['shop']])) {
|
||||
$anzChecked[$article['shop']] = 0;
|
||||
$app->erp->SetKonfigurationValue(
|
||||
'shopexport_artikeluebertragen_check_changed_' . $article['shop'],
|
||||
$anzChanged[$article['shop']]
|
||||
);
|
||||
$app->erp->SetKonfigurationValue(
|
||||
'shopexport_artikeluebertragen_check_checked_' . $article['shop'],
|
||||
$anzChecked[$article['shop']]
|
||||
);
|
||||
if (method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||
$logger->debug(
|
||||
'!canRunCronjob'
|
||||
);
|
||||
return;
|
||||
}
|
||||
if(!isset($lastids[$article['shop']])) {
|
||||
$lastids[$article['shop']] = (int)$app->erp->GetKonfiguration(
|
||||
'shopexport_artikeluebertragen_check_lastid_' . $article['shop']
|
||||
);
|
||||
}
|
||||
$changed = $objShopexport->hasArticleHashChanged($article['artikel'], $article['shop']);
|
||||
if($changed['changed']) {
|
||||
$app->DB->Insert(
|
||||
sprintf(
|
||||
'INSERT INTO `shopexport_artikeluebertragen` (`artikel`, `shop`, `check_nr`) VALUES (%d, %d, %d)',
|
||||
$article['artikel'], $article['shop'], $lastids[$article['shop']]
|
||||
)
|
||||
);
|
||||
$anzChanged[$article['shop']]++;
|
||||
}
|
||||
$anzChecked[$article['shop']]++;
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
'DELETE FROM `shopexport_artikeluebertragen_check` WHERE `id` = %d',
|
||||
$article['id']
|
||||
)
|
||||
$articles = $app->DB->SelectArr(
|
||||
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id` LIMIT 10'
|
||||
);
|
||||
$app->DB->Update(
|
||||
sprintf(
|
||||
"UPDATE `shopexport` SET `autosendarticle_last` = NOW() WHERE `id` = %d",
|
||||
$article['shop']
|
||||
)
|
||||
);
|
||||
}
|
||||
$app->erp->SetKonfigurationValue(
|
||||
'shopexport_artikeluebertragen_check_changed_'.$article['shop'],
|
||||
$anzChanged[$article['shop']]
|
||||
);
|
||||
$app->erp->SetKonfigurationValue(
|
||||
'shopexport_artikeluebertragen_check_checked_'.$article['shop'],
|
||||
$anzChecked[$article['shop']]
|
||||
);
|
||||
if(method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||
return;
|
||||
}
|
||||
$articles = $app->DB->SelectArr(
|
||||
'SELECT `id`,`shop`,`artikel` FROM `shopexport_artikeluebertragen_check` ORDER BY `id` LIMIT 10'
|
||||
);
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
"UPDATE `prozessstarter`
|
||||
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
|
||||
WHERE `parameter` = 'artikeluebertragen'"
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
"UPDATE `prozessstarter`
|
||||
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
|
||||
WHERE `parameter` = 'artikeluebertragen'"
|
||||
);
|
||||
while($check > 0) {
|
||||
$shopartikel = $app->DB->Query(
|
||||
"SELECT `id`,`shop`,`artikel`,`check_nr` FROM `shopexport_artikeluebertragen` ORDER BY `id` LIMIT 10"
|
||||
);
|
||||
if(!empty($shopartikel)) {
|
||||
$anz = 0;
|
||||
while ($row = $app->DB->Fetch_Assoc($shopartikel)) {
|
||||
if(!isset($lastids[$row['shop']])) {
|
||||
$lastids[$row['shop']] = (int)$app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_lastid_' . $row['shop']);
|
||||
}
|
||||
|
||||
$anz++;
|
||||
try {
|
||||
$app->remote->RemoteSendArticleList($row['shop'], array($row['artikel']));
|
||||
$app->erp->LagerSync($row['artikel'], true);
|
||||
}
|
||||
catch (Execption $exception) {
|
||||
$app->erp->LogFile($app->DB->real_escape_string($exception->getMessage()));
|
||||
}
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
'DELETE FROM `shopexport_artikeluebertragen` WHERE `id`= %d LIMIT 1',
|
||||
$row['id']
|
||||
)
|
||||
);
|
||||
/*
|
||||
while ($check > 0) {
|
||||
$shopartikel = $app->DB->Query(
|
||||
"SELECT `id`,`shop`,`artikel`,`check_nr` FROM `shopexport_artikeluebertragen` ORDER BY `id` LIMIT 10"
|
||||
);
|
||||
if (!empty($shopartikel)) {
|
||||
$anz = 0;
|
||||
while ($row = $app->DB->Fetch_Assoc($shopartikel)) {
|
||||
if (!isset($lastids[$row['shop']])) {
|
||||
$lastids[$row['shop']] = (int) $app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_lastid_' . $row['shop']);
|
||||
}
|
||||
|
||||
if(!empty($row['check_nr']) && $row['check_nr'] == $lastids[$row['shop']]) {
|
||||
$transfered = 1+(int)$app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_transfered_'.$row['shop']);
|
||||
$app->erp->SetKonfigurationValue('shopexport_artikeluebertragen_check_transfered_'.$row['shop'], $transfered);
|
||||
}
|
||||
$anz++;
|
||||
try {
|
||||
$app->remote->RemoteSendArticleList($row['shop'], array($row['artikel']));
|
||||
$app->erp->LagerSync($row['artikel'], true);
|
||||
} catch (Execption $exception) {
|
||||
$app->erp->LogFile($app->DB->real_escape_string($exception->getMessage()));
|
||||
}
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
'DELETE FROM `shopexport_artikeluebertragen` WHERE `id`= %d LIMIT 1',
|
||||
$row['id']
|
||||
)
|
||||
);
|
||||
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
if (!empty($row['check_nr']) && $row['check_nr'] == $lastids[$row['shop']]) {
|
||||
$transfered = 1 + (int) $app->erp->GetKonfiguration('shopexport_artikeluebertragen_check_transfered_' . $row['shop']);
|
||||
$app->erp->SetKonfigurationValue('shopexport_artikeluebertragen_check_transfered_' . $row['shop'], $transfered);
|
||||
}
|
||||
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `letzteausfuerhung`=NOW(), `mutex` = 1,`mutexcounter`=0
|
||||
WHERE `parameter` = 'artikeluebertragen'"
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
$app->DB->free($shopartikel);
|
||||
}
|
||||
|
||||
$app->DB->free($shopartikel);
|
||||
}
|
||||
if (method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['artikeluebertragen'])) {
|
||||
return;
|
||||
}
|
||||
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
|
||||
}*/
|
||||
|
||||
//sleep(20); // das performance nicht total spinnt
|
||||
$check = $app->DB->Select('SELECT COUNT(`id`) FROM `shopexport_artikeluebertragen`');
|
||||
|
||||
$sql = "SELECT DISTINCT `shop`, shopexport.`bezeichnung` FROM `shopexport_artikeluebertragen` INNER JOIN shopexport ON shopexport.id = `shop`";
|
||||
$shops_to_transmit = $app->DB->SelectArr($sql);
|
||||
|
||||
//$app->erp->LogFile('Cronjob artikeluebertragen '.(!empty($shops_to_transmit)?count($shops_to_transmit):0)." shops", print_r($shops_to_transmit, true));
|
||||
$logger->debug(
|
||||
'{count} Shops',
|
||||
[
|
||||
'count' => (!empty($shops_to_transmit)?count($shops_to_transmit):0),
|
||||
'shops_to_transmit' => $shops_to_transmit
|
||||
]
|
||||
);
|
||||
|
||||
foreach ($shops_to_transmit as $shop_to_transmit) {
|
||||
$sql = "SELECT `artikel` FROM `shopexport_artikeluebertragen` WHERE `shop` = '".$shop_to_transmit['shop']."'";
|
||||
$articles_to_transmit = $app->DB->SelectArr($sql);
|
||||
|
||||
$logger->debug(
|
||||
'{bezeichnung} (Shop {shop_to_transmit}) {count} Artikel',
|
||||
[
|
||||
'shop_to_transmit' => $shop_to_transmit['shop'],
|
||||
'bezeichnung' => $shop_to_transmit['bezeichnung'],
|
||||
'count' => (!empty($articles_to_transmit)?count($articles_to_transmit):0),
|
||||
'articles_to_transmit' => $articles_to_transmit
|
||||
]
|
||||
);
|
||||
|
||||
if (!empty($articles_to_transmit)) {
|
||||
|
||||
$article_ids_to_transmit = array_column($articles_to_transmit, 'artikel');
|
||||
|
||||
try {
|
||||
$result = $app->remote->RemoteSendArticleList($shop_to_transmit['shop'], $article_ids_to_transmit); // Expected result is array $articles_to_transmit, field status contains transmission status
|
||||
} catch (Execption $exception) {
|
||||
$logger->error(
|
||||
'Fehler {bezeichnung} (Shop {shop_to_transmit}) {count} Artikel',
|
||||
[
|
||||
'shop_to_transmit' => $shop_to_transmit['shop'],
|
||||
'bezeichnung' => $shop_to_transmit['bezeichnung'],
|
||||
'count' => (!empty($articles_to_transmit)?count($articles_to_transmit):0),
|
||||
'exception' => $exception
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$logger->debug(
|
||||
'Ende {bezeichnung} (Shop {shop_to_transmit}) {count} Artikel',
|
||||
[
|
||||
'shop_to_transmit' => $shop_to_transmit['shop'],
|
||||
'bezeichnung' => $shop_to_transmit['bezeichnung'],
|
||||
'count' => (!empty($articles_to_transmit)?count($articles_to_transmit):0),
|
||||
'result' => $result
|
||||
]
|
||||
);
|
||||
|
||||
// See description of return format in function class.remote.php -> RemoteSendArticleList()
|
||||
foreach ($result['articlelist'] as $article) {
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
'DELETE FROM `shopexport_artikeluebertragen` WHERE `artikel`= %d AND `shop` = %d',
|
||||
$article['artikel'],
|
||||
$shop_to_transmit['shop']
|
||||
)
|
||||
);
|
||||
$app->erp->LagerSync($article['artikel'], true);
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$logger->debug(
|
||||
'Ende'
|
||||
);
|
||||
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
"UPDATE `prozessstarter`
|
||||
SET `letzteausfuerhung`= NOW(), `mutex` = 0,`mutexcounter`=0
|
||||
WHERE `parameter` = 'artikeluebertragen'"
|
||||
);
|
||||
|
||||
|
||||
|
@ -148,8 +148,7 @@ $tables = [
|
||||
'templatemessage',
|
||||
'shopimport_auftraege',
|
||||
'versandzentrum_log',
|
||||
'api_request_response_log',
|
||||
'shopimport_amazon_fees',
|
||||
'api_request_response_log'
|
||||
];
|
||||
$minMemoryMb = 1;
|
||||
$minMemory = $minMemoryMb * 1024 * 1024;
|
||||
@ -623,34 +622,11 @@ if($shopExportLogCleanerActive && $tage > 0) {
|
||||
|
||||
$shopExportLogCleanerActive = $app->erp->Firmendaten('cleaner_shopexportlog');
|
||||
$tage = (int)$app->erp->Firmendaten('cleaner_shopexportlog_tage');
|
||||
$isToDelete = !empty($tableSchemaByTables['shopimport_amazon_fees'])
|
||||
&& !empty($tableSchemaByTables['shopimport_amazon_fees']['todelete']);
|
||||
if((!$shopExportLogCleanerActive || $tage <= 0 || $tage > 30) && $isToDelete) {
|
||||
$shopExportLogCleanerActive = true;
|
||||
if($tage <= 0 || $tage > 30) {
|
||||
$tage = 30;
|
||||
}
|
||||
}
|
||||
|
||||
if($shopExportLogCleanerActive && $tage > 0) {
|
||||
if($tage < 30) {
|
||||
$tage = 30;
|
||||
}
|
||||
$app->DB->Delete(
|
||||
sprintf(
|
||||
"DELETE FROM `shopimport_amazon_fees`
|
||||
WHERE DATE_SUB(NOW(), INTERVAL %d DAY) >= `zeitstempel` OR `zeitstempel` = '0000-00-00 00:00:00'",
|
||||
$tage
|
||||
)
|
||||
);
|
||||
$affectedRows = $app->DB->affected_rows();
|
||||
if(!empty($tableSchemaByTables['shopimport_amazon_fees'])
|
||||
&& ($tableSchemaByTables['shopimport_amazon_fees']['todelete'] > 0)) {
|
||||
$tableSchemaByTables['shopimport_amazon_fees']['todelete'] -= $affectedRows;
|
||||
}
|
||||
if($affectedRows > 0 && !empty($optimize['shopimport_amazon_fees'])) {
|
||||
$app->DB->Query('OPTIMIZE TABLE `shopimport_amazon_fees`');
|
||||
unset($optimize['shopimport_amazon_fees']);
|
||||
}
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter SET letzteausfuerhung=NOW(),mutex=1,mutexcounter=0 WHERE parameter = 'cleaner' AND aktiv = 1"
|
||||
);
|
||||
|
@ -1,38 +1,37 @@
|
||||
<?php
|
||||
if(file_exists(dirname(__DIR__).'/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
||||
|
||||
if (file_exists(dirname(__DIR__) . '/www/lib/class.erpapi_custom.php') && !class_exists('erpAPICustom')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi_custom.php';
|
||||
}
|
||||
|
||||
if(empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||
$app = new app_t();
|
||||
if (empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||
$app = new app_t();
|
||||
}
|
||||
|
||||
if(empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$app->Conf = $conf;
|
||||
if (empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$app->Conf = $conf;
|
||||
}
|
||||
if(empty($app->DB)) {
|
||||
$app->DB = new DB($app->Conf->WFdbhost,$app->Conf->WFdbname,$app->Conf->WFdbuser,$app->Conf->WFdbpass,null,$app->Conf->WFdbport);
|
||||
if (empty($app->DB)) {
|
||||
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
|
||||
}
|
||||
if(empty($app->erp)) {
|
||||
if(class_exists('erpAPICustom')) {
|
||||
$erp = new erpAPICustom($app);
|
||||
}
|
||||
else {
|
||||
$erp = new erpAPI($app);
|
||||
}
|
||||
$app->erp = $erp;
|
||||
}
|
||||
if(empty($app->remote)) {
|
||||
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')){
|
||||
if(!class_exists('RemoteCustom')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
if (empty($app->erp)) {
|
||||
if (class_exists('erpAPICustom')) {
|
||||
$erp = new erpAPICustom($app);
|
||||
} else {
|
||||
$erp = new erpAPI($app);
|
||||
}
|
||||
$app->erp = $erp;
|
||||
}
|
||||
if (empty($app->remote)) {
|
||||
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||
if (!class_exists('RemoteCustom')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
} else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
$app->remote = new RemoteCustom($app);
|
||||
}
|
||||
else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
}
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Start");
|
||||
|
||||
@ -40,34 +39,33 @@ $app->erp->LogFile("Lagerzahlen-Synchronisation Start");
|
||||
|
||||
$firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
|
||||
$app->DB->Update(
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutexcounter` = `mutexcounter` + 1
|
||||
WHERE `mutex` = 1 AND `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
);
|
||||
if(!$app->DB->Select(
|
||||
);
|
||||
if (!$app->DB->Select(
|
||||
"SELECT `id` FROM `prozessstarter` WHERE `mutex` = 0 AND `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
)) {
|
||||
)) {
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Prozessstarter-Mutex nicht bereit");
|
||||
return;
|
||||
}
|
||||
|
||||
$shops = $app->DB->SelectArr('SELECT * FROM `shopexport` WHERE `aktiv` = 1');
|
||||
if(empty($shops)) {
|
||||
}
|
||||
|
||||
$shops = $app->DB->SelectArr('SELECT * FROM `shopexport` WHERE `aktiv` = 1');
|
||||
if (empty($shops)) {
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine aktiven Shops");
|
||||
|
||||
return;
|
||||
}
|
||||
$shopByIds = [];
|
||||
foreach($shops as $shop) {
|
||||
}
|
||||
$shopByIds = [];
|
||||
foreach ($shops as $shop) {
|
||||
$shopByIds[$shop['id']] = $shop;
|
||||
}
|
||||
$shopIds = array_keys($shopByIds);
|
||||
$shopIdsStr = implode(',', $shopIds);
|
||||
$hours = 12;
|
||||
$hoursShop = 48;
|
||||
$lagerartikel = $app->DB->SelectFirstCols(
|
||||
"SELECT a.id
|
||||
}
|
||||
$shopIds = array_keys($shopByIds);
|
||||
$shopIdsStr = implode(',', $shopIds);
|
||||
$hours = 12;
|
||||
$hoursShop = 48;
|
||||
$lagerartikel = $app->DB->SelectFirstCols(
|
||||
"SELECT a.id
|
||||
FROM `artikel` AS `a`
|
||||
LEFT JOIN (
|
||||
SELECT ao2.artikel, 1 AS `autolagerlampe`,
|
||||
@ -97,91 +95,86 @@ $firmendatenid = $app->DB->Select("SELECT MAX(id) FROM firmendaten LIMIT 1");
|
||||
ORDER BY a.cache_lagerplatzinhaltmenge = -999 DESC,
|
||||
ao.cache_reseted DESC,
|
||||
a.laststorage_sync"
|
||||
);
|
||||
|
||||
if(empty($lagerartikel)) {
|
||||
);
|
||||
|
||||
if (empty($lagerartikel)) {
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: Keine fälligen Artikel");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
$r = new ReflectionMethod($app->erp, 'LagerSync');
|
||||
$params = $r->getParameters();
|
||||
$anzargs = count($params);
|
||||
}
|
||||
catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$anzargs = 2;
|
||||
}
|
||||
}
|
||||
|
||||
$clagerartikel = $lagerartikel?count($lagerartikel):0;
|
||||
$app->erp->LogFile('Lagerzahlen-Synchronisation, Artikel gesamt: '.$clagerartikel);
|
||||
foreach($lagerartikel as $ij => $articleId) {
|
||||
$clagerartikel = $lagerartikel ? count($lagerartikel) : 0;
|
||||
$app->erp->LogFile('Lagerzahlen-Synchronisation, Artikel gesamt: ' . $clagerartikel);
|
||||
foreach ($lagerartikel as $articleCounter => $articleId) {
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutex` = 1 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
);
|
||||
try {
|
||||
if($anzargs > 2){
|
||||
$message .= $app->erp->LagerSync($articleId, false, $shopByIds); // 2nd parameter is print_echo -> prints via echo to logfile (big print_r)
|
||||
}else{
|
||||
$message .= $app->erp->LagerSync($articleId, false);
|
||||
}
|
||||
if ($anzargs > 2) {
|
||||
$message .= $app->erp->LagerSync($articleId, false, $shopByIds); // 2nd parameter is print_echo -> prints via echo to logfile (big print_r)
|
||||
} else {
|
||||
$message .= $app->erp->LagerSync($articleId, false);
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
$message .= '<br>' . $exception->getMessage();
|
||||
}
|
||||
catch (Exception $exception) {
|
||||
$message .= '<br>' . $exception->getMessage();
|
||||
if ($message != '') {
|
||||
$message .= '<br>';
|
||||
}
|
||||
if($message!='') {
|
||||
$message .='<br>';
|
||||
if ($articleCounter % 10 === 0 && method_exists($app->erp, 'canRunCronjob') && !$app->erp->canRunCronjob(['lagerzahlen'])) {
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
);
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende: lagerzahlen-Job kann nicht geladen werden");
|
||||
return;
|
||||
}
|
||||
if($ij % 10 === 0 && method_exists($app->erp, 'canRunCronjob')
|
||||
&& !$app->erp->canRunCronjob(['lagerzahlen'])) {
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
);
|
||||
return;
|
||||
}
|
||||
usleep(10000);
|
||||
}
|
||||
$app->DB->Update(
|
||||
// $app->erp->LogFile("Lagerzahlen-Synchronisation: Warte 10 Sekunden");
|
||||
// usleep(10000);
|
||||
}
|
||||
$app->DB->Update(
|
||||
"UPDATE `prozessstarter`
|
||||
SET `mutex` = 0 , `mutexcounter` = 0, `letzteausfuerhung` = NOW()
|
||||
WHERE `parameter` = 'lagerzahlen' AND `aktiv` = 1"
|
||||
);
|
||||
if($message !='' && $erp->Firmendaten('systemmailsabschalten') == 0 && $erp->GetFirmaMail()!='') {
|
||||
);
|
||||
if ($message != '' && $erp->Firmendaten('systemmailsabschalten') == 0 && $erp->GetFirmaMail() != '') {
|
||||
try {
|
||||
if($erp->Firmendaten('systemmailsempfaenger') != ''){
|
||||
$erp->MailSend(
|
||||
$erp->GetFirmaMail(),
|
||||
$erp->GetFirmaName(),
|
||||
$erp->Firmendaten('systemmailsempfaenger'),
|
||||
'Lagerverwaltung',
|
||||
'Systemmeldung: Auto Update Lagerlampen',
|
||||
$message
|
||||
);
|
||||
|
||||
}else{
|
||||
if($erp->GetFirmaBCC1() != ''){
|
||||
$erp->MailSend(
|
||||
$erp->GetFirmaMail(),
|
||||
$erp->GetFirmaName(),
|
||||
$erp->GetFirmaBCC1(),
|
||||
'Lagerverwaltung',
|
||||
'Systemmeldung: Auto Update Lagerlampen',
|
||||
$message
|
||||
);
|
||||
if ($erp->Firmendaten('systemmailsempfaenger') != '') {
|
||||
$erp->MailSend(
|
||||
$erp->GetFirmaMail(),
|
||||
$erp->GetFirmaName(),
|
||||
$erp->Firmendaten('systemmailsempfaenger'),
|
||||
'Lagerverwaltung',
|
||||
'Systemmeldung: Auto Update Lagerlampen',
|
||||
$message
|
||||
);
|
||||
} else {
|
||||
if ($erp->GetFirmaBCC1() != '') {
|
||||
$erp->MailSend(
|
||||
$erp->GetFirmaMail(),
|
||||
$erp->GetFirmaName(),
|
||||
$erp->GetFirmaBCC1(),
|
||||
'Lagerverwaltung',
|
||||
'Systemmeldung: Auto Update Lagerlampen',
|
||||
$message
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Exception:" . $app->DB->real_escape_string($exception->getMessage()));
|
||||
}
|
||||
catch (Exception $exception) {
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Exception:".$app->DB->real_escape_string($exception->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende");
|
||||
$app->erp->LogFile("Lagerzahlen-Synchronisation Ende");
|
||||
|
||||
|
||||
|
43
cronjobs/shipment_tracking.php
Normal file
43
cronjobs/shipment_tracking.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
// SPDX-FileCopyrightText: 2024 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
|
||||
use Xentral\Components\Database\Database;
|
||||
use Xentral\Modules\ShippingMethod\Model\ShipmentStatus;
|
||||
|
||||
error_reporting(E_ERROR);
|
||||
|
||||
include_once dirname(__DIR__) . '/xentral_autoloader.php';
|
||||
|
||||
if(empty($app) || !($app instanceof ApplicationCore)){
|
||||
$app = new ApplicationCore();
|
||||
}
|
||||
|
||||
|
||||
/** @var Database $db */
|
||||
$db = $app->Container->get('Database');
|
||||
|
||||
$shipments_sql = "SELECT CONCAT(va.id, ';', va.modul) module, vp.id, vp.tracking, vp.status
|
||||
FROM versandpakete vp
|
||||
JOIN versandarten va ON vp.versandart = va.type
|
||||
WHERE status IN ('neu', 'versendet')";
|
||||
$shipments = $db->fetchGroup($shipments_sql);
|
||||
|
||||
foreach ($shipments as $module => $vps) {
|
||||
list($moduleId, $moduleName) = explode(';', $module,2);
|
||||
$module = $app->erp->LoadVersandModul($moduleName, intval($moduleId));
|
||||
|
||||
foreach ($vps as $vp) {
|
||||
$status = match ($module->GetShipmentStatus($vp['tracking'])) {
|
||||
ShipmentStatus::Announced => 'neu',
|
||||
ShipmentStatus::EnRoute => 'versendet',
|
||||
ShipmentStatus::Delivered => 'abgeschlossen',
|
||||
default => null,
|
||||
};
|
||||
if ($status === null || $status === $vp['status']) continue;
|
||||
$db->perform('UPDATE versandpakete SET status = :status WHERE id = :id',
|
||||
['status' => $status, 'id' => $vp['id']]);
|
||||
}
|
||||
}
|
@ -1,401 +1,398 @@
|
||||
<?php
|
||||
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE);
|
||||
if(!class_exists('ApplicationCore') && is_file(dirname(__DIR__).'/xentral_autoloader.php')) {
|
||||
include_once dirname(__DIR__).'/xentral_autoloader.php';
|
||||
if (!class_exists('ApplicationCore') && is_file(dirname(__DIR__) . '/xentral_autoloader.php')) {
|
||||
include_once dirname(__DIR__) . '/xentral_autoloader.php';
|
||||
}
|
||||
include_once dirname(__DIR__).'/conf/main.conf.php';
|
||||
include_once dirname(__DIR__).'/phpwf/plugins/class.mysql.php';
|
||||
include_once dirname(__DIR__).'/phpwf/plugins/class.secure.php';
|
||||
include_once dirname(__DIR__).'/phpwf/plugins/class.user.php';
|
||||
if(file_exists(dirname(__DIR__).'/conf/user_defined.php')) {
|
||||
include_once dirname(__DIR__).'/conf/user_defined.php';
|
||||
}
|
||||
if(!class_exists('FPDFWAWISION')){
|
||||
if(file_exists(dirname(__DIR__).'/conf/user_defined.php')){
|
||||
include_once dirname(__DIR__) . '/conf/main.conf.php';
|
||||
include_once dirname(__DIR__) . '/phpwf/plugins/class.mysql.php';
|
||||
include_once dirname(__DIR__) . '/phpwf/plugins/class.secure.php';
|
||||
include_once dirname(__DIR__) . '/phpwf/plugins/class.user.php';
|
||||
if (file_exists(dirname(__DIR__) . '/conf/user_defined.php')) {
|
||||
include_once dirname(__DIR__) . '/conf/user_defined.php';
|
||||
}
|
||||
if(defined('USEFPDF3') && USEFPDF3 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php')){
|
||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php';
|
||||
}else if(defined('USEFPDF2') && USEFPDF2 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php')){
|
||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php';
|
||||
}else{
|
||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf.php';
|
||||
}
|
||||
}
|
||||
include_once dirname(__DIR__).'/www/lib/pdf/fpdf_final.php';
|
||||
include_once dirname(__DIR__).'/www/lib/imap.inc.php';
|
||||
include_once dirname(__DIR__).'/www/lib/class.erpapi.php';
|
||||
include_once dirname(__DIR__).'/www/lib/class.remote.php';
|
||||
include_once dirname(__DIR__).'/www/lib/class.httpclient.php';
|
||||
if (!class_exists('FPDFWAWISION')) {
|
||||
if (file_exists(dirname(__DIR__) . '/conf/user_defined.php')) {
|
||||
include_once dirname(__DIR__) . '/conf/user_defined.php';
|
||||
}
|
||||
if (defined('USEFPDF3') && USEFPDF3 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_3.php';
|
||||
} else if (defined('USEFPDF2') && USEFPDF2 && file_exists(dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf_2.php';
|
||||
} else {
|
||||
require_once dirname(__DIR__) . '/www/lib/pdf/fpdf.php';
|
||||
}
|
||||
}
|
||||
include_once dirname(__DIR__) . '/www/lib/pdf/fpdf_final.php';
|
||||
include_once dirname(__DIR__) . '/www/lib/imap.inc.php';
|
||||
include_once dirname(__DIR__) . '/www/lib/class.erpapi.php';
|
||||
include_once dirname(__DIR__) . '/www/lib/class.remote.php';
|
||||
include_once dirname(__DIR__) . '/www/lib/class.httpclient.php';
|
||||
$aes = '';
|
||||
$phpversion = (String)phpversion();
|
||||
if($phpversion[0] == '7' && (int)$phpversion[2] > 0) {
|
||||
$aes = '2';
|
||||
$phpversion = (String) phpversion();
|
||||
if ($phpversion[0] == '7' && (int) $phpversion[2] > 0) {
|
||||
$aes = '2';
|
||||
}
|
||||
if($aes == 2 && is_file(dirname(__DIR__).'/www/lib/class.aes2.php')) {
|
||||
include_once dirname(__DIR__).'/www/lib/class.aes2.php';
|
||||
}
|
||||
else{
|
||||
include_once dirname(__DIR__) . '/www/lib/class.aes.php';
|
||||
if ($aes == 2 && is_file(dirname(__DIR__) . '/www/lib/class.aes2.php')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/class.aes2.php';
|
||||
} else {
|
||||
include_once dirname(__DIR__) . '/www/lib/class.aes.php';
|
||||
}
|
||||
|
||||
$classes = array('briefpapier','lieferschein','auftrag','anfrage','gutschrift','bestellung','rechnung','mahnwesen');
|
||||
foreach($classes as $class)
|
||||
{
|
||||
if(file_exists(dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'_custom.php'))
|
||||
{
|
||||
include_once dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'_custom.php';
|
||||
}
|
||||
elseif(file_exists(dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'.php')) {
|
||||
include_once dirname(__DIR__).'/www/lib/dokumente/class.'.$class.'.php';
|
||||
}
|
||||
$classes = array('briefpapier', 'lieferschein', 'auftrag', 'anfrage', 'gutschrift', 'bestellung', 'rechnung', 'mahnwesen');
|
||||
foreach ($classes as $class) {
|
||||
if (file_exists(dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '_custom.php')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '_custom.php';
|
||||
} elseif (file_exists(dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '.php')) {
|
||||
include_once dirname(__DIR__) . '/www/lib/dokumente/class.' . $class . '.php';
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.briefpapier.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.lieferschein.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.auftrag.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.angebot.php");
|
||||
if(file_exists(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php"))include_once(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.gutschrift.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.bestellung.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.rechnung.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.mahnwesen.php");*/
|
||||
include_once dirname(__DIR__).'/phpwf/plugins/class.string.php';
|
||||
if(!class_exists('app_t2'))
|
||||
{
|
||||
class app_t2 extends ApplicationCore {
|
||||
var $DB;
|
||||
var $erp;
|
||||
var $User;
|
||||
var $mail;
|
||||
var $remote;
|
||||
var $Secure;
|
||||
function GetLandLang($isocode)
|
||||
{
|
||||
$flipped = array_flip($this->GetLaender());
|
||||
if(isset($flipped[$isocode]))
|
||||
$land = $flipped[$isocode];
|
||||
else {
|
||||
$land = 'unkown';
|
||||
}
|
||||
return $land;
|
||||
}
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.briefpapier.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.lieferschein.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.auftrag.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.angebot.php");
|
||||
if(file_exists(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php"))include_once(dirname(__FILE__)."/../www/lib/dokumente/class.anfrage.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.gutschrift.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.bestellung.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.rechnung.php");
|
||||
include_once(dirname(__FILE__)."/../www/lib/dokumente/class.mahnwesen.php"); */
|
||||
include_once dirname(__DIR__) . '/phpwf/plugins/class.string.php';
|
||||
if (!class_exists('app_t2')) {
|
||||
|
||||
class app_t2 extends ApplicationCore {
|
||||
|
||||
var $DB;
|
||||
var $erp;
|
||||
var $User;
|
||||
var $mail;
|
||||
var $remote;
|
||||
var $Secure;
|
||||
|
||||
function GetLandLang($isocode) {
|
||||
$flipped = array_flip($this->GetLaender());
|
||||
if (isset($flipped[$isocode]))
|
||||
$land = $flipped[$isocode];
|
||||
else {
|
||||
$land = 'unkown';
|
||||
}
|
||||
return $land;
|
||||
}
|
||||
|
||||
function GetLaender() {
|
||||
$laender = array(
|
||||
'Afghanistan' => 'AF',
|
||||
'Ägypten' => 'EG',
|
||||
'Albanien' => 'AL',
|
||||
'Algerien' => 'DZ',
|
||||
'Andorra' => 'AD',
|
||||
'Angola' => 'AO',
|
||||
'Anguilla' => 'AI',
|
||||
'Antarktis' => 'AQ',
|
||||
'Antigua und Barbuda' => 'AG',
|
||||
'Äquatorial Guinea' => 'GQ',
|
||||
'Argentinien' => 'AR',
|
||||
'Armenien' => 'AM',
|
||||
'Aruba' => 'AW',
|
||||
'Aserbaidschan' => 'AZ',
|
||||
'Äthiopien' => 'ET',
|
||||
'Australien' => 'AU',
|
||||
'Bahamas' => 'BS',
|
||||
'Bahrain' => 'BH',
|
||||
'Bangladesh' => 'BD',
|
||||
'Barbados' => 'BB',
|
||||
'Belgien' => 'BE',
|
||||
'Belize' => 'BZ',
|
||||
'Benin' => 'BJ',
|
||||
'Bermudas' => 'BM',
|
||||
'Bhutan' => 'BT',
|
||||
'Birma' => 'MM',
|
||||
'Bolivien' => 'BO',
|
||||
'Bosnien-Herzegowina' => 'BA',
|
||||
'Botswana' => 'BW',
|
||||
'Bouvet Inseln' => 'BV',
|
||||
'Brasilien' => 'BR',
|
||||
'Britisch-Indischer Ozean' => 'IO',
|
||||
'Brunei' => 'BN',
|
||||
'Bulgarien' => 'BG',
|
||||
'Burkina Faso' => 'BF',
|
||||
'Burundi' => 'BI',
|
||||
'Chile' => 'CL',
|
||||
'China' => 'CN',
|
||||
'Christmas Island' => 'CX',
|
||||
'Cook Inseln' => 'CK',
|
||||
'Costa Rica' => 'CR',
|
||||
'Dänemark' => 'DK',
|
||||
'Deutschland' => 'DE',
|
||||
'Djibuti' => 'DJ',
|
||||
'Dominika' => 'DM',
|
||||
'Dominikanische Republik' => 'DO',
|
||||
'Ecuador' => 'EC',
|
||||
'El Salvador' => 'SV',
|
||||
'Elfenbeinküste' => 'CI',
|
||||
'Eritrea' => 'ER',
|
||||
'Estland' => 'EE',
|
||||
'Falkland Inseln' => 'FK',
|
||||
'Färöer Inseln' => 'FO',
|
||||
'Fidschi' => 'FJ',
|
||||
'Finnland' => 'FI',
|
||||
'Frankreich' => 'FR',
|
||||
'Französisch Guyana' => 'GF',
|
||||
'Französisch Polynesien' => 'PF',
|
||||
'Französisches Süd-Territorium' => 'TF',
|
||||
'Gabun' => 'GA',
|
||||
'Gambia' => 'GM',
|
||||
'Georgien' => 'GE',
|
||||
'Ghana' => 'GH',
|
||||
'Gibraltar' => 'GI',
|
||||
'Grenada' => 'GD',
|
||||
'Griechenland' => 'GR',
|
||||
'Grönland' => 'GL',
|
||||
'Großbritannien' => 'UK',
|
||||
'Großbritannien (UK)' => 'GB',
|
||||
'Guadeloupe' => 'GP',
|
||||
'Guam' => 'GU',
|
||||
'Guatemala' => 'GT',
|
||||
'Guinea' => 'GN',
|
||||
'Guinea Bissau' => 'GW',
|
||||
'Guyana' => 'GY',
|
||||
'Haiti' => 'HT',
|
||||
'Heard und McDonald Islands' => 'HM',
|
||||
'Honduras' => 'HN',
|
||||
'Hong Kong' => 'HK',
|
||||
'Indien' => 'IN',
|
||||
'Indonesien' => 'ID',
|
||||
'Irak' => 'IQ',
|
||||
'Iran' => 'IR',
|
||||
'Irland' => 'IE',
|
||||
'Island' => 'IS',
|
||||
'Israel' => 'IL',
|
||||
'Italien' => 'IT',
|
||||
'Jamaika' => 'JM',
|
||||
'Japan' => 'JP',
|
||||
'Jemen' => 'YE',
|
||||
'Jordanien' => 'JO',
|
||||
'Jugoslawien' => 'YU',
|
||||
'Kaiman Inseln' => 'KY',
|
||||
'Kambodscha' => 'KH',
|
||||
'Kamerun' => 'CM',
|
||||
'Kanada' => 'CA',
|
||||
'Kap Verde' => 'CV',
|
||||
'Kasachstan' => 'KZ',
|
||||
'Kenia' => 'KE',
|
||||
'Kirgisistan' => 'KG',
|
||||
'Kiribati' => 'KI',
|
||||
'Kokosinseln' => 'CC',
|
||||
'Kolumbien' => 'CO',
|
||||
'Komoren' => 'KM',
|
||||
'Kongo' => 'CG',
|
||||
'Kongo, Demokratische Republik' => 'CD',
|
||||
'Kosovo' => 'KO',
|
||||
'Kroatien' => 'HR',
|
||||
'Kuba' => 'CU',
|
||||
'Kuwait' => 'KW',
|
||||
'Laos' => 'LA',
|
||||
'Lesotho' => 'LS',
|
||||
'Lettland' => 'LV',
|
||||
'Libanon' => 'LB',
|
||||
'Liberia' => 'LR',
|
||||
'Libyen' => 'LY',
|
||||
'Liechtenstein' => 'LI',
|
||||
'Litauen' => 'LT',
|
||||
'Luxemburg' => 'LU',
|
||||
'Macao' => 'MO',
|
||||
'Madagaskar' => 'MG',
|
||||
'Malawi' => 'MW',
|
||||
'Malaysia' => 'MY',
|
||||
'Malediven' => 'MV',
|
||||
'Mali' => 'ML',
|
||||
'Malta' => 'MT',
|
||||
'Marianen' => 'MP',
|
||||
'Marokko' => 'MA',
|
||||
'Marshall Inseln' => 'MH',
|
||||
'Martinique' => 'MQ',
|
||||
'Mauretanien' => 'MR',
|
||||
'Mauritius' => 'MU',
|
||||
'Mayotte' => 'YT',
|
||||
'Mazedonien' => 'MK',
|
||||
'Mexiko' => 'MX',
|
||||
'Mikronesien' => 'FM',
|
||||
'Mocambique' => 'MZ',
|
||||
'Moldavien' => 'MD',
|
||||
'Monaco' => 'MC',
|
||||
'Mongolei' => 'MN',
|
||||
'Montenegro' => 'ME',
|
||||
'Montserrat' => 'MS',
|
||||
'Namibia' => 'NA',
|
||||
'Nauru' => 'NR',
|
||||
'Nepal' => 'NP',
|
||||
'Neukaledonien' => 'NC',
|
||||
'Neuseeland' => 'NZ',
|
||||
'Nicaragua' => 'NI',
|
||||
'Niederlande' => 'NL',
|
||||
'Niederländische Antillen' => 'AN',
|
||||
'Niger' => 'NE',
|
||||
'Nigeria' => 'NG',
|
||||
'Niue' => 'NU',
|
||||
'Nord Korea' => 'KP',
|
||||
'Norfolk Inseln' => 'NF',
|
||||
'Norwegen' => 'NO',
|
||||
'Oman' => 'OM',
|
||||
'Österreich' => 'AT',
|
||||
'Pakistan' => 'PK',
|
||||
'Palästina' => 'PS',
|
||||
'Palau' => 'PW',
|
||||
'Panama' => 'PA',
|
||||
'Papua Neuguinea' => 'PG',
|
||||
'Paraguay' => 'PY',
|
||||
'Peru' => 'PE',
|
||||
'Philippinen' => 'PH',
|
||||
'Pitcairn' => 'PN',
|
||||
'Polen' => 'PL',
|
||||
'Portugal' => 'PT',
|
||||
'Puerto Rico' => 'PR',
|
||||
'Qatar' => 'QA',
|
||||
'Reunion' => 'RE',
|
||||
'Ruanda' => 'RW',
|
||||
'Rumänien' => 'RO',
|
||||
'Rußland' => 'RU',
|
||||
'Saint Lucia' => 'LC',
|
||||
'Sambia' => 'ZM',
|
||||
'Samoa' => 'AS',
|
||||
'Samoa' => 'WS',
|
||||
'San Marino' => 'SM',
|
||||
'Sao Tome' => 'ST',
|
||||
'Saudi Arabien' => 'SA',
|
||||
'Schweden' => 'SE',
|
||||
'Schweiz' => 'CH',
|
||||
'Senegal' => 'SN',
|
||||
'Serbien' => 'RS',
|
||||
'Seychellen' => 'SC',
|
||||
'Sierra Leone' => 'SL',
|
||||
'Singapur' => 'SG',
|
||||
'Slowakei -slowakische Republik-' => 'SK',
|
||||
'Slowenien' => 'SI',
|
||||
'Solomon Inseln' => 'SB',
|
||||
'Somalia' => 'SO',
|
||||
'South Georgia, South Sandwich Isl.' => 'GS',
|
||||
'Spanien' => 'ES',
|
||||
'Sri Lanka' => 'LK',
|
||||
'St. Helena' => 'SH',
|
||||
'St. Kitts Nevis Anguilla' => 'KN',
|
||||
'St. Pierre und Miquelon' => 'PM',
|
||||
'St. Vincent' => 'VC',
|
||||
'Süd Korea' => 'KR',
|
||||
'Südafrika' => 'ZA',
|
||||
'Sudan' => 'SD',
|
||||
'Surinam' => 'SR',
|
||||
'Svalbard und Jan Mayen Islands' => 'SJ',
|
||||
'Swasiland' => 'SZ',
|
||||
'Syrien' => 'SY',
|
||||
'Tadschikistan' => 'TJ',
|
||||
'Taiwan' => 'TW',
|
||||
'Tansania' => 'TZ',
|
||||
'Thailand' => 'TH',
|
||||
'Timor' => 'TP',
|
||||
'Togo' => 'TG',
|
||||
'Tokelau' => 'TK',
|
||||
'Tonga' => 'TO',
|
||||
'Trinidad Tobago' => 'TT',
|
||||
'Tschad' => 'TD',
|
||||
'Tschechische Republik' => 'CZ',
|
||||
'Tunesien' => 'TN',
|
||||
'Türkei' => 'TR',
|
||||
'Turkmenistan' => 'TM',
|
||||
'Turks und Kaikos Inseln' => 'TC',
|
||||
'Tuvalu' => 'TV',
|
||||
'Uganda' => 'UG',
|
||||
'Ukraine' => 'UA',
|
||||
'Ungarn' => 'HU',
|
||||
'Uruguay' => 'UY',
|
||||
'Usbekistan' => 'UZ',
|
||||
'Vanuatu' => 'VU',
|
||||
'Vatikan' => 'VA',
|
||||
'Venezuela' => 'VE',
|
||||
'Vereinigte Arabische Emirate' => 'AE',
|
||||
'Vereinigte Staaten von Amerika' => 'US',
|
||||
'Vietnam' => 'VN',
|
||||
'Virgin Island (Brit.)' => 'VG',
|
||||
'Virgin Island (USA)' => 'VI',
|
||||
'Wallis et Futuna' => 'WF',
|
||||
'Weißrußland' => 'BY',
|
||||
'Westsahara' => 'EH',
|
||||
'Zentralafrikanische Republik' => 'CF',
|
||||
'Zimbabwe' => 'ZW',
|
||||
'Zypern' => 'CY'
|
||||
);
|
||||
return $laender;
|
||||
}
|
||||
}
|
||||
|
||||
function GetLaender()
|
||||
{
|
||||
$laender = array(
|
||||
'Afghanistan' => 'AF',
|
||||
'Ägypten' => 'EG',
|
||||
'Albanien' => 'AL',
|
||||
'Algerien' => 'DZ',
|
||||
'Andorra' => 'AD',
|
||||
'Angola' => 'AO',
|
||||
'Anguilla' => 'AI',
|
||||
'Antarktis' => 'AQ',
|
||||
'Antigua und Barbuda' => 'AG',
|
||||
'Äquatorial Guinea' => 'GQ',
|
||||
'Argentinien' => 'AR',
|
||||
'Armenien' => 'AM',
|
||||
'Aruba' => 'AW',
|
||||
'Aserbaidschan' => 'AZ',
|
||||
'Äthiopien' => 'ET',
|
||||
'Australien' => 'AU',
|
||||
'Bahamas' => 'BS',
|
||||
'Bahrain' => 'BH',
|
||||
'Bangladesh' => 'BD',
|
||||
'Barbados' => 'BB',
|
||||
'Belgien' => 'BE',
|
||||
'Belize' => 'BZ',
|
||||
'Benin' => 'BJ',
|
||||
'Bermudas' => 'BM',
|
||||
'Bhutan' => 'BT',
|
||||
'Birma' => 'MM',
|
||||
'Bolivien' => 'BO',
|
||||
'Bosnien-Herzegowina' => 'BA',
|
||||
'Botswana' => 'BW',
|
||||
'Bouvet Inseln' => 'BV',
|
||||
'Brasilien' => 'BR',
|
||||
'Britisch-Indischer Ozean' => 'IO',
|
||||
'Brunei' => 'BN',
|
||||
'Bulgarien' => 'BG',
|
||||
'Burkina Faso' => 'BF',
|
||||
'Burundi' => 'BI',
|
||||
'Chile' => 'CL',
|
||||
'China' => 'CN',
|
||||
'Christmas Island' => 'CX',
|
||||
'Cook Inseln' => 'CK',
|
||||
'Costa Rica' => 'CR',
|
||||
'Dänemark' => 'DK',
|
||||
'Deutschland' => 'DE',
|
||||
'Djibuti' => 'DJ',
|
||||
'Dominika' => 'DM',
|
||||
'Dominikanische Republik' => 'DO',
|
||||
'Ecuador' => 'EC',
|
||||
'El Salvador' => 'SV',
|
||||
'Elfenbeinküste' => 'CI',
|
||||
'Eritrea' => 'ER',
|
||||
'Estland' => 'EE',
|
||||
'Falkland Inseln' => 'FK',
|
||||
'Färöer Inseln' => 'FO',
|
||||
'Fidschi' => 'FJ',
|
||||
'Finnland' => 'FI',
|
||||
'Frankreich' => 'FR',
|
||||
'Französisch Guyana' => 'GF',
|
||||
'Französisch Polynesien' => 'PF',
|
||||
'Französisches Süd-Territorium' => 'TF',
|
||||
'Gabun' => 'GA',
|
||||
'Gambia' => 'GM',
|
||||
'Georgien' => 'GE',
|
||||
'Ghana' => 'GH',
|
||||
'Gibraltar' => 'GI',
|
||||
'Grenada' => 'GD',
|
||||
'Griechenland' => 'GR',
|
||||
'Grönland' => 'GL',
|
||||
'Großbritannien' => 'UK',
|
||||
'Großbritannien (UK)' => 'GB',
|
||||
'Guadeloupe' => 'GP',
|
||||
'Guam' => 'GU',
|
||||
'Guatemala' => 'GT',
|
||||
'Guinea' => 'GN',
|
||||
'Guinea Bissau' => 'GW',
|
||||
'Guyana' => 'GY',
|
||||
'Haiti' => 'HT',
|
||||
'Heard und McDonald Islands' => 'HM',
|
||||
'Honduras' => 'HN',
|
||||
'Hong Kong' => 'HK',
|
||||
'Indien' => 'IN',
|
||||
'Indonesien' => 'ID',
|
||||
'Irak' => 'IQ',
|
||||
'Iran' => 'IR',
|
||||
'Irland' => 'IE',
|
||||
'Island' => 'IS',
|
||||
'Israel' => 'IL',
|
||||
'Italien' => 'IT',
|
||||
'Jamaika' => 'JM',
|
||||
'Japan' => 'JP',
|
||||
'Jemen' => 'YE',
|
||||
'Jordanien' => 'JO',
|
||||
'Jugoslawien' => 'YU',
|
||||
'Kaiman Inseln' => 'KY',
|
||||
'Kambodscha' => 'KH',
|
||||
'Kamerun' => 'CM',
|
||||
'Kanada' => 'CA',
|
||||
'Kap Verde' => 'CV',
|
||||
'Kasachstan' => 'KZ',
|
||||
'Kenia' => 'KE',
|
||||
'Kirgisistan' => 'KG',
|
||||
'Kiribati' => 'KI',
|
||||
'Kokosinseln' => 'CC',
|
||||
'Kolumbien' => 'CO',
|
||||
'Komoren' => 'KM',
|
||||
'Kongo' => 'CG',
|
||||
'Kongo, Demokratische Republik' => 'CD',
|
||||
'Kosovo' => 'KO',
|
||||
'Kroatien' => 'HR',
|
||||
'Kuba' => 'CU',
|
||||
'Kuwait' => 'KW',
|
||||
'Laos' => 'LA',
|
||||
'Lesotho' => 'LS',
|
||||
'Lettland' => 'LV',
|
||||
'Libanon' => 'LB',
|
||||
'Liberia' => 'LR',
|
||||
'Libyen' => 'LY',
|
||||
'Liechtenstein' => 'LI',
|
||||
'Litauen' => 'LT',
|
||||
'Luxemburg' => 'LU',
|
||||
'Macao' => 'MO',
|
||||
'Madagaskar' => 'MG',
|
||||
'Malawi' => 'MW',
|
||||
'Malaysia' => 'MY',
|
||||
'Malediven' => 'MV',
|
||||
'Mali' => 'ML',
|
||||
'Malta' => 'MT',
|
||||
'Marianen' => 'MP',
|
||||
'Marokko' => 'MA',
|
||||
'Marshall Inseln' => 'MH',
|
||||
'Martinique' => 'MQ',
|
||||
'Mauretanien' => 'MR',
|
||||
'Mauritius' => 'MU',
|
||||
'Mayotte' => 'YT',
|
||||
'Mazedonien' => 'MK',
|
||||
'Mexiko' => 'MX',
|
||||
'Mikronesien' => 'FM',
|
||||
'Mocambique' => 'MZ',
|
||||
'Moldavien' => 'MD',
|
||||
'Monaco' => 'MC',
|
||||
'Mongolei' => 'MN',
|
||||
'Montenegro' => 'ME',
|
||||
'Montserrat' => 'MS',
|
||||
'Namibia' => 'NA',
|
||||
'Nauru' => 'NR',
|
||||
'Nepal' => 'NP',
|
||||
'Neukaledonien' => 'NC',
|
||||
'Neuseeland' => 'NZ',
|
||||
'Nicaragua' => 'NI',
|
||||
'Niederlande' => 'NL',
|
||||
'Niederländische Antillen' => 'AN',
|
||||
'Niger' => 'NE',
|
||||
'Nigeria' => 'NG',
|
||||
'Niue' => 'NU',
|
||||
'Nord Korea' => 'KP',
|
||||
'Norfolk Inseln' => 'NF',
|
||||
'Norwegen' => 'NO',
|
||||
'Oman' => 'OM',
|
||||
'Österreich' => 'AT',
|
||||
'Pakistan' => 'PK',
|
||||
'Palästina' => 'PS',
|
||||
'Palau' => 'PW',
|
||||
'Panama' => 'PA',
|
||||
'Papua Neuguinea' => 'PG',
|
||||
'Paraguay' => 'PY',
|
||||
'Peru' => 'PE',
|
||||
'Philippinen' => 'PH',
|
||||
'Pitcairn' => 'PN',
|
||||
'Polen' => 'PL',
|
||||
'Portugal' => 'PT',
|
||||
'Puerto Rico' => 'PR',
|
||||
'Qatar' => 'QA',
|
||||
'Reunion' => 'RE',
|
||||
'Ruanda' => 'RW',
|
||||
'Rumänien' => 'RO',
|
||||
'Rußland' => 'RU',
|
||||
'Saint Lucia' => 'LC',
|
||||
'Sambia' => 'ZM',
|
||||
'Samoa' => 'AS',
|
||||
'Samoa' => 'WS',
|
||||
'San Marino' => 'SM',
|
||||
'Sao Tome' => 'ST',
|
||||
'Saudi Arabien' => 'SA',
|
||||
'Schweden' => 'SE',
|
||||
'Schweiz' => 'CH',
|
||||
'Senegal' => 'SN',
|
||||
'Serbien' => 'RS',
|
||||
'Seychellen' => 'SC',
|
||||
'Sierra Leone' => 'SL',
|
||||
'Singapur' => 'SG',
|
||||
'Slowakei -slowakische Republik-' => 'SK',
|
||||
'Slowenien' => 'SI',
|
||||
'Solomon Inseln' => 'SB',
|
||||
'Somalia' => 'SO',
|
||||
'South Georgia, South Sandwich Isl.' => 'GS',
|
||||
'Spanien' => 'ES',
|
||||
'Sri Lanka' => 'LK',
|
||||
'St. Helena' => 'SH',
|
||||
'St. Kitts Nevis Anguilla' => 'KN',
|
||||
'St. Pierre und Miquelon' => 'PM',
|
||||
'St. Vincent' => 'VC',
|
||||
'Süd Korea' => 'KR',
|
||||
'Südafrika' => 'ZA',
|
||||
'Sudan' => 'SD',
|
||||
'Surinam' => 'SR',
|
||||
'Svalbard und Jan Mayen Islands' => 'SJ',
|
||||
'Swasiland' => 'SZ',
|
||||
'Syrien' => 'SY',
|
||||
'Tadschikistan' => 'TJ',
|
||||
'Taiwan' => 'TW',
|
||||
'Tansania' => 'TZ',
|
||||
'Thailand' => 'TH',
|
||||
'Timor' => 'TP',
|
||||
'Togo' => 'TG',
|
||||
'Tokelau' => 'TK',
|
||||
'Tonga' => 'TO',
|
||||
'Trinidad Tobago' => 'TT',
|
||||
'Tschad' => 'TD',
|
||||
'Tschechische Republik' => 'CZ',
|
||||
'Tunesien' => 'TN',
|
||||
'Türkei' => 'TR',
|
||||
'Turkmenistan' => 'TM',
|
||||
'Turks und Kaikos Inseln' => 'TC',
|
||||
'Tuvalu' => 'TV',
|
||||
'Uganda' => 'UG',
|
||||
'Ukraine' => 'UA',
|
||||
'Ungarn' => 'HU',
|
||||
'Uruguay' => 'UY',
|
||||
'Usbekistan' => 'UZ',
|
||||
'Vanuatu' => 'VU',
|
||||
'Vatikan' => 'VA',
|
||||
'Venezuela' => 'VE',
|
||||
'Vereinigte Arabische Emirate' => 'AE',
|
||||
'Vereinigte Staaten von Amerika' => 'US',
|
||||
'Vietnam' => 'VN',
|
||||
'Virgin Island (Brit.)' => 'VG',
|
||||
'Virgin Island (USA)' => 'VI',
|
||||
'Wallis et Futuna' => 'WF',
|
||||
'Weißrußland' => 'BY',
|
||||
'Westsahara' => 'EH',
|
||||
'Zentralafrikanische Republik' => 'CF',
|
||||
'Zimbabwe' => 'ZW',
|
||||
'Zypern' => 'CY'
|
||||
);
|
||||
return $laender;
|
||||
}
|
||||
}
|
||||
}
|
||||
//ENDE
|
||||
|
||||
|
||||
if(empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||
if (empty($app) || !class_exists('ApplicationCore') || !($app instanceof ApplicationCore)) {
|
||||
$app = new app_t2();
|
||||
}
|
||||
if(empty($app->Conf)){
|
||||
}
|
||||
if (empty($app->Conf)) {
|
||||
$conf = new Config();
|
||||
$app->Conf = $conf;
|
||||
}
|
||||
if(empty($app->DB)){
|
||||
}
|
||||
if (empty($app->DB)) {
|
||||
$app->DB = new DB($app->Conf->WFdbhost, $app->Conf->WFdbname, $app->Conf->WFdbuser, $app->Conf->WFdbpass, null, $app->Conf->WFdbport);
|
||||
}
|
||||
if(empty($app->erp)){
|
||||
}
|
||||
if (empty($app->erp)) {
|
||||
$erp = new erpAPI($app);
|
||||
$app->erp = $erp;
|
||||
}
|
||||
$app->String = new WawiString();
|
||||
if(empty($app->remote)){
|
||||
if(is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')){
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
$app->remote = new RemoteCustom($app);
|
||||
}
|
||||
$app->String = new WawiString();
|
||||
if (empty($app->remote)) {
|
||||
if (is_file(dirname(__DIR__) . '/www/lib/class.remote_custom.php')) {
|
||||
require_once dirname(__DIR__) . '/www/lib/class.remote_custom.php';
|
||||
$app->remote = new RemoteCustom($app);
|
||||
} else {
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
else{
|
||||
$app->remote = new Remote($app);
|
||||
}
|
||||
}
|
||||
//$app->remote = new Remote($app);
|
||||
$app->Secure = new Secure($app);
|
||||
$app->User = new User($app);
|
||||
if(!defined('FPDF_FONTPATH')) {
|
||||
define('FPDF_FONTPATH',dirname(__DIR__).'/www/lib/pdf/font/');
|
||||
}
|
||||
|
||||
}
|
||||
//$app->remote = new Remote($app);
|
||||
$app->Secure = new Secure($app);
|
||||
$app->User = new User($app);
|
||||
if (!defined('FPDF_FONTPATH')) {
|
||||
define('FPDF_FONTPATH', dirname(__DIR__) . '/www/lib/pdf/font/');
|
||||
}
|
||||
|
||||
//ENDE
|
||||
|
||||
const MAXIMUM_NUMBER_OF_TRIES = 10;
|
||||
const MAXIMUM_NUMBER_OF_TRIES = 10;
|
||||
|
||||
$shops = $app->DB->SelectFirstCols(
|
||||
'SELECT id FROM shopexport WHERE auftragabgleich = 1 AND aktiv = 1 AND demomodus <> 1 AND sendonlywithtracking = 0'
|
||||
);
|
||||
if(empty($shops)) {
|
||||
$shops = $app->DB->SelectFirstCols(
|
||||
'SELECT id FROM shopexport WHERE auftragabgleich = 1 AND aktiv = 1 AND demomodus <> 1 AND sendonlywithtracking = 0'
|
||||
);
|
||||
if (empty($shops)) {
|
||||
return;
|
||||
}
|
||||
$app->DB->Update("UPDATE prozessstarter SET mutexcounter = mutexcounter + 1 WHERE mutex = 1 AND (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||
if(!$app->DB->Select("SELECT id FROM prozessstarter WHERE mutex = 0 AND (parameter = 'shop_rueckmeldungen') AND aktiv = 1")) {
|
||||
}
|
||||
$app->DB->Update("UPDATE prozessstarter SET mutexcounter = mutexcounter + 1 WHERE mutex = 1 AND (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||
if (!$app->DB->Select("SELECT id FROM prozessstarter WHERE mutex = 0 AND (parameter = 'shop_rueckmeldungen') AND aktiv = 1")) {
|
||||
return;
|
||||
}
|
||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||
}
|
||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||
|
||||
$subwhere = sprintf(' a.shop IN (%s) ', implode(',', $shops));
|
||||
$join = '';
|
||||
$where = '';
|
||||
$app->erp->RunHook('shop_rueckmeldung', 2, $join, $where);
|
||||
$sql = "SELECT a.id,apro.zeit, a.shop, l.id as lieferschein, v.id as versandid, l.projekt
|
||||
FROM auftrag AS a
|
||||
LEFT JOIN lieferschein AS l on l.auftragid = a.id
|
||||
LEFT JOIN auftrag_protokoll AS apro ON a.id = apro.auftrag AND apro.grund LIKE 'Auftrag importiert vom Shop'
|
||||
LEFT JOIN projekt AS pr ON l.projekt = pr.id
|
||||
LEFT JOIN versand AS v ON v.lieferschein = l.id
|
||||
$subwhere = sprintf(' a.shop IN (%s) ', implode(',', $shops));
|
||||
$join = '';
|
||||
$where = '';
|
||||
$app->erp->RunHook('shop_rueckmeldung', 2, $join, $where);
|
||||
$sql = "SELECT DISTINCT a.id, a.shop
|
||||
FROM auftrag a
|
||||
LEFT JOIN lieferschein l on l.auftragid = a.id
|
||||
LEFT JOIN projekt pr ON l.projekt = pr.id
|
||||
LEFT JOIN lieferschein_position lp ON lp.lieferschein = l.id
|
||||
LEFT JOIN versandpaket_lieferschein_position vlp ON vlp.lieferschein_position = lp.id
|
||||
LEFT JOIN versandpakete v ON (v.lieferschein_ohne_pos = l.id OR v.id = vlp.versandpaket)
|
||||
$join
|
||||
WHERE a.status = 'abgeschlossen' AND $subwhere AND
|
||||
DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 2 WEEK),'%Y-%m-%d') < a.datum AND
|
||||
DATE_SUB(NOW(),INTERVAL 2 WEEK) < a.datum AND
|
||||
a.shopextstatus <> 'abgeschlossen' AND a.shop > 0 AND
|
||||
(
|
||||
( v.tracking <> '' AND l.status = 'versendet') OR
|
||||
@ -403,7 +400,7 @@ function GetLaender()
|
||||
((pr.kommissionierverfahren = 'lieferschein' OR pr.kommissionierverfahren = 'rechnungsmail') AND isnull(v.id))
|
||||
)
|
||||
AND (ISNULL(a.shop_status_update_last_attempt_at) OR a.shop_status_update_last_attempt_at < DATE_SUB(NOW(), INTERVAL 4 HOUR))
|
||||
AND a.shop_status_update_attempt <= ".MAXIMUM_NUMBER_OF_TRIES."
|
||||
AND a.shop_status_update_attempt <= " . MAXIMUM_NUMBER_OF_TRIES . "
|
||||
$where
|
||||
ORDER BY a.id, l.id DESC, v.id DESC
|
||||
";
|
||||
@ -411,33 +408,33 @@ function GetLaender()
|
||||
$auftraege = $app->DB->SelectArr($sql);
|
||||
if(!empty($auftraege)) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
"UPDATE prozessstarter
|
||||
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
||||
WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1"
|
||||
);
|
||||
$auftragid = null;
|
||||
$countRequests = 0;
|
||||
foreach($auftraege as $auftrag) {
|
||||
if($auftrag['id'] != $auftragid) {
|
||||
$countRequests++;
|
||||
$auftragid = $auftrag['id'];
|
||||
$app->remote->RemoteUpdateAuftrag($auftrag['shop'], $auftrag['id']);
|
||||
if($countRequests % 10 === 0) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
foreach ($auftraege as $auftrag) {
|
||||
if ($auftrag['id'] != $auftragid) {
|
||||
$countRequests++;
|
||||
$auftragid = $auftrag['id'];
|
||||
$app->remote->RemoteUpdateAuftrag($auftrag['shop'], $auftrag['id']);
|
||||
if ($countRequests % 10 === 0) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
||||
WHERE parameter = 'shop_rueckmeldungen' AND aktiv = 1"
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($auftraege);
|
||||
}
|
||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||
}
|
||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||
|
||||
//Zahlungsstatus
|
||||
$query = $app->DB->Query(
|
||||
"SELECT a.id
|
||||
//Zahlungsstatus
|
||||
$query = $app->DB->Query(
|
||||
"SELECT a.id
|
||||
FROM `auftrag` AS `a`
|
||||
LEFT JOIN `rechnung` AS `r1` ON r1.id = a.rechnungid
|
||||
LEFT JOIN `rechnung` AS `r2` ON r2.auftragid = a.id
|
||||
@ -448,21 +445,22 @@ function GetLaender()
|
||||
AND (r1.zahlungsstatus = 'bezahlt' OR r2.zahlungsstatus = 'bezahlt') AND DATEDIFF(NOW(), a.datum) <= 28
|
||||
GROUP BY a.id
|
||||
LIMIT 1000"
|
||||
);
|
||||
if($query) {
|
||||
);
|
||||
if ($query) {
|
||||
$countRequests = 0;
|
||||
while($row = $app->DB->Fetch_Assoc($query)) {
|
||||
$app->erp->ImportUpdateZahlungsstatus($row['id']);
|
||||
$countRequests++;
|
||||
if($countRequests % 10 === 0) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
while ($row = $app->DB->Fetch_Assoc($query)) {
|
||||
$app->erp->ImportUpdateZahlungsstatus($row['id']);
|
||||
$countRequests++;
|
||||
if ($countRequests % 10 === 0) {
|
||||
$app->DB->Update(
|
||||
"UPDATE prozessstarter
|
||||
SET mutex = 1 , mutexcounter = 0, letzteausfuerhung = now()
|
||||
WHERE parameter = 'shop_rueckmeldungen' AND aktiv = 1"
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
$app->DB->free($query);
|
||||
}
|
||||
}
|
||||
|
||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 0, mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||
|
||||
$app->DB->Update("UPDATE prozessstarter SET mutex = 0, mutexcounter = 0, letzteausfuerhung = now() WHERE (parameter = 'shop_rueckmeldungen' ) AND aktiv = 1");
|
||||
|
@ -945,7 +945,9 @@ if($shops) {
|
||||
{
|
||||
$onlinebestellnummer = $tmpwarenkorb['auftrag'];
|
||||
}
|
||||
|
||||
$projekt = $app->DB->Select("SELECT projekt FROM shopexport WHERE id = '$id' LIMIT 1");
|
||||
|
||||
if(!empty($tmpwarenkorb['projekt']) && $app->DB->Select("SELECT id FROM projekt WHERE id = '".(int)$tmpwarenkorb['projekt']."' LIMIT 1"))$projekt = (int)$tmpwarenkorb['projekt'];
|
||||
if(isset($tmpwarenkorb['subshop']) && $tmpwarenkorb['subshop'])
|
||||
{
|
||||
|
@ -12945,12 +12945,8 @@ DROP TABLE IF EXISTS `seriennummern`;
|
||||
CREATE TABLE `seriennummern` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`seriennummer` varchar(255) NOT NULL,
|
||||
`adresse` int(11) NOT NULL,
|
||||
`artikel` int(11) NOT NULL,
|
||||
`beschreibung` varchar(255) NOT NULL,
|
||||
`lieferung` date NOT NULL,
|
||||
`lieferschein` int(11) NOT NULL,
|
||||
`lieferscheinpos` int(11) NOT NULL,
|
||||
`bearbeiter` varchar(255) NOT NULL,
|
||||
`logdatei` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
@ -17873,6 +17869,23 @@ INSERT INTO `hook_register` (`hook_action`, `function`, `aktiv`, `position`, `ho
|
||||
;
|
||||
/* OpenXE 2024-02-03 für belegvorlagen */
|
||||
|
||||
/* OpenXE 2024-08-11 für TOTP */
|
||||
INSERT INTO `hook`(`name`, `aktiv`, `parametercount`, `alias`, `description`) VALUES
|
||||
('login_password_check_otp', 1, 3, '', '');
|
||||
|
||||
INSERT INTO `hook_register`(
|
||||
`hook_action`, `function`, `aktiv`, `position`, `hook`, `module`, `module_parameter`) VALUES
|
||||
( 0, 'TOTPCheckLogin', 1, 1, (SELECT id FROM hook WHERE NAME = 'login_password_check_otp' LIMIT 1), 'totp', 0);
|
||||
/* OpenXE 2024-08-11 für TOTP */
|
||||
|
||||
/* OpenXE 2024-08-11 für Smarty shopimport */
|
||||
INSERT INTO `hook` (`name`, `aktiv`, `parametercount`, `alias`, `description`) VALUES
|
||||
('ImportAuftragBefore', 1, 4, '', '');
|
||||
|
||||
INSERT INTO `hook_register` (`hook_action`, `function`, `aktiv`, `position`, `hook`, `module`, `module_parameter`) VALUES
|
||||
(0, 'ImportAuftragBeforeHook', 1, 1, (SELECT id FROM hook WHERE name = 'ImportAuftragBefore' LIMIT 1), 'onlineshops', 0);
|
||||
/* OpenXE 2024-08-11 für Smarty shopimport */
|
||||
|
||||
/*
|
||||
BelegPositionenButtons
|
||||
|
||||
|
8
docker-compose.override.example.yml
Normal file
8
docker-compose.override.example.yml
Normal file
@ -0,0 +1,8 @@
|
||||
# This file can be used to override defaults from the docker-compose.yml file
|
||||
# if it is copied/renamed to docker-compose.override.yml
|
||||
|
||||
version: '3.9'
|
||||
services:
|
||||
vite:
|
||||
# Set this to your local uid:gid to run the frontend build as your user and keep the working directory clean
|
||||
user: 1000:1000
|
62
docker-compose.yml
Normal file
62
docker-compose.yml
Normal file
@ -0,0 +1,62 @@
|
||||
version: '3.9'
|
||||
services:
|
||||
vite:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile
|
||||
target: frontend
|
||||
image: openxe_frontend
|
||||
entrypoint: npm run dev
|
||||
volumes:
|
||||
- .:/app
|
||||
ports:
|
||||
- "5173:5173"
|
||||
app_init:
|
||||
image: openxe:test
|
||||
volumes:
|
||||
- .:/var/www/html
|
||||
working_dir: /var/www/html/upgrade
|
||||
entrypoint: php data/upgrade.php -db -do
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile
|
||||
image: openxe:test
|
||||
volumes:
|
||||
- .:/var/www/html
|
||||
ports:
|
||||
- "8081:80"
|
||||
depends_on:
|
||||
app_init:
|
||||
condition: service_completed_successfully
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
mysql:
|
||||
image: mariadb:10.11
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: "rootpw"
|
||||
MYSQL_USER: "openxe"
|
||||
MYSQL_PASSWORD: "openxe"
|
||||
MYSQL_DATABASE: "openxe"
|
||||
MARIADB_AUTO_UPGRADE: "1"
|
||||
volumes:
|
||||
- mysqldata:/var/lib/mysql
|
||||
ports:
|
||||
- "3306:3306"
|
||||
healthcheck:
|
||||
interval: 5s
|
||||
retries: 3
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"healthcheck.sh",
|
||||
"--connect",
|
||||
"--innodb_initialized"
|
||||
]
|
||||
timeout: 30s
|
||||
|
||||
volumes:
|
||||
mysqldata: {}
|
29
docker/Dockerfile
Normal file
29
docker/Dockerfile
Normal file
@ -0,0 +1,29 @@
|
||||
ARG PHP_EXT="gd ldap imap mysqli soap zip"
|
||||
ARG DEB_PKG="libc-client2007e libaom3 libavif15 libdav1d6 libfreetype6 libjpeg62-turbo libldap-common libpng16-16 libwebp7 libxpm4 libzip4"
|
||||
ARG DEB_PKG_TMP="cmake gnutls-dev libaom-dev libavif-dev libbz2-dev libc-client-dev libdav1d-dev libfreetype6-dev libjpeg62-turbo-dev libkrb5-dev libldap2-dev libpng-dev libssl-dev libwebp-dev libxml2-dev libxpm-dev libzip-dev zlib1g-dev"
|
||||
|
||||
FROM node:20 as frontend
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json vite.config.js /app/
|
||||
RUN npm install
|
||||
COPY classes /app/classes
|
||||
COPY resources /app/resources
|
||||
COPY www /app/www
|
||||
RUN npm run build
|
||||
|
||||
#FROM php:8.1-fpm as fpm_server
|
||||
FROM php:8.1-apache as web_server
|
||||
ARG PHP_EXT
|
||||
ARG DEB_PKG
|
||||
ARG DEB_PKG_TMP
|
||||
|
||||
WORKDIR /app
|
||||
RUN apt-get update && apt-get install -y ${DEB_PKG} ${DEB_PKG_TMP} && \
|
||||
docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
|
||||
docker-php-ext-install ${PHP_EXT} && \
|
||||
apt-get remove --purge -y ${DEB_PKG_TMP} && \
|
||||
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
COPY docker/php "$PHP_INI_DIR/conf.d/"
|
||||
COPY --chown=www-data:www-data . /var/www/html
|
||||
COPY --chown=www-data:www-data --from=frontend /app/www/dist /var/www/html/www/dist
|
3
docker/php/memory.ini
Normal file
3
docker/php/memory.ini
Normal file
@ -0,0 +1,3 @@
|
||||
memory_limit = 256M
|
||||
upload_max_filesize = 32M
|
||||
post_max_size = 32M
|
15822
package-lock.json
generated
15822
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
@ -1,25 +1,26 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"api-docs:validate": "./node_modules/raml2html/bin/raml2html --validate www/api/docs.raml > /dev/null",
|
||||
"api-docs:build": "./node_modules/raml2html/bin/raml2html --validate --theme raml2html-werk-theme --input www/api/docs.raml --output www/api/docs-tmp.html && cat www/api/docs-tmp.html | sed -e 's/<\\/head>/<link rel=\\\"stylesheet\\\" href=\\\"\\.\\/assets\\/docs_custom\\.css\\\"><\\/head>/' > www/api/docs.html && rm www/api/docs-tmp.html",
|
||||
"dev": "npm run development",
|
||||
"development": "./node_modules/cross-env/src/bin/cross-env-shell.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"watch": "npm run development -- --watch",
|
||||
"hot": "./node_modules/cross-env/src/bin/cross-env-shell.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
|
||||
"prod": "npm run production",
|
||||
"production": "./node_modules/cross-env/src/bin/cross-env-shell.js NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||
"dev": "vite -d --cors --host ::",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"raml2html": "^7.6.0",
|
||||
"raml2html-werk-theme": "^1.1.0",
|
||||
"cross-env": "^7.0",
|
||||
"laravel-mix": "^5.0.1",
|
||||
"resolve-url-loader": "^3.1.0",
|
||||
"sass": "^1.15.2",
|
||||
"sass-loader": "^8.0.0"
|
||||
"raml2html": "^7.8.0",
|
||||
"raml2html-werk-theme": "^1.3.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"vue": "^2.6.12"
|
||||
"@primevue/icons": "^4.0.7",
|
||||
"@primevue/themes": "^4.0.7",
|
||||
"@vitejs/plugin-vue": "^5",
|
||||
"axios": "^1",
|
||||
"glob": "^11",
|
||||
"primeicons": "^7.0.0",
|
||||
"primevue": "^4",
|
||||
"vite": "^5",
|
||||
"vue": "^3"
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,12 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019 Xentral ERP Software GmbH, Fuggerstrasse 11, D-86150 Augsburg
|
||||
* SPDX-FileCopyrightText: 2023-2024 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
*/
|
||||
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
@ -96,105 +104,7 @@ class Player {
|
||||
$module = 'welcome';
|
||||
$action = 'main';
|
||||
}
|
||||
|
||||
|
||||
if($this->app->erp->isIoncube() && method_exists($this->app->erp, 'IoncubeProperty')
|
||||
&& WithGUI() && !(($module=='welcome' && $action=='upgrade') || $module=='' || ($module=='welcome' && $action=='start')))
|
||||
{
|
||||
if(method_exists('erpAPI','Ioncube_getMaxUser'))
|
||||
{
|
||||
$maxuser = erpAPI::Ioncube_getMaxUser();
|
||||
}elseif(method_exists($this->app->erp, 'IoncubegetMaxUser'))
|
||||
{
|
||||
$maxuser = $this->app->erp->IoncubegetMaxUser();
|
||||
}else{
|
||||
$maxuser = 0;
|
||||
}
|
||||
if(method_exists('erpAPI','Ioncube_getMaxLightusers'))
|
||||
{
|
||||
$maxlightuser = erpAPI::Ioncube_getMaxLightusers();
|
||||
}else{
|
||||
$maxlightuser = 0;
|
||||
}
|
||||
if($maxuser)
|
||||
{
|
||||
$anzuser2 = 0;
|
||||
if($maxlightuser > 0) {
|
||||
$anzuser2 = (int)$this->app->DB->Select("SELECT count(DISTINCT u.id) FROM `user` u WHERE activ = 1 AND type = 'lightuser' ");
|
||||
$anzuser = (int)$this->app->DB->Select("SELECT count(id) FROM `user` WHERE activ = 1 AND not isnull(hwtoken) AND hwtoken <> 4") - $anzuser2;
|
||||
$anzuserzeiterfassung = (int)$this->app->DB->Select("SELECT count(*) from user where activ = 1 AND hwtoken = 4 AND type != 'lightuser'");
|
||||
}else{
|
||||
$anzuser = $this->app->DB->Select("SELECT count(*) from user where activ = 1 AND hwtoken <> 4 ");
|
||||
$anzuserzeiterfassung = (int)$this->app->DB->Select("SELECT count(*) from user where activ = 1 AND hwtoken = 4");
|
||||
}
|
||||
|
||||
$maxmitarbeiterzeiterfassung = $this->app->erp->ModulVorhanden('mitarbeiterzeiterfassung')?$maxuser:0;
|
||||
if($anzuser > $maxuser
|
||||
|| (
|
||||
($anzuser + $anzuserzeiterfassung + $anzuser2) >
|
||||
$maxmitarbeiterzeiterfassung + $maxuser + $maxlightuser
|
||||
)
|
||||
|| (($anzuser + $anzuserzeiterfassung) > $maxmitarbeiterzeiterfassung + $maxuser)
|
||||
) {
|
||||
if(!(($module == 'welcome' &&
|
||||
($action=='info' || $action == 'start' || $action == 'logout' || $action == '' || $action == 'main')) ||
|
||||
($module == 'einstellungen' && ($action == 'list' || $action == '')) ||
|
||||
$module == 'benutzer'
|
||||
))
|
||||
{
|
||||
if($this->app->erp->RechteVorhanden('benutzer','list'))
|
||||
{
|
||||
$module = 'benutzer';
|
||||
$action = 'list';
|
||||
|
||||
if($maxlightuser > 0){
|
||||
$error = 'Es existieren mehr aktive Benutzer als Ihre Lizenz erlaubt: Benutzer ' . ($anzuser + $anzuser2) . ($maxlightuser > 0 ? ' (davon ' . $anzuser2 . ' Light-User)' : '') . ' von ' . ($maxuser + $maxlightuser) . ($maxlightuser > 0 ? ' (' . $maxlightuser . ' Light-User)' : '');
|
||||
}else{
|
||||
$error = 'Es existieren mehr aktive Benutzer als Ihre Lizenz erlaubt: Benutzer ' . ($anzuser + $anzuser2) . ($maxlightuser > 0 ? ' (davon ' . $anzuser2 . ' Zeiterfassungs-User)' : '') . ' von ' . ($maxuser + $anzuser2) . ($anzuser2 > 0 ? ' (' . $anzuser2 . ' Zeiterfassungs-User)' : '');
|
||||
}
|
||||
$error = '<div class="error">'.$error.'</div>';
|
||||
$this->app->Tpl->Add('MESSAGE', $error);
|
||||
$this->app->Secure->GET['msg'] = $this->app->erp->base64_url_encode($error);
|
||||
}else{
|
||||
$module = 'welcome';
|
||||
$action = 'info';
|
||||
}
|
||||
$this->app->Secure->GET['module'] = $module;
|
||||
$this->app->Secure->GET['action'] = $action;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(method_exists('erpAPI','Ioncube_Property'))
|
||||
{
|
||||
$deaktivateonexp = erpAPI::Ioncube_Property('deaktivateonexp');
|
||||
}else{
|
||||
$deaktivateonexp = $this->app->erp->IoncubeProperty('deaktivateonexp');
|
||||
}
|
||||
if($deaktivateonexp)
|
||||
{
|
||||
if(method_exists('erpAPI','Ioncube_HasExpired'))
|
||||
{
|
||||
$IoncubeHasExpired = erpAPI::Ioncube_HasExpired();
|
||||
}elseif(method_exists($this->app->erp, 'IoncubeHasExpired'))
|
||||
{
|
||||
$IoncubeHasExpired = $this->app->erp->IoncubeHasExpired();
|
||||
}else{
|
||||
$IoncubeHasExpired = false;
|
||||
}
|
||||
}else{
|
||||
$IoncubeHasExpired = false;
|
||||
}
|
||||
if($deaktivateonexp && $IoncubeHasExpired
|
||||
&& !(($module == 'welcome' && $action='logout') || ($module == 'welcome' && $action='start') || ($module == 'welcome' && $action='main'))
|
||||
)
|
||||
{
|
||||
$module = 'welcome';
|
||||
$action = 'info';
|
||||
$this->app->Secure->GET['module'] = $module;
|
||||
$this->app->Secure->GET['action'] = $action;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($action!="list" && $action!="css" && $action!="logo" && $action!="poll" && $module!="ajax" && $module!="protokoll" && $action!="thumbnail"){
|
||||
$this->app->erp->Protokoll();
|
||||
@ -317,9 +227,14 @@ class Player {
|
||||
|
||||
$moduleClassName = strtoupper($module[0]) . substr($module, 1);
|
||||
$this->app->ModuleScriptCache->IncludeModule($moduleClassName);
|
||||
$this->app->ModuleScriptCache->IncludeJavascriptModules('_theme_', ['www/themes/new/js/main.js']);
|
||||
$this->app->Tpl->Add('MODULESTYLESHEET', $this->app->ModuleScriptCache->GetStylesheetHtmlTags());
|
||||
$this->app->Tpl->Add('MODULEJAVASCRIPTHEAD', $this->app->ModuleScriptCache->GetJavascriptHtmlTags('head'));
|
||||
$this->app->Tpl->Add('MODULEJAVASCRIPTBODY', $this->app->ModuleScriptCache->GetJavascriptHtmlTags('body'));
|
||||
$this->app->Tpl->Set('JAVASCRIPTMODULES', $this->app->ModuleScriptCache->GetJavascriptModulesHtmlTags());
|
||||
if (defined('VITE_DEV_SERVER')) {
|
||||
$this->app->Tpl->Add('ADDITIONALCSPHEADER', VITE_DEV_SERVER.' ');
|
||||
}
|
||||
|
||||
$permission = true;
|
||||
if(isset($myApp) && method_exists($myApp,'CheckRights'))$permission = $myApp->CheckRights();
|
||||
@ -412,7 +327,7 @@ class Player {
|
||||
else{
|
||||
|
||||
$this->app->Tpl->Set('VUEJS', 'vue.min.js');
|
||||
$this->app->erp->RunHook('before_final_parse_page');
|
||||
$this->app->erp->RunHook('before_final_parse_page');
|
||||
echo $this->app->Tpl->FinalParse('page.tpl');
|
||||
}
|
||||
}
|
||||
|
@ -194,6 +194,11 @@ class HTMLInput
|
||||
name=\"{$this->name}\" value=\"{$this->value}\" size=\"{$this->size}\"
|
||||
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled}>";
|
||||
break;
|
||||
case "money":
|
||||
$html = "<input type=\"number\" step=\"any\" id=\"{$this->id}\" class=\"{$this->class}\" tabindex=\"{$this->tabindex}\"
|
||||
name=\"{$this->name}\" value=\"".preg_replace("/\"/",""",$this->value)."\" size=\"{$this->size}\" placeholder=\"{$this->placeholder}\"
|
||||
maxlength=\"{$this->maxlength}\" {$this->readonly} {$this->disabled} [COMMONREADONLYINPUT]>";
|
||||
break;
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
@ -295,8 +295,6 @@ class Acl
|
||||
/** @var EnvironmentConfig $environmentConfig */
|
||||
$environmentConfig = $this->app->Container->get('EnvironmentConfig');
|
||||
|
||||
$mailAddresses = array_merge($mailAddresses, $environmentConfig->getSystemFallbackEmailAddresses());
|
||||
|
||||
return array_unique($mailAddresses);
|
||||
}
|
||||
|
||||
@ -438,37 +436,24 @@ class Acl
|
||||
if(!empty($serverLocation)) {
|
||||
$server = rtrim($serverLocation,'/') . '?module=welcome&action=passwortvergessen&code=' . $code;
|
||||
}
|
||||
foreach(['default', 'fallback'] as $sentSetting) {
|
||||
if($sentSetting === 'fallback') {
|
||||
$db = $this->app->Conf->WFdbname;
|
||||
if(
|
||||
empty(erpAPI::Ioncube_Property('cloudemail'))
|
||||
|| $this->app->erp->firmendaten[$db]['email'] === erpAPI::Ioncube_Property('cloudemail')
|
||||
) {
|
||||
break;
|
||||
}
|
||||
$this->app->erp->firmendaten[$db]['mailanstellesmtp'] = 1;
|
||||
$this->app->erp->firmendaten[$db]['email'] = erpAPI::Ioncube_Property('cloudemail');
|
||||
foreach ($emailAddresses as $email) {
|
||||
$recipientMailAddress = $email;
|
||||
$recipientName = $name;
|
||||
if(empty($recipientMailAddress) || empty($recipientName)) {
|
||||
continue;
|
||||
}
|
||||
foreach ($emailAddresses as $email) {
|
||||
$recipientMailAddress = $email;
|
||||
$recipientName = $name;
|
||||
if(empty($recipientMailAddress) || empty($recipientName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$mailContent = str_replace(['{NAME}', '{ANREDE}', '{URL}'], [$recipientName, $anrede, $server], $mailContent);
|
||||
$mailContent = str_replace(['{NAME}', '{ANREDE}', '{URL}'], [$recipientName, $anrede, $server], $mailContent);
|
||||
|
||||
if(!$this->app->erp->isHTML($mailContent)){
|
||||
$mailContent = str_replace("\r\n", '<br>', $mailContent);
|
||||
}
|
||||
$mailSuccessfullySent = $this->app->erp->MailSend(
|
||||
$this->app->erp->GetFirmaMail(), $this->app->erp->GetFirmaAbsender(),
|
||||
$recipientMailAddress, $recipientName, $mailSubject, $mailContent, '', 0, true, '', '', true
|
||||
);
|
||||
if($mailSuccessfullySent){
|
||||
break 2;
|
||||
}
|
||||
if(!$this->app->erp->isHTML($mailContent)){
|
||||
$mailContent = str_replace("\r\n", '<br>', $mailContent);
|
||||
}
|
||||
$mailSuccessfullySent = $this->app->erp->MailSend(
|
||||
$this->app->erp->GetFirmaMail(), $this->app->erp->GetFirmaAbsender(),
|
||||
$recipientMailAddress, $recipientName, $mailSubject, $mailContent, '', 0, true, '', '', true
|
||||
);
|
||||
if($mailSuccessfullySent){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,12 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2019 Xentral ERP Software GmbH, Fuggerstrasse 11, D-86150 Augsburg
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
*/
|
||||
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
@ -10,8 +18,8 @@
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
|
||||
/**
|
||||
@ -34,12 +42,19 @@ class ModuleScriptCache
|
||||
/** @var string $relativeCacheDir Relativer Pfad zum Cache-Ordner (ausgehend von www) */
|
||||
protected $relativeCacheDir;
|
||||
|
||||
protected $assetDir;
|
||||
|
||||
/** @var object $assetManifest Parsed manifest.json from vite */
|
||||
protected $assetManifest;
|
||||
|
||||
/** @var array $javascriptFiles Absolute Pfade zu Javascript-Dateien die gecached werden sollen */
|
||||
protected $javascriptFiles = [
|
||||
'head' => [],
|
||||
'body' => [],
|
||||
];
|
||||
|
||||
protected $javascriptModules = [];
|
||||
|
||||
/** @var array $stylesheetFiles Absolute Pfade zu Stylesheet-Dateien die gecached werden sollen */
|
||||
protected $stylesheetFiles = [];
|
||||
|
||||
@ -48,6 +63,8 @@ class ModuleScriptCache
|
||||
$this->baseDir = dirname(dirname(__DIR__));
|
||||
$this->absoluteCacheDir = $this->baseDir . '/www/cache';
|
||||
$this->relativeCacheDir = './cache';
|
||||
$this->assetDir = '/dist';
|
||||
$this->assetManifest = json_decode(file_get_contents($this->baseDir. '/www' . $this->assetDir . '/.vite/manifest.json'));
|
||||
|
||||
// Cache-Ordner anzulegen, falls nicht existent
|
||||
if (!is_dir($this->absoluteCacheDir)) {
|
||||
@ -74,6 +91,7 @@ class ModuleScriptCache
|
||||
// Javascript- und Stylesheet-Dateien sind als Eigenschaft im Modul definiert
|
||||
$javascript = $this->GetClassProperty($legacyModuleClassName, 'javascript');
|
||||
$stylesheet = $this->GetClassProperty($legacyModuleClassName, 'stylesheet');
|
||||
$jsmodules = $this->GetClassProperty($legacyModuleClassName, 'jsmodules');
|
||||
|
||||
// Falls nicht im Modul definiert > Defaults verwenden
|
||||
if (empty($javascript)) {
|
||||
@ -82,9 +100,13 @@ class ModuleScriptCache
|
||||
if (empty($stylesheet)) {
|
||||
$stylesheet = [$this->GetDefaultModuleStylesheetFile($newModuleName)];
|
||||
}
|
||||
if (empty($jsmodules)) {
|
||||
$jsmodules = $this->GetDefaultModuleJavascriptModules($newModuleName);
|
||||
}
|
||||
|
||||
$this->IncludeJavascriptFiles($newModuleName, $javascript);
|
||||
$this->IncludeStylesheetFiles($newModuleName, $stylesheet);
|
||||
$this->IncludeJavascriptModules($newModuleName, $jsmodules);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -193,6 +215,16 @@ class ModuleScriptCache
|
||||
}
|
||||
}
|
||||
|
||||
public function IncludeJavascriptModules(string $moduleName, array $files) : void
|
||||
{
|
||||
foreach ($files as $file) {
|
||||
$realPath = realpath($this->baseDir . '/' . $file);
|
||||
if (!is_file($realPath))
|
||||
continue;
|
||||
$this->javascriptModules[] = $file;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $cacheName Name unter dem die Cache-Datei zusammengefasst werden
|
||||
* @param array $files Array mit relativen Pfaden zur Xentral-Installation
|
||||
@ -258,6 +290,55 @@ class ModuleScriptCache
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function GetJavascriptModulesHtmlTags() : string
|
||||
{
|
||||
if (empty($this->javascriptModules))
|
||||
return '';
|
||||
|
||||
$tags = [];
|
||||
if (defined('VITE_DEV_SERVER')) {
|
||||
foreach ($this->javascriptModules as $module)
|
||||
$tags[] = sprintf('<script type="module" src="%s"></script>',VITE_DEV_SERVER.'/'.$module);
|
||||
} else {
|
||||
foreach ($this->javascriptModules as $module)
|
||||
$this->includeChunk($module, true);
|
||||
foreach (array_unique($this->renderedCss) as $css)
|
||||
$tags[] = sprintf('<link rel="stylesheet" href="%s" />', $this->GetLinkUrl($css));
|
||||
foreach (array_unique($this->renderedJs) as $js)
|
||||
$tags[] = sprintf('<script type="module" src="%s"></script>', $this->GetLinkUrl($js));
|
||||
foreach (array_diff(array_unique($this->renderedPreload), $this->renderedJs) as $preload)
|
||||
$tags[] = sprintf('<link rel="modulepreload" href="%s" />', $this->GetLinkUrl($preload));
|
||||
}
|
||||
|
||||
return join("\n", $tags);
|
||||
}
|
||||
|
||||
private array $renderedCss = [];
|
||||
private array $renderedJs = [];
|
||||
private array $renderedPreload = [];
|
||||
private function includeChunk(string $chunkName, bool $isRoot = false) : void
|
||||
{
|
||||
if (!isset($this->assetManifest->$chunkName))
|
||||
return;
|
||||
|
||||
$manifestEntry = $this->assetManifest->$chunkName;
|
||||
foreach ($manifestEntry->css as $cssFile)
|
||||
$this->renderedCss[] = $cssFile;
|
||||
foreach ($manifestEntry->imports as $import)
|
||||
$this->includeChunk($import);
|
||||
|
||||
if ($isRoot)
|
||||
$this->renderedJs[] = $manifestEntry->file;
|
||||
else
|
||||
$this->renderedPreload[] = $manifestEntry->file;
|
||||
}
|
||||
|
||||
private function GetLinkUrl(string $chunkFile) {
|
||||
if (str_starts_with($chunkFile, 'http:'))
|
||||
return $chunkFile;
|
||||
return '.'.$this->assetDir.'/'.$chunkFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@ -389,6 +470,18 @@ class ModuleScriptCache
|
||||
return sprintf('./classes/Modules/%s/www/js/%s.js', $moduleName, strtolower($moduleName));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $moduleName
|
||||
* @return string relative path to default Javascript-Module-File
|
||||
*/
|
||||
protected function GetDefaultModuleJavascriptModules(string $moduleName): array
|
||||
{
|
||||
return [
|
||||
sprintf('classes/Modules/%s/www/js/entry.js', $moduleName),
|
||||
sprintf('classes/Modules/%s/www/js/entry.jsx', $moduleName)
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $moduleName
|
||||
*
|
||||
|
@ -154,7 +154,8 @@ class DB{
|
||||
$version_stringFormat = str_replace('.','',$version_string);
|
||||
return ['mysql', $version_string, $version_stringFormat];
|
||||
}
|
||||
$mariaVersion = substr($version, 0, 4);
|
||||
$version_array = explode('.', $version);
|
||||
$mariaVersion = $version_array[0].'.'.$version_array[1];
|
||||
$version_stringFormat = str_replace('.','', $mariaVersion);
|
||||
return ['mariadb',$mariaVersion, $version_stringFormat];
|
||||
}
|
||||
@ -1416,10 +1417,11 @@ class DB{
|
||||
* @param string $TableName
|
||||
* @param string $IDFieldName
|
||||
* @param int $IDToDuplicate
|
||||
* replace array('field' => 'value')
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function MysqlCopyRow($TableName, $IDFieldName, $IDToDuplicate)
|
||||
public function MysqlCopyRow($TableName, $IDFieldName, $IDToDuplicate, $replace = Array())
|
||||
{
|
||||
if(empty($TableName) || empty($IDFieldName) || empty($IDToDuplicate)) {
|
||||
return null;
|
||||
@ -1451,7 +1453,17 @@ class DB{
|
||||
$comma = "";
|
||||
foreach ($fields as $field => $value) {
|
||||
if ($field != $IDFieldName) {
|
||||
$sql .= $comma."`".$field."`";
|
||||
$replaced = false;
|
||||
foreach ($replace as $rkey => $rvalue) {
|
||||
if ($field == $rkey) {
|
||||
$sql .= $comma."'".$rvalue."' AS `".$rkey."`";
|
||||
$replaced = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$replaced) {
|
||||
$sql .= $comma."`".$field."`";
|
||||
}
|
||||
} else {
|
||||
$sql .= "NULL";
|
||||
}
|
||||
|
@ -365,9 +365,13 @@ class TemplateParser {
|
||||
echo '<br><br>';
|
||||
}
|
||||
}
|
||||
function SetText($_var, $_value)
|
||||
{
|
||||
$this->VARARRAY[$_var]= $this->htmlspecialchars($_value);
|
||||
function SetText($_var, $_value, $html = false)
|
||||
{
|
||||
if(!$html)
|
||||
{
|
||||
$_value = $this->htmlspecialchars($_value);
|
||||
}
|
||||
$this->VARARRAY[$_var]= $_value;
|
||||
}
|
||||
|
||||
function AddText($_var,$_value, $variable = false){
|
||||
@ -616,7 +620,7 @@ class TemplateParser {
|
||||
}
|
||||
}
|
||||
|
||||
if(count($this->VARARRAY)>0)
|
||||
if(!empty($this->VARARRAY))
|
||||
foreach($this->VARARRAY as $key=>$value)
|
||||
{
|
||||
if($key!="")
|
||||
|
@ -1122,6 +1122,15 @@ class YUI {
|
||||
return $newid;
|
||||
}
|
||||
|
||||
/*
|
||||
* Move all special fields by one position after a certain position
|
||||
* Use after inserting a position
|
||||
*/
|
||||
function pushDrawItem($module, $id, $pos) {
|
||||
$sql = "UPDATE `beleg_zwischenpositionen` set `pos` = `pos`+1 WHERE `pos` > $pos AND `doctype` = '$module' AND `doctypeid` = '$id'";
|
||||
$this->app->DB->Update($sql);
|
||||
}
|
||||
|
||||
function ReSortDrawItem($module, $id)
|
||||
{
|
||||
$items = $this->app->DB->SelectArr("SELECT id, pos, sort FROM beleg_zwischenpositionen WHERE doctype = '".$module."' AND doctypeid = '$id' ORDER BY pos, sort");
|
||||
@ -1820,8 +1829,16 @@ class YUI {
|
||||
)
|
||||
);
|
||||
$projekt = $this->app->DB->Select("SELECT id FROM projekt WHERE abkuerzung='$projekt' LIMIT 1");
|
||||
$sort = $this->app->DB->Select("SELECT MAX(sort) FROM $table WHERE $module='$id' LIMIT 1");
|
||||
$sort = $sort + 1;
|
||||
|
||||
$insertbefore = $this->app->Secure->GetPOST("insertbefore");
|
||||
if (is_numeric($insertbefore)) {
|
||||
$sort = $insertbefore - 1;
|
||||
$reload_afterwards = true;
|
||||
} else {
|
||||
$sort = $this->app->DB->Select("SELECT MAX(sort) FROM $table WHERE $module='$id' LIMIT 1");
|
||||
$sort = $sort + 1;
|
||||
}
|
||||
|
||||
$adresse = $docArr['adresse'];// $this->app->DB->Select("SELECT adresse FROM $module WHERE id='$id' LIMIT 1");
|
||||
$sprache = $docArr['sprache'];//$this->app->DB->Select("SELECT sprache FROM $module WHERE id='$id' LIMIT 1");
|
||||
if($sprache=='') {
|
||||
@ -1921,8 +1938,17 @@ class YUI {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->app->erp->RunHook('AARLGPositionenSprache', 6, $module, $id, $artikel_id, $sprache, $bezeichnung, $beschreibung);
|
||||
|
||||
// OpenXE artikel_texte
|
||||
$language = $this->app->erp->GetSpracheBeleg($module,$id);
|
||||
$sql = "SELECT * FROM artikel_texte WHERE artikel = '".$artikel_id."' AND sprache = '".$language."'";
|
||||
$uebersetzung = $this->app->DB->SelectRow($sql);
|
||||
if ($uebersetzung) {
|
||||
$bezeichnung = $uebersetzung['name'];
|
||||
$beschreibung = $uebersetzung['beschreibung'];
|
||||
}
|
||||
|
||||
$bezeichnung = $this->app->DB->real_escape_string($bezeichnung);
|
||||
$beschreibung = $this->app->DB->real_escape_string($beschreibung);
|
||||
|
||||
@ -2600,6 +2626,8 @@ class YUI {
|
||||
$sql .= $this->FormatPreis('einkaufspreis')." as einkaufspreis,
|
||||
CONCAT(".$this->app->erp->FormatPreis("ROUND(deckungsbeitrag*100,2)",2).",'%') AS DB,
|
||||
";
|
||||
} else {
|
||||
$sql .= "'-' AS 'einkaufspreis', '-' AS 'DB',";
|
||||
}
|
||||
|
||||
$sql .= "b.id as id
|
||||
@ -2845,7 +2873,9 @@ class YUI {
|
||||
$sql .= $this->FormatPreis('einkaufspreis')." as einkaufspreis,
|
||||
CONCAT(".$this->app->erp->FormatPreis("ROUND(deckungsbeitrag*100,2)",2).",'%') AS DB,
|
||||
";
|
||||
}
|
||||
} else {
|
||||
$sql .= "'-' AS 'einkaufspreis', '-' AS 'DB',";
|
||||
}
|
||||
|
||||
} else {
|
||||
$sql = "SELECT $sortcol, CONCAT($hersteller_ansicht if(b.beschreibung!='',
|
||||
@ -3043,6 +3073,13 @@ class YUI {
|
||||
}
|
||||
$this->app->Tpl->Add('PAGE', "</fieldset>");
|
||||
}
|
||||
|
||||
if ($reload_afterwards) {
|
||||
$this->pushDrawItem($module,$id,$sort);
|
||||
header('Location: index.php?module='.$module.'&action=positionen&id='.$id);
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function FormatPreis($spalte)
|
||||
@ -4182,14 +4219,14 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
||||
|
||||
$sortmodus = $this->TableSearchFilter($name, 1, 'sortmodus', 0,0, 'checkbox');
|
||||
// headings
|
||||
$heading = array('','','','Titel', 'Stichwort', 'Version','Größe', 'Ersteller','Version','Datum','Sortierung','Menü');
|
||||
$width = array('1%','1%','10','40%', '15%', '5%','10%','15%', '10%', '10%','15%', '10%','5%','1%');
|
||||
$findcols = array('open','d.id','d.id',"CONCAT(d.titel,' ',v.dateiname)", 's.subjekt', 'v.version',"if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),'')", 'v.ersteller','v.bemerkung','v.datum', 's.sort','s.id');
|
||||
$heading = array('','','','Titel', 'Stichwort', 'Version','Größe', 'Ersteller','Beschreibung','Datum','Sortierung','Geschützt','Menü');
|
||||
$width = array('1%','1%','10','40%', '15%', '5%','10%','15%', '10%', '10%','15%', '10%','5%','1%','1%');
|
||||
$findcols = array('open','d.id','d.id',"CONCAT(d.titel,' ',v.dateiname)", 's.subjekt', 'v.version',"if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),'')", 'v.ersteller','d.beschreibungbemerkung','v.datum', 's.sort','d.geschuetzt','s.id');
|
||||
$searchsql = array('d.titel', 's.subjekt', 'v.version',"if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),'')", 'v.ersteller','v.bemerkung','v.dateiname',"DATE_FORMAT(v.datum, '%d.%m.%Y')");
|
||||
|
||||
$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap><a href=\"#\" onclick=editdatei(%value%,\"$cmd\")><img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"index.php?module=dateien&action=send&id=%value%\"><img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/download.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=dateien&action=delete&cmd=".urlencode($objekt)."&id=%value%\")><img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\" ></a></td></tr></table>";
|
||||
$menucol = 11;
|
||||
$alignright=array(6,7,11);
|
||||
$menucol = 12;
|
||||
$alignright=array(6,7,11,12);
|
||||
|
||||
if(!function_exists('imagejpeg'))
|
||||
{
|
||||
@ -4199,10 +4236,21 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
||||
}
|
||||
|
||||
// SQL statement
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS d.id,'<img src=./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' as open,concat('<input type=\"checkbox\" id=\"auswahl_',d.id,'\" onchange=\"chauswahl();\" value=\"1\" />'),
|
||||
$img,
|
||||
|
||||
if(d.titel!='',CONCAT(d.titel,'<br><i style=color:#999>',v.dateiname,'</i>'),v.dateiname), s.subjekt, v.version, if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),''), v.ersteller, v.bemerkung, DATE_FORMAT(v.datum, '%d.%m.%Y'),s.sort,".($sortmodus?"s.id": "d.id")."
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS
|
||||
d.id,
|
||||
'<img src=./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' as open,
|
||||
CONCAT('<input type=\"checkbox\" id=\"auswahl_',d.id,'\" onchange=\"chauswahl();\" value=\"1\" />'),
|
||||
$img,
|
||||
if(d.titel!='',CONCAT(d.titel,'<br><i style=color:#999>',v.dateiname,'</i>'),v.dateiname),
|
||||
s.subjekt,
|
||||
v.version,
|
||||
if(v.size!='',if(v.size > 1024*1024,CONCAT(ROUND(v.size/1024/1024,2),' MB'),CONCAT(ROUND(v.size/1024,2),' KB')),''),
|
||||
v.ersteller,
|
||||
d.beschreibung,
|
||||
".$this->app->erp->FormatDate("v.datum").",
|
||||
s.sort,
|
||||
d.geschuetzt,
|
||||
".($sortmodus?"s.id": "d.id")."
|
||||
FROM `datei` AS `d`
|
||||
INNER JOIN `datei_stichwoerter` AS `s` ON d.id=s.datei
|
||||
LEFT JOIN (
|
||||
@ -5266,6 +5314,25 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
||||
)
|
||||
";
|
||||
}
|
||||
|
||||
if(isset($parameter['lieferadresse']) && !empty($parameter['lieferadresse'])) {
|
||||
$paramsArray[] = "
|
||||
(
|
||||
a.id IN
|
||||
(
|
||||
SELECT
|
||||
adresse
|
||||
FROM
|
||||
lieferadressen lfadr
|
||||
WHERE
|
||||
lfadr.name LIKE '%" . $parameter['lieferadresse'] . "%' OR
|
||||
lfadr.strasse LIKE '%" . $parameter['lieferadresse'] . "%' OR
|
||||
lfadr.plz LIKE '%" . $parameter['lieferadresse'] . "%' OR
|
||||
lfadr.ort LIKE '%" . $parameter['lieferadresse'] . "%'
|
||||
)
|
||||
)
|
||||
";
|
||||
}
|
||||
|
||||
if(isset($parameter['abteilung']) && !empty($parameter['abteilung'])) {
|
||||
$paramsArray[] = "a.abteilung LIKE '%".$parameter['abteilung']."%' ";
|
||||
@ -6706,11 +6773,11 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
|
||||
$menu .= "<img src=\"themes/{$this->app->Conf->WFconf['defaulttheme']}/images/copy.svg\" border=\"0\">";
|
||||
$menu .= "</a>";
|
||||
$menu .= "</td>";
|
||||
$menu .= "<td>";
|
||||
/* $menu .= "<td>";
|
||||
$menu .= "<a href=\"index.php?module=rechnung&action=pdf&id=%value%\">";
|
||||
$menu .= "<img src=\"themes/{$this->app->Conf->WFconf['defaulttheme']}/images/pdf.svg\" border=\"0\">";
|
||||
$menu .= "</a>";
|
||||
$menu .= "</td>";
|
||||
$menu .= "</td>";*/
|
||||
$menu .= "<td>";
|
||||
$menu .= '<a href="#" class="label-manager" data-label-column-number="6" data-label-reference-id="%value%" data-label-reference-table="rechnung">';
|
||||
$menu .= '<span class="label-manager-icon"></span>';
|
||||
@ -6757,6 +6824,10 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
|
||||
}
|
||||
}
|
||||
|
||||
$width[] = '1%';
|
||||
$findcols[] = 'r.id';
|
||||
$heading[] = '';
|
||||
|
||||
$width[] = '1%';
|
||||
$findcols[] = 'r.id';
|
||||
$heading[] = 'Menü';
|
||||
@ -6786,8 +6857,9 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
|
||||
if(r.soll-r.ist!=0 AND r.ist > 0,FORMAT(r.ist-r.soll,2{$extended_mysql55}),FORMAT((r.soll-r.ist)*-1,2{$extended_mysql55})),
|
||||
'')
|
||||
as fehlt,
|
||||
if(r.status = 'storniert' AND r.teilstorno = 1,'TEILSTORNO',UPPER(r.status)) as status,
|
||||
".(!empty($zusatzcols)?implode(', ',$zusatzcols).',':'')."
|
||||
if(r.status = 'storniert' AND r.teilstorno = 1,'TEILSTORNO',UPPER(r.status)) as status
|
||||
".(!empty($zusatzcols)?','.implode(', ',$zusatzcols):'').",
|
||||
".$this->GetRechnungFileDownloadLinkIconSQL().",
|
||||
r.id
|
||||
FROM rechnung r LEFT JOIN projekt p ON p.id=r.projekt LEFT JOIN adresse adr ON r.adresse=adr.id LEFT JOIN auftrag au ON au.id = r.auftragid ";
|
||||
if(isset($parameter['artikel']) && !empty($parameter['artikel'])) {
|
||||
@ -6983,7 +7055,7 @@ r.land as land, p.abkuerzung as projekt, r.zahlungsweise as zahlungsweise,
|
||||
|
||||
// SQL statement
|
||||
$sql =
|
||||
"SELECT
|
||||
"SELECT SQL_CALC_FOUND_ROWS
|
||||
b.id,
|
||||
'<img src=./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/details_open.png class=details>' AS `open`,
|
||||
'ENTWURF' AS `belegnr`,
|
||||
@ -14099,36 +14171,7 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
}
|
||||
$werte = $werte . $values[$i + 1];
|
||||
$this->app->Tpl->Add('CHARTS', "c.add('', '$color', [ $werte]);");
|
||||
}
|
||||
|
||||
function DateiUploadNeuVersion($parsetarget, $datei) {
|
||||
$speichern = $this->app->Secure->GetPOST("speichern");
|
||||
$module = $this->app->Secure->GetGET("module");
|
||||
$action = $this->app->Secure->GetGET("action");
|
||||
$id = $this->app->Secure->GetGET("id");
|
||||
if($id)$this->app->Tpl->Set('ID',$id);
|
||||
if ($speichern != "") {
|
||||
$titel = $this->app->Secure->GetPOST("titel");
|
||||
$beschreibung = $this->app->Secure->GetPOST("beschreibung");
|
||||
$stichwort = $this->app->Secure->GetPOST("stichwort");
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($_FILES['upload']['tmp_name'] == "") {
|
||||
$this->app->Tpl->Set('ERROR', "<div class=\"info\">Bitte wählen Sie eine Datei aus und laden Sie diese herauf!</div>");
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} else {
|
||||
|
||||
//$fileid = $this->app->erp->CreateDatei($_FILES['upload']['name'],$titel,$beschreibung,"",$_FILES['upload']['tmp_name'],$this->app->User->GetName());
|
||||
$this->app->erp->AddDateiVersion($datei, $this->app->User->GetName(), $_FILES['upload']['name'], "Neue Version", $_FILES['upload']['tmp_name']);
|
||||
header("Location: index.php?module=$module&action=$action&id=$id");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
$this->app->Tpl->Set('STARTDISABLE', "<!--");
|
||||
$this->app->Tpl->Set('ENDEDISABLE', "-->");
|
||||
$this->app->Tpl->Parse($parsetarget, "datei_neudirekt.tpl");
|
||||
}
|
||||
}
|
||||
|
||||
function DateiUpload($parsetarget, $objekt, $parameter, $optionen = null) {
|
||||
$speichern = $this->app->Secure->GetPOST("speichern");
|
||||
@ -14201,61 +14244,18 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
$id = $this->app->Secure->GetGET("id");
|
||||
$sid = $this->app->Secure->GetGET("sid");
|
||||
if($id)$this->app->Tpl->Set('ID', $id);
|
||||
|
||||
// Get files here
|
||||
if ($speichern != "") {
|
||||
if($parameter == '')$parameter = $id;
|
||||
if(isset($_POST['dateiv']))
|
||||
{
|
||||
foreach($_POST['dateiv'] as $k => $v)
|
||||
{
|
||||
$name = $this->app->DB->real_escape_string($_POST['dateiname'][$k]);
|
||||
$titel = $this->app->DB->real_escape_string($_POST['dateititel'][$k]);
|
||||
$beschreibung = $this->app->DB->real_escape_string($_POST['beschreibung'][$k]);
|
||||
$stichwort = $this->app->DB->real_escape_string($_POST['dateistichwort'][$k]);
|
||||
|
||||
//$getMime = explode('.', $name);
|
||||
//$mime = end($getMime);
|
||||
|
||||
$data = explode(',', $v);
|
||||
|
||||
$encodedData = str_replace(' ','+',$data[1]);
|
||||
$decodedData = base64_decode($encodedData);
|
||||
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($v == "" ) {
|
||||
$this->app->Tpl->Set('ERROR', "<div class=\"error\">Keine Datei ausgewählt!</div>");
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} else {
|
||||
$fileid = $this->app->erp->CreateDatei($name, $titel, $beschreibung, "", $decodedData, $this->app->User->GetName());
|
||||
|
||||
// stichwoerter hinzufuegen
|
||||
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
|
||||
}
|
||||
}
|
||||
if($_FILES['upload']['tmp_name'] == "")
|
||||
{
|
||||
header("Location: index.php?module=$_module&action=$_action&id=$id&sid=$sid".($typ!=''?"&typ=".$typ:''));
|
||||
}
|
||||
if($parameter == '') {
|
||||
$parameter = $id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$titel = $this->app->Secure->GetPOST("titel");
|
||||
$beschreibung = $this->app->Secure->GetPOST("beschreibung");
|
||||
$stichwort = $this->app->Secure->GetPOST("stichwort");
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($_FILES['upload']['tmp_name'] == "" && empty($_POST['dateiv'])) {
|
||||
$this->app->Tpl->Set('ERROR', "<div class=\"error\">Keine Datei ausgewählt!</div>");
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} elseif($_FILES['upload']['tmp_name'] != '') {
|
||||
$fileid = $this->app->erp->CreateDatei($_FILES['upload']['name'], $titel, $beschreibung, "", $_FILES['upload']['tmp_name'], $this->app->User->GetName());
|
||||
|
||||
// stichwoerter hinzufuegen
|
||||
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
|
||||
header("Location: index.php?module=$_module&action=$_action&id=$id&sid=$sid".($typ!=''?"&typ=".$typ:''));
|
||||
$retval = $this->FilesFromUploadtoDMS($objekt, $parameter);
|
||||
if ($retval !== true) {
|
||||
$this->app->Tpl->Set('ERROR', implode(', ',$retval));
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} else {
|
||||
header("Location: index.php?module=$_module&action=$_action&id=$id&sid=$sid".($typ!=''?"&typ=".$typ:''));
|
||||
}
|
||||
}
|
||||
|
||||
@ -14523,6 +14523,87 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Retrieve uploaded files and put them into DMS
|
||||
* $datei: given file, just add a new version
|
||||
* Return array of errors or true
|
||||
*/
|
||||
function FilesFromUploadtoDMS($objekt, $parameter, $datei = false) {
|
||||
|
||||
$retval = true;
|
||||
// Files come from drag'n'drop
|
||||
if(isset($_POST['dateiv']))
|
||||
{
|
||||
foreach($_POST['dateiv'] as $k => $v)
|
||||
{
|
||||
$name = $this->app->DB->real_escape_string($_POST['dateiname'][$k]);
|
||||
$titel = $this->app->DB->real_escape_string($_POST['dateititel'][$k]);
|
||||
$beschreibung = $this->app->DB->real_escape_string($_POST['dateibeschreibung'][$k]);
|
||||
$stichwort = $this->app->DB->real_escape_string($_POST['dateistichwort'][$k]);
|
||||
|
||||
$data = explode(',', $v);
|
||||
|
||||
$encodedData = str_replace(' ','+',$data[1]);
|
||||
$decodedData = base64_decode($encodedData);
|
||||
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($v == "" ) {
|
||||
$this->app->Tpl->Set('ERROR', "<div class=\"error\">Keine Datei ausgewählt!</div>");
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
} else {
|
||||
// Save file to disk first
|
||||
$tempfilename = rtrim($this->app->erp->GetTMP(), '/') . "/" . $name;
|
||||
if($handle = fopen($tempfilename, "wb")){
|
||||
fwrite($handle, $decodedData);
|
||||
fclose($handle);
|
||||
// Add file to DMS
|
||||
if ($datei) {
|
||||
$this->app->erp->AddDateiVersion($datei, $this->app->User->GetName(), $name, "Neue Version", $tempfilename);
|
||||
} else {
|
||||
$fileid = $this->app->erp->CreateDatei($name, $titel, $beschreibung, "", $tempfilename, $this->app->User->GetName());
|
||||
// stichwoerter hinzufuegen
|
||||
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
|
||||
}
|
||||
} else {
|
||||
if ($retval === true) {
|
||||
$retval = array();
|
||||
}
|
||||
$retval[] = "<div class=\"error\">Datei konnte nicht gespeichert werden: ".$name."</div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
} // drag'n'drop
|
||||
// Single file comes from browse button
|
||||
else {
|
||||
$titel = $this->app->Secure->GetPOST("titel");
|
||||
$beschreibung = $this->app->Secure->GetPOST("beschreibung");
|
||||
$stichwort = $this->app->Secure->GetPOST("stichwort");
|
||||
$this->app->Tpl->Set('TITLE', $titel);
|
||||
$this->app->Tpl->Set('BESCHREIBUNG', $beschreibung);
|
||||
|
||||
if ($_FILES['upload']['tmp_name'] == "" && empty($_POST['dateiv'])) {
|
||||
$this->app->erp->EnableTab("tabs-2");
|
||||
if ($retval === true) {
|
||||
$retval = array();
|
||||
}
|
||||
$retval[] = "<div class=\"error\">Keine Datei ausgewählt!</div>";
|
||||
|
||||
} elseif ($_FILES['upload']['tmp_name'] != '') {
|
||||
if ($datei) {
|
||||
$this->app->erp->AddDateiVersion($datei, $this->app->User->GetName(), $_FILES['upload']['name'], "Neue Version", $_FILES['upload']['tmp_name']);
|
||||
}
|
||||
else {
|
||||
$fileid = $this->app->erp->CreateDatei($_FILES['upload']['name'], $titel, $beschreibung, "", $_FILES['upload']['tmp_name'], $this->app->User->GetName());
|
||||
// stichwoerter hinzufuegen
|
||||
$this->app->erp->AddDateiStichwort($fileid, $stichwort, $objekt, $parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
return($retval);
|
||||
}
|
||||
|
||||
function SortListAdd($parsetarget, &$ref, $menu, $sql, $sort = true) {
|
||||
|
||||
$module = $this->app->Secure->GetGET("module");
|
||||
@ -14792,7 +14873,7 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
if ($module == "angebot" || $module == "auftrag" || $module == "rechnung" || $module == "gutschrift" || $module == "proformarechnung") {
|
||||
|
||||
if ($schreibschutz != 1) {
|
||||
$addrow = array('<form action="" method="post" id="myform">', '[ARTIKELSTART]<input type="text" size="30" name="artikel" id="artikel" onblur="window.setTimeout(\'selectafterblur()\',200);">[ARTIKELENDE]', '<input type="text" name="projekt" id="projekt" size="10" readonly onclick="checkhere()" >', '<input type="text" name="nummer" id="nummer" size="7">', '<input type="text" size="8" name="lieferdatum" id="lieferdatum">', '<input type="text" name="menge" id="menge" size="5" onblur="window.setTimeout(\'selectafterblurmenge()\',200); document.getElementById(\'preis\').style.background =\'none\';">', '<input type="text" name="preis" id="preis" size="10" onclick="checkhere();">', '<input type="text" name="waehrung" id="waehrung" size="10" onclick="checkhere();">' ,'<input type="text" name="rabatt" id="rabatt" size="7">','','');
|
||||
$addrow = array('<form action="" method="post" id="myform"><input type="number" min="1" size="4" name="insertbefore">', '[ARTIKELSTART]<input type="text" size="30" name="artikel" id="artikel" onblur="window.setTimeout(\'selectafterblur()\',200);">[ARTIKELENDE]', '<input type="text" name="projekt" id="projekt" size="10" readonly onclick="checkhere()" >', '<input type="text" name="nummer" id="nummer" size="7">', '<input type="text" size="8" name="lieferdatum" id="lieferdatum">', '<input type="text" name="menge" id="menge" size="5" onblur="window.setTimeout(\'selectafterblurmenge()\',200); document.getElementById(\'preis\').style.background =\'none\';">', '<input type="text" name="preis" id="preis" size="10" onclick="checkhere();">', '<input type="text" name="waehrung" id="waehrung" size="10" onclick="checkhere();">' ,'<input type="text" name="rabatt" id="rabatt" size="7">','','');
|
||||
$addrow[] = '<input type="submit" value="einfügen" name="ajaxbuchen">
|
||||
<script type="text/javascript">
|
||||
document.onkeydown = function(evt) {
|
||||
@ -15849,4 +15930,24 @@ function IframeDialog($width, $height, $src = "") {
|
||||
return 'convert(cast(convert('.$field.' using latin1) as binary) using utf8)';
|
||||
//return $field.' COLLATE utf8_general_ci'; ersetzt Original
|
||||
}
|
||||
|
||||
public function GetRechnungFileDownloadLinkIconSQL($tablename = 'r') {
|
||||
return(
|
||||
"IF(".$tablename.".xmlrechnung,
|
||||
CONCAT('<a href=\"index.php?module=rechnung&action=xml&id=',".$tablename.".id,'\"><img src=\"themes/".$this->app->Conf->WFconf['defaulttheme']."/images/xml.svg\" border=\"0\">'),
|
||||
CONCAT('<a href=\"index.php?module=rechnung&action=pdf&id=',".$tablename.".id,'\"><img src=\"themes/".$this->app->Conf->WFconf['defaulttheme']."/images/pdf.svg\" border=\"0\">')
|
||||
)"
|
||||
);
|
||||
}
|
||||
|
||||
public function GetRechnungFileDownloadLinkIcon($id) {
|
||||
$xmlrechnung = $this->app->DB->SelectRow("SELECT belegnr, xmlrechnung FROM rechnung WHERE id = '".$id."' LIMIT 1");
|
||||
if ($xmlrechnung['belegnr'] == '') {
|
||||
return('');
|
||||
} else if ($xmlrechnung['xmlrechnung']) {
|
||||
return("<a href=\"index.php?module=rechnung&action=xml&id=%value%\"><img border=\"0\" src=\"./themes/new/images/xml.svg\" title=\"XML\"></a>");
|
||||
} else {
|
||||
return("<a href=\"index.php?module=rechnung&action=pdf&id=%value%\"><img border=\"0\" src=\"./themes/new/images/pdf.svg\" title=\"PDF\"></a>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
31
resources/css/primevue/_base.css
Normal file
31
resources/css/primevue/_base.css
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
@import "basecomponent.css";
|
||||
@import "autocomplete.css";
|
||||
@import "dialog.css";
|
||||
@import "dropdown.css";
|
||||
@import "icons.css";
|
||||
@import "listbox.css";
|
||||
|
||||
.p-component-overlay {
|
||||
background-color: rgba(170,170,170,0.7);
|
||||
}
|
||||
|
||||
.p-button {
|
||||
background-color: var(--button-primary-background);
|
||||
padding: 6px;
|
||||
margin: 3px;
|
||||
color: white;
|
||||
border-radius: 3px;
|
||||
border: 1px solid var(--button-primary-border-color);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.p-icon {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
}
|
206
resources/css/primevue/autocomplete.css
Normal file
206
resources/css/primevue/autocomplete.css
Normal file
@ -0,0 +1,206 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
.p-autocomplete .p-autocomplete-loader {
|
||||
right: 0.75rem;
|
||||
}
|
||||
.p-autocomplete.p-autocomplete-dd .p-autocomplete-loader {
|
||||
right: 3.107rem;
|
||||
}
|
||||
.p-autocomplete:not(.p-disabled):hover .p-autocomplete-multiple-container {
|
||||
border-color: #ced4da;
|
||||
}
|
||||
.p-autocomplete:not(.p-disabled).p-focus .p-autocomplete-multiple-container {
|
||||
outline: 0 none;
|
||||
outline-offset: 0;
|
||||
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
|
||||
border-color: #007bff;
|
||||
}
|
||||
.p-autocomplete .p-autocomplete-multiple-container {
|
||||
padding: 0.25rem 0.75rem;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-input-token {
|
||||
padding: 0.25rem 0;
|
||||
}
|
||||
.p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-input-token input {
|
||||
font-family: inherit;
|
||||
font-feature-settings: inherit;
|
||||
font-size: inherit;
|
||||
color: #212529;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-token {
|
||||
padding: 0.25rem 0.75rem;
|
||||
background: #dee2e6;
|
||||
color: #212529;
|
||||
border-radius: 16px;
|
||||
}
|
||||
.p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-token .p-autocomplete-token-icon {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
.p-autocomplete .p-autocomplete-multiple-container .p-autocomplete-token.p-focus {
|
||||
background: #ced4da;
|
||||
color: #212529;
|
||||
}
|
||||
.p-autocomplete.p-invalid.p-component > .p-inputtext {
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.p-autocomplete-panel {
|
||||
background: #ffffff;
|
||||
color: var(--grey);
|
||||
border: 1px solid var(--fieldset-dark);
|
||||
border-radius: 4px;
|
||||
box-shadow: none;
|
||||
}
|
||||
.p-autocomplete-panel .p-autocomplete-items {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item {
|
||||
margin: 0;
|
||||
padding: 3px;
|
||||
border: 0 none;
|
||||
color: #212529;
|
||||
background: transparent;
|
||||
transition: box-shadow 0.15s;
|
||||
border-radius: 0;
|
||||
}
|
||||
.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item.p-highlight {
|
||||
color: #ffffff;
|
||||
background: #007bff;
|
||||
}
|
||||
.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item.p-highlight.p-focus {
|
||||
background: #0067d6;
|
||||
}
|
||||
.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item:not(.p-highlight):not(.p-disabled).p-focus {
|
||||
color: #212529;
|
||||
background: #dee2e6;
|
||||
}
|
||||
.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item:not(.p-highlight):not(.p-disabled):hover {
|
||||
color: #212529;
|
||||
background: #e9ecef;
|
||||
}
|
||||
.p-autocomplete-panel .p-autocomplete-items .p-autocomplete-item-group {
|
||||
margin: 0;
|
||||
padding: 0.75rem 1rem;
|
||||
color: #212529;
|
||||
background: #ffffff;
|
||||
font-weight: 600;
|
||||
}
|
||||
input[type=text].p-autocomplete-dd-input {
|
||||
border-bottom-right-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
.p-autocomplete-dd .p-autocomplete-dropdown {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0px;
|
||||
margin: 0;
|
||||
padding: 3px;
|
||||
}
|
||||
.p-autocomplete-dd .p-autocomplete-dropdown svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
@layer primevue {
|
||||
.p-autocomplete {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.p-autocomplete-loader {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -0.5rem;
|
||||
}
|
||||
|
||||
.p-autocomplete-dd .p-autocomplete-input {
|
||||
flex: 1 1 auto;
|
||||
width: 1%;
|
||||
}
|
||||
|
||||
.p-autocomplete-dd .p-autocomplete-input,
|
||||
.p-autocomplete-dd .p-autocomplete-multiple-container {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
.p-autocomplete-dd .p-autocomplete-dropdown {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0px;
|
||||
}
|
||||
|
||||
.p-autocomplete .p-autocomplete-panel {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.p-autocomplete-panel {
|
||||
position: absolute;
|
||||
overflow: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.p-autocomplete-items {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.p-autocomplete-item {
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.p-autocomplete-multiple-container {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style-type: none;
|
||||
cursor: text;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.p-autocomplete-token {
|
||||
cursor: default;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.p-autocomplete-token-icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.p-autocomplete-input-token {
|
||||
flex: 1 1 auto;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.p-autocomplete-input-token input {
|
||||
border: 0 none;
|
||||
outline: 0 none;
|
||||
background-color: transparent;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.p-fluid .p-autocomplete {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.p-fluid .p-autocomplete-dd .p-autocomplete-input {
|
||||
width: 1%;
|
||||
}
|
||||
}
|
163
resources/css/primevue/basecomponent.css
Normal file
163
resources/css/primevue/basecomponent.css
Normal file
@ -0,0 +1,163 @@
|
||||
@layer primevue {
|
||||
.p-component, .p-component * {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.p-hidden-space {
|
||||
visibility: hidden;
|
||||
}
|
||||
.p-reset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
text-decoration: none;
|
||||
font-size: 100%;
|
||||
list-style: none;
|
||||
}
|
||||
.p-disabled, .p-disabled * {
|
||||
cursor: default;
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
}
|
||||
.p-component-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.p-unselectable-text {
|
||||
user-select: none;
|
||||
}
|
||||
.p-sr-only {
|
||||
border: 0;
|
||||
clip: rect(1px, 1px, 1px, 1px);
|
||||
clip-path: inset(50%);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
word-wrap: normal;
|
||||
}
|
||||
.p-link {
|
||||
text-align: left;
|
||||
background-color: transparent;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.p-link:disabled {
|
||||
cursor: default;
|
||||
}
|
||||
/* Non vue overlay animations */
|
||||
.p-connected-overlay {
|
||||
opacity: 0;
|
||||
transform: scaleY(0.8);
|
||||
transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);
|
||||
}
|
||||
.p-connected-overlay-visible {
|
||||
opacity: 1;
|
||||
transform: scaleY(1);
|
||||
}
|
||||
.p-connected-overlay-hidden {
|
||||
opacity: 0;
|
||||
transform: scaleY(1);
|
||||
transition: opacity .1s linear;
|
||||
}
|
||||
/* Vue based overlay animations */
|
||||
.p-connected-overlay-enter-from {
|
||||
opacity: 0;
|
||||
transform: scaleY(0.8);
|
||||
}
|
||||
.p-connected-overlay-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
.p-connected-overlay-enter-active {
|
||||
transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1);
|
||||
}
|
||||
.p-connected-overlay-leave-active {
|
||||
transition: opacity .1s linear;
|
||||
}
|
||||
/* Toggleable Content */
|
||||
.p-toggleable-content-enter-from,
|
||||
.p-toggleable-content-leave-to {
|
||||
max-height: 0;
|
||||
}
|
||||
.p-toggleable-content-enter-to,
|
||||
.p-toggleable-content-leave-from {
|
||||
max-height: 1000px;
|
||||
}
|
||||
.p-toggleable-content-leave-active {
|
||||
overflow: hidden;
|
||||
transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);
|
||||
}
|
||||
.p-toggleable-content-enter-active {
|
||||
overflow: hidden;
|
||||
transition: max-height 1s ease-in-out;
|
||||
}
|
||||
.p-button {
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
align-items: center;
|
||||
vertical-align: bottom;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
.p-button-label {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.p-button-icon-right {
|
||||
order: 1;
|
||||
}
|
||||
.p-button:disabled {
|
||||
cursor: default;
|
||||
}
|
||||
.p-button-icon-only {
|
||||
justify-content: center;
|
||||
}
|
||||
.p-button-icon-only .p-button-label {
|
||||
visibility: hidden;
|
||||
width: 0;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.p-button-vertical {
|
||||
flex-direction: column;
|
||||
}
|
||||
.p-button-icon-bottom {
|
||||
order: 2;
|
||||
}
|
||||
.p-buttonset .p-button {
|
||||
margin: 0;
|
||||
}
|
||||
.p-buttonset .p-button:not(:last-child), .p-buttonset .p-button:not(:last-child):hover {
|
||||
border-right: 0 none;
|
||||
}
|
||||
.p-buttonset .p-button:not(:first-of-type):not(:last-of-type) {
|
||||
border-radius: 0;
|
||||
}
|
||||
.p-buttonset .p-button:first-of-type:not(:only-of-type) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.p-buttonset .p-button:last-of-type:not(:only-of-type) {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.p-buttonset .p-button:focus {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
.p-fluid .p-inputtext {
|
||||
width: 100%;
|
||||
}
|
||||
.p-fluid .p-input-icon-left,
|
||||
.p-fluid .p-input-icon-right {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
78
resources/css/primevue/checkbox.css
Normal file
78
resources/css/primevue/checkbox.css
Normal file
@ -0,0 +1,78 @@
|
||||
@layer primevue {
|
||||
.p-checkbox {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
user-select: none;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.p-checkbox-input {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.p-checkbox-box {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.p-checkbox {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.p-checkbox .p-checkbox-input {
|
||||
appearance: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
z-index: 1;
|
||||
outline: 0 none;
|
||||
border: 2px solid #ced4da;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.p-checkbox .p-checkbox-box {
|
||||
border: 2px solid #ced4da;
|
||||
background: #ffffff;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
color: #212529;
|
||||
border-radius: 4px;
|
||||
transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
|
||||
outline-color: transparent;
|
||||
}
|
||||
.p-checkbox .p-checkbox-box .p-checkbox-icon {
|
||||
transition-duration: 0.15s;
|
||||
color: #ffffff;
|
||||
font-size: 14px;
|
||||
}
|
||||
.p-checkbox .p-checkbox-box .p-checkbox-icon.p-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
.p-checkbox .p-checkbox-box.p-highlight {
|
||||
border-color: var(--button-primary-background);
|
||||
background: var(--button-primary-background);
|
||||
}
|
||||
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box {
|
||||
border-color: #ced4da;
|
||||
}
|
||||
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:hover) .p-checkbox-box.p-highlight {
|
||||
border-color: #0062cc;
|
||||
background: #0062cc;
|
||||
color: #ffffff;
|
||||
}
|
||||
.p-checkbox:not(.p-disabled):has(.p-checkbox-input:focus-visible) .p-checkbox-box {
|
||||
outline: 0 none;
|
||||
outline-offset: 0;
|
||||
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
|
||||
border-color: #007bff;
|
||||
}
|
||||
.p-checkbox.p-invalid > .p-checkbox-box {
|
||||
border-color: #dc3545;
|
||||
}
|
166
resources/css/primevue/dialog.css
Normal file
166
resources/css/primevue/dialog.css
Normal file
@ -0,0 +1,166 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
.p-dialog {
|
||||
background-color: var(--body-background);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.p-dialog-header {
|
||||
color: #6d6d6f;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
padding: .4em 1em;
|
||||
}
|
||||
|
||||
.p-dialog .p-dialog-header .p-dialog-header-icon {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
|
||||
.p-dialog .p-dialog-content {
|
||||
padding: 0.5em 1em;
|
||||
}
|
||||
|
||||
.p-dialog .p-dialog-footer {
|
||||
border-top: 1px solid var(--fieldset-dark);
|
||||
padding: 0.3em 1em 0.5em 0.4em;
|
||||
text-align: right;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
|
||||
@layer primevue {
|
||||
.p-dialog-mask.p-component-overlay {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.p-dialog {
|
||||
max-height: 90%;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.p-dialog-content {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.p-dialog-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.p-dialog-footer {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.p-dialog .p-dialog-header-icons {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.p-dialog .p-dialog-header-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Fluid */
|
||||
.p-fluid .p-dialog-footer .p-button {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/* Animation */
|
||||
/* Center */
|
||||
.p-dialog-enter-active {
|
||||
transition: all 150ms cubic-bezier(0, 0, 0.2, 1);
|
||||
}
|
||||
.p-dialog-leave-active {
|
||||
transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
.p-dialog-enter-from,
|
||||
.p-dialog-leave-to {
|
||||
opacity: 0;
|
||||
transform: scale(0.7);
|
||||
}
|
||||
|
||||
/* Top, Bottom, Left, Right, Top* and Bottom* */
|
||||
.p-dialog-top .p-dialog,
|
||||
.p-dialog-bottom .p-dialog,
|
||||
.p-dialog-left .p-dialog,
|
||||
.p-dialog-right .p-dialog,
|
||||
.p-dialog-topleft .p-dialog,
|
||||
.p-dialog-topright .p-dialog,
|
||||
.p-dialog-bottomleft .p-dialog,
|
||||
.p-dialog-bottomright .p-dialog {
|
||||
margin: 0.75rem;
|
||||
transform: translate3d(0px, 0px, 0px);
|
||||
}
|
||||
.p-dialog-top .p-dialog-enter-active,
|
||||
.p-dialog-top .p-dialog-leave-active,
|
||||
.p-dialog-bottom .p-dialog-enter-active,
|
||||
.p-dialog-bottom .p-dialog-leave-active,
|
||||
.p-dialog-left .p-dialog-enter-active,
|
||||
.p-dialog-left .p-dialog-leave-active,
|
||||
.p-dialog-right .p-dialog-enter-active,
|
||||
.p-dialog-right .p-dialog-leave-active,
|
||||
.p-dialog-topleft .p-dialog-enter-active,
|
||||
.p-dialog-topleft .p-dialog-leave-active,
|
||||
.p-dialog-topright .p-dialog-enter-active,
|
||||
.p-dialog-topright .p-dialog-leave-active,
|
||||
.p-dialog-bottomleft .p-dialog-enter-active,
|
||||
.p-dialog-bottomleft .p-dialog-leave-active,
|
||||
.p-dialog-bottomright .p-dialog-enter-active,
|
||||
.p-dialog-bottomright .p-dialog-leave-active {
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
.p-dialog-top .p-dialog-enter-from,
|
||||
.p-dialog-top .p-dialog-leave-to {
|
||||
transform: translate3d(0px, -100%, 0px);
|
||||
}
|
||||
.p-dialog-bottom .p-dialog-enter-from,
|
||||
.p-dialog-bottom .p-dialog-leave-to {
|
||||
transform: translate3d(0px, 100%, 0px);
|
||||
}
|
||||
.p-dialog-left .p-dialog-enter-from,
|
||||
.p-dialog-left .p-dialog-leave-to,
|
||||
.p-dialog-topleft .p-dialog-enter-from,
|
||||
.p-dialog-topleft .p-dialog-leave-to,
|
||||
.p-dialog-bottomleft .p-dialog-enter-from,
|
||||
.p-dialog-bottomleft .p-dialog-leave-to {
|
||||
transform: translate3d(-100%, 0px, 0px);
|
||||
}
|
||||
.p-dialog-right .p-dialog-enter-from,
|
||||
.p-dialog-right .p-dialog-leave-to,
|
||||
.p-dialog-topright .p-dialog-enter-from,
|
||||
.p-dialog-topright .p-dialog-leave-to,
|
||||
.p-dialog-bottomright .p-dialog-enter-from,
|
||||
.p-dialog-bottomright .p-dialog-leave-to {
|
||||
transform: translate3d(100%, 0px, 0px);
|
||||
}
|
||||
|
||||
/* Maximize */
|
||||
.p-dialog-maximized {
|
||||
width: 100vw !important;
|
||||
height: 100vh !important;
|
||||
top: 0px !important;
|
||||
left: 0px !important;
|
||||
max-height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.p-dialog-maximized .p-dialog-content {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.p-confirm-dialog .p-dialog-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
210
resources/css/primevue/dropdown.css
Normal file
210
resources/css/primevue/dropdown.css
Normal file
@ -0,0 +1,210 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
@layer primevue {
|
||||
.p-dropdown {
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
user-select: none;
|
||||
}
|
||||
.p-dropdown-clear-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -0.5rem;
|
||||
}
|
||||
.p-dropdown-trigger {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.p-dropdown-label {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
flex: 1 1 auto;
|
||||
width: 1%;
|
||||
text-overflow: ellipsis;
|
||||
cursor: pointer;
|
||||
}
|
||||
.p-dropdown-label-empty {
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
input.p-dropdown-label {
|
||||
cursor: default;
|
||||
}
|
||||
.p-dropdown .p-dropdown-panel {
|
||||
min-width: 100%;
|
||||
}
|
||||
.p-dropdown-panel {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.p-dropdown-items-wrapper {
|
||||
overflow: auto;
|
||||
}
|
||||
.p-dropdown-item {
|
||||
cursor: pointer;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.p-dropdown-item-group {
|
||||
cursor: auto;
|
||||
}
|
||||
.p-dropdown-items {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
.p-dropdown-filter {
|
||||
width: 100%;
|
||||
}
|
||||
.p-dropdown-filter-container {
|
||||
position: relative;
|
||||
}
|
||||
.p-dropdown-filter-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -0.5rem;
|
||||
}
|
||||
.p-fluid .p-dropdown {
|
||||
display: flex;
|
||||
}
|
||||
.p-fluid .p-dropdown .p-dropdown-label {
|
||||
width: 1%;
|
||||
}
|
||||
}
|
||||
|
||||
.p-dropdown {
|
||||
background: #ffffff;
|
||||
border: 1px solid #ced4da;
|
||||
transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
|
||||
border-radius: 4px;
|
||||
padding: 4px 5px;
|
||||
font-size: 11px;
|
||||
}
|
||||
.p-dropdown:not(.p-disabled):hover {
|
||||
border-color: #ced4da;
|
||||
}
|
||||
.p-dropdown:not(.p-disabled).p-focus {
|
||||
outline: 0 none;
|
||||
outline-offset: 0;
|
||||
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
|
||||
border-color: #007bff;
|
||||
}
|
||||
.p-dropdown.p-dropdown-clearable .p-dropdown-label {
|
||||
padding-right: 1.75rem;
|
||||
}
|
||||
.p-dropdown .p-dropdown-label {
|
||||
background: transparent;
|
||||
border: 0 none;
|
||||
color: #6d6d6f;
|
||||
}
|
||||
.p-dropdown .p-dropdown-label.p-placeholder {
|
||||
color: #6c757d;
|
||||
}
|
||||
.p-dropdown .p-dropdown-label:focus, .p-dropdown .p-dropdown-label:enabled:focus {
|
||||
outline: 0 none;
|
||||
box-shadow: none;
|
||||
}
|
||||
.p-dropdown .p-dropdown-trigger {
|
||||
background: transparent;
|
||||
color: #495057;
|
||||
width: 2.357rem;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
.p-dropdown .p-dropdown-clear-icon {
|
||||
color: #495057;
|
||||
right: 2.357rem;
|
||||
}
|
||||
.p-dropdown.p-invalid.p-component {
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.p-dropdown-panel {
|
||||
background: #ffffff;
|
||||
color: var(--grey);
|
||||
border: 1px solid var(--fieldset-dark);
|
||||
border-radius: 4px;
|
||||
box-shadow: none;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-header {
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
color: #212529;
|
||||
background: #efefef;
|
||||
margin: 0;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-header .p-dropdown-filter {
|
||||
padding-right: 1.75rem;
|
||||
margin-right: -1.75rem;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-header .p-dropdown-filter-icon {
|
||||
right: 0.75rem;
|
||||
color: #495057;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-items {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-item {
|
||||
margin: 0;
|
||||
padding: 3px;
|
||||
border: 0 none;
|
||||
color: #212529;
|
||||
background: transparent;
|
||||
transition: box-shadow 0.15s;
|
||||
border-radius: 0;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight {
|
||||
color: #ffffff;
|
||||
background: #007bff;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight.p-focus {
|
||||
background: #0067d6;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-item:not(.p-highlight):not(.p-disabled).p-focus {
|
||||
color: #212529;
|
||||
background: #dee2e6;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-item:not(.p-highlight):not(.p-disabled):hover {
|
||||
color: #212529;
|
||||
background: #e9ecef;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-item-group {
|
||||
margin: 0;
|
||||
padding: 0.75rem 1rem;
|
||||
color: #212529;
|
||||
background: #ffffff;
|
||||
font-weight: 600;
|
||||
}
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-empty-message {
|
||||
padding: 0.5rem 1.5rem;
|
||||
color: #212529;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.p-input-filled .p-dropdown {
|
||||
background: #efefef;
|
||||
}
|
||||
.p-input-filled .p-dropdown:not(.p-disabled):hover {
|
||||
background-color: #efefef;
|
||||
}
|
||||
.p-input-filled .p-dropdown:not(.p-disabled).p-focus {
|
||||
background-color: #efefef;
|
||||
}
|
||||
.p-input-filled .p-dropdown:not(.p-disabled).p-focus .p-inputtext {
|
||||
background-color: transparent;
|
||||
}
|
30
resources/css/primevue/icons.css
Normal file
30
resources/css/primevue/icons.css
Normal file
@ -0,0 +1,30 @@
|
||||
.p-icon {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.p-icon-spin {
|
||||
-webkit-animation: p-icon-spin 2s infinite linear;
|
||||
animation: p-icon-spin 2s infinite linear;
|
||||
}
|
||||
|
||||
@-webkit-keyframes p-icon-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes p-icon-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
105
resources/css/primevue/listbox.css
Normal file
105
resources/css/primevue/listbox.css
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
@layer primevue {
|
||||
.p-listbox-list-wrapper {
|
||||
overflow: auto;
|
||||
}
|
||||
.p-listbox-list {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.p-listbox-item {
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.p-listbox-item-group {
|
||||
cursor: auto;
|
||||
}
|
||||
.p-listbox-filter-container {
|
||||
position: relative;
|
||||
}
|
||||
.p-listbox-filter-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -0.5rem;
|
||||
}
|
||||
.p-listbox-filter {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.p-listbox {
|
||||
background: #ffffff;
|
||||
color: #6d6d6f;
|
||||
border: 1px solid #ced4da;
|
||||
border-radius: 4px;
|
||||
transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
.p-listbox .p-listbox-header {
|
||||
padding: 0.75rem 1.5rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
color: #212529;
|
||||
background: #efefef;
|
||||
margin: 0;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
}
|
||||
.p-listbox .p-listbox-header .p-listbox-filter {
|
||||
padding-right: 1.75rem;
|
||||
}
|
||||
.p-listbox .p-listbox-header .p-listbox-filter-icon {
|
||||
right: 0.75rem;
|
||||
color: #495057;
|
||||
}
|
||||
.p-listbox .p-listbox-list {
|
||||
padding: 0.5rem 0;
|
||||
outline: 0 none;
|
||||
}
|
||||
.p-listbox .p-listbox-list .p-listbox-item {
|
||||
margin: 0;
|
||||
padding: 0.5rem 1.5rem;
|
||||
border: 0 none;
|
||||
color: #212529;
|
||||
transition: box-shadow 0.15s;
|
||||
border-radius: 0;
|
||||
}
|
||||
.p-listbox .p-listbox-list .p-listbox-item.p-highlight {
|
||||
color: #ffffff;
|
||||
background: var(--green);
|
||||
}
|
||||
.p-listbox .p-listbox-list .p-listbox-item-group {
|
||||
margin: 0;
|
||||
padding: 0.75rem 1rem;
|
||||
color: #212529;
|
||||
background: #ffffff;
|
||||
font-weight: 600;
|
||||
}
|
||||
.p-listbox .p-listbox-list .p-listbox-empty-message {
|
||||
padding: 0.5rem 1.5rem;
|
||||
color: #212529;
|
||||
background: transparent;
|
||||
}
|
||||
.p-listbox:not(.p-disabled) .p-listbox-item.p-highlight.p-focus {
|
||||
background: var(--green);
|
||||
}
|
||||
.p-listbox:not(.p-disabled) .p-listbox-item:not(.p-highlight):not(.p-disabled).p-focus {
|
||||
color: #212529;
|
||||
background: #dee2e6;
|
||||
}
|
||||
.p-listbox:not(.p-disabled) .p-listbox-item:not(.p-highlight):not(.p-disabled):hover {
|
||||
color: #212529;
|
||||
background: #e9ecef;
|
||||
}
|
||||
.p-listbox.p-focus {
|
||||
outline: 0 none;
|
||||
outline-offset: 0;
|
||||
}
|
||||
.p-listbox.p-invalid {
|
||||
border-color: #dc3545;
|
||||
}
|
247
resources/css/primevue/multiselect.css
Normal file
247
resources/css/primevue/multiselect.css
Normal file
@ -0,0 +1,247 @@
|
||||
@layer primevue {
|
||||
.p-multiselect {
|
||||
display: inline-flex;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.p-multiselect-trigger {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.p-multiselect-label-container {
|
||||
overflow: hidden;
|
||||
flex: 1 1 auto;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.p-multiselect-label {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.p-multiselect-label-empty {
|
||||
overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.p-multiselect-token {
|
||||
cursor: default;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.p-multiselect-token-icon {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.p-multiselect .p-multiselect-panel {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.p-multiselect-items-wrapper {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.p-multiselect-items {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.p-multiselect-item {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: normal;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.p-multiselect-item-group {
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.p-multiselect-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.p-multiselect-filter-container {
|
||||
position: relative;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.p-multiselect-filter-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -0.5rem;
|
||||
}
|
||||
|
||||
.p-multiselect-filter-container .p-inputtext {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.p-multiselect-close {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.p-fluid .p-multiselect {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.p-multiselect {
|
||||
background: #ffffff;
|
||||
border: 1px solid #ced4da;
|
||||
transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
|
||||
border-radius: 4px;
|
||||
outline-color: transparent;
|
||||
}
|
||||
.p-multiselect:not(.p-disabled):hover {
|
||||
border-color: #ced4da;
|
||||
}
|
||||
.p-multiselect:not(.p-disabled).p-focus {
|
||||
outline: 0 none;
|
||||
outline-offset: 0;
|
||||
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
|
||||
border-color: #007bff;
|
||||
}
|
||||
.p-multiselect .p-multiselect-label {
|
||||
padding: 0.25rem 0.75rem;
|
||||
transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
.p-multiselect .p-multiselect-label.p-placeholder {
|
||||
color: #6c757d;
|
||||
}
|
||||
.p-multiselect.p-multiselect-chip .p-multiselect-token {
|
||||
padding: 0.25rem 0.75rem;
|
||||
margin-right: 0.5rem;
|
||||
background: #dee2e6;
|
||||
color: #212529;
|
||||
border-radius: 16px;
|
||||
}
|
||||
.p-multiselect.p-multiselect-chip .p-multiselect-token .p-multiselect-token-icon {
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
.p-multiselect .p-multiselect-trigger {
|
||||
background: transparent;
|
||||
color: #495057;
|
||||
width: 2.357rem;
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
.p-multiselect.p-invalid.p-component {
|
||||
border-color: #dc3545;
|
||||
}
|
||||
|
||||
.p-inputwrapper-filled.p-multiselect.p-multiselect-chip .p-multiselect-label {
|
||||
padding: 0.25rem 0.75rem;
|
||||
}
|
||||
|
||||
.p-multiselect-panel {
|
||||
background: #ffffff;
|
||||
color: var(--grey);
|
||||
border: 1px solid var(--fieldset-dark);
|
||||
border-radius: 4px;
|
||||
box-shadow: none;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-header {
|
||||
padding: 3px;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
color: #212529;
|
||||
background: #efefef;
|
||||
margin: 0;
|
||||
border-top-right-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-header .p-multiselect-filter-container .p-inputtext {
|
||||
padding-right: 1.75rem;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-header .p-multiselect-filter-container .p-multiselect-filter-icon {
|
||||
right: 0.75rem;
|
||||
color: #495057;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-header .p-checkbox {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-header .p-multiselect-close {
|
||||
margin-left: 0.5rem;
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
color: #6c757d;
|
||||
border: 0 none;
|
||||
background: transparent;
|
||||
border-radius: 50%;
|
||||
transition: box-shadow 0.15s;
|
||||
outline-color: transparent;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-header .p-multiselect-close:enabled:hover {
|
||||
color: #495057;
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-header .p-multiselect-close:focus-visible {
|
||||
outline: 0 none;
|
||||
outline-offset: 0;
|
||||
box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items {
|
||||
padding: 0;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item {
|
||||
margin: 0;
|
||||
padding: 3px;
|
||||
border: 0 none;
|
||||
color: #212529;
|
||||
background: transparent;
|
||||
transition: box-shadow 0.15s;
|
||||
border-radius: 0;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item.p-highlight {
|
||||
/*color: #ffffff;*/
|
||||
/*background: var(--button-primary-background);*/
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item.p-highlight.p-focus {
|
||||
/*background: var(--button-primary-background);*/
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item:not(.p-highlight):not(.p-disabled).p-focus {
|
||||
color: #212529;
|
||||
background: #e9ecef;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item .p-checkbox {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-item-group {
|
||||
margin: 0;
|
||||
padding: 0.75rem 1rem;
|
||||
color: #212529;
|
||||
background: #ffffff;
|
||||
font-weight: 600;
|
||||
}
|
||||
.p-multiselect-panel .p-multiselect-items .p-multiselect-empty-message {
|
||||
padding: 0.5rem 1.5rem;
|
||||
color: #212529;
|
||||
background: transparent;
|
||||
}
|
33
resources/css/vue.css
Normal file
33
resources/css/vue.css
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
*
|
||||
* SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
*/
|
||||
|
||||
.vueAction {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.flex-align-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.justify-self-start {
|
||||
justify-self: start;
|
||||
}
|
||||
|
||||
.gap-1 {
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.grid label, .grid .p-checkbox {
|
||||
padding-top: 5px;
|
||||
}
|
15
resources/js/ajaxErrorHandler.ts
Normal file
15
resources/js/ajaxErrorHandler.ts
Normal file
@ -0,0 +1,15 @@
|
||||
// SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import {AxiosError} from 'axios';
|
||||
|
||||
export function AlertErrorHandler(error: AxiosError) {
|
||||
if (error.response === undefined || error.response.status >= 500) {
|
||||
console.log('Unknown error on axios request', error);
|
||||
alert('Unerwarteter Fehler, weitere Hinweise ggf. in der JavaScript-Konsole');
|
||||
} else {
|
||||
console.log('ClientError on axios request', error);
|
||||
alert(error.response.data);
|
||||
}
|
||||
}
|
7
resources/js/jqueryBridge.js
vendored
Normal file
7
resources/js/jqueryBridge.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
// SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export function reloadDataTables() {
|
||||
window.$('#main .dataTable').DataTable().ajax.reload();
|
||||
}
|
25
resources/js/vue.js
Normal file
25
resources/js/vue.js
Normal file
@ -0,0 +1,25 @@
|
||||
// SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
//
|
||||
// SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
|
||||
import '@res/css/vue.css';
|
||||
import {createApp} from "vue";
|
||||
import PrimeVue from "primevue/config";
|
||||
import Aura from '@primevue/themes/aura';
|
||||
import {definePreset} from "@primevue/themes";
|
||||
|
||||
const OpenXePreset = definePreset(Aura, {
|
||||
|
||||
});
|
||||
|
||||
export function createVueApp(rootComponent, rootProps) {
|
||||
return createApp(rootComponent, rootProps)
|
||||
.use(PrimeVue, {
|
||||
theme: {
|
||||
preset: OpenXePreset,
|
||||
options: {
|
||||
darkModeSelector: '.openXeDarkMode'
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
52
resources/vue/AutoComplete.vue
Normal file
52
resources/vue/AutoComplete.vue
Normal file
@ -0,0 +1,52 @@
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2023 Andreas Palm
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<script setup>
|
||||
import {ref} from "vue";
|
||||
import AutoComplete from "primevue/autocomplete";
|
||||
import axios from "axios";
|
||||
import SearchIcon from "@primevue/icons/search";
|
||||
|
||||
const props = defineProps({
|
||||
ajaxFilter: String,
|
||||
modelValue: null,
|
||||
forceSelection: Boolean,
|
||||
inputId: String,
|
||||
});
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
const items = ref([]);
|
||||
async function search(event) {
|
||||
await axios.get('index.php',
|
||||
{
|
||||
params: {
|
||||
module: 'ajax',
|
||||
action: 'filter',
|
||||
filtername: props.ajaxFilter,
|
||||
term: event.query,
|
||||
object: true
|
||||
}
|
||||
})
|
||||
.then(response => items.value = response.data)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AutoComplete
|
||||
:modelValue="modelValue"
|
||||
@update:modelValue="value => emit('update:modelValue', value)"
|
||||
:suggestions="items"
|
||||
@complete="search"
|
||||
dataKey="id"
|
||||
:forceSelection="forceSelection"
|
||||
dropdown
|
||||
:input-id="inputId"
|
||||
>
|
||||
<template #dropdownicon>
|
||||
<SearchIcon />
|
||||
</template>
|
||||
</AutoComplete>
|
||||
</template>
|
@ -36,7 +36,7 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
// columns that are aligned right (numbers etc)
|
||||
// $alignright = array(4,5,6,7,8);
|
||||
|
||||
$findcols = array('PLACEHOLDER_ID_COLUMN','PLACEHOLDER_ID_COLUMN',PLACEHOLDER_SQL_COLUMNS);
|
||||
$findcols = array('PLACEHOLDER_ID_COLUMN','PLACEHOLDER_ID_COLUMN',PLACEHOLDER_SQL_COLUMNS); // use 'null' for non-searchable columns
|
||||
$searchsql = array(PLACEHOLDER_SQL_COLUMNS);
|
||||
|
||||
$defaultorder = 1;
|
||||
@ -60,6 +60,8 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
$count = "SELECT count(DISTINCT id) FROM PLACEHOLDER_MODULENAME WHERE $where";
|
||||
// $groupby = "";
|
||||
|
||||
// echo($sql." WHERE ".$where." ".$groupby);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3682,6 +3682,39 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "lieferscheinpositionetikettdruck",
|
||||
"Type": "int(1)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "lieferscheinpositionetikett",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "rechnung_smarty_template",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
@ -18196,7 +18229,7 @@
|
||||
},
|
||||
{
|
||||
"Field": "sprache",
|
||||
"Type": "varchar(11)",
|
||||
"Type": "varchar(30)",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
@ -18692,6 +18725,14 @@
|
||||
"id"
|
||||
],
|
||||
"Non_unique": ""
|
||||
},
|
||||
{
|
||||
"Key_name": "eigenschaft_unique",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"Non_unique": "UNIQUE"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -18802,6 +18843,15 @@
|
||||
"artikel"
|
||||
],
|
||||
"Non_unique": ""
|
||||
},
|
||||
{
|
||||
"Key_name": "eigenschaft_artikel_unique",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"artikel",
|
||||
"artikeleigenschaften"
|
||||
],
|
||||
"Non_unique": "UNIQUE"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -31142,6 +31192,17 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "geschuetzt",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "logdatei",
|
||||
"Type": "timestamp",
|
||||
@ -44229,6 +44290,17 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "rechnung_smarty_template",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
@ -77521,6 +77593,39 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "etiketten_kommissionierung",
|
||||
"Type": "tinyint(1)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "etiketten_kommissionierung_drucker",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "etiketten_kommissionierung_art",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "etiketten_positionen",
|
||||
"Type": "tinyint(1)",
|
||||
@ -78819,6 +78924,17 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "etiketten_kommissionierung_sort",
|
||||
"Type": "tinyint(2)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "etiketten_sort",
|
||||
"Type": "tinyint(2)",
|
||||
@ -80248,6 +80364,17 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "rechnung_smarty_template",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
@ -84126,6 +84253,17 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "xmlrechnung",
|
||||
"Type": "int(1)",
|
||||
"Collation": null,
|
||||
"Null": "YES",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
@ -91423,12 +91561,12 @@
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "adresse",
|
||||
"Type": "int(11)",
|
||||
"Field": "datum",
|
||||
"Type": "datetime",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Default": "current_timestamp()",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
@ -91456,34 +91594,12 @@
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "lieferung",
|
||||
"Type": "date",
|
||||
"Field": "eingelagert",
|
||||
"Type": "int(1)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "lieferschein",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "lieferscheinpos",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Default": 0,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
@ -91511,6 +91627,76 @@
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
{
|
||||
"Key_name": "PRIMARY",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"id"
|
||||
],
|
||||
"Non_unique": ""
|
||||
},
|
||||
{
|
||||
"Key_name": "seriennummer_artikel",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"seriennummer",
|
||||
"artikel"
|
||||
],
|
||||
"Non_unique": "UNIQUE"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "seriennummern_beleg_position",
|
||||
"collation": "utf8mb3_general_ci",
|
||||
"type": "BASE TABLE",
|
||||
"columns": [
|
||||
{
|
||||
"Field": "id",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "PRI",
|
||||
"Default": null,
|
||||
"Extra": "auto_increment",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "seriennummer",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "beleg_typ",
|
||||
"Type": "varchar(30)",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "beleg_position",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
{
|
||||
"Key_name": "PRIMARY",
|
||||
@ -112329,7 +112515,7 @@
|
||||
},
|
||||
{
|
||||
"Field": "preis",
|
||||
"Type": "decimal(14,5)",
|
||||
"Type": "decimal(14,10)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
@ -119036,6 +119222,56 @@
|
||||
"Non_unique": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "smarty_templates",
|
||||
"collation": "utf8mb3_general_ci",
|
||||
"type": "BASE TABLE",
|
||||
"columns": [
|
||||
{
|
||||
"Field": "id",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "PRI",
|
||||
"Default": null,
|
||||
"Extra": "auto_increment",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "name",
|
||||
"Type": "varchar(30)",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "template",
|
||||
"Type": "text",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
{
|
||||
"Key_name": "PRIMARY",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"id"
|
||||
],
|
||||
"Non_unique": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"views": [
|
||||
@ -119057,12 +119293,12 @@
|
||||
{
|
||||
"name": "fibu_objekte_view",
|
||||
"type": "VIEW",
|
||||
"Create": "CREATE VIEW `fibu_objekte_view` AS select `fo`.`datum` AS `datum`,`fo`.`typ` AS `typ`,`fo`.`id` AS `id`,`fo`.`info` AS `info`,`fo`.`parent_typ` AS `parent_typ`,`fo`.`parent_id` AS `parent_id`,`fo`.`parent_info` AS `parent_info`,`fo`.`typ` in ('rechnung','gutschrift','verbindlichkeit','auftrag') AS `is_beleg` from (select `auftrag`.`datum` AS `datum`,'auftrag' AS `typ`,`auftrag`.`id` AS `id`,`auftrag`.`belegnr` AS `info`,'adresse' AS `parent_typ`,`auftrag`.`adresse` AS `parent_id`,`auftrag`.`name` AS `parent_info` from `auftrag` where `auftrag`.`belegnr` <> '' union select `rechnung`.`datum` AS `datum`,'rechnung' AS `typ`,`rechnung`.`id` AS `id`,`rechnung`.`belegnr` AS `info`,'adresse' AS `parent_type`,`rechnung`.`adresse` AS `parent_id`,`rechnung`.`name` AS `parent_info` from `rechnung` where `rechnung`.`belegnr` <> '' union select `gutschrift`.`datum` AS `datum`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`belegnr` AS `belegnr`,'adresse' AS `parent_type`,`gutschrift`.`adresse` AS `parent_id`,`gutschrift`.`name` AS `parent_info` from `gutschrift` where `gutschrift`.`belegnr` <> '' union select `verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`rechnung` AS `belegnr`,'adresse' AS `parent_type`,`verbindlichkeit`.`adresse` AS `parent_id`,`adresse`.`name` AS `name` from (`verbindlichkeit` join `adresse` on(`verbindlichkeit`.`adresse` = `adresse`.`id`)) where `verbindlichkeit`.`belegnr` <> '' union select `kontoauszuege`.`buchung` AS `buchung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,concat(`konten`.`kurzbezeichnung`,' - ',`kontoauszuege`.`buchungstext`) AS `buchungstext`,'konten' AS `parent_type`,`kontoauszuege`.`konto` AS `parent_id`,`konten`.`bezeichnung` AS `bezeichnung` from (`kontoauszuege` left join `konten` on(`konten`.`id` = `kontoauszuege`.`konto`)) union select '' AS `datum`,'kontorahmen' AS `'kontorahmen'`,`kontorahmen`.`id` AS `id`,concat(`kontorahmen`.`sachkonto`,' - ',`kontorahmen`.`beschriftung`) AS `beschriftung`,'','','' from `kontorahmen`) `fo` where `fo`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') or `fo`.`datum` = ''"
|
||||
"Create": "CREATE VIEW `fibu_objekte_view` AS select `fo`.`datum` AS `datum`,`fo`.`typ` AS `typ`,`fo`.`id` AS `id`,`fo`.`info` AS `info`,`fo`.`parent_typ` AS `parent_typ`,`fo`.`parent_id` AS `parent_id`,`fo`.`parent_info` AS `parent_info`,`fo`.`typ` in ('rechnung','gutschrift','verbindlichkeit','auftrag') AS `is_beleg` from (select `auftrag`.`datum` AS `datum`,'auftrag' AS `typ`,`auftrag`.`id` AS `id`,`auftrag`.`belegnr` AS `info`,'adresse' AS `parent_typ`,`auftrag`.`adresse` AS `parent_id`,`auftrag`.`name` AS `parent_info` from `auftrag` where `auftrag`.`belegnr` <> '' and `auftrag`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') union select `rechnung`.`datum` AS `datum`,'rechnung' AS `typ`,`rechnung`.`id` AS `id`,`rechnung`.`belegnr` AS `info`,'adresse' AS `parent_type`,`rechnung`.`adresse` AS `parent_id`,`rechnung`.`name` AS `parent_info` from `rechnung` where `rechnung`.`belegnr` <> '' and `rechnung`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') union select `gutschrift`.`datum` AS `datum`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`belegnr` AS `belegnr`,'adresse' AS `parent_type`,`gutschrift`.`adresse` AS `parent_id`,`gutschrift`.`name` AS `parent_info` from `gutschrift` where `gutschrift`.`belegnr` <> '' and `gutschrift`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') union select `verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`rechnung` AS `belegnr`,'adresse' AS `parent_type`,`verbindlichkeit`.`adresse` AS `parent_id`,`adresse`.`name` AS `name` from (`verbindlichkeit` join `adresse` on(`verbindlichkeit`.`adresse` = `adresse`.`id`)) where `verbindlichkeit`.`belegnr` <> '' and `verbindlichkeit`.`rechnungsdatum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') union select `kontoauszuege`.`buchung` AS `buchung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,concat(`konten`.`kurzbezeichnung`,' - ',`kontoauszuege`.`buchungstext`) AS `buchungstext`,'konten' AS `parent_type`,`kontoauszuege`.`konto` AS `parent_id`,`konten`.`bezeichnung` AS `bezeichnung` from (`kontoauszuege` left join `konten` on(`konten`.`id` = `kontoauszuege`.`konto`)) where `kontoauszuege`.`importfehler` is null and `kontoauszuege`.`buchung` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') union select '' AS `datum`,'kontorahmen' AS `'kontorahmen'`,`kontorahmen`.`id` AS `id`,concat(`kontorahmen`.`sachkonto`,' - ',`kontorahmen`.`beschriftung`) AS `beschriftung`,'','','' from `kontorahmen`) `fo` where `fo`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') or `fo`.`datum` = ''"
|
||||
},
|
||||
{
|
||||
"name": "fibu_buchungen_alle_view",
|
||||
"type": "VIEW",
|
||||
"Create": "CREATE VIEW `fibu_buchungen_alle_view` AS select `fb`.`buchungsart` AS `buchungsart`,`fb`.`typ` AS `typ`,`fb`.`id` AS `id`,if(`fibu_objekte_view`.`datum` <> '',`fibu_objekte_view`.`datum`,`fb`.`datum`) AS `datum`,`fb`.`gegen_typ` AS `doc_typ`,`fb`.`gegen_id` AS `doc_id`,`fibu_objekte_view`.`info` AS `doc_info`,cast(`fb`.`soll` as decimal(10,2)) AS `betrag`,`fb`.`waehrung` AS `waehrung`,`fb`.`edit_module` AS `edit_module`,`fb`.`edit_id` AS `edit_id` from ((select 'umsatz' AS `buchungsart`,'rechnung' AS `typ`,`rechnung`.`id` AS `id`,-`rechnung`.`soll` AS `soll`,`rechnung`.`waehrung` AS `waehrung`,'rechnung' AS `gegen_typ`,`rechnung`.`id` AS `gegen_id`,`rechnung`.`datum` AS `datum`,'rechnung' AS `edit_module`,`rechnung`.`id` AS `edit_id` from `rechnung` where `rechnung`.`belegnr` <> '' union select 'umsatz' AS `umsatz`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`soll` AS `soll`,`gutschrift`.`waehrung` AS `waehrung`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`datum` AS `datum`,'gutschrift' AS `edit_module`,`gutschrift`.`id` AS `id` from `gutschrift` where `gutschrift`.`belegnr` <> '' union select 'aufwand' AS `aufwand`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`betrag` AS `betrag`,`verbindlichkeit`.`waehrung` AS `waehrung`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id` from `verbindlichkeit` where `verbindlichkeit`.`belegnr` <> '' union select 'zahlung' AS `zahlung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,`kontoauszuege`.`soll` AS `soll`,`kontoauszuege`.`waehrung` AS `waehrung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,`kontoauszuege`.`buchung` AS `buchung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id` from `kontoauszuege` where `kontoauszuege`.`importfehler` is null union select 'abbuchung' AS `abbuchung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,`fibu_buchungen`.`betrag` AS `betrag`,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,`fibu_buchungen`.`datum` AS `datum`,'fibu_buchungen' AS `fibu_buchungen`,`fibu_buchungen`.`id` AS `id` from `fibu_buchungen` union select 'zubuchung' AS `zubuchung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,-`fibu_buchungen`.`betrag` AS `-``openxe``.``fibu_buchungen``.``betrag```,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,`fibu_buchungen`.`datum` AS `datum`,'fibu_buchungen' AS `fibu_buchungen`,`fibu_buchungen`.`id` AS `id` from `fibu_buchungen`) `fb` left join `fibu_objekte_view` on(`fb`.`gegen_typ` = `fibu_objekte_view`.`typ` and `fb`.`gegen_id` = `fibu_objekte_view`.`id`)) where `fb`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') and `fibu_objekte_view`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') or `fibu_objekte_view`.`datum` = ''"
|
||||
"Create": "CREATE VIEW `fibu_buchungen_alle_view` AS select `fb`.`buchungsart` AS `buchungsart`,`fb`.`typ` AS `typ`,`fb`.`id` AS `id`,if(`fibu_objekte_view`.`datum` <> '',`fibu_objekte_view`.`datum`,`fb`.`datum`) AS `datum`,`fb`.`gegen_typ` AS `doc_typ`,`fb`.`gegen_id` AS `doc_id`,`fibu_objekte_view`.`info` AS `doc_info`,cast(`fb`.`soll` as decimal(10,2)) AS `betrag`,`fb`.`waehrung` AS `waehrung`,`fb`.`edit_module` AS `edit_module`,`fb`.`edit_id` AS `edit_id` from ((select 'umsatz' AS `buchungsart`,'rechnung' AS `typ`,`rechnung`.`id` AS `id`,-`rechnung`.`soll` AS `soll`,`rechnung`.`waehrung` AS `waehrung`,'rechnung' AS `gegen_typ`,`rechnung`.`id` AS `gegen_id`,`rechnung`.`datum` AS `datum`,'rechnung' AS `edit_module`,`rechnung`.`id` AS `edit_id` from `rechnung` where `rechnung`.`belegnr` <> '' and `rechnung`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') union select 'umsatz' AS `umsatz`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`soll` AS `soll`,`gutschrift`.`waehrung` AS `waehrung`,'gutschrift' AS `gutschrift`,`gutschrift`.`id` AS `id`,`gutschrift`.`datum` AS `datum`,'gutschrift' AS `edit_module`,`gutschrift`.`id` AS `id` from `gutschrift` where `gutschrift`.`belegnr` <> '' and `gutschrift`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') union select 'aufwand' AS `aufwand`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`betrag` AS `betrag`,`verbindlichkeit`.`waehrung` AS `waehrung`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id`,`verbindlichkeit`.`rechnungsdatum` AS `rechnungsdatum`,'verbindlichkeit' AS `verbindlichkeit`,`verbindlichkeit`.`id` AS `id` from `verbindlichkeit` where `verbindlichkeit`.`belegnr` <> '' and `verbindlichkeit`.`rechnungsdatum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') union select 'zahlung' AS `zahlung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,`kontoauszuege`.`soll` AS `soll`,`kontoauszuege`.`waehrung` AS `waehrung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id`,`kontoauszuege`.`buchung` AS `buchung`,'kontoauszuege' AS `kontoauszuege`,`kontoauszuege`.`id` AS `id` from `kontoauszuege` where `kontoauszuege`.`importfehler` is null and `kontoauszuege`.`buchung` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') union select 'abbuchung' AS `abbuchung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,`fibu_buchungen`.`betrag` AS `betrag`,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,`fibu_buchungen`.`datum` AS `datum`,'fibu_buchungen' AS `fibu_buchungen`,`fibu_buchungen`.`id` AS `id` from `fibu_buchungen` union select 'zubuchung' AS `zubuchung`,`fibu_buchungen`.`nach_typ` AS `nach_typ`,`fibu_buchungen`.`nach_id` AS `nach_id`,-`fibu_buchungen`.`betrag` AS `-``openxe``.``fibu_buchungen``.``betrag```,`fibu_buchungen`.`waehrung` AS `waehrung`,`fibu_buchungen`.`von_typ` AS `von_typ`,`fibu_buchungen`.`von_id` AS `von_id`,`fibu_buchungen`.`datum` AS `datum`,'fibu_buchungen' AS `fibu_buchungen`,`fibu_buchungen`.`id` AS `id` from `fibu_buchungen`) `fb` left join `fibu_objekte_view` on(`fb`.`gegen_typ` = `fibu_objekte_view`.`typ` and `fb`.`gegen_id` = `fibu_objekte_view`.`id`)) where `fb`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') and `fibu_objekte_view`.`datum` >= (select `firmendaten_werte`.`wert` from `firmendaten_werte` where `firmendaten_werte`.`name` = 'fibu_buchungen_startdatum') or `fibu_objekte_view`.`datum` = ''"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -284,6 +284,36 @@ function upgrade_main(string $directory,bool $verbose, bool $check_git, bool $do
|
||||
return(-1);
|
||||
}
|
||||
echo_output($output);
|
||||
|
||||
// Remove files cache
|
||||
echo_out("--------------- Cleaning Filescache ---------------\n");
|
||||
class UserdataInfo {
|
||||
function __construct($dir) {
|
||||
require($dir."/../conf/user.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
$udi = new UserdataInfo($directory);
|
||||
|
||||
$cache_files = array('cache_javascript.php','cache_services.php');
|
||||
|
||||
$delete_cache_result = true;
|
||||
|
||||
foreach ($cache_files as $cache_file) {
|
||||
$filename = $udi->WFuserdata."/tmp/".$udi->WFdbname."/".$cache_file;
|
||||
$delete_cache_file_result = @unlink($filename);
|
||||
if (!$delete_cache_file_result) {
|
||||
echo_out("Failed to delete ".$filename."! Please delete manually...\n");
|
||||
$delete_cache_result = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($delete_cache_result) {
|
||||
echo_out("--------------- Cleaning Filescache completed ---------------\n");
|
||||
} else {
|
||||
echo_out("--------------- Cleaning Filescache failed! ---------------\n");
|
||||
}
|
||||
|
||||
} // $do_git
|
||||
else { // Dry run
|
||||
echo_out("--------------- Dry run, use -do to upgrade ---------------\n");
|
||||
|
@ -1,2 +1,52 @@
|
||||
#!/bin/bash
|
||||
sudo -u www-data php data/upgrade.php "$@"
|
||||
|
||||
echo_user() {
|
||||
echo
|
||||
echo "--------------- Starting with user \"$_user\" ---------------"
|
||||
}
|
||||
|
||||
while :
|
||||
do
|
||||
clear
|
||||
echo "--------------- OpenXE manual upgrade ---------------"
|
||||
echo -e "Choose user:"
|
||||
echo -e "1) autodect user "
|
||||
echo -e "2) use current user "
|
||||
echo -e "3) read username from \"upgrade.user\" file"
|
||||
echo -e "4) enter username "
|
||||
echo ""
|
||||
echo -e "0) Exit"
|
||||
read -p "Choose an option: " main </dev/tty
|
||||
case $main in
|
||||
1)
|
||||
_user=$(ls -la data/upgrade.php | awk '{print $3}')
|
||||
echo_user
|
||||
sudo -u $_user php data/upgrade.php "$@"
|
||||
exit 1
|
||||
;;
|
||||
2)
|
||||
_user=$(whoami)
|
||||
echo_user
|
||||
php data/upgrade.php "$@"
|
||||
exit 1
|
||||
;;
|
||||
3)
|
||||
_user=$(cat upgrade.user)
|
||||
echo_user
|
||||
sudo -u $_user php data/upgrade.php "$@"
|
||||
exit 1
|
||||
;;
|
||||
4)
|
||||
read -p "Enter your username: " _user
|
||||
echo_user
|
||||
sudo -u $_user php data/upgrade.php "$@"
|
||||
exit 1
|
||||
;;
|
||||
0)
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
clear
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
18
vendor/autoload.php
vendored
18
vendor/autoload.php
vendored
@ -2,6 +2,24 @@
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit0c49a81c1214ef2f7493c6ce921b17ee::getLoader();
|
||||
|
163
vendor/bin/jp.php
vendored
Normal file → Executable file
163
vendor/bin/jp.php
vendored
Normal file → Executable file
@ -1,74 +1,119 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
} elseif (file_exists(__DIR__ . '/../../../autoload.php')) {
|
||||
require __DIR__ . '/../../../autoload.php';
|
||||
} elseif (file_exists(__DIR__ . '/../autoload.php')) {
|
||||
require __DIR__ . '/../autoload.php';
|
||||
} else {
|
||||
throw new RuntimeException('Unable to locate autoload.php file.');
|
||||
}
|
||||
/**
|
||||
* Proxy PHP file generated by Composer
|
||||
*
|
||||
* This file includes the referenced bin path (../mtdowling/jmespath.php/bin/jp.php)
|
||||
* using a stream wrapper to prevent the shebang from being output on PHP<8
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
|
||||
use JmesPath\Env;
|
||||
use JmesPath\DebugRuntime;
|
||||
namespace Composer;
|
||||
|
||||
$description = <<<EOT
|
||||
Runs a JMESPath expression on the provided input or a test case.
|
||||
$GLOBALS['_composer_bin_dir'] = __DIR__;
|
||||
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
|
||||
|
||||
Provide the JSON input and expression:
|
||||
echo '{}' | jp.php expression
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
if (!class_exists('Composer\BinProxyWrapper')) {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class BinProxyWrapper
|
||||
{
|
||||
private $handle;
|
||||
private $position;
|
||||
private $realpath;
|
||||
|
||||
Or provide the path to a compliance script, a suite, and test case number:
|
||||
jp.php --script path_to_script --suite test_suite_number --case test_case_number [expression]
|
||||
public function stream_open($path, $mode, $options, &$opened_path)
|
||||
{
|
||||
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
||||
$opened_path = substr($path, 17);
|
||||
$this->realpath = realpath($opened_path) ?: $opened_path;
|
||||
$opened_path = $this->realpath;
|
||||
$this->handle = fopen($this->realpath, $mode);
|
||||
$this->position = 0;
|
||||
|
||||
EOT;
|
||||
return (bool) $this->handle;
|
||||
}
|
||||
|
||||
$args = [];
|
||||
$currentKey = null;
|
||||
for ($i = 1, $total = count($argv); $i < $total; $i++) {
|
||||
if ($i % 2) {
|
||||
if (substr($argv[$i], 0, 2) == '--') {
|
||||
$currentKey = str_replace('--', '', $argv[$i]);
|
||||
} else {
|
||||
$currentKey = trim($argv[$i]);
|
||||
}
|
||||
} else {
|
||||
$args[$currentKey] = $argv[$i];
|
||||
$currentKey = null;
|
||||
}
|
||||
}
|
||||
public function stream_read($count)
|
||||
{
|
||||
$data = fread($this->handle, $count);
|
||||
|
||||
$expression = $currentKey;
|
||||
if ($this->position === 0) {
|
||||
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
||||
}
|
||||
|
||||
if (isset($args['file']) || isset($args['suite']) || isset($args['case'])) {
|
||||
if (!isset($args['file']) || !isset($args['suite']) || !isset($args['case'])) {
|
||||
die($description);
|
||||
}
|
||||
// Manually run a compliance test
|
||||
$path = realpath($args['file']);
|
||||
file_exists($path) or die('File not found at ' . $path);
|
||||
$json = json_decode(file_get_contents($path), true);
|
||||
$set = $json[$args['suite']];
|
||||
$data = $set['given'];
|
||||
if (!isset($expression)) {
|
||||
$expression = $set['cases'][$args['case']]['expression'];
|
||||
echo "Expects\n=======\n";
|
||||
if (isset($set['cases'][$args['case']]['result'])) {
|
||||
echo json_encode($set['cases'][$args['case']]['result'], JSON_PRETTY_PRINT) . "\n\n";
|
||||
} elseif (isset($set['cases'][$args['case']]['error'])) {
|
||||
echo "{$set['cases'][$argv['case']]['error']} error\n\n";
|
||||
} else {
|
||||
echo "NULL\n\n";
|
||||
$this->position += strlen($data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function stream_cast($castAs)
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
public function stream_close()
|
||||
{
|
||||
fclose($this->handle);
|
||||
}
|
||||
|
||||
public function stream_lock($operation)
|
||||
{
|
||||
return $operation ? flock($this->handle, $operation) : true;
|
||||
}
|
||||
|
||||
public function stream_seek($offset, $whence)
|
||||
{
|
||||
if (0 === fseek($this->handle, $offset, $whence)) {
|
||||
$this->position = ftell($this->handle);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_tell()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function stream_eof()
|
||||
{
|
||||
return feof($this->handle);
|
||||
}
|
||||
|
||||
public function stream_stat()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function stream_set_option($option, $arg1, $arg2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function url_stat($path, $flags)
|
||||
{
|
||||
$path = substr($path, 17);
|
||||
if (file_exists($path)) {
|
||||
return stat($path);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (isset($expression)) {
|
||||
// Pass in an expression and STDIN as a standalone argument
|
||||
$data = json_decode(stream_get_contents(STDIN), true);
|
||||
} else {
|
||||
die($description);
|
||||
|
||||
if (
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
return include("phpvfscomposer://" . __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php');
|
||||
}
|
||||
}
|
||||
|
||||
$runtime = new DebugRuntime(Env::createRuntime());
|
||||
$runtime($expression, $data);
|
||||
return include __DIR__ . '/..'.'/mtdowling/jmespath.php/bin/jp.php';
|
||||
|
204
vendor/composer/ClassLoader.php
vendored
204
vendor/composer/ClassLoader.php
vendored
@ -37,57 +37,126 @@ namespace Composer\Autoload;
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||
* @see http://www.php-fig.org/psr/psr-0/
|
||||
* @see http://www.php-fig.org/psr/psr-4/
|
||||
* @see https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var string|null */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array<string, list<string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var string|null */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var array<string, self>
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param string|null $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Array of classname => path
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $classMap Class to filename map
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addClassMap(array $classMap)
|
||||
{
|
||||
@ -102,22 +171,25 @@ class ClassLoader
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
|
||||
@ -126,19 +198,19 @@ class ClassLoader
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -147,25 +219,28 @@ class ClassLoader
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
@ -175,18 +250,18 @@ class ClassLoader
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -195,8 +270,10 @@ class ClassLoader
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param array|string $paths The PSR-0 base directories
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function set($prefix, $paths)
|
||||
{
|
||||
@ -211,10 +288,12 @@ class ClassLoader
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param array|string $paths The PSR-4 base directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setPsr4($prefix, $paths)
|
||||
{
|
||||
@ -234,6 +313,8 @@ class ClassLoader
|
||||
* Turns on searching the include path for class files.
|
||||
*
|
||||
* @param bool $useIncludePath
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setUseIncludePath($useIncludePath)
|
||||
{
|
||||
@ -256,6 +337,8 @@ class ClassLoader
|
||||
* that have not been registered with the class map.
|
||||
*
|
||||
* @param bool $classMapAuthoritative
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setClassMapAuthoritative($classMapAuthoritative)
|
||||
{
|
||||
@ -276,6 +359,8 @@ class ClassLoader
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
@ -296,33 +381,55 @@ class ClassLoader
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
* @param bool $prepend Whether to prepend the autoloader or not
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return bool|null True if loaded, null otherwise
|
||||
* @return true|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
includeFile($file);
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -367,6 +474,21 @@ class ClassLoader
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
*
|
||||
* @return array<string, self>
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
private function findFileWithExtension($class, $ext)
|
||||
{
|
||||
// PSR-4 lookup
|
||||
@ -432,14 +554,26 @@ class ClassLoader
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
|
359
vendor/composer/InstalledVersions.php
vendored
Normal file
359
vendor/composer/InstalledVersions.php
vendored
Normal file
@ -0,0 +1,359 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Composer.
|
||||
*
|
||||
* (c) Nils Adermann <naderman@naderman.de>
|
||||
* Jordi Boggiano <j.boggiano@seld.be>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Composer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Composer\Semver\VersionParser;
|
||||
|
||||
/**
|
||||
* This class is copied in every Composer installed project and available to all
|
||||
*
|
||||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
/**
|
||||
* @var bool|null
|
||||
*/
|
||||
private static $canGetVendors;
|
||||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
/**
|
||||
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
||||
*
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackages()
|
||||
{
|
||||
$packages = array();
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
$packages[] = array_keys($installed['versions']);
|
||||
}
|
||||
|
||||
if (1 === \count($packages)) {
|
||||
return $packages[0];
|
||||
}
|
||||
|
||||
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of all package names with a specific type e.g. 'library'
|
||||
*
|
||||
* @param string $type
|
||||
* @return string[]
|
||||
* @psalm-return list<string>
|
||||
*/
|
||||
public static function getInstalledPackagesByType($type)
|
||||
{
|
||||
$packagesByType = array();
|
||||
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
foreach ($installed['versions'] as $name => $package) {
|
||||
if (isset($package['type']) && $package['type'] === $type) {
|
||||
$packagesByType[] = $name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $packagesByType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package is installed
|
||||
*
|
||||
* This also returns true if the package name is provided or replaced by another package
|
||||
*
|
||||
* @param string $packageName
|
||||
* @param bool $includeDevRequirements
|
||||
* @return bool
|
||||
*/
|
||||
public static function isInstalled($packageName, $includeDevRequirements = true)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given package satisfies a version constraint
|
||||
*
|
||||
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
||||
*
|
||||
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
||||
*
|
||||
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
||||
* @param string $packageName
|
||||
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
||||
* @return bool
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a version constraint representing all the range(s) which are installed for a given package
|
||||
*
|
||||
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
||||
* whether a given version of a package is installed, and not just whether it exists
|
||||
*
|
||||
* @param string $packageName
|
||||
* @return string Version constraint usable with composer/semver
|
||||
*/
|
||||
public static function getVersionRanges($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$ranges = array();
|
||||
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
||||
}
|
||||
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
||||
}
|
||||
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
||||
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
||||
}
|
||||
|
||||
return implode(' || ', $ranges);
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
||||
*/
|
||||
public static function getPrettyVersion($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['pretty_version'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
||||
*/
|
||||
public static function getReference($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isset($installed['versions'][$packageName]['reference'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $installed['versions'][$packageName]['reference'];
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $packageName
|
||||
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
||||
*/
|
||||
public static function getInstallPath($packageName)
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (!isset($installed['versions'][$packageName])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
||||
}
|
||||
|
||||
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
$installed = self::getInstalled();
|
||||
|
||||
return $installed[0]['root'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw installed.php data for custom implementations
|
||||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
return self::$installed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
return self::getInstalled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Lets you reload the static array from another file
|
||||
*
|
||||
* This is only useful for complex integrations in which a project needs to use
|
||||
* this class but then also needs to execute another project's autoloader in process,
|
||||
* and wants to ensure both projects have access to their version of installed.php.
|
||||
*
|
||||
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
||||
* the data it needs from this class, then call reload() with
|
||||
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
||||
* the project in which it runs can then also use this class safely, without
|
||||
* interference between PHPUnit's dependencies and the project's dependencies.
|
||||
*
|
||||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
self::$installed = $data;
|
||||
self::$installedByVendor = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
if (null === self::$canGetVendors) {
|
||||
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
||||
}
|
||||
|
||||
$installed = array();
|
||||
|
||||
if (self::$canGetVendors) {
|
||||
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
|
||||
return $installed;
|
||||
}
|
||||
}
|
75
vendor/composer/autoload_classmap.php
vendored
75
vendor/composer/autoload_classmap.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
@ -812,6 +812,7 @@ return array(
|
||||
'Aws\\kendra\\kendraClient' => $vendorDir . '/aws/aws-sdk-php/src/kendra/kendraClient.php',
|
||||
'Aws\\signer\\Exception\\signerException' => $vendorDir . '/aws/aws-sdk-php/src/signer/Exception/signerException.php',
|
||||
'Aws\\signer\\signerClient' => $vendorDir . '/aws/aws-sdk-php/src/signer/signerClient.php',
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'Datamatrix' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php',
|
||||
'Datto\\JsonRpc\\Client' => $vendorDir . '/datto/json-rpc/src/Client.php',
|
||||
'Datto\\JsonRpc\\Evaluator' => $vendorDir . '/datto/json-rpc/src/Evaluator.php',
|
||||
@ -1116,9 +1117,6 @@ return array(
|
||||
'HTMLPurifier_Printer' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php',
|
||||
'HTMLPurifier_Printer_CSSDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php',
|
||||
'HTMLPurifier_Printer_ConfigForm' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
|
||||
'HTMLPurifier_Printer_ConfigForm_NullDecorator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
|
||||
'HTMLPurifier_Printer_ConfigForm_bool' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
|
||||
'HTMLPurifier_Printer_ConfigForm_default' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
|
||||
'HTMLPurifier_Printer_HTMLDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php',
|
||||
'HTMLPurifier_PropertyList' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php',
|
||||
'HTMLPurifier_PropertyListIterator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php',
|
||||
@ -2190,6 +2188,57 @@ return array(
|
||||
'TrueBV\\Exception\\LabelOutOfBoundsException' => $vendorDir . '/true/punycode/src/Exception/LabelOutOfBoundsException.php',
|
||||
'TrueBV\\Exception\\OutOfBoundsException' => $vendorDir . '/true/punycode/src/Exception/OutOfBoundsException.php',
|
||||
'TrueBV\\Punycode' => $vendorDir . '/true/punycode/src/Punycode.php',
|
||||
'Versandart_dhl' => $baseDir . '/www/lib/versandarten/dhl.php',
|
||||
'Versandart_sendcloud' => $baseDir . '/www/lib/versandarten/sendcloud.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Bank' => $baseDir . '/classes/Carrier/Dhl/Data/Bank.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Communication' => $baseDir . '/classes/Carrier/Dhl/Data/Communication.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Contact' => $baseDir . '/classes/Carrier/Dhl/Data/Contact.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Country' => $baseDir . '/classes/Carrier/Dhl/Data/Country.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\CreateShipmentOrderRequest' => $baseDir . '/classes/Carrier/Dhl/Data/CreateShipmentOrderRequest.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\CreateShipmentOrderResponse' => $baseDir . '/classes/Carrier/Dhl/Data/CreateShipmentOrderResponse.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\CreationState' => $baseDir . '/classes/Carrier/Dhl/Data/CreationState.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Customer' => $baseDir . '/classes/Carrier/Dhl/Data/Customer.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\DeleteShipmentOrderRequest' => $baseDir . '/classes/Carrier/Dhl/Data/DeleteShipmentOrderRequest.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\DeleteShipmentOrderResponse' => $baseDir . '/classes/Carrier/Dhl/Data/DeleteShipmentOrderResponse.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\DeletionState' => $baseDir . '/classes/Carrier/Dhl/Data/DeletionState.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\DeliveryAddress' => $baseDir . '/classes/Carrier/Dhl/Data/DeliveryAddress.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Dimension' => $baseDir . '/classes/Carrier/Dhl/Data/Dimension.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\ExportDocPosition' => $baseDir . '/classes/Carrier/Dhl/Data/ExportDocPosition.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\ExportDocument' => $baseDir . '/classes/Carrier/Dhl/Data/ExportDocument.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\LabelData' => $baseDir . '/classes/Carrier/Dhl/Data/LabelData.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Name' => $baseDir . '/classes/Carrier/Dhl/Data/Name.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\NativeAddress' => $baseDir . '/classes/Carrier/Dhl/Data/NativeAddress.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\NativeAddressNew' => $baseDir . '/classes/Carrier/Dhl/Data/NativeAddressNew.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\PackStation' => $baseDir . '/classes/Carrier/Dhl/Data/PackStation.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Postfiliale' => $baseDir . '/classes/Carrier/Dhl/Data/Postfiliale.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Receiver' => $baseDir . '/classes/Carrier/Dhl/Data/Receiver.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\ReceiverNativeAddress' => $baseDir . '/classes/Carrier/Dhl/Data/ReceiverNativeAddress.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Shipment' => $baseDir . '/classes/Carrier/Dhl/Data/Shipment.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\ShipmentDetails' => $baseDir . '/classes/Carrier/Dhl/Data/ShipmentDetails.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\ShipmentItem' => $baseDir . '/classes/Carrier/Dhl/Data/ShipmentItem.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\ShipmentNotification' => $baseDir . '/classes/Carrier/Dhl/Data/ShipmentNotification.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\ShipmentOrder' => $baseDir . '/classes/Carrier/Dhl/Data/ShipmentOrder.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\ShipmentService' => $baseDir . '/classes/Carrier/Dhl/Data/ShipmentService.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Shipper' => $baseDir . '/classes/Carrier/Dhl/Data/Shipper.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Status' => $baseDir . '/classes/Carrier/Dhl/Data/Status.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\StatusElement' => $baseDir . '/classes/Carrier/Dhl/Data/StatusElement.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Statusinformation' => $baseDir . '/classes/Carrier/Dhl/Data/Statusinformation.php',
|
||||
'Xentral\\Carrier\\Dhl\\Data\\Version' => $baseDir . '/classes/Carrier/Dhl/Data/Version.php',
|
||||
'Xentral\\Carrier\\Dhl\\DhlApi' => $baseDir . '/classes/Carrier/Dhl/DhlApi.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\Document' => $baseDir . '/classes/Carrier/SendCloud/Data/Document.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\Label' => $baseDir . '/classes/Carrier/SendCloud/Data/Label.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\ParcelBase' => $baseDir . '/classes/Carrier/SendCloud/Data/ParcelBase.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\ParcelCreation' => $baseDir . '/classes/Carrier/SendCloud/Data/ParcelCreation.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\ParcelCreationError' => $baseDir . '/classes/Carrier/SendCloud/Data/ParcelCreationError.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\ParcelItem' => $baseDir . '/classes/Carrier/SendCloud/Data/ParcelItem.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\ParcelResponse' => $baseDir . '/classes/Carrier/SendCloud/Data/ParcelResponse.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\SenderAddress' => $baseDir . '/classes/Carrier/SendCloud/Data/SenderAddress.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\Shipment' => $baseDir . '/classes/Carrier/SendCloud/Data/Shipment.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\ShippingMethod' => $baseDir . '/classes/Carrier/SendCloud/Data/ShippingMethod.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\ShippingProduct' => $baseDir . '/classes/Carrier/SendCloud/Data/ShippingProduct.php',
|
||||
'Xentral\\Carrier\\SendCloud\\Data\\Status' => $baseDir . '/classes/Carrier/SendCloud/Data/Status.php',
|
||||
'Xentral\\Carrier\\SendCloud\\SendCloudApi' => $baseDir . '/classes/Carrier/SendCloud/SendCloudApi.php',
|
||||
'Xentral\\Carrier\\SendCloud\\SendcloudApiException' => $baseDir . '/classes/Carrier/SendCloud/SendcloudApiException.php',
|
||||
'Xentral\\Components\\Backup\\Adapter\\AdapterInterface' => $baseDir . '/classes/Components/Backup/Adapter/AdapterInterface.php',
|
||||
'Xentral\\Components\\Backup\\Adapter\\ExecAdapter' => $baseDir . '/classes/Components/Backup/Adapter/ExecAdapter.php',
|
||||
'Xentral\\Components\\Backup\\Bootstrap' => $baseDir . '/classes/Components/Backup/Bootstrap.php',
|
||||
@ -2726,6 +2775,7 @@ return array(
|
||||
'Xentral\\Modules\\Article\\Exception\\InvalidArgumentException' => $baseDir . '/classes/Modules/Article/Exception/InvalidArgumentException.php',
|
||||
'Xentral\\Modules\\Article\\Exception\\SellingPriceNotFoundException' => $baseDir . '/classes/Modules/Article/Exception/SellingPriceNotFoundException.php',
|
||||
'Xentral\\Modules\\Article\\Gateway\\ArticleGateway' => $baseDir . '/classes/Modules/Article/Gateway/ArticleGateway.php',
|
||||
'Xentral\\Modules\\Article\\Service\\ArticleService' => $baseDir . '/classes/Modules/Article/Service/ArticleService.php',
|
||||
'Xentral\\Modules\\Article\\Service\\CurrencyConversionService' => $baseDir . '/classes/Modules/Article/Service/CurrencyConversionService.php',
|
||||
'Xentral\\Modules\\Article\\Service\\PurchasePriceService' => $baseDir . '/classes/Modules/Article/Service/PurchasePriceService.php',
|
||||
'Xentral\\Modules\\Article\\Service\\SellingPriceService' => $baseDir . '/classes/Modules/Article/Service/SellingPriceService.php',
|
||||
@ -2832,10 +2882,7 @@ return array(
|
||||
'Xentral\\Modules\\Datanorm\\Service\\DatanormIntermediateService' => $baseDir . '/classes/Modules/Datanorm/Service/DatanormIntermediateService.php',
|
||||
'Xentral\\Modules\\Datanorm\\Service\\DatanormReader' => $baseDir . '/classes/Modules/Datanorm/Service/DatanormReader.php',
|
||||
'Xentral\\Modules\\Datanorm\\Wrapper\\AddressWrapper' => $baseDir . '/classes/Modules/Datanorm/Wrapper/AddressWrapper.php',
|
||||
'Xentral\\Modules\\DatevApi\\Bootstrap' => $baseDir . '/classes/Modules/DatevApi/Bootstrap.php',
|
||||
'Xentral\\Modules\\DatevApi\\DataTable\\DatevExportDataTable' => $baseDir . '/classes/Modules/DatevApi/DataTable/DatevExportDataTable.php',
|
||||
'Xentral\\Modules\\DatevApi\\DatevApiService' => $baseDir . '/classes/Modules/DatevApi/DatevApiService.php',
|
||||
'Xentral\\Modules\\DatevApi\\DatevZipStream' => $baseDir . '/classes/Modules/DatevApi/DatevZipStream.php',
|
||||
'Xentral\\Modules\\DemoExporter\\Bootstrap' => $baseDir . '/classes/Modules/DemoExporter/Bootstrap.php',
|
||||
'Xentral\\Modules\\DemoExporter\\DemoExporterCleanerService' => $baseDir . '/classes/Modules/DemoExporter/DemoExporterCleanerService.php',
|
||||
'Xentral\\Modules\\DemoExporter\\DemoExporterDateiService' => $baseDir . '/classes/Modules/DemoExporter/DemoExporterDateiService.php',
|
||||
@ -3007,7 +3054,6 @@ return array(
|
||||
'Xentral\\Modules\\FiskalyApi\\Service\\FiskalyApi' => $baseDir . '/classes/Modules/FiskalyApi/Service/FiskalyApi.php',
|
||||
'Xentral\\Modules\\FiskalyApi\\Service\\FiskalyCashPointClosingDBInterface' => $baseDir . '/classes/Modules/FiskalyApi/Service/FiskalyCashPointClosingDBInterface.php',
|
||||
'Xentral\\Modules\\FiskalyApi\\Service\\FiskalyCashPointClosingDBService' => $baseDir . '/classes/Modules/FiskalyApi/Service/FiskalyCashPointClosingDBService.php',
|
||||
'Xentral\\Modules\\FiskalyApi\\Service\\FiskalyConfig' => $baseDir . '/classes/Modules/FiskalyApi/Service/FiskalyConfig.php',
|
||||
'Xentral\\Modules\\FiskalyApi\\Service\\FiskalyDSFinVKApi' => $baseDir . '/classes/Modules/FiskalyApi/Service/FiskalyDSFinVKApi.php',
|
||||
'Xentral\\Modules\\FiskalyApi\\Service\\FiskalyEReceiptApi' => $baseDir . '/classes/Modules/FiskalyApi/Service/FiskalyEReceiptApi.php',
|
||||
'Xentral\\Modules\\FiskalyApi\\Service\\FiskalyKassenSichVApi' => $baseDir . '/classes/Modules/FiskalyApi/Service/FiskalyKassenSichVApi.php',
|
||||
@ -3188,6 +3234,15 @@ return array(
|
||||
'Xentral\\Modules\\MandatoryFields\\Service\\MandatoryFieldsGateway' => $baseDir . '/classes/Modules/MandatoryFields/Service/MandatoryFieldsGateway.php',
|
||||
'Xentral\\Modules\\MandatoryFields\\Service\\MandatoryFieldsService' => $baseDir . '/classes/Modules/MandatoryFields/Service/MandatoryFieldsService.php',
|
||||
'Xentral\\Modules\\MandatoryFields\\Service\\MandatoryFieldsValidator' => $baseDir . '/classes/Modules/MandatoryFields/Service/MandatoryFieldsValidator.php',
|
||||
'Xentral\\Modules\\MatrixProduct\\Bootstrap' => $baseDir . '/classes/Modules/MatrixProduct/Bootstrap.php',
|
||||
'Xentral\\Modules\\MatrixProduct\\Data\\Group' => $baseDir . '/classes/Modules/MatrixProduct/Data/Group.php',
|
||||
'Xentral\\Modules\\MatrixProduct\\Data\\Option' => $baseDir . '/classes/Modules/MatrixProduct/Data/Option.php',
|
||||
'Xentral\\Modules\\MatrixProduct\\Data\\Translation' => $baseDir . '/classes/Modules/MatrixProduct/Data/Translation.php',
|
||||
'Xentral\\Modules\\MatrixProduct\\MatrixProductGateway' => $baseDir . '/classes/Modules/MatrixProduct/MatrixProductGateway.php',
|
||||
'Xentral\\Modules\\MatrixProduct\\MatrixProductService' => $baseDir . '/classes/Modules/MatrixProduct/MatrixProductService.php',
|
||||
'Xentral\\Modules\\Onlineshop\\Data\\OrderStatus' => $baseDir . '/classes/Modules/Onlineshop/Data/OrderStatus.php',
|
||||
'Xentral\\Modules\\Onlineshop\\Data\\OrderStatusUpdateRequest' => $baseDir . '/classes/Modules/Onlineshop/Data/OrderStatusUpdateRequest.php',
|
||||
'Xentral\\Modules\\Onlineshop\\Data\\Shipment' => $baseDir . '/classes/Modules/Onlineshop/Data/Shipment.php',
|
||||
'Xentral\\Modules\\Onlineshop\\Data\\ShopConnectorOrderStatusUpdateResponse' => $baseDir . '/classes/Modules/Onlineshop/Data/ShopConnectorOrderStatusUpdateResponse.php',
|
||||
'Xentral\\Modules\\Onlineshop\\Data\\ShopConnectorResponseInterface' => $baseDir . '/classes/Modules/Onlineshop/Data/ShopConnectorResponseInterface.php',
|
||||
'Xentral\\Modules\\PartialDelivery\\Bootstrap' => $baseDir . '/classes/Modules/PartialDelivery/Bootstrap.php',
|
||||
@ -3345,6 +3400,9 @@ return array(
|
||||
'Xentral\\Modules\\ScanArticle\\Wrapper\\PriceWrapper' => $baseDir . '/classes/Modules/ScanArticle/Wrapper/PriceWrapper.php',
|
||||
'Xentral\\Modules\\ScanArticle\\Wrapper\\SavePositionWrapper' => $baseDir . '/classes/Modules/ScanArticle/Wrapper/SavePositionWrapper.php',
|
||||
'Xentral\\Modules\\Setting\\Bootstrap' => $baseDir . '/classes/Modules/Setting/Bootstrap.php',
|
||||
'Xentral\\Modules\\ShippingMethod\\Model\\CreateShipmentResult' => $baseDir . '/classes/Modules/ShippingMethod/Model/CreateShipmentResult.php',
|
||||
'Xentral\\Modules\\ShippingMethod\\Model\\CustomsInfo' => $baseDir . '/classes/Modules/ShippingMethod/Model/CustomsInfo.php',
|
||||
'Xentral\\Modules\\ShippingMethod\\Model\\Product' => $baseDir . '/classes/Modules/ShippingMethod/Model/Product.php',
|
||||
'Xentral\\Modules\\ShippingTaxSplit\\Bootstrap' => $baseDir . '/classes/Modules/ShippingTaxSplit/Bootstrap.php',
|
||||
'Xentral\\Modules\\ShippingTaxSplit\\Exception\\InvalidArgumentException' => $baseDir . '/classes/Modules/ShippingTaxSplit/Exception/InvalidArgumentException.php',
|
||||
'Xentral\\Modules\\ShippingTaxSplit\\Exception\\ShippingTaxSplitExceptionInterface' => $baseDir . '/classes/Modules/ShippingTaxSplit/Exception/ShippingTaxSplitExceptionInterface.php',
|
||||
@ -3404,6 +3462,7 @@ return array(
|
||||
'Xentral\\Modules\\SubscriptionCycle\\Service\\SubscriptionCycleJobService' => $baseDir . '/classes/Modules/SubscriptionCycle/Service/SubscriptionCycleJobService.php',
|
||||
'Xentral\\Modules\\SubscriptionCycle\\SubscriptionCycleCacheFiller' => $baseDir . '/classes/Modules/SubscriptionCycle/SubscriptionCycleCacheFiller.php',
|
||||
'Xentral\\Modules\\SubscriptionCycle\\SubscriptionCycleModuleInterface' => $baseDir . '/classes/Modules/SubscriptionCycle/SubscriptionCycleModuleInterface.php',
|
||||
'Xentral\\Modules\\SubscriptionCycle\\SubscriptionModule' => $baseDir . '/classes/Modules/SubscriptionCycle/SubscriptionModule.php',
|
||||
'Xentral\\Modules\\SubscriptionCycle\\SubscriptionModuleInterface' => $baseDir . '/classes/Modules/SubscriptionCycle/SubscriptionModuleInterface.php',
|
||||
'Xentral\\Modules\\SubscriptionCycle\\Wrapper\\BusinessLetterWrapper' => $baseDir . '/classes/Modules/SubscriptionCycle/Wrapper/BusinessLetterWrapper.php',
|
||||
'Xentral\\Modules\\SuperSearch\\Bootstrap' => $baseDir . '/classes/Modules/SuperSearch/Bootstrap.php',
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user