diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 51a893832b1..38a2eee7555 100755 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -832,8 +832,9 @@ class Form if ($conf->use_javascript_ajax && ! $forcecombo) { 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"'; + $comboenhancement =ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + $out.= $comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } // Construct $out and $outarray @@ -1037,8 +1038,9 @@ class Form if ($conf->use_javascript_ajax && ! $forcecombo && ! $options_only) { 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"'; + $comboenhancement = ajax_combobox($htmlname, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT); + $out.= $comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } if ($htmlname != 'none' || $options_only) $out.= ''; @@ -1230,8 +1232,9 @@ class Form /*if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname); - $nodatarole=' data-role="none"'; + $comboenhancement = ajax_combobox($htmlname); + $out.= $comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); }*/ $out.= ''; @@ -4288,7 +4291,7 @@ class Form // Try also magic suggest - // Add data-role="none" to diable jmobile decoration + // Add data-role="none" to disable jmobile decoration $out = ''."\n"; if (is_array($array) && ! empty($array)) { @@ -4628,8 +4631,9 @@ class Form if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname); - $nodatarole=' data-role="none"'; + $comboenhancement = ajax_combobox($htmlname); + $out.= $comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } $out.= ''; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 68a7b677667..5bb491adf89 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -324,8 +324,9 @@ class FormOther if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $moreforfilter.= ajax_combobox('select_categ_'.$htmlname); - $nodatarole=' data-role="none"'; + $comboenhancement = ajax_combobox('select_categ_'.$htmlname); + $moreforfilter.=$comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } // Print a select with each of them @@ -373,8 +374,9 @@ class FormOther if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname); - $nodatarole=' data-role="none"'; + $comboenhancement = ajax_combobox($htmlname); + $out.=$comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } // Select each sales and print them in a select input $out.=''; diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index aba8abf78a3..e1487818438 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -91,8 +91,9 @@ class FormProjets if (! empty($conf->use_javascript_ajax)) { include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; - $out.= ajax_combobox($htmlname, '', 0, $forcefocus); - $nodatarole=' data-role="none"'; + $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus); + $out.=$comboenhancement; + $nodatarole=($comboenhancement?' data-role="none"':''); } if (empty($option_only)) { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 72c3214610a..ff9398f6eeb 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -114,7 +114,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; print $langs->trans("Project").' '; print ''; - $formproject->select_projects($socid?$socid:-1, $pid, 'projectid'); + $formproject->select_projects($socid?$socid:-1, $pid, 'projectid', 0); print ''; } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index ee876aa87c6..8bb98b6cdaa 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -322,7 +322,7 @@ 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 ''; // select2 works with jmobile + if (! empty($conf->dol_use_jmobile)) return ''; // select2 works with jmobile but it breaks the autosize feature of jmobile. if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return ''; if (empty($conf->use_javascript_ajax)) return '';