@@ -97,16 +97,18 @@ public function process() {
9797 */
9898class Hm_Handler_find_message_contacts extends Hm_Handler_Module {
9999 public function process () {
100- $ contacts = array ();
101100 $ existing = $ this ->get ('contact_store ' );
102101 $ addr_headers = array ('to ' , 'cc ' , 'bcc ' , 'sender ' , 'reply-to ' , 'from ' );
103102 $ headers = $ this ->get ('msg_headers ' , array ());
104103 $ addresses = array ();
105104 foreach ($ headers as $ name => $ value ) {
106105 if (in_array (mb_strtolower ($ name ), $ addr_headers , true )) {
107- foreach (Hm_Address_Field::parse ($ value ) as $ vals ) {
108- if (!$ existing ->search (array ('email_address ' => $ vals ['email ' ]))) {
109- $ addresses [] = $ vals ;
106+ $ values = is_array ($ value ) ? $ value : array ($ value );
107+ foreach ($ values as $ val ) {
108+ foreach (Hm_Address_Field::parse ($ val ) as $ v ) {
109+ if (!$ existing ->search (array ('email_address ' => $ v ['email ' ]))) {
110+ $ addresses [] = $ v ;
111+ }
110112 }
111113 }
112114 }
@@ -391,7 +393,7 @@ protected function output() {
391393 '<i class="bi bi-person-fill"></i> ' .
392394 '</d><td> ' .$ this ->html_safe ($ c ->value ('type ' )).'<td><span class="contact_src"> ' .
393395 ($ c ->value ('source ' ) == 'local ' ? '' : $ this ->html_safe ($ c ->value ('source ' ))).'</span> ' .
394- '</td><td> ' . $ this ->html_safe ($ name ) . '</td> ' .
396+ '</td><td class="contact_name_fld" data-title=" ' . $ this -> html_safe ( $ name ) . ' " > ' . $ this ->html_safe ($ name ) . '</td> ' .
395397 '<td><div class="contact_fld"> ' .$ this ->html_safe ($ c ->value ('email_address ' )).'</div></td> ' .
396398 '<td class="contact_fld"><a href="tel: ' .$ this ->html_safe ($ c ->value ('phone_number ' )).'"> ' .
397399 $ this ->html_safe ($ c ->value ('phone_number ' )).'</a></td> ' .
@@ -411,8 +413,7 @@ protected function output() {
411413 $ edit_url = Hm_LDAP_Contact::addDNToUrl ($ c , $ edit_url );
412414 }
413415
414- $ res .= '<a ' .$ delete_attrs .' class="delete_contact cursor-pointer" title=" ' .$ this ->trans ('Delete ' ).'"><i class="bi bi-trash3 text-danger ms-2"></i></a> ' .
415- '<a href=" ' .$ edit_url .'" class="edit_contact cursor-pointer" title=" ' .$ this ->trans ('Edit ' ).'"><i class="bi bi-pencil-square ms-2"></i></a> ' ;
416+ $ res .= '<a href=" ' .$ edit_url .'" class="edit_contact cursor-pointer" title=" ' .$ this ->trans ('Edit ' ).'"><i class="bi bi-gear ms-2"></i></a> ' ;
416417 }
417418
418419 $ send_to_url = '?page=compose&contact_id= ' .$ this ->html_safe ($ c ->value ('id ' )).
@@ -424,7 +425,11 @@ protected function output() {
424425 }
425426
426427 $ res .= '<a href=" ' .$ send_to_url .'" class="send_to_contact cursor-pointer" title=" ' .$ this ->trans ('Send To ' ).'"> ' .
427- '<i class="bi bi-envelope-arrow-up ms-2"></i></a> ' ;
428+ '<i class="bi bi-file-earmark-text ms-2"></i></a> ' ;
429+
430+ if (in_array ($ c ->value ('type ' ).': ' .$ c ->value ('source ' ), $ editable , true )) {
431+ $ res .= '<a ' .$ delete_attrs .' class="delete_contact cursor-pointer ms-3" title=" ' .$ this ->trans ('Delete ' ).'"><i class="bi bi-trash3 text-danger"></i></a> ' ;
432+ }
428433
429434 $ res .= '</td></tr> ' ;
430435 $ res .= '<tr><td id="contact_ ' .$ this ->html_safe ($ c ->value ('id ' )).'_detail" class="contact_detail_row" colspan="6"> ' ;
0 commit comments