Ignore:
Timestamp:
05/23/08 17:10:39 (16 years ago)
Author:
brunocosta
Message:

Correção dos problemas gerados no commit anterior, a funcionalidade citada no ticket #199 foram temporariamente desativadas.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/contactcenter/inc/class.bo_catalog_group_catalog.inc.php

    r284 r285  
    2020 
    2121        include_once('class.abo_catalog.inc.php'); 
    22  
     22         
    2323        class bo_catalog_group_catalog extends abo_catalog 
    2424        { 
    25  
    2625                var $external; 
    27  
    2826                var $fields = array( 
    2927                        'id_contact'    => true, 
     
    4038                        'pgp_key'       => true, 
    4139                        'notes'         => true, 
    42  
     40                         
    4341                        /* Array fields */ 
    4442                        'companies'     => true, 
     
    4745                        'connections'   => true 
    4846                ); 
    49  
    50                 /*! 
    51  
     47         
     48                /*! 
     49                 
    5250                 @function bo_people_catalog 
    5351                 @abstract Constructor 
    5452                 @author Raphael Derosso Pereira 
    55  
     53                  
    5654                */ 
    57                 function bo_catalog_group_catalog(& $bo_contactcenter, & $catalog, $external = 0) 
     55                function bo_catalog_group_catalog(& $bo_contactcenter, & $catalog, $external = 0 ) 
    5856                { 
    5957                        $this->bo_contactcenter = & $bo_contactcenter; 
     
    6159                        $this->external = $external; 
    6260                } 
    63  
     61                         
    6462 
    6563                /*! 
     
    7169 
    7270                 @param SEE class bo_contactcenter for usage 
    73  
     71                 
    7472                */ 
    7573                function find($what, $rules, $other) 
     
    7775                        if ($ldap_info = $this->catalog['ldap']) 
    7876                        { 
    79  
    8077                                $meta_catalog =& CreateObject('contactcenter.bo_global_ldap_catalog',$ldap_info['id_source'], $ldap_info['context'], $this->external); 
    8178                                return $meta_catalog->find($what, $rules, $other); 
    8279                        } 
    83  
     80                         
    8481                        $results = array(); 
    85  
     82                         
    8683                        reset($this->catalog); 
    8784                        while(list(, $new_catalog) = each($this->catalog['sub_branch'])) 
     
    9087                                //echo 'Setting catalog: <b>'.$new_catalog['name'].'</b><br>'; 
    9188                                $new_catalog = $this->bo_contactcenter->set_catalog($new_catalog); 
    92  
     89                                 
    9390                                //if($new_catalog) echo 'Setado corretamente!<br><br>'; else echo 'Erro ao setar<br><br>'; 
    94  
     91                                 
    9592                                if ($new_catalog['type'] === 'empty') 
    9693                                { 
    9794                                        continue; 
    9895                                } 
    99  
     96                                 
    10097                                $temp_res = $this->bo_contactcenter->catalog->find($what, $rules, $other); 
    10198                                if (is_array($temp_res) and count($temp_res)) 
     
    111108                        return $result; 
    112109                } 
    113  
    114                 /*! 
    115  
     110                 
     111                /*! 
     112                 
    116113                 @function get_single_entry 
    117114                 @abstract Returns all information requested about one contact 
    118115                 @author Raphael Derosso Pereira 
    119  
     116                      
    120117                 @param integer $id_contact The contact ID 
    121118                 @param array $fields The array returned by get_fields whith true 
    122119                        on the fields to be taken. 
    123  
     120                         
    124121                */ 
    125122                function get_single_entry ( $id_contact, $fields ) 
    126                 { 
    127                         if (!is_array($fields)) 
    128                         { 
    129                                 if (is_object($GLOBALS['phpgw']->log)) 
     123                {        
     124                        if (!is_array($fields))  
     125                        { 
     126                                if (is_object($GLOBALS['phpgw']->log))  
    130127                                { 
    131128                                        $GLOBALS['phpgw']->log->message(array( 
     
    133130                                                'line' => __LINE__, 
    134131                                                'file' => __FILE__)); 
    135  
     132                                         
    136133                                        $GLOBALS['phpgw']->log->commit(); 
    137134                                } 
    138                                 else 
     135                                else  
    139136                                { 
    140137                                        exit('Argument Error on: <br>File:'.__FILE__.'<br>Line:'.__LINE__.'<br>'); 
    141138                                } 
    142139                        } 
    143  
     140                         
    144141                        $contact_array = $this->get_multiple_entries(array($id_contact), $fields); 
    145  
     142                         
    146143                        if (!count($contact_array)) 
    147144                        { 
     
    153150                        else 
    154151                                $contact_data = $contact_array[$id_contact]; 
    155  
     152                         
    156153                        if (!is_array($contact_data)) 
    157154                        { 
    158155                                return false; 
    159156                        } 
    160  
     157                         
    161158                        return $contact_data; 
    162159                } 
    163  
    164                 /*! 
    165  
     160         
     161                /*! 
     162                  
    166163                 @function get_multiple_entries 
    167164                 @abstract Returns multiple Contacts data into one array 
     
    176173                                'sort'      => <sort>, 
    177174                                'order_by'  => <order by> 
    178                         ); 
    179  
     175                        );  
     176                 
    180177                */ 
    181178                function get_multiple_entries ( $id_contacts, $fields, $other_data = false ) 
     
    183180                        if (!is_array($id_contacts) or !is_array($fields) or ($other_data != false and !is_array($other_data))) 
    184181                        { 
    185                                 if (is_object($GLOBALS['phpgw']->log)) 
     182                                if (is_object($GLOBALS['phpgw']->log))  
    186183                                { 
    187184                                        $GLOBALS['phpgw']->log->message(array( 
     
    189186                                                'line' => __LINE__, 
    190187                                                'file' => __FILE__)); 
    191  
     188                                         
    192189                                        $GLOBALS['phpgw']->log->commit(); 
    193190                                } 
     
    196193                                } 
    197194                        } 
    198  
     195                         
    199196                        $contacts = array(); 
    200  
     197         
    201198                        if ($other_data) 
    202199                        { 
    203200                                //TODO 
    204201                        } 
    205  
    206                         //error_log("bo_ldap_catalog_group_catalog->get_multiple_entries \n", 3, '/var/www/teste.log'); 
    207  
     202         
    208203                        /* First check if this is a LDAP Catalog Group. In this case, just leave the 
    209204                         * subtree search for the LDAP server 
     
    214209                                return $meta_catalog->get_multiple_entries($id_contacts, $fields, $other_data); 
    215210                        } 
    216  
     211                         
    217212                        /* Search for the catalog of the first entry and try to get all ids from that 
    218213                         * catalog. Repeat to the ones not found until there's none missing or no more 
     
    226221                                $this->bo_contactcenter->set_catalog($branch); 
    227222                                $contacts += $this->bo_contactcenter->catalog->get_multiple_entries($id_contacts, $fields, $other_data); 
    228  
     223                                 
    229224                                reset($contacts); 
    230225                                while (list($id) = each($contacts)) 
     
    243238 
    244239                        $this->bo_contactcenter->set_catalog($this->catalog); 
    245  
     240                         
    246241                        return $contacts; 
    247242                } 
    248  
     243         
    249244                function get_all_entries_ids () 
    250245                { 
     
    252247                        return null; 
    253248                } 
    254  
     249                 
    255250                /*********************************************************************\ 
    256251                 *                Methods to get general fields                      * 
    257252                \*********************************************************************/ 
    258  
     253                 
    259254                /*********************************************************************\ 
    260255                 *                   Methods to Include Data                         * 
Note: See TracChangeset for help on using the changeset viewer.