Index: openacs-4/packages/contacts/lib/contacts.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/contacts.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/contacts/lib/contacts.tcl 14 Jun 2005 09:05:28 -0000 1.6
+++ openacs-4/packages/contacts/lib/contacts.tcl 15 Jun 2005 01:07:32 -0000 1.7
@@ -6,7 +6,7 @@
{search_id:integer ""}
{query ""}
{page:optional}
- {page_size:integer "25"}
+ {page_size:integer ""}
}
@@ -20,19 +20,21 @@
append name_label " [_ contacts.Show]: "
-set first_p 1
-foreach page_s [list 25 50 100 500] {
- if { [string is false $first_p] } {
- append name_label " | "
- }
+
+set valid_page_sizes [list 25 50 100 500]
+if { ![exists_and_not_null page_size] || [lsearch $valid_page_sizes $page_size] < 0 } {
+ set page_size [parameter::get -parameter "DefaultPageSize" -default "50"]
+}
+foreach page_s $valid_page_sizes {
if { $page_size == $page_s } {
- append name_label $page_s
+ lappend page_size_list $page_s
} else {
- append name_label "$page_s"
+ lappend page_size_list "$page_s"
}
- set first_p 0
}
+append name_label [join $page_size_list " | "]
+
append name_label " [_ contacts.Get]: [_ contacts.CSV]"
Index: openacs-4/packages/contacts/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/index.tcl,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/contacts/www/index.tcl 14 Jun 2005 06:08:28 -0000 1.11
+++ openacs-4/packages/contacts/www/index.tcl 15 Jun 2005 01:08:11 -0000 1.12
@@ -10,7 +10,7 @@
{search_id:integer ""}
{query ""}
{page:optional}
- {page_size:integer "25"}
+ {page_size:integer ""}
{add_person:optional}
{add_organization:optional}
}
@@ -26,6 +26,11 @@
set user_id [ad_conn user_id]
set package_id [ad_conn package_id]
+set valid_page_sizes [list 25 50 100 500]
+if { ![exists_and_not_null page_size] || [lsearch $valid_page_sizes $page_size] < 0 } {
+ set page_size [parameter::get -boolean -parameter "DefaultPageSize" -default "50"]
+}
+
set contacts_total_count [contact::search::results_count -search_id $search_id -query $query]
if { [exists_and_not_null search_id] } {