Fix: Pb when option javascript disabled.

This commit is contained in:
Laurent Destailleur 2014-07-29 19:45:48 +02:00
parent c895c892a5
commit 6226d39cda
4 changed files with 13 additions and 5 deletions

View File

@ -673,7 +673,7 @@ class ExtraFields
elseif ($type == 'select') elseif ($type == 'select')
{ {
$out = ''; $out = '';
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT); $out.= ajax_combobox('options_'.$key.$keyprefix, array(), $conf->global->COMPANY_USE_SEARCH_TO_SELECT);

View File

@ -804,7 +804,7 @@ class Form
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
{ {
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php'; include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT); $out.= ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
@ -1008,6 +1008,7 @@ class Form
if ($conf->use_javascript_ajax && $conf->global->CONTACT_USE_SEARCH_TO_SELECT && ! $forcecombo && ! $options_only) if ($conf->use_javascript_ajax && $conf->global->CONTACT_USE_SEARCH_TO_SELECT && ! $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); $out.= ajax_combobox($htmlname, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
} }

View File

@ -77,11 +77,18 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
print '</td><td class="nowrap maxwidthonsmartphone">'; print '</td><td class="nowrap maxwidthonsmartphone">';
//print ' &nbsp;'; //print ' &nbsp;';
print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit); print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit);
print ajax_combobox('usertodo'); if (! empty($conf->use_javascript_ajax))
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
print ajax_combobox('usertodo');
}
print ' &nbsp; '.$langs->trans("or") . ' '; print ' &nbsp; '.$langs->trans("or") . ' ';
print $langs->trans("ActionsForUsersGroup").' &nbsp; '; print $langs->trans("ActionsForUsersGroup").' &nbsp; ';
print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit); print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit);
print ajax_combobox('usergroup'); if (! empty($conf->use_javascript_ajax))
{
print ajax_combobox('usergroup');
}
print '</td></tr>'; print '</td></tr>';
/*print '<tr>'; /*print '<tr>';

View File

@ -88,7 +88,7 @@ class FormResource
if ($resourcestat) if ($resourcestat)
{ {
if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT && ! $forcecombo) if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
{ {
//$minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); //$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); $out.= ajax_combobox($htmlname, $event, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);