From d918c1e763092af1d2ec20e175c447dc5a75cf02 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 7 Feb 2022 13:36:31 +0100 Subject: [PATCH 1/5] Avviso requisito minimo php 7.4 --- core.php | 2 +- include/init/requirements.php | 26 +++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/core.php b/core.php index c22580eda..cced4a696 100755 --- a/core.php +++ b/core.php @@ -24,7 +24,7 @@ header_remove('X-Powered-By'); date_default_timezone_set('Europe/Rome'); // Controllo sulla versione PHP -$minimum = '7.1.0'; +$minimum = '7.2.0'; if (version_compare(phpversion(), $minimum) < 0) { echo '

Stai utilizzando la versione PHP '.phpversion().', non compatibile con OpenSTAManager.

diff --git a/include/init/requirements.php b/include/init/requirements.php index 43a22cf30..665c4964a 100755 --- a/include/init/requirements.php +++ b/include/init/requirements.php @@ -43,8 +43,16 @@ foreach ($modules as $name => $values) { ]; } -// PHP +//PHP $settings = [ + + 'php_version' => [ + 'type' => 'php', + 'description' => '7.4 - 8.0', + 'minimum' => '7.4', + 'maximum' => '8.0', + ], + 'zip' => [ 'type' => 'ext', 'description' => tr('Permette di leggere e scrivere gli archivi compressi ZIP e i file al loro interno'), @@ -98,13 +106,23 @@ $settings = [ 'type' => 'value', 'description' => '>32M', ], + ]; $php = []; foreach ($settings as $name => $values) { $description = $values['description']; - if ($values['type'] == 'ext') { + if ($values['type'] == 'php') { + + $description = tr('Valore consigliato: _VALUE_ (Valore attuale: _PHP_VERSION_)', [ + '_VALUE_' => $description, + '_PHP_VERSION_' => phpversion(), + ]); + + $status = (version_compare(phpversion(), $values['minimum']) < 0 || (version_compare(phpversion(), $values['maximum']) > 0) ? 0 : 1); + + } elseif ($values['type'] == 'ext') { $status = extension_loaded($name); } else { $ini = str_replace(['k', 'M'], ['000', '000000'], ini_get($name)); @@ -161,12 +179,14 @@ foreach ($dirs as $name => $description) { $requirements = [ tr('Apache') => $apache, - tr('PHP (_VERSION_)', [ + tr('PHP (_VERSION_ _SUPPORTED_)', [ '_VERSION_' => phpversion(), + '_SUPPORTED_' => (version_compare(phpversion(), $settings['php_version']['minimum']) < 0 || (version_compare(phpversion(), $settings['php_version']['maximum']) > 0) ? ' '.tr('versioni supportate:').' '.$settings['php_version']['minimum'].' - '.$settings['php_version']['maximum'].'' : '' ) ]) => $php, tr('Percorsi di servizio') => $directories, ]; + // Tabelle di riepilogo foreach ($requirements as $key => $values) { $statuses = array_column($values, 'status'); From 37889fa277183f1b42b1a14faf3b38bb21fe4bd6 Mon Sep 17 00:00:00 2001 From: Marco Antonio Mauro Date: Mon, 7 Feb 2022 14:19:09 +0100 Subject: [PATCH 2/5] Risolta issue #1014 --- modules/tipi_intervento/actions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/tipi_intervento/actions.php b/modules/tipi_intervento/actions.php index 1093cfade..15ce287c5 100755 --- a/modules/tipi_intervento/actions.php +++ b/modules/tipi_intervento/actions.php @@ -42,13 +42,12 @@ switch (post('op')) { case 'add': $codice = post('codice'); - $tipo->calcola_km = post('calcola_km'); $descrizione = post('descrizione'); $tipo = Tipo::build($codice, $descrizione); $tipo->tempo_standard = post('tempo_standard'); - + $tipo->calcola_km = post('calcola_km'); $tipo->costo_orario = post('costo_orario'); $tipo->costo_km = post('costo_km'); $tipo->costo_diritto_chiamata = post('costo_diritto_chiamata'); From 0440d6cc779ba192a555e4d3c17031b885988e6c Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 7 Feb 2022 14:41:06 +0100 Subject: [PATCH 3/5] Aggiunto controllo MySQL per i requisiti --- include/init/requirements.php | 53 ++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/include/init/requirements.php b/include/init/requirements.php index 665c4964a..d0a2ce0cc 100755 --- a/include/init/requirements.php +++ b/include/init/requirements.php @@ -47,10 +47,10 @@ foreach ($modules as $name => $values) { $settings = [ 'php_version' => [ - 'type' => 'php', - 'description' => '7.4 - 8.0', - 'minimum' => '7.4', - 'maximum' => '8.0', + 'type' => 'version', + 'description' => '7.4.x - 8.0.x', + 'minimum' => '7.4.0', + 'maximum' => '8.0.15', ], 'zip' => [ @@ -113,14 +113,14 @@ $php = []; foreach ($settings as $name => $values) { $description = $values['description']; - if ($values['type'] == 'php') { + if ($values['type'] == 'version') { $description = tr('Valore consigliato: _VALUE_ (Valore attuale: _PHP_VERSION_)', [ '_VALUE_' => $description, '_PHP_VERSION_' => phpversion(), ]); - $status = (version_compare(phpversion(), $values['minimum']) < 0 || (version_compare(phpversion(), $values['maximum']) > 0) ? 0 : 1); + $status = ((version_compare(phpversion(), $values['minimum'], ">=") && version_compare(phpversion(), $values['maximum'], "<=")) ? 1 : 0); } elseif ($values['type'] == 'ext') { $status = extension_loaded($name); @@ -150,6 +150,14 @@ foreach ($settings as $name => $values) { $type = ($values['type'] == 'ext') ? tr('Estensione') : tr('Impostazione'); + if ($values['type'] == 'ext'){ + $type = tr('Estensione'); + }elseif ($values['type'] == 'version') { + $type = tr('Versione'); + }else{ + $type = tr('Impostazione'); + } + $php[] = [ 'name' => $name, 'description' => $description, @@ -158,6 +166,36 @@ foreach ($settings as $name => $values) { ]; } +// MySQL +$db = [ + + 'mysql_version' => [ + 'type' => 'mysql', + 'description' => '5.7.x - 8.0.x', + 'minimum' => '5.7.0', + 'maximum' => '8.0.27', + ], + +]; + +foreach ($db as $name => $values) { + $description = $values['description']; + $description = tr('Valore consigliato: _VALUE_ (Valore attuale: _MYSQL_VERSION_)', [ + '_VALUE_' => $description, + '_MYSQL_VERSION_' => $database->getMySQLVersion(), + ]); + + $status = ((version_compare($database->getMySQLVersion(), $values['minimum'], ">=") && version_compare($database->getMySQLVersion(), $values['maximum'], "<=")) ? 1 : 0); + + $mysql[] = [ + 'name' => $name, + 'description' => $description, + 'status' => $status, + 'type' => tr('Versione'), + ]; +} + + // Percorsi di servizio $dirs = [ 'backup' => tr('Necessario per il salvataggio dei backup'), @@ -181,8 +219,9 @@ $requirements = [ tr('Apache') => $apache, tr('PHP (_VERSION_ _SUPPORTED_)', [ '_VERSION_' => phpversion(), - '_SUPPORTED_' => (version_compare(phpversion(), $settings['php_version']['minimum']) < 0 || (version_compare(phpversion(), $settings['php_version']['maximum']) > 0) ? ' '.tr('versioni supportate:').' '.$settings['php_version']['minimum'].' - '.$settings['php_version']['maximum'].'' : '' ) + '_SUPPORTED_' => ( ( version_compare(phpversion(), $settings['php_version']['minimum'], ">=") && version_compare(phpversion(), $settings['php_version']['maximum'], "<=") ) ? '' : ' '.tr('versioni supportate:').' '.$settings['php_version']['description'].'') ]) => $php, + tr('MySQL') => $mysql, tr('Percorsi di servizio') => $directories, ]; From 90563bf6b79e237dc5c3e4ecc5713ab6c6ddef52 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 7 Feb 2022 14:58:28 +0100 Subject: [PATCH 4/5] Rimosso controllo della versione php da parte di composer --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c4cc3de2d..907b70ae4 100755 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }], "type": "project", "require": { - "php": ">=7.4", + "php": ">=7.2", "ext-curl": "*", "ext-dom": "*", "ext-fileinfo": "*", @@ -138,6 +138,7 @@ "optimize-autoloader": false, "apcu-autoloader": true, "prefer-stable": true, + "platform-check": false, "platform": { "php": "7.4" }, From 1800fd2a9d3460377a12252e65b1f5fd9330b1f1 Mon Sep 17 00:00:00 2001 From: Matteo Date: Mon, 7 Feb 2022 17:45:28 +0100 Subject: [PATCH 5/5] Ricereca mail referente per sede in invio mail --- modules/anagrafiche/ajax/complete.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/anagrafiche/ajax/complete.php b/modules/anagrafiche/ajax/complete.php index 79d2f0cdf..244bde358 100755 --- a/modules/anagrafiche/ajax/complete.php +++ b/modules/anagrafiche/ajax/complete.php @@ -60,13 +60,13 @@ switch ($resource) { $results = []; // Tutti i referenti per questo cliente - $q = "SELECT DISTINCT(email), idanagrafica, nome AS ragione_sociale FROM an_referenti WHERE email != '' ".$where.' ORDER BY idanagrafica'; + $q = "SELECT DISTINCT(email), (SELECT nomesede FROM an_sedi WHERE an_sedi.id=an_referenti.idsede) AS sede, idanagrafica, nome AS ragione_sociale FROM an_referenti WHERE email != '' ".$where.' ORDER BY idanagrafica'; $rs = $dbo->fetchArray($q); foreach ($rs as $r) { $results[] = [ 'value' => $r['email'], - 'label' => $r['ragione_sociale'].' <'.$r['email'].'>', + 'label' => $r['ragione_sociale'].($r['sede']!=''?' ('.$r['sede'].')':'').' <'.$r['email'].'>', ]; }