From b0d8d553a21f0c208162ad7df0198f256f7f74e2 Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Tue, 12 Sep 2017 18:18:27 +0200 Subject: [PATCH] Miglioramento della generazione del feed per la Dashboard --- modules/dashboard/ajaxreq.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/dashboard/ajaxreq.php b/modules/dashboard/ajaxreq.php index 45a3d1c6f..229297821 100644 --- a/modules/dashboard/ajaxreq.php +++ b/modules/dashboard/ajaxreq.php @@ -30,22 +30,22 @@ switch (get('op')) { $color = $rs[$i]['colore_tecnico']; } - $results[] = ' - { - "id": "'.$rs[$i]['id'].'", - "idintervento": "'.$rs[$i]['idintervento'].'", - "idtecnico":"'.$rs[$i]['idtecnico'].'", - "title":"Int. '.$rs[$i]['idintervento'].' '.addslashes($rs[$i]['cliente']).'
'.tr('Tecnici').': '.addslashes($rs[$i]['nome_tecnico']).'", - "start": "'.$rs[$i]['orario_inizio'].'", - "end": "'.$rs[$i]['orario_fine'].'", - "url":"'.$rootdir.'/editor.php?id_module='.Modules::getModule('Interventi')['id'].'&id_record='.$rs[$i]['idintervento'].'", - "backgroundColor":"'.$rs[$i]['colore'].'", - "textColor":"'.color_inverse($rs[$i]['colore']).'", - "borderColor":"'.$color.'", - "allDay": false - }'; + $results[] = [ + 'id' => $rs[$i]['id'], + 'idintervento' => $rs[$i]['idintervento'], + 'idtecnico' => $rs[$i]['idtecnico'], + 'title' => 'Int. '.$rs[$i]['idintervento'].' '.addslashes($rs[$i]['cliente']).'
'.tr('Tecnici').': '.addslashes($rs[$i]['nome_tecnico']), + 'start' => $rs[$i]['orario_inizio'], + 'end' => $rs[$i]['orario_fine'], + 'url' => $rootdir.'/editor.php?id_module='.Modules::getModule('Interventi')['id'].'&id_record='.$rs[$i]['idintervento'], + 'backgroundColor' => $rs[$i]['colore'], + 'textColor' => color_inverse($rs[$i]['colore']), + 'borderColor' => $color, + 'allDay' => false, + ]; } - echo '['.implode(',', $results).']'; + + echo json_encode($results); break;