Index: openacs-4/packages/contacts/lib/contacts.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/contacts.tcl,v diff -u -r1.26 -r1.27 --- openacs-4/packages/contacts/lib/contacts.tcl 19 Oct 2005 16:58:36 -0000 1.26 +++ openacs-4/packages/contacts/lib/contacts.tcl 20 Oct 2005 13:21:39 -0000 1.27 @@ -179,7 +179,7 @@ {$name_label} \ display_template \ { - @contacts.name@ + @contacts.name;noquote@@contacts.orga_info;noquote@ \[[_ contacts.Edit]\] @@ -304,7 +304,7 @@ } } -set extend "$attr_extend contact_url message_url name" +set extend "$attr_extend contact_url message_url name orga_info" db_multirow -extend $extend -unclobber contacts contacts_select " " { set contact_url [contact::url -party_id $party_id] @@ -316,6 +316,26 @@ set attr_object_id [db_string get_attr_object_id { } -default ""] set $attr [ams::value -object_id $attr_object_id -attribute_id $attribute_id -attribute_name $attribute_name] } + + set display_employers_p [parameter::get -parameter DisplayEmployersP -package_id [apm_package_id_from_key "contacts"] -default "0"] + + if {$display_employers_p && [person::person_p -party_id $party_id]} { + # We want to display the names of the organization behind the employees name + set organizations [contact::util::get_employers -employee_id $party_id] + if {[llength $organizations] > 0} { + set orga_info {} + foreach organization $organizations { + set organization_url [contact::url -party_id [lindex $organization 0]] + set organization_name [lindex $organization 1] + lappend orga_info "$organization_name" + } + + if {![empty_string_p $orga_info]} { + set orga_info " - ([join $orga_info ", "])" + } + } + } + } if { [exists_and_not_null query] && [template::multirow size contacts] == 1 } { Index: openacs-4/packages/contacts/tcl/contacts-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-procs.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/contacts/tcl/contacts-procs.tcl 19 Oct 2005 18:17:57 -0000 1.36 +++ openacs-4/packages/contacts/tcl/contacts-procs.tcl 20 Oct 2005 13:21:39 -0000 1.37 @@ -253,22 +253,6 @@ } { if {[person::person_p -party_id $party_id]} { set person_info [person::name -person_id $party_id] - set ok [parameter::get -parameter DisplayEmployersP -package_id [apm_package_id_from_key "contacts"]] - if {$ok} { - set organizations [contact::util::get_employers -employee_id $party_id] - if {[llength $organizations] > 0} { - append person_info " (" - foreach organization $organizations { - set organization_url [contact::url -party_id [lindex $organization 0]] - set organization_name [lindex $organization 1] - append person_info "$organization_name" - append person_info ", " - } - # for some reason the following line does not work - set $person_info [string trimright $person_info ", "] - append person_info ")" - } - } return $person_info } else { # if there is an org the name is returned otherwise we search for a grou,