Index: openacs-4/packages/contacts/tcl/contact-search-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contact-search-procs.tcl,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/contacts/tcl/contact-search-procs.tcl 1 Apr 2006 07:07:16 -0000 1.24 +++ openacs-4/packages/contacts/tcl/contact-search-procs.tcl 6 Apr 2006 03:17:59 -0000 1.25 @@ -227,6 +227,7 @@ {-query ""} {-party_id "party_id"} {-revision_id "revision_id"} + {-limit_type_p "1"} } { Get the search clause for a search_id @@ -437,19 +438,22 @@ {-and:boolean} {-party_id} {-revision_id} + {-limit_type_p "1"} } { } { if { $and_p } { return [util_memoize [list ::contact::search::where_clause_not_cached \ -search_id $search_id \ -and \ -party_id $party_id \ - -revision_id $revision_id]] + -revision_id $revision_id \ + -limit_type_p $limit_type_p]] } else { return [util_memoize [list ::contact::search::where_clause_not_cached \ -search_id $search_id \ -party_id $party_id \ - -revision_id $revision_id]] + -revision_id $revision_id \ + -limit_type_p $limit_type_p]] } } @@ -458,19 +462,21 @@ {-and:boolean} {-party_id} {-revision_id} + {-limit_type_p} } { } { db_0or1row get_search_info {} set where_clauses [list] if { [exists_and_not_null all_or_any] } { set result {} - if { $object_type == "person" } { - # append result "$party_id = persons.person_id\n" - } elseif { $object_type == "organization" } { - # append result "$party_id = organizations.organization_id\n" + if { [string is true $limit_type_p] } { + if { $object_type == "person" } { + append result "$party_id = persons.person_id\n" + } elseif { $object_type == "organization" } { + append result "$party_id = organizations.organization_id\n" + } } - # the reason we do not put this in the db_foreach statement is because we # can run into problems with the number of database pools we have when a sub # query is a condition. We are limited to 3 levels of database access for most