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 %} 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']; + } }