From 854ed90a6226eeb8c0cb62fee9a0f3af459a35c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Dec 2014 11:15:10 +0100 Subject: [PATCH] Fixed: bad place for the ajaxcombo. --- htdocs/core/class/html.form.class.php | 17 +++++++++++++++-- htdocs/core/lib/agenda.lib.php | 25 +------------------------ htdocs/core/lib/ajax.lib.php | 4 +++- htdocs/langs/en_US/main.lang | 1 + 4 files changed, 20 insertions(+), 27 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index eec9318f9ba..b40438d4292 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1342,6 +1342,12 @@ class Form $out.= ''; } $out.= ''; + + if (! empty($conf->use_javascript_ajax)) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out.= ajax_combobox($htmlname); + } } else { @@ -4566,10 +4572,17 @@ class Form } else { - $out.= ''; + if ($show_empty) $out.= ''."\n"; + $out.= ''; } $out.= ''; + + if (! empty($conf->use_javascript_ajax)) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out.= ajax_combobox($htmlname); + } } else { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 236f418dd86..7bc5b931c0e 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -70,36 +70,13 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { print ''; print ''; - //print $langs->trans("ActionsAskedBy"); - //print '  '; - //print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit); - //print '   '.$langs->trans("or") . ' '; print $langs->trans("ActionsOwnedBy").'   '; print ''; - //print $langs->trans("User"); print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit); - if (! empty($conf->use_javascript_ajax)) - { - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - print ajax_combobox('usertodo'); - } - if (empty($conf->dol_optimize_smallscreen)) print '   '.$langs->trans("or") . ' '; - else print '
'; - print $langs->trans("Group").'   '; + if (empty($conf->dol_optimize_smallscreen)) print '   '.$langs->trans("or") . ' '.$langs->trans("Group").'   '; print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); - if (! empty($conf->use_javascript_ajax)) - { - print ajax_combobox('usergroup'); - } print ''; - /*print ''; - print ''; - print $langs->trans("or") . ' ' . $langs->trans("ActionsDoneBy"); - print '  '; - print $form->select_dolusers($filterd, 'userdone', 1, '', ! $canedit); - print '';*/ - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions=new FormActions($db); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 3966b29f874..74e715f7b4a 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -321,8 +321,10 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0) global $conf; if (! empty($conf->browser->phone)) return ''; // combobox disabled for smartphones (does not works) + if (! empty($conf->dol_use_jmobile)) return ''; // combobox with jmobile (does not works) if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; - + if (empty($conf->use_javascript_ajax)) return ''; + /* Some properties for combobox: minLengthToAutocomplete: 2, comboboxContainerClass: "comboboxContainer", diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index cbc4deb40d7..fd07d379a44 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -169,6 +169,7 @@ User=User Users=Users Group=Group Groups=Groups +NoUserGroupDefined=No user group defined Password=Password PasswordRetype=Retype your password NoteSomeFeaturesAreDisabled=Note that a lot of features/modules are disabled in this demonstration.