diff --git a/modules/ddt/plugins/ddt.anagrafiche.php b/modules/ddt/plugins/ddt.anagrafiche.php index 2667350f4..c90e57dc9 100644 --- a/modules/ddt/plugins/ddt.anagrafiche.php +++ b/modules/ddt/plugins/ddt.anagrafiche.php @@ -40,7 +40,7 @@ if (!empty($rsddt)) { '.Modules::link('Ddt di vendita', $rsddt[$i]['idddt'], $rsddt[$i]['numero_esterno']).' - '.Translator::dateToLocale($rsddt[$i]['data']).' + '.(!empty($rsddt[$i]['data']) ? Translator::dateToLocale($rsddt[$i]['data']) : '').' '.$rsddt[$i]['descrizione'].' diff --git a/update/2_3.php b/update/2_3.php index 1db104e33..1c061e687 100644 --- a/update/2_3.php +++ b/update/2_3.php @@ -153,7 +153,8 @@ if(!empty($fk)){ $database->query("ALTER TABLE `in_interventi_tecnici` DROP FOREIGN KEY `in_interventi_tecnici_ibfk_1`"); } -$database->query("ALTER TABLE `in_interventi` CHANGE `idintervento` `codice` varchar(25) NOT NULL UNIQUE"); +$database->query("ALTER TABLE `in_interventi` DROP PRIMARY KEY, CHANGE `idintervento` `codice` varchar(25) NOT NULL UNIQUE, ADD PRIMARY KEY (`id`)"); +$database->query("DROP INDEX primary_key ON `in_interventi`"); // Fix dei timestamp delle tabelle mg_prodotti, mg_movimenti, zz_logs e zz_files $database->query('UPDATE `mg_prodotti` SET `created_at` = `data`, `updated_at` = `data`'); diff --git a/update/2_3.sql b/update/2_3.sql index deebec717..767773c1e 100644 --- a/update/2_3.sql +++ b/update/2_3.sql @@ -15,7 +15,9 @@ ALTER TABLE `zz_modules` CHANGE `module_dir` `directory` varchar(50) NOT NULL, C UPDATE `zz_modules` SET `name` = REPLACE(`name`, 'à', 'à'), `title` = REPLACE(`title`, 'à', 'à'); -- Adattamento della tabella in_interventi -ALTER TABLE `in_interventi` DROP PRIMARY KEY, ADD `id` int(11) NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`); +ALTER TABLE `in_interventi` ADD `id` int(11) NOT NULL; +CREATE INDEX primary_key ON `in_interventi` (`id`); +ALTER TABLE `in_interventi` CHANGE `id` `id` int(11) NOT NULL AUTO_INCREMENT FIRST; ALTER TABLE `my_impianti_interventi` DROP PRIMARY KEY;