calendar::item::add_recurrence (public)
calendar::item::add_recurrence -cal_item_id cal_item_id \ -interval_type interval_type -every_n every_n \ [ -days_of_week days_of_week ] [ -recur_until recur_until ]
Defined in packages/calendar/tcl/cal-item-procs.tcl
Adds a recurrence for a calendar item
- Switches:
- -cal_item_id (required)
- -interval_type (required)
- -every_n (required)
- -days_of_week (optional)
- -recur_until (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- cal_item_edit_recurrence, cal_item_add_delete
Source code: db_transaction { set recurrence_id [db_exec_plsql create_recurrence {}] db_dml update_event {} db_exec_plsql insert_instances {} # Make sure they're all in the calendar! db_dml insert_cal_items {} } return $recurrence_idGeneric XQL file: <fullquery name="calendar::item::add_recurrence.update_event"> <querytext> update acs_events set recurrence_id= :recurrence_id where event_id= :cal_item_id </querytext> </fullquery> <fullquery name="calendar::item::add_recurrence.insert_cal_items"> <querytext> insert into cal_items (cal_item_id, on_which_calendar, item_type_id) select event_id, (select on_which_calendar as calendar_id from cal_items where cal_item_id = :cal_item_id), (select item_type_id as item_type from cal_items where cal_item_id = :cal_item_id) from acs_events where recurrence_id= :recurrence_id and event_id <> :cal_item_id </querytext> </fullquery>packages/calendar/tcl/cal-item-procs.xql
PostgreSQL XQL file: <fullquery name="calendar::item::add_recurrence.create_recurrence"> <querytext> select recurrence__new(:interval_type, :every_n, :days_of_week, :recur_until, NULL) </querytext> </fullquery> <fullquery name="calendar::item::add_recurrence.insert_instances"> <querytext> select acs_event__insert_instances(:cal_item_id, NULL); </querytext> </fullquery>packages/calendar/tcl/cal-item-procs-postgresql.xql
Oracle XQL file: <fullquery name="calendar::item::add_recurrence.create_recurrence"> <querytext> begin :1 := recurrence.new(interval_type => :interval_type, every_nth_interval => :every_n, days_of_week => :days_of_week, recur_until => to_date(:recur_until,'YYYY-MM-DD HH24:MI')); end; </querytext> </fullquery> <fullquery name="calendar::item::add_recurrence.insert_instances"> <querytext> begin acs_event.insert_instances(event_id => :cal_item_id); end; </querytext> </fullquery>packages/calendar/tcl/cal-item-procs-oracle.xql