Index: openacs-4/packages/contacts/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/index.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/contacts/www/index.tcl 15 Jun 2005 01:08:11 -0000 1.12
+++ openacs-4/packages/contacts/www/index.tcl 29 Aug 2005 22:48:41 -0000 1.13
@@ -13,6 +13,7 @@
{page_size:integer ""}
{add_person:optional}
{add_organization:optional}
+ {aggregate_attribute_id ""}
}
if { [exists_and_not_null add_person] } {
@@ -23,6 +24,11 @@
ad_script_abort
}
+set aggregated_p 0
+if {[exists_and_not_null aggregate_attribute_id] } {
+ set aggregated_p 1
+}
+
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
@@ -33,6 +39,10 @@
set contacts_total_count [contact::search::results_count -search_id $search_id -query $query]
+if { $aggregated_p } {
+ set contacts_total_count "$contacts_total_count"
+}
+
if { [exists_and_not_null search_id] } {
contact::search::log -search_id $search_id
}
@@ -51,7 +61,7 @@
{search_id:integer(select),optional {label ""} {options $search_options} {html {onChange "javascript:acs_FormRefresh('search')"}}}
{query:text(text),optional {label ""} {html {size 20 maxlength 255}}}
{save:text(submit) {label {[_ contacts.Search]}} {value "go"}}
- {results_count:integer(inform),optional {label " [_ contacts.Results] $contacts_total_count"}}
+ {results_count:integer(inform),optional {label " [_ contacts.Results] $contacts_total_count "}}
}
if { [parameter::get -boolean -parameter "ForceSearchBeforeAdd" -default "0"] } {
Index: openacs-4/packages/contacts/www/search.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/contacts/www/search.tcl 1 Jul 2005 22:44:26 -0000 1.15
+++ openacs-4/packages/contacts/www/search.tcl 29 Aug 2005 22:48:41 -0000 1.16
@@ -17,6 +17,8 @@
{all_or_any ""}
{title ""}
{owner_id ""}
+ {aggregate_attribute_id ""}
+ {aggregate ""}
} -validate {
valid_object_type -requires {object_type} {
if { [lsearch [list party person organization] $object_type] < 0 } {
@@ -47,6 +49,10 @@
}
+if { [exists_and_not_null aggregate] } {
+ ad_returnredirect "[export_vars -base ./ -url {search_id aggregate_attribute_id}]"
+}
+
set page_title "[_ contacts.Advanced_Search]"
set context [list $page_title]
@@ -144,13 +150,24 @@
if { $search_exists_p } {
set results_count [contact::search::results_count -search_id $search_id]
-
append form_elements {
{title:text(text),optional {label "
[_ contacts.save_this_search_]"} {html {size 40 maxlength 255}}}
{save:text(submit) {label "[_ contacts.Save]"} {value "save"}}
{search:text(submit) {label "[_ contacts.Search]"} {value "search"}}
{clear:text(submit) {label "[_ contacts.Clear]"} {value "clear"}}
- {delete:text(submit) {label "[_ contacts.Delete]"} {value "delete"}}
+ {delete:text(submit) {label "[_ contacts.Delete]"} {value "delete"} \
+ {after_html "
[_ contacts.Aggregate_by]:
"}
+ }
+ }
+
+ append form_elements [contacts::search::condition_type::attribute \
+ -request ad_form_widgets \
+ -prefix "aggregate_" \
+ -without_arrow_p "t" \
+ -only_multiple_p "t"]
+
+ append form_elements {
+ {aggregate:text(submit) {label "[_ contacts.Aggregate]"} {value "aggregate"}}
{results_count_widget:text(inform) {label " [_ contacts.Results]"} {value {$results_count}}}
}
}