mirror of
https://github.com/Karaka-Management/oms-Customs.git
synced 2026-02-12 08:28:41 +00:00
Test fixes
This commit is contained in:
parent
dd5e2e73e0
commit
af73bc7d6c
|
|
@ -14,14 +14,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\Customs\Admin;
|
namespace Modules\Customs\Admin;
|
||||||
|
|
||||||
use Modules\Admin\Models\NullAccount;
|
|
||||||
use phpOMS\Application\ApplicationAbstract;
|
|
||||||
use phpOMS\Config\SettingsInterface;
|
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
|
||||||
use phpOMS\Module\InstallerAbstract;
|
use phpOMS\Module\InstallerAbstract;
|
||||||
use phpOMS\Module\ModuleInfo;
|
|
||||||
use phpOMS\System\File\PathException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Installer class.
|
* Installer class.
|
||||||
|
|
@ -40,12 +33,4 @@ final class Installer extends InstallerAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const PATH = __DIR__;
|
public const PATH = __DIR__;
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public static function install(ApplicationAbstract $app, ModuleInfo $info, SettingsInterface $cfgHandler) : void
|
|
||||||
{
|
|
||||||
parent::install($app, $info, $cfgHandler);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,5 @@
|
||||||
*/
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Modules\Dashboard\Controller\ApiController;
|
|
||||||
use Modules\Dashboard\Models\PermissionCategory;
|
|
||||||
use phpOMS\Account\PermissionType;
|
|
||||||
use phpOMS\Router\RouteVerb;
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\Customs\Controller;
|
namespace Modules\Customs\Controller;
|
||||||
|
|
||||||
use phpOMS\Message\Http\RequestStatusCode;
|
|
||||||
use phpOMS\Message\RequestAbstract;
|
|
||||||
use phpOMS\Message\ResponseAbstract;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Api controller for the dashboard module.
|
* Api controller for the dashboard module.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -78,18 +78,18 @@ final class BackendController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$con = new \phpOMS\DataStorage\Database\Connection\SQLiteConnection([
|
$con = new \phpOMS\DataStorage\Database\Connection\SQLiteConnection([
|
||||||
'db' => 'sqlite',
|
'db' => 'sqlite',
|
||||||
'database' => __DIR__ . '/../Data/customs.sqlite'
|
'database' => __DIR__ . '/../Data/customs.sqlite',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$con->connect();
|
$con->connect();
|
||||||
|
|
||||||
$query = new Builder($con);
|
$query = new Builder($con);
|
||||||
|
|
||||||
$nameString = \str_replace(['.', ';', ',', '-'], ' ', $request->getDataString('name') ?? '');
|
$nameString = \str_replace(['.', ';', ',', '-'], ' ', $request->getDataString('name') ?? '');
|
||||||
$names = \explode(' ', $nameString);
|
$names = \explode(' ', $nameString);
|
||||||
$fileSearchArray = $names;
|
$fileSearchArray = $names;
|
||||||
$name = '';
|
$name = '';
|
||||||
|
|
||||||
// US SDN and CONS
|
// US SDN and CONS
|
||||||
foreach ($names as $idx => $n) {
|
foreach ($names as $idx => $n) {
|
||||||
|
|
@ -140,7 +140,7 @@ final class BackendController extends Controller
|
||||||
LIMIT 100;
|
LIMIT 100;
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
$view->data['sanctions'] = \array_merge($view->data['sanctions'], $query->raw($sql)->execute()->fetchAll());
|
$view->data['sanctions'] = \array_merge($view->data['sanctions'], $query->raw($sql)->execute()?->fetchAll() ?? []);
|
||||||
|
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
SELECT sanction_us_cons.Ent_num,
|
SELECT sanction_us_cons.Ent_num,
|
||||||
|
|
@ -158,7 +158,7 @@ final class BackendController extends Controller
|
||||||
LIMIT 100;
|
LIMIT 100;
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
$view->data['sanctions'] = \array_merge($view->data['sanctions'], $query->raw($sql)->execute()->fetchAll());
|
$view->data['sanctions'] = \array_merge($view->data['sanctions'], $query->raw($sql)->execute()?->fetchAll() ?? []);
|
||||||
|
|
||||||
// EU Consolidated
|
// EU Consolidated
|
||||||
$name = '';
|
$name = '';
|
||||||
|
|
@ -246,7 +246,7 @@ final class BackendController extends Controller
|
||||||
LIMIT 500;
|
LIMIT 500;
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
$view->data['sanctions'] = \array_merge($view->data['sanctions'], $query->raw($sql)->execute()->fetchAll());
|
$view->data['sanctions'] = \array_merge($view->data['sanctions'], $query->raw($sql)->execute()?->fetchAll() ?? []);
|
||||||
|
|
||||||
$con->close();
|
$con->close();
|
||||||
|
|
||||||
|
|
@ -254,7 +254,7 @@ final class BackendController extends Controller
|
||||||
$positions = SearchUtils::findInFile(__DIR__ . '/../Data/Sanctions/EU/CELEX 32002R0881 EN TXT.html', $fileSearchArray);
|
$positions = SearchUtils::findInFile(__DIR__ . '/../Data/Sanctions/EU/CELEX 32002R0881 EN TXT.html', $fileSearchArray);
|
||||||
|
|
||||||
$lex_881_2002 = [];
|
$lex_881_2002 = [];
|
||||||
$hashResults = [];
|
$hashResults = [];
|
||||||
foreach ($positions as $position) {
|
foreach ($positions as $position) {
|
||||||
if ($position['distance'] > 500) {
|
if ($position['distance'] > 500) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -272,11 +272,11 @@ final class BackendController extends Controller
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hashResults[] = $hash;
|
$hashResults[] = $hash;
|
||||||
$lex_881_2002[] = [
|
$lex_881_2002[] = [
|
||||||
'sanction_db' => 'EU_881/2002',
|
'sanction_db' => 'EU_881/2002',
|
||||||
'Ent_num' => 'EU_881/2002',
|
'Ent_num' => 'EU_881/2002',
|
||||||
'parsed' => $sanction,
|
'parsed' => $sanction,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -286,7 +286,7 @@ final class BackendController extends Controller
|
||||||
$positions = SearchUtils::findInFile(__DIR__ . '/../Data/Sanctions/EU/CELEX 32011R0753 EN TXT.html', $fileSearchArray);
|
$positions = SearchUtils::findInFile(__DIR__ . '/../Data/Sanctions/EU/CELEX 32011R0753 EN TXT.html', $fileSearchArray);
|
||||||
|
|
||||||
$lex_753_2011 = [];
|
$lex_753_2011 = [];
|
||||||
$hashResults = [];
|
$hashResults = [];
|
||||||
foreach ($positions as $position) {
|
foreach ($positions as $position) {
|
||||||
if ($position['distance'] > 500) {
|
if ($position['distance'] > 500) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -304,11 +304,11 @@ final class BackendController extends Controller
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hashResults[] = $hash;
|
$hashResults[] = $hash;
|
||||||
$lex_753_2011[] = [
|
$lex_753_2011[] = [
|
||||||
'sanction_db' => 'EU_753/2011',
|
'sanction_db' => 'EU_753/2011',
|
||||||
'Ent_num' => 'EU_753/2011',
|
'Ent_num' => 'EU_753/2011',
|
||||||
'parsed' => $sanction,
|
'parsed' => $sanction,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -318,7 +318,7 @@ final class BackendController extends Controller
|
||||||
$positions = SearchUtils::findInFile(__DIR__ . '/../Data/Sanctions/EU/CELEX 32011R0753 EN TXT.html', $fileSearchArray);
|
$positions = SearchUtils::findInFile(__DIR__ . '/../Data/Sanctions/EU/CELEX 32011R0753 EN TXT.html', $fileSearchArray);
|
||||||
|
|
||||||
$lex_2024_385 = [];
|
$lex_2024_385 = [];
|
||||||
$hashResults = [];
|
$hashResults = [];
|
||||||
foreach ($positions as $position) {
|
foreach ($positions as $position) {
|
||||||
if ($position['distance'] > 500) {
|
if ($position['distance'] > 500) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -336,11 +336,11 @@ final class BackendController extends Controller
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hashResults[] = $hash;
|
$hashResults[] = $hash;
|
||||||
$lex_2024_385[] = [
|
$lex_2024_385[] = [
|
||||||
'sanction_db' => 'EU_2024/385',
|
'sanction_db' => 'EU_2024/385',
|
||||||
'Ent_num' => 'EU_2024/385',
|
'Ent_num' => 'EU_2024/385',
|
||||||
'parsed' => $sanction,
|
'parsed' => $sanction,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -349,20 +349,35 @@ final class BackendController extends Controller
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create HS code view
|
||||||
|
*
|
||||||
|
* @param RequestAbstract $request Request
|
||||||
|
* @param ResponseAbstract $response Response
|
||||||
|
* @param array $data Generic data
|
||||||
|
*
|
||||||
|
* @return RenderableInterface
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function viewHSCodeView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
public function viewHSCodeView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Customs/Theme/Backend/hscode-view');
|
$view->setTemplate('/Modules/Customs/Theme/Backend/hscode-view');
|
||||||
|
|
||||||
|
$original = $request->getDataString('id') ?? '';
|
||||||
|
|
||||||
if (!$request->hasData('id')
|
if (!$request->hasData('id')
|
||||||
|| \preg_match('/^[0-9 ]+$/', $original = $request->getDataString('id')) !== 1
|
|| \preg_match('/^[0-9 ]+$/', $original) !== 1
|
||||||
) {
|
) {
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
$con = new \phpOMS\DataStorage\Database\Connection\SQLiteConnection([
|
$con = new \phpOMS\DataStorage\Database\Connection\SQLiteConnection([
|
||||||
'db' => 'sqlite',
|
'db' => 'sqlite',
|
||||||
'database' => __DIR__ . '/../Data/customs.sqlite'
|
'database' => __DIR__ . '/../Data/customs.sqlite',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$con->connect();
|
$con->connect();
|
||||||
|
|
@ -395,7 +410,7 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
$query = new Builder($con);
|
$query = new Builder($con);
|
||||||
|
|
||||||
$view->data['goods'] = $query->raw($sql)->execute()->fetchAll();
|
$view->data['goods'] = $query->raw($sql)->execute()?->fetchAll() ?? [];
|
||||||
|
|
||||||
if (empty($view->data['goods'])) {
|
if (empty($view->data['goods'])) {
|
||||||
return $view;
|
return $view;
|
||||||
|
|
@ -425,7 +440,7 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
$query = new Builder($con);
|
$query = new Builder($con);
|
||||||
|
|
||||||
$view->data['footnotes'] = $query->raw($sql)->execute()->fetchAll();
|
$view->data['footnotes'] = $query->raw($sql)->execute()?->fetchAll() ?? [];
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -453,8 +468,8 @@ final class BackendController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$con = new \phpOMS\DataStorage\Database\Connection\SQLiteConnection([
|
$con = new \phpOMS\DataStorage\Database\Connection\SQLiteConnection([
|
||||||
'db' => 'sqlite',
|
'db' => 'sqlite',
|
||||||
'database' => __DIR__ . '/../Data/customs.sqlite'
|
'database' => __DIR__ . '/../Data/customs.sqlite',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$con->connect();
|
$con->connect();
|
||||||
|
|
@ -474,7 +489,7 @@ final class BackendController extends Controller
|
||||||
$query->bind(['value' => '%' . $request->getDataString('hscode') . '%'], ':description');
|
$query->bind(['value' => '%' . $request->getDataString('hscode') . '%'], ':description');
|
||||||
$query->bind(['value' => '%' . $request->getDataString('hscode') . '%'], ':code');
|
$query->bind(['value' => '%' . $request->getDataString('hscode') . '%'], ':code');
|
||||||
|
|
||||||
$temp = $query->raw($sql)->execute()->fetchAll();
|
$temp = $query->raw($sql)->execute()?->fetchAll() ?? [];
|
||||||
|
|
||||||
if (($exactCount = \count($temp)) === 0) {
|
if (($exactCount = \count($temp)) === 0) {
|
||||||
return $view;
|
return $view;
|
||||||
|
|
@ -484,7 +499,7 @@ final class BackendController extends Controller
|
||||||
// For this reason we have to also load all the sub-categories
|
// For this reason we have to also load all the sub-categories
|
||||||
// Create code range by finding the last none-0 value and increasing that value by 1
|
// Create code range by finding the last none-0 value and increasing that value by 1
|
||||||
// While that value is a 9 the value is set to 0 and the left number is increased by 1
|
// While that value is a 9 the value is set to 0 and the left number is increased by 1
|
||||||
$codeRanges = [];
|
$codeRanges = [];
|
||||||
$exactMatches = [];
|
$exactMatches = [];
|
||||||
|
|
||||||
foreach ($temp as $code) {
|
foreach ($temp as $code) {
|
||||||
|
|
@ -495,7 +510,7 @@ final class BackendController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$length = \strlen($code['Goods_code']);
|
$length = \strlen($code['Goods_code']);
|
||||||
$max = \max(
|
$max = \max(
|
||||||
\strrpos($code['Goods_code'], '1', -3),
|
\strrpos($code['Goods_code'], '1', -3),
|
||||||
\strrpos($code['Goods_code'], '2', -3),
|
\strrpos($code['Goods_code'], '2', -3),
|
||||||
\strrpos($code['Goods_code'], '3', -3),
|
\strrpos($code['Goods_code'], '3', -3),
|
||||||
|
|
@ -506,7 +521,7 @@ final class BackendController extends Controller
|
||||||
\strrpos($code['Goods_code'], '8', -3),
|
\strrpos($code['Goods_code'], '8', -3),
|
||||||
\strrpos($code['Goods_code'], '9', -3),
|
\strrpos($code['Goods_code'], '9', -3),
|
||||||
);
|
);
|
||||||
$maxCode = $code['Goods_code'];
|
$maxCode = $code['Goods_code'];
|
||||||
$maxCode[$length - 1] = '0';
|
$maxCode[$length - 1] = '0';
|
||||||
$maxCode[$length - 2] = '0';
|
$maxCode[$length - 2] = '0';
|
||||||
|
|
||||||
|
|
@ -516,13 +531,13 @@ final class BackendController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$maxCode[$max] = ((int) $code['Goods_code'][$max]) + 1;
|
$maxCode[$max] = ((int) $code['Goods_code'][$max]) + 1;
|
||||||
$codeRanges[] = '(taric_good.Goods_code >= "' . $code['Goods_code'] . '"'
|
$codeRanges[] = '(taric_good.Goods_code >= "' . $code['Goods_code'] . '"'
|
||||||
. ' AND taric_good.Goods_code < "' . $maxCode . '")';
|
. ' AND taric_good.Goods_code < "' . $maxCode . '")';
|
||||||
}
|
}
|
||||||
|
|
||||||
$codeRanges = empty($codeRanges)
|
$codeRanges = empty($codeRanges)
|
||||||
? ''
|
? ''
|
||||||
: ' OR (' . \implode (' OR ', $codeRanges) . ')';
|
: ' OR (' . \implode(' OR ', $codeRanges) . ')';
|
||||||
|
|
||||||
$exactMatches = '"' . \implode('","', $exactMatches) . '"';
|
$exactMatches = '"' . \implode('","', $exactMatches) . '"';
|
||||||
|
|
||||||
|
|
@ -535,8 +550,8 @@ final class BackendController extends Controller
|
||||||
LIMIT 1000;
|
LIMIT 1000;
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
$query = new Builder($con);
|
$query = new Builder($con);
|
||||||
$view->data['codes'] = $query->raw($sql)->execute()->fetchAll();
|
$view->data['codes'] = $query->raw($sql)->execute()?->fetchAll() ?? [];
|
||||||
|
|
||||||
$con->close();
|
$con->close();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Jingga
|
||||||
|
*
|
||||||
|
* PHP Version 8.2
|
||||||
|
*
|
||||||
|
* @package Modules\Customs\Data
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
// Sources:
|
// Sources:
|
||||||
|
|
||||||
|
|
@ -29,13 +41,21 @@ if (\is_file($file)) {
|
||||||
|
|
||||||
$con = new SQLiteConnection(
|
$con = new SQLiteConnection(
|
||||||
[
|
[
|
||||||
'db' => 'sqlite',
|
'db' => 'sqlite',
|
||||||
'database' => $file,
|
'database' => $file,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$con->connect();
|
$con->connect();
|
||||||
|
|
||||||
$schema = \json_decode(\file_get_contents(__DIR__ . '/schema.json'), true);
|
$schemaContent = \file_get_contents(__DIR__ . '/schema.json');
|
||||||
|
if ($schemaContent === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$schema = \json_decode($schemaContent, true);
|
||||||
|
if (!\is_array($schema)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($schema as $table) {
|
foreach ($schema as $table) {
|
||||||
Builder::createFromSchema($table, $con)->execute();
|
Builder::createFromSchema($table, $con)->execute();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
# Structure
|
|
||||||
|
|
||||||
## ER
|
|
||||||
|
|
||||||

|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 48 KiB |
|
|
@ -13,7 +13,7 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['Navigation' => [
|
return ['Navigation' => [
|
||||||
'Customs' => 'Zoll',
|
'Customs' => 'Zoll',
|
||||||
'Sanctions' => 'Sanktionen',
|
'Sanctions' => 'Sanktionen',
|
||||||
'HSCode' => 'Zolltarifnummer',
|
'HSCode' => 'Zolltarifnummer',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['Navigation' => [
|
return ['Navigation' => [
|
||||||
'Customs' => 'Customs',
|
'Customs' => 'Customs',
|
||||||
'Sanctions' => 'Sanctions',
|
'Sanctions' => 'Sanctions',
|
||||||
'HSCode' => 'HS Code',
|
'HSCode' => 'HS Code',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -13,28 +13,28 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['Customs' => [
|
return ['Customs' => [
|
||||||
'HSCodes' => 'Zolltarifnummern',
|
'HSCodes' => 'Zolltarifnummern',
|
||||||
'Code' => 'ZTN',
|
'Code' => 'ZTN',
|
||||||
'Description' => 'Beschreibung',
|
'Description' => 'Beschreibung',
|
||||||
'Basic' => 'Standard',
|
'Basic' => 'Standard',
|
||||||
'Type' => 'Typ',
|
'Type' => 'Typ',
|
||||||
'Name' => 'Name',
|
'Name' => 'Name',
|
||||||
'Address' => 'Adresse',
|
'Address' => 'Adresse',
|
||||||
'Start' => 'Begin',
|
'Start' => 'Begin',
|
||||||
'City' => 'Stadt',
|
'City' => 'Stadt',
|
||||||
'Country' => 'Land',
|
'Country' => 'Land',
|
||||||
'Detail' => 'Detail',
|
'Detail' => 'Detail',
|
||||||
'Birthday' => 'Geburtstag',
|
'Birthday' => 'Geburtstag',
|
||||||
'Phone' => 'Telefon',
|
'Phone' => 'Telefon',
|
||||||
'Remark' => 'Bemerkung',
|
'Remark' => 'Bemerkung',
|
||||||
'Sanctions' => 'Sanktionen',
|
'Sanctions' => 'Sanktionen',
|
||||||
'Sanction' => 'Sanktion',
|
'Sanction' => 'Sanktion',
|
||||||
'IdentificationNumber' => 'Identifikationsnummer',
|
'IdentificationNumber' => 'Identifikationsnummer',
|
||||||
'MeasureType' => 'Measure Type',
|
'MeasureType' => 'Measure Type',
|
||||||
'Footnote' => 'Fußnote',
|
'Footnote' => 'Fußnote',
|
||||||
'FootnoteDescription' => 'Fußnote Beschreibung',
|
'FootnoteDescription' => 'Fußnote Beschreibung',
|
||||||
'ExportDuty' => 'Export Zoll',
|
'ExportDuty' => 'Export Zoll',
|
||||||
'ImportDuty' => 'Import Zoll',
|
'ImportDuty' => 'Import Zoll',
|
||||||
'AddCode' => 'Add Code',
|
'AddCode' => 'Add Code',
|
||||||
'AddDescription' => 'Add Beschreibung',
|
'AddDescription' => 'Add Beschreibung',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -13,28 +13,28 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['Customs' => [
|
return ['Customs' => [
|
||||||
'HSCodes' => 'HS Codes',
|
'HSCodes' => 'HS Codes',
|
||||||
'Code' => 'Code',
|
'Code' => 'Code',
|
||||||
'Description' => 'Description',
|
'Description' => 'Description',
|
||||||
'Basic' => 'Basic',
|
'Basic' => 'Basic',
|
||||||
'Type' => 'Type',
|
'Type' => 'Type',
|
||||||
'Name' => 'Name',
|
'Name' => 'Name',
|
||||||
'Address' => 'Address',
|
'Address' => 'Address',
|
||||||
'City' => 'City',
|
'City' => 'City',
|
||||||
'Start' => 'Start',
|
'Start' => 'Start',
|
||||||
'Country' => 'Country',
|
'Country' => 'Country',
|
||||||
'Detail' => 'Detail',
|
'Detail' => 'Detail',
|
||||||
'Birthday' => 'Birthday',
|
'Birthday' => 'Birthday',
|
||||||
'Phone' => 'Phone',
|
'Phone' => 'Phone',
|
||||||
'Remark' => 'Remark',
|
'Remark' => 'Remark',
|
||||||
'Sanctions' => 'Sanctions',
|
'Sanctions' => 'Sanctions',
|
||||||
'Sanction' => 'Sanction',
|
'Sanction' => 'Sanction',
|
||||||
'IdentificationNumber' => 'Identification Number',
|
'IdentificationNumber' => 'Identification Number',
|
||||||
'MeasureType' => 'Measure Type',
|
'MeasureType' => 'Measure Type',
|
||||||
'Footnote' => 'Footnote',
|
'Footnote' => 'Footnote',
|
||||||
'FootnoteDescription' => 'Footnote Description',
|
'FootnoteDescription' => 'Footnote Description',
|
||||||
'ExportDuty' => 'Export Duty',
|
'ExportDuty' => 'Export Duty',
|
||||||
'ImportDuty' => 'Import Duty',
|
'ImportDuty' => 'Import Duty',
|
||||||
'AddCode' => 'Add Code',
|
'AddCode' => 'Add Code',
|
||||||
'AddDescription' => 'Add Description',
|
'AddDescription' => 'Add Description',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,9 @@ $codes = $this->data['codes'] ?? [];
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 0;
|
<?php $count = 0;
|
||||||
foreach ($codes as $key => $value) : ++$count;
|
foreach ($codes as $key => $value) : ++$count;
|
||||||
$id = \substr($value['Goods_code'], 0, (int) \stripos($value['Goods_code'], ' '));
|
$id = \substr($value['Goods_code'], 0, (int) \stripos($value['Goods_code'], ' '));
|
||||||
$url = UriFactory::build('{/base}/customs/hscode/view?id=' . $id);
|
$url = UriFactory::build('{/base}/customs/hscode/view?id=' . $id);
|
||||||
$description = $this->printHtml($value['Description']);
|
$description = $this->printHtml($value['Description']);
|
||||||
$foundKeyword = \stripos($description, $this->request->getDataString('hscode'));
|
$foundKeyword = \stripos($description, $this->request->getDataString('hscode'));
|
||||||
|
|
||||||
if ($foundKeyword !== false) {
|
if ($foundKeyword !== false) {
|
||||||
|
|
@ -50,13 +50,13 @@ $codes = $this->data['codes'] ?? [];
|
||||||
// Whitespace handling is causing issues since the whitespace is only rendered if followed by another character
|
// Whitespace handling is causing issues since the whitespace is only rendered if followed by another character
|
||||||
// If whitespace found -> exclude from string -> add which gets always rendered unlike the whitespace
|
// If whitespace found -> exclude from string -> add which gets always rendered unlike the whitespace
|
||||||
$startsWithS = ($description[$foundKeyword - 1] ?? '') === ' ';
|
$startsWithS = ($description[$foundKeyword - 1] ?? '') === ' ';
|
||||||
$endsWithS = ($description[$foundKeyword + $len] ?? '') === ' ';
|
$endsWithS = ($description[$foundKeyword + $len] ?? '') === ' ';
|
||||||
|
|
||||||
$description = \substr($description, 0, $foundKeyword - ((int) $startsWithS))
|
$description = \substr($description, 0, $foundKeyword - ((int) $startsWithS))
|
||||||
. (($description[$foundKeyword - 1] ?? '') === ' ' ? ' ' : '')
|
. (($description[$foundKeyword - 1] ?? '') === ' ' ? ' ' : '')
|
||||||
. '<mark>' . \substr($description, $foundKeyword, $len) . '</mark>'
|
. '<mark>' . \substr($description, $foundKeyword, $len) . '</mark>'
|
||||||
. (($description[$foundKeyword + $len] ?? '') === ' ' ? ' ' : '')
|
. (($description[$foundKeyword + $len] ?? '') === ' ' ? ' ' : '')
|
||||||
. \substr($description, $foundKeyword + $len + ((int) $endsWithS));
|
. \substr($description, $foundKeyword + $len + ((int) $endsWithS));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
$footnotes = $this->data['footnotes'] ?? [];
|
$footnotes = $this->data['footnotes'] ?? [];
|
||||||
$goods = $this->data['goods'] ?? [];
|
$goods = $this->data['goods'] ?? [];
|
||||||
$baseDate = strtotime("1899-12-30");
|
$baseDate = \strtotime("1899-12-30");
|
||||||
?>
|
?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-6">
|
<div class="col-xs-12 col-md-6">
|
||||||
|
|
@ -9,8 +9,8 @@ $baseDate = strtotime("1899-12-30");
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<?php foreach ($goods as $good) : ?>
|
<?php foreach ($goods as $good) : ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><?= $good['Goods_code'] ?></label>
|
<label><?= $good['Goods_code']; ?></label>
|
||||||
<p><?= $good['Description'] ?></p>
|
<p><?= $good['Description']; ?></p>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -19,7 +19,7 @@ $baseDate = strtotime("1899-12-30");
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$length = \count($footnotes);
|
$length = \count($footnotes);
|
||||||
$lastOrigin = '';
|
$lastOrigin = '';
|
||||||
foreach ($footnotes as $idx => $value) :
|
foreach ($footnotes as $idx => $value) :
|
||||||
if ($lastOrigin === $value['Origin_code']) {
|
if ($lastOrigin === $value['Origin_code']) {
|
||||||
|
|
@ -46,8 +46,8 @@ foreach ($footnotes as $idx => $value) :
|
||||||
$start = '';
|
$start = '';
|
||||||
if (!empty($footnotes[$i]['Start_date'])) {
|
if (!empty($footnotes[$i]['Start_date'])) {
|
||||||
$seconds = $footnotes[$i]['Start_date'] * 86400;
|
$seconds = $footnotes[$i]['Start_date'] * 86400;
|
||||||
$date = new DateTime('@' . ($baseDate + $seconds));
|
$date = new DateTime('@' . ($baseDate + $seconds));
|
||||||
$start = $date->format('Y-m-d');
|
$start = $date->format('Y-m-d');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
},
|
},
|
||||||
"creator": {
|
"creator": {
|
||||||
"name": "Jingga",
|
"name": "Jingga",
|
||||||
"website": "jingga.app"
|
"website": "https://jingga.app"
|
||||||
},
|
},
|
||||||
"description": "The customs module.",
|
"description": "The customs module.",
|
||||||
"directory": "Customs",
|
"directory": "Customs",
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,6 @@ use phpOMS\DataStorage\Session\HttpSession;
|
||||||
use phpOMS\Dispatcher\Dispatcher;
|
use phpOMS\Dispatcher\Dispatcher;
|
||||||
use phpOMS\Event\EventManager;
|
use phpOMS\Event\EventManager;
|
||||||
use phpOMS\Localization\L11nManager;
|
use phpOMS\Localization\L11nManager;
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
|
||||||
use phpOMS\Message\Http\RequestStatusCode;
|
|
||||||
use phpOMS\Module\ModuleAbstract;
|
use phpOMS\Module\ModuleAbstract;
|
||||||
use phpOMS\Module\ModuleManager;
|
use phpOMS\Module\ModuleManager;
|
||||||
use phpOMS\Router\WebRouter;
|
use phpOMS\Router\WebRouter;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user