Index: openacs-4/packages/contacts/www/search.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search.tcl,v
diff -u -r1.30 -r1.31
--- openacs-4/packages/contacts/www/search.tcl 18 Apr 2006 07:14:37 -0000 1.30
+++ openacs-4/packages/contacts/www/search.tcl 18 Apr 2006 10:19:44 -0000 1.31
@@ -179,6 +179,23 @@
set owner_id [ad_conn user_id]
}
+if { $search_exists_p } {
+ set conditions [list]
+ db_foreach selectqueries {} {
+ set condition_name [contacts::search::condition_type -type $query_type -request pretty -var_list $query_var_list]
+ if { [empty_string_p $condition_name] } {
+ set condition_name "[_ contacts.Employees]"
+ }
+ lappend conditions "$condition_name "
+ }
+ if { [llength $conditions] > 0 } {
+ set query_pretty "
"
+ } else {
+ set query_pretty ""
+ }
+} else {
+ set query_pretty ""
+}
# FORM HEADER
set form_elements {
@@ -191,7 +208,7 @@
append form_elements {
{object_type:text(hidden) {value $object_type}}
{object_type_pretty:text(inform) {label {[_ contacts.Search_for]}} {value "$object_type_pretty"} {after_html "[_ contacts.which_match]"}}
- {all_or_any:text(select),optional {label ""} {options {{[_ contacts.All] all} {[_ contacts.Any] any}}} {after_html "[_ contacts.lt_of_the_following_cond]"}}
+ {all_or_any:text(select),optional {label ""} {options {{[_ contacts.All] all} {[_ contacts.Any] any}}} {after_html "[_ contacts.lt_of_the_following_cond]$query_pretty"}}
}
} else {
set object_type_options [list]
@@ -204,23 +221,6 @@
}
-if { $search_exists_p } {
- set conditions [list]
- db_foreach selectqueries {} {
- set condition_name [contacts::search::condition_type -type $query_type -request pretty -var_list $query_var_list]
- if { [empty_string_p $condition_name] } {
- set condition_name "[_ contacts.Employees]"
- }
- lappend conditions "$condition_name "
- }
- if { [llength $conditions] > 0 } {
- set query_pretty ""
- } else {
- set query_pretty ""
- }
- lappend form_elements [list query:text(hidden),optional]
- lappend form_elements [list query_pretty:text(inform),optional [list label {}] [list value $query_pretty]]
-}
# The employee search only works without other attribute so
# we are going to remove the option "Employee" where is already
@@ -288,8 +288,7 @@
-package_id [ad_conn package_id]]
append form_elements {
- {aggregate:text(submit) {label "[_ contacts.Aggregate]"} {value "aggregate"}}
- {results_count_widget:text(inform) {label " [_ contacts.Results]"} {value {$results_count}}}
+ {aggregate:text(submit) {label "[_ contacts.Aggregate]"} {value "aggregate"} {after_html " [_ contacts.Results] $results_count"}}
}
}