todos fixed

This commit is contained in:
Dennis Eichhorn 2023-10-12 22:49:20 +00:00
parent 587264eb0d
commit 67afeb4911
7 changed files with 43 additions and 41 deletions

View File

@ -61,7 +61,7 @@ final class ApiDriverAttributeController extends Controller
return; return;
} }
$type = DriverAttributeTypeMapper::get()->where('id', (int) $request->getData('type'))->execute(); $type = DriverAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute();
$attribute = $this->createAttributeFromRequest($request, $type); $attribute = $this->createAttributeFromRequest($request, $type);
$this->createModel($request->header->account, $attribute, DriverAttributeMapper::class, 'attribute', $request->getOrigin()); $this->createModel($request->header->account, $attribute, DriverAttributeMapper::class, 'attribute', $request->getOrigin());
$this->createStandardCreateResponse($request, $response, $attribute); $this->createStandardCreateResponse($request, $response, $attribute);
@ -359,7 +359,7 @@ final class ApiDriverAttributeController extends Controller
} }
/** @var AttributeType $old */ /** @var AttributeType $old */
$old = DriverAttributeTypeMapper::get()->where('id', (int) $request->getData('id'))->execute(); $old = DriverAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute();
$new = $this->updateAttributeTypeFromRequest($request, clone $old); $new = $this->updateAttributeTypeFromRequest($request, clone $old);
$this->updateModel($request->header->account, $old, $new, DriverAttributeTypeMapper::class, 'driver_attribute_type', $request->getOrigin()); $this->updateModel($request->header->account, $old, $new, DriverAttributeTypeMapper::class, 'driver_attribute_type', $request->getOrigin());
@ -391,7 +391,7 @@ final class ApiDriverAttributeController extends Controller
} }
/** @var AttributeType $driverAttributeType */ /** @var AttributeType $driverAttributeType */
$driverAttributeType = DriverAttributeTypeMapper::get()->where('id', (int) $request->getData('id'))->execute(); $driverAttributeType = DriverAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute();
$this->deleteModel($request->header->account, $driverAttributeType, DriverAttributeTypeMapper::class, 'driver_attribute_type', $request->getOrigin()); $this->deleteModel($request->header->account, $driverAttributeType, DriverAttributeTypeMapper::class, 'driver_attribute_type', $request->getOrigin());
$this->createStandardDeleteResponse($request, $response, $driverAttributeType); $this->createStandardDeleteResponse($request, $response, $driverAttributeType);
} }

View File

@ -61,7 +61,7 @@ final class ApiVehicleAttributeController extends Controller
return; return;
} }
$type = VehicleAttributeTypeMapper::get()->where('id', (int) $request->getData('type'))->execute(); $type = VehicleAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute();
$attribute = $this->createAttributeFromRequest($request, $type); $attribute = $this->createAttributeFromRequest($request, $type);
$this->createModel($request->header->account, $attribute, VehicleAttributeMapper::class, 'attribute', $request->getOrigin()); $this->createModel($request->header->account, $attribute, VehicleAttributeMapper::class, 'attribute', $request->getOrigin());
$this->createStandardCreateResponse($request, $response, $attribute); $this->createStandardCreateResponse($request, $response, $attribute);
@ -359,7 +359,7 @@ final class ApiVehicleAttributeController extends Controller
} }
/** @var AttributeType $old */ /** @var AttributeType $old */
$old = VehicleAttributeTypeMapper::get()->where('id', (int) $request->getData('id'))->execute(); $old = VehicleAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute();
$new = $this->updateAttributeTypeFromRequest($request, clone $old); $new = $this->updateAttributeTypeFromRequest($request, clone $old);
$this->updateModel($request->header->account, $old, $new, VehicleAttributeTypeMapper::class, 'vehicle_attribute_type', $request->getOrigin()); $this->updateModel($request->header->account, $old, $new, VehicleAttributeTypeMapper::class, 'vehicle_attribute_type', $request->getOrigin());
@ -391,7 +391,7 @@ final class ApiVehicleAttributeController extends Controller
} }
/** @var AttributeType $vehicleAttributeType */ /** @var AttributeType $vehicleAttributeType */
$vehicleAttributeType = VehicleAttributeTypeMapper::get()->where('id', (int) $request->getData('id'))->execute(); $vehicleAttributeType = VehicleAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('id'))->execute();
$this->deleteModel($request->header->account, $vehicleAttributeType, VehicleAttributeTypeMapper::class, 'vehicle_attribute_type', $request->getOrigin()); $this->deleteModel($request->header->account, $vehicleAttributeType, VehicleAttributeTypeMapper::class, 'vehicle_attribute_type', $request->getOrigin());
$this->createStandardDeleteResponse($request, $response, $vehicleAttributeType); $this->createStandardDeleteResponse($request, $response, $vehicleAttributeType);
} }

View File

@ -13,12 +13,12 @@
declare(strict_types=1); declare(strict_types=1);
return ['Navigation' => [ return ['Navigation' => [
'DriverAttributes' => '', 'DriverAttributes' => 'Fahrerattribute',
'DriverInspectionTypes' => '', 'DriverInspectionTypes' => 'Fahrerinspektionstypen',
'Drivers' => '', 'Drivers' => 'Fahrer',
'FleetManagement' => '', 'FleetManagement' => 'Fuhrparkmanagement',
'Inspections' => '', 'Inspections' => 'Inspektionen',
'VehicleAttributes' => '', 'VehicleAttributes' => 'Fahrzeugattribute',
'VehicleInspectionTypes' => '', 'VehicleInspectionTypes' => 'Fahrzeuginspektionstypen',
'Vehicles' => '', 'Vehicles' => 'Fahrzeuge',
]]; ]];

View File

@ -17,10 +17,10 @@ return ['FleetManagement' => [
':status2' => 'Inaktiv', ':status2' => 'Inaktiv',
':status3' => 'Beschädigt', ':status3' => 'Beschädigt',
':status4' => 'Außer Betrieb', ':status4' => 'Außer Betrieb',
'Accounting' => '', 'Accounting' => 'Buchhaltung',
'Addition' => '', 'Addition' => 'Zhd.',
'Address' => '', 'Address' => 'Adresse',
'Addresses' => '', 'Addresses' => 'Adressen',
'Africa' => '', 'Africa' => '',
'AllCustomers' => '', 'AllCustomers' => '',
'America' => '', 'America' => '',
@ -40,15 +40,15 @@ return ['FleetManagement' => [
'CLV' => '', 'CLV' => '',
'Calendar' => '', 'Calendar' => '',
'City' => '', 'City' => '',
'Client' => '', 'Client' => 'Kunde',
'ClientID' => '', 'ClientID' => 'Kunden ID',
'Clients' => '', 'Clients' => 'Kunden',
'ComparisonTime' => '', 'ComparisonTime' => '',
'Contact' => '', 'Contact' => '',
'Costs' => 'Kosten', 'Costs' => 'Kosten',
'Country' => '', 'Country' => '',
'Created' => '', 'Created' => 'Erstellt',
'CreatedAt' => '', 'CreatedAt' => 'Erstellt',
'CreditRating' => '', 'CreditRating' => '',
'Creditcard' => '', 'Creditcard' => '',
'Customers' => '', 'Customers' => '',
@ -70,7 +70,7 @@ return ['FleetManagement' => [
'Fax' => '', 'Fax' => '',
'Files' => 'Dateien', 'Files' => 'Dateien',
'Filter' => '', 'Filter' => '',
'Freightage' => '', 'Freightage' => 'Fracht',
'From' => '', 'From' => '',
'Group' => '', 'Group' => '',
'History' => 'Historie', 'History' => 'Historie',
@ -97,9 +97,9 @@ return ['FleetManagement' => [
'Modified' => '', 'Modified' => '',
'Modules' => '', 'Modules' => '',
'Name' => 'Name', 'Name' => 'Name',
'Name1' => '', 'Name1' => 'Name 1',
'Name2' => '', 'Name2' => 'Name 2',
'Name3' => '', 'Name3' => 'Name 3',
'Net' => '', 'Net' => '',
'NewCustomers' => '', 'NewCustomers' => '',
'Notes' => 'Notizen', 'Notes' => 'Notizen',
@ -132,7 +132,7 @@ return ['FleetManagement' => [
'Status' => 'Status', 'Status' => 'Status',
'Subtype' => '', 'Subtype' => '',
'Support' => '', 'Support' => '',
'Tags' => '', 'Tags' => 'Stichworte',
'Title' => '', 'Title' => '',
'To' => '', 'To' => '',
'Total' => '', 'Total' => '',
@ -148,5 +148,5 @@ return ['FleetManagement' => [
'Website' => '', 'Website' => '',
'Wire' => '', 'Wire' => '',
'YTDSales' => '', 'YTDSales' => '',
'Zip' => '', 'Zip' => 'Postleitzahl',
]]; ]];

View File

@ -47,8 +47,8 @@ return ['FleetManagement' => [
'Contact' => '', 'Contact' => '',
'Costs' => 'Costs', 'Costs' => 'Costs',
'Country' => '', 'Country' => '',
'Created' => '', 'Created' => 'Created',
'CreatedAt' => '', 'CreatedAt' => 'Created At',
'CreditRating' => '', 'CreditRating' => '',
'Creditcard' => '', 'Creditcard' => '',
'Customers' => '', 'Customers' => '',
@ -70,7 +70,7 @@ return ['FleetManagement' => [
'Fax' => '', 'Fax' => '',
'Files' => 'Files', 'Files' => 'Files',
'Filter' => '', 'Filter' => '',
'Freightage' => '', 'Freightage' => 'Freightage',
'From' => '', 'From' => '',
'Group' => '', 'Group' => '',
'History' => 'History', 'History' => 'History',
@ -97,9 +97,9 @@ return ['FleetManagement' => [
'Modified' => '', 'Modified' => '',
'Modules' => '', 'Modules' => '',
'Name' => 'Name', 'Name' => 'Name',
'Name1' => '', 'Name1' => 'Name 1',
'Name2' => '', 'Name2' => 'Name 2',
'Name3' => '', 'Name3' => 'Name 3',
'Net' => '', 'Net' => '',
'NewCustomers' => '', 'NewCustomers' => '',
'Notes' => 'Notes', 'Notes' => 'Notes',
@ -121,7 +121,7 @@ return ['FleetManagement' => [
'PurchasePrice' => 'Purchase Price', 'PurchasePrice' => 'Purchase Price',
'Quantity' => '', 'Quantity' => '',
'RecentInvoices' => '', 'RecentInvoices' => '',
'Region' => '', 'Region' => 'Region',
'Rep' => '', 'Rep' => '',
'Responsible' => 'Responsible', 'Responsible' => 'Responsible',
'Retention' => '', 'Retention' => '',
@ -132,7 +132,7 @@ return ['FleetManagement' => [
'Status' => 'Status', 'Status' => 'Status',
'Subtype' => '', 'Subtype' => '',
'Support' => '', 'Support' => '',
'Tags' => '', 'Tags' => 'Tags',
'Title' => '', 'Title' => '',
'To' => '', 'To' => '',
'Total' => '', 'Total' => '',

View File

@ -12,8 +12,8 @@
*/ */
declare(strict_types=1); declare(strict_types=1);
use Modules\FleetManagement\Models\DriverStatus; use Modules\FleetManagement\Models\Driver\DriverStatus;
use Modules\FleetManagement\Models\NullDriver; use Modules\FleetManagement\Models\Driver\NullDriver;
use Modules\Media\Models\NullMedia; use Modules\Media\Models\NullMedia;
use phpOMS\Uri\UriFactory; use phpOMS\Uri\UriFactory;
@ -102,7 +102,8 @@ echo $this->data['nav']->render();
$driver->attributes, $driver->attributes,
$this->data['attributeTypes'] ?? [], $this->data['attributeTypes'] ?? [],
[], [],
'{/api}fleet/driver/attribute' '{/api}fleet/driver/attribute',
$driver->id
); );
?> ?>
</div> </div>

View File

@ -147,7 +147,8 @@ echo $this->data['nav']->render();
$vehicle->attributes, $vehicle->attributes,
$this->data['attributeTypes'] ?? [], $this->data['attributeTypes'] ?? [],
$this->data['units'] ?? [], $this->data['units'] ?? [],
'{/api}fleet/vehicle/attribute' '{/api}fleet/vehicle/attribute',
$vehicle->id
); );
?> ?>
</div> </div>