Index: openacs-4/packages/calendar/www/view-month-display.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-month-display.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/calendar/www/view-month-display.tcl 12 Sep 2003 20:00:13 -0000 1.6
+++ openacs-4/packages/calendar/www/view-month-display.tcl 25 Sep 2003 23:11:12 -0000 1.7
@@ -1,17 +1,10 @@
-# Show a calendar month widget
-#
-# Parameters:
-#
-# date (YYYY-MM-DD) - optional
-
if {![info exists date] || [empty_string_p $date]} {
# Default to todays date in the users (the connection) timezone
set server_now_time [dt_systime]
set user_now_time [lc_time_system_to_conn $server_now_time]
set date [lc_time_fmt $user_now_time "%x"]
}
-# calendar-portlet uses this stuff
if { ![info exists url_stub_callback] } {
set url_stub_callback ""
}
@@ -24,31 +17,22 @@
set item_template "\$item"
}
-# NEW
-if { ![info exists show_calendar_name_p] } {
- set show_calendar_name_p 1
+if {[exists_and_not_null page_num]} {
+ set page_num "&page_num=$page_num"
+} else {
+ set page_num ""
}
+
+if {![exists_and_not_null base_url]} {
+ set base_url ""
+}
-if {[exists_and_not_null $calendar_id_list]} {
+if {[exists_and_not_null calendar_id_list]} {
set calendars_clause "and on_which_calendar in ([join $calendar_id_list ","]) and (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id))"
} else {
- set calendars_clause "and (cals.package_id= :package_id or (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id)))"
+ set calendars_clause "and ((cals.package_id= :package_id and cals.private_p='f') or (cals.private_p='t' and cals.owner_id= :user_id))"
}
-if { ![info exists prev_month_template] } {
- set prev_month_template ""
-}
-
-if { ![info exists next_month_template] } {
- set next_month_template ""
-}
-
-if { ![info exists item_add_template] } {
- set item_add_template ""
-}
-# calendar-portlet
-
-
dt_get_info $date
set date_list [dt_ansi_to_list $date]
set this_year [dt_trim_leading_zeros [lindex $date_list 0]]
@@ -61,9 +45,21 @@
set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
set today_date [dt_sysdate]
-set next_month_url ""
-set prev_month_url ""
+if { [info exists prev_month_template] } {
+ set prev_month_url "[subst $prev_month_template]"
+} else {
+ set prev_month_url ""
+}
+
+
+if { [info exists next_month_template] } {
+ set next_month_url "[subst $next_month_template]"
+} else {
+ set next_month_url ""
+}
+
+
set first_day_of_week [lc_get firstdayofweek]
set last_day_of_week [expr [expr $first_day_of_week + 7] % 7]
@@ -163,4 +159,4 @@
for {} {$current_day <= [expr $last_julian_date_in_month + $remaining_days]} {incr current_day} {
multirow append days_of_a_month "" "" "" "" "" "" f f "" t ""
}
-}
\ No newline at end of file
+}