Ignore:
Timestamp:
05/25/11 12:08:00 (13 years ago)
Author:
airton
Message:

Ticket #1928 - Falhas na associação de um contato com um grupo de contato

File:
1 edited

Legend:

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

    r4500 r4502  
    20292029                        $data['contact_in_list'] = $new_tdata[1]; 
    20302030                        $data['id_group'] = $new_tdata[2]; 
     2031                        $data['old_contacts_in_list'] = $new_tdata[3]; 
    20312032                         
    2032                         $contactWOemail = false;  
    2033                                   
    2034                         foreach ($data['contact_in_list'] as $id_connection)  
    2035                         {  
    2036                                 $boConn = CreateObject('contactcenter.bo_connection');  
    2037                                 $type = $boConn->get_connection_type_by_conn_id($id_connection);  
    2038                                 if ($type != 1)  
    2039                                 {  
    2040                                         $contactWOemail = true;  
    2041                                         break;  
    2042                                 }  
    2043                         } 
    2044  
    2045  
     2033                        foreach ($data['old_contacts_in_list'] as $id_connection) 
     2034                        { 
     2035                                $boConn = CreateObject('contactcenter.bo_connection'); 
     2036 
     2037                                $id_contact = $boConn->get_contact_id_by_connection($id_connection); 
     2038                                $contact = CreateObject('contactcenter.so_contact', $id_contact); 
     2039                                $contact->set_field("last_status", 'U'); 
     2040                                $contact->set_field("last_update",time()."000"); 
     2041                                $contact->commit(); 
     2042                        } 
     2043                                                 
     2044                        $contactWOemail = false; 
     2045 
     2046                        foreach ($data['contact_in_list'] as $id_connection) 
     2047                        { 
     2048                                $boConn = CreateObject('contactcenter.bo_connection'); 
     2049                                 
     2050                                $id_contact = $boConn->get_contact_id_by_connection($id_connection); 
     2051                                $contact = CreateObject('contactcenter.so_contact', $id_contact); 
     2052                                $contact->set_field("last_status", 'U'); 
     2053                                $contact->set_field("last_update",time()."000"); 
     2054                                $contact->commit(); 
     2055                                 
     2056                                if (!$contactWOemail) 
     2057                                { 
     2058                                        $type = $boConn->get_connection_type_by_conn_id($id_connection); 
     2059                                        if ($type != 1) 
     2060                                        { 
     2061                                                $contactWOemail = true; 
     2062                                        } 
     2063                                } 
     2064                        } 
     2065 
     2066  
    20462067                        $acumulatedErrors = ''; 
    20472068 
     
    24972518                        if (!is_null($id) and $id !== '') 
    24982519                        { 
    2499                                 $id = $this->bo->catalog->update_single_info($id, $data);  
     2520                                $old_connections = $this->bo->catalog->get_connections($id); 
     2521                                $id = $this->bo->catalog->update_single_info($id, $data); 
    25002522                                $result = array( 
    25012523                                        'msg' => lang('Updated Successfully!'), 
     
    25222544                        else 
    25232545                        { 
    2524                                 $this->bo->catalog->update_contact_groups($id, $groups); 
     2546                                if (isset($old_connections)) 
     2547                                        $this->bo->catalog->update_contact_groups($id, $groups, $old_connections); 
     2548                                else 
     2549                                        $this->bo->catalog->update_contact_groups($id, $groups); 
    25252550                        } 
    25262551 
Note: See TracChangeset for help on using the changeset viewer.