mirror of
https://github.com/Karaka-Management/oms-FleetManagement.git
synced 2026-01-11 12:58:42 +00:00
Continue implementation.
This commit is contained in:
parent
364626bf85
commit
8517c6a051
|
|
@ -110,7 +110,7 @@
|
|||
"pid": "/",
|
||||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Inspection",
|
||||
"name": "Inspections",
|
||||
"uri": "{/base}/fleet/inspection/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
|
|
@ -139,11 +139,26 @@
|
|||
"pid": "/fleet/inspection",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "{/base}/fleet/inspection/create?{?}",
|
||||
"name": "VehicleInspectionTypes",
|
||||
"uri": "{/base}/fleet/vehicle/inspection/type/list?{?}",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"order": 5,
|
||||
"from": "FleetManagement",
|
||||
"permission": { "permission": 4, "category": null, "element": null },
|
||||
"parent": 1003504001,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": 1003504301,
|
||||
"pid": "/fleet/inspection",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "DriverInspectionTypes",
|
||||
"uri": "{/base}/fleet/driver/inspection/type/list?{?}",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 10,
|
||||
"from": "FleetManagement",
|
||||
"permission": { "permission": 4, "category": null, "element": null },
|
||||
"parent": 1003504001,
|
||||
|
|
|
|||
|
|
@ -428,7 +428,7 @@
|
|||
"null": false
|
||||
},
|
||||
"fleetmgmt_attr_type_required": {
|
||||
"description": "Every item must have this attribute type if set to true.",
|
||||
"description": "Every vehicle must have this attribute type if set to true.",
|
||||
"name": "fleetmgmt_attr_type_required",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
|
|
@ -601,8 +601,8 @@
|
|||
"primary": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"fleetmgmt_vehicle_attr_item": {
|
||||
"name": "fleetmgmt_vehicle_attr_item",
|
||||
"fleetmgmt_vehicle_attr_vehicle": {
|
||||
"name": "fleetmgmt_vehicle_attr_vehicle",
|
||||
"type": "INT(11)",
|
||||
"null": false,
|
||||
"foreignTable": "fleetmgmt_vehicle",
|
||||
|
|
@ -709,7 +709,7 @@
|
|||
"null": false
|
||||
},
|
||||
"fleetmgmt_driver_attr_type_required": {
|
||||
"description": "Every item must have this attribute type if set to true.",
|
||||
"description": "Every driver must have this attribute type if set to true.",
|
||||
"name": "fleetmgmt_driver_attr_type_required",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
|
|
@ -882,8 +882,8 @@
|
|||
"primary": true,
|
||||
"autoincrement": true
|
||||
},
|
||||
"fleetmgmt_driver_attr_item": {
|
||||
"name": "fleetmgmt_driver_attr_item",
|
||||
"fleetmgmt_driver_attr_driver": {
|
||||
"name": "fleetmgmt_driver_attr_driver",
|
||||
"type": "INT(11)",
|
||||
"null": false,
|
||||
"foreignTable": "fleetmgmt_driver",
|
||||
|
|
|
|||
9
Admin/Install/driverinspectiontype.json
Normal file
9
Admin/Install/driverinspectiontype.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[
|
||||
{
|
||||
"name": "license",
|
||||
"l11n": {
|
||||
"en": "License",
|
||||
"de": "Führerschein"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -87,6 +87,16 @@ final class Installer extends InstallerAbstract
|
|||
/** @var array $types */
|
||||
$types = \json_decode($fileContent, true);
|
||||
$inspectionTypes = self::createInspectionTypes($app, $types);
|
||||
|
||||
/* Inspection types */
|
||||
$fileContent = \file_get_contents(__DIR__ . '/Install/driverinspectiontype.json');
|
||||
if ($fileContent === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var array $types */
|
||||
$types = \json_decode($fileContent, true);
|
||||
$inspectionTypes = self::createDriverInspectionTypes($app, $types);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -272,6 +282,67 @@ final class Installer extends InstallerAbstract
|
|||
return $inspectionTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install inspection type
|
||||
*
|
||||
* @param ApplicationAbstract $app Application
|
||||
* @param array $types Attribute definition
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private static function createDriverInspectionTypes(ApplicationAbstract $app, array $types) : array
|
||||
{
|
||||
/** @var array<string, array> $inspectionTypes */
|
||||
$inspectionTypes = [];
|
||||
|
||||
/** @var \Modules\FleetManagement\Controller\ApiVehicleController $module */
|
||||
$module = $app->moduleManager->getModuleInstance('FleetManagement', 'ApiDriver');
|
||||
|
||||
/** @var array $type */
|
||||
foreach ($types as $type) {
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('name', $type['name'] ?? '');
|
||||
$request->setData('title', \reset($type['l11n']));
|
||||
$request->setData('language', \array_keys($type['l11n'])[0] ?? 'en');
|
||||
|
||||
$module->apiDriverInspectionTypeCreate($request, $response);
|
||||
|
||||
$responseData = $response->get('');
|
||||
if (!\is_array($responseData)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$inspectionTypes[$type['name']] = !\is_array($responseData['response'])
|
||||
? $responseData['response']->toArray()
|
||||
: $responseData['response'];
|
||||
|
||||
$isFirst = true;
|
||||
foreach ($type['l11n'] as $language => $l11n) {
|
||||
if ($isFirst) {
|
||||
$isFirst = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
$response = new HttpResponse();
|
||||
$request = new HttpRequest(new HttpUri(''));
|
||||
|
||||
$request->header->account = 1;
|
||||
$request->setData('title', $l11n);
|
||||
$request->setData('language', $language);
|
||||
$request->setData('type', $inspectionTypes[$type['name']]['id']);
|
||||
|
||||
$module->apiDriverInspectionTypeL11nCreate($request, $response);
|
||||
}
|
||||
}
|
||||
|
||||
return $inspectionTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install default attribute types
|
||||
*
|
||||
|
|
|
|||
|
|
@ -58,12 +58,33 @@ return [
|
|||
'permission' => [
|
||||
'module' => Controller::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::VEHICLE,
|
||||
'state' => PermissionCategory::DRIVER,
|
||||
],
|
||||
],
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiDriverAttributeController:apiDriverAttributeUpdate',
|
||||
'verb' => RouteVerb::SET,
|
||||
'permission' => [
|
||||
'module' => Controller::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::DRIVER,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/vehicle/note.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleAttributeController:apiNoteCreate',
|
||||
'verb' => RouteVerb::PUT,
|
||||
'permission' => [
|
||||
'module' => Controller::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::VEHICLE,
|
||||
],
|
||||
],
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleAttributeController:apiNoteEdit',
|
||||
'verb' => RouteVerb::SET,
|
||||
'permission' => [
|
||||
'module' => Controller::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -71,4 +92,25 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
|
||||
'^.*/fleet/driver/note.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiDriverAttributeController:apiNoteCreate',
|
||||
'verb' => RouteVerb::PUT,
|
||||
'permission' => [
|
||||
'module' => Controller::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::DRIVER,
|
||||
],
|
||||
],
|
||||
[
|
||||
'dest' => '\Modules\FleetManagement\Controller\ApiDriverAttributeController:apiNoteEdit',
|
||||
'verb' => RouteVerb::SET,
|
||||
'permission' => [
|
||||
'module' => Controller::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::DRIVER,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ final class ApiDriverController extends Controller
|
|||
$driver->id,
|
||||
$media->id,
|
||||
DriverMapper::class,
|
||||
'media',
|
||||
'files',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
|
|
@ -179,7 +179,7 @@ final class ApiDriverController extends Controller
|
|||
$driver->id,
|
||||
$media->id,
|
||||
DriverMapper::class,
|
||||
'media',
|
||||
'files',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
|
|
@ -408,7 +408,7 @@ final class ApiDriverController extends Controller
|
|||
|
||||
/** @var BaseStringL11nType $driver */
|
||||
$driver = $this->createDriverInspectionTypeFromRequest($request);
|
||||
$this->createModel($request->header->account, $driver, DriverInspectionTypeMapper::class, 'inspection_type', $request->getOrigin());
|
||||
$this->createModel($request->header->account, $driver, DriverInspectionTypeMapper::class, 'driver_inspection_type', $request->getOrigin());
|
||||
|
||||
$this->fillJsonResponse(
|
||||
$request,
|
||||
|
|
@ -475,14 +475,14 @@ final class ApiDriverController extends Controller
|
|||
public function apiDriverInspectionTypeL11nCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateDriverInspectionTypeL11nCreate($request))) {
|
||||
$response->data['inspection_type_l11n_create'] = new FormValidation($val);
|
||||
$response->data['driver_inspection_type_l11n_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$typeL11n = $this->createDriverInspectionTypeL11nFromRequest($request);
|
||||
$this->createModel($request->header->account, $typeL11n, DriverInspectionTypeL11nMapper::class, 'inspection_type_l11n', $request->getOrigin());
|
||||
$this->createModel($request->header->account, $typeL11n, DriverInspectionTypeL11nMapper::class, 'driver_inspection_type_l11n', $request->getOrigin());
|
||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Localization', 'Localization successfully created', $typeL11n);
|
||||
}
|
||||
|
||||
|
|
@ -529,7 +529,7 @@ final class ApiDriverController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to create item files
|
||||
* Api method to create notes
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -550,7 +550,7 @@ final class ApiDriverController extends Controller
|
|||
return;
|
||||
}
|
||||
|
||||
$request->setData('virtualpath', '/Modules/FleetManagement/Items/' . $request->getData('id'), true);
|
||||
$request->setData('virtualpath', '/Modules/FleetManagement/Driver/' . $request->getData('id'), true);
|
||||
$this->app->moduleManager->get('Editor', 'Api')->apiEditorCreate($request, $response, $data);
|
||||
|
||||
if ($response->header->status !== RequestStatusCode::R_200) {
|
||||
|
|
@ -585,4 +585,31 @@ final class ApiDriverController extends Controller
|
|||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Api method to update note
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function apiNoteEdit(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
$this->app->moduleManager->get('Editor', 'Api')->apiEditorUpdate($request, $response, $data);
|
||||
|
||||
if ($response->header->status !== RequestStatusCode::R_200) {
|
||||
return;
|
||||
}
|
||||
|
||||
$responseData = $response->get($request->uri->__toString());
|
||||
if (!\is_array($responseData)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ final class ApiVehicleController extends Controller
|
|||
$vehicle->id,
|
||||
$media->id,
|
||||
VehicleMapper::class,
|
||||
'media',
|
||||
'files',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
|
|
@ -476,7 +476,7 @@ final class ApiVehicleController extends Controller
|
|||
$vehicle->id,
|
||||
$media->id,
|
||||
VehicleMapper::class,
|
||||
'media',
|
||||
'files',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
|
|
@ -827,7 +827,7 @@ final class ApiVehicleController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to create item files
|
||||
* Api method to create notes
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -848,7 +848,7 @@ final class ApiVehicleController extends Controller
|
|||
return;
|
||||
}
|
||||
|
||||
$request->setData('virtualpath', '/Modules/FleetManagement/Items/' . $request->getData('id'), true);
|
||||
$request->setData('virtualpath', '/Modules/FleetManagement/Vehicle/' . $request->getData('id'), true);
|
||||
$this->app->moduleManager->get('Editor', 'Api')->apiEditorCreate($request, $response, $data);
|
||||
|
||||
if ($response->header->status !== RequestStatusCode::R_200) {
|
||||
|
|
@ -883,4 +883,31 @@ final class ApiVehicleController extends Controller
|
|||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Api method to update note
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function apiNoteEdit(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
$this->app->moduleManager->get('Editor', 'Api')->apiEditorUpdate($request, $response, $data);
|
||||
|
||||
if ($response->header->status !== RequestStatusCode::R_200) {
|
||||
return;
|
||||
}
|
||||
|
||||
$responseData = $response->get($request->uri->__toString());
|
||||
if (!\is_array($responseData)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,6 +100,35 @@ final class BackendController extends Controller
|
|||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Routing end-point for application behaviour.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return RenderableInterface Returns a renderable object
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewFleetManagementDriverList(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/driver-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response);
|
||||
|
||||
$list = DriverMapper::getAll()
|
||||
->with('account')
|
||||
->sort('id', 'DESC')
|
||||
->execute();
|
||||
|
||||
$view->data['drivers'] = $list;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Routing end-point for application behaviour.
|
||||
*
|
||||
|
|
@ -254,4 +283,73 @@ final class BackendController extends Controller
|
|||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Routing end-point for application behaviour.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param mixed $data Generic data
|
||||
*
|
||||
* @return RenderableInterface Returns a renderable object
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function viewFleetManagementDriverProfile(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
|
||||
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/driver-profile');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response);
|
||||
|
||||
// @todo: This langauge filtering doesn't work. But it was working with the old mappers. Maybe there is a bug in the where() definition. Need to inspect the actual query.
|
||||
$driver = DriverMapper::get()
|
||||
->with('attributes')
|
||||
->with('attributes/type')
|
||||
->with('attributes/value')
|
||||
->with('attributes/type/l11n')
|
||||
->with('files')
|
||||
->with('files/types')
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->where('attributes/type/l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
|
||||
$view->data['driver'] = $driver;
|
||||
|
||||
$query = new Builder($this->app->dbPool->get());
|
||||
$results = $query->selectAs(DriverMapper::HAS_MANY['files']['external'], 'file')
|
||||
->from(DriverMapper::TABLE)
|
||||
->leftJoin(DriverMapper::HAS_MANY['files']['table'])
|
||||
->on(DriverMapper::HAS_MANY['files']['table'] . '.' . DriverMapper::HAS_MANY['files']['self'], '=', DriverMapper::TABLE . '.' . DriverMapper::PRIMARYFIELD)
|
||||
->leftJoin(MediaMapper::TABLE)
|
||||
->on(DriverMapper::HAS_MANY['files']['table'] . '.' . DriverMapper::HAS_MANY['files']['external'], '=', MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD)
|
||||
->leftJoin(MediaMapper::HAS_MANY['types']['table'])
|
||||
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self'])
|
||||
->leftJoin(MediaTypeMapper::TABLE)
|
||||
->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD)
|
||||
->where(DriverMapper::HAS_MANY['files']['self'], '=', $driver->id)
|
||||
->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'driver_profile_image');
|
||||
|
||||
$driverImage = MediaMapper::get()
|
||||
->with('types')
|
||||
->where('id', $results)
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$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['defaultlocalization'] = 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['driver-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
||||
|
||||
return $view;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ final class DriverAttributeMapper extends DataMapperFactory
|
|||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_driver_attr_id' => ['name' => 'fleetmgmt_driver_attr_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_driver_attr_item' => ['name' => 'fleetmgmt_driver_attr_item', 'type' => 'int', 'internal' => 'ref'],
|
||||
'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'],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ final class DriverMapper extends DataMapperFactory
|
|||
'attributes' => [
|
||||
'mapper' => DriverAttributeMapper::class,
|
||||
'table' => 'fleetmgmt_driver_attr',
|
||||
'self' => 'fleetmgmt_driver_attr_item',
|
||||
'self' => 'fleetmgmt_driver_attr_driver',
|
||||
'external' => null,
|
||||
],
|
||||
'notes' => [
|
||||
|
|
|
|||
|
|
@ -32,9 +32,17 @@ abstract class PermissionCategory extends Enum
|
|||
|
||||
public const VEHICLE_TYPE = 3;
|
||||
|
||||
public const INSPECTION_TYPE = 4;
|
||||
public const VEHICLE_INSPECTION_TYPE = 4;
|
||||
|
||||
public const INSPECTION = 5;
|
||||
public const VEHICLE_INSPECTION = 5;
|
||||
|
||||
public const ATTRIBUTE_TYPE = 6;
|
||||
public const VEHICLE_ATTRIBUTE_TYPE = 6;
|
||||
|
||||
public const DRIVER = 7;
|
||||
|
||||
public const DRIVER_INSPECTION_TYPE = 8;
|
||||
|
||||
public const DRIVER_INSPECTION = 9;
|
||||
|
||||
public const DRIVER_ATTRIBUTE_TYPE = 10;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ final class VehicleAttributeMapper extends DataMapperFactory
|
|||
*/
|
||||
public const COLUMNS = [
|
||||
'fleetmgmt_vehicle_attr_id' => ['name' => 'fleetmgmt_vehicle_attr_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'fleetmgmt_vehicle_attr_item' => ['name' => 'fleetmgmt_vehicle_attr_item', 'type' => 'int', 'internal' => 'ref'],
|
||||
'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'],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -15,5 +15,10 @@ declare(strict_types=1);
|
|||
return ['Navigation' => [
|
||||
'FleetManagement' => 'Fleet Management',
|
||||
'Vehicles' => 'Vehicles',
|
||||
'Drivers' => 'Drivers',
|
||||
'Drivers' => 'Drivers',
|
||||
'Inspections' => 'Inspections',
|
||||
'VehicleInspectionTypes' => 'Vehicle Inspection Types',
|
||||
'DriverInspectionTypes' => 'Driver Inspection Types',
|
||||
'VehicleAttributes' => 'Vehicle Attributes',
|
||||
'DriverAttributes' => 'Driver Attributes',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ return ['FleetManagement' => [
|
|||
'Milage' => 'Milage',
|
||||
'Driver' => 'Driver',
|
||||
'Vin' => 'Vin',
|
||||
'History' => 'History',
|
||||
'Upcoming' => 'Upcoming',
|
||||
'Responsible' => 'Responsible',
|
||||
'Date' => 'Date',
|
||||
'PurchasePrice' => 'Purchase Price',
|
||||
'LeasingFee' => 'Leasing Fee',
|
||||
':status1' => 'Active',
|
||||
|
|
|
|||
100
Theme/Backend/driver-list.tpl.php
Normal file
100
Theme/Backend/driver-list.tpl.php
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Karaka
|
||||
*
|
||||
* 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 phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$drivers = $this->data['drivers'] ?? [];
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Vehicles'); ?><i class="lni lni-download download btn end-xs"></i></div>
|
||||
<div class="slider">
|
||||
<table id="iSalesClientList" 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">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-2">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-2">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Status'); ?>
|
||||
<label for="iSalesClientList-sort-3">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-3">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-4">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-4">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
||||
<label for="iSalesClientList-sort-5">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-5">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-6">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-6">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<td><?= $this->getHtml('Type'); ?>
|
||||
<label for="iSalesClientList-sort-7">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-7">
|
||||
<i class="sort-asc fa fa-chevron-up"></i>
|
||||
</label>
|
||||
<label for="iSalesClientList-sort-8">
|
||||
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-8">
|
||||
<i class="sort-desc fa fa-chevron-down"></i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter fa fa-filter"></i>
|
||||
</label>
|
||||
<tbody>
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($drivers as $key => $value) :
|
||||
++$count;
|
||||
$url = UriFactory::build('{/base}/fleet/driver/profile?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td>
|
||||
<td data-label="<?= $this->getHtml('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml((string) $value->id); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Status'); ?>"><a href="<?= $url; ?>"><?= $this->getHtml(':status' . $value->status); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Type'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->type->getL11n()); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
318
Theme/Backend/driver-profile.tpl.php
Normal file
318
Theme/Backend/driver-profile.tpl.php
Normal file
|
|
@ -0,0 +1,318 @@
|
|||
<?php
|
||||
/**
|
||||
* Karaka
|
||||
*
|
||||
* 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\NullDriver;
|
||||
use Modules\FleetManagement\Models\DriverStatus;
|
||||
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();
|
||||
$files = $driver->files;
|
||||
$driverImage = $this->data['driverImage'] ?? new NullMedia();
|
||||
$attributeView = $this->data['attributeView'];
|
||||
|
||||
/**
|
||||
* @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' . $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">
|
||||
<?= $attributeView->render(
|
||||
$driver->attributes,
|
||||
$this->data['attributeTypes'] ?? [],
|
||||
[],
|
||||
'{/api}fleet/driver/attribute'
|
||||
);
|
||||
?>
|
||||
</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('{/app}/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">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Date'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Type'); ?>
|
||||
<td><?= $this->getHtml('Responsible'); ?>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<td>
|
||||
<td>
|
||||
</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">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Date'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Type'); ?>
|
||||
<td><?= $this->getHtml('Responsible'); ?>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<td>
|
||||
<td>
|
||||
</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="fa fa-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('{/app}/sales/client/profile?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="lni lni-download download btn end-xs"></i></div>
|
||||
<div class="slider">
|
||||
<table id="milageTable" class="default"
|
||||
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 fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<td><?= $this->getHtml('Milage'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<td><?= $this->getHtml('Start'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<td><?= $this->getHtml('End'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<tbody>
|
||||
<template class="oms-add-tpl-milage">
|
||||
<tr data-id="" draggable="false">
|
||||
<td>
|
||||
<i class="fa fa-cogs btn update-form"></i>
|
||||
<input id="milageTable-remove-0" type="checkbox" class="hidden">
|
||||
<label for="milageTable-remove-0" class="checked-visibility-alt"><i class="fa fa-times btn form-action"></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="fa fa-cogs btn update-form"></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="fa fa-times btn form-action"></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,10 +24,10 @@ $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'] ?? [];
|
||||
$vehicle = $this->data['vehicle'] ?? new NullVehicle();
|
||||
$files = $vehicle->files;
|
||||
$vehicleImage = $this->data['vehicleImage'] ?? new NullMedia();
|
||||
$vehicleTypes = $this->data['types'] ?? [];
|
||||
$attributeView = $this->data['attributeView'];
|
||||
|
||||
/**
|
||||
|
|
@ -144,7 +144,7 @@ echo $this->data['nav']->render();
|
|||
<div class="tab">
|
||||
<div class="row">
|
||||
<?= $attributeView->render(
|
||||
$vehicle->getAttributes(),
|
||||
$vehicle->attributes,
|
||||
$this->data['attributeTypes'] ?? [],
|
||||
$this->data['units'] ?? [],
|
||||
'{/api}fleet/vehicle/attribute'
|
||||
|
|
@ -212,10 +212,10 @@ echo $this->data['nav']->render();
|
|||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<form id="attributeForm" action="<?= UriFactory::build(''); ?>" method="post"
|
||||
data-ui-container="#attributeTable tbody"
|
||||
data-add-form="attributeForm"
|
||||
data-add-tpl="#attributeTable tbody .oms-add-tpl-attribute">
|
||||
<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">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user