Browse code

Update

Benjamin Roth authored on15/08/2023 00:19:43
Showing19 changed files
... ...
@@ -20,7 +20,8 @@
20 20
         "symfony/config": "^5.4",
21 21
         "symfony/dependency-injection": "^5.4",
22 22
         "symfony/http-kernel": "^5.4",
23
-        "vonrotenberg/htmx-bundle": "^1.0"
23
+        "vonrotenberg/htmx-bundle": "^1.0",
24
+        "menatwork/contao-multicolumnwizard-bundle": "^3.6"
24 25
     },
25 26
     "require-dev": {
26 27
         "bamarni/composer-bin-plugin": "^1.5",
... ...
@@ -9,17 +9,19 @@
9 9
  */
10 10
 
11 11
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungRebsorteModel;
12
+use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungLeseartModel;
12 13
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungReservationModel;
13 14
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungSlotsModel;
14 15
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungStandortModel;
15 16
 
16 17
 $GLOBALS['BE_MOD']['content']['weinanlieferung'] = array
17 18
 (
18
-    'tables'     => array('tl_vr_wa_standort', 'tl_vr_wa_slot', 'tl_vr_wa_rebsorte'),
19
+    'tables'     => array('tl_vr_wa_standort', 'tl_vr_wa_slot', 'tl_vr_wa_rebsorte','tl_vr_wa_leseart'),
19 20
     'stylesheet' => array('bundles/vonrotenbergweinanlieferung/css/backend.css')
20 21
 );
21 22
 
22 23
 $GLOBALS['TL_MODELS']['tl_vr_wa_slot'] = WeinanlieferungSlotsModel::class;
23 24
 $GLOBALS['TL_MODELS']['tl_vr_wa_standort'] = WeinanlieferungStandortModel::class;
24 25
 $GLOBALS['TL_MODELS']['tl_vr_wa_rebsorte'] = WeinanlieferungRebsorteModel::class;
26
+$GLOBALS['TL_MODELS']['tl_vr_wa_leseart'] = WeinanlieferungLeseartModel::class;
25 27
 $GLOBALS['TL_MODELS']['tl_vr_wa_reservation'] = WeinanlieferungReservationModel::class;
26 28
new file mode 100644
... ...
@@ -0,0 +1,124 @@
1
+<?php
2
+
3
+/**
4
+ * This file is part of contao-weinanlieferung-bundle.
5
+ *
6
+ * (c) vonRotenberg
7
+ *
8
+ * @license commercial
9
+ */
10
+
11
+use Contao\DC_Table;
12
+use Contao\DataContainer;
13
+
14
+$GLOBALS['TL_DCA']['tl_vr_wa_leseart'] = array
15
+(
16
+    // Config
17
+    'config' => array
18
+    (
19
+        'dataContainer'    => DC_Table::class,
20
+        'enableVersioning' => true,
21
+        'sql'              => array
22
+        (
23
+            'keys' => array
24
+            (
25
+                'id'  => 'primary'
26
+            )
27
+        )
28
+    ),
29
+
30
+    // List
31
+    'list' => array
32
+    (
33
+        'sorting' => array
34
+        (
35
+            'mode'                    => DataContainer::MODE_SORTED,
36
+            'fields'                  => array('title'),
37
+            'flag'                    => DataContainer::SORT_INITIAL_LETTER_ASC,
38
+            'panelLayout'             => 'limit'
39
+        ),
40
+        'label' => array(
41
+            'fields'                  => array('title'),
42
+            'format'                  => '%s'
43
+        ),
44
+        'global_operations' => array
45
+        (
46
+            'back' => array
47
+            (
48
+                'href'                => 'table=tl_vr_wa_standort',
49
+                'class'               => 'header_back',
50
+            ),
51
+            'all' => array
52
+            (
53
+                'href'                => 'act=select',
54
+                'class'               => 'header_edit_all',
55
+                'attributes'          => 'onclick="Backend.getScrollOffset()" accesskey="e"'
56
+            )
57
+        ),
58
+        'operations' => array
59
+        (
60
+            'edit' => array
61
+            (
62
+                'href'                => 'act=edit',
63
+                'icon'                => 'edit.gif',
64
+            ),
65
+            'copy' => array
66
+            (
67
+                'href'                => 'act=paste&amp;mode=copy',
68
+                'icon'                => 'copy.svg'
69
+            ),
70
+            'cut' => array
71
+            (
72
+                'href'                => 'act=paste&amp;mode=cut',
73
+                'icon'                => 'cut.svg',
74
+                'attributes'          => 'onclick="Backend.getScrollOffset()"'
75
+            ),
76
+            'delete' => array
77
+            (
78
+                'href'                => 'act=delete',
79
+                'icon'                => 'delete.gif',
80
+            ),
81
+            'show' => array
82
+            (
83
+                'icon'                => 'show.gif',
84
+            ),
85
+        )
86
+    ),
87
+
88
+    // Palettes
89
+    'palettes' => array
90
+    (
91
+        'default' => '{title_legend},title'
92
+    ),
93
+
94
+    // Subpalettes
95
+    'subpalettes' => array
96
+    (
97
+    ),
98
+
99
+    // Fields
100
+    'fields' => array
101
+    (
102
+        'id' => array
103
+        (
104
+            'sql'                     => "int(10) unsigned NOT NULL auto_increment"
105
+        ),
106
+        'tstamp' => array
107
+        (
108
+            'sql'                     => "int(10) unsigned NOT NULL default 0"
109
+        ),
110
+        'title' => array
111
+        (
112
+            'exclude'                 => true,
113
+            'sorting'                 => true,
114
+            'flag'                    => DataContainer::SORT_INITIAL_LETTER_ASC,
115
+            'inputType'               => 'text',
116
+            'eval'                    => array
117
+            (
118
+                'mandatory' => true,
119
+                'maxlength' => 255
120
+            ),
121
+            'sql'                     => "varchar(255) NOT NULL default ''"
122
+        )
123
+    )
124
+);
... ...
@@ -56,7 +56,7 @@ $GLOBALS['TL_DCA']['tl_vr_wa_reservation'] = array
56 56
         'sorten'       => array
57 57
         (
58 58
             'foreignKey'   => 'tl_vr_wa_rebsorte.title',
59
-            'eval'  => array('multiple'=>true, 'csv'=>','),
59
+            'eval'  => array('multiple'=>true, 'csv'=>';'),
60 60
             'sql'       => "blob NULL",
61 61
             'relation'   => array('type' => 'hasMany', 'load' => 'lazy')
62 62
         ),
... ...
@@ -89,7 +89,7 @@ $GLOBALS['TL_DCA']['tl_vr_wa_slot'] = array
89 89
     'palettes' => array
90 90
     (
91 91
         '__selector__' => array('addEnclosure'),
92
-        'default' => '{time_legend},date,time;{type_legend},behaelter,leseart,sorte;{info_legend},anmerkungen,addEnclosure;{booking_legend},buchbar,buchbar_bis'
92
+        'default' => '{time_legend},date,time;{type_legend},behaelter,sorten;{info_legend},anmerkungen,addEnclosure;{booking_legend},buchbar,buchbar_bis'
93 93
     ),
94 94
 
95 95
     // Subpalettes
... ...
@@ -149,23 +149,32 @@ $GLOBALS['TL_DCA']['tl_vr_wa_slot'] = array
149 149
             'eval'      => array('rgxp' => 'natural', 'mandatory' => true, 'includeBlankOption' => true, 'tl_class' => 'w50'),
150 150
             'sql'       => "smallint(3) unsigned NOT NULL default 0"
151 151
         ),
152
-        'leseart'     => array
152
+        'sorten'       => array
153 153
         (
154 154
             'exclude'   => true,
155
-            'inputType' => 'select',
156
-            'options'   => [],
157
-            'reference' => &$GLOBALS['TL_LANG']['MSC']['leseart'],
158
-            'eval'      => array('rgxp' => 'natural', 'mandatory' => false, 'includeBlankOption' => true, 'tl_class' => 'clr w50'),
159
-            'sql'       => "varchar(32) NOT NULL default ''"
160
-        ),
161
-        'sorte'       => array
162
-        (
163
-            'exclude'   => true,
164
-            'inputType' => 'select',
165
-            'foreignKey'   => 'tl_vr_wa_rebsorte.title',
166
-            'eval'      => array('rgxp' => 'natural', 'mandatory' => false, 'multiple'=>true,'chosen'=>true,'includeBlankOption' => true, 'tl_class' => 'w50','csv'=>','),
155
+            'inputType' => 'multiColumnWizard',
156
+            'eval'      => array(
157
+                'minCount' => 1,
158
+                'tl_class' => 'clr',
159
+                'columnFields' => array
160
+                (
161
+                    'sorte' => array
162
+                    (
163
+                        'label' => $GLOBALS['TL_LANG']['MSC']['wa_sorte'],
164
+                        'inputType' => 'select',
165
+                        'foreignKey'   => 'tl_vr_wa_rebsorte.title',
166
+                        'eval' => array('style' => 'width:350px','mandatory' => true,'chosen'=>true,'includeBlankOption' => true)
167
+                    ),
168
+                    'leseart' => array
169
+                    (
170
+                        'label' => $GLOBALS['TL_LANG']['MSC']['wa_leseart'],
171
+                        'inputType' => 'select',
172
+                        'foreignKey'   => 'tl_vr_wa_leseart.title',
173
+                        'eval' => array('style' => 'width:350px','mandatory' => true,'chosen'=>true,'includeBlankOption' => true)
174
+                    )
175
+                )
176
+            ),
167 177
             'sql'       => "blob NULL",
168
-            'relation'   => array('type' => 'hasMany', 'load' => 'lazy')
169 178
         ),
170 179
         'anmerkungen' => array
171 180
         (
... ...
@@ -49,6 +49,11 @@ $GLOBALS['TL_DCA']['tl_vr_wa_standort'] = array
49 49
                 'href'                => 'table=tl_vr_wa_rebsorte',
50 50
                 'class'               => 'header_rebsorte',
51 51
             ),
52
+            'leseart' => array
53
+            (
54
+                'href'                => 'table=tl_vr_wa_leseart',
55
+                'class'               => 'header_leseart',
56
+            ),
52 57
             'all' => array
53 58
             (
54 59
                 'href'                => 'act=select',
55 60
new file mode 100644
... ...
@@ -0,0 +1,12 @@
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']['MSC']['wa_sorte'] = 'Rebsorte';
12
+$GLOBALS['TL_LANG']['MSC']['wa_leseart'] = 'Leseart';
... ...
@@ -14,6 +14,7 @@ use vonRotenberg\WeinanlieferungBundle\Controller\Frontend\Module\Weinanlieferun
14 14
 $GLOBALS['TL_LANG']['MOD']['weinanlieferung'][0] = 'Weinanlieferung';
15 15
 $GLOBALS['TL_LANG']['MOD']['weinanlieferung'][1] = 'Buchungstool zur Weinanlieferung';
16 16
 $GLOBALS['TL_LANG']['MOD']['tl_vr_wa_rebsorte'] = 'Rebsorten';
17
+$GLOBALS['TL_LANG']['MOD']['tl_vr_wa_leseart'] = 'Leseart';
17 18
 $GLOBALS['TL_LANG']['MOD']['tl_vr_wa_slot'] = 'Zeitslots';
18 19
 
19 20
 $GLOBALS['TL_LANG']['FMD'][WeinanlieferungSlotsListModuleController::TYPE][0] = 'Weinanlieferung-Zeitslotliste';
... ...
@@ -16,8 +16,8 @@ $GLOBALS['TL_LANG']['tl_vr_wa_slot']['behaelter'][0] = 'Behälter';
16 16
 $GLOBALS['TL_LANG']['tl_vr_wa_slot']['behaelter'][1] = 'Anzahl der Behälter, die verarbeitet werden können.';
17 17
 $GLOBALS['TL_LANG']['tl_vr_wa_slot']['leseart'][0] = 'Leseart';
18 18
 $GLOBALS['TL_LANG']['tl_vr_wa_slot']['leseart'][1] = 'Die verwendete Leseart.';
19
-$GLOBALS['TL_LANG']['tl_vr_wa_slot']['sorte'][0] = 'Rebsorten';
20
-$GLOBALS['TL_LANG']['tl_vr_wa_slot']['sorte'][1] = 'Die Rebsorten, die in diesem Zeitslot verarbeitet werden.';
19
+$GLOBALS['TL_LANG']['tl_vr_wa_slot']['sorten'][0] = 'Rebsorten';
20
+$GLOBALS['TL_LANG']['tl_vr_wa_slot']['sorten'][1] = 'Die Rebsorten, die in diesem Zeitslot verarbeitet werden.';
21 21
 $GLOBALS['TL_LANG']['tl_vr_wa_slot']['anmerkungen'][0] = 'Anmerkungen';
22 22
 $GLOBALS['TL_LANG']['tl_vr_wa_slot']['anmerkungen'][1] = 'Ergänzende Hinweise zu diesem Zeitslot.';
23 23
 $GLOBALS['TL_LANG']['tl_vr_wa_slot']['addEnclosure'][0] = 'Anhänge';
... ...
@@ -14,3 +14,4 @@ $GLOBALS['TL_LANG']['tl_vr_wa_standort']['title'][1] = 'Der Name des Anlieferung
14 14
 $GLOBALS['TL_LANG']['tl_vr_wa_standort']['title_legend'] = 'Standort';
15 15
 
16 16
 $GLOBALS['TL_LANG']['tl_vr_wa_standort']['rebsorte'] = 'Rebsorten';
17
+$GLOBALS['TL_LANG']['tl_vr_wa_standort']['leseart'] = 'Leseart';
... ...
@@ -27,7 +27,6 @@
27 27
         <div class="divider m-0 mb-2"></div>
28 28
 
29 29
         <div class="frame__body">
30
-
31 30
             <h3>Reservierung ändern</h3>
32 31
             <form hx-post="/_ajax/vr_wa/v1/slot?do=updateReservation">
33 32
                 <input type="hidden" name="id" value="{{ id }}">
... ...
@@ -23,7 +23,7 @@
23 23
                                     </div>
24 24
                                     <div class="col u-text-right action">
25 25
                                         <a hx-get="/_ajax/vr_wa/v1/slot?do=booking&id={{ booking.id }}" hx-target="body" hx-swap="beforeend" href="javascript:;" class="btn btn--xs m-0">Anzeigen</a>
26
-                                        <a hx-get="/_ajax/vr_wa/v1/slot?do=delete&id={{ booking.id }}" hx-target="body" hx-swap="beforeend" href="javascript:;" class="btn btn--xs btn-danger m-0">Löschen</a>
26
+                                        <a hx-get="/_ajax/vr_wa/v1/slot?do=delete&id={{ booking.id }}" hx-target="body" hx-swap="beforeend" hx-confirm="Sind Sie sicher, dass Sie diese Reservierung löschen möchten?" href="javascript:;" class="btn btn--xs btn-danger m-0">Löschen</a>
27 27
                                     </div>
28 28
                                 </div>
29 29
                             {% endfor %}
... ...
@@ -1,4 +1,5 @@
1
-.header_rebsorte {
1
+.header_rebsorte,
2
+.header_leseart {
2 3
   padding:3px 0 3px 21px;
3 4
   background-position:left center;
4 5
   background-repeat:no-repeat;
... ...
@@ -7,3 +8,6 @@
7 8
 .header_rebsorte {
8 9
   background-image:url("/bundles/vonrotenbergweinanlieferung/images/icons/reben.svg");
9 10
 }
11
+.header_leseart {
12
+  background-image:url("/bundles/vonrotenbergweinanlieferung/images/icons/schere.svg");
13
+}
... ...
@@ -1 +1 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="16px" height="16px" viewBox="0 0 600 600" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><g><path d="M128.043,160.998c21.826,3.314 36.857,23.724 33.543,45.551c-3.314,21.827 -23.724,36.857 -45.551,33.543c-21.826,-3.313 -36.856,-23.724 -33.543,-45.551c3.314,-21.826 23.724,-36.856 45.551,-33.543Z" style="fill:#462592;"/><path d="M129.244,153.089c26.191,3.976 44.228,28.469 40.251,54.661c-3.976,26.192 -28.469,44.228 -54.66,40.251c-26.192,-3.976 -44.228,-28.468 -40.252,-54.66c3.976,-26.192 28.469,-44.228 54.661,-40.252Z" style="fill:#462592;"/><path d="M173.554,260.962c26.192,3.976 44.228,28.469 40.252,54.661c-3.976,26.191 -28.469,44.228 -54.661,40.251c-26.191,-3.976 -44.228,-28.469 -40.251,-54.66c3.976,-26.192 28.469,-44.228 54.66,-40.252Z" style="fill:#462592;"/><path d="M217.865,368.835c26.192,3.976 44.228,28.469 40.252,54.66c-3.976,26.192 -28.469,44.228 -54.661,40.252c-26.191,-3.976 -44.228,-28.469 -40.251,-54.661c3.976,-26.191 28.469,-44.228 54.66,-40.251Z" style="fill:#462592;"/><path d="M336.506,386.846c26.192,3.976 44.228,28.469 40.252,54.661c-3.977,26.192 -28.469,44.228 -54.661,40.251c-26.192,-3.976 -44.228,-28.469 -40.252,-54.66c3.976,-26.192 28.469,-44.228 54.661,-40.252Z" style="fill:#462592;"/><path d="M262.176,476.707c26.192,3.977 44.228,28.469 40.252,54.661c-3.976,26.192 -28.469,44.228 -54.661,40.252c-26.192,-3.976 -44.228,-28.469 -40.252,-54.661c3.977,-26.192 28.469,-44.228 54.661,-40.252Z" style="fill:#462592;"/><path d="M247.884,171.1c26.192,3.977 44.228,28.469 40.252,54.661c-3.976,26.192 -28.469,44.228 -54.661,40.252c-26.192,-3.977 -44.228,-28.469 -40.252,-54.661c3.977,-26.192 28.469,-44.228 54.661,-40.252Z" style="fill:#462592;"/><path d="M292.195,278.973c26.192,3.976 44.228,28.469 40.252,54.661c-3.976,26.192 -28.469,44.228 -54.661,40.252c-26.192,-3.977 -44.228,-28.469 -40.252,-54.661c3.977,-26.192 28.469,-44.228 54.661,-40.252Z" style="fill:#462592;"/><path d="M410.836,296.984c26.192,3.977 44.228,28.469 40.251,54.661c-3.976,26.192 -28.469,44.228 -54.66,40.252c-26.192,-3.976 -44.228,-28.469 -40.252,-54.661c3.976,-26.192 28.469,-44.228 54.661,-40.252Z" style="fill:#462592;"/><path d="M366.525,189.112c26.192,3.976 44.228,28.469 40.252,54.66c-3.977,26.192 -28.469,44.228 -54.661,40.252c-26.192,-3.976 -44.228,-28.469 -40.252,-54.661c3.976,-26.191 28.469,-44.228 54.661,-40.251Z" style="fill:#462592;"/><path d="M485.165,207.123c26.192,3.976 44.228,28.469 40.252,54.661c-3.976,26.191 -28.469,44.228 -54.661,40.251c-26.191,-3.976 -44.228,-28.469 -40.251,-54.66c3.976,-26.192 28.469,-44.228 54.66,-40.252Z" style="fill:#462592;"/></g><path d="M301.146,167.049c0,-0 25.368,-112.94 68.42,-131.217l39.547,6.003c-0,0 -39.5,19.327 -88.762,128.129l-19.205,-2.915Z" style="fill:#259232;"/></g></svg>
2 1
\ No newline at end of file
2
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="16px" height="16px" viewBox="0 0 600 600" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><g><path d="M127.578,156.518c24.702,3.75 41.711,26.849 37.961,51.55c-3.75,24.701 -26.848,41.711 -51.55,37.961c-24.701,-3.75 -41.71,-26.849 -37.961,-51.55c3.75,-24.701 26.849,-41.711 51.55,-37.961Z" style="fill:#462592;"/><path d="M174.53,246.999c34.3,5.207 57.919,37.282 52.712,71.582c-5.207,34.3 -37.282,57.92 -71.582,52.712c-34.3,-5.207 -57.92,-37.282 -52.712,-71.581c5.207,-34.3 37.282,-57.92 71.582,-52.713Z" style="fill:#462592;"/><path d="M225.829,374.71c23.351,3.545 39.431,25.381 35.886,48.732c-3.545,23.351 -25.381,39.431 -48.732,35.886c-23.352,-3.545 -39.432,-25.381 -35.887,-48.732c3.545,-23.351 25.382,-39.431 48.733,-35.886Z" style="fill:#462592;"/><path d="M342.957,422.684c17.852,2.71 30.146,19.405 27.436,37.257c-2.711,17.853 -19.405,30.146 -37.257,27.436c-17.853,-2.71 -30.146,-19.405 -27.436,-37.257c2.71,-17.853 19.404,-30.146 37.257,-27.436Z" style="fill:#462592;"/><path d="M260.921,477.436c26.192,3.976 44.228,28.469 40.252,54.661c-3.977,26.191 -28.469,44.228 -54.661,40.251c-26.192,-3.976 -44.228,-28.469 -40.252,-54.661c3.977,-26.191 28.469,-44.228 54.661,-40.251Z" style="fill:#462592;"/><path d="M245.895,166.666c23.521,3.571 39.719,25.567 36.148,49.089c-3.571,23.522 -25.567,39.719 -49.089,36.148c-23.521,-3.571 -39.719,-25.567 -36.148,-49.088c3.571,-23.522 25.567,-39.72 49.089,-36.149Z" style="fill:#462592;"/><path d="M300.796,280.648c25.67,3.897 43.346,27.901 39.449,53.57c-3.897,25.67 -27.901,43.346 -53.57,39.449c-25.67,-3.897 -43.346,-27.901 -39.449,-53.57c3.897,-25.67 27.901,-43.346 53.57,-39.449Z" style="fill:#462592;"/><path d="M398.518,314.709c22.331,3.39 37.708,24.272 34.317,46.602c-3.39,22.33 -24.271,37.708 -46.601,34.317c-22.331,-3.39 -37.708,-24.271 -34.318,-46.601c3.391,-22.331 24.272,-37.708 46.602,-34.318Z" style="fill:#462592;"/><path d="M363.102,204.117c18.312,2.78 30.922,19.904 28.142,38.216c-2.78,18.312 -19.904,30.922 -38.216,28.142c-18.312,-2.78 -30.922,-19.904 -28.142,-38.216c2.78,-18.312 19.904,-30.922 38.216,-28.142Z" style="fill:#462592;"/><path d="M484.777,202.139c29.345,4.455 49.552,31.896 45.097,61.24c-4.455,29.345 -31.896,49.552 -61.24,45.097c-29.344,-4.455 -49.552,-31.896 -45.097,-61.24c4.455,-29.345 31.896,-49.552 61.24,-45.097Z" style="fill:#462592;"/></g><path d="M301.146,167.049c0,-0 25.368,-112.94 68.42,-131.217l39.547,6.003c-0,0 -39.5,19.327 -88.762,128.129l-19.205,-2.915Z" style="fill:#259232;"/></g></svg>
3 3
\ No newline at end of file
4 4
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="16px" height="16px" viewBox="0 0 600 600" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><path d="M339.851,268.552l-41.185,20.628l-15.669,-31.276l41.192,-20.641l15.662,31.289Z" style="fill:#585858;fill-rule:nonzero;"/><path d="M381.328,317.165l-0.994,-46.062l-34.982,0.765l0.997,46.051l34.979,-0.754Z" style="fill:#585858;fill-rule:nonzero;"/><path d="M434.823,17.328c36.356,21.909 37.361,83.346 6.034,135.316c-32.157,53.355 -86.977,79.343 -122.509,57.928l116.475,-193.244Z" style="fill:#3b3b3b;fill-rule:nonzero;"/><path d="M320.409,207.207c14.396,-23.864 45.395,-31.558 69.256,-17.173c23.872,14.388 31.558,45.394 17.17,69.266c-14.381,23.86 -45.382,31.545 -69.258,17.163c-23.866,-14.384 -31.552,-45.39 -17.168,-69.256Z" style="fill:#585858;fill-rule:nonzero;"/><path d="M62.816,411.922l40.125,47.985l194.647,-162.455c10.483,-5.437 15.577,-17.595 12.151,-28.912c-4.099,-13.509 -18.656,-20.754 -31.937,-16.009l-214.986,159.391Z" style="fill:#9f3330;fill-rule:nonzero;"/><path d="M346.134,582.672l-61.764,-10.361l53.321,-250.689c-0.089,-11.809 8.282,-21.991 19.894,-24.249c13.846,-2.693 27.059,6.803 29.068,20.768l-40.519,264.531Z" style="fill:#9f3330;fill-rule:nonzero;"/><path d="M489.563,50.321c121.816,73.42 -12.415,310.3 -151.998,226.176l52.122,-86.479c33.649,20.29 81.83,11.759 103.949,-33.404l8.312,-23.876c7.448,-34.427 -5.818,-63.6 -12.385,-82.417Z" style="fill:#585858;fill-rule:nonzero;"/><path d="M370.883,221.206c6.656,4.01 8.799,12.656 4.793,19.312c-4.01,6.653 -12.66,8.797 -19.313,4.787c-6.66,-4.014 -8.797,-12.657 -4.787,-19.313c4.015,-6.654 12.653,-8.798 19.307,-4.786Z" style="fill-rule:nonzero;"/></g></svg>
0 2
\ No newline at end of file
... ...
@@ -18,12 +18,15 @@ use Contao\CoreBundle\Framework\ContaoFramework;
18 18
 use Contao\CoreBundle\Security\Authentication\Token\TokenChecker;
19 19
 use Contao\FrontendUser;
20 20
 use Contao\Input;
21
+use Contao\StringUtil;
21 22
 use Contao\System;
22 23
 use Doctrine\DBAL\Connection;
23 24
 use Symfony\Component\HttpFoundation\Request;
24 25
 use Symfony\Component\HttpFoundation\Response;
25 26
 use Symfony\Component\Routing\Annotation\Route;
26 27
 use Symfony\Contracts\Translation\TranslatorInterface;
28
+use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungLeseartModel;
29
+use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungRebsorteModel;
27 30
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungReservationModel;
28 31
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungSlotsModel;
29 32
 
... ...
@@ -83,7 +86,6 @@ class SlotAjaxController extends AbstractController
83 86
         }
84 87
 
85 88
         return new Response('',500);
86
-        return new Response(null,203);
87 89
     }
88 90
 
89 91
     protected function renderDetails(bool $blnModal=true)
... ...
@@ -106,10 +108,18 @@ class SlotAjaxController extends AbstractController
106 108
             foreach ($Reservations as $reservation)
107 109
             {
108 110
                 $arrSortenBooked = [];
109
-                if (($Sorten = $reservation->getRelated('sorten')) !== null)
111
+                $SortenLeseart = explode(';',$reservation->sorten);
112
+                foreach($SortenLeseart as $sorteLeseart)
110 113
                 {
111
-                    $arrSortenBooked = $Sorten->fetchEach('title');
114
+                    list($sorte,$leseart) = explode(',',$sorteLeseart);
115
+                    $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte);
116
+                    $objLeseart = WeinanlieferungLeseartModel::findByPk($leseart);
117
+                    $arrSortenBooked[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null  ? $objSorte->title : '') . ' ' . ($objLeseart !== null  ? $objLeseart->title : '');
112 118
                 }
119
+                /*if (($Sorten = $reservation->getRelated('sorten')) !== null)
120
+                {
121
+                    $arrSortenBooked = $Sorten->fetchEach('title');
122
+                }*/
113 123
                 $arrReservations[] = array_merge($reservation->row(),[
114 124
                     'sorten' => $arrSortenBooked
115 125
                 ]);
... ...
@@ -118,10 +128,17 @@ class SlotAjaxController extends AbstractController
118 128
 
119 129
         // Build data
120 130
         $arrSorten = [];
121
-        if (($Sorten = $Slot->getRelated('sorte')) !== null)
131
+        $Sorten = StringUtil::deserialize($Slot->sorten,true);
132
+        foreach($Sorten as $sorte)
122 133
         {
123
-            $arrSorten = array_combine($Sorten->fetchEach('id'),$Sorten->fetchEach('title'));
134
+            $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte['sorte']);
135
+            $objLeseart = WeinanlieferungLeseartModel::findByPk($sorte['leseart']);
136
+            $arrSorten[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null  ? $objSorte->title : '') . ' ' . ($objLeseart !== null  ? $objLeseart->title : '');
124 137
         }
138
+        /*if (($Sorten = $Slot->getRelated('sorte')) !== null)
139
+        {
140
+            $arrSorten = array_combine($Sorten->fetchEach('id'),$Sorten->fetchEach('title'));
141
+        }*/
125 142
 
126 143
         $intAvailableBehaelter = $Slot->getAvailableBehaelter();
127 144
 
... ...
@@ -158,14 +175,21 @@ class SlotAjaxController extends AbstractController
158 175
         }
159 176
 
160 177
         $arrSortenAvailable = [];
161
-        if (($Sorten = $Slot->getRelated('sorte')) !== null)
178
+        $Sorten = StringUtil::deserialize($Slot->sorten,true);
179
+        foreach($Sorten as $sorte)
162 180
         {
163
-            $arrSortenAvailable = array_combine($Sorten->fetchEach('id'),$Sorten->fetchEach('title'));
181
+            $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte['sorte']);
182
+            $objLeseart = WeinanlieferungLeseartModel::findByPk($sorte['leseart']);
183
+            $arrSortenAvailable[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null  ? $objSorte->title : '') . ' ' . ($objLeseart !== null  ? $objLeseart->title : '');
164 184
         }
165 185
         $arrSortenBooked = [];
166
-        if (($Sorten = $Booking->getRelated('sorten')) !== null)
186
+        $SortenLeseart = explode(';',$Booking->sorten);
187
+        foreach($SortenLeseart as $sorteLeseart)
167 188
         {
168
-            $arrSortenBooked = array_combine($Sorten->fetchEach('id'),$Sorten->fetchEach('title'));
189
+            list($sorte,$leseart) = explode(',',$sorteLeseart);
190
+            $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte);
191
+            $objLeseart = WeinanlieferungLeseartModel::findByPk($leseart);
192
+            $arrSortenBooked[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null  ? $objSorte->title : '') . ' ' . ($objLeseart !== null  ? $objLeseart->title : '');
169 193
         }
170 194
 
171 195
         $intAvailableBehaelter = $Slot->getAvailableBehaelter();
... ...
@@ -203,7 +227,7 @@ class SlotAjaxController extends AbstractController
203 227
         {
204 228
             $arrSorten[] = Input::post('sorten');
205 229
         } else {
206
-            $arrSorten = implode(',', Input::post('sorten'));
230
+            $arrSorten = implode(';', Input::post('sorten'));
207 231
         }
208 232
 
209 233
         $Reservation = new WeinanlieferungReservationModel();
... ...
@@ -21,9 +21,11 @@ use Contao\Date;
21 21
 use Contao\FrontendUser;
22 22
 use Contao\ModuleModel;
23 23
 use Contao\StringUtil;
24
+use Contao\System;
24 25
 use Contao\Template;
25 26
 use Symfony\Component\HttpFoundation\Request;
26 27
 use Symfony\Component\HttpFoundation\Response;
28
+use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungLeseartModel;
27 29
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungRebsorteModel;
28 30
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungReservationModel;
29 31
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungSlotsModel;
... ...
@@ -58,9 +60,13 @@ class WeinanlieferungBookedListModuleController extends AbstractFrontendModuleCo
58 60
                     $day = new Date($Slot->date);
59 61
                     $arrSorten = [];
60 62
 
61
-                    if (($Sorten = $booking->getRelated('sorten')) !== null)
63
+                    $SortenLeseart = explode(';',$booking->sorten);
64
+                    foreach($SortenLeseart as $sorteLeseart)
62 65
                     {
63
-                        $arrSorten = $Sorten->fetchEach('title');
66
+                        list($sorte,$leseart) = explode(',',$sorteLeseart);
67
+                        $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte);
68
+                        $objLeseart = WeinanlieferungLeseartModel::findByPk($leseart);
69
+                        $arrSorten[$objSorte->id.','.$objLeseart->id] = ($objSorte !== null  ? $objSorte->title : '') . ' ' . ($objLeseart !== null  ? $objLeseart->title : '');
64 70
                     }
65 71
 
66 72
                     $arrData['days'][$day->dayBegin][] = array_merge($booking->row(), [
... ...
@@ -21,9 +21,11 @@ use Contao\Date;
21 21
 use Contao\FrontendUser;
22 22
 use Contao\ModuleModel;
23 23
 use Contao\StringUtil;
24
+use Contao\System;
24 25
 use Contao\Template;
25 26
 use Symfony\Component\HttpFoundation\Request;
26 27
 use Symfony\Component\HttpFoundation\Response;
28
+use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungLeseartModel;
27 29
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungRebsorteModel;
28 30
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungReservationModel;
29 31
 use vonRotenberg\WeinanlieferungBundle\Model\WeinanlieferungSlotsModel;
... ...
@@ -59,8 +61,9 @@ class WeinanlieferungSlotsListModuleController extends AbstractFrontendModuleCon
59 61
         if (!empty($_GET['filter_sorte']))
60 62
         {
61 63
             $arrData['filter']['sorte']['selected'] = $_GET['filter_sorte'];
62
-            $arrOptions['column'][] = 'FIND_IN_SET(?,sorte)';
63
-            $arrOptions['value'][] = $_GET['filter_sorte'];
64
+//            $arrOptions['column'][] = 'FIND_IN_SET(?,sorte)';
65
+            $arrOptions['column'][] = "REGEXP_LIKE(sorten,'\"sorte\";s:[0-9]+:\"" . intval($_GET['filter_sorte']) . "\"')";
66
+//            $arrOptions['value'][] = $_GET['filter_sorte'];
64 67
         }
65 68
         $arrData['filter']['kapazitaet']['options'] = range(1,30);
66 69
 
... ...
@@ -79,10 +82,17 @@ class WeinanlieferungSlotsListModuleController extends AbstractFrontendModuleCon
79 82
                 $arrSorten = [];
80 83
                 $intAvailableBehaelter = $slot->getAvailableBehaelter();
81 84
 
82
-                if (($Sorten = $slot->getRelated('sorte')) !== null)
85
+                $Sorten = StringUtil::deserialize($slot->sorten,true);
86
+                foreach($Sorten as $sorte)
83 87
                 {
84
-                    $arrSorten = $Sorten->fetchEach('title');
88
+                    $objSorte = WeinanlieferungRebsorteModel::findByPk($sorte['sorte']);
89
+                    $objLeseart = WeinanlieferungLeseartModel::findByPk($sorte['leseart']);
90
+                    $arrSorten[] = ($objSorte !== null  ? $objSorte->title : '') . ' ' . ($objLeseart !== null  ? $objLeseart->title : '');
85 91
                 }
92
+                /*if (($Sorten = $slot->getRelated('sorte')) !== null)
93
+                {
94
+                    $arrSorten = $Sorten->fetchEach('title');
95
+                }*/
86 96
 
87 97
                 $arrData['days'][$day->dayBegin][] = array_merge($slot->row(),[
88 98
                     'sorte' => $arrSorten,
89 99
new file mode 100644
... ...
@@ -0,0 +1,24 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
+
5
+/*
6
+ * This file is part of contao-weinanlieferung-bundle.
7
+ *
8
+ * (c) vonRotenberg
9
+ *
10
+ * @license commercial
11
+ */
12
+
13
+namespace vonRotenberg\WeinanlieferungBundle\Model;
14
+
15
+use Contao\Model;
16
+
17
+class WeinanlieferungLeseartModel extends Model
18
+{
19
+    /**
20
+     * Table name
21
+     * @var string
22
+     */
23
+    protected static $strTable = 'tl_vr_wa_leseart';
24
+}