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 -N -r1.11 -r1.12 --- openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql 13 Jan 2005 13:56:27 -0000 1.11 +++ openacs-4/packages/calendar/tcl/cal-item-procs-oracle.xql 2 Sep 2008 20:48:09 -0000 1.12 @@ -202,4 +202,53 @@ end; + + + + update acs_events set + [join $colspecs ", "] + where recurrence_id= :recurrence_id + and event_id in + (select e.event_id + from acs_events e, timespans t, time_intervals i + where e.recurrence_id = :recurrence_id + and t.timespan_id = e.timespan_id + and i.interval_id = t.interval_id + and (:edit_past_events_p = 't' + or i.start_date >= :start_date) + ) + + + + + + update cal_items + set [join $colspecs ", "] + where cal_item_id in (select e.event_id + from acs_events e, timespans t, time_intervals i + where e.recurrence_id = :recurrence_id + and t.timespan_id = e.timespan_id + and i.interval_id = t.interval_id + and (:edit_past_events_p = 't' + or i.start_date >= :start_date) + ) + + + + + + update acs_objects + set context_id = :calendar_id + where object_id in + (select e.event_id + from acs_events e, timespans t, time_intervals i + where e.recurrence_id = :recurrence_id + and t.timespan_id = e.timespan_id + and i.interval_id = t.interval_id + and (:edit_past_events_p = 't' + or i.start_date >= :start_date) + ) + + + 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 -N -r1.19 -r1.20 --- openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql 8 Aug 2006 21:26:17 -0000 1.19 +++ openacs-4/packages/calendar/tcl/cal-item-procs-postgresql.xql 2 Sep 2008 20:48:09 -0000 1.20 @@ -193,4 +193,52 @@ + + + update acs_events set + [join $colspecs ", "] + where recurrence_id= :recurrence_id + and event_id in + (select e.event_id + from acs_events e, timespans t, time_intervals i + where e.recurrence_id = :recurrence_id + and t.timespan_id = e.timespan_id + and i.interval_id = t.interval_id + and (:edit_past_events_p = 't' + or i.start_date >= :start_date) + ) + + + + + + update cal_items + set [join $colspecs ", "] + where cal_item_id in (select e.event_id + from acs_events e, timespans t, time_intervals i + where e.recurrence_id = :recurrence_id + and t.timespan_id = e.timespan_id + and i.interval_id = t.interval_id + and (:edit_past_events_p = 't' + or i.start_date >= :start_date) + ) + + + + + + update acs_objects + set context_id = :calendar_id + where object_id in + (select e.event_id + from acs_events e, timespans t, time_intervals i + where e.recurrence_id = :recurrence_id + and t.timespan_id = e.timespan_id + and i.interval_id = t.interval_id + and (:edit_past_events_p = 't' + or i.start_date >= :start_date) + ) + + + 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 -N -r1.23 -r1.24 --- openacs-4/packages/calendar/tcl/cal-item-procs.tcl 30 Aug 2008 19:51:23 -0000 1.23 +++ openacs-4/packages/calendar/tcl/cal-item-procs.tcl 2 Sep 2008 20:48:09 -0000 1.24 @@ -168,6 +168,7 @@ {-description:required} {-item_type_id ""} {-edit_all_p 0} + {-edit_past_events_p 1} {-calendar_id ""} } { Edit the item @@ -186,7 +187,8 @@ -name $name \ -description $description \ -item_type_id $item_type_id \ - -calendar_id $calendar_id + -calendar_id $calendar_id \ + -edit_past_events_p $edit_past_events_p return } @@ -283,25 +285,35 @@ {-description:required} {-item_type_id ""} {-calendar_id ""} + {-edit_past_events_p "t"} } { edit a recurrence } { set recurrence_id [db_string select_recurrence_id {}] - + set edit_past_events_p [string map {0 f 1 t} [string is true $edit_past_events_p]] db_transaction { db_exec_plsql recurrence_timespan_update {} - - db_dml recurrence_events_update {} + # compare this event to the original one we are + # editing DAVEB 2007-03-15 + calendar::item::get \ + -cal_item_id $event_id \ + -array orig_event set colspecs [list] + foreach col {name description} { + if {$orig_event($col) ne [set $col]} { + lappend colspecs "$col = :$col" + } + } + if {[llength $colspecs]} { + db_dml recurrence_events_update {} + } + set colspecs [list] lappend colspecs {item_type_id = :item_type_id} if { ![empty_string_p $calendar_id] } { lappend colspecs {on_which_calendar = :calendar_id} db_dml update_context_id { - update acs_objects - set context_id = :calendar_id - where object_id in (select event_id from acs_events where recurrence_id = :recurrence_id) } }