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;
}
$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);
$this->createModel($request->header->account, $attribute, DriverAttributeMapper::class, 'attribute', $request->getOrigin());
$this->createStandardCreateResponse($request, $response, $attribute);
@ -359,7 +359,7 @@ final class ApiDriverAttributeController extends Controller
}
/** @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);
$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 */
$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->createStandardDeleteResponse($request, $response, $driverAttributeType);
}

View File

@ -61,7 +61,7 @@ final class ApiVehicleAttributeController extends Controller
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);
$this->createModel($request->header->account, $attribute, VehicleAttributeMapper::class, 'attribute', $request->getOrigin());
$this->createStandardCreateResponse($request, $response, $attribute);
@ -359,7 +359,7 @@ final class ApiVehicleAttributeController extends Controller
}
/** @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);
$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 */
$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->createStandardDeleteResponse($request, $response, $vehicleAttributeType);
}

View File

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

View File

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

View File

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

View File

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

View File

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