diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index 083d399..3cc80b3 100644 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -65,7 +65,7 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::CREATE, 'state' => PermissionCategory::DRIVER, ], ], @@ -76,7 +76,7 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::MODIFY, 'state' => PermissionCategory::DRIVER, ], ], @@ -90,8 +90,8 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::VEHICLE, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::VEHICLE_NOTE, ], ], [ @@ -101,8 +101,8 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::VEHICLE, + 'type' => PermissionType::MODIFY, + 'state' => PermissionCategory::VEHICLE_NOTE, ], ], ], @@ -115,8 +115,8 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::DRIVER, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::DRIVER_NOTE, ], ], [ @@ -126,8 +126,8 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::DRIVER, + 'type' => PermissionType::MODIFY, + 'state' => PermissionCategory::DRIVER_NOTE, ], ], ], diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 38204bc..4901fee 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -21,6 +21,9 @@ namespace Modules\FleetManagement\Controller; * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 + * + * @question Consider to make FleetManagement rely on EquipmentManagement (especially the attributes)? + * https://github.com/Karaka-Management/oms-FleetManagement/issues/3 */ final class ApiController extends Controller { diff --git a/Theme/Backend/driver-view.tpl.php b/Theme/Backend/driver-view.tpl.php index 3ec3452..20fa678 100644 --- a/Theme/Backend/driver-view.tpl.php +++ b/Theme/Backend/driver-view.tpl.php @@ -27,12 +27,15 @@ $driverStatus = DriverStatus::getConstants(); $driver = $this->data['driver'] ?? new NullDriver(); $driverImage = $this->data['driverImage'] ?? new NullMedia(); +$isNew = $driver->id === 0; + /** * @var \phpOMS\Views\View $this */ echo $this->data['nav']->render(); ?>
+
+
- request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>> + request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
+
>
getHtml('Driver'); ?>
@@ -78,6 +86,7 @@ echo $this->data['nav']->render();
+
@@ -93,6 +102,7 @@ echo $this->data['nav']->render();
+ request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
@@ -322,5 +332,6 @@ echo $this->data['nav']->render();
+
\ No newline at end of file diff --git a/Theme/Backend/vehicle-view.tpl.php b/Theme/Backend/vehicle-view.tpl.php index 8e20f39..50696a5 100644 --- a/Theme/Backend/vehicle-view.tpl.php +++ b/Theme/Backend/vehicle-view.tpl.php @@ -28,12 +28,15 @@ $vehicle = $this->data['vehicle'] ?? new NullVehicle(); $vehicleImage = $this->data['vehicleImage'] ?? new NullMedia(); $vehicleTypes = $this->data['types'] ?? []; +$isNew = $vehicle->id === 0; + /** * @var \phpOMS\Views\View $this */ echo $this->data['nav']->render(); ?>
+
+
- request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>> + request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
+
>
getHtml('Vehicle'); ?>
@@ -123,6 +131,7 @@ echo $this->data['nav']->render();
+
@@ -138,6 +147,7 @@ echo $this->data['nav']->render();
+ request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
@@ -381,5 +391,6 @@ echo $this->data['nav']->render();
+
\ No newline at end of file