284: fetch csr_get_person_type_id into l_person_type_id;
285: close csr_get_person_type_id;
286: --
287: if l_person_type_id is null then
288: fnd_message.set_name('PER','IRC_412156_PERS_TYPE_NOT_SET');
289: fnd_message.raise_error;
290: end if;
291: --
292: -- get the PTU person type for iRecruitment Candidate
285: close csr_get_person_type_id;
286: --
287: if l_person_type_id is null then
288: fnd_message.set_name('PER','IRC_412156_PERS_TYPE_NOT_SET');
289: fnd_message.raise_error;
290: end if;
291: --
292: -- get the PTU person type for iRecruitment Candidate
293: --
299: --
300: if (l_legislation_code = 'JP') then
301: if (l_last_name_phonetic is null) then
302: l_last_name_phonetic :=
303: fnd_message.get_string('PER','IRC_412108_UNKNOWN_NAME');
304: end if;
305: hr_contact_api.create_person
306: (p_validate => p_validate
307: ,p_start_date => l_start_date
1003: --
1004: l_business_group_id := fnd_profile.value('IRC_REGISTRATION_BG_ID');
1005: --
1006: if l_business_group_id is null then
1007: fnd_message.set_name('PER','IRC_412155_REG_BG_NOT_SET');
1008: fnd_message.raise_error;
1009: end if;
1010: --
1011: hr_utility.set_location(l_proc, 30);
1004: l_business_group_id := fnd_profile.value('IRC_REGISTRATION_BG_ID');
1005: --
1006: if l_business_group_id is null then
1007: fnd_message.set_name('PER','IRC_412155_REG_BG_NOT_SET');
1008: fnd_message.raise_error;
1009: end if;
1010: --
1011: hr_utility.set_location(l_proc, 30);
1012: --
1519: --
1520: if (l_legislation_code = 'JP') then
1521: if (l_last_name_phonetic is null) then
1522: l_last_name_phonetic :=
1523: fnd_message.get_string('PER','IRC_412108_UNKNOWN_NAME');
1524: end if;
1525: hr_person_api.update_person
1526: (p_validate => false
1527: ,p_effective_date => l_effective_date
1971: if ( l_application_count_limit is not null ) then
1972: open csr_application_count(p_vacancy_id, p_effective_date);
1973: fetch csr_application_count into l_application_count;
1974: if ( l_application_count >= l_application_count_limit ) then
1975: fnd_message.set_name('PER','IRC_MAX_APPLICATIONS_LIMIT');
1976: hr_multi_message.add();
1977: hr_multi_message.end_validation_set();
1978: end if;
1979: close csr_application_count;
2262: if ( csr_person_id%notfound and csr_person_all_dates%found ) then
2263: --
2264: close csr_person_id;
2265: close csr_person_all_dates;
2266: fnd_message.set_name('PER','IRC_412099_CANNOT_APPLY');
2267: hr_multi_message.add();
2268: end if;
2269: close csr_person_all_dates;
2270: --
2745: begin
2746: hr_utility.set_location(' Entering: '||l_proc, 10);
2747: --
2748: -- Create Person
2749: l_default_last_name := nvl(p_last_name,fnd_message.get_string('PER','IRC_412108_UNKNOWN_NAME'));
2750:
2751: irc_party_api.create_registered_user
2752: (p_last_name => l_default_last_name
2753: ,p_first_name => p_first_name
3035: l_password_check := fnd_web_sec.validate_password(username => p_user_name
3036: ,password => p_password);
3037:
3038: if (l_password_check = 'N') then
3039: fnd_message.raise_error;
3040: end if;
3041: --
3042: -- create party and user
3043: --
3209: return guestFndPwd;
3210: --
3211: exception
3212: when others then
3213: fnd_message.set_encoded('MRP'||fnd_global.local_chr(0)||
3214: 'GEN-INVALID PROFILE'||fnd_global.local_chr(0)||
3215: 'N'||fnd_global.local_chr(0)||
3216: 'PROFILE'||fnd_global.local_chr(0)||
3217: 'GUEST_USER_PWD'||fnd_global.local_chr(0)||
3575: hr_utility.set_location(l_proc,23);
3576: l_num := TestUserName(p_user_name=>upper(p_current_email_address));
3577: if l_num <> 0 then
3578: -- the e-mail address is already in use. Raise an error
3579: fnd_message.set_name('PER','IRC_EXEMP_EMAIL_IN_USE');
3580: fnd_message.raise_error;
3581: end if;
3582: else
3583: hr_utility.set_location(l_proc,26);
3576: l_num := TestUserName(p_user_name=>upper(p_current_email_address));
3577: if l_num <> 0 then
3578: -- the e-mail address is already in use. Raise an error
3579: fnd_message.set_name('PER','IRC_EXEMP_EMAIL_IN_USE');
3580: fnd_message.raise_error;
3581: end if;
3582: else
3583: hr_utility.set_location(l_proc,26);
3584: -- check if the user account is already associated to a person
3585: open user_association_exists(p_user_name);
3586: fetch user_association_exists into l_dummy;
3587: if user_association_exists%found then
3588: close user_association_exists;
3589: fnd_message.set_name('PER','IRC_EXEMP_PERSON_LINK_EXISTS');
3590: fnd_message.raise_error;
3591: else
3592: close user_association_exists;
3593: end if;
3586: fetch user_association_exists into l_dummy;
3587: if user_association_exists%found then
3588: close user_association_exists;
3589: fnd_message.set_name('PER','IRC_EXEMP_PERSON_LINK_EXISTS');
3590: fnd_message.raise_error;
3591: else
3592: close user_association_exists;
3593: end if;
3594: end if;
3598: fetch get_prev_emp into l_party_id,l_count;
3599: if get_prev_emp%notfound then
3600: -- we have not found a match at all, so error out
3601: close get_prev_emp;
3602: fnd_message.set_name('PER','IRC_EXEMP_NO_RECORD_FOUND');
3603: fnd_message.raise_error;
3604: end if;
3605: hr_utility.set_location(l_proc,40);
3606:
3599: if get_prev_emp%notfound then
3600: -- we have not found a match at all, so error out
3601: close get_prev_emp;
3602: fnd_message.set_name('PER','IRC_EXEMP_NO_RECORD_FOUND');
3603: fnd_message.raise_error;
3604: end if;
3605: hr_utility.set_location(l_proc,40);
3606:
3607: fetch get_prev_emp into l_party_id2,l_count2;
3607: fetch get_prev_emp into l_party_id2,l_count2;
3608: if get_prev_emp%found then
3609: -- we have found more than one match, so error out
3610: close get_prev_emp;
3611: fnd_message.set_name('PER','IRC_EXEMP_MANY_RECORDS_FOUND');
3612: fnd_message.raise_error;
3613: end if;
3614: close get_prev_emp;
3615: hr_utility.set_location(l_proc,50);
3608: if get_prev_emp%found then
3609: -- we have found more than one match, so error out
3610: close get_prev_emp;
3611: fnd_message.set_name('PER','IRC_EXEMP_MANY_RECORDS_FOUND');
3612: fnd_message.raise_error;
3613: end if;
3614: close get_prev_emp;
3615: hr_utility.set_location(l_proc,50);
3616:
3619: fetch current_emp into l_dummy;
3620: if current_emp%found then
3621: close current_emp;
3622: -- the person is a current employee, so error
3623: fnd_message.set_name('PER','IRC_EXEMP_CURRENT_EMP');
3624: fnd_message.raise_error;
3625: end if;
3626: close current_emp;
3627: hr_utility.set_location(l_proc,60);
3620: if current_emp%found then
3621: close current_emp;
3622: -- the person is a current employee, so error
3623: fnd_message.set_name('PER','IRC_EXEMP_CURRENT_EMP');
3624: fnd_message.raise_error;
3625: end if;
3626: close current_emp;
3627: hr_utility.set_location(l_proc,60);
3628:
3925: , fnd_profile.value('IRC_WORKFLOW_ITEM_TYPE')
3926: , 'IRC_TEXT_HTML_MSG'
3927: );
3928: --
3929: fnd_message.set_name('PER','IRC_EXEMP_SUBJECT');
3930: l_subject:=fnd_message.get;
3931: wf_notification.setAttrText ( l_nid , 'SUBJECT' , l_subject);
3932:
3933: if p_user_name is null then
3926: , 'IRC_TEXT_HTML_MSG'
3927: );
3928: --
3929: fnd_message.set_name('PER','IRC_EXEMP_SUBJECT');
3930: l_subject:=fnd_message.get;
3931: wf_notification.setAttrText ( l_nid , 'SUBJECT' , l_subject);
3932:
3933: if p_user_name is null then
3934: fnd_message.set_name('PER','IRC_EXEMP_HTML');
3930: l_subject:=fnd_message.get;
3931: wf_notification.setAttrText ( l_nid , 'SUBJECT' , l_subject);
3932:
3933: if p_user_name is null then
3934: fnd_message.set_name('PER','IRC_EXEMP_HTML');
3935: else
3936: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_HTML');
3937: end if;
3938: l_html_body:=fnd_message.get;
3932:
3933: if p_user_name is null then
3934: fnd_message.set_name('PER','IRC_EXEMP_HTML');
3935: else
3936: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_HTML');
3937: end if;
3938: l_html_body:=fnd_message.get;
3939: if p_user_name is null then
3940: fnd_message.set_name('PER','IRC_EXEMP_HTML');
3934: fnd_message.set_name('PER','IRC_EXEMP_HTML');
3935: else
3936: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_HTML');
3937: end if;
3938: l_html_body:=fnd_message.get;
3939: if p_user_name is null then
3940: fnd_message.set_name('PER','IRC_EXEMP_HTML');
3941: else
3942: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_HTML');
3936: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_HTML');
3937: end if;
3938: l_html_body:=fnd_message.get;
3939: if p_user_name is null then
3940: fnd_message.set_name('PER','IRC_EXEMP_HTML');
3941: else
3942: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_HTML');
3943: end if;
3944: if (instrb(l_html_body,'&'||'PASSWORD')>0) then
3938: l_html_body:=fnd_message.get;
3939: if p_user_name is null then
3940: fnd_message.set_name('PER','IRC_EXEMP_HTML');
3941: else
3942: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_HTML');
3943: end if;
3944: if (instrb(l_html_body,'&'||'PASSWORD')>0) then
3945: fnd_message.set_token('PASSWORD', l_password);
3946: end if;
3941: else
3942: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_HTML');
3943: end if;
3944: if (instrb(l_html_body,'&'||'PASSWORD')>0) then
3945: fnd_message.set_token('PASSWORD', l_password);
3946: end if;
3947: if (instrb(l_html_body,'&'||'FIRST_NAME')>0) then
3948: fnd_message.set_token('FIRST_NAME', p_first_name);
3949: end if;
3944: if (instrb(l_html_body,'&'||'PASSWORD')>0) then
3945: fnd_message.set_token('PASSWORD', l_password);
3946: end if;
3947: if (instrb(l_html_body,'&'||'FIRST_NAME')>0) then
3948: fnd_message.set_token('FIRST_NAME', p_first_name);
3949: end if;
3950: if (instrb(l_html_body,'&'||'LAST_NAME')>0) then
3951: fnd_message.set_token('LAST_NAME', p_last_name);
3952: end if;
3947: if (instrb(l_html_body,'&'||'FIRST_NAME')>0) then
3948: fnd_message.set_token('FIRST_NAME', p_first_name);
3949: end if;
3950: if (instrb(l_html_body,'&'||'LAST_NAME')>0) then
3951: fnd_message.set_token('LAST_NAME', p_last_name);
3952: end if;
3953: if (instrb(l_html_body,'&'||'EMAIL')>0) then
3954: fnd_message.set_token('EMAIL', p_current_email_address);
3955: end if;
3950: if (instrb(l_html_body,'&'||'LAST_NAME')>0) then
3951: fnd_message.set_token('LAST_NAME', p_last_name);
3952: end if;
3953: if (instrb(l_html_body,'&'||'EMAIL')>0) then
3954: fnd_message.set_token('EMAIL', p_current_email_address);
3955: end if;
3956: if (instrb(l_html_body,'&'||'USER_NAME')>0) then
3957: fnd_message.set_token('USER_NAME', p_user_name);
3958: end if;
3953: if (instrb(l_html_body,'&'||'EMAIL')>0) then
3954: fnd_message.set_token('EMAIL', p_current_email_address);
3955: end if;
3956: if (instrb(l_html_body,'&'||'USER_NAME')>0) then
3957: fnd_message.set_token('USER_NAME', p_user_name);
3958: end if;
3959: l_html_body:=fnd_message.get;
3960: irc_notification_helper_pkg.set_v2_attributes
3961: (p_wf_attribute_value => l_html_body
3955: end if;
3956: if (instrb(l_html_body,'&'||'USER_NAME')>0) then
3957: fnd_message.set_token('USER_NAME', p_user_name);
3958: end if;
3959: l_html_body:=fnd_message.get;
3960: irc_notification_helper_pkg.set_v2_attributes
3961: (p_wf_attribute_value => l_html_body
3962: ,p_wf_attribute_name => 'HTML_BODY'
3963: ,p_nid => l_nid);
3962: ,p_wf_attribute_name => 'HTML_BODY'
3963: ,p_nid => l_nid);
3964:
3965: if p_user_name is null then
3966: fnd_message.set_name('PER','IRC_EXEMP_TEXT');
3967: else
3968: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_TEXT');
3969: end if;
3970: l_text_body:=fnd_message.get;
3964:
3965: if p_user_name is null then
3966: fnd_message.set_name('PER','IRC_EXEMP_TEXT');
3967: else
3968: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_TEXT');
3969: end if;
3970: l_text_body:=fnd_message.get;
3971: if p_user_name is null then
3972: fnd_message.set_name('PER','IRC_EXEMP_TEXT');
3966: fnd_message.set_name('PER','IRC_EXEMP_TEXT');
3967: else
3968: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_TEXT');
3969: end if;
3970: l_text_body:=fnd_message.get;
3971: if p_user_name is null then
3972: fnd_message.set_name('PER','IRC_EXEMP_TEXT');
3973: else
3974: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_TEXT');
3968: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_TEXT');
3969: end if;
3970: l_text_body:=fnd_message.get;
3971: if p_user_name is null then
3972: fnd_message.set_name('PER','IRC_EXEMP_TEXT');
3973: else
3974: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_TEXT');
3975: end if;
3976: if (instrb(l_text_body,'&'||'PASSWORD')>0) then
3970: l_text_body:=fnd_message.get;
3971: if p_user_name is null then
3972: fnd_message.set_name('PER','IRC_EXEMP_TEXT');
3973: else
3974: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_TEXT');
3975: end if;
3976: if (instrb(l_text_body,'&'||'PASSWORD')>0) then
3977: fnd_message.set_token('PASSWORD', l_password);
3978: end if;
3973: else
3974: fnd_message.set_name('PER','IRC_EXEMP_REGISTERED_TEXT');
3975: end if;
3976: if (instrb(l_text_body,'&'||'PASSWORD')>0) then
3977: fnd_message.set_token('PASSWORD', l_password);
3978: end if;
3979: if (instrb(l_text_body,'&'||'FIRST_NAME')>0) then
3980: fnd_message.set_token('FIRST_NAME', p_first_name);
3981: end if;
3976: if (instrb(l_text_body,'&'||'PASSWORD')>0) then
3977: fnd_message.set_token('PASSWORD', l_password);
3978: end if;
3979: if (instrb(l_text_body,'&'||'FIRST_NAME')>0) then
3980: fnd_message.set_token('FIRST_NAME', p_first_name);
3981: end if;
3982: if (instrb(l_text_body,'&'||'LAST_NAME')>0) then
3983: fnd_message.set_token('LAST_NAME', p_last_name);
3984: end if;
3979: if (instrb(l_text_body,'&'||'FIRST_NAME')>0) then
3980: fnd_message.set_token('FIRST_NAME', p_first_name);
3981: end if;
3982: if (instrb(l_text_body,'&'||'LAST_NAME')>0) then
3983: fnd_message.set_token('LAST_NAME', p_last_name);
3984: end if;
3985: if (instrb(l_text_body,'&'||'EMAIL')>0) then
3986: fnd_message.set_token('EMAIL', p_current_email_address);
3987: end if;
3982: if (instrb(l_text_body,'&'||'LAST_NAME')>0) then
3983: fnd_message.set_token('LAST_NAME', p_last_name);
3984: end if;
3985: if (instrb(l_text_body,'&'||'EMAIL')>0) then
3986: fnd_message.set_token('EMAIL', p_current_email_address);
3987: end if;
3988: if (instrb(l_text_body,'&'||'USER_NAME')>0) then
3989: fnd_message.set_token('USER_NAME', p_user_name);
3990: end if;
3985: if (instrb(l_text_body,'&'||'EMAIL')>0) then
3986: fnd_message.set_token('EMAIL', p_current_email_address);
3987: end if;
3988: if (instrb(l_text_body,'&'||'USER_NAME')>0) then
3989: fnd_message.set_token('USER_NAME', p_user_name);
3990: end if;
3991: l_text_body:=fnd_message.get;
3992: irc_notification_helper_pkg.set_v2_attributes
3993: (p_wf_attribute_value => l_text_body
3987: end if;
3988: if (instrb(l_text_body,'&'||'USER_NAME')>0) then
3989: fnd_message.set_token('USER_NAME', p_user_name);
3990: end if;
3991: l_text_body:=fnd_message.get;
3992: irc_notification_helper_pkg.set_v2_attributes
3993: (p_wf_attribute_value => l_text_body
3994: ,p_wf_attribute_name => 'TEXT_BODY'
3995: ,p_nid => l_nid);
4213: -- we have to REVISIT after using UMX support for Registration
4214: if l_person_id is not null then
4215: l_per_type := irc_utilities_pkg.get_emp_spt_for_person(l_person_id, trunc(p_start_date));
4216: if (l_per_type = 'EMP') then
4217: fnd_message.set_name('PER','IRC_412224_EMP_PARTIAL_REG');
4218: fnd_message.raise_error;
4219: end if;
4220: end if;
4221: --
4214: if l_person_id is not null then
4215: l_per_type := irc_utilities_pkg.get_emp_spt_for_person(l_person_id, trunc(p_start_date));
4216: if (l_per_type = 'EMP') then
4217: fnd_message.set_name('PER','IRC_412224_EMP_PARTIAL_REG');
4218: fnd_message.raise_error;
4219: end if;
4220: end if;
4221: --
4222: hr_utility.set_location(l_proc, 40);
4223: -- there is no person attached to this FND_USER. We need to create a new
4224: -- iRecruitment Candidate, update FND user with the person_id,
4225: -- set Language profile and Create Work Preferences
4226: if l_person_id is NULL then
4227: l_default_last_name := nvl(p_last_name,fnd_message.get_string('PER','IRC_412108_UNKNOWN_NAME'));
4228:
4229: IRC_PARTY_API.CREATE_CANDIDATE_INTERNAL
4230: (p_business_group_id => p_reg_bg_id
4231: ,p_last_name => l_default_last_name
4730: p_responsibility_id, p_resp_appl_id, p_security_group_id);
4731: -- if the User doesn't have the responsibility, assign it.
4732: if NOT l_resp_exists then
4733: if (l_per_type = 'EMP') then
4734: fnd_message.set_name('PER','IRC_412224_EMP_PARTIAL_REG');
4735: fnd_message.raise_error;
4736: end if;
4737: --
4738: -- add the appropriate responsibility
4731: -- if the User doesn't have the responsibility, assign it.
4732: if NOT l_resp_exists then
4733: if (l_per_type = 'EMP') then
4734: fnd_message.set_name('PER','IRC_412224_EMP_PARTIAL_REG');
4735: fnd_message.raise_error;
4736: end if;
4737: --
4738: -- add the appropriate responsibility
4739: --
4988: begin
4989: hr_utility.set_location(' Entering: '||l_proc, 10);
4990: --
4991: -- Create Person
4992: l_default_last_name := nvl(p_last_name,fnd_message.get_string('PER','IRC_412108_UNKNOWN_NAME'));
4993:
4994: l_person_id := p_person_id;
4995: --
4996: hr_utility.set_location(l_proc,20);
5173: l_password_check := fnd_web_sec.validate_password(username => p_user_name
5174: ,password => p_password);
5175:
5176: if (l_password_check = 'N') then
5177: fnd_message.raise_error;
5178: end if;
5179: --
5180: -- create party and user
5181: --