template fixes + bug fixes + style fixes

This commit is contained in:
Dennis Eichhorn 2024-04-02 21:40:47 +00:00
parent 3c7c5da883
commit 4673f1de53
4 changed files with 30 additions and 30 deletions

View File

@ -62,13 +62,13 @@ final class BackendController extends Controller
*/ */
public function viewFleetManagementAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface public function viewFleetManagementAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{ {
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeListView($this->app->l11nManager, $request, $response); $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeListView($this->app->l11nManager, $request, $response);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response);
$view->attributes = VehicleAttributeTypeMapper::getAll() $view->attributes = VehicleAttributeTypeMapper::getAll()
->with('l11n') ->with('l11n')
->where('l11n/language', $response->header->l11n->language) ->where('l11n/language', $response->header->l11n->language)
->execute(); ->executeGetArray();
$view->path = 'fleet/vehicle'; $view->path = 'fleet/vehicle';
@ -89,13 +89,13 @@ final class BackendController extends Controller
*/ */
public function viewFleetManagementDriverAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface public function viewFleetManagementDriverAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{ {
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeListView($this->app->l11nManager, $request, $response); $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeListView($this->app->l11nManager, $request, $response);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response);
$view->attributes = DriverAttributeTypeMapper::getAll() $view->attributes = DriverAttributeTypeMapper::getAll()
->with('l11n') ->with('l11n')
->where('l11n/language', $response->header->l11n->language) ->where('l11n/language', $response->header->l11n->language)
->execute(); ->executeGetArray();
$view->path = 'fleet/driver'; $view->path = 'fleet/driver';
@ -126,7 +126,7 @@ final class BackendController extends Controller
->with('type/l11n') ->with('type/l11n')
->where('type/l11n/language', $response->header->l11n->language) ->where('type/l11n/language', $response->header->l11n->language)
->sort('id', 'DESC') ->sort('id', 'DESC')
->execute(); ->executeGetArray();
$view->data['vehicles'] = $list; $view->data['vehicles'] = $list;
@ -155,7 +155,7 @@ final class BackendController extends Controller
$list = DriverMapper::getAll() $list = DriverMapper::getAll()
->with('account') ->with('account')
->sort('id', 'DESC') ->sort('id', 'DESC')
->execute(); ->executeGetArray();
$view->data['drivers'] = $list; $view->data['drivers'] = $list;
@ -189,7 +189,7 @@ final class BackendController extends Controller
->sort('id', 'DESC') ->sort('id', 'DESC')
->executeGetArray(); ->executeGetArray();
$inspections = array_merge($vehicles, $drivers); $inspections = \array_merge($vehicles, $drivers);
\usort($inspections, function (Inspection $a, Inspection $b) : int { \usort($inspections, function (Inspection $a, Inspection $b) : int {
return $a->date?->getTimestamp() <=> $b->date?->getTimestamp(); return $a->date?->getTimestamp() <=> $b->date?->getTimestamp();
}); });
@ -220,7 +220,7 @@ final class BackendController extends Controller
$list = InspectionTypeMapper::getAll() $list = InspectionTypeMapper::getAll()
->sort('id', 'DESC') ->sort('id', 'DESC')
->execute(); ->executeGetArray();
$view->data['inspections'] = $list; $view->data['inspections'] = $list;
@ -248,7 +248,7 @@ final class BackendController extends Controller
$list = InspectionMapper::getAll() $list = InspectionMapper::getAll()
->sort('id', 'DESC') ->sort('id', 'DESC')
->execute(); ->executeGetArray();
$view->data['inspections'] = $list; $view->data['inspections'] = $list;
@ -269,7 +269,7 @@ final class BackendController extends Controller
*/ */
public function viewFleetManagementAttributeType(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface public function viewFleetManagementAttributeType(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{ {
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response); $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003505001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003505001, $request, $response);
$view->attribute = VehicleAttributeTypeMapper::get() $view->attribute = VehicleAttributeTypeMapper::get()
@ -283,7 +283,7 @@ final class BackendController extends Controller
$view->l11ns = VehicleAttributeTypeL11nMapper::getAll() $view->l11ns = VehicleAttributeTypeL11nMapper::getAll()
->where('ref', $view->attribute->id) ->where('ref', $view->attribute->id)
->execute(); ->executeGetArray();
$view->path = 'fleet/vehicle'; $view->path = 'fleet/vehicle';
@ -304,7 +304,7 @@ final class BackendController extends Controller
*/ */
public function viewFleetManagementDriverAttributeType(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface public function viewFleetManagementDriverAttributeType(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{ {
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response); $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003506001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003506001, $request, $response);
$view->attribute = VehicleAttributeTypeMapper::get() $view->attribute = VehicleAttributeTypeMapper::get()
@ -318,7 +318,7 @@ final class BackendController extends Controller
$view->l11ns = VehicleAttributeTypeL11nMapper::getAll() $view->l11ns = VehicleAttributeTypeL11nMapper::getAll()
->where('ref', $view->attribute->id) ->where('ref', $view->attribute->id)
->execute(); ->executeGetArray();
$view->path = 'fleet/driver'; $view->path = 'fleet/driver';
@ -339,7 +339,7 @@ final class BackendController extends Controller
*/ */
public function viewFleetManagementAttributeValue(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface public function viewFleetManagementAttributeValue(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{ {
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeValueView($this->app->l11nManager, $request, $response); $view = new \Modules\Attribute\Theme\Backend\Components\AttributeValueView($this->app->l11nManager, $request, $response);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003505001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003505001, $request, $response);
$view->attribute = VehicleAttributeValueMapper::get() $view->attribute = VehicleAttributeValueMapper::get()
@ -350,7 +350,7 @@ final class BackendController extends Controller
$view->l11ns = VehicleAttributeValueL11nMapper::getAll() $view->l11ns = VehicleAttributeValueL11nMapper::getAll()
->where('ref', $view->attribute->id) ->where('ref', $view->attribute->id)
->execute(); ->executeGetArray();
// @todo Also find the ItemAttributeType // @todo Also find the ItemAttributeType
@ -371,7 +371,7 @@ final class BackendController extends Controller
*/ */
public function viewFleetManagementDriverAttributeValue(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface public function viewFleetManagementDriverAttributeValue(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{ {
$view = new \Modules\Attribute\Theme\Backend\Components\AttributeValueView($this->app->l11nManager, $request, $response); $view = new \Modules\Attribute\Theme\Backend\Components\AttributeValueView($this->app->l11nManager, $request, $response);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003506001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003506001, $request, $response);
$view->attribute = DriverAttributeValueMapper::get() $view->attribute = DriverAttributeValueMapper::get()
@ -382,7 +382,7 @@ final class BackendController extends Controller
$view->l11ns = DriverAttributeValueL11nMapper::getAll() $view->l11ns = DriverAttributeValueL11nMapper::getAll()
->where('ref', $view->attribute->id) ->where('ref', $view->attribute->id)
->execute(); ->executeGetArray();
// @todo Also find the ItemAttributeType // @todo Also find the ItemAttributeType
@ -513,7 +513,7 @@ final class BackendController extends Controller
->with('type/l11n') ->with('type/l11n')
->where('reference', $vehicle->id) ->where('reference', $vehicle->id)
->where('type/l11n/language', $response->header->l11n->language) ->where('type/l11n/language', $response->header->l11n->language)
->execute(); ->executeGetArray();
$view->data['inspections'] = $inspections; $view->data['inspections'] = $inspections;
@ -542,15 +542,15 @@ final class BackendController extends Controller
$view->data['types'] = VehicleTypeMapper::getAll() $view->data['types'] = VehicleTypeMapper::getAll()
->with('l11n') ->with('l11n')
->where('l11n/language', $response->header->l11n->language) ->where('l11n/language', $response->header->l11n->language)
->execute(); ->executeGetArray();
$view->data['units'] = UnitMapper::getAll() $view->data['units'] = UnitMapper::getAll()
->execute(); ->executeGetArray();
$view->data['attributeTypes'] = VehicleAttributeTypeMapper::getAll() $view->data['attributeTypes'] = VehicleAttributeTypeMapper::getAll()
->with('l11n') ->with('l11n')
->where('l11n/language', $response->header->l11n->language) ->where('l11n/language', $response->header->l11n->language)
->execute(); ->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;
@ -601,7 +601,7 @@ final class BackendController extends Controller
->with('type/l11n') ->with('type/l11n')
->where('reference', $driver->id) ->where('reference', $driver->id)
->where('type/l11n/language', $response->header->l11n->language) ->where('type/l11n/language', $response->header->l11n->language)
->execute(); ->executeGetArray();
// @feature Create a new read mapper function that returns relation models instead of its own model // @feature Create a new read mapper function that returns relation models instead of its own model
// https://github.com/Karaka-Management/phpOMS/issues/320 // https://github.com/Karaka-Management/phpOMS/issues/320
@ -628,7 +628,7 @@ final class BackendController extends Controller
$view->data['attributeTypes'] = DriverAttributeTypeMapper::getAll() $view->data['attributeTypes'] = DriverAttributeTypeMapper::getAll()
->with('l11n') ->with('l11n')
->where('l11n/language', $response->header->l11n->language) ->where('l11n/language', $response->header->l11n->language)
->execute(); ->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;

View File

@ -26,9 +26,9 @@ return ['FleetManagement' => [
'Driver' => 'Fahrer', 'Driver' => 'Fahrer',
'Drivers' => 'Fahrer', 'Drivers' => 'Fahrer',
'End' => 'Ende', 'End' => 'Ende',
'From' => 'Von', 'From' => 'Von',
'Description' => 'Beschreibung', 'Description' => 'Beschreibung',
'To' => 'Nach', 'To' => 'Nach',
'Files' => 'Dateien', 'Files' => 'Dateien',
'History' => 'Historie', 'History' => 'Historie',
'Inspections' => 'Inspektionen', 'Inspections' => 'Inspektionen',

View File

@ -26,9 +26,9 @@ return ['FleetManagement' => [
'Driver' => 'Driver', 'Driver' => 'Driver',
'Drivers' => 'Drivers', 'Drivers' => 'Drivers',
'End' => 'End', 'End' => 'End',
'From' => 'From', 'From' => 'From',
'To' => 'To', 'To' => 'To',
'Description' => 'Description', 'Description' => 'Description',
'Files' => 'Files', 'Files' => 'Files',
'History' => 'History', 'History' => 'History',
'Inspections' => 'Inspections', 'Inspections' => 'Inspections',

View File

@ -28,7 +28,7 @@ trait ApiControllerVehicleTrait
#[\PHPUnit\Framework\Attributes\Group('module')] #[\PHPUnit\Framework\Attributes\Group('module')]
public function testApiVehicleCreate() : void public function testApiVehicleCreate() : void
{ {
$vehicleType = VehicleTypeMapper::getAll()->execute(); $vehicleType = VehicleTypeMapper::getAll()->executeGetArray();
$vehicleTypeCount = \count($vehicleType); $vehicleTypeCount = \count($vehicleType);
$fuelTypeCount = FuelTypeMapper::count()->executeCount(); $fuelTypeCount = FuelTypeMapper::count()->executeCount();