Ignore:
Timestamp:
05/20/11 17:03:00 (13 years ago)
Author:
airton
Message:

Ticket #1912 - Permitir a criação de contatos sem email

File:
1 edited

Legend:

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

    r4289 r4477  
    16821682                         
    16831683                        $boGroup = CreateObject('contactcenter.bo_group'); 
    1684  
    1685                         $all_contacts = $boGroup->get_all_contacts('only_email',$shared_from); 
     1684                         
     1685                        $all_contacts = $boGroup->get_all_contacts(false,$shared_from); 
     1686                         
    16861687                         
    16871688                        $contact_options = ""; 
    16881689                        if(count($all_contacts)) {                                       
    16891690                                foreach($all_contacts as $idx => $contact) {                             
    1690                                         $contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered']." (".$contact['connection_value'].")</OPTION>"; 
     1691                                        $contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered']; 
     1692                                        if (isset($contact['connection_value'])) 
     1693                                                $contact_options .= " (".$contact['connection_value'].")</OPTION>"; 
     1694                                        else 
     1695                                                $contact_options .= " (". $contact['phone'].")</OPTION>"; 
    16911696                                } 
    16921697                        } 
     
    19871992                        $data['contact_in_list'] = $new_tdata[1]; 
    19881993                        $data['id_group'] = $new_tdata[2]; 
     1994                         
     1995                        $contactWOemail = false;  
     1996                                  
     1997                        foreach ($data['contact_in_list'] as $id_connection)  
     1998                        {  
     1999                                $boConn = CreateObject('contactcenter.bo_connection');  
     2000                                $type = $boConn->get_connection_type_by_conn_id($id_connection);  
     2001                                if ($type != 1)  
     2002                                {  
     2003                                        $contactWOemail = true;  
     2004                                        break;  
     2005                                }  
     2006                        } 
     2007 
     2008 
    19892009                        $acumulatedErrors = ''; 
    19902010 
     
    20382058                        { 
    20392059                                $this->page_info['changed'] = true; 
    2040  
     2060                                 
     2061                                if (!$contactWOemail) 
     2062                                        echo serialize(array( 
     2063                                                'msg'    => lang('Entry added with success!'), 
     2064                                                'status' => 'ok' 
     2065                                                )); 
     2066                                else 
     2067                                        echo serialize(array( 
     2068                                                'msg'    => lang('Entry added with success. But some contacts will not receive or send messages.'), 
     2069                                                'status' => 'warning' 
     2070                                                )); 
     2071                        } 
     2072                        else 
     2073                        { 
    20412074                                echo serialize(array( 
    2042                                         'msg'    => lang('Entry added with success!'), 
    2043                                         'status' => 'ok' 
    2044                                 )); 
    2045                         } 
    2046                         else 
    2047                         { 
    2048                                 echo serialize(array( 
    2049                                         'msg'    => lang('Problems on adding your Contact. No Contact added!'). 
    2050                                             "\n".$acumulatedErrors, 
     2075                                        'msg'    => lang('Problems on adding your Contact. No Contact added!'), 
    20512076                                        'status' => 'error' 
    20522077                                )); 
Note: See TracChangeset for help on using the changeset viewer.