diff --git a/include/init/update.php b/include/init/update.php index 6cdad30ec..e651a3148 100755 --- a/include/init/update.php +++ b/include/init/update.php @@ -204,6 +204,9 @@ } // Update completed elseif (Update::isUpdateCompleted()) { + $postUpdateUrl = base_path_osm().'/index.php'; + $autoRedirect = (($_GET['firstuse'] ?? '') !== 'true') ? 'true' : 'false'; + Update::updateCleanup(); echo ' @@ -216,7 +219,13 @@ // Mostra tutti i segni di spunta per gli aggiornamenti completati $("#updates-list .fa-check").show(); - $("#versions-details-container").after(\'
'.tr('Configura il gestionale').'
\'); + var postUpdateUrl = '.json_encode($postUpdateUrl).'; + $("#versions-details-container").after(\'
'.tr('Configura il gestionale').'
\'); + if ('.$autoRedirect.') { + setTimeout(function() { + window.location.href = postUpdateUrl; + }, 1200); + } '; // Instructions for the first installation