From 93be92efdf85f4b5b9382985d458d4dffe4892e3 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 28 Mar 2023 11:57:23 +0200 Subject: [PATCH] Aggiunto in Dashboard sfondo rosso per giorni non lavorativi --- assets/src/css/style.css | 17 ++++++++++------- modules/dashboard/edit.php | 36 +++++++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/assets/src/css/style.css b/assets/src/css/style.css index 4c0b2f0b2..d9bd2b399 100755 --- a/assets/src/css/style.css +++ b/assets/src/css/style.css @@ -1119,12 +1119,6 @@ div.tip { opacity: 0.5; } -/* Stile Fullcalendar per weekend */ -.fc-day-sat, -.fc-day-sun { - background-color: rgba(255,49,21,.3) !important; -} - .login-box .img-responsive { padding: 18px 0px 4px; } @@ -1222,4 +1216,13 @@ input[type="radio"] { .widget-user .widget-user-image>img { -webkit-box-shadow: -10px 0px 13px -7px #000000, 10px 0px 13px -7px #000000, 5px 5px 15px 5px rgba(0, 0, 0, 0); box-shadow: -10px 0px 13px -7px #000000, 10px 0px 13px -7px #000000, 5px 5px 15px 5px rgba(0, 0, 0, 0); -} \ No newline at end of file +} + +/* +* Colore eventi fullcalendar +*/ +.fc .fc-bg-event { + background: rgba(255, 49, 21, .5) !important; +} + + diff --git a/modules/dashboard/edit.php b/modules/dashboard/edit.php index bbcd635b4..187ba4d75 100755 --- a/modules/dashboard/edit.php +++ b/modules/dashboard/edit.php @@ -339,6 +339,24 @@ if ($vista == 'mese') { $def = 'listWeek'; } +$days = [ + 1 => 'Lunedì', + 2 => 'Martedì', + 3 => 'Mercoledì', + 4 => 'Giovedì', + 5 => 'Venerdì', + 6 => 'Sabato', + 0 => 'Domenica' +]; +$working_days = explode(",",setting('Giorni lavorativi')); +$non_working_days = []; + +foreach ($days as $key => $day) { + if (!in_array($day, $working_days)) { + array_push($non_working_days, $key); + } +} + $modulo_interventi = Modules::get('Interventi'); echo ' @@ -687,10 +705,10 @@ echo ' eventDidMount: function(info){ let element = $(info.el); - + let id_record = info.event.extendedProps.idintervento; - if (globals.dashboard.tooltip == 1) { + if (globals.dashboard.tooltip == 1 && element[0].childElementCount > 0 ) { element.tooltipster({ content: globals.translations.loading + "...", animation: "grow", @@ -713,9 +731,10 @@ echo ' id_record: id_record, allDay: info.event.allDay, }, function (data, response) { - instance.content(data); - - $origin.data("loaded", true); + if (data !== "") { + instance.content(data); + $origin.data("loaded", true); + } }); } } @@ -732,6 +751,13 @@ echo ' } }); + calendar.addEvent({ + daysOfWeek: "'.implode(',', $non_working_days).'", + display: "background", + overlap: true, + allDay: true + }); + calendar.render(); globals.dashboard.calendar = calendar;