mirror of
https://github.com/Karaka-Management/oms-Labeling.git
synced 2026-02-11 15:18:41 +00:00
auto fixes + some impl.
This commit is contained in:
parent
dccf1df831
commit
6549ec0323
|
|
@ -20,7 +20,6 @@ use phpOMS\Message\Http\HttpRequest;
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
use phpOMS\Message\Http\HttpResponse;
|
||||||
use phpOMS\Module\InstallerAbstract;
|
use phpOMS\Module\InstallerAbstract;
|
||||||
use phpOMS\Module\ModuleInfo;
|
use phpOMS\Module\ModuleInfo;
|
||||||
use phpOMS\Uri\HttpUri;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Installer class.
|
* Installer class.
|
||||||
|
|
@ -83,7 +82,7 @@ final class Installer extends InstallerAbstract
|
||||||
|
|
||||||
foreach ($layouts as $layout) {
|
foreach ($layouts as $layout) {
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', \reset($layout['l11n']));
|
$request->setData('title', \reset($layout['l11n']));
|
||||||
|
|
@ -123,7 +122,7 @@ final class Installer extends InstallerAbstract
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', $l11n);
|
$request->setData('title', $l11n);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
|
||||||
use phpOMS\Router\RouteVerb;
|
use phpOMS\Router\RouteVerb;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'^.*/warehouse/labeling/item/list.*$' => [
|
'^.*/warehouse/labeling/item/list(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Labeling\Controller\BackendController:viewItemList',
|
'dest' => '\Modules\Labeling\Controller\BackendController:viewItemList',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -17,7 +17,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/warehouse/labeling/item\?.*$' => [
|
'^.*/warehouse/labeling/item(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Labeling\Controller\BackendController:viewItem',
|
'dest' => '\Modules\Labeling\Controller\BackendController:viewItem',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -28,7 +28,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/warehouse/labeling/layout\?.*$' => [
|
'^.*/warehouse/labeling/layout(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Labeling\Controller\BackendController:viewLayout',
|
'dest' => '\Modules\Labeling\Controller\BackendController:viewLayout',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -39,7 +39,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/warehouse/labeling/layout/list.*$' => [
|
'^.*/warehouse/labeling/layout/list(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Labeling\Controller\BackendController:viewItemLabelList',
|
'dest' => '\Modules\Labeling\Controller\BackendController:viewItemLabelList',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,10 @@ final class ApiController extends Controller
|
||||||
private function createLabelLayoutFromRequest(RequestAbstract $request) : LabelLayout
|
private function createLabelLayoutFromRequest(RequestAbstract $request) : LabelLayout
|
||||||
{
|
{
|
||||||
$labelLayout = new 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');
|
$path = '/Modules/Labeling/Templates/' . $request->getDataString('title');
|
||||||
$uploadedFiles = $request->files;
|
$uploadedFiles = $request->files;
|
||||||
|
|
@ -178,9 +181,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
$labelLayoutL11n = new BaseStringL11n();
|
$labelLayoutL11n = new BaseStringL11n();
|
||||||
$labelLayoutL11n->ref = $request->getDataInt('layout') ?? 0;
|
$labelLayoutL11n->ref = $request->getDataInt('layout') ?? 0;
|
||||||
$labelLayoutL11n->setLanguage(
|
$labelLayoutL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
|
||||||
$request->getDataString('language') ?? $request->header->l11n->language
|
|
||||||
);
|
|
||||||
$labelLayoutL11n->content = $request->getDataString('title') ?? '';
|
$labelLayoutL11n->content = $request->getDataString('title') ?? '';
|
||||||
|
|
||||||
return $labelLayoutL11n;
|
return $labelLayoutL11n;
|
||||||
|
|
|
||||||
|
|
@ -61,12 +61,12 @@ class LabelLayout implements \JsonSerializable
|
||||||
$this->l11n = $l11n;
|
$this->l11n = $l11n;
|
||||||
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
|
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
|
||||||
$this->l11n->content = $l11n;
|
$this->l11n->content = $l11n;
|
||||||
$this->l11n->setLanguage($lang);
|
$this->l11n->language = $lang;
|
||||||
} else {
|
} else {
|
||||||
$this->l11n = new BaseStringL11n();
|
$this->l11n = new BaseStringL11n();
|
||||||
$this->l11n->content = $l11n;
|
$this->l11n->content = $l11n;
|
||||||
$this->l11n->ref = $this->id;
|
$this->l11n->ref = $this->id;
|
||||||
$this->l11n->setLanguage($lang);
|
$this->l11n->language = $lang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,53 +25,53 @@ echo $this->data['nav']->render(); ?>
|
||||||
<section class="portlet">
|
<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="portlet-head"><?= $this->getHtml('Items', 'ItemManagement', 'Backend'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||||
<div class="slider">
|
<div class="slider">
|
||||||
<table id="iSalesItemList" class="default sticky">
|
<table id="iItemList" class="default sticky">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<td><?= $this->getHtml('Number', 'ItemManagement', 'Backend'); ?>
|
<td><?= $this->getHtml('Number', 'ItemManagement', 'Backend'); ?>
|
||||||
<label for="iSalesItemList-sort-1">
|
<label for="iItemList-sort-1">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-1">
|
<input type="radio" name="iItemList-sort" id="iItemList-sort-1">
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
<i class="sort-asc g-icon">expand_less</i>
|
||||||
</label>
|
</label>
|
||||||
<label for="iSalesItemList-sort-2">
|
<label for="iItemList-sort-2">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-2">
|
<input type="radio" name="iItemList-sort" id="iItemList-sort-2">
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
<i class="sort-desc g-icon">expand_more</i>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<i class="filter g-icon">filter_alt</i>
|
<i class="filter g-icon">filter_alt</i>
|
||||||
</label>
|
</label>
|
||||||
<td><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
<td><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
||||||
<label for="iSalesItemList-sort-3">
|
<label for="iItemList-sort-3">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-3">
|
<input type="radio" name="iItemList-sort" id="iItemList-sort-3">
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
<i class="sort-asc g-icon">expand_less</i>
|
||||||
</label>
|
</label>
|
||||||
<label for="iSalesItemList-sort-4">
|
<label for="iItemList-sort-4">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-4">
|
<input type="radio" name="iItemList-sort" id="iItemList-sort-4">
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
<i class="sort-desc g-icon">expand_more</i>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<i class="filter g-icon">filter_alt</i>
|
<i class="filter g-icon">filter_alt</i>
|
||||||
</label>
|
</label>
|
||||||
<td><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
<td><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
||||||
<label for="iSalesItemList-sort-5">
|
<label for="iItemList-sort-5">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-5">
|
<input type="radio" name="iItemList-sort" id="iItemList-sort-5">
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
<i class="sort-asc g-icon">expand_less</i>
|
||||||
</label>
|
</label>
|
||||||
<label for="iSalesItemList-sort-6">
|
<label for="iItemList-sort-6">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-6">
|
<input type="radio" name="iItemList-sort" id="iItemList-sort-6">
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
<i class="sort-desc g-icon">expand_more</i>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<i class="filter g-icon">filter_alt</i>
|
<i class="filter g-icon">filter_alt</i>
|
||||||
</label>
|
</label>
|
||||||
<td class="wf-100"><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
<td class="wf-100"><?= $this->getHtml('Name', 'ItemManagement', 'Backend'); ?>
|
||||||
<label for="iSalesItemList-sort-7">
|
<label for="iItemList-sort-7">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-7">
|
<input type="radio" name="iItemList-sort" id="iItemList-sort-7">
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
<i class="sort-asc g-icon">expand_less</i>
|
||||||
</label>
|
</label>
|
||||||
<label for="iSalesItemList-sort-8">
|
<label for="iItemList-sort-8">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-8">
|
<input type="radio" name="iItemList-sort" id="iItemList-sort-8">
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
<i class="sort-desc g-icon">expand_more</i>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
|
|
|
||||||
|
|
@ -25,29 +25,29 @@ echo $this->data['nav']->render(); ?>
|
||||||
<section class="portlet">
|
<section class="portlet">
|
||||||
<div class="portlet-head"><?= $this->getHtml('Layouts'); ?><i class="g-icon download btn end-xs">download</i></div>
|
<div class="portlet-head"><?= $this->getHtml('Layouts'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||||
<div class="slider">
|
<div class="slider">
|
||||||
<table id="iSalesItemList" class="default sticky">
|
<table id="iLayoutList" class="default sticky">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||||
<label for="iSalesItemList-sort-1">
|
<label for="iLayoutList-sort-1">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-1">
|
<input type="radio" name="iLayoutList-sort" id="iLayoutList-sort-1">
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
<i class="sort-asc g-icon">expand_less</i>
|
||||||
</label>
|
</label>
|
||||||
<label for="iSalesItemList-sort-2">
|
<label for="iLayoutList-sort-2">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-2">
|
<input type="radio" name="iLayoutList-sort" id="iLayoutList-sort-2">
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
<i class="sort-desc g-icon">expand_more</i>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<i class="filter g-icon">filter_alt</i>
|
<i class="filter g-icon">filter_alt</i>
|
||||||
</label>
|
</label>
|
||||||
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
||||||
<label for="iSalesItemList-sort-1">
|
<label for="iLayoutList-sort-1">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-1">
|
<input type="radio" name="iLayoutList-sort" id="iLayoutList-sort-1">
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
<i class="sort-asc g-icon">expand_less</i>
|
||||||
</label>
|
</label>
|
||||||
<label for="iSalesItemList-sort-2">
|
<label for="iLayoutList-sort-2">
|
||||||
<input type="radio" name="iSalesItemList-sort" id="iSalesItemList-sort-2">
|
<input type="radio" name="iLayoutList-sort" id="iLayoutList-sort-2">
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
<i class="sort-desc g-icon">expand_more</i>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,15 @@
|
||||||
<?php
|
<?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);
|
declare(strict_types=1);
|
||||||
|
|
||||||
\ini_set('memory_limit', '2048M');
|
\ini_set('memory_limit', '2048M');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user