From af7cf059a0614ee533e6c04ae66876fecf42cbb2 Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Thu, 21 Mar 2024 10:36:23 +0100 Subject: [PATCH] Aggiunti record per lingua inglese --- update/2_5.php | 57 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/update/2_5.php b/update/2_5.php index 8d8d47432..61bd123fd 100644 --- a/update/2_5.php +++ b/update/2_5.php @@ -42,4 +42,59 @@ if ($backup_dir){ } }else{ echo "Impossibile completare l'aggiornamento. Variabile $backup_dir non impostata.\n"; -} \ No newline at end of file +} + +$tables = [ + 'an_provenienze_lang', + 'an_relazioni_lang', + 'an_settori_lang', + 'an_tipianagrafiche_lang', + 'co_iva_lang', + 'co_pagamenti_lang', + 'co_staticontratti_lang', + 'co_statidocumento_lang', + 'co_statipreventivi_lang', + 'co_tipidocumento_lang', + 'co_tipi_scadenze_lang', + 'do_categorie_lang', + 'dt_aspettobeni_lang', + 'dt_causalet_lang', + 'dt_porto_lang', + 'dt_spedizione_lang', + 'dt_statiddt_lang', + 'dt_tipiddt_lang', + 'em_lists_lang', + 'em_templates_lang', + 'in_fasceorarie_lang', + 'in_statiintervento_lang', + 'in_tipiintervento_lang', + 'mg_articoli_lang', + 'mg_attributi_lang', + 'mg_categorie_lang', + 'mg_causali_movimenti_lang', + 'mg_combinazioni_lang', + 'or_statiordine_lang', + 'or_tipiordine_lang', + 'zz_cache_lang', + 'zz_currencies_lang', + 'zz_groups_lang', + 'zz_group_module_lang', + 'zz_hooks_lang', + 'zz_imports_lang', + 'zz_modules_lang', + 'zz_plugins_lang', + 'zz_prints_lang', + 'zz_segments_lang', + 'zz_settings_lang', + 'zz_tasks_lang', + 'zz_views_lang', + 'zz_widgets_lang', +]; + +foreach ($tables as $table) { + $database->query('CREATE TEMPORARY TABLE `tmp` SELECT * FROM '.$table); + $database->query('ALTER TABLE `tmp` DROP `id`'); + $database->query('UPDATE `tmp` SET `id_lang` = 2'); + $database->query('INSERT INTO '.$table.' SELECT NULL,tmp. * FROM tmp'); + $database->query('DROP TEMPORARY TABLE tmp'); +}