... | ... |
@@ -7,13 +7,21 @@ |
7 | 7 |
<div class="grid-c-6 mb-2 mb-0-md"> |
8 | 8 |
<div class="u-flex u-items-center u-gap-1"> |
9 | 9 |
<i class="icon-uhr-outline"></i> |
10 |
- <div class="t-label">Tag/Urzeit</div> |
|
10 |
+ <div class="t-label">Beginn</div> |
|
11 | 11 |
</div> |
12 | 12 |
<div class="">{{ slot.time|date('d.m.Y H:i') }}</div> |
13 | 13 |
</div> |
14 | 14 |
|
15 | 15 |
<div class="grid-c-6 mb-2 mb-0-md"> |
16 | 16 |
<div class="u-flex u-items-center u-gap-1"> |
17 |
+ <i class="icon-uhr-outline"></i> |
|
18 |
+ <div class="t-label">Ende</div> |
|
19 |
+ </div> |
|
20 |
+ <div class="">{{ (slot.time + slot.duration * 60)|date('d.m.Y H:i') }}</div> |
|
21 |
+ </div> |
|
22 |
+ |
|
23 |
+ <div class="grid-c-6 mb-2 mb-0-md"> |
|
24 |
+ <div class="u-flex u-items-center u-gap-1"> |
|
17 | 25 |
<i class="icon-standort-outline"></i> |
18 | 26 |
<div class="t-label">Standort</div> |
19 | 27 |
</div> |
... | ... |
@@ -50,24 +58,6 @@ |
50 | 58 |
{% endfor %} |
51 | 59 |
</select> |
52 | 60 |
</fieldset> |
53 |
- <fieldset> |
|
54 |
- <legend>Anliefernde Rebsorte(n)<sup class="text-danger">*</sup></legend> |
|
55 |
- {% for value,label in buchen.sorten %} |
|
56 |
- <label><input type="checkbox" name="sorten[]" value="{{ value }}"{{ value in buchung.sorten|keys ? ' checked' : '' }}> <span class="checkable">{{ label }}</span></label><br> |
|
57 |
- {% endfor %} |
|
58 |
- </fieldset> |
|
59 |
- <fieldset> |
|
60 |
- <legend>Ernteart(en)<sup class="text-danger">*</sup></legend> |
|
61 |
- {% for value,label in buchen.ernteart %} |
|
62 |
- <label><input type="checkbox" name="ernteart[]" value="{{ value }}"{{ value in buchung.ernteart ? ' checked' : '' }}> <span class="checkable">{{ label }}</span></label><br> |
|
63 |
- {% endfor %} |
|
64 |
- </fieldset> |
|
65 |
- <fieldset> |
|
66 |
- <legend>Lage(n)<sup class="text-danger">*</sup></legend> |
|
67 |
- {% for value,label in buchen.lage %} |
|
68 |
- <label><input type="checkbox" name="lage[]" value="{{ value }}"{{ value in buchung.lage ? ' checked' : '' }}> <span class="checkable">{{ label }}</span></label><br> |
|
69 |
- {% endfor %} |
|
70 |
- </fieldset> |
|
71 | 61 |
{% if file is defined %} |
72 | 62 |
<fieldset> |
73 | 63 |
<div class="t-label">Aktuelle Datei</div> |
... | ... |
@@ -14,6 +14,14 @@ |
14 | 14 |
|
15 | 15 |
<div class="grid-c-6 mb-2 mb-0-md"> |
16 | 16 |
<div class="u-flex u-items-center u-gap-1"> |
17 |
+ <i class="icon-uhr-outline"></i> |
|
18 |
+ <div class="t-label">Tag/Urzeit</div> |
|
19 |
+ </div> |
|
20 |
+ <div class="">{{ (slot.time + slot.duration * 60)|date('d.m.Y H:i') }}</div> |
|
21 |
+ </div> |
|
22 |
+ |
|
23 |
+ <div class="grid-c-6 mb-2 mb-0-md"> |
|
24 |
+ <div class="u-flex u-items-center u-gap-1"> |
|
17 | 25 |
<i class="icon-standort-outline"></i> |
18 | 26 |
<div class="t-label">Standort</div> |
19 | 27 |
</div> |
... | ... |
@@ -28,30 +36,6 @@ |
28 | 36 |
<div class="">{{ slot.behaelterAvailable }}</div> |
29 | 37 |
</div> |
30 | 38 |
|
31 |
- <div class="grid-c-6 mb-2 mb-0-md"> |
|
32 |
- <div class="u-flex u-items-center u-gap-1"> |
|
33 |
- <i class="icon-schere-outline"></i> |
|
34 |
- <div class="t-label">Erntearten</div> |
|
35 |
- </div> |
|
36 |
- <div class="">{{ ernteart|join(', ') }}</div> |
|
37 |
- </div> |
|
38 |
- |
|
39 |
- <div class="grid-c-6 mb-2 mb-0-md"> |
|
40 |
- <div class="u-flex u-items-center u-gap-1"> |
|
41 |
- <i class="icon-reben-outline"></i> |
|
42 |
- <div class="t-label">Verarbeitete Sorten</div> |
|
43 |
- </div> |
|
44 |
- <div class="">{{ slot.sorte|join(', ') }}</div> |
|
45 |
- </div> |
|
46 |
- |
|
47 |
- <div class="grid-c-6 mb-2 mb-0-md"> |
|
48 |
- <div class="u-flex u-items-center u-gap-1"> |
|
49 |
- <i class="icon-lage-outline"></i> |
|
50 |
- <div class="t-label">Lagen</div> |
|
51 |
- </div> |
|
52 |
- <div class="">{{ lage|join(', ') }}</div> |
|
53 |
- </div> |
|
54 |
- |
|
55 | 39 |
{% if slot.anmerkungen %} |
56 | 40 |
<div class="grid-c-12 mb-2 mb-0-md"> |
57 | 41 |
<div class="u-flex u-items-center u-gap-1"> |
... | ... |
@@ -7,13 +7,21 @@ |
7 | 7 |
<div class="grid-c-6 mb-2 mb-0-md"> |
8 | 8 |
<div class="u-flex u-items-center u-gap-1"> |
9 | 9 |
<i class="icon-uhr-outline"></i> |
10 |
- <div class="t-label">Tag/Urzeit</div> |
|
10 |
+ <div class="t-label">Beginn</div> |
|
11 | 11 |
</div> |
12 | 12 |
<div class="">{{ slot.time|date('d.m.Y H:i') }}</div> |
13 | 13 |
</div> |
14 | 14 |
|
15 | 15 |
<div class="grid-c-6 mb-2 mb-0-md"> |
16 | 16 |
<div class="u-flex u-items-center u-gap-1"> |
17 |
+ <i class="icon-uhr-outline"></i> |
|
18 |
+ <div class="t-label">Ende</div> |
|
19 |
+ </div> |
|
20 |
+ <div class="">{{ (slot.time + slot.duration * 60)|date('d.m.Y H:i') }}</div> |
|
21 |
+ </div> |
|
22 |
+ |
|
23 |
+ <div class="grid-c-6 mb-2 mb-0-md"> |
|
24 |
+ <div class="u-flex u-items-center u-gap-1"> |
|
17 | 25 |
<i class="icon-standort-outline"></i> |
18 | 26 |
<div class="t-label">Standort</div> |
19 | 27 |
</div> |
... | ... |
@@ -28,30 +36,6 @@ |
28 | 36 |
<div class="">{{ slot.behaelterAvailable }}</div> |
29 | 37 |
</div> |
30 | 38 |
|
31 |
- <div class="grid-c-6 mb-2 mb-0-md"> |
|
32 |
- <div class="u-flex u-items-center u-gap-1"> |
|
33 |
- <i class="icon-schere-outline"></i> |
|
34 |
- <div class="t-label">Erntearten</div> |
|
35 |
- </div> |
|
36 |
- <div class="">{{ ernteart|join(', ') }}</div> |
|
37 |
- </div> |
|
38 |
- |
|
39 |
- <div class="grid-c-6 mb-2 mb-0-md"> |
|
40 |
- <div class="u-flex u-items-center u-gap-1"> |
|
41 |
- <i class="icon-reben-outline"></i> |
|
42 |
- <div class="t-label">Verarbeitete Sorten</div> |
|
43 |
- </div> |
|
44 |
- <div class="">{{ slot.sorte|join(', ') }}</div> |
|
45 |
- </div> |
|
46 |
- |
|
47 |
- <div class="grid-c-6 mb-2 mb-0-md"> |
|
48 |
- <div class="u-flex u-items-center u-gap-1"> |
|
49 |
- <i class="icon-lage-outline"></i> |
|
50 |
- <div class="t-label">Lagen</div> |
|
51 |
- </div> |
|
52 |
- <div class="">{{ lage|join(', ') }}</div> |
|
53 |
- </div> |
|
54 |
- |
|
55 | 39 |
{% if slot.anmerkungen %} |
56 | 40 |
<div class="grid-c-12 mb-2 mb-0-md"> |
57 | 41 |
<div class="u-flex u-items-center u-gap-1"> |
... | ... |
@@ -73,18 +57,12 @@ |
73 | 57 |
<ul class="no-bullets mx-0 reservations"> |
74 | 58 |
{% for reservation in reservations %} |
75 | 59 |
<li class="row u-items-center p-0"> |
76 |
- <div class="col-2"> |
|
60 |
+ <div class="col-7"> |
|
77 | 61 |
<div class="u-flex u-items-center u-gap-1"> |
78 | 62 |
<i class="icon-behaelter-outline"></i> |
79 | 63 |
{{ reservation.behaelter }} |
80 | 64 |
</div> |
81 | 65 |
</div> |
82 |
- <div class="col-6"> |
|
83 |
- <div class="u-flex u-items-center u-gap-1"> |
|
84 |
- <i class="icon-reben-outline"></i> |
|
85 |
- {{ reservation.sorten|join(', ') }} |
|
86 |
- </div> |
|
87 |
- </div> |
|
88 | 66 |
<div class="col u-text-right"> |
89 | 67 |
<div><a hx-get="/_ajax/vr_wa/v1/slot?do=booking&id={{ reservation.id }}" hx-target="body" hx-swap="beforeend" href="javascript:;" class="btn btn--sm m-0">Bearbeiten</a></div> |
90 | 68 |
</div> |
... | ... |
@@ -114,24 +92,6 @@ |
114 | 92 |
</select> |
115 | 93 |
</fieldset> |
116 | 94 |
<fieldset> |
117 |
- <legend>Anliefernde Rebsorte(n)<sup class="text-danger">*</sup></legend> |
|
118 |
- {% for value,label in buchen.sorten %} |
|
119 |
- <label><input type="checkbox" name="sorten[]" value="{{ value }}"> <span class="checkable">{{ label }}</span></label><br> |
|
120 |
- {% endfor %} |
|
121 |
- </fieldset> |
|
122 |
- <fieldset> |
|
123 |
- <legend>Ernteart(en)<sup class="text-danger">*</sup></legend> |
|
124 |
- {% for value,label in buchen.ernteart %} |
|
125 |
- <label><input type="checkbox" name="ernteart[]" value="{{ value }}"> <span class="checkable">{{ label }}</span></label><br> |
|
126 |
- {% endfor %} |
|
127 |
- </fieldset> |
|
128 |
- <fieldset> |
|
129 |
- <legend>Lage(n)<sup class="text-danger">*</sup></legend> |
|
130 |
- {% for value,label in buchen.lage %} |
|
131 |
- <label><input type="checkbox" name="lage[]" value="{{ value }}"> <span class="checkable">{{ label }}</span></label><br> |
|
132 |
- {% endfor %} |
|
133 |
- </fieldset> |
|
134 |
- <fieldset> |
|
135 | 95 |
<label for="res-upload"><strong>Dateianhang</strong></label> |
136 | 96 |
<input type="file" id="res-upload" name="upload"> |
137 | 97 |
</fieldset> |
... | ... |
@@ -14,25 +14,24 @@ |
14 | 14 |
<div class="grid-c-3 time bg-white p-1"> |
15 | 15 |
<div class="u-flex u-items-center u-gap-1"> |
16 | 16 |
<i class="icon-uhr-outline"></i> |
17 |
- <span class="t-label">Uhrzeit</span> |
|
17 |
+ <span class="t-label">Beginn</span> |
|
18 | 18 |
{{ booking.slot.time|date('H:i') }} |
19 | 19 |
</div> |
20 | 20 |
</div> |
21 |
+ <div class="grid-c-3 time bg-white p-1"> |
|
22 |
+ <div class="u-flex u-items-center u-gap-1"> |
|
23 |
+ <i class="icon-uhr-outline"></i> |
|
24 |
+ <span class="t-label">Ende</span> |
|
25 |
+ {{ (booking.slot.time + booking.slot.duration * 60)|date('H:i') }} |
|
26 |
+ </div> |
|
27 |
+ </div> |
|
21 | 28 |
<div class="grid-c-3 behaelter bg-white p-1"> |
22 | 29 |
<div class="u-flex u-flex-wrap u-gap-1"> |
23 | 30 |
<i class="icon-behaelter-outline"></i> |
24 |
- <span class="t-label">Gebuchte Behälterkapazität</span> |
|
31 |
+ <span class="t-label">Gebuchte Behälter</span> |
|
25 | 32 |
{{ booking.behaelter }} |
26 | 33 |
</div> |
27 | 34 |
</div> |
28 |
- <div class="grid-c-6 rebsorten bg-white p-1"> |
|
29 |
- <div class="u-flex u-flex-wrap u-gap-1"> |
|
30 |
- <i class="icon-reben-outline"></i> |
|
31 |
- <div class="t-label">Anliefernde Sorten</div> |
|
32 |
- |
|
33 |
- </div> |
|
34 |
- {{ booking.sorte|join(', ') }} |
|
35 |
- </div> |
|
36 | 35 |
<div class="grid-c-3 standort bg-white p-1"> |
37 | 36 |
<div class="u-flex u-flex-wrap u-gap-1"> |
38 | 37 |
<i class="icon-standort-outline"></i> |
... | ... |
@@ -40,20 +39,6 @@ |
40 | 39 |
{{ booking.standort }} |
41 | 40 |
</div> |
42 | 41 |
</div> |
43 |
- <div class="grid-c-3 ernteart bg-white p-1"> |
|
44 |
- <div class="u-flex u-flex-wrap u-gap-1"> |
|
45 |
- <i class="icon-schere-outline"></i> |
|
46 |
- <div class="t-label">Erntearten</div> |
|
47 |
- {{ booking.ernteart|join(', ') }} |
|
48 |
- </div> |
|
49 |
- </div> |
|
50 |
- <div class="grid-c-6 lage bg-white p-1"> |
|
51 |
- <div class="u-flex u-flex-wrap u-gap-1"> |
|
52 |
- <i class="icon-lage-outline"></i> |
|
53 |
- <span class="t-label">Lagen</span> |
|
54 |
- {{ booking.lage|join(', ') }} |
|
55 |
- </div> |
|
56 |
- </div> |
|
57 | 42 |
{% if booking.slot.anmerkungen is defined and booking.slot.anmerkungen %} |
58 | 43 |
<div class="grid-c-12 bg-white p-1"> |
59 | 44 |
<div class="u-flex u-flex-wrap u-gap-1"> |
... | ... |
@@ -119,54 +119,11 @@ class SlotAjaxController extends AbstractController |
119 | 119 |
{ |
120 | 120 |
foreach ($Reservations as $reservation) |
121 | 121 |
{ |
122 |
- $arrSortenBooked = []; |
|
123 |
- $SortenLeseart = explode(';',$reservation->sorten); |
|
124 |
- foreach($SortenLeseart as $sorteLeseart) |
|
125 |
- { |
|
126 |
- list($sorte,$leseart) = explode(',',$sorteLeseart); |
|
127 |
- $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte); |
|
128 |
- $objLeseart = WeinanlieferungLeseartModel::findByPk($leseart); |
|
129 |
- $arrSortenBooked[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null ? $objSorte->title : '') . ' ' . ($objLeseart !== null ? $objLeseart->title : ''); |
|
130 |
- } |
|
131 |
- /*if (($Sorten = $reservation->getRelated('sorten')) !== null) |
|
132 |
- { |
|
133 |
- $arrSortenBooked = $Sorten->fetchEach('title'); |
|
134 |
- }*/ |
|
135 |
- $arrReservations[] = array_merge($reservation->row(),[ |
|
136 |
- 'sorten' => $arrSortenBooked |
|
137 |
- ]); |
|
122 |
+ $arrReservations[] = $reservation->row(); |
|
138 | 123 |
} |
139 | 124 |
} |
140 | 125 |
|
141 | 126 |
// Build data |
142 |
- $arrSorten = []; |
|
143 |
- $Sorten = StringUtil::deserialize($Slot->sorten,true); |
|
144 |
- foreach($Sorten as $sorte) |
|
145 |
- { |
|
146 |
- $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte['sorte']); |
|
147 |
- $objLeseart = WeinanlieferungLeseartModel::findByPk($sorte['leseart']); |
|
148 |
- $arrSorten[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null ? $objSorte->title : '') . ' ' . ($objLeseart !== null ? $objLeseart->title : ''); |
|
149 |
- } |
|
150 |
- /*if (($Sorten = $Slot->getRelated('sorte')) !== null) |
|
151 |
- { |
|
152 |
- $arrSorten = array_combine($Sorten->fetchEach('id'),$Sorten->fetchEach('title')); |
|
153 |
- }*/ |
|
154 |
- |
|
155 |
- $arrErnteart = []; |
|
156 |
- if ($Slot->ernteart !== null) |
|
157 |
- { |
|
158 |
- foreach (explode(',', $Slot->ernteart) as $ernteart) |
|
159 |
- { |
|
160 |
- $arrErnteart[$ernteart] = $GLOBALS['TL_LANG']['REF']['wa_ernteart'][$ernteart] ?? $ernteart; |
|
161 |
- } |
|
162 |
- } |
|
163 |
- |
|
164 |
- $arrLage = []; |
|
165 |
- if (($Lage = $Slot->getRelated('lage')) !== null) |
|
166 |
- { |
|
167 |
- $arrLage = array_combine($Lage->fetchEach('id'),$Lage->fetchEach('title')); |
|
168 |
- } |
|
169 |
- |
|
170 | 127 |
$intAvailableBehaelter = max(0,$Slot->getAvailableBehaelter()); |
171 | 128 |
|
172 | 129 |
$arrData = [ |
... | ... |
@@ -174,18 +131,12 @@ class SlotAjaxController extends AbstractController |
174 | 131 |
'id' => $Slot->id, |
175 | 132 |
'slot' => array_merge($Slot->row(),[ |
176 | 133 |
'anmerkungen' => $insertTagService->replace($Slot->anmerkungen ?? ''), |
177 |
- 'sorte' => $arrSorten, |
|
178 | 134 |
'behaelterAvailable' => $intAvailableBehaelter |
179 | 135 |
]), |
180 | 136 |
'standort' => $Slot->getRelated('pid'), |
181 |
- 'lage' => $arrLage, |
|
182 |
- 'ernteart' => $arrErnteart, |
|
183 | 137 |
'buchen' => [ |
184 | 138 |
'buchbar' => (boolean) $intAvailableBehaelter, |
185 | 139 |
'behaelter' => range(min($intAvailableBehaelter,1),$intAvailableBehaelter), |
186 |
- 'sorten' => $arrSorten, |
|
187 |
- 'lage' => $arrLage, |
|
188 |
- 'ernteart' => $arrErnteart, |
|
189 | 140 |
], |
190 | 141 |
'reservations' => $arrReservations |
191 | 142 |
]; |
... | ... |
@@ -320,52 +271,6 @@ class SlotAjaxController extends AbstractController |
320 | 271 |
} |
321 | 272 |
} |
322 | 273 |
|
323 |
- $arrSortenAvailable = []; |
|
324 |
- $Sorten = StringUtil::deserialize($Slot->sorten,true); |
|
325 |
- foreach($Sorten as $sorte) |
|
326 |
- { |
|
327 |
- $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte['sorte']); |
|
328 |
- $objLeseart = WeinanlieferungLeseartModel::findByPk($sorte['leseart']); |
|
329 |
- $arrSortenAvailable[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null ? $objSorte->title : '') . ' ' . ($objLeseart !== null ? $objLeseart->title : ''); |
|
330 |
- } |
|
331 |
- $arrSortenBooked = []; |
|
332 |
- $SortenLeseart = explode(';',$Booking->sorten); |
|
333 |
- foreach($SortenLeseart as $sorteLeseart) |
|
334 |
- { |
|
335 |
- list($sorte,$leseart) = explode(',',$sorteLeseart); |
|
336 |
- $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte); |
|
337 |
- $objLeseart = WeinanlieferungLeseartModel::findByPk($leseart); |
|
338 |
- $arrSortenBooked[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null ? $objSorte->title : '') . ' ' . ($objLeseart !== null ? $objLeseart->title : ''); |
|
339 |
- } |
|
340 |
- |
|
341 |
- $arrErnteartAvailable = []; |
|
342 |
- if ($Slot->ernteart !== null) |
|
343 |
- { |
|
344 |
- foreach (explode(',', $Slot->ernteart) as $ernteart) |
|
345 |
- { |
|
346 |
- $arrErnteartAvailable[$ernteart] = $GLOBALS['TL_LANG']['REF']['wa_ernteart'][$ernteart] ?? $ernteart; |
|
347 |
- } |
|
348 |
- } |
|
349 |
- $arrErnteartBooked = []; |
|
350 |
- if ($Booking->ernteart !== null) |
|
351 |
- { |
|
352 |
- $arrErnteartBooked = explode(',', $Booking->ernteart); |
|
353 |
- } |
|
354 |
- |
|
355 |
- $arrLagenAvailable = []; |
|
356 |
- if (($Lagen = $Slot->getRelated('lage')) !== null) |
|
357 |
- { |
|
358 |
- foreach ($Lagen as $lage) |
|
359 |
- { |
|
360 |
- $arrLagenAvailable[$lage->id] = $lage->title; |
|
361 |
- } |
|
362 |
- } |
|
363 |
- $arrLagenBooked = []; |
|
364 |
- if ($Booking->lage !== null) |
|
365 |
- { |
|
366 |
- $arrLagenBooked = explode(',', $Booking->lage); |
|
367 |
- } |
|
368 |
- |
|
369 | 274 |
$intAvailableBehaelter = max(0,$Slot->getAvailableBehaelter()); |
370 | 275 |
|
371 | 276 |
$arrData = array_merge($arrData,[ |
... | ... |
@@ -373,21 +278,13 @@ class SlotAjaxController extends AbstractController |
373 | 278 |
'id' => $Booking->id, |
374 | 279 |
'slot' => array_merge($Slot->row(),[ |
375 | 280 |
'anmerkungen' => $insertTagService->replace($Slot->anmerkungen ?? ''), |
376 |
- 'sorte' => $arrSortenAvailable, |
|
377 | 281 |
'behaelterAvailable' => $intAvailableBehaelter, |
378 | 282 |
]), |
379 |
- 'buchung' => array_merge($Booking->row(),[ |
|
380 |
- 'sorten' => $arrSortenBooked, |
|
381 |
- 'ernteart' => $arrErnteartBooked, |
|
382 |
- 'lage' => $arrLagenBooked, |
|
383 |
- ]), |
|
283 |
+ 'buchung' => $Booking->row(), |
|
384 | 284 |
'standort' => $Slot->getRelated('pid'), |
385 | 285 |
'buchen' => [ |
386 | 286 |
'buchbar' => (boolean) $intAvailableBehaelter, |
387 | 287 |
'behaelter' => range(min($intAvailableBehaelter,1),$intAvailableBehaelter+$Booking->behaelter), |
388 |
- 'sorten' => $arrSortenAvailable, |
|
389 |
- 'ernteart' => $arrErnteartAvailable, |
|
390 |
- 'lage' => $arrLagenAvailable, |
|
391 | 288 |
] |
392 | 289 |
]); |
393 | 290 |
|
... | ... |
@@ -439,7 +336,7 @@ class SlotAjaxController extends AbstractController |
439 | 336 |
} |
440 | 337 |
} |
441 | 338 |
$arrError = []; |
442 |
- foreach (['behaelter','sorten','ernteart','lage'] as $field) |
|
339 |
+ foreach (['behaelter'] as $field) |
|
443 | 340 |
{ |
444 | 341 |
if (empty(Input::post($field))) |
445 | 342 |
{ |
... | ... |
@@ -452,43 +349,14 @@ class SlotAjaxController extends AbstractController |
452 | 349 |
return $this->renderDetails(false,'<div class="toast toast--danger mx-0">Bitte geben Sie alle Pflichtangaben (mit * markierte Felder) an</div>'); |
453 | 350 |
} |
454 | 351 |
|
455 |
- $arrSorten = []; |
|
456 |
- if (!is_array(Input::post('sorten'))) |
|
457 |
- { |
|
458 |
- $arrSorten[] = Input::post('sorten'); |
|
459 |
- } else { |
|
460 |
- $arrSorten = implode(';', Input::post('sorten')); |
|
461 |
- } |
|
462 |
- |
|
463 |
- $arrErnteart = []; |
|
464 |
- if (!is_array(Input::post('ernteart'))) |
|
465 |
- { |
|
466 |
- $arrErnteart[] = Input::post('ernteart'); |
|
467 |
- } else { |
|
468 |
- $arrErnteart = implode(',', Input::post('ernteart')); |
|
469 |
- } |
|
470 |
- |
|
471 |
- $arrLage = []; |
|
472 |
- if (!is_array(Input::post('lage'))) |
|
473 |
- { |
|
474 |
- $arrLage[] = Input::post('lage'); |
|
475 |
- } else { |
|
476 |
- $arrLage = implode(',', Input::post('lage')); |
|
477 |
- } |
|
478 |
- |
|
479 | 352 |
$Reservation = new WeinanlieferungReservationModel(); |
480 | 353 |
$arrData = array_merge($arrData,[ |
481 | 354 |
'pid' => $_REQUEST['id'], |
482 | 355 |
'tstamp' => time(), |
483 | 356 |
'uid' => FrontendUser::getInstance()->id, |
484 | 357 |
'behaelter' => Input::post('behaelter'), |
485 |
- 'sorten' => $arrSorten, |
|
486 |
- 'ernteart' => $arrErnteart, |
|
487 |
- 'lage' => $arrLage |
|
488 | 358 |
]); |
489 | 359 |
$Reservation->setRow($arrData); |
490 |
- |
|
491 |
- |
|
492 | 360 |
$Reservation->save(); |
493 | 361 |
|
494 | 362 |
return new Response('<div class="toast toast--success mx-0"><p>Reservierung erfolgreich</p></div>',200,['HX-Trigger'=> 'updateWaList']); |
... | ... |
@@ -64,17 +64,6 @@ class WeinanlieferungBookedListModuleController extends AbstractFrontendModuleCo |
64 | 64 |
if (($Slot = $booking->getRelated('pid')) !== null) |
65 | 65 |
{ |
66 | 66 |
$day = new Date($Slot->date); |
67 |
- $arrSorten = []; |
|
68 |
- $arrErnteart = []; |
|
69 |
- |
|
70 |
- $SortenLeseart = explode(';',$booking->sorten); |
|
71 |
- foreach($SortenLeseart as $sorteLeseart) |
|
72 |
- { |
|
73 |
- list($sorte,$leseart) = explode(',',$sorteLeseart); |
|
74 |
- $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte); |
|
75 |
- $objLeseart = WeinanlieferungLeseartModel::findByPk($leseart); |
|
76 |
- $arrSorten[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null ? $objSorte->title : '') . ' ' . ($objLeseart !== null ? $objLeseart->title : ''); |
|
77 |
- } |
|
78 | 67 |
|
79 | 68 |
$strStandort = ''; |
80 | 69 |
if (($Standort = $Slot->getRelated('pid')) !== null) |
... | ... |
@@ -82,28 +71,11 @@ class WeinanlieferungBookedListModuleController extends AbstractFrontendModuleCo |
82 | 71 |
$strStandort = $Standort->title; |
83 | 72 |
} |
84 | 73 |
|
85 |
- if ($booking->ernteart !== null) |
|
86 |
- { |
|
87 |
- foreach (explode(',', $booking->ernteart) as $ernteart) |
|
88 |
- { |
|
89 |
- $arrErnteart[] = $GLOBALS['TL_LANG']['REF']['wa_ernteart'][$ernteart] ?? $ernteart; |
|
90 |
- } |
|
91 |
- } |
|
92 |
- |
|
93 |
- $arrLage = []; |
|
94 |
- if (($Lage = $booking->getRelated('lage')) !== null) |
|
95 |
- { |
|
96 |
- $arrLage = $Lage->fetchEach('title'); |
|
97 |
- } |
|
98 |
- |
|
99 | 74 |
$arrData['days'][$day->dayBegin][] = array_merge($booking->row(), [ |
100 |
- 'sorte' => $arrSorten, |
|
101 | 75 |
'slot' => array_merge($Slot->row(),[ |
102 | 76 |
'anmerkungen' => $Slot->anmerkungen ? StringUtil::substr(strip_tags($Slot->anmerkungen),110) : '', |
103 | 77 |
]), |
104 | 78 |
'standort' => $strStandort, |
105 |
- 'ernteart' => $arrErnteart, |
|
106 |
- 'lage' => $arrLage, |
|
107 | 79 |
]); |
108 | 80 |
} |
109 | 81 |
} |