Index: openacs-4/packages/calendar-portlet/www/calendar-full-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/www/calendar-full-portlet.adp,v diff -u -r1.18 -r1.19 --- openacs-4/packages/calendar-portlet/www/calendar-full-portlet.adp 22 Sep 2003 10:04:39 -0000 1.18 +++ openacs-4/packages/calendar-portlet/www/calendar-full-portlet.adp 26 Sep 2003 06:54:44 -0000 1.19 @@ -18,19 +18,74 @@ %> + +
- @cal_nav;noquote@ +

- @cal_stuff;noquote@ + + + + + + + + + + + + + + + + + +
Index: openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl,v diff -u -r1.27 -r1.28 --- openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl 22 Sep 2003 10:04:39 -0000 1.27 +++ openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl 26 Sep 2003 06:54:44 -0000 1.28 @@ -45,6 +45,8 @@ } set list_of_calendar_ids $config(calendar_id) +set base_url [ad_conn url] + set scoped_p $config(scoped_p) if {$scoped_p == "t"} { set show_calendar_name_p 1 @@ -72,28 +74,25 @@ } } +# global variables set current_date $date set date_format "YYYY-MM-DD HH24:MI" set return_url "[ns_conn url]?[ns_conn query]" set encoded_return_url [ns_urlencode $return_url] -set cal_nav [dt_widget_calendar_navigation "" $view $date "page_num=$page_num"] - set item_template "\$item" - if {$create_p} { - set hour_template "\$hour" + set hour_template "\$localized_day_current_hour" set item_add_template "+" } else { - set hour_template "\$hour" + set hour_template "\$localized_day_current_hour" set item_add_template "" } -if {$view == "day"} { +set url_stub_callback "calendar_portlet_display::get_url_stub" - # Check that the previous and next days are in the tcl boundaries - # so that the calendar widget doesn't bomb when it creates the next/prev links +if {$view == "day"} { if {[catch {set yest [clock format [clock scan "1 day ago" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { set previous_link "" } else { @@ -113,23 +112,9 @@ set next_link "\"forward" } } - - - set cal_stuff [calendar::one_day_display \ - -prev_nav_template $previous_link \ - -next_nav_template $next_link \ - -item_template $item_template \ - -hour_template $hour_template \ - -date $current_date -start_hour 7 -end_hour 22 \ - -calendar_id_list $list_of_calendar_ids \ - -url_stub_callback "calendar_portlet_display::get_url_stub" \ - -show_calendar_name_p $show_calendar_name_p] } if {$view == "week"} { - - # Check that the previous and next weeks are in the tcl boundaries - # so that the calendar widget doesn't bomb when it creates the next/prev links if {[catch {set last_w [clock format [clock scan "1 week ago" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { set previous_link "" } else { @@ -150,77 +135,45 @@ } } - set cal_stuff [calendar::one_week_display \ - -item_template $item_template \ - -day_template "\"Add\$day - \$pretty_date" \ - -date $current_date \ - -calendar_id_list $list_of_calendar_ids \ - -url_stub_callback "calendar_portlet_display::get_url_stub" \ - -prev_week_template "\"back" \ - -next_week_template "\"forward" \ - -show_calendar_name_p $show_calendar_name_p - ] + set prev_week_template "\"back" + set next_week_template "\"forward" } -if {$view == "month"} { - # Check that the previous and next months are in the tcl boundaries - # so that the calendar widget doesn't bomb when it creates the next/prev links +if {$view == "month"} { if {[catch {set prev_m [clock format [clock scan "1 month ago" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set previous_link "" + set prev_month_template "" } else { if {[catch {clock scan $prev_m}]} { - set previous_link "" + set prev_month_template "" } else { - set previous_link "\"back" + set prev_month_template "\"back" } } if {[catch {set next_m [clock format [clock scan "1 month" -base [clock scan $date]] -format "%Y-%m-%d"]}]} { - set next_link "" + set next_month_template "" } else { if {[catch {clock scan $next_m}]} { - set next_link "" + set next_month_template "" } else { - set next_link "\"forward" + set next_month_template "\"forward" } } - - - set cal_stuff [calendar::one_month_display \ - -item_template "$item_template" \ - -day_template "\$day_number" \ - -date $current_date \ - -item_add_template "$item_add_template" \ - -calendar_id_list $list_of_calendar_ids \ - -url_stub_callback "calendar_portlet_display::get_url_stub" \ - -prev_month_template $previous_link \ - -next_month_template $next_link \ - -show_calendar_name_p $show_calendar_name_p] } + if {$view == "list"} { set sort_by [ns_queryget sort_by] set thirty_days [expr 60*60*24*30] + set start_date [ns_fmttime [expr [ns_time] - $thirty_days] "%Y-%m-%d 00:00"] set end_date [ns_fmttime [expr [ns_time] + $thirty_days] "%Y-%m-%d 00:00"] - set cal_stuff [calendar::list_display \ - -item_template $item_template \ - -date $current_date \ - -start_date $start_date \ - -end_date $end_date \ - -calendar_id_list $list_of_calendar_ids \ - -sort_by $sort_by \ - -url_template "?view=list&sort_by=\$order_by&page_num=$page_num" \ - -url_stub_callback "calendar_portlet_display::get_url_stub" \ - -show_calendar_name_p $show_calendar_name_p] + set url_template "?view=list&sort_by=\$order_by&page_num=$page_num" } -if {$view == "year"} { - set cal_stuff "" -} ad_return_template Index: openacs-4/packages/calendar-portlet/www/calendar-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/www/calendar-portlet.adp,v diff -u -r1.11 -r1.12 --- openacs-4/packages/calendar-portlet/www/calendar-portlet.adp 22 Sep 2003 10:04:39 -0000 1.11 +++ openacs-4/packages/calendar-portlet/www/calendar-portlet.adp 26 Sep 2003 06:54:44 -0000 1.12 @@ -19,7 +19,18 @@ %> + + + + @cal_stuff;noquote@ +   Index: openacs-4/packages/calendar-portlet/www/calendar-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/www/calendar-portlet.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/calendar-portlet/www/calendar-portlet.tcl 22 Sep 2003 10:04:39 -0000 1.23 +++ openacs-4/packages/calendar-portlet/www/calendar-portlet.tcl 26 Sep 2003 06:54:44 -0000 1.24 @@ -42,6 +42,7 @@ array set config $cf set view $config(default_view) set list_of_calendar_ids $config(calendar_id) +set base_url [ad_conn url] set scoped_p $config(scoped_p) @@ -73,10 +74,10 @@ set item_template "\$item" if {$create_p} { - set hour_template "\$hour" - set item_add_template "ADD" + set hour_template "\$localized_day_current_hour" + set item_add_template "+" } else { - set hour_template "\$hour" + set hour_template "\$localized_day_current_hour" set item_add_template "" } @@ -105,16 +106,8 @@ } } - - set cal_stuff [calendar::one_day_display \ - -prev_nav_template $previous_link \ - -next_nav_template $next_link \ - -item_template $item_template \ - -hour_template $hour_template \ - -date $current_date -start_hour 7 -end_hour 22 \ - -calendar_id_list $list_of_calendar_ids \ - -url_stub_callback "calendar_portlet_display::get_url_stub" \ - -show_calendar_name_p $show_calendar_name_p] +# -url_stub_callback "calendar_portlet_display::get_url_stub" \ +# -show_calendar_name_p $show_calendar_name_p] }