diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 1011536b0db..00fb490161e 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -1,12 +1,13 @@ - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2023 Gauthier VERDOL +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2021-2024 Frédéric France + * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Vincent de Grandpré + * Copyright (C) 2024 Vincent de Grandpré + * Copyright (C) 2025 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -96,43 +97,128 @@ pHeader($langs->trans("Repair"), "upgrade2", GETPOST('action', 'aZ09')); $actiondone = 1; print '
'; -print $langs->trans("SetAtLeastOneOptionAsUrlParameter"); +print 'Select a link "test" or "confirmed" to launch a reparation on the chosen option'; print '
'; - -//print 'You must set one of the following option with a parameter value that is "test" or "confirmed" on the URL
'; -//print $langs->trans("Example").': '.DOL_MAIN_URL_ROOT.'/install/repair.php?standard=confirmed
'."\n"; print '
'; -print 'Option standard is '.(GETPOST('standard', 'alpha') ? GETPOST('standard', 'alpha') : 'undefined').'
'."\n"; -// Disable modules -print 'Option force_disable_of_modules_not_found is '.(GETPOST('force_disable_of_modules_not_found', 'alpha') ? GETPOST('force_disable_of_modules_not_found', 'alpha') : 'undefined').'
'."\n"; -// Files -print 'Option restore_thirdparties_logos is '.(GETPOST('restore_thirdparties_logos', 'alpha') ? GETPOST('restore_thirdparties_logos', 'alpha') : 'undefined').'
'."\n"; -print 'Option restore_user_pictures is '.(GETPOST('restore_user_pictures', 'alpha') ? GETPOST('restore_user_pictures', 'alpha') : 'undefined').'
'."\n"; -print 'Option rebuild_product_thumbs is '.(GETPOST('rebuild_product_thumbs', 'alpha') ? GETPOST('rebuild_product_thumbs', 'alpha') : 'undefined').'
'."\n"; -// Clean tables and data -print 'Option clean_linked_elements is '.(GETPOST('clean_linked_elements', 'alpha') ? GETPOST('clean_linked_elements', 'alpha') : 'undefined').'
'."\n"; -print 'Option clean_menus is '.(GETPOST('clean_menus', 'alpha') ? GETPOST('clean_menus', 'alpha') : 'undefined').'
'."\n"; -print 'Option clean_orphelin_dir is '.(GETPOST('clean_orphelin_dir', 'alpha') ? GETPOST('clean_orphelin_dir', 'alpha') : 'undefined').'
'."\n"; -print 'Option clean_product_stock_batch is '.(GETPOST('clean_product_stock_batch', 'alpha') ? GETPOST('clean_product_stock_batch', 'alpha') : 'undefined').'
'."\n"; -print 'Option clean_perm_table is '.(GETPOST('clean_perm_table', 'alpha') ? GETPOST('clean_perm_table', 'alpha') : 'undefined').'
'."\n"; -print 'Option clean_ecm_files_table is '.(GETPOST('clean_ecm_files_table', 'alpha') ? GETPOST('clean_ecm_files_table', 'alpha') : 'undefined').'
'."\n"; -print 'Option repair_link_dispatch_lines_supplier_order_lines, is '.(GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha') ? GETPOST('repair_link_dispatch_lines_supplier_order_lines', 'alpha') : 'undefined').'
'."\n"; -// Init data -print 'Option set_empty_time_spent_amount is '.(GETPOST('set_empty_time_spent_amount', 'alpha') ? GETPOST('set_empty_time_spent_amount', 'alpha') : 'undefined').'
'."\n"; -// Structure -print 'Option force_utf8_on_tables (force utf8 + row=dynamic), for mysql/mariadb only, is '.(GETPOST('force_utf8_on_tables', 'alpha') ? GETPOST('force_utf8_on_tables', 'alpha') : 'undefined').'
'."\n"; -print ''."Option force_utf8mb4_on_tables (force utf8mb4 + row=dynamic), for mysql/mariadb only, is ".(GETPOST('force_utf8mb4_on_tables', 'alpha') ? GETPOST('force_utf8mb4_on_tables', 'alpha') : 'undefined'); -print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +$warning_using_utf8mb4 = ''; if ($dolibarr_main_db_character_set != 'utf8mb4') { - print ''; + $warning_using_utf8mb4 = ''; } -print "
\n"; -print "Option force_collation_from_conf_on_tables (force ".$conf->db->character_set."/".$conf->db->dolibarr_main_db_collation." + row=dynamic), for mysql/mariadb only is ".(GETPOST('force_collation_from_conf_on_tables', 'alpha') ? GETPOST('force_collation_from_conf_on_tables', 'alpha') : 'undefined')."
\n"; -// Rebuild sequence -print 'Option rebuild_sequences, for postgresql only, is '.(GETPOST('rebuild_sequences', 'alpha') ? GETPOST('rebuild_sequences', 'alpha') : 'undefined').'
'."\n"; -print '
'; +$sections = [ + 'Standard' => [ + [ + 'name' => 'standard', + 'info' => '' + ] + ], + 'Modules' => [ + [ + 'name' => 'force_disable_of_modules_not_found', + 'info' => 'Disable modules not found' + ] + ], + 'Files' => [ + [ + 'name' => 'restore_thirdparties_logos', + 'info' => 'Restore logos for thirdparties' + ], + [ + 'name' => 'restore_user_pictures', + 'info' => 'Restore user pictures' + ], + [ + 'name' => 'rebuild_product_thumbs', + 'info' => 'Rebuild product thumbnails' + ] + ], + 'Clean tables and data' => [ + [ + 'name' => 'clean_linked_elements', + 'info' => 'Clean linked elements' + ], + [ + 'name' => 'clean_menus', + 'info' => 'Clean menus' + ], + [ + 'name' => 'clean_orphelin_dir', + 'info' => 'Clean orphan directories' + ], + [ + 'name' => 'clean_product_stock_batch', + 'info' => 'Clean product stock batch' + ], + [ + 'name' => 'clean_perm_table', + 'info' => 'Clean permissions table' + ], + [ + 'name' => 'clean_ecm_files_table', + 'info' => 'Clean ECM files table' + ], + [ + 'name' => 'repair_link_dispatch_lines_supplier_order_lines', + 'info' => 'Repair link between dispatch lines and supplier order lines' + ] + ], + 'Init data' => [ + [ + 'name' => 'set_empty_time_spent_amount', + 'info' => 'Init empty time spent amount' + ] + ], + 'Structure' => [ + [ + 'name' => 'force_utf8_on_tables', + 'info' => 'Force utf8 + row=dynamic, for mysql/mariadb only' + ], + [ + 'name' => 'force_utf8mb4_on_tables', + 'info' => 'Force utf8mb4 + row=dynamic, for mysql/mariadb only' . $warning_using_utf8mb4 + ], + [ + 'name' => 'force_collation_from_conf_on_tables', + 'info' => 'Force '.$conf->db->character_set.'/'.$conf->db->dolibarr_main_db_collation.' + row=dynamic, for mysql/mariadb only' + ] + ], + 'Rebuild sequence' => [ + [ + 'name' => 'rebuild_sequences', + 'info' => 'For postgresql only' + ] + ] +]; + +foreach ($sections as $section => $options) { + print ''; + foreach ($options as $opt) { + $option = $opt['name']; + $info = $opt['info']; + $value = GETPOST($option, 'alpha') ? GETPOST($option, 'alpha') : 'undefined'; + // Generate links with the right option and value + $url_test = $_SERVER['PHP_SELF'].'?'.$option.'=test'; + $url_confirmed = $_SERVER['PHP_SELF'].'?'.$option.'=confirmed'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + } +} +print '
OptionInformationLaunch testLaunch confirmedActual value
'.$section.'
' . $option . '' . $info . 'testconfirmed' . $value . '
'; print '
';