Index: openacs-4/packages/contacts/tcl/contact-message-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-message-procs.tcl,v diff -u -N -r1.32 -r1.33 --- openacs-4/packages/contacts/tcl/contact-message-procs.tcl 5 Oct 2006 14:15:20 -0000 1.32 +++ openacs-4/packages/contacts/tcl/contact-message-procs.tcl 28 Oct 2006 16:51:50 -0000 1.33 @@ -275,7 +275,12 @@ -format $format] if { $mailing_address ne "" } { if {$with_name_p} { - set mailing_address "- [contact::name -party_id $party_id] -\n$mailing_address" + if {[person::person_p -party_id $party_id]} { + set mailing_address "- [contact::name -party_id $party_id] -\n$mailing_address" + } else { + set name "[contact::name -party_id $party_id] \n [ams::value -object_id $revision_id -attribute_name company_name_ext -format $format]" + set mailing_address "$name \n$mailing_address" + } } break } @@ -289,7 +294,10 @@ if { $mailing_address ne "" } { # We should display the company name. Currently handled outside this. if {$with_name_p} { - set mailing_address "[contact::name -party_id [lindex $employer 0]]\n- [contact::name -party_id $party_id] -\n $mailing_address" + set employer_id [lindex $employer 0] + set employer_rev_id [contact::live_revision -party_id $employer_id] + set name "[contact::name -party_id $employer_id]\n[ams::value -object_id $employer_rev_id -attribute_name company_name_ext -format $format]" + set mailing_address "$name\n- [contact::name -party_id $party_id] -\n$mailing_address" } break }