CREATE OR REPLACE PACKAGE BODY caco_system IS /* * $Header: /Isle Of Grain/database/PLSQL/caco_system.pck 6 20/10/05 17:12 Gilberta $ * $Revision: 6 $ * */ g_corporate_dark_colour CONSTANT VARCHAR2(7) := '#003466'; g_corporate_light_colour CONSTANT VARCHAR2(7) := '#A6BBD0'; -- c_hungarian CONSTANT VARCHAR2(255) := 'HU'; c_english CONSTANT VARCHAR2(255) := 'EN'; -- g_owner VARCHAR2(80); g_name VARCHAR2(80); g_lineno NUMBER; g_caller_type VARCHAR2(80); -- g_menu_level NUMBER := 1; -- PROCEDURE content_type IS -- -- BEGIN -- htp.p(''); -- END; -- FUNCTION get_lang_meaning(p_lang_code IN VARCHAR2) RETURN VARCHAR2 IS -- l_meaning VARCHAR2(255); c_lang_domain VARCHAR2(255) := 'LANGUAGE'; -- BEGIN -- l_meaning := NULL; -- l_meaning := caco_utilities.cgrefmeaning(p_domain => C_lang_domain, p_value => p_lang_code); -- RETURN (l_meaning); -- END ; -- PROCEDURE switch_language IS -- l_language VARCHAR2(255); -- BEGIN -- l_language := caco_utilities.get_syus_lang(p_syus_id => caco_utilities.get_syus_id); -- IF l_language = C_Hungarian THEN -- UPDATE system_users SET LANGUAGE = c_English WHERE syus_id = caco_utilities.get_syus_id; -- ELSE -- UPDATE system_users SET LANGUAGE = c_hungarian WHERE syus_id = caco_utilities.get_syus_id; -- END IF; -- home; -- END; -- PROCEDURE set_language (p_language IN VARCHAR2) IS -- l_old_language VARCHAR2(500); l_new_language VARCHAR2(500); -- BEGIN -- l_old_language := caco_utilities.get_syus_lang(p_syus_id => caco_utilities.get_syus_id); l_new_language := p_language; -- IF l_old_language <> l_new_language THEN -- UPDATE system_users s SET s.language = p_language WHERE s.syus_id = caco_utilities.get_syus_id; -- END IF; -- END; -- FUNCTION dad_path RETURN VARCHAR2 IS BEGIN -- RETURN(lower(owa_util.get_cgi_env('REQUEST_PROTOCOL') || '://' || owa_util.get_cgi_env('HTTP_HOST') || owa_util.get_cgi_env('SCRIPT_NAME') || '/')); -- END dad_path; -- FUNCTION home_path RETURN VARCHAR2 IS BEGIN -- RETURN(dad_path || 'home'); -- END home_path; -- FUNCTION images_path RETURN VARCHAR2 IS -- -- BEGIN -- RETURN g_images_dir; -- END images_path; -- PROCEDURE css(p_type IN VARCHAR2 DEFAULT 'general') IS -- -- BEGIN -- -- CSS mime header -- owa_util.mime_header(ccontent_type => 'text/css'); -- -- Set common global styles -- -- JP (new css with fixes for FF and IE6 htp.p('form { padding: 0; margin: 0; border: 0; }'); -- -- Check if we are an LOV -- IF UPPER(p_type) = 'LOV' THEN -- htp.p('body { font-size: 1em; line-height: 1.1em; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0 0 0 0; padding: 0 0 0 0; color: #000000; background-color: #ffffff; } '); -- ELSE -- -- Disable overflow -- htp.p('html { overflow:hidden; } body { font-size: 1em; line-height: 1.1em; font-family: Verdana, Arial, Helvetica, sans-serif; margin: 0 0 0 0; padding: 0 0 0 0; color: #000000; background-color: #ffffff; overflow: hidden; } '); -- END IF; -- htp.p(' a { text-decoration: none; color: #F21C0A; } a img { border: 0; } div#banner { position:absolute; width:100%; height: 102px; background: #F21C0A url(docs/SeitenkopfAbschluss.gif) top right no-repeat; right: 5px; z-index:2; } #logo { color:inherit; font-family:Arial,Helvetica,sans-serif; max-width:59.5em; min-width:46.2em; overflow:visible; padding:0.8em 0pt 0pt 2em; } #logo img { border:medium none; margin:0.25em 0pt 0pt; } div#topRightNav { position: absolute; top:0; right: 10px; } div#topRightNav ul { list-style-type: none; margin: 0; padding: 0; height: 20px; float:right; } div#topRightNav ul li { float: left; } div#topRightNav a { float: left; display:block; height: 20px; padding-top:5px; padding-right: 5px; font-size: 0.79em; color: #ffffff; } div#topRightNav a:hover { color: #000000; } #userLang { display:inline; float:right; xfont-size:0.85em; xfont-weight:bold; xline-height:2.5em; margin: 2.3em 1em 0pt 0pt; padding:0pt; } div#topNav { clear: both; position: absolute; top: 102px; left: 101px; } div#topNav ul { list-style-type: none; margin: 0; padding: 0; height: 22px; } div#topNav ul li { float: left; } div#topNav ul li a { float: left; display: block; height: 22px; padding-right: 10px; font-size: 11px; font-weight: bold; color: #F21C0A; } div#topNav ul li a:hover { color: #ffffff; } div#topNav ul li.infoline { float: left; padding-left: 65px; font-size: 11px; font-weight: bold; color: #F21C0A; } #right{ position: absolute; margin-left:160px; max-width:100%; font: normal 12px verdana, arial, helvetica, sans-serif; } /*need to set the max width in ie6 quirks (eg set the width)*/ * html #right { display: inline; margin-left: 0px; width: expression(document.body.clientWidth - 200 + "px") } #left{ background-color: #FFF; font: normal 12px verdana, arial, helvetica, sans-serif; padding:0px; border-top:1px solid #FFFFFF; border-right:1px solid #FFFFFF; position:relative; top:55px; left:0px; width:149px; background-color:#FFFFFF; color: #000000; min-height:60%; float:left; } /*we need to float this for ie6 quirks*/ * html #left { float: left; height:100%; } #left ul { margin: 0px; padding: 0px; list-style: none; width: 149px; height:20px; border-bottom: 0px; } * HTML #left ul li { float: left; display: inline; padding-right: 10px; } #left ul li a { padding: 0; display: block; text-align: right; } #left .menulvl1_inact, .menulvl1_act { font-weight: bold; color: #000000; height: 20px; width: 150px; display:block; text-decoration: none; list-style: none; } #left .menulvl1_act { background-color:#CECECE; } #left .menulvl2_inact, .menulvl2_act { font-size: 10px; height: 20px; width: 150px; color: #000000; background-color:#E6E6E6; display:block; text-decoration: none; list-style: none; } #left .menulvl2_act{ color:#F21C0A; } #left .menulvl3_act, .menulvl3_inact { font-size: 10px; height: 20px; width: 150px; background-color:#F5F5F5; color: #000000; display:block; text-decoration: none; list-style: none; text-align: right; } #left .menulvl3_act { color: #F21C0A; } #left a.menulvl1_inact:hover { color: #F21C0A; } #left a.menulvl2_inact:hover { color: #F21C0A; } #left a.menulvl3_inact:hover { color: #F21C0A; } ul.sitemaplevel1 li { float: left; width: 9.5em; list-style-image: none; margin: 0; padding: 0; } ul.sitemaplevel1 a { display: block; margin: 0 0.5em 0 0; padding: 0.075em 0.5em 0.075em 0.5em; font-size: 0.75em; text-decoration: none; font-weight:bold; color: #ffffff; background-color: #F21C0A; } ul.sitemaplevel1 li ul { margin: 0; padding: 0; position: relative; top: 0em; left: 0em; } ul.sitemaplevel1 li ul li a { width: 11.2em; padding: 0.5em; color: #000000; background-color: #ffffff; } ul.sitemaplevel1 li ul li ul li { margin-left: 0.5em; } ul.sitemaplevel1 li ul li ul li a { width: 12.8em; font-size: 0.625em; font-weight: normal; zpadding: 0.3em 0.5em 0.3em 0.5em; color:inherit; background-color: #e6e6e6; display: block; } #centrecontent{ position: absolute; overflow:auto; bottom:2em; top:120px; width:100%; background-color:white; z-index: 1; } /*we use the hack below to use border bottom and top to replace top and bottom ofsets used above */ * html #centrecontent { border-top:120px solid white; border-bottom:2em solid white; top:0px; height:100%; } h1 { font-weight : bold; font-size: 17px; line-height: 1.2em; margin: 1em 0 0.5em 0; color: #F21C0A; background-color: inherit; } h2 { font-weight : bold; font-size : 17px; font-family : verdana, arial, Helvetica, sans-serif; border-top 5px; color: #000000; } h4 { font-weight : bold; font-size : 14px; font-family : verdana, arial, Helvetica, sans-serif; color:#000000; } #centrecontent table { border-collapse: collapse; } #centrecontent table th { font-size: 12px; font-weight: bold; } #centrecontent table td { font-size: 12px; } menu { display:none; } div#hotlinks{ border:1px solid #F21C0A; position:relative; margin-left:660px; width:170px; height:235px; font: normal 12px verdana, arial, helvetica, sans-serif; } * html #hotlinks{ margin-left:10px; margin-right:-170px; } div#hotlinks h2 { height: 20px; padding-left: 20px; padding-top:5px; margin: 0; font-size: 11px; background: #F21C0A; color:#ffffff; text-transform: uppercase } div#hotlinks ul{ font-size:1em; margin:0; padding:0; text-decoration:none; list-style-type: none; } div#hotlinks ul li { line-height: 1.25em; display: inline; margin-bottom: 2em; } div#hotlinks ul li a:hover { text-decoration: underline; } div#hotlinks ul li a { background:url(docs/list_pointer.gif) 5px 3px no-repeat; padding-left: 15px; text-transform: uppercase; color: #969696; display: block; margin-bottom: 0em; font-size: 11px; } div#bulletin{ margin-left:660px; margin-top: 10px; border:1px solid #F21C0A; width:170px; height:235px; font: normal 12px verdana, arial, helvetica, sans-serif; } * html #bulletin{ margin-left:10px; margin-right:-170px; margin-bottom:0px; } div#bulletin h2 { height: 20px; padding-left: 20px; padding-top:5px; margin: 0; font-size: 11px; background: #F21C0A; color:#ffffff; text-transform: uppercase } div#bulletin ul{ font-size:1em; margin:0px; padding:0px; text-decoration:none; list-style-type:none; } div#bulletin ul li { line-height: 1.25em; display: inline; margin-bottom: 2em; } div#bulletin ul li a:hover { text-decoration: underline; } div#bulletin ul li.Y a { background: url(docs/me_read.gif) 5px 3px no-repeat; padding-left: 22px; text-transform: uppercase; color: #969696; display: block; margin-bottom: 0.5em; font-size:11px; } div#bulletin ul li.N a { background: url(docs/me_unread.gif) 5px 3px no-repeat; padding-left: 22px; text-transform: uppercase; color: #969696; display: block; margin-bottom: 0.5em; font-size: 11px; } #piechart{ position:absolute; top:353px; left:800px; width:200px; height:197px; display:none; } #piechart h1{ color:white; background-color:#003D62; text-align:center; } #barchart{ position:absolute; top:353px; left:150px; width:649px; height:197px; background-color:#ffffff; z-index:1; display:none; } #barchart h1{ color:white; background-color:#003D62; text-align:center; } #middletable{ font-size:.8em; position: absolute; top:70px; left:175px; width:107px; height:280px; background-color:#ffffff; border-top:1px solid #EEEEFF; display:none; } #edit{ position:absolute; top: 550px; left: 0px; text-align: right; z-index:3; display:inline; } #edit a{ color:black; display:inline; display:none; } li { list-style:none inside; } div#breadcrumb { height:20px; padding-top: 10px; padding-bottom: 10px; } * html div#breadcrumb { display: inline; } div#breadcrumb h1 { padding: 0; border: 0; margin: 0; } div#breadcrumb h1 a { font-weight : bold; font-size: 1.1em; color: #FA3221; } div#breadcrumb h1 a:hover { text-decoration: underline; } #homecentrecontent{ height: 100%; overflow:auto; background: #F21C0A url(docs/homeimage.png) top right no-repeat; z-index: 2; } * html #homecentrecontent { position:absolute; z-index:2; width:100%; height:80%; height:500px; } #homepageimage{ float:left; margin-left:0px; margin-top:0px; } div#footer { position: absolute; overflow: hidden; bottom:0; left:0; width: 100%; height:2em; z-index:2; color: #CECECE; font-size : 1em; font-family : verdana, arial, Helvetica, sans-serif; } #ContainerFooter { background-color:inherit; color:#A5A5A5; max-width:50.6em; min-width:37.3em; } #ContainerFooter, #HomepageContainerFooter { clear:both; margin:1em 0pt 0pt 10.9em; padding:0pt 0pt 2em; } p#FooterCopyright { float:left; margin:0pt; } #ContainerFooter p, #HomepageContainerFooter p, #ContainerFooter a, #HomepageContainerFooter a { font-size:0.688em; } ul#FooterNavRechts { float:right; } ul#FooterNavLinks, ul#FooterNavRechts { margin:0pt; padding:0pt; } #ContainerFooter ul, #HomepageContainerFooter { font-size:1em; } #ContainerFooter a:hover, #ContainerFooter a:active, #ContainerFooter a:focus, #HomepageContainerFooter a:hover, #HomepageContainerFooter a:active, #HomepageContainerFooter a:focus { text-decoration:underline; } #ContainerFooter a:link, #ContainerFooter a:visited { background-color:inherit; color:#A5A5A5; } #ContainerFooter a:link, #ContainerFooter a:visited, #HomepageContainerFooter a:link, #HomepageContainerFooter a:visited { font-weight:normal; margin:0pt; text-decoration:none; } ul#FooterNavLinks li a, ul#FooterNavRechts li a { display:block; } #ContainerFooterUnten { border-top:1px solid #A5A5A5; clear:both; padding:0pt; } ul#FooterNavRechts li { padding:0pt 0pt 0pt 1em; } ul#FooterNavRechts li { display:inline; float:left; list-style-image:none; list-style-position:outside; list-style-type:none; margin:0pt; } #advcopy { position: relative; top: 3px; float:left; } #advanticalink { position: relative; top: 3px; right: 3px; float: right; color: #CECECE; } * html #nepoListDiv{ margin-right:-3px; } * html #cnppvDiv{ width:100%; margin-left: -2px; } '); -- -- Any specific styles -- IF p_type = 'content' THEN -- NULL; -- ELSIF p_type = 'query' THEN -- htp.p('body {background-color : white }' || chr(10)); -- END IF; -- END css; -- PROCEDURE homecss IS BEGIN -- owa_util.mime_header(ccontent_type => 'text/css'); -- htp.p(' html { background-color: #F21C0A; font: normal 12px verdana, arial, helvetica, sans-serif; overflow:hidden; } body { margin: 0; overflow: hidden; background-color: #F21C0A; } a { text-decoration: none; } div#banner { position:absolute; width:100%; left: 0; } div#logo { position: relative; top: 0px; left: 0px; float: left; overflow: hidden; zwidth: 370px; zheight: 50px; margin: 0.25em 0 0 0; } div#topRightNav { position: absolute; top:0; right: 10px; } div#topRightNav ul { list-style-type: none; margin: 0; padding: 0; height: 20px; float:right; } div#topRightNav ul li { float: left; } div#topRightNav a { float: left; display:block; height: 20px; padding-top:5px; padding-right: 5px; font-size: 0.79em; color: #ffffff; } div#topRightNav a:hover { color: #000000; } div#loginlink { position: absolute; top: 15%; left: 10px; } div#loginlink ul { margin: 0px; padding: 0px; list-style: none; border-bottom: 0px; } div#loginlink ul li a { padding-left: 12; display: block; text-align: left; background: url(docs/leftlink.gif) left no-repeat; background-position: 0px 0px; } div#loginlink .login { font-size: 12px; font-weight: bold; color: #FFFFFF; display:block; text-decoration: none; list-style: none; } div#loginlink a.login:hover { color: #990000; } div#loginform { position: fixed; top: 140px; left: 170px; } * html div#loginform{ position: absolute; } div#loginform h2 { color: #FFFFFF; font-style: normal; font-weight: bold; font-size: 18px; line-height: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none } div#loginform h4 { color: #FFFFFF; font-style: normal; font-weight: bold; font-size: 14px; line-height: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none } div#loginform td { color: #FFFFFF; font-style: normal; font-weight: bold; font-size: 12px; line-height: 15px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none } #homecentrecontent{ position:absolute; display: block; margin-left:500px; margin-top:250; width:400px; height:400px; background: url(docs/homeimage.png) no-repeat; } '); -- END homecss; -- FUNCTION statusbar RETURN VARCHAR2 IS BEGIN RETURN NULL; END statusbar; PROCEDURE clock_js IS BEGIN -- -- Output the clock javascript if logged on -- htp.p(''); -- END clock_js; -- -- Eon Menu -- FUNCTION menu(p_syop_id IN system_options.syop_id%TYPE DEFAULT NULL) RETURN VARCHAR2 IS -- -- Private Variables -- v_syop_id system_options.syop_id%TYPE; l_language VARCHAR2(255); l_language_code VARCHAR2(255); l_alternative_lang_code VARCHAR2(255); -- -- Private routines -- -- -- Output menuitems -- PROCEDURE menuitem(p_module IN VARCHAR2 ,p_text IN VARCHAR2 ,p_level IN VARCHAR2 DEFAULT '1' ,p_active IN VARCHAR2 DEFAULT 'inact') IS BEGIN -- htp.p('
  • ' || p_text || '
  • '); -- END menuitem; -- FUNCTION get_syus_name ( p_syus_id IN system_users.syus_id%TYPE DEFAULT caco_utilities.get_syus_id ) RETURN VARCHAR2 IS -- l_return VARCHAR2(1000); -- BEGIN -- BEGIN -- SELECT DECODE(syus.language, 'HU', syus.last_name||' '||syus.first_name, syus.first_name||' '||syus.last_name) AS name_string INTO l_return FROM system_users syus WHERE syus.syus_id = p_syus_id; -- EXCEPTION WHEN OTHERS THEN -- l_return := 'No Name'; -- END; -- RETURN l_return; -- END; -- PROCEDURE baritem(p_module IN VARCHAR2 ,p_text IN VARCHAR2 ) IS BEGIN -- htp.p('
  • ' || p_text || '
  • '); -- END baritem; -- -- display the menu, calls itself recursively -- PROCEDURE disp_menu(p_start IN system_options.syop_id%TYPE DEFAULT NULL ,p_end IN system_options.syop_id%TYPE DEFAULT NULL ,p_level IN NUMBER DEFAULT 1) IS -- l_drill_id system_options.syop_id%TYPE; l_first_time BOOLEAN := TRUE; -- BEGIN -- -- Get all the menu items for the current level -- FOR i IN (SELECT so.syop_id_the_parent_of ,so.syop_id ,DECODE(so.module_name ,NULL ,'home?p_syop_id=' || so.syop_id ,so.module_name) AS module_name ,DECODE(so.mtxt_text_number, NULL, so.NAME, caco_utilities.get_module_text(so.mtxt_text_number)) AS name FROM system_options so ,profile_options po ,user_profiles up WHERE so.syop_id = po.syop_id AND po.sypr_id = up.sypr_id AND up.syus_id = caco_utilities.get_syus_id AND (so.syop_id_the_parent_of = p_start OR (p_start IS NULL AND so.syop_id_the_parent_of IS NULL)) GROUP BY so.syop_id_the_parent_of ,so.syop_id ,DECODE(so.module_name ,NULL ,'home?p_syop_id=' || so.syop_id ,so.module_name) ,DECODE(so.mtxt_text_number, NULL, so.NAME, caco_utilities.get_module_text(so.mtxt_text_number)) ,display_seq ORDER BY display_seq ,so.syop_id) LOOP -- -- If we have an end point to get to, find the drill path -- IF p_end IS NOT NULL THEN -- -- Find the ID for the next level down only once -- IF l_first_time THEN -- -- As we're working pottom up, reverse the level -- BEGIN SELECT a.syop_id INTO l_drill_id FROM (SELECT LEVEL AS a_level ,syop_id_the_parent_of ,syop_id FROM system_options so CONNECT BY PRIOR so.syop_id_the_parent_of = so.syop_id START WITH so.syop_id = p_end ORDER BY LEVEL DESC) a ,(SELECT MAX(LEVEL) m_level FROM system_options so CONNECT BY PRIOR so.syop_id_the_parent_of = so.syop_id START WITH so.syop_id = p_end) b WHERE b.m_level - a.a_level + 1 = p_level; EXCEPTION WHEN OTHERS THEN NULL; END; -- l_first_time := FALSE; -- END IF; -- -- If the current item is on the drill path -- IF l_drill_id = i.syop_id THEN -- -- Ouput an active menu item -- menuitem(p_module => i.module_name ,p_text => i.NAME ,p_level => p_level ,p_active => 'act'); -- -- Output Children -- disp_menu(p_start => i.syop_id ,p_end => p_end ,p_level => p_level + 1); -- ELSE -- -- Output inactive menu item -- menuitem(p_module => i.module_name ,p_text => i.NAME ,p_level => p_level ,p_active => 'inact'); -- END IF; -- ELSE -- -- Top level menu, just output -- menuitem(p_module => i.module_name ,p_text => i.NAME); -- END IF; -- END LOOP; -- END disp_menu; -- BEGIN -- v_syop_id := p_syop_id; -- -- Section added to display the alternative language choice on the banner bar. -- l_language_code := caco_utilities.get_syus_lang(p_syus_id => caco_utilities.get_syus_id); -- IF l_language_code = c_English THEN -- l_alternative_lang_code := c_Hungarian; -- ELSE -- l_alternative_lang_code := c_English; -- END IF; -- l_language := get_lang_meaning(l_alternative_lang_code); -- -- Output the clock javascript if logged on -- clock_js; -- -- Here we output the footer, this will absolutely -- positioned at the bottom of the screen and held -- in a fixed position relative to the bottom of the -- browser window by setting the overflows on the html and body -- to hidden and letting the content div overflow auto -- IF caco_utilities.get_cust_id <> caco_utilities.get_system_customer THEN -- htp.comment(ctext => 'Copyright 2007 Advantica'); -- htp.p(''); -- END IF; -- -- Show the curved right hand banner -- htp.p(' '); --banner/bannerfront --Centre Content -- --This contains the the left and right divs that sit in the middle of the --screen. We have adjusted this so that when the menu or the main application --screens gain a vertical height greater than the view port the user can scroll --just the centre content div to view the remaining parts of the screen -- htp.p('
    '); -- -- Left bar -- IF caco_utilities.get_cust_id <> caco_utilities.get_system_customer THEN -- htp.p('
    '); -- ELSE -- htp.p('
    '); -- END IF; -- -- Main nav menu -- htp.p('' || chr(10)); -- -- Close the menu div -- htp.p('
    '); -- -- Open the right div, this will contain the business bits of the application -- htp.p('