mirror of
https://github.com/Karaka-Management/oms-EquipmentManagement.git
synced 2026-01-11 17:18:41 +00:00
Test fixes
This commit is contained in:
parent
c413733ac0
commit
bffa634633
|
|
@ -115,6 +115,11 @@
|
|||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
},
|
||||
"equipmgmt_equipment_location": {
|
||||
"name": "equipmgmt_equipment_location",
|
||||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
},
|
||||
"equipmgmt_equipment_status": {
|
||||
"name": "equipmgmt_equipment_status",
|
||||
"type": "TINYINT",
|
||||
|
|
@ -289,13 +294,13 @@
|
|||
"null": false
|
||||
},
|
||||
"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",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"equipmgmt_attr_type_pattern": {
|
||||
"description": "This is a regex validation pattern.",
|
||||
"comment": "This is a regex validation pattern.",
|
||||
"name": "equipmgmt_attr_type_pattern",
|
||||
"type": "VARCHAR(255)",
|
||||
"null": false
|
||||
|
|
|
|||
|
|
@ -287,6 +287,10 @@ final class Installer extends InstallerAbstract
|
|||
$module = $app->moduleManager->get('EquipmentManagement', 'ApiEquipmentAttribute');
|
||||
|
||||
foreach ($attributes as $attribute) {
|
||||
if (!isset($attribute['values'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$itemAttrValue[$attribute['name']] = [];
|
||||
|
||||
/** @var array $value */
|
||||
|
|
|
|||
|
|
@ -86,6 +86,8 @@ final class ApiController extends Controller
|
|||
$equipment = new Equipment();
|
||||
$equipment->name = $request->getDataString('name') ?? '';
|
||||
$equipment->info = $request->getDataString('info') ?? '';
|
||||
$equipment->code = $request->getDataString('code') ?? '';
|
||||
$equipment->location = $request->getDataString('location') ?? '';
|
||||
$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;
|
||||
|
|
|
|||
|
|
@ -217,7 +217,6 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/EquipmentManagement/Theme/Backend/equipment-view');
|
||||
$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()
|
||||
->with('attributes')
|
||||
->with('attributes/type')
|
||||
|
|
@ -273,6 +272,11 @@ final class BackendController extends Controller
|
|||
$view->data['units'] = UnitMapper::getAll()
|
||||
->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']->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 $location = '';
|
||||
|
||||
public int $status = EquipmentStatus::ACTIVE;
|
||||
|
||||
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_name' => ['name' => 'equipmgmt_equipment_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'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_info' => ['name' => 'equipmgmt_equipment_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'equipmgmt_equipment_unit' => ['name' => 'equipmgmt_equipment_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ return ['EquipmentManagement' => [
|
|||
':status4' => 'Außer Betrieb',
|
||||
'Attributes' => 'Attribute',
|
||||
'Costs' => 'Kosten',
|
||||
'Code' => 'Code',
|
||||
'Date' => 'Datum',
|
||||
'EIN' => 'WKN',
|
||||
'Ein' => 'Ein',
|
||||
|
|
@ -41,5 +42,6 @@ return ['EquipmentManagement' => [
|
|||
'Start' => 'Start',
|
||||
'Status' => 'Status',
|
||||
'Type' => 'Typ',
|
||||
'Location' => 'Standort',
|
||||
'Upcoming' => 'Upcoming',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ return ['EquipmentManagement' => [
|
|||
':status4' => 'Out of order',
|
||||
'Attributes' => 'Attributes',
|
||||
'Costs' => 'Costs',
|
||||
'Code' => 'Code',
|
||||
'Date' => 'Date',
|
||||
'EIN' => 'EIN',
|
||||
'Ein' => 'Ein',
|
||||
|
|
@ -41,5 +42,6 @@ return ['EquipmentManagement' => [
|
|||
'Start' => 'Start',
|
||||
'Status' => 'Status',
|
||||
'Type' => 'Type',
|
||||
'Location' => 'Location',
|
||||
'Upcoming' => 'Upcoming',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -79,6 +79,11 @@ echo $this->data['nav']->render();
|
|||
</select>
|
||||
</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">
|
||||
<label for="iEquipmentEnd"><?= $this->getHtml('Type'); ?></label>
|
||||
<select id="iEquipmentEnd" name="equipment_type">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user