From f776c44ebdcc0fe85e284a31cc2dd4a9e14f19ea Mon Sep 17 00:00:00 2001 From: tobias74 Date: Thu, 11 Jan 2024 09:56:10 +0100 Subject: [PATCH 1/2] adjust form to display minutes instead of slotcount --- zmsadmin/src/Zmsadmin/AppointmentForm.php | 5 ++++- zmsadmin/src/Zmsadmin/Helper/AppointmentFormHelper.php | 2 +- zmsadmin/src/Zmsadmin/Helper/GraphDefaults.php | 1 + zmsadmin/templates/block/appointment/form.twig | 8 +++++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/zmsadmin/src/Zmsadmin/AppointmentForm.php b/zmsadmin/src/Zmsadmin/AppointmentForm.php index 903b64b08..3983f7349 100644 --- a/zmsadmin/src/Zmsadmin/AppointmentForm.php +++ b/zmsadmin/src/Zmsadmin/AppointmentForm.php @@ -50,6 +50,8 @@ public function readResponse( ? Helper\AppointmentFormHelper::readFreeProcessList($request, $workstation) : null; + $provider = $selectedScope->getProvider(); + return \BO\Slim\Render::withHtml( $response, 'block/appointment/form.twig', @@ -65,7 +67,8 @@ public function readResponse( 'selectedDate' => ($selectedDate) ? $selectedDate : \App::$now->format('Y-m-d'), 'selectedTime' => $selectedTime, 'freeProcessList' => $freeProcessList, - 'requestList' => $requestList + 'requestList' => $requestList, + 'slotTimeInMinutes' => $provider->getSlotTimeInMinutes(), ) ); } diff --git a/zmsadmin/src/Zmsadmin/Helper/AppointmentFormHelper.php b/zmsadmin/src/Zmsadmin/Helper/AppointmentFormHelper.php index cb0ac0642..140deac7b 100644 --- a/zmsadmin/src/Zmsadmin/Helper/AppointmentFormHelper.php +++ b/zmsadmin/src/Zmsadmin/Helper/AppointmentFormHelper.php @@ -76,7 +76,7 @@ public static function readSelectedScope($request, $workstation, $selectedProces if ($selectedScopeId) { $selectedScope = \App::$http ->readGetResult('/scope/'. $selectedScopeId .'/', [ - 'resolveReferences' => 1, + 'resolveReferences' => 2, 'gql' => GraphDefaults::getScope() ]) ->getEntity(); diff --git a/zmsadmin/src/Zmsadmin/Helper/GraphDefaults.php b/zmsadmin/src/Zmsadmin/Helper/GraphDefaults.php index f9584b670..db3b93627 100644 --- a/zmsadmin/src/Zmsadmin/Helper/GraphDefaults.php +++ b/zmsadmin/src/Zmsadmin/Helper/GraphDefaults.php @@ -127,6 +127,7 @@ public static function getScope() name data { payment + slotTimeInMinutes } } queue diff --git a/zmsadmin/templates/block/appointment/form.twig b/zmsadmin/templates/block/appointment/form.twig index 9a1d0d67c..df66a7472 100644 --- a/zmsadmin/templates/block/appointment/form.twig +++ b/zmsadmin/templates/block/appointment/form.twig @@ -54,10 +54,11 @@ {% else %} {% set selected = "" %} {% endif %} - {% set slotCountOptions = slotCountOptions|merge([{ "value": slotCount, "name": slotCount, "selected":selected}]) %} + {% set duration = slotTimeInMinutes * slotCount %} + {% set slotCountOptions = slotCountOptions|merge([{ "value": slotCount, "name": duration, "selected":selected}]) %} {% endfor %} {{ formgroup( - {"label": "Slots"}, + {"label": "Termindauer in Minuten"}, [{ "type":"select", "parameter": { @@ -297,8 +298,9 @@ {% endif %} {% set requestName = request.name %} + {% set duration = slotTimeInMinutes * request.timeSlotCount %} {% if scope.preferences.appointment.multipleSlotsEnabled or selectedProcess.scope.preferences.appointment.multipleSlotsEnabled %} - {% set requestName = request.name ~ " (" ~ request.timeSlotCount ~ ")" %} + {% set requestName = request.name ~ " (" ~ duration ~ " min)" %} {% endif %} {% set requestsOptions = requestsOptions|merge([{ "value": request.id, "name": requestName, "class": "service-checkbox", "data": {'slots': request.timeSlotCount}, "selected": checked }]) %} {% endfor %} From 64ebcd18b847697374516cde09e7aa431051d005 Mon Sep 17 00:00:00 2001 From: tobias74 Date: Thu, 11 Jan 2024 10:21:05 +0100 Subject: [PATCH 2/2] add missing file for provider --- zmsentities/src/Zmsentities/Provider.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zmsentities/src/Zmsentities/Provider.php b/zmsentities/src/Zmsentities/Provider.php index 5fb0f3609..c503ad95b 100644 --- a/zmsentities/src/Zmsentities/Provider.php +++ b/zmsentities/src/Zmsentities/Provider.php @@ -77,4 +77,9 @@ public function getAdditionalData() { return $this->toProperty()->data->get(); } + + public function getSlotTimeInMinutes() + { + return $this->getAdditionalData()['slotTimeInMinutes']; + } }