From d8c63a75e811f63a0e556b7a430fed60226ace3c Mon Sep 17 00:00:00 2001 From: Dasc3er Date: Mon, 15 Mar 2021 10:39:42 +0100 Subject: [PATCH] Correzione su utilizzo della sessione PHP --- core.php | 2 +- include/common/importa.php | 2 +- include/manager.php | 2 +- include/top.php | 2 +- .../src/Controlli/DatiFattureElettroniche.php | 4 +- modules/articoli/bulk.php | 2 +- modules/contratti/bulk.php | 4 +- modules/dashboard/edit.php | 38 ++++++++++--------- .../widgets/stampa_calendario.dashboard.php | 6 +-- modules/ddt/bulk.php | 4 +- modules/fatture/add.php | 2 +- modules/fatture/bulk.php | 2 +- modules/giacenze_sedi/controller_before.php | 6 +-- modules/interventi/bulk.php | 5 ++- modules/listini/bulk.php | 2 +- modules/ordini/bulk.php | 6 +-- modules/partitario/actions.php | 4 +- modules/partitario/edit.php | 2 +- modules/preventivi/bulk.php | 4 +- modules/segmenti/edit.php | 4 +- modules/stampe_contabili/edit.php | 4 +- modules/stampe_contabili/stampe_contabili.php | 4 +- plugins/importFE/generate.php | 2 +- .../crea_fattura.php | 2 +- plugins/receiptFE/src/MissingReceiptTask.php | 2 +- .../receiptFE/src/NotificheRicevuteHook.php | 4 +- src/Modules.php | 2 +- src/Util/Query.php | 4 +- templates/barcode/body.php | 6 +-- templates/bilancio/init.php | 4 +- templates/dashboard/body.php | 6 +-- templates/dashboard/settings.php | 4 +- templates/libro_giornale/init.php | 4 +- templates/liquidazione_iva/settings.php | 4 +- templates/magazzino_inventario/body.php | 2 +- templates/registro_iva/settings.php | 4 +- templates/riepilogo_interventi/init.php | 4 +- templates/scadenzario/init.php | 4 +- 38 files changed, 87 insertions(+), 82 deletions(-) diff --git a/core.php b/core.php index 3cd928219..b69fea9c1 100755 --- a/core.php +++ b/core.php @@ -197,7 +197,7 @@ if (!$api_request) { if (!empty($id_module)) { // Segmenti - if (!isset($_SESSION['module_'.$id_module]['id_segment'])) { + if (session('module_'.$id_module.'.id_segment') === null) { $segments = Modules::getSegments($id_module); session(['module_'.$id_module.'.id_segment' => isset($segments[0]['id']) ? $segments[0]['id'] : null]); } diff --git a/include/common/importa.php b/include/common/importa.php index 6cda4c53b..3d12c085c 100755 --- a/include/common/importa.php +++ b/include/common/importa.php @@ -85,7 +85,7 @@ if (!empty($options['create_document'])) { // Opzioni aggiuntive per le Fatture if (in_array($final_module['name'], ['Fatture di vendita', 'Fatture di acquisto'])) { - $id_segment = $_SESSION['module_'.$final_module['id']]['id_segment']; + $id_segment = session('module_'.$final_module['id'].'.id_segment'); $stato_predefinito = $database->fetchOne("SELECT id FROM co_statidocumento WHERE descrizione = 'Bozza'"); diff --git a/include/manager.php b/include/manager.php index d80b15d36..b9d8a4795 100755 --- a/include/manager.php +++ b/include/manager.php @@ -74,7 +74,7 @@ if (!empty($type) && $type != 'menu' && $type != 'custom') { echo '
- {[ "type": "select", "name": "id_segment_", "required": 0, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module = '.prepare($id_module).'", "value": "'.$_SESSION['module_'.$id_module]['id_segment'].'" ]} + {[ "type": "select", "name": "id_segment_", "required": 0, "values": "query=SELECT id, name AS descrizione FROM zz_segments WHERE id_module = '.prepare($id_module).'", "value": "'.session('module_'.$id_module.'.id_segment').'" ]}

'; diff --git a/include/top.php b/include/top.php index 82be2d273..b6f070afb 100755 --- a/include/top.php +++ b/include/top.php @@ -62,7 +62,7 @@ if (auth()->check()) {