Index: openacs-4/packages/calendar/sql/oracle/cal-item-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/sql/oracle/cal-item-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/calendar/sql/oracle/cal-item-create.sql 17 Mar 2002 19:54:04 -0000 1.7 +++ openacs-4/packages/calendar/sql/oracle/cal-item-create.sql 25 Apr 2002 16:42:26 -0000 1.8 @@ -108,6 +108,10 @@ procedure delete ( cal_item_id in cal_items.cal_item_id%TYPE ); + + procedure delete_all ( + recurrence_id in acs_events.recurrence_id%TYPE + ); -- functions to return the name of the cal_item function name ( @@ -213,6 +217,21 @@ acs_event.delete(cal_item_id); end delete; + procedure delete_all ( + recurrence_id in acs_events.recurrence_id%TYPE + ) is + v_event_id acs_events%ROWTYPE; + begin + FOR v_event_id in + (select * from acs_events + where recurrence_id = delete_all.recurrence_id) + LOOP + cal_item.delete(v_event_id.event_id); + end LOOP; + + recurrence.delete(recurrence_id); + end delete_all; + -- functions to return the name of the cal_item function name ( cal_item_id in cal_items.cal_item_id%TYPE 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.7 -r1.8 --- openacs-4/packages/calendar/sql/postgresql/cal-item-create.sql 16 Apr 2002 05:16:42 -0000 1.7 +++ openacs-4/packages/calendar/sql/postgresql/cal-item-create.sql 25 Apr 2002 16:42:26 -0000 1.8 @@ -188,6 +188,27 @@ end;' LANGUAGE 'plpgsql'; +CREATE FUNCTION cal_item__delete_all ( + integer +) +RETURNS integer AS ' +declare + delete__recurrence_id alias for $1; + v_event_id integer; +begin + for v_event_id in (select event_id from acs_events + where recurrence_id= delete__recurrence_id) + LOOP + PERFORM cal_item__delete(v_event_id); + END LOOP; + + PERFORM recurrence__delete(delete__recurrence_id); + + return 0; + +end;' LANGUAGE 'plpgsql'; + + ------------------------------------------------------------- -- the name function ------------------------------------------------------------- Index: openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql 24 Aug 2001 01:19:03 -0000 1.1 +++ openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql 25 Apr 2002 16:42:26 -0000 1.2 @@ -137,5 +137,17 @@ + + + + begin + cal_item.delete_all ( + recurrence_id => :recurrence_id + ); + end; + + + + Index: openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql 8 Mar 2002 22:29:24 -0000 1.6 +++ openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql 25 Apr 2002 16:42:26 -0000 1.7 @@ -125,5 +125,14 @@ + + + select cal_item__delete_all ( + :recurrence_id + ) + + + + Index: openacs-4/packages/calendar/tcl/cal-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/calendar/tcl/cal-item-procs.tcl 16 Mar 2002 21:06:44 -0000 1.5 +++ openacs-4/packages/calendar/tcl/cal-item-procs.tcl 25 Apr 2002 16:42:26 -0000 1.6 @@ -269,7 +269,22 @@ } +# Recurrences +ad_proc -public cal_item_delete_recurrence { + {-recurrence_id:required} +} { + # call delete procedure + db_exec_plsql delete_cal_item_recurrence " + begin + cal_item.delete_all ( + recurrence_id => :recurrence_id + ); + end; + " +} + + ad_proc -public calendar_item_add_recurrence { {-cal_item_id:required} {-interval_type:required} Index: openacs-4/packages/calendar/www/cal-item-delete-all-occurrences.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-delete-all-occurrences.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/calendar/www/cal-item-delete-all-occurrences.tcl 25 Apr 2002 16:42:26 -0000 1.1 @@ -0,0 +1,15 @@ + +ad_page_contract { + delete all occurences of a recurring item + + @author Ben Adida (ben@openforce) + @creation-date April 25, 2002 +} { + recurrence_id + {show_cal_nav 1} + {return_url "./"} +} + +cal_item_delete_recurrence -recurrence_id $recurrence_id + +ad_returnredirect $return_url Index: openacs-4/packages/calendar/www/cal-item-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar/www/cal-item-view.adp 10 Apr 2002 00:54:09 -0000 1.1 +++ openacs-4/packages/calendar/www/cal-item-view.adp 25 Apr 2002 16:42:26 -0000 1.2 @@ -21,12 +21,17 @@ - + +
Date and Time:@item_data.start_date@, from @item_data.start_time@ to @item_data.end_time@
@description@
Date and Time:@item_data.start_date@, from @item_data.start_time@ to @item_data.end_time@
Title:@item_data.name@
Type:@item_data.item_type@

- edit | delete + edit | delete + +| delete all occurrences + + Index: openacs-4/packages/calendar/www/cal-item-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/calendar/www/cal-item-view.tcl 10 Apr 2002 00:54:09 -0000 1.1 +++ openacs-4/packages/calendar/www/cal-item-view.tcl 25 Apr 2002 16:42:26 -0000 1.2 @@ -29,6 +29,7 @@ # Select information about the calendar item db_1row get_item_data { select to_char(start_date,'HH:MIpm')as start_time, + start_date as raw_start_date, to_char(start_date, 'MM/DD/YYYY') as start_date, to_char(end_date, 'HH:MIpm') as end_time, nvl(a. name, e.name) as name,