diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json
index 506b025..bd69cc7 100755
--- a/Admin/Install/Navigation.install.json
+++ b/Admin/Install/Navigation.install.json
@@ -140,7 +140,7 @@
"type": 3,
"subtype": 1,
"name": "VehicleInspectionTypes",
- "uri": "{/base}/fleet/inspection/type/list?{?}",
+ "uri": "{/base}/fleet/inspection/vehicle/type/list?{?}",
"target": "self",
"icon": null,
"order": 5,
@@ -155,7 +155,7 @@
"type": 3,
"subtype": 1,
"name": "DriverInspectionTypes",
- "uri": "{/base}/fleet/inspection/type/list?{?}",
+ "uri": "{/base}/fleet/inspection/driver/type/list?{?}",
"target": "self",
"icon": null,
"order": 5,
diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php
index 0e7093f..45903b4 100644
--- a/Admin/Routes/Web/Api.php
+++ b/Admin/Routes/Web/Api.php
@@ -22,6 +22,7 @@ return [
[
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleController:apiVehicleFind',
'verb' => RouteVerb::GET,
+ 'csrf' => true,
'permission' => [
'module' => Controller::NAME,
'type' => PermissionType::READ,
@@ -34,6 +35,7 @@ return [
[
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleAttributeController:apiVehicleAttributeCreate',
'verb' => RouteVerb::PUT,
+ 'csrf' => true,
'permission' => [
'module' => Controller::NAME,
'type' => PermissionType::READ,
@@ -43,6 +45,7 @@ return [
[
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleAttributeController:apiVehicleAttributeUpdate',
'verb' => RouteVerb::SET,
+ 'csrf' => true,
'permission' => [
'module' => Controller::NAME,
'type' => PermissionType::READ,
@@ -55,6 +58,7 @@ return [
[
'dest' => '\Modules\FleetManagement\Controller\ApiDriverAttributeController:apiDriverAttributeCreate',
'verb' => RouteVerb::PUT,
+ 'csrf' => true,
'permission' => [
'module' => Controller::NAME,
'type' => PermissionType::READ,
@@ -64,6 +68,7 @@ return [
[
'dest' => '\Modules\FleetManagement\Controller\ApiDriverAttributeController:apiDriverAttributeUpdate',
'verb' => RouteVerb::SET,
+ 'csrf' => true,
'permission' => [
'module' => Controller::NAME,
'type' => PermissionType::READ,
@@ -76,6 +81,7 @@ return [
[
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleController:apiNoteCreate',
'verb' => RouteVerb::PUT,
+ 'csrf' => true,
'permission' => [
'module' => Controller::NAME,
'type' => PermissionType::READ,
@@ -85,6 +91,7 @@ return [
[
'dest' => '\Modules\FleetManagement\Controller\ApiVehicleController:apiNoteUpdate',
'verb' => RouteVerb::SET,
+ 'csrf' => true,
'permission' => [
'module' => Controller::NAME,
'type' => PermissionType::READ,
@@ -97,6 +104,7 @@ return [
[
'dest' => '\Modules\FleetManagement\Controller\ApiDriverController:apiNoteCreate',
'verb' => RouteVerb::PUT,
+ 'csrf' => true,
'permission' => [
'module' => Controller::NAME,
'type' => PermissionType::READ,
@@ -106,6 +114,7 @@ return [
[
'dest' => '\Modules\FleetManagement\Controller\ApiDriverController:apiNoteUpdate',
'verb' => RouteVerb::SET,
+ 'csrf' => true,
'permission' => [
'module' => Controller::NAME,
'type' => PermissionType::READ,
diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php
index 219cdff..72bf014 100755
--- a/Admin/Routes/Web/Backend.php
+++ b/Admin/Routes/Web/Backend.php
@@ -25,18 +25,51 @@ return [
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
- 'state' => PermissionCategory::VEHICLE,
+ 'state' => PermissionCategory::ATTRIBUTE,
],
],
],
- '^.*/fleet/vehicle/attribute/type(\?.*$|$)' => [
+ '^.*/fleet/vehicle/attribute/type/view(\?.*$|$)' => [
[
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementAttributeType',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
- 'state' => PermissionCategory::VEHICLE,
+ 'state' => PermissionCategory::ATTRIBUTE,
+ ],
+ ],
+ ],
+ '^.*/fleet/vehicle/attribute/type/create(\?.*$|$)' => [
+ [
+ 'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementAttributeTypeCreate',
+ 'verb' => RouteVerb::GET,
+ 'permission' => [
+ 'module' => BackendController::NAME,
+ 'type' => PermissionType::CREATE,
+ 'state' => PermissionCategory::ATTRIBUTE,
+ ],
+ ],
+ ],
+ '^.*/fleet/vehicle/attribute/value/view(\?.*$|$)' => [
+ [
+ 'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementAttributeValue',
+ 'verb' => RouteVerb::GET,
+ 'permission' => [
+ 'module' => BackendController::NAME,
+ 'type' => PermissionType::READ,
+ 'state' => PermissionCategory::ATTRIBUTE,
+ ],
+ ],
+ ],
+ '^.*/fleet/vehicle/attribute/value/create(\?.*$|$)' => [
+ [
+ 'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementAttributeValueCreate',
+ 'verb' => RouteVerb::GET,
+ 'permission' => [
+ 'module' => BackendController::NAME,
+ 'type' => PermissionType::CREATE,
+ 'state' => PermissionCategory::ATTRIBUTE,
],
],
],
@@ -82,18 +115,51 @@ return [
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
- 'state' => PermissionCategory::VEHICLE,
+ 'state' => PermissionCategory::ATTRIBUTE,
],
],
],
- '^.*/fleet/driver/attribute/type(\?.*$|$)' => [
+ '^.*/fleet/driver/attribute/type/view(\?.*$|$)' => [
[
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverAttributeType',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
- 'state' => PermissionCategory::VEHICLE,
+ 'state' => PermissionCategory::ATTRIBUTE,
+ ],
+ ],
+ ],
+ '^.*/fleet/driver/attribute/type/create(\?.*$|$)' => [
+ [
+ 'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverAttributeTypeCreate',
+ 'verb' => RouteVerb::GET,
+ 'permission' => [
+ 'module' => BackendController::NAME,
+ 'type' => PermissionType::CREATE,
+ 'state' => PermissionCategory::ATTRIBUTE,
+ ],
+ ],
+ ],
+ '^.*/fleet/driver/attribute/value/view(\?.*$|$)' => [
+ [
+ 'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverAttributeValue',
+ 'verb' => RouteVerb::GET,
+ 'permission' => [
+ 'module' => BackendController::NAME,
+ 'type' => PermissionType::READ,
+ 'state' => PermissionCategory::ATTRIBUTE,
+ ],
+ ],
+ ],
+ '^.*/fleet/driver/attribute/value/create(\?.*$|$)' => [
+ [
+ 'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverAttributeValueCreate',
+ 'verb' => RouteVerb::GET,
+ 'permission' => [
+ 'module' => BackendController::NAME,
+ 'type' => PermissionType::CREATE,
+ 'state' => PermissionCategory::ATTRIBUTE,
],
],
],
@@ -143,7 +209,7 @@ return [
],
],
],
- '^.*/fleet/inspection/type/list(\?.*$|$)' => [
+ '^.*/fleet/inspection/vehicle/type/list(\?.*$|$)' => [
[
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementInspectionTypeList',
'verb' => RouteVerb::GET,
@@ -154,7 +220,7 @@ return [
],
],
],
- '^.*/fleet/inspection/create(\?.*$|$)' => [
+ '^.*/fleet/inspection/vehicle/create(\?.*$|$)' => [
[
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementInspectionCreate',
'verb' => RouteVerb::GET,
@@ -165,7 +231,7 @@ return [
],
],
],
- '^.*/fleet/inspection/view(\?.*$|$)' => [
+ '^.*/fleet/inspection/vehicle/view(\?.*$|$)' => [
[
'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementInspectionView',
'verb' => RouteVerb::GET,
@@ -176,4 +242,37 @@ return [
],
],
],
+ '^.*/fleet/inspection/driver/type/list(\?.*$|$)' => [
+ [
+ 'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverInspectionTypeList',
+ 'verb' => RouteVerb::GET,
+ 'permission' => [
+ 'module' => BackendController::NAME,
+ 'type' => PermissionType::READ,
+ 'state' => PermissionCategory::VEHICLE,
+ ],
+ ],
+ ],
+ '^.*/fleet/inspection/driver/create(\?.*$|$)' => [
+ [
+ 'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverInspectionCreate',
+ 'verb' => RouteVerb::GET,
+ 'permission' => [
+ 'module' => BackendController::NAME,
+ 'type' => PermissionType::CREATE,
+ 'state' => PermissionCategory::VEHICLE,
+ ],
+ ],
+ ],
+ '^.*/fleet/inspection/driver/view(\?.*$|$)' => [
+ [
+ 'dest' => '\Modules\FleetManagement\Controller\BackendController:viewFleetManagementDriverInspectionView',
+ 'verb' => RouteVerb::GET,
+ 'permission' => [
+ 'module' => BackendController::NAME,
+ 'type' => PermissionType::READ,
+ 'state' => PermissionCategory::VEHICLE,
+ ],
+ ],
+ ],
];
diff --git a/Controller/BackendController.php b/Controller/BackendController.php
index a587496..9047d57 100755
--- a/Controller/BackendController.php
+++ b/Controller/BackendController.php
@@ -15,10 +15,15 @@ declare(strict_types=1);
namespace Modules\FleetManagement\Controller;
use Modules\FleetManagement\Models\Attribute\DriverAttributeTypeMapper;
+use Modules\FleetManagement\Models\Attribute\DriverAttributeValueL11nMapper;
+use Modules\FleetManagement\Models\Attribute\DriverAttributeValueMapper;
use Modules\FleetManagement\Models\Attribute\VehicleAttributeTypeL11nMapper;
use Modules\FleetManagement\Models\Attribute\VehicleAttributeTypeMapper;
+use Modules\FleetManagement\Models\Attribute\VehicleAttributeValueL11nMapper;
+use Modules\FleetManagement\Models\Attribute\VehicleAttributeValueMapper;
use Modules\FleetManagement\Models\Driver\DriverInspectionMapper;
use Modules\FleetManagement\Models\Driver\DriverMapper;
+use Modules\FleetManagement\Models\Inspection;
use Modules\FleetManagement\Models\InspectionMapper;
use Modules\FleetManagement\Models\InspectionTypeMapper;
use Modules\FleetManagement\Models\VehicleMapper;
@@ -57,17 +62,15 @@ final class BackendController extends Controller
*/
public function viewFleetManagementAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
- $view = new View($this->app->l11nManager, $request, $response);
- $view->setTemplate('/Modules/FleetManagement/Theme/Backend/attribute-type-list');
+ $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeListView($this->app->l11nManager, $request, $response);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response);
- /** @var \Modules\Attribute\Models\AttributeType[] $attributes */
- $attributes = VehicleAttributeTypeMapper::getAll()
+ $view->attributes = VehicleAttributeTypeMapper::getAll()
->with('l11n')
->where('l11n/language', $response->header->l11n->language)
->execute();
- $view->data['attributes'] = $attributes;
+ $view->path = 'fleet/vehicle';
return $view;
}
@@ -86,17 +89,15 @@ final class BackendController extends Controller
*/
public function viewFleetManagementDriverAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
- $view = new View($this->app->l11nManager, $request, $response);
- $view->setTemplate('/Modules/FleetManagement/Theme/Backend/attribute-type-list');
+ $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeListView($this->app->l11nManager, $request, $response);
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response);
- /** @var \Modules\Attribute\Models\AttributeType[] $attributes */
- $attributes = DriverAttributeTypeMapper::getAll()
+ $view->attributes = DriverAttributeTypeMapper::getAll()
->with('l11n')
->where('l11n/language', $response->header->l11n->language)
->execute();
- $view->data['attributes'] = $attributes;
+ $view->path = 'fleet/driver';
return $view;
}
@@ -178,13 +179,22 @@ final class BackendController extends Controller
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/FleetManagement/Theme/Backend/inspection-list');
- $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003501001, $request, $response);
+ $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003504001, $request, $response);
- $list = InspectionMapper::getAll()
+ $vehicles = InspectionMapper::getAll()
->sort('id', 'DESC')
- ->execute();
+ ->executeGetArray();
- $view->data['inspections'] = $list;
+ $drivers = DriverInspectionMapper::getAll()
+ ->sort('id', 'DESC')
+ ->executeGetArray();
+
+ $inspections = array_merge($vehicles, $drivers);
+ \usort($inspections, function (Inspection $a, Inspection $b) : int {
+ return $a->date?->getTimestamp() <=> $b->date?->getTimestamp();
+ });
+
+ $view->data['inspections'] = $inspections;
return $view;
}
@@ -259,23 +269,23 @@ final class BackendController extends Controller
*/
public function viewFleetManagementAttributeType(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
- $view = new View($this->app->l11nManager, $request, $response);
- $view->setTemplate('/Modules/FleetManagement/Theme/Backend/attribute-type');
- $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response);
+ $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response);
+ $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003505001, $request, $response);
- /** @var \Modules\Attribute\Models\AttributeType $attribute */
- $attribute = VehicleAttributeTypeMapper::get()
+ $view->attribute = VehicleAttributeTypeMapper::get()
->with('l11n')
+ ->with('defaults')
+ ->with('defaults/l11n')
->where('id', (int) $request->getData('id'))
->where('l11n/language', $response->header->l11n->language)
+ ->where('defaults/l11n/language', [$response->header->l11n->language, null])
->execute();
- $l11ns = VehicleAttributeTypeL11nMapper::getAll()
- ->where('ref', $attribute->id)
+ $view->l11ns = VehicleAttributeTypeL11nMapper::getAll()
+ ->where('ref', $view->attribute->id)
->execute();
- $view->data['attribute'] = $attribute;
- $view->data['l11ns'] = $l11ns;
+ $view->path = 'fleet/vehicle';
return $view;
}
@@ -294,23 +304,87 @@ final class BackendController extends Controller
*/
public function viewFleetManagementDriverAttributeType(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
- $view = new View($this->app->l11nManager, $request, $response);
- $view->setTemplate('/Modules/FleetManagement/Theme/Backend/attribute-type');
- $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response);
+ $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response);
+ $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003506001, $request, $response);
- /** @var \Modules\Attribute\Models\AttributeType $attribute */
- $attribute = VehicleAttributeTypeMapper::get()
+ $view->attribute = VehicleAttributeTypeMapper::get()
->with('l11n')
+ ->with('defaults')
+ ->with('defaults/l11n')
->where('id', (int) $request->getData('id'))
->where('l11n/language', $response->header->l11n->language)
+ ->where('defaults/l11n/language', [$response->header->l11n->language, null])
->execute();
- $l11ns = VehicleAttributeTypeL11nMapper::getAll()
- ->where('ref', $attribute->id)
+ $view->l11ns = VehicleAttributeTypeL11nMapper::getAll()
+ ->where('ref', $view->attribute->id)
->execute();
- $view->data['attribute'] = $attribute;
- $view->data['l11ns'] = $l11ns;
+ $view->path = 'fleet/driver';
+
+ return $view;
+ }
+
+ /**
+ * Routing end-point for application behavior.
+ *
+ * @param RequestAbstract $request Request
+ * @param ResponseAbstract $response Response
+ * @param array $data Generic data
+ *
+ * @return RenderableInterface
+ *
+ * @since 1.0.0
+ * @codeCoverageIgnore
+ */
+ public function viewFleetManagementAttributeValue(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
+ {
+ $view = new \Modules\Attribute\Theme\Backend\Components\AttributeValueView($this->app->l11nManager, $request, $response);
+ $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003505001, $request, $response);
+
+ $view->attribute = VehicleAttributeValueMapper::get()
+ ->with('l11n')
+ ->where('id', (int) $request->getData('id'))
+ ->where('l11n/language', [$response->header->l11n->language, null])
+ ->execute();
+
+ $view->l11ns = VehicleAttributeValueL11nMapper::getAll()
+ ->where('ref', $view->attribute->id)
+ ->execute();
+
+ // @todo Also find the ItemAttributeType
+
+ return $view;
+ }
+
+ /**
+ * Routing end-point for application behavior.
+ *
+ * @param RequestAbstract $request Request
+ * @param ResponseAbstract $response Response
+ * @param array $data Generic data
+ *
+ * @return RenderableInterface
+ *
+ * @since 1.0.0
+ * @codeCoverageIgnore
+ */
+ public function viewFleetManagementDriverAttributeValue(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
+ {
+ $view = new \Modules\Attribute\Theme\Backend\Components\AttributeValueView($this->app->l11nManager, $request, $response);
+ $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003506001, $request, $response);
+
+ $view->attribute = DriverAttributeValueMapper::get()
+ ->with('l11n')
+ ->where('id', (int) $request->getData('id'))
+ ->where('l11n/language', [$response->header->l11n->language, null])
+ ->execute();
+
+ $view->l11ns = DriverAttributeValueL11nMapper::getAll()
+ ->where('ref', $view->attribute->id)
+ ->execute();
+
+ // @todo Also find the ItemAttributeType
return $view;
}
diff --git a/Models/PermissionCategory.php b/Models/PermissionCategory.php
index 75f2b60..58ddbe2 100755
--- a/Models/PermissionCategory.php
+++ b/Models/PermissionCategory.php
@@ -49,4 +49,6 @@ abstract class PermissionCategory extends Enum
public const VEHICLE_NOTE = 11;
public const DRIVER_NOTE = 12;
+
+ public const ATTRIBUTE = 13;
}
diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php
index 41292a1..e4dae64 100755
--- a/Theme/Backend/Lang/de.lang.php
+++ b/Theme/Backend/Lang/de.lang.php
@@ -26,6 +26,9 @@ return ['FleetManagement' => [
'Driver' => 'Fahrer',
'Drivers' => 'Fahrer',
'End' => 'Ende',
+ 'From' => 'Von',
+ 'Description' => 'Beschreibung',
+ 'To' => 'Nach',
'Files' => 'Dateien',
'History' => 'Historie',
'Inspections' => 'Inspektionen',
diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php
index 817ae79..d4da4d1 100755
--- a/Theme/Backend/Lang/en.lang.php
+++ b/Theme/Backend/Lang/en.lang.php
@@ -26,6 +26,9 @@ return ['FleetManagement' => [
'Driver' => 'Driver',
'Drivers' => 'Drivers',
'End' => 'End',
+ 'From' => 'From',
+ 'To' => 'To',
+ 'Description' => 'Description',
'Files' => 'Files',
'History' => 'History',
'Inspections' => 'Inspections',
diff --git a/Theme/Backend/attribute-type-list.tpl.php b/Theme/Backend/attribute-type-list.tpl.php
deleted file mode 100755
index a6fefc7..0000000
--- a/Theme/Backend/attribute-type-list.tpl.php
+++ /dev/null
@@ -1,71 +0,0 @@
-data['attributes'];
-
-echo $this->data['nav']->render(); ?>
-
-
-
-
- = $this->getHtml('AttributeTypes', 'Attribute', 'Backend'); ?>download
-
-
-
-
diff --git a/Theme/Backend/attribute-type.tpl.php b/Theme/Backend/attribute-type.tpl.php
deleted file mode 100755
index c6c3533..0000000
--- a/Theme/Backend/attribute-type.tpl.php
+++ /dev/null
@@ -1,98 +0,0 @@
-data['attribute'];
-$l11ns = $this->data['l11ns'];
-
-echo $this->data['nav']->render(); ?>
-
-
-
-
- = $this->getHtml('Attribute', 'Attribute', 'Backend'); ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
= $this->getHtml('Language', '0', '0'); ?>download
-
-
-
- |
- |
- | = $this->getHtml('Language', '0', '0'); ?>
- | = $this->getHtml('Title', 'Attribute', 'Backend'); ?>
- |
- $value) : ++$c; ?>
-
- | close
- | settings
- | = ISO639Enum::getByName('_' . \strtoupper($value->language)); ?>
- | = $value->content; ?>
-
-
- |
| = $this->getHtml('Empty', '0', '0'); ?>
-
- |
-
-
-
diff --git a/Theme/Backend/driver-list.tpl.php b/Theme/Backend/driver-list.tpl.php
index 947df93..5c54fc6 100644
--- a/Theme/Backend/driver-list.tpl.php
+++ b/Theme/Backend/driver-list.tpl.php
@@ -73,7 +73,7 @@ echo $this->data['nav']->render(); ?>
?>
|
- | = $this->printHtml((string) $value->id); ?>
+ | = $value->id; ?>
| = $this->getHtml(':status-d' . $value->status); ?>
| = $this->printHtml(
$this->renderUserName('%3$s %2$s %1$s', [$value->account->name1, $value->account->name2, $value->account->name3, $value->account->login])
diff --git a/Theme/Backend/driver-profile.tpl.php b/Theme/Backend/driver-profile.tpl.php
index 03586c0..3edaf98 100644
--- a/Theme/Backend/driver-profile.tpl.php
+++ b/Theme/Backend/driver-profile.tpl.php
@@ -100,7 +100,7 @@ echo $this->data['nav']->render();
$driver->attributes,
$this->data['attributeTypes'] ?? [],
[],
- '{/api}fleet/driver/attribute',
+ '{/api}fleet/driver/attribute?csrf={$CSRF}',
$driver->id
);
?>
diff --git a/Theme/Backend/driver-view.tpl.php b/Theme/Backend/driver-view.tpl.php
index 052c9ee..d519200 100644
--- a/Theme/Backend/driver-view.tpl.php
+++ b/Theme/Backend/driver-view.tpl.php
@@ -100,7 +100,7 @@ echo $this->data['nav']->render();
$driver->attributes,
$this->data['attributeTypes'] ?? [],
[],
- '{/api}fleet/driver/attribute',
+ '{/api}fleet/driver/attribute?csrf={$CSRF}',
$driver->id
);
?>
diff --git a/Theme/Backend/inspection-list.tpl.php b/Theme/Backend/inspection-list.tpl.php
index ceb8b89..1eb571e 100644
--- a/Theme/Backend/inspection-list.tpl.php
+++ b/Theme/Backend/inspection-list.tpl.php
@@ -13,3 +13,67 @@
declare(strict_types=1);
echo $this->data['nav']->render();
+?>
+
+
+
+
+ = $this->getHtml('Upcoming'); ?>
+
+
+
+ | = $this->getHtml('Date'); ?>
+ | = $this->getHtml('Type'); ?>
+ | = $this->getHtml('Responsible'); ?>
+ |
+ data['inspections'] ?? []) as $inspection) :
+ // @todo handle old inspections in the past? maybe use a status?!
+ if ($inspection->next === null) {
+ continue;
+ }
+
+ ++$count;
+ ?>
+
+ | = $inspection->next->format('Y-m-d H:i'); ?>
+ | = $this->printHtml($inspection->type->getL11n()); ?>
+ |
+
+
+ | | = $this->getHtml('Empty', '0', '0'); ?>
+
+ |
+
+
+
+
+
+
+
+ = $this->getHtml('History'); ?>
+
+
+
+ | = $this->getHtml('Date'); ?>
+ | = $this->getHtml('Type'); ?>
+ | = $this->getHtml('Responsible'); ?>
+ |
+ data['inspections'] ?? []) as $inspection) :
+ ++$count;
+ ?>
+
+ | = $inspection->date->format('Y-m-d H:i'); ?>
+ | = $this->printHtml($inspection->type->getL11n()); ?>
+ |
+
+
+ | | = $this->getHtml('Empty', '0', '0'); ?>
+
+ |
+
+
+
diff --git a/Theme/Backend/vehicle-list.tpl.php b/Theme/Backend/vehicle-list.tpl.php
index 6318bf4..c49c3b1 100755
--- a/Theme/Backend/vehicle-list.tpl.php
+++ b/Theme/Backend/vehicle-list.tpl.php
@@ -85,7 +85,7 @@ echo $this->data['nav']->render(); ?>
?>
|
- | = $this->printHtml((string) $value->id); ?>
+ | = $value->id; ?>
| = $this->getHtml(':status' . $value->status); ?>
| = $this->printHtml($value->name); ?>
| = $this->printHtml($value->type->getL11n()); ?>
diff --git a/Theme/Backend/vehicle-profile.tpl.php b/Theme/Backend/vehicle-profile.tpl.php
index 1ff44ae..da61ea3 100755
--- a/Theme/Backend/vehicle-profile.tpl.php
+++ b/Theme/Backend/vehicle-profile.tpl.php
@@ -145,7 +145,7 @@ echo $this->data['nav']->render();
$vehicle->attributes,
$this->data['attributeTypes'] ?? [],
$this->data['units'] ?? [],
- '{/api}fleet/vehicle/attribute',
+ '{/api}fleet/vehicle/attribute?csrf={$CSRF}',
$vehicle->id
);
?>
diff --git a/Theme/Backend/vehicle-view.tpl.php b/Theme/Backend/vehicle-view.tpl.php
index d3844fa..ef7f274 100644
--- a/Theme/Backend/vehicle-view.tpl.php
+++ b/Theme/Backend/vehicle-view.tpl.php
@@ -145,7 +145,7 @@ echo $this->data['nav']->render();
$vehicle->attributes,
$this->data['attributeTypes'] ?? [],
$this->data['units'] ?? [],
- '{/api}fleet/vehicle/attribute',
+ '{/api}fleet/vehicle/attribute?csrf={$CSRF}',
$vehicle->id
);
?>
| |