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):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::item::add_recurrence calendar::item::add_recurrence test_cal_item_add_delete->calendar::item::add_recurrence test_cal_item_edit_recurrence cal_item_edit_recurrence (test calendar) test_cal_item_edit_recurrence->calendar::item::add_recurrence db_dml db_dml (public) calendar::item::add_recurrence->db_dml db_exec_plsql db_exec_plsql (public) calendar::item::add_recurrence->db_exec_plsql db_transaction db_transaction (public) calendar::item::add_recurrence->db_transaction Class ::xo::ical::VCALITEM Class ::xo::ical::VCALITEM (public) Class ::xo::ical::VCALITEM->calendar::item::add_recurrence calendar_item_add_recurrence calendar_item_add_recurrence (public, deprecated) calendar_item_add_recurrence->calendar::item::add_recurrence packages/calendar/www/cal-item-create-recurrence.tcl packages/calendar/ www/cal-item-create-recurrence.tcl packages/calendar/www/cal-item-create-recurrence.tcl->calendar::item::add_recurrence xo::ical::VCALITEM instproc add_recurrence xo::ical::VCALITEM instproc add_recurrence (public) xo::ical::VCALITEM instproc add_recurrence->calendar::item::add_recurrence xo::ical::VCALITEM instproc edit_recurrence xo::ical::VCALITEM instproc edit_recurrence (public) xo::ical::VCALITEM instproc edit_recurrence->calendar::item::add_recurrence

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_id
Generic 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

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