Index: openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/cal-item-2-procs.tcl,v
diff -u -N -r1.12 -r1.13
--- openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl 25 Sep 2003 08:54:35 -0000 1.12
+++ openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl 25 Sep 2003 23:11:11 -0000 1.13
@@ -127,7 +127,14 @@
Edit the item
} {
- cal_item_update $cal_item_id $start_date $end_date $name $description $item_type_id $edit_all_p
+ if {[dates_valid_p -start_date $start_date -end_date $end_date]} {
+ # For now we call the old nasty version
+ return [cal_item_update $cal_item_id $start_date $end_date $name $description $item_type_id $edit_all_p]
+ } else {
+ # FIXME: do this better
+ ad_return_complaint 1 "Start Time must be before End Time"
+ ad_script_abort
+ }
}
ad_proc -public delete {
Index: openacs-4/packages/calendar/tcl/cal-item-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs.tcl,v
diff -u -N -r1.14 -r1.15
--- openacs-4/packages/calendar/tcl/cal-item-procs.tcl 3 Sep 2003 13:48:31 -0000 1.14
+++ openacs-4/packages/calendar/tcl/cal-item-procs.tcl 25 Sep 2003 23:11:11 -0000 1.15
@@ -68,7 +68,6 @@
} {
-
# find out the activity_id
set activity_id [db_exec_plsql insert_activity {
begin
Index: openacs-4/packages/calendar/tcl/calendar-2-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-2-procs.tcl,v
diff -u -N -r1.12 -r1.13
--- openacs-4/packages/calendar/tcl/calendar-2-procs.tcl 12 Sep 2003 20:00:13 -0000 1.12
+++ openacs-4/packages/calendar/tcl/calendar-2-procs.tcl 25 Sep 2003 23:11:11 -0000 1.13
@@ -131,7 +131,6 @@
if {[empty_string_p $package_id]} {
set package_id [ad_conn package_id]
}
-
set new_list [db_list_of_lists select_calendar_list {}]
}
Index: openacs-4/packages/calendar/www/cal-item-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-new.tcl,v
diff -u -N -r1.17 -r1.18
--- openacs-4/packages/calendar/www/cal-item-new.tcl 24 Sep 2003 11:15:58 -0000 1.17
+++ openacs-4/packages/calendar/www/cal-item-new.tcl 25 Sep 2003 23:11:12 -0000 1.18
@@ -31,8 +31,6 @@
ad_require_permission $calendar_id cal_item_create
}
-
-
if {![info exists item_type_id]} {
set item_type_id ""
}
Index: openacs-4/packages/calendar/www/cal-item-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.tcl,v
diff -u -N -r1.11 -r1.12
--- openacs-4/packages/calendar/www/cal-item-view.tcl 21 Jul 2003 19:21:36 -0000 1.11
+++ openacs-4/packages/calendar/www/cal-item-view.tcl 25 Sep 2003 23:11:12 -0000 1.12
@@ -12,7 +12,7 @@
set user_id [ad_verify_and_get_user_id]
set package_id [ad_conn package_id]
-ad_require_permission $cal_item_id read
+#ad_require_permission $cal_item_id read
set edit_p [ad_permission_p $cal_item_id cal_item_write]
set delete_p [ad_permission_p $cal_item_id cal_item_delete]
Index: openacs-4/packages/calendar/www/mini-calendar.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/mini-calendar.adp,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/calendar/www/mini-calendar.adp 19 Sep 2003 11:35:04 -0000 1.3
+++ openacs-4/packages/calendar/www/mini-calendar.adp 25 Sep 2003 23:11:12 -0000 1.4
@@ -9,7 +9,7 @@
- @views.name@
+ @views.name@
|
@@ -60,7 +60,7 @@
-
+
@months.name@
|
@@ -89,7 +89,7 @@
-
+
@days.day_number@
|
@@ -100,7 +100,7 @@
-
+
@days.day_number@
|
@@ -140,6 +140,7 @@
#acs-datetime.Date_as_YYYYMMDD#
@form_vars;noquote@
+ @page_num_formvar;noquote@
Index: openacs-4/packages/calendar/www/mini-calendar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/mini-calendar.tcl,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/calendar/www/mini-calendar.tcl 12 Sep 2003 20:00:13 -0000 1.5
+++ openacs-4/packages/calendar/www/mini-calendar.tcl 25 Sep 2003 23:11:12 -0000 1.6
@@ -6,6 +6,14 @@
set date [dt_sysdate]
}
+if {[exists_and_not_null page_num]} {
+ set page_num_formvar [export_form_vars page_num]
+ set page_num "&page_num=$page_num"
+} else {
+ set page_num_formvar ""
+ set page_num ""
+}
+
# Create row with existing views
multirow create views name text active_p
foreach viewname {list day week month} {
@@ -41,8 +49,8 @@
set curr_year [clock format $now -format "%Y"]
set prev_year [clock format [clock scan "1 year ago" -base $now] -format "%Y-%m-%d"]
set next_year [clock format [clock scan "1 year" -base $now] -format "%Y-%m-%d"]
- set prev_year_url ""
- set next_year_url ""
+ set prev_year_url ""
+ set next_year_url ""
set now [clock scan $date]
@@ -76,8 +84,8 @@
set curr_month [lindex $months_list $curr_month_idx ]
set prev_month [clock format [clock scan "1 month ago" -base $now] -format "%Y-%m-%d"]
set next_month [clock format [clock scan "1 month" -base $now] -format "%Y-%m-%d"]
- set prev_month_url ""
- set next_month_url ""
+ set prev_month_url ""
+ set next_month_url ""
set first_day_of_week [lc_get firstdayofweek]
set week_days [lc_get abday]
@@ -141,7 +149,7 @@
}
}
-set today_url "$base_url?view=day&date=[ad_urlencode [dt_sysdate]]"
+set today_url "$base_url?view=day&date=[ad_urlencode [dt_sysdate]]$page_num"
if { $view == "day" && [dt_sysdate] == $date } {
set today_p t
Index: openacs-4/packages/calendar/www/view-list-display.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-list-display.adp,v
diff -u -N -r1.6 -r1.7
--- openacs-4/packages/calendar/www/view-list-display.adp 19 Sep 2003 11:35:04 -0000 1.6
+++ openacs-4/packages/calendar/www/view-list-display.adp 25 Sep 2003 23:11:12 -0000 1.7
@@ -1,3 +1,4 @@
+
+
+No Items
+
Index: openacs-4/packages/calendar/www/view-list-display.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-list-display.tcl,v
diff -u -N -r1.10 -r1.11
--- openacs-4/packages/calendar/www/view-list-display.tcl 19 Sep 2003 11:35:04 -0000 1.10
+++ openacs-4/packages/calendar/www/view-list-display.tcl 25 Sep 2003 23:11:12 -0000 1.11
@@ -6,20 +6,30 @@
}
if { ![info exists item_template] } {
+ set url_template {?sort_by=$order_by}
+}
+
+if { ![info exists item_template] } {
set item_template "\$item"
}
if { ![info exists show_calendar_name_p] } {
set show_calendar_name_p 1
}
-if {[exists_and_not_null $calendar_id_list]} {
+if { ![info exists order_by] } {
+ set order_by ""
+}
+
+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))"
}
-# --calendar-portlet
+if { ![info exists period_days] } {
+ set period_days 31
+}
set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
# sort by cannot be empty
@@ -50,8 +60,9 @@
set today_ansi_list [dt_ansi_to_list $today_date]
set today_julian_date [dt_ansi_to_julian [lindex $today_ansi_list 0] [lindex $today_ansi_list 1] [lindex $today_ansi_list 2]]
-set item_type_url "view?view=list&sort_by=item_type&start_date=$start_date"
-set start_date_url "view?view=list&sort_by=start_date&start_date=$start_date"
+set item_type_url "view?view=list&sort_by=item_type&start_date=$start_date&period_days=$period_days"
+set start_date_url "view?view=list&sort_by=start_date&start_date=$start_date&period_days=$period_days"
+
set view list
set form_vars [export_form_vars start_date sort_by view]
Index: openacs-4/packages/calendar/www/view-month-display-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/view-month-display-oracle.xql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/calendar/www/view-month-display-oracle.xql 14 Aug 2003 15:44:08 -0000 1.1
+++ openacs-4/packages/calendar/www/view-month-display-oracle.xql 25 Sep 2003 23:11:12 -0000 1.2
@@ -24,11 +24,10 @@
and e.activity_id = a.activity_id
and start_date between to_date(:first_date_of_month_system, :ansi_date_format)
and to_date(:last_date_in_month_system, :ansi_date_format)
- and cals.package_id= :package_id
- and (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id))
and cals.calendar_id = ci.on_which_calendar
and e.event_id = ci.cal_item_id
- order by ansi_start_date
+ $calendars_clause
+ order by ansi_start_date, ansi_end_date
Index: openacs-4/packages/calendar/www/view-month-display-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/view-month-display-postgresql.xql,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/calendar/www/view-month-display-postgresql.xql 14 Aug 2003 15:44:08 -0000 1.5
+++ openacs-4/packages/calendar/www/view-month-display-postgresql.xql 25 Sep 2003 23:11:12 -0000 1.6
@@ -24,11 +24,10 @@
and e.activity_id = a.activity_id
and start_date between to_timestamp(:first_date_of_month_system, :ansi_date_format)
and to_timestamp(:last_date_in_month_system, :ansi_date_format)
- and cals.package_id= :package_id
- and (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id))
and cals.calendar_id = ci.on_which_calendar
and e.event_id = ci.cal_item_id
- order by ansi_start_date
+ $calendars_clause
+ order by ansi_start_date, ansi_end_date
Index: openacs-4/packages/calendar/www/view-month-display.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-month-display.adp,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/calendar/www/view-month-display.adp 19 Sep 2003 11:35:04 -0000 1.5
+++ openacs-4/packages/calendar/www/view-month-display.adp 25 Sep 2003 23:11:12 -0000 1.6
@@ -1,72 +1,76 @@
-
+
+
+
- |
-
- |
-
+
-
-
+
+
+
-
-
- @weekday_names.weekday_short@
- |
-
+
|
-
-
-
-
-
-
+
-
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 -N -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
+}
Index: openacs-4/packages/calendar/www/view-one-day-display-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/view-one-day-display-oracle.xql,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/calendar/www/view-one-day-display-oracle.xql 9 Sep 2003 09:11:14 -0000 1.4
+++ openacs-4/packages/calendar/www/view-one-day-display-oracle.xql 25 Sep 2003 23:11:12 -0000 1.5
@@ -26,7 +26,6 @@
and ci.cal_item_id = e.event_id
and to_char(start_date, 'HH24:MI') = '00:00'
and to_char(end_date, 'HH24:MI') = '00:00'
-and (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id))
and cals.calendar_id = ci.on_which_calendar
and e.event_id = ci.cal_item_id
$calendars_clause
@@ -54,16 +53,13 @@
and e.activity_id = a.activity_id
and start_date between
to_date(:current_date_system,:ansi_date_format) and
- (to_date(:current_date_system,:ansi_date_format) + (24 - 1/3600)/24)
+ (to_date(:current_date_system,:ansi_date_format) + (:end_display_hour - 1/3600)/:end_display_hour)
and ci.cal_item_id = e.event_id
and (to_char(start_date, 'HH24:MI') <> '00:00' or
to_char(end_date, 'HH24:MI') <> '00:00')
-and (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id))
and cals.calendar_id = ci.on_which_calendar
and e.event_id = ci.cal_item_id
$calendars_clause
-$start_clause
-$end_clause
order by to_char(start_date,'HH24')
Index: openacs-4/packages/calendar/www/view-one-day-display.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-one-day-display.adp,v
diff -u -N -r1.11 -r1.12
--- openacs-4/packages/calendar/www/view-one-day-display.adp 22 Sep 2003 21:32:40 -0000 1.11
+++ openacs-4/packages/calendar/www/view-one-day-display.adp 25 Sep 2003 23:11:12 -0000 1.12
@@ -18,14 +18,16 @@
|
-
+
+ @item_add_without_time;noquote@ |
+
-
- @item_add_without_time;noquote@ |
+
@day_items_without_time.full_item;noquote@ |
-
+ |
+
@@ -36,18 +38,14 @@
-@day_items_with_time.current_hour_link;noquote@
+ @day_items_with_time.current_hour_link;noquote@
+ |
- |
-
- @day_items_with_time.start_time@
- - @day_items_with_time.end_time@
@day_items_with_time.full_item;noquote@
0 } {
- set start_clause "and to_char(start_date, 'HH') > :start_display_hour"
+if {![exists_and_not_null base_url]} {
+ set base_url ""
+}
+
+set current_date $date
+if { [info exists start_display_hour]} {
+ set current_date_system "$current_date $start_display_hour:00:00"
} else {
- set start_clause ""
+ set current_date_system "$current_date 00:00:00"
set start_display_hour 0
}
-if { [info exists end_display_hour] && $end_display_hour < 23 } {
- set end_clause "and to_char(start_date, 'HH') < :end_display_hour"
-} else {
- set end_clause ""
- set end_display_hour 23
+if { ![info exists end_display_hour]} {
+ set end_display_hour 24
}
-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))"
}
-# --calendar-portlet
-
# The database needs this for proper formatting.
set ansi_date_format "YYYY-MM-DD HH24:MI:SS"
@@ -66,10 +66,7 @@
set date [lc_time_fmt $user_now_time "%F"]
}
-set current_date $date
-set current_date_system "$current_date 00:00:00"
-
set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
@@ -96,8 +93,9 @@
multirow append day_items_without_time $name $status_summary $item_id $calendar_name $full_item
}
+
set day_current_hour 0
-set localized_day_current_hour {}
+set localized_day_current_hour {}
set item_add_without_time [subst $hour_template]
# Now items with time
@@ -159,7 +157,6 @@
# reset url stub
set url_stub ""
-
# In case we need to dispatch to a different URL (ben)
if {![empty_string_p $url_stub_callback]} {
# Cache the stuff
Index: openacs-4/packages/calendar/www/view-week-display-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display-oracle.xql,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/calendar/www/view-week-display-oracle.xql 21 Sep 2003 22:14:07 -0000 1.3
+++ openacs-4/packages/calendar/www/view-week-display-oracle.xql 25 Sep 2003 23:11:12 -0000 1.4
@@ -36,13 +36,12 @@
where e.timespan_id = s.timespan_id
and s.interval_id = t.interval_id
and e.activity_id = a.activity_id
-and cals.package_id= :package_id
and start_date between
to_date(:first_weekday_of_the_week_tz, :ansi_date_format) and
to_date(:last_weekday_of_the_week_tz, :ansi_date_format)
-and (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id))
and cals.calendar_id = ci.on_which_calendar
and e.event_id = ci.cal_item_id
+$calendars_clause
order by to_char(start_date, 'J'), to_char(start_date,'HH24:MI')
Index: openacs-4/packages/calendar/www/view-week-display-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display-postgresql.xql,v
diff -u -N -r1.6 -r1.7
--- openacs-4/packages/calendar/www/view-week-display-postgresql.xql 21 Sep 2003 22:14:45 -0000 1.6
+++ openacs-4/packages/calendar/www/view-week-display-postgresql.xql 25 Sep 2003 23:11:12 -0000 1.7
@@ -39,10 +39,9 @@
and start_date between
to_date(:first_weekday_of_the_week_tz, :ansi_date_format) and
to_date(:last_weekday_of_the_week_tz, :ansi_date_format)
-and cals.package_id= :package_id
-and (cals.private_p='f' or (cals.private_p='t' and cals.owner_id= :user_id))
and cals.calendar_id = ci.on_which_calendar
and e.event_id = ci.cal_item_id
+$calendars_clause
order by to_char(start_date, 'J'), to_char(start_date,'HH24:MI')
Index: openacs-4/packages/calendar/www/view-week-display.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display.adp,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/calendar/www/view-week-display.adp 19 Sep 2003 11:35:04 -0000 1.4
+++ openacs-4/packages/calendar/www/view-week-display.adp 25 Sep 2003 23:11:12 -0000 1.5
@@ -5,11 +5,9 @@
@@ -23,16 +21,14 @@
- @week_items.start_date_weekday@:
-
+ @week_items.start_date_weekday@:
|
+ href="@base_url@cal-item-new?date=@week_items.ansi_start_date@&start_time=&end_time=">
@week_items.start_date@
+ href="?view=day&date=@week_items.ansi_start_date@@page_num@">@week_items.start_date@
|
@@ -48,14 +44,10 @@
-
-
@week_items.start_time@ - @week_items.end_time@
@week_items.full_item;noquote@
-
Index: openacs-4/packages/calendar/www/view-week-display.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display.tcl,v
diff -u -N -r1.9 -r1.10
--- openacs-4/packages/calendar/www/view-week-display.tcl 21 Sep 2003 22:15:00 -0000 1.9
+++ openacs-4/packages/calendar/www/view-week-display.tcl 25 Sep 2003 23:11:12 -0000 1.10
@@ -1,11 +1,3 @@
-# Show calendar items per one week.
-#
-# Parameters:
-#
-# date (YYYY-MM-DD) - optional
-
-
-# calendar-portlet uses this stuff
if { ![info exists url_stub_callback] } {
set url_stub_callback ""
}
@@ -18,35 +10,28 @@
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_formvar [export_form_vars page_num]
+ set page_num "&page_num=$page_num"
+} else {
+ set page_num_formvar ""
+ set page_num ""
}
-if { ![info exists prev_week_template] } {
- set prev_week_template ""
+if {![exists_and_not_null base_url]} {
+ set base_url ""
}
-if { ![info exists next_week_template] } {
- set next_week_template ""
-}
-
if { ![info exists url_stub_callback] } {
set url_stub_callback ""
}
-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 item_add_template] } {
- set item_add_template ""
-}
-# calendar-portlet
-
-
if {[empty_string_p $date]} {
# Default to todays date in the users (the connection) timezone
set server_now_time [dt_systime]
@@ -73,7 +58,7 @@
set current_weekday 0
-multirow create week_items name item_id start_date calendar_name status_summary day_of_week start_date_weekday start_time end_time no_time_p full_item
+multirow create week_items name item_id ansi_start_date start_date calendar_name status_summary day_of_week start_date_weekday start_time end_time no_time_p full_item
# Convert date from user timezone to system timezone
set first_weekday_of_the_week_tz [lc_time_conn_to_system "$first_weekday_of_the_week 00:00:00"]
@@ -95,7 +80,7 @@
# need to add dummy entries to show all days
for { } { $current_weekday < $day_of_week } { incr current_weekday } {
set ansi_this_date [dt_julian_to_ansi [expr $first_weekday_julian + $current_weekday]]
- multirow append week_items "" "" [lc_time_fmt $ansi_this_date "%x"] "" "" $current_weekday [lc_time_fmt $ansi_this_date %A] "" "" "" ""
+ multirow append week_items "" "" $ansi_this_date [lc_time_fmt $ansi_this_date "%x"] "" "" $current_weekday [lc_time_fmt $ansi_this_date %A] "" "" "" ""
}
if {[string equal $start_time "12:00 AM"] && [string equal $end_time "12:00 AM"]} {
@@ -116,20 +101,31 @@
set item "$name"
set full_item "[subst $item_template]"
-
- multirow append week_items $name $item_id $start_date $calendar_name $status_summary $day_of_week $start_date_weekday $start_time $end_time $no_time_p $full_item
+ multirow append week_items $name $item_id $ansi_start_date $start_date $calendar_name $status_summary $day_of_week $start_date_weekday $start_time $end_time $no_time_p $full_item
set current_weekday $day_of_week
}
if {$current_weekday < 7} {
# need to add dummy entries to show all hours
for { } { $current_weekday < 7 } { incr current_weekday } {
set ansi_this_date [dt_julian_to_ansi [expr $first_weekday_julian + $current_weekday]]
- multirow append week_items "" "" [lc_time_fmt $ansi_this_date "%x"] "" "" $current_weekday [lc_time_fmt $ansi_this_date %A] "" "" "" ""
+ multirow append week_items "" "" $ansi_this_date [lc_time_fmt $ansi_this_date "%x"] "" "" $current_weekday [lc_time_fmt $ansi_this_date %A] "" "" "" ""
}
}
# Navigation Bar
set dates "[lc_time_fmt $first_weekday_date "%q"] - [lc_time_fmt $last_weekday_date "%q"]"
-set url_previous_week ""
-set url_next_week ""
+if { ![info exists prev_week_template] } {
+ set url_previous_week ""
+} else {
+ set url_previous_week [subst $prev_week_template]
+}
+
+if { ![info exists next_week_template] } {
+ set url_next_week ""
+ set next_week_template ""
+} else {
+ set url_next_week [subst $next_week_template]
+}
+
+
Index: openacs-4/packages/calendar/www/view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view.adp,v
diff -u -N -r1.19 -r1.20
--- openacs-4/packages/calendar/www/view.adp 23 Sep 2003 21:35:24 -0000 1.19
+++ openacs-4/packages/calendar/www/view.adp 25 Sep 2003 23:11:12 -0000 1.20
@@ -28,28 +28,24 @@
end_date=@end_date@
date=@date@
period_days=@period_days@
-calendar_id_list=@calendar_list@
sort_by=@sort_by@>
+date="@date@" start_hour=0 end_hour=23>
+date="@date@">
+date=@date@>
|