... | ... |
@@ -67,7 +67,7 @@ |
67 | 67 |
<select id="res-behaelter" name="behaelter" required> |
68 | 68 |
<option value="">-</option> |
69 | 69 |
{% for option in buchen.behaelter %} |
70 |
- {% if option > slot.behaelterAvailable %} |
|
70 |
+ {% if option > buchen.default %} |
|
71 | 71 |
<option value="{{ option }}"{{ buchung.amount == option ? ' selected' : '' }}>{{ option }} ({{ 'MSC.wa_overbooking'|trans([], 'contao_default') }})</option> |
72 | 72 |
{% else %} |
73 | 73 |
<option value="{{ option }}"{{ buchung.amount == option ? ' selected' : '' }}>{{ option }}</option> |
... | ... |
@@ -298,6 +298,7 @@ class SlotAjaxController extends AbstractController |
298 | 298 |
|
299 | 299 |
$intAvailableBehaelter = max(0,$Slot->getAvailableBehaelter()); |
300 | 300 |
$intBookableBehaelter = $Slot->getAvailableBehaelter() + $Slot->getOvercapacityBehaelter(); |
301 |
+ $intDefaultAmount = $intAvailableBehaelter+$Booking->behaelter; |
|
301 | 302 |
$intUnitAmount = $intBookableBehaelter+$Booking->behaelter; |
302 | 303 |
$arrUnits = []; |
303 | 304 |
|
... | ... |
@@ -318,6 +319,7 @@ class SlotAjaxController extends AbstractController |
318 | 319 |
return new Response('Could not load unit data', 500); |
319 | 320 |
} |
320 | 321 |
|
322 |
+ $intDefaultAmount = floor($intDefaultAmount / max(1, $Unit->containers)); |
|
321 | 323 |
$intUnitAmount = floor($intUnitAmount / max(1, $Unit->containers)); |
322 | 324 |
} |
323 | 325 |
|
... | ... |
@@ -334,6 +336,7 @@ class SlotAjaxController extends AbstractController |
334 | 336 |
'standort' => $Slot->getRelated('pid'), |
335 | 337 |
'buchen' => [ |
336 | 338 |
'buchbar' => (boolean) $intBookableBehaelter, |
339 |
+ 'default' => $intDefaultAmount, |
|
337 | 340 |
'behaelter' => $intUnitAmount ? range(1,$intUnitAmount) : [], |
338 | 341 |
'units' => $arrUnits, |
339 | 342 |
] |
... | ... |
@@ -577,9 +580,9 @@ class SlotAjaxController extends AbstractController |
577 | 580 |
return new Response('Could not load slot data',500); |
578 | 581 |
} |
579 | 582 |
|
580 |
- $intAvailableBehaelter = max(0,$Slot->getAvailableBehaelter()); |
|
581 |
- $intAmount = $intAvailableBehaelter; |
|
582 |
- if ($intAvailableBehaelter > 0) |
|
583 |
+ $intDefault = max(0,$Slot->getAvailableBehaelter()); |
|
584 |
+ $intAmount = $intDefault; |
|
585 |
+ if ($intDefault > 0) |
|
583 | 586 |
{ |
584 | 587 |
$intOvercapacityBehaelter = $Slot->getOvercapacityBehaelter(); |
585 | 588 |
$intAmount += $intOvercapacityBehaelter; |
... | ... |
@@ -592,14 +595,15 @@ class SlotAjaxController extends AbstractController |
592 | 595 |
return new Response('Could not load unit data', 500); |
593 | 596 |
} |
594 | 597 |
|
595 |
- $intAmount = floor($intAvailableBehaelter / max(1, $Unit->containers)); |
|
598 |
+ $intDefault = floor($intDefault / max(1, $Unit->containers)); |
|
599 |
+ $intAmount = floor($intAmount / max(1, $Unit->containers)); |
|
596 | 600 |
} |
597 | 601 |
|
598 | 602 |
$strOutput = "<select id=\"res-behaelter\" name=\"behaelter\" required> |
599 | 603 |
<option value=\"\">-</option>\n"; |
600 | 604 |
for ($i = 1; $i <= $intAmount; $i++) |
601 | 605 |
{ |
602 |
- if ($intAvailableBehaelter < $i) |
|
606 |
+ if ($intDefault < $i) |
|
603 | 607 |
{ |
604 | 608 |
$strOutput .= "<option value=\"$i\">$i (".$this->translator->trans('MSC.wa_overbooking',[], 'contao_default').")</option>\n"; |
605 | 609 |
} else { |
... | ... |
@@ -623,9 +627,9 @@ class SlotAjaxController extends AbstractController |
623 | 627 |
return new Response('Could not load slot data',500); |
624 | 628 |
} |
625 | 629 |
|
626 |
- $intAvailableBehaelter = max(0,$Slot->getAvailableBehaelter())+$Reservation->behaelter; |
|
627 |
- $intAmount = $intAvailableBehaelter; |
|
628 |
- if ($intAvailableBehaelter > 0) |
|
630 |
+ $intDefault = max(0,$Slot->getAvailableBehaelter())+$Reservation->behaelter; |
|
631 |
+ $intAmount = $intDefault; |
|
632 |
+ if ($intDefault > 0) |
|
629 | 633 |
{ |
630 | 634 |
$intOvercapacityBehaelter = $Slot->getOvercapacityBehaelter(); |
631 | 635 |
$intAmount += $intOvercapacityBehaelter; |
... | ... |
@@ -638,14 +642,15 @@ class SlotAjaxController extends AbstractController |
638 | 642 |
return new Response('Could not load unit data', 500); |
639 | 643 |
} |
640 | 644 |
|
641 |
- $intAmount = floor($intAvailableBehaelter / max(1, $Unit->containers)); |
|
645 |
+ $intDefault = floor($intDefault / max(1, $Unit->containers)); |
|
646 |
+ $intAmount = floor($intAmount / max(1, $Unit->containers)); |
|
642 | 647 |
} |
643 | 648 |
|
644 | 649 |
$strOutput = "<select id=\"res-behaelter\" name=\"behaelter\" required> |
645 | 650 |
<option value=\"\">-</option>\n"; |
646 | 651 |
for ($i = 1; $i <= $intAmount; $i++) |
647 | 652 |
{ |
648 |
- if ($intAvailableBehaelter < $i) |
|
653 |
+ if ($intDefault < $i) |
|
649 | 654 |
{ |
650 | 655 |
$strOutput .= "<option value=\"$i\">$i (".$this->translator->trans('MSC.wa_overbooking',[], 'contao_default').")</option>\n"; |
651 | 656 |
} else { |