Index: openacs-4/packages/calendar/tcl/calendar-display-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-display-procs.tcl,v diff -u -r1.34 -r1.35 --- openacs-4/packages/calendar/tcl/calendar-display-procs.tcl 17 May 2003 10:20:50 -0000 1.34 +++ openacs-4/packages/calendar/tcl/calendar-display-procs.tcl 26 May 2003 09:59:54 -0000 1.35 @@ -14,103 +14,6 @@ namespace eval calendar { - ad_proc -public one_month_display { - {-calendar_id_list ""} - {-day_template "\$day_number"} - {-item_template "\$item"} - {-item_add_template ""} - {-date ""} - {-url_stub_callback ""} - {-show_calendar_name_p 1} - {-prev_month_template ""} - {-next_month_template ""} - } { - Creates a month widget with events for that month - - The url_stub_callback parameter allows a parameterizable URL stub - for each calendar_id. If the parameter is non-null, it is considered a proc - that can be called on a calendar_id to generate a URL stub. - } { - if {[empty_string_p $date]} { - set date [dt_systime] - } - - # If we were given no calendars, we assume we display the - # private calendar. It makes no sense for this to be called with - # no data whatsoever. - if {[empty_string_p $calendar_id_list]} { - set calendar_id_list [list [calendar_have_private_p -return_id 1 [ad_get_user_id]]] - } - - set items [ns_set create] - - - db_foreach select_monthly_items {} { - # Calendar name now set in query - # set calendar_name [calendar_get_name $calendar_id] - - # 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 item "[subst $item_template]" - - if {![dt_no_time_p -start_time $start_time -end_time $end_time]} { - set item "$start_time $item" - } - - if {$show_calendar_name_p} { - append item " ($calendar_name)" - } - - # DRB: This ugly hack was added for dotlrn-events, to give us a way to - # flag event status in red in accordance with the spec. When calendar - # is rewritten we should come up with a way for objects derived from - # acs-events to render their own name summary and full descriptions. - - if { [string length $status_summary] > 0 } { - append item " $status_summary " - } - - append item "
" - - ns_set put $items $start_date $item - } - - - # Display stuff - if {[empty_string_p $item_add_template]} { - set day_number_template "$day_template" - } else { - set day_number_template "$day_template     $item_add_template" - } - - return [dt_widget_month -calendar_details $items -date $date \ - -master_bgcolor black \ - -header_bgcolor lavender \ - -header_text_color black \ - -header_text_size "+1" \ - -day_header_bgcolor lavender \ - -day_bgcolor white \ - -today_bgcolor #FFF8DC \ - -empty_bgcolor lightgrey \ - -day_text_color black \ - -prev_next_links_in_title 1 \ - -prev_month_template $prev_month_template \ - -next_month_template $next_month_template \ - -day_number_template $day_number_template] - } - ad_proc -public one_week_display { {-calendar_id_list ""} {-day_template "\$day   -   \$pretty_date"} @@ -171,7 +74,7 @@ if {[dt_no_time_p -start_time $start_date -end_time $end_date]} { set time_details "" } else { - set time_details "$pretty_start_date - $pretty_end_date:" + set time_details "$ansi_start_date - $ansi_end_date:" } set item "$time_details $item_details" @@ -269,7 +172,7 @@ set item $name set item_subst [subst $item_template] - if {[dt_no_time_p -start_time $pretty_start_date -end_time $pretty_end_date]} { + if {[dt_no_time_p -start_time $ansi_start_date -end_time $ansi_end_date]} { # Hack for no-time items set item "$item_subst" if {![empty_string_p $item_details]} { @@ -278,7 +181,7 @@ set ns_set_pos "X" } else { - set item "$pretty_start_date - $pretty_end_date: $item_subst" + set item "$ansi_start_date - $ansi_end_date: $item_subst" if {![empty_string_p $item_details]} { append item " ($item_details)" } @@ -306,147 +209,4 @@ -calendar_details $items -date $date -overlap_p 1] } - - ad_proc -public list_display { - {-date ""} - {-start_date ""} - {-end_date ""} - {-calendar_id_list ""} - {-item_template {$item}} - {-url_template {?sort_by=$order_by}} - {-url_stub_callback ""} - {-show_calendar_name_p 1} - {-sort_by "item_type"} - } { - create a list display of items - } { - # If we were given no calendars, we assume we display the - # private calendar. It makes no sense for this to be called with - # no data whatsoever. - if {[empty_string_p $calendar_id_list]} { - set calendar_id_list [list [calendar_have_private_p -return_id 1 [ad_get_user_id]]] - } - - # sort by cannot be empty - if {[empty_string_p $sort_by]} { - set sort_by "item_type" - } - - set date_format "YYYY-MM-DD HH24:MI" - set current_date $date - set items [ns_set create] - - # Loop through the calendars - foreach calendar_id $calendar_id_list { - set calendar_name [calendar_get_name $calendar_id] - - # 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] - } - - db_foreach select_list_items {} { - ns_log Notice "BMA-CHECK: test $name" - set item "$name" - set item [subst $item_template] - - if {$show_calendar_name_p} { - append item " ($calendar_name)" - } - - ns_set put $items $start_hour [list $pretty_date $pretty_start_date $pretty_end_date $pretty_weekday $item_type $item] - } - - } - - # Now we have the items in a big ns_set - # We call the widget maker - return [dt_widget_list -order_by $sort_by \ - -item_template $item_template \ - -calendar_details $items \ - -start_date $start_date \ - -end_date $end_date \ - -url_template $url_template] - - } - -# ad_proc -public list_display { -# {-date ""} -# {-calendar_id_list ""} -# {-item_template {$item}} -# {-url_stub_callback ""} -# {-show_calendar_name_p 1} -# } { -# Creates a list widget -# } { -# if {[empty_string_p $date]} { -# set date [dt_sysdate] -# } - -# set date_format "YYYY-MM-DD HH24:MI" -# set current_date $date - -# # If we were given no calendars, we assume we display the -# # private calendar. It makes no sense for this to be called with -# # no data whatsoever. -# if {[empty_string_p $calendar_id_list]} { -# set calendar_id_list [list [calendar_have_private_p -return_id 1 [ad_get_user_id]]] -# } - -# set items [ns_set create] - -# # Loop through the calendars -# foreach calendar_id $calendar_id_list { -# set calendar_name [calendar_get_name $calendar_id] - -# # 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] -# } - -# db_foreach select_day_items {} { -# # ns_log Notice "bma: one item" -# set item "$pretty_start_date - $pretty_end_date: $name" - -# if {$show_calendar_name_p} { -# append item " ($calendar_name)" -# } - -# set item [subst $item_template] - -# ns_set put $items $start_hour $item -# } - -# } - -# set return_html "Items for [util_AnsiDatetoPrettyDate $date]:

" - -# return $return_html -# } - - - }