1 PACKAGE BODY HR_WPM_UTIL AS
2 /* $Header: hrwpmutl.pkb 120.1 2008/01/17 11:44:59 arumukhe ship $*/
3
4 FUNCTION is_appraisal_started (p_plan_id IN per_perf_mgmt_plans.plan_id%TYPE)
5 RETURN varchar2
6 IS
7 cursor get_current_plan_appraisals(c_plan_id per_perf_mgmt_plans.plan_id%TYPE)
8 is
9 select distinct 'Y' as if_current
10 from per_appraisal_periods
11 where plan_id = c_plan_id
12 and trunc(sysdate) between nvl(task_start_date,sysdate) and nvl(task_end_date,sysdate);
13
14 result varchar2(1) default null;
15 BEGIN
16 open get_current_plan_appraisals(p_plan_id);
17 fetch get_current_plan_appraisals into result;
18 close get_current_plan_appraisals;
19
20 return result;
21 EXCEPTION
22 WHEN OTHERS THEN
23 RAISE;
24 END;
25 ------
26 -- Function to return the LOS icon enabled/disabled from view and track objective.
27 ------
28 FUNCTION is_los_enabled (p_obj_id IN per_objectives.objective_id%TYPE, p_align_id IN per_objectives.aligned_with_objective_id%TYPE)
29 RETURN varchar2
30 IS
31 l_up_hierarchy_enable varchar2(1);
32 l_down_hierarchy_enable varchar2(1);
33 result varchar2(1) default null;
34 BEGIN
35 l_up_hierarchy_enable := is_up_hierarchy_enabled(p_align_id);
36 l_down_hierarchy_enable := is_down_hierarchy_enabled(p_obj_id);
37
38 if(l_up_hierarchy_enable ='Y' or l_down_hierarchy_enable = 'Y' ) then
39 result := 'Y';
40 end if;
41
42 return result;
43 EXCEPTION
44 WHEN OTHERS THEN
45 RAISE;
46 END;
47 ------
48 -- Function to return if there is objective hierarchy DOWN the LOS
49 ------
50 FUNCTION is_down_hierarchy_enabled (p_obj_id IN per_objectives.objective_id%TYPE)
51 RETURN varchar2
52 IS
53 cursor get_objectives_down(c_obj_id IN per_objectives.objective_id%TYPE)
54 is
55 select distinct 'Y' as enabled
56 from per_objectives
57 where aligned_with_objective_id = c_obj_id;
58
59 result varchar2(1) default null;
60 BEGIN
61
62 open get_objectives_down(p_obj_id);
63 fetch get_objectives_down into result;
64 close get_objectives_down;
65
66 return result;
67 EXCEPTION
68 WHEN OTHERS THEN
69 RAISE;
70 END;
71
72 ------
73 -- Function to return if there is objective hierarchy UP the LOS
74 ------
75 FUNCTION is_up_hierarchy_enabled (p_align_id IN per_objectives.objective_id%TYPE)
76 RETURN varchar2
77 IS
78 cursor get_objectives_up(c_align_id IN per_objectives.aligned_with_objective_id%TYPE)
79 is
80 select distinct 'Y' as enabled
81 from per_objectives
82 where objective_id = c_align_id;
83
84 result varchar2(1) default null;
85 BEGIN
86
87 open get_objectives_up(p_align_id);
88 fetch get_objectives_up into result;
89 close get_objectives_up;
90
91 return result;
92 EXCEPTION
93 WHEN OTHERS THEN
94 RAISE;
95 END;
96
97
98 END HR_WPM_UTIL; -- Package spec
99