DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_SESSION_UTILITIES

Source


1 PACKAGE BODY HR_SESSION_UTILITIES AS
2 /* $Header: hrsessuw.pkb 120.1 2005/09/23 15:54:57 svittal noship $*/
3 -- ----------------------------------------------------------------------------
4 -- |--< VARIABLES >-----------------------------------------------------------|
5 -- ----------------------------------------------------------------------------
6 g_today 	DATE;
7 g_today_txt	VARCHAR2 (200);
8 g_today_set	BOOLEAN;
9 g_loggedin_user		per_people_f%ROWTYPE;
10 l_val_person_id	per_people_f.person_id%TYPE;
11 g_do_process		BOOLEAN;
12 --2721758
13 g_debug boolean := hr_utility.debug_enabled;
14 -- ----------------------------------------------------------------------------
15 -- |--< Get_LoggedIn_User >---------------------------------------------------|
16 -- ----------------------------------------------------------------------------
17 FUNCTION Get_LoggedIn_User
18 RETURN per_people_f%ROWTYPE
19 IS
20   l_person_id	per_people_f.person_id%TYPE;
21 --
22   l_proc	VARCHAR2 (72) ;
23 BEGIN
24 g_debug := hr_utility.debug_enabled;
25 
26 IF g_debug THEN
27   l_proc	:= g_package || ' Get_LoggedIn_User';
28   hr_utility.set_location('Entering : ' || l_proc, 5);
29 END IF;
30 
31 -- note validate session is only used to retrieve data here
32 -- not actually used to validate the session (done outside of the function)
33 --
34 -- changed to eliminate call to validate_session
35 -- icx_sec called directly
36 --
37   l_person_id := icx_sec.getID(n_param => 9);
38   RETURN hr_general_utilities.Get_Person_Record (p_person_id => l_person_id);
39 EXCEPTION
40   WHEN OTHERS THEN
41   RAISE ;
42 END Get_LoggedIn_User;
43 -- ----------------------------------------------------------------------------
44 -- |--< insert_session_row >--------------------------------------------------|
45 -- ----------------------------------------------------------------------------
46 -- name:
47 --   insert_session_row
48 -- description:
49 --   insert an fnd session row so that selects from date tracked
50 --   tables is successful.
51 -- requirement:
52 --   remember to use remove_session_row
53 --   when your select is complete.
54 --
55 -- updated for bug 1994945
56 -- ----------------------------------------------------------------------------
57 PROCEDURE insert_session_row
58             (p_effective_date in date)
59 IS
60 --
61   l_proc	VARCHAR2 (72) := g_package || 'insert_session_row';
62 BEGIN
63 g_debug := hr_utility.debug_enabled;
64 
65 IF g_debug THEN
66   hr_utility.set_location('Entering : ' || l_proc, 5);
67 END IF;
68 
69   --
70   dt_fndate.set_effective_date(trunc(p_effective_date));
71   --
72 
73 IF g_debug THEN
74   hr_utility.set_location('Leaving : ' || l_proc, 10);
75 END IF;
76 
77 EXCEPTION
78   WHEN OTHERS THEN
79     hr_utility.set_message
80       ( hr_session_utilities.g_PER_application_id
81       , 'HR_6153_ALL_PROCEDURE_FAIL'
82       );
83     hr_utility.set_message_token('PROCEDURE', l_proc);
84     hr_utility.set_message_token('STEP', sqlerrm);
85     RAISE hr_session_utilities.g_fatal_error;
86 END insert_session_row;
87 -- ----------------------------------------------------------------------------
88 -- |--< insert_session_row >--------------------------------------------------|
89 -- ----------------------------------------------------------------------------
90 -- overloaded to accept an encrypted effective date
91 --
92 -- this always sets sysdate as the effective date
93 --
94 -- updated for bug 1994945
95 -- ----------------------------------------------------------------------------
96 PROCEDURE insert_session_row
97             (p_effective_date in varchar2)
98 IS
99 --
100   l_date       date;
101 --
102   l_proc	VARCHAR2 (72) := g_package || 'insert_session_row';
103 BEGIN
104 g_debug := hr_utility.debug_enabled;
105 
106 IF g_debug THEN
107   hr_utility.set_location('Entering : ' || l_proc, 5);
108 END IF;
109 
110   --
111   l_date := trunc(SYSDATE);
112   --
113   dt_fndate.set_effective_date(l_date);
114   --
115 
116 IF g_debug THEN
117   hr_utility.set_location('Leaving : ' || l_proc, 10);
118 END IF;
119 
120   --
121 EXCEPTION
122   WHEN OTHERS THEN
123     hr_utility.set_message
124       ( hr_session_utilities.g_PER_application_id
125       , 'HR_6153_ALL_PROCEDURE_FAIL'
126       );
127     hr_utility.set_message_token('PROCEDURE', l_proc);
128     hr_utility.set_message_token('STEP', sqlerrm);
129     RAISE hr_session_utilities.g_fatal_error;
130 END insert_session_row;
131 -- ----------------------------------------------------------------------------
132 -- |--< remove_session_row >--------------------------------------------------|
133 -- ----------------------------------------------------------------------------
134 -- name:
135 --   remove_session_row
136 -- description:
137 --   removes the fnd session row created by insert_session_row
138 -- ------------------------------------------------------------------------
139 PROCEDURE remove_session_row
140 IS
141   l_person_id  per_people_f.person_id%type;
142 --
143   l_proc	VARCHAR2 (72) := g_package || ' remove_session_row';
144 BEGIN
145 g_debug := hr_utility.debug_enabled;
146 
147 IF g_debug THEN
148   hr_utility.set_location('Entering : ' || l_proc, 5);
149 END IF;
150 
151   delete from fnd_sessions
152   where session_id = userenv('sessionid');
153 
154 IF g_debug THEN
155   hr_utility.set_location('Leaving : ' || l_proc, 10);
156 END IF;
157 
158 EXCEPTION
159   WHEN OTHERS THEN
160     hr_utility.set_message
161       ( hr_session_utilities.g_PER_application_id
162       , 'HR_6153_ALL_PROCEDURE_FAIL'
163       );
164     hr_utility.set_message_token('PROCEDURE', l_proc);
165     hr_utility.set_message_token('STEP', sqlerrm);
166     RAISE hr_session_utilities.g_fatal_error;
167 END remove_session_row;
168 -- ----------------------------------------------------------------------------
169 -- |--< Get_Installation_Status >---------------------------------------------|
170 -- ----------------------------------------------------------------------------
171 FUNCTION Get_Installation_Status (p_application_id IN NUMBER)
172 RETURN VARCHAR2
173 IS
174   l_hr_installation_status fnd_product_installations.status%TYPE;
175 -- Cursor to extract the status of the application installation
176   CURSOR csr_hr_installation_status(p_application_id number)
177   IS
178     select fpi.status
179     from   fnd_product_installations fpi
180     where  fpi.application_id = p_application_id;
181 --
182   l_proc	VARCHAR2 (72) := g_package || ' Get_Installation_Status';
183 BEGIN
184 
185 IF g_debug THEN
186   hr_utility.set_location('Entering : ' || l_proc, 5);
187 END IF;
188 
189   OPEN csr_hr_installation_status(p_application_id => p_application_id);
190   FETCH csr_hr_installation_status into l_hr_installation_status;
191   CLOSE csr_hr_installation_status;
192 --
193   RETURN l_hr_installation_status;
194 EXCEPTION
195   WHEN OTHERS THEN
196     hr_utility.set_message
197       ( hr_session_utilities.g_PER_application_id
198       , 'HR_6153_ALL_PROCEDURE_FAIL'
199       );
200     hr_utility.set_message_token('PROCEDURE', l_proc);
201     hr_utility.set_message_token('STEP', sqlerrm);
202     RAISE hr_session_utilities.g_fatal_error;
203 END Get_Installation_Status;
204 -- ----------------------------------------------------------------------------
205 -- |--< validate_session >----------------------------------------------------|
206 -- ----------------------------------------------------------------------------
207 -- VALIDATE SESSION, REVISED HERE, BUT ELIMINATED FROM PACKAGE HEADER
208 -- VALIDATE SESSION IN HR_UTIL_MISC_WEB USED INSTEAD
209 --
210 -- name:
211 --   validate_session (one out parameter, four in parameters)
212 -- description:
213 --   Calls the internet commerce's security procedure to check for a valid
214 --   'cookie' for this user.  Also calls their routine to return the person_id
215 --   based upon their web id.
216 --
217 -- 10/15/97
218 --   The default for calling icx_sec.validateSession is to update the count
219 --   and timestamp in icx_session table but do NOT commit to database.  The
220 --   reason being EDA modules are not allowed to have a commit while within
221 --   a workflow activity.
222 -- ------------------------------------------------------------------------
223 PROCEDURE validate_session
224    (p_person_id    out nocopy    number
225    ,p_check_ota    in     varchar2 default 'N'
226    ,p_check_ben    in     varchar2 default 'N'
227    ,p_icx_update   in     boolean  default true      -- 10/15/97 Changed
228    ,p_icx_commit   in     boolean  default false) IS -- 10/15/97 Changed
229 --
230   l_web_username  varchar2(80) default null;
231   l_person_id     per_people_f.person_id%type;
232   l_proc	VARCHAR2 (72) ;
233 BEGIN
234 
235 IF g_debug THEN
236   l_proc	:= g_package || ' validate_session';
237   hr_utility.set_location('Entering : ' || l_proc, 5);
238 END IF;
239 
240    hr_util_misc_web.validate_session
241               (p_person_id    => l_person_id
242               ,p_web_username => l_web_username
243               ,p_check_ota    => p_check_ota
244               ,p_check_ben    => p_check_ben
245               ,p_icx_update   => p_icx_update           -- 10/15/97 Changed
246               ,p_icx_commit   => p_icx_commit);         -- 10/15/97 Changed
247   p_person_id := l_person_id;
248 
249 IF g_debug THEN
250   hr_utility.set_location('Leaving : ' || l_proc, 5);
251 END IF;
252 
253 EXCEPTION
254   WHEN OTHERS THEN
255     RAISE;
256 -- capture errors as they are in the calling code
257 END validate_session;
258 -- ----------------------------------------------------------------------------
259 -- |--------------------------------< validate_session >----------------------|
260 -- ----------------------------------------------------------------------------
261 -- name:
262 --   validate_session (Two Out Parameters, four in parameters)
263 -- description:
264 --   Calls the internet commerce's security procedure to check for a valid
265 --  'cookie' for this user.  Also calls their routine to return the person_id
266 --   based upon their web id.
267 -- ------------------------------------------------------------------------
268 PROCEDURE validate_session
269    (p_person_id    out nocopy    number
270    ,p_web_username out nocopy    varchar2
271    ,p_check_ota    in     varchar2 default 'N'
272    ,p_check_ben    in     varchar2 default 'N'
273    ,p_icx_update   in     boolean  default true         -- 10/15/97 Changed
274    ,p_icx_commit   in     boolean  default false) IS    -- 10/15/97 Changed
275 --
276 
277   l_web_user_id   number;
278   l_web_username  varchar2(80) default null;
279 
280   l_cookie        		owa_cookie.cookie;
281   l_person_id     		per_people_f.person_id%type;
282   l_hr_installation_status 	fnd_product_installations.status%TYPE
283 				DEFAULT NULL;
284 --
285 --
286   l_proc	VARCHAR2 (72) ;
287 BEGIN
288 
289 IF g_debug THEN
290   l_proc	:= g_package || ' validate_session';
291   hr_utility.set_location('Entering : ' || l_proc, 5);
292 END IF;
293 
294 -- validate the session
295 -- ----------------------------------------------------------------------------
296 -- 10/15/97
297 -- The default for calling icx_sec.validateSession is to update the count and
298 -- timestamp in icx_session table but NOT to commit.  The reason is EDA
299 -- or any modules invoked by workflow cannot have a commit while the workflow
300 -- process is not completed.
301 -- ----------------------------------------------------------------------------
302   IF NOT(icx_sec.validateSession(c_update => p_icx_update        --10/15/97 Chg
303                                 ,c_commit => p_icx_commit)) then --10/15/97 Chg
304     RAISE g_fatal_error;
305   ELSE
306 
307 IF g_debug THEN
308     hr_utility.set_location(l_proc, 10);
309 END IF;
310 
311     --
312     -- ensure HR is fully installed, else raise error
313     --
314     IF NOT Get_Installation_Status (
315 		p_application_id => g_per_application_id) = 'I' THEN
316       fnd_message.set_name('PER', 'HR_7079_HR_NOT_INSTALLED');
317       RAISE g_fatal_error;
318     ELSE
319       NULL;
320     END IF;
321 -- ----------------------------------------------------------------------------
322     IF p_check_ota = 'Y' THEN
323       --
324       -- ensure OTA is fully installed, else raise error
325       --
326       IF NOT Get_Installation_Status (p_application_id => 810) = 'I' THEN
327         fnd_message.set_name('OTA', 'OTA_13629_WEB_OTA_NOT_INSTALL');
328         RAISE g_fatal_error;
329       ELSE
330         NULL;
331       END IF;
332     END IF;
333 --
334     IF p_check_ben = 'Y' THEN
335       --
336       -- ensure BEN is fully installed, else raise error
337       --
338       IF NOT Get_Installation_Status (p_application_id => 805) = 'I' THEN
339         fnd_message.set_name('BEN', 'BEN_CHANGE_ME');
340         RAISE g_fatal_error;
341       ELSE
342         NULL;
343       END IF;
344     END IF;
345 -- ----------------------------------------------------------------------------
346 
347 IF g_debug THEN
348     hr_utility.set_location(l_proc, 10);
349 END IF;
350 
351 --
352       -- getid with a parm of 10 returns the web user id.
353       -- we don't need this id in our code, but getid
354       -- also returns a -1 into the web user id if we are in
355       -- a psuedo session situation:  this we do need to know
356       -- so that we can manually get the person information when
357       -- there is a psuedo session.
358     l_web_user_id := icx_sec.getID(n_param => 10);
359 	--
360     -- determine if the web user is -1 (pseudo session)
361     IF l_web_user_id = -1 then
362 
363 IF g_debug THEN
364       hr_utility.set_location(l_proc, 20);
365 END IF;
366 
367       -- as we are in a pseudo session get the cookie record
368       -- for the cookie WF_SESSION
369       l_cookie := owa_cookie.get('WF_SESSION');
370       -- ensure the cookie exists
371       IF l_cookie.num_vals > 0 then
372         -- as the cookie does exist get the web username from
373         -- the workflow system
374         l_web_username := wf_notification.accesscheck
375                             (l_cookie.vals(l_cookie.num_vals));
376         --
377         -- getid with a parm of 9 returns the internal-contact-id,
378         l_person_id := icx_sec.getID(n_param => 9);
379         --
380       ELSE
381 
382 IF g_debug THEN
383         hr_utility.set_location(l_proc, 30);
384 END IF;
385 
386         -- the WF_SESSION cookie does not exist. a serious error
387         -- has ocurred which must be reported
388         --
389         fnd_message.set_name('PER','HR_51393_WEB_COOKIE_ERROR');
390 	RAISE g_fatal_error;
391       END IF;
392     ELSE
393 
394 IF g_debug THEN
395       hr_utility.set_location(l_proc, 40);
396 END IF;
397 
398 	  -- 11/14/96 the person_id is stored in security attribute values
399 	  -- associated with a web user.
400 	  --
401 	  -- 12/26/97 remove calls to getSecureAttributeValues, use getid.
402 	  -- getid with a parm of 9 returns the internal-contact-id,
403 	  -- which in our case is the person_id.
404       l_person_id := icx_sec.getID(n_param => 9);
405 	  --
406 	  -- getid with a parm of 99 returns the web user name.
407       l_web_username := icx_sec.getID(n_param => 99);
408     END IF;
409   END IF;
410   p_person_id    := l_person_id;
411   p_web_username := l_web_username;
412 --
413 
414 IF g_debug THEN
415   hr_utility.set_location('Leaving : ' || l_proc, 10);
416 END IF;
417 
418 EXCEPTION
419   -- too many rows will be returned if the csr_iwu returns more than
420   -- one person id for the web user.
421   WHEN TOO_MANY_ROWS then
422     fnd_message.set_name('PER','HR_51776_WEB_TOO_MANY_USERS');
423     RAISE;
424   WHEN g_fatal_error THEN
425     -- messages set, just re-raise
426     RAISE;
427   WHEN OTHERS THEN
428     -- can't find this message name so uses the given value instead
429     fnd_message.set_name('PER', sqlerrm|| ' '||sqlcode);
430     RAISE;
431 END validate_session;
432 -- ----------------------------------------------------------------------------
433 -- |--< get_language_code >---------------------------------------------------|
434 -- ----------------------------------------------------------------------------
435 -- name:
436 --   get_language_code
437 -- description:
438 --   This function returns the language code for the current session.
439 -- ----------------------------------------------------------------------------
440 FUNCTION get_language_code
441 RETURN VARCHAR2
442 IS
443 --
444 --
445   l_proc	VARCHAR2 (72) := g_package || ' get_language_code';
446 BEGIN
447 g_debug := hr_utility.debug_enabled;
448 
449 IF g_debug THEN
450   hr_utility.set_location('Entering : ' || l_proc, 5);
451 END IF;
452 
453   RETURN icx_sec.getID(icx_sec.PV_LANGUAGE_CODE);
454 EXCEPTION
455   WHEN OTHERS THEN
456     hr_utility.set_message
457       ( hr_session_utilities.g_PER_application_id
458       , 'HR_6153_ALL_PROCEDURE_FAIL'
459       );
460     hr_utility.set_message_token('PROCEDURE', l_proc);
461     hr_utility.set_message_token('STEP', sqlerrm);
462     RAISE hr_session_utilities.g_fatal_error;
463 END get_language_code;
464 -- ----------------------------------------------------------------------------
465 -- |--< get_image_directory >-------------------------------------------------|
466 -- ----------------------------------------------------------------------------
467 -- name:
468 --   get_image_directory
469 -- description:
470 --   Gets the image directory for the current session language.  Images are
471 --   stored by language code.
472 -- ----------------------------------------------------------------------------
473 FUNCTION get_image_directory
474 RETURN VARCHAR2
475 IS
476   l_proc	VARCHAR2 (72) := g_package || ' get_image_directory';
477 BEGIN
478 g_debug := hr_utility.debug_enabled;
479 
480 IF g_debug THEN
481   hr_utility.set_location('Entering : ' || l_proc, 5);
482 END IF;
483 
484   RETURN '/' || hr_session_utilities.g_image_dir || '/'
485          || get_language_code||'/';
486 EXCEPTION
487   WHEN OTHERS THEN
488     hr_utility.set_message
489       ( hr_session_utilities.g_PER_application_id
490       , 'HR_6153_ALL_PROCEDURE_FAIL'
491       );
492     hr_utility.set_message_token('PROCEDURE', l_proc);
493     hr_utility.set_message_token('STEP', sqlerrm);
494     RAISE hr_session_utilities.g_fatal_error;
495 END get_image_directory;
496 -- ----------------------------------------------------------------------------
497 -- |--< get_html_directory >--------------------------------------------------|
498 -- ----------------------------------------------------------------------------
499 -- name:
500 --   get_html_directory
501 -- description:
502 --   Gets the html directory for the current session language.
503 -- ----------------------------------------------------------------------------
504 FUNCTION get_html_directory
505 RETURN VARCHAR2
506 IS
507 --
508 --
509   l_proc	VARCHAR2 (72) := g_package || ' get_html_directory';
510 BEGIN
511 g_debug := hr_utility.debug_enabled;
512 
513 IF g_debug THEN
514   hr_utility.set_location('Entering : ' || l_proc, 5);
515 END IF;
516 
517 
518   RETURN
519     '/' || hr_session_utilities.g_html_dir || '/' || get_language_code||'/';
520 EXCEPTION
521   WHEN OTHERS THEN
522     hr_utility.set_message
523       ( hr_session_utilities.g_PER_application_id
524       , 'HR_6153_ALL_PROCEDURE_FAIL'
525       );
526     hr_utility.set_message_token('PROCEDURE', l_proc);
527     hr_utility.set_message_token('STEP', sqlerrm);
528     RAISE hr_session_utilities.g_fatal_error;
529 END get_html_directory;
530 -- ----------------------------------------------------------------------------
531 -- |--< get_static_html_directory >-------------------------------------------|
532 -- ----------------------------------------------------------------------------
533 -- name:
534 --   get_static_html_directory
535 -- description:
536 --   Gets the static html directory for the current session language.
537 -- ----------------------------------------------------------------------------
538 FUNCTION get_static_html_directory
539 RETURN VARCHAR2
540 IS
541 --
542 --
543   l_proc	VARCHAR2 (72) := g_package || ' get_static_html_directory';
544 BEGIN
545 g_debug := hr_utility.debug_enabled;
546 
547 IF g_debug THEN
548   hr_utility.set_location('Entering : ' || l_proc, 5);
549 END IF;
550 
551   RETURN
552     '/' ||
553     hr_session_utilities.g_static_html_dir ||'/';
554 EXCEPTION
555   WHEN OTHERS THEN
556     hr_utility.set_message
557       ( hr_session_utilities.g_PER_application_id
558       , 'HR_6153_ALL_PROCEDURE_FAIL'
559       );
560     hr_utility.set_message_token('PROCEDURE', l_proc);
561     hr_utility.set_message_token('STEP', sqlerrm);
562     RAISE hr_session_utilities.g_fatal_error;
563 END get_static_html_directory;
564 -- ----------------------------------------------------------------------------
565 -- |--< get_java_directory >--------------------------------------------------|
566 -- ----------------------------------------------------------------------------
567 -- name:
568 --   get_java_directory
569 -- description:
570 --   Gets the java directory for the current session language.
571 -- ----------------------------------------------------------------------------
572 FUNCTION get_java_directory
573 RETURN VARCHAR2
574 IS
575 --
576 --
577   l_proc	VARCHAR2 (72) := g_package || ' get_java_directory';
578 BEGIN
579 g_debug := hr_utility.debug_enabled;
580 
581 IF g_debug THEN
582   hr_utility.set_location('Entering : ' || l_proc, 5);
583 END IF;
584 
585   --
586   RETURN hr_session_utilities.g_java_dir || get_language_code||'/';
587 EXCEPTION
588   WHEN OTHERS THEN
589     hr_utility.set_message
590       ( hr_session_utilities.g_PER_application_id
591       , 'HR_6153_ALL_PROCEDURE_FAIL'
592       );
593     hr_utility.set_message_token('PROCEDURE', l_proc);
594     hr_utility.set_message_token('STEP', sqlerrm);
595     RAISE hr_session_utilities.g_fatal_error;
596 END get_java_directory;
597 -- ----------------------------------------------------------------------------
598 -- |--< get_user_date_format >------------------------------------------------|
599 -- ----------------------------------------------------------------------------
600 -- name:
601 --   get_user_date_format
602 --
603 -- description:
604 --   This function retrieves user's preference date format mask from
605 --   icx.
606 -- ----------------------------------------------------------------------------
607 FUNCTION get_user_date_format
608 RETURN VARCHAR2
609 IS
610 BEGIN
611 
612   return(hr_util_misc_web.get_user_date_format);
613 
614 END get_user_date_format;
615 -- ----------------------------------------------------------------------------
616 -- |--< Get_Base_HREF >-------------------------------------------------------|
617 -- ----------------------------------------------------------------------------
618 FUNCTION Get_Base_HREF
619 RETURN VARCHAR2
620 IS
621   l_owa	  	VARCHAR2 (1000);
622   l_proc	VARCHAR2 (72) := g_package || ' Get_Base_HREF';
623 BEGIN
624 g_debug := hr_utility.debug_enabled;
625 
626 IF g_debug THEN
627   hr_utility.set_location('Entering : ' || l_proc, 5);
628 END IF;
629 
630 -- Fix for bug 894682
631     l_owa := FND_WEB_CONFIG.PLSQL_AGENT;
632 
633 IF g_debug THEN
634   hr_utility.set_location('Leaving : ' || l_proc, 10);
635 END IF;
636 
637   RETURN l_owa;
638 EXCEPTION
639   WHEN OTHERS THEN
640     hr_utility.set_message
641       ( hr_session_utilities.g_PER_application_id
642       , 'HR_6153_ALL_PROCEDURE_FAIL'
643       );
644     hr_utility.set_message_token('PROCEDURE', l_proc);
645     hr_utility.set_message_token('STEP', sqlerrm);
646     RAISE hr_session_utilities.g_fatal_error;
647 END Get_Base_HREF;
648 -- ----------------------------------------------------------------------------
649 -- |--< Get_Today >-----------------------------------------------------------|
650 -- ----------------------------------------------------------------------------
651 FUNCTION Get_Today
652 RETURN DATE
653 IS
654 BEGIN
655 
656   RETURN g_today;
657 END Get_Today;
658 -- ----------------------------------------------------------------------------
659 -- |--< Get_Today_As_Text >---------------------------------------------------|
660 -- ----------------------------------------------------------------------------
661 FUNCTION Get_Today_As_Text
662 RETURN VARCHAR2
663 IS
664 BEGIN
665 
666 --
667   RETURN g_today_txt;
668 END Get_Today_As_Text;
669 -- ----------------------------------------------------------------------------
670 -- |--< Get_Print_Action >----------------------------------------------------|
671 -- ----------------------------------------------------------------------------
672 FUNCTION Get_Print_Action
673   ( p_frame_index	 IN NUMBER
674   )
675 RETURN VARCHAR2
676 IS
677   l_return_val	VARCHAR2 (2000);
678   l_user_agent VARCHAR2 (2000) := owa_util.get_cgi_env ('HTTP_USER_AGENT');
679   l_proc	VARCHAR2 (72) ;
680 BEGIN
681 g_debug := hr_utility.debug_enabled;
682 
683 IF g_debug THEN
684   l_proc	:= g_package || ' Get_Print_Action';
685   hr_utility.set_location('Entering : ' || l_proc, 5);
686 END IF;
687 
688   IF INSTR
689        ( UPPER
690            (l_user_agent
691            )
692           , 'MSIE'
693 --        , UPPER(hrhtml.d_printapiavailable_rec)
694         ) > 0
695   THEN
696     -- print api available
697     l_return_val := 'MSIE';
698 --      'window.parent.frames[' || to_char(p_frame_index) || '].print()';
699   ELSIF INSTR
700        ( UPPER
701            (l_user_agent
702            )
703           , 'MOZILLA/4'
704 --        , UPPER(hrhtml.d_printapiavailable_rec)
705         ) > 0 THEN
706     -- print api not available
707     l_return_val := 'NN4';
708   ELSIF INSTR
709        ( UPPER
710            (l_user_agent
711            )
712           , 'MOZILLA/3'
713         ) > 0
714   THEN
715     -- print api not available
716     l_return_val := 'NN3';
717   END IF;
718 --
719   IF l_return_val = 'NN3' THEN
720     IF  INSTR
721        ( UPPER
722            (l_user_agent
723            )
724           , '(W'
725         ) > 0
726     THEN
727       l_return_val := l_return_val || 'W';
728     ELSIF INSTR
729        ( UPPER
730            (l_user_agent
731            )
732           , '(X'
733         ) > 0
734     THEN
735       l_return_val := l_return_val || 'X';
736     ELSE
737       l_return_val := l_return_val || 'U';
738     END IF;
739   ELSE
740     NULL;
741   END IF;
742 
743 
744 /*
745       hrhtml.Use_JS_Click_Event
746         ( p_url =>
747             'hrhtml2.dp'
748         , p_event_action => 'NONMODALINFO'
749         );
750 */
751 
752 IF g_debug THEN
753   hr_utility.set_location('Leaving : ' || l_proc, 10);
754 END IF;
755 
756 --
757   RETURN l_return_val;
758 END Get_Print_Action;
759 
760 
761 -- bug 1641590
762 /*
763 -- ----------------------------------------------------------------------------
764 -- |--< PACKAGE INITIALIZATION >----------------------------------------------|
765 -- ----------------------------------------------------------------------------
766 BEGIN
767 --
768 -- bug 748569 fix: validate_session package initialization code eliminated
769 -- handled by frame drawing procedures only
770 --
771     g_loggedin_user := hr_session_utilities.get_LoggedIn_User;
772 */
773 
774 END HR_SESSION_UTILITIES;