diff --git a/modules/dashboard/ajaxreq.php b/modules/dashboard/ajaxreq.php index ee3c91c60..45a3d1c6f 100644 --- a/modules/dashboard/ajaxreq.php +++ b/modules/dashboard/ajaxreq.php @@ -50,12 +50,13 @@ switch (get('op')) { break; case 'update_intervento': - $id = get('id'); + $sessione = get('id'); + $idintervento = get('idintervento'); $timeStart = get('timeStart'); $timeEnd = get('timeEnd'); //Aggiornamento prezzo totale - $q = 'SELECT in_interventi_tecnici.prezzo_ore_unitario, idtecnico, in_statiintervento.completato FROM in_interventi_tecnici INNER JOIN in_interventi ON in_interventi_tecnici.idintervento=in_interventi.id LEFT OUTER JOIN in_statiintervento ON in_interventi.idstatointervento = in_statiintervento.idstatointervento WHERE in_interventi.id='.prepare($id).' AND in_statiintervento.completato = 0 '.Modules::getAdditionalsQuery('Interventi'); + $q = 'SELECT in_interventi_tecnici.prezzo_ore_unitario, idtecnico, in_statiintervento.completato FROM in_interventi_tecnici INNER JOIN in_interventi ON in_interventi_tecnici.idintervento=in_interventi.id LEFT OUTER JOIN in_statiintervento ON in_interventi.idstatointervento = in_statiintervento.idstatointervento WHERE in_interventi.id='.prepare($idintervento).' AND in_statiintervento.completato = 0 '.Modules::getAdditionalsQuery('Interventi'); $rs = $dbo->fetchArray($q); $prezzo_ore = 0.00; @@ -69,7 +70,7 @@ switch (get('op')) { if (count($rs) > 0) { // Aggiornamento orario tecnico - $dbo->query('UPDATE in_interventi_tecnici SET orario_inizio = '.prepare($timeStart).', orario_fine = '.prepare($timeEnd).', ore='.prepare($t).', prezzo_ore_consuntivo='.prepare($t * $prezzo_ore_unitario).' WHERE id='.prepare($id)); + $dbo->query('UPDATE in_interventi_tecnici SET orario_inizio = '.prepare($timeStart).', orario_fine = '.prepare($timeEnd).', ore='.prepare($t).', prezzo_ore_consuntivo='.prepare($t * $prezzo_ore_unitario).' WHERE id='.prepare($sessione)); echo 'ok'; } else { echo tr('Attività completata, non è possibile modificarla!'); diff --git a/modules/dashboard/edit.php b/modules/dashboard/edit.php index 1b0981f29..a23f9fc0c 100644 --- a/modules/dashboard/edit.php +++ b/modules/dashboard/edit.php @@ -488,7 +488,7 @@ if (Modules::getPermission('Interventi') == 'rw') { editable: true, eventDrop: function(event,dayDelta,minuteDelta,revertFunc) { - $.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=update_intervento&id="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){ + $.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=update_intervento&id="+event.id+"&idintervento="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){ if( response=="success" ){ data = $.trim(data); if( data!="ok" ){ @@ -503,7 +503,7 @@ if (Modules::getPermission('Interventi') == 'rw') { }); }, eventResize: function(event,dayDelta,minuteDelta,revertFunc) { - $.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=update_intervento&id="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){ + $.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=update_intervento&id="+event.id+"&idintervento="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){ if( response=="success" ){ data = $.trim(data); if(data != "ok"){ @@ -527,7 +527,7 @@ if (Modules::getPermission('Interventi') == 'rw') { if (get_var('Utilizzare i tooltip sul calendario') == '1') { ?> - $.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=get_more_info&id="+event.id+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){ + $.get(globals.rootdir + "/modules/dashboard/ajaxreq.php?op=get_more_info&id="+event.idintervento+"&timeStart="+moment(event.start).format("YYYY-MM-DD HH:mm")+"&timeEnd="+moment(event.end).format("YYYY-MM-DD HH:mm"), function(data,response){ if( response=="success" ){ data = $.trim(data); if( data!="ok" ){ diff --git a/modules/utenti/edit.php b/modules/utenti/edit.php index 55f1928bc..0d4cdd530 100644 --- a/modules/utenti/edit.php +++ b/modules/utenti/edit.php @@ -17,7 +17,7 @@ echo '