Controllo per cancellazione bulk

This commit is contained in:
Luca 2018-03-22 15:58:13 +01:00
parent 4dafc5f029
commit aea256a6ca
3 changed files with 30 additions and 19 deletions

View File

@ -145,14 +145,20 @@ switch (post('op')) {
break;
case 'delete-bulk':
if ($debug){
foreach ($id_records as $id) {
$dbo->query('DELETE FROM dt_ddt WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM dt_righe_ddt WHERE idddt='.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM mg_movimenti WHERE idddt='.prepare($id).Modules::getAdditionalsQuery($id_module));
}
foreach ($id_records as $id) {
$dbo->query('DELETE FROM dt_ddt WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM dt_righe_ddt WHERE idddt='.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM mg_movimenti WHERE idddt='.prepare($id).Modules::getAdditionalsQuery($id_module));
}
$_SESSION['infos'][] = tr('Ddt eliminati!');
$_SESSION['infos'][] = tr('Ddt eliminati!');
}else{
$_SESSION['warnings'][] = tr('Procedura in fase di sviluppo. Nessuna modifica apportata.');
}
break;
}

View File

@ -50,21 +50,26 @@ switch (post('op')) {
break;
case 'delete-bulk':
if ($debug){
foreach ($id_records as $id) {
$dbo->query('DELETE FROM co_documenti WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM co_righe_documenti WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM co_scadenziario WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM mg_movimenti WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
}
foreach ($id_records as $id) {
$dbo->query('DELETE FROM co_documenti WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM co_righe_documenti WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM co_scadenziario WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
$dbo->query('DELETE FROM mg_movimenti WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
}
$_SESSION['infos'][] = tr('Fatture eliminate!');
$_SESSION['infos'][] = tr('Fatture eliminate!');
}else{
$_SESSION['warnings'][] = tr('Procedura in fase di sviluppo. Nessuna modifica apportata.');
}
break;
}
return [
'delete-bulk' => tr('Elimina selezionati'),
'delete-bulk' => tr('Elimina selezionati'),
'export-bulk' => [
'text' => tr('Esporta stampe'),

View File

@ -289,5 +289,5 @@ DELETE FROM `zz_settings` WHERE `zz_settings`.`nome` = 'Destinatario fisso in co
-- Conversione numero co_documenti da int(11) a varchar(100)
ALTER TABLE `co_documenti` CHANGE `numero` `numero` VARCHAR(100) NOT NULL;
-- Disabilito di default filtro tecnici che vedono solo le anagrafiche per i quali hanno eseguito un intervento
UPDATE `zz_group_module` SET `enabled` = '1' WHERE `zz_group_module`.`id` = 2;
-- Disabilito di default filtro tecnici che altrimento vedono solo le anagrafiche per i quali hanno eseguito un intervento (issue #190)
UPDATE `zz_group_module` SET `enabled` = '0' WHERE `zz_group_module`.`id` = 2;