mirror of
https://github.com/Karaka-Management/oms-FleetManagement.git
synced 2026-01-11 12:58:42 +00:00
started with template fixes
This commit is contained in:
parent
428529983a
commit
7c546648f6
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,4 +49,6 @@ abstract class PermissionCategory extends Enum
|
|||
public const VEHICLE_NOTE = 11;
|
||||
|
||||
public const DRIVER_NOTE = 12;
|
||||
|
||||
public const ATTRIBUTE = 13;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ return ['FleetManagement' => [
|
|||
'Driver' => 'Fahrer',
|
||||
'Drivers' => 'Fahrer',
|
||||
'End' => 'Ende',
|
||||
'From' => 'Von',
|
||||
'Description' => 'Beschreibung',
|
||||
'To' => 'Nach',
|
||||
'Files' => 'Dateien',
|
||||
'History' => 'Historie',
|
||||
'Inspections' => 'Inspektionen',
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ return ['FleetManagement' => [
|
|||
'Driver' => 'Driver',
|
||||
'Drivers' => 'Drivers',
|
||||
'End' => 'End',
|
||||
'From' => 'From',
|
||||
'To' => 'To',
|
||||
'Description' => 'Description',
|
||||
'Files' => 'Files',
|
||||
'History' => 'History',
|
||||
'Inspections' => 'Inspections',
|
||||
|
|
|
|||
|
|
@ -1,71 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\ItemManagement
|
||||
* @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 */
|
||||
$attributes = $this->data['attributes'];
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('AttributeTypes', 'Attribute', 'Backend'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<div class="slider">
|
||||
<table id="iAttributeTypeList" class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<label for="iAttributeTypeList-sort-1">
|
||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-1">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iAttributeTypeList-sort-2">
|
||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-2">
|
||||
<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="iAttributeTypeList-sort-2">
|
||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-2">
|
||||
<i class="sort-asc g-icon">expand_less</i>
|
||||
</label>
|
||||
<label for="iAttributeTypeList-sort-3">
|
||||
<input type="radio" name="iAttributeTypeList-sort" id="iAttributeTypeList-sort-3">
|
||||
<i class="sort-desc g-icon">expand_more</i>
|
||||
</label>
|
||||
<label>
|
||||
<i class="filter g-icon">filter_alt</i>
|
||||
</label>
|
||||
<tbody>
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($attributes as $key => $value) : ++$count;
|
||||
$url = UriFactory::build('{/base}/fleet/vehicle/attribute/type?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n()); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="2" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Tasks
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\Attribute\Models\AttributeValueType;
|
||||
use phpOMS\Localization\ISO639Enum;
|
||||
|
||||
$types = AttributeValueType::getConstants();
|
||||
|
||||
$attribute = $this->data['attribute'];
|
||||
$l11ns = $this->data['l11ns'];
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-xs-12">
|
||||
<section id="task" class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Attribute', 'Attribute', 'Backend'); ?></div>
|
||||
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||
<input type="text" value="<?= $this->printHtml((string) $attribute->id); ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iName"><?= $this->getHtml('Name', 'Attribute', 'Backend'); ?></label>
|
||||
<input id="iNAme" type="text" value="<?= $this->printHtml($attribute->name); ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iType"><?= $this->getHtml('Datatype', 'Attribute', 'Backend'); ?></label>
|
||||
<select id="iType" name="type" disabled>
|
||||
<?php foreach ($types as $key => $type) : ?>
|
||||
<option value="<?= $type; ?>"<?= $type === $attribute->datatype ? ' selected' : ''; ?>><?= $this->printHtml($key); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iPattern"><?= $this->getHtml('Pattern', 'Attribute', 'Backend'); ?></label>
|
||||
<input id="iPattern" type="text" value="<?= $this->printHtml($attribute->validationPattern); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="checkbox" for="iRequired">
|
||||
<input id="iRequired" type="checkbox" name="required" value="1"<?= $attribute->isRequired ? ' checked' : ''; ?>>
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('IsRequired', 'Attribute', 'Backend'); ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="checkbox" for="iCustom">
|
||||
<input id="iCustom" type="checkbox" name="custom" value="1" <?= $attribute->custom ? ' checked' : ''; ?>>
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('CustomValue', 'Attribute', 'Backend'); ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Language', '0', '0'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<table class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>
|
||||
<td>
|
||||
<td><?= $this->getHtml('Language', '0', '0'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Title', 'Attribute', 'Backend'); ?>
|
||||
<tbody>
|
||||
<?php $c = 0; foreach ($l11ns as $key => $value) : ++$c; ?>
|
||||
<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->language)); ?>
|
||||
<td><?= $value->content; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -73,7 +73,7 @@ echo $this->data['nav']->render(); ?>
|
|||
?>
|
||||
<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('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $value->id; ?></a>
|
||||
<td data-label="<?= $this->getHtml('Status'); ?>"><a href="<?= $url; ?>"><?= $this->getHtml(':status-d' . $value->status); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml(
|
||||
$this->renderUserName('%3$s %2$s %1$s', [$value->account->name1, $value->account->name2, $value->account->name3, $value->account->login])
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -13,3 +13,67 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
echo $this->data['nav']->render();
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<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>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<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>
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ echo $this->data['nav']->render(); ?>
|
|||
?>
|
||||
<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('ID', '0', '0'); ?>"><a href="<?= $url; ?>"><?= $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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user