Index: openacs-4/packages/contacts/tcl/contact-search-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-search-procs.xql,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/contacts/tcl/contact-search-procs.xql 13 Mar 2006 07:22:00 -0000 1.12
+++ openacs-4/packages/contacts/tcl/contact-search-procs.xql 16 Apr 2006 10:10:10 -0000 1.13
@@ -39,8 +39,8 @@
select count(distinct party_id)
from parties 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
- and group_distinct_member_map.group_id in ('[join [contacts::default_groups] "','"]')
- [contact::search_clause -and -search_id $search_id -query $query -party_id "parties.party_id" -revision_id "revision_id"]
+ and group_distinct_member_map.group_id in ([template::util::tcl_to_sql_list [contacts::default_groups -package_id $package_id]])
+ [contact::search_clause -and -search_id $search_id -query $query -party_id "parties.party_id" -revision_id "revision_id" -limit_type_p "0"]
@@ -49,10 +49,10 @@
select count(distinct person_id)
from persons, cr_items, cr_revisions, group_distinct_member_map
where persons.person_id = group_distinct_member_map.member_id
- and group_distinct_member_map.group_id in ('[join [contacts::default_groups] "','"]')
+ and group_distinct_member_map.group_id in ([template::util::tcl_to_sql_list [contacts::default_groups -package_id $package_id]])
and persons.person_id = cr_items.item_id
and cr_items.latest_revision = cr_revisions.revision_id
- [contact::search_clause -and -search_id $search_id -query $query -party_id "persons.person_id" -revision_id "revision_id"]
+ [contact::search_clause -and -search_id $search_id -query $query -party_id "persons.person_id" -revision_id "revision_id" -limit_type_p "0"]
@@ -61,36 +61,40 @@
select count(distinct organization_id)
from organizations, cr_items, cr_revisions, group_distinct_member_map
where organizations.organization_id = group_distinct_member_map.member_id
- and group_distinct_member_map.group_id in ('[join [contacts::default_groups] "','"]')
+ and group_distinct_member_map.group_id in ([template::util::tcl_to_sql_list [contacts::default_groups -package_id $package_id]])
and organizations.organization_id = cr_items.item_id
and cr_items.latest_revision = cr_revisions.revision_id
- [contact::search_clause -and -search_id $search_id -query $query -party_id "organizations.organization_id" -revision_id "revision_id"]
+ [contact::search_clause -and -search_id $search_id -query $query -party_id "organizations.organization_id" -revision_id "revision_id" -limit_type_p "0"]
- select
- object_type
- from
- contact_searches
- where
- search_id = :search_id
+ select object_type
+ from contact_searches
+ where search_id = :search_id
- select
- count(object_id_one)
- from
- acs_rels
- where
- rel_type = 'contact_rels_employment'
+ select count(object_id_one)
+ from acs_rels
+ where rel_type = 'contact_rels_employment'
+
+
+ select 1
+ from group_distinct_member_map
+ where member_id = '${party_id}'
+ and group_id in ([template::util::tcl_to_sql_list [contacts::default_groups -package_id $package_id]])
+ [contact::search_clause -and -search_id $search_id -party_id "'${party_id}'" -revision_id "'${revision_id}'"]
+
+
+
select title,