diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 82b0ebe7d1a..a086f3c7e07 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -89,15 +89,15 @@ class FormResource if ($resourcestat) { - if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo) + if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->RESOURCE_USE_SEARCH_TO_SELECT) && ! $forcecombo) { - //$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); - $out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); + //$minLength = (is_numeric($conf->global->RESOURCE_USE_SEARCH_TO_SELECT)?$conf->global->RESOURCE_USE_SEARCH_TO_SELECT:2); + $out.= ajax_combobox($htmlname, $event, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT); } // Construct $out and $outarray - $out.= ''."\n"; + if ($showempty) $out.= ''."\n"; $num = count($resourcestat->lines); //var_dump($resourcestat->lines); @@ -106,9 +106,11 @@ class FormResource { while ( $i < $num) { - $label=$langs->trans(ucfirst($resourcestat->lines[$i]->element)).' : '; - $label.=$resourcestat->lines[$i]->ref?$resourcestat->lines[$i]->ref:''.$resourcestat->lines[$i]->label; - + $resourceclass=ucfirst($resourcestat->lines[$i]->element); + + $label=$resourcestat->lines[$i]->ref?$resourcestat->lines[$i]->ref:''.$resourcestat->lines[$i]->label; + if ($resourceclass != 'Dolresource') $label.=' ('.$langs->trans($resourceclass).')'; + if ($selected > 0 && $selected == $resourcestat->lines[$i]->id) { $out.= '';