2 Commit-ok 3438d24fb0 ... f9e8c98baf

Szerző SHA1 Üzenet Dátum
  ferrari f9e8c98baf calendar - fix visualizzazione "annulla lezione" 3 hete
  ferrari 5a2e1580f1 presence - controllo ora fine corso 3 hete

+ 2 - 1
app/Http/Livewire/Presence.php

@@ -282,6 +282,7 @@ class Presence extends Component
             $d = $days[$dow];
 
             $h = date('H:i', strtotime($this->calendar->from));
+            $h_to = date('H:i', strtotime($this->calendar->to));
 
             // Elenco corsi per tipologia in base al calendario
             $courses = \App\Models\Course::where('name', $this->calendar->name)->where('date_from', '<=', $this->calendar->from)->where('date_to', '>=', $this->calendar->to)->pluck('id')->toArray();
@@ -299,7 +300,7 @@ class Presence extends Component
 
             // $members_courses = \App\Models\MemberCourse::whereRaw("JSON_CONTAINS(`when`, JSON_OBJECT('day', JSON_ARRAY(?), 'from', ?), '$')", [$d, $h])->where('months', 'like', '%"m":' . $months . ',%')->whereIn('course_id', $courses)->pluck('member_id')->toArray();
             $members_courses = \App\Models\MemberCourse::query()
-                ->whereRaw("JSON_CONTAINS(`when`, JSON_OBJECT('day', JSON_ARRAY(?), 'from', ?), '$')", [$d, $h])
+                ->whereRaw("JSON_CONTAINS(`when`, JSON_OBJECT('day', JSON_ARRAY(?), 'from', ?, 'to', ?), '$')", [$d, $h, $h_to])
                 ->whereRaw("JSON_CONTAINS(months, JSON_OBJECT('m', CAST(? AS UNSIGNED)), '$')", [$months])
                 ->whereRaw("NOT JSON_CONTAINS(months, JSON_OBJECT('m', CAST(? AS UNSIGNED), 'status', 2), '$')", [$months])
                 ->whereRaw("NOT JSON_CONTAINS(months, JSON_OBJECT('m', CAST(? AS UNSIGNED), 'status', '2'), '$')", [$months])

+ 9 - 0
resources/views/livewire/calendar.blade.php

@@ -323,6 +323,15 @@
             jQuery(".showDelete").show();
         }
 
+        function hideDelete() {
+            jQuery(".hideDelete").show();
+            jQuery(".showDelete").hide();
+        }
+
+        jQuery("#calendarModal").on("hidden.bs.modal", function () {
+            hideDelete();
+        });
+
         function pad(num, size) {
             num = num.toString();
             while (num.length < size) num = "0" + num;