auto fixes + some impl.

This commit is contained in:
Dennis Eichhorn 2024-01-26 22:53:59 +00:00
parent dccf1df831
commit 6549ec0323
12 changed files with 107 additions and 96 deletions

View File

@ -20,7 +20,6 @@ use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Module\InstallerAbstract;
use phpOMS\Module\ModuleInfo;
use phpOMS\Uri\HttpUri;
/**
* Installer class.
@ -83,7 +82,7 @@ final class Installer extends InstallerAbstract
foreach ($layouts as $layout) {
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', \reset($layout['l11n']));
@ -123,7 +122,7 @@ final class Installer extends InstallerAbstract
}
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', $l11n);

View File

@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/warehouse/labeling/item/list.*$' => [
'^.*/warehouse/labeling/item/list(\?.*$|$)' => [
[
'dest' => '\Modules\Labeling\Controller\BackendController:viewItemList',
'verb' => RouteVerb::GET,
@ -17,7 +17,7 @@ return [
],
],
],
'^.*/warehouse/labeling/item\?.*$' => [
'^.*/warehouse/labeling/item(\?.*$|$)' => [
[
'dest' => '\Modules\Labeling\Controller\BackendController:viewItem',
'verb' => RouteVerb::GET,
@ -28,7 +28,7 @@ return [
],
],
],
'^.*/warehouse/labeling/layout\?.*$' => [
'^.*/warehouse/labeling/layout(\?.*$|$)' => [
[
'dest' => '\Modules\Labeling\Controller\BackendController:viewLayout',
'verb' => RouteVerb::GET,
@ -39,7 +39,7 @@ return [
],
],
],
'^.*/warehouse/labeling/layout/list.*$' => [
'^.*/warehouse/labeling/layout/list(\?.*$|$)' => [
[
'dest' => '\Modules\Labeling\Controller\BackendController:viewItemLabelList',
'verb' => RouteVerb::GET,

View File

@ -94,7 +94,10 @@ final class ApiController extends Controller
private function createLabelLayoutFromRequest(RequestAbstract $request) : LabelLayout
{
$labelLayout = new LabelLayout();
$labelLayout->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
$labelLayout->setL11n(
$request->getDataString('title') ?? '',
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
);
$path = '/Modules/Labeling/Templates/' . $request->getDataString('title');
$uploadedFiles = $request->files;
@ -178,9 +181,7 @@ final class ApiController extends Controller
{
$labelLayoutL11n = new BaseStringL11n();
$labelLayoutL11n->ref = $request->getDataInt('layout') ?? 0;
$labelLayoutL11n->setLanguage(
$request->getDataString('language') ?? $request->header->l11n->language
);
$labelLayoutL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
$labelLayoutL11n->content = $request->getDataString('title') ?? '';
return $labelLayoutL11n;

View File

@ -61,12 +61,12 @@ class LabelLayout implements \JsonSerializable
$this->l11n = $l11n;
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
$this->l11n->content = $l11n;
$this->l11n->setLanguage($lang);
$this->l11n->language = $lang;
} else {
$this->l11n = new BaseStringL11n();
$this->l11n->content = $l11n;
$this->l11n->ref = $this->id;
$this->l11n->setLanguage($lang);
$this->l11n->language = $lang;
}
}

View File

@ -25,53 +25,53 @@ echo $this->data['nav']->render(); ?>
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Items', 'ItemManagement', 'Backend'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="iSalesItemList" class="default sticky">
<table id="iItemList" class="default sticky">
<thead>
<tr>
<td>
<td><?= $this->getHtml('Number', 'ItemManagement', 'Backend'); ?>
<label for="iSalesItemList-sort-1">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-1">
<label for="iItemList-sort-1">
<input type="radio" name="iItemList-sort" id="iItemList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesItemList-sort-2">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-2">
<label for="iItemList-sort-2">
<input type="radio" name="iItemList-sort" id="iItemList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
<label for="iSalesItemList-sort-3">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-3">
<label for="iItemList-sort-3">
<input type="radio" name="iItemList-sort" id="iItemList-sort-3">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesItemList-sort-4">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-4">
<label for="iItemList-sort-4">
<input type="radio" name="iItemList-sort" id="iItemList-sort-4">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
<label for="iSalesItemList-sort-5">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-5">
<label for="iItemList-sort-5">
<input type="radio" name="iItemList-sort" id="iItemList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesItemList-sort-6">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-6">
<label for="iItemList-sort-6">
<input type="radio" name="iItemList-sort" id="iItemList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
<label for="iSalesItemList-sort-7">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-7">
<label for="iItemList-sort-7">
<input type="radio" name="iItemList-sort" id="iItemList-sort-7">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesItemList-sort-8">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-8">
<label for="iItemList-sort-8">
<input type="radio" name="iItemList-sort" id="iItemList-sort-8">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>

View File

@ -25,29 +25,29 @@ echo $this->data['nav']->render(); ?>
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Layouts'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="iSalesItemList" class="default sticky">
<table id="iLayoutList" class="default sticky">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="iSalesItemList-sort-1">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-1">
<label for="iLayoutList-sort-1">
<input type="radio" name="iLayoutList-sort" id="iLayoutList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesItemList-sort-2">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-2">
<label for="iLayoutList-sort-2">
<input type="radio" name="iLayoutList-sort" id="iLayoutList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<label for="iSalesItemList-sort-1">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-1">
<label for="iLayoutList-sort-1">
<input type="radio" name="iLayoutList-sort" id="iLayoutList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="iSalesItemList-sort-2">
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-2">
<label for="iLayoutList-sort-2">
<input type="radio" name="iLayoutList-sort" id="iLayoutList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>

View File

@ -1,4 +1,15 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Labeling\tests
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
\ini_set('memory_limit', '2048M');