Index: openacs-4/packages/calendar/sql/postgresql/cal-item-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/sql/postgresql/cal-item-create.sql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/calendar/sql/postgresql/cal-item-create.sql 8 Mar 2002 22:29:24 -0000 1.6 +++ openacs-4/packages/calendar/sql/postgresql/cal-item-create.sql 16 Apr 2002 05:16:42 -0000 1.7 @@ -75,6 +75,10 @@ constraint cal_item_which_cal_fk references calendars on delete cascade + item_type_id integer, + constraint cal_items_type_fk + foreign key (on_which_calendar, item_type_id) + references cal_item_types(calendar_id, item_type_id) ); comment on table cal_items is ' Index: openacs-4/packages/calendar/sql/postgresql/calendar-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/sql/postgresql/calendar-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/calendar/sql/postgresql/calendar-create.sql 19 Jan 2002 23:45:46 -0000 1.7 +++ openacs-4/packages/calendar/sql/postgresql/calendar-create.sql 16 Apr 2002 05:16:42 -0000 1.8 @@ -246,6 +246,25 @@ '; +-- Calendar Item Types + +create sequence cal_item_type_seq; + +create table cal_item_types ( + item_type_id integer not null + constraint cal_item_type_id_pk + primary key, + calendar_id integer not null + constraint cal_item_type_cal_id_fk + references calendars(calendar_id), + type varchar(100) not null, + -- this constraint is obvious given that item_type_id + -- is unique, but it's necessary to allow strong + -- references to the pair calendar_id, item_type_id (ben) + constraint cal_item_types_un + unique (calendar_id, item_type_id) +); + ------------------------------------------------------------- -- Load cal_item_object ------------------------------------------------------------- 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.13 -r1.14 --- openacs-4/packages/calendar/tcl/calendar-display-procs.tcl 11 Apr 2002 19:58:12 -0000 1.13 +++ openacs-4/packages/calendar/tcl/calendar-display-procs.tcl 16 Apr 2002 05:16:42 -0000 1.14 @@ -20,8 +20,13 @@ {-item_template "\$item"} {-item_add_template ""} {-date ""} + {-url_stub_callback ""} } { 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] @@ -40,6 +45,11 @@ 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 [eval $url_stub_callback $calendar_id] + } + db_foreach select_monthly_items {} { set item "$name" set item "[subst $item_template]
" @@ -73,8 +83,13 @@ {-item_template "\$item"} {-item_add_template ""} {-date ""} + {-url_stub_callback ""} } { Creates a week widget + + 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_sysdate] @@ -99,9 +114,15 @@ 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 [eval $url_stub_callback $calendar_id] + } + db_foreach select_week_items {} { set item "$pretty_start_date - $pretty_end_date: $name ($calendar_name)" set item "[subst $item_template]
" + if { [string length $status_summary] > 0 } { append item " $status_summary " } @@ -133,8 +154,13 @@ {-next_nav_template {>}} {-start_hour 0} {-end_hour 23} + {-url_stub_callback ""} } { Creates a day widget + + 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. } { set widget_start_hour $start_hour set widget_end_hour $end_hour @@ -161,6 +187,11 @@ set calendar_name [calendar_get_name $calendar_id] # ns_log Notice "bma: one calendar $calendar_name" + # In case we need to dispatch to a different URL (ben) + if {![empty_string_p $url_stub_callback]} { + set url_stub [eval $url_stub_callback $calendar_id] + } + db_foreach select_day_items {} { if {[empty_string_p $item_type]} { set item_details "$calendar_name" @@ -207,6 +238,7 @@ {-date ""} {-calendar_id_list ""} {-item_template {$item}} + {-url_stub_callback ""} } { Creates a list widget } {