mirror of
https://github.com/Karaka-Management/oms-EquipmentManagement.git
synced 2026-02-17 18:48:41 +00:00
started with template fixes
This commit is contained in:
parent
6d8e4ee44d
commit
868255f65c
|
|
@ -93,7 +93,7 @@
|
||||||
"pid": "/equipment/inspection",
|
"pid": "/equipment/inspection",
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "EquipmentInspectionTypes",
|
"name": "InspectionTypes",
|
||||||
"uri": "{/base}/equipment/inspection/type/list?{?}",
|
"uri": "{/base}/equipment/inspection/type/list?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
"pid": "/",
|
"pid": "/",
|
||||||
"type": 2,
|
"type": 2,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "EquipmentAttributes",
|
"name": "Attributes",
|
||||||
"uri": "{/base}/equipment/attribute/type/list?{?}",
|
"uri": "{/base}/equipment/attribute/type/list?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ return [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\EquipmentManagement\Controller\ApiController:apiEquipmentFind',
|
'dest' => '\Modules\EquipmentManagement\Controller\ApiController:apiEquipmentFind',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
'csrf' => true,
|
||||||
'permission' => [
|
'permission' => [
|
||||||
'module' => Controller::NAME,
|
'module' => Controller::NAME,
|
||||||
'type' => PermissionType::READ,
|
'type' => PermissionType::READ,
|
||||||
|
|
@ -34,6 +35,7 @@ return [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\EquipmentManagement\Controller\ApiEquipmentAttributeController:apiEquipmentAttributeCreate',
|
'dest' => '\Modules\EquipmentManagement\Controller\ApiEquipmentAttributeController:apiEquipmentAttributeCreate',
|
||||||
'verb' => RouteVerb::PUT,
|
'verb' => RouteVerb::PUT,
|
||||||
|
'csrf' => true,
|
||||||
'permission' => [
|
'permission' => [
|
||||||
'module' => Controller::NAME,
|
'module' => Controller::NAME,
|
||||||
'type' => PermissionType::READ,
|
'type' => PermissionType::READ,
|
||||||
|
|
@ -43,6 +45,7 @@ return [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\EquipmentManagement\Controller\ApiEquipmentAttributeController:apiEquipmentAttributeUpdate',
|
'dest' => '\Modules\EquipmentManagement\Controller\ApiEquipmentAttributeController:apiEquipmentAttributeUpdate',
|
||||||
'verb' => RouteVerb::SET,
|
'verb' => RouteVerb::SET,
|
||||||
|
'csrf' => true,
|
||||||
'permission' => [
|
'permission' => [
|
||||||
'module' => Controller::NAME,
|
'module' => Controller::NAME,
|
||||||
'type' => PermissionType::READ,
|
'type' => PermissionType::READ,
|
||||||
|
|
@ -55,6 +58,7 @@ return [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\EquipmentManagement\Controller\ApiController:apiNoteCreate',
|
'dest' => '\Modules\EquipmentManagement\Controller\ApiController:apiNoteCreate',
|
||||||
'verb' => RouteVerb::PUT,
|
'verb' => RouteVerb::PUT,
|
||||||
|
'csrf' => true,
|
||||||
'permission' => [
|
'permission' => [
|
||||||
'module' => Controller::NAME,
|
'module' => Controller::NAME,
|
||||||
'type' => PermissionType::READ,
|
'type' => PermissionType::READ,
|
||||||
|
|
@ -64,6 +68,7 @@ return [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\EquipmentManagement\Controller\ApiController:apiNoteUpdate',
|
'dest' => '\Modules\EquipmentManagement\Controller\ApiController:apiNoteUpdate',
|
||||||
'verb' => RouteVerb::SET,
|
'verb' => RouteVerb::SET,
|
||||||
|
'csrf' => true,
|
||||||
'permission' => [
|
'permission' => [
|
||||||
'module' => Controller::NAME,
|
'module' => Controller::NAME,
|
||||||
'type' => PermissionType::READ,
|
'type' => PermissionType::READ,
|
||||||
|
|
|
||||||
|
|
@ -25,18 +25,51 @@ return [
|
||||||
'permission' => [
|
'permission' => [
|
||||||
'module' => BackendController::NAME,
|
'module' => BackendController::NAME,
|
||||||
'type' => PermissionType::READ,
|
'type' => PermissionType::READ,
|
||||||
'state' => PermissionCategory::EQUIPMENT,
|
'state' => PermissionCategory::ATTRIBUTE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/equipment/attribute/type(\?.*$|$)' => [
|
'^.*/equipment/attribute/type/view(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeType',
|
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeType',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
'permission' => [
|
'permission' => [
|
||||||
'module' => BackendController::NAME,
|
'module' => BackendController::NAME,
|
||||||
'type' => PermissionType::READ,
|
'type' => PermissionType::READ,
|
||||||
'state' => PermissionCategory::EQUIPMENT,
|
'state' => PermissionCategory::ATTRIBUTE,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'^.*/equipment/attribute/type/create(\?.*$|$)' => [
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeTypeCreate',
|
||||||
|
'verb' => RouteVerb::GET,
|
||||||
|
'permission' => [
|
||||||
|
'module' => BackendController::NAME,
|
||||||
|
'type' => PermissionType::CREATE,
|
||||||
|
'state' => PermissionCategory::ATTRIBUTE,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'^.*/equipment/attribute/value/view(\?.*$|$)' => [
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeValue',
|
||||||
|
'verb' => RouteVerb::GET,
|
||||||
|
'permission' => [
|
||||||
|
'module' => BackendController::NAME,
|
||||||
|
'type' => PermissionType::READ,
|
||||||
|
'state' => PermissionCategory::ATTRIBUTE,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'^.*/equipment/attribute/value/create(\?.*$|$)' => [
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeValueCreate',
|
||||||
|
'verb' => RouteVerb::GET,
|
||||||
|
'permission' => [
|
||||||
|
'module' => BackendController::NAME,
|
||||||
|
'type' => PermissionType::CREATE,
|
||||||
|
'state' => PermissionCategory::ATTRIBUTE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ namespace Modules\EquipmentManagement\Controller;
|
||||||
|
|
||||||
use Modules\EquipmentManagement\Models\Attribute\EquipmentAttributeTypeL11nMapper;
|
use Modules\EquipmentManagement\Models\Attribute\EquipmentAttributeTypeL11nMapper;
|
||||||
use Modules\EquipmentManagement\Models\Attribute\EquipmentAttributeTypeMapper;
|
use Modules\EquipmentManagement\Models\Attribute\EquipmentAttributeTypeMapper;
|
||||||
|
use Modules\EquipmentManagement\Models\Attribute\EquipmentAttributeValueL11nMapper;
|
||||||
|
use Modules\EquipmentManagement\Models\Attribute\EquipmentAttributeValueMapper;
|
||||||
use Modules\EquipmentManagement\Models\EquipmentMapper;
|
use Modules\EquipmentManagement\Models\EquipmentMapper;
|
||||||
use Modules\EquipmentManagement\Models\EquipmentTypeMapper;
|
use Modules\EquipmentManagement\Models\EquipmentTypeMapper;
|
||||||
use Modules\EquipmentManagement\Models\InspectionMapper;
|
use Modules\EquipmentManagement\Models\InspectionMapper;
|
||||||
|
|
@ -54,17 +56,15 @@ final class BackendController extends Controller
|
||||||
*/
|
*/
|
||||||
public function viewEquipmentManagementAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
public function viewEquipmentManagementAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeListView($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/EquipmentManagement/Theme/Backend/attribute-type-list');
|
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008405001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008405001, $request, $response);
|
||||||
|
|
||||||
/** @var \Modules\Attribute\Models\AttributeType[] $attributes */
|
$view->attributes = EquipmentAttributeTypeMapper::getAll()
|
||||||
$attributes = EquipmentAttributeTypeMapper::getAll()
|
|
||||||
->with('l11n')
|
->with('l11n')
|
||||||
->where('l11n/language', $response->header->l11n->language)
|
->where('l11n/language', $response->header->l11n->language)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$view->data['attributes'] = $attributes;
|
$view->path = 'equipment';
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -114,23 +114,55 @@ final class BackendController extends Controller
|
||||||
*/
|
*/
|
||||||
public function viewEquipmentManagementAttributeType(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
public function viewEquipmentManagementAttributeType(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/EquipmentManagement/Theme/Backend/attribute-type');
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008405001, $request, $response);
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response);
|
|
||||||
|
|
||||||
/** @var \Modules\Attribute\Models\AttributeType $attribute */
|
$view->attribute = EquipmentAttributeTypeMapper::get()
|
||||||
$attribute = EquipmentAttributeTypeMapper::get()
|
|
||||||
->with('l11n')
|
->with('l11n')
|
||||||
|
->with('defaults')
|
||||||
|
->with('defaults/l11n')
|
||||||
->where('id', (int) $request->getData('id'))
|
->where('id', (int) $request->getData('id'))
|
||||||
->where('l11n/language', $response->header->l11n->language)
|
->where('l11n/language', $response->header->l11n->language)
|
||||||
|
->where('defaults/l11n/language', [$response->header->l11n->language, null])
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$l11ns = EquipmentAttributeTypeL11nMapper::getAll()
|
$view->l11ns = EquipmentAttributeTypeL11nMapper::getAll()
|
||||||
->where('ref', $attribute->id)
|
->where('ref', $view->attribute->id)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$view->data['attribute'] = $attribute;
|
$view->path = 'fleet/vehicle';
|
||||||
$view->data['l11ns'] = $l11ns;
|
|
||||||
|
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 viewEquipmentManagementAttributeValue(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||||
|
{
|
||||||
|
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeValueView($this->app->l11nManager, $request, $response);
|
||||||
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008405001, $request, $response);
|
||||||
|
|
||||||
|
$view->attribute = EquipmentAttributeValueMapper::get()
|
||||||
|
->with('l11n')
|
||||||
|
->where('id', (int) $request->getData('id'))
|
||||||
|
->where('l11n/language', [$response->header->l11n->language, null])
|
||||||
|
->execute();
|
||||||
|
|
||||||
|
$view->l11ns = EquipmentAttributeValueL11nMapper::getAll()
|
||||||
|
->where('ref', $view->attribute->id)
|
||||||
|
->execute();
|
||||||
|
|
||||||
|
// @todo Also find the ItemAttributeType
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -275,13 +307,11 @@ final class BackendController extends Controller
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
|
|
||||||
$view->setTemplate('/Modules/EquipmentManagement/Theme/Backend/inspection-list');
|
$view->setTemplate('/Modules/EquipmentManagement/Theme/Backend/inspection-list');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008401001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008404001, $request, $response);
|
||||||
|
|
||||||
$list = InspectionMapper::getAll()
|
$view->data['inspections'] = InspectionMapper::getAll()
|
||||||
->sort('id', 'DESC')
|
->sort('id', 'DESC')
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
$view->data['inspections'] = $list;
|
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,4 +37,6 @@ abstract class PermissionCategory extends Enum
|
||||||
public const EQUIPMENT_ATTRIBUTE_TYPE = 6;
|
public const EQUIPMENT_ATTRIBUTE_TYPE = 6;
|
||||||
|
|
||||||
public const EQUIPMENT_NOTE = 7;
|
public const EQUIPMENT_NOTE = 7;
|
||||||
|
|
||||||
|
public const ATTRIBUTE = 8;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['Navigation' => [
|
return ['Navigation' => [
|
||||||
'EquipmentAttributes' => 'Equipment Attribute',
|
'Attributes' => 'Attribute',
|
||||||
'EquipmentInspectionTypes' => 'Equipment Inspektionstypen',
|
'InspectionTypes' => 'Inspektionsarten',
|
||||||
'EquipmentManagement' => 'Equipment Management',
|
'EquipmentManagement' => 'Equipment Management',
|
||||||
'Equipments' => 'Equipments',
|
'Equipments' => 'Equipments',
|
||||||
'Inspections' => 'Inspektionen',
|
'Inspections' => 'Inspektionen',
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['Navigation' => [
|
return ['Navigation' => [
|
||||||
'EquipmentAttributes' => 'Equipment Attributes',
|
'Attributes' => 'Attributes',
|
||||||
'EquipmentInspectionTypes' => 'Equipment Inspection Types',
|
'InspectionTypes' => 'Inspection Types',
|
||||||
'EquipmentManagement' => 'Equipment Management',
|
'EquipmentManagement' => 'Equipment Management',
|
||||||
'Equipments' => 'Equipments',
|
'Equipments' => 'Equipments',
|
||||||
'Inspections' => 'Inspections',
|
'Inspections' => 'Inspections',
|
||||||
|
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Jingga
|
|
||||||
*
|
|
||||||
* PHP Version 8.2
|
|
||||||
*
|
|
||||||
* @package Modules\ItemManagement
|
|
||||||
* @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 */
|
|
||||||
$attributes = $this->data['attributes'];
|
|
||||||
|
|
||||||
echo $this->data['nav']->render(); ?>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-12">
|
|
||||||
<section class="portlet">
|
|
||||||
<div class="portlet-head"><?= $this->getHtml('AttributeTypes', 'Attribute', 'Backend'); ?><i class="g-icon download btn end-xs">download</i></div>
|
|
||||||
<div class="slider">
|
|
||||||
<table id="iAttributeTypeList" class="default sticky">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
|
||||||
<label for="iAttributeTypeList-sort-1">
|
|
||||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-1">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="iAttributeTypeList-sort-2">
|
|
||||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-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="iAttributeTypeList-sort-2">
|
|
||||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-2">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="iAttributeTypeList-sort-3">
|
|
||||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-3">
|
|
||||||
<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 ($attributes as $key => $value) : ++$count;
|
|
||||||
$url = UriFactory::build('{/base}/fleet/equipment/attribute/type?{?}&id=' . $value->id);
|
|
||||||
?>
|
|
||||||
<tr data-href="<?= $url; ?>">
|
|
||||||
<td><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n()); ?></a>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php if ($count === 0) : ?>
|
|
||||||
<tr><td colspan="2" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,98 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Jingga
|
|
||||||
*
|
|
||||||
* PHP Version 8.2
|
|
||||||
*
|
|
||||||
* @package Modules\Tasks
|
|
||||||
* @copyright Dennis Eichhorn
|
|
||||||
* @license OMS License 2.0
|
|
||||||
* @version 1.0.0
|
|
||||||
* @link https://jingga.app
|
|
||||||
*/
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use Modules\Attribute\Models\AttributeValueType;
|
|
||||||
use phpOMS\Localization\ISO639Enum;
|
|
||||||
|
|
||||||
$types = AttributeValueType::getConstants();
|
|
||||||
|
|
||||||
$attribute = $this->data['attribute'];
|
|
||||||
$l11ns = $this->data['l11ns'];
|
|
||||||
|
|
||||||
echo $this->data['nav']->render(); ?>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6 col-xs-12">
|
|
||||||
<section id="task" class="portlet">
|
|
||||||
<div class="portlet-head"><?= $this->getHtml('Attribute', 'Attribute', 'Backend'); ?></div>
|
|
||||||
|
|
||||||
<div class="portlet-body">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
|
||||||
<input type="text" value="<?= $this->printHtml((string) $attribute->id); ?>" disabled>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="iName"><?= $this->getHtml('Name', 'Attribute', 'Backend'); ?></label>
|
|
||||||
<input id="iNAme" type="text" value="<?= $this->printHtml($attribute->name); ?>" disabled>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="iType"><?= $this->getHtml('Datatype', 'Attribute', 'Backend'); ?></label>
|
|
||||||
<select id="iType" name="type" disabled>
|
|
||||||
<?php foreach ($types as $key => $type) : ?>
|
|
||||||
<option value="<?= $type; ?>"<?= $type === $attribute->datatype ? ' selected' : ''; ?>><?= $this->printHtml($key); ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="iPattern"><?= $this->getHtml('Pattern', 'Attribute', 'Backend'); ?></label>
|
|
||||||
<input id="iPattern" type="text" value="<?= $this->printHtml($attribute->validationPattern); ?>">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="checkbox" for="iRequired">
|
|
||||||
<input id="iRequired" type="checkbox" name="required" value="1"<?= $attribute->isRequired ? ' checked' : ''; ?>>
|
|
||||||
<span class="checkmark"></span>
|
|
||||||
<?= $this->getHtml('IsRequired', 'Attribute', 'Backend'); ?>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="checkbox" for="iCustom">
|
|
||||||
<input id="iCustom" type="checkbox" name="custom" value="1" <?= $attribute->custom ? ' checked' : ''; ?>>
|
|
||||||
<span class="checkmark"></span>
|
|
||||||
<?= $this->getHtml('CustomValue', 'Attribute', 'Backend'); ?>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-xs-12 col-md-6">
|
|
||||||
<div class="portlet">
|
|
||||||
<div class="portlet-head"><?= $this->getHtml('Language', '0', '0'); ?><i class="g-icon download btn end-xs">download</i></div>
|
|
||||||
<table class="default sticky">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<td>
|
|
||||||
<td><?= $this->getHtml('Language', '0', '0'); ?>
|
|
||||||
<td class="wf-100"><?= $this->getHtml('Title', 'Attribute', 'Backend'); ?>
|
|
||||||
<tbody>
|
|
||||||
<?php $c = 0; foreach ($l11ns as $key => $value) : ++$c; ?>
|
|
||||||
<tr>
|
|
||||||
<td><a href="#"><i class="g-icon">close</i></a>
|
|
||||||
<td><a href="#"><i class="g-icon">settings</i></a>
|
|
||||||
<td><?= ISO639Enum::getByName('_' . \strtoupper($value->language)); ?>
|
|
||||||
<td><?= $value->content; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php if ($c === 0) : ?>
|
|
||||||
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -85,7 +85,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td>
|
<td>
|
||||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml((string) $value->id); ?></a>
|
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||||
<td data-label="<?= $this->getHtml('Status'); ?>"><a href="<?= $url; ?>"><?= $this->getHtml(':status' . $value->status); ?></a>
|
<td data-label="<?= $this->getHtml('Status'); ?>"><a href="<?= $url; ?>"><?= $this->getHtml(':status' . $value->status); ?></a>
|
||||||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
|
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
|
||||||
<td data-label="<?= $this->getHtml('Type'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->type->getL11n()); ?></a>
|
<td data-label="<?= $this->getHtml('Type'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->type->getL11n()); ?></a>
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ echo $this->data['nav']->render();
|
||||||
$equipment->attributes,
|
$equipment->attributes,
|
||||||
$this->data['attributeTypes'] ?? [],
|
$this->data['attributeTypes'] ?? [],
|
||||||
$this->data['units'] ?? [],
|
$this->data['units'] ?? [],
|
||||||
'{/api}fleet/equipment/attribute',
|
'{/api}fleet/equipment/attribute?csrf={$CSRF}',
|
||||||
$equipment->id
|
$equipment->id
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -13,3 +13,67 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
echo $this->data['nav']->render();
|
echo $this->data['nav']->render();
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<section class="portlet">
|
||||||
|
<div class="portlet-head"><?= $this->getHtml('Upcoming'); ?></div>
|
||||||
|
<table id="upcomingInspections" class="default sticky">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td><?= $this->getHtml('Date'); ?>
|
||||||
|
<td class="wf-100"><?= $this->getHtml('Type'); ?>
|
||||||
|
<td><?= $this->getHtml('Responsible'); ?>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$count = 0;
|
||||||
|
foreach (($this->data['inspections'] ?? []) as $inspection) :
|
||||||
|
// @todo handle old inspections in the past? maybe use a status?!
|
||||||
|
if ($inspection->next === null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
++$count;
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?= $inspection->next->format('Y-m-d H:i'); ?>
|
||||||
|
<td><?= $this->printHtml($inspection->type->getL11n()); ?>
|
||||||
|
<td>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php if ($count === 0) : ?>
|
||||||
|
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<section class="portlet">
|
||||||
|
<div class="portlet-head"><?= $this->getHtml('History'); ?></div>
|
||||||
|
<table id="historicInspections" class="default sticky">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td><?= $this->getHtml('Date'); ?>
|
||||||
|
<td class="wf-100"><?= $this->getHtml('Type'); ?>
|
||||||
|
<td><?= $this->getHtml('Responsible'); ?>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
$count = 0;
|
||||||
|
foreach (($this->data['inspections'] ?? []) as $inspection) :
|
||||||
|
++$count;
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td><?= $inspection->date->format('Y-m-d H:i'); ?>
|
||||||
|
<td><?= $this->printHtml($inspection->type->getL11n()); ?>
|
||||||
|
<td>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php if ($count === 0) : ?>
|
||||||
|
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user