From c87df50df860b90031a4732cee8a8b79c08b7135 Mon Sep 17 00:00:00 2001 From: loviuz Date: Tue, 6 Jun 2023 17:11:13 +0200 Subject: [PATCH 1/3] Fix su creazione ddt di completamento --- modules/ddt/buttons.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ddt/buttons.php b/modules/ddt/buttons.php index 25b516b80..ffdfd4c3d 100755 --- a/modules/ddt/buttons.php +++ b/modules/ddt/buttons.php @@ -50,7 +50,11 @@ function completaTrasporto() { confirmButtonText: "'.tr('Completa').'", }).then( function() { - location.href = globals.rootdir + "/editor.php?id_module='.$id_module.'&id_segment=" + $("select[name=id_segment]").val() + "&id_record='.$id_record.'&op=completa_trasporto&backto=record-edit"; + if ($("select[name=id_segment]").val() == null) { + swal( "'.tr('Attenzione').'", "'.tr('Devi prima selezionare un segmento').'...", "warning"); + } else { + location.href = globals.rootdir + "/editor.php?id_module='.$id_module.'&id_segment=" + $("select[name=id_segment]").val() + "&id_record='.$id_record.'&op=completa_trasporto&backto=record-edit"; + } }, function() {}, start_superselect(), From 298b29e6f3e186478f2bb03a549b7efc03dbdf6b Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Tue, 6 Jun 2023 17:12:51 +0200 Subject: [PATCH 2/3] Aggiunta vincolo fra ddt e righe ddt --- update/2_4_47.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 update/2_4_47.sql diff --git a/update/2_4_47.sql b/update/2_4_47.sql new file mode 100644 index 000000000..4ae2fdf36 --- /dev/null +++ b/update/2_4_47.sql @@ -0,0 +1,2 @@ +-- Aggiunta vincolo fra ddt e righe ddt +ALTER TABLE `dt_righe_ddt` ADD CONSTRAINT `dt_righe_ddt_ibfk_2` FOREIGN KEY (`idddt`) REFERENCES `dt_ddt`(`id`) ON DELETE CASCADE ON UPDATE RESTRICT; \ No newline at end of file From 144be6cbd752de2e488491372858da8cfb3dc4c5 Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Wed, 7 Jun 2023 15:23:19 +0200 Subject: [PATCH 3/3] Fix minore --- modules/contratti/variables.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/contratti/variables.php b/modules/contratti/variables.php index a2ecca39e..6379bcd00 100755 --- a/modules/contratti/variables.php +++ b/modules/contratti/variables.php @@ -18,23 +18,25 @@ */ $r = $dbo->fetchOne('SELECT *, + co_contratti.nome AS nome_contratto, an_anagrafiche.pec, IF((an_referenti.email IS NOT NULL AND an_referenti.email != ""), an_referenti.email, an_anagrafiche.email) AS email, an_anagrafiche.idanagrafica, - an_referenti.nome, + an_referenti.nome AS nome_referente, an_anagrafiche.ragione_sociale FROM co_contratti INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica - LEFT OUTER JOIN an_referenti ON an_referenti.id=co_contratti.idreferente + LEFT JOIN an_referenti ON an_referenti.id=co_contratti.idreferente WHERE co_contratti.id='.prepare($id_record)); // Variabili da sostituire return [ + 'nome' => $r['nome_contratto'], 'email' => $options['is_pec'] ? $r['pec'] : $r['email'], 'ragione_sociale' => $r['ragione_sociale'], 'numero' => $r['numero'], 'descrizione' => $r['descrizione'], 'data' => Translator::dateToLocale($r['data_bozza']), 'id_anagrafica' => $r['idanagrafica'], - 'nome_referente' => $r['nome'], + 'nome_referente' => $r['nome_referente'], ];