DBA Data[Home] [Help]

PACKAGE BODY: APPS.ODP

Source


1 PACKAGE BODY ODP AS
2 /* $Header: msddsplb.pls 115.12 2002/05/21 10:13:04 pkm ship     $ */
3 
4 procedure display_plans is
5 
6 n_session_id            number;
7 n_responsibility_id     number;
8 n_function_id           number;
9 n_application_id        number;
10 v_language              varchar2(240);
11 v_url                   varchar2(2000);
12 n_web_user              number;
13 b_plans_found           boolean;
14 v_mod_shared_path       MSD_DEMAND_PLANS_V.SHARED_DB_LOCATION%TYPE;
15 v_odp_resp              varchar2(2) NOT NULL := 'NA';
16 v_browser               varchar2(80);
17 v_prompt_tab            icx_util.g_prompts_table;
18 v_title                 varchar2(80);
19 v_no_plans              varchar2(80);
20 v_prompt                varchar2(80);
21 v_start                 varchar2(80);
22 v_function_name         varchar2(30);
23 
24 v_appl_id               number := 601;  -- Application must be Oracle Common Modules-AK for translation
25 v_page_code             varchar2(30) := 'MSD_DISPLAY_PLANS';
26 v_init_prg              varchar2(80) := 'dp.init.sso';
27 v_odpcode_db            varchar2(80) := 'ODPCODE';
28 v_sep                   varchar2(1)  := '/';
29 v_pth_sep               varchar2(3)  := '%2f';
30 v_id_nm                 varchar2(3)  := 'ID=';
31 v_func_id_nm            varchar2(4)  := 'IDF=';
32 v_shr_nm                varchar2(4)  := 'SHR=';
33 v_shrpth_nm             varchar2(9)  := 'SHR_PATH=';
34 
35 v_help_html             varchar2(150); -- 06/07/00
36 
37 b_profile_defined       boolean;
38 v_access_profile_nm     varchar2(80) := 'ICX_ACCESSIBILITY_FEATURES';
39 v_jaws_spt              varchar2(13) := 'JAWS_SUPPORT=';
40 v_jaws_spt_val          varchar2(3);
41 
42 cursor c_demand_plans is
43    select DEMAND_PLAN_ID, DEMAND_PLAN_NAME,
44    EXPRESS_MACHINE_PORT, OWA_VIRTUAL_PATH_NAME,
45    EAD_NAME, SHARED_DB_LOCATION, SHARED_DB_PREFIX
46    from msd_demand_plans_v
47    where demand_plan_id in
48    (select demand_plan_id from msd_dp_users_v
49      where user_id = n_web_user and
50      responsibility_id = n_responsibility_id)
51    order by demand_plan_name;
52 
53 begin
54 
55  if (icx_sec.validateSession()) then
56    n_session_id := icx_sec.getID(icx_sec.PV_SESSION_ID);
57    v_language := icx_sec.getID(icx_sec.PV_LANGUAGE_CODE);
58    n_web_user := icx_sec.getID(icx_sec.PV_WEB_USER_ID);
59    n_responsibility_id := icx_sec.getID(icx_sec.PV_RESPONSIBILITY_ID);
60    n_function_id := icx_sec.getID(icx_sec.PV_FUNCTION_ID);
61 
62    select APPLICATION_ID
63      into n_application_id
64      from FND_RESPONSIBILITY
65      where RESPONSIBILITY_ID = n_responsibility_id;
66 
67    select FUNCTION_NAME
68      into v_function_name
69      from FND_FORM_FUNCTIONS
70      where FUNCTION_ID = n_function_id;
71 
72    fnd_profile.get_specific(
73              name_z               => v_access_profile_nm,
74              user_id_z            => n_web_user,
75              responsibility_id_z  => n_responsibility_id,
76              application_id_z     => n_application_id,
77              val_z                => v_jaws_spt_val,
78              defined_z            => b_profile_defined);
79 
80    if( NOT b_profile_defined OR v_jaws_spt_val = '' OR v_jaws_spt_val = 'N')
81      then
82         v_jaws_spt_val := 'No';
83      else
84         v_jaws_spt_val := 'Yes';
85      end if;
86 
87    htp.htmlOpen;
88    -- show copyright in source
89    icx_util.copyright;
90    htp.headOpen;
91 
92    icx_util.getPrompts(v_appl_id, v_page_code, v_title, v_prompt_tab);
93    v_prompt := v_prompt_tab(1);
94    v_start := v_prompt_tab(2);
95    v_no_plans := v_prompt_tab(3);
96    htp.title(v_title);
97 
98    htp.p('<SCRIPT LANGUAGE="JavaScript">');
99    htp.p('<!-- hide from old browsers');
100    htp.p('var destHREF="NULL"');
101 
102    -- wsn 06/07/00 add help function
103    icx_admin_sig.help_win_script('ICXPHP', null, 'FND');
104 
105    htp.p('function BldUrl(_val)
106           {
107           var _browser_name=navigator.appName;
108           var _browser_ver=navigator.appVersion.substring(0,3);
109           var _screen_height=screen.availHeight - 50;
110           var _screen_width=screen.availWidth - 15;
111           if (_browser_name==''Netscape'')
112             var _intl_lang=navigator.languager;
113           else
114             var _intl_lang=navigator.browserLanguager;
115 	      destHREF=_val+"BRWS="+_browser_name+"/BRWS_VER="+_browser_ver+"/LANG="+_intl_lang+"/SCR_HT="+_screen_height+"/SCR_WD="+_screen_width
116           winParms="height="+_screen_height+",width="+_screen_width+",toolbar=no,status=yes,location=no,menubar=no,resizable=yes,scrollbars=yes,top=0,left=0,screenX=0,screenY=0"
117           }');
118    htp.p('function SubmitHandler()
119           {
120           if (destHREF!="NULL")
121           {
122             destHREF = destHREF + "/DUMMY="+Math.random();
123             window.open(destHREF,"ODPwindow",winParms);
124           }
125           else
126           {
127             alert("Select a demand plan.")
128           }
129           }');
130    htp.p('// done hiding -->');
131    htp.p('</SCRIPT>');
132    htp.headClose;
133 
134    htp.bodyOpen( cattributes => 'BGCOLOR=white');
135    -- display logo and toolbar
136    icx_admin_sig.toolbar(v_language);
137    htp.header(3, v_prompt);
138    htp.para;
139 
140    htp.formOpen(curl => '');
141    b_plans_found := false;
142    for v_plan in c_demand_plans loop
143 
144       select REPLACE(v_plan.SHARED_DB_LOCATION, v_sep, v_pth_sep)
145         into v_mod_shared_path from DUAL;
146 
147       v_url := 'http:' || v_sep || v_sep ||
148                v_plan.EXPRESS_MACHINE_PORT || v_sep ||
149                v_plan.OWA_VIRTUAL_PATH_NAME
150                || v_sep || v_plan.EAD_NAME || '/db' ||
151                v_odpcode_db || v_sep || v_init_prg
152                || '?' ||
153                v_func_id_nm || v_function_name || v_sep ||
154                v_id_nm || v_plan.DEMAND_PLAN_ID || v_sep ||
155                v_shr_nm || v_plan.SHARED_DB_PREFIX || v_sep ||
156                v_shrpth_nm || v_mod_shared_path || v_sep ||
157                v_jaws_spt || v_jaws_spt_val || v_sep;
158 
159       htp.p('<INPUT TYPE="RADIO" NAME="PlanSelect" VALUE="' ||
160             v_url || '" onCLick="BldUrl(this.value)"> ' ||
161             v_plan.DEMAND_PLAN_NAME);
162       htp.nl;
163 
164       b_plans_found := true;
165    end loop;
166 
167    if (b_plans_found) then
168       htp.para;
169       htp.p('<INPUT TYPE="BUTTON" NAME="Start" VALUE="' || v_start || '" onClick="SubmitHandler()">');
170    else
171       htp.para;
172       htp.print(v_no_plans);
173       htp.para;
174    end if;
175 
176    htp.formClose;
177    htp.bodyClose;
178    htp.htmlClose;
179  end if;
180 
181 end display_plans;
182 
183 end odp;