Changeset 6532 for trunk


Ignore:
Timestamp:
06/18/12 12:04:51 (12 years ago)
Author:
gustavo
Message:

Ticket #2766 - Remocao das antigas chamadas e funcoes que faziam o CRUD de contatos dinamicos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.db_functions.inc.php

    r6528 r6532  
    247247        } 
    248248 
    249         //Gera lista de contatos para ser gravado e acessado pelo expresso offline. 
    250         /*function get_dropdown_contacts_to_cache() { 
    251                 return $this->get_dropdown_contacts(); 
    252         } 
    253          
    254         function get_dropdown_contacts(){ 
    255                 $contacts = $this->get_cc_contacts(); 
    256                 $groups = $this->get_cc_groups(); 
    257                  
    258                 if(($contacts) && ($groups)) 
    259                         $stringDropDownContacts = $contacts . ',' . $groups; 
    260                 elseif ((!$contacts) && (!$groups)) 
    261                         $stringDropDownContacts = ''; 
    262                 elseif (($contacts) && (!$groups)) 
    263                         $stringDropDownContacts = $contacts; 
    264                 elseif ((!$contacts) && ($groups)) 
    265                         $stringDropDownContacts = $groups; 
    266                                          
    267                 if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts']) { 
    268                         // Free others requests  
    269                         session_write_close();  
    270                         $dynamic_contact = new dynamic_contacts(); 
    271                         $dynamic = $dynamic_contact->dynamic_contact_toString(); 
    272                         if ($dynamic) 
    273                                 $stringDropDownContacts .= ($stringDropDownContacts ? ',' : '') . $dynamic; 
    274                 } 
    275                 return $stringDropDownContacts;  
    276         }*/ 
    277249        function getUserByEmail($params){        
    278250                // Follow the referral 
     
    307279                return $result; 
    308280        } 
    309         /* 
    310         function get_dynamic_contacts() 
    311         {                                
    312                 // Pesquisa os emails e ultima inserção nos contatos dinamicos. 
    313                 if(!$this->db->select('phpgw_expressomail_contacts','data','id_owner ='.$this->user_id,__LINE__,__FILE__)) 
    314                 { 
    315                 return $this->db->Error; 
    316 } 
    317                 while($this->db->next_record()) 
    318                 { 
    319                         $result[] = $this->db->row(); 
    320                 } 
    321                 if($result) foreach($result as $item)  
    322                 { 
    323                         $contacts = unserialize($item['data']); 
    324                 } 
    325                 if (count($contacts) == 0) 
    326                 {                        
    327                         return null; 
    328                 }        
    329                 //Sort by email 
    330                 function cmp($a, $b) { return strcmp($a["email"], $b["email"]);}  
    331                 usort($contacts,"cmp"); 
    332                 return $contacts; 
    333         } 
    334         */ 
    335         /* 
    336         function update_contacts($contacts=array()) 
    337         {                        
    338                  
    339          
    340                 if(!$this->db->select('phpgw_expressomail_contacts','data','id_owner ='.$this->user_id,__LINE__,__FILE__)) 
    341         { 
    342             $result['dberr1'] = $this->db->Error; 
    343         } 
    344                 $regs = array(); 
    345                 while($this->db->next_record()) 
    346         { 
    347             $regs[] = $this->db->row(); 
    348         } 
    349                 $old_contatacts = array(); 
    350                 foreach($regs as $old){ 
    351                         $old_contatacts = unserialize($old['data']); 
    352                 } 
    353                   
    354                 foreach($old_contatacts as $i => $v) 
    355                         foreach($contacts as $ii => $vv) 
    356                                 if(trim($v['email']) == trim($vv['email'])) 
    357                                         unset($old_contatacts[$i]); 
    358                  
    359                   
    360                  $old_contatacts = array_merge( $old_contatacts , $contacts);            
    361                 // Atualiza um email nos contatos dinamicos. 
    362                 if(!$this->db->update('phpgw_expressomail_contacts ','data=\''.serialize($old_contatacts).'\'','id_owner ='.$this->user_id,__LINE__,__FILE__)) 
    363                 { 
    364                         return $this->db->Error; 
    365                 } 
    366                 return $contacts; 
    367         }       */ 
    368281         
    369282        function update_preferences($params){ 
     
    379292        } 
    380293         
    381         /* 
    382         function insert_contact($contact)        
    383         { 
    384                 $contacts[] = array( 'timestamp'        => time(), 
    385                                                                 'email'         => $contact ); 
    386  
    387                 // Insere um email nos contatos dinamicos.       
    388                 $query = 'INSERT INTO phpgw_expressomail_contacts (data, id_owner)  ' . 
    389                                         'values ( \''.serialize($contacts).'\', '.$this->user_id.')'; 
    390                  
    391                 if(!$this->db->query($query,__LINE__,__FILE__)) 
    392                 return $this->db->Error; 
    393         return $contacts; 
    394         } 
    395          
    396         function remove_dynamic_contact($user_id,$line,$file) 
    397         { 
    398                 $where = $user_id.' = id_owner'; 
    399                 $this->db->delete('phpgw_expressomail_contacts',$where,$line,$file);     
    400         } 
    401         */  
    402294        function import_vcard($params){ 
    403295            include_once('class.imap_functions.inc.php'); 
Note: See TracChangeset for help on using the changeset viewer.