//CEV2-15-01-01 john.zhong 2013-12-30 // $Id: Buttons.js,v 1.27 2011/11/29 03:08:56 louis.dai Exp $ /** * Generate buttons */ /** * Trx buttons */ function GenTrxSysBtns(){ try { //check TrxSysBtnsDiv if (!document.getElementById("TrxSysBtnsDiv")) return; var oTrxSysBtnsDiv = document.getElementById("TrxSysBtnsDiv"); //clear all buttons document.getElementById("TrxSysBtnsDiv").innerHTML = ""; //create buttons table var oBtnTable = document.createElement("table"); oBtnTable.setAttribute("id", "TrxSysBtns"); oTrxSysBtnsDiv.appendChild(oBtnTable); //create buttons row var oTrxSysBtnsRow = document.createElement("tr"); oTrxSysBtnsRow.setAttribute("id", "TrxSysBtnsRow"); oBtnTable.appendChild(oTrxSysBtnsRow); //Previous button if (nCurrTabId != nFstTabId) { AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdprevious"); AddBtnToCell("tdprevious", "prim_previous", "prim_previous", "PreviousTab()", "<<");// Syed removed PREVIOUS --old is like < 0) { //would open this in CEV210.FP4. // Added the SYS_FUNCTION_TYPE == "PM" for the View Historical in Correspondence Module - By Praveen if (beInt(SYS_I_EVENT_TIMES) > 0 && (SYS_FUNCTION_TYPE == "IQ" || SYS_FUNCTION_TYPE == "PM") && !isInqHistoryFunc()) {//would remove this in CEV210.FP4 AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdprint"); // AddBtnToCell("tdprint", "prim_view_historical", "prim_view_historical", "_Inq_Hist_Page(this)", "VIEW HISTORICAL"); //alert("function GenTrxSysBtns"); AddBtnToCell("tdprint", "prim_view_historical", "prim_view_historical", "InqHistoryInTrx()", "VIEW HISTORICAL"); } //Confirm button, for last tab only if ((nCurrTabId == nLastTabId) && (SYS_FUNCTION_TYPE != "IQ") && SYS_FUNCTION_TYPE != "DM" && (SYS_FUNCTION_TYPE != "RE") && !isRptFunc) { //Added the Print Button Option by considering 'Apply LC for Other Banks' function -- By Praveen //Modified on 24-JUNE-2009 AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdprint"); AddBtnToCell("tdprint", "prim_print", "prim_print", "printDetail()", "PRINT"); AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdconfirm"); AddBtnToCell("tdconfirm", "prim_confirm", "prim_confirm", "ConfirmTransaction()", "CONFIRM"); } if ((nCurrTabId == nLastTabId) && SYS_FUNCTION_TYPE == "DM") { AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdconfirm"); AddBtnToCell("tdconfirm", "prim_confirm", "prim_confirm", "deleteTransaction()", "DELETE"); } //Print button if (SYS_FUNCTION_TYPE == "IQ" && window.location.href.indexOf("_TRX_STATUS=INQDTL_VIEW") != -1 && !isRptFunc) { AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdprint"); AddBtnToCell("tdprint", "prim_print", "prim_print", "printDetail()", "PRINT"); } //Next button if (nCurrTabId != nLastTabId) { AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdnext"); AddBtnToCell("tdnext", "prim_next", "prim_next", "NextTab()", ">>");// Syed removed NEXT --old is like NEXT>> } //Added to Remove Confirm Button in the view of Bank Message in the Landing Page Inbox - By Praveen //if(SYS_FUNCTION_TYPE == "PM" && SYS_I_EVENT_TIMES == "6" && TRAN_NAME =="" && nCurrTabId == "0") //if(SYS_FUNCTION_TYPE == "PM" && SYS_I_EVENT_TIMES == "6" && TRAN_NAME =="" && nCurrTabId == "0") //{ //hideObj("prim_confirm"); //hideObj("prim_save"); //hideObj("View"); //AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdcancel"); //AddBtnToCell("tdcancel", "sec_cancel", "sec_cancel", "CancelTransaction()", "CANCEL"); //} //remove buttons if requred rmBtnBatch(); document.getElementById("TrxSysBtnsDiv").innerHTML = oTrxSysBtnsDiv.innerHTML; //Syed added to saparate Cancel button row---Start //check TrxSysBtnsDiv //if (!document.getElementById("TrxSysBtnsDiv")) // return; // var oTrxSysBtnsDiv = document.getElementById("TrxSysBtnsDiv"); //clear all buttons // document.getElementById("TrxSysBtnsDiv").innerHTML = ""; //var oBtnTable = document.createElement("table"); // oBtnTable.setAttribute("id", "TrxSysBtns"); // oTrxSysBtnsDiv.appendChild(oBtnTable); //var oTrxSysBtnsRow = document.createElement("tr"); //oTrxSysBtnsRow.setAttribute("id", "TrxSysBtnsRow"); // oBtnTable.appendChild(oTrxSysBtnsRow); // AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdcancel"); // AddBtnToCell("tdcancel", "sec_cancel", "sec_cancel", "CancelTransaction()", "CANCEL"); //Syed added to saparate Cancel button row---End //reset layout for compare event and remove btns. if (typeof(parent.CompareEventInit)=="function") { parent.CompareEventInit(); } } catch (e) { showExcpt("Buttons", e); } } function isInqHistoryFunc() { try { var isHistory = false; if (typeof(isInqHistory) != "undefined") { if (isInqHistory == true) { isHistory = true; } } return isHistory; } catch (e) { showExcpt("Buttons", e); } } function InqHistoryInTrx(){ try { //alert("InqHistoryInTrx function"); var _TRX_STATUS = getFldValue("_TRX_STATUS"); _Inq_Hist_Page(); setFldValue("_TRX_STATUS", _TRX_STATUS); } catch (e) { showExcpt("Buttons", e); } } /** * Add button cell to row * * @param string Table id * @param string Row id * @param string Cell id */ function AddBtnCell(sTableId, sRowId, sCellId){ try { var oTableId = document.getElementById(sTableId); var oRowId = document.getElementById(sRowId); var oCell = document.createElement("td"); oCell.setAttribute("id", sCellId); oCell.setAttribute("nowrap", "nowrap"); oCell.setAttribute("width", "1%"); oRowId.appendChild(oCell); } catch (e) { showExcpt("Buttons", e); } } /** * Add space cell to row * * @param string Table id * @param string Row id */ function AddSpaceCell(sTableId, sRowId){ try { var oTableId = document.getElementById(sTableId); var oRowId = document.getElementById(sRowId); var oCell = document.createElement("td"); oCell.setAttribute("nowrap", "nowrap"); oCell.setAttribute("width", "100%"); oRowId.appendChild(oCell); } catch (e) { showExcpt("Buttons", e); } } /** * Add button to cell * * @param string Cell id * @param string Button id * @param string Class name * @param string On click event function name */ function AddBtnToCell(sCellId, sBtnId, sClass, OnClickFuncNm, sBtnValue){ try { var oCellId = document.getElementById(sCellId); var oBtn = document.createElement("input"); oBtn.setAttribute("type", "button"); oBtn.setAttribute("id", sBtnId); oBtn.setAttribute("class", sClass); oBtn.setAttribute("onClick", OnClickFuncNm); if (sBtnValue != undefined) { oBtn.setAttribute("value", sBtnValue); } oCellId.appendChild(oBtn); } catch (e) { showExcpt("Buttons", e); } } /** * Go to previous tab */ function PreviousTab(){ try { var nCurrTabIdx = GetTabArrIdx(nCurrTabId); if (nCurrTabIdx == 0) { var nPrevTabIdx = nCurrTabIdx; } else { var nPrevTabIdx = arrDivTabs[nCurrTabIdx - 1][0]; } showTab(String(nPrevTabIdx)); } catch (e) { showExcpt("Buttons", e); } } /** * Go to next tab */ function NextTab(){ try { var nCurrTabIdx = GetTabArrIdx(nCurrTabId); if (nCurrTabIdx == nMaxTabs) { var nNextTabIdx = nCurrTabIdx; } else { var nNextTabIdx = arrDivTabs[nCurrTabIdx + 1][0]; } if (nNextTabIdx != undefined) { showTab(String(nNextTabIdx)); } if (!chkDataFmt()) { return false; //global level validation rules } } catch (e) { showExcpt("Buttons", e); } } /** * Get tab array (arrDivTabs) Index by tab id * * @param numeric tab id */ function GetTabArrIdx(nTabId){ try { for (var i = 0; i < nMaxTabs; i++) { if (arrDivTabs[i][0] == nTabId) { return i; } } } catch (e) { showExcpt("Buttons", e); } } /** * Remove button by button name * * @param string button name */ //keep remove buttons name in this arry var arrRmBtn = new Array(); //valid buttons var arrValidBtnNm = new Array("PREV", "CANCEL", "DOCUMENT", "TEMPLATE", "SAVE", "CONFIRM", "NEXT"); //buttons cell name, the order should be the same with arrValidBtnNm var arrValidBtnCellId = new Array("tdprevious", "tdcancel", "tddocument", "tdtemplate", "tdsave", "tdconfirm", "tdnext"); function rmBtn(sBtnNm){ try { if (!arrValidBtnNm.in_array(sBtnNm)) { showMsg("The buttom name " + sBtnNm + " is invalid."); } else { if (!arrRmBtn.in_array(sBtnNm)) { arrRmBtn.push(sBtnNm); } } } catch (e) { showExcpt("Buttons", e); } } /** * Remove buttons in batch, called in GenTrxSysBtns() */ function rmBtnBatch(){ try { var narrRmBtnLen = arrRmBtn.length; var narrValidBtnNmLen = arrValidBtnNm.length; for (var i = 0; i < narrRmBtnLen; i++) { //get button name idx for (var j = 0; j < narrValidBtnNmLen; j++) { if (arrRmBtn[i] == arrValidBtnNm[j]) { var nBtnIdx = j; var oBtnCell = document.getElementById(arrValidBtnCellId[nBtnIdx]); if (oBtnCell) { oBtnCell.parentNode.removeChild(oBtnCell); } } } } } catch (e) { showExcpt("Buttons", e); } } var arrAddBtn = new Array(); function addBtn(sBtnNm){ try { if (!arrValidBtnNm.in_array(sBtnNm)) { showMsg("The buttom name " + sBtnNm + " is invalid."); } else { if (!arrRmBtn.in_array(sBtnNm)) { arrAddBtn.push(sBtnNm); } } } catch (e) { showExcpt("Buttons", e); } } var strFileNm = ""; function setDocument(sFileNm){ try { strFileNm = sFileNm; } catch (e) { showExcpt("Buttons", e); } } function Document(){ try { var url = "../BBYN/KW/WEB/FORM/" + strFileNm; var style = Document[0]; if (typeof(style) == "undefined") { style = new OpenWinStyle(); style.setScrollbars(true); style.setMenubar(true); style.setWidth(780); style.setHeight(600); } // var wStyle = "menubar=yes,toolbar=no,scrollbars=yes,resizable=no,width=780,height=600"; var winID = "DocumentWin"; openWin(url, winID, style); } catch (e) { showExcpt("Buttons", e); } } function InqDocument(){ try { var DOC_LIST = getFldValue("DOC_LIST"); var docList = document.getElementById("DOC_LIST"); var optValue = docList.options[docList.selectedIndex].value; var fileType = optValue.substring(0, 3); if (DOC_LIST.length == 0 || DOC_LIST == "0") { showMsg("A document must be selected."); return false; } else { //viewImgDtal(); if (fileType == "rpt") { viewRptDoc(); } else viewImgDtal(); } } catch (e) { showExcpt("Buttons", e); } } function viewImgDtal(){ try { var sImgIndx = getFldValue("DOC_LIST"); var keyValue = ""; if (sImgIndx != "") { if(formKeyValue){ keyValue = formKeyValue.replace(new RegExp("&","g"),"&"); } //keyValue = formKeyValue; } else { showMsg("A valid item from the Advice menu list must be selected."); return; } var wid = screen.width - 5; var hei = screen.height - 5; //CEV2-0536 CEV2.1.1 2010-01-05 Frank Modify Start var actionUrl="../servlets/WSTrxManager?_TRX_STATUS=CE_INQ_IMG&IMG_INQ_TYPE=IMG_INQ_DTAL&byFileName=true"; //var url = "../servlets/WSTrxManager?_TRX_STATUS=CE_INQ_IMG&IMG_INQ_TYPE=IMG_INQ_DTAL"; actionUrl += keyValue; actionUrl=encodeUrl(actionUrl); //E var wStyle = "toolbar=0,menubar=0,resizable=1,scrollbars=1,status=1,left=0,top=0,width=" + wid + ",height=" + hei; var trxWin = window.open(actionUrl, "ceImgView", wStyle); } catch (e) { showExcpt("Buttons", e); } } //Start: button onclick function /** * Cancel transaction */ function CancelTransaction(){ try { if (SYS_FUNCTION_TYPE != "IQ" && !isRptFunc && ITEM_ID != "Inquire") { var isCancel = window.confirm("Data will not be saved if you proceed."); if (isCancel) { _Cancel_ToPrevious(); } } else { if(isInqHistoryDtl() || isPopUpWindow){ window.parent.close(); } else { _Cancel_ToPrevious(); } } } catch (e) { showExcpt("Buttons", e); } } /** * Cancel for release function */ function CancelRelease(){ try { var isCancel = window.confirm("Data will not be saved if you proceed."); if (isCancel) { _Cancel_ToPrevious(); } } catch (e) { showExcpt("Buttons", e); } } /** * Cancel for catalog screen */ function CancelCatalog(){ try { if(window.CLOSE_PAGE){ closeTrxSession(); }else{ _Cancel_ToMainMenu(); } } catch (e) { showExcpt("Buttons", e); } } /** * Template */ function Template(){ try { CalIsFstTab(); CalIsLastTab(); TemplateBtn(); } catch (e) { showExcpt("Buttons", e); } } /** * Save transaction */ function SaveTransaction(){ try { _save_onclick(); } catch (e) { showExcpt("Buttons", e); } } /** * Confirm Transaction */ function ConfirmTransaction(){ try { var isConfirm = true; if (isConfirm) { _Confirm(); } } catch (e) { showExcpt("Buttons", e); } } /** * delete transaction */ function deleteTransaction(){ try { directDelete(); } catch (e) { showExcpt("Buttons", e); } } /** * Create a hidden field to keep IsFstTab value */ function CalIsFstTab(){ try { if (!document.getElementById("IsFstTab")) { var oIsFstTab = document.createElement("input"); oIsFstTab.setAttribute("id", "IsFstTab"); oIsFstTab.setAttribute("type", "hidden"); document.forms["MAINFORM"].appendChild(oIsFstTab); } else { oIsFstTab = document.getElementById("IsFstTab"); } if (nCurrTabId == nFstTabId) { oIsFstTab.setAttribute("value", "Y"); } else { oIsFstTab.setAttribute("value", "N"); } } catch (e) { showExcpt("Buttons", e); } } /** * Create a hidden field to keep IsLastTab value */ function CalIsLastTab(){ try { if (!document.getElementById("IsLastTab")) { var oIsLastTab = document.createElement("input"); oIsLastTab.setAttribute("id", "IsLastTab"); oIsLastTab.setAttribute("type", "hidden"); document.forms["MAINFORM"].appendChild(oIsLastTab); } else { oIsLastTab = document.getElementById("IsLastTab"); } if (nCurrTabId == nLastTabId) { oIsLastTab.setAttribute("value", "Y"); } else { oIsLastTab.setAttribute("value", "N"); } } catch (e) { showExcpt("Buttons", e); } } /** * Insert clause with fix width and height window */ //function Clause(sFldNm){ function Clause(sFldNm, autoCompleteParams){ try { var sFldType = getFldType(sFldNm); if(typeof(isClauseLayer) != 'undefined' && isClauseLayer && !autoCompleteParams) { return; } if (sFldType != "P") { if(autoCompleteParams) { SYS_InsertClause(sFldNm, undefined, undefined, autoCompleteParams); return; } SYS_InsertClause(sFldNm); } } catch (e) { showExcpt("Buttons", e); } } /** * Reset for Staning catalog */ function ResetStdCata(){ try { //system keep the keyword, to clear it first clearReset(); //reset catalog, it run funcItemClick() for this function again to reset everything back if (typeof(isCriteria) != "undefined") { isCriteria = true; } //for inbox & calendar catalog reset //if (typeof(FUNC_ID) != "undefined" && FUNC_ID == "") { var eventTitle = document.getElementById("_EVENT_TITLE"); if ((typeof(FUNC_ID) != "undefined" && FUNC_ID == "")||(eventTitle!= null && eventTitle.value != "")) { FilterCata(); } //for normal catalog reset else { for (var i = 0; i < nNoOfFuncs; i++) { if (strArray[i][3] == FUNC_ID) { var sModDesc = strArray[i][10]; var sProdId = strArray[i][1]; var sItemId = strArray[i][5]; var sModNm = strArray[i][0]; if (!isSEC && (window.SYS_FUNCTION_NAME && window.SYS_FUNCTION_NAME.length > 0)) { funcItemClick(sModDesc, sProdId, sSelectedFuncId, sItemId, sModNm); } else { funcItemClick(sModDesc, sProdId, FUNC_ID, sItemId, sModNm); } break; } } } } catch (e) { showExcpt("Buttons", e); } } /** * Print trx details */ function printDetail(){ try { var url = "../screen/PrintPage.jsp"; // var wStyle = "menubar=yes,toolbar=no,scrollbars=yes,resizable=no,width=780,height=600"; var winID = "PrintWin"; var wStyle = printDetail.arguments[0]; if (typeof(wStyle) == "undefined") { wStyle = new OpenWinStyle(); wStyle.setMenubar(true); wStyle.setScrollbars(true); wStyle.setWidth(780); wStyle.setHeight(600); } //CEV2-0536 cash 2011-6-8 s url = encodeUrl(url); //CEV2-0536 cash 2011-6-8 e openWin(url, winID, wStyle); //var objNewWin = window.open(url, winID, wStyle); //arChildWin.push(objNewWin); } catch (e) { showExcpt("Buttons", e); } } /** * Filter button on function catalog */ function FilterCata(){ try { tran_search_onclick(); } catch (e) { showExcpt("Buttons", e); } } /** * Inquire history */ function InqHistory(obj){ try { if (!check_select_one()) { showMsg("A record must be selected."); } else { _Inquire_history_onclick(obj); } } catch (e) { showExcpt("Buttons", e); } } function CompareEvent(obj){ try { if (!check_select_one()) { var msg = _getClientMessage(90144); showMsg(msg); } else { _compare_event_onclick(obj); } } catch (e) { showExcpt("Buttons", e); } } function _Secu_CETOCSX_onclick(obj){ try { ViewCEToCSXMsg(obj); } catch (e) { showExcpt("Buttons", e); } } //CEV2-0385 john.zhong 2009-10-30 S function _Secu_ResendSWIFT_onclick(obj){ try { ViewSwift(obj); } catch (E) { DisExcpt("Buttons", E); } } //CEV2-0385 john.zhong 2009-10-30 E function _Secu_CSXTOCE_onclick(obj){ try { ModifyCSXToCEMsg(obj); } catch (e) { showExcpt("Buttons", e); } } /** * View CE outgoing message */ function ViewCEToCSXMsg(obj){ try { if (!check_select_one()) { showMsg("Please Select a Record."); } else { var oForm = document.forms[0]; oForm.ID.value = FUNC_ID; oForm.TRXL_TYPE.value = "S"; oForm.ITEM_ID.value = "ReSendGAPI"; oForm._ACT_TYPE.value = "VIEW_GAPI"; oForm._TRX_STATUS.value = "RESEND_GAPI"; //CEV2-0536 CEV2.1.1 2010-01-05 Frank Modify Start var actionUrl="../servlets/WSTrxManager"; //CEV2-07-01-04 john.zhong 2014-04-10 S //actionUrl=encodeUrl(actionUrl); //CEV2-07-01-04 john.zhong 2014-04-10 E //Frank modify end oForm.action=actionUrl;//Frank add oForm.method = "post"; var swidth = screen.width - 500; var sheight = screen.height - 468; var showx = (window.screen.availWidth - swidth) / 2; var showy = (window.screen.availHeight - sheight) / 2; var wStyle = "width=" + swidth + ",height=" + sheight + ",left=" + showx + ",top=" + showy + ",scrollbars=1,status=1,resizable=no"; //var wOpen = window.open("", "_ViewGAPI", wStyle); //CEV2-07-01-04 john.zhong 2014-04-10 S if(isIE11){ var baseUrl = actionUrl; baseUrl = getOpenWinGETUrlWithForm(baseUrl,oForm); openWin(baseUrl,"_ViewGAPI",wStyle); }else{ var wOpen = openWin("../screen/SYS_Dummy.htm", "_ViewGAPI", wStyle); oForm.target = addWinIDSuffix("_ViewGAPI"); //oForm.target = "_ViewGAPI"; oForm.submit(); oForm.target = ""; } //CEV2-07-01-04 john.zhong 2014-04-10 E } } catch (e) { showExcpt("Buttons", e); } } //CEV2-0385 john.zhong 2009-10-30 S function ViewSwift(obj){ try { if (!check_select_one()) { alert("Please Select a Record."); } else { var oForm = document.forms[0]; //CEV2-0536 CEV2.1.1 2010-01-05 Frank Modify Start var actionUrl="../servlets/WSTrxManager"; actionUrl=encodeUrl(actionUrl); //Frank modify end oForm.ID.value = FUNC_ID; oForm.TRXL_TYPE.value = "S"; oForm.ITEM_ID.value = "ResendSWIFT"; oForm._ACT_TYPE.value = "VIEW_SWIFT"; oForm._TRX_STATUS.value = "RESEND_SWIFT"; //oForm.action = "../servlets/WSTrxManager"; //Frank comment oForm.action=actionUrl;//Frank add oForm.method = "post"; var swidth = screen.width - 500; var sheight = screen.height - 468; var showx = (window.screen.availWidth - swidth) / 2; var showy = (window.screen.availHeight - sheight) / 2; var wStyle = "width=" + swidth + ",height=" + sheight + ",left=" + showx + ",top=" + showy + ",scrollbars=1,status=1,resizable=no"; var wOpen = window.open("", "_ViewGAPI", wStyle); oForm.target = "_ViewGAPI"; oForm.submit(); oForm.target = ""; } } catch (E) { DisExcpt("Buttons", E); } } /** * Resend CE outgoing message * * @date 2007-01-30 */ function ResendCEToCSXMsg(obj){ try { if (!check_select_one()) { alert("Please Select a Record."); } else { var oForm = document.forms[0]; //CEV2-0536 CEV2.1.1 2010-01-05 Frank Modify Start var actionUrl=""; actionUrl="../servlets/WSTrxManager"; actionUrl = encodeUrl(actionUrl); //Frank modify end oForm.ID.value = FUNC_ID; oForm.TRXL_TYPE.value = "S"; var itemID = "ReSendGAPI"; var status = "RESEND_GAPI"; if (ITEM_ID.match("ResendSWIFT")) { itemID = "ResendSWIFT"; status = "RESEND_SWIFT"; } oForm.ITEM_ID.value = itemID; oForm._ACT_TYPE.value = ""; oForm._TRX_STATUS.value = status; //oForm.action = "../servlets/WSTrxManager"; //Frank comment oForm.action=actionUrl;//Frank add oForm.method = "post"; oForm.submit(); } } catch (E) { DisExcpt("Buttons", E); } } //CEV2-0385 john.zhong 2009-10-30 E /** * Modify message from CSX */ function ModifyCSXToCEMsg(obj){ try { if (!check_select_one()) { showMsg("Please Select a Record."); } else { STPDemerge_Onclick(obj); } } catch (e) { showExcpt("Buttons", e); } } //End: button onclick function function _DeleteMaster_onclick(obj){ try { _DeleteMaster(obj); } catch (e) { showExcpt("Buttons", e); } } function _DeleteMaster(obj){ try { var vForm = document.forms[0]; if (!check_select_one()) { var msg = _getClientMessage(90149); _SYS_Display_WARN(msg); return false; } var vFuncID = obj.getAttribute("itemFunc"); if (vFuncID == null || vFuncID == "") { vFuncID = FUNC_ID; } vForm.ID.value = vFuncID; vForm.TRXL_TYPE.value = "MD"; vForm.ITEM_ID.value = "Delete"; genHiddenField(); vForm.method = "post"; //CEV2-0536 CEV2.1.1 2010-01-05 Frank Modify Start var actionUrl="../servlets/WSTrxManager"; actionUrl=encodeUrl(actionUrl); //Frank modify End vForm.action = actionUrl; vForm._TRX_STATUS.value = "LDGLIST"; _submit_cataform(); } catch (e) { showExcpt("Buttons", e); } } function Release(){ try { var objForm = document.forms[0]; var i = 0; for (i = 0; i < 2; i++) { if (objForm.IsAgreeGroup[i].checked) { isAgreeValue = objForm.IsAgreeGroup[i].value; objForm.C_IS_AGREE.value = isAgreeValue; break; } } if (ITEM_ID) { document.forms[0].ITEM_ID.value = ITEM_ID; } else { document.forms[0].ITEM_ID.value = "Release"; } document.forms[0]._TRX_STATUS.value = "RELE"; _release_submit(); } catch (e) { showExcpt("Buttons", e); } } /** * Inquire standing data and get related data * Pending: * 1. Make callback function works. * 2. _SYS_setFieldValue() in SSS responsed data cannot update global js variable. * @param string standing data type and other parameters, splitted by : */ function inqStanData(sParam, sCallBackFunc){ try { var arrParam = sParam.split(":"); var sStanType = arrParam[0]; var sSubType = arrParam[1]; var sTerType = arrParam[2]; var sData = ""; sInqStanType = sStanType; sInqSubType = sSubType; sInqTerType = sTerType; if (typeof(sTerType) == "undefined") { sInqTerType = ""; } if (sStanType == "PARTY") { if (sSubType == "BANK") { sData = "&sNm=" + getFldValue(sTerType + "_BK_NM"); sData += "&sAdd1=" + getFldValue(sTerType + "_BK_ADD1"); sData += "&sAdd2=" + getFldValue(sTerType + "_BK_ADD2"); sData += "&sAdd3=" + getFldValue(sTerType + "_BK_ADD3"); sData += "&sSwAdd=" + getFldValue(sTerType + "_BK_SW_ADD"); } else { sData = "&sNm=" + getFldValue(sSubType + "_NM"); sData += "&sAdd1=" + getFldValue(sSubType + "_ADD1"); sData += "&sAdd2=" + getFldValue(sSubType + "_ADD2"); sData += "&sAdd3=" + getFldValue(sSubType + "_ADD3"); } } else if (sStanType == "AC") { sData = "&sCcy=" + getFldValue(sSubType + "_AC_CCY"); } else if (sStanType == "BANK" || sStanType == "BANK1" ) { if (sSubType == "PARTY_BK") { sData = "&sNm=" + getFldValue(sSubType + "_NM"); sData += "&sAdd1=" + getFldValue(sSubType + "_ADD1"); sData += "&sAdd2=" + getFldValue(sSubType + "_ADD2"); sData += "&sAdd3=" + getFldValue(sSubType + "_ADD3"); sData += "&sSwAdd=" + getFldValue(sSubType + "_SW_ADD"); } else if (sSubType == "REQ_CONF_PARTY") { sData = "&sNm=" + getFldValue(sSubType + "_NM"); sData += "&sAdd1=" + getFldValue(sSubType + "_ADD1"); sData += "&sAdd2=" + getFldValue(sSubType + "_ADD2"); sData += "&sAdd3=" + getFldValue(sSubType + "_ADD3"); //sData += "&sSwAdd=" + getFldValue(sSubType + "_SW_ADD"); } else { sData = "&sNm=" + getFldValue(sSubType + "_BK_NM"); sData += "&sAdd1=" + getFldValue(sSubType + "_BK_ADD1"); sData += "&sAdd2=" + getFldValue(sSubType + "_BK_ADD2"); sData += "&sAdd3=" + getFldValue(sSubType + "_BK_ADD3"); sData += "&sSwAdd=" + getFldValue(sSubType + "_BK_SW_ADD"); } } //CEV2-0536 CEV2.1.1 2010-01-05 Frank Modify Start var actionUrl="../screen/inqStanData.jsp?sParam=" + sParam + "&sCallBackFunc=" + sCallBackFunc + sData; //CEV2-07-01-04 john.zhong 2014-04-04 S //actionUrl=encodeUrl(actionUrl); //CEV2-07-01-04 john.zhong 2014-04-04 E //Frank modify End //var sURL = "../screen/inqStanData.jsp?sParam=" + sParam + "&sCallBackFunc=" + sCallBackFunc + sData; var swidth = screen.width - 10; var sheight = screen.height - 50; var wStyle = inqStanData.arguments[2]; if (typeof(wStyle) == "undefined") { wStyle = new OpenWinStyle(); wStyle.setScrollbars(true); wStyle.setWidth(swidth); wStyle.setHeight(sheight); } // var wStyle = "width=" + swidth + ",height=" + sheight + ",left=0,top=0,scrollbars=yes,status=no,resizable=no"; //CEV2-07-01-04 john.zhong 2014-04-04 S openWin(actionUrl, "inqStanDataWin", wStyle, true); //CEV2-07-01-04 john.zhong 2014-04-04 E } catch (e) { showExcpt("Buttons", e); } } function getStanData(){ try { SYS_GetDataBySSS("getStanData", "sInqStanType;sInqSubType;sInqTerType;sInqDataId", "getStanDataCallBack"); } catch (e) { showExcpt("Buttons", e); } } function getStanDataCallBack(){ try { // TO DO. } catch (e) { showExcpt("Buttons", e); } } /** * get bank data by BIC * @param string Bank type */ function getBankDataByBIC(strBkType){ try { var sFunc = getBankDataByBIC.caller.toString(); var sFuncNm = sFunc.substring(sFunc.indexOf(" ") + 1, sFunc.indexOf("(")); sBkType = sFuncNm.split("_")[0]; sSwAdd = getFldValue(sBkType + "_BK_SW_ADD"); if (sSwAdd.length > 0) { SYS_GetDataBySSS("getBankDataByBIC", "sBkType;sSwAdd", "getStanDataCallBack"); } else { setFldValue(sBkType + "_BK_ID", ""); setFldValue(sBkType + "_BK_NM", ""); setFldValue(sBkType + "_BK_ADD1", ""); setFldValue(sBkType + "_BK_ADD2", ""); setFldValue(sBkType + "_BK_ADD3", ""); } } catch (e) { showExcpt("Buttons", e); } } function toProfilePage(){ try { var vForm = document.forms[0]; //CEV2-0536 CEV2.1.1 2010-01-05 Frank Modify Start var actionUrl=""; actionUrl="../servlets/WSTrxManager"; actionUrl=encodeUrl(actionUrl); //Frank modify end //vForm.action = "../servlets/WSTrxManager"; //Frank comment vForm.action=actionUrl;//Frank add vForm.method = "post"; setUniqueFieldValue(vForm, "_TRX_STATUS", "USERPROFILE"); setUniqueFieldValue(vForm, "_ACTION", "CustomProfile"); vForm.submit(); } catch (e) { showExcpt("Buttons", e); } } function exportExcelParty(btn){ try { if (!check_select_one()) { var msg = _getClientMessage(90144); showMsg(msg); } else { Excel_onclick(btn); } } catch (e) { showExcpt("Buttons", e); } } /** * widget hyperlink click * CEV2-04-07-01 john.zhong 2013-04-27 * */ function SYS_CataField_Onclick_Widget(widgetName,type){ var args = SYS_CataField_Onclick_Widget.arguments; var funcName=""; if("P" == type){ funcName = SYS_getMethodFullName("_PilotLink_Onclick_"+widgetName,args); }else{ funcName = SYS_getMethodFullName("_SubLink_Onclick_"+widgetName,args); } eval(funcName); } /** * Pilot action event * @author Terry * @PatchNo CEV2-05-08-01 2011-9-9 (CEV2-0548) Louis bound * @since CEV2.6.0 * @Date 2011-5-30 */ function _PilotLink_Onclick(obj,type,funcId){ var vform = document.forms[0]; var ckboxs = vform["_Sel_CheckBox"]; if(ckboxs){ var selRow = obj.getAttribute("row"); if(ckboxs.length){ for(var i=0;i 0)) { var bIsView = false; if (SYS_FUNCTION_NAME.indexOf("View") != -1) { bIsView = true; } if (bIsView || isRptFunc) { sendRequestByAjaxPost(url,true,closeTrxWin); } else { var isCancel = window.confirm("Data will not be saved if you proceed."); if (isCancel) { sendRequestByAjaxPost(url,true,closeTrxWin); } } }else{ sendRequestByAjaxPost(url,true,closeTrxWin); } } function closeTrxWin(){ window.close(); } function _TrxActButton_Onclick(target,funcId,criteria,param,noMapping,isPopup,frameID){ try{ var actionUrl = "../servlets/WSTrxManager?_TRX_STATUS=PARALLEL&IS_FUNC_START=T"; var parentId = window.trxSessionId; if(typeof(parentId)=="undefined"){ parentId = ""; } actionUrl += "&RESERVE_PARENT=T&PARENT_ID="+parentId+"&FUNC_ID="+funcId; if(typeof(target) != "undefined" && target != null){ actionUrl += "&TARGET="+target; } if (isPopup||typeof(frameID)!="undefined") { actionUrl += "&POP=Y"; } if(typeof(noMapping) != "undefined"&&noMapping){ actionUrl += "&NO_MAPPING=T"; } var winID = ""; if (typeof(FUNC_ID) != "undefined") { winID = "SubButton"+FUNC_ID; } actionUrl += "&RELATION_ID="+winID; actionUrl += typeof(param) == "undefined" || param == null?"":"&"+param; actionUrl += getMappingXml(criteria,noMapping); window.trxSessionId = ""; actionUrl = encodeUrl(actionUrl); if (isPopup) { openWin(actionUrl, winID, ""); } else { if(typeof(frameID)!="undefined"){ var frameObj = document.getElementById(frameID); frameObj.src = actionUrl; }else{ var arrayActionUrl = actionUrl.split("?"); var actionServer = arrayActionUrl[0]; urlChangeToFormSubmit(actionServer,arrayActionUrl[1]); } } window.trxSessionId = parentId; }catch (E){ showExcpt("Buttons",E); } } function urlChangeToFormSubmit(actionServer,actionUrl){ try{ if (actionServer && actionUrl) { var form = document.forms[0]; form.action = actionServer; var allOpInputs = $("input[id^='OP']",form); for(var i=0;i"; //CEV2-04-11-01 john.zhong 2013-06-20 E } // xmlstr += ""; var xmlstr = XMLManager.xmlDomToString(root); var mapping = "&MAPPING="+xmlstr+extClause; return mapping; //CEV2-04-11-01 cash 2013-06-21 S }catch (E){ showExcpt("Buttons",E); } } function confirmSubmit(custSubmitFlds){ var vform = document.forms[0]; setUniqueFieldValue(vform,"CONFIRM_POST","T"); var submitFields = new Array("LOGIN_NAME", "FUN_DESC", "PRODUCT_NAME", "_TRX_STATUS", "ITEM_NAME", "TRAN_NAME", "PRODUCT_ID", "_ACT_TYPE", "ID", "PREV_TRAN_NAME", "TITLE_NAME", "FUN_NAME", "FUNC_ID", "ITEM_ID", "C_LAST_PWD", "C_STAT_INFO","C_LAN_VAL","CONFIRM_POST"); if (custSubmitFlds instanceof Array) { submitFields = submitFields.concat(custSubmitFlds); } var actionUrl = "../servlets/WSTrxManager"; actionUrl = encodeUrl(actionUrl); vform.action = actionUrl; vform.method = "post"; if(AjaxPost == "T"){ postFormByAjax(vform,furtherConfirm); }else{ vform.submit(); } } function genCfmSuccBtns(){ //check TrxSysBtnsDiv var oTrxSysBtnsDiv = document.getElementById("TrxCfmBtnsDiv"); if(typeof(oTrxSysBtnsDiv) == "undefined"){ return; } //clear all buttons oTrxSysBtnsDiv.innerHTML = ""; //create buttons table var oBtnTable = document.createElement("table"); oBtnTable.setAttribute("id", "TrxSysBtns"); oTrxSysBtnsDiv.appendChild(oBtnTable); //create buttons row var oTrxSysBtnsRow = document.createElement("tr"); oTrxSysBtnsRow.setAttribute("id", "TrxSysBtnsRow"); oBtnTable.appendChild(oTrxSysBtnsRow); //Cancel button AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdcancel"); var btnDesc = "CONFM" == PAGE_TYPE ? "CANCEL":"DONE"; var funcName = "CONFM" == PAGE_TYPE ? "_Back_ToPrevious()":"_Cancel_ToPrevious()"; AddBtnToCell("tdcancel", "sec_cancel", "sec_cancel", funcName, btnDesc); //spacer cell AddSpaceCell("TrxSysBtns", "TrxSysBtnsRow"); if("CONFM" == PAGE_TYPE){ AddBtnCell("TrxSysBtns", "TrxSysBtnsRow", "tdconfirm"); AddBtnToCell("tdconfirm", "prim_confirm", "prim_confirm", "confirmSubmit()", "CONFIRM"); } } /* * click the function item in the widget * * @param funcID * @param isPop * * @PatchNo CEV2-04-01-01 cash 2013-06-07 s * */ function functionItemClick(funcID,isPop){ try { if (funcID == null || funcID.Trim() == "") { return null; } var len = arguments.length; var params = null; if(len > 2){ //if you want to post parameters, you need to structure them as string "AAA=aaa&BBB=bbb" var params = arguments[len-1]; } _TrxActButton_Onclick(null,funcID,null,params,true,isPop); } catch(e){ showExcpt("Buttons", e); } } //S change record number per page function showRecordNum(num){ try { if(num == null || typeof(num) == "undefined"){ num = "10"; } setFldValue("CATA_PAGE_SIZE",num); gotoPageNo("1", "Wrong page."); } catch (e) { showExcpt("Buttons", e); } } //E change record number per page