From 476aab9bae80fc9e1f8475517897b1a25a7a8a15 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 Oct 2018 21:00:26 +0200 Subject: [PATCH 1/2] Same order than top menu --- htdocs/core/ajax/selectsearchbox.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 57483848c4e..364903c9cd7 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -53,6 +53,12 @@ $search_boxvalue=GETPOST('q', 'none'); $arrayresult=array(); // Define $searchform + +if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) +{ + $arrayresult['searchintomember']=array('position'=>8, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); +} + if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { $arrayresult['searchintothirdparty']=array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); @@ -63,11 +69,6 @@ if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CON $arrayresult['searchintocontact']=array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); } -if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) -{ - $arrayresult['searchintomember']=array('position'=>20, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):'')); -} - if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) { From d4b6429ccd0cde77e0e860803e916fc6686ba556 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Oct 2018 21:45:20 +0200 Subject: [PATCH 2/2] Fix regression into backup feature --- htdocs/admin/tools/export.php | 2 +- htdocs/core/class/utils.class.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index e10b5530f52..6b0ea790ab2 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -129,7 +129,7 @@ if ($what == 'mysql') { $arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands); $ok=0; - dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that on of this command is inside ".$cmddump); + dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that one of this command is inside ".$cmddump); foreach($arrayofallowedcommand as $allowedcommand) { if (preg_match('/'.preg_quote($allowedcommand,'/').'/', $cmddump)) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index b0b641eca57..ec95063906c 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -291,12 +291,11 @@ class Utils if ($handle) { - $execmethod=1; if (! empty($conf->global->MAIN_EXEC_USE_POPEN)) $execmethod=$conf->global->MAIN_EXEC_USE_POPEN; if (empty($execmethod)) $execmethod=1; $ok=0; - dol_syslog("Run command with method ".$execmethod." with ".$fullcommandcrypted); + dol_syslog("Utils::dumpDatabase execmethod=".$execmethod." command:".$fullcommandcrypted, LOG_DEBUG); // TODO Replace with executeCLI function if ($execmethod == 1) @@ -319,7 +318,7 @@ class Utils { $i++; // output line number if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue; - fwrite($handle,$read); + fwrite($handle, $read.($execmethod == 2 ? '' : "\n")); if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1; elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1; }