Index: openacs-4/packages/contacts/lib/contacts.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/contacts.tcl,v
diff -u -r1.70 -r1.71
--- openacs-4/packages/contacts/lib/contacts.tcl 8 Nov 2006 18:36:33 -0000 1.70
+++ openacs-4/packages/contacts/lib/contacts.tcl 19 Dec 2006 11:02:05 -0000 1.71
@@ -695,11 +695,3 @@
template::element::set_value add_column_form extended_columns $extended_columns
template::element::set_value remove_column_form extended_columns $extended_columns
-
-
-
-
-
-
-
-
Index: openacs-4/packages/contacts/lib/search-contact.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/search-contact.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/contacts/lib/search-contact.adp 31 Dec 2005 07:39:39 -0000 1.2
+++ openacs-4/packages/contacts/lib/search-contact.adp 19 Dec 2006 11:02:05 -0000 1.3
@@ -1,8 +1,21 @@
-
-
-
-
-
+
Index: openacs-4/packages/contacts/lib/search-contact.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/search-contact.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/contacts/lib/search-contact.tcl 16 Dec 2006 11:27:19 -0000 1.5
+++ openacs-4/packages/contacts/lib/search-contact.tcl 19 Dec 2006 11:02:05 -0000 1.6
@@ -25,15 +25,10 @@
set return_url [ad_return_url]
}
-set focus_message "if(this.value=='[_ contacts.search_contact]')this.value='';"
-set blur_message "if(this.value=='')this.value='[_ contacts.search_contact]';"
+# Include for an Ajax dropdown smart search widget that filters search results as you type.
+# Requires ajaxhelper
-ad_form -name search_contact -form {
- {keyword:text(text)
- {html {size 20 onfocus "$focus_message" onblur "$blur_message" class search_contact}}
- {value "[_ contacts.search_contact]"}
- }
- {return_url:text(hidden) {value $return_url}}
-} -on_submit {
- ad_returnredirect [export_vars -base "$contacts_url" -url {{query $keyword}}]
-} -has_submit {1}
+set js_update_user_select [ah::ajaxupdate \
+ -container "results_box" \
+ -url "${contacts_url}/lookup" \
+ -pars "Form.serialize('searchform')"]
\ No newline at end of file
Index: openacs-4/packages/contacts/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/index.adp,v
diff -u -r1.20 -r1.21
--- openacs-4/packages/contacts/www/index.adp 1 Apr 2006 07:07:16 -0000 1.20
+++ openacs-4/packages/contacts/www/index.adp 19 Dec 2006 11:02:05 -0000 1.21
@@ -1,6 +1,14 @@
+
+
+
-
[_ contacts.Results] $contacts_total_count "}}
}
Index: openacs-4/packages/contacts/www/lookup.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/lookup.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/lookup.adp 19 Dec 2006 11:02:05 -0000 1.1
@@ -0,0 +1 @@
+@result;noquote@
Index: openacs-4/packages/contacts/www/lookup.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/lookup.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/lookup.tcl 19 Dec 2006 11:02:05 -0000 1.1
@@ -0,0 +1,19 @@
+ad_page_contract {
+ Lookup contact names
+
+ @author Malte Sussdorff (malte.sussdorff@cognovis.de)
+ @creation-date 2006-12-17
+ @cvs-id $Id: lookup.tcl,v 1.1 2006/12/19 11:02:05 maltes Exp $
+} {
+ {query ""}
+}
+
+if {$query eq ""} {
+ set result "no_result"
+} else {
+ set result ""
+ set sql "select first_names, last_name,person_id from persons where lower(first_names) like lower('%$query%') or lower(last_name) like lower('%$query%')"
+ db_foreach contacts "$sql" {
+ append result "$first_names $last_name
"
+ }
+}
\ No newline at end of file
Index: openacs-4/packages/contacts/www/smart-search.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/smart-search.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/contacts/www/smart-search.adp 19 Dec 2006 11:02:05 -0000 1.1
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file