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.1 -r1.2 --- openacs-4/packages/contacts/lib/contacts-aggregated.xql 29 Aug 2005 22:47:58 -0000 1.1 +++ openacs-4/packages/contacts/lib/contacts-aggregated.xql 30 Aug 2005 21:31:04 -0000 1.2 @@ -13,6 +13,16 @@ + + + select + c.default_name as option, + c.iso + from + countries c + + + select @@ -58,4 +68,42 @@ + + + select + count(parties.party_id) + from + parties + where parties.party_id in ( + select + parties.party_id + from + parties + left join organizations on (parties.party_id = organizations.organization_id) + left join cr_items on (parties.party_id = cr_items.item_id) + left join cr_revisions on (cr_items.latest_revision = cr_revisions.revision_id ), + group_distinct_member_map + where parties.party_id = group_distinct_member_map.member_id + $search_clause + ) + and parties.party_id in ( + select + p.party_id + from + parties p, + ams_attribute_values a, + postal_addresses pa, + cr_items i, + cr_revisions r + where + i.item_id = p.party_id + and r.revision_id = i.latest_revision + and r.revision_id = a.object_id + and a.value_id = pa.address_id + and pa.country_code = :iso + ) + + + +