| ... | ... |
@@ -97,7 +97,7 @@ $GLOBALS['TL_DCA']['tl_vr_wa_reservation'] = array |
| 97 | 97 |
'palettes' => array |
| 98 | 98 |
( |
| 99 | 99 |
'__selector__' => array(), |
| 100 |
- 'default' => 'pid,behaelter,upload,uid,sorten' |
|
| 100 |
+ 'default' => 'pid,uid,behaelter,sorten,upload' |
|
| 101 | 101 |
), |
| 102 | 102 |
|
| 103 | 103 |
// Subpalettes |
| ... | ... |
@@ -128,27 +128,27 @@ $GLOBALS['TL_DCA']['tl_vr_wa_reservation'] = array |
| 128 | 128 |
( |
| 129 | 129 |
'inputType' => 'select', |
| 130 | 130 |
'foreignKey' => 'tl_member.username', |
| 131 |
- 'eval' => array('mandatory'=>true,'chosen'=>true,'includeBlankOption'=>true),
|
|
| 131 |
+ 'eval' => array('mandatory'=>true,'chosen'=>true,'includeBlankOption'=>true,'tl_class'=>'w50'),
|
|
| 132 | 132 |
'sql' => "int(10) unsigned NOT NULL default '0'", |
| 133 | 133 |
'relation' => array('type' => 'belongsTo', 'load' => 'lazy')
|
| 134 | 134 |
), |
| 135 | 135 |
'behaelter' => array |
| 136 | 136 |
( |
| 137 | 137 |
'inputType' => 'text', |
| 138 |
- 'eval' => array('rgxp'=>'natural'),
|
|
| 138 |
+ 'eval' => array('rgxp'=>'natural','tl_class'=>'w50'),
|
|
| 139 | 139 |
'sql' => "smallint(3) unsigned NOT NULL default 0", |
| 140 | 140 |
), |
| 141 | 141 |
'sorten' => array |
| 142 | 142 |
( |
| 143 | 143 |
'inputType' => 'checkbox', |
| 144 |
- 'eval' => array('multiple'=>true, 'csv'=>';'),
|
|
| 144 |
+ 'eval' => array('multiple'=>true, 'csv'=>';','tl_class'=>'w50'),
|
|
| 145 | 145 |
'sql' => "blob NULL", |
| 146 | 146 |
), |
| 147 | 147 |
'upload' => array |
| 148 | 148 |
( |
| 149 | 149 |
'exclude' => true, |
| 150 | 150 |
'inputType' => 'fileTree', |
| 151 |
- 'eval' => array('filesOnly'=>true, 'fieldType'=>'radio', 'tl_class'=>'clr', 'extensions'=>Config::get('allowedDownload')),
|
|
| 151 |
+ 'eval' => array('filesOnly'=>true, 'fieldType'=>'radio', 'tl_class'=>'w50', 'extensions'=>Config::get('allowedDownload')),
|
|
| 152 | 152 |
'sql' => "binary(16) NULL" |
| 153 | 153 |
), |
| 154 | 154 |
'filename' => array |
| 155 | 155 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,16 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+/** |
|
| 4 |
+ * This file is part of contao-weinanlieferung-bundle. |
|
| 5 |
+ * |
|
| 6 |
+ * (c) vonRotenberg |
|
| 7 |
+ * |
|
| 8 |
+ * @license commercial |
|
| 9 |
+ */ |
|
| 10 |
+ |
|
| 11 |
+$GLOBALS['TL_LANG']['tl_vr_wa_leseart']['title'][0] = 'Leseart'; |
|
| 12 |
+$GLOBALS['TL_LANG']['tl_vr_wa_leseart']['title'][1] = 'Die Bezeichnung der Leseart.'; |
|
| 13 |
+ |
|
| 14 |
+$GLOBALS['TL_LANG']['tl_vr_wa_leseart']['title_legend'] = 'Leseart'; |
|
| 15 |
+ |
|
| 16 |
+$GLOBALS['TL_LANG']['tl_vr_wa_leseart']['back'] = 'Zurück'; |
| 0 | 17 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,24 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+/** |
|
| 4 |
+ * This file is part of contao-weinanlieferung-bundle. |
|
| 5 |
+ * |
|
| 6 |
+ * (c) vonRotenberg |
|
| 7 |
+ * |
|
| 8 |
+ * @license commercial |
|
| 9 |
+ */ |
|
| 10 |
+ |
|
| 11 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['pid'][0] = 'Zeitslot'; |
|
| 12 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['pid'][1] = 'Der gebuchte Zeitslot.'; |
|
| 13 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['behaelter'][0] = 'Behälteranzahl'; |
|
| 14 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['behaelter'][1] = 'Die Anzahl an Behälter, die der Winzer anliefert.'; |
|
| 15 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['sorten'][0] = 'Sorten'; |
|
| 16 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['sorten'][1] = 'Die Sorten, die der Winzer anliefert.'; |
|
| 17 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['uid'][0] = 'Winzer'; |
|
| 18 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['uid'][1] = 'Zuordnung des anliefernden Winzers.'; |
|
| 19 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['upload'][0] = 'Datei'; |
|
| 20 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['upload'][1] = 'Die hochgeladene Datei des Winzers.'; |
|
| 21 |
+ |
|
| 22 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['title_legend'] = 'Leseart'; |
|
| 23 |
+ |
|
| 24 |
+$GLOBALS['TL_LANG']['tl_vr_wa_reservation']['back'] = 'Zurück'; |
| ... | ... |
@@ -68,7 +68,36 @@ class WeinanlieferungReservationContainerListener |
| 68 | 68 |
$arrData = []; |
| 69 | 69 |
foreach ($Slots as $slot) |
| 70 | 70 |
{
|
| 71 |
- $arrData[$slot->id] = Date::parse(Date::getNumericDatimFormat(),$slot->time); |
|
| 71 |
+ $arrSorten = []; |
|
| 72 |
+ $intAvailableBehaelter = $slot->getAvailableBehaelter(); |
|
| 73 |
+ |
|
| 74 |
+ $Sorten = StringUtil::deserialize($slot->sorten,true); |
|
| 75 |
+ foreach($Sorten as $sorte) |
|
| 76 |
+ {
|
|
| 77 |
+ $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte['sorte']); |
|
| 78 |
+ $objLeseart = WeinanlieferungLeseartModel::findByPk($sorte['leseart']); |
|
| 79 |
+ $arrSorten[] = ($objSorte !== null ? $objSorte->title : '') . ' ' . ($objLeseart !== null ? $objLeseart->title : ''); |
|
| 80 |
+ } |
|
| 81 |
+ $arrData[$slot->id] = Date::parse(Date::getNumericDatimFormat(),$slot->time) . ' - (' . implode(', ',$arrSorten) . ') [Verfügbare Behälter: ' . $intAvailableBehaelter . '/' . $slot->behaelter . ']';
|
|
| 82 |
+ } |
|
| 83 |
+ |
|
| 84 |
+ return $arrData; |
|
| 85 |
+ } |
|
| 86 |
+ |
|
| 87 |
+ /** |
|
| 88 |
+ * @Callback(table="tl_vr_wa_reservation", target="fields.uid.options") |
|
| 89 |
+ */ |
|
| 90 |
+ public function onUidOptionsCallback(DataContainer $dc) |
|
| 91 |
+ {
|
|
| 92 |
+ if (($Members = \MemberModel::findAll()) === null) |
|
| 93 |
+ {
|
|
| 94 |
+ return []; |
|
| 95 |
+ } |
|
| 96 |
+ |
|
| 97 |
+ $arrData = []; |
|
| 98 |
+ foreach ($Members as $member) |
|
| 99 |
+ {
|
|
| 100 |
+ $arrData[$member->id] = ($member->memberno !== null && $member->memberno ? $member->memberno.' ' : '') . $member->firstname . ' ' . $member->lastname . ' [' . $member->email . ']'; |
|
| 72 | 101 |
} |
| 73 | 102 |
|
| 74 | 103 |
return $arrData; |
| ... | ... |
@@ -103,6 +103,11 @@ class WeinanlieferungSlotsModel extends Model |
| 103 | 103 |
$t = static::$strTable; |
| 104 | 104 |
$time = Date::floorToMinute(); |
| 105 | 105 |
|
| 106 |
+ if (!isset($arrOptions['order'])) |
|
| 107 |
+ {
|
|
| 108 |
+ $arrOptions['order'] = "$t.time ASC"; |
|
| 109 |
+ } |
|
| 110 |
+ |
|
| 106 | 111 |
return static::findBy(array("$t.time >= ?","$t.tstamp!=0","$t.buchbar='1' AND $t.buchbar_bis > ?"), [$time,$time], $arrOptions);
|
| 107 | 112 |
} |
| 108 | 113 |
|