mirror of
https://github.com/Karaka-Management/oms-EquipmentManagement.git
synced 2026-01-10 16:48:42 +00:00
fix templates
This commit is contained in:
parent
b80fb1bfe4
commit
ed7035c192
|
|
@ -142,7 +142,7 @@ return [
|
|||
],
|
||||
'^/equipment/inspection/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementEquipmentCreate',
|
||||
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementInspectionCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
|
|
@ -154,7 +154,7 @@ return [
|
|||
],
|
||||
'^/equipment/inspection/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementEquipmentView',
|
||||
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementInspectionView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\EquipmentManagement\Controller;
|
||||
|
||||
use Modules\Attribute\Models\NullAttributeType;
|
||||
use Modules\Attribute\Models\NullAttributeValue;
|
||||
use Modules\EquipmentManagement\Models\Attribute\EquipmentAttributeTypeL11nMapper;
|
||||
use Modules\EquipmentManagement\Models\Attribute\EquipmentAttributeTypeMapper;
|
||||
use Modules\EquipmentManagement\Models\Attribute\EquipmentAttributeValueL11nMapper;
|
||||
|
|
@ -216,7 +218,7 @@ final class BackendController extends Controller
|
|||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008402001, $request, $response);
|
||||
|
||||
// @todo This langauge filtering doesn't work. But it was working with the old mappers. Maybe there is a bug in the where() definition. Need to inspect the actual query.
|
||||
$equipment = EquipmentMapper::get()
|
||||
$view->data['equipment'] = EquipmentMapper::get()
|
||||
->with('attributes')
|
||||
->with('attributes/type')
|
||||
->with('attributes/value')
|
||||
|
|
@ -235,17 +237,13 @@ final class BackendController extends Controller
|
|||
->where('attributes/value/l11n/language', [$response->header->l11n->language, null])
|
||||
->execute();
|
||||
|
||||
$view->data['equipment'] = $equipment;
|
||||
|
||||
$inspections = InspectionMapper::getAll()
|
||||
$view->data['inspections'] = InspectionMapper::getAll()
|
||||
->with('type')
|
||||
->with('type/l11n')
|
||||
->where('reference', $equipment->id)
|
||||
->where('reference', $view->data['equipment']->id)
|
||||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['inspections'] = $inspections;
|
||||
|
||||
// @feature Create a new read mapper function that returns relation models instead of its own model
|
||||
// https://github.com/Karaka-Management/phpOMS/issues/320
|
||||
$query = new Builder($this->app->dbPool->get());
|
||||
|
|
@ -259,29 +257,23 @@ final class BackendController extends Controller
|
|||
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self'])
|
||||
->leftJoin(MediaTypeMapper::TABLE)
|
||||
->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD)
|
||||
->where(EquipmentMapper::HAS_MANY['files']['self'], '=', $equipment->id)
|
||||
->where(EquipmentMapper::HAS_MANY['files']['self'], '=', $view->data['equipment']->id)
|
||||
->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'equipment_profile_image');
|
||||
|
||||
$equipmentImage = MediaMapper::get()
|
||||
$view->data['equipmentImage'] = MediaMapper::get()
|
||||
->with('types')
|
||||
->where('id', $results)
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['equipmentImage'] = $equipmentImage;
|
||||
|
||||
$equipmentTypes = EquipmentTypeMapper::getAll()
|
||||
$view->data['types'] = EquipmentTypeMapper::getAll()
|
||||
->with('l11n')
|
||||
->where('l11n/language', $response->header->l11n->language)
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['types'] = $equipmentTypes;
|
||||
|
||||
$units = UnitMapper::getAll()
|
||||
$view->data['units'] = UnitMapper::getAll()
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['units'] = $units;
|
||||
|
||||
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
||||
$view->data['attributeView']->data['default_localization'] = $this->app->l11nServer;
|
||||
|
||||
|
|
@ -341,15 +333,63 @@ final class BackendController extends Controller
|
|||
public function viewEquipmentManagementInspectionTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/EquipmentManagement/Theme/Backend/inspection-type-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 = InspectionTypeMapper::getAll()
|
||||
$view->data['types'] = InspectionTypeMapper::getAll()
|
||||
->with('l11n')
|
||||
->where('l11n/language', $response->header->l11n->language)
|
||||
->sort('id', 'DESC')
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['inspections'] = $list;
|
||||
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 viewEquipmentManagementAttributeTypeCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response);
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008405001, $request, $response);
|
||||
|
||||
$view->attribute = new NullAttributeType();
|
||||
|
||||
$view->path = 'equipment';
|
||||
|
||||
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 viewEquipmentManagementAttributeValueCreate(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->type = EquipmentAttributeTypeMapper::get()->where('id', (int) $request->getData('type'))->execute();
|
||||
$view->attribute = new NullAttributeValue();
|
||||
|
||||
$view->path = 'equipment';
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ use phpOMS\Localization\BaseStringL11nType;
|
|||
/**
|
||||
* Equipment class.
|
||||
*
|
||||
* @package Modules\Attribute\Models
|
||||
* @package Modules\EquipmentManagement\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
|
|
|
|||
|
|
@ -20,14 +20,17 @@ return ['EquipmentManagement' => [
|
|||
'Attributes' => 'Attribute',
|
||||
'Costs' => 'Kosten',
|
||||
'Date' => 'Datum',
|
||||
'Driver' => '',
|
||||
'EIN' => '',
|
||||
'Driver' => 'Fahrer',
|
||||
'EIN' => 'WKN',
|
||||
'Ein' => 'Ein',
|
||||
'End' => 'Ende',
|
||||
'Number' => 'Nummer',
|
||||
'Equipments' => 'Equipment',
|
||||
'Equipment' => 'Equipment',
|
||||
'Files' => 'Dateien',
|
||||
'History' => 'Historie',
|
||||
'Inspections' => 'Inspectionen',
|
||||
'InspectionTypes' => 'Inspektionsarten',
|
||||
'LeasingFee' => 'Leasingkosten',
|
||||
'Make' => 'Marke',
|
||||
'Model' => 'Modell',
|
||||
|
|
|
|||
|
|
@ -20,14 +20,16 @@ return ['EquipmentManagement' => [
|
|||
'Attributes' => 'Attributes',
|
||||
'Costs' => 'Costs',
|
||||
'Date' => 'Date',
|
||||
'Driver' => '',
|
||||
'EIN' => '',
|
||||
'EIN' => 'EIN',
|
||||
'Ein' => 'Ein',
|
||||
'End' => 'End',
|
||||
'Equipments' => 'Equipments',
|
||||
'Equipment' => 'Equipment',
|
||||
'Number' => 'Number',
|
||||
'Files' => 'Files',
|
||||
'History' => 'History',
|
||||
'Inspections' => 'Inspections',
|
||||
'InspectionTypes' => 'Inspection Types',
|
||||
'LeasingFee' => 'Leasing Fee',
|
||||
'Make' => 'Make',
|
||||
'Model' => 'Model',
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\ClientManagement
|
||||
* @package Modules\EquipmentManagement
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
|
|
@ -36,9 +36,10 @@ $isNew = $equipment->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('Profile'); ?></label>
|
||||
<li><label for="c-tab-1"><?= $this->getHtml('Equipment'); ?></label>
|
||||
<li><label for="c-tab-2"><?= $this->getHtml('Attributes'); ?></label>
|
||||
<li><label for="c-tab-3"><?= $this->getHtml('Files'); ?></label>
|
||||
<li><label for="c-tab-4"><?= $this->getHtml('Notes'); ?></label>
|
||||
|
|
@ -46,19 +47,25 @@ echo $this->data['nav']->render();
|
|||
<li><label for="c-tab-8"><?= $this->getHtml('Costs'); ?></label>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="tab-content">
|
||||
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
|
||||
<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('Profile'); ?></div>
|
||||
<div class="portlet-head"><?= $this->getHtml('Equipment'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iEquipmentProfileName"><?= $this->getHtml('Name'); ?></label>
|
||||
<input type="text" id="iEquipmentProfileName" name="name" value="<?= $this->printHtml($equipment->name); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iEquipmentCode"><?= $this->getHtml('Code'); ?></label>
|
||||
<input type="text" id="iEquipmentCode" name="code" value="<?= $this->printHtml($equipment->code); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iEquipmentStatus"><?= $this->getHtml('Status'); ?></label>
|
||||
<select id="iEquipmentStatus" name="equipment_status">
|
||||
|
|
@ -129,6 +136,7 @@ echo $this->data['nav']->render();
|
|||
</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 class="row">
|
||||
|
|
@ -213,5 +221,6 @@ echo $this->data['nav']->render();
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -12,4 +12,56 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
echo $this->data['nav']->render();
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('InspectionTypes'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<div class="slider">
|
||||
<table id="iContractTypeList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<label for="iContractTypeList-sort-1">
|
||||
<input type="radio" name="iContractTypeList-sort" id="iContractTypeList-sort-1">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iContractTypeList-sort-2">
|
||||
<input type="radio" name="iContractTypeList-sort" id="iContractTypeList-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="iContractTypeList-sort-2">
|
||||
<input type="radio" name="iContractTypeList-sort" id="iContractTypeList-sort-2">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iContractTypeList-sort-3">
|
||||
<input type="radio" name="iContractTypeList-sort" id="iContractTypeList-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 ($this->data['types'] as $key => $value) : ++$count;
|
||||
$url = UriFactory::build('{/base}/equipment/inspection/type/view?{?}&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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user