mirror of
https://github.com/Karaka-Management/oms-EquipmentManagement.git
synced 2026-02-17 18:48:41 +00:00
Test fixes
This commit is contained in:
parent
c413733ac0
commit
bffa634633
|
|
@ -115,6 +115,11 @@
|
||||||
"type": "VARCHAR(255)",
|
"type": "VARCHAR(255)",
|
||||||
"null": false
|
"null": false
|
||||||
},
|
},
|
||||||
|
"equipmgmt_equipment_location": {
|
||||||
|
"name": "equipmgmt_equipment_location",
|
||||||
|
"type": "VARCHAR(255)",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
"equipmgmt_equipment_status": {
|
"equipmgmt_equipment_status": {
|
||||||
"name": "equipmgmt_equipment_status",
|
"name": "equipmgmt_equipment_status",
|
||||||
"type": "TINYINT",
|
"type": "TINYINT",
|
||||||
|
|
@ -289,13 +294,13 @@
|
||||||
"null": false
|
"null": false
|
||||||
},
|
},
|
||||||
"equipmgmt_attr_type_required": {
|
"equipmgmt_attr_type_required": {
|
||||||
"description": "Every equipment must have this attribute type if set to true.",
|
"comment": "Every equipment must have this attribute type if set to true.",
|
||||||
"name": "equipmgmt_attr_type_required",
|
"name": "equipmgmt_attr_type_required",
|
||||||
"type": "TINYINT(1)",
|
"type": "TINYINT(1)",
|
||||||
"null": false
|
"null": false
|
||||||
},
|
},
|
||||||
"equipmgmt_attr_type_pattern": {
|
"equipmgmt_attr_type_pattern": {
|
||||||
"description": "This is a regex validation pattern.",
|
"comment": "This is a regex validation pattern.",
|
||||||
"name": "equipmgmt_attr_type_pattern",
|
"name": "equipmgmt_attr_type_pattern",
|
||||||
"type": "VARCHAR(255)",
|
"type": "VARCHAR(255)",
|
||||||
"null": false
|
"null": false
|
||||||
|
|
|
||||||
|
|
@ -287,6 +287,10 @@ final class Installer extends InstallerAbstract
|
||||||
$module = $app->moduleManager->get('EquipmentManagement', 'ApiEquipmentAttribute');
|
$module = $app->moduleManager->get('EquipmentManagement', 'ApiEquipmentAttribute');
|
||||||
|
|
||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
|
if (!isset($attribute['values'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$itemAttrValue[$attribute['name']] = [];
|
$itemAttrValue[$attribute['name']] = [];
|
||||||
|
|
||||||
/** @var array $value */
|
/** @var array $value */
|
||||||
|
|
|
||||||
|
|
@ -83,12 +83,14 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
public function createEquipmentFromRequest(RequestAbstract $request) : Equipment
|
public function createEquipmentFromRequest(RequestAbstract $request) : Equipment
|
||||||
{
|
{
|
||||||
$equipment = new Equipment();
|
$equipment = new Equipment();
|
||||||
$equipment->name = $request->getDataString('name') ?? '';
|
$equipment->name = $request->getDataString('name') ?? '';
|
||||||
$equipment->info = $request->getDataString('info') ?? '';
|
$equipment->info = $request->getDataString('info') ?? '';
|
||||||
$equipment->type = new NullBaseStringL11nType((int) ($request->getDataInt('type') ?? 0));
|
$equipment->code = $request->getDataString('code') ?? '';
|
||||||
$equipment->status = EquipmentStatus::tryFromValue($request->getDataInt('status')) ?? EquipmentStatus::INACTIVE;
|
$equipment->location = $request->getDataString('location') ?? '';
|
||||||
$equipment->unit = $request->getDataInt('unit') ?? $this->app->unitId;
|
$equipment->type = new NullBaseStringL11nType((int) ($request->getDataInt('type') ?? 0));
|
||||||
|
$equipment->status = EquipmentStatus::tryFromValue($request->getDataInt('status')) ?? EquipmentStatus::INACTIVE;
|
||||||
|
$equipment->unit = $request->getDataInt('unit') ?? $this->app->unitId;
|
||||||
|
|
||||||
return $equipment;
|
return $equipment;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,6 @@ final class BackendController extends Controller
|
||||||
$view->setTemplate('/Modules/EquipmentManagement/Theme/Backend/equipment-view');
|
$view->setTemplate('/Modules/EquipmentManagement/Theme/Backend/equipment-view');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008402001, $request, $response);
|
$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.
|
|
||||||
$view->data['equipment'] = EquipmentMapper::get()
|
$view->data['equipment'] = EquipmentMapper::get()
|
||||||
->with('attributes')
|
->with('attributes')
|
||||||
->with('attributes/type')
|
->with('attributes/type')
|
||||||
|
|
@ -273,6 +272,11 @@ final class BackendController extends Controller
|
||||||
$view->data['units'] = UnitMapper::getAll()
|
$view->data['units'] = UnitMapper::getAll()
|
||||||
->executeGetArray();
|
->executeGetArray();
|
||||||
|
|
||||||
|
$view->data['attributeTypes'] = EquipmentAttributeTypeMapper::getAll()
|
||||||
|
->with('l11n')
|
||||||
|
->where('l11n/language', $response->header->l11n->language)
|
||||||
|
->executeGetArray();
|
||||||
|
|
||||||
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
||||||
$view->data['attributeView']->data['default_localization'] = $this->app->l11nServer;
|
$view->data['attributeView']->data['default_localization'] = $this->app->l11nServer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
# Structure
|
|
||||||
|
|
||||||
## ER
|
|
||||||
|
|
||||||

|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 74 KiB |
|
|
@ -32,6 +32,8 @@ class Equipment implements \JsonSerializable
|
||||||
|
|
||||||
public string $code = '';
|
public string $code = '';
|
||||||
|
|
||||||
|
public string $location = '';
|
||||||
|
|
||||||
public int $status = EquipmentStatus::ACTIVE;
|
public int $status = EquipmentStatus::ACTIVE;
|
||||||
|
|
||||||
public BaseStringL11nType $type;
|
public BaseStringL11nType $type;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ final class EquipmentMapper extends DataMapperFactory
|
||||||
'equipmgmt_equipment_id' => ['name' => 'equipmgmt_equipment_id', 'type' => 'int', 'internal' => 'id'],
|
'equipmgmt_equipment_id' => ['name' => 'equipmgmt_equipment_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'equipmgmt_equipment_name' => ['name' => 'equipmgmt_equipment_name', 'type' => 'string', 'internal' => 'name'],
|
'equipmgmt_equipment_name' => ['name' => 'equipmgmt_equipment_name', 'type' => 'string', 'internal' => 'name'],
|
||||||
'equipmgmt_equipment_code' => ['name' => 'equipmgmt_equipment_code', 'type' => 'string', 'internal' => 'code'],
|
'equipmgmt_equipment_code' => ['name' => 'equipmgmt_equipment_code', 'type' => 'string', 'internal' => 'code'],
|
||||||
|
'equipmgmt_equipment_location' => ['name' => 'equipmgmt_equipment_location', 'type' => 'string', 'internal' => 'location'],
|
||||||
'equipmgmt_equipment_status' => ['name' => 'equipmgmt_equipment_status', 'type' => 'int', 'internal' => 'status'],
|
'equipmgmt_equipment_status' => ['name' => 'equipmgmt_equipment_status', 'type' => 'int', 'internal' => 'status'],
|
||||||
'equipmgmt_equipment_info' => ['name' => 'equipmgmt_equipment_info', 'type' => 'string', 'internal' => 'info'],
|
'equipmgmt_equipment_info' => ['name' => 'equipmgmt_equipment_info', 'type' => 'string', 'internal' => 'info'],
|
||||||
'equipmgmt_equipment_unit' => ['name' => 'equipmgmt_equipment_unit', 'type' => 'int', 'internal' => 'unit'],
|
'equipmgmt_equipment_unit' => ['name' => 'equipmgmt_equipment_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||||
|
|
|
||||||
|
|
@ -13,33 +13,35 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['EquipmentManagement' => [
|
return ['EquipmentManagement' => [
|
||||||
':status1' => 'Aktiv',
|
':status1' => 'Aktiv',
|
||||||
':status2' => 'Inaktiv',
|
':status2' => 'Inaktiv',
|
||||||
':status3' => 'Beschädigt',
|
':status3' => 'Beschädigt',
|
||||||
':status4' => 'Außer Betrieb',
|
':status4' => 'Außer Betrieb',
|
||||||
'Attributes' => 'Attribute',
|
'Attributes' => 'Attribute',
|
||||||
'Costs' => 'Kosten',
|
'Costs' => 'Kosten',
|
||||||
'Date' => 'Datum',
|
'Code' => 'Code',
|
||||||
'EIN' => 'WKN',
|
'Date' => 'Datum',
|
||||||
'Ein' => 'Ein',
|
'EIN' => 'WKN',
|
||||||
'End' => 'Ende',
|
'Ein' => 'Ein',
|
||||||
'Number' => 'Nummer',
|
'End' => 'Ende',
|
||||||
'Equipments' => 'Equipment',
|
'Number' => 'Nummer',
|
||||||
'Equipment' => 'Equipment',
|
'Equipments' => 'Equipment',
|
||||||
'Files' => 'Dateien',
|
'Equipment' => 'Equipment',
|
||||||
'History' => 'Historie',
|
'Files' => 'Dateien',
|
||||||
'Inspections' => 'Inspectionen',
|
'History' => 'Historie',
|
||||||
'InspectionTypes' => 'Inspektionsarten',
|
'Inspections' => 'Inspectionen',
|
||||||
'LeasingFee' => 'Leasingkosten',
|
'InspectionTypes' => 'Inspektionsarten',
|
||||||
'Make' => 'Marke',
|
'LeasingFee' => 'Leasingkosten',
|
||||||
'Model' => 'Modell',
|
'Make' => 'Marke',
|
||||||
'Name' => 'Name',
|
'Model' => 'Modell',
|
||||||
'Notes' => 'Notizen',
|
'Name' => 'Name',
|
||||||
'Profile' => 'Profile',
|
'Notes' => 'Notizen',
|
||||||
'PurchasePrice' => 'Kaufpreis',
|
'Profile' => 'Profile',
|
||||||
'Responsible' => 'Verantwortlich',
|
'PurchasePrice' => 'Kaufpreis',
|
||||||
'Start' => 'Start',
|
'Responsible' => 'Verantwortlich',
|
||||||
'Status' => 'Status',
|
'Start' => 'Start',
|
||||||
'Type' => 'Typ',
|
'Status' => 'Status',
|
||||||
'Upcoming' => 'Upcoming',
|
'Type' => 'Typ',
|
||||||
|
'Location' => 'Standort',
|
||||||
|
'Upcoming' => 'Upcoming',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -13,33 +13,35 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['EquipmentManagement' => [
|
return ['EquipmentManagement' => [
|
||||||
':status1' => 'Active',
|
':status1' => 'Active',
|
||||||
':status2' => 'Inactive',
|
':status2' => 'Inactive',
|
||||||
':status3' => 'Damaged',
|
':status3' => 'Damaged',
|
||||||
':status4' => 'Out of order',
|
':status4' => 'Out of order',
|
||||||
'Attributes' => 'Attributes',
|
'Attributes' => 'Attributes',
|
||||||
'Costs' => 'Costs',
|
'Costs' => 'Costs',
|
||||||
'Date' => 'Date',
|
'Code' => 'Code',
|
||||||
'EIN' => 'EIN',
|
'Date' => 'Date',
|
||||||
'Ein' => 'Ein',
|
'EIN' => 'EIN',
|
||||||
'End' => 'End',
|
'Ein' => 'Ein',
|
||||||
'Equipments' => 'Equipments',
|
'End' => 'End',
|
||||||
'Equipment' => 'Equipment',
|
'Equipments' => 'Equipments',
|
||||||
'Number' => 'Number',
|
'Equipment' => 'Equipment',
|
||||||
'Files' => 'Files',
|
'Number' => 'Number',
|
||||||
'History' => 'History',
|
'Files' => 'Files',
|
||||||
'Inspections' => 'Inspections',
|
'History' => 'History',
|
||||||
'InspectionTypes' => 'Inspection Types',
|
'Inspections' => 'Inspections',
|
||||||
'LeasingFee' => 'Leasing Fee',
|
'InspectionTypes' => 'Inspection Types',
|
||||||
'Make' => 'Make',
|
'LeasingFee' => 'Leasing Fee',
|
||||||
'Model' => 'Model',
|
'Make' => 'Make',
|
||||||
'Name' => 'Name',
|
'Model' => 'Model',
|
||||||
'Notes' => 'Notes',
|
'Name' => 'Name',
|
||||||
'Profile' => 'Profile',
|
'Notes' => 'Notes',
|
||||||
'PurchasePrice' => 'Purchase Price',
|
'Profile' => 'Profile',
|
||||||
'Responsible' => 'Responsible',
|
'PurchasePrice' => 'Purchase Price',
|
||||||
'Start' => 'Start',
|
'Responsible' => 'Responsible',
|
||||||
'Status' => 'Status',
|
'Start' => 'Start',
|
||||||
'Type' => 'Type',
|
'Status' => 'Status',
|
||||||
'Upcoming' => 'Upcoming',
|
'Type' => 'Type',
|
||||||
|
'Location' => 'Location',
|
||||||
|
'Upcoming' => 'Upcoming',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,11 @@ echo $this->data['nav']->render();
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="iEquipmentLocation"><?= $this->getHtml('Location'); ?></label>
|
||||||
|
<input type="text" id="iEquipmentLocation" name="location" value="<?= $this->printHtml($asset->number); ?>">
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="iEquipmentEnd"><?= $this->getHtml('Type'); ?></label>
|
<label for="iEquipmentEnd"><?= $this->getHtml('Type'); ?></label>
|
||||||
<select id="iEquipmentEnd" name="equipment_type">
|
<select id="iEquipmentEnd" name="equipment_type">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user