Changeset 502


Ignore:
Timestamp:
10/01/08 16:45:47 (16 years ago)
Author:
niltonneto
Message:

Na função get_cc_contacts, adiciona os contatos compartilhados, caso exista algum.

File:
1 edited

Legend:

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

    r484 r502  
    44include_once(PHPGW_API_INC.'/class.db.inc.php'); 
    55include_once('class.dynamic_contacts.inc.php'); 
    6  
     6         
    77class db_functions 
    88{        
     
    3131                $stringDropDownContacts = ''; 
    3232                // Pesquisa no CC os nomes e email dos contatos. 
    33                 $query = 'select A.names_ordered, C.connection_value from phpgw_cc_contact A,'. 
    34                 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 
    35         'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 
    36         'and B.id_typeof_contact_connection = 1 and '. 
    37         'A.id_owner ='.$this -> user_id.' order by A.names_ordered'; 
    38                                  
     33                $query = 'select A.names_ordered, C.connection_value from phpgw_cc_contact A, 
     34                                        phpgw_cc_contact_conns B, phpgw_cc_connections C where 
     35                                        A.id_contact = B.id_contact and B.id_connection = C.id_connection 
     36                                        and B.id_typeof_contact_connection = 1 and 
     37                                        (A.id_owner ='.$this -> user_id.' or  
     38                                        A.id_owner in ( 
     39                                        select id_related from phpgw_cc_contact_rels where id_contact='.$this -> user_id.' and id_typeof_contact_relation=1 
     40                                        ) 
     41                                        )  
     42                                        group by A.names_ordered,C.connection_value 
     43                                        order by A.names_ordered'; 
    3944        if (!$this->db->query($query)) 
    4045                return null; 
     
    143148        } 
    144149 
    145         function get_dropdown_contacts() { 
     150        function get_dropdown_contacts(){ 
    146151                 
    147152                $contacts = $this -> get_cc_contacts(); 
     
    156161                elseif ((!$contacts) && ($groups)) 
    157162                        $stringDropDownContacts = $groups; 
    158  
     163                                         
    159164                if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] && 
    160165                        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_dynamic_contacts']) { 
     
    274279                { 
    275280                return $this->db->Error; 
    276         } 
     281} 
    277282                while($this->db->next_record()) 
    278283                { 
     
    292297                return $contacts; 
    293298        } 
    294          
    295299        function update_contacts($contacts=array()) 
    296300        {                        
Note: See TracChangeset for help on using the changeset viewer.