mirror of
https://github.com/Karaka-Management/oms-Production.git
synced 2026-01-10 13:38:41 +00:00
fix templates
This commit is contained in:
parent
5413acde61
commit
dc59b704eb
|
|
@ -12,12 +12,21 @@
|
|||
"production_machine_capacity": {
|
||||
"name": "production_machine_capacity",
|
||||
"type": "BIGINT",
|
||||
"null": true,
|
||||
"default": null
|
||||
},
|
||||
"production_machine_unitmeasure": {
|
||||
"name": "production_machine_unitmeasure",
|
||||
"type": "VARCHAR(16)",
|
||||
"null": false
|
||||
},
|
||||
"production_machine_unit": {
|
||||
"name": "production_machine_unit",
|
||||
"type": "VARCHAR(16)",
|
||||
"null": false
|
||||
"type": "INT",
|
||||
"null": true,
|
||||
"default": null,
|
||||
"foreignTable": "unit",
|
||||
"foreignKey": "unit_id"
|
||||
},
|
||||
"production_machine_equipment": {
|
||||
"name": "production_machine_equipment",
|
||||
|
|
|
|||
|
|
@ -68,19 +68,19 @@ return [
|
|||
],
|
||||
'^/production/machine/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Production\Controller\BackendController:viewProductionMachineCreate',
|
||||
'dest' => '\Modules\Production\Controller\BackendController:viewProductionMachineView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::MACHINE,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^/production/recipe/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Production\Controller\BackendController:viewProductionMachineList',
|
||||
'dest' => '\Modules\Production\Controller\BackendController:viewProductionRecipeList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
|
|
@ -92,7 +92,7 @@ return [
|
|||
],
|
||||
'^/production/recipe/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Production\Controller\BackendController:viewProductionMachineCreate',
|
||||
'dest' => '\Modules\Production\Controller\BackendController:viewProductionRecipeCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
|
|
@ -104,12 +104,12 @@ return [
|
|||
],
|
||||
'^/production/recipe/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Production\Controller\BackendController:viewProductionMachineCreate',
|
||||
'dest' => '\Modules\Production\Controller\BackendController:viewProductionRecipeView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::RECIPE,
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Production\Controller;
|
||||
|
||||
use Modules\Production\Models\MachineMapper;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
|
|
@ -68,6 +69,57 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Production/Theme/Backend/machine-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004303001, $request, $response);
|
||||
|
||||
$view->data['machines'] = MachineMapper::getAll()
|
||||
->with('equipment')
|
||||
->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Routing end-point for application behavior.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param array $data Generic data
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewProductionMachineView(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Production/Theme/Backend/machine-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004303001, $request, $response);
|
||||
|
||||
$view->data['machine'] = MachineMapper::get()
|
||||
->with('equipment')
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->execute();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Routing end-point for application behavior.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param array $data Generic data
|
||||
*
|
||||
* @return RenderableInterface
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewProductionMachineCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Production/Theme/Backend/machine-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004303001, $request, $response);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +138,7 @@ final class BackendController extends Controller
|
|||
public function viewProductionCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Production/Theme/Backend/production-create');
|
||||
$view->setTemplate('/Modules/Production/Theme/Backend/production-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004303001, $request, $response);
|
||||
|
||||
return $view;
|
||||
|
|
|
|||
45
Models/Machine.php
Normal file
45
Models/Machine.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Production\Models;
|
||||
|
||||
use Modules\EquipmentManagement\Models\Equipment;
|
||||
use Modules\EquipmentManagement\Models\NullEquipment;
|
||||
use phpOMS\Stdlib\Base\FloatInt;
|
||||
|
||||
/**
|
||||
* Machine class.
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Machine
|
||||
{
|
||||
public int $id = 0;
|
||||
|
||||
public Equipment $equipment;
|
||||
|
||||
public ?FloatInt $capacity = null;
|
||||
|
||||
public string $unitOfMeasure = '';
|
||||
|
||||
public int $unit = 0;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->equipment = new NullEquipment();
|
||||
}
|
||||
}
|
||||
84
Models/MachineMapper.php
Normal file
84
Models/MachineMapper.php
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Production\Models;
|
||||
|
||||
use Modules\EquipmentManagement\Models\EquipmentMapper;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Machine mapper class.
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @template T of Machine
|
||||
* @extends DataMapperFactory<T>
|
||||
*/
|
||||
final class MachineMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
*
|
||||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'production_machine_id' => ['name' => 'production_machine_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'production_machine_capacity' => ['name' => 'production_machine_capacity', 'type' => 'int', 'internal' => 'capacity'],
|
||||
'production_machine_equipment' => ['name' => 'production_machine_equipment', 'type' => 'int', 'internal' => 'equipment'],
|
||||
'production_machine_unitmeasure' => ['name' => 'production_machine_unitmeasure', 'type' => 'string', 'internal' => 'unitOfMeasure'],
|
||||
'production_machine_unit' => ['name' => 'production_machine_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'production_machine_created_at' => ['name' => 'production_machine_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
];
|
||||
|
||||
/**
|
||||
* Has one relation.
|
||||
*
|
||||
* @var array<string, array{mapper:class-string, external:string, by?:string, column?:string, conditional?:bool}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const OWNS_ONE = [
|
||||
'equipment' => [
|
||||
'mapper' => EquipmentMapper::class,
|
||||
'external' => 'production_machine_equipment',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Primary table.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const TABLE = 'production_machine';
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const CREATED_AT = 'production_machine_created_at';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const PRIMARYFIELD = 'production_machine_id';
|
||||
}
|
||||
47
Models/NullMachine.php
Normal file
47
Models/NullMachine.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Production\Models;
|
||||
|
||||
/**
|
||||
* Null model
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class NullMachine extends Machine
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param int $id Model id
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct(int $id = 0)
|
||||
{
|
||||
$this->id = $id;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function jsonSerialize() : mixed
|
||||
{
|
||||
return ['id' => $this->id];
|
||||
}
|
||||
}
|
||||
28
Models/NullProduction.php
Normal file
28
Models/NullProduction.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Production\Models;
|
||||
|
||||
/**
|
||||
* Production model.
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class NullProduction extends Production
|
||||
{
|
||||
|
||||
}
|
||||
54
Models/Production.php
Normal file
54
Models/Production.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Production\Models;
|
||||
|
||||
use Modules\Billing\Models\Bill;
|
||||
use Modules\ItemManagement\Models\Item;
|
||||
use Modules\ItemManagement\Models\NullItem;
|
||||
|
||||
/**
|
||||
* Production model.
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class Production
|
||||
{
|
||||
public int $id = 0;
|
||||
|
||||
public string $number = '';
|
||||
|
||||
public int $status = ProductionStatus::ACTIVE;
|
||||
|
||||
public \DateTimeImmutable $createdAt;
|
||||
|
||||
public ?\DateTime $start = null;
|
||||
|
||||
public ?\DateTime $expectedEnd = null;
|
||||
|
||||
public ?\DateTime $end = null;
|
||||
|
||||
public ?Bill $bill = null;
|
||||
|
||||
public Item $item;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->createdAt = new \DateTimeImmutable('now');
|
||||
$this->item = new NullItem();
|
||||
}
|
||||
}
|
||||
36
Models/ProductionStatus.php
Normal file
36
Models/ProductionStatus.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Production\Models;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
||||
/**
|
||||
* Permission category enum.
|
||||
*
|
||||
* @package Modules\Production\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
abstract class ProductionStatus extends Enum
|
||||
{
|
||||
public const DRAFT = 1;
|
||||
|
||||
public const ACTIVE = 2;
|
||||
|
||||
public const FINISHED = 3;
|
||||
|
||||
public const CANCELED = 4;
|
||||
}
|
||||
|
|
@ -17,12 +17,20 @@ return ['Production' => [
|
|||
'Due' => 'Fällig',
|
||||
'For' => 'Für',
|
||||
'Name' => 'Name',
|
||||
'Items' => 'Artikel',
|
||||
'Ordered' => 'Bestellt',
|
||||
'Orderer' => 'Besteller',
|
||||
'Process' => 'Prozess',
|
||||
'Product' => 'Product',
|
||||
'Productions' => 'Produktionen',
|
||||
'Quantity' => 'Menge',
|
||||
'Machines' => 'Maschinen',
|
||||
'Machine' => 'Maschine',
|
||||
'Start' => 'Start',
|
||||
'Status' => 'Status',
|
||||
'Number' => 'Nummer',
|
||||
'Item' => 'Artikel',
|
||||
'ExpectedEnd' => 'Erwartete Fertigstellung',
|
||||
'Bill' => 'Beleg',
|
||||
'Production' => 'Produktion',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -17,12 +17,21 @@ return ['Production' => [
|
|||
'Due' => 'Due',
|
||||
'For' => 'For',
|
||||
'Name' => 'Name',
|
||||
'Items' => 'Items',
|
||||
'Item' => 'Item',
|
||||
'Ordered' => 'Ordered',
|
||||
'Orderer' => 'Orderer',
|
||||
'Process' => 'Process',
|
||||
'Product' => 'Product',
|
||||
'Productions' => 'Productions',
|
||||
'Production' => 'Production',
|
||||
'Quantity' => 'Quantity',
|
||||
'Start' => 'Start',
|
||||
'Machines' => 'Machines',
|
||||
'Machine' => 'Machine',
|
||||
'Status' => 'Status',
|
||||
'Number' => 'Number',
|
||||
'Item' => 'Item',
|
||||
'ExpectedEnd' => 'Expected End',
|
||||
'Bill' => 'Bill',
|
||||
]];
|
||||
|
|
|
|||
87
Theme/Backend/machine-list.tpl.php
Normal file
87
Theme/Backend/machine-list.tpl.php
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$machines = $this->data['machines'] ?? [];
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Machines'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<div class="slider">
|
||||
<table id="iMachineList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<label for="iMachineList-sort-1">
|
||||
<input type="radio" name="iMachineList-sort" id="iMachineList-sort-1">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iMachineList-sort-2">
|
||||
<input type="radio" name="iMachineList-sort" id="iMachineList-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('Status'); ?>
|
||||
<label for="iMachineList-sort-3">
|
||||
<input type="radio" name="iMachineList-sort" id="iMachineList-sort-3">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iMachineList-sort-4">
|
||||
<input type="radio" name="iMachineList-sort" id="iMachineList-sort-4">
|
||||
<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="iMachineList-sort-5">
|
||||
<input type="radio" name="iMachineList-sort" id="iMachineList-sort-5">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iMachineList-sort-6">
|
||||
<input type="radio" name="iMachineList-sort" id="iMachineList-sort-6">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<tbody>
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($machines as $key => $value) :
|
||||
++$count;
|
||||
$url = UriFactory::build('{/base}/production/machine/view?{?}&id=' . $value->equipment->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td>
|
||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->equipment->id; ?></a>
|
||||
<td data-label="<?= $this->getHtml('Status'); ?>"><a href="<?= $url; ?>"><?= $this->getHtml(':status' . $value->equipment->status); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->equipment->name); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
124
Theme/Backend/machine-view.tpl.php
Normal file
124
Theme/Backend/machine-view.tpl.php
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\EquipmentManagement\Models\EquipmentStatus;
|
||||
use Modules\Media\Models\NullMedia;
|
||||
use Modules\Production\Models\NullMachine;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/**
|
||||
* @var \Modules\MachineManagement\Models\Machine $machine
|
||||
*/
|
||||
$machine = $this->data['machine'] ?? new NullMachine();
|
||||
$machineImage = $this->data['machineImage'] ?? new NullMedia();
|
||||
$isNew = $machine->id === 0;
|
||||
|
||||
$equipmentStatus = EquipmentStatus::getConstants();
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
echo $this->data['nav']->render();
|
||||
?>
|
||||
<div class="tabview tab-2">
|
||||
<?php if (!$isNew) : ?>
|
||||
<div class="box">
|
||||
<ul class="tab-links">
|
||||
<li><label for="c-tab-1"><?= $this->getHtml('Machine'); ?></label>
|
||||
<li><label for="c-tab-2"><?= $this->getHtml('Items'); ?></label>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="tab-content">
|
||||
<input type="radio" id="c-tab-1" name="tabular-2"<?= $isNew || $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Machine'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iMachineProfileName"><?= $this->getHtml('Name', 'EquipmentManagement', 'Backend'); ?></label>
|
||||
<input type="text" id="iMachineProfileName" name="name" value="<?= $this->printHtml($machine->equipment->name); ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMachineNumber"><?= $this->getHtml('Number', 'EquipmentManagement', 'Backend'); ?></label>
|
||||
<input type="text" id="iMachineNumber" name="code" value="<?= $this->printHtml($machine->equipment->code); ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMachineEquipment"><?= $this->getHtml('Equipment', 'EquipmentManagement', 'Backend'); ?></label>
|
||||
<input type="text" id="iMachineEquipment" name="equipment" value="<?= $this->printHtml($machine->equipment->code); ?>"<?= $isNew ? '' : ' disabled'; ?>>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMachineStatus"><?= $this->getHtml('Status', 'EquipmentManagement', 'Backend'); ?></label>
|
||||
<select id="iMachineStatus" name="machine_status" disabled>
|
||||
<?php foreach ($equipmentStatus as $status) : ?>
|
||||
<option value="<?= $status; ?>"<?= $status === $machine->equipment->status ? ' selected' : ''; ?>><?= $this->getHtml(':status' . $status, 'EquipmentManagement', 'Backend'); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMachineMake"><?= $this->getHtml('Make', 'EquipmentManagement', 'Backend'); ?></label>
|
||||
<input type="text" id="iMachineMake" name="make" value="<?= $this->printHtml($machine->equipment->getAttribute('maker')->value->getValue()); ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMachineModel"><?= $this->getHtml('Model', 'EquipmentManagement', 'Backend'); ?></label>
|
||||
<input type="text" id="iMachineModel" name="machine_model" value="<?= $this->printHtml($machine->equipment->getAttribute('machine_model')->value->getValue()); ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMachineStart"><?= $this->getHtml('Start', 'EquipmentManagement', 'Backend'); ?></label>
|
||||
<input type="datetime-local" id="iMachineStart" name="ownership_start" value="<?= $machine->equipment->getAttribute('ownership_start')->value->getValue()?->format('Y-m-d\TH:i') ?? $machine->equipment->createdAt->format('Y-m-d\TH:i'); ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMachineEnd"><?= $this->getHtml('End', 'EquipmentManagement', 'Backend'); ?></label>
|
||||
<input type="datetime-local" id="iMachineEnd" name="ownership_end" value="<?= $machine->equipment->getAttribute('ownership_end')->value->getValue()?->format('Y-m-d\TH:i'); ?>" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?php if ($machine->equipment->id === 0) : ?>
|
||||
<input id="iCreateSubmit" type="Submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||
<?php else : ?>
|
||||
<input id="iSaveSubmit" type="Submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-body">
|
||||
<img width="100%" src="<?= $machineImage->id === 0
|
||||
? 'Web/Backend/img/logo_grey.png'
|
||||
: UriFactory::build($machineImage->getPath()); ?>"></a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!$isNew) : ?>
|
||||
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
$task = new \Modules\Tasks\Models\Task(null);
|
||||
|
|
@ -16,13 +16,6 @@ declare(strict_types=1);
|
|||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
|
||||
$footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response);
|
||||
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
|
||||
|
||||
$footerView->setPages(25);
|
||||
$footerView->setPage(1);
|
||||
$footerView->setResults(1);
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
|
|
@ -35,25 +28,25 @@ echo $this->data['nav']->render(); ?>
|
|||
<tr>
|
||||
<td><?= $this->getHtml('Status'); ?>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Article'); ?>
|
||||
<td><?= $this->getHtml('Quantity'); ?>
|
||||
<td><?= $this->getHtml('Start'); ?>
|
||||
<td><?= $this->getHtml('Due'); ?>
|
||||
<td><?= $this->getHtml('Done'); ?>
|
||||
<tbody>
|
||||
<?php $c = 0; foreach ([] as $key => $value) : ++$c;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/prefix}business/department/view?{?}&id=' . $value->id); ?>
|
||||
<?php $c = 0;
|
||||
foreach ([] as $key => $value) : ++$c;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/prefix}/production/machine/view?{?}&id=' . $value->id); ?>
|
||||
<tr>
|
||||
<td><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getName()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getParent()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getUnit()); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr>
|
||||
<td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
108
Theme/Backend/production-view.tpl.php
Normal file
108
Theme/Backend/production-view.tpl.php
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Production
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\Production\Models\NullProduction;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
$production = $this->data['production'] ?? new NullProduction();
|
||||
$isNew = $production->id === 0;
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="tabview tab-2">
|
||||
<?php if (!$isNew) : ?>
|
||||
<div class="box">
|
||||
<ul class="tab-links">
|
||||
<li><label for="c-tab-1"><?= $this->getHtml('Production'); ?></label>
|
||||
<li><label for="c-tab-2"><?= $this->getHtml('Parts'); ?></label>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="tab-content">
|
||||
<input type="radio" id="c-tab-1" name="tabular-2"<?= $isNew || $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<?php if ($isNew) : ?>
|
||||
<section class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iBill"><?= $this->getHtml('Bill'); ?></label>
|
||||
<input type="text" name="bill" id="iBill">
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<input id="iCreateSubmit" type="Submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="portlet">
|
||||
<form method="<?= $isNew ? 'PUT' : 'POST'; ?>" action="<?= UriFactory::build('{/api}production/view?csrf={$CSRF}'); ?>">
|
||||
<div class="portlet-head"><?= $this->getHtml('Production'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||
<input type="text" name="id" id="iId" value="<?= $production->id; ?>" disabled>
|
||||
</div>
|
||||
|
||||
<?php if (!$isNew) : ?>
|
||||
<div class="form-group">
|
||||
<label for="iStatus"><?= $this->getHtml('Status'); ?></label>
|
||||
<input type="text" name="number" id="iStatus" value="<?= $this->printHtml($production->item->getL11n('name1')->name); ?>" required>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iNumber"><?= $this->getHtml('Number'); ?></label>
|
||||
<input type="text" name="number" id="iNumber" value="<?= $this->printHtml($production->number); ?>" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iItem"><?= $this->getHtml('Item'); ?></label>
|
||||
<input type="text" name="number" id="iItem" value="<?= $this->printHtml($production->item->getL11n('name1')->name); ?>" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iQuantity"><?= $this->getHtml('Quantity'); ?></label>
|
||||
<input type="text" name="number" id="iQuantity" value="<?= $this->printHtml($production->item->getL11n('name1')->name); ?>" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iStart"><?= $this->getHtml('Start'); ?></label>
|
||||
<input type="date" name="start" id="iStart" value="<?= $production->start?->format('Y-m-d'); ?>" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iExpectedEnd"><?= $this->getHtml('ExpectedEnd'); ?></label>
|
||||
<input type="date" name="expected_end" id="iExpectedEnd" value="<?= $production->expectedEnd?->format('Y-m-d'); ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?php if ($isNew) : ?>
|
||||
<input id="iCreateSubmit" type="Submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||
<?php else : ?>
|
||||
<input id="iSaveSubmit" type="Submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user