Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74aeb90758 | ||
|
|
7c4c9e64d6 | ||
|
|
6695369af7 | ||
|
|
fdafc13e2c | ||
|
|
bd0392698d | ||
|
|
dc58045423 |
+4
-1
@@ -54,11 +54,14 @@ memory_limit = 256M
|
||||
## Install additional zip
|
||||
`sudo apt-get install zip`
|
||||
|
||||
## Install mysql client
|
||||
`sudo apt-get install mysql-client`
|
||||
|
||||
## Install database server
|
||||
`sudo apt-get install mariadb-server`
|
||||
|
||||
## Configure database server
|
||||
`sudo mariadb-secure-installation`
|
||||
`sudo mysql_secure_installation`
|
||||
```
|
||||
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
|
||||
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n;
|
||||
|
||||
use Xentral\Components\Database\Database;
|
||||
use Xentral\Components\Http\Request;
|
||||
use Xentral\Components\Http\Session\Session;
|
||||
use Xentral\Core\DependencyInjection\ServiceContainer;
|
||||
|
||||
/**
|
||||
* Factory for localization object.
|
||||
*
|
||||
* @see Localization
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
final class Bootstrap
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function registerServices(): array
|
||||
{
|
||||
return [
|
||||
'Localization' => 'onInitLocalization',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Replaces umlauts with their 2 character representation.
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return array|string|string[]
|
||||
*/
|
||||
public static function replaceUmlauts(string $string)
|
||||
{
|
||||
$search = ['ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü', 'ß'];
|
||||
$replace = ['ae', 'oe', 'ue', 'Ae', 'Oe', 'Ue', 'ss'];
|
||||
return str_replace($search, $replace, $string);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Find the language information from the given string.
|
||||
*
|
||||
* @param string $lang
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public static function findLanguage(string $lang): ?array
|
||||
{
|
||||
$subject = strtolower($lang);
|
||||
foreach ((new Iso639()) as $key => $val) {
|
||||
if (array_filter($val, function ($str) use ($subject) {
|
||||
return $str && ((strtolower($str) == $subject) || (self::replaceUmlauts(strtolower($str)) == $subject));
|
||||
})) {
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Find the region information from the given string.
|
||||
*
|
||||
* @param string $region
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public static function findRegion(string $region): ?array
|
||||
{
|
||||
$subject = strtolower($region);
|
||||
foreach ((new Iso3166()) as $key => $val) {
|
||||
if (array_filter($val, function ($str) use ($subject) {
|
||||
return $str && ((strtolower($str) == $subject) || (self::replaceUmlauts(strtolower($str)) == $subject));
|
||||
})) {
|
||||
return $val;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This is the factory for the Localization object.
|
||||
*
|
||||
* @param ServiceContainer $container
|
||||
*
|
||||
* @return Localization
|
||||
*/
|
||||
public static function onInitLocalization(ServiceContainer $container): Localization
|
||||
{
|
||||
/** @var Request $request */
|
||||
$request = $container->get('Request');
|
||||
/** @var Session $session */
|
||||
$session = $container->get('Session');
|
||||
/** @var \erpooSystem $app */
|
||||
$app = $container->get('LegacyApplication');
|
||||
/** @var Database $db */
|
||||
$db = $container->get('Database');
|
||||
|
||||
$config=[];
|
||||
$firmaLang=null;
|
||||
$firmaRegion=null;
|
||||
// Get language from system settings and normalize to 3-letter-code and 2-letter-code
|
||||
if ($firmaLang = self::findLanguage($app->erp->Firmendaten('preferredLanguage'))) {
|
||||
$config[Localization::LANGUAGE_DEFAULT] = $firmaLang[Iso639\Key::ALPHA_3];
|
||||
}
|
||||
|
||||
// Get region from system settings and normalize to 2-letter-code
|
||||
if ($firmaLang && ($firmaRegion = self::findRegion($app->erp->Firmendaten('land')))) {
|
||||
$config[Localization::LOCALE_DEFAULT] = "{$firmaLang[Iso639\Key::ALPHA_2]}_{$firmaRegion[Iso3166\Key::ALPHA_2]}";
|
||||
}
|
||||
|
||||
|
||||
// Get User
|
||||
$usersettings = [];
|
||||
if ($user = $app->User) {
|
||||
// Get User's address from user
|
||||
$userAddress = $db->fetchRow(
|
||||
$db->select()->cols(['*'])->from('adresse')->where('id=:id'),
|
||||
['id' => $user->GetAdresse()]
|
||||
);
|
||||
|
||||
// Get language from user account and normalize to 3-letter-code and 2-letter-code
|
||||
if ($userLang = self::findLanguage($user->GetSprache())) {
|
||||
$usersettings['language'] = $userLang[Iso639\Key::ALPHA_3];
|
||||
}
|
||||
|
||||
// Get region from user account and normalize to 2-letter-code
|
||||
if ($userLang && ($userRegion = self::findRegion($userAddress['land']))) {
|
||||
$usersettings['locale'] = "{$userLang[Iso639\Key::ALPHA_2]}_{$userRegion[Iso3166\Key::ALPHA_2]}";
|
||||
}
|
||||
}
|
||||
|
||||
// Create Localization object
|
||||
return new Localization($request, $session, $usersettings, $config);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Dataaccess;
|
||||
|
||||
/**
|
||||
* Provides array access functions to the data provider.
|
||||
*
|
||||
* @see \ArrayAccess
|
||||
* @see DataProvider
|
||||
* @see DataProviderInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
trait ArrayAccessTrait
|
||||
{
|
||||
/**
|
||||
* Whether an offset exists.
|
||||
*
|
||||
* @param string $offset
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return array_key_exists($offset, $this->DataProvider_DATA);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Offset to retrieve.
|
||||
*
|
||||
* @param string $offset
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function offsetGet($offset): array
|
||||
{
|
||||
return $this->DataProvider_DATA[$offset];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Assign a value to the specified offset.
|
||||
* No function since data set is read only.
|
||||
*
|
||||
* @param string $offset
|
||||
* @param array $value
|
||||
*/
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
// $this->DataProvider_DATA[$offset]=$value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Unset an offset.
|
||||
* No function since data set is read only.
|
||||
*
|
||||
* @param string $offset
|
||||
*/
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
// unset($this->DataProvider_DATA[$offset]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Dataaccess;
|
||||
|
||||
/**
|
||||
* Provides countable functions to the data provider.
|
||||
*
|
||||
* @see \Countable
|
||||
* @see DataProvider
|
||||
* @see DataProviderInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
trait CountableTrait
|
||||
{
|
||||
/**
|
||||
* Counts the number of records in the private $data array.
|
||||
*
|
||||
* @return int Number of records
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return count($this->DataProvider_DATA);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Dataaccess;
|
||||
|
||||
|
||||
/**
|
||||
* Abstract filter class.
|
||||
*
|
||||
* @see DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
abstract class DataFilter implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* Pointer to next filter in chain.
|
||||
*
|
||||
* @var DataFilterInterface
|
||||
*/
|
||||
private $nextFilter = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface::then()
|
||||
*/
|
||||
public function then(DataFilterInterface $filter): DataFilterInterface
|
||||
{
|
||||
if (!$this->nextFilter) {
|
||||
$this->nextFilter = $filter;
|
||||
} else {
|
||||
$this->nextFilter->then($filter);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Applies the filter to the data and executes the next filter
|
||||
* if present.
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface::__invoke()
|
||||
*/
|
||||
public function __invoke(array $data): array
|
||||
{
|
||||
// echo get_called_class()."::__invoke(\$data)".PHP_EOL;
|
||||
|
||||
$filteredData = [];
|
||||
foreach ($data as $key => $val) {
|
||||
if ($this->selectItem($key, $val)) {
|
||||
$filteredData[$key] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->nextFilter) {
|
||||
$filteredData = ($this->nextFilter)($filteredData);
|
||||
}
|
||||
return $filteredData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if the current item is to be selected for
|
||||
* the dataset.
|
||||
*
|
||||
* @param mixed $key
|
||||
* @param mixed $val
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract protected function selectItem(&$key, &$val): bool;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Dataaccess;
|
||||
|
||||
|
||||
/**
|
||||
* Filter Interface.
|
||||
*
|
||||
* @see DataFilter
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
interface DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* Add a filter to the end of the filter chain.
|
||||
*
|
||||
* @param DataFilterInterface $filter Filter to add
|
||||
*
|
||||
* @return DataFilterInterface Start of filter chain
|
||||
*/
|
||||
function then(DataFilterInterface $filter): DataFilterInterface;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Applies the filter to the data and executes the next filter
|
||||
* if present.
|
||||
*
|
||||
* @see \Ruga\I18n\Dataaccess\DataFilterInterface::__invoke()
|
||||
*/
|
||||
function __invoke(array $data): array;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Dataaccess;
|
||||
|
||||
use ArrayAccess;
|
||||
use Countable;
|
||||
use Iterator;
|
||||
|
||||
/**
|
||||
* Abstract implementation of a general data provider.
|
||||
*
|
||||
* @see DataProviderInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
abstract class DataProvider implements Countable, Iterator, ArrayAccess, DataProviderInterface
|
||||
{
|
||||
use CountableTrait;
|
||||
use IteratorTrait;
|
||||
use ArrayAccessTrait;
|
||||
|
||||
|
||||
/**
|
||||
* Holds filtered data.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $DataProvider_DATA = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the object and apply data filter.
|
||||
*
|
||||
* @param DataFilterInterface|null $filter
|
||||
*/
|
||||
public function __construct(DataFilterInterface $filter = null)
|
||||
{
|
||||
if ($filter) {
|
||||
$this->DataProvider_DATA = $filter($this->getOriginalData());
|
||||
} else {
|
||||
$this->DataProvider_DATA = $this->getOriginalData();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the original data array).
|
||||
* Raw data before any filtering takes place.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
abstract protected function getOriginalData(): array;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array suitable for select fields.
|
||||
* The key of the filtered data set is used as key of the
|
||||
* array and $desiredName field is used as value.
|
||||
*
|
||||
* @param string $desiredName
|
||||
*
|
||||
* @return array;
|
||||
*/
|
||||
public function getMultiOptions($desiredName = 'NAME_deu'): array
|
||||
{
|
||||
$a = [];
|
||||
foreach ($this as $key => $l) {
|
||||
$a[$key] = $l[$desiredName];
|
||||
}
|
||||
return $a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the field $desiredName from the record $id.
|
||||
*
|
||||
* @param mixed $id
|
||||
* @param string $desiredName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getString($id, $desiredName): string
|
||||
{
|
||||
if (!isset($this[$id])) {
|
||||
throw new Exception\OutOfRangeException("Index '{$id}' not found");
|
||||
}
|
||||
$d = $this[$id];
|
||||
if ($desiredName) {
|
||||
if ($desiredName == 'POST') {
|
||||
return strtoupper($this->getString($id, 'NAME_eng'));
|
||||
}
|
||||
return $d[$desiredName];
|
||||
}
|
||||
throw new Exception\OutOfRangeException("No '{$desiredName}' data for '{$id}'");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the item at position $id.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getData($id)
|
||||
{
|
||||
if (empty($id)) {
|
||||
return null;
|
||||
}
|
||||
if (!isset($this[$id])) {
|
||||
throw new Exception\OutOfRangeException("Index '{$id}' not found.");
|
||||
}
|
||||
return $this[$id];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Dataaccess;
|
||||
|
||||
|
||||
/**
|
||||
* Interface to the general data provider class.
|
||||
*
|
||||
* @see DataProvider
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
interface DataProviderInterface
|
||||
{
|
||||
/**
|
||||
* Returns an array suitable for select fields.
|
||||
* The key of the filtered data set is used as key of the
|
||||
* array and $desiredName field is used as value.
|
||||
*
|
||||
* @param string $desiredName
|
||||
*
|
||||
* @return array;
|
||||
*/
|
||||
public function getMultiOptions($desiredName): array;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the field $desiredName from the record $id.
|
||||
*
|
||||
* @param mixed $id
|
||||
* @param string $desiredName
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getString($id, $desiredName): string;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the item at position $id.
|
||||
*
|
||||
* @param string $id
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getData($id);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Dataaccess\Exception;
|
||||
|
||||
class OutOfRangeException extends \OutOfRangeException
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Dataaccess;
|
||||
|
||||
/**
|
||||
* Provides iterator functions to the data provider.
|
||||
*
|
||||
* @see \Iterator
|
||||
* @see DataProvider
|
||||
* @see DataProviderInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
trait IteratorTrait
|
||||
{
|
||||
/**
|
||||
* Index of the current element's key.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $IteratorTrait_index = null;
|
||||
|
||||
/**
|
||||
* Array of keys of the data set.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $IteratorTrait_keys = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the current element.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function current()
|
||||
{
|
||||
return $this->valid() ? $this->DataProvider_DATA[$this->key()] : null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the key of the current element.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function key()
|
||||
{
|
||||
return static::valid() ? $this->IteratorTrait_keys[$this->IteratorTrait_index] : null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Move forward to next element.
|
||||
*
|
||||
* @return bool false if invalid
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
$this->IteratorTrait_index++;
|
||||
if (!$this->valid()) {
|
||||
$this->IteratorTrait_index = null;
|
||||
}
|
||||
return $this->valid();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Rewind the Iterator to the first element.
|
||||
*/
|
||||
public function rewind()
|
||||
{
|
||||
$this->IteratorTrait_keys = array_keys($this->DataProvider_DATA);
|
||||
sort($this->IteratorTrait_keys);
|
||||
$this->IteratorTrait_index = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Checks if current position is valid.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function valid(): bool
|
||||
{
|
||||
return ($this->IteratorTrait_index !== null)
|
||||
&& array_key_exists($this->IteratorTrait_index, $this->IteratorTrait_keys)
|
||||
&& array_key_exists($this->IteratorTrait_keys[$this->IteratorTrait_index], $this->DataProvider_DATA);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Exception;
|
||||
|
||||
class LanguageNotInitializedException extends \RuntimeException
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Exception;
|
||||
|
||||
class UnsupportedLocaleStringException extends \RuntimeException
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataProvider;
|
||||
|
||||
/**
|
||||
* Country Codes - ISO 3166.
|
||||
* Loads the data and holds the filtered (if desired) list.
|
||||
*
|
||||
* @see https://www.iso.org/iso-3166-country-codes.html
|
||||
* @see DataProvider
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* @license AGPL-3.0-only
|
||||
*/
|
||||
class Iso3166 extends DataProvider
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataProvider::getOriginalData()
|
||||
*/
|
||||
protected function getOriginalData(): array
|
||||
{
|
||||
return include(__DIR__ . '/data/Iso3166data.php');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso3166\Filter;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilter;
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilterInterface;
|
||||
|
||||
/**
|
||||
* This filter returns all records from the data set (aka dummy filter).
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilter
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class All extends DataFilter implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface::selectItem()
|
||||
*/
|
||||
function selectItem(&$key, &$val): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso3166\Filter;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilterInterface;
|
||||
use Xentral\Components\I18n\Iso3166\Key;
|
||||
|
||||
|
||||
/**
|
||||
* Applies a filter to only select central european countries.
|
||||
*
|
||||
* @see Custom
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilter
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class CentralEurope extends Custom implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* Countries in Europe.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
const CentralEurope_Countries = ['CHE', 'DEU', 'AUT', 'ITA', 'FRA', 'ESP', 'PRT', 'GBR'];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set predefined values.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(static::CentralEurope_Countries, Key::ALPHA_3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso3166\Filter;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilterInterface;
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilter;
|
||||
|
||||
|
||||
/**
|
||||
* This filter can be used to change the main key
|
||||
* of the data set.
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilter
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class ChangeKey extends DataFilter implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* New key to use for the data set.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $ChangeKey_key = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initialize filter and set the new key.
|
||||
*
|
||||
* @param mixed $key
|
||||
*/
|
||||
public function __construct($key)
|
||||
{
|
||||
$this->ChangeKey_key = $key;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface::selectItem()
|
||||
*/
|
||||
protected function selectItem(&$key, &$val): bool
|
||||
{
|
||||
$key = $val[$this->ChangeKey_key];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso3166\Filter;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilter;
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilterInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Apply a custom filter to the data set.
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilter
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class Custom extends DataFilter implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* Array of wanted values.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $Custom_values = null;
|
||||
|
||||
/**
|
||||
* Key to check for the values in $this->Custom_values.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $Custom_key = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set values for filter.
|
||||
*
|
||||
* @param array $values
|
||||
* @param mixed $key
|
||||
*/
|
||||
public function __construct(array $values, $key)
|
||||
{
|
||||
$this->Custom_values = $values;
|
||||
$this->Custom_key = $key;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface::selectItem()
|
||||
*/
|
||||
protected function selectItem(&$key, &$val): bool
|
||||
{
|
||||
$needle = $val[$this->Custom_key];
|
||||
return in_array($needle, $this->Custom_values);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso3166\Filter;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilterInterface;
|
||||
use Xentral\Components\I18n\Iso3166\Key;
|
||||
|
||||
|
||||
/**
|
||||
* Applies a filter to only select european countries.
|
||||
*
|
||||
* @see Custom
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilter
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class Europe extends Custom implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* Set predefined values.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(['150'], Key::REGION_CODE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso3166;
|
||||
|
||||
|
||||
/**
|
||||
* Keys for the iso3166 list.
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Iso3166
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
abstract class Key/* extends Ruga_Enum*/
|
||||
{
|
||||
/** Key: Alpha-2 code */
|
||||
const ALPHA_2 = 'A2';
|
||||
|
||||
/** Key: Alpha-3 code */
|
||||
const ALPHA_3 = 'A3';
|
||||
|
||||
/** Key: Numeric code */
|
||||
const NUMERIC = 'NUM';
|
||||
|
||||
/** Key: Top Level Domain */
|
||||
const TLD = 'TLD';
|
||||
|
||||
/** Key: Currency Code */
|
||||
const CURRENCY_CODE = 'CURRENCY_CODE';
|
||||
const TELEPHONE_CODE = 'TEL_CODE';
|
||||
const REGION = 'REGION';
|
||||
const REGION_CODE = 'REGION_CODE';
|
||||
const SUBREGION = 'SUBREGION';
|
||||
const SUBREGION_CODE = 'SUBREGION_CODE';
|
||||
const INTERMEDIATEREGION = 'INTERMEDIATEREGION';
|
||||
const INTERMEDIATEREGION_CODE = 'INTERMEDIATEREGION_CODE';
|
||||
const NAME_eng = 'NAME_eng';
|
||||
const NAME_fra = 'NAME_fra';
|
||||
const NAME_deu = 'NAME_deu';
|
||||
|
||||
|
||||
/** Key: Postal country name */
|
||||
const POST = 'POST';
|
||||
|
||||
|
||||
const DEFAULT = self::ALPHA_3;
|
||||
|
||||
|
||||
protected static $fullnameMap = [
|
||||
self::ALPHA_2 => 'ISO 3166 Alpha-2',
|
||||
self::ALPHA_3 => 'ISO 3166 Alpha-3',
|
||||
self::NUMERIC => 'ISO 3166 Numerisch',
|
||||
self::TLD => 'Top Level Domain',
|
||||
self::CURRENCY_CODE => 'Währung',
|
||||
self::TELEPHONE_CODE => 'Landesvorwahl',
|
||||
self::REGION => 'Region',
|
||||
self::REGION_CODE => 'Region Code',
|
||||
self::SUBREGION => 'Unter-Region',
|
||||
self::SUBREGION_CODE => 'Unter-Region Code',
|
||||
self::INTERMEDIATEREGION => 'Intermediate-Region',
|
||||
self::INTERMEDIATEREGION_CODE => 'Intermediate-Region Code',
|
||||
self::NAME_eng => 'Englische Bezeichnung',
|
||||
self::NAME_fra => 'Französische Bezeichnung',
|
||||
self::NAME_deu => 'Deutsche Bezeichnung',
|
||||
|
||||
self::POST => 'Landesbezeichung Postadresse',
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso3166;
|
||||
|
||||
/**
|
||||
* Names for the iso3166 list.
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Iso3166
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
abstract class Name/* extends Ruga_Enum */
|
||||
{
|
||||
/** Englisch */
|
||||
const ENG = 'NAME_eng';
|
||||
/** Französisch */
|
||||
const FRA = 'NAME_fra';
|
||||
/** Deutsch */
|
||||
const DEU = 'NAME_deu';
|
||||
|
||||
|
||||
protected static $fullnameMap = [
|
||||
self::ENG => 'Englische Bezeichnung',
|
||||
self::FRA => 'Französische Bezeichnung',
|
||||
self::DEU => 'Deutsche Bezeichnung',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataProvider;
|
||||
use Xentral\Components\I18n\Dataaccess\Exception\OutOfRangeException;
|
||||
|
||||
/**
|
||||
* Codes for the Representation of Names of Languages - ISO 639.
|
||||
* Loads the data and holds the filtered (if desired) list.
|
||||
*
|
||||
* @see https://www.iso.org/iso-639-language-codes.html
|
||||
* @see DataProvider
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class Iso639 extends DataProvider
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataProvider::getOriginalData()
|
||||
*/
|
||||
protected function getOriginalData(): array
|
||||
{
|
||||
return include(__DIR__ . '/data/Iso639data.php');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the field $desiredName from the record $id.
|
||||
*
|
||||
* @param mixed $id
|
||||
* @param string $desiredName
|
||||
* @param null $default
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function find($id, $desiredName, $default = null): string
|
||||
{
|
||||
$id = strtolower($id);
|
||||
try {
|
||||
return $this->getString($id, $desiredName);
|
||||
} catch (OutOfRangeException $e) {
|
||||
try {
|
||||
return (new \Xentral\Components\I18n\Iso639(
|
||||
(new \Xentral\Components\I18n\Iso639\Filter\All())
|
||||
->then(new \Xentral\Components\I18n\Iso639\Filter\ChangeKey(\Xentral\Components\I18n\Iso639\Key::ALPHA_2))
|
||||
))->getString($id, $desiredName);
|
||||
} catch (OutOfRangeException $e) {
|
||||
try {
|
||||
$id = strtoupper($id);
|
||||
return (new \Xentral\Components\I18n\Iso639(
|
||||
(new \Xentral\Components\I18n\Iso639\Filter\All())
|
||||
->then(new \Xentral\Components\I18n\Iso639\Filter\ChangeKey(\Xentral\Components\I18n\Iso639\Key::ONELETTER))
|
||||
))->getString($id, $desiredName);
|
||||
} catch (OutOfRangeException $e) {
|
||||
if ($default === null) {
|
||||
throw $e;
|
||||
} else {
|
||||
return $this->getString($default, $desiredName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso639\Filter;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilter;
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilterInterface;
|
||||
|
||||
|
||||
/**
|
||||
* This filter returns all records from the data set (aka dummy filter).
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilter
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class All extends DataFilter implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface::selectItem()
|
||||
*/
|
||||
function selectItem(&$key, &$val): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso639\Filter;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilterInterface;
|
||||
use Xentral\Components\I18n\Iso639\Key;
|
||||
|
||||
|
||||
/**
|
||||
* Applies a filter to only select central european countries.
|
||||
*
|
||||
* @see Custom
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilter
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class CentralEurope extends Custom implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* Countries in Europe.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
const CentralEurope_Languages = ['deu', 'fra', 'ita', 'roh', 'spa', 'por', 'eng'];
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set predefined values.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(static::CentralEurope_Languages, Key::ALPHA_3);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso639\Filter;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilterInterface;
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilter;
|
||||
|
||||
|
||||
/**
|
||||
* This filter can be used to change the main key
|
||||
* of the data set.
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilter
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class ChangeKey extends DataFilter implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* New key to use for the data set.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $ChangeKey_key = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Initialize filter and set the new key.
|
||||
*
|
||||
* @param mixed $key
|
||||
*/
|
||||
public function __construct($key)
|
||||
{
|
||||
$this->ChangeKey_key = $key;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface::selectItem()
|
||||
*/
|
||||
protected function selectItem(&$key, &$val): bool
|
||||
{
|
||||
$key = $val[$this->ChangeKey_key] ?? null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso639\Filter;
|
||||
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilter;
|
||||
use Xentral\Components\I18n\Dataaccess\DataFilterInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Apply a custom filter to the data set.
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilter
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
class Custom extends DataFilter implements DataFilterInterface
|
||||
{
|
||||
/**
|
||||
* Array of wanted values.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $Custom_values = null;
|
||||
|
||||
/**
|
||||
* Key to check for the values in $this->Custom_values.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $Custom_key = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set values for filter.
|
||||
*
|
||||
* @param array $values
|
||||
* @param mixed $key
|
||||
*/
|
||||
public function __construct(array $values, $key)
|
||||
{
|
||||
$this->Custom_values = $values;
|
||||
$this->Custom_key = $key;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @see \Xentral\Components\I18n\Dataaccess\DataFilterInterface::selectItem()
|
||||
*/
|
||||
protected function selectItem(&$key, &$val): bool
|
||||
{
|
||||
$needle = $val[$this->Custom_key];
|
||||
return in_array($needle, $this->Custom_values);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso639;
|
||||
|
||||
|
||||
/**
|
||||
* Keys for the iso639 list.
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Iso639
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
abstract class Key/* extends Ruga_Enum*/
|
||||
{
|
||||
/** Key: Alpha-2 code */
|
||||
const ALPHA_2 = '639-1';
|
||||
const ISO639_1 = '639-1';
|
||||
|
||||
/** Key: Alpha-3 code */
|
||||
const ALPHA_3 = '639-2';
|
||||
const ISO639_2 = '639-2';
|
||||
|
||||
/** Key: Top Level Domain */
|
||||
const ONELETTER = '1L';
|
||||
|
||||
/** Key: Name */
|
||||
const NAME_eng = 'NAME_eng';
|
||||
const NAME_fra = 'NAME_fra';
|
||||
const NAME_deu = 'NAME_deu';
|
||||
|
||||
|
||||
const DEFAULT = self::ALPHA_3;
|
||||
|
||||
|
||||
protected static $fullnameMap = [
|
||||
self::ALPHA_2 => 'ISO 639 Alpha-2',
|
||||
self::ALPHA_3 => 'ISO 639 Alpha-3',
|
||||
self::ONELETTER => 'ISO 639 Alpha-1',
|
||||
self::NAME_eng => 'Englische Bezeichnung',
|
||||
self::NAME_fra => 'Französische Bezeichnung',
|
||||
self::NAME_deu => 'Deutsche Bezeichnung',
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n\Iso639;
|
||||
|
||||
|
||||
/**
|
||||
* Names for the iso639 list.
|
||||
*
|
||||
* @see \Xentral\Components\I18n\Iso639
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
abstract class Name/* extends Ruga_Enum */
|
||||
{
|
||||
/** Englisch */
|
||||
const ENG = 'NAME_eng';
|
||||
/** Französisch */
|
||||
const FRA = 'NAME_fra';
|
||||
/** Deutsch */
|
||||
const DEU = 'NAME_deu';
|
||||
|
||||
|
||||
protected static $fullnameMap = [
|
||||
self::ENG => 'Englische Bezeichnung',
|
||||
self::FRA => 'Französische Bezeichnung',
|
||||
self::DEU => 'Deutsche Bezeichnung',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n;
|
||||
|
||||
use Locale;
|
||||
use Xentral\Components\Http\Request;
|
||||
use Xentral\Components\Http\Session\Session;
|
||||
use Xentral\Components\I18n\Exception\LanguageNotInitializedException;
|
||||
use Xentral\Components\I18n\Exception\UnsupportedLocaleStringException;
|
||||
|
||||
/**
|
||||
* Provides a central service for localization.
|
||||
*
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
final class Localization implements LocalizationInterface
|
||||
{
|
||||
private array $config;
|
||||
|
||||
private ?Request $request;
|
||||
|
||||
private ?Session $session;
|
||||
|
||||
private array $usersettings = [];
|
||||
|
||||
private array $language = [];
|
||||
|
||||
private array $locale = [];
|
||||
|
||||
|
||||
|
||||
public function __construct(?Request $request, ?Session $session, array $usersettings = [], array $config = [])
|
||||
{
|
||||
$this->request = $request;
|
||||
$this->session = $session;
|
||||
$this->usersettings = $usersettings;
|
||||
$this->config = $config;
|
||||
$this->process();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function process()
|
||||
{
|
||||
// Hardcoded defaults if config is not available
|
||||
$localeDefault = $this->config[Localization::LOCALE_DEFAULT] ?? 'de_DE';
|
||||
$localeAttrName = $this->config[Localization::LOCALE_ATTRIBUTE_NAME] ?? 'locale';
|
||||
$langDefault = $this->config[Localization::LANGUAGE_DEFAULT] ?? 'deu';
|
||||
$langAttrName = $this->config[Localization::LANGUAGE_ATTRIBUTE_NAME] ?? 'language';
|
||||
|
||||
$segmentName = 'i18n';
|
||||
|
||||
// Get the locale from the session, if available
|
||||
if ($this->session && ($locale = $this->session->getValue($segmentName, $localeAttrName))) {
|
||||
} else {
|
||||
// Get locale from request, fallback to the user's browser preference
|
||||
if ($this->request) {
|
||||
$locale = $this->request->attributes->get(
|
||||
$localeAttrName,
|
||||
Locale::acceptFromHttp(
|
||||
$this->request->getHeader('Accept-Language', $localeDefault)
|
||||
) ?? $localeDefault
|
||||
);
|
||||
} else {
|
||||
$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? $localeDefault);
|
||||
}
|
||||
}
|
||||
// Get locale from user
|
||||
// This overrides all previous attempts to find a locale
|
||||
if (array_key_exists('locale', $this->usersettings)) {
|
||||
$locale = $this->usersettings['locale'];
|
||||
}
|
||||
// Get locale from query string
|
||||
// This overrides all previous attempts to find a locale
|
||||
if ($this->request) {
|
||||
$locale = $this->request->getParam($localeAttrName, $locale ?? $localeDefault);
|
||||
} else {
|
||||
$locale = $_GET[$localeAttrName] ?? $locale ?? $localeDefault;
|
||||
}
|
||||
|
||||
|
||||
// Get the language from the session, if available
|
||||
if ($this->session && ($language = $this->session->getValue($segmentName, $langAttrName))) {
|
||||
} else {
|
||||
// Get language from request, fallback to the current locale
|
||||
if ($this->request) {
|
||||
$language = $this->request->attributes->get($langAttrName, Locale::getPrimaryLanguage($locale));
|
||||
} else {
|
||||
$language = Locale::getPrimaryLanguage($locale);
|
||||
}
|
||||
}
|
||||
// Get language from user
|
||||
// This overrides all previous attempts to find a language
|
||||
if (array_key_exists('language', $this->usersettings)) {
|
||||
$language = $this->usersettings['language'];
|
||||
}
|
||||
// Get language from query string
|
||||
// This overrides all previous attempts to find a language
|
||||
if ($this->request) {
|
||||
$language = $this->request->getParam($langAttrName, $language ?? $langDefault);
|
||||
} else {
|
||||
$language = $language ?? $langDefault;
|
||||
}
|
||||
|
||||
// Check language against the data from Iso639 (and normalize to 3-letter-code)
|
||||
$language = (new Iso639())->find($language, Iso639\Key::DEFAULT, $langDefault);
|
||||
|
||||
|
||||
// Store the locale and language to the LocalizationInterface
|
||||
$this->setLanguage($language);
|
||||
$this->setLocale($locale);
|
||||
|
||||
// Store the locale and language to the session
|
||||
if ($this->session) {
|
||||
$this->session->setValue($segmentName, $localeAttrName, $locale);
|
||||
$this->session->setValue($segmentName, $langAttrName, $language);
|
||||
}
|
||||
|
||||
// Store the locale and language as a request attribute
|
||||
if ($this->request) {
|
||||
$this->request->attributes->set($localeAttrName, $locale);
|
||||
$this->request->attributes->set($langAttrName, $language);
|
||||
}
|
||||
|
||||
// Set the default locale
|
||||
Locale::setDefault($locale);
|
||||
// error_log(self::class . ": {$locale}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set the language.
|
||||
*
|
||||
* @param string $language
|
||||
*/
|
||||
public function setLanguage(string $language)
|
||||
{
|
||||
$this->language[Iso639\Key::DEFAULT] = (new \Xentral\Components\I18n\Iso639())->find(
|
||||
$language,
|
||||
Iso639\Key::DEFAULT
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the language string as defined by $key.
|
||||
*
|
||||
* @param string|null $key A constant from Iso639\Key
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLanguage(string $key = null): string
|
||||
{
|
||||
if (!$key) {
|
||||
$key = Iso639\Key::DEFAULT;
|
||||
}
|
||||
if (!($this->language[$key] ?? null)) {
|
||||
if (!($this->language[Iso639\Key::DEFAULT] ?? null)) {
|
||||
throw new LanguageNotInitializedException("Language is not set for key '" . Iso639\Key::DEFAULT . "'");
|
||||
}
|
||||
$this->language[$key] = (new \Xentral\Components\I18n\Iso639())->find(
|
||||
$this->language[Iso639\Key::DEFAULT],
|
||||
$key
|
||||
);
|
||||
}
|
||||
return $this->language[$key];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set the locale.
|
||||
*
|
||||
* @param string $locale
|
||||
*/
|
||||
public function setLocale(string $locale)
|
||||
{
|
||||
$parsedLocale = Locale::parseLocale($locale);
|
||||
$locale = Locale::composeLocale([
|
||||
'language' => $parsedLocale['language'],
|
||||
'region' => $parsedLocale['region'],
|
||||
]);
|
||||
|
||||
if(!$locale) throw new UnsupportedLocaleStringException("The given locale string '{$locale}' is not supported");
|
||||
|
||||
$this->locale[Iso3166\Key::DEFAULT] = $locale;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the locale string as defined by $key.
|
||||
*
|
||||
* @param string|null $key A constant from Iso3166\Key
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocale(string $key = null): string
|
||||
{
|
||||
return $this->locale[Iso3166\Key::DEFAULT];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return a new localization object using the given adresse array as source for language and region.
|
||||
*
|
||||
* @param array $adresse
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function withAdresse(array $adresse): self
|
||||
{
|
||||
$localization = clone $this;
|
||||
|
||||
// Find language from address array or keep current language
|
||||
if (!$lang = Bootstrap::findLanguage($adresse['sprache'])) {
|
||||
$lang = Bootstrap::findLanguage($this->getLanguage());
|
||||
}
|
||||
if ($lang) {
|
||||
$localization->setLanguage($lang[Iso639\Key::ALPHA_3]);
|
||||
}
|
||||
|
||||
// Find region from address or keep current region
|
||||
if (!$region = Bootstrap::findRegion($adresse['land'])) {
|
||||
$parsedLocale = Locale::parseLocale($this->getLocale());
|
||||
$region = Bootstrap::findRegion($parsedLocale['region']);
|
||||
}
|
||||
if ($lang && $region) {
|
||||
$localization->setLocale("{$lang[Iso639\Key::ALPHA_2]}_{$region[Iso3166\Key::ALPHA_2]}");
|
||||
}
|
||||
|
||||
return $localization;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Xentral\Components\I18n;
|
||||
|
||||
/**
|
||||
* Interface LocalizationInterface
|
||||
*
|
||||
* @author Roland Rusch, easy-smart solution GmbH <roland.rusch@easy-smart.ch>
|
||||
*/
|
||||
interface LocalizationInterface
|
||||
{
|
||||
const LOCALE_DEFAULT = 'locale_default';
|
||||
const LOCALE_ATTRIBUTE_NAME = 'locale_attr_name';
|
||||
const LANGUAGE_DEFAULT = 'language_default';
|
||||
const LANGUAGE_ATTRIBUTE_NAME = 'language_attr_name';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set the language.
|
||||
*
|
||||
* @param string $language
|
||||
*/
|
||||
public function setLanguage(string $language);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the language string as defined by $key.
|
||||
*
|
||||
* @param string|null $key A constant from Iso639\Key
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLanguage(string $key = null): string;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set the locale.
|
||||
*
|
||||
* @param string $locale
|
||||
*/
|
||||
public function setLocale(string $locale);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return the locale string as defined by $key.
|
||||
*
|
||||
* @param string|null $key A constant from Iso3166\Key
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLocale(string $key = null): string;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/*
|
||||
* Data extracted from https://www.iso.org/iso-639-language-codes.html
|
||||
*/
|
||||
return [
|
||||
|
||||
'aar' => [
|
||||
'639-2' => 'aar',
|
||||
'639-1' => 'aa',
|
||||
'NAME_eng' => 'Afar',
|
||||
'NAME_fra' => 'afar',
|
||||
'NAME_deu' => 'Danakil-Sprache',
|
||||
],
|
||||
'abk' => [
|
||||
'639-2' => 'abk',
|
||||
'639-1' => 'ab',
|
||||
'NAME_eng' => 'Abkhazian',
|
||||
'NAME_fra' => 'abkhaze',
|
||||
'NAME_deu' => 'Abchasisch',
|
||||
],
|
||||
'ace' => [
|
||||
'639-2' => 'ace',
|
||||
'639-1' => null,
|
||||
'NAME_eng' => 'Achinese',
|
||||
'NAME_fra' => 'aceh',
|
||||
'NAME_deu' => 'Aceh-Sprache',
|
||||
],
|
||||
'ach' => [
|
||||
'639-2' => 'ach',
|
||||
'639-1' => null,
|
||||
'NAME_eng' => 'Acoli',
|
||||
'NAME_fra' => 'acoli',
|
||||
'NAME_deu' => 'Acholi-Sprache',
|
||||
],
|
||||
'ada' => [
|
||||
'639-2' => 'ada',
|
||||
'639-1' => null,
|
||||
'NAME_eng' => 'Adangme',
|
||||
'NAME_fra' => 'adangme',
|
||||
'NAME_deu' => 'Adangme-Sprache',
|
||||
],
|
||||
'ady' => [
|
||||
'639-2' => 'ady',
|
||||
'639-1' => null,
|
||||
'NAME_eng' => 'Adyghe',
|
||||
'NAME_fra' => 'adyghé',
|
||||
'NAME_deu' => 'Adygisch',
|
||||
],
|
||||
'afa' => [
|
||||
'639-2' => 'afa',
|
||||
'639-1' => null,
|
||||
'NAME_eng' => 'Afro-Asiatic languages',
|
||||
'NAME_fra' => 'afro-asiatiques, langues',
|
||||
'NAME_deu' => 'Hamitosemitische Sprachen (Andere)',
|
||||
],
|
||||
'afh' => [
|
||||
'639-2' => 'afh',
|
||||
'639-1' => null,
|
||||
'NAME_eng' => 'Afrihili',
|
||||
'NAME_fra' => 'afrihili',
|
||||
'NAME_deu' => 'Afrihili',
|
||||
],
|
||||
'afr' => [
|
||||
'639-2' => 'afr',
|
||||
'639-1' => 'af',
|
||||
'NAME_eng' => 'Afrikaans',
|
||||
'NAME_fra' => 'afrikaans',
|
||||
'NAME_deu' => 'Afrikaans',
|
||||
],
|
||||
'ain' => [
|
||||
'639-2' => 'ain',
|
||||
'639-1' => null,
|
||||
'NAME_eng' => 'Ainu',
|
||||
'NAME_fra' => 'aïnou',
|
||||
'NAME_deu' => 'Ainu-Sprache',
|
||||
],
|
||||
'aka' => [
|
||||
'639-2' => 'aka',
|
||||
'639-1' => 'ak',
|
||||
'NAME_eng' => 'Akan',
|
||||
'NAME_fra' => 'akan',
|
||||
'NAME_deu' => 'Akan-Sprache',
|
||||
],
|
||||
'akk' => [
|
||||
'639-2' => 'akk',
|
||||
'639-1' => null,
|
||||
'NAME_eng' => 'Akkadian',
|
||||
'NAME_fra' => 'akkadien',
|
||||
'NAME_deu' => 'Akkadisch',
|
||||
],
|
||||
'sqi' => [
|
||||
'639-2' => 'sqi',
|
||||
'639-1' => 'sq',
|
||||
'NAME_eng' => 'Albanian',
|
||||
'NAME_fra' => 'albanais',
|
||||
'NAME_deu' => 'Albanisch',
|
||||
'639-2-B' => 'alb',
|
||||
],
|
||||
|
||||
'deu' => [
|
||||
'639-2' => 'deu',
|
||||
'639-1' => 'de',
|
||||
'NAME_eng' => 'German',
|
||||
'NAME_fra' => 'allemand',
|
||||
'NAME_deu' => 'Deutsch',
|
||||
'639-2-B' => 'ger',
|
||||
'1L' => 'D',
|
||||
],
|
||||
'eng' => [
|
||||
'639-2' => 'eng',
|
||||
'639-1' => 'en',
|
||||
'NAME_eng' => 'English',
|
||||
'NAME_fra' => 'anglais',
|
||||
'NAME_deu' => 'Englisch',
|
||||
'1L' => 'E',
|
||||
],
|
||||
'fra' => [
|
||||
'639-2' => 'fra',
|
||||
'639-1' => 'fr',
|
||||
'NAME_eng' => 'French',
|
||||
'NAME_fra' => 'français',
|
||||
'NAME_deu' => 'Französisch',
|
||||
'639-2-B' => 'fre',
|
||||
'1L' => 'F',
|
||||
],
|
||||
'ita' => [
|
||||
'639-2' => 'ita',
|
||||
'639-1' => 'it',
|
||||
'NAME_eng' => 'Italian',
|
||||
'NAME_fra' => 'italien',
|
||||
'NAME_deu' => 'Italienisch',
|
||||
'1L' => 'I',
|
||||
],
|
||||
'spa' => [
|
||||
'639-2' => 'spa',
|
||||
'639-1' => 'es',
|
||||
'NAME_eng' => 'Spanish',
|
||||
'NAME_fra' => 'espagnol',
|
||||
'NAME_deu' => 'Spanisch',
|
||||
],
|
||||
'por' => [
|
||||
'639-2' => 'por',
|
||||
'639-1' => 'pt',
|
||||
'NAME_eng' => 'Portuguese',
|
||||
'NAME_fra' => 'portugais',
|
||||
'NAME_deu' => 'Portugiesisch',
|
||||
],
|
||||
'roh' => [
|
||||
'639-2' => 'roh',
|
||||
'639-1' => 'rm',
|
||||
'NAME_eng' => 'Romansh',
|
||||
'NAME_fra' => 'romanche',
|
||||
'NAME_deu' => 'Rätoromanisch',
|
||||
],
|
||||
'dut' => ['639-2' => 'dut', '639-1' => 'nl', 'NAME_eng' => 'Dutch', 'NAME_fra' => 'néerlandais', 'NAME_deu' => 'Niederländisch', 'NAME_deu_alt' => 'Holländisch'],
|
||||
'swe' => ['639-2' => 'swe', '639-1' => 'sv', 'NAME_eng' => 'Swedish', 'NAME_fra' => 'suédois', 'NAME_deu' => 'Schwedisch'],
|
||||
'dan' => ['639-2' => 'dan', '639-1' => 'da', 'NAME_eng' => 'Danish', 'NAME_fra' => 'danois', 'NAME_deu' => 'Dänisch'],
|
||||
'nor' => ['639-2' => 'nor', '639-1' => 'no', 'NAME_eng' => 'Norwegian', 'NAME_fra' => 'norvégien', 'NAME_deu' => 'Norwegisch'],
|
||||
];
|
||||
@@ -1,453 +1,451 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
|
||||
class StringCleaner
|
||||
{
|
||||
private $elements;
|
||||
private $htmlpuriferconfig;
|
||||
private $htmlpurifer;
|
||||
private $ruleregexps;
|
||||
/** @var Application */
|
||||
private $app;
|
||||
|
||||
/**
|
||||
* StringCleaner constructor.
|
||||
*
|
||||
* @param null|Application $app
|
||||
*/
|
||||
public function __construct($app = null)
|
||||
{
|
||||
$this->app = $app;
|
||||
if(class_exists('HTMLPurifier_Config')) {
|
||||
$this->htmlpuriferconfig = HTMLPurifier_Config::createDefault();
|
||||
$this->htmlpuriferconfig->set('Core.Encoding', 'UTF-8');
|
||||
$this->htmlpuriferconfig->set('Attr.AllowedFrameTargets', ['_blank']); // Allow hyperlinks with target="_blank"
|
||||
//$this->htmlpuriferconfig->set('HTML.AllowedElements', 'h1,h2,h3,h4,h5,h6,p,a,strong,em,ol,ul,li,img,param,div,br,form,label,fieldset,input,textarea,select,option');
|
||||
$this->htmlpurifer = new HTMLPurifier($this->htmlpuriferconfig);
|
||||
}
|
||||
$this->elements = array('nohtml'=> array('ust_befreit','abweichendelieferadresse','bestellungsart','bearbeiter','datum','lieferdatum','name','anrede','partner','packstation_inhaber','packstation_station','packstation_ident','packstation_plz','packstation_ort','partnerid','kennen','ihrebestellnummer'
|
||||
,'abteilung','unterabteilung','ansprechpartner','adresszusatz','strasse','land','bundesstaat','plz','ort','versandart','internet','transaktionsnummer','vertrieb','zahlungsweise'
|
||||
,'lieferabteilung','lieferunterabteilung','lieferansprechpartner','lieferadresszusatz','lieferstrasse','lieferland','lieferbundesstaat','lieferplz','lieferort'
|
||||
,'bank_inhaber','bank_institut','bank_blz','bank_konto'
|
||||
,'email','telefon','telefax','ustid','partner','projekt','herstellernummer','ean','nummer','name_de','name_ean'),
|
||||
'nojs' => array('anabregstext','anabregstext_en','uebersicht_de','uebersicht_en','kurztext_de','kurztext_en','internebemerkung','internebezeichnung','freitext'));
|
||||
|
||||
$this->rulechecks = array('digit'=>'/^[0-9]+$/'
|
||||
,'alpha'=>'/^[a-zA-Z]+$/'
|
||||
,'alphadigit'=>'/^[0-9a-zA-Z]+$/'
|
||||
,'username'=>'/^[0-9a-zA-Z\.\-]+$/'
|
||||
,'space'=>'/^[\x20]+$/'
|
||||
,'module'=>'/^[0-9a-zA-Z\_]$/'
|
||||
,'password'=>'/^[^\s\n]{1}[^\n]{5}.*$/'
|
||||
,'email'=>'/^[^@\s\x00-\x20]+@[^@\s\x00-\x20\.]+\.[^@\s\x00-\x20\.]+[^@\s\x00-\x20]*$/'
|
||||
);
|
||||
|
||||
$this->ruleregexps = array(
|
||||
'digit'=>'/[^0-9]/'
|
||||
,'username'=>'/[^0-9a-zA-Z\.\-]/'
|
||||
,'alpha'=>'/[^a-zA-Z]/'
|
||||
,'alphadigits'=>'/[^0-9a-zA-Z]/'
|
||||
,'module'=>'/[^0-9a-zA-Z\_]/'
|
||||
,'moduleminus'=>'/[^0-9a-zA-Z\_\-]/'
|
||||
,'alphadigitsspecial'=>'/[^0-9a-zA-Z\_\.\(\)]/'
|
||||
,'base64'=>'/[^0-9a-zA-Z\=\+\-\_\/]/'
|
||||
);
|
||||
}
|
||||
|
||||
function SyntaxByElement($key, $default = '')
|
||||
{
|
||||
foreach($this->elements as $type => $arr) {
|
||||
if(in_array($key, $arr)) {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
function CleanSQLReturn($value, $columnname, $default = '')
|
||||
{
|
||||
if($value == '' || is_numeric($value))
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
if(in_array($columnname, array('nummer','name','kundennummer','bezeichnung','bezeichnunglieferant','lieferantennummer','mitarbeiternummer','name_de','name_en',
|
||||
'kurzbezeichnung','abkuerzung',
|
||||
'strasse','plz','ort','land','ansprechpartner','abteilung','unterabteilung',
|
||||
'liefername','lieferstrasse','lieferplz','lieferort','lieferland','lieferansprechpartner','lieferabteilung','lieferunterabteilung'))){
|
||||
return strip_tags($value);
|
||||
}
|
||||
if($default == 'xss_clean')
|
||||
{
|
||||
return $this->xss_clean($value, false);
|
||||
}
|
||||
if($this->htmlpurifer)
|
||||
{
|
||||
return $this->htmlpurifer->purify($value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
function RuleCheck($string, $rule = null, &$found = false)
|
||||
{
|
||||
if(isset($this->rulechecks[$rule]))
|
||||
{
|
||||
$found = true;
|
||||
return preg_match_all($this->rulechecks[$rule], $string, $dummy);
|
||||
}
|
||||
switch($rule)
|
||||
{
|
||||
case 'datum':
|
||||
$found = true;
|
||||
|
||||
if(preg_match_all('/([0-9]+)\.([0-9]+)\.$/', $string, $matches))
|
||||
{
|
||||
$string = $matches[1][0].'.'.$matches[2][0].'.'.date('Y');
|
||||
}
|
||||
|
||||
try {
|
||||
if($x = new DateTime($string)) {
|
||||
return $x->format('Y') > 0;
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CheckSQLHtml($sql)
|
||||
{
|
||||
$start = 0;
|
||||
$len = strlen($sql);
|
||||
$lvl = 0;
|
||||
$col = 0;
|
||||
$ret = array(0);
|
||||
$instring = false;
|
||||
for($i = $start; $i < $len; $i++)
|
||||
{
|
||||
$char = $sql[$i];
|
||||
switch($char)
|
||||
{
|
||||
case "'":
|
||||
if($instring)
|
||||
{
|
||||
if($sql[$i-1] != '\\')
|
||||
{
|
||||
$instring = false;
|
||||
}
|
||||
}else{
|
||||
if($sql[$i-1] != '\\'){
|
||||
$instring = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "(":
|
||||
if($instring)
|
||||
{
|
||||
|
||||
}else{
|
||||
$lvl++;
|
||||
}
|
||||
break;
|
||||
case ")":
|
||||
if($instring)
|
||||
{
|
||||
|
||||
}else{
|
||||
$lvl--;
|
||||
}
|
||||
break;
|
||||
case "<":
|
||||
if($instring)
|
||||
{
|
||||
if(preg_match('/<[a-zA-Z]/',$char.$sql[$i+1]))
|
||||
{
|
||||
if($ret[$col] != 2)
|
||||
{
|
||||
$ret[$col] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ',':
|
||||
if($instring)
|
||||
{
|
||||
|
||||
}else{
|
||||
if($lvl == 0)
|
||||
{
|
||||
$col++;
|
||||
$ret[$col] = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'o':
|
||||
case 'O':
|
||||
if($instring)
|
||||
{
|
||||
if($i < $len -4)
|
||||
{
|
||||
if(strtolower(substr($sql, $i, 2)) == 'on')
|
||||
{
|
||||
if(preg_match('/^on[a-z]+(\s*)=/', substr($sql, $i)))
|
||||
{
|
||||
$ret[$col] = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
case 'f':
|
||||
if($instring)
|
||||
{
|
||||
|
||||
}else{
|
||||
if($lvl == 0)
|
||||
{
|
||||
if($i < $len - 4)
|
||||
{
|
||||
if(strtolower(substr($sql, $i, 4)) == 'from')
|
||||
{
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$where = strripos($sql, 'where');
|
||||
$restsql = substr($sql, $i, $where - $i);
|
||||
if(preg_match('/<[a-zA-Z]/', $restsql))
|
||||
{
|
||||
if(preg_match('/on[a-z]+(\s*)=/',$restsql))
|
||||
{
|
||||
if($ret)
|
||||
{
|
||||
foreach($ret as $k => $v)
|
||||
{
|
||||
$ret[$k] = 2;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if($ret)
|
||||
{
|
||||
foreach($ret as $k => $v)
|
||||
{
|
||||
if($v != 2)
|
||||
{
|
||||
$ret[$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function CleanString($string, $rule = null, &$found = false)
|
||||
{
|
||||
if(is_null($rule))
|
||||
{
|
||||
$rule = 'nothml';
|
||||
}
|
||||
switch($rule)
|
||||
{
|
||||
case 'email':
|
||||
if($this->RuleCheck($string, $rule))
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
return '';
|
||||
break;
|
||||
case 'nohtml':
|
||||
$found = true;
|
||||
if($string == '' || is_numeric($string))
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
if(strpos($string,'<') === false)
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
return strip_tags($string);
|
||||
break;
|
||||
case 'datum':
|
||||
$found = true;
|
||||
$string_ = $string;
|
||||
if(preg_match_all('/([0-9]+)\.([0-9]+)\.$/', $string, $matches))
|
||||
{
|
||||
$string_ = $matches[1][0].'.'.$matches[2][0].'.'.date('Y');
|
||||
}
|
||||
try
|
||||
{
|
||||
if($x = new DateTime($string_))
|
||||
{
|
||||
if($x->format('Y') <= 0)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return '';
|
||||
}
|
||||
return '';
|
||||
break;
|
||||
case 'xss_clean':
|
||||
$found = true;
|
||||
if($string == '' || is_numeric($string))
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
if(strpos($string,'<') === false){
|
||||
return $string;
|
||||
}
|
||||
return $this->xss_clean($string, false);
|
||||
break;
|
||||
case 'nojs':
|
||||
$found = true;
|
||||
if($string == '' || is_numeric($string))return $string;
|
||||
if(strpos($string,'<') === false)return $string;
|
||||
if($this->htmlpurifer)
|
||||
{
|
||||
return $this->htmlpurifer->purify($string);
|
||||
}
|
||||
return $this->xss_clean($string);
|
||||
break;
|
||||
case 'id':
|
||||
$found = true;
|
||||
if((String)$string === '')
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
return (int)$string;
|
||||
break;
|
||||
case 'doppelid':
|
||||
$found = true;
|
||||
if((String)$string === '')
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
$stringa = explode('-', $string, 2);
|
||||
if(count($stringa) == 1)return (int)$stringa[0];
|
||||
return ($stringa[0]===''?'':(int)$stringa[0]).'-'.(int)$stringa[1];
|
||||
break;
|
||||
case 'module':
|
||||
$found = true;
|
||||
return preg_replace ($this->ruleregexps[$rule], '' , $string);
|
||||
break;
|
||||
default:
|
||||
if(isset($this->ruleregexps[$rule]))
|
||||
{
|
||||
$found = true;
|
||||
return preg_replace ($this->ruleregexps[$rule], '' , $string);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function xss_clean($data, $usepurify = true)
|
||||
{
|
||||
if($usepurify && !empty($this->htmlpurifer))
|
||||
{
|
||||
return $this->htmlpurifer->purify($data);
|
||||
}
|
||||
// Fix &entity\n;
|
||||
$data = str_replace(array('&','<','>'), array('&amp;','&lt;','&gt;'), $data);
|
||||
$data = preg_replace('/(&#*\w+)[\x00-\x20]+;/u', '$1;', $data);
|
||||
$data = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $data);
|
||||
$data = html_entity_decode($data, ENT_COMPAT, 'UTF-8');
|
||||
return $data;
|
||||
// Remove any attribute starting with "on" or xmlns
|
||||
$data = preg_replace('#(<[^>]+?[\x00-\x20"\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data);
|
||||
|
||||
// Remove javascript: and vbscript: protocols
|
||||
$data = preg_replace('#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([`\'"]*)[\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2nojavascript...', $data);
|
||||
$data = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2novbscript...', $data);
|
||||
$data = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*-moz-binding[\x00-\x20]*:#u', '$1=$2nomozbinding...', $data);
|
||||
|
||||
// Only works in IE: <span style="width: expression(alert('Ping!'));"></span>
|
||||
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?expression[\x00-\x20]*\([^>]*+>#i', '$1>', $data);
|
||||
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?behaviour[\x00-\x20]*\([^>]*+>#i', '$1>', $data);
|
||||
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:*[^>]*+>#iu', '$1>', $data);
|
||||
|
||||
// Remove namespaced elements (we do not need them)
|
||||
$data = preg_replace('#</*\w+:\w[^>]*+>#i', '', $data);
|
||||
|
||||
do
|
||||
{
|
||||
// Remove really unwanted tags
|
||||
$old_data = $data;
|
||||
$data = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $data);
|
||||
}
|
||||
while ($old_data !== $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
function XMLArray_clean(&$xml, $lvl = 0)
|
||||
{
|
||||
if(is_string($xml))
|
||||
{
|
||||
|
||||
}elseif(is_array($xml))
|
||||
{
|
||||
if(count($xml) > 0)
|
||||
{
|
||||
foreach($xml as $k => $v)
|
||||
{
|
||||
if(is_string($v))
|
||||
{
|
||||
$xml[$k] = $this->CleanString($v, $this->SyntaxByElement($k,'nojs'));
|
||||
}
|
||||
if($lvl < 10)
|
||||
{
|
||||
$this->XMLArray_clean($v, $lvl + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}elseif(is_object($xml))
|
||||
{
|
||||
$xml = (array) $xml;
|
||||
if(count($xml) > 0)
|
||||
{
|
||||
foreach($xml as $k => $v)
|
||||
{
|
||||
$v = (array) $v;
|
||||
if(count($v) > 0)
|
||||
{
|
||||
if($lvl < 10)
|
||||
{
|
||||
$this->XMLArray_clean($v, $lvl + 1);
|
||||
}
|
||||
}elseif((String)$v != '')
|
||||
{
|
||||
if(isset($xml->$k))
|
||||
{
|
||||
//$xml->$k = $this->CleanString($v, $this->SyntaxByElement($k,'nojs'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $xml;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
class StringCleaner
|
||||
{
|
||||
private $elements;
|
||||
private $htmlpuriferconfig;
|
||||
private $htmlpurifer;
|
||||
private $ruleregexps;
|
||||
/** @var Application */
|
||||
private $app;
|
||||
|
||||
/**
|
||||
* StringCleaner constructor.
|
||||
*
|
||||
* @param null|Application $app
|
||||
*/
|
||||
public function __construct($app = null)
|
||||
{
|
||||
$this->app = $app;
|
||||
if(class_exists('HTMLPurifier_Config')) {
|
||||
$this->htmlpuriferconfig = HTMLPurifier_Config::createDefault();
|
||||
$this->htmlpuriferconfig->set('Core.Encoding', 'UTF-8');
|
||||
$this->htmlpuriferconfig->set('Attr.AllowedFrameTargets', ['_blank']); // Allow hyperlinks with target="_blank"
|
||||
//$this->htmlpuriferconfig->set('HTML.AllowedElements', 'h1,h2,h3,h4,h5,h6,p,a,strong,em,ol,ul,li,img,param,div,br,form,label,fieldset,input,textarea,select,option');
|
||||
$this->htmlpurifer = new HTMLPurifier($this->htmlpuriferconfig);
|
||||
}
|
||||
$this->elements = array('nohtml'=> array('ust_befreit','abweichendelieferadresse','bestellungsart','bearbeiter','datum','lieferdatum','name','anrede','partner','packstation_inhaber','packstation_station','packstation_ident','packstation_plz','packstation_ort','partnerid','kennen','ihrebestellnummer'
|
||||
,'abteilung','unterabteilung','ansprechpartner','adresszusatz','strasse','land','bundesstaat','plz','ort','versandart','internet','transaktionsnummer','vertrieb','zahlungsweise'
|
||||
,'lieferabteilung','lieferunterabteilung','lieferansprechpartner','lieferadresszusatz','lieferstrasse','lieferland','lieferbundesstaat','lieferplz','lieferort'
|
||||
,'bank_inhaber','bank_institut','bank_blz','bank_konto'
|
||||
,'email','telefon','telefax','ustid','partner','projekt','herstellernummer','ean','nummer','name_de','name_ean'),
|
||||
'nojs' => array('anabregstext','anabregstext_en','uebersicht_de','uebersicht_en','kurztext_de','kurztext_en','internebemerkung','internebezeichnung','freitext'));
|
||||
|
||||
$this->rulechecks = array('digit'=>'/^[0-9]+$/'
|
||||
,'alpha'=>'/^[a-zA-Z]+$/'
|
||||
,'alphadigit'=>'/^[0-9a-zA-Z]+$/'
|
||||
,'username'=>'/^[0-9a-zA-Z\.\-]+$/'
|
||||
,'space'=>'/^[\x20]+$/'
|
||||
,'module'=>'/^[0-9a-zA-Z\_]$/'
|
||||
,'password'=>'/^[^\s\n]{1}[^\n]{5}.*$/'
|
||||
,'email'=>'/^[^@\s\x00-\x20]+@[^@\s\x00-\x20\.]+\.[^@\s\x00-\x20\.]+[^@\s\x00-\x20]*$/'
|
||||
);
|
||||
|
||||
$this->ruleregexps = array(
|
||||
'digit'=>'/[^0-9]/'
|
||||
,'username'=>'/[^0-9a-zA-Z\.\-]/'
|
||||
,'alpha'=>'/[^a-zA-Z]/'
|
||||
,'alphadigits'=>'/[^0-9a-zA-Z]/'
|
||||
,'module'=>'/[^0-9a-zA-Z\_]/'
|
||||
,'moduleminus'=>'/[^0-9a-zA-Z\_\-]/'
|
||||
,'alphadigitsspecial'=>'/[^0-9a-zA-Z\_\.\(\)]/'
|
||||
,'base64'=>'/[^0-9a-zA-Z\=\+\-\_\/]/'
|
||||
);
|
||||
}
|
||||
|
||||
function SyntaxByElement($key, $default = '')
|
||||
{
|
||||
foreach($this->elements as $type => $arr) {
|
||||
if(in_array($key, $arr)) {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
return $default;
|
||||
}
|
||||
|
||||
function CleanSQLReturn($value, $columnname, $default = '')
|
||||
{
|
||||
if($value == '' || is_numeric($value))
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
if(in_array($columnname, array('nummer','name','kundennummer','bezeichnung','bezeichnunglieferant','lieferantennummer','mitarbeiternummer','name_de','name_en',
|
||||
'kurzbezeichnung','abkuerzung',
|
||||
'strasse','plz','ort','land','ansprechpartner','abteilung','unterabteilung',
|
||||
'liefername','lieferstrasse','lieferplz','lieferort','lieferland','lieferansprechpartner','lieferabteilung','lieferunterabteilung'))){
|
||||
return strip_tags($value);
|
||||
}
|
||||
if($default == 'xss_clean')
|
||||
{
|
||||
return $this->xss_clean($value, false);
|
||||
}
|
||||
if($this->htmlpurifer)
|
||||
{
|
||||
return $this->htmlpurifer->purify($value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
function RuleCheck($string, $rule = null, &$found = false)
|
||||
{
|
||||
if(isset($this->rulechecks[$rule]))
|
||||
{
|
||||
$found = true;
|
||||
return preg_match_all($this->rulechecks[$rule], $string, $dummy);
|
||||
}
|
||||
switch($rule)
|
||||
{
|
||||
case 'datum':
|
||||
$found = true;
|
||||
|
||||
if(preg_match_all('/([0-9]+)\.([0-9]+)\.$/', $string, $matches))
|
||||
{
|
||||
$string = $matches[1][0].'.'.$matches[2][0].'.'.date('Y');
|
||||
}
|
||||
|
||||
try {
|
||||
if($x = new DateTime($string)) {
|
||||
return $x->format('Y') > 0;
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function CheckSQLHtml($sql)
|
||||
{
|
||||
$start = 0;
|
||||
$len = strlen($sql);
|
||||
$lvl = 0;
|
||||
$col = 0;
|
||||
$ret = array(0);
|
||||
$instring = false;
|
||||
for($i = $start; $i < $len; $i++)
|
||||
{
|
||||
$char = $sql[$i];
|
||||
switch($char)
|
||||
{
|
||||
case "'":
|
||||
if($instring)
|
||||
{
|
||||
if($sql[$i-1] != '\\')
|
||||
{
|
||||
$instring = false;
|
||||
}
|
||||
}else{
|
||||
if($sql[$i-1] != '\\'){
|
||||
$instring = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "(":
|
||||
if($instring)
|
||||
{
|
||||
|
||||
}else{
|
||||
$lvl++;
|
||||
}
|
||||
break;
|
||||
case ")":
|
||||
if($instring)
|
||||
{
|
||||
|
||||
}else{
|
||||
$lvl--;
|
||||
}
|
||||
break;
|
||||
case "<":
|
||||
if($instring)
|
||||
{
|
||||
if(preg_match('/<[a-zA-Z]/',$char.$sql[$i+1]))
|
||||
{
|
||||
if($ret[$col] != 2)
|
||||
{
|
||||
$ret[$col] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ',':
|
||||
if($instring)
|
||||
{
|
||||
|
||||
}else{
|
||||
if($lvl == 0)
|
||||
{
|
||||
$col++;
|
||||
$ret[$col] = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'o':
|
||||
case 'O':
|
||||
if($instring)
|
||||
{
|
||||
if($i < $len -4)
|
||||
{
|
||||
if(strtolower(substr($sql, $i, 2)) == 'on')
|
||||
{
|
||||
if(preg_match('/^on[a-z]+(\s*)=/', substr($sql, $i)))
|
||||
{
|
||||
$ret[$col] = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
case 'f':
|
||||
if($instring)
|
||||
{
|
||||
|
||||
}else{
|
||||
if($lvl == 0)
|
||||
{
|
||||
if($i < $len - 4)
|
||||
{
|
||||
if(strtolower(substr($sql, $i, 4)) == 'from')
|
||||
{
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$where = strripos($sql, 'where');
|
||||
$restsql = substr($sql, $i, $where - $i);
|
||||
if(preg_match('/<[a-zA-Z]/', $restsql))
|
||||
{
|
||||
if(preg_match('/on[a-z]+(\s*)=/',$restsql))
|
||||
{
|
||||
if($ret)
|
||||
{
|
||||
foreach($ret as $k => $v)
|
||||
{
|
||||
$ret[$k] = 2;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if($ret)
|
||||
{
|
||||
foreach($ret as $k => $v)
|
||||
{
|
||||
if($v != 2)
|
||||
{
|
||||
$ret[$k] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function CleanString($string, $rule = null, &$found = false)
|
||||
{
|
||||
if(is_null($rule))
|
||||
{
|
||||
$rule = 'nothml';
|
||||
}
|
||||
switch($rule)
|
||||
{
|
||||
case 'email':
|
||||
if($this->RuleCheck($string, $rule))
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
return '';
|
||||
break;
|
||||
case 'nohtml':
|
||||
$found = true;
|
||||
if($string == '' || is_numeric($string))
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
if(strpos($string,'<') === false)
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
return strip_tags($string);
|
||||
break;
|
||||
case 'datum':
|
||||
$found = true;
|
||||
$string_ = $string;
|
||||
if(preg_match_all('/([0-9]+)\.([0-9]+)\.$/', $string, $matches))
|
||||
{
|
||||
$string_ = $matches[1][0].'.'.$matches[2][0].'.'.date('Y');
|
||||
}
|
||||
try
|
||||
{
|
||||
if($x = new DateTime($string_))
|
||||
{
|
||||
if($x->format('Y') <= 0)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return '';
|
||||
}
|
||||
return '';
|
||||
break;
|
||||
case 'xss_clean':
|
||||
$found = true;
|
||||
if($string == '' || is_numeric($string))
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
if(strpos($string,'<') === false){
|
||||
return $string;
|
||||
}
|
||||
return $this->xss_clean($string, false);
|
||||
break;
|
||||
case 'nojs':
|
||||
$found = true;
|
||||
if($string == '' || is_numeric($string))return $string;
|
||||
if(strpos($string,'<') === false)return $string;
|
||||
if($this->htmlpurifer)
|
||||
{
|
||||
return $this->htmlpurifer->purify($string);
|
||||
}
|
||||
return $this->xss_clean($string);
|
||||
break;
|
||||
case 'id':
|
||||
$found = true;
|
||||
if((String)$string === '')
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
return (int)$string;
|
||||
break;
|
||||
case 'doppelid':
|
||||
$found = true;
|
||||
if((String)$string === '')
|
||||
{
|
||||
return $string;
|
||||
}
|
||||
$stringa = explode('-', $string, 2);
|
||||
if(count($stringa) == 1)return (int)$stringa[0];
|
||||
return ($stringa[0]===''?'':(int)$stringa[0]).'-'.(int)$stringa[1];
|
||||
break;
|
||||
case 'module':
|
||||
$found = true;
|
||||
return preg_replace ($this->ruleregexps[$rule], '' , $string);
|
||||
break;
|
||||
default:
|
||||
if(isset($this->ruleregexps[$rule]))
|
||||
{
|
||||
$found = true;
|
||||
return preg_replace ($this->ruleregexps[$rule], '' , $string);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function xss_clean($data, $usepurify = true)
|
||||
{
|
||||
if($usepurify && !empty($this->htmlpurifer))
|
||||
{
|
||||
return $this->htmlpurifer->purify($data);
|
||||
}
|
||||
// Fix &entity\n;
|
||||
$data = str_replace(array('&','<','>'), array('&amp;','&lt;','&gt;'), $data);
|
||||
$data = preg_replace('/(&#*\w+)[\x00-\x20]+;/u', '$1;', $data);
|
||||
$data = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $data);
|
||||
$data = html_entity_decode($data, ENT_COMPAT, 'UTF-8');
|
||||
return $data;
|
||||
// Remove any attribute starting with "on" or xmlns
|
||||
$data = preg_replace('#(<[^>]+?[\x00-\x20"\'])(?:on|xmlns)[^>]*+>#iu', '$1>', $data);
|
||||
|
||||
// Remove javascript: and vbscript: protocols
|
||||
$data = preg_replace('#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([`\'"]*)[\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2nojavascript...', $data);
|
||||
$data = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2novbscript...', $data);
|
||||
$data = preg_replace('#([a-z]*)[\x00-\x20]*=([\'"]*)[\x00-\x20]*-moz-binding[\x00-\x20]*:#u', '$1=$2nomozbinding...', $data);
|
||||
|
||||
// Only works in IE: <span style="width: expression(alert('Ping!'));"></span>
|
||||
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?expression[\x00-\x20]*\([^>]*+>#i', '$1>', $data);
|
||||
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?behaviour[\x00-\x20]*\([^>]*+>#i', '$1>', $data);
|
||||
$data = preg_replace('#(<[^>]+?)style[\x00-\x20]*=[\x00-\x20]*[`\'"]*.*?s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:*[^>]*+>#iu', '$1>', $data);
|
||||
|
||||
// Remove namespaced elements (we do not need them)
|
||||
$data = preg_replace('#</*\w+:\w[^>]*+>#i', '', $data);
|
||||
|
||||
do
|
||||
{
|
||||
// Remove really unwanted tags
|
||||
$old_data = $data;
|
||||
$data = preg_replace('#</*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $data);
|
||||
}
|
||||
while ($old_data !== $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
function XMLArray_clean(&$xml, $lvl = 0)
|
||||
{
|
||||
if(is_string($xml))
|
||||
{
|
||||
|
||||
}elseif(is_array($xml))
|
||||
{
|
||||
if(count($xml) > 0)
|
||||
{
|
||||
foreach($xml as $k => $v)
|
||||
{
|
||||
if(is_string($v))
|
||||
{
|
||||
$xml[$k] = $this->CleanString($v, $this->SyntaxByElement($k,'nojs'));
|
||||
}
|
||||
if($lvl < 10)
|
||||
{
|
||||
$this->XMLArray_clean($v, $lvl + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}elseif(is_object($xml))
|
||||
{
|
||||
if(count($xml) > 0)
|
||||
{
|
||||
foreach($xml as $k => $v)
|
||||
{
|
||||
if(count($v) > 0)
|
||||
{
|
||||
if($lvl < 10)
|
||||
{
|
||||
$this->XMLArray_clean($v, $lvl + 1);
|
||||
}
|
||||
}elseif((String)$v != '')
|
||||
{
|
||||
if(isset($xml->$k))
|
||||
{
|
||||
//$xml->$k = $this->CleanString($v, $this->SyntaxByElement($k,'nojs'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $xml;
|
||||
}
|
||||
}
|
||||
|
||||
+18
-151
@@ -2578,19 +2578,11 @@ class YUI {
|
||||
if(CHAR_LENGTH(b.bezeichnung)>" . $this->app->erp->MaxArtikelbezeichnung() . ",CONCAT(SUBSTR(b.bezeichnung,1," . $this->app->erp->MaxArtikelbezeichnung() . "),'...'),b.bezeichnung))
|
||||
) $erweiterte_ansicht)
|
||||
as Artikel,
|
||||
p.abkuerzung as projekt,
|
||||
b.nummer as nummer,
|
||||
DATE_FORMAT(lieferdatum,'%d.%m.%Y') as lieferdatum,
|
||||
trim(b.menge)+0 as menge,
|
||||
".$this->FormatPreis($preiscell)." as preis,
|
||||
b.waehrung,
|
||||
".$this->FormatPreis('b.rabatt')." as rabatt,";
|
||||
|
||||
if ($this->app->erp->RechteVorhanden('auftrag','einkaufspreise')) {
|
||||
$sql .= $this->FormatPreis('einkaufspreis')." as einkaufspreis,
|
||||
CONCAT(".$this->app->erp->FormatPreis("ROUND(deckungsbeitrag*100,2)",2).",'%') AS DB,
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
p.abkuerzung as projekt, b.nummer as nummer, DATE_FORMAT(lieferdatum,'%d.%m.%Y') as lieferdatum, trim(b.menge)+0 as menge, ".$this->FormatPreis($preiscell)." as preis,b.waehrung, ".$this->FormatPreis('b.rabatt')." as rabatt, ";
|
||||
|
||||
|
||||
$sql .= "b.id as id
|
||||
FROM $table b
|
||||
@@ -3622,121 +3614,6 @@ class YUI {
|
||||
'</td></tr></table>')";
|
||||
}
|
||||
|
||||
function IconsSQL_versandpaket() {
|
||||
/*
|
||||
status:
|
||||
neu ->
|
||||
|
||||
Lagergo
|
||||
lagergo_stop
|
||||
lagerstop
|
||||
|
||||
Schein
|
||||
summe_go
|
||||
summe_stop
|
||||
|
||||
Auto
|
||||
liefersperrego
|
||||
liefersperrestop
|
||||
|
||||
marke
|
||||
portogo
|
||||
portostop
|
||||
|
||||
produktion_usn_gut
|
||||
storno*/
|
||||
|
||||
|
||||
$lieferschein_kein = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/summe_stop.png\" title=\"Kein Lieferschein\" border=\"0\" style=\"margin-right:1px\">";
|
||||
$lieferschein_ohne_pos = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/summe_go.png\" title=\"Lieferschein ohne Positionen\" border=\"0\" style=\"margin-right:1px\">";
|
||||
$lieferschein_voll = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/lagergo.png\" title=\"Lieferschein vollständig\" border=\"0\" style=\"margin-right:1px\">";
|
||||
$lieferschein_teil = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/lagergo_teil.png\" title=\"Lieferschein teilweise\" border=\"0\" style=\"margin-right:1px\">";
|
||||
|
||||
$versendet = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/liefersperrego.png\" title=\"Versendet\" border=\"0\" style=\"margin-right:1px\">";
|
||||
$versendet_nicht = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/liefersperrestop.png\" title=\"Nicht versendet\" border=\"0\" style=\"margin-right:1px\">";
|
||||
|
||||
$paketmarke = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/portogo.png\" style=\"margin-right:1px\" title=\"Paketmarke\" border=\"0\">";
|
||||
$paketmarke_keine = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/portostop.png\" style=\"margin-right:1px\" title=\"Keine Paketmarke\" border=\"0\">";
|
||||
|
||||
$ausgeliefert = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delivery_ok.png\" style=\"margin-right:1px\" title=\"Ausgeliefert\" border=\"0\">";
|
||||
$ausgeliefert_nicht = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delivery.png\" style=\"margin-right:1px\" title=\"Nicht ausgeliefert\" border=\"0\">";
|
||||
|
||||
$storno = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/storno.png\" style=\"margin-right:1px\" title=\"Storniert\" border=\"0\">";
|
||||
|
||||
for ($z = 0;$z < 4;$z++) {
|
||||
$abgeschlossen .= $ausgeliefert;
|
||||
$storniert .= $storno;
|
||||
}
|
||||
|
||||
return "CONCAT('<table><tr><td nowrap>',
|
||||
CASE
|
||||
WHEN status = 'storniert' THEN '$storniert'
|
||||
ELSE CONCAT(
|
||||
CASE
|
||||
WHEN lieferscheine <> '' AND vmenge = lmenge THEN '$lieferschein_voll'
|
||||
WHEN lieferschein_ohne_pos <> '' AND vmenge IS NULL THEN '$lieferschein_ohne_pos'
|
||||
WHEN lieferscheine <> '' THEN '$lieferschein_teil'
|
||||
ELSE
|
||||
'$lieferschein_kein'
|
||||
END,
|
||||
CASE
|
||||
WHEN tracking <> '' THEN '$paketmarke'
|
||||
ELSE
|
||||
'$paketmarke_keine'
|
||||
END,
|
||||
CASE
|
||||
WHEN status = 'versendet' THEN '$versendet'
|
||||
WHEN status = 'abgeschlossen' THEN '$versendet'
|
||||
ELSE
|
||||
'$versendet_nicht'
|
||||
END,
|
||||
CASE
|
||||
WHEN status = 'abgeschlossen' THEN '$ausgeliefert'
|
||||
ELSE
|
||||
'$ausgeliefert_nicht'
|
||||
END
|
||||
)
|
||||
END,
|
||||
'</td></tr></table>')";
|
||||
}
|
||||
function IconsSQL_lieferung() {
|
||||
|
||||
$lieferschein_kein = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/lagerstop.png\" title=\"Keine Artikel in Versandpaketen\" border=\"0\" style=\"margin-right:1px\">";
|
||||
$lieferschein_ohne_pos = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/summe_go.png\" title=\"Lieferschein ohne Positionen\" border=\"0\" style=\"margin-right:1px\">";
|
||||
$lieferschein_voll = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/lagergo.png\" title=\"Artikel vollständig in Versandpaketen\" border=\"0\" style=\"margin-right:1px\">";
|
||||
$lieferschein_teil = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/lagergo_stop.png\" title=\"Artikel teilweise in Versandpaketen\" border=\"0\" style=\"margin-right:1px\">";
|
||||
|
||||
$versendet = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/liefersperrego.png\" title=\"Versendet\" border=\"0\" style=\"margin-right:1px\">";
|
||||
$versendet_nicht = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/liefersperrestop.png\" title=\"Nicht versendet\" border=\"0\" style=\"margin-right:1px\">";
|
||||
$versendet_teil = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/liefersperregostop.png\" title=\"Teilweise versendet\" border=\"0\" style=\"margin-right:1px\">";
|
||||
|
||||
$ausgeliefert = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delivery_ok.png\" style=\"margin-right:1px\" title=\"Ausgeliefert\" border=\"0\">";
|
||||
$ausgeliefert_nicht = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delivery.png\" style=\"margin-right:1px\" title=\"Nicht ausgeliefert\" border=\"0\">";
|
||||
$ausgeliefert_teil = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/delivery_pending.png\" style=\"margin-right:1px\" title=\"Teilweise ausgeliefert\" border=\"0\">";
|
||||
|
||||
$storno = "<img src=\"./themes/{$this->app->Conf->WFconf['defaulttheme']}/images/storno.png\" style=\"margin-right:1px\" title=\"Storniert\" border=\"0\">";
|
||||
|
||||
return "CONCAT(
|
||||
'<table><tr><td nowrap>',
|
||||
CASE
|
||||
WHEN vmenge >= lmenge THEN '$lieferschein_voll'
|
||||
WHEN vmenge < lmenge AND vmenge <> 0 THEN '$lieferschein_teil'
|
||||
ELSE '$lieferschein_kein'
|
||||
END,
|
||||
CASE
|
||||
WHEN alle_abgeschlossen THEN '$versendet'
|
||||
WHEN alle_versendet THEN '$versendet'
|
||||
WHEN eins_versendet THEN '$versendet_teil'
|
||||
ELSE '$versendet_nicht'
|
||||
END,
|
||||
CASE
|
||||
WHEN alle_abgeschlossen THEN '$ausgeliefert'
|
||||
WHEN eins_abgeschlossen THEN '$ausgeliefert_teil'
|
||||
ELSE '$ausgeliefert_nicht'
|
||||
END,
|
||||
'</td></tr></table>')";
|
||||
}
|
||||
|
||||
function TablePositionSearch($parsetarget, $name, $callback = "show", $gener) {
|
||||
|
||||
$id = $this->app->Secure->GetGET("id");
|
||||
@@ -5825,8 +5702,12 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
||||
}
|
||||
}
|
||||
// Fester filter
|
||||
$more_data6 = $this->app->Secure->GetGET("more_data6");
|
||||
$more_data7 = $this->app->Secure->GetGET("more_data7");
|
||||
$more_data8 = $this->app->Secure->GetGET("more_data8");
|
||||
|
||||
$more_data4 = $this->app->Secure->GetGET("more_data4");
|
||||
/*
|
||||
|
||||
$versandjoin = "";
|
||||
if(isset($parameter['offenversandzentrum']) && !empty($parameter['offenversandzentrum']))
|
||||
{
|
||||
@@ -5860,8 +5741,8 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
||||
}
|
||||
|
||||
if($versandjoin)$sql .= $versandjoin;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
if($more_data4 || (isset($parameter['ohnerechnung']) && !empty($parameter['ohnerechnung']))) {
|
||||
|
||||
$paramsArray[] = " l.status !='storniert' ";
|
||||
@@ -5936,21 +5817,6 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
||||
if ($more_data3 == 1) $subwhere[] = " l.lieferantenretoure=1 ";
|
||||
|
||||
// ENDE EXTRA more
|
||||
$more_data6 = $this->app->Secure->GetGET("more_data6");
|
||||
$more_data7 = $this->app->Secure->GetGET("more_data7");
|
||||
$more_data8 = $this->app->Secure->GetGET("more_data8");
|
||||
|
||||
if ($more_data6) {
|
||||
$subwhere[] = "l.versand_status = 3";
|
||||
}
|
||||
if ($more_data7) {
|
||||
$subwhere[] = "l.versand_status = 1";
|
||||
}
|
||||
if ($more_data8) {
|
||||
$subwhere[] = "l.versand_status IN (2,3)";
|
||||
}
|
||||
|
||||
|
||||
for ($j = 0;$j < (empty($subwhere)?0:count($subwhere));$j++) $tmp.= " AND " . $subwhere[$j];
|
||||
$where = " l.id!='' AND l.status!='angelegt' $tmp " . $this->app->erp->ProjektRechte('p.id', true, 'l.vertriebid');
|
||||
|
||||
@@ -12242,6 +12108,9 @@ url:strUrl, success:function(html){strReturn = html;}, async:false
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table></div>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
');
|
||||
|
||||
if((empty($disableautosavefilter)) && $this->anzusersaves < 2) {
|
||||
@@ -14726,7 +14595,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">', '[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) {
|
||||
@@ -14889,11 +14758,9 @@ source: "index.php?module=ajax&action=filter&filtername=' . $filter . $extendurl
|
||||
}
|
||||
$table->headings[6] = 'Preis';
|
||||
$mengencol = 5;
|
||||
if ($module == "angebot" || $module == "auftrag" || $module == "rechnung" || $module == "gutschrift") {
|
||||
$table->headings[7] = 'Währung';
|
||||
$table->headings[8] = 'Rabatt';
|
||||
$rabattcol = 8;
|
||||
}
|
||||
if ($module == "angebot" || $module == "auftrag" || $module == "rechnung" || $module == "gutschrift") $table->headings[7] = 'Währung';
|
||||
if ($module == "angebot" || $module == "auftrag" || $module == "rechnung" || $module == "gutschrift") $table->headings[8] = 'Rabatt';
|
||||
if ($module == "angebot" || $module == "auftrag" || $module == "rechnung" || $module == "gutschrift") $rabattcol = 8;
|
||||
}
|
||||
$__arr = array($summencol, $mengencol, $rabattcol, $ecol, $dcol,$zwischensumme);
|
||||
$this->app->erp->RunHook('yui_sortlistadd_draw', 2,$table,$__arr);
|
||||
|
||||
@@ -42,11 +42,7 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
$defaultorder = 1;
|
||||
$defaultorderdesc = 0;
|
||||
|
||||
$dropnbox = "PLACEHOLDER_DROPNBOX";
|
||||
|
||||
// $moreinfo = true; // Allow drop down details
|
||||
// $moreinfoaction = "lieferschein"; // specify suffix for minidetail-URL to allow different minidetails
|
||||
// $menucol = 11; // Set id col for moredata/menu
|
||||
$dropnbox = "PLACEHOLDER_DROPNBOX";
|
||||
|
||||
$menu = "<table cellpadding=0 cellspacing=0><tr><td nowrap>" . "<a href=\"index.php?module=PLACEHOLDER_MODULENAME&action=edit&id=%value%\"><img src=\"./themes/{$app->Conf->WFconf['defaulttheme']}/images/edit.svg\" border=\"0\"></a> <a href=\"#\" onclick=DeleteDialog(\"index.php?module=PLACEHOLDER_MODULENAME&action=delete&id=%value%\");>" . "<img src=\"themes/{$app->Conf->WFconf['defaulttheme']}/images/delete.svg\" border=\"0\"></a>" . "</td></tr></table>";
|
||||
|
||||
@@ -122,8 +118,6 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
|
||||
// Add checks here
|
||||
|
||||
// $input['projekt'] = $this->app->erp->ReplaceProjekt(true,$input['projekt'],true); // Parameters: Target db?, value, from form?
|
||||
|
||||
$columns = "id, ";
|
||||
$values = "$id, ";
|
||||
$update = "";
|
||||
@@ -172,9 +166,6 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
$this->app->Tpl->Add('KURZUEBERSCHRIFT2', $email);
|
||||
$this->app->Tpl->Add('EMAIL', $email);
|
||||
$this->app->Tpl->Add('ANGEZEIGTERNAME', $angezeigtername);
|
||||
|
||||
$this->app->YUI->AutoComplete("artikel", "artikelnummer");
|
||||
|
||||
*/
|
||||
|
||||
// $this->SetInput($input);
|
||||
@@ -192,4 +183,14 @@ class PLACEHOLDER_MODULECLASSNAME {
|
||||
|
||||
return $input;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set all fields in the page corresponding to $input
|
||||
*/
|
||||
function SetInput($input) {
|
||||
// $this->app->Tpl->Set('EMAIL', $input['email']);
|
||||
|
||||
PLACEHOLDER_SET_INPUT
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57169,17 +57169,6 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "versand_status",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "0",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
@@ -64796,17 +64785,6 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "vorlaeufig",
|
||||
"Type": "int(1)",
|
||||
"Collation": null,
|
||||
"Null": "YES",
|
||||
"Key": "",
|
||||
"Default": "",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
@@ -112673,76 +112651,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "versandpaket_lieferschein_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": "versandpaket",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "lieferschein_position",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "menge",
|
||||
"Type": "decimal(14,4)",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
{
|
||||
"Key_name": "PRIMARY",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"id"
|
||||
],
|
||||
"Non_unique": ""
|
||||
},
|
||||
{
|
||||
"Key_name": "versandpaket_lieferschein_position",
|
||||
"Index_type": "BTREE",
|
||||
"columns": [
|
||||
"versandpaket",
|
||||
"lieferschein_position"
|
||||
],
|
||||
"Non_unique": "UNIQUE"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "versandarten",
|
||||
"collation": "utf8mb3_general_ci",
|
||||
@@ -112930,17 +112838,6 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "datum",
|
||||
"Type": "datetime",
|
||||
"Collation": null,
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "current_timestamp()",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "versand",
|
||||
"Type": "int(11)",
|
||||
@@ -112963,28 +112860,6 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "versandart",
|
||||
"Type": "varchar(64)",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "lieferschein_ohne_pos",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "YES",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "tracking",
|
||||
"Type": "varchar(255)",
|
||||
@@ -112996,17 +112871,6 @@
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "tracking_link",
|
||||
"Type": "text",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": "",
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "versender",
|
||||
"Type": "varchar(255)",
|
||||
@@ -113039,28 +112903,6 @@
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "status",
|
||||
"Type": "varchar(64)",
|
||||
"Collation": "utf8mb3_general_ci",
|
||||
"Null": "NO",
|
||||
"Key": "",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
},
|
||||
{
|
||||
"Field": "usereditid",
|
||||
"Type": "int(11)",
|
||||
"Collation": null,
|
||||
"Null": "YES",
|
||||
"Key": "MUL",
|
||||
"Default": null,
|
||||
"Extra": "",
|
||||
"Privileges": "select,insert,update,references",
|
||||
"Comment": ""
|
||||
}
|
||||
],
|
||||
"keys": [
|
||||
|
||||
+1476
-41
File diff suppressed because it is too large
Load Diff
@@ -75,8 +75,7 @@ abstract class Versanddienstleister
|
||||
$ret['lieferscheinId'] = $lieferscheinId;
|
||||
|
||||
$addressfields = ['name', 'adresszusatz', 'abteilung', 'ansprechpartner', 'unterabteilung', 'ort', 'plz',
|
||||
'strasse', 'land'];
|
||||
|
||||
'strasse', 'land'];
|
||||
$ret['original'] = array_filter($docArr, fn($key) => in_array($key, $addressfields), ARRAY_FILTER_USE_KEY);
|
||||
|
||||
$ret['name'] = empty(trim($docArr['ansprechpartner'])) ? trim($docArr['name']) : trim($docArr['ansprechpartner']);
|
||||
@@ -128,7 +127,7 @@ abstract class Versanddienstleister
|
||||
if (!empty($docArr['ihrebestellnummer'])) {
|
||||
$orderNumberParts[] = $docArr['ihrebestellnummer'];
|
||||
}
|
||||
$orderNumberParts[] = ucfirst($sid)." ".$docArr['belegnr'];
|
||||
$orderNumberParts[] = $docArr['belegnr'];
|
||||
$ret['order_number'] = implode(' / ', $orderNumberParts);
|
||||
}
|
||||
|
||||
@@ -370,7 +369,7 @@ abstract class Versanddienstleister
|
||||
return true;
|
||||
}
|
||||
|
||||
public function Paketmarke(string $target, string $docType, int $docId, $versandpaket = null): void
|
||||
public function Paketmarke(string $target, string $docType, int $docId): void
|
||||
{
|
||||
$address = $this->GetAdressdaten($docId, $docType);
|
||||
if (isset($_SERVER['CONTENT_TYPE']) && ($_SERVER['CONTENT_TYPE'] === 'application/json')) {
|
||||
@@ -379,65 +378,25 @@ abstract class Versanddienstleister
|
||||
if ($json->submit == 'print') {
|
||||
$result = $this->CreateShipment($json, $address);
|
||||
if ($result->Success) {
|
||||
if (empty($versandpaket)) {
|
||||
$sql = "INSERT INTO versandpakete
|
||||
(
|
||||
lieferschein_ohne_pos,
|
||||
gewicht,
|
||||
tracking,
|
||||
tracking_link,
|
||||
status,
|
||||
versandart,
|
||||
versender
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
{$address['lieferscheinId']},
|
||||
'$json->weight',
|
||||
'$result->TrackingNumber',
|
||||
'$result->TrackingUrl',
|
||||
'neu',
|
||||
'$this->type',
|
||||
'".$this->app->User->GetName()."'
|
||||
)";
|
||||
$this->app->DB->Insert($sql);
|
||||
$versandpaket = $this->app->DB->GetInsertID();
|
||||
}
|
||||
else {
|
||||
$sql = "UPDATE versandpakete SET
|
||||
gewicht = '".$json->weight."',
|
||||
tracking = '".$result->TrackingNumber."',
|
||||
tracking_link = '".$result->TrackingUrl."'
|
||||
WHERE id = '".$versandpaket."'
|
||||
";
|
||||
$this->app->DB->Update($sql);
|
||||
}
|
||||
$sql = "INSERT INTO versand
|
||||
(adresse, lieferschein, versandunternehmen, gewicht, tracking, tracking_link, anzahlpakete)
|
||||
VALUES
|
||||
({$address['addressId']}, {$address['lieferscheinId']}, '$this->type',
|
||||
'$json->weight', '$result->TrackingNumber', '$result->TrackingUrl', 1)";
|
||||
$this->app->DB->Insert($sql);
|
||||
|
||||
$filename = join('_', [$this->type, 'Label', $result->TrackingNumber]) . '.pdf';
|
||||
$filefullpath = $this->app->erp->GetTMP() . $filename;
|
||||
file_put_contents($filefullpath, $result->Label);
|
||||
$this->app->erp->CreateDateiWithStichwort(
|
||||
$filename,
|
||||
'Paketmarke '.$this->type.' '.$result->TrackingNumber,
|
||||
'Paketmarke Versandpaket Nr. '.$versandpaket,
|
||||
'',
|
||||
$filefullpath,
|
||||
$this->app->User->GetName(),
|
||||
'paketmarke',
|
||||
'versandpaket',
|
||||
$versandpaket
|
||||
);
|
||||
$filename = $this->app->erp->GetTMP() . join('_', [$this->type, 'Label', $result->TrackingNumber]) . '.pdf';
|
||||
file_put_contents($filename, $result->Label);
|
||||
$this->app->printer->Drucken($this->labelPrinterId, $filename);
|
||||
|
||||
$this->app->printer->Drucken($this->labelPrinterId, $filefullpath);
|
||||
|
||||
if (isset($result->ExportDocuments)) {
|
||||
$filefullpath = $this->app->erp->GetTMP() . join('_', [$this->type, 'ExportDoc', $result->TrackingNumber]) . '.pdf';
|
||||
file_put_contents($filefullpath, $result->ExportDocuments);
|
||||
$this->app->printer->Drucken($this->documentPrinterId, $filefullpath);
|
||||
}
|
||||
$ret['messages'][] = ['class' => 'info', 'text' => "Paketmarke wurde erfolgreich erstellt: $result->TrackingNumber"];
|
||||
if (isset($result->ExportDocuments)) {
|
||||
$filename = $this->app->erp->GetTMP() . join('_', [$this->type, 'ExportDoc', $result->TrackingNumber]) . '.pdf';
|
||||
file_put_contents($filename, $result->ExportDocuments);
|
||||
$this->app->printer->Drucken($this->documentPrinterId, $filename);
|
||||
}
|
||||
$ret['messages'][] = ['class' => 'info', 'text' => "Paketmarke wurde erfolgreich erstellt: $result->TrackingNumber"];
|
||||
} else {
|
||||
$ret['messages'] = array_map(fn(string $item) => ['class' => 'error', 'text' => $item], array_unique($result->Errors));
|
||||
$ret['messages'] = array_map(fn(string $item) => ['class' => 'error', 'text' => $item], array_unique($result->Errors));
|
||||
}
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
@@ -451,12 +410,7 @@ abstract class Versanddienstleister
|
||||
$address['product'] = $products[0]->Id ?? '';
|
||||
|
||||
$countries = $this->app->DB->SelectArr("SELECT iso, bezeichnung_de name, eu FROM laender ORDER BY bezeichnung_de");
|
||||
if(!empty($countries)) {
|
||||
$countries = array_combine(array_column($countries, 'iso'), $countries);
|
||||
} else {
|
||||
$countries = Array();
|
||||
$this->app->Tpl->addMessage('error', 'Länderliste ist leer. Siehe Einstellungen -> Länderliste.', false, 'PAGE');
|
||||
}
|
||||
$countries = array_combine(array_column($countries, 'iso'), $countries);
|
||||
|
||||
$json['form'] = $address;
|
||||
$json['countries'] = $countries;
|
||||
|
||||
@@ -137,7 +137,7 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
<h2>{|Paket|}</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td>{|Gewicht (in kg)</b>|}:</td>
|
||||
<td>{|Gewicht (in kg)|}:</td>
|
||||
<td><input type="text" v-model.number="form.weight"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -157,7 +157,7 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
<td>
|
||||
<select v-model="form.product" required>
|
||||
<option v-for="prod in products" :value="prod.Id" v-if="productAvailable(prod)">{{prod.Name}}</option>
|
||||
</select><i>Für Produktwahl Gewicht eingeben!</i>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="serviceAvailable('premium')">
|
||||
@@ -168,11 +168,11 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="col-md-12">
|
||||
<h2>{|Sonstiges|}</h2>
|
||||
<h2>{|Bestellung|}</h2>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{|Referenzen|}:</td>
|
||||
<td>{|Bestellnummer|}:</td>
|
||||
<td><input type="text" size="36" v-model="form.order_number"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -300,4 +300,4 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</script>
|
||||
+4
-10
@@ -1597,17 +1597,11 @@ select a.kundennummer, (SELECT name FROM adresse a2 WHERE a2.kundennummer = a.ku
|
||||
if($artikel_freitext1_suche)
|
||||
{
|
||||
$felder[] = 'art.freifeld1';
|
||||
} else {
|
||||
$artikel_freitext1_suche = 'true';
|
||||
}
|
||||
$subwhere = $this->AjaxFilterWhere($termorig,$felder);
|
||||
$sql = "SELECT CONCAT(art.nummer,' ',art.name_de) as name FROM artikel art
|
||||
$subwhere = $this->AjaxFilterWhere($termorig,$felder);
|
||||
$arr = $this->app->DB->SelectArr("SELECT CONCAT(art.nummer,' ',art.name_de) as name FROM artikel art
|
||||
INNER JOIN $doctype"."_position ap ON ap.artikel = art.id AND $doctype = '$doctypeid'
|
||||
WHERE
|
||||
art.geloescht=0 AND ($artikel_freitext1_suche) AND art.geloescht=0 AND art.intern_gesperrt!=1 AND
|
||||
(name_de LIKE '%$term%' OR art.nummer LIKE '%$term%')
|
||||
LIMIT 20";
|
||||
$arr = $this->app->DB->SelectArr($sql);
|
||||
WHERE art.geloescht=0 AND ($artikel_freitext1_suche) AND art.geloescht=0 AND art.intern_gesperrt!=1 LIMIT 20");
|
||||
$carr = !empty($arr)?count($arr):0;
|
||||
for($i = 0; $i < $carr; $i++) {
|
||||
$newarr[] = $arr[$i]['name'];
|
||||
@@ -2485,7 +2479,7 @@ select a.kundennummer, (SELECT name FROM adresse a2 WHERE a2.kundennummer = a.ku
|
||||
$adresse = $this->app->DB->Select("SELECT id FROM adresse WHERE kundennummer = '".$kunde[0]."' AND kundennummer <> '' LIMIT 1");
|
||||
}
|
||||
$beleg = str_replace('kunden','',$filtername);
|
||||
$arr = $this->app->DB->SelectArr("SELECT CONCAT(belegnr,' ',kundennummer,' ',name) as name FROM $beleg WHERE (belegnr <> '') AND (belegnr LIKE '%$term%' OR name LIKE '%$term%' OR kundennummer LIKE '$%term%') AND (status IN ('angelegt','freigegeben','versendet'))
|
||||
$arr = $this->app->DB->SelectArr("SELECT CONCAT(id,' ',if(belegnr <> '',belegnr,'ENTWURF'),' ',kundennummer,' ',name) as name FROM $beleg WHERE (belegnr LIKE '%$term%' OR name LIKE '%$term%' OR kundennummer LIKE '$%term%') AND (status = 'angelegt' OR status = 'freigegeben')
|
||||
".($adresse?" AND adresse = '$adresse' ":'')." ".$this->app->erp->ProjektRechte('projekt')."
|
||||
ORDER by belegnr LIMIT 20");
|
||||
$carr = !empty($arr)?count($arr):0;
|
||||
|
||||
+7
-93
@@ -1990,52 +1990,8 @@ class Auftrag extends GenAuftrag
|
||||
$gebuchtezeit = str_replace(".", ",", round($gebuchtezeit,2));
|
||||
}
|
||||
$summebrutto = $this->app->DB->Select("SELECT gesamtsumme FROM auftrag WHERE id='$id' LIMIT 1");
|
||||
|
||||
// Deckungsbeitrag
|
||||
if (!$this->app->erp->RechteVorhanden('auftrag','einkaufspreise')) {
|
||||
$this->app->Tpl->Set('DBHIDDEN','hidden');
|
||||
} else {
|
||||
$sql = "
|
||||
SELECT
|
||||
umsatz_netto_gesamt,
|
||||
artikel,
|
||||
menge,
|
||||
einkaufspreis
|
||||
FROM
|
||||
`auftrag_position`
|
||||
WHERE
|
||||
`auftrag` = ".$id."
|
||||
";
|
||||
|
||||
$positionen = $this->app->DB->SelectArr($sql);
|
||||
|
||||
$umsatz_gesamt = 0;
|
||||
$kosten_gesamt = 0;
|
||||
$db_gesamt = 0;
|
||||
foreach ($positionen as $position) {
|
||||
if (empty($position['einkaufspreis'])) {
|
||||
$position['einkaufspreis'] = $this->app->erp->GetEinkaufspreis($position['artikel'],$position['menge']);
|
||||
}
|
||||
$kosten = ($position['einkaufspreis']*$position['menge']);
|
||||
$db_gesamt += $position['umsatz_netto_gesamt']-$kosten;
|
||||
$kosten_gesamt += $kosten;
|
||||
$umsatz_gesamt += $position['umsatz_netto_gesamt'];
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('NETTOGESAMT',$this->app->erp->number_format_variable($umsatz_gesamt,2));
|
||||
$this->app->Tpl->Set('KOSTEN',$this->app->erp->number_format_variable($kosten_gesamt,2));
|
||||
$this->app->Tpl->Set('DECKUNGSBEITRAG',$this->app->erp->number_format_variable($db_gesamt,2));
|
||||
$this->app->Tpl->Set( 'DBPROZENT',
|
||||
$umsatz_gesamt==0?
|
||||
"-":
|
||||
$this->app->erp->number_format_variable(
|
||||
round(
|
||||
$db_gesamt/$umsatz_gesamt*100,2
|
||||
)
|
||||
)."%"
|
||||
);
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('DECKUNGSBEITRAG',0);
|
||||
$this->app->Tpl->Set('DBPROZENT',0);
|
||||
$this->app->Tpl->Set('GEBUCHTEZEIT',0);
|
||||
|
||||
if($auftragArr[0]['ust_befreit']==0){
|
||||
@@ -2314,7 +2270,7 @@ class Auftrag extends GenAuftrag
|
||||
}
|
||||
$this->app->Tpl->Set('PREISANFRAGE', implode('<br />', $priceRequestsHtml));
|
||||
}
|
||||
/*
|
||||
|
||||
$tmpVersand = !$hasDeliveryNotes?[]: $this->app->DB->SelectFirstCols(
|
||||
"SELECT if(v.versendet_am!='0000-00-00',
|
||||
CONCAT(DATE_FORMAT( v.versendet_am,'%d.%m.%Y'),' ',v.versandunternehmen),
|
||||
@@ -2397,39 +2353,6 @@ class Auftrag extends GenAuftrag
|
||||
else {
|
||||
$this->app->Tpl->Set('TRACKING',$tmpVersand);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS
|
||||
v.id,
|
||||
v.tracking as tracking,
|
||||
v.tracking_link
|
||||
FROM
|
||||
versandpakete v
|
||||
LEFT JOIN
|
||||
versandpaket_lieferschein_position vlp ON v.id = vlp.versandpaket
|
||||
LEFT JOIN
|
||||
lieferschein_position lp ON lp.id = vlp.lieferschein_position
|
||||
LEFT JOIN
|
||||
lieferschein l ON lp.lieferschein = l.id
|
||||
LEFT JOIN
|
||||
lieferschein lop ON lop.id = v.lieferschein_ohne_pos
|
||||
WHERE
|
||||
l.auftragid = ".$id." OR lop.auftragid = ".$id."
|
||||
GROUP BY
|
||||
v.id
|
||||
";
|
||||
$tracking = $this->app->DB->SelectArr($sql);
|
||||
|
||||
$tracking_list = array();
|
||||
foreach ($tracking as $single_tracking) {
|
||||
$tracking_list[] = '<a href="index.php?module=versandpakete&action=edit&id='.$single_tracking['id'].'">Paket Nr.'.$single_tracking['id'].'</a>'.
|
||||
' ('.'<a href="'.$single_tracking['tracking_link'].'">'.$single_tracking['tracking'].'</a>'.')';
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('TRACKING',implode('<br>',$tracking_list));
|
||||
|
||||
|
||||
|
||||
|
||||
$icons = $this->app->YUI->IconsSQL();
|
||||
@@ -4993,10 +4916,6 @@ class Auftrag extends GenAuftrag
|
||||
$this->app->erp->AdresseAlsLieferadresseButton($adresse);
|
||||
}
|
||||
|
||||
if ($schreibschutz != 1 AND $status != 'abgeschlossen') {
|
||||
$this->app->erp->BerechneDeckungsbeitrag($id,'auftrag');
|
||||
}
|
||||
|
||||
if($nummer!='') {
|
||||
$this->app->Tpl->Set('NUMMER',$nummer);
|
||||
if($this->app->erp->RechteVorhanden('adresse','edit')){
|
||||
@@ -5775,13 +5694,8 @@ Die Gesamtsumme stimmt nicht mehr mit ursprünglich festgelegten Betrag '.
|
||||
}
|
||||
|
||||
$this->app->DB->Update("UPDATE lieferschein SET
|
||||
belegnr='$ls_belegnr',
|
||||
status='freigegeben',
|
||||
versand='".$this->app->User->GetDescription()."',
|
||||
versand_status = 1
|
||||
WHERE id='$lieferschein' LIMIT 1");
|
||||
|
||||
// Versand_status: 1 = process in versandpakete, 2 = finished, 3 = finished manually
|
||||
belegnr='$ls_belegnr', status='freigegeben', versand='".$this->app->User->GetDescription()."'
|
||||
WHERE id='$lieferschein' LIMIT 1");
|
||||
|
||||
$this->app->erp->LieferscheinProtokoll($lieferschein, 'Lieferschein freigegeben');
|
||||
|
||||
@@ -6428,7 +6342,7 @@ Die Gesamtsumme stimmt nicht mehr mit ursprünglich festgelegten Betrag '.
|
||||
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=list','Übersicht');
|
||||
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=create','Neuen Auftrag anlegen');
|
||||
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=offene','Offene Positionen');
|
||||
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=versandzentrum','Versandübergabe');
|
||||
$this->app->erp->MenuEintrag('index.php?module=auftrag&action=versandzentrum','Versandzentrum');
|
||||
|
||||
if(strlen($backurl)>5){
|
||||
$this->app->erp->MenuEintrag("$backurl", 'Zurück zur Übersicht');
|
||||
@@ -6473,7 +6387,7 @@ Die Gesamtsumme stimmt nicht mehr mit ursprünglich festgelegten Betrag '.
|
||||
$this->AuftraguebersichtMenu();
|
||||
$targetMessage = 'AUTOVERSANDBERECHNEN';
|
||||
|
||||
$this->app->Tpl->Add('MESSAGE','<div class="info">Aufträge an Versand übergeben mit automatischem Druck und Mailversand. <a class="button" href="index.php?module=versandpakete&action=lieferungen">Zum Versand</a></div>');
|
||||
$this->app->Tpl->Add('MESSAGE','<div class="info">Aufträge an Versand übergeben mit automatischem Druck und Mailversand.</div>');
|
||||
|
||||
$autoshipmentEnabled = true;
|
||||
$this->app->erp->RunHook('OrderAutoShipment', 2, $targetMessage, $autoshipmentEnabled);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<tr><td class="auftraginfo_cell">{|Bestellung|}:</td><td class="auftraginfo_cell" >[BESTELLUNG]</td><td class="auftraginfo_cell">{|Eigene Umsatzsteuer ID|}:</td><td class="auftraginfo_cell">[DELIVERYTHRESHOLDVATID]</td></tr>
|
||||
<tr><td class="auftraginfo_cell">{|Retoure|}:</td><td class="auftraginfo_cell" >[RETOURE]</td><td class="auftraginfo_cell"></td><td class="auftraginfo_cell"></td></tr>
|
||||
<tr><td class="auftraginfo_cell">{|Preisanfrage|}:</td><td class="auftraginfo_cell" >[PREISANFRAGE]</td><td class="auftraginfo_cell"></td><td class="auftraginfo_cell"></td></tr>
|
||||
<tr><td class="auftraginfo_cell">{|Pakete|}:</td><td class="auftraginfo_cell" >[TRACKING]</td><td class="auftraginfo_cell"></td><td class="auftraginfo_cell"></td></tr>
|
||||
<tr><td class="auftraginfo_cell">{|Tracking|}:</td><td class="auftraginfo_cell" >[TRACKING]</td><td class="auftraginfo_cell"></td><td class="auftraginfo_cell"></td></tr>
|
||||
</table>
|
||||
|
||||
<table width="100%">
|
||||
@@ -48,14 +48,19 @@
|
||||
<td style="" width="50%">[VERSANDTEXT]</td>
|
||||
[RMAENDIF]
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<div style="background-color:white">
|
||||
<div style="padding:10px">
|
||||
[RECHNUNGLIEFERADRESSE]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div style="float:left; width:50%">
|
||||
|
||||
<div style="overflow:auto;max-height:550px;">
|
||||
<div style="background-color:white;">
|
||||
<h2 class="greyh2">Artikel</h2>
|
||||
@@ -64,55 +69,63 @@
|
||||
<i style="color:#999">* Die linke Zahl zeigt die für den Kunden reservierten Einheiten und die rechte Zahl die global reservierte Anzahl.</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
[MINIDETAILNACHARTIKEL]
|
||||
<div style="background-color:white" [DBHIDDEN]>
|
||||
<h2 class="greyh2">{|Deckungsbeitrag (netto)|}</h2>
|
||||
<table width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Umsatz EUR</td>
|
||||
<td>Kosten EUR</td>
|
||||
<td>Deckungsbeitrag EUR</td>
|
||||
<td>DB %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="greybox" width="25%">[NETTOGESAMT]</td>
|
||||
<td class="greybox" width="25%">[KOSTEN]</td>
|
||||
<td class="greybox" width="25%">[DECKUNGSBEITRAG]</td>
|
||||
<td class="greybox" width="25%">[DBPROZENT]</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!--
|
||||
<div style="background-color:white;">
|
||||
<h2 class="greyh2">Lieferkette</h2>
|
||||
<div style="padding:10px">
|
||||
<table class="mkTable">
|
||||
<tr><th>Art</th><th>Beleg</th><th>Datum</th><th>Lieferant</th><th>Status</th></tr>
|
||||
<tr><td>Bestellung</td><td>ENTWURF</td><td></td><td>In-Circuit<br>200 x 777777 SMT USBprog 1)</td><td>-</td></tr>
|
||||
<tr><td>Anlieferung</td><td>200000</td><td></td><td>In-Circuit<br>200 x 777777 ATMEGA32</td><td>offen</td></tr>
|
||||
<tr><td>Bestellung</td><td>100023</td><td></td><td>Instanet<br>200 x USBprog 5.0 Spezial Elektor<br>200 x 777777 Flashen + Montieren</td><td>offen</td></tr>
|
||||
<tr><td>Anlieferung</td><td>200002</td><td></td><td>Instanet<br>200 x 777777 SMT USBprog 1)<br>200 x 122222 Gehäuse</td><td>offen</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div style="background-color:white">
|
||||
<h2 class="greyh2">{|Zahlungen|}</h2>
|
||||
<div style="padding:10px">
|
||||
[ZAHLUNGEN]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="background-color:white">
|
||||
<h2 class="greyh2">{|Protokoll|}</h2>
|
||||
<div style="padding:10px;">
|
||||
[PROTOKOLL]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
[VORPRODUKTIONPROTOKOLL]
|
||||
[PRODUKTIONPROTOKOLL]
|
||||
[NACHPRODUKTIONPROTOKOLL]
|
||||
<!--
|
||||
|
||||
<div style="background-color:white">
|
||||
<h2 class="greyh2">{|RMA Prozess|}</h2>
|
||||
<div style="padding:10px">
|
||||
[RMA]
|
||||
</div>
|
||||
<h2 class="greyh2">{|RMA Prozess|}</h2>
|
||||
<div style="padding:10px">
|
||||
[RMA]
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div style="background-color:white">
|
||||
<h2 class="greyh2">{|PDF-Archiv|}</h2>
|
||||
<div style="padding:10px;overflow:auto;">
|
||||
[PDFARCHIV]
|
||||
</div>
|
||||
</div>
|
||||
<div style="background-color:white">
|
||||
<h2 class="greyh2">{|Deckungsbeitrag|}</h2>
|
||||
<div style="padding:10px">
|
||||
|
||||
<div class="info">{|Dieses Modul ist erst ab Version Professional verfügbar|}</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
[INTERNEBEMERKUNGEDIT]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
<li>{|Stornierung|} <i>{|Variablen|}: {AUFTRAG}, {DATUM}, {INTERNET}</i></li>
|
||||
<li>{|ZahlungMiss|} <i>{|Variablen|}: {AUFTRAG}, {DATUM}, {GESAMT}, {REST}, {ANSCHREIBEN}, {INTERNET}</i></li>
|
||||
<li>Mahnung <i>Variablen: {BELEGNR}, {DATUM}, {OFFEN}, {MAHNGEBUEHR}, {HEUTE}</i></li>
|
||||
<li>{|Versand|} <i>{|Variablen|}: {VERSAND}, {VERSANDTYPE}, {VERSANDBEZEICHNUNG}, {TRACKINGNUMMER}, {TRACKINGLINK}, {NAME}, {ANSCHREIBEN}, {BELEGNR}, {IHREBESTELLNUMMER}, {INTERNET}, {AUFTRAGDATUM}, {LIEFERADRESSE}, {LIEFERADRESSELANG}</i></li>
|
||||
<li>{|Versand|} <i>{|Variablen|}: {VERSAND}, {VERSANDTYPE}, {VERSANDBEZEICHNUNG}, {TRACKINGNUMMER}, {NAME}, {ANSCHREIBEN}, {BELEGNR}, {IHREBESTELLNUMMER}, {INTERNET}, {AUFTRAGDATUM}, {LIEFERADRESSE}, {LIEFERADRESSELANG}</i></li>
|
||||
<li>{|VersandMailDokumente|} <i>{|Variablen|}: {NAME}, {ANSCHREIBEN}, {BELEGNR}, {IHREBESTELLNUMMER}, {INTERNET}, {AUFTRAGDATUM}</i></li>
|
||||
<li>{|Erweiterte Freigabe|} <i>{|Variablen|}: {REQUESTER}, {LINK}, {LINKFREIGABEUEBERSICHT}, {DOCTYPE}, {DOCTYPE_ID}</i></li>
|
||||
<li>{|Selbstabholer|}</li>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<tr><td class="auftraginfo_cell">Projekt:</td><td class="auftraginfo_cell">[PROJEKT]</td><td class="auftraginfo_cell">Angebotssumme:</td><td class="auftraginfo_cell">[GESAMTSUMME]</td></tr>
|
||||
<tr><td class="auftraginfo_cell">Auftrag:</td><td class="auftraginfo_cell">[AUFTRAG]</td><td class="auftraginfo_cell">Versteuerung:</td><td class="auftraginfo_cell">[STEUER]</td></tr>
|
||||
<tr><td class="auftraginfo_cell">Rechnung:</td><td class="auftraginfo_cell">[RECHNUNG]</td><td class="auftraginfo_cell">Gewicht (netto):</td><td class="auftraginfo_cell">[GEWICHT]</td></tr>
|
||||
<tr><td class="auftraginfo_cell">Pakete:</td><td class="auftraginfo_cell">[TRACKING]</td><td class="auftraginfo_cell">Versandart:</td><td class="auftraginfo_cell">[VERSANDART]</td></tr>
|
||||
<tr><td class="auftraginfo_cell">Tracking:</td><td class="auftraginfo_cell">[TRACKING]</td><td class="auftraginfo_cell">Versandart:</td><td class="auftraginfo_cell">[VERSANDART]</td></tr>
|
||||
<tr><td class="auftraginfo_cell">Retoure:</td><td class="auftraginfo_cell">[RETOURE]</td><td class="auftraginfo_cell"></td><td class="auftraginfo_cell"></td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -17,6 +17,33 @@
|
||||
<li class="filter-item"><input type="checkbox" id="anlieferanten"><label for="anlieferanten">{|an Lieferanten|}</label></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="filter-block filter-inline">
|
||||
<div class="filter-title">{|Filter Versandzentrum|}</div>
|
||||
<ul class="filter-list">
|
||||
<li class="filter-item">
|
||||
<label for="abgeschlossenlogistik" class="switch">
|
||||
<input type="checkbox" id="abgeschlossenlogistik">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="abgeschlossenlogistik">{|abgeschlossen über Logistik|}</label>
|
||||
</li>
|
||||
<li class="filter-item">
|
||||
<label for="nochinlogistik" class="switch">
|
||||
<input type="checkbox" id="nochinlogistik">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="nochinlogistik">{|noch in Logistik|}</label>
|
||||
</li>
|
||||
<li class="filter-item">
|
||||
<label for="manuellabgeschlossen" class="switch">
|
||||
<input type="checkbox" id="manuellabgeschlossen">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="manuellabgeschlossen">{|manuell abgeschlossen|}</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
[MESSAGE]
|
||||
@@ -29,7 +56,6 @@
|
||||
<option value="offen">{|als offen markieren|}</option>
|
||||
<option value="versendet">{|als versendet markieren|}</option>
|
||||
<option value="storniert">{|als storniert markieren|}</option>
|
||||
<option value="versanduebergabe">{|in Versand geben|}</option>
|
||||
<option value="pdf">{|Sammel-PDF|}</option>
|
||||
<option value="drucken">{|drucken|}</option>
|
||||
</select> {|Drucker|}: <select name="seldrucker">[SELDRUCKER]</select> <input type="submit" class="btnBlue" name="ausfuehren" value="{|ausführen|}" />
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<fieldset>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<legend>{|[STATUSICON]<b>Ticket <font color="blue">#[SCHLUESSEL]</font></b>|}</legend>
|
||||
<tr><td>{|Betreff|}:</td><td><input type="text" name="betreff" id="betreff" value="[BETREFF]" style="width: 100%;"></td></tr>
|
||||
<tr><td>{|Betreff|}:</td><td><input type="text" name="betreff" id="betreff" value="[BETREFF]" size="20"></td></tr>
|
||||
<tr><td>{|Von|}:</td><td>[KUNDE] [MAILADRESSE]</td></tr>
|
||||
<tr><td>{|Projekt|}:</td><td><input type="text" name="projekt" id="projekt" value="[PROJEKT]" size="20"></td></tr>
|
||||
<tr><td>{|Adresse|}:</td><td><input type="text" name="adresse" id="adresse" value="[ADRESSE]" size="20"><a href="index.php?module=adresse&action=edit&id=[ADRESSE_ID]"><img src="./themes/new/images/forward.svg" border="0" style="top:6px; position:relative"></a></td></tr>
|
||||
|
||||
@@ -23,9 +23,6 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
[MODULEINSTALLIERT]
|
||||
</fieldset>
|
||||
[TAB1NEXT]
|
||||
<form id="neu" action="index.php?module=versandarten&action=neusonstige" method="post">
|
||||
<button name="submit" value="neusonstige" class="ui-button-icon">Versandart ohne Modul anlegen</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- tab view schließen -->
|
||||
@@ -38,4 +35,4 @@ SPDX-License-Identifier: LicenseRef-EGPL-3.1
|
||||
:pages="pages"
|
||||
:allowClose="allowClose"
|
||||
:pagination="pagination">
|
||||
</click-by-click-assistant>
|
||||
</click-by-click-assistant>
|
||||
@@ -1,80 +0,0 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1"></a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
<form action="index.php?module=versandpakete&action=add&id=[ID]&lieferschein=[LIEFERSCHEIN_ID]" method="post">
|
||||
[FORMHANDLEREVENT]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-14 col-md-10 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Hinzufügen von Artikeln aus <a href="index.php?module=lieferschein&action=edit&id=[LIEFERSCHEIN_ID]"><b>Lieferschein [LIEFERSCHEIN]</b></a> zu Versandpaket <b>Nr. [ID]</b>|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<td>
|
||||
{|Artikel|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="artikel" id="artikel" value="" size="40" autofocus>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Menge|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="menge" id="menge" value="" min="1" size="40">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-14 col-md-2 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Aktionen|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr><td><button name="submit" value="hinzufuegen" class="ui-button-icon" style="width:100%;">Hinzufügen</button></td></tr>
|
||||
<tr><td><button name="submit" value="lieferschein_komplett_hinzufuegen" class="ui-button-icon" style="width:100%;">Alle hinzufügen</button></td></tr>
|
||||
<tr><td><button form="back" name="submit" value="fertig" class="ui-button-icon" style="width:100%;">Fertig</button></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Lieferscheininhalt|}</legend>
|
||||
[LIEFERSCHEININHALT]
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Paketinhalt|}</legend>
|
||||
[PAKETINHALT]
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" name="lieferschein" id="lieferschein" value="[LIEFERSCHEIN]" size="40" hidden>
|
||||
</form>
|
||||
<form action="index.php?module=versandpakete&action=edit&id=[VERSANDPAKET_ID]" id="back" method="post">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1"></a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
[FORMHANDLEREVENT]
|
||||
<form id="save" action="" method="post">
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-14 col-md-6 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>
|
||||
{|<b>Versandpaket Nr. [ID]</b> vom [DATUM]<span [NO_ADDRESS_HIDDEN]> für Adresse '[ADRESSE]'|}</span>
|
||||
</legend>
|
||||
[ICONS]
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr>
|
||||
<td>
|
||||
{|Status|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="" id="" value="[STATUS]" size="40" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Versender|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="" id="" value="[VERSENDER]" size="40" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Versandart|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="" id="" value="[VERSANDART]" size="40" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Tracking|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="tracking" id="tracking" value="[TRACKING]" size="40" [TRACKING_DISABLED]>
|
||||
<a href="[PAKETMARKE_LINK]" [PAKETMARKE_HIDDEN]>
|
||||
<img src="themes/new/images/portogo.png" border="0" title="Zur Paketmarke" style="top:6px; position:relative">
|
||||
</a>
|
||||
<a href="[TRACKING_LINK]" [TRACKING_LINK_HIDDEN]>
|
||||
<img src="themes/new/images/forward.svg" border="0" title="Zum Tracking" style="top:6px; position:relative">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr [TRACKING_LINK_EDIT_HIDDEN]>
|
||||
<td>
|
||||
{|Tracking link|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="tracking_link" id="tracking_link" value="[TRACKING_LINK]" size="40" [TRACKING_DISABLED]>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Gewicht Kg|}:
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="" id="" value="[GEWICHT]" size="40" disabled>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{|Bemerkung|}:
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="bemerkung" id="bemerkung" rows="3" style="width:100%;">[BEMERKUNG]</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-14 col-md-6 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset >
|
||||
<legend>{|Lieferschein|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr [LIEFERSCHEIN_OHNE_POS_HIDDEN]>
|
||||
<td>
|
||||
{|Zugeordnet|}:
|
||||
</td>
|
||||
<td>
|
||||
<input form="add" type="text" name="" id="" value="[LIEFERSCHEIN_OHNE_POS]" size="40" disabled>
|
||||
<a href="index.php?module=lieferschein&action=edit&id=[LIEFERSCHEIN_OHNE_POS_ID]"><img src="themes/new/images/forward.svg" title="Zum Lieferschein" border="0" style="top:6px; position:relative"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr [LIEFERSCHEIN_ADD_POS_HIDDEN]>
|
||||
<td>
|
||||
{|Lieferschein für Artikel hinzufügen|}:
|
||||
</td>
|
||||
<td>
|
||||
<input form="add" type="text" name="lieferschein" id="lieferschein" value="[LIEFERSCHEIN]" autofocus size="40">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-14 col-md-2 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Aktionen|}</legend>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<tr><td><button form="save" name="submit" value="speichern" class="ui-button-icon" style="width:100%;">Speichern</button></td></tr>
|
||||
<tr [LIEFERSCHEIN_ADD_POS_HIDDEN]><td><button form="add" name="submit" value="lieferschein_hinzufuegen" class="ui-button-icon" style="width:100%;">Artikel hinzufügen</button></td></tr>
|
||||
<tr [LIEFERSCHEIN_ADD_POS_HIDDEN]><td><button form="add" name="submit" value="lieferschein_komplett_hinzufuegen" class="ui-button-icon" style="width:100%;">Alle Artikel hinzufügen</button></td></tr>
|
||||
<tr [PAKETMARKE_ADD_HIDDEN]><td><button form="paketmarke" name="submit" value="paketmarke" class="ui-button-icon" style="width:100%;">Paketmarke drucken</button></td></tr>
|
||||
<tr [ABSENDEN_HIDDEN]><td><button name="submit" value="absenden" class="ui-button-icon" style="width:100%;">Absenden</button></td></tr>
|
||||
<tr [ABSCHLIESSEN_HIDDEN]><td><button name="submit" value="abschliessen" class="ui-button-icon" style="width:100%;">Abschließen</button></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form id="add" action="index.php?module=versandpakete&action=add&id=[ID]" method="post">
|
||||
</form>
|
||||
<form id="paketmarke" action="index.php?module=versandpakete&action=paketmarke&id=[ID]" method="post">
|
||||
</form>
|
||||
<div class="row" [LIEFERSCHEIN_POS_HIDDEN]>
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|Paketinhalt|}</legend>
|
||||
[PAKETINHALT]
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">[TABTEXT1]</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
<legend>{|<b>Lieferung zu <font color="blue"><a href="index.php?module=lieferschein&action=edit&id=[BELEGID]">Lieferschein [BELEGNR]</a></font></b>|}</legend>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
[MESSAGE]
|
||||
<div class="row">
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-12 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<form action="index.php?module=versandpakete&action=stapelverarbeitung&from=lieferung&id=[FROMID]" id="frmauto" name="frmauto" method="post">
|
||||
[TAB1]
|
||||
<fieldset>
|
||||
<table>
|
||||
<legend>Stapelverarbeitung</legend>
|
||||
<tr>
|
||||
<tr><td>{|Status|}:</td><td><select name="status">[STATUS_OPTIONS]</select></td></tr>
|
||||
<td><input type="checkbox" value="1" id="autoalle" /> alle markieren </td><td><input type="submit" class="btnBlue" name="status_setzen" value="{|Status setzen|}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
[TAB1NEXT]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$('#autoalle').on('change',function(){
|
||||
var wert = $(this).prop('checked');
|
||||
$('#versandpakete_list').find('input[type="checkbox"]').prop('checked',wert);
|
||||
$('#versandpakete_list').find('input[type="checkbox"]').first().trigger('change');
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -1,32 +0,0 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">[TABTEXT1]</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
<div class="filter-box filter-usersave">
|
||||
<div class="filter-block filter-inline">
|
||||
<div class="filter-title">{|Filter|}</div>
|
||||
<ul class="filter-list">
|
||||
[STATUSFILTER]
|
||||
<li class="filter-item">
|
||||
<label for="unterwegs" class="switch">
|
||||
<input type="checkbox" id="unterwegs">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="unterwegs">{|Unterwegs|}</label>
|
||||
</li>
|
||||
<li class="filter-item">
|
||||
<label for="geschlossene" class="switch">
|
||||
<input type="checkbox" id="geschlossene">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="geschlossene">{|Zzgl. abgeschlossen|}</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
[TAB1]
|
||||
[TAB1NEXT]
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,53 +0,0 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">[TABTEXT1]</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
[MESSAGE]
|
||||
<div class="filter-box filter-usersave">
|
||||
<div class="filter-block filter-inline">
|
||||
<div class="filter-title">{|Filter|}</div>
|
||||
<ul class="filter-list">
|
||||
[STATUSFILTER]
|
||||
<li class="filter-item">
|
||||
<label for="geschlossene" class="switch">
|
||||
<input type="checkbox" id="geschlossene">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="geschlossene">{|Zzgl. abgeschlossen|}</label>
|
||||
</li>
|
||||
<li class="filter-item">
|
||||
<label for="stornierte" class="switch">
|
||||
<input type="checkbox" id="stornierte">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
<label for="stornierte">{|Zzgl. Papierkorb|}</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<form action="index.php?module=versandpakete&action=stapelverarbeitung" id="frmauto" name="frmauto" method="post">
|
||||
[TAB1]
|
||||
<fieldset>
|
||||
<table>
|
||||
<legend>Stapelverarbeitung</legend>
|
||||
<tr>
|
||||
<tr><td>{|Status|}:</td><td><select name="status">[STATUS_OPTIONS]</select></td></tr>
|
||||
<td><input type="checkbox" value="1" id="autoalle" /> alle markieren </td><td><input type="submit" class="btnBlue" name="status_setzen" value="{|Status setzen|}" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</form>
|
||||
[TAB1NEXT]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$('#autoalle').on('change',function(){
|
||||
var wert = $(this).prop('checked');
|
||||
$('#versandpakete_list').find('input[type="checkbox"]').prop('checked',wert);
|
||||
$('#versandpakete_list').find('input[type="checkbox"]').first().trigger('change');
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -1,11 +1,7 @@
|
||||
<!--
|
||||
<table id="table[MD5]">
|
||||
<tr><td>{|Lieferschein|}:</td><td><input type="checkbox" onchange="lsclick[MD5]();" id="beiback_lieferschein[MD5]" disabled value="1" [BEIPACK_LIEFERSCHEIN] /></td><td><span id="lsnr[MD5]">[LSNR]</span></td>
|
||||
<td><input type="button" value="{|Belege ändern|}" style="cursor:hand;" onclick="editclick[MD5]();" /></td>
|
||||
</tr>
|
||||
<tr><td>{|Lieferschein|}:</td><td><input type="checkbox" onchange="lsclick[MD5]();" id="beiback_lieferschein[MD5]" disabled value="1" [BEIPACK_LIEFERSCHEIN] /></td><td><span id="lsnr[MD5]">[LSNR]</span></td><td><input type="button" value="{|Belege ändern|}" style="cursor:hand;" onclick="editclick[MD5]();" /></td></tr>
|
||||
<tr><td>{|Rechnung|}:</td><td><input type="checkbox" onchange="reclick[MD5]();" id="beiback_rechnung[MD5]" disabled value="1" [BEIPACK_RECHNUNG] /></td><td><span id="renr[MD5]">[RENR]</span></td><td></td></tr>
|
||||
</table>
|
||||
-->
|
||||
|
||||
<table width="100%">
|
||||
<tr><td width="100%">[ARTIKEL]</td></tr>
|
||||
@@ -114,4 +110,4 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
@@ -12,10 +12,10 @@
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-8 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
|
||||
<div class="filter-box filter-usersave">
|
||||
<div class="filter-block filter-inline">
|
||||
<div class="filter-block filter-inline">
|
||||
<fieldset>
|
||||
<legend>{|Neuen Wareneingang erzeugen|}</legend>
|
||||
<div class="filter-title">{|Filter|}</div>
|
||||
<ul class="filter-list">
|
||||
<li class="filter-item">
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
<input type="hidden" id="paketannahme_id" value="[ID]" />
|
||||
[BEFORETAB1]
|
||||
<div id="tabs-1">
|
||||
|
||||
[TAB1START]
|
||||
|
||||
[MESSAGE1]
|
||||
<form action="" method="post">
|
||||
<div class="row">
|
||||
@@ -24,50 +26,25 @@
|
||||
<tr><td>{|Lieferschein-Nr.|}:</td><td><input type=text size="40" name="lsnr" value=[LSNR]></td></tr>
|
||||
<tr><td>{|Rechnung-Nr.|}:</td><td><input type=text size="40" name="renr" value=[RENR]></td></tr>
|
||||
<tr><td>{|Bemerkung|}:</td><td><textarea rows="5" cols="40" name="bemerkung">[BEMERKUNG]</textarea></td></tr>
|
||||
[ISLIEFERANTSTART]
|
||||
<tr><td>{|Ziellager|}:</td><td><input type=text size="40" name="ziellager" id="ziellager" value=[LAGER]><br><i>Wenn nicht angegeben, wird das Standardlager des Artikels bebucht.</i></td></tr>
|
||||
[ISLIEFERANTENDE]
|
||||
<tr><td><input type="submit" name="speichern" class="btnGreenNew" value="Speichern"></td>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-2 col-md-height">
|
||||
<div class="inside inside-full-height">
|
||||
<fieldset>
|
||||
[BUTTONS]
|
||||
[BEFOREFRM]
|
||||
[AFTERFRM]
|
||||
[DISTRIINHALTBUTTONS]
|
||||
[BEFOREFRM]
|
||||
[AFTERFRM]
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="speichern" hidden="true"></button>
|
||||
<table width="100%" border="0" class="mkTableFormular">
|
||||
<legend>{|Aktionen|}</legend>
|
||||
[BEFOREMANUELLERFASSEN]
|
||||
<tr><td>
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="manuellerfassen">{|Artikel manuell erfassen|}</button>
|
||||
</td></tr>
|
||||
[AFTERMANUELLERFASSEN]
|
||||
[ISLIEFERANTSTART]
|
||||
<tr><td>
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="fuellen">{|Aus Bestellungen füllen|}</button>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="leeren">{|Leeren|}</button>
|
||||
</td></tr>
|
||||
[ISLIEFERANTENDE]
|
||||
<tr><td>
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="speichern">{|Speichern|}</button>
|
||||
</td></tr>
|
||||
[ISLIEFERANTSTART]
|
||||
<tr><td>
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="buchen">{|Buchen|}</button>
|
||||
</td></tr>
|
||||
[ISLIEFERANTENDE]
|
||||
<tr><td>
|
||||
<button name="submit" class="ui-button-icon" style="width:100%;" value="abschliessen">{|Abschließen|}</button>
|
||||
</td></tr>
|
||||
</table>
|
||||
<fieldset>
|
||||
<legend>{|Aktionen|}</legend>
|
||||
[BUTTONS]
|
||||
[BEFOREFRM]
|
||||
[AFTERFRM]
|
||||
[DISTRIINHALTBUTTONS]
|
||||
<input type="submit" name="abschliessen" id="btnabschliessen" class="btnGreenNew" value="Paketinhalt ist erfasst">
|
||||
[BEFOREMANUELLERFASSEN]
|
||||
<input type="submit" name="manuellerfassen" class="btnBlueNew" value="Artikel manuell erfassen">
|
||||
[AFTERMANUELLERFASSEN]
|
||||
[BEFOREFRM]
|
||||
[AFTERFRM]
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
@@ -77,7 +54,7 @@
|
||||
<div class="row-height">
|
||||
<div class="col-xs-12 col-md-10 col-md-height">
|
||||
<div class="inside-white inside-full-height">
|
||||
[TAB1]
|
||||
[TAB1]
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -97,7 +97,11 @@
|
||||
<td>{|Sprache|}:</td>
|
||||
<td><select name="sprachebevorzugen" id="sprachebevorzugen">[SPRACHEBEVORZUGEN]</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr>
|
||||
<td>{|Sprache und Region|}:</td>
|
||||
<td><input type="text" name="locale" id="locale" value="[LOCALE]" size="40" disabled="disabled"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{|Eigene Kalenderfarbe|}:</td>
|
||||
<td><input type="text" name="defaultcolor" id="defaultcolor" value="[DEFAULTCOLOR]" size="80"></td>
|
||||
<td></td>
|
||||
|
||||
@@ -300,7 +300,7 @@ $width = array('10%'); // Fill out manually later
|
||||
$result[0]['email'],
|
||||
$result[0]['angezeigtername'],
|
||||
'OpenXE ERP: Testmail',
|
||||
utf8_encode('Dies ist eine Testmail für Account "'.$result[0]['email'].'".'),
|
||||
'Dies ist eine Testmail für Account "'.$result[0]['email'].'".',
|
||||
'',0,false,'','',
|
||||
true
|
||||
)
|
||||
|
||||
@@ -609,7 +609,7 @@ class Exportbuchhaltung
|
||||
$data['Soll-/Haben-Kennzeichen'] = $typ['kennzeichen_negativ']; // obligatory
|
||||
}
|
||||
|
||||
$data['EU-Steuersatz (Bestimmung)'] = number_format($tmpsteuersatz, 2, ',', '');
|
||||
$data['EU-Steuersatz (Bestimmung)'] = number_format($$tmpsteuersatz, 2, ',', '');
|
||||
$data['WKZ Umsatz'] = $row['pos_waehrung'];
|
||||
$data['Belegfeld 1'] = mb_strimwidth($row['belegnr'],0,12);
|
||||
$data['Konto'] = $row['kundennummer']; // obligatory
|
||||
|
||||
@@ -468,8 +468,7 @@ class Lieferschein extends GenLieferschein
|
||||
AND v.aktiv = 1 AND v.ausprojekt = 0 AND v.modul != ''
|
||||
ORDER BY v.projekt DESC LIMIT 1");
|
||||
if (empty($result['modul']) || empty($result['id'])) {
|
||||
// $this->app->Tpl->addMessage('error', 'Bitte zuerst eine gültige Versandart auswählen', false, 'PAGE');
|
||||
$this->app->Location->execute("index.php?module=versandpakete&action=add&lieferschein=".$id);
|
||||
$this->app->Tpl->addMessage('error', 'Bitte zuerst eine gültige Versandart auswählen', false, 'PAGE');
|
||||
return;
|
||||
}
|
||||
$versandmodul = $this->app->erp->LoadVersandModul($result['modul'], $result['id']);
|
||||
@@ -961,7 +960,6 @@ class Lieferschein extends GenLieferschein
|
||||
|
||||
$this->app->Tpl->Set('VERSANDART',$auftragArr[0]['versandart']);
|
||||
|
||||
/*
|
||||
$tracking = $this->app->DB->SelectArr("SELECT
|
||||
if(v.tracking_link IS NOT NULL AND v.tracking_link != '', CONCAT(UPPER(versandunternehmen), ':<a href=\"', v.tracking_link, '\">', v.tracking, '</a>'),
|
||||
if(versandunternehmen = 'dhlexpress' AND l.land = 'DE' AND v.tracking != '', CONCAT(UPPER(versandunternehmen), ':<a href=\"https://www.dhl.de/de/privatkunden/pakete-empfangen/verfolgen.html?piececode=', v.tracking, '\" target=\"_blank\">', v.tracking, '</a>'),
|
||||
@@ -1020,32 +1018,7 @@ class Lieferschein extends GenLieferschein
|
||||
if (!is_null($tmp)) {
|
||||
$this->app->Tpl->Set('TRACKING',implode(', ',$tmp));
|
||||
}
|
||||
*/
|
||||
|
||||
$sql = "SELECT SQL_CALC_FOUND_ROWS
|
||||
v.id,
|
||||
v.tracking as tracking,
|
||||
v.tracking_link
|
||||
FROM
|
||||
versandpakete v
|
||||
LEFT JOIN
|
||||
versandpaket_lieferschein_position vlp ON v.id = vlp.versandpaket
|
||||
LEFT JOIN
|
||||
lieferschein_position lp ON lp.id = vlp.lieferschein_position
|
||||
LEFT JOIN
|
||||
lieferschein l ON lp.lieferschein = l.id
|
||||
WHERE l.id = ".$id." OR v.lieferschein_ohne_pos = ".$id."
|
||||
GROUP BY
|
||||
v.id
|
||||
";
|
||||
$tracking = $this->app->DB->SelectArr($sql);
|
||||
$tracking_list = array();
|
||||
foreach ($tracking as $single_tracking) {
|
||||
$tracking_list[] = '<a href="index.php?module=versandpakete&action=edit&id='.$single_tracking['id'].'">Paket Nr.'.$single_tracking['id'].'</a>'.
|
||||
' ('.'<a href="'.$single_tracking['tracking_link'].'">'.$single_tracking['tracking'].'</a>'.')';
|
||||
}
|
||||
|
||||
$this->app->Tpl->Set('TRACKING',implode('<br>',$tracking_list));
|
||||
|
||||
$returnOrders = (array)$this->app->DB->SelectArr(
|
||||
sprintf(
|
||||
@@ -2286,18 +2259,6 @@ class Lieferschein extends GenLieferschein
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'versanduebergabe':
|
||||
if(!empty($selectedIds)) {
|
||||
$this->app->DB->Update(
|
||||
sprintf(
|
||||
"UPDATE `lieferschein`
|
||||
SET `versand_status` = 1
|
||||
WHERE `id` IN (%s) AND `versand_status` = 0",
|
||||
implode(',' , $selectedIds)
|
||||
)
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,8 +401,7 @@ class Managementboard
|
||||
/** @var Rechnungslauf $obj */
|
||||
$obj = $this->app->erp->LoadModul('rechnungslauf');
|
||||
if($obj){
|
||||
// $w[24] = $obj->RechnungslaufRechnungslauf(true); // This does not exist, presumably old xentral function
|
||||
$w[24] = 0;
|
||||
$w[24] = $obj->RechnungslaufRechnungslauf(true);
|
||||
}
|
||||
else {
|
||||
$w[24] = 0;
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class Paketmarke {
|
||||
/** @var Application $app */
|
||||
var $app;
|
||||
|
||||
/**
|
||||
* Paketmarke constructor.
|
||||
*
|
||||
* @param Application $app
|
||||
* @param bool $intern
|
||||
*/
|
||||
public function __construct($app, $intern = false) {
|
||||
//parent::GenPaketmarke($app);
|
||||
$this->app=$app;
|
||||
if($intern) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->app->ActionHandlerInit($this);
|
||||
|
||||
$this->app->ActionHandler("create","PaketmarkeCreatePopup");
|
||||
$this->app->ActionHandler("tracking","PaketmarkeTracking");
|
||||
|
||||
$this->app->ActionHandlerListen($app);
|
||||
|
||||
}
|
||||
|
||||
function PaketmarkeTracking()
|
||||
{
|
||||
$this->app->erp->Headlines('Paketmarken Drucker');
|
||||
|
||||
$this->app->Tpl->Set('PAGE',"Tracking-Nummer: <input type=\"text\" id=\"tracking\"><script type=\"text/javascript\">document.getElementById(\"tracking\").focus(); </script>");
|
||||
//$this->app->BuildNavigation=false;
|
||||
}
|
||||
|
||||
function PaketmarkeCreatePopup()
|
||||
{
|
||||
$this->app->erp->Headlines('Paketmarken Drucker');
|
||||
$this->app->erp->PaketmarkeDHLEmbedded('PAGE','lieferschein');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2727,8 +2727,6 @@ class Projekt extends GenProjekt {
|
||||
|
||||
if($oldProjectId > 0){
|
||||
$this->createAdditionalInputForCopyProjects($oldProjectId,$check);
|
||||
$msg = $this->app->erp->base64_url_encode("<div class=\"info\">Das Projekt wurde erfolgreich kopiert.</div>");
|
||||
$this->app->Location->execute("index.php?module=projekt&action=uebersicht&id=$check&msg=$msg");
|
||||
return;
|
||||
}
|
||||
$msg = $this->app->erp->base64_url_encode("<div class=\"info\">Das Projekt wurde erfolgreich angelegt.</div>");
|
||||
@@ -2850,7 +2848,7 @@ class Projekt extends GenProjekt {
|
||||
* @param int $copyProjectId
|
||||
* @return bool
|
||||
*/
|
||||
public function createAdditionalInputForCopyProjects(int $oldProjectId, int $copyProjectId)
|
||||
public function createAdditionalInputForCopyProjects(int $oldProjectId, int $copyProjectId): bool
|
||||
{
|
||||
$hasAdditionalInput = false;
|
||||
$this->app->Tpl->Set('TOID',$copyProjectId);
|
||||
|
||||
@@ -68,7 +68,7 @@ class Ticket {
|
||||
$dropnbox = "'<img src=./themes/new/images/details_open.png class=details>' AS `open`,
|
||||
CONCAT('<input type=\"checkbox\" name=\"auswahl[]\" value=\"',t.id,'\" />') AS `auswahl`";
|
||||
|
||||
$priobetreff = "if(t.prio!=1,REGEXP_REPLACE(t.betreff, '<[^>]*>+', ''),CONCAT('<b><font color=red>',REGEXP_REPLACE(t.betreff, '<[^>]*>+', ''),'</font></b>'))"; //+ #20230916 XSS
|
||||
$priobetreff = "if(t.prio!=1,t.betreff,CONCAT('<b><font color=red>',t.betreff,'</font></b>'))";
|
||||
|
||||
$anzahlnachrichten = "(SELECT COUNT(n.id) FROM ticket_nachricht n WHERE n.ticket = t.schluessel)";
|
||||
|
||||
@@ -310,8 +310,6 @@ class Ticket {
|
||||
// Add Messages now
|
||||
foreach ($messages as $message) {
|
||||
|
||||
$message['betreff'] = strip_tags($message['betreff']); //+ #20230916 XSS
|
||||
|
||||
// Clear this first
|
||||
$this->app->Tpl->Set('NACHRICHT_ANHANG',"");
|
||||
|
||||
@@ -624,8 +622,6 @@ class Ticket {
|
||||
|
||||
$ticket_from_db = $this->app->DB->SelectArr($sql)[0];
|
||||
|
||||
$ticket_from_db['betreff'] = htmlentities(strip_tags($ticket_from_db['betreff'])); //+ #20230916 XSS
|
||||
|
||||
foreach ($ticket_from_db as $key => $value) {
|
||||
$this->app->Tpl->Set(strtoupper($key), $value);
|
||||
}
|
||||
@@ -737,10 +733,10 @@ class Ticket {
|
||||
|
||||
if (!empty($recv_messages)) {
|
||||
if (!str_starts_with(strtoupper($recv_messages[0]['betreff']),"RE:")) {
|
||||
$betreff = "RE: ".strip_tags($recv_messages[0]['betreff']); //+ #20230916 XSS
|
||||
$betreff = "RE: ".$recv_messages[0]['betreff'];
|
||||
}
|
||||
else {
|
||||
$betreff = strip_tags($recv_messages[0]['betreff']); //+ #20230916 XSS
|
||||
$betreff = $recv_messages[0]['betreff'];
|
||||
}
|
||||
|
||||
$sql = "SELECT GROUP_CONCAT(DISTINCT `value` ORDER BY `value` SEPARATOR ', ') FROM ticket_header th WHERE th.ticket_nachricht = ".$recv_messages[0]['id']." AND `value` <> '".$senderAddress."' AND type='to'";
|
||||
|
||||
@@ -56,7 +56,6 @@ class Versandarten {
|
||||
|
||||
// ab hier alle Action Handler definieren die das Modul hat
|
||||
$this->app->ActionHandler("create", "VersandartenCreate");
|
||||
$this->app->ActionHandler("neusonstige", "VersandartenNeuSonstige");
|
||||
$this->app->ActionHandler("edit", "VersandartenEdit");
|
||||
$this->app->ActionHandler("list", "VersandartenList");
|
||||
$this->app->ActionHandler("delete", "VersandartenDelete");
|
||||
@@ -154,13 +153,6 @@ class Versandarten {
|
||||
return $erg;
|
||||
}
|
||||
|
||||
public function VersandartenNeuSonstige() {
|
||||
$sql = "INSERT INTO versandarten (aktiv) VALUES (1)";
|
||||
$this->app->DB->Insert($sql);
|
||||
$id = $this->app->DB->GetInsertID();
|
||||
$this->app->Location->execute('index.php?module=versandarten&action=edit&id='.$id);
|
||||
}
|
||||
|
||||
/** @noinspection PhpUnused */
|
||||
public function VersandartenEdit(): void
|
||||
{
|
||||
@@ -177,8 +169,8 @@ class Versandarten {
|
||||
if($submit != '') { // handle form submit
|
||||
$form = $this->GetInput();
|
||||
$obj = $this->loadModule($form['modul'], $id);
|
||||
/* if ($obj === null)
|
||||
$error[] = sprintf('Versandart "%s" existiert nicht.', $form['selmodul']); */
|
||||
if ($obj === null)
|
||||
$error[] = sprintf('Versandart "%s" existiert nicht.', $form['selmodul']);
|
||||
|
||||
if(trim($form['bezeichnung']) == '')
|
||||
$error[] = 'Bitte eine Bezeichnung angeben!';
|
||||
@@ -842,4 +834,4 @@ class Versandarten {
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+2405
-2434
File diff suppressed because it is too large
Load Diff
@@ -1711,6 +1711,13 @@ $this->app->Tpl->Add('TODOFORUSER',"<tr><td width=\"90%\">".$tmp[$i]['aufgabe'].
|
||||
$this->app->Tpl->Set('STARTSEITE', $settings['startseite']);
|
||||
$this->app->Tpl->Set('DEFAULTCOLOR', $settings['defaultcolor']);
|
||||
$this->app->Tpl->Set('SPRACHEBEVORZUGEN', $this->languageSelectOptions($settings['sprachebevorzugen']));
|
||||
|
||||
/** @var \Xentral\Components\I18n\Localization $localization */
|
||||
if($localization=$this->app->Container->get('Localization')) {
|
||||
$this->app->Tpl->Set('LOCALE', $localization->getLocale());
|
||||
} else {
|
||||
$this->app->Tpl->Set('LOCALE', 'Fehler!');
|
||||
}
|
||||
|
||||
if($settings['chat_popup']){
|
||||
$this->app->Tpl->Set('CHAT_POPUP', ' checked="checked" ');
|
||||
|
||||
@@ -1,3 +1,37 @@
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../themes/new/fonts/Inter-Regular.woff2?v=3.13') format("woff2"),
|
||||
url('../themes/new/fonts/Inter-Regular.woff?v=3.13') format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../themes/new/fonts/Inter-Italic.woff2?v=3.13') format("woff2"),
|
||||
url('../themes/new/fonts/Inter-Italic.woff?v=3.13') format("woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../themes/new/fonts/Inter-Bold.woff2?v=3.13') format("woff2"),
|
||||
url('../themes/new/fonts/Inter-Bold.woff?v=3.13') format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../themes/new/fonts/Inter-BoldItalic.woff2?v=3.13') format("woff2"),
|
||||
url('../themes/new/fonts/Inter-BoldItalic.woff?v=3.13') format("woff");
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 16px;
|
||||
font-family: 'Inter', Arial, Helvetica, sans-serif;
|
||||
|
||||
@@ -64,6 +64,5 @@
|
||||
--error: #F05A5C;
|
||||
--error-color: #fff;
|
||||
--important: #68D4D0;
|
||||
/* --success: #92EFB4;*/
|
||||
--success: #2DCA73;
|
||||
--success: #92EFB4;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,38 @@
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../themes/new/fonts/Inter-Regular.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-Regular.woff?v=3.13') format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../themes/new/fonts/Inter-Italic.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-Italic.woff?v=3.13') format("woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../fonts/Inter-Bold.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-Bold.woff?v=3.13') format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../fonts/Inter-BoldItalic.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-BoldItalic.woff?v=3.13') format("woff");
|
||||
}
|
||||
|
||||
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,39 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../fonts/Inter-Regular.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-Regular.woff?v=3.13') format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../fonts/Inter-Italic.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-Italic.woff?v=3.13') format("woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../fonts/Inter-Bold.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-Bold.woff?v=3.13') format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../themes/new/fonts/Inter-BoldItalic.woff2?v=3.13') format("woff2"),
|
||||
url('../themes/new/fonts/Inter-BoldItalic.woff?v=3.13') format("woff");
|
||||
}
|
||||
|
||||
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,71 @@
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../fonts/Inter-Regular.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-Regular.woff?v=3.13') format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
font-display: swap;
|
||||
src: url('../fonts/Inter-Italic.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-Italic.woff?v=3.13') format("woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url("../fonts/Inter-Medium.woff2?v=3.13") format("woff2"),
|
||||
url("../fonts/Inter-Medium.woff?v=3.13") format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 500;
|
||||
font-display: swap;
|
||||
src: url("../fonts/Inter-MediumItalic.woff2?v=3.13") format("woff2"),
|
||||
url("../fonts/Inter-MediumItalic.woff?v=3.13") format("woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-display: swap;
|
||||
src: url("../fonts/Inter-SemiBold.woff2?v=3.13") format("woff2"),
|
||||
url("../fonts/Inter-SemiBold.woff?v=3.13") format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 600;
|
||||
font-display: swap;
|
||||
src: url("../fonts/Inter-SemiBoldItalic.woff2?v=3.13") format("woff2"),
|
||||
url("../fonts/Inter-SemiBoldItalic.woff?v=3.13") format("woff");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../fonts/Inter-Bold.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-Bold.woff?v=3.13') format("woff");
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Inter';
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
font-display: swap;
|
||||
src: url('../fonts/Inter-BoldItalic.woff2?v=3.13') format("woff2"),
|
||||
url('../fonts/Inter-BoldItalic.woff?v=3.13') format("woff");
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 12px;
|
||||
font-family: 'Inter', Arial, Helvetica, sans-serif;
|
||||
@@ -2961,6 +3029,7 @@ div.error > input[type=submit] {
|
||||
}
|
||||
|
||||
.info,
|
||||
.success,
|
||||
.error2 {
|
||||
background-color: var(--info);
|
||||
color: var(--info-color);
|
||||
@@ -2975,14 +3044,6 @@ div.error > input[type=submit] {
|
||||
background-size: 30px 30px;
|
||||
}
|
||||
|
||||
.success {
|
||||
background-color: var(--success);
|
||||
color: var(--info-color);
|
||||
background-image: url('../images/info.png');
|
||||
background-size: 30px 30px;
|
||||
}
|
||||
|
||||
|
||||
.pull-right {
|
||||
float: right !important;
|
||||
}
|
||||
@@ -3047,7 +3108,7 @@ div.error > input[type=submit] {
|
||||
#header div.headererror > input {
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
background-color: var(--success);
|
||||
background-color: var(--info);
|
||||
color: var(--info-color);
|
||||
}
|
||||
|
||||
@@ -3663,8 +3724,9 @@ a.ui-tabs-anchor:hover {
|
||||
|
||||
.greybox {
|
||||
background-color: lightgrey;
|
||||
color: white;
|
||||
padding: 10px;
|
||||
font-size: 1.2em;
|
||||
font-size: 1.8em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,6 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.06267 11.2331H4.76674C4.5067 11.2331 4.2959 11.4439 4.2959 11.7039V14.529C4.2959 14.7891 4.5067 14.9999 4.76674 14.9999H7.59182C7.85186 14.9999 8.06267 14.7891 8.06267 14.529V11.2331Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.3584 11.2331H8.0625V14.529C8.0625 14.7891 8.27331 14.9999 8.53335 14.9999H11.3584C11.6185 14.9999 11.8293 14.7891 11.8293 14.529V11.7039C11.8293 11.4439 11.6185 11.2331 11.3584 11.2331Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.47512 7.46631H6.65005C6.39 7.46631 6.1792 7.67711 6.1792 7.93716V11.2331H9.94597V7.93716C9.94597 7.67711 9.73517 7.46631 9.47512 7.46631Z" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M15.1254 15V5.2064C15.1255 4.85853 14.9339 4.53892 14.6269 4.37519L8.50592 1.11066C8.22908 0.963114 7.89694 0.963114 7.6201 1.11066L1.4991 4.37519C1.19193 4.53876 1 4.85839 1 5.2064V15" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,312 +1,308 @@
|
||||
<?php
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
/*
|
||||
**** COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*
|
||||
* Xentral (c) Xentral ERP Sorftware GmbH, Fuggerstrasse 11, D-86150 Augsburg, * Germany 2019
|
||||
*
|
||||
* This file is licensed under the Embedded Projects General Public License *Version 3.1.
|
||||
*
|
||||
* You should have received a copy of this license from your vendor and/or *along with this file; If not, please visit www.wawision.de/Lizenzhinweis
|
||||
* to obtain the text of the corresponding license version.
|
||||
*
|
||||
**** END OF COPYRIGHT & LICENSE NOTICE *** DO NOT REMOVE ****
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
|
||||
class WidgetGenauftrag_position
|
||||
{
|
||||
|
||||
private $app; //application object
|
||||
public $form; //store form object
|
||||
protected $parsetarget; //target for content
|
||||
|
||||
public function __construct($app,$parsetarget)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->parsetarget = $parsetarget;
|
||||
$this->Form();
|
||||
}
|
||||
|
||||
public function auftrag_positionDelete()
|
||||
{
|
||||
|
||||
$this->form->Execute("auftrag_position","delete");
|
||||
|
||||
$this->auftrag_positionList();
|
||||
}
|
||||
|
||||
function Edit()
|
||||
{
|
||||
$this->form->Edit();
|
||||
}
|
||||
|
||||
function Copy()
|
||||
{
|
||||
$this->form->Copy();
|
||||
}
|
||||
|
||||
public function Create()
|
||||
{
|
||||
$this->form->Create();
|
||||
}
|
||||
|
||||
public function Search()
|
||||
{
|
||||
$this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE");
|
||||
}
|
||||
|
||||
public function Summary()
|
||||
{
|
||||
$this->app->Tpl->Set($this->parsetarget,"grosse Tabelle");
|
||||
}
|
||||
|
||||
function Form()
|
||||
{
|
||||
$this->form = $this->app->FormHandler->CreateNew("auftrag_position");
|
||||
$this->form->UseTable("auftrag_position");
|
||||
$this->form->UseTemplate("auftrag_position.tpl",$this->parsetarget);
|
||||
|
||||
$field = new HTMLInput("nummer","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
$this->form->AddMandatory("bezeichnung","notempty","Pflichtfeld!","MSGBEZEICHNUNG");
|
||||
|
||||
$field = new HTMLTextarea("beschreibung",8,48,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("menge","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
$this->form->AddMandatory("menge","notempty","Pflichtfeld!","MSGMENGE");
|
||||
|
||||
$field = new HTMLInput("preis","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLTextarea("formelmenge",2,48,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLTextarea("formelpreis",2,48,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("ohnepreis","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("ausblenden_im_pdf","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("waehrung","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0");
|
||||
$field->AddOption('Standard','');
|
||||
$field->AddOption('Ermäßigt','ermaessigt');
|
||||
$field->AddOption('Befreit','befreit');
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("anderersteuersatz","","","","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("steuersatz","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLTextarea("steuertext",3,50,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("grundrabatt","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt1","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt2","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt3","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt4","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt5","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("keinrabatterlaubt","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("einheit","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("vpe","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("lieferdatum","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("lieferdatumkw","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("artikelnummerkunde","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("zolltarifnummer","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("herkunftsland","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld1","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld2","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld3","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld4","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld5","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld6","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld7","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld8","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld9","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld10","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld11","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld12","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld13","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld14","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld15","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld16","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld17","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld18","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld19","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld20","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld21","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld22","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld23","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld24","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld25","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld26","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld27","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld28","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld29","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld30","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld31","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld32","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld33","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld34","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld35","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld36","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld37","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld38","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld39","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld40","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("punkte","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("bonuspunkte","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("mlmdirektpraemie","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("kostenstelle","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("erloese","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("erloesefestschreiben","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
if ($this->app->erp->RechteVorhanden('auftrag','einkaufspreise')) {
|
||||
$field = new HTMLInput("einkaufspreis","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
}
|
||||
|
||||
$field = new HTMLTextarea("bemerkung",3,40,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
|
||||
class WidgetGenauftrag_position
|
||||
{
|
||||
|
||||
private $app; //application object
|
||||
public $form; //store form object
|
||||
protected $parsetarget; //target for content
|
||||
|
||||
public function __construct($app,$parsetarget)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->parsetarget = $parsetarget;
|
||||
$this->Form();
|
||||
}
|
||||
|
||||
public function auftrag_positionDelete()
|
||||
{
|
||||
|
||||
$this->form->Execute("auftrag_position","delete");
|
||||
|
||||
$this->auftrag_positionList();
|
||||
}
|
||||
|
||||
function Edit()
|
||||
{
|
||||
$this->form->Edit();
|
||||
}
|
||||
|
||||
function Copy()
|
||||
{
|
||||
$this->form->Copy();
|
||||
}
|
||||
|
||||
public function Create()
|
||||
{
|
||||
$this->form->Create();
|
||||
}
|
||||
|
||||
public function Search()
|
||||
{
|
||||
$this->app->Tpl->Set($this->parsetarget,"SUUUCHEEE");
|
||||
}
|
||||
|
||||
public function Summary()
|
||||
{
|
||||
$this->app->Tpl->Set($this->parsetarget,"grosse Tabelle");
|
||||
}
|
||||
|
||||
function Form()
|
||||
{
|
||||
$this->form = $this->app->FormHandler->CreateNew("auftrag_position");
|
||||
$this->form->UseTable("auftrag_position");
|
||||
$this->form->UseTemplate("auftrag_position.tpl",$this->parsetarget);
|
||||
|
||||
$field = new HTMLInput("nummer","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("bezeichnung","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
$this->form->AddMandatory("bezeichnung","notempty","Pflichtfeld!","MSGBEZEICHNUNG");
|
||||
|
||||
$field = new HTMLTextarea("beschreibung",8,48,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("menge","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
$this->form->AddMandatory("menge","notempty","Pflichtfeld!","MSGMENGE");
|
||||
|
||||
$field = new HTMLInput("preis","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLTextarea("formelmenge",2,48,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLTextarea("formelpreis",2,48,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("ohnepreis","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("ausblenden_im_pdf","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("waehrung","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLSelect("umsatzsteuer",0,"umsatzsteuer","","","0");
|
||||
$field->AddOption('Standard','');
|
||||
$field->AddOption('Ermäßigt','ermaessigt');
|
||||
$field->AddOption('Befreit','befreit');
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("anderersteuersatz","","","","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("steuersatz","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLTextarea("steuertext",3,50,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("grundrabatt","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt1","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt2","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt3","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt4","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt5","text","","5","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("keinrabatterlaubt","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("rabatt","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("einheit","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("vpe","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("lieferdatum","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("lieferdatumkw","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("artikelnummerkunde","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("zolltarifnummer","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("herkunftsland","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld1","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld2","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld3","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld4","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld5","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld6","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld7","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld8","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld9","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld10","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld11","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld12","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld13","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld14","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld15","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld16","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld17","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld18","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld19","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld20","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld21","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld22","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld23","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld24","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld25","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld26","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld27","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld28","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld29","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld30","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld31","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld32","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld33","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld34","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld35","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld36","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld37","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld38","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld39","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("freifeld40","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("punkte","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("bonuspunkte","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("mlmdirektpraemie","text","","50","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
|
||||
$field = new HTMLInput("kostenstelle","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLInput("erloese","text","","15","","","","","","","","0","","");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLCheckbox("erloesefestschreiben","","","1","0","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
$field = new HTMLTextarea("bemerkung",3,40,"","","","","0");
|
||||
$this->form->NewField($field);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user