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" }, 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..d0a2ce0cc 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' => 'version', + 'description' => '7.4.x - 8.0.x', + 'minimum' => '7.4.0', + 'maximum' => '8.0.15', + ], + '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'] == 'version') { + + $description = tr('Valore consigliato: _VALUE_ (Valore attuale: _PHP_VERSION_)', [ + '_VALUE_' => $description, + '_PHP_VERSION_' => phpversion(), + ]); + + $status = ((version_compare(phpversion(), $values['minimum'], ">=") && version_compare(phpversion(), $values['maximum'], "<=")) ? 1 : 0); + + } elseif ($values['type'] == 'ext') { $status = extension_loaded($name); } else { $ini = str_replace(['k', 'M'], ['000', '000000'], ini_get($name)); @@ -132,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, @@ -140,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'), @@ -161,12 +217,15 @@ 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'], ">=") && version_compare(phpversion(), $settings['php_version']['maximum'], "<=") ) ? '' : ' '.tr('versioni supportate:').' '.$settings['php_version']['description'].'') ]) => $php, + tr('MySQL') => $mysql, tr('Percorsi di servizio') => $directories, ]; + // Tabelle di riepilogo foreach ($requirements as $key => $values) { $statuses = array_column($values, 'status'); 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'].'>', ]; } 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');