Index: openacs-4/packages/calendar-portlet/catalog/calendar-portlet.de_DE.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/catalog/calendar-portlet.de_DE.ISO-8859-1.xml,v
diff -u -r1.14 -r1.14.2.1
--- openacs-4/packages/calendar-portlet/catalog/calendar-portlet.de_DE.ISO-8859-1.xml 15 Dec 2006 22:45:20 -0000 1.14
+++ openacs-4/packages/calendar-portlet/catalog/calendar-portlet.de_DE.ISO-8859-1.xml 26 Mar 2007 11:16:54 -0000 1.14.2.1
@@ -7,6 +7,7 @@
Kalender
Eintragskategorien �ndern
Eintragskategorien �ndern
+ Angezeigte Tage in der Listendarstellung (standard)
Kalender
Tagesplan
Index: openacs-4/packages/calendar-portlet/catalog/calendar-portlet.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/catalog/calendar-portlet.en_US.ISO-8859-1.xml,v
diff -u -r1.16.2.1 -r1.16.2.2
--- openacs-4/packages/calendar-portlet/catalog/calendar-portlet.en_US.ISO-8859-1.xml 21 Mar 2007 09:48:43 -0000 1.16.2.1
+++ openacs-4/packages/calendar-portlet/catalog/calendar-portlet.en_US.ISO-8859-1.xml 26 Mar 2007 11:16:54 -0000 1.16.2.2
@@ -7,7 +7,7 @@
Full Calendar
Manage Calendar Event Types
Manage Item Types
- Period Days
+ Period days for the list view (default)
Calendar
Schedule
Index: openacs-4/packages/calendar-portlet/www/calendar-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/www/calendar-admin-portlet.tcl,v
diff -u -r1.3.16.1 -r1.3.16.2
--- openacs-4/packages/calendar-portlet/www/calendar-admin-portlet.tcl 3 Mar 2007 19:17:31 -0000 1.3.16.1
+++ openacs-4/packages/calendar-portlet/www/calendar-admin-portlet.tcl 26 Mar 2007 11:16:55 -0000 1.3.16.2
@@ -45,8 +45,6 @@
return -code error "shouldn't be more than one calendar in admin!"
}
-set calendar_id [lindex $list_of_calendar_ids 0]
-
set url "calendar/"
ad_return_template
Index: openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl,v
diff -u -r1.34.6.3 -r1.34.6.4
--- openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl 16 Mar 2007 11:59:49 -0000 1.34.6.3
+++ openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl 26 Mar 2007 11:16:55 -0000 1.34.6.4
@@ -38,11 +38,6 @@
}
}
-#ad_page_contract doesn't do the defaulting correctly in included files like this one.
-if { ![exists_and_not_null period_days] } {
- set period_days 30
-}
-
# get stuff out of the config array
array set config $cf
if {[empty_string_p $view]} {
@@ -60,6 +55,33 @@
set show_calendar_name_p 0
}
+# set the period_days for calendar's list view, therefore we need
+# to check which instance of calendar is currently displayed
+if {[apm_package_installed_p dotlrn]} {
+ set site_node [site_node::get_node_id_from_object_id -object_id [ad_conn package_id]]
+ set dotlrn_package_id [site_node::closest_ancestor_package -node_id $site_node -package_key dotlrn -include_self]
+ set community_id [db_string get_community_id {select community_id from dotlrn_communities_all where package_id=:dotlrn_package_id} -default [db_null]]
+} else {
+ set community_id ""
+}
+
+set calendar_id [lindex $list_of_calendar_ids 0]
+db_0or1row select_calendar_package_id {select package_id from calendars where calendar_id=:calendar_id}
+if { ![info exists period_days] } {
+ if { [exists_and_not_null community_id] } {
+ set period_days [parameter::get -package_id $package_id -parameter ListView_DefaultPeriodDays -default 31]
+ } else {
+ foreach calendar $list_of_calendar_ids {
+ # returns 1 if calendar_id is user's personal calendar
+ if { [calendar::personal_p -calendar_id $calendar] } {
+ db_0or1row select_calendar_package_id {select package_id from calendars where calendar_id=:calendar}
+ set period_days [parameter::get -package_id $package_id -parameter ListView_DefaultPeriodDays -default 31]
+ break
+ }
+ }
+ }
+}
+
if {[llength $list_of_calendar_ids] > 1} {
set force_calendar_id [calendar::have_private_p -return_id 1 -calendar_id_list $list_of_calendar_ids -party_id [ad_conn user_id]]
} else {
Index: openacs-4/packages/calendar-portlet/www/calendar-list-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/www/calendar-list-portlet.tcl,v
diff -u -r1.10.2.2 -r1.10.2.3
--- openacs-4/packages/calendar-portlet/www/calendar-list-portlet.tcl 3 Mar 2007 19:17:31 -0000 1.10.2.2
+++ openacs-4/packages/calendar-portlet/www/calendar-list-portlet.tcl 26 Mar 2007 11:16:55 -0000 1.10.2.3
@@ -55,7 +55,7 @@
db_0or1row select_calendar_package_id {select package_id from calendars where calendar_id=:calendar_id}
if { ![info exists period_days] } {
- set period_days [parameter::get -package_id $package_id -parameter DefaultPeriodDays -default 31]
+ set period_days [parameter::get -package_id $package_id -parameter ListView_DefaultPeriodDays -default 31]
}
set scoped_p $config(scoped_p)