Changeset 1937f46 in github


Ignore:
Timestamp:
Oct 30, 2011 11:30:59 AM (19 months ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
Children:
2429cfd
Parents:
abdf314
Message:

Improve definition of composite address fields of LDAP contacts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_ldap.php

    r187ff4e r1937f46  
    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        // support for composite address 
     121        if ($this->fieldmap['street'] && $this->fieldmap['locality']) { 
     122            $this->coltypes['address'] = array('limit' => max(1, $this->coltypes['locality']['limit']), 'subtypes' => $this->coltypes['locality']['subtypes']); 
     123            foreach (array('street','locality','zipcode','region','country') as $childcol) 
     124                unset($this->coltypes[$childcol]);  // remove address child col from global coltypes list 
     125        } 
    122126        else if ($this->coltypes['address']) 
    123127            $this->coltypes['address'] = array('type' => 'textarea', 'childs' => null, 'limit' => 1, 'size' => 40); 
Note: See TracChangeset for help on using the changeset viewer.