4: person_ug_map_rec_table ota_learner_access_util.person_ug_map_table;
5: t_ug_learner_list_table ota_learner_access_util.ug_learner_list_table;
6:
7: cursor csr_evt_tree(
8: p_event_id ota_events.event_id%type) is
9: select o.offering_id, i.activity_version_id, i.category_usage_id,
10: c1.parent_cat_usage_id as parent_cat_usage_id_1,
11: c2.parent_cat_usage_id as parent_cat_usage_id_2,
12: c3.parent_cat_usage_id as parent_cat_usage_id_3,
10: c1.parent_cat_usage_id as parent_cat_usage_id_1,
11: c2.parent_cat_usage_id as parent_cat_usage_id_2,
12: c3.parent_cat_usage_id as parent_cat_usage_id_3,
13: c4.parent_cat_usage_id as parent_cat_usage_id_4
14: from ota_events e,
15: ota_offerings o,
16: ota_act_cat_inclusions i,
17: ota_category_usages c1,
18: ota_category_usages c2,
109:
110:
111: cursor csr_evt_assoc(
112: p_self_enroll_only varchar2,
113: p_event_id ota_events.event_id%type,
114: p_offering_id ota_offerings.offering_id%type,
115: p_activity_version_id ota_activity_versions.activity_version_id%type,
116: p_category_usage_id ota_category_usages.category_usage_id%type,
117: p_parent_cat_usage_id_1 ota_category_usages.category_usage_id%type,
131:
132:
133: /*Bug 7046019- Modified cursor check_mandatory_evt_assoc to include learner groups
134: Cursor check_mandatory_evt_assoc(
135: p_event_id ota_events.event_id%type,
136: p_person_id ota_event_associations.person_id%type,
137: p_as_of in date
138: ) is
139: select ea.event_association_id
156: ( ea.org_structure_version_id IS NOT NULL AND learner_belongs_to_child_org(ea.org_structure_version_id,ea.organization_id,paf.person_id)='Y')
157: );*/
158:
159: Cursor check_mandatory_evt_assoc(
160: p_event_id ota_events.event_id%type,
161: p_person_id ota_event_associations.person_id%type,
162: p_as_of in date
163: ) is
164: select ea.event_association_id
184:
185: cursor csr_evt_assoc_ext(
186: p_self_enroll_only varchar2,
187: p_party_id hz_parties.party_id%type,
188: p_event_id ota_events.event_id%type,
189: p_offering_id ota_offerings.offering_id%type,
190: p_activity_version_id ota_activity_versions.activity_version_id%type,
191: p_category_usage_id ota_category_usages.category_usage_id%type,
192: p_parent_cat_usage_id_1 ota_category_usages.category_usage_id%type,
533: OEV.public_event_flag,
534: OEV.maximum_internal_attendees,
535: OEV.course_start_date
536: FROM ota_activity_versions_vl OAV,
537: ota_events_vl OEV,
538: ota_offerings_vl OFR,
539: ota_category_usages OCU
540: WHERE OFR.activity_version_id = OAV.activity_version_id
541: AND OEV.parent_offering_id = OFR.offering_id
602: and uge.user_group_id = ugb.user_group_id
603: and trunc(sysdate) between trunc(nvl(ugb.start_date_active, sysdate)) and trunc(nvl(ugb.end_date_active, sysdate+1)) --Bug#7120108
604: and (uge.business_group_id = p_business_group_id or p_business_group_id = -1);
605:
606: function is_customer_event(p_event_id in ota_events.event_id%type) return boolean is
607:
608: cursor customer_assoc is
609: select 1
610: from ota_event_associations
622: end is_customer_event;
623:
624:
625: function get_event_start_date(
626: p_event_id ota_events.event_id%type,
627: p_date date) return date is
628:
629: l_event_start_date ota_events.course_start_date%type;
630: --l_date date := trunc(p_date);
625: function get_event_start_date(
626: p_event_id ota_events.event_id%type,
627: p_date date) return date is
628:
629: l_event_start_date ota_events.course_start_date%type;
630: --l_date date := trunc(p_date);
631:
632: l_start_date ota_events.course_start_date%type;
633: l_synchronous_flag ota_category_usages.synchronous_flag%type;
628:
629: l_event_start_date ota_events.course_start_date%type;
630: --l_date date := trunc(p_date);
631:
632: l_start_date ota_events.course_start_date%type;
633: l_synchronous_flag ota_category_usages.synchronous_flag%type;
634: l_event_status ota_events.event_status%type;
635: l_event_end_date ota_events.course_end_date%type;
636: l_event_end_time ota_events.course_end_time%type;
630: --l_date date := trunc(p_date);
631:
632: l_start_date ota_events.course_start_date%type;
633: l_synchronous_flag ota_category_usages.synchronous_flag%type;
634: l_event_status ota_events.event_status%type;
635: l_event_end_date ota_events.course_end_date%type;
636: l_event_end_time ota_events.course_end_time%type;
637: l_timezone ota_events.timezone%type;
638: begin
631:
632: l_start_date ota_events.course_start_date%type;
633: l_synchronous_flag ota_category_usages.synchronous_flag%type;
634: l_event_status ota_events.event_status%type;
635: l_event_end_date ota_events.course_end_date%type;
636: l_event_end_time ota_events.course_end_time%type;
637: l_timezone ota_events.timezone%type;
638: begin
639: -- Modified this function for bug#4393763 to return
632: l_start_date ota_events.course_start_date%type;
633: l_synchronous_flag ota_category_usages.synchronous_flag%type;
634: l_event_status ota_events.event_status%type;
635: l_event_end_date ota_events.course_end_date%type;
636: l_event_end_time ota_events.course_end_time%type;
637: l_timezone ota_events.timezone%type;
638: begin
639: -- Modified this function for bug#4393763 to return
640: -- course_end_Date for synchronous class
633: l_synchronous_flag ota_category_usages.synchronous_flag%type;
634: l_event_status ota_events.event_status%type;
635: l_event_end_date ota_events.course_end_date%type;
636: l_event_end_time ota_events.course_end_time%type;
637: l_timezone ota_events.timezone%type;
638: begin
639: -- Modified this function for bug#4393763 to return
640: -- course_end_Date for synchronous class
641: -- sysdate for asynchronous class and 'Planned' status class
642: select oev.course_start_date, oev.course_end_date,ocu.synchronous_flag, oev.event_status
643: ,oev.timezone , oev.course_end_time
644: into l_event_start_date,l_event_end_date,l_synchronous_flag, l_event_status
645: ,l_timezone , l_event_end_time
646: from ota_events oev, ota_offerings ofr, ota_category_usages ocu
647: Where oev.event_id = p_event_id and
648: oev.parent_offering_id = ofr.offering_id and
649: ofr.delivery_mode_id = ocu.category_usage_id and
650: event_type in ('SCHEDULED','SELFPACED') and
732:
733:
734: function emp_matches_org(
735: p_person_id in per_people_f.person_id%type,
736: p_event_id in ota_events.event_id%type,
737: p_organization_id in ota_events.organization_id%type) return varchar2 is
738:
739: cursor csr_assignments(
740: p_person_id per_people_f.person_id%type,
733:
734: function emp_matches_org(
735: p_person_id in per_people_f.person_id%type,
736: p_event_id in ota_events.event_id%type,
737: p_organization_id in ota_events.organization_id%type) return varchar2 is
738:
739: cursor csr_assignments(
740: p_person_id per_people_f.person_id%type,
741: p_organization_id ota_event_associations.organization_id%type,
747: nvl(p_course_start_date, trunc(p_now)) between asg.effective_start_date and asg.effective_end_date and
748: p_organization_id = asg.organization_id and
749: asg.assignment_type in ('E','A','C');
750: l_now date;
751: l_event_start_date ota_events.course_start_date%type;
752: begin
753: l_now := sysdate;
754: -- Bug 4584737: if no data found, event has expired or does not exist. Return 'N'.
755: begin
811: END learner_belongs_to_child_org;
812:
813: function emp_has_access(
814: p_person_id in per_people_f.person_id%type,
815: p_event_id in ota_events.event_id%type,
816: p_self_enroll_only in varchar2) return varchar2 is
817:
818: l_event_start_date ota_events.course_start_date%type;
819: l_now date := sysdate;
814: p_person_id in per_people_f.person_id%type,
815: p_event_id in ota_events.event_id%type,
816: p_self_enroll_only in varchar2) return varchar2 is
817:
818: l_event_start_date ota_events.course_start_date%type;
819: l_now date := sysdate;
820: l_offering_id ota_offerings.offering_id%type;
821: l_activity_version_id ota_activity_versions.activity_version_id%type;
822: l_category_usage_id ota_category_usages.category_usage_id%type;
890:
891:
892: function ext_has_access(
893: p_party_id in hz_parties.party_id%type,
894: p_event_id in ota_events.event_id%type,
895: p_self_enroll_only in varchar2) return varchar2 is
896:
897: l_offering_id ota_offerings.offering_id%type;
898: l_activity_version_id ota_activity_versions.activity_version_id%type;
925: return 'N';
926: end ext_has_access;
927:
928: FUNCTION emp_has_valid_dates(p_person_id per_all_people_f.person_id%TYPE
929: ,p_event_id ota_events.event_id%TYPE)
930: RETURN VARCHAR2 IS
931: l_event_start_date DATE;
932: l_assignment_id per_all_assignments_f.assignment_id%TYPE;
933: BEGIN
954:
955:
956: function employee_can_enroll(
957: p_person_id in per_people_f.person_id%type,
958: p_event_id in ota_events.event_id%type,
959: p_public_event_flag ota_events.public_event_flag%type,
960: p_max_internal in ota_events.maximum_internal_attendees%type,
961: p_event_start_date in otv_scheduled_events.course_start_date%type,
962: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
955:
956: function employee_can_enroll(
957: p_person_id in per_people_f.person_id%type,
958: p_event_id in ota_events.event_id%type,
959: p_public_event_flag ota_events.public_event_flag%type,
960: p_max_internal in ota_events.maximum_internal_attendees%type,
961: p_event_start_date in otv_scheduled_events.course_start_date%type,
962: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
963:
956: function employee_can_enroll(
957: p_person_id in per_people_f.person_id%type,
958: p_event_id in ota_events.event_id%type,
959: p_public_event_flag ota_events.public_event_flag%type,
960: p_max_internal in ota_events.maximum_internal_attendees%type,
961: p_event_start_date in otv_scheduled_events.course_start_date%type,
962: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
963:
964: --Bug 547819
958: p_event_id in ota_events.event_id%type,
959: p_public_event_flag ota_events.public_event_flag%type,
960: p_max_internal in ota_events.maximum_internal_attendees%type,
961: p_event_start_date in otv_scheduled_events.course_start_date%type,
962: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
963:
964: --Bug 547819
965: Cursor c_event_data is
966: Select OCU.synchronous_flag, OEV.event_status, OEV.secure_event_flag,
964: --Bug 547819
965: Cursor c_event_data is
966: Select OCU.synchronous_flag, OEV.event_status, OEV.secure_event_flag,
967: OEV.organization_id
968: From ota_events OEV, ota_offerings OFR, ota_category_usages OCU
969: Where OEV.event_id = p_event_id
970: And OEV.parent_offering_id = OFR.offering_id
971: And OFR.delivery_mode_id = OCU.category_usage_id;
972:
971: And OFR.delivery_mode_id = OCU.category_usage_id;
972:
973: l_synchronous_flag ota_category_usages.synchronous_flag%type;
974: l_effective_start_date PER_ALL_PEOPLE_F.effective_start_date%type;
975: l_event_status ota_events.event_status%type;
976: l_secure_event_flag ota_events.secure_event_flag%type;
977: l_organization_id ota_events.organization_id%type;
978: l_start_date otv_scheduled_events.course_start_date%type;
979: l_is_secure_event boolean;
972:
973: l_synchronous_flag ota_category_usages.synchronous_flag%type;
974: l_effective_start_date PER_ALL_PEOPLE_F.effective_start_date%type;
975: l_event_status ota_events.event_status%type;
976: l_secure_event_flag ota_events.secure_event_flag%type;
977: l_organization_id ota_events.organization_id%type;
978: l_start_date otv_scheduled_events.course_start_date%type;
979: l_is_secure_event boolean;
980: begin
973: l_synchronous_flag ota_category_usages.synchronous_flag%type;
974: l_effective_start_date PER_ALL_PEOPLE_F.effective_start_date%type;
975: l_event_status ota_events.event_status%type;
976: l_secure_event_flag ota_events.secure_event_flag%type;
977: l_organization_id ota_events.organization_id%type;
978: l_start_date otv_scheduled_events.course_start_date%type;
979: l_is_secure_event boolean;
980: begin
981: --Bug 547819
1015:
1016:
1017: function employee_can_self_enroll(
1018: p_person_id in per_people_f.person_id%type,
1019: p_event_id in ota_events.event_id%type,
1020: p_public_event_flag ota_events.public_event_flag%type,
1021: p_max_internal in ota_events.maximum_internal_attendees%type,
1022: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1023: begin
1016:
1017: function employee_can_self_enroll(
1018: p_person_id in per_people_f.person_id%type,
1019: p_event_id in ota_events.event_id%type,
1020: p_public_event_flag ota_events.public_event_flag%type,
1021: p_max_internal in ota_events.maximum_internal_attendees%type,
1022: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1023: begin
1024: -- Employees may not enroll if MAXIMUM_INTERNAL_ATTENDEES is zero.
1017: function employee_can_self_enroll(
1018: p_person_id in per_people_f.person_id%type,
1019: p_event_id in ota_events.event_id%type,
1020: p_public_event_flag ota_events.public_event_flag%type,
1021: p_max_internal in ota_events.maximum_internal_attendees%type,
1022: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1023: begin
1024: -- Employees may not enroll if MAXIMUM_INTERNAL_ATTENDEES is zero.
1025: -- Self-enrollment can only be specified via event associations. Therefore,
1018: p_person_id in per_people_f.person_id%type,
1019: p_event_id in ota_events.event_id%type,
1020: p_public_event_flag ota_events.public_event_flag%type,
1021: p_max_internal in ota_events.maximum_internal_attendees%type,
1022: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1023: begin
1024: -- Employees may not enroll if MAXIMUM_INTERNAL_ATTENDEES is zero.
1025: -- Self-enrollment can only be specified via event associations. Therefore,
1026: -- public events or customer events can never be self-enrollable.
1034:
1035:
1036: function ext_learner_can_enroll(
1037: p_party_id in hz_parties.party_id%type,
1038: p_event_id in ota_events.event_id%type,
1039: p_public_event_flag ota_events.public_event_flag%type,
1040: p_max_internal in ota_events.maximum_internal_attendees%type,
1041: p_event_start_date in otv_scheduled_events.course_start_date%type,
1042: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1035:
1036: function ext_learner_can_enroll(
1037: p_party_id in hz_parties.party_id%type,
1038: p_event_id in ota_events.event_id%type,
1039: p_public_event_flag ota_events.public_event_flag%type,
1040: p_max_internal in ota_events.maximum_internal_attendees%type,
1041: p_event_start_date in otv_scheduled_events.course_start_date%type,
1042: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1043: begin
1036: function ext_learner_can_enroll(
1037: p_party_id in hz_parties.party_id%type,
1038: p_event_id in ota_events.event_id%type,
1039: p_public_event_flag ota_events.public_event_flag%type,
1040: p_max_internal in ota_events.maximum_internal_attendees%type,
1041: p_event_start_date in otv_scheduled_events.course_start_date%type,
1042: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1043: begin
1044: -- External learners can enroll if the event is public, or it is a non-customer event and
1038: p_event_id in ota_events.event_id%type,
1039: p_public_event_flag ota_events.public_event_flag%type,
1040: p_max_internal in ota_events.maximum_internal_attendees%type,
1041: p_event_start_date in otv_scheduled_events.course_start_date%type,
1042: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1043: begin
1044: -- External learners can enroll if the event is public, or it is a non-customer event and
1045: -- the learner has been specifically given access via event associations.
1046:
1058:
1059:
1060: function ext_learner_can_self_enroll(
1061: p_party_id in hz_parties.party_id%type,
1062: p_event_id in ota_events.event_id%type,
1063: p_public_event_flag ota_events.public_event_flag%type,
1064: p_max_internal in ota_events.maximum_internal_attendees%type,
1065: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1066: begin
1059:
1060: function ext_learner_can_self_enroll(
1061: p_party_id in hz_parties.party_id%type,
1062: p_event_id in ota_events.event_id%type,
1063: p_public_event_flag ota_events.public_event_flag%type,
1064: p_max_internal in ota_events.maximum_internal_attendees%type,
1065: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1066: begin
1067: -- Self-enrollment can only be specified via event associations. Therefore,
1060: function ext_learner_can_self_enroll(
1061: p_party_id in hz_parties.party_id%type,
1062: p_event_id in ota_events.event_id%type,
1063: p_public_event_flag ota_events.public_event_flag%type,
1064: p_max_internal in ota_events.maximum_internal_attendees%type,
1065: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1066: begin
1067: -- Self-enrollment can only be specified via event associations. Therefore,
1068: -- public events or customer events can never be self-enrollable.
1061: p_party_id in hz_parties.party_id%type,
1062: p_event_id in ota_events.event_id%type,
1063: p_public_event_flag ota_events.public_event_flag%type,
1064: p_max_internal in ota_events.maximum_internal_attendees%type,
1065: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1066: begin
1067: -- Self-enrollment can only be specified via event associations. Therefore,
1068: -- public events or customer events can never be self-enrollable.
1069: if p_public_event_flag = 'Y' or is_customer_event(p_event_id) then
1077:
1078: function learner_can_enroll(
1079: p_person_id in per_people_f.person_id%type,
1080: p_party_id in hz_parties.party_id%type,
1081: p_event_id in ota_events.event_id%type,
1082: p_public_event_flag in ota_events.public_event_flag%type,
1083: p_max_internal in ota_events.maximum_internal_attendees%type,
1084: p_event_start_date in otv_scheduled_events.course_start_date%type,
1085: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1078: function learner_can_enroll(
1079: p_person_id in per_people_f.person_id%type,
1080: p_party_id in hz_parties.party_id%type,
1081: p_event_id in ota_events.event_id%type,
1082: p_public_event_flag in ota_events.public_event_flag%type,
1083: p_max_internal in ota_events.maximum_internal_attendees%type,
1084: p_event_start_date in otv_scheduled_events.course_start_date%type,
1085: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1086: begin
1079: p_person_id in per_people_f.person_id%type,
1080: p_party_id in hz_parties.party_id%type,
1081: p_event_id in ota_events.event_id%type,
1082: p_public_event_flag in ota_events.public_event_flag%type,
1083: p_max_internal in ota_events.maximum_internal_attendees%type,
1084: p_event_start_date in otv_scheduled_events.course_start_date%type,
1085: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1086: begin
1087: if p_person_id is not null then
1081: p_event_id in ota_events.event_id%type,
1082: p_public_event_flag in ota_events.public_event_flag%type,
1083: p_max_internal in ota_events.maximum_internal_attendees%type,
1084: p_event_start_date in otv_scheduled_events.course_start_date%type,
1085: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1086: begin
1087: if p_person_id is not null then
1088: return employee_can_enroll(p_person_id, p_event_id, p_public_event_flag, p_max_internal, p_event_start_date, p_parent_offering_id);
1089: else
1094:
1095: function learner_can_enroll(
1096: p_person_id in per_people_f.person_id%type,
1097: p_party_id in hz_parties.party_id%type,
1098: p_event_id in ota_events.event_id%type,
1099: p_event_start_date in otv_scheduled_events.course_start_date%type,
1100: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1101:
1102: v_public_event_flag ota_events.public_event_flag%type;
1096: p_person_id in per_people_f.person_id%type,
1097: p_party_id in hz_parties.party_id%type,
1098: p_event_id in ota_events.event_id%type,
1099: p_event_start_date in otv_scheduled_events.course_start_date%type,
1100: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1101:
1102: v_public_event_flag ota_events.public_event_flag%type;
1103: v_max_internal ota_events.maximum_internal_attendees%type;
1104: begin
1098: p_event_id in ota_events.event_id%type,
1099: p_event_start_date in otv_scheduled_events.course_start_date%type,
1100: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1101:
1102: v_public_event_flag ota_events.public_event_flag%type;
1103: v_max_internal ota_events.maximum_internal_attendees%type;
1104: begin
1105: select maximum_internal_attendees, public_event_flag
1106: into v_max_internal, v_public_event_flag
1099: p_event_start_date in otv_scheduled_events.course_start_date%type,
1100: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1101:
1102: v_public_event_flag ota_events.public_event_flag%type;
1103: v_max_internal ota_events.maximum_internal_attendees%type;
1104: begin
1105: select maximum_internal_attendees, public_event_flag
1106: into v_max_internal, v_public_event_flag
1107: from ota_events
1103: v_max_internal ota_events.maximum_internal_attendees%type;
1104: begin
1105: select maximum_internal_attendees, public_event_flag
1106: into v_max_internal, v_public_event_flag
1107: from ota_events
1108: where event_id = p_event_id;
1109:
1110: return learner_can_enroll(p_person_id, p_party_id, p_event_id, v_public_event_flag, v_max_internal, p_event_start_date, p_parent_offering_id);
1111: end learner_can_enroll;
1113:
1114: function learner_can_enroll(
1115: p_person_id in per_people_f.person_id%type,
1116: p_party_id in hz_parties.party_id%type,
1117: p_event_id in ota_events.event_id%type) return varchar2 is
1118:
1119: v_event_start_date ota_events.course_start_date%type;
1120: v_parent_offering_id ota_events.parent_offering_id%type;
1121: v_public_event_flag ota_events.public_event_flag%type;
1115: p_person_id in per_people_f.person_id%type,
1116: p_party_id in hz_parties.party_id%type,
1117: p_event_id in ota_events.event_id%type) return varchar2 is
1118:
1119: v_event_start_date ota_events.course_start_date%type;
1120: v_parent_offering_id ota_events.parent_offering_id%type;
1121: v_public_event_flag ota_events.public_event_flag%type;
1122: v_max_internal ota_events.maximum_internal_attendees%type;
1123: begin
1116: p_party_id in hz_parties.party_id%type,
1117: p_event_id in ota_events.event_id%type) return varchar2 is
1118:
1119: v_event_start_date ota_events.course_start_date%type;
1120: v_parent_offering_id ota_events.parent_offering_id%type;
1121: v_public_event_flag ota_events.public_event_flag%type;
1122: v_max_internal ota_events.maximum_internal_attendees%type;
1123: begin
1124: select maximum_internal_attendees, public_event_flag, parent_offering_id, course_start_date
1117: p_event_id in ota_events.event_id%type) return varchar2 is
1118:
1119: v_event_start_date ota_events.course_start_date%type;
1120: v_parent_offering_id ota_events.parent_offering_id%type;
1121: v_public_event_flag ota_events.public_event_flag%type;
1122: v_max_internal ota_events.maximum_internal_attendees%type;
1123: begin
1124: select maximum_internal_attendees, public_event_flag, parent_offering_id, course_start_date
1125: into v_max_internal, v_public_event_flag, v_parent_offering_id, v_event_start_date
1118:
1119: v_event_start_date ota_events.course_start_date%type;
1120: v_parent_offering_id ota_events.parent_offering_id%type;
1121: v_public_event_flag ota_events.public_event_flag%type;
1122: v_max_internal ota_events.maximum_internal_attendees%type;
1123: begin
1124: select maximum_internal_attendees, public_event_flag, parent_offering_id, course_start_date
1125: into v_max_internal, v_public_event_flag, v_parent_offering_id, v_event_start_date
1126: from ota_events
1122: v_max_internal ota_events.maximum_internal_attendees%type;
1123: begin
1124: select maximum_internal_attendees, public_event_flag, parent_offering_id, course_start_date
1125: into v_max_internal, v_public_event_flag, v_parent_offering_id, v_event_start_date
1126: from ota_events
1127: where event_id = p_event_id;
1128:
1129: return learner_can_enroll(p_person_id, p_party_id, p_event_id, v_public_event_flag, v_max_internal, v_event_start_date, v_parent_offering_id);
1130: end learner_can_enroll;
1132:
1133: function learner_can_self_enroll(
1134: p_person_id in per_people_f.person_id%type,
1135: p_party_id in hz_parties.party_id%type,
1136: p_event_id in ota_events.event_id%type,
1137: p_public_event_flag in ota_events.public_event_flag%type,
1138: p_max_internal in ota_events.maximum_internal_attendees%type,
1139: p_event_start_date in otv_scheduled_events.course_start_date%type,
1140: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1133: function learner_can_self_enroll(
1134: p_person_id in per_people_f.person_id%type,
1135: p_party_id in hz_parties.party_id%type,
1136: p_event_id in ota_events.event_id%type,
1137: p_public_event_flag in ota_events.public_event_flag%type,
1138: p_max_internal in ota_events.maximum_internal_attendees%type,
1139: p_event_start_date in otv_scheduled_events.course_start_date%type,
1140: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1141: begin
1134: p_person_id in per_people_f.person_id%type,
1135: p_party_id in hz_parties.party_id%type,
1136: p_event_id in ota_events.event_id%type,
1137: p_public_event_flag in ota_events.public_event_flag%type,
1138: p_max_internal in ota_events.maximum_internal_attendees%type,
1139: p_event_start_date in otv_scheduled_events.course_start_date%type,
1140: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1141: begin
1142: if p_person_id is not null then
1136: p_event_id in ota_events.event_id%type,
1137: p_public_event_flag in ota_events.public_event_flag%type,
1138: p_max_internal in ota_events.maximum_internal_attendees%type,
1139: p_event_start_date in otv_scheduled_events.course_start_date%type,
1140: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1141: begin
1142: if p_person_id is not null then
1143: return employee_can_self_enroll(p_person_id, p_event_id, p_public_event_flag, p_max_internal, p_parent_offering_id);
1144: else
1149:
1150: function learner_can_self_enroll(
1151: p_person_id in per_people_f.person_id%type,
1152: p_party_id in hz_parties.party_id%type,
1153: p_event_id in ota_events.event_id%type,
1154: p_event_start_date in otv_scheduled_events.course_start_date%type,
1155: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1156:
1157: v_public_event_flag ota_events.public_event_flag%type;
1151: p_person_id in per_people_f.person_id%type,
1152: p_party_id in hz_parties.party_id%type,
1153: p_event_id in ota_events.event_id%type,
1154: p_event_start_date in otv_scheduled_events.course_start_date%type,
1155: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1156:
1157: v_public_event_flag ota_events.public_event_flag%type;
1158: v_max_internal ota_events.maximum_internal_attendees%type;
1159: begin
1153: p_event_id in ota_events.event_id%type,
1154: p_event_start_date in otv_scheduled_events.course_start_date%type,
1155: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1156:
1157: v_public_event_flag ota_events.public_event_flag%type;
1158: v_max_internal ota_events.maximum_internal_attendees%type;
1159: begin
1160: select maximum_internal_attendees, public_event_flag
1161: into v_max_internal, v_public_event_flag
1154: p_event_start_date in otv_scheduled_events.course_start_date%type,
1155: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1156:
1157: v_public_event_flag ota_events.public_event_flag%type;
1158: v_max_internal ota_events.maximum_internal_attendees%type;
1159: begin
1160: select maximum_internal_attendees, public_event_flag
1161: into v_max_internal, v_public_event_flag
1162: from ota_events
1158: v_max_internal ota_events.maximum_internal_attendees%type;
1159: begin
1160: select maximum_internal_attendees, public_event_flag
1161: into v_max_internal, v_public_event_flag
1162: from ota_events
1163: where event_id = p_event_id;
1164:
1165: return learner_can_self_enroll(p_person_id, p_party_id, p_event_id, v_public_event_flag, v_max_internal, p_event_start_date, p_parent_offering_id);
1166: end learner_can_self_enroll;
1167:
1168: function learner_can_self_enroll(
1169: p_person_id in per_people_f.person_id%type,
1170: p_party_id in hz_parties.party_id%type,
1171: p_event_id in ota_events.event_id%type) return varchar2 is
1172:
1173: v_event_start_date ota_events.course_start_date%type;
1174: v_parent_offering_id ota_events.parent_offering_id%type;
1175: v_public_event_flag ota_events.public_event_flag%type;
1169: p_person_id in per_people_f.person_id%type,
1170: p_party_id in hz_parties.party_id%type,
1171: p_event_id in ota_events.event_id%type) return varchar2 is
1172:
1173: v_event_start_date ota_events.course_start_date%type;
1174: v_parent_offering_id ota_events.parent_offering_id%type;
1175: v_public_event_flag ota_events.public_event_flag%type;
1176: v_max_internal ota_events.maximum_internal_attendees%type;
1177: begin
1170: p_party_id in hz_parties.party_id%type,
1171: p_event_id in ota_events.event_id%type) return varchar2 is
1172:
1173: v_event_start_date ota_events.course_start_date%type;
1174: v_parent_offering_id ota_events.parent_offering_id%type;
1175: v_public_event_flag ota_events.public_event_flag%type;
1176: v_max_internal ota_events.maximum_internal_attendees%type;
1177: begin
1178: select maximum_internal_attendees, public_event_flag, parent_offering_id, course_start_date
1171: p_event_id in ota_events.event_id%type) return varchar2 is
1172:
1173: v_event_start_date ota_events.course_start_date%type;
1174: v_parent_offering_id ota_events.parent_offering_id%type;
1175: v_public_event_flag ota_events.public_event_flag%type;
1176: v_max_internal ota_events.maximum_internal_attendees%type;
1177: begin
1178: select maximum_internal_attendees, public_event_flag, parent_offering_id, course_start_date
1179: into v_max_internal, v_public_event_flag, v_parent_offering_id, v_event_start_date
1172:
1173: v_event_start_date ota_events.course_start_date%type;
1174: v_parent_offering_id ota_events.parent_offering_id%type;
1175: v_public_event_flag ota_events.public_event_flag%type;
1176: v_max_internal ota_events.maximum_internal_attendees%type;
1177: begin
1178: select maximum_internal_attendees, public_event_flag, parent_offering_id, course_start_date
1179: into v_max_internal, v_public_event_flag, v_parent_offering_id, v_event_start_date
1180: from ota_events
1176: v_max_internal ota_events.maximum_internal_attendees%type;
1177: begin
1178: select maximum_internal_attendees, public_event_flag, parent_offering_id, course_start_date
1179: into v_max_internal, v_public_event_flag, v_parent_offering_id, v_event_start_date
1180: from ota_events
1181: where event_id = p_event_id;
1182:
1183: return learner_can_self_enroll(p_person_id, p_party_id, p_event_id, v_public_event_flag, v_max_internal, v_event_start_date, v_parent_offering_id);
1184: end learner_can_self_enroll;
1185:
1186:
1187: function chk_delegate_ok_for_event(
1188: p_delegate_id in per_people_f.person_id%type,
1189: p_event_id in ota_events.event_id%type,
1190: p_event_start_date in otv_scheduled_events.course_start_date%type,
1191: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1192: begin
1193: return learner_can_enroll(p_delegate_id, null, p_event_id, p_event_start_date, p_parent_offering_id);
1187: function chk_delegate_ok_for_event(
1188: p_delegate_id in per_people_f.person_id%type,
1189: p_event_id in ota_events.event_id%type,
1190: p_event_start_date in otv_scheduled_events.course_start_date%type,
1191: p_parent_offering_id in ota_events.parent_offering_id%type default null) return varchar2 is
1192: begin
1193: return learner_can_enroll(p_delegate_id, null, p_event_id, p_event_start_date, p_parent_offering_id);
1194: end chk_delegate_ok_for_event;
1195: