Changeset 4357 in subversion
- Timestamp:
- Dec 22, 2010 8:29:42 AM (2 years ago)
- Location:
- branches/devel-addressbook
- Files:
-
- 4 edited
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/rcube_ldap.php (modified) (5 diffs)
-
program/js/app.js (modified) (1 diff)
-
program/steps/addressbook/func.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/devel-addressbook/config/main.inc.php.dist
r4342 r4357 458 458 'search_fields' => array('mail', 'cn'), // fields to search in 459 459 'fieldmap' => array( // mapping of contact fields to directory attributes 460 // roundcube => ldap460 // Roundcube => LDAP 461 461 'name' => 'cn', 462 462 'surname' => 'sn', 463 463 'firstname' => 'givenName', 464 'phone' => 'telephoneNumber',465 464 'email' => 'mail', 465 'phone:home' => 'homePhone', 466 'phone:work' => 'telephoneNumber', 467 'phone:mobile' => 'mobile', 466 468 'street' => 'street', 467 469 'zipcode' => 'postalCode', -
branches/devel-addressbook/program/include/rcube_ldap.php
r4341 r4357 61 61 if (is_array($p['fieldmap'])) { 62 62 foreach ($p['fieldmap'] as $rf => $lf) 63 $this->fieldmap[$rf] = $this->_attr_name(strtolower($lf));63 $this->fieldmap[$rf] = $this->_attr_name(strtolower($lf)); 64 64 } 65 65 else { … … 71 71 72 72 // use fieldmap to advertise supported coltypes to the application 73 $this->coltypes = array_keys($this->fieldmap); 73 foreach ($this->fieldmap as $col => $lf) { 74 list($col, $type) = explode(':', $col); 75 if (!is_array($this->coltypes[$col])) 76 $this->coltypes[$col] = array('limit' => 1, 'subtypes' => array($type)); 77 else if ($type) { 78 $this->coltypes[$col]['subtypes'][] = $type; 79 $this->coltypes[$col]['limit']++; 80 } 81 if ($type && !$this->fieldmap[$col]) 82 $this->fieldmap[$col] = $lf; 83 } 84 74 85 if ($this->fieldmap['street'] && $this->fieldmap['locality']) 75 $this->coltypes[] = 'address'; 86 $this->coltypes['address'] = array('limit' => 1); 87 else if ($this->coltypes['address']) 88 $this->coltypes['address'] = array('type' => 'textarea', 'childs' => null, 'limit' => 1); 76 89 77 90 // make sure 'required_fields' is an array … … 547 560 $replacedata = array(); 548 561 $deletedata = array(); 549 foreach ($ save_cols as $col => $val) {550 $ fld = $this->_map_field($col);562 foreach ($this->fieldmap as $col => $fld) { 563 $val = $save_cols[$col]; 551 564 if ($fld) { 552 565 // The field does exist compare it to the ldap record. … … 589 602 if ($replacedata[$this->prop['LDAP_rdn']]) { 590 603 $newdn = $this->prop['LDAP_rdn'].'=' 591 .rcube_ldap::quote_string($replacedata[$this->prop['LDAP_rdn']], true)592 .','.$this->prop['base_dn']; 604 .rcube_ldap::quote_string($replacedata[$this->prop['LDAP_rdn']], true) 605 .','.$this->prop['base_dn']; 593 606 if ($dn != $newdn) { 594 607 $newrdn = $this->prop['LDAP_rdn'].'=' 595 .rcube_ldap::quote_string($replacedata[$this->prop['LDAP_rdn']], true);608 .rcube_ldap::quote_string($replacedata[$this->prop['LDAP_rdn']], true); 596 609 unset($replacedata[$this->prop['LDAP_rdn']]); 597 610 } … … 603 616 $this->_debug("S: ".ldap_error($this->conn)); 604 617 return false; 605 }618 } 606 619 $this->_debug("S: OK"); 607 620 } // end if -
branches/devel-addressbook/program/js/app.js
r4342 r4357 4083 4083 else 4084 4084 option = $('<option>').attr('value', col).html(colprop.label).appendTo(addmenu); 4085 } 4086 else 4087 alert('addmennu not found') 4085 addmenu.show(); 4086 } 4088 4087 }; 4089 4088 -
branches/devel-addressbook/program/steps/addressbook/func.inc
r4356 r4357 126 126 $id = strval($source['id'] ? $source['id'] : $j); 127 127 $js_id = JQ($id); 128 $dom_id = preg_replace('/[^a-z0-9\-_]/i', ' ', $id);128 $dom_id = preg_replace('/[^a-z0-9\-_]/i', '_', $id); 129 129 $out .= sprintf($line_templ, $dom_id, ($current === $id ? 'selected' : ''), 130 130 Q(rcmail_url(null, array('_source' => $id))), … … 500 500 501 501 // also render add-field selector 502 if ($edit_mode && $select_add->_count)503 $content .= html::p('addfield', $select_add->show(null ));502 if ($edit_mode) 503 $content .= html::p('addfield', $select_add->show(null, array('style' => $select_add->_count ? null : 'display:none'))); 504 504 505 505 $content = html::div(array('id' => 'contactsection' . $section), $content);
Note: See TracChangeset
for help on using the changeset viewer.
