diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 3284e15..6c360af 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -149,7 +149,7 @@ final class BackendController extends Controller $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); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response); $list = DriverMapper::getAll() ->with('account') @@ -360,7 +360,7 @@ final class BackendController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/FleetManagement/Theme/Backend/driver-view'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $request, $response); $view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response); $view->data['attributeView']->data['default_localization'] = $this->app->l11nServer; @@ -505,7 +505,7 @@ final class BackendController extends Controller $view = new View($this->app->l11nManager, $request, $response); $view->setTemplate('/Modules/FleetManagement/Theme/Backend/driver-view'); - $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003502001, $request, $response); + $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003503001, $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. $driver = DriverMapper::get() diff --git a/Models/Driver/Driver.php b/Models/Driver/Driver.php index 71aeca9..60c5a41 100644 --- a/Models/Driver/Driver.php +++ b/Models/Driver/Driver.php @@ -15,6 +15,7 @@ declare(strict_types=1); namespace Modules\FleetManagement\Models\Driver; use Modules\Admin\Models\Account; +use Modules\Admin\Models\NullAccount; /** * Driver class. @@ -54,6 +55,11 @@ class Driver public array $inspections = []; + public function __construct() + { + $this->account = new NullAccount(); + } + /** * {@inheritdoc} */ diff --git a/Models/Driver/NullDriver.php b/Models/Driver/NullDriver.php index 6d2427c..ca23aca 100644 --- a/Models/Driver/NullDriver.php +++ b/Models/Driver/NullDriver.php @@ -34,6 +34,7 @@ final class NullDriver extends Driver public function __construct(int $id = 0) { $this->id = $id; + parent::__construct(); } /** diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index b746585..9ea4a3d 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -40,6 +40,7 @@ return ['FleetManagement' => [ 'Responsible' => 'Verantwortlich', 'Start' => 'Start', 'Status' => 'Status', + 'VIN' => 'VIN', 'Type' => 'Typ', 'Upcoming' => 'Upcoming', 'Vehicles' => 'Fahrzeuge', diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 0896c18..77623dc 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -40,6 +40,7 @@ return ['FleetManagement' => [ 'Responsible' => 'Responsible', 'Start' => 'Start', 'Status' => 'Status', + 'VIN' => 'VIN', 'Type' => 'Type', 'Upcoming' => 'Upcoming', 'Vehicles' => 'Vehicles', diff --git a/Theme/Backend/driver-view.tpl.php b/Theme/Backend/driver-view.tpl.php index a1ce416..c433b10 100644 --- a/Theme/Backend/driver-view.tpl.php +++ b/Theme/Backend/driver-view.tpl.php @@ -133,7 +133,7 @@ echo $this->data['nav']->render(); getHtml('Type'); ?> getHtml('Responsible'); ?> - data['inspections'] as $inspection) : + data['inspections'] ?? []) as $inspection) : // @todo handle old inspections in the past? maybe use a status?! if ($inspection->next === null) { continue; @@ -158,7 +158,7 @@ echo $this->data['nav']->render(); getHtml('Type'); ?> getHtml('Responsible'); ?> - data['inspections'] as $inspection) : ?> + data['inspections'] ?? []) as $inspection) : ?> date->format('Y-m-d H:i'); ?> printHtml($inspection->type->getL11n()); ?> diff --git a/Theme/Backend/vehicle-view.tpl.php b/Theme/Backend/vehicle-view.tpl.php index a1b43ce..1926fea 100644 --- a/Theme/Backend/vehicle-view.tpl.php +++ b/Theme/Backend/vehicle-view.tpl.php @@ -60,7 +60,7 @@ echo $this->data['nav']->render();
- +
@@ -108,12 +108,12 @@ echo $this->data['nav']->render();
- +
- +
@@ -180,7 +180,7 @@ echo $this->data['nav']->render(); data['inspections'] as $inspection) : + foreach (($this->data['inspections'] ?? []) as $inspection) : // @todo handle old inspections in the past? maybe use a status?! if ($inspection->next === null) { continue; @@ -212,7 +212,7 @@ echo $this->data['nav']->render(); data['inspections'] as $inspection) : + foreach (($this->data['inspections'] ?? []) as $inspection) : ++$count; ?>