From 9d3ad36b7869da48ec4c6c1aead84ee2ca57bb76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 May 2016 11:06:18 +0200 Subject: [PATCH 1/2] NEW If error is reported during migration process, you can ignore it to avoid to be locked. --- htdocs/install/inc.php | 10 ++++++++-- htdocs/install/upgrade.php | 2 +- htdocs/langs/en_US/install.lang | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 1fa6189df67..a0d873d4f5c 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -420,7 +420,7 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='') /** * Print HTML footer of install pages * - * @param integer $nonext 1=No button "Next step", 2=Show button but disabled + * @param integer $nonext 1=No button "Next step", 2=Show button but disabled with a link to enable * @param string $setuplang Language code * @param string $jscheckfunction Add a javascript check function * @param integer $withpleasewait Add also please wait tags @@ -439,7 +439,13 @@ function pFooter($nonext=0,$setuplang='',$jscheckfunction='', $withpleasewait=0) if (! $nonext || ($nonext == '2')) { - print '
"'; + print '
'; + if ($nonext == '2') + { + print $langs->trans("ErrorFoundDuringMigration", $_SERVER["REQUEST_URI"].'&ignoreerrors=1').'

'; + } + + print '"'; if ($jscheckfunction) print ' onClick="return '.$jscheckfunction.'();"'; print '>
'; if ($withpleasewait) print ''; diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 4d42e225429..2a07c55d051 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2015 Raphaƫl Doursenaud * diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index ed692c07424..ca2e94686fb 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -205,3 +205,4 @@ MigrationEvents=Migration of events to add event owner into assignement table MigrationReloadModule=Reload module %s ShowNotAvailableOptions=Show not available options HideNotAvailableOptions=Hide not available options +ErrorFoundDuringMigration=Error were reported during migration process so next step is not available. To ignore errors, you can click here, but application or some features may not work correctly until fixed. \ No newline at end of file From 1032583b02b70c7908e874d98046aa7858b264f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 May 2016 14:59:59 +0200 Subject: [PATCH 2/2] Better support for accessiblity --- htdocs/core/menus/standard/eldy.lib.php | 17 +++++++++++++-- htdocs/core/menus/standard/eldy_menu.php | 2 +- htdocs/main.inc.php | 27 ++++++++++++++++++------ 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 67708eba5fe..2fc166e7625 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; * @param int $type_user 0=Menu for backoffice, 1=Menu for front office * @param array $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param array $menu Object Menu to return back list of menu entries - * @param int $noout Disable output (Initialise &$menu only). + * @param int $noout 1=Disable output (Initialise &$menu only). * @return int 0 */ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) @@ -50,6 +50,19 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) if (empty($noout)) print_start_menu_array(); + // Show/Hide vertical menu + if (GETPOST('testhidemenu') && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $showmode=1; + $classname = 'class="tmenu"'; + $idsel='home'; + + if (empty($noout)) print_start_menu_entry($idsel,$classname,$showmode); + if (empty($noout)) print_text_menu_entry($langs->trans("XXX"), 1, '#', $id, $idsel, $classname, $atarget); + if (empty($noout)) print_end_menu_entry($showmode); + $menu->add('#', $langs->trans("XXX"), 0, $showmode, $atarget, "xxx", ''); + } + // Home $showmode=1; $classname=""; @@ -463,7 +476,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu print '
'."\n"; } - if (is_array($moredata) && ! empty($moredata['searchform'])) + if (is_array($moredata) && ! empty($moredata['searchform']) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { print "\n"; print "\n"; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 354f7de1453..eb5e75dfef8 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -144,7 +144,7 @@ class MenuManager if ($mode == 'topnb') { - print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1); + print_eldy_menu($this->db,$this->atarget,$this->type_user,$this->tabMenu,$this->menu,1); // no output return $this->menu->getNbOfVisibleMenuEntries(); } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b17ce86ad17..ffdb4288928 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -563,7 +563,11 @@ if (! defined('NOLOGIN')) $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; - header('Location: '.DOL_URL_ROOT.'/index.php'); + $paramsurl=array(); + if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int'); + if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int'); + if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang','alpha'); + header('Location: '.DOL_URL_ROOT.'/index.php'.($count(paramsurl)?'?'.join('&',$paramsurl):'')); exit; } } @@ -617,7 +621,11 @@ if (! defined('NOLOGIN')) $reshook=$hookmanager->executeHooks('afterLoginFailed',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; - header('Location: '.DOL_URL_ROOT.'/index.php'); + $paramsurl=array(); + if (GETPOST('textbrowser')) $paramsurl[]='textbrowser='.GETPOST('textbrowser','int'); + if (GETPOST('nojs')) $paramsurl[]='nojs='.GETPOST('nojs','int'); + if (GETPOST('lang')) $paramsurl[]='lang='.GETPOST('lang','alpha'); + header('Location: '.DOL_URL_ROOT.'/index.php'.($count(paramsurl)?'?'.join('&',$paramsurl):'')); exit; } else @@ -756,6 +764,11 @@ if (! GETPOST('nojs')) // If javascript was not disabled on URL } } else $conf->use_javascript_ajax=0; +// Set MAIN_OPTIMIZEFORTEXTBROWSER +if (GETPOST('textbrowser') || ! empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) // If text browser was enabled on URL +{ + $conf->global->MAIN_OPTIMIZEFORTEXTBROWSER=1; +} // Set terminal output option according to conf->browser. if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu=1; @@ -1006,9 +1019,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs $favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico',1); if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL; print ''."\n"; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; - if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n"; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print ''."\n"; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print ''."\n"; + if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && ! GETPOST('textbrowser')) print ''."\n"; // Displays title $appli=constant('DOL_APPLICATION_TITLE'); @@ -1460,7 +1473,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a else $toprightmenu.=$result; // For backward compatibility // Link to print main content area - if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->browser->phone)) + if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && empty($conf->browser->phone)) { $qs=$_SERVER["QUERY_STRING"]; $qs.=(($qs && $morequerystring)?'&':'').$morequerystring; @@ -1471,7 +1484,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a } // Link to Dolibarr wiki pages - if (empty($conf->global->MAIN_HELP_DISABLELINK)) + if (empty($conf->global->MAIN_HELP_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $langs->load("help");