Ignore:
Timestamp:
05/25/11 16:25:53 (13 years ago)
Author:
wmerlotto
Message:

Ticket #1935 - Correcao na importacao de contatos de arquivos CSV do contactcenter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.2.0.2/contactcenter/inc/class.so_group.inc.php

    r4502 r4510  
    423423                } 
    424424 
    425                 function verifyContact($email) 
    426                 { 
    427                         $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'. 
    428                         'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 
    429                         'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 
    430                         'and B.id_typeof_contact_connection = 1 and '. 
    431                         'A.id_owner ='.$this->owner.' and C.connection_value = \''.$email.'\''; 
    432                                                  
    433                         if (!$this->db->query($query)) 
    434                         { 
    435                                 exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 
    436                         } 
     425                function verifyContact($email, $name, $phone) 
     426                { 
     427                        if ($email) { 
     428                         
     429                                $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'. 
     430                                'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 
     431                                'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 
     432                                'and B.id_typeof_contact_connection = 1 and '. 
     433                                "A.id_owner ='" .$this->owner."' and C.connection_value = '".$email. "'"; 
     434 
     435                                if (!$this->db->query($query)) 
     436                                {        
     437                                        exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 
     438                                } 
    437439                          
    438                         $return = false; 
    439                          
    440                         while($this->db->next_record()) 
    441                         { 
    442                                 $row = $this->db->row(); 
    443                                 $return[] =  $row['names_ordered']; 
    444                                 $return[] =  $row['id_connection']; 
    445                         } 
    446                          
     440                                $return = false; 
     441                         
     442                                while($this->db->next_record()) 
     443                                { 
     444                                        $row = $this->db->row(); 
     445                                        $return[] =  $row['names_ordered'];  
     446                                } 
     447                        }  
     448                         
     449                        if (!$return && $phone) {  
     450 
     451                                $query = 'select A.names_ordered, C.id_connection from phpgw_cc_contact A,'. 
     452                                'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 
     453                                'A.id_contact = B.id_contact and B.id_connection = C.id_connection '. 
     454                                'and B.id_typeof_contact_connection = 2 and '. 
     455                                "A.id_owner ='" .$this->owner."' and C.connection_value = '".$phone. "'"; 
     456 
     457                                if (!$this->db->query($query)) 
     458                                {        
     459                                        exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 
     460                                } 
     461                          
     462                                $return = false; 
     463                         
     464                                while($this->db->next_record()) 
     465                                { 
     466                                        $row = $this->db->row(); 
     467                                        $return[] =  $row['names_ordered'];  
     468                                } 
     469 
     470                        } 
     471                         
     472                        if (!$return && $name) {  
     473 
     474                                $query = "select names_ordered, C.id_connection from phpgw_cc_contact where id_owner = '" . $this->owner . "' and RTRIM(names_ordered) = '". $name. "'"; 
     475 
     476                                if (!$this->db->query($query)) 
     477                                {        
     478                                        exit ('Query failed! File: '.__FILE__.' on line'.__LINE__); 
     479                                } 
     480                          
     481                                $return = false; 
     482                         
     483                                while($this->db->next_record()) 
     484                                { 
     485                                        $row = $this->db->row(); 
     486                                        $return[] =  $row['names_ordered'];  
     487                                } 
     488 
     489                        } 
     490                    $return[] =  $row['id_connection']; 
     491 
    447492                        return $return; 
    448493                }                
Note: See TracChangeset for help on using the changeset viewer.