DBA Data[Home] [Help]

APPS.CAC_SYNC_TASK_COMMON SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 19

| 01-FEB-2005   rhshriva     Changed update_existing_data               |
| 03-FEB-2004   rhshriva     Changed create_new_data and do_mapping     |
| 26-SEP-2005   deeprao      Changed delete_task_data                   |
|			     and delete_bookings, added delete_tasks    |
*=======================================================================*/

   g_fb_type_changed  boolean := false;
Line: 40

     SELECT 1
     FROM jtf_task_recur_rules jtrr, jtf_tasks_b jtb
      WHERE ((jtrr.occurs_uom ='YER' AND
	  jtrr.occurs_every > 1)
	  OR
	  (jtrr.occurs_uom ='MON'
	  AND (DECODE(sunday,'Y',1,0) + DECODE(monday,'Y',1,0) + DECODE(tuesday,'Y',1,0)
	  + DECODE(wednesday,'Y',1,0) + DECODE(thursday,'Y',1,0) + DECODE(friday,'Y',1,0)
	  + DECODE(saturday,'Y',1,0)) > 1)) AND
      jtb.recurrence_rule_id=jtrr.recurrence_rule_id
      AND jtb.task_id=b_task_id;
Line: 192

          SELECT task_id FROM jta_task_exclusions WHERE
             task_id=b_exclude_task_id;
Line: 195

   l_update_exclusion  BOOLEAN:=FALSE;
Line: 215

         l_update_exclusion:=TRUE;
Line: 217

         l_update_exclusion:=FALSE;
Line: 224

       if ((p_exclusion_tbl(i).eventType <> g_delete) ) then
--creating exclusion


     if (l_update_exclusion)  then

          delete from jta_task_exclusions
                 where  task_id=l_exclude_task_id
              and recurrence_rule_id=p_rec_rule_id;
Line: 234

  end if;--   if (l_update_exclusion)  then
Line: 246

                 delete_exclusion_task (
                  p_repeating_task_id => l_exclude_task_id,
                  x_task_rec          => p_task_rec
              );
Line: 265

      SELECT COLLAB_ID, MEETING_MODE,MEETING_ID,MEETING_URL,JOIN_URL ,
      PLAYBACK_URL ,DOWNLOAD_URL ,CHAT_URL ,IS_STANDALONE_LOCATION,DIAL_IN
      FROM  CAC_VIEW_COLLAB_DETAILS_VL
      WHERE task_id=b_task_id;
Line: 275

    p_updation_record   jtf_task_repeat_appt_pvt.updated_field_rec;
Line: 350

        jtf_task_repeat_appt_pvt.update_repeat_appointment(
        p_api_version            =>1.0,
        p_init_msg_list           =>fnd_api.g_false,
        p_commit                  =>fnd_api.g_false,
        p_object_version_number   =>l_ovn,
        p_updated_field_rec       =>p_updation_record ,
        x_return_status           =>l_return_status,
        x_msg_count               =>l_msg_count,
        x_msg_data                =>l_msg_data
    ) ;
Line: 363

           THEN-- Failed to update a task

               cac_sync_common.put_message_to_excl_record (
                  p_exclusion_rec=>p_exclusion,
                  p_status => 2,
                  p_user_message => 'JTA_SYNC_UPDATE_TASK_FAIL'
               );
Line: 387

              cac_view_collab_details_pkg.update_row
               (x_collab_id=> l_collab_details.collab_id ,
                x_task_id=> p_updation_record.task_id,
                x_meeting_mode=>l_collab_details.meeting_mode,
                x_meeting_id=>l_collab_details.meeting_id,
                x_meeting_url=>l_collab_details.meeting_url,
                x_join_url=>l_collab_details.join_url,
                x_playback_url=>l_collab_details.playback_url,
                x_download_url=>l_collab_details.download_url,
                x_chat_url=>l_collab_details.chat_url,
                x_is_standalone_location=>l_collab_details.is_standalone_location,
                x_location=>l_location,
                x_dial_in=>p_exclusion.dial_in,
                x_last_update_date=>SYSDATE,
                x_last_updated_by=>jtf_task_utl.updated_by,
                x_last_update_login=>jtf_task_utl.login_id);
Line: 434

     SELECT task_id
       FROM jta_sync_task_mapping
      WHERE task_sync_id = p_sync_id;
Line: 473

      SELECT COUNT (recurrence_rule_id)
    INTO l_count
    FROM jta_task_exclusions
       WHERE recurrence_rule_id = p_recurrence_rule_id;
Line: 485

      SELECT COUNT (recurrence_rule_id)
    INTO l_count
    FROM jtf_tasks_b
       WHERE recurrence_rule_id = p_recurrence_rule_id;
Line: 537

         SELECT task_id
           FROM jtf_tasks_b
          WHERE recurrence_rule_id = b_recurrence_rule_id
            AND TRUNC (calendar_start_date) = TRUNC (b_exclusion_start_date);
Line: 576

      l_date_selected   VARCHAR2(1);
Line: 581

      CURSOR c_dateselect
      IS
     SELECT jt.date_selected
       FROM jtf_tasks_b jt
      WHERE jt.task_id = p_task_id;
Line: 591

     OPEN c_dateselect;
Line: 592

     FETCH c_dateselect INTO l_date_selected;
Line: 594

     IF    c_dateselect%NOTFOUND
        OR l_date_selected = 'P'
        OR p_request_type = G_REQ_APPOINTMENT
     THEN
        l_date := p_planned_start_date;
Line: 599

     ELSIF l_date_selected = 'S'
     THEN
        l_date := p_scheduled_start_date;
Line: 602

     ELSIF l_date_selected = 'A'
     THEN
        l_date := p_actual_start_date;
Line: 607

     CLOSE c_dateselect;
Line: 620

     SELECT task_id
       FROM jta_sync_task_mapping
      WHERE task_sync_id = p_sync_id;
Line: 678

     SELECT task_id
       FROM jtf_task_all_assignments
      WHERE task_assignment_id = p_task_assignment_id;
Line: 710

     SELECT timezone_id
       FROM jtf_tasks_b
      WHERE task_id = p_task_id;
Line: 750

     SELECT object_version_number
       FROM jtf_tasks_b
      WHERE task_id = b_task_id;
Line: 782

     SELECT object_version_number
       FROM jtf_task_all_assignments
      WHERE task_assignment_id = b_task_assignment_id;
Line: 816

     SELECT resource_id, 'RS_' || category
       FROM jtf_rs_resource_extns
      WHERE user_id = fnd_global.user_id;
Line: 854

               SELECT jta_sync_task_mapping_s.nextval
               INTO x_task_sync_id
               FROM dual;
Line: 859

            cac_sync_task_map_pkg.insert_row (
                p_task_sync_id => x_task_sync_id,
                p_task_id      => p_task_id,
                p_resource_id  => cac_sync_task.g_login_resource_id,
                p_principal_id => p_principal_id
            );
Line: 867

            cac_sync_task_map_pkg.update_row (
                p_task_sync_id => x_task_sync_id,
                p_task_id      => p_task_id,
                p_resource_id  => cac_sync_task.g_login_resource_id,
                p_principal_id => p_principal_id
            );
Line: 873

   /* ELSIF p_operation = G_DELETE
      THEN
        cac_sync_task_map_pkg.delete_row (
        p_task_sync_id => x_task_sync_id
     );*/
Line: 883

      p_deleted_flag         IN     VARCHAR2,
      p_task_sync_id         IN     NUMBER,
      p_source_object_type_code IN  VARCHAR2,
      p_calendar_start_date  IN     DATE,
      p_calendar_end_date    IN     DATE,
      p_assignment_status_id IN     NUMBER,
      x_operation          OUT NOCOPY VARCHAR2
   )
   IS
      l_deleted_flag        VARCHAR2(1) := NVL (p_deleted_flag, 'N');
Line: 907

          x_operation := G_DELETE;
Line: 914

      IF l_deleted_flag = 'Y' OR
         p_assignment_status_id = 4 -- Rejected
      THEN
          x_operation := G_DELETE;
Line: 918

      ELSE -- l_deleted_flag = 'N'
          x_operation  := G_MODIFY;
Line: 922

      IF l_deleted_flag = 'N' AND
         nvl(p_assignment_status_id,-1) <> 4 -- Not Rejected
      THEN
         x_operation := G_NEW;
Line: 935

     SELECT group_id resource_id
       FROM jtf_rs_group_members
      WHERE resource_id = b_resource_id
        AND delete_flag <> 'Y';
Line: 942

     SELECT team_id resource_id
       FROM jtf_rs_team_members
      WHERE team_resource_id = b_resource_id
        AND delete_flag <> 'Y';
Line: 975

     SELECT DISTINCT fgs.instance_pk1_value resource_id,
             fgs.instance_pk2_value resource_type
       FROM fnd_grants fgs,
        fnd_menus fmu,
        fnd_objects fos,
        jtf_rs_group_usages jru,
        jtf_rs_groups_tl jrt
      WHERE fgs.object_id = fos.object_id   -- grants joint to object
        AND fgs.menu_id = fmu.menu_id   -- grants joint to menus
        AND fos.obj_name = 'JTF_TASK_RESOURCE'
        AND fgs.grantee_key = b_resource_id
        AND fgs.grantee_type = 'USER'
        AND fgs.start_date < SYSDATE
        AND (  fgs.end_date >= SYSDATE
        OR fgs.end_date IS NULL)
        AND fgs.instance_pk2_value = 'RS_GROUP'
        AND jrt.group_id = TO_NUMBER (fgs.instance_pk1_value)
        AND jrt.language = USERENV ('LANG')
        AND jru.group_id = jrt.group_id
        AND jru.usage = 'GROUP_CALENDAR';
Line: 1134

      p_operation      IN       VARCHAR2, --CREATE OR UPDATE
      x_planned_start      OUT NOCOPY      DATE,
      x_planned_end    OUT NOCOPY      DATE,
      x_scheduled_start    OUT NOCOPY      DATE,
      x_scheduled_end      OUT NOCOPY      DATE,
      x_actual_start       OUT NOCOPY      DATE,
      x_actual_end     OUT NOCOPY      DATE,
      x_date_selected      OUT NOCOPY      VARCHAR2,
      x_show_on_calendar   OUT NOCOPY      VARCHAR2
   )
   IS
      l_task_id NUMBER;
Line: 1229

     SELECT MAX (tasks.calendar_start_date)
       FROM ( select b.calendar_start_date from jtf_tasks_b b
               where b.recurrence_rule_id=p_recurrence_rule_id
               union
              select b.calendar_start_date from jtf_tasks_b b,
              jta_task_exclusions jte where
              jte.recurrence_rule_id=p_recurrence_rule_id
              and jte.task_id=b.task_id) tasks;
Line: 1282

        SELECT task_priority_id
          FROM jtf_tasks_b
         WHERE task_id = p_task_id;
Line: 1342

     p_exclusion_data (i).dateSelected:=l_exclusion.date_selected;
Line: 1406

   FUNCTION already_selected(p_task_id     IN NUMBER
                            ,p_sync_id     IN NUMBER
                            ,p_task_tbl    IN cac_sync_task.task_tbl)
   RETURN BOOLEAN
   IS
       l_selected BOOLEAN := FALSE;
Line: 1421

                      l_selected := TRUE;
Line: 1428

                      l_selected := TRUE;
Line: 1437

       RETURN l_selected;
Line: 1439

   END already_selected;
Line: 1456

      p_date_selected          IN   VARCHAR2,
      p_timezone_id            IN   NUMBER,
      p_syncanchor             IN   DATE,
      p_planned_start_date     IN   DATE,
      p_planned_end_date       IN   DATE,
      p_scheduled_start_date   IN   DATE,
      p_scheduled_end_date     IN   DATE,
      p_actual_start_date      IN   DATE,
      p_actual_end_date        IN   DATE,
      p_calendar_start_date    IN   DATE,
      p_calendar_end_date      IN   DATE,
      p_alarm_on               IN   VARCHAR2,
      p_alarm_start            IN   NUMBER,
      p_recurrence_rule_id     IN   NUMBER,
      p_occurs_uom             IN   VARCHAR2,
      p_occurs_every           IN   NUMBER,
      p_occurs_number          IN   NUMBER,
      p_start_date_active      IN   DATE,
      p_end_date_active        IN   DATE,
      p_sunday                 IN   VARCHAR2,
      p_monday                 IN   VARCHAR2,
      p_tuesday                IN   VARCHAR2,
      p_wednesday              IN   VARCHAR2,
      p_thursday               IN   VARCHAR2,
      p_friday                 IN   VARCHAR2,
      p_saturday               IN   VARCHAR2,
      p_date_of_month          IN   VARCHAR2,
      p_occurs_which           IN   VARCHAR2,
      --p_get_data               IN   BOOLEAN,
      p_locations              IN   VARCHAR2,
      p_free_busy_type         IN   VARCHAR2,
      p_dial_in                IN   VARCHAR2,
      x_task_rec           IN OUT NOCOPY   cac_sync_task.task_rec
   )
   IS
      l_category_name   VARCHAR2(240); -- Fix bug 2540722
Line: 1588

      IF p_operation <> G_DELETE
      THEN
          make_prefix (
             p_assignment_status_id    => get_assignment_status_id (p_task_id, p_resource_id),
             p_source_object_type_code => x_task_rec.objectcode,
             p_resource_type           => p_owner_type_code,
             p_resource_id             => cac_sync_task.g_login_resource_id,
             p_group_id                => p_resource_id,
             x_subject                 => x_task_rec.subject
          );
Line: 1605

      x_task_rec.dateselected := NVL(p_date_selected,'S'); -- fix bug 2389092
Line: 1789

   PROCEDURE check_delete_data (
      p_task_id       IN       NUMBER,
      p_resource_id   IN       NUMBER,
      p_objectcode    IN       VARCHAR2,
      x_status_id     OUT NOCOPY      NUMBER,
      x_delete_flag   OUT NOCOPY      VARCHAR2
   )
   IS
      l_assignee_role          VARCHAR2(30);
Line: 1812

        x_delete_flag := 'U';   -- UPDATE
Line: 1815

        x_delete_flag := 'X';   -- DO NOTHING
Line: 1818

        x_delete_flag := 'D';   -- DELETE
Line: 1821

     x_delete_flag := 'D';
Line: 1823

   END check_delete_data;
Line: 1833

     SELECT task_assignment_id
       FROM jtf_task_all_assignments
      WHERE task_id = p_task_id
        AND resource_id = p_resource_id
        AND resource_type_code = p_resource_type;
Line: 1870

     SELECT assignment_status_id
       FROM jtf_task_all_assignments
      WHERE task_id = p_task_id
        AND resource_id = p_resource_id;
Line: 1907

     SELECT task_name, owner_id, owner_type_code
       FROM jtf_tasks_vl
      WHERE task_id = b_task_id;
Line: 1945

     SELECT a.assignee_role, a.assignment_status_id, r.resource_id
       FROM jtf_rs_resource_extns r, jtf_task_all_assignments a
      WHERE a.task_id = b_task_id
        AND a.resource_id = b_resource_id
        AND r.user_id = a.created_by;
Line: 2016

         SELECT DISTINCT fmu.menu_name
           FROM fnd_menus fmu, fnd_objects fos, fnd_grants fgs
          WHERE fmu.menu_id = fgs.menu_id   -- grants joint to menus
            AND fos.obj_name = 'JTF_TASK_RESOURCE'
            AND fos.object_id = fgs.object_id   -- grants joint to object
            AND fgs.grantee_key = b_resource_id
            AND fgs.grantee_type = 'USER'
            AND fgs.start_date < SYSDATE
            AND (  fgs.end_date >= SYSDATE
            OR fgs.end_date IS NULL)
            AND fgs.instance_pk2_value = 'RS_GROUP'
            AND fgs.instance_pk1_value = b_group_id;
Line: 2057

     SELECT source_object_type_code
       FROM jtf_tasks_b
      WHERE task_id = b_task_id;
Line: 2094

       SELECT asg.assignee_role
            , rs.resource_type_code
            , rs.group_calendar_flag
            , asg.assignment_status_id
            , tsk.source_object_type_code
         FROM (SELECT p_resource_id resource_id
                    , 'RS_EMPLOYEE' resource_type_code
                    , 'N' group_calendar_flag
                 FROM dual
               UNION ALL
               SELECT tm.team_id resource_id
                    , 'RS_TEAM'  resource_type_code
                    , 'N' group_calendar_flag
                 FROM jtf_rs_team_members tm
                WHERE tm.team_resource_id = p_resource_id
               UNION ALL
               SELECT gm.group_id resource_id
                    , 'RS_GROUP' resource_type_code
                    , 'N' group_calendar_flag
                 FROM jtf_rs_group_members gm
                WHERE gm.resource_id = p_resource_id
               UNION ALL
               SELECT g.group_id resource_id
                    , 'RS_GROUP' resource_type_code
                    , 'Y' group_calendar_flag
                 FROM fnd_grants fg
                    , jtf_rs_groups_b g
                WHERE fg.grantee_key = to_char(p_resource_id)
                  AND fg.grantee_type = 'USER'
                  AND fg.instance_pk2_value = 'RS_GROUP'
                  AND fg.instance_pk1_value = to_char(g.group_id)
              ) rs
            , jtf_task_all_assignments asg
            , jtf_tasks_b tsk
        WHERE asg.resource_type_code = rs.resource_type_code
          AND asg.resource_id        = rs.resource_id
          AND asg.task_id            = tsk.task_id
          AND tsk.task_id            = p_task_id
       ORDER BY rs.group_calendar_flag desc
               ,decode(rs.resource_type_code,
                       'RS_EMPLOYEE', 1,
                       'RS_GROUP',    2,
                       'RS_TEAM',     3);
Line: 2163

   FUNCTION get_update_type (p_task_id IN NUMBER,
                             p_resource_id IN NUMBER,
                             p_subject IN VARCHAR2)
   RETURN VARCHAR2
   IS
      l_synced_resource_type    VARCHAR2(30);
Line: 2174

      l_update_type             VARCHAR2(15) := G_UPDATE_ALL; -- Added for fix bug 2442686
Line: 2194

          l_update_type := g_do_nothing; -- Added for fix bug 2442686
Line: 2211

                   l_update_type := g_update_status;
Line: 2213

                   l_update_type := g_do_nothing;
Line: 2219

      RETURN l_update_type; -- Added for fix bug 2442686
Line: 2221

   END get_update_type;
Line: 2232

       SELECT
          t.timezone_id,
		  tl.description,
		  tl.task_name,
                  t.planned_start_date,
                  t.planned_end_date,
                  t.scheduled_start_date,
                  t.scheduled_end_date,
                  t.actual_start_date,
                  t.actual_end_date,
                  t.calendar_end_date,
                  NVL (t.private_flag, 'N') private_flag,
                  rc.occurs_uom,
                  rc.occurs_every,
                  greatest(rc.start_date_active, t.planned_start_date) start_date_active,
                  rc.end_date_active,
                  rc.sunday,
                  rc.monday,
                  rc.tuesday,
                  rc.wednesday,
                  rc.thursday,
                  rc.friday,
                  rc.saturday,
                  rc.date_of_month,
                  rc.occurs_which,
                  rc.recurrence_rule_id,
                  CAC_VIEW_UTIL_PUB.get_locations(t.task_id) locations,
                  ta.free_busy_type free_busy_type,
                  t.alarm_start alarm_start,
                  t.alarm_on alarm_on
             FROM jtf_task_recur_rules rc,
                  jtf_task_statuses_b ts,
                  jtf_task_priorities_b tb,
                  jtf_tasks_tl tl,
                  jtf_task_all_assignments ta,
                  jtf_tasks_b t
            WHERE
               ta.task_id = t.task_id
               and ta.assignee_role= b_role
               AND tl.task_id = t.task_id
               AND ts.task_status_id = t.task_status_id
               AND tl.language = USERENV ('LANG')
               AND rc.recurrence_rule_id (+)= t.recurrence_rule_id
               AND tb.task_priority_id (+) = t.task_priority_id
               and t.task_id=b_task_id
               and nvl(t.deleted_flag,'N')='N';
Line: 2425

     SELECT t.recurrence_rule_id
       FROM jtf_tasks_b t
      WHERE t.task_id = p_task_id;
Line: 2614

         IF NOT (l_invalid OR already_selected(p_task_id => rec_modify_nonrepeat.task_id, p_task_tbl => x_data))
         THEN
             IF p_get_data
             THEN
                 add_task (
                    p_request_type         => p_request_type,
                    p_resource_id          => p_resource_id,
                    p_principal_id         => p_principal_id,
                    p_resource_type        => p_resource_type,
                    p_recordindex          => i+1,
                    p_operation            => g_modify,
                    p_task_sync_id         => rec_modify_nonrepeat.task_sync_id,
                    p_task_id              => rec_modify_nonrepeat.task_id,
                    p_task_name            => rec_modify_nonrepeat.task_name,
                    p_owner_type_code      => rec_modify_nonrepeat.owner_type_code,
                    p_description          => rec_modify_nonrepeat.description,
                    p_task_status_id       => rec_modify_nonrepeat.task_status_id,
                    p_task_priority_id     => rec_modify_nonrepeat.importance_level ,
                    p_private_flag         => rec_modify_nonrepeat.private_flag,
                    p_date_selected        => rec_modify_nonrepeat.date_selected,
                    p_timezone_id          => rec_modify_nonrepeat.timezone_id,
                    p_syncanchor           => rec_modify_nonrepeat.new_timestamp,
                    p_planned_start_date   => rec_modify_nonrepeat.planned_start_date,
                    p_planned_end_date     => rec_modify_nonrepeat.planned_end_date,
                    p_scheduled_start_date => rec_modify_nonrepeat.scheduled_start_date,
                    p_scheduled_end_date   => rec_modify_nonrepeat.scheduled_end_date,
                    p_actual_start_date    => rec_modify_nonrepeat.actual_start_date,
                    p_actual_end_date      => rec_modify_nonrepeat.actual_end_date,
                    p_calendar_start_date  => rec_modify_nonrepeat.calendar_start_date,
                    p_calendar_end_date    => rec_modify_nonrepeat.calendar_end_date,
                    p_alarm_on             => rec_modify_nonrepeat.alarm_on,
                    p_alarm_start          => rec_modify_nonrepeat.alarm_start,
                    p_recurrence_rule_id   => rec_modify_nonrepeat.recurrence_rule_id,
                    p_occurs_uom           => NULL,
                    p_occurs_every         => NULL,
                    p_occurs_number        => NULL,
                    p_start_date_active    => NULL,
                    p_end_date_active      => NULL,
                    p_sunday               => NULL,
                    p_monday               => NULL,
                    p_tuesday              => NULL,
                    p_wednesday            => NULL,
                    p_thursday             => NULL,
                    p_friday               => NULL,
                    p_saturday             => NULL,
                    p_date_of_month        => NULL,
                    p_occurs_which         => NULL,
                    p_locations            => rec_modify_nonrepeat.locations,
                    p_free_busy_type       => rec_modify_nonrepeat.free_busy_type,
                    p_dial_in              => get_dial_in_value(rec_modify_nonrepeat.task_id),
                    x_task_rec             => x_task_rec
                 );
Line: 2669

             ELSE -- For get_count, store the task_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 2705

         IF NOT (l_invalid OR already_selected(p_task_id => rec_new_nonrepeat.task_id, p_task_tbl => x_data))
         THEN
             IF p_get_data
             THEN
                 add_task (
                    p_request_type   => p_request_type,
                    p_resource_id    => p_resource_id,
                    p_principal_id   => p_principal_id,
                    p_resource_type  => p_resource_type,
                    p_recordindex    => i + 1,
                    p_operation      => g_new,
                    p_task_sync_id   => NULL,
                    p_task_id        => rec_new_nonrepeat.task_id,
                    p_task_name      => rec_new_nonrepeat.task_name,
                    p_owner_type_code => rec_new_nonrepeat.owner_type_code,
                    p_description => rec_new_nonrepeat.description,
                    p_task_status_id => rec_new_nonrepeat.task_status_id,
                    p_task_priority_id => rec_new_nonrepeat.importance_level ,
                    p_private_flag => rec_new_nonrepeat.private_flag,
                    p_date_selected => rec_new_nonrepeat.date_selected,
                    p_timezone_id => rec_new_nonrepeat.timezone_id,
                    p_syncanchor => rec_new_nonrepeat.new_timestamp,
                    p_planned_start_date => rec_new_nonrepeat.planned_start_date,
                    p_planned_end_date => rec_new_nonrepeat.planned_end_date,
                    p_scheduled_start_date => rec_new_nonrepeat.scheduled_start_date,
                    p_scheduled_end_date => rec_new_nonrepeat.scheduled_end_date,
                    p_actual_start_date => rec_new_nonrepeat.actual_start_date,
                    p_actual_end_date => rec_new_nonrepeat.actual_end_date,
                    p_calendar_start_date => rec_new_nonrepeat.calendar_start_date,
                    p_calendar_end_date => rec_new_nonrepeat.calendar_end_date,
                    p_alarm_on => rec_new_nonrepeat.alarm_on,
                    p_alarm_start => rec_new_nonrepeat.alarm_start,
                    p_recurrence_rule_id => rec_new_nonrepeat.recurrence_rule_id,
                    p_occurs_uom => NULL,
                    p_occurs_every => NULL,
                    p_occurs_number => NULL,
                    p_start_date_active => NULL,
                    p_end_date_active => NULL,
                    p_sunday => NULL,
                    p_monday => NULL,
                    p_tuesday => NULL,
                    p_wednesday => NULL,
                    p_thursday => NULL,
                    p_friday => NULL,
                    p_saturday => NULL,
                    p_date_of_month => NULL,
                    p_occurs_which => NULL,
                    --p_get_data => p_get_data,
                    p_locations    => rec_new_nonrepeat.locations,
                    p_free_busy_type=>rec_new_nonrepeat.free_busy_type,
                    p_dial_in=>get_dial_in_value(rec_new_nonrepeat.task_id),
                    x_task_rec => x_task_rec
                 );
Line: 2761

             ELSE -- For get_count, store the task_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 2772

   PROCEDURE get_all_deleted_tasks (
      p_request_type         IN       VARCHAR2,
      p_syncanchor           IN       DATE,
      p_recordindex          IN       NUMBER,
      p_resource_id          IN       NUMBER,
      p_principal_id         IN       NUMBER,
      p_resource_type        IN       VARCHAR2,
      p_source_object_type   IN       VARCHAR2,
      p_get_data             IN       BOOLEAN,
      x_totaldeleted         IN OUT NOCOPY   NUMBER,
      x_data                 IN OUT NOCOPY   cac_sync_task.task_tbl
   )
   IS
      i   INTEGER := nvl(x_data.last,0);
Line: 2787

      FOR rec_delete IN cac_sync_task_cursors.c_delete_task (
                            p_syncanchor,
                            p_resource_id,
                            p_principal_id,
                            p_resource_type,
                            p_source_object_type
                      )
      LOOP
         IF NOT already_selected(p_sync_id => rec_delete.task_sync_id, p_task_tbl => x_data)
         THEN
             IF p_get_data
             THEN
                 i := i + 1;
Line: 2800

                 x_data(i).syncid     := rec_delete.task_sync_id;
Line: 2802

                 x_data(i).eventtype  := g_delete;
Line: 2805

                 cac_sync_task_map_pkg.delete_row (
                    p_task_sync_id => rec_delete.task_sync_id
                 );
Line: 2810

             ELSE -- For get_count, store the sync_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 2812

                 x_data (i).syncid := rec_delete.task_sync_id;
Line: 2815

             x_totaldeleted := x_totaldeleted + 1;
Line: 2819

      FOR rec_delete IN cac_sync_task_cursors.c_delete_assignee_reject (
                            p_syncanchor,
                            p_resource_id,
                            p_principal_id,
                            p_resource_type,
                            p_source_object_type
                      )
      LOOP
          IF NOT already_selected(p_sync_id => rec_delete.task_sync_id, p_task_tbl => x_data)
          THEN
             IF p_get_data
             THEN
                 i := i + 1;
Line: 2832

                 x_data(i).syncid     := rec_delete.task_sync_id;
Line: 2834

                 x_data(i).eventtype  := g_delete;
Line: 2837

		 /* Commented this for bug#5191856 bcos for deleted appointments, records are not deleted
		     from jtf_task_all_assignments table and the user has the option of Accepting the declined
		     Appointment. */
                 /*cac_sync_task_map_pkg.delete_row (
                    p_task_sync_id => rec_delete.task_sync_id
                 );*/
Line: 2845

             ELSE -- For get_count, store the sync_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 2847

                 x_data (i).syncid := rec_delete.task_sync_id;
Line: 2850

             x_totaldeleted := x_totaldeleted + 1;
Line: 2854

      FOR rec_delete IN cac_sync_task_cursors.c_delete_assignment (
                         p_syncanchor,
                         p_resource_id,
                         p_resource_type,
                         p_principal_id,
                         p_source_object_type
                      )
      LOOP
          IF NOT already_selected(p_sync_id => rec_delete.task_sync_id, p_task_tbl => x_data)
          THEN
             IF p_get_data
             THEN
                 i := i + 1;
Line: 2867

                 x_data(i).eventtype  := g_delete;
Line: 2868

                 x_data(i).syncid     := rec_delete.task_sync_id;
Line: 2872

                 cac_sync_task_map_pkg.delete_row (
                    p_task_sync_id => rec_delete.task_sync_id
                 );
Line: 2877

             ELSE -- For get_count, store the sync_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 2879

                 x_data (i).syncid := rec_delete.task_sync_id;
Line: 2882

             x_totaldeleted := x_totaldeleted + 1;
Line: 2886

      FOR rec_delete IN cac_sync_task_cursors.c_delete_rejected_tasks (
                         p_syncanchor,
                         p_resource_id,
                         p_resource_type,
                         p_principal_id,
                         p_source_object_type
                       )
      LOOP
          IF NOT already_selected(p_sync_id => rec_delete.task_sync_id, p_task_tbl => x_data)
          THEN
             IF p_get_data
             THEN
                 i := i + 1;
Line: 2899

                 x_data (i).syncid     := rec_delete.task_sync_id;
Line: 2901

                 x_data (i).eventtype  := g_delete;
Line: 2904

                 cac_sync_task_map_pkg.delete_row (
                     p_task_sync_id => rec_delete.task_sync_id
                 );
Line: 2909

             ELSE -- For get_count, store the sync_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 2911

                 x_data (i).syncid := rec_delete.task_sync_id;
Line: 2914

             x_totaldeleted := x_totaldeleted + 1;
Line: 2918

      FOR rec_delete IN cac_sync_task_cursors.c_delete_unsubscribed(
                         p_resource_id,
                         p_resource_type,
                         p_principal_id,
                         p_source_object_type
                       )
      LOOP
          IF NOT already_selected(p_sync_id => rec_delete.task_sync_id, p_task_tbl => x_data)
          THEN
             IF p_get_data
             THEN
                 i := i + 1;
Line: 2930

                 x_data (i).syncid     := rec_delete.task_sync_id;
Line: 2932

                 x_data (i).eventtype  := g_delete;
Line: 2935

                 cac_sync_task_map_pkg.delete_row (
                     p_task_sync_id => rec_delete.task_sync_id
                 );
Line: 2941

             ELSE -- For get_count, store the sync_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 2943

                 x_data (i).syncid := rec_delete.task_sync_id;
Line: 2946

             x_totaldeleted := x_totaldeleted + 1;
Line: 2949

   END get_all_deleted_tasks;
Line: 3004

                 x_data(i).eventtype  := g_delete;
Line: 3007

                 cac_sync_task_map_pkg.delete_row (
                    p_task_sync_id => rec_modify_repeat.task_sync_id
                 );
Line: 3012

             ELSE -- For get_count, store the sync_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 3022

         IF NOT (l_invalid OR already_selected(p_task_id => rec_modify_repeat.task_id, p_task_tbl => x_data))
         THEN


             IF p_get_data
             THEN

                 add_task (
                    p_request_type => p_request_type,
                    p_resource_id => p_resource_id,
                    p_principal_id => p_principal_id,
                    p_resource_type => p_resource_type,
                    p_recordindex => i + 1,
                    p_operation => g_modify,
                    p_task_sync_id => rec_modify_repeat.task_sync_id,
                    p_task_id => rec_modify_repeat.task_id,
                    p_task_name => rec_modify_repeat.task_name,
                    p_owner_type_code => rec_modify_repeat.owner_type_code,
                    p_description => rec_modify_repeat.description,
                    p_task_status_id => rec_modify_repeat.task_status_id,
                    p_task_priority_id => null  ,
                    p_private_flag => rec_modify_repeat.private_flag,
                    p_date_selected => rec_modify_repeat.date_selected,
                    p_timezone_id => rec_modify_repeat.timezone_id,
                    p_syncanchor => rec_modify_repeat.new_timestamp,
                    p_planned_start_date => rec_modify_repeat.planned_start_date,
                    p_planned_end_date => rec_modify_repeat.planned_end_date,
                    p_scheduled_start_date => rec_modify_repeat.scheduled_start_date,
                    p_scheduled_end_date => rec_modify_repeat.scheduled_end_date,
                    p_actual_start_date => rec_modify_repeat.actual_start_date,
                    p_actual_end_date => rec_modify_repeat.actual_end_date,
                    p_calendar_start_date => rec_modify_repeat.calendar_start_date,
                    p_calendar_end_date => rec_modify_repeat.calendar_end_date,
                    p_alarm_on => rec_modify_repeat.alarm_on,
                    p_alarm_start => rec_modify_repeat.alarm_start,
                    p_recurrence_rule_id => rec_modify_repeat.recurrence_rule_id,
                    p_occurs_uom => rec_modify_repeat.occurs_uom,
                    p_occurs_every => rec_modify_repeat.occurs_every,
                    p_occurs_number => rec_modify_repeat.occurs_number,
                    p_start_date_active => rec_modify_repeat.start_date_active,
                    p_end_date_active => rec_modify_repeat.end_date_active,
                    p_sunday => rec_modify_repeat.sunday,
                    p_monday => rec_modify_repeat.monday,
                    p_tuesday => rec_modify_repeat.tuesday,
                    p_wednesday => rec_modify_repeat.wednesday,
                    p_thursday => rec_modify_repeat.thursday,
                    p_friday => rec_modify_repeat.friday,
                    p_saturday => rec_modify_repeat.saturday,
                    p_date_of_month => rec_modify_repeat.date_of_month,
                    p_occurs_which => rec_modify_repeat.occurs_which,
                    p_locations    => rec_modify_repeat.locations,
                    p_free_busy_type=>rec_modify_repeat.free_busy_type,
                    p_dial_in =>get_dial_in_value(rec_modify_repeat.task_id),
                    x_task_rec => x_task_rec

                    --p_get_data => p_get_data
                 );
Line: 3093

          ELSE -- For get_count, store the sync_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 3123

         IF NOT (l_invalid OR already_selected(p_task_id => rec_new_repeat.task_id, p_task_tbl => x_data))
         THEN

             IF p_get_data
             THEN

                 add_task (
                    p_request_type => p_request_type,
                    p_resource_id => p_resource_id,
                    p_principal_id => p_principal_id,
                    p_resource_type => p_resource_type,
                    p_recordindex => i + 1,
                    p_operation => g_new,
                    p_task_sync_id => null  ,
                    p_task_id => rec_new_repeat.task_id,
                    p_task_name => rec_new_repeat.task_name,
                    p_owner_type_code => rec_new_repeat.owner_type_code,
                    p_description => rec_new_repeat.description,
                    p_task_status_id => rec_new_repeat.task_status_id,
                    p_task_priority_id => rec_new_repeat.importance_level,
                    p_private_flag => rec_new_repeat.private_flag,
                    p_date_selected => rec_new_repeat.date_selected,
                    p_timezone_id => rec_new_repeat.timezone_id,
                    p_syncanchor => rec_new_repeat.new_timestamp,
                    p_planned_start_date => rec_new_repeat.planned_start_date,
                    p_planned_end_date => rec_new_repeat.planned_end_date,
                    p_scheduled_start_date => rec_new_repeat.scheduled_start_date,
                    p_scheduled_end_date => rec_new_repeat.scheduled_end_date,
                    p_actual_start_date => rec_new_repeat.actual_start_date,
                    p_actual_end_date => rec_new_repeat.actual_end_date,
                    p_calendar_start_date => rec_new_repeat.calendar_start_date,
                    p_calendar_end_date => rec_new_repeat.calendar_end_date,
                    p_alarm_on => rec_new_repeat.alarm_on,
                    p_alarm_start => rec_new_repeat.alarm_start,
                    p_recurrence_rule_id => rec_new_repeat.recurrence_rule_id,
                    p_occurs_uom => rec_new_repeat.occurs_uom,
                    p_occurs_every => rec_new_repeat.occurs_every,
                    p_occurs_number => rec_new_repeat.occurs_number,
                    p_start_date_active => rec_new_repeat.start_date_active,
                    p_end_date_active => rec_new_repeat.end_date_active,
                    p_sunday => rec_new_repeat.sunday,
                    p_monday => rec_new_repeat.monday,
                    p_tuesday => rec_new_repeat.tuesday,
                    p_wednesday => rec_new_repeat.wednesday,
                    p_thursday => rec_new_repeat.thursday,
                    p_friday => rec_new_repeat.friday,
                    p_saturday => rec_new_repeat.saturday,
                    p_date_of_month => rec_new_repeat.date_of_month,
                    p_occurs_which => rec_new_repeat.occurs_which,
                    --p_get_data => p_get_data,
                    p_locations    => rec_new_repeat.locations,
                    p_free_busy_type=>rec_new_repeat.free_busy_type,
                    p_dial_in => get_dial_in_value(rec_new_repeat.task_id),
                    x_task_rec => x_task_rec
                 );
Line: 3192

            ELSE -- For get_count, store the sync_id selected so as to avoid the duplicate
                 i := i + 1;
Line: 3212

  	SELECT cac_view_collab_details_s.nextval INTO l_key FROM DUAL;
Line: 3231

      l_date_selected       VARCHAR2(100);
Line: 3244

      l_update_type         VARCHAR2(15);
Line: 3275

       select b.object_version_number,b.task_id from jtf_tasks_b b,jtf_tasks_tl t
         where b.entity in ('BOOKING','APPOINTMENT')
         and b.source_object_type_code='EXTERNAL APPOINTMENT'
         and t.task_id=b.task_id
         and t.language=userenv('LANG')
         and nvl(b.deleted_flag,'N')='N'
         and t.task_name=b_task_name
         and b.calendar_start_date =b_cal_start_date
         and b.calendar_end_date=b_cal_end_date
         and b.owner_type_code=b_owner_type_code
         and b.owner_id=b_owner_id;
Line: 3291

          select 1 from jta_sync_task_mapping where
           principal_id=b_principal_id
           and task_id=b_task_id
           and resource_id=b_resource_id;
Line: 3297

      SELECT COLLAB_ID, MEETING_MODE,MEETING_ID,MEETING_URL,JOIN_URL ,
         PLAYBACK_URL ,DOWNLOAD_URL ,CHAT_URL ,IS_STANDALONE_LOCATION,DIAL_IN
        FROM  CAC_VIEW_COLLAB_DETAILS_VL
        WHERE task_id=b_task_id;
Line: 3327

         x_date_selected => l_date_selected,
         x_show_on_calendar => l_show_on_calendar
      );
Line: 3372

         cac_view_collab_details_pkg.insert_row (
                  x_rowid => l_rowid,
                  x_collab_id => get_collab_id,
                  x_task_id => l_task_id,
                  x_meeting_mode => 'LIVE',
                  x_meeting_id => null,
                  x_meeting_url => null,
                  x_join_url => null,
                  x_playback_url => null,
                  x_download_url => null,
                  x_chat_url => null,
                  x_is_standalone_location => 'Y',
                  x_location => l_location,-- previous it was p_task_rec.locations,
                  x_dial_in => p_task_rec.dial_in,
                  x_creation_date => SYSDATE,
                  x_created_by => jtf_task_utl.created_by,
                  x_last_update_date => SYSDATE,
                  x_last_updated_by => jtf_task_utl.updated_by,
                  x_last_update_login => jtf_task_utl.login_id
        );
Line: 3414

              p_timezone_id => G_SERVER_TIMEZONE_ID,--changed from g_client_timezone_id, as everything should be inserted in server timezone
              p_date_selected => NULL, -- Fix Bug 2467021: For creation, pass NULL
              p_alarm_start => l_alarm_mins,
              p_alarm_start_uom => 'MIN',
              p_alarm_interval_uom => 'MIN',
              p_alarm_on => p_task_rec.alarmflag,
              p_private_flag => p_task_rec.privateFlag,
              p_category_id => l_category_id,
              x_return_status => l_return_status,
              x_msg_count => l_msg_count,
              x_msg_data => l_msg_data,
              x_task_id => l_task_id
        );
Line: 3447

        cac_view_appt_pvt.update_external_appointment (
              p_object_version_number   =>l_object_version_number,
              p_task_id                 =>l_task_id,
              p_task_name               => l_subject,
              p_task_type_id            => get_default_task_type,
              p_description             => p_task_rec.description,
              p_task_priority_id        => p_task_rec.priorityid,
              p_planned_start_date      => l_planned_start,
              p_planned_end_date        => l_planned_end,
              p_timezone_id             => G_SERVER_TIMEZONE_ID,  --changed from g_client_timezone_id as all the value must be stored at server timezone
              p_private_flag            => p_task_rec.privateFlag,
              p_alarm_start             => l_alarm_mins,
              p_alarm_on                => p_task_rec.alarmflag,
              p_category_id             => l_category_id,
	          p_free_busy_type          => p_task_rec.free_busy_type,
	          p_change_mode             => jtf_task_repeat_appt_pvt.g_all,
              x_return_status           => l_return_status
        );
Line: 3476

              cac_view_collab_details_pkg.update_row
               (x_collab_id=> l_collab_details.collab_id ,
                x_task_id=> l_task_id,
                x_meeting_mode=>l_collab_details.meeting_mode,
                x_meeting_id=>l_collab_details.meeting_id,
                x_meeting_url=>l_collab_details.meeting_url,
                x_join_url=>l_collab_details.join_url,
                x_playback_url=>l_collab_details.playback_url,
                x_download_url=>l_collab_details.download_url,
                x_chat_url=>l_collab_details.chat_url,
                x_is_standalone_location=>l_collab_details.is_standalone_location,
                x_location=>l_location,
                x_dial_in=>p_task_rec.dial_in,
                x_last_update_date=>SYSDATE,
                x_last_updated_by=>jtf_task_utl.updated_by,
                x_last_update_login=>jtf_task_utl.login_id);
Line: 3501

	   --checking if the update status is false and if yes, write to message stack.

           if (cac_sync_common.is_success (l_return_status)=false) then

               cac_sync_common.put_messages_to_result (
                  p_task_rec,
                  p_status => 2,
                  p_user_message => 'JTA_SYNC_UPDATE_TASK_FAIL'
                  );
Line: 3535

         cac_view_collab_details_pkg.insert_row (
                  x_rowid => l_rowid,
                  x_collab_id => get_collab_id,
                  x_task_id => l_task_id,
                  x_meeting_mode => 'LIVE',
                  x_meeting_id => NULL,
                  x_meeting_url => NULL,
                  x_join_url => NULL,
                  x_playback_url => NULL,
                  x_download_url => NULL,
                  x_chat_url => NULL,
                  x_is_standalone_location => 'Y',
                  x_location => l_location,-- previous it was p_task_rec.locations,
                  x_dial_in => p_task_rec.dial_in,
                  x_creation_date => SYSDATE,
                  x_created_by => jtf_task_utl.created_by,
                  x_last_update_date => SYSDATE,
                  x_last_updated_by => jtf_task_utl.updated_by,
                  x_last_update_login => jtf_task_utl.login_id
        );
Line: 3739

      /*insert_or_update_mapping (
     p_task_sync_id => p_task_rec.syncid,
     p_task_id => l_task_id,
     p_resource_id => p_resource_id,
     p_mapping_type => p_mapping_type
      );
Line: 3779

       SELECT     tl.task_name,t.task_id,
                  tl.description,
                  t.date_selected,
                  t.planned_start_date,
                  t.planned_end_date,
                  t.scheduled_start_date,
                  t.scheduled_end_date,
                  t.actual_start_date,
                  t.actual_end_date,
                  t.calendar_start_date,
                  t.calendar_end_date,
                  t.task_status_id,
                  tb.importance_level importance_level,
                  NVL (t.alarm_on, 'N') alarm_on,
                  t.alarm_start,
                  UPPER (t.alarm_start_uom) alarm_start_uom,
                  NVL (t.private_flag, 'N') private_flag,
                  t.timezone_id timezone_id,
                  t.owner_type_code,
                  t.source_object_type_code,
                  rc.recurrence_rule_id,
                  rc.occurs_uom,
                  rc.occurs_every,
                  rc.occurs_number,
                  greatest(rc.start_date_active, t.planned_start_date) start_date_active,
                  rc.end_date_active,
                  rc.sunday,
                  rc.monday,
                  rc.tuesday,
                  rc.wednesday,
                  rc.thursday,
                  rc.friday,
                  rc.saturday,
                  rc.date_of_month,
                  rc.occurs_which,
                  greatest(t.object_changed_date, ta.last_update_date) new_timestamp,
                  CAC_VIEW_UTIL_PUB.get_locations(t.task_id) locations,
                  ta.free_busy_type free_busy_type
             FROM jtf_task_recur_rules rc,
                  jtf_task_statuses_b ts,
                  jtf_task_priorities_b tb,
                  jtf_tasks_tl tl,
                  jtf_task_all_assignments ta,
                  jtf_tasks_b t
            WHERE

               ta.task_id = t.task_id
               and ta.assignee_role= b_role
               AND tl.task_id = t.task_id
               AND ts.task_status_id = t.task_status_id
               AND tl.language = USERENV ('LANG')
               AND rc.recurrence_rule_id (+)= t.recurrence_rule_id
               AND tb.task_priority_id (+) = t.task_priority_id
               and t.task_id=b_task_id
               and nvl(t.deleted_flag,'N')='N';
Line: 4005

  PROCEDURE update_existing_data (
      p_task_rec        IN OUT NOCOPY   cac_sync_task.task_rec,
      p_exclusion_tbl   IN OUT NOCOPY      cac_sync_task.exclusion_tbl,
      p_resource_id     IN       NUMBER,
      p_resource_type   IN       VARCHAR2
   )
   IS
      l_ovn                 NUMBER;
Line: 4020

      l_date_selected       VARCHAR2(100);
Line: 4024

      l_update_type         VARCHAR2(15);
Line: 4034

      l_update_all          VARCHAR2(5);
Line: 4058

         SELECT task_id,
                planned_start_date,
                planned_end_date,
                scheduled_start_date,
                scheduled_end_date,
                actual_start_date,
                actual_end_date,
                calendar_start_date,
                timezone_id
           FROM jtf_tasks_b
          WHERE recurrence_rule_id = b_recurrence_rule_id;
Line: 4076

     select CAC.COLLAB_ID, CAC.MEETING_MODE,CAC.MEETING_ID,CAC.MEETING_URL,
      CAC.JOIN_URL ,CAC.PLAYBACK_URL ,CAC.DOWNLOAD_URL ,CAC.CHAT_URL ,
       CAC.IS_STANDALONE_LOCATION,CAC.DIAL_IN, jtb1.task_id
        from cac_view_collab_details_vl cac, jtf_tasks_b jtb1,jtf_tasks_b jtb2
         where cac.task_id=jtb1.task_id
          and jtb1.recurrence_rule_id=jtb2.recurrence_rule_id
           and jtb2.task_id=b_task_id;
Line: 4088

      select COLLAB_ID, MEETING_MODE,MEETING_ID,MEETING_URL,JOIN_URL ,
         PLAYBACK_URL ,DOWNLOAD_URL ,CHAT_URL ,IS_STANDALONE_LOCATION,DIAL_IN
        from  CAC_VIEW_COLLAB_DETAILS_VL
        where task_id=b_task_id;
Line: 4116

           p_operation        => 'UPDATE',
           x_planned_start    => l_planned_start_date,
           x_planned_end      => l_planned_end_date,
           x_scheduled_start  => l_scheduled_start_date,
           x_scheduled_end    => l_scheduled_end_date,
           x_actual_start     => l_actual_start_date,
           x_actual_end       => l_actual_end_date,
           x_date_selected    => l_date_selected,
           x_show_on_calendar => l_show_on_calendar
       );
Line: 4144

       l_update_type := get_update_type (
                            p_task_id => l_task_id,
                            p_resource_id => p_resource_id,
                            p_subject => p_task_rec.subject
                       );
Line: 4188

          IF l_update_type = g_update_all
          THEN
             IF p_exclusion_tbl.COUNT > 0
             THEN
                 process_exclusions (
                           p_exclusion_tbl => p_exclusion_tbl,
                           p_rec_rule_id => l_rec_rule_id,
                           p_repeating_task_id => l_task_id,
                           p_task_rec => p_task_rec
                 );
Line: 4202

                    l_update_type = cac_sync_task_common.g_update_all
                 THEN -- Changed Repeating Rule


                    -- include open end dates also

            l_G_TASK_TIMEZONE_ID:=get_task_timezone_id(l_task_id);
Line: 4253

              jtf_task_recurrences_pvt.update_task_recurrence (
                           p_api_version        =>   1.0,
                           p_task_id            =>   l_task_id,
                           p_recurrence_rule_id =>   l_rec_rule_id,
                           p_occurs_which       =>   l_occurs_which,
                           p_date_of_month      =>   l_date_of_month,
                           p_occurs_month       =>   l_occurs_month,
                           p_occurs_uom         =>   p_task_rec.unit_of_measure,
                           p_occurs_every       =>   p_task_rec.occurs_every,
                           p_occurs_number      =>   l_occurs_number,
                           p_start_date_active  =>   l_repeat_start_date,
                           p_end_date_active    =>   l_repeat_end_date,
                           p_sunday             =>   l_sunday,
                           p_monday             =>   l_monday,
                           p_tuesday            =>   l_tuesday,
                           p_wednesday          =>   l_wednesday,
                           p_thursday           =>   l_thursday,
                           p_friday             =>   l_friday,
                           p_saturday           =>   l_saturday,
                           x_new_recurrence_rule_id =>   l_new_recurrence_rule_id,
                           x_return_status      =>   l_return_status,
                           x_msg_count          =>   l_msg_count,
                           x_msg_data           =>   l_msg_data
                    );
Line: 4281

                    THEN-- Failed to update a task

       l_task_id     := get_task_id (p_sync_id => p_task_rec.syncid);
Line: 4291

                            p_user_message => 'JTA_SYNC_UPDATE_RECUR_FAIL'
                       );
Line: 4308

                          cac_view_collab_details_pkg.update_row
                          (x_collab_id=> p_getTaskForRecurRule.collab_id ,
                           x_task_id=> p_getTaskForRecurRule.task_id,
                           x_meeting_mode=>p_getTaskForRecurRule.meeting_mode,
                           x_meeting_id=>p_getTaskForRecurRule.meeting_id,
                           x_meeting_url=>p_getTaskForRecurRule.meeting_url,
                           x_join_url=>p_getTaskForRecurRule.join_url,
                           x_playback_url=>p_getTaskForRecurRule.playback_url,
                           x_download_url=>p_getTaskForRecurRule.download_url,
                           x_chat_url=>p_getTaskForRecurRule.chat_url,
                           x_is_standalone_location=>p_getTaskForRecurRule.is_standalone_location,
                           x_location=>l_location,-- p_task_rec.locations,
                           x_dial_in=>p_task_rec.dial_in,
                           x_last_update_date=>sysdate,
                           x_last_updated_by=>jtf_task_utl.updated_by,
                           x_last_update_login=>jtf_task_utl.login_id);
Line: 4334

          END IF; -- l_update_type = g_update_all
Line: 4343

       IF l_update_type = g_update_all
       THEN
           -----------------------------------------------------------
           -- Fix for the bug 2380399
           --  : If the current sync has a change of any fields
           --    along with the change of repeating rule,
           --    The update_task_recurrence_rule API creates new repeating
           --    tasks and updates the mapping record with the new first
           --    task_id. Hence the new task_id must be picked from
           --    mapping table again. And the new object_version_number
           --    of the the new task_id must be selected for update of the
           --    other fields
           -----------------------------------------------------------
           l_task_id := get_task_id (p_sync_id => p_task_rec.syncid);
Line: 4365

             delete_task_data ( p_task_rec =>p_task_rec, p_delete_map_flag  =>true);
Line: 4382

               jta_cal_appointment_pvt.update_appointment (
                    p_object_version_number  => l_ovn ,
                    p_task_id                => l_task_id,
                    p_task_name              => NVL (l_task_name, ' '),
                    p_description            => p_task_rec.description,
                    p_task_priority_id       => l_priorityId,
                    p_planned_start_date     => l_planned_start_date,
                    p_planned_end_date       => l_planned_end_date,
                    p_timezone_id            => get_task_timezone_id (l_task_id),
                    p_private_flag           => p_task_rec.privateflag,
                    p_alarm_start            => l_alarm_mins,
                    p_alarm_on               => p_task_rec.alarmflag,
                    --p_category_id            => l_category_id,
		            p_free_busy_type         => p_task_rec.free_busy_type,
                    p_change_mode            => jtf_task_repeat_appt_pvt.g_all,
                    x_return_status          => l_return_status
               );
Line: 4412

              cac_view_collab_details_pkg.update_row
               (x_collab_id=> l_collab_details.collab_id ,
                x_task_id=> l_task_id,
                x_meeting_mode=>l_collab_details.meeting_mode,
                x_meeting_id=>l_collab_details.meeting_id,
                x_meeting_url=>l_collab_details.meeting_url,
                x_join_url=>l_collab_details.join_url,
                x_playback_url=>l_collab_details.playback_url,
                x_download_url=>l_collab_details.download_url,
                x_chat_url=>l_collab_details.chat_url,
                x_is_standalone_location=>l_collab_details.is_standalone_location,
                x_location=>l_location,--  was   p_task_rec.locations,
                x_dial_in=>p_task_rec.dial_in,
                x_last_update_date=>sysdate,
                x_last_updated_by=>jtf_task_utl.updated_by,
                x_last_update_login=>jtf_task_utl.login_id);
Line: 4432

               cac_view_collab_details_pkg.insert_row (
                  x_rowid => l_rowid,
                  x_collab_id => get_collab_id,--cac_view_collab_details_s.nextval,
                  x_task_id => l_task_id,
                  x_meeting_mode => 'LIVE',
                  x_meeting_id => null,
                  x_meeting_url => null,
                  x_join_url => null,
                  x_playback_url => null,
                  x_download_url => null,
                  x_chat_url => null,
                  x_is_standalone_location => 'Y',
                  x_location => l_location,--was p_task_rec.locations,
                  x_dial_in => p_task_rec.dial_in,
                  x_creation_date => SYSDATE,
                  x_created_by => jtf_task_utl.created_by,
                  x_last_update_date => SYSDATE,
                  x_last_updated_by => jtf_task_utl.updated_by,
                  x_last_update_login => jtf_task_utl.login_id);
Line: 4465

                 cac_view_collab_details_pkg.update_row
                   (x_collab_id=> p_getTaskForRecurRule.collab_id ,
                    x_task_id=> p_getTaskForRecurRule.task_id,
                    x_meeting_mode=>p_getTaskForRecurRule.meeting_mode,
                    x_meeting_id=>p_getTaskForRecurRule.meeting_id,
                    x_meeting_url=>p_getTaskForRecurRule.meeting_url,
                    x_join_url=>p_getTaskForRecurRule.join_url,
                    x_playback_url=>p_getTaskForRecurRule.playback_url,
                    x_download_url=>p_getTaskForRecurRule.download_url,
                    x_chat_url=>p_getTaskForRecurRule.chat_url,
                    x_is_standalone_location=>p_getTaskForRecurRule.is_standalone_location,
                    x_location=>l_location,--was p_task_rec.locations,
                    x_dial_in=>p_task_rec.dial_in,
                    x_last_update_date=>sysdate,
                    x_last_updated_by=>jtf_task_utl.updated_by,
                    x_last_update_login=>jtf_task_utl.login_id);
Line: 4494

               jtf_tasks_pvt.update_task (
                    p_api_version           => 1.0,
                    p_init_msg_list         => fnd_api.g_true,
                    p_commit                => fnd_api.g_false,
                    p_task_id               => l_task_id,
                    p_object_version_number => l_ovn,
                    p_task_name             => NVL (l_task_name, ' '),
                    p_description           => p_task_rec.description,
                    p_task_status_id        => p_task_rec.statusid,
                    p_task_priority_id      => p_task_rec.priorityid,
                    p_planned_start_date    => l_planned_start_date,
                    p_planned_end_date      => l_planned_end_date,
                    p_scheduled_start_date  => l_scheduled_start_date,
                    p_scheduled_end_date    => l_scheduled_end_date,
--                    p_actual_start_date     => l_actual_start_date,
--                    p_actual_end_date       => l_actual_end_date,
                    p_show_on_calendar      => fnd_api.g_miss_char, -- Fix Bug 2467021: For update, pass g_miss_char
                    p_date_selected         => fnd_api.g_miss_char, -- Fix Bug 2467021: For update, pass g_miss_char
                    p_alarm_start           => l_alarm_mins,
                    p_alarm_start_uom       => 'MIN',
                    p_timezone_id           => get_task_timezone_id (l_task_id),
                    p_private_flag          => p_task_rec.privateflag,
                    --p_category_id           => l_category_id,
                    p_change_mode           => 'A',
                    p_enable_workflow       => 'N',
                    p_abort_workflow        => 'N',
                    x_return_status         => l_return_status,
                    x_msg_count             => l_msg_count,
                    x_msg_data              => l_msg_data
              );
Line: 4531

             delete_task_data ( p_task_rec =>p_task_rec, p_delete_map_flag  =>true);
Line: 4548

        cac_view_appt_pvt.update_external_appointment (
              p_object_version_number   =>l_ovn,
              p_task_id                 =>l_task_id,
              p_task_name               => NVL (l_task_name, ' '),
              p_task_type_id            => get_default_task_type,
              p_description             => p_task_rec.description,
              p_task_priority_id        => p_task_rec.priorityid,
              p_planned_start_date      => l_planned_start_date,
              p_planned_end_date        => l_planned_end_date,
              p_timezone_id             => G_SERVER_TIMEZONE_ID,  --changed from g_client_timezone_id as all the value must be stored at server timezone
              p_private_flag            => p_task_rec.privateFlag,
              p_alarm_start             => l_alarm_mins,
              p_alarm_on                => p_task_rec.alarmflag,
              --p_category_id             => l_category_id,
	          p_free_busy_type          => p_task_rec.free_busy_type,
	          p_change_mode             => jtf_task_repeat_appt_pvt.g_all,
              x_return_status           => l_return_status
        );
Line: 4577

              cac_view_collab_details_pkg.update_row
               (x_collab_id=> l_collab_details.collab_id ,
                x_task_id=> l_task_id,
                x_meeting_mode=>l_collab_details.meeting_mode,
                x_meeting_id=>l_collab_details.meeting_id,
                x_meeting_url=>l_collab_details.meeting_url,
                x_join_url=>l_collab_details.join_url,
                x_playback_url=>l_collab_details.playback_url,
                x_download_url=>l_collab_details.download_url,
                x_chat_url=>l_collab_details.chat_url,
                x_is_standalone_location=>l_collab_details.is_standalone_location,
                x_location=>l_location,
                x_dial_in=>p_task_rec.dial_in,
                x_last_update_date=>SYSDATE,
                x_last_updated_by=>jtf_task_utl.updated_by,
                x_last_update_login=>jtf_task_utl.login_id);
Line: 4616

           THEN-- Failed to update a task

               cac_sync_common.put_messages_to_result (
                  p_task_rec,
                  p_status => 2,
                  p_user_message => 'JTA_SYNC_UPDATE_TASK_FAIL'
               );   -- l_return_status
Line: 4626

      ELSIF ((l_update_type = g_update_status)) --and (compare_task_rec(p_task_rec)=true))
      THEN
         if not (compare_task_rec(p_task_rec)) then

            cac_sync_common.put_messages_to_result (
                  p_task_rec,
                  p_status => 2,
                  p_user_message => 'CAC_SYNC_APPT_PERMISSION_DENY',
                  p_token_name=>'P_APPOINTMENT_SUBJECT',
                  p_token_value=>p_task_rec.subject
               );   -- l_return_status
Line: 4651

            jtf_task_assignments_pvt.update_task_assignment (
             p_api_version           => 1.0,
             p_object_version_number => l_ovn,
             p_init_msg_list         => fnd_api.g_true,
             p_commit                => fnd_api.g_false,
             p_task_assignment_id    => l_task_assignment_id,
             p_assignment_status_id  => 3,   -- ACCEPT
             p_free_busy_type        => l_free_busy_type,
             p_enable_workflow 	     => fnd_profile.value('JTF_TASK_ENABLE_WORKFLOW'),
             p_abort_workflow		 => fnd_profile.value('JTF_TASK_ABORT_PREV_WF'),
             x_return_status         => l_return_status,
             x_msg_count             => l_msg_count,
             x_msg_data              => l_msg_data
            );
Line: 4671

                    p_user_message => 'JTA_SYNC_UPDATE_STS_FAIL'
               );
Line: 4681

	ELSE--IF --(l_update_type=g_do_nothing) then
/*

      if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) then
       FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,'cac_sync_task_common.create_new_data', ' When l_update_type=g_do_nothing for task  '|| p_task_rec.subject);
Line: 4712

         jtf_task_assignments_pvt.update_task_assignment (
             p_api_version           => 1.0,
             p_object_version_number => l_ovn,
             p_init_msg_list         => fnd_api.g_true,
             p_commit                => fnd_api.g_false,
             p_task_assignment_id    => l_task_assignment_id,
             p_free_busy_type        => p_task_rec.free_busy_type,
             p_enable_workflow 	     => fnd_profile.value('JTF_TASK_ENABLE_WORKFLOW'),
             p_abort_workflow		 => fnd_profile.value('JTF_TASK_ABORT_PREV_WF'),
             --p_update_all            => l_update_all,
             --p_enable_workflow       => 'N',
             --p_abort_workflow        => 'N',
             x_return_status         => l_return_status,
             x_msg_count             => l_msg_count,
             x_msg_data              => l_msg_data
         );
Line: 4731

     END IF; -- l_update_type
Line: 4745

   END update_existing_data;
Line: 4750

   PROCEDURE delete_exclusion_task (
      p_repeating_task_id   IN       NUMBER,
      x_task_rec            IN OUT NOCOPY   cac_sync_task.task_rec
   )
   IS
      l_ovn     NUMBER;
Line: 4767

          jta_cal_appointment_pvt.delete_appointment (
              p_object_version_number       => l_ovn,
              p_task_id                     => p_repeating_task_id,
              p_delete_future_recurrences   => fnd_api.g_false,
              x_return_status               => l_return_status
          );
Line: 4774

          jtf_tasks_pvt.delete_task (
            p_api_version               => 1.0,
            p_init_msg_list             => fnd_api.g_true,
            p_commit                    => fnd_api.g_false,
            p_task_id                   => p_repeating_task_id,
            p_object_version_number     => l_ovn,
            x_return_status             => l_return_status,
            p_delete_future_recurrences => fnd_api.g_false ,
            x_msg_count                 => l_msg_count,
            x_msg_data                  => l_msg_data
          );
Line: 4800

              p_user_message => 'JTA_SYNC_DELETE_EXCLUSION_FAIL'
         );
Line: 4803

   END delete_exclusion_task;
Line: 4805

   PROCEDURE delete_task_data (
      p_task_rec      IN OUT NOCOPY   cac_sync_task.task_rec,
      p_delete_map_flag   IN       BOOLEAN
   )
   IS

      l_task_id     NUMBER;
Line: 4820

      delete_tasks(p_task_id => l_task_id,
                  x_return_status => l_return_status);
Line: 4828

         IF p_delete_map_flag
         THEN

            cac_sync_task_map_pkg.delete_row (
               p_task_sync_id => p_task_rec.syncid
            );
Line: 4845

            p_user_message => 'JTA_SYNC_DELETE_TASK_FAILED'
         );
Line: 4849

   END delete_task_data;
Line: 4859

       l_deleted              BOOLEAN        := FALSE;
Line: 4873

       l_update_all varchar2(1) ;
Line: 4882

           l_update_all := 'Y' ;
Line: 4884

           l_update_all := null ;
Line: 4895

       jtf_task_assignments_pvt.update_task_assignment (
            p_api_version => 1.0,
            p_object_version_number => l_ovn,
            p_init_msg_list => fnd_api.g_true,
            p_commit => fnd_api.g_false,
            p_task_assignment_id => l_task_assignment_id,
            p_assignment_status_id => 4,   -- reject
            x_return_status => l_return_status,
            x_msg_count => l_msg_count,
            x_msg_data => l_msg_data
            --p_enable_workflow  => 'N',
            --p_abort_workflow  => 'N'
       );
Line: 4919

            cac_sync_task_map_pkg.delete_row(p_task_sync_id => p_task_rec.syncid);
Line: 4924

               p_user_message => 'JTA_SYNC_UPDATE_STS_FAIL'
            );
Line: 4934

     SELECT jtrr.*
       FROM jtf_task_recur_rules jtrr, jtf_tasks_b jtb
      WHERE jtb.task_id = b_task_id
        AND jtb.recurrence_rule_id IS NOT NULL
        AND jtrr.recurrence_rule_id = jtb.recurrence_rule_id;
Line: 5019

     SELECT closed_flag, completed_flag, cancelled_flag, rejected_flag,
        assigned_flag, working_flag, schedulable_flag, accepted_flag,
        on_hold_flag, approved_flag

       FROM jtf_task_statuses_b
      WHERE task_status_id = p_task_status_id;
Line: 5038

                  x_operation := cac_sync_task_common.g_delete;
Line: 5058

              x_operation := cac_sync_task_common.g_delete;
Line: 5076

            x_operation := cac_sync_task_common.g_delete;
Line: 5125

             SELECT 1 INTO l_num
         FROM
         fnd_user
         ,fnd_user_resp_groups
         ,fnd_responsibility
         ,jtf_state_rules_b
         , jtf_state_responsibilities
         WHERE fnd_user.user_id = fnd_global.user_id
         AND fnd_user.user_id = fnd_user_resp_groups.user_id
         AND fnd_user_resp_groups.responsibility_id = jtf_state_responsibilities.responsibility_id
         AND jtf_state_responsibilities.rule_id = jtf_state_rules_b.rule_id;
Line: 5158

        SELECT 1
          FROM jta_sync_task_mapping
         WHERE task_sync_id = b_syncid;
Line: 5200

       select cactl.dial_in
       from
       cac_view_collab_details_tl cactl,
       cac_view_collab_details cac
       where cac.collab_id=cactl.collab_id
       and cactl.LANGUAGE = userenv('LANG')
       and cac.task_id=b_task_id;
Line: 5232

  procedure delete_bookings (
      p_principal_id        IN   NUMBER

   )
   IS

      CURSOR getUserId(b_principal_id  IN NUMBER)
      IS
       SELECT user_id
        FROM cac_sync_principals
        WHERE principal_id  = b_principal_id;
Line: 5246

       SELECT jtb.task_id,jtb.object_version_number,jstm.task_sync_id, jtb.source_object_type_code objectcode
        FROM jta_sync_task_mapping jstm, jtf_tasks_b jtb
        WHERE jstm.principal_id IN
		(SELECT principal_id
		FROM cac_sync_principals
		WHERE device_id = (SELECT device_id FROM cac_sync_principals
		WHERE principal_id = b_principal_id)
		AND user_id = b_user_id)
         AND   jstm.task_id=jtb.task_id
        AND   jtb.entity IN ('BOOKING', 'APPOINTMENT')
        AND   jtb.source_object_type_code='EXTERNAL APPOINTMENT';
Line: 5290

	  FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,'cac_sync_task_common.delete_booking', 'no booking is found for the principal id ' || p_principal_id);
Line: 5295

	  FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,'cac_sync_task_common.delete_booking', 'booking is found for the principal id ' || p_principal_id);
Line: 5304

        delete_tasks(p_task_id => p_getBookings.task_id,
                     x_return_status => l_return_status);
Line: 5310

           cac_sync_task_map_pkg.delete_row (
               p_task_sync_id => p_getBookings.task_sync_id);
Line: 5314

	  FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,'cac_sync_task_common.delete_booking', 'success from cac_bookings_pub.delete_booking');
Line: 5317

       else --failure from delete_booking API

         if( FND_LOG.LEVEL_STATEMENT >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) then
	  FND_LOG.STRING(FND_LOG.LEVEL_STATEMENT,'cac_sync_task_common.delete_booking', 'failure from cac_bookings_pub.delete_booking');
Line: 5333

   END delete_bookings;
Line: 5345

       select OCCURS_WHICH,DAY_OF_WEEK,DATE_OF_MONTH,
              OCCURS_MONTH,OCCURS_UOM,OCCURS_EVERY,
              OCCURS_NUMBER,START_DATE_ACTIVE,END_DATE_ACTIVE,
              SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,
              SATURDAY
       from jtf_task_recur_rules jtrr, jtf_tasks_b b
       where b.recurrence_rule_id=jtrr.recurrence_rule_id
          and b.task_id=b_task_id;
Line: 5359

       l_update_type         VARCHAR2(15);
Line: 5366

       l_update_type := get_update_type (
                            p_task_id => l_task_id,
                            p_resource_id => l_resource_id,
                            p_subject => p_task_rec.subject
                       );
Line: 5373

    if (l_update_type = g_update_all)  then
      open get_recur_rule(l_task_id);
Line: 5447

end if;  --  if (l_update_type = g_update_all)
Line: 5456

PROCEDURE delete_tasks (
      p_task_id      IN OUT NOCOPY   NUMBER,
      x_return_status   IN OUT NOCOPY VARCHAR2
   )
   IS

    cursor get_tasks_ids (b_recurrence_rule_id IN NUMBER)
    is
    select jte.task_id from
    jta_task_exclusions jte
    where jte.recurrence_rule_id=b_recurrence_rule_id;
Line: 5479

          jtf_tasks_pvt.delete_task (
             p_api_version => 1.0,
             p_init_msg_list => fnd_api.g_false,
             p_commit => fnd_api.g_false,
             p_task_id => p_task_id,
             p_object_version_number => l_ovn,
             p_delete_future_recurrences => 'A',
             x_return_status => x_return_status,
             x_msg_count => l_msg_count,
             x_msg_data => l_msg_data
          );
Line: 5503

            jtf_tasks_pvt.delete_task (
             p_api_version => 1.0,
             p_init_msg_list => fnd_api.g_false,
             p_commit => fnd_api.g_false,
             p_task_id => l_tsk_ids.task_id,
             p_object_version_number => l_ovn,
             p_delete_future_recurrences => jtf_task_repeat_appt_pvt.G_ONE,
             x_return_status => x_return_status,
             x_msg_count => l_msg_count,
             x_msg_data => l_msg_data
          );
Line: 5526

END delete_tasks;
Line: 5530

   If the appointment has been deleted/declined, it will return false and update will not be called.
   Instead Sync will throw error saying that appointment has been deleted in server. */
PROCEDURE is_appointment_existing(p_task_sync_id IN NUMBER, x_result OUT NOCOPY VARCHAR2)
IS

   CURSOR check_appt(b_resource_id NUMBER, b_resource_type_code VARCHAR2)
   IS
     SELECT a.assignment_status_id
     from  jtf_tasks_b b, jtf_task_all_assignments a, jta_sync_Task_mapping s
     where b.task_id = a.task_id
     and   s.task_id = b.task_id
     and   s.task_sync_id = p_task_sync_id
     and   a.resource_id = b_resource_id
     and   a.resource_type_code = b_resource_type_code;