... | ... |
@@ -54,6 +54,23 @@ |
54 | 54 |
{# <div class="col submit"><button class="u-block w-100p">Filter übernehmen</button></div>#} |
55 | 55 |
</div> |
56 | 56 |
</form> |
57 |
+ {# Todo: Future feature #} |
|
58 |
+ {#<div class="u-flex u-gap-2 u-justify-center"> |
|
59 |
+ <div class="col"> |
|
60 |
+ <div class="tag-container group-tags group-tags--rounded"> |
|
61 |
+ <div class="tag tag--dark">Datum:</div> |
|
62 |
+ <div class="tag">19.09.1980</div> |
|
63 |
+ <div class="tag tag__close-btn"></div> |
|
64 |
+ </div> |
|
65 |
+ </div> |
|
66 |
+ <div class="col"> |
|
67 |
+ <div class="tag-container group-tags group-tags--rounded"> |
|
68 |
+ <div class="tag tag--dark">Standort:</div> |
|
69 |
+ <div class="tag">Annahmestelle 1</div> |
|
70 |
+ <div class="tag tag__close-btn"></div> |
|
71 |
+ </div> |
|
72 |
+ </div> |
|
73 |
+ </div>#} |
|
57 | 74 |
{% endblock %} |
58 | 75 |
|
59 | 76 |
{% block content %} |
... | ... |
@@ -115,7 +115,7 @@ class WeinanlieferungSlotsListModuleController extends AbstractFrontendModuleCon |
115 | 115 |
$day = new Date($slot->date); |
116 | 116 |
$arrSorten = []; |
117 | 117 |
$arrErnteart = []; |
118 |
- $intAvailableBehaelter = max(0,$slot->getAvailableBehaelter()); |
|
118 |
+ $intAvailableBehaelter = max(0, $slot->getAvailableBehaelter()); |
|
119 | 119 |
|
120 | 120 |
$Sorten = StringUtil::deserialize($slot->sorten, true); |
121 | 121 |
foreach ($Sorten as $sorte) |
... | ... |
@@ -145,33 +145,36 @@ class WeinanlieferungSlotsListModuleController extends AbstractFrontendModuleCon |
145 | 145 |
$arrLage = $Lage->fetchEach('title'); |
146 | 146 |
} |
147 | 147 |
|
148 |
- $arrData['days'][$day->dayBegin][] = array_merge($slot->row(),[ |
|
149 |
- 'anmerkungen' => $slot->anmerkungen ? StringUtil::substr(strip_tags($slot->anmerkungen),110) : '', |
|
150 |
- 'standort' => $strStandort, |
|
151 |
- 'lage' => $arrLage, |
|
152 |
- 'sorte' => $arrSorten, |
|
153 |
- 'ernteart' => $arrErnteart, |
|
148 |
+ $arrData['days'][$day->dayBegin][] = array_merge($slot->row(), [ |
|
149 |
+ 'anmerkungen' => $slot->anmerkungen ? StringUtil::substr(strip_tags($slot->anmerkungen), 110) : '', |
|
150 |
+ 'standort' => $strStandort, |
|
151 |
+ 'lage' => $arrLage, |
|
152 |
+ 'sorte' => $arrSorten, |
|
153 |
+ 'ernteart' => $arrErnteart, |
|
154 | 154 |
'behaelterAvailable' => $intAvailableBehaelter, |
155 |
- 'buchbar' => (boolean) $intAvailableBehaelter, |
|
156 |
- 'gebucht' => (boolean) WeinanlieferungReservationModel::countBy(["uid = ?","pid = ?"],[FrontendUser::getInstance()->id,$slot->id]) |
|
155 |
+ 'buchbar' => (boolean)$intAvailableBehaelter, |
|
156 |
+ 'gebucht' => (boolean)WeinanlieferungReservationModel::countBy(["uid = ?", "pid = ?"], [FrontendUser::getInstance()->id, $slot->id]) |
|
157 | 157 |
]); |
158 | 158 |
} |
159 | 159 |
|
160 | 160 |
// Get filter values |
161 |
- $result = $this->db->executeQuery("SELECT MAX(behaelter) as 'kapazitaet' FROM tl_vr_wa_slot WHERE id IN (".implode(',',$slotIds).")"); |
|
161 |
+ $result = $this->db->executeQuery("SELECT MAX(behaelter) as 'kapazitaet' FROM tl_vr_wa_slot WHERE id IN (" . implode(',', $slotIds) . ")"); |
|
162 | 162 |
$intMaxKapazitaet = $result->fetchOne(); |
163 |
- $arrData['filter']['kapazitaet']['options'] = range(1,max(1,$intMaxKapazitaet)); |
|
163 |
+ $arrData['filter']['kapazitaet']['options'] = range(1, max(1, $intMaxKapazitaet)); |
|
164 | 164 |
|
165 |
- if (($Standorte = WeinanlieferungStandortModel::findBy(["id IN (".implode(',',$standortIds).")","id IN (SELECT tl_vr_wa_slot.pid FROM tl_vr_wa_slot WHERE tl_vr_wa_slot.id IN (".implode(',',$slotIds)."))"],null,['order'=>'title ASC'])) !== null) |
|
165 |
+ if (($Standorte = WeinanlieferungStandortModel::findBy(["id IN (" . implode(',', $standortIds) . ")", "id IN (SELECT tl_vr_wa_slot.pid FROM tl_vr_wa_slot WHERE tl_vr_wa_slot.id IN (" . implode(',', $slotIds) . "))"], null, ['order' => 'title ASC'])) !== null) |
|
166 | 166 |
{ |
167 |
- $arrData['filter']['standort']['options'] = array_combine($Standorte->fetchEach('id'),$Standorte->fetchEach('title')); |
|
167 |
+ $arrData['filter']['standort']['options'] = array_combine($Standorte->fetchEach('id'), $Standorte->fetchEach('title')); |
|
168 | 168 |
} |
169 | 169 |
|
170 |
- $slots->reset(); |
|
171 |
- foreach ($slots as $slot) |
|
170 |
+// $slots->reset(); |
|
171 |
+ if (($slotsUnfiltered = WeinanlieferungSlotsModel::findMultiplePublishedByPids($standortIds)) !== null) |
|
172 | 172 |
{ |
173 |
- $Tag = new Date($slot->time); |
|
174 |
- $arrData['filter']['tag']['options'][$Tag->dayBegin] = Date::parse(Date::getNumericDateFormat(),$Tag->dayBegin); |
|
173 |
+ foreach ($slotsUnfiltered as $slot) |
|
174 |
+ { |
|
175 |
+ $Tag = new Date($slot->time); |
|
176 |
+ $arrData['filter']['tag']['options'][$Tag->dayBegin] = Date::parse(Date::getNumericDateFormat(), $Tag->dayBegin); |
|
177 |
+ } |
|
175 | 178 |
} |
176 | 179 |
|
177 | 180 |
/*if (isset($GLOBALS['TL_DCA']['tl_vr_wa_slot']['fields']['ernteart']['options'])) |