Index: openacs-4/packages/address-book/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/address-book/www/index.tcl,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/address-book/www/index.tcl 20 Apr 2001 20:51:12 -0000 1.1
+++ openacs-4/packages/address-book/www/index.tcl 1 Sep 2001 20:34:19 -0000 1.2
@@ -40,17 +40,13 @@
regsub -all {%} $substr {} substr
- set like_clause "like '%[string tolower $substr]%'"
+ set substr [string tolower $substr]
- set search_filter "and (lower(last_name) $like_clause
- or lower(first_names) $like_clause
- or lower(title) $like_clause
- or lower(organization) $like_clause
- or lower(work_phone) $like_clause
- or lower(home_phone) $like_clause
- or lower(fax) $like_clause
- or lower(other) $like_clause
- or lower(email) $like_clause)"
+ # DRB: This depends on support for partial string matches of some sort...
+ set like_clause [db_map like_clause]
+
+ set search_filter [db_map search_filter]
+
}
set datadef {
@@ -72,24 +68,8 @@
# This invokes a bunch of functions, which is bad, I think, but maybe it's still way faster than the
# join, 'cause the view meant for joining has been commented out in the permission SQL file... ?
-set sql_query "
- select contact_id,
- nvl(last_name,'
') as last_name,
- nvl(first_names,'
') as first_names,
- nvl(title,'
') as title,
- nvl(organization,'
') as organization,
- nvl(work_phone,'
') as work_phone,
- nvl(home_phone,'
') as home_phone,
- nvl(fax,'
') as fax,
- nvl(other,'
') as other,
- nvl(email,'
') as email,
- acs_permission.permission_p(acr.rel_id,:user_id,'delete') as delete_p,
- acr.rel_id
- from ab_contacts_related acr
- where acs_permission.permission_p(contact_id,:user_id,'read') = 't'
- and object_id = :instance_id
- [value_if_exists search_filter]
-"
+set sql_query [db_map sql_query]
+
append sql_query [ad_order_by_from_sort_spec $orderby $datadef]
if { $instance_id && $user_id } {
@@ -99,4 +79,4 @@
set contact_table [ad_table -Torderby $orderby -bind $bind_vars address_book_listing $sql_query $datadef]
-ad_return_template
\ No newline at end of file
+ad_return_template