1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-23 05:54:03 +01:00

Aggiunti eventi in Dashboard

This commit is contained in:
Luca 2023-03-28 16:24:33 +02:00
parent 51dd56d2ea
commit e80e64eb37
3 changed files with 62 additions and 10 deletions

View File

@ -1223,6 +1223,4 @@ input[type="radio"] {
*/
.fc .fc-bg-event {
background: rgba(255, 49, 21, .5) !important;
}
}

View File

@ -468,4 +468,38 @@ switch (filter('op')) {
}
break;
case 'calendario_eventi':
$start = filter('start');
$end = filter('end');
$query = 'SELECT * FROM `zz_events` WHERE `zz_events`.`is_bank_holiday` = 1 AND `zz_events`.`data` >= '.prepare($start).' AND `zz_events`.`data` <= '.prepare($end);
$eventi = $dbo->fetchArray($query);
$results = [];
foreach ($eventi as $evento) {
$results[] = [
'id' => $evento['id'],
'title' => $evento['nome'],
'start' => $evento['data'],
'end' => date('Y-m-d', strtotime($evento['data']. '+1 day')),
//'initialDate' => $evento['data'],
//'startRecur' => (($evento['is_recurring']) ? $evento['data'] : ''),
//'endRecur' => (($evento['is_recurring']) ? date('Y-m-d', strtotime($evento['data']. '+1 day')) : ''),
'display' => "background",
'allDay' => true,
'overlap' => true,
];
}
echo json_encode($results);
break;
}

View File

@ -363,7 +363,7 @@ echo '
<script type="text/javascript">
var Draggable = FullCalendar.Draggable;
globals.dashboard = {
load_url: "'.$structure->fileurl('ajax.php').'?id_module='.$id_module.'",
load_url: "'.$structure->fileurl('ajax.php').'",
style: "'.$def.'",
show_sunday: '.intval(setting('Visualizzare la domenica sul calendario')).',
start_time: "'.setting('Ora inizio sul calendario').'",
@ -742,13 +742,33 @@ echo '
}
},
events: {
url: globals.dashboard.load_url + "&op=interventi_periodo",
type: "GET",
error: function () {
swal(globals.dashboard.genericError, globals.dashboard.error, "error");
eventSources: [
{
url: globals.dashboard.load_url,
type: "POST",
extraParams: {
op: "interventi_periodo",
id_module: "'.$id_module.'"
},
failure: function () {
swal(globals.dashboard.genericError, globals.dashboard.error, "error");
}
},
{
url: globals.dashboard.load_url,
method: "POST",
extraParams: {
op: "calendario_eventi",
id_module: "'.$id_module.'"
},
failure: function () {
swal(globals.dashboard.genericError, globals.dashboard.error, "error");
}
}
}
]
});
calendar.addEvent({