mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 11:30:55 +01:00
fix: controlli database
This commit is contained in:
parent
467ebaea56
commit
1c74007dc4
@ -77,7 +77,6 @@ $effettua_controllo = filter('effettua_controllo');
|
||||
if (empty($effettua_controllo)) {
|
||||
echo '
|
||||
<div id="righe_controlli">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info" id="card-loading">
|
||||
@ -143,25 +142,26 @@ $results_settings_added = settings_diff($settings, $data_settings);
|
||||
|
||||
// Schermata di visualizzazione degli errori
|
||||
if (!empty($results) || !empty($results_added) || !empty($results_settings) || !empty($results_settings_added)) {
|
||||
if (!empty($results)) {
|
||||
if ($results) {
|
||||
echo '
|
||||
<p>'.tr("Segue l'elenco delle tabelle del database che presentano una struttura diversa rispetto a quella prevista nella versione ufficiale del gestionale").'.</p>
|
||||
<div class="alert alert-warning">
|
||||
<p>'.tr("Segue l'elenco delle tabelle del database che presentano una struttura diversa rispetto a quella prevista nella versione ufficiale del gestionale").'.</p>
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa fa-warning"></i>
|
||||
'.tr('Attenzione: questa funzionalità può presentare dei risultati falsamente positivi, sulla base del contenuto del file _FILE_ e la versione di _MYSQL_VERSION_ di _DBMS_TYPE_ rilevata a sistema', [
|
||||
'_FILE_' => '<b>'.$file_to_check_database.'</b>',
|
||||
'_MYSQL_VERSION_' => '<b>'.$database->getMySQLVersion().'</b>',
|
||||
'_DBMS_TYPE_' => '<b>'.$database->getType().'</b>',
|
||||
]).'.
|
||||
</div>';
|
||||
</div>';
|
||||
|
||||
foreach ($results as $table => $errors) {
|
||||
echo '
|
||||
<h3>'.$table.'</h3>';
|
||||
<h3>'.$table.'</h3>';
|
||||
|
||||
if (array_key_exists('current', $errors) && $errors['current'] == null) {
|
||||
echo '
|
||||
<div class="alert alert-danger" ><i class="fa fa-times"></i> '.tr('Tabella assente').'</div>';
|
||||
<div class="alert alert-danger" ><i class="fa fa-times"></i> '.tr('Tabella assente').'
|
||||
</div>';
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ if (!empty($results) || !empty($results_added) || !empty($results_settings) || !
|
||||
|
||||
if (!empty($errors)) {
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Colonna').'</th>
|
||||
@ -215,12 +215,12 @@ if (!empty($results) || !empty($results_added) || !empty($results_settings) || !
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
</table>';
|
||||
}
|
||||
|
||||
if (!empty($foreign_keys)) {
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Foreign keys').'</th>
|
||||
@ -244,20 +244,21 @@ if (!empty($results) || !empty($results_added) || !empty($results_settings) || !
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
</table>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($results_added)) {
|
||||
if ($results_added) {
|
||||
foreach ($results_added as $table => $errors) {
|
||||
if ($results[$table] && array_keys($results[$table]) != array_keys($errors)) {
|
||||
if (($results[$table] && array_keys($results[$table]) != array_keys($errors)) || (empty($results[$table]) && !empty($errors))) {
|
||||
echo '
|
||||
<h3>'.$table.'</h3>';
|
||||
<h3>'.$table.'</h3>';
|
||||
|
||||
if (array_key_exists('current', $errors) && $errors['current'] == null) {
|
||||
echo '
|
||||
<div class="alert alert-danger" ><i class="fa fa-times"></i> '.tr('Tabella assente').'</div>';
|
||||
<div class="alert alert-danger" ><i class="fa fa-times"></i> '.tr('Tabella assente').'
|
||||
</div>';
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -266,7 +267,7 @@ if (!empty($results) || !empty($results_added) || !empty($results_settings) || !
|
||||
|
||||
if (!empty($errors)) {
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Colonna').'</th>
|
||||
@ -302,12 +303,12 @@ if (!empty($results) || !empty($results_added) || !empty($results_settings) || !
|
||||
}
|
||||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
</table>';
|
||||
}
|
||||
|
||||
if (!empty($foreign_keys)) {
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Foreign keys').'</th>
|
||||
@ -331,23 +332,24 @@ if (!empty($results) || !empty($results_added) || !empty($results_settings) || !
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>';
|
||||
</table>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($results_settings)) {
|
||||
if ($results_settings) {
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<thead>
|
||||
<h3>Problemi impostazioni</h3>
|
||||
<tr>
|
||||
<th>'.tr('Nome').'</th>
|
||||
<th>'.tr('Valore attuale').'</th>
|
||||
<th>'.tr('Valore atteso').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
|
||||
<tbody>';
|
||||
foreach ($results_settings as $key => $setting) {
|
||||
if (!$setting['current']) {
|
||||
@ -372,16 +374,17 @@ if (!empty($results) || !empty($results_added) || !empty($results_settings) || !
|
||||
</tbody>
|
||||
</table>';
|
||||
}
|
||||
if (!empty($results_settings_added)) {
|
||||
|
||||
if ($results_settings_added) {
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<thead>
|
||||
<h3>Impostazioni non previste</h3>
|
||||
<tr>
|
||||
<th>'.tr('Nome').'</th>
|
||||
<th>'.tr('Valore attuale').'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
<tbody>';
|
||||
foreach ($results_settings_added as $key => $setting) {
|
||||
if ($setting['current'] == null) {
|
||||
@ -403,6 +406,6 @@ if (!empty($results) || !empty($results_added) || !empty($results_settings) || !
|
||||
} else {
|
||||
echo '
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info-circle"></i> '.tr('Il database non presenta problemi di integrità').'.
|
||||
<i class="fa fa-info-circle"></i> '.tr('Il database non presenta problemi di integrità').'.
|
||||
</div>';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user