Browse code

Update

Benjamin Roth authored on15/08/2023 18:18:52
Showing2 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 {% block content %}
2 2
     {% if modal %}<div class="modal-content">{% endif %}
3
-    <div id="wa-slot-{{ id }}" class="frame">
3
+    <div id="wa-booking-{{ id }}" class="frame">
4 4
         <div class="frame__header">
5 5
             <h3>Reservierung</h3>
6 6
             <div class="row">
... ...
@@ -79,13 +79,13 @@
79 79
             (function ($) {
80 80
 
81 81
                 window.modals = window.modals || []
82
-                window.modals.wa_slots = window.modals.wa_slots || []
82
+                window.modals.wa_bookings = window.modals.wa_bookings || []
83 83
 
84
-                if (window.modals.wa_slots.details{{ id }} === undefined)
84
+                if (window.modals.wa_bookings.details{{ id }} === undefined)
85 85
                 {
86
-                    window.modals.wa_slots.details{{ id }} = new jBox('Modal', {
86
+                    window.modals.wa_bookings.details{{ id }} = new jBox('Modal', {
87 87
                     closeButton: 'box',
88
-                    content: $('#wa-slot-{{ id }}'),
88
+                    content: $('#wa-booking-{{ id }}'),
89 89
                     maxWidth: 650,
90 90
                     minWidth: 100,
91 91
                     minHeight: 100,
... ...
@@ -96,8 +96,8 @@
96 96
                     addClass: ''
97 97
                 }).open();
98 98
                 } else {
99
-                    window.modals.wa_slots.details{{ id }}.content.empty();
100
-                    window.modals.wa_slots.details{{ id }}.setContent($('#wa-slot-{{ id }}')).open();
99
+                    window.modals.wa_bookings.details{{ id }}.content.empty();
100
+                    window.modals.wa_bookings.details{{ id }}.setContent($('#wa-booking-{{ id }}')).open();
101 101
                 }
102 102
 
103 103
             })(jQuery);
... ...
@@ -290,8 +290,11 @@ class SlotAjaxController extends AbstractController
290 290
                 return $this->renderDetails(false,'<div class="toast toast--danger mx-0">' . $File->getErrorAsHTML() . '</div>');
291 291
             }
292 292
 
293
-            $arrData['filename'] = $_SESSION['FILES'][$File->name]['name'] ?? '';
294
-            $arrData['upload'] = $_SESSION['FILES'][$File->name]['uuid'] ? StringUtil::uuidToBin($_SESSION['FILES'][$File->name]['uuid']) : null;
293
+            if (!empty($_SESSION['FILES'][$File->name]))
294
+            {
295
+                $arrData['filename'] = $_SESSION['FILES'][$File->name]['name'] ?? '';
296
+                $arrData['upload'] = $_SESSION['FILES'][$File->name]['uuid'] ? StringUtil::uuidToBin($_SESSION['FILES'][$File->name]['uuid']) : null;
297
+            }
295 298
         }
296 299
 
297 300
         if (empty($_REQUEST['id']) || empty(Input::post('behaelter')) || empty(Input::post('sorten')))
... ...
@@ -352,8 +355,11 @@ class SlotAjaxController extends AbstractController
352 355
                 return $this->renderDetails(false,'<div class="toast toast--danger mx-0">' . $File->getErrorAsHTML() . '</div>');
353 356
             }
354 357
 
355
-            $Reservation->filename = $_SESSION['FILES'][$File->name]['name'] ?? '';
356
-            $Reservation->upload = $_SESSION['FILES'][$File->name]['uuid'] ? StringUtil::uuidToBin($_SESSION['FILES'][$File->name]['uuid']) : null;
358
+            if (!empty($_SESSION['FILES'][$File->name]))
359
+            {
360
+                $Reservation->filename = $_SESSION['FILES'][$File->name]['name'] ?? '';
361
+                $Reservation->upload = $_SESSION['FILES'][$File->name]['uuid'] ? StringUtil::uuidToBin($_SESSION['FILES'][$File->name]['uuid']) : null;
362
+            }
357 363
         }
358 364
 
359 365
         $arrSorten = [];
... ...
@@ -361,7 +367,7 @@ class SlotAjaxController extends AbstractController
361 367
         {
362 368
             $arrSorten[] = Input::post('sorten');
363 369
         } else {
364
-            $arrSorten = implode(',', Input::post('sorten'));
370
+            $arrSorten = implode(';', Input::post('sorten'));
365 371
         }
366 372
 
367 373
         $Reservation->tstamp = time();