1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-17 03:51:06 +01:00

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; break;
case 'delete-bulk': 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) { $_SESSION['infos'][] = tr('Ddt eliminati!');
$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)); }else{
$dbo->query('DELETE FROM mg_movimenti WHERE idddt='.prepare($id).Modules::getAdditionalsQuery($id_module)); $_SESSION['warnings'][] = tr('Procedura in fase di sviluppo. Nessuna modifica apportata.');
} }
$_SESSION['infos'][] = tr('Ddt eliminati!');
break; break;
} }

View File

@ -50,21 +50,26 @@ switch (post('op')) {
break; break;
case 'delete-bulk': 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) { $_SESSION['infos'][] = tr('Fatture eliminate!');
$dbo->query('DELETE FROM co_documenti WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module)); }else{
$dbo->query('DELETE FROM co_righe_documenti WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module)); $_SESSION['warnings'][] = tr('Procedura in fase di sviluppo. Nessuna modifica apportata.');
$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!');
break; break;
} }
return [ return [
'delete-bulk' => tr('Elimina selezionati'),
'delete-bulk' => tr('Elimina selezionati'),
'export-bulk' => [ 'export-bulk' => [
'text' => tr('Esporta stampe'), '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) -- Conversione numero co_documenti da int(11) a varchar(100)
ALTER TABLE `co_documenti` CHANGE `numero` `numero` VARCHAR(100) NOT NULL; 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 -- 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` = '1' WHERE `zz_group_module`.`id` = 2; UPDATE `zz_group_module` SET `enabled` = '0' WHERE `zz_group_module`.`id` = 2;