Skip to content

Commit

Permalink
Merge pull request #97 from tobias74/ZMS-1794-show-minutes-instead-of…
Browse files Browse the repository at this point in the history
…-slots

ZMS-1794 adjust form to display minutes instead of slotcount
  • Loading branch information
tobias74 authored Jan 11, 2024
2 parents cec255e + 64ebcd1 commit 7b6e84e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
5 changes: 4 additions & 1 deletion zmsadmin/src/Zmsadmin/AppointmentForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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(),
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion zmsadmin/src/Zmsadmin/Helper/AppointmentFormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions zmsadmin/src/Zmsadmin/Helper/GraphDefaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public static function getScope()
name
data {
payment
slotTimeInMinutes
}
}
queue
Expand Down
8 changes: 5 additions & 3 deletions zmsadmin/templates/block/appointment/form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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 %}
Expand Down
5 changes: 5 additions & 0 deletions zmsentities/src/Zmsentities/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,9 @@ public function getAdditionalData()
{
return $this->toProperty()->data->get();
}

public function getSlotTimeInMinutes()
{
return $this->getAdditionalData()['slotTimeInMinutes'];
}
}

0 comments on commit 7b6e84e

Please sign in to comment.