Changeset 5736 in subversion


Ignore:
Timestamp:
Jan 6, 2012 10:57:33 AM (18 months ago)
Author:
thomasb
Message:

Migrate LDAP fieldmap fix from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-0.7/program/include/rcube_ldap.php

    r5706 r5736  
    108108            if (!is_array($this->coltypes[$col])) { 
    109109                $subtypes = $type ? array($type) : null; 
    110                 $this->coltypes[$col] = array('limit' => 2, 'subtypes' => $subtypes); 
     110                $this->coltypes[$col] = array('limit' => 1, 'subtypes' => $subtypes); 
    111111            } 
    112112            elseif ($type) { 
     
    118118        } 
    119119 
    120         if ($this->fieldmap['street'] && $this->fieldmap['locality']) 
    121             $this->coltypes['address'] = array('limit' => 1); 
     120        if ($this->fieldmap['street'] && $this->fieldmap['locality']) { 
     121            $this->coltypes['address'] = array('limit' => max(1, $this->coltypes['locality']['limit']), 'subtypes' => $this->coltypes['locality']['subtypes'], 'childs' => array()); 
     122            foreach (array('street','locality','zipcode','region','country') as $childcol) { 
     123                if ($this->fieldmap[$childcol]) { 
     124                    $this->coltypes['address']['childs'][$childcol] = array('type' => 'text'); 
     125                    unset($this->coltypes[$childcol]);  // remove address child col from global coltypes list 
     126                } 
     127            } 
     128        } 
    122129        else if ($this->coltypes['address']) 
    123130            $this->coltypes['address'] = array('type' => 'textarea', 'childs' => null, 'limit' => 1, 'size' => 40); 
Note: See TracChangeset for help on using the changeset viewer.