calendar::item::edit_recurrence (public)

 calendar::item::edit_recurrence -event_id event_id \
    -start_date start_date -end_date end_date -name name \
    -description description [ -item_type_id item_type_id ] \
    [ -calendar_id calendar_id ] \
    [ -edit_past_events_p edit_past_events_p ]

Defined in packages/calendar/tcl/cal-item-procs.tcl

edit a recurrence

Switches:
-event_id (required)
-start_date (required)
-end_date (required)
-name (required)
-description (required)
-item_type_id (optional)
-calendar_id (optional)
-edit_past_events_p (optional, defaults to "t")

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_edit_recurrence cal_item_edit_recurrence (test calendar) calendar::item::edit_recurrence calendar::item::edit_recurrence test_cal_item_edit_recurrence->calendar::item::edit_recurrence calendar::item::get calendar::item::get (public) calendar::item::edit_recurrence->calendar::item::get db_dml db_dml (public) calendar::item::edit_recurrence->db_dml db_exec_plsql db_exec_plsql (public) calendar::item::edit_recurrence->db_exec_plsql db_string db_string (public) calendar::item::edit_recurrence->db_string db_transaction db_transaction (public) calendar::item::edit_recurrence->db_transaction calendar::item::edit calendar::item::edit (public) calendar::item::edit->calendar::item::edit_recurrence

Testcases:
cal_item_edit_recurrence
Source code:
    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 {}
        # 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 { $calendar_id ne "" } {
            lappend colspecs {on_which_calendar = :calendar_id}

            db_dml update_context_id {
            }
        }

        db_dml recurrence_items_update {}
    }
Generic XQL file:
<fullquery name="calendar::item::edit_recurrence.recurrence_events_update">
    <querytext>
    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)
            )
    </querytext>
</fullquery>

<fullquery name="calendar::item::edit_recurrence.recurrence_items_update">
    <querytext>
            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)
            )
    </querytext>
</fullquery>

<fullquery name="calendar::item::edit_recurrence.update_context_id">
    <querytext>
        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)
            )
    </querytext>
</fullquery>

<fullquery name="calendar::item::edit_recurrence.select_recurrence_id">
    <querytext>
select recurrence_id from acs_events where event_id= :event_id
</querytext>
</fullquery>

<fullquery name="calendar::item::edit_recurrence.recurrence_activities_update">
    <querytext>
    update acs_activities 
    set    name = :name,
           description = :description
    where  activity_id
    in     (
           select activity_id
           from   acs_events
           where  recurrence_id = :recurrence_id
           )
    </querytext>
</fullquery>

<fullquery name="calendar::item::edit_recurrence.recurrence_events_update">
    <querytext>
    update acs_events set
    name= :name, description= :description
    where recurrence_id= :recurrence_id
    </querytext>
</fullquery>

<fullquery name="calendar::item::edit_recurrence.recurrence_items_update">
    <querytext>
            update cal_items
            set    [join $colspecs ", "]
            where  cal_item_id in (select event_id from acs_events where recurrence_id = :recurrence_id)
    </querytext>
</fullquery>
packages/calendar/tcl/cal-item-procs.xql

PostgreSQL XQL file:
<fullquery name="calendar::item::edit_recurrence.recurrence_timespan_update">
    <querytext>
select
  acs_event__recurrence_timespan_edit (
    :event_id,
    :start_date,
    :end_date
  )
</querytext>
</fullquery>
packages/calendar/tcl/cal-item-procs-postgresql.xql

Oracle XQL file:
<fullquery name="calendar::item::edit_recurrence.recurrence_timespan_update">
    <querytext>
begin
  acs_event.recurrence_timespan_edit (
    event_id => :event_id,
    start_date => to_date(:start_date,'YYYY-MM-DD HH24:MI'),
    end_date => to_date(:end_date,'YYYY-MM-DD HH24:MI')
  );
end;
</querytext>
</fullquery>
packages/calendar/tcl/cal-item-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: