mirror of
https://github.com/Karaka-Management/oms-FleetManagement.git
synced 2026-01-11 12:58:42 +00:00
auto fixes + some impl.
This commit is contained in:
parent
3c296f062b
commit
30d0aaf2ce
|
|
@ -458,6 +458,11 @@
|
|||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"fleetmgmt_vehicle_attr_type_internal": {
|
||||
"name": "fleetmgmt_vehicle_attr_type_internal",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"fleetmgmt_vehicle_attr_type_required": {
|
||||
"description": "Every vehicle must have this attribute type if set to true.",
|
||||
"name": "fleetmgmt_vehicle_attr_type_required",
|
||||
|
|
@ -744,6 +749,11 @@
|
|||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"fleetmgmt_driver_attr_type_internal": {
|
||||
"name": "fleetmgmt_driver_attr_type_internal",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"fleetmgmt_driver_attr_type_required": {
|
||||
"description": "Every driver must have this attribute type if set to true.",
|
||||
"name": "fleetmgmt_driver_attr_type_required",
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ use phpOMS\Message\Http\HttpRequest;
|
|||
use phpOMS\Message\Http\HttpResponse;
|
||||
use phpOMS\Module\InstallerAbstract;
|
||||
use phpOMS\Module\ModuleInfo;
|
||||
use phpOMS\Uri\HttpUri;
|
||||
|
||||
/**
|
||||
* Installer class.
|
||||
|
|
@ -131,7 +130,7 @@ final class Installer extends InstallerAbstract
|
|||
/** @var array $type */
|
||||
foreach ($types as $type) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('name', $type['name'] ?? '');
|
||||
|
|
@ -157,7 +156,7 @@ final class Installer extends InstallerAbstract
|
|||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', $l11n);
|
||||
|
|
@ -192,7 +191,7 @@ final class Installer extends InstallerAbstract
|
|||
/** @var array $type */
|
||||
foreach ($types as $type) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('name', $type['name'] ?? '');
|
||||
|
|
@ -218,7 +217,7 @@ final class Installer extends InstallerAbstract
|
|||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', $l11n);
|
||||
|
|
@ -253,7 +252,7 @@ final class Installer extends InstallerAbstract
|
|||
/** @var array $type */
|
||||
foreach ($types as $type) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('name', $type['name'] ?? '');
|
||||
|
|
@ -279,7 +278,7 @@ final class Installer extends InstallerAbstract
|
|||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', $l11n);
|
||||
|
|
@ -314,7 +313,7 @@ final class Installer extends InstallerAbstract
|
|||
/** @var array $type */
|
||||
foreach ($types as $type) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('name', $type['name'] ?? '');
|
||||
|
|
@ -340,7 +339,7 @@ final class Installer extends InstallerAbstract
|
|||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', $l11n);
|
||||
|
|
@ -375,12 +374,14 @@ final class Installer extends InstallerAbstract
|
|||
/** @var array $attribute */
|
||||
foreach ($attributes as $attribute) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('name', $attribute['name'] ?? '');
|
||||
$request->setData('title', \reset($attribute['l11n']));
|
||||
$request->setData('language', \array_keys($attribute['l11n'])[0] ?? 'en');
|
||||
$request->setData('repeatable', $attribute['repeatable'] ?? false);
|
||||
$request->setData('internal', $attribute['internal'] ?? false);
|
||||
$request->setData('is_required', $attribute['is_required'] ?? false);
|
||||
$request->setData('custom', $attribute['is_custom_allowed'] ?? false);
|
||||
$request->setData('validation_pattern', $attribute['validation_pattern'] ?? '');
|
||||
|
|
@ -405,7 +406,7 @@ final class Installer extends InstallerAbstract
|
|||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', $l11n);
|
||||
|
|
@ -444,7 +445,7 @@ final class Installer extends InstallerAbstract
|
|||
/** @var array $value */
|
||||
foreach ($attribute['values'] as $value) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('value', $value['value'] ?? '');
|
||||
|
|
@ -478,7 +479,7 @@ final class Installer extends InstallerAbstract
|
|||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', $l11n);
|
||||
|
|
@ -514,12 +515,14 @@ final class Installer extends InstallerAbstract
|
|||
/** @var array $attribute */
|
||||
foreach ($attributes as $attribute) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('name', $attribute['name'] ?? '');
|
||||
$request->setData('title', \reset($attribute['l11n']));
|
||||
$request->setData('language', \array_keys($attribute['l11n'])[0] ?? 'en');
|
||||
$request->setData('repeatable', $attribute['repeatable'] ?? false);
|
||||
$request->setData('internal', $attribute['internal'] ?? false);
|
||||
$request->setData('is_required', $attribute['is_required'] ?? false);
|
||||
$request->setData('custom', $attribute['is_custom_allowed'] ?? false);
|
||||
$request->setData('validation_pattern', $attribute['validation_pattern'] ?? '');
|
||||
|
|
@ -544,7 +547,7 @@ final class Installer extends InstallerAbstract
|
|||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', $l11n);
|
||||
|
|
@ -583,7 +586,7 @@ final class Installer extends InstallerAbstract
|
|||
/** @var array $value */
|
||||
foreach ($attribute['values'] as $value) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('value', $value['value'] ?? '');
|
||||
|
|
@ -617,7 +620,7 @@ final class Installer extends InstallerAbstract
|
|||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', $l11n);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
|
|||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
return [
|
||||
'^.*/fleet/vehicle/find.*$' => [
|
||||
'^.*/fleet/vehicle/find(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleController:apiVehicleFind',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -30,7 +30,7 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/vehicle/attribute.*$' => [
|
||||
'^.*/fleet/vehicle/attribute(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleAttributeController:apiVehicleAttributeCreate',
|
||||
'verb' => RouteVerb::PUT,
|
||||
|
|
@ -51,7 +51,7 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/driver/attribute.*$' => [
|
||||
'^.*/fleet/driver/attribute(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiDriverAttributeController:apiDriverAttributeCreate',
|
||||
'verb' => RouteVerb::PUT,
|
||||
|
|
@ -72,7 +72,7 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/vehicle/note.*$' => [
|
||||
'^.*/fleet/vehicle/note(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleController:apiNoteCreate',
|
||||
'verb' => RouteVerb::PUT,
|
||||
|
|
@ -93,7 +93,7 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/driver/note.*$' => [
|
||||
'^.*/fleet/driver/note(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiDriverController:apiNoteCreate',
|
||||
'verb' => RouteVerb::PUT,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
|
|||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
return [
|
||||
'^.*/fleet/vehicle/attribute/type/list.*$' => [
|
||||
'^.*/fleet/vehicle/attribute/type/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementAttributeTypeList',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -29,7 +29,7 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/fleet/vehicle/attribute/type\?.*$' => [
|
||||
'^.*/fleet/vehicle/attribute/type(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementAttributeType',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -41,7 +41,7 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/vehicle/list.*$' => [
|
||||
'^.*/fleet/vehicle/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementVehicleList',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -52,7 +52,7 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/fleet/vehicle/create.*$' => [
|
||||
'^.*/fleet/vehicle/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementVehicleCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -63,9 +63,9 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/fleet/vehicle/profile.*$' => [
|
||||
'^.*/fleet/vehicle/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementVehicleProfile',
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementVehicleView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
|
|
@ -75,7 +75,7 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/driver/attribute/type/list.*$' => [
|
||||
'^.*/fleet/driver/attribute/type/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverAttributeTypeList',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -86,7 +86,7 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/fleet/driver/attribute/type\?.*$' => [
|
||||
'^.*/fleet/driver/attribute/type(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverAttributeType',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -98,7 +98,7 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/driver/list.*$' => [
|
||||
'^.*/fleet/driver/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverList',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -109,7 +109,7 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/fleet/driver/create.*$' => [
|
||||
'^.*/fleet/driver/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -120,9 +120,9 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/fleet/driver/profile.*$' => [
|
||||
'^.*/fleet/driver/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverProfile',
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
|
|
@ -132,7 +132,7 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/inspection/list.*$' => [
|
||||
'^.*/fleet/inspection/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementInspectionList',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -143,7 +143,7 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/fleet/inspection/type/list.*$' => [
|
||||
'^.*/fleet/inspection/type/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementInspectionTypeList',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -154,7 +154,7 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/fleet/inspection/create.*$' => [
|
||||
'^.*/fleet/inspection/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementInspectionCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
|
|
@ -165,9 +165,9 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/fleet/inspection/profile.*$' => [
|
||||
'^.*/fleet/inspection/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementInspectionProfile',
|
||||
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementInspectionView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
|
|
|
|||
|
|
@ -61,12 +61,15 @@ final class ApiDriverAttributeController extends Controller
|
|||
return;
|
||||
}
|
||||
|
||||
$type = DriverAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute();
|
||||
$type = DriverAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('id', (int) $request->getData('type'))
|
||||
->execute();
|
||||
|
||||
if (!$type->repeatable) {
|
||||
$attr = DriverAttributeMapper::count()
|
||||
->with('type')
|
||||
->where('type/id', (int) $request->getData('type'))
|
||||
->where('type/id', $type->id)
|
||||
->where('ref', (int) $request->getData('ref'))
|
||||
->execute();
|
||||
|
||||
|
|
@ -164,13 +167,20 @@ final class ApiDriverAttributeController extends Controller
|
|||
->where('id', $request->getDataInt('type') ?? 0)
|
||||
->execute();
|
||||
|
||||
if ($type->isInternal) {
|
||||
$response->header->status = RequestStatusCode::R_403;
|
||||
$this->createInvalidCreateResponse($request, $response, $val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$attrValue = $this->createAttributeValueFromRequest($request, $type);
|
||||
$this->createModel($request->header->account, $attrValue, DriverAttributeValueMapper::class, 'attr_value', $request->getOrigin());
|
||||
|
||||
if ($attrValue->isDefault) {
|
||||
$this->createModelRelation(
|
||||
$request->header->account,
|
||||
(int) $request->getData('type'),
|
||||
$type->id,
|
||||
$attrValue->id,
|
||||
DriverAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ final class ApiDriverController extends Controller
|
|||
$inspection = new Inspection();
|
||||
$inspection->reference = (int) $request->getData('ref');
|
||||
$inspection->description = $request->getDataString('description') ?? '';
|
||||
$inspection->status = $request->getDataInt('status') ?? InspectionStatus::TODO;
|
||||
$inspection->status = InspectionStatus::tryFromValue($request->getDataInt('status')) ?? InspectionStatus::TODO;
|
||||
$inspection->next = $request->getDataDateTime('next') ?? null;
|
||||
$inspection->date = $request->getDataDateTime('date') ?? null;
|
||||
$inspection->interval = $request->getDataInt('interval') ?? 0;
|
||||
|
|
@ -168,7 +168,7 @@ final class ApiDriverController extends Controller
|
|||
{
|
||||
$driver = new Driver();
|
||||
$driver->account = new NullAccount($request->getDataInt('account') ?? 1);
|
||||
$driver->status = $request->getDataInt('status') ?? DriverStatus::INACTIVE;
|
||||
$driver->status = DriverStatus::tryFromValue($request->getDataInt('status')) ?? DriverStatus::INACTIVE;
|
||||
|
||||
return $driver;
|
||||
}
|
||||
|
|
@ -493,7 +493,10 @@ final class ApiDriverController extends Controller
|
|||
{
|
||||
$type = new BaseStringL11nType();
|
||||
$type->title = $request->getDataString('name') ?? '';
|
||||
$type->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
|
||||
$type->setL11n(
|
||||
$request->getDataString('title') ?? '',
|
||||
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
|
||||
);
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
|
@ -557,12 +560,10 @@ final class ApiDriverController extends Controller
|
|||
*/
|
||||
private function createDriverInspectionTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
|
||||
{
|
||||
$typeL11n = new BaseStringL11n();
|
||||
$typeL11n->ref = $request->getDataInt('type') ?? 0;
|
||||
$typeL11n->setLanguage(
|
||||
$request->getDataString('language') ?? $request->header->l11n->language
|
||||
);
|
||||
$typeL11n->content = $request->getDataString('title') ?? '';
|
||||
$typeL11n = new BaseStringL11n();
|
||||
$typeL11n->ref = $request->getDataInt('type') ?? 0;
|
||||
$typeL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
|
||||
$typeL11n->content = $request->getDataString('title') ?? '';
|
||||
|
||||
return $typeL11n;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,12 +61,15 @@ final class ApiVehicleAttributeController extends Controller
|
|||
return;
|
||||
}
|
||||
|
||||
$type = VehicleAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute();
|
||||
$type = VehicleAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('id', (int) $request->getData('type'))
|
||||
->execute();
|
||||
|
||||
if (!$type->repeatable) {
|
||||
$attr = VehicleAttributeMapper::count()
|
||||
->with('type')
|
||||
->where('type/id', (int) $request->getData('type'))
|
||||
->where('type/id', $type->id)
|
||||
->where('ref', (int) $request->getData('ref'))
|
||||
->execute();
|
||||
|
||||
|
|
@ -164,13 +167,20 @@ final class ApiVehicleAttributeController extends Controller
|
|||
->where('id', $request->getDataInt('type') ?? 0)
|
||||
->execute();
|
||||
|
||||
if ($type->isInternal) {
|
||||
$response->header->status = RequestStatusCode::R_403;
|
||||
$this->createInvalidCreateResponse($request, $response, $val);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$attrValue = $this->createAttributeValueFromRequest($request, $type);
|
||||
$this->createModel($request->header->account, $attrValue, VehicleAttributeValueMapper::class, 'attr_value', $request->getOrigin());
|
||||
|
||||
if ($attrValue->isDefault) {
|
||||
$this->createModelRelation(
|
||||
$request->header->account,
|
||||
(int) $request->getData('type'),
|
||||
$type->id,
|
||||
$attrValue->id,
|
||||
VehicleAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ final class ApiVehicleController extends Controller
|
|||
$inspection = new Inspection();
|
||||
$inspection->reference = (int) $request->getData('ref');
|
||||
$inspection->description = $request->getDataString('description') ?? '';
|
||||
$inspection->status = $request->getDataInt('status') ?? InspectionStatus::TODO;
|
||||
$inspection->status = InspectionStatus::tryFromValue($request->getDataInt('status')) ?? InspectionStatus::TODO;
|
||||
$inspection->next = $request->getDataDateTime('next') ?? null;
|
||||
$inspection->date = $request->getDataDateTime('date') ?? null;
|
||||
$inspection->interval = $request->getDataInt('interval') ?? 0;
|
||||
|
|
@ -258,7 +258,10 @@ final class ApiVehicleController extends Controller
|
|||
{
|
||||
$type = new BaseStringL11nType();
|
||||
$type->title = $request->getDataString('name') ?? '';
|
||||
$type->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
|
||||
$type->setL11n(
|
||||
$request->getDataString('title') ?? '',
|
||||
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
|
||||
);
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
|
@ -322,12 +325,10 @@ final class ApiVehicleController extends Controller
|
|||
*/
|
||||
private function createVehicleTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
|
||||
{
|
||||
$typeL11n = new BaseStringL11n();
|
||||
$typeL11n->ref = $request->getDataInt('type') ?? 0;
|
||||
$typeL11n->setLanguage(
|
||||
$request->getDataString('language') ?? $request->header->l11n->language
|
||||
);
|
||||
$typeL11n->content = $request->getDataString('title') ?? '';
|
||||
$typeL11n = new BaseStringL11n();
|
||||
$typeL11n->ref = $request->getDataInt('type') ?? 0;
|
||||
$typeL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
|
||||
$typeL11n->content = $request->getDataString('title') ?? '';
|
||||
|
||||
return $typeL11n;
|
||||
}
|
||||
|
|
@ -394,7 +395,10 @@ final class ApiVehicleController extends Controller
|
|||
{
|
||||
$type = new BaseStringL11nType();
|
||||
$type->title = $request->getDataString('name') ?? '';
|
||||
$type->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
|
||||
$type->setL11n(
|
||||
$request->getDataString('title') ?? '',
|
||||
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
|
||||
);
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
|
@ -458,12 +462,10 @@ final class ApiVehicleController extends Controller
|
|||
*/
|
||||
private function createFuelTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
|
||||
{
|
||||
$typeL11n = new BaseStringL11n();
|
||||
$typeL11n->ref = $request->getDataInt('type') ?? 0;
|
||||
$typeL11n->setLanguage(
|
||||
$request->getDataString('language') ?? $request->header->l11n->language
|
||||
);
|
||||
$typeL11n->content = $request->getDataString('title') ?? '';
|
||||
$typeL11n = new BaseStringL11n();
|
||||
$typeL11n->ref = $request->getDataInt('type') ?? 0;
|
||||
$typeL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
|
||||
$typeL11n->content = $request->getDataString('title') ?? '';
|
||||
|
||||
return $typeL11n;
|
||||
}
|
||||
|
|
@ -540,7 +542,7 @@ final class ApiVehicleController extends Controller
|
|||
$vehicle->info = $request->getDataString('info') ?? '';
|
||||
$vehicle->type = new NullBaseStringL11nType((int) ($request->getDataInt('type') ?? 0));
|
||||
$vehicle->fuelType = new NullBaseStringL11nType((int) ($request->getDataInt('fuel') ?? 0));
|
||||
$vehicle->status = $request->getDataInt('status') ?? VehicleStatus::INACTIVE;
|
||||
$vehicle->status = VehicleStatus::tryFromValue($request->getDataInt('status')) ?? VehicleStatus::INACTIVE;
|
||||
$vehicle->unit = $request->getDataInt('unit') ?? $this->app->unitId;
|
||||
|
||||
return $vehicle;
|
||||
|
|
@ -867,7 +869,10 @@ final class ApiVehicleController extends Controller
|
|||
{
|
||||
$type = new BaseStringL11nType();
|
||||
$type->title = $request->getDataString('name') ?? '';
|
||||
$type->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
|
||||
$type->setL11n(
|
||||
$request->getDataString('title') ?? '',
|
||||
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
|
||||
);
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
|
@ -931,12 +936,10 @@ final class ApiVehicleController extends Controller
|
|||
*/
|
||||
private function createInspectionTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
|
||||
{
|
||||
$typeL11n = new BaseStringL11n();
|
||||
$typeL11n->ref = $request->getDataInt('type') ?? 0;
|
||||
$typeL11n->setLanguage(
|
||||
$request->getDataString('language') ?? $request->header->l11n->language
|
||||
);
|
||||
$typeL11n->content = $request->getDataString('title') ?? '';
|
||||
$typeL11n = new BaseStringL11n();
|
||||
$typeL11n->ref = $request->getDataInt('type') ?? 0;
|
||||
$typeL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
|
||||
$typeL11n->content = $request->getDataString('title') ?? '';
|
||||
|
||||
return $typeL11n;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\FleetManagement\Controller;
|
||||
|
||||
use Modules\Admin\Models\LocalizationMapper;
|
||||
use Modules\Admin\Models\SettingsEnum;
|
||||
use Modules\FleetManagement\Models\Attribute\DriverAttributeTypeMapper;
|
||||
use Modules\FleetManagement\Models\Attribute\VehicleAttributeTypeL11nMapper;
|
||||
use Modules\FleetManagement\Models\Attribute\VehicleAttributeTypeMapper;
|
||||
|
|
@ -332,14 +330,11 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/vehicle-profile');
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/vehicle-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response);
|
||||
|
||||
/** @var \Model\Setting $settings */
|
||||
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION);
|
||||
|
||||
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
||||
$view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
|
||||
$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['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->data['vehicle-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
||||
|
|
@ -363,17 +358,14 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/vehicle-profile');
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/driver-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response);
|
||||
|
||||
/** @var \Model\Setting $settings */
|
||||
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION);
|
||||
$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'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
||||
$view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
|
||||
|
||||
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->data['vehicle-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->data['driver-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -390,11 +382,11 @@ final class BackendController extends Controller
|
|||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewFleetManagementInspectionProfile(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
public function viewFleetManagementInspectionView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/inspection-profile');
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/inspection-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response);
|
||||
|
||||
return $view;
|
||||
|
|
@ -412,11 +404,11 @@ final class BackendController extends Controller
|
|||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewFleetManagementVehicleProfile(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
public function viewFleetManagementVehicleView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/vehicle-profile');
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/vehicle-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response);
|
||||
|
||||
// @todo This language 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.
|
||||
|
|
@ -425,6 +417,7 @@ final class BackendController extends Controller
|
|||
->with('attributes/type')
|
||||
->with('attributes/value')
|
||||
->with('attributes/type/l11n')
|
||||
//->with('attributes/value/l11n')
|
||||
->with('files')
|
||||
->with('files/types')
|
||||
->with('type')
|
||||
|
|
@ -435,6 +428,7 @@ final class BackendController extends Controller
|
|||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->where('fuelType/l11n/language', $response->header->l11n->language)
|
||||
->where('attributes/type/l11n/language', $response->header->l11n->language)
|
||||
//->where('attributes/value/l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
|
||||
$view->data['vehicle'] = $vehicle;
|
||||
|
|
@ -482,11 +476,8 @@ final class BackendController extends Controller
|
|||
|
||||
$view->data['units'] = $units;
|
||||
|
||||
/** @var \Model\Setting $settings */
|
||||
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION);
|
||||
|
||||
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
||||
$view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
|
||||
$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['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->data['vehicle-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
||||
|
|
@ -506,11 +497,11 @@ final class BackendController extends Controller
|
|||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewFleetManagementDriverProfile(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
public function viewFleetManagementDriverView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/driver-profile');
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/driver-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response);
|
||||
|
||||
// @todo This language 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.
|
||||
|
|
@ -519,10 +510,12 @@ final class BackendController extends Controller
|
|||
->with('attributes/type')
|
||||
->with('attributes/value')
|
||||
->with('attributes/type/l11n')
|
||||
//->with('attributes/value/l11n')
|
||||
->with('files')
|
||||
->with('files/types')
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->where('attributes/type/l11n/language', $response->header->l11n->language)
|
||||
//->where('attributes/value/l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
|
||||
$view->data['driver'] = $driver;
|
||||
|
|
@ -558,11 +551,8 @@ final class BackendController extends Controller
|
|||
|
||||
$view->data['driverImage'] = $driverImage;
|
||||
|
||||
/** @var \Model\Setting $settings */
|
||||
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION);
|
||||
|
||||
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
||||
$view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
|
||||
$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['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||
$view->data['driver-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ final class DriverAttributeMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_driver_attr_id' => ['name' => 'fleetmgmt_driver_attr_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_driver_attr_driver' => ['name' => 'fleetmgmt_driver_attr_driver', 'type' => 'int', 'internal' => 'ref'],
|
||||
'fleetmgmt_driver_attr_type' => ['name' => 'fleetmgmt_driver_attr_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'fleetmgmt_driver_attr_value' => ['name' => 'fleetmgmt_driver_attr_value', 'type' => 'int', 'internal' => 'value'],
|
||||
'fleetmgmt_driver_attr_id' => ['name' => 'fleetmgmt_driver_attr_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_driver_attr_driver' => ['name' => 'fleetmgmt_driver_attr_driver', 'type' => 'int', 'internal' => 'ref'],
|
||||
'fleetmgmt_driver_attr_type' => ['name' => 'fleetmgmt_driver_attr_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'fleetmgmt_driver_attr_value' => ['name' => 'fleetmgmt_driver_attr_value', 'type' => 'int', 'internal' => 'value'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ final class DriverAttributeTypeMapper extends DataMapperFactory
|
|||
'fleetmgmt_driver_attr_type_datatype' => ['name' => 'fleetmgmt_driver_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
|
||||
'fleetmgmt_driver_attr_type_fields' => ['name' => 'fleetmgmt_driver_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
|
||||
'fleetmgmt_driver_attr_type_custom' => ['name' => 'fleetmgmt_driver_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
|
||||
'fleetmgmt_driver_attr_type_repeatable' => ['name' => 'fleetmgmt_driver_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
|
||||
'fleetmgmt_driver_attr_type_repeatable' => ['name' => 'fleetmgmt_driver_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
|
||||
'fleetmgmt_driver_attr_type_internal' => ['name' => 'fleetmgmt_driver_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'],
|
||||
'fleetmgmt_driver_attr_type_pattern' => ['name' => 'fleetmgmt_driver_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
|
||||
'fleetmgmt_driver_attr_type_required' => ['name' => 'fleetmgmt_driver_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ final class DriverAttributeValueL11nMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_driver_attr_value_l11n_id' => ['name' => 'fleetmgmt_driver_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_driver_attr_value_l11n_title' => ['name' => 'fleetmgmt_driver_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
||||
'fleetmgmt_driver_attr_value_l11n_value' => ['name' => 'fleetmgmt_driver_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
|
||||
'fleetmgmt_driver_attr_value_l11n_lang' => ['name' => 'fleetmgmt_driver_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
|
||||
'fleetmgmt_driver_attr_value_l11n_id' => ['name' => 'fleetmgmt_driver_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_driver_attr_value_l11n_title' => ['name' => 'fleetmgmt_driver_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
||||
'fleetmgmt_driver_attr_value_l11n_value' => ['name' => 'fleetmgmt_driver_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
|
||||
'fleetmgmt_driver_attr_value_l11n_lang' => ['name' => 'fleetmgmt_driver_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,15 +37,15 @@ final class DriverAttributeValueMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_driver_attr_value_id' => ['name' => 'fleetmgmt_driver_attr_value_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_driver_attr_value_default' => ['name' => 'fleetmgmt_driver_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
|
||||
'fleetmgmt_driver_attr_value_valueStr' => ['name' => 'fleetmgmt_driver_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
|
||||
'fleetmgmt_driver_attr_value_valueInt' => ['name' => 'fleetmgmt_driver_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
|
||||
'fleetmgmt_driver_attr_value_valueDec' => ['name' => 'fleetmgmt_driver_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
|
||||
'fleetmgmt_driver_attr_value_valueDat' => ['name' => 'fleetmgmt_driver_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
|
||||
'fleetmgmt_driver_attr_value_unit' => ['name' => 'fleetmgmt_driver_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
|
||||
'fleetmgmt_driver_attr_value_deptype' => ['name' => 'fleetmgmt_driver_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
|
||||
'fleetmgmt_driver_attr_value_depvalue' => ['name' => 'fleetmgmt_driver_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
|
||||
'fleetmgmt_driver_attr_value_id' => ['name' => 'fleetmgmt_driver_attr_value_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_driver_attr_value_default' => ['name' => 'fleetmgmt_driver_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
|
||||
'fleetmgmt_driver_attr_value_valueStr' => ['name' => 'fleetmgmt_driver_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
|
||||
'fleetmgmt_driver_attr_value_valueInt' => ['name' => 'fleetmgmt_driver_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
|
||||
'fleetmgmt_driver_attr_value_valueDec' => ['name' => 'fleetmgmt_driver_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
|
||||
'fleetmgmt_driver_attr_value_valueDat' => ['name' => 'fleetmgmt_driver_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
|
||||
'fleetmgmt_driver_attr_value_unit' => ['name' => 'fleetmgmt_driver_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
|
||||
'fleetmgmt_driver_attr_value_deptype' => ['name' => 'fleetmgmt_driver_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
|
||||
'fleetmgmt_driver_attr_value_depvalue' => ['name' => 'fleetmgmt_driver_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ final class VehicleAttributeMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_vehicle_attr_id' => ['name' => 'fleetmgmt_vehicle_attr_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_attr_vehicle' => ['name' => 'fleetmgmt_vehicle_attr_vehicle', 'type' => 'int', 'internal' => 'ref'],
|
||||
'fleetmgmt_vehicle_attr_type' => ['name' => 'fleetmgmt_vehicle_attr_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'fleetmgmt_vehicle_attr_value' => ['name' => 'fleetmgmt_vehicle_attr_value', 'type' => 'int', 'internal' => 'value'],
|
||||
'fleetmgmt_vehicle_attr_id' => ['name' => 'fleetmgmt_vehicle_attr_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_attr_vehicle' => ['name' => 'fleetmgmt_vehicle_attr_vehicle', 'type' => 'int', 'internal' => 'ref'],
|
||||
'fleetmgmt_vehicle_attr_type' => ['name' => 'fleetmgmt_vehicle_attr_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'fleetmgmt_vehicle_attr_value' => ['name' => 'fleetmgmt_vehicle_attr_value', 'type' => 'int', 'internal' => 'value'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ final class VehicleAttributeTypeMapper extends DataMapperFactory
|
|||
'fleetmgmt_vehicle_attr_type_datatype' => ['name' => 'fleetmgmt_vehicle_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
|
||||
'fleetmgmt_vehicle_attr_type_fields' => ['name' => 'fleetmgmt_vehicle_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
|
||||
'fleetmgmt_vehicle_attr_type_custom' => ['name' => 'fleetmgmt_vehicle_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
|
||||
'fleetmgmt_vehicle_attr_type_repeatable' => ['name' => 'fleetmgmt_vehicle_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
|
||||
'fleetmgmt_vehicle_attr_type_repeatable' => ['name' => 'fleetmgmt_vehicle_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
|
||||
'fleetmgmt_vehicle_attr_type_internal' => ['name' => 'fleetmgmt_vehicle_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'],
|
||||
'fleetmgmt_vehicle_attr_type_pattern' => ['name' => 'fleetmgmt_vehicle_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
|
||||
'fleetmgmt_vehicle_attr_type_required' => ['name' => 'fleetmgmt_vehicle_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ final class VehicleAttributeValueL11nMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_vehicle_attr_value_l11n_id' => ['name' => 'fleetmgmt_vehicle_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_attr_value_l11n_title' => ['name' => 'fleetmgmt_vehicle_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
||||
'fleetmgmt_vehicle_attr_value_l11n_value' => ['name' => 'fleetmgmt_vehicle_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
|
||||
'fleetmgmt_vehicle_attr_value_l11n_lang' => ['name' => 'fleetmgmt_vehicle_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
|
||||
'fleetmgmt_vehicle_attr_value_l11n_id' => ['name' => 'fleetmgmt_vehicle_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_attr_value_l11n_title' => ['name' => 'fleetmgmt_vehicle_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
||||
'fleetmgmt_vehicle_attr_value_l11n_value' => ['name' => 'fleetmgmt_vehicle_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
|
||||
'fleetmgmt_vehicle_attr_value_l11n_lang' => ['name' => 'fleetmgmt_vehicle_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,15 +37,15 @@ final class VehicleAttributeValueMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_vehicle_attr_value_id' => ['name' => 'fleetmgmt_vehicle_attr_value_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_attr_value_default' => ['name' => 'fleetmgmt_vehicle_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
|
||||
'fleetmgmt_vehicle_attr_value_valueStr' => ['name' => 'fleetmgmt_vehicle_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
|
||||
'fleetmgmt_vehicle_attr_value_valueInt' => ['name' => 'fleetmgmt_vehicle_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
|
||||
'fleetmgmt_vehicle_attr_value_valueDec' => ['name' => 'fleetmgmt_vehicle_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
|
||||
'fleetmgmt_vehicle_attr_value_valueDat' => ['name' => 'fleetmgmt_vehicle_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
|
||||
'fleetmgmt_vehicle_attr_value_unit' => ['name' => 'fleetmgmt_vehicle_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
|
||||
'fleetmgmt_vehicle_attr_value_deptype' => ['name' => 'fleetmgmt_vehicle_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
|
||||
'fleetmgmt_vehicle_attr_value_depvalue' => ['name' => 'fleetmgmt_vehicle_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
|
||||
'fleetmgmt_vehicle_attr_value_id' => ['name' => 'fleetmgmt_vehicle_attr_value_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_attr_value_default' => ['name' => 'fleetmgmt_vehicle_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
|
||||
'fleetmgmt_vehicle_attr_value_valueStr' => ['name' => 'fleetmgmt_vehicle_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
|
||||
'fleetmgmt_vehicle_attr_value_valueInt' => ['name' => 'fleetmgmt_vehicle_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
|
||||
'fleetmgmt_vehicle_attr_value_valueDec' => ['name' => 'fleetmgmt_vehicle_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
|
||||
'fleetmgmt_vehicle_attr_value_valueDat' => ['name' => 'fleetmgmt_vehicle_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
|
||||
'fleetmgmt_vehicle_attr_value_unit' => ['name' => 'fleetmgmt_vehicle_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
|
||||
'fleetmgmt_vehicle_attr_value_deptype' => ['name' => 'fleetmgmt_vehicle_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
|
||||
'fleetmgmt_vehicle_attr_value_depvalue' => ['name' => 'fleetmgmt_vehicle_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class Cost implements \JsonSerializable
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'id' => $this->id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class CostType implements \JsonSerializable
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'id' => $this->id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ class Driver
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'status' => $this->status,
|
||||
'id' => $this->id,
|
||||
'status' => $this->status,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use Modules\FleetManagement\Models\Inspection;
|
|||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* mapper class.
|
||||
* Driver inspection mapper class.
|
||||
*
|
||||
* @package Modules\FleetManagement\Models\Driver
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* mapper class.
|
||||
* Driver inspection type l11n mapper class.
|
||||
*
|
||||
* @package Modules\FleetManagement\Models\Driver
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ final class DriverMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_driver_id' => ['name' => 'fleetmgmt_driver_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_driver_status' => ['name' => 'fleetmgmt_driver_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'fleetmgmt_driver_account' => ['name' => 'fleetmgmt_driver_account', 'type' => 'int', 'internal' => 'account'],
|
||||
'fleetmgmt_driver_id' => ['name' => 'fleetmgmt_driver_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_driver_status' => ['name' => 'fleetmgmt_driver_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'fleetmgmt_driver_account' => ['name' => 'fleetmgmt_driver_account', 'type' => 'int', 'internal' => 'account'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -52,7 +52,7 @@ final class DriverMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const HAS_MANY = [
|
||||
'files' => [
|
||||
'files' => [
|
||||
'mapper' => MediaMapper::class,
|
||||
'table' => 'fleetmgmt_driver_media',
|
||||
'external' => 'fleetmgmt_driver_media_media',
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* mapper class.
|
||||
* Fuel type l11n mapper class.
|
||||
*
|
||||
* @package Modules\FleetManagement\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class Inspection implements \JsonSerializable
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'id' => $this->id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Modules\FleetManagement\Models;
|
|||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* mapper class.
|
||||
* Inspection mapper class.
|
||||
*
|
||||
* @package Modules\FleetManagement\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* mapper class.
|
||||
* Inspection type l11n mapper class.
|
||||
*
|
||||
* @package Modules\FleetManagement\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class License implements \JsonSerializable
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'id' => $this->id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class LicenseType implements \JsonSerializable
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'id' => $this->id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class Milage implements \JsonSerializable
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'id' => $this->id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use Modules\FleetManagement\Models\Driver\DriverMapper;
|
|||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* mapper class.
|
||||
* Milage mapper class.
|
||||
*
|
||||
* @package Modules\FleetManagement\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
@ -37,15 +37,15 @@ final class MilageMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_milage_id' => ['name' => 'fleetmgmt_milage_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_milage_description' => ['name' => 'fleetmgmt_milage_description', 'type' => 'string', 'internal' => 'description'],
|
||||
'fleetmgmt_milage_status' => ['name' => 'fleetmgmt_milage_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'fleetmgmt_milage_driver' => ['name' => 'fleetmgmt_milage_driver', 'type' => 'int', 'internal' => 'driver'],
|
||||
'fleetmgmt_milage_vehicle' => ['name' => 'fleetmgmt_milage_vehicle', 'type' => 'int', 'internal' => 'vehicle'],
|
||||
'fleetmgmt_milage_start' => ['name' => 'fleetmgmt_milage_start', 'type' => 'DateTime', 'internal' => 'start'],
|
||||
'fleetmgmt_milage_end' => ['name' => 'fleetmgmt_milage_end', 'type' => 'DateTime', 'internal' => 'end'],
|
||||
'fleetmgmt_milage_milage' => ['name' => 'fleetmgmt_milage_milage', 'type' => 'int', 'internal' => 'milage'],
|
||||
'fleetmgmt_milage_fuel' => ['name' => 'fleetmgmt_milage_fuel', 'type' => 'int', 'internal' => 'fuelUsage'],
|
||||
'fleetmgmt_milage_id' => ['name' => 'fleetmgmt_milage_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_milage_description' => ['name' => 'fleetmgmt_milage_description', 'type' => 'string', 'internal' => 'description'],
|
||||
'fleetmgmt_milage_status' => ['name' => 'fleetmgmt_milage_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'fleetmgmt_milage_driver' => ['name' => 'fleetmgmt_milage_driver', 'type' => 'int', 'internal' => 'driver'],
|
||||
'fleetmgmt_milage_vehicle' => ['name' => 'fleetmgmt_milage_vehicle', 'type' => 'int', 'internal' => 'vehicle'],
|
||||
'fleetmgmt_milage_start' => ['name' => 'fleetmgmt_milage_start', 'type' => 'DateTime', 'internal' => 'start'],
|
||||
'fleetmgmt_milage_end' => ['name' => 'fleetmgmt_milage_end', 'type' => 'DateTime', 'internal' => 'end'],
|
||||
'fleetmgmt_milage_milage' => ['name' => 'fleetmgmt_milage_milage', 'type' => 'int', 'internal' => 'milage'],
|
||||
'fleetmgmt_milage_fuel' => ['name' => 'fleetmgmt_milage_fuel', 'type' => 'int', 'internal' => 'fuelUsage'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class Vehicle implements \JsonSerializable
|
|||
public function toArray() : array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'id' => $this->id,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,15 +39,15 @@ final class VehicleMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_vehicle_id' => ['name' => 'fleetmgmt_vehicle_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_name' => ['name' => 'fleetmgmt_vehicle_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'fleetmgmt_vehicle_status' => ['name' => 'fleetmgmt_vehicle_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'fleetmgmt_vehicle_info' => ['name' => 'fleetmgmt_vehicle_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'fleetmgmt_vehicle_unit' => ['name' => 'fleetmgmt_vehicle_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'fleetmgmt_vehicle_type' => ['name' => 'fleetmgmt_vehicle_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'fleetmgmt_vehicle_fuel' => ['name' => 'fleetmgmt_vehicle_fuel', 'type' => 'int', 'internal' => 'fuelType'],
|
||||
'fleetmgmt_vehicle_responsible' => ['name' => 'fleetmgmt_vehicle_responsible', 'type' => 'int', 'internal' => 'responsible'],
|
||||
'fleetmgmt_vehicle_created_at' => ['name' => 'fleetmgmt_vehicle_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
'fleetmgmt_vehicle_id' => ['name' => 'fleetmgmt_vehicle_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_name' => ['name' => 'fleetmgmt_vehicle_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'fleetmgmt_vehicle_status' => ['name' => 'fleetmgmt_vehicle_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'fleetmgmt_vehicle_info' => ['name' => 'fleetmgmt_vehicle_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'fleetmgmt_vehicle_unit' => ['name' => 'fleetmgmt_vehicle_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
'fleetmgmt_vehicle_type' => ['name' => 'fleetmgmt_vehicle_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'fleetmgmt_vehicle_fuel' => ['name' => 'fleetmgmt_vehicle_fuel', 'type' => 'int', 'internal' => 'fuelType'],
|
||||
'fleetmgmt_vehicle_responsible' => ['name' => 'fleetmgmt_vehicle_responsible', 'type' => 'int', 'internal' => 'responsible'],
|
||||
'fleetmgmt_vehicle_created_at' => ['name' => 'fleetmgmt_vehicle_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -57,7 +57,7 @@ final class VehicleMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const HAS_MANY = [
|
||||
'files' => [
|
||||
'files' => [
|
||||
'mapper' => MediaMapper::class,
|
||||
'table' => 'fleetmgmt_vehicle_media',
|
||||
'external' => 'fleetmgmt_vehicle_media_media',
|
||||
|
|
@ -85,12 +85,12 @@ final class VehicleMapper extends DataMapperFactory
|
|||
*/
|
||||
public const OWNS_ONE = [
|
||||
'type' => [
|
||||
'mapper' => VehicleTypeMapper::class,
|
||||
'external' => 'fleetmgmt_vehicle_type',
|
||||
'mapper' => VehicleTypeMapper::class,
|
||||
'external' => 'fleetmgmt_vehicle_type',
|
||||
],
|
||||
'fuelType' => [
|
||||
'mapper' => FuelTypeMapper::class,
|
||||
'external' => 'fleetmgmt_vehicle_fuel',
|
||||
'mapper' => FuelTypeMapper::class,
|
||||
'external' => 'fleetmgmt_vehicle_fuel',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* mapper class.
|
||||
* Vehicle type l11n mapper class.
|
||||
*
|
||||
* @package Modules\FleetManagement\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ final class VehicleTypeMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_vehicle_type_id' => ['name' => 'fleetmgmt_vehicle_type_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_type_name' => ['name' => 'fleetmgmt_vehicle_type_name', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
|
||||
'fleetmgmt_vehicle_type_id' => ['name' => 'fleetmgmt_vehicle_type_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_type_name' => ['name' => 'fleetmgmt_vehicle_type_name', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
|
||||
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -13,35 +13,35 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
':status1' => 'Aktiv',
|
||||
':status2' => 'Inaktiv',
|
||||
':status3' => 'Beschädigt',
|
||||
':status4' => 'Außer Betrieb',
|
||||
':status-d1' => 'Aktiv',
|
||||
':status-d2' => 'Inaktiv',
|
||||
':status-d3' => 'Fahrunfähig',
|
||||
'Attributes' => 'Attribute',
|
||||
'Costs' => 'Kosten',
|
||||
'Date' => 'Datum',
|
||||
'Driver' => 'Fahrer',
|
||||
'Drivers' => 'Fahrer',
|
||||
'End' => 'Ende',
|
||||
'Files' => 'Dateien',
|
||||
'History' => 'Historie',
|
||||
'Inspections' => 'Inspektionen',
|
||||
'LeasingFee' => 'Leasingkosten',
|
||||
'Make' => 'Marke',
|
||||
'Milage' => 'Tacho',
|
||||
'Model' => 'Modell',
|
||||
'Name' => 'Name',
|
||||
'Notes' => 'Notizen',
|
||||
'Profile' => 'Profile',
|
||||
'PurchasePrice' => 'Kaufpreis',
|
||||
'Responsible' => 'Verantwortlich',
|
||||
'Start' => 'Start',
|
||||
'Status' => 'Status',
|
||||
'Type' => 'Typ',
|
||||
'Upcoming' => 'Upcoming',
|
||||
'Vehicles' => 'Fahrzeuge',
|
||||
'Vin' => 'Vin',
|
||||
':status1' => 'Aktiv',
|
||||
':status2' => 'Inaktiv',
|
||||
':status3' => 'Beschädigt',
|
||||
':status4' => 'Außer Betrieb',
|
||||
':status-d1' => 'Aktiv',
|
||||
':status-d2' => 'Inaktiv',
|
||||
':status-d3' => 'Fahrunfähig',
|
||||
'Attributes' => 'Attribute',
|
||||
'Costs' => 'Kosten',
|
||||
'Date' => 'Datum',
|
||||
'Driver' => 'Fahrer',
|
||||
'Drivers' => 'Fahrer',
|
||||
'End' => 'Ende',
|
||||
'Files' => 'Dateien',
|
||||
'History' => 'Historie',
|
||||
'Inspections' => 'Inspektionen',
|
||||
'LeasingFee' => 'Leasingkosten',
|
||||
'Make' => 'Marke',
|
||||
'Milage' => 'Tacho',
|
||||
'Model' => 'Modell',
|
||||
'Name' => 'Name',
|
||||
'Notes' => 'Notizen',
|
||||
'Profile' => 'Profile',
|
||||
'PurchasePrice' => 'Kaufpreis',
|
||||
'Responsible' => 'Verantwortlich',
|
||||
'Start' => 'Start',
|
||||
'Status' => 'Status',
|
||||
'Type' => 'Typ',
|
||||
'Upcoming' => 'Upcoming',
|
||||
'Vehicles' => 'Fahrzeuge',
|
||||
'Vin' => 'Vin',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,35 +13,35 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
':status1' => 'Active',
|
||||
':status2' => 'Inactive',
|
||||
':status3' => 'Damaged',
|
||||
':status4' => 'Out of order',
|
||||
':status-d1' => 'Active',
|
||||
':status-d2' => 'Inactive',
|
||||
':status-d3' => 'Suspended',
|
||||
'Attributes' => 'Attributes',
|
||||
'Costs' => 'Costs',
|
||||
'Date' => 'Date',
|
||||
'Driver' => 'Driver',
|
||||
'Drivers' => 'Drivers',
|
||||
'End' => 'End',
|
||||
'Files' => 'Files',
|
||||
'History' => 'History',
|
||||
'Inspections' => 'Inspections',
|
||||
'LeasingFee' => 'Leasing Fee',
|
||||
'Make' => 'Make',
|
||||
'Milage' => 'Milage',
|
||||
'Model' => 'Model',
|
||||
'Name' => 'Name',
|
||||
'Notes' => 'Notes',
|
||||
'Profile' => 'Profile',
|
||||
'PurchasePrice' => 'Purchase Price',
|
||||
'Responsible' => 'Responsible',
|
||||
'Start' => 'Start',
|
||||
'Status' => 'Status',
|
||||
'Type' => 'Type',
|
||||
'Upcoming' => 'Upcoming',
|
||||
'Vehicles' => 'Vehicles',
|
||||
'Vin' => 'Vin',
|
||||
':status1' => 'Active',
|
||||
':status2' => 'Inactive',
|
||||
':status3' => 'Damaged',
|
||||
':status4' => 'Out of order',
|
||||
':status-d1' => 'Active',
|
||||
':status-d2' => 'Inactive',
|
||||
':status-d3' => 'Suspended',
|
||||
'Attributes' => 'Attributes',
|
||||
'Costs' => 'Costs',
|
||||
'Date' => 'Date',
|
||||
'Driver' => 'Driver',
|
||||
'Drivers' => 'Drivers',
|
||||
'End' => 'End',
|
||||
'Files' => 'Files',
|
||||
'History' => 'History',
|
||||
'Inspections' => 'Inspections',
|
||||
'LeasingFee' => 'Leasing Fee',
|
||||
'Make' => 'Make',
|
||||
'Milage' => 'Milage',
|
||||
'Model' => 'Model',
|
||||
'Name' => 'Name',
|
||||
'Notes' => 'Notes',
|
||||
'Profile' => 'Profile',
|
||||
'PurchasePrice' => 'Purchase Price',
|
||||
'Responsible' => 'Responsible',
|
||||
'Start' => 'Start',
|
||||
'Status' => 'Status',
|
||||
'Type' => 'Type',
|
||||
'Upcoming' => 'Upcoming',
|
||||
'Vehicles' => 'Vehicles',
|
||||
'Vin' => 'Vin',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,32 +13,32 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Dato',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Filer',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Navn',
|
||||
'Notes' => 'Notater',
|
||||
'Profile' => 'Profil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Type',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Dato',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Filer',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Navn',
|
||||
'Notes' => 'Notater',
|
||||
'Profile' => 'Profil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Type',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,32 +13,32 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Data',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Pliki',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Nazwa',
|
||||
'Notes' => 'Notatki',
|
||||
'Profile' => 'Profil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Rodzaj',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Data',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Pliki',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Nazwa',
|
||||
'Notes' => 'Notatki',
|
||||
'Profile' => 'Profil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Rodzaj',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,32 +13,32 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Encontro',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'arquivos',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Nome',
|
||||
'Notes' => 'Notas',
|
||||
'Profile' => 'Perfil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Modelo',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Encontro',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'arquivos',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Nome',
|
||||
'Notes' => 'Notas',
|
||||
'Profile' => 'Perfil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Modelo',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,32 +13,32 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Дата',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Файлы',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Имя',
|
||||
'Notes' => 'Примечания',
|
||||
'Profile' => 'Профиль',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Тип',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Дата',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Файлы',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Имя',
|
||||
'Notes' => 'Примечания',
|
||||
'Profile' => 'Профиль',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Тип',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,32 +13,32 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Datum',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Filer',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'namn',
|
||||
'Notes' => 'Anteckningar',
|
||||
'Profile' => 'Profil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Typ',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Datum',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Filer',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'namn',
|
||||
'Notes' => 'Anteckningar',
|
||||
'Profile' => 'Profil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Typ',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,32 +13,32 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'วันที่',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'ไฟล์',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'ชื่อ',
|
||||
'Notes' => 'หมายเหตุ',
|
||||
'Profile' => 'ประวัติโดยย่อ',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'พิมพ์',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'วันที่',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'ไฟล์',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'ชื่อ',
|
||||
'Notes' => 'หมายเหตุ',
|
||||
'Profile' => 'ประวัติโดยย่อ',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'พิมพ์',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,32 +13,32 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Tarih',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Dosyalar',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'İsim',
|
||||
'Notes' => 'Notalar',
|
||||
'Profile' => 'Profil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Tip',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Tarih',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Dosyalar',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'İsim',
|
||||
'Notes' => 'Notalar',
|
||||
'Profile' => 'Profil',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Tip',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,32 +13,32 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Дата',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Файли',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Назва',
|
||||
'Notes' => 'Ноти',
|
||||
'Profile' => 'Профіль',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Тип',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => 'Дата',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => 'Файли',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => 'Назва',
|
||||
'Notes' => 'Ноти',
|
||||
'Profile' => 'Профіль',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => 'Тип',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -13,32 +13,32 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['FleetManagement' => [
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => '日期',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => '文件',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => '名称',
|
||||
'Notes' => '笔记',
|
||||
'Profile' => '轮廓',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => '类型',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
'Attributes' => '',
|
||||
'Costs' => '',
|
||||
'Date' => '日期',
|
||||
'Description' => '',
|
||||
'Driver' => '',
|
||||
'Drivers' => '',
|
||||
'End' => '',
|
||||
'Files' => '文件',
|
||||
'From' => '',
|
||||
'History' => '',
|
||||
'Inspections' => '',
|
||||
'LeasingFee' => '',
|
||||
'Make' => '',
|
||||
'Milage' => '',
|
||||
'Model' => '',
|
||||
'Name' => '名称',
|
||||
'Notes' => '笔记',
|
||||
'Profile' => '轮廓',
|
||||
'PurchasePrice' => '',
|
||||
'Responsible' => '',
|
||||
'Start' => '',
|
||||
'Status' => '',
|
||||
'To' => '',
|
||||
'Type' => '类型',
|
||||
'Upcoming' => '',
|
||||
'VIN' => '',
|
||||
'Vehicles' => '',
|
||||
'Vin' => '',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<tr>
|
||||
<td><a href="#"><i class="g-icon">close</i></a>
|
||||
<td><a href="#"><i class="g-icon">settings</i></a>
|
||||
<td><?= ISO639Enum::getByName('_' . \strtoupper($value->getLanguage())); ?>
|
||||
<td><?= ISO639Enum::getByName('_' . \strtoupper($value->language)); ?>
|
||||
<td><?= $value->content; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
|
|
|
|||
|
|
@ -24,41 +24,41 @@ echo $this->data['nav']->render(); ?>
|
|||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Drivers'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<div class="slider">
|
||||
<table id="iSalesClientList" class="default sticky">
|
||||
<table id="iDriverList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<label for="iSalesClientList-sort-1">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-1">
|
||||
<label for="iDriverList-sort-1">
|
||||
<input type="radio" name="iDriverList-sort" id="iDriverList-sort-1">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-2">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-2">
|
||||
<label for="iDriverList-sort-2">
|
||||
<input type="radio" name="iDriverList-sort" id="iDriverList-sort-2">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Status'); ?>
|
||||
<label for="iSalesClientList-sort-3">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-3">
|
||||
<label for="iDriverList-sort-3">
|
||||
<input type="radio" name="iDriverList-sort" id="iDriverList-sort-3">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-4">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-4">
|
||||
<label for="iDriverList-sort-4">
|
||||
<input type="radio" name="iDriverList-sort" id="iDriverList-sort-4">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
||||
<label for="iSalesClientList-sort-5">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-5">
|
||||
<label for="iDriverList-sort-5">
|
||||
<input type="radio" name="iDriverList-sort" id="iDriverList-sort-5">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-6">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-6">
|
||||
<label for="iDriverList-sort-6">
|
||||
<input type="radio" name="iDriverList-sort" id="iDriverList-sort-6">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
|
|
@ -69,7 +69,7 @@ echo $this->data['nav']->render(); ?>
|
|||
$count = 0;
|
||||
foreach ($drivers as $key => $value) :
|
||||
++$count;
|
||||
$url = UriFactory::build('{/base}/fleet/driver/profile?{?}&id=' . $value->id);
|
||||
$url = UriFactory::build('{/base}/fleet/driver/view?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -17,17 +17,15 @@ use Modules\FleetManagement\Models\Driver\NullDriver;
|
|||
use Modules\Media\Models\NullMedia;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
|
||||
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
|
||||
$driverStatus = DriverStatus::getConstants();
|
||||
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
|
||||
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
|
||||
$driverStatus = DriverStatus::getConstants();
|
||||
|
||||
/**
|
||||
* @var \Modules\FleetManagement\Models\Driver $driver
|
||||
*/
|
||||
$driver = $this->data['driver'] ?? new NullDriver();
|
||||
$files = $driver->files;
|
||||
$driverImage = $this->data['driverImage'] ?? new NullMedia();
|
||||
$attributeView = $this->data['attributeView'];
|
||||
$driver = $this->data['driver'] ?? new NullDriver();
|
||||
$driverImage = $this->data['driverImage'] ?? new NullMedia();
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
|
|
@ -98,7 +96,7 @@ echo $this->data['nav']->render();
|
|||
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<?= $attributeView->render(
|
||||
<?= $this->data['attributeView']->render(
|
||||
$driver->attributes,
|
||||
$this->data['attributeTypes'] ?? [],
|
||||
[],
|
||||
|
|
@ -201,7 +199,7 @@ echo $this->data['nav']->render();
|
|||
</div>
|
||||
<?php if (0 > 0) : ?>
|
||||
<div class="ipt-second">
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/sales/client/profile?id=' . 0); ?>"><?= $this->getHtml('Driver'); ?></a>
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/sales/client/view?id=' . 0); ?>"><?= $this->getHtml('Driver'); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
|||
326
Theme/Backend/driver-view.tpl.php
Normal file
326
Theme/Backend/driver-view.tpl.php
Normal file
|
|
@ -0,0 +1,326 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\ClientManagement
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\FleetManagement\Models\Driver\DriverStatus;
|
||||
use Modules\FleetManagement\Models\Driver\NullDriver;
|
||||
use Modules\Media\Models\NullMedia;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
|
||||
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
|
||||
$driverStatus = DriverStatus::getConstants();
|
||||
|
||||
/**
|
||||
* @var \Modules\FleetManagement\Models\Driver $driver
|
||||
*/
|
||||
$driver = $this->data['driver'] ?? new NullDriver();
|
||||
$driverImage = $this->data['driverImage'] ?? new NullMedia();
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
echo $this->data['nav']->render();
|
||||
?>
|
||||
<div class="tabview tab-2">
|
||||
<div class="box">
|
||||
<ul class="tab-links">
|
||||
<li><label for="c-tab-1"><?= $this->getHtml('Profile'); ?></label>
|
||||
<li><label for="c-tab-2"><?= $this->getHtml('Attributes'); ?></label>
|
||||
<li><label for="c-tab-3"><?= $this->getHtml('Files'); ?></label>
|
||||
<li><label for="c-tab-4"><?= $this->getHtml('Notes'); ?></label>
|
||||
<li><label for="c-tab-5"><?= $this->getHtml('Inspections'); ?></label>
|
||||
<li><label for="c-tab-7"><?= $this->getHtml('Milage'); ?></label>
|
||||
<li><label for="c-tab-8"><?= $this->getHtml('Costs'); ?></label>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Profile'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iFleetDriverProfileName"><?= $this->getHtml('Name'); ?></label>
|
||||
<input type="text" id="iFleetDriverProfileName" name="name" value="<?= $this->printHtml($driver->account->name1); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iDriverStatus"><?= $this->getHtml('Status'); ?></label>
|
||||
<select id="iDriverStatus" name="driver_status">
|
||||
<?php foreach ($driverStatus as $status) : ?>
|
||||
<option value="<?= $status; ?>"<?= $status === $driver->status ? ' selected' : ''; ?>><?= $this->getHtml(':status-d' . $status); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iDriverMake"><?= $this->getHtml('Make'); ?></label>
|
||||
<input type="text" id="iDriverMake" name="make" value="<?= $this->printHtml($driver->getAttribute('maker')->value->getValue()); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?php if ($driver->id === 0) : ?>
|
||||
<input id="iCreateSubmit" type="Submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||
<?php else : ?>
|
||||
<input id="iSaveSubmit" type="Submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="md-hidden col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-body">
|
||||
<img width="100%" src="<?= $driverImage->id === 0
|
||||
? 'Web/Backend/img/logo_grey.png'
|
||||
: UriFactory::build($driverImage->getPath()); ?>"></a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<?= $this->data['attributeView']->render(
|
||||
$driver->attributes,
|
||||
$this->data['attributeTypes'] ?? [],
|
||||
[],
|
||||
'{/api}fleet/driver/attribute',
|
||||
$driver->id
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
|
||||
<div class="tab col-simple">
|
||||
<?= $this->data['media-upload']->render('driver-file', 'files', '', $driver->files); ?>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<?= $this->data['driver-notes']->render('driver-notes', '', $driver->notes); ?>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/fleet/inspection/create?driver=' . $driver->id); ?>"><?= $this->getHtml('Create', '0', '0'); ?></a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Upcoming'); ?></div>
|
||||
<table id="upcomingInspections" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Date'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Type'); ?>
|
||||
<td><?= $this->getHtml('Responsible'); ?>
|
||||
<tbody>
|
||||
<?php foreach ($this->data['inspections'] as $inspection) :
|
||||
// @todo handle old inspections in the past? maybe use a status?!
|
||||
if ($inspection->next === null) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $inspection->next->format('Y-m-d H:i'); ?>
|
||||
<td><?= $this->printHtml($inspection->type->getL11n()); ?>
|
||||
<td>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('History'); ?></div>
|
||||
<table id="historicInspections" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Date'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Type'); ?>
|
||||
<td><?= $this->getHtml('Responsible'); ?>
|
||||
<tbody>
|
||||
<?php foreach ($this->data['inspections'] as $inspection) : ?>
|
||||
<tr>
|
||||
<td><?= $inspection->date->format('Y-m-d H:i'); ?>
|
||||
<td><?= $this->printHtml($inspection->type->getL11n()); ?>
|
||||
<td>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-7" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-7' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<form id="milageForm" action="<?= UriFactory::build(''); ?>" method="post"
|
||||
data-ui-container="#milageTable tbody"
|
||||
data-add-form="milageForm"
|
||||
data-add-tpl="#milageTable tbody .oms-add-tpl-milage">
|
||||
<div class="portlet-head"><?= $this->getHtml('Milage'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iAttributeId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||
<input type="text" id="iAttributeId" name="id" data-tpl-text="/id" data-tpl-value="/id" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iDriver"><?= $this->getHtml('Driver'); ?></label>
|
||||
<div class="ipt-wrap">
|
||||
<div class="ipt-first">
|
||||
<span class="input">
|
||||
<button type="button" formaction="">
|
||||
<i class="g-icon">book</i>
|
||||
</button>
|
||||
<input type="text" id="iDriver" name="bill_client" value="">
|
||||
</span>
|
||||
</div>
|
||||
<?php if (0 > 0) : ?>
|
||||
<div class="ipt-second">
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/sales/client/view?id=' . 0); ?>"><?= $this->getHtml('Driver'); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iStartDate"><?= $this->getHtml('Start'); ?></label>
|
||||
<input type="datetime-local" id="iStartDate" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iEndDate"><?= $this->getHtml('End'); ?></label>
|
||||
<input type="datetime-local" id="iEndDate" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iFrom"><?= $this->getHtml('From'); ?></label>
|
||||
<input type="text" id="iFrom" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iTo"><?= $this->getHtml('To'); ?></label>
|
||||
<input type="text" id="iTo" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMilage"><?= $this->getHtml('Milage'); ?></label>
|
||||
<input type="number" id="iMilage" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMilageDescription"><?= $this->getHtml('Description'); ?></label>
|
||||
<pre class="textarea contenteditable" id="iMilageDescription" data-name="description" data-tpl-value="/value" contenteditable></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<input id="bAttributeAdd" formmethod="put" type="submit" class="add-form" value="<?= $this->getHtml('Add', '0', '0'); ?>">
|
||||
<input id="bAttributeSave" formmethod="post" type="submit" class="save-form hidden button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
|
||||
<input type="submit" class="cancel-form hidden button close" value="<?= $this->getHtml('Cancel', '0', '0'); ?>">
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Milage'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<div class="slider">
|
||||
<table id="milageTable" class="default sticky"
|
||||
data-tag="form"
|
||||
data-ui-element="tr"
|
||||
data-add-tpl=".oms-add-tpl-milage"
|
||||
data-update-form="milageForm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Driver'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||
<td><?= $this->getHtml('Milage'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||
<td><?= $this->getHtml('Start'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||
<td><?= $this->getHtml('End'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||
<tbody>
|
||||
<template class="oms-add-tpl-milage">
|
||||
<tr data-id="" draggable="false">
|
||||
<td>
|
||||
<i class="g-icon btn update-form">settings</i>
|
||||
<input id="milageTable-remove-0" type="checkbox" class="hidden">
|
||||
<label for="milageTable-remove-0" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
||||
<span class="checked-visibility">
|
||||
<label for="milageTable-remove-0" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||
<label for="milageTable-remove-0" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
||||
</span>
|
||||
<td data-tpl-text="/id" data-tpl-value="/id"></td>
|
||||
<td data-tpl-text="/type" data-tpl-value="/type" data-value=""></td>
|
||||
<td data-tpl-text="/value" data-tpl-value="/value"></td>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit"></td>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit"></td>
|
||||
</tr>
|
||||
</template>
|
||||
<?php $c = 0;
|
||||
$milage = [];
|
||||
foreach ($milage as $key => $value) : ++$c; ?>
|
||||
<tr data-id="<?= $value->id; ?>">
|
||||
<td>
|
||||
<i class="g-icon btn update-form">settings</i>
|
||||
<?php if (!$value->type->isRequired) : ?>
|
||||
<input id="milageTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
||||
<label for="milageTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
||||
<span class="checked-visibility">
|
||||
<label for="milageTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||
<label for="milageTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
||||
<td data-tpl-text="/type" data-tpl-value="/type" data-value="<?= $value->type->id; ?>"><?= $this->printHtml($value->type->getL11n()); ?>
|
||||
<td data-tpl-text="/value" data-tpl-value="/value"><?= $value->value->getValue() instanceof \DateTime ? $value->value->getValue()->format('Y-m-d') : $this->printHtml((string) $value->value->getValue()); ?>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value="<?= $value->value->unit; ?>"><?= $this->printHtml($value->value->unit); ?>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value="<?= $value->value->unit; ?>"><?= $this->printHtml($value->value->unit); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr>
|
||||
<td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-8" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-8' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -24,53 +24,53 @@ echo $this->data['nav']->render(); ?>
|
|||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Vehicles'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<div class="slider">
|
||||
<table id="iSalesClientList" class="default sticky">
|
||||
<table id="iVehicleList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<label for="iSalesClientList-sort-1">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-1">
|
||||
<label for="iVehicleList-sort-1">
|
||||
<input type="radio" name="iVehicleList-sort" id="iVehicleList-sort-1">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-2">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-2">
|
||||
<label for="iVehicleList-sort-2">
|
||||
<input type="radio" name="iVehicleList-sort" id="iVehicleList-sort-2">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Status'); ?>
|
||||
<label for="iSalesClientList-sort-3">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-3">
|
||||
<label for="iVehicleList-sort-3">
|
||||
<input type="radio" name="iVehicleList-sort" id="iVehicleList-sort-3">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-4">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-4">
|
||||
<label for="iVehicleList-sort-4">
|
||||
<input type="radio" name="iVehicleList-sort" id="iVehicleList-sort-4">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
||||
<label for="iSalesClientList-sort-5">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-5">
|
||||
<label for="iVehicleList-sort-5">
|
||||
<input type="radio" name="iVehicleList-sort" id="iVehicleList-sort-5">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-6">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-6">
|
||||
<label for="iVehicleList-sort-6">
|
||||
<input type="radio" name="iVehicleList-sort" id="iVehicleList-sort-6">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Type'); ?>
|
||||
<label for="iSalesClientList-sort-7">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-7">
|
||||
<label for="iVehicleList-sort-7">
|
||||
<input type="radio" name="iVehicleList-sort" id="iVehicleList-sort-7">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-8">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-8">
|
||||
<label for="iVehicleList-sort-8">
|
||||
<input type="radio" name="iVehicleList-sort" id="iVehicleList-sort-8">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
|
|
@ -81,7 +81,7 @@ echo $this->data['nav']->render(); ?>
|
|||
$count = 0;
|
||||
foreach ($vehicles as $key => $value) :
|
||||
++$count;
|
||||
$url = UriFactory::build('{/base}/fleet/vehicle/profile?{?}&id=' . $value->id);
|
||||
$url = UriFactory::build('{/base}/fleet/vehicle/view?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -24,11 +24,9 @@ $vehicleStatus = VehicleStatus::getConstants();
|
|||
/**
|
||||
* @var \Modules\FleetManagement\Models\Vehicle $vehicle
|
||||
*/
|
||||
$vehicle = $this->data['vehicle'] ?? new NullVehicle();
|
||||
$files = $vehicle->files;
|
||||
$vehicleImage = $this->data['vehicleImage'] ?? new NullMedia();
|
||||
$vehicleTypes = $this->data['types'] ?? [];
|
||||
$attributeView = $this->data['attributeView'];
|
||||
$vehicle = $this->data['vehicle'] ?? new NullVehicle();
|
||||
$vehicleImage = $this->data['vehicleImage'] ?? new NullMedia();
|
||||
$vehicleTypes = $this->data['types'] ?? [];
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
|
|
@ -143,7 +141,7 @@ echo $this->data['nav']->render();
|
|||
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<?= $attributeView->render(
|
||||
<?= $this->data['attributeView']->render(
|
||||
$vehicle->attributes,
|
||||
$this->data['attributeTypes'] ?? [],
|
||||
$this->data['units'] ?? [],
|
||||
|
|
@ -246,7 +244,7 @@ echo $this->data['nav']->render();
|
|||
</div>
|
||||
<?php if (0 > 0) : ?>
|
||||
<div class="ipt-second">
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/sales/client/profile?id=' . 0); ?>"><?= $this->getHtml('Driver'); ?></a>
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/sales/client/view?id=' . 0); ?>"><?= $this->getHtml('Driver'); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
|||
385
Theme/Backend/vehicle-view.tpl.php
Normal file
385
Theme/Backend/vehicle-view.tpl.php
Normal file
|
|
@ -0,0 +1,385 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\ClientManagement
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\FleetManagement\Models\NullVehicle;
|
||||
use Modules\FleetManagement\Models\VehicleStatus;
|
||||
use Modules\Media\Models\NullMedia;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
|
||||
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
|
||||
$vehicleStatus = VehicleStatus::getConstants();
|
||||
|
||||
/**
|
||||
* @var \Modules\FleetManagement\Models\Vehicle $vehicle
|
||||
*/
|
||||
$vehicle = $this->data['vehicle'] ?? new NullVehicle();
|
||||
$vehicleImage = $this->data['vehicleImage'] ?? new NullMedia();
|
||||
$vehicleTypes = $this->data['types'] ?? [];
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
echo $this->data['nav']->render();
|
||||
?>
|
||||
<div class="tabview tab-2">
|
||||
<div class="box">
|
||||
<ul class="tab-links">
|
||||
<li><label for="c-tab-1"><?= $this->getHtml('Profile'); ?></label>
|
||||
<li><label for="c-tab-2"><?= $this->getHtml('Attributes'); ?></label>
|
||||
<li><label for="c-tab-3"><?= $this->getHtml('Files'); ?></label>
|
||||
<li><label for="c-tab-4"><?= $this->getHtml('Notes'); ?></label>
|
||||
<li><label for="c-tab-5"><?= $this->getHtml('Inspections'); ?></label>
|
||||
<li><label for="c-tab-7"><?= $this->getHtml('Milage'); ?></label>
|
||||
<li><label for="c-tab-8"><?= $this->getHtml('Costs'); ?></label>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Profile'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iFleetVehicleProfileName"><?= $this->getHtml('Name'); ?></label>
|
||||
<input type="text" id="iFleetVehicleProfileName" name="name" value="<?= $this->printHtml($vehicle->name); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehicleDriver"><?= $this->getHtml('Driver'); ?></label>
|
||||
<input type="text" id="iVehicleDriver" name="driver" value="" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehicleVin"><?= $this->getHtml('VIN'); ?></label>
|
||||
<input type="text" id="iVehicleVin" name="vin" value="<?= $this->printHtml($vehicle->getAttribute('vin')->value->getValue()); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehicleStatus"><?= $this->getHtml('Status'); ?></label>
|
||||
<select id="iVehicleStatus" name="vehicle_status">
|
||||
<?php foreach ($vehicleStatus as $status) : ?>
|
||||
<option value="<?= $status; ?>"<?= $status === $vehicle->status ? ' selected' : ''; ?>><?= $this->getHtml(':status' . $status); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehicleEnd"><?= $this->getHtml('Type'); ?></label>
|
||||
<select id="iVehicleEnd" name="vehicle_type">
|
||||
<?php foreach ($vehicleTypes as $type) : ?>
|
||||
<option value="<?= $type->id; ?>"<?= $vehicle->type->id === $type->id ? ' selected' : ''; ?>><?= $this->printHtml($type->getL11n()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehicleMake"><?= $this->getHtml('Make'); ?></label>
|
||||
<input type="text" id="iVehicleMake" name="make" value="<?= $this->printHtml($vehicle->getAttribute('maker')->value->getValue()); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehicleModel"><?= $this->getHtml('Model'); ?></label>
|
||||
<input type="text" id="iVehicleModel" name="vehicle_model" value="<?= $this->printHtml($vehicle->getAttribute('vehicle_model')->value->getValue()); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehicleStart"><?= $this->getHtml('Start'); ?></label>
|
||||
<input type="datetime-local" id="iVehicleStart" name="ownership_start" value="<?= $vehicle->getAttribute('ownership_start')->value->getValue()?->format('Y-m-d\TH:i') ?? $vehicle->createdAt->format('Y-m-d\TH:i'); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehicleEnd"><?= $this->getHtml('End'); ?></label>
|
||||
<input type="datetime-local" id="iVehicleEnd" name="ownership_end" value="<?= $vehicle->getAttribute('ownership_end')->value->getValue()?->format('Y-m-d\TH:i'); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehiclePrice"><?= $this->getHtml('PurchasePrice'); ?></label>
|
||||
<input type="number" step="0.01" id="iVehiclePrice" name="purchase_price" value="<?= $this->printHtml($vehicle->getAttribute('purchase_price')->value->getValue()); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iVehiclePrice"><?= $this->getHtml('LeasingFee'); ?></label>
|
||||
<input type="number" step="0.01" id="iVehiclePrice" name="leasing_fee" value="<?= $this->printHtml($vehicle->getAttribute('leasing_fee')->value->getValue()); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?php if ($vehicle->id === 0) : ?>
|
||||
<input id="iCreateSubmit" type="Submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||
<?php else : ?>
|
||||
<input id="iSaveSubmit" type="Submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-body">
|
||||
<img width="100%" src="<?= $vehicleImage->id === 0
|
||||
? 'Web/Backend/img/logo_grey.png'
|
||||
: UriFactory::build($vehicleImage->getPath()); ?>"></a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<?= $this->data['attributeView']->render(
|
||||
$vehicle->attributes,
|
||||
$this->data['attributeTypes'] ?? [],
|
||||
$this->data['units'] ?? [],
|
||||
'{/api}fleet/vehicle/attribute',
|
||||
$vehicle->id
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
|
||||
<div class="tab col-simple">
|
||||
<?= $this->data['media-upload']->render('vehicle-file', 'files', '', $vehicle->files); ?>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<?= $this->data['vehicle-notes']->render('vehicle-notes', '', $vehicle->notes); ?>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/fleet/inspection/create?vehicle=' . $vehicle->id); ?>"><?= $this->getHtml('Create', '0', '0'); ?></a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Upcoming'); ?></div>
|
||||
<table id="upcomingInspections" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Date'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Type'); ?>
|
||||
<td><?= $this->getHtml('Responsible'); ?>
|
||||
<tbody>
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($this->data['inspections'] as $inspection) :
|
||||
// @todo handle old inspections in the past? maybe use a status?!
|
||||
if ($inspection->next === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
++$count;
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $inspection->next->format('Y-m-d H:i'); ?>
|
||||
<td><?= $this->printHtml($inspection->type->getL11n()); ?>
|
||||
<td>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('History'); ?></div>
|
||||
<table id="historicInspections" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Date'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Type'); ?>
|
||||
<td><?= $this->getHtml('Responsible'); ?>
|
||||
<tbody>
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($this->data['inspections'] as $inspection) :
|
||||
++$count;
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $inspection->date->format('Y-m-d H:i'); ?>
|
||||
<td><?= $this->printHtml($inspection->type->getL11n()); ?>
|
||||
<td>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-7" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-7' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<form id="milageForm" action="<?= UriFactory::build(''); ?>" method="post"
|
||||
data-ui-container="#milageTable tbody"
|
||||
data-add-form="milageForm"
|
||||
data-add-tpl="#milageTable tbody .oms-add-tpl-milage">
|
||||
<div class="portlet-head"><?= $this->getHtml('Milage'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iAttributeId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||
<input type="text" id="iAttributeId" name="id" data-tpl-text="/id" data-tpl-value="/id" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iDriver"><?= $this->getHtml('Driver'); ?></label>
|
||||
<div class="ipt-wrap">
|
||||
<div class="ipt-first">
|
||||
<span class="input">
|
||||
<button type="button" formaction="">
|
||||
<i class="g-icon">book</i>
|
||||
</button>
|
||||
<input type="text" id="iDriver" name="bill_client" value="">
|
||||
</span>
|
||||
</div>
|
||||
<?php if (0 > 0) : ?>
|
||||
<div class="ipt-second">
|
||||
<a class="button" href="<?= UriFactory::build('{/base}/sales/client/view?id=' . 0); ?>"><?= $this->getHtml('Driver'); ?></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iStartDate"><?= $this->getHtml('Start'); ?></label>
|
||||
<input type="datetime-local" id="iStartDate" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iEndDate"><?= $this->getHtml('End'); ?></label>
|
||||
<input type="datetime-local" id="iEndDate" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iFrom"><?= $this->getHtml('From'); ?></label>
|
||||
<input type="text" id="iFrom" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iTo"><?= $this->getHtml('To'); ?></label>
|
||||
<input type="text" id="iTo" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMilage"><?= $this->getHtml('Milage'); ?></label>
|
||||
<input type="number" id="iMilage" name="bill_invoice_date"
|
||||
value="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMilageDescription"><?= $this->getHtml('Description'); ?></label>
|
||||
<pre class="textarea contenteditable" id="iMilageDescription" data-name="description" data-tpl-value="/value" contenteditable></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<input id="bAttributeAdd" formmethod="put" type="submit" class="add-form" value="<?= $this->getHtml('Add', '0', '0'); ?>">
|
||||
<input id="bAttributeSave" formmethod="post" type="submit" class="save-form hidden button save" value="<?= $this->getHtml('Update', '0', '0'); ?>">
|
||||
<input type="submit" class="cancel-form hidden button close" value="<?= $this->getHtml('Cancel', '0', '0'); ?>">
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Milage'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<div class="slider">
|
||||
<table id="milageTable" class="default sticky"
|
||||
data-tag="form"
|
||||
data-ui-element="tr"
|
||||
data-add-tpl=".oms-add-tpl-milage"
|
||||
data-update-form="milageForm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Driver'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||
<td><?= $this->getHtml('Milage'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||
<td><?= $this->getHtml('Start'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||
<td><?= $this->getHtml('End'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||
<tbody>
|
||||
<template class="oms-add-tpl-milage">
|
||||
<tr data-id="" draggable="false">
|
||||
<td>
|
||||
<i class="g-icon btn update-form">settings</i>
|
||||
<input id="milageTable-remove-0" type="checkbox" class="hidden">
|
||||
<label for="milageTable-remove-0" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
||||
<span class="checked-visibility">
|
||||
<label for="milageTable-remove-0" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||
<label for="milageTable-remove-0" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
||||
</span>
|
||||
<td data-tpl-text="/id" data-tpl-value="/id"></td>
|
||||
<td data-tpl-text="/type" data-tpl-value="/type" data-value=""></td>
|
||||
<td data-tpl-text="/value" data-tpl-value="/value"></td>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit"></td>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit"></td>
|
||||
</tr>
|
||||
</template>
|
||||
<?php $c = 0;
|
||||
$milage = [];
|
||||
foreach ($milage as $key => $value) : ++$c; ?>
|
||||
<tr data-id="<?= $value->id; ?>">
|
||||
<td>
|
||||
<i class="g-icon btn update-form">settings</i>
|
||||
<?php if (!$value->type->isRequired) : ?>
|
||||
<input id="milageTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
||||
<label for="milageTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
||||
<span class="checked-visibility">
|
||||
<label for="milageTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||
<label for="milageTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
||||
<td data-tpl-text="/type" data-tpl-value="/type" data-value="<?= $value->type->id; ?>"><?= $this->printHtml($value->type->getL11n()); ?>
|
||||
<td data-tpl-text="/value" data-tpl-value="/value"><?= $value->value->getValue() instanceof \DateTime ? $value->value->getValue()->format('Y-m-d') : $this->printHtml((string) $value->value->getValue()); ?>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value="<?= $value->value->unit; ?>"><?= $this->printHtml($value->value->unit); ?>
|
||||
<td data-tpl-text="/unit" data-tpl-value="/unit" data-value="<?= $value->value->unit; ?>"><?= $this->printHtml($value->value->unit); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr>
|
||||
<td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="radio" id="c-tab-8" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-8' ? ' checked' : ''; ?>>
|
||||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -75,8 +75,8 @@ final class Autoloader
|
|||
*/
|
||||
public static function defaultAutoloader(string $class) : void
|
||||
{
|
||||
$class = \ltrim($class, '\\');
|
||||
$class = \strtr($class, '_\\', '//');
|
||||
$class = \ltrim($class, '\\');
|
||||
$class = \strtr($class, '_\\', '//');
|
||||
|
||||
if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) {
|
||||
$class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,15 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @package Modules\FleetManagement\tests
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
\ini_set('memory_limit', '2048M');
|
||||
|
|
@ -67,10 +78,10 @@ $GLOBALS['is_github'] = $IS_GITHUB;
|
|||
$tmp = FileLogger::getInstance(__DIR__ . '/../Logs');
|
||||
|
||||
$CONFIG = [
|
||||
'db' => [
|
||||
'db' => [
|
||||
'core' => [
|
||||
'masters' => [
|
||||
'admin' => [
|
||||
'admin' => [
|
||||
'db' => 'mysql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '3306', /* db host port */
|
||||
|
|
@ -80,7 +91,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'insert' => [
|
||||
'insert' => [
|
||||
'db' => 'mysql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '3306', /* db host port */
|
||||
|
|
@ -90,7 +101,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'select' => [
|
||||
'select' => [
|
||||
'db' => 'mysql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '3306', /* db host port */
|
||||
|
|
@ -100,7 +111,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'update' => [
|
||||
'update' => [
|
||||
'db' => 'mysql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '3306', /* db host port */
|
||||
|
|
@ -110,7 +121,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'delete' => [
|
||||
'delete' => [
|
||||
'db' => 'mysql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '3306', /* db host port */
|
||||
|
|
@ -120,7 +131,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'schema' => [
|
||||
'schema' => [
|
||||
'db' => 'mysql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '3306', /* db host port */
|
||||
|
|
@ -132,7 +143,7 @@ $CONFIG = [
|
|||
],
|
||||
],
|
||||
'postgresql' => [
|
||||
'admin' => [
|
||||
'admin' => [
|
||||
'db' => 'pgsql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '5432', /* db host port */
|
||||
|
|
@ -142,7 +153,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'insert' => [
|
||||
'insert' => [
|
||||
'db' => 'pgsql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '5432', /* db host port */
|
||||
|
|
@ -152,7 +163,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'select' => [
|
||||
'select' => [
|
||||
'db' => 'pgsql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '5432', /* db host port */
|
||||
|
|
@ -162,7 +173,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'update' => [
|
||||
'update' => [
|
||||
'db' => 'pgsql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '5432', /* db host port */
|
||||
|
|
@ -172,7 +183,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'delete' => [
|
||||
'delete' => [
|
||||
'db' => 'pgsql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '5432', /* db host port */
|
||||
|
|
@ -182,7 +193,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'schema' => [
|
||||
'schema' => [
|
||||
'db' => 'pgsql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '5432', /* db host port */
|
||||
|
|
@ -194,37 +205,37 @@ $CONFIG = [
|
|||
],
|
||||
],
|
||||
'sqlite' => [
|
||||
'admin' => [
|
||||
'admin' => [
|
||||
'db' => 'sqlite', /* db type */
|
||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'insert' => [
|
||||
'insert' => [
|
||||
'db' => 'sqlite', /* db type */
|
||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'select' => [
|
||||
'select' => [
|
||||
'db' => 'sqlite', /* db type */
|
||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'update' => [
|
||||
'update' => [
|
||||
'db' => 'sqlite', /* db type */
|
||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'delete' => [
|
||||
'delete' => [
|
||||
'db' => 'sqlite', /* db type */
|
||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'schema' => [
|
||||
'schema' => [
|
||||
'db' => 'sqlite', /* db type */
|
||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||
'weight' => 1000, /* db table prefix */
|
||||
|
|
@ -232,7 +243,7 @@ $CONFIG = [
|
|||
],
|
||||
],
|
||||
'mssql' => [
|
||||
'admin' => [
|
||||
'admin' => [
|
||||
'db' => 'mssql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '1433', /* db host port */
|
||||
|
|
@ -242,7 +253,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'insert' => [
|
||||
'insert' => [
|
||||
'db' => 'mssql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '1433', /* db host port */
|
||||
|
|
@ -252,7 +263,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'select' => [
|
||||
'select' => [
|
||||
'db' => 'mssql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '1433', /* db host port */
|
||||
|
|
@ -262,7 +273,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'update' => [
|
||||
'update' => [
|
||||
'db' => 'mssql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '1433', /* db host port */
|
||||
|
|
@ -272,7 +283,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'delete' => [
|
||||
'delete' => [
|
||||
'db' => 'mssql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '1433', /* db host port */
|
||||
|
|
@ -282,7 +293,7 @@ $CONFIG = [
|
|||
'weight' => 1000, /* db table prefix */
|
||||
'datetimeformat' => 'Y-m-d H:i:s',
|
||||
],
|
||||
'schema' => [
|
||||
'schema' => [
|
||||
'db' => 'mssql', /* db type */
|
||||
'host' => '127.0.0.1', /* db host address */
|
||||
'port' => '1433', /* db host port */
|
||||
|
|
@ -322,16 +333,16 @@ $CONFIG = [
|
|||
'password' => '123456',
|
||||
],
|
||||
],
|
||||
'log' => [
|
||||
'log' => [
|
||||
'file' => [
|
||||
'path' => __DIR__ . '/Logs',
|
||||
],
|
||||
],
|
||||
'page' => [
|
||||
'page' => [
|
||||
'root' => '/',
|
||||
'https' => false,
|
||||
],
|
||||
'app' => [
|
||||
'app' => [
|
||||
'path' => __DIR__,
|
||||
'default' => [
|
||||
'app' => 'Backend',
|
||||
|
|
@ -350,7 +361,7 @@ $CONFIG = [
|
|||
],
|
||||
],
|
||||
],
|
||||
'socket' => [
|
||||
'socket' => [
|
||||
'master' => [
|
||||
'host' => '127.0.0.1',
|
||||
'limit' => 300,
|
||||
|
|
@ -360,7 +371,7 @@ $CONFIG = [
|
|||
'language' => [
|
||||
'en',
|
||||
],
|
||||
'apis' => [
|
||||
'apis' => [
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ use phpOMS\Localization\ISO639x1Enum;
|
|||
use phpOMS\Message\Http\HttpRequest;
|
||||
use phpOMS\Message\Http\HttpResponse;
|
||||
use phpOMS\Message\Http\RequestStatusCode;
|
||||
use phpOMS\Uri\HttpUri;
|
||||
|
||||
include_once __DIR__ . '/../../Autoloader.php';
|
||||
|
||||
|
|
@ -32,7 +31,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeTypeCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('name', 'test_attribute');
|
||||
|
|
@ -50,7 +49,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeTypeL11nCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', 'DE:2');
|
||||
|
|
@ -68,7 +67,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeValueIntCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('default', '1');
|
||||
|
|
@ -88,7 +87,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeValueStrCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('type', '1');
|
||||
|
|
@ -107,7 +106,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeValueFloatCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('type', '1');
|
||||
|
|
@ -126,7 +125,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeValueDatCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('type', '1');
|
||||
|
|
@ -145,7 +144,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeCreate() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('ref', '1');
|
||||
|
|
@ -163,7 +162,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeValueCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('invalid', '1');
|
||||
|
|
@ -179,7 +178,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeTypeCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('invalid', '1');
|
||||
|
|
@ -195,7 +194,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeTypeL11nCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('invalid', '1');
|
||||
|
|
@ -211,7 +210,7 @@ trait ApiControllerAttributeTrait
|
|||
public function testApiVehicleAttributeCreateInvalidData() : void
|
||||
{
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('invalid', '1');
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ use Modules\FleetManagement\Models\FuelTypeMapper;
|
|||
use Modules\FleetManagement\Models\VehicleTypeMapper;
|
||||
use phpOMS\Message\Http\HttpRequest;
|
||||
use phpOMS\Message\Http\HttpResponse;
|
||||
use phpOMS\Uri\HttpUri;
|
||||
use phpOMS\Utils\RnG\Text;
|
||||
|
||||
trait ApiControllerVehicleTrait
|
||||
|
|
@ -34,7 +33,7 @@ trait ApiControllerVehicleTrait
|
|||
$fuelTypeCount = FuelTypeMapper::count()->execute();
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
$request = new HttpRequest();
|
||||
|
||||
$LOREM = \array_slice(Text::LOREM_IPSUM, 0, 25);
|
||||
$LOREM_COUNT = \count($LOREM) - 1;
|
||||
|
|
|
|||
|
|
@ -57,13 +57,13 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
|||
protected string $appName = 'Api';
|
||||
};
|
||||
|
||||
$this->app->dbPool = $GLOBALS['dbpool'];
|
||||
$this->app->unitId = 1;
|
||||
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
||||
$this->app->appSettings = new CoreSettings();
|
||||
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
|
||||
$this->app->dispatcher = new Dispatcher($this->app);
|
||||
$this->app->eventManager = new EventManager($this->app->dispatcher);
|
||||
$this->app->dbPool = $GLOBALS['dbpool'];
|
||||
$this->app->unitId = 1;
|
||||
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
||||
$this->app->appSettings = new CoreSettings();
|
||||
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
|
||||
$this->app->dispatcher = new Dispatcher($this->app);
|
||||
$this->app->eventManager = new EventManager($this->app->dispatcher);
|
||||
$this->app->eventManager->importFromFile(__DIR__ . '/../../../../Web/Api/Hooks.php');
|
||||
$this->app->sessionManager = new HttpSession(36000);
|
||||
$this->app->l11nManager = new L11nManager();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user