171: SELECT task_id
172: , calendar_start_date
173: FROM jtf_tasks_b
174: WHERE recurrence_rule_id = b_recurrence_rule_id
175: AND ((b_add_option = JTF_TASK_REPEAT_APPT_PVT.G_ALL) OR
176: (b_add_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE AND calendar_start_date >= b_calendar_start_date) OR
177: (b_add_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE AND calendar_start_date = b_calendar_start_date));
178:
179: l_task_exclusion_id NUMBER;
172: , calendar_start_date
173: FROM jtf_tasks_b
174: WHERE recurrence_rule_id = b_recurrence_rule_id
175: AND ((b_add_option = JTF_TASK_REPEAT_APPT_PVT.G_ALL) OR
176: (b_add_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE AND calendar_start_date >= b_calendar_start_date) OR
177: (b_add_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE AND calendar_start_date = b_calendar_start_date));
178:
179: l_task_exclusion_id NUMBER;
180:
173: FROM jtf_tasks_b
174: WHERE recurrence_rule_id = b_recurrence_rule_id
175: AND ((b_add_option = JTF_TASK_REPEAT_APPT_PVT.G_ALL) OR
176: (b_add_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE AND calendar_start_date >= b_calendar_start_date) OR
177: (b_add_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE AND calendar_start_date = b_calendar_start_date));
178:
179: l_task_exclusion_id NUMBER;
180:
181: CURSOR c_recur (b_recurrence_rule_id NUMBER) IS
224: -----------------------------------
225: -- Check if this is the last one
226: -----------------------------------
227: IF (l_first AND NOT l_exist_new_first_task) OR
228: (l_first AND l_add_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE)
229: THEN
230: -- This repeating rule has only one appointment currently OR
231: -- A user selected the first task one and
232: -- chose the option "Add this new invitee into all the future appointments"
229: THEN
230: -- This repeating rule has only one appointment currently OR
231: -- A user selected the first task one and
232: -- chose the option "Add this new invitee into all the future appointments"
233: l_add_option := JTF_TASK_REPEAT_APPT_PVT.G_ALL;
234: END IF;
235:
236: IF l_add_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE
237: THEN
232: -- chose the option "Add this new invitee into all the future appointments"
233: l_add_option := JTF_TASK_REPEAT_APPT_PVT.G_ALL;
234: END IF;
235:
236: IF l_add_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE
237: THEN
238: -----------------------------------------------------------------
239: -- Create a new repeating rule (use recurrence table handler)
240: -----------------------------------------------------------------
303: FOR rec_tasks IN c_tasks (b_recurrence_rule_id => p_add_assignee_rec.recurrence_rule_id
304: ,b_calendar_start_date=> p_add_assignee_rec.calendar_start_date
305: ,b_add_option => l_add_option)
306: LOOP
307: IF l_add_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE AND
308: l_first AND
309: l_exist_new_first_task
310: THEN
311: ---------------------------------------------------
323: );
324: END IF;
325: END IF;
326:
327: IF l_add_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE OR
328: l_add_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE
329: THEN
330: --------------------------------------------
331: -- Insert this appt into exclusion table
324: END IF;
325: END IF;
326:
327: IF l_add_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE OR
328: l_add_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE
329: THEN
330: --------------------------------------------
331: -- Insert this appt into exclusion table
332: --------------------------------------------
342: );
343:
344: --------------------------------------------------------
345: -- l_new_recurrence_rule_id has the following value
346: -- 1) NULL if option = JTF_TASK_REPEAT_APPT_PVT.G_ONE
347: -- 2) new recurrence rule id if option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE
348: --------------------------------------------------------
349: UPDATE jtf_tasks_b
350: SET recurrence_rule_id = l_new_recurrence_rule_id
343:
344: --------------------------------------------------------
345: -- l_new_recurrence_rule_id has the following value
346: -- 1) NULL if option = JTF_TASK_REPEAT_APPT_PVT.G_ONE
347: -- 2) new recurrence rule id if option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE
348: --------------------------------------------------------
349: UPDATE jtf_tasks_b
350: SET recurrence_rule_id = l_new_recurrence_rule_id
351: , object_changed_date = SYSDATE
423: , jtb.calendar_start_date
424: FROM jtf_task_all_assignments jtaa
425: , jtf_tasks_b jtb
426: WHERE jtb.recurrence_rule_id = b_recurrence_rule_id
427: AND ((b_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_ALL) OR
428: (b_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE AND jtb.calendar_start_date = b_calendar_start_date) OR
429: (b_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE AND jtb.calendar_start_date >= b_calendar_start_date))
430: AND jtaa.task_id = jtb.task_id
431: AND jtaa.resource_id = b_resource_id;
424: FROM jtf_task_all_assignments jtaa
425: , jtf_tasks_b jtb
426: WHERE jtb.recurrence_rule_id = b_recurrence_rule_id
427: AND ((b_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_ALL) OR
428: (b_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE AND jtb.calendar_start_date = b_calendar_start_date) OR
429: (b_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE AND jtb.calendar_start_date >= b_calendar_start_date))
430: AND jtaa.task_id = jtb.task_id
431: AND jtaa.resource_id = b_resource_id;
432:
425: , jtf_tasks_b jtb
426: WHERE jtb.recurrence_rule_id = b_recurrence_rule_id
427: AND ((b_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_ALL) OR
428: (b_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE AND jtb.calendar_start_date = b_calendar_start_date) OR
429: (b_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE AND jtb.calendar_start_date >= b_calendar_start_date))
430: AND jtaa.task_id = jtb.task_id
431: AND jtaa.resource_id = b_resource_id;
432:
433: l_task_exclusion_id NUMBER;
481: -----------------------------------
482: -- Check if this is the last one
483: -----------------------------------
484: IF (l_first AND NOT l_exist_new_first_task) OR
485: (l_first AND l_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE)
486: THEN
487: -- This repeating rule has only one appointment currently OR
488: -- A user selected the first task one and
489: -- chose the option "Delete this invitee from all the future appointments"
486: THEN
487: -- This repeating rule has only one appointment currently OR
488: -- A user selected the first task one and
489: -- chose the option "Delete this invitee from all the future appointments"
490: l_delete_option := JTF_TASK_REPEAT_APPT_PVT.G_ALL;
491: END IF;
492:
493: IF l_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE
494: THEN
489: -- chose the option "Delete this invitee from all the future appointments"
490: l_delete_option := JTF_TASK_REPEAT_APPT_PVT.G_ALL;
491: END IF;
492:
493: IF l_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE
494: THEN
495: -----------------------------------------------------------------
496: -- Create a new repeating rule (use recurrence table handler)
497: -----------------------------------------------------------------
561: ,b_calendar_start_date => p_delete_assignee_rec.calendar_start_date
562: ,b_resource_id => p_delete_assignee_rec.resource_id
563: ,b_delete_option => l_delete_option)
564: LOOP
565: IF l_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE AND
566: l_first AND
567: l_exist_new_first_task
568: THEN
569: ---------------------------------------------------
581: );
582: END IF;
583: END IF;
584:
585: IF l_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE OR
586: l_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE
587: THEN
588: --------------------------------------------
589: -- Insert this appt into exclusion table
582: END IF;
583: END IF;
584:
585: IF l_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE OR
586: l_delete_option = JTF_TASK_REPEAT_APPT_PVT.G_ONE
587: THEN
588: --------------------------------------------
589: -- Insert this appt into exclusion table
590: --------------------------------------------
600: );
601:
602: --------------------------------------------------------
603: -- l_new_recurrence_rule_id has the following value
604: -- 1) NULL if option = JTF_TASK_REPEAT_APPT_PVT.G_ONE
605: -- 2) new recurrence rule id if option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE
606: --------------------------------------------------------
607: UPDATE jtf_tasks_b
608: SET recurrence_rule_id = l_new_recurrence_rule_id
601:
602: --------------------------------------------------------
603: -- l_new_recurrence_rule_id has the following value
604: -- 1) NULL if option = JTF_TASK_REPEAT_APPT_PVT.G_ONE
605: -- 2) new recurrence rule id if option = JTF_TASK_REPEAT_APPT_PVT.G_FUTURE
606: --------------------------------------------------------
607: UPDATE jtf_tasks_b
608: SET recurrence_rule_id = l_new_recurrence_rule_id
609: , object_changed_date = SYSDATE