diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fff53e9d25c..94f0f463b31 100755 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -816,84 +816,15 @@ class Form $resql=$this->db->query($sql); if ($resql) { - if (! empty($conf->use_javascript_ajax)) + if ($conf->use_javascript_ajax && ! $forcecombo) { - if (! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) - { - include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); - } - else - { - if (! $forcecombo) - { - $out.=' - '; - } - - if (count($events)) // Add management of event - { - $out.=''; - } - } + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + $nodatarole=' data-role="none"'; } // Construct $out and $outarray - $out.= ''."\n"; $textifempty=''; // Do not use textempty = ' ' or ' ' here, or search on key will search on ' key'. @@ -1094,9 +1025,10 @@ class Form { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; $out.= ajax_combobox($htmlname, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT); + $nodatarole=' data-role="none"'; } - if ($htmlname != 'none' || $options_only) $out.= ''; if ($showempty == 1) $out.= ''; if ($showempty == 2) $out.= ''; $num = $this->db->num_rows($resql); @@ -1280,7 +1212,15 @@ class Form $i = 0; if ($num) { - $out.= ''; if ($show_empty) $out.= ''."\n"; $userstatic=new User($this->db); @@ -1355,16 +1295,6 @@ class Form $out.= ''; } $out.= ''; - - $out.= ''; } else { @@ -4585,11 +4515,20 @@ class Form $resql=$this->db->query($sql); if ($resql) { - $num = $this->db->num_rows($resql); + // Enhance with select2 + if ($conf->use_javascript_ajax) + { + include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; + $out.= ajax_combobox($htmlname); + $nodatarole=' data-role="none"'; + } + + $out.= ''; if ($show_empty) $out.= ''."\n"; while ($i < $num) @@ -4618,8 +4557,8 @@ class Form } else { - $out.= ''; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 236f418dd86..3d51490f6b2 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); @@ -147,16 +124,18 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print ''.$langs->trans("WorkingTimeRange").''; print ""; - print ' - '; + print ''; + if (empty($conf->dol_use_jmobile)) print ' - '; print ''; - print ' '.$langs->trans("H"); + if (empty($conf->dol_use_jmobile)) print ' '.$langs->trans("H"); print ''; // Filter on days print ''; print ''.$langs->trans("WorkingDaysRange").''; print ""; - print ' - '; + print ''; + if (empty($conf->dol_use_jmobile)) print ' - '; print ''; print ''; } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index df7c09d9274..96c7bc8d05a 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -320,63 +320,71 @@ 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->browser->phone)) return ''; // combobox disabled for smartphones (does not works) + //if (! empty($conf->dol_use_jmobile)) return ''; // select2 works with jmobile if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; - + if (empty($conf->use_javascript_ajax)) return ''; + + if (empty($minLengthToAutocomplete)) $minLengthToAutocomplete=0; + $msg = '\n"; return $msg; 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.