svncommit
2006-01-08 9d2c0d496713fef847415616146ae8e6868ba242
fixed bug with field choice dropdown not appearing when only one ldap server is configured - thanks to Pieter Hoekstra for the report


2 files modified
20 ■■■■ changed files
program/steps/addressbook/ldapsearchform.inc 17 ●●●● patch | view | raw | blame | history
skins/default/includes/ldapscripts.html 3 ●●●● patch | view | raw | blame | history
program/steps/addressbook/ldapsearchform.inc
@@ -83,14 +83,26 @@
              rep_specialchars_output(rcube_label('ldappublicsearchfield')) . 
              "</label></td><td>" . $search_fields->show() . "</td></tr>\n";
      $search_type = new checkbox(array('name' => '_ldap_public_search_type',
                                        'id' => 'rcmfd_ldap_public_search_type', 'value' => 0));
      $attributes = array('name'  => '_ldap_public_search_type',
                          'id'    => 'rcmfd_ldap_public_search_type');
      // if there's only one server, and it doesn't accept fuzzy searches,
      // then check and disable the check box - thanks pieter
      if ($server_count == 1 && !$server['fuzzy_search'])
        {
        $attributes['CHECKED'] = 'CHECKED';
        $attributes['disabled'] = 'disabled';
        }
      $search_type = new checkbox($attributes);
      $out .= '<tr id="ldap_fuzzy_search"><td class="title"><label for="rcmfd_ldap_public_search_type">' .
              rep_specialchars_output(rcube_label('ldappublicsearchtype')) .
              "</label></td><td>" . $search_type->show() . "</td></tr>\n";
      }
    if ($server_count > 1)
      {
    // store the search fields in a js array for each server
    $js = '';
    foreach ($server['search_fields'] as $k => $search_field)
@@ -100,6 +112,7 @@
    $js .= $server['fuzzy_search'] ? "'fuzzy'" : "'exact'";
    $OUTPUT->add_script("rcmail.set_env('{$server_names[$i]}_search_fields', new Array($js));");
    }
    }
  // add contact button label text
  $OUTPUT->add_script("rcmail.set_env('addcontact', '" . rcube_label('addcontact') . "');");
skins/default/includes/ldapscripts.html
@@ -1,15 +1,16 @@
<script type="text/javascript">
var ldap_server_select = document.getElementById('rcfmd_ldap_public_servers');
if (ldap_server_select) {
  // attach event to ldap server drop down
  ldap_server_select.onchange = function() {
    updateLdapSearchFields(this);
    return false;
  }
}
// update the fields on page load
updateLdapSearchFields(ldap_server_select);
}
/**
 * function to change the attributes of the ldap server search fields select box