From b228fe6a2ae6aa5ac265fcb1aca90c5247c2d4d4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Jun 2017 16:06:20 +0200 Subject: [PATCH] Fix auto focus on module page --- htdocs/admin/modules.php | 4 +++- htdocs/core/lib/functions.lib.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 8bea1c6dcb7..5d5886b5415 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -430,6 +430,8 @@ print "
\n"; if ($mode == 'common') { + dol_set_focus('#search_keyword'); + print '
'; if ($optioncss != '') print ''; print ''; @@ -441,7 +443,7 @@ if ($mode == 'common') $moreforfilter = ''; $moreforfilter.='
'; - $moreforfilter.= $langs->trans('Keyword') . ': '; + $moreforfilter.= $langs->trans('Keyword') . ': '; $moreforfilter.= '
'; $moreforfilter.='
'; $moreforfilter.= $langs->trans('Origin') . ': '.$form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), 1); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a582263185b..fd3b0012165 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6089,12 +6089,12 @@ function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=') /** * Set focus onto field with selector * - * @param string $selector Selector ('#id') + * @param string $selector Selector ('#id') to use to find the HTML input field that must get the autofocus. You must use a CSS selector, so unique id preceding with the '#' char. * @return string HTML code to set focus */ function dol_set_focus($selector) { - print ''."\n"; + print "\n".''."\n"; print ''."\n"; }