Ignore:
Timestamp:
06/03/08 17:58:40 (16 years ago)
Author:
niltonneto
Message:

Bug de exportação de contato com telefones

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/contactcenter/inc/class.ui_data.inc.php

    r285 r293  
    27422742                        if(!count($contacts)) 
    27432743                                echo null; 
    2744  
    2745  
    2746                         // Essa iteração transforma uma esturuta com contatos redundantes e separados por email ou tel. 
    2747                         // em outra com apenas 1 elemento pra cada contato 
    2748                         $i=0; 
    2749                         foreach($contacts as $object){ 
    2750                                 $i=($object['id_contact'] - 1); 
    2751                                 $all_contacts[$i]['name']=$object['names_ordered']; 
    2752                                 if ($object['id_typeof_contact_connection'] == 1) 
    2753                                         $all_contacts[$i]['email']=$object['connection_value']; 
    2754                                 else 
    2755                                         $all_contacts[$i]['phone']=$object['connection_value']; 
    2756                         } 
    27572744                         
    27582745                        switch($typeExport) { 
     
    27612748                                        $streamBuffer = "Name;E-mail Address;Notes;Mobile Phone;Pager;Company;". 
    27622749                                                        "Job Title;Home Phone;Home Fax;Business Phone;Business Fax\r\n";                                                         
    2763                                         foreach($all_contacts as $index => $object){ 
    2764                                                 $streamBuffer.= $object['name'].";".$object['email'].";;;;;;".$object['phone'].";;;\r\n"; 
     2750                                        foreach($contacts as $index => $object){ 
     2751                                                $streamBuffer.= $object['names_ordered'].";".$object['connection_value'].";;;;;;".$object['phone'].";;;\r\n"; 
    27652752                                        } 
    27662753                                break; 
     
    27732760                                        "CEP do endereço comercial;Estado do endereço comercial;". 
    27742761                                        "País/região do endereço comercial;Telefone comercial;Empresa;Cargo\r\n";                                                        
    2775                                         foreach($all_contacts as $index => $object){ 
    2776                                                 $streamBuffer.= $object['name'].";".$object['email'].";;;;;;".$object['phone'].";;;;;;;;\r\n"; 
     2762                                        foreach($contacts as $index => $object){ 
     2763                                                $streamBuffer.= $object['names_ordered'].";".$object['connection_value'].";;;;;;".$object['phone'].";;;;;;;;\r\n"; 
    27772764                                        } 
    27782765                                break; 
     
    27972784                                        "\"Personalizado 3\",\"Personalizado 4\",\"Prioridade\",\"Profissão\",\"Quilometragem\",\"Sala\",\"Sensibilidade\",\"Servidor de diretório\",". 
    27982785                                        "\"Sexo\"\r\n"; 
    2799                                         foreach($all_contacts as $index => $object){ 
    2800                                                 $streamBuffer.= ",\"".$object['name']."\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,".$object['phone'].",,,,,,,,,,,,\"".$object['email']."\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n"; 
     2786                                        foreach($contacts as $index => $object){ 
     2787                                                $streamBuffer.= ",\"".$object['names_ordered']."\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,".$object['phone'].",,,,,,,,,,,,\"".$object['connection_value']."\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n"; 
    28012788                                        } 
    28022789                                break; 
     
    28132800                                        "Gender,Government ID Number,Hobby,Initials,Internet Free Busy,Keywords,Language,Location,Manager's Name,Mileage,Notes,". 
    28142801                                        "Office Location,Organizational ID Number,PO Box,Priority,Private,Profession,Referred By,Sensitivity,Spouse,User 1,User 2,User 3,User 4,Web Page\r\n"; 
    2815                                         foreach($all_contacts as $index => $object){ 
    2816                                                 $streamBuffer.= ",".$object['name'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,".$object['phone'].",,,,,,,,,,,,".$object['email'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n"; 
     2802                                        foreach($contacts as $index => $object){ 
     2803                                                $streamBuffer.= ",".$object['names_ordered'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,".$object['phone'].",,,,,,,,,,,,".$object['connection_value'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n"; 
    28172804                                        } 
    28182805                                break; 
     
    28202807                                case 'thunderbird': 
    28212808                                        $streamBuffer = "\n";                                                    
    2822                                         foreach($all_contacts as $index => $object){ 
    2823                                                 $streamBuffer.= ",,".$object['name'].",,".$object['email'].",,".$object['phone'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n"; 
     2809                                        foreach($contacts as $index => $object){ 
     2810                                                $streamBuffer.= ",,".$object['names_ordered'].",,".$object['connection_value'].",,".$object['phone'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n"; 
    28242811                                        } 
    28252812                                break; 
     
    28272814                                case 'expresso': 
    28282815                                        $streamBuffer = "Nome,Email,Telefone\r\n"; 
    2829                                         foreach($all_contacts as $index => $object){ 
    2830                                                 $streamBuffer.= $object['name'].",".$object['email'].",".$object['phone']."\r\n"; 
     2816                                        foreach($contacts as $index => $object){ 
     2817                                                $streamBuffer.= $object['names_ordered'].",".$object['connection_value'].",".$object['phone']."\r\n"; 
    28312818                                        } 
    28322819                                break; 
Note: See TracChangeset for help on using the changeset viewer.