create or replace package body efnow100$js$syus is -------------------------------------------------------------------------------- -- Name: efnow100$js$syus.CreateViewJavaScript -- -- Description: -- -- Parameters: -- -------------------------------------------------------------------------------- procedure CreateViewJavaScript( VF_ROWS_UPDATED in integer, VF_ROWS_DELETED in integer, VF_ROWS_ERROR in integer, VF_BODY_ATTRIBUTES in varchar2, IF_ROWS_INSERTED in integer, IF_ROWS_ERROR in integer, LOV_FRAME in varchar2) is begin if not caco_security.security_check('efnow100$syus') then return; end if; htp.p(WSGJSL.OpenScript); htp.p('var index = 0;'); if IF_ROWS_INSERTED > 0 then htp.p( 'var DataChange = true;' ); else htp.p( 'var DataChange = false;' ); end if; if IF_ROWS_ERROR > 0 then htp.p( 'var DataChangeErrors = true;' ); else htp.p( 'var DataChangeErrors = false;' ); end if; htp.p( 'var P_SYUS_ID = new Array();' ); htp.p( 'var P_SYUS_ID = new Array();' ); htp.p( 'var P_25 = new Array();' ); htp.p( 'var INTE_CHK_VALUE = new Array();' ); htp.p( 'var USEM_CHK_VALUE = new Array();' ); htp.p(WSGJSL.RtnOpenLOV); htp.p(WSGJSL.RtnNotNull); htp.p(WSGJSL.RtnChkMaxLength); htp.p(WSGJSL.RtnReplace); htp.p(WSGJSL.RtnGetValue); htp.p(WSGJSL.RtnStripMask); htp.p(WSGJSL.RtnToNumber); htp.p(WSGJSL.RtnChkNumScale); htp.p(WSGJSL.RtnRadioChange); htp.p(WSGJSL.RtnCheckModified); htp.p(WSGJSL.RtnRevertForm); htp.p(WSGJSL.RtnFlagRow); htp.p(WSGJSL.RtnFindTargetFrame); WSGJSL.Output_Invoke_CAL_JS ('efnow100$syus', 'scrollbars=no,resizable=no,width=320,height=350'); efnow100$syus.InitialiseDomain('TITLE'); efnow100$syus.InitialiseDomain('LANGUAGE'); efnow100$syus.InitialiseDomain('USER_LOCKED'); htp.p(' function ResetRadios( form, num_rows ) { var count = 0 ; for ( row = 0 ; row < num_rows ; row++ ) { // Change the images on the radio buttons count = 0 ; for ( i=0 ; i < document.images.length ; i++ ) { if ( document.images[i].name == "RADIO_P_USER_LOCKED" + row ) { count++ ; if ( count == RADIO_P_USER_LOCKED_option[row] ) { document.images[i].src = "/images/'||WSGL.IMG_RADIO_SEL||'"; } else { document.images[i].src = "/images/'||WSGL.IMG_RADIO_UNSEL||'"; } } } } return; }; '); htp.p(WSGJSL.OpenEvent('TITLE','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('FIRST_NAME','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('LAST_NAME','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('DESCRIPTION','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('DESIGNATION','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('EMAIL_ADDRESS','OnChange')); htp.p( ' // Validate // // return emailCheck(ctl.value);'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('CONTACT_TELEPHONE','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('CONTACT_FAX','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('MOBILE_TEL_NUMBER','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('LANGUAGE','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('UI_CUST_NAME','LOV')); htp.p(' var depStr = ""; var modeStr = "" if (index == null) index = 0; if (ctl[index].form.name.search(/VForm$/) == -1) { modeStr = "INS"; } else { modeStr = "UPD"; } '); 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], index, modeStr, "efnow100$syus.cust_lov_lov", depStr, lovFra, winpar, filterprompt ); '); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('UI_CUST_NAME','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('UI_INTE_NAME','LOV')); htp.p(' var depStr = ""; var modeStr = "" if (index == null) index = 0; if (ctl[index].form.name.search(/VForm$/) == -1) { modeStr = "INS"; } else { modeStr = "UPD"; } '); 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], index, modeStr, "efnow100$syus.eflv_cuin_names_lov", depStr, lovFra, winpar, filterprompt ); '); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('UI_INTE_NAME','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('PERIOD_START','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('PERIOD_END','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('PASSWORD','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('PASSWORD_EXPIRES','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('GRACE_LOGINS','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('USER_LOCKED','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('CERTIFICATE_SERIAL','OnChange')); htp.p(' if (ctl != null) { ctl.form.z_modified[index].value = "Y"; }'); htp.p(WSGJSL.CloseEvent); htp.p( '// emailCheck // // function emailCheck (emailStr) { /* The following variable tells the rest of the function whether or not to verify that the address ends in a two-letter country or well-known TLD. 1 means check it, 0 means don''t. */ var checkTLD=1; /* The following is the list of known TLDs that an e-mail address must end with. */ var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/; /* The following pattern is used to check if the entered e-mail address fits the user@domain format. It also is used to separate the username from the domain. */ var emailPat=/^(.+)@(.+)$/; /* The following string represents the pattern for matching all special characters. We don''t want to allow special characters in the address. These characters include ( ) < > @ , ; : \ " . [ ] */ var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]"; /* The following string represents the range of characters allowed in a username or domainname. It really states which chars aren''t allowed.*/ var validChars="\[^\\s" + specialChars + "\]"; /* The following pattern applies if the "user" is a quoted string (in which case, there are no rules about which characters are allowed and which aren''t; anything goes). E.g. "jiminy cricket"@disney.com is a legal e-mail address. */ var quotedUser="(\"[^\"]*\")"; /* The following pattern applies for domains that are IP addresses, rather than symbolic names. E.g. joe@[123.124.233.4] is a legal e-mail address. NOTE: The square brackets are required. */ var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/; /* The following string represents an atom (basically a series of non-special characters.) */ var atom=validChars + ''+''; /* The following string represents one word in the typical username. For example, in john.doe@somewhere.com, john and doe are words. Basically, a word is either an atom or quoted string. */ var word="(" + atom + "|" + quotedUser + ")"; // The following pattern describes the structure of the user var userPat=new RegExp("^" + word + "(\\." + word + ")*$"); /* The following pattern describes the structure of a normal symbolic domain, as opposed to ipDomainPat, shown above. */ var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$"); /* Finally, let''s start trying to figure out if the supplied address is valid. */ /* Begin with the coarse pattern to simply break up user@domain into different pieces that are easy to analyze. */ var matchArray=emailStr.match(emailPat); if (matchArray==null) { /* Too many/few @''s or something; basically, this address doesn''t even fit the general mould of a valid e-mail address. */ alert("Email address seems incorrect (check @ and .''s)"); return false; } var user=matchArray[1]; var domain=matchArray[2]; // Start by checking that only basic ASCII characters are in the strings (0-127). for (i=0; i127) { alert("Ths username contains invalid characters."); return false; } } for (i=0; i127) { alert("Ths domain name contains invalid characters."); return false; } } // See if "user" is valid if (user.match(userPat)==null) { // user is not valid alert("The username doesn''t seem to be valid."); return false; } /* if the e-mail address is at an IP address (as opposed to a symbolic host name) make sure the IP address is valid. */ var IPArray=domain.match(ipDomainPat); if (IPArray!=null) { // this is an IP address for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert("Destination IP address is invalid!"); return false; } } return true; } // Domain is symbolic name. Check if it''s valid. var atomPat=new RegExp("^" + atom + "$"); var domArr=domain.split("."); var len=domArr.length; for (i=0;i '); htp.p(WSGJSL.OpenEvent('SYUS','Validate'));htp.p('var index = 0;'); htp.p(' for (index = 0; index < ctl.form.P_FIRST_NAME.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallNotNull('ctl.form.P_FIRST_NAME[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#First Name * #1073#:'), true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_LAST_NAME.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallNotNull('ctl.form.P_LAST_NAME[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Last Name * #1072#:'), true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_DESCRIPTION.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallChkMaxLength('ctl.form.P_DESCRIPTION[index]', 80, WSGL.MsgGetText(230, WSGLM.MSG230_MAXLEN_ERROR, '#Description#20#:', '80') , true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_DESIGNATION.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_CONTACT_TELEPHONE.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallNotNull('ctl.form.P_CONTACT_TELEPHONE[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Telephone * #1071#:'), true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_CONTACT_FAX.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallNotNull('ctl.form.P_CONTACT_FAX[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Fax * #1083#:'), true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_MOBILE_TEL_NUMBER.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallNotNull('ctl.form.P_MOBILE_TEL_NUMBER[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Mobile Tel No * #2452#:'), true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_UI_CUST_NAME.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallNotNull('ctl.form.P_UI_CUST_NAME[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Customer * #2453#:'), true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_UI_INTE_NAME.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallNotNull('ctl.form.P_UI_INTE_NAME[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Intermediary * #2448#:'), true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_PERIOD_START.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallNotNull('ctl.form.P_PERIOD_START[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Period Start * #1050#:'), true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_PERIOD_END.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_PASSWORD.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(WSGJSL.CallNotNull('ctl.form.P_PASSWORD[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Password * #2451#:'), true)); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_PASSWORD_EXPIRES.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_GRACE_LOGINS.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(' }'); htp.p(' for (index = 0; index < ctl.form.P_CERTIFICATE_SERIAL.length; index++) {'); htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};'); htp.p(' }'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('SYUS','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('btnVFU','OnClick')); htp.p(' if (!SYUS_Validate(ctl)) { return false; }'); htp.p(WSGJSL.StandardSubmit(false)); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('btnVFD','OnClick')); htp.p(WSGJSL.VerifyDelete(WSGL.MsgGetText(118, WSGLM.DSP118_CONFIRM_DELETE))); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('btnVFR','OnClick')); htp.p(WSGJSL.StandardSubmit(false)); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('btnVFI','OnClick')); htp.p(WSGJSL.StandardSubmit(false)); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('AI_INTE','OnClick')); htp.p(' var TargetFrame = JSLFindTargetFrame( "_top"); var Url = "EFNOW100$INTE.startup?Z_FORM=QUERY&P_SYUS_ID=" + P_SYUS_ID[index] + "&P_25=" + P_25[index] + "&Z_CHK=" + INTE_CHK_VALUE[index]; if (TargetFrame) { TargetFrame.location = Url; } else { location = Url; } return false;'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('AI_USEM','OnClick')); htp.p(' var TargetFrame = JSLFindTargetFrame( "_top"); var Url = "EFNOW100$USEM.startup?Z_FORM=QUERY&P_SYUS_ID=" + P_SYUS_ID[index] + "&P_25=" + P_25[index] + "&Z_CHK=" + USEM_CHK_VALUE[index]; if (TargetFrame) { TargetFrame.location = Url; } else { location = Url; } return false;'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.CloseScript); exception when others then WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain User#2189#', VF_BODY_ATTRIBUTES, 'efnow100$js$syus.CreateViewJavaScript'); end; -------------------------------------------------------------------------------- -- Name: efnow100$js$syus.CreateInsertJavaScript -- -- Description: -- -- Parameters: -- -------------------------------------------------------------------------------- procedure CreateInsertJavaScript( IF_ROWS_INSERTED in integer, IF_ROWS_ERROR in integer, IF_BODY_ATTRIBUTES in varchar2, LOV_FRAME in varchar2) is begin if not caco_security.security_check('efnow100$syus') then return; end if; htp.p(WSGJSL.OpenScript); htp.p('var FormType = "Insert";'); htp.p('var index = 0;'); if IF_ROWS_INSERTED > 0 then htp.p( 'var DataChange = true;' ); else htp.p( 'var DataChange = false;' ); end if; if IF_ROWS_ERROR > 0 then htp.p( 'var DataChangeErrors = true;' ); else htp.p( 'var DataChangeErrors = false;' ); end if; htp.p(WSGJSL.RtnOpenLOV); htp.p(WSGJSL.RtnNotNull); htp.p(WSGJSL.RtnChkMaxLength); htp.p(WSGJSL.RtnReplace); htp.p(WSGJSL.RtnGetValue); htp.p(WSGJSL.RtnStripMask); htp.p(WSGJSL.RtnToNumber); htp.p(WSGJSL.RtnChkNumScale); htp.p(WSGJSL.RtnRadioChange); htp.p(WSGJSL.RtnCheckModified); htp.p(WSGJSL.RtnRevertForm); htp.p(WSGJSL.RtnFlagRow); htp.p(WSGJSL.RtnFindTargetFrame); WSGJSL.Output_Invoke_CAL_JS ('efnow100$syus', 'scrollbars=no,resizable=no,width=320,height=350'); htp.p(WSGJSL.OpenEvent('EMAIL_ADDRESS','OnChange')); htp.p( ' // Validate // // return emailCheck(ctl.value);'); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('UI_CUST_NAME','LOV')); htp.p(' var depStr = ""; var modeStr = "" if (index == null) index = 0; if (ctl[index].form.name.search(/VForm$/) == -1) { modeStr = "INS"; } else { modeStr = "UPD"; } '); 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], index, modeStr, "efnow100$syus.cust_lov_lov", depStr, lovFra, winpar, filterprompt ); '); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('UI_INTE_NAME','LOV')); htp.p(' var depStr = ""; var modeStr = "" if (index == null) index = 0; if (ctl[index].form.name.search(/VForm$/) == -1) { modeStr = "INS"; } else { modeStr = "UPD"; } '); 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], index, modeStr, "efnow100$syus.eflv_cuin_names_lov", depStr, lovFra, winpar, filterprompt ); '); htp.p(WSGJSL.CloseEvent); htp.p( '// emailCheck // // function emailCheck (emailStr) { /* The following variable tells the rest of the function whether or not to verify that the address ends in a two-letter country or well-known TLD. 1 means check it, 0 means don''t. */ var checkTLD=1; /* The following is the list of known TLDs that an e-mail address must end with. */ var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/; /* The following pattern is used to check if the entered e-mail address fits the user@domain format. It also is used to separate the username from the domain. */ var emailPat=/^(.+)@(.+)$/; /* The following string represents the pattern for matching all special characters. We don''t want to allow special characters in the address. These characters include ( ) < > @ , ; : \ " . [ ] */ var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]"; /* The following string represents the range of characters allowed in a username or domainname. It really states which chars aren''t allowed.*/ var validChars="\[^\\s" + specialChars + "\]"; /* The following pattern applies if the "user" is a quoted string (in which case, there are no rules about which characters are allowed and which aren''t; anything goes). E.g. "jiminy cricket"@disney.com is a legal e-mail address. */ var quotedUser="(\"[^\"]*\")"; /* The following pattern applies for domains that are IP addresses, rather than symbolic names. E.g. joe@[123.124.233.4] is a legal e-mail address. NOTE: The square brackets are required. */ var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/; /* The following string represents an atom (basically a series of non-special characters.) */ var atom=validChars + ''+''; /* The following string represents one word in the typical username. For example, in john.doe@somewhere.com, john and doe are words. Basically, a word is either an atom or quoted string. */ var word="(" + atom + "|" + quotedUser + ")"; // The following pattern describes the structure of the user var userPat=new RegExp("^" + word + "(\\." + word + ")*$"); /* The following pattern describes the structure of a normal symbolic domain, as opposed to ipDomainPat, shown above. */ var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$"); /* Finally, let''s start trying to figure out if the supplied address is valid. */ /* Begin with the coarse pattern to simply break up user@domain into different pieces that are easy to analyze. */ var matchArray=emailStr.match(emailPat); if (matchArray==null) { /* Too many/few @''s or something; basically, this address doesn''t even fit the general mould of a valid e-mail address. */ alert("Email address seems incorrect (check @ and .''s)"); return false; } var user=matchArray[1]; var domain=matchArray[2]; // Start by checking that only basic ASCII characters are in the strings (0-127). for (i=0; i127) { alert("Ths username contains invalid characters."); return false; } } for (i=0; i127) { alert("Ths domain name contains invalid characters."); return false; } } // See if "user" is valid if (user.match(userPat)==null) { // user is not valid alert("The username doesn''t seem to be valid."); return false; } /* if the e-mail address is at an IP address (as opposed to a symbolic host name) make sure the IP address is valid. */ var IPArray=domain.match(ipDomainPat); if (IPArray!=null) { // this is an IP address for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert("Destination IP address is invalid!"); return false; } } return true; } // Domain is symbolic name. Check if it''s valid. var atomPat=new RegExp("^" + atom + "$"); var domArr=domain.split("."); var len=domArr.length; for (i=0;i '); htp.p(WSGJSL.OpenEvent('SYUS','Validate'));htp.p('var index = 0;'); htp.p(WSGJSL.CallNotNull('ctl.form.P_FIRST_NAME[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#First Name * #1073#:'))); htp.p(WSGJSL.CallNotNull('ctl.form.P_LAST_NAME[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Last Name * #1072#:'))); htp.p(WSGJSL.CallChkMaxLength('ctl.form.P_DESCRIPTION[index]', 80, WSGL.MsgGetText(230, WSGLM.MSG230_MAXLEN_ERROR, '#Description#20#:', '80') )); htp.p(WSGJSL.CallNotNull('ctl.form.P_CONTACT_TELEPHONE[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Telephone * #1071#:'))); htp.p(WSGJSL.CallNotNull('ctl.form.P_CONTACT_FAX[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Fax * #1083#:'))); htp.p(WSGJSL.CallNotNull('ctl.form.P_MOBILE_TEL_NUMBER[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Mobile Tel No * #2452#:'))); htp.p(WSGJSL.CallNotNull('ctl.form.P_UI_CUST_NAME[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Customer * #2453#:'))); htp.p(WSGJSL.CallNotNull('ctl.form.P_UI_INTE_NAME[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Intermediary * #2448#:'))); htp.p(WSGJSL.CallNotNull('ctl.form.P_PERIOD_START[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Period Start * #1050#:'))); htp.p(WSGJSL.CallNotNull('ctl.form.P_PASSWORD[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Password * #2451#:'))); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('SYUS','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('btnIFI','OnClick')); htp.p(' if (!SYUS_Validate(ctl)) { return false; }'); htp.p(WSGJSL.StandardSubmit(false)); htp.p(WSGJSL.CloseEvent); htp.p(WSGJSL.OpenEvent('btnIFR','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 User#2189#', IF_BODY_ATTRIBUTES, 'efnow100$js$syus.CreateInsertJavaScript'); end; -------------------------------------------------------------------------------- -- Name: efnow100$js$syus.CreateQueryJavaScript -- -- Description: -- -- Parameters: -- -------------------------------------------------------------------------------- procedure CreateQueryJavaScript ( LOV_FRAME in varchar2, QF_BODY_ATTRIBUTES in varchar2) is begin if not caco_security.security_check('efnow100$syus') then return; end if; htp.p(WSGJSL.OpenScript); htp.p('var FormType = "Query";'); htp.p(WSGJSL.OpenEvent('DB_USERNAME','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, "efnow100$syus.eflv_syus_name_lov", depStr, lovFra, winpar, filterprompt ); '); htp.p(WSGJSL.CloseEvent); WSGJSL.Output_Invoke_CAL_JS ('efnow100$syus', 'scrollbars=no,resizable=no,width=320,height=350'); htp.p(WSGJSL.OpenEvent('SYUS','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 User#2189#', QF_BODY_ATTRIBUTES, 'efnow100$js$syus.CreateQueryJavaScript'); end; end; /