Index: openacs-4/packages/contacts/lib/contact-relationships-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/contact-relationships-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/contacts/lib/contact-relationships-postgresql.xql 10 Mar 2006 09:39:34 -0000 1.5 +++ openacs-4/packages/contacts/lib/contact-relationships-postgresql.xql 27 Apr 2006 06:37:21 -0000 1.6 @@ -3,7 +3,7 @@ -select rel_id, other_name, other_party_id, role_singular, role_plural, rel_type +select rel_id, other_name, other_party_id, role_singular, role_plural, rel_type, creation_date from ( select CASE WHEN object_id_one = :party_id THEN contact__name(object_id_two,'t') ELSE contact__name(object_id_one,'t') END as other_name, CASE WHEN object_id_one = :party_id THEN object_id_two ELSE object_id_one END as other_party_id, CASE WHEN object_id_one = :party_id THEN role_two ELSE role_one END as role, @@ -13,9 +13,11 @@ from acs_rels, acs_rel_types where acs_rels.rel_type = acs_rel_types.rel_type + and acs_objects.object_id = acs_rels.rel_id and ( object_id_one = :party_id or object_id_two = :party_id ) and acs_rels.rel_type in ( select object_type from acs_object_types where supertype = 'contact_rel') - ) rels_temp + ) rels_temp, acs_objects + where rels_temp.rel_id = acs_objects.object_id order by upper(role_singular) asc, upper(other_name)