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.27 -r1.28 --- openacs-4/packages/contacts/tcl/contacts-procs.tcl 24 Aug 2005 10:50:07 -0000 1.27 +++ openacs-4/packages/contacts/tcl/contacts-procs.tcl 14 Sep 2005 16:43:35 -0000 1.28 @@ -113,9 +113,15 @@ if {[contact::person_p -party_id $party_id]} { return [person::name -person_id $party_id] } else { - # if there is an org the name is returned otherwise null is - # returned - return [db_string get_org_name {select name from organizations where organization_id = :party_id} -default {}] + # if there is an org the name is returned otherwise we search for a grou, + # if there is no group null is returned + set name [db_string get_org_name {select name from organizations where organization_id = :party_id} -default ""] + if { [empty_string_p $name] } { + set name [db_string get_group_name {select group_name from groups where group_id = :party_id} -default {}] + } else { + return $name + } + } }