Index: openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 9 Dec 2001 20:20:31 -0000 1.16 +++ openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 10 Dec 2001 02:48:38 -0000 1.17 @@ -31,34 +31,30 @@ } ad_proc -public add_self_to_page { - portal_id + page_id calendar_id } { Adds a calendar PE to the given page with the community_id. @return element_id The new element's id - @param portal_id The page to add self to + @param page_id The page to add self to @param community_id The community with the folder @author arjun@openforce.net @creation-date Sept 2001 } { - # Find out if this calendar already exists - set element_id_list \ - [portal::get_element_ids_by_ds $portal_id [my_name]] + set element_id_list [portal::get_element_ids_by_ds $page_id [my_name]] if {[llength $element_id_list] == 0} { - set element_id [portal::add_element $portal_id [my_name]] + set element_id [portal::add_element $page_id [my_name]] # Set the single calendar_id as a param portal::set_element_param $element_id "calendar_id" $calendar_id } else { set element_id [lindex $element_id_list 0] # There are existing calendar_id's which should NOT be overwritten portal::add_element_param_value \ - -element_id $element_id \ - -key calendar_id \ - -value $calendar_id + -element_id $element_id -key calendar_id -value $calendar_id } return $element_id @@ -91,55 +87,60 @@ set set_id [ns_set new day_items] # otherwise, get the calendar_name for the give_id - set calendar_name [calendar_get_name $calendar_id] set view $config(default_view) set list_of_calendar_ids $config(calendar_id) - - foreach calendar_id $list_of_calendar_ids { - set calendar_name "" - # [calendar_get_name $calendar_id] - - if { $view == "day" } { - # big non-ported query, i'm bad - db_foreach get_day_items " - select to_char(start_date, 'HH24') as start_hour, - to_char(start_date, 'HH24:MI') as pretty_start_date, - to_char(end_date, 'HH24:MI') as pretty_end_date, - nvl(e.name, a.name) as name, - e.event_id as item_id - from acs_activities a, - acs_events e, - timespans s, - time_intervals t - where e.timespan_id = s.timespan_id - and s.interval_id = t.interval_id - and e.activity_id = a.activity_id - and start_date between - to_date(:current_date,:date_format) and - to_date(:current_date,:date_format) + (24 - 1/3600)/24 - and e.event_id - in ( - select cal_item_id - from cal_items - where on_which_calendar = :calendar_id - )" { - ns_set put $set_id $start_hour \ - " - $pretty_start_date - $pretty_end_date $name ($calendar_name) -
" - } - - } - - # shaded_p support version 1 + if { $view == "day" } { + + foreach calendar_id $list_of_calendar_ids { + + set calendar_name "" + # [calendar_get_name $calendar_id] + + ns_log notice "aks11: the current calendar_id os $calendar_id, $calendar_name list is $list_of_calendar_ids, cf $cf" + + # big non-ported query, i'm bad + db_foreach get_day_items " + select to_char(start_date, 'HH24') as start_hour, + to_char(start_date, 'HH24:MI') as pretty_start_date, + to_char(end_date, 'HH24:MI') as pretty_end_date, + nvl(e.name, a.name) as name, + e.event_id as item_id + from acs_activities a, + acs_events e, + timespans s, + time_intervals t + where e.timespan_id = s.timespan_id + and s.interval_id = t.interval_id + and e.activity_id = a.activity_id + and start_date between + to_date(:current_date,:date_format) and + to_date(:current_date,:date_format) + (24 - 1/3600)/24 + and e.event_id + in ( + select cal_item_id + from cal_items + where on_which_calendar = :calendar_id + )" { + ns_set put $set_id $start_hour \ + " + $pretty_start_date - $pretty_end_date $name ($calendar_name) +
" + } + + } + + # shaded_p support version 1 set row_html " - - - - \n" + $calendar_name +

+
+

TimeTitle
+ + + \n" while {$i < $num_hour_rows} { set filled_cell_count 0 @@ -233,10 +234,10 @@ ) } { ns_set put $set_id $start_date \ - "
  • + "
  • $pretty_start_date - $pretty_end_date $name ($calendar_name) " - append items "
  • + append items "
  • $pretty_start_date - $pretty_end_date $name ($calendar_name)
    " } @@ -268,7 +269,7 @@ append row_html "
  • @@ -319,7 +320,7 @@ where on_which_calendar = :calendar_id ) " { ns_set put $set_id $start_date \ - " + " $name ($calendar_name)
    " } @@ -355,10 +356,10 @@ where on_which_calendar = :calendar_id )" { ns_set put $set_id $start_date \ - " + " $pretty_start_date - $pretty_end_date $name ($calendar_name)
    " - append items "
  • + append items "
  • $pretty_start_date - $pretty_end_date $name ($calendar_name)
    " } @@ -449,7 +450,7 @@ } { Removes a calendar PE from the given page - @param portal_id The page to remove self from + @param page_id The page to remove self from @param community_id @author arjun@openforce.net @creation-date Sept 2001 @@ -484,28 +485,28 @@ } ad_proc -public make_self_available { - portal_id + page_id } { Wrapper for the portal:: proc - @param portal_id + @param page_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_available \ - $portal_id [portal::get_datasource_id [my_name]] + $page_id [portal::get_datasource_id [my_name]] } ad_proc -public make_self_unavailable { - portal_id + page_id } { Wrapper for the portal:: proc - @param portal_id + @param page_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_unavailable \ - $portal_id [portal::get_datasource_id [my_name]] + $page_id [portal::get_datasource_id [my_name]] } }
  • TimeTitle
    $weekday - $pretty_date + $pretty_date