- Timestamp:
- 06/03/08 17:58:40 (16 years ago)
- Location:
- trunk/contactcenter/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/inc/class.so_group.inc.php
r285 r293 116 116 'phpgw_cc_contact_conns B, phpgw_cc_connections C where '. 117 117 'A.id_contact = B.id_contact and B.id_connection = C.id_connection and '. 118 ' C.connection_is_default = true and B.id_typeof_contact_connection = 1 and'.119 ' A.id_owner ='.$this->owner.'order by A.names_ordered,C.connection_value';118 'A.id_owner ='.$this->owner.' and C.connection_is_default = true '. 119 ' order by A.names_ordered,C.connection_value'; 120 120 121 121 … … 131 131 $return[] = $this->db->row(); 132 132 } 133 134 return $return; 133 134 // Essa iteração transforma uma esturuta com contatos redundantes e separados por email ou tel. 135 // em outra com apenas 1 elemento pra cada contato 136 foreach($return as $i => $object){ 137 if ($object['id_typeof_contact_connection'] == 1){ 138 $all_contacts[$object['id_contact']]['connection_value'] = $object['connection_value']; 139 $all_contacts[$object['id_contact']]['names_ordered'] = $object['names_ordered']; 140 $all_contacts[$object['id_contact']]['id_contact'] = $object['id_contact']; 141 $all_contacts[$object['id_contact']]['id_connection'] = $object['id_connection']; 142 } 143 else 144 if ($object['id_typeof_contact_connection'] == 2){ 145 $all_contacts[$object['id_contact']]['phone'] = $object['connection_value']; 146 $all_contacts[$object['id_contact']]['names_ordered'] = $object['names_ordered']; 147 $all_contacts[$object['id_contact']]['id_contact'] = $object['id_contact']; 148 $all_contacts[$object['id_contact']]['id_connection'] = $object['id_connection']; 149 } 150 } 151 152 return array_values($all_contacts); 135 153 } 136 154 -
trunk/contactcenter/inc/class.ui_data.inc.php
r285 r293 2742 2742 if(!count($contacts)) 2743 2743 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 contato2748 $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 else2755 $all_contacts[$i]['phone']=$object['connection_value'];2756 }2757 2744 2758 2745 switch($typeExport) { … … 2761 2748 $streamBuffer = "Name;E-mail Address;Notes;Mobile Phone;Pager;Company;". 2762 2749 "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"; 2765 2752 } 2766 2753 break; … … 2773 2760 "CEP do endereço comercial;Estado do endereço comercial;". 2774 2761 "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"; 2777 2764 } 2778 2765 break; … … 2797 2784 "\"Personalizado 3\",\"Personalizado 4\",\"Prioridade\",\"Profissão\",\"Quilometragem\",\"Sala\",\"Sensibilidade\",\"Servidor de diretório\",". 2798 2785 "\"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"; 2801 2788 } 2802 2789 break; … … 2813 2800 "Gender,Government ID Number,Hobby,Initials,Internet Free Busy,Keywords,Language,Location,Manager's Name,Mileage,Notes,". 2814 2801 "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"; 2817 2804 } 2818 2805 break; … … 2820 2807 case 'thunderbird': 2821 2808 $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"; 2824 2811 } 2825 2812 break; … … 2827 2814 case 'expresso': 2828 2815 $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"; 2831 2818 } 2832 2819 break;
Note: See TracChangeset
for help on using the changeset viewer.