Ignore:
Timestamp:
06/11/11 16:42:10 (13 years ago)
Author:
rafaelraymundo
Message:

Ticket #2006 - Incluir Contato Compartilhado duplicado

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.0.1/contactcenter/inc/class.ui_data.inc.php

    r4598 r4599  
    22892289                        foreach($data as $field => $value) 
    22902290                        { 
     2291                                $dataConn = $data['connections']; 
     2292                                $aa = count($dataConn); 
     2293 
     2294                                for($i = 0; $i < $aa; $i++ ) 
     2295                                { 
     2296                                    if($dataConn['connection'.$i]['connection_is_default'] == "TRUE") 
     2297                                    { 
     2298                                        $email = $dataConn['connection'.$i]['connection_value']; 
     2299                                    } 
     2300                                } 
     2301                                // verifica se email já existe! 
     2302                                $boGroup = CreateObject('contactcenter.bo_group'); 
     2303                                $contact = $boGroup->verify_contact($email); 
     2304                                if($contact) 
     2305                                { 
     2306                                    $str_contact = "\r\n - ".implode("\r\n - ",$contact); 
     2307                                    echo serialize(array( 
     2308                                    'msg'    => lang('Problems on adding your Contact. The email "%1" already exists in: %2',$tdata[4], $str_contact), 
     2309                                    'status' => 'alreadyExists' 
     2310                                    )); 
     2311                                    return; 
     2312                                } 
    22912313 
    22922314                                switch($field) 
     
    25782600                        foreach($data as $field => &$value) 
    25792601                        { 
     2602 
     2603                                $dataConn = $data['connections']; 
     2604                                $aa = count($dataConn); 
     2605 
     2606                                for($i = 0; $i < $aa; $i++ ) 
     2607                                { 
     2608                                    if($dataConn['connection'.$i]['connection_is_default'] == "TRUE") 
     2609                                    { 
     2610                                        $email = $dataConn['connection'.$i]['connection_value']; 
     2611                                    } 
     2612                                } 
     2613                                // verifica se email já existe! 
     2614                                $boGroup = CreateObject('contactcenter.bo_group'); 
     2615                                $contact = $boGroup->verify_shared_contact($owner,$email); 
     2616                                if($contact) 
     2617                                { 
     2618                                    $str_contact = "\r\n - ".implode("\r\n - ",$contact); 
     2619                                    echo serialize(array( 
     2620                                    'msg'    => lang('Problems on adding your Contact. The email "%1" already exists in: %2',$tdata[4], $str_contact), 
     2621                                    'status' => 'alreadyExists' 
     2622                                    )); 
     2623                                    return; 
     2624                                } 
     2625 
    25802626                                if ($value == '' or is_null($value)) 
    25812627                                { 
     
    26962742                                        case 'connections': 
    26972743                                                /* Does nothing... */ 
     2744                                                $aaaa = 1111; 
    26982745                                                break; 
    26992746 
Note: See TracChangeset for help on using the changeset viewer.