Index: openacs-4/packages/contacts/lib/contacts-aggregated.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/contacts-aggregated.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts/lib/contacts-aggregated.xql 30 Aug 2005 21:31:04 -0000 1.2 +++ openacs-4/packages/contacts/lib/contacts-aggregated.xql 14 Nov 2005 20:42:03 -0000 1.3 @@ -105,5 +105,45 @@ + + + select + distinct + ot.pretty_name as option, + rt.rel_type + from + acs_rel_types rt, + acs_object_types ot, + parties p + where + rt.rel_type like 'contact_rels_%' + and rt.rel_type = ot.object_type + + + + + select + count(t.party_id) + from + ( + select + distinct + CASE WHEN r.object_id_one = parties.party_id + THEN r.object_id_one + ELSE r.object_id_two END as party_id + from + acs_rels r + where + r.rel_type = :rel_type + ) t, + cr_items ci, + cr_revisions cr + where + t.party_id = ci.item_id + and ci.latest_revision = cr.revision_id + $search_clause + + +