DBA Data[Home] [Help]

PACKAGE BODY: APPS.GMS_INSTALL

Source


1 package body  GMS_INSTALL as
2 -- $Header: GMSINSTB.pls 120.6 2006/07/30 20:19:08 spunathi noship $
3 
4 
5 -- ------------------------------------------------------------------+
6 -- --------------------- MOAC CHANGES START -------------------------+
7 -- ------------------------------------------------------------------+
8 -- Function ENABLED and ENABLED(x_org_id number) rewritten on
9 -- Jul-22-05 .. K.Biju
10 -- ------------------------------------------------------------------+
11 FUNCTION ENABLED return boolean
12 is
13  l_org_id NUMBER;
14 
15 Begin
16 
17      l_org_id :=    PA_MOAC_UTILS.get_current_org_id ;
18 
19 
20      -- GMS responsibility
21      -- PO/AP etc ..
22      RETURN enabled(l_org_id);
23 
24 end ENABLED;
25 
26 -- -----------------------------------------------------------+
27 FUNCTION ENABLED(x_org_id number) return boolean
28 is
29   l_dummy number;
30 begin
31 
32   If x_org_id is NULL then
33 
34      select 1 into l_dummy
35      from dual where exists
36         (select 1
37          from gms_implementations
38          where enabled = 'Y');
39 
40   Else
41 
42      select 1 into l_dummy
43      from dual where exists
44         (select 1
45          from gms_implementations
46          where org_id = x_org_id
47          and   enabled = 'Y');
48 
49   End If;
50 
51       Return TRUE;
52 Exception
53  When no_data_found then
54       Return FALSE;
55 end ENABLED;
56 
57 -- Following procedure and function called from GMS.pld
58 -- ------------------------------------------------------------------+
59 -- This procedure will build the pl/sql table containing orgs where
60 -- grants is implemented ..
61 -- ------------------------------------------------------------------+
62 PROCEDURE SET_ORG_ARRAY
63 IS
64 BEGIN
65   -- Build a pl/sql table for the GMS implemented org ..
66   select org_id
67   BULK COLLECT into t_org_id
68   from  gms_implementations;
69 
70 END SET_ORG_ARRAY;
71 
72 -- -----------------------------------------------------------------------+
73 -- This procedure will be called from gms.style and gms.event for AP/PO ..
74 -- -----------------------------------------------------------------------+
75 FUNCTION GMS_ENABLED_MOAC(p_org_id IN NUMBER) RETURN BOOLEAN
76 IS
77   l_dummy number(1);
78 BEGIN
79       for x in 1..t_org_id.COUNT
80       loop
81         If p_org_id = t_org_id(x) then
82            l_dummy := 1;
83            EXIT;
84         End If;
85       end loop;
86 
87       If l_dummy =1 then
88          RETURN TRUE;
89       Else
90          RETURN FALSE;
91       End If;
92 
93 END GMS_ENABLED_MOAC;
94 
95 -- -----------------------------------------------------------------------+
96 -- Function is_sponsored_project returns:
97 --     'Y' if project is sponsored
98 --     'N' if the project is non sponsored.
99 --  Called from GMS.pld
100 -- -----------------------------------------------------------------------+
101  FUNCTION IS_SPONSORED_PROJECT ( p_project_id NUMBER )
102  RETURN VARCHAR2 is
103  BEGIN
104 
105   If p_project_id is NULL then
106      g_sponsored_flag := 'N';
107      RETURN g_sponsored_flag;
108   End if;
109 
110   If (g_project_id is not null and
111       g_project_id = p_project_id)
112   then
113      null;
114   Else
115 
116    g_sponsored_flag := 'N';
117    g_project_id     := p_project_id;
118 
119    select 'Y'
120    into   g_sponsored_flag
121    from   pa_projects_all pp,
122           pa_project_types_all pt
123    where  pp.project_id = p_project_id
124    and    pp.project_type = pt.project_type
125    and    pp.org_id = pt.org_id
126    and    nvl(pt.sponsored_flag,'N') = 'Y';
127 
128   End If;
129 
130    RETURN g_sponsored_flag;
131 
132  EXCEPTION
133     When no_data_found then
134 	RETURN g_sponsored_flag;
135 
136  END IS_SPONSORED_PROJECT ;
137 
138 -- ------------------------------------------------------------------+
139 -- --------------------- MOAC CHANGES START -------------------------+
140 -- ------------------------------------------------------------------+
141 
142 	function SITE_ENABLED return boolean
143 	is
144  		x_temp     varchar2(1) ;
145 	begin
146 -- Bug 2254944 (CODING STANDARD VIOLATIONS TO BE FIXED) - replaced rownum with exists
147     		--select 'X'
148 	  	--into x_temp
149 	  	select 'X' into x_temp from dual where exists (
150 	  	select 1
151 	  	from gms_implementations_all );
152 	  	--where rownum < 2 ;
153 
154 		return TRUE;
155 
156 	EXCEPTION
157   		WHEN TOO_MANY_ROWS THEN
158 	 		return TRUE ;
159   		WHEN OTHERS THEN
160 	 		return FALSE ;
161 	end SITE_ENABLED;
162 
163 -------------------------------------------------------------+
164 	function FAB_ENABLED return boolean
165 	is
166 	begin
167 		RETURN FALSE;
168 
169 	end FAB_ENABLED;
170 
171 -------------------------------------------------------------+
172 	function FAB_ENABLED(x_org_id NUMBER) return boolean
173 	is
174 	begin
175 		RETURN FALSE;
176 
177 	end FAB_ENABLED;
178 
179 -------------------------------------------------------------+
180 
181 end GMS_INSTALL;