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 -r1.2 -r1.3 --- openacs-4/packages/calendar/www/view-list-display.adp 21 Jul 2003 19:21:36 -0000 1.2 +++ openacs-4/packages/calendar/www/view-list-display.adp 29 Aug 2003 20:46:43 -0000 1.3 @@ -39,8 +39,7 @@ @calendar_items.pretty_start_time@ @calendar_items.pretty_end_time@ @calendar_items.item_type@ - @calendar_items.name@ + @calendar_items.full_item;noquote@ (@calendar_items.calendar_name@) 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 -r1.6 -r1.7 --- openacs-4/packages/calendar/www/view-list-display.tcl 14 Aug 2003 15:44:08 -0000 1.6 +++ openacs-4/packages/calendar/www/view-list-display.tcl 29 Aug 2003 20:46:43 -0000 1.7 @@ -4,6 +4,16 @@ set calendar_id [lindex [lindex $calendar_list 0] 1] } +# calendar-portlet uses this stuff +if { ![info exists url_stub_callback] } { + set url_stub_callback "" +} + +if { ![info exists item_template] } { + set item_template "\$item" +} +# calendar-portlet + set calendar_name [calendar_get_name $calendar_id] set package_id [ad_conn package_id] @@ -43,7 +53,7 @@ set flip -1 -multirow create calendar_items calendar_name item_id name item_type pretty_weekday pretty_start_date pretty_end_date pretty_start_time pretty_end_time flip today +multirow create calendar_items calendar_name item_id name item_type pretty_weekday pretty_start_date pretty_end_date pretty_start_time pretty_end_time flip today full_item set last_pretty_start_date "" # Loop through the events, and add them @@ -93,6 +103,14 @@ set today "" } - multirow append calendar_items $calendar_name $item_id $name $item_type $pretty_weekday $pretty_start_date $pretty_end_date $pretty_start_time $pretty_end_time $flip $today + # In case we need to dispatch to a different URL (ben) + if {![empty_string_p $url_stub_callback]} { + set url_stub [$url_stub_callback $calendar_id] + } + + set item "$name" + set item [subst $item_template] + + multirow append calendar_items $calendar_name $item_id $name $item_type $pretty_weekday $pretty_start_date $pretty_end_date $pretty_start_time $pretty_end_time $flip $today $item } 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 -r1.2 -r1.3 --- openacs-4/packages/calendar/www/view-month-display.adp 21 Jul 2003 19:21:36 -0000 1.2 +++ openacs-4/packages/calendar/www/view-month-display.adp 29 Aug 2003 20:46:43 -0000 1.3 @@ -55,7 +55,7 @@
@days_of_a_month.ansi_start_time@ @days_of_a_month.calendar_item@ + href=cal-item-view?cal_item_id=@days_of_a_month.item_id@>@days_of_a_month.full_item;noquote@ [@days_of_a_month.calendar_name@]
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.4 -r1.5 --- openacs-4/packages/calendar/www/view-month-display.tcl 14 Aug 2003 15:44:08 -0000 1.4 +++ openacs-4/packages/calendar/www/view-month-display.tcl 29 Aug 2003 20:46:43 -0000 1.5 @@ -10,6 +10,22 @@ 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 "" +} + +if { ![info exists day_template] } { + set day_template "\$day   -   \$pretty_date" +} + +if { ![info exists item_template] } { + set item_template "\$item" +} +# calendar-portlet + + dt_get_info $date set ansi_date_format "YYYY-MM-DD HH24:MI:SS" @@ -41,15 +57,15 @@ set today_julian_date [dt_ansi_to_julian [lindex $today_ansi_list 0] [lindex $today_ansi_list 1] [lindex $today_ansi_list 2]] -multirow create days_of_a_month calendar_item item_id ansi_start_date ansi_start_time day_number calendar_name beginning_of_week_p end_of_week_p today_p outside_month_p +multirow create days_of_a_month calendar_item item_id ansi_start_date ansi_start_time day_number calendar_name beginning_of_week_p end_of_week_p today_p outside_month_p full_item for {set current_day $first_julian_date} {$current_day < $first_julian_date_of_month} {incr current_day} { if {$current_day == $first_julian_date} { set beginning_of_week_p t } else { set beginning_of_week_p f } - multirow append days_of_a_month "" "" [dt_julian_to_ansi [expr $first_julian_date_of_month + $current_day -1]] "" "" "" $beginning_of_week_p f "" t + multirow append days_of_a_month "" "" [dt_julian_to_ansi [expr $first_julian_date_of_month + $current_day -1]] "" "" "" $beginning_of_week_p f "" t "" } set current_day $first_julian_date_of_month @@ -68,29 +84,45 @@ if {$current_day < $julian_start_date} { for {} {$current_day < $julian_start_date} {incr current_day} { array set display_information [calendar::get_month_multirow_information -current_day $current_day -today_julian_date $today_julian_date -first_julian_date_of_month $first_julian_date_of_month] - multirow append days_of_a_month "" "" [dt_julian_to_ansi $current_day] "" $display_information(day_number) "" $display_information(beginning_of_week_p) $display_information(end_of_week_p) $display_information(today_p) f + multirow append days_of_a_month "" "" [dt_julian_to_ansi $current_day] "" $display_information(day_number) "" $display_information(beginning_of_week_p) $display_information(end_of_week_p) $display_information(today_p) f "" } } if {[string equal $ansi_start_time "00:00"] && [string equal $ansi_end_time "00:00"]} { set ansi_start_time "--" } + # 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 + if {![info exists url_stubs($calendar_id)]} { + set url_stubs($calendar_id) [$url_stub_callback $calendar_id] + } + + set url_stub $url_stubs($calendar_id) + } + + set item "$name" + set full_item "[subst $item_template]" + array set display_information [calendar::get_month_multirow_information -current_day $current_day -today_julian_date $today_julian_date -first_julian_date_of_month $first_julian_date_of_month] - multirow append days_of_a_month $name $item_id [dt_julian_to_ansi $current_day] $ansi_start_time $display_information(day_number) $calendar_name $display_information(beginning_of_week_p) $display_information(end_of_week_p) $display_information(today_p) f + multirow append days_of_a_month $name $item_id [dt_julian_to_ansi $current_day] $ansi_start_time $display_information(day_number) $calendar_name $display_information(beginning_of_week_p) $display_information(end_of_week_p) $display_information(today_p) f $full_item } for {} {$current_day <= $last_julian_date_in_month} {incr current_day} { array set display_information [calendar::get_month_multirow_information -current_day $current_day -today_julian_date $today_julian_date -first_julian_date_of_month $first_julian_date_of_month] - multirow append days_of_a_month "" "" [dt_julian_to_ansi $current_day] "" $display_information(day_number) "" $display_information(beginning_of_week_p) $display_information(end_of_week_p) $display_information(today_p) f + multirow append days_of_a_month "" "" [dt_julian_to_ansi $current_day] "" $display_information(day_number) "" $display_information(beginning_of_week_p) $display_information(end_of_week_p) $display_information(today_p) f "" incr number_day_cells } set remaining_days [expr 6 - $current_day % 7] if {$remaining_days > 0 } { for {} {$current_day <= [expr $last_julian_date_in_month + $remaining_days]} {incr current_day} { - multirow append days_of_a_month "" "" "" "" "" "" f f "" t + 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.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-one-day-display.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/calendar/www/view-one-day-display.adp 18 Aug 2003 16:17:05 -0000 1.5 +++ openacs-4/packages/calendar/www/view-one-day-display.adp 29 Aug 2003 20:46:43 -0000 1.6 @@ -24,18 +24,17 @@ No Time - @day_items_without_time.name@ + @day_items_without_time.full_item;noquote@ - + - + @day_items_with_time.start_time@ - @day_items_with_time.end_time@ - @day_items_with_time.name@@day_items_with_time.calendar_name@ + @day_items_with_time.full_item;noquote@@day_items_with_time.calendar_name@ Index: openacs-4/packages/calendar/www/view-one-day-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-one-day-display.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/calendar/www/view-one-day-display.tcl 18 Aug 2003 16:17:05 -0000 1.10 +++ openacs-4/packages/calendar/www/view-one-day-display.tcl 29 Aug 2003 20:46:43 -0000 1.11 @@ -3,7 +3,23 @@ # Parameters: # # date (YYYY-MM-DD) - optional +# start_display_hour and end_display_hour + +# calendar-portlet uses this stuff +if { ![info exists url_stub_callback] } { + set url_stub_callback "" +} + +if { ![info exists day_template] } { + set day_template "\$day_number" +} + +if { ![info exists item_template] } { + set item_template "\$item" +} +# calendar-portlet + if { ![info exists start_display_hour] } { set start_display_hour 0 } @@ -30,13 +46,30 @@ set user_id [ad_conn user_id] # Loop through the calendars -multirow create day_items_without_time name status_summary item_id calendar_name +multirow create day_items_without_time name status_summary item_id calendar_name full_item db_foreach select_day_items {} { - multirow append day_items_without_time $name $status_summary $item_id $calendar_name + # 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 + if {![info exists url_stubs($calendar_id)]} { + set url_stubs($calendar_id) [$url_stub_callback $calendar_id] + } + + set url_stub $url_stubs($calendar_id) + } + + set item "$name" + set full_item "[subst $item_template]" + + multirow append day_items_without_time $name $status_summary $item_id $calendar_name $full_item } -multirow create day_items_with_time current_hour localized_current_hour name item_id calendar_name status_summary start_hour end_hour start_time end_time colspan rowspan +# Quite some extra code here to be able to display overlapping items. +multirow create day_items_with_time current_hour localized_current_hour name item_id calendar_name status_summary start_hour end_hour start_time end_time colspan rowspan full_item for {set i $start_display_hour } { $i < $end_display_hour } { incr i } { set items_per_hour($i) 0 @@ -55,8 +88,7 @@ set end_time [lc_time_fmt $ansi_end_date "%X"] for { set item_current_hour $start_hour } { $item_current_hour < $end_hour } { incr item_current_hour } { - set item_current_hour [expr int($item_current_hour)] - + set item_current_hour [expr [string trimleft $item_current_hour 0]+0] if {$start_hour == $item_current_hour && $start_hour >= $start_display_hour } { lappend day_items_per_hour [list $item_current_hour $name $item_id $calendar_name $status_summary $start_hour $end_hour $start_time $end_time] } elseif { $end_hour <= $end_display_hour } { @@ -78,28 +110,48 @@ } } -foreach item $day_items_per_hour { - set item_start_hour [expr int( [lindex $item 5])] - set item_end_hour [lindex $item 6] +foreach this_item $day_items_per_hour { + set item_start_hour [expr [string trimleft [lindex $this_item 5] 0]+0] + set item_end_hour [expr [string trimleft [lindex $this_item 6] 0]+0] set rowspan [expr $item_end_hour - $item_start_hour] if {$item_start_hour > $day_current_hour} { # need to add dummy entries to show all hours for { } { $day_current_hour < $item_start_hour } { incr day_current_hour } { set localized_day_current_hour [lc_time_fmt "$current_date $day_current_hour:00:00" "%r"] - multirow append day_items_with_time $day_current_hour $localized_day_current_hour "" "" "" "" "" "" "" "" 0 0 + multirow append day_items_with_time $day_current_hour $localized_day_current_hour "" "" "" "" "" "" "" "" 0 0 "" } } set localized_day_current_hour [lc_time_fmt "$current_date $day_current_hour:00:00" "%r"] - multirow append day_items_with_time [lindex $item 0] $localized_day_current_hour [lindex $item 1] [lindex $item 2] [lindex $item 3] [lindex $item 4] [lindex $item 5] [lindex $item 6] [lindex $item 7] [lindex $item 8] 0 $rowspan - set day_current_hour [expr [lindex $item 0] +1 ] + + # 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 + if {![info exists url_stubs($calendar_id)]} { + set url_stubs($calendar_id) [$url_stub_callback $calendar_id] + } + + set url_stub $url_stubs($calendar_id) + } + + set start_time [lindex $this_item 7] + set end_time [lindex $this_item 8] + + set item [lindex $this_item 1] + set full_item "[subst $item_template]" + + multirow append day_items_with_time [lindex $this_item 0] $localized_day_current_hour [lindex $this_item 1] [lindex $this_item 2] [lindex $this_item 3] [lindex $this_item 4] [lindex $this_item 5] [lindex $this_item 6] [lindex $this_item 7] [lindex $this_item 8] 0 $rowspan $full_item + set day_current_hour [expr [lindex $this_item 0] +1 ] } if {$day_current_hour < $end_display_hour } { # need to add dummy entries to show all hours for { } { $day_current_hour <= $end_display_hour } { incr day_current_hour } { set localized_day_current_hour [lc_time_fmt "$current_date $day_current_hour:00:00" "%r"] - multirow append day_items_with_time $day_current_hour $localized_day_current_hour "" "" "" "" "" 0 0 + multirow append day_items_with_time $day_current_hour $localized_day_current_hour "" "" "" "" "" 0 0 "" } } 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 -r1.2 -r1.3 --- openacs-4/packages/calendar/www/view-week-display.adp 21 Jul 2003 19:21:36 -0000 1.2 +++ openacs-4/packages/calendar/www/view-week-display.adp 29 Aug 2003 20:46:43 -0000 1.3 @@ -54,7 +54,7 @@ @week_items.start_time@ - @week_items.end_time@ - @week_items.name@ + @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 -r1.6 -r1.7 --- openacs-4/packages/calendar/www/view-week-display.tcl 18 Aug 2003 19:15:50 -0000 1.6 +++ openacs-4/packages/calendar/www/view-week-display.tcl 29 Aug 2003 20:46:43 -0000 1.7 @@ -4,6 +4,22 @@ # # date (YYYY-MM-DD) - optional + +# calendar-portlet uses this stuff +if { ![info exists url_stub_callback] } { + set url_stub_callback "" +} + +if { ![info exists day_template] } { + set day_template "\$day   -   \$pretty_date" +} + +if { ![info exists item_template] } { + set item_template "\$item" +} +# calendar-portlet + + if {[empty_string_p $date]} { # Default to todays date in the users (the connection) timezone set server_now_time [dt_systime] @@ -34,7 +50,7 @@ set current_weekday 0 # Loop through the calendars -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 +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 # Convert date from user timezone to system timezone set sunday_of_the_week_system [lc_time_conn_to_system "$sunday_of_the_week 00:00:00"] @@ -58,7 +74,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 $sunday_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 "" "" [lc_time_fmt $ansi_this_date "%x"] "" "" $current_weekday [lc_time_fmt $ansi_this_date %A] "" "" "" "" } } @@ -68,15 +84,28 @@ set no_time_p f } - 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 + # In case we need to dispatch to a different URL (ben) + if {![empty_string_p $url_stub_callback]} { + # Cache the stuff + if {![info exists url_stubs($calendar_id)]} { + set url_stubs($calendar_id) [$url_stub_callback $calendar_id] + } + + set url_stub $url_stubs($calendar_id) + } + + 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 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 $sunday_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 "" "" [lc_time_fmt $ansi_this_date "%x"] "" "" $current_weekday [lc_time_fmt $ansi_this_date %A] "" "" "" "" } } Index: openacs-4/packages/calendar/www/view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view.adp,v diff -u -r1.15 -r1.16 --- openacs-4/packages/calendar/www/view.adp 13 Aug 2003 16:08:33 -0000 1.15 +++ openacs-4/packages/calendar/www/view.adp 29 Aug 2003 20:46:43 -0000 1.16 @@ -3,7 +3,6 @@ #calendar.Calendar# -