Files
mip/Data/BulkLoad/EFT/Nominations/Changes/Aug_2010/efnow050$js$cont.bdy

172 lines
5.0 KiB
Plaintext

create or replace package body efnow050$js$cont is
--------------------------------------------------------------------------------
-- Name: efnow050$js$cont.CreateQueryJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateQueryJavaScript (
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow050$cont') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Query";');
WSGJSL.Output_Invoke_CAL_JS ('efnow050$cont', 'scrollbars=no,resizable=no,width=320,height=350');
htp.p(WSGJSL.OpenEvent('L_CUST_NAME','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow050$cont.l_cust_name_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(
'// CAL
//
//
function CAL(the_fieldname, the_value, the_format, the_prompt) {
var filter = "";
var the_pathname = location.pathname;
var i = the_pathname.indexOf (''/:'');
var j = the_pathname.indexOf (''/'', ++i);
//var frmCAL; //B1777722 Needs to be global to remember state between calls.
if (i != -1)
{
// Syntactically incorrect url so it needs to be corrected
the_pathname = the_pathname.substring (j, the_pathname.length);
}; // (i != -1)
// B1777722 and B1854252 for IE5
if ( navigator.appName == "Microsoft Internet Explorer" && typeof frmCAL == "object" )
{
frmCAL.close();
}
frmCAL = open ("efnow050$cont.ncalendar" +
"?Z_FIELD_NAME=" + escape(the_fieldname) +
"&Z_CALLER_URL=" + escape(location.protocol + ''//'' + location.host + the_pathname + location.search) +
"&Z_FIELD_VALUE=" + escape(the_value) +
"&Z_FIELD_FORMAT=" + escape(the_format) +
"&Z_FIELD_PROMPT=" + escape(the_prompt),
"winCAL", "scrollbars=no,resizable=no,width=320,height=350");
if (frmCAL.opener == null)
{
frmCAL.opener = self;
}
} ');
htp.p(WSGJSL.OpenEvent('CONT','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnQFQ','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
QF_BODY_ATTRIBUTES, 'efnow050$js$cont.CreateQueryJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow050$js$cont.CreateListJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateListJavaScript (
RL_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow050$cont') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "List";');
htp.p( 'var P_7 = new Array();' );
htp.p(WSGJSL.OpenEvent('AI_NEW_CONTRACT','OnClick'));
htp.p(
'
// AI_NEW_CONTRACT_OnClick
//
//
location.href = "efnow050$.contract_startup?p_screen_type=CONTRACT";');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
RL_BODY_ATTRIBUTES, 'efnow050$js$cont.CreateListJavaScript');
end;
end;
/