Changeset 3ac5cdb in github


Ignore:
Timestamp:
Oct 30, 2011 12:33:09 PM (20 months ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
Children:
fda58b1
Parents:
2429cfd
Message:

Also merge properties of child cols of composite address book fields + remove undefined fields from template

Location:
program
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_ldap.php

    r1937f46 r3ac5cdb  
    120120        // support for composite address 
    121121        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 
     122            $this->coltypes['address'] = array('limit' => max(1, $this->coltypes['locality']['limit']), 'subtypes' => $this->coltypes['locality']['subtypes'], 'childs' => array()); 
     123            foreach (array('street','locality','zipcode','region','country') as $childcol) { 
     124                if ($this->fieldmap[$childcol]) { 
     125                    $this->coltypes['address']['childs'][$childcol] = array('type' => 'text'); 
     126                    unset($this->coltypes[$childcol]);  // remove address child col from global coltypes list 
     127                } 
     128            } 
    125129        } 
    126130        else if ($this->coltypes['address']) 
  • program/steps/addressbook/func.inc

    r7772ae2 r3ac5cdb  
    141141        // add associative coltypes definition 
    142142        if (!$CONTACTS->coltypes[0]) { 
    143             foreach ($CONTACTS->coltypes as $col => $colprop) 
     143            foreach ($CONTACTS->coltypes as $col => $colprop) { 
     144                if (is_array($colprop['childs'])) { 
     145                    foreach ($colprop['childs'] as $childcol => $childprop) 
     146                        $colprop['childs'][$childcol] = array_merge((array)$CONTACT_COLTYPES[$col]['childs'][$childcol], $childprop); 
     147                } 
    144148                $CONTACT_COLTYPES[$col] = $CONTACT_COLTYPES[$col] ? array_merge($CONTACT_COLTYPES[$col], $colprop) : $colprop; 
     149            } 
    145150        } 
    146151    } 
     
    598603                        $coltypes[$field] += (array)$colprop; 
    599604                        $coltypes[$field]['count']++; 
    600                         $val = strtr($template, $composite); 
     605                        $val = preg_replace('/\{\w+\}/', '', strtr($template, $composite)); 
    601606                    } 
    602607                    else if ($edit_mode) { 
Note: See TracChangeset for help on using the changeset viewer.