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.30 -r1.31 --- openacs-4/packages/calendar/www/view-one-day-display.tcl 17 May 2004 15:15:00 -0000 1.30 +++ openacs-4/packages/calendar/www/view-one-day-display.tcl 13 Jan 2005 13:56:30 -0000 1.31 @@ -60,6 +60,9 @@ set order_by_clause " order by name" set interval_limitation_clause [db_map dbqd.calendar.www.views.day_interval_limitation] +#AG: the "select_all_day_items" query is identical to "select_items" +#just without the Oracle +ORDERED hint, which speeds every other +#query but slows this one. db_foreach dbqd.calendar.www.views.select_items {} { # reset url stub set url_stub "" @@ -74,6 +77,7 @@ set url_stub $url_stubs($calendar_id) } + set event_url [subst $item_template] multirow append items_without_time $name $event_url $calendar_name $status_summary } @@ -105,7 +109,10 @@ set additional_limitations_clause " and (to_char(start_date, 'HH24:MI') <> '00:00' or to_char(end_date, 'HH24:MI') <> '00:00')" set order_by_clause " order by to_char(start_date,'HH24')" set day_items_per_hour {} + db_foreach dbqd.calendar.www.views.select_items {} { + + set ansi_start_date [lc_time_system_to_conn $ansi_start_date] set ansi_end_date [lc_time_system_to_conn $ansi_end_date] @@ -122,10 +129,10 @@ if { $start_hour == $item_current_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] + [list $item_current_hour $name $item_id $calendar_name $status_summary $start_hour $end_hour $start_time $end_time $calendar_id] } else { lappend day_items_per_hour \ - [list $item_current_hour {} $item_id $calendar_name $status_summary $start_hour $end_hour $start_time $end_time] + [list $item_current_hour {} $item_id $calendar_name $status_summary $start_hour $end_hour $start_time $end_time $calendar_id] } incr items_per_hour($item_current_hour) } @@ -172,16 +179,19 @@ # 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] + + if {![info exists url_stubs([lindex $this_item 9])]} { + set url_stubs([lindex $this_item 9]) [$url_stub_callback [lindex $this_item 9]] } - set url_stub $url_stubs($calendar_id) + set url_stub $url_stubs([lindex $this_item 9]) } + set item [lindex $this_item 1] set item_id [lindex $this_item 2]