/* * ei.script v1.04 */ if(navigator.userAgent.indexOf("MSIE") != -1){ window.document.onkeydown =keyPressEvent; }else{ window.document.onkeypress =keyPressEvent; } function keyPressEvent(e){ if (!e){ e = window.event; } var code; if(e.keyCode){ code = e.keyCode; }else if(e.charCode){ code = e.charCode; } if( code == 0x25 && e.altKey == true ){ return false; }else if( e.keyCode == 0x08){ var element; if(e.srcElement){ element = e.srcElement; }else if(e.target){ element = e.target; }else{ return true; } if(element.type){ if(element.type == "text" || element.type == "password" || element.type == "textarea"){ if(element.readOnly){ return false; }else{ return true; } }else{ return false; } }else{ return false; } } } //************************************************************************************** // DispatchAction(2007/02/14) //************************************************************************************** function doAction(action, target, form, command, index, svalidate, dccheck) { var oldaction = window.document.forms[0].action; if (form == null|| form == ""||form == "undefined"){ form = window.document.forms[0]; } if (action == null|| action == ""||action == "undefined"){ action = form.action; } if(dccheck) { if(!doubleSubmitCheck('既に処理が実行済みです。',true)) { return false; } }else if (!doubleSubmitCheck('既に処理が実行済みです。',false)){ return false; } if(!svalidate) { var actionName = action; var a = action.substring(0, actionName.lastIndexOf(".")) + "_NoValidate" + actionName.substring(actionName.lastIndexOf("."), actionName.length); form.action = a; }else{ form.action = action; } if (target == null) { target = ''; } form.target = target; form._TARGETID.value = target; form.command.value = command; form.index.value = index; form.submit(); if(!dccheck){ form.action = oldaction; } return false; } //************************************************************************************** // DispatchRequest(2007/02/14) //************************************************************************************** function doRequest(validate, formObj, command) { if (validate){ formObj.command.value = command; formObj.submit(); } } //************************************************************************************** // DispatchRequestWithDCCheck(2007/02/14):ボタン連打対応 //************************************************************************************** function doRequestWithDCCheck(validate, formObj, command) { if (validate){ if (doubleSubmitCheck('既に処理が実行済みです。',true)){ formObj.command.value = command; formObj.submit(); } } } //************************************************************************************** // DispatchRequest_Novalidate(2007/02/14):Server側Validateチェックなし //************************************************************************************** function doRequest_NoValidate(formObj, command) { var actionName = formObj.action; if (actionName.indexOf("_NoValidate") < 0){ formObj.action = actionName.substring(0, actionName.lastIndexOf(".")) + "_NoValidate" + actionName.substring(actionName.lastIndexOf("."), actionName.length); } doRequest('true', formObj, command); } //************************************************************************************** // DispatchRequestWithDCCheck_NoValidate(2007/02/14):ボタン連打対応(Server側Validateチェックなし) //************************************************************************************** function doRequestWithDCCheck_NoValidate(formObj, command) { var actionName = formObj.action; if (actionName.indexOf("_NoValidate") < 0){ formObj.action = actionName.substring(0, actionName.lastIndexOf(".")) + "_NoValidate" + actionName.substring(actionName.lastIndexOf("."), actionName.length); } doRequestWithDCCheck('true', formObj, command); } //************************************************************************************** // SubmitdoubleClickCheck(2007/02/14) //************************************************************************************** var submitFlg = false; function doubleSubmitCheck(message,update){ if( submitFlg ){ alert(message); return false; } if (update){ submitFlg = true; } return true; } function doSelect(validate, formObj, command, tl) { if (validate){ formObj.command.value = command; formObj.targetLine.value = tl; formObj.submit(); } } //************************************************************************************** // DispatchRequest_Novalidate(2007/02/14): //************************************************************************************** function doSelect_NoValidate(formObj, command, tl) { var actionName = formObj.action; if (actionName.indexOf("_NoValidate") < 0){ formObj.action = actionName.substring(0, actionName.lastIndexOf(".")) + "_NoValidate" + actionName.substring(actionName.lastIndexOf("."), actionName.length); } doSelect('true', formObj, command, tl); } //************************************************************************************** // DirectSubmit Cancel(2007/02/14): //************************************************************************************** function directSubmitCancel(formObj){ return false; } // --------------------------------------------------------------------------------------- // -- eiSwitchDisplay : -- // -- フォームの折りたたみによる表示/非表示を切り替える -- // -- (暫定版)標準Scriptにすでに存在する場合はそちらを使用すること。 -- // -- id: 折りたたむエリアを指定しているdivタグのid -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- //フォーム表示非表示切替 function eiSwitchDisplay(id){ var disp = document.getElementById(id).style.display; var dispclass = document.getElementById(id).className; if(disp == "none"){ document.getElementById(id).style.display = "block"; }else if(disp == "block"){ document.getElementById(id).style.display = "none"; }else if(dispclass == "eiDvDpn"){ document.getElementById(id).style.display = "block"; }else if(dispclass == "eiDvDpb"){ document.getElementById(id).style.display = "none"; }else{ document.getElementById(id).style.display = "none"; } // return false; } // --------------------------------------------------------------------------------------- // -- eiSetValueParentWindow :    -- // -- 子ウィンドウから親ウィンドウに値をセットする -- // -- thisform: 自WinのForm名 -- // -- thiselm: 自Winから渡すエレメント名(カンマ区切り) -- // -- pareform: 親WinのForm名 -- // -- pareelm: 親Winのセットするエレメント名(カンマ区切り) -- // -- 自Winから渡すエレメント名と順番と数が対になっていること -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiSetValueParentWindow(thisform,thiselm,pareform,pareelm){ // 親のエレメント名の配列 parentArray_el = pareelm.split(","); // 子のエレメント名の配列 thisArray_el = thiselm.split(","); for(var i = 0;i < thisArray_el.length;i++){ var parentElement = window.opener.document.forms[0].elements[parentArray_el[i]]; var thisElement = window.document.forms[thisform].elements[thisArray_el[i]]; if (parentElement && thisElement){ setElementElement(thisElement,parentElement); } } } // --------------------------------------------------------------------------------------- // -- eiSetValueParentWindowSubmit : -- // -- 子ウィンドウから親ウィンドウに値を返し、親WindowsのActionを実行後、自Winを閉じる -- // -- thisform: 自WinのForm名 -- // -- thiselm: 自Winから渡すエレメント名(カンマ区切り) -- // -- pareform: 親WinのForm名 -- // -- pareelm: 親Winのセットするエレメント名(カンマ区切り) -- // -- 自Winから渡すエレメント名と順番と数が対になっていること -- // -- nextcommand: 親WinでSubmitするコマンド -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiSetValueParentWindowSubmit(thisform,thiselm,pareform,pareelm,nextcommand,sscheck){ var curAction; if (pareelm != null && pareelm != undefined){ eiSetValueParentWindow(thisform,thiselm,pareform,pareelm); } if(sscheck=!null && sscheck != undefined && !sscheck){ curAction = window.document.forms[pareform].action; tmpaction = curAction.split(".do"); curAction = tmpaction[0] + "_NoValidate.do"; window.document.forms[pareform].action = curAction; } window.opener.document.forms[pareform].elements["command"].value = nextcommand; window.opener.document.forms[pareform].submit(); window.close(); } // --------------------------------------------------------------------------------------- // -- eiSetValueParentWindowClose : -- // -- 子ウィンドウから親ウィンドウに値を返し、自Winを閉じる -- // -- thisform: 自WinのForm名 -- // -- thiselm: 自Winから渡すエレメント名(カンマ区切り) -- // -- pareform: 親WinのForm名 -- // -- pareelm: 親Winのセットするエレメント名(カンマ区切り) -- // -- 自Winから渡すエレメント名と順番と数が対になっていること -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiSetValueParentWindowClose(thisform,thiselm,pareform,pareelm){ eiSetValueParentWindow(thisform,thiselm,pareform,pareelm); window.close(); } // --------------------------------------------------------------------------------------- // -- eiSetValueParentWindowModal : -- // -- 子Modalから親ウィンドウに値をセットする -- // -- thisform: 自WinのForm名 -- // -- thiselm: 自Winから渡すエレメント名(カンマ区切り) -- // -- pareform: 親WinのForm名 -- // -- pareelm: 親Winのセットするエレメント名(カンマ区切り) -- // -- 自Winから渡すエレメント名と順番と数が対になっていること -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiSetValueParentWindowModal(thisform,thiselm,pareform,pareelm){ var opener=window.dialogArguments; if (!opener){ opener=window.opener; } var opener_form=opener.document.forms[pareform]; // 親のエレメント名の配列 parentArray_el = pareelm.split(","); // 子のエレメント名の配列 thisArray_el = thiselm.split(","); for(var i = 0;i < thisArray_el.length;i++){ var parentElement = opener_form.elements[parentArray_el[i]]; var thisElement = self.window.document.forms[thisform].elements[thisArray_el[i]]; if (parentElement && thisElement){ setElementElement(thisElement,parentElement); } } } // --------------------------------------------------------------------------------------- // -- eiSetValueParentWindowCloseModal : -- // -- 子Modalから親ウィンドウに値を返し、自Winを閉じる -- // -- (暫定版)標準Scriptにすでに存在する場合はそちらを使用すること。 -- // -- thisform: 自WinのForm名 -- // -- thiselm: 自Winから渡すエレメント名(カンマ区切り) -- // -- pareform: 親WinのForm名 -- // -- pareelm: 親Winのセットするエレメント名(カンマ区切り) -- // -- 自Winから渡すエレメント名と順番と数が対になっていること -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiSetValueParentWindowCloseModal(thisform,thiselm,pareform,pareelm){ eiSetValueParentWindowModal(thisform,thiselm,pareform,pareelm); self.window.close(); } // --------------------------------------------------------------------------------------- // -- eiSetValueParentWindowSubmitModal : -- // -- 子Modalから親ウィンドウに値を返し、親WindowsのActionを実行後、自Winを閉じる -- // -- (暫定版)標準Scriptにすでに存在する場合はそちらを使用すること。 -- // -- thisform: 自WinのForm名 -- // -- thiselm: 自Winから渡すエレメント名(カンマ区切り) -- // -- pareform: 親WinのForm名 -- // -- pareelm: 親Winのセットするエレメント名(カンマ区切り) -- // -- 自Winから渡すエレメント名と順番と数が対になっていること -- // -- nextcommand: 親WinでSubmitするコマンド -- // -- sscheck: Submit時にサーバーサイドチェック(ture/falseValidation) -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiSetValueParentWindowSubmitModal(thisform,thiselm,pareform,pareelm,nextcommand,sscheck){ var opener=window.dialogArguments; if (!opener){ opener=window.opener; } var curAction; if (pareelm != null && pareelm != undefined){ eiSetValueParentWindowModal(thisform,thiselm,pareform,pareelm); } if(sscheck=!null && sscheck != undefined && !sscheck){ curAction = opener.document.forms[pareform].action; tmpaction = curAction.split(".do"); curAction = tmpaction[0] + "_NoValidate.do"; opener.document.forms[pareform].action = curAction; } opener.document.forms[pareform].elements["command"].value = nextcommand; opener.document.forms[pareform].submit(); self.window.close(); } // --------------------------------------------------------------------------------------- // -- eiSetDateTime : -- // -- クライアントマシンの現在年月日時刻(yyyy/mm/dd hh:mm)を入力する -- // -- (暫定版)標準Scriptにすでに存在する場合はそちらを使用すること。 -- // -- obj: 年月日時刻を入力するオブジェクトのID -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiSetDateTime(obj) { var d_Now = new Date(); var d_Year = d_Now.getYear(); var d_Mon = d_Now.getMonth() + 1; var d_Day = d_Now.getDate(); var d_Hour = d_Now.getHours(); var d_Min = d_Now.getMinutes(); if(d_Mon < 10){ d_Mon = "0"+d_Mon; } if(d_Day < 10){ d_Day = "0"+d_Day; } if(d_Hour < 10){ d_Hour = "0"+d_Hour; } if(d_Min < 10){ d_Min = "0"+d_Min; } if (document.getElementById(obj)){ document.getElementById(obj).value = d_Year+"/"+d_Mon+"/"+d_Day+" "+d_Hour+":"+d_Min; } } //バルーン表示の為の固定値 var ver4 = (navigator.appVersion.charAt(0) >= "4"); var NN4 = ver4 && (navigator.appName == "Netscape"); var IE4 = ver4 && (navigator.appName.charAt(0) == "M"); var NN3 = ((navigator.appVersion.charAt(0) == "3") && (navigator.appName == "Netscape")); if(NN3) window.onerror = null; var msgPop; // --------------------------------------------------------------------------------------- // -- eiBaloonMsgShow : -- // -- バルーンを表示する -- // -- (暫定版)標準Scriptにすでに存在する場合はそちらを使用すること。 -- // -- x: バルーン表示する横位置 -- // -- y: バルーンを表示する縦位置 -- // -- msg: 表示するメッセージ(HTML) -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiBaloonMsgShow(x,y,msg) { if(NN4){ msgPop = document.layers["msgPop"]; msgPop.left = x; msgPop.top = y; msgPop.document.open(); msgPop.document.write(msg); msgPop.document.close(); msgPop.visibility = "show"; } if(IE4){ msgPop = document.all("msgPop"); msgPop.style.posLeft = x+document.body.scrollLeft; msgPop.style.posTop = y+document.body.scrollTop; msgPop.innerHTML = msg; msgPop.style.visibility = "visible"; } } // --------------------------------------------------------------------------------------- // -- eiBaloonMsgHide : -- // -- バルーンを非表示する -- // -- (暫定版)標準Scriptにすでに存在する場合はそちらを使用すること。 -- -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiBaloonMsgHide(){ if(NN4) msgPop.visibility = "hide"; if(IE4) msgPop.style.visibility = "hidden"; } // --------------------------------------------------------------------------------------- // -- eiModalWindowAction : -- // -- 新規ModalでActionを実行する -- // -- url: 実行するActionURL -- // -- command: 実行するコマンド -- // -- Wd: 子Winの幅 -- // -- Hi: 子Winの高さ -- //-- elements: 親Winから渡したいパラメーター名 -- //-- params: 子Winに渡すパラメーター名 -- // -- create by IBM -- // -- ceate date 2007/02/14 -- // -- last modified 2007/02/14 -- // --------------------------------------------------------------------------------------- function eiModalWindowAction(url,command,Wd,Hi,elements,params) { var newURL = url + "?command=" + command; var wacstoken = window.document.forms[0].elements["_TOKEN"].value; var wacsframe = window.document.forms[0].elements["_FRAMEID"].value; newURL = newURL + "&_FRAMEID=" +"EIMODAL"; newURL = newURL + "&_TOKEN=" +wacstoken; //newURL = newURL + "&_LUID="; newURL = newURL + "&_TARGETID=EIMODAL"; //newURL = newURL + "&_FRAMEID=root&_TOKEN=1250764453968"; if( typeof(Wd) == "undefined" ) Wd = "750px"; if( typeof(Hi) == "undefined" ) Hi = "500px"; //element,paramsが定義されている場合 if( typeof(elements)!="undefined" && typeof(params)!="undefined" ){ // 親のエレメント名の配列 Array_el = elements.split(","); // 子のエレメント名の配列 Array_vl = params.split(","); //エレメント要素をGETで付加 var val = ""; for(var i = 0;i < Array_el.length;i++){ var val = getElementValue(window.document.forms[0].elements[Array_vl[i]]); newURL = newURL + "&" + Array_el[i] + "=" + val; } } mw = window.showModalDialog(newURL,this,"dialogWidth=" + Wd + "; dialogHeight=" + Hi + "; status=yes ; resizable=yes"); } // --------------------------------------------------------------------------------------- // -- eiModalWindowActionWithEscape : -- // -- 新規ModalでActionを実行する(日本語文字化け対応) -- // -- url: 実行するActionURL -- // -- command: 実行するコマンド -- // -- Wd: 子Winの幅 -- // -- Hi: 子Winの高さ -- //-- elements: 親Winから渡したいパラメーター名 -- //-- params: 子Winに渡すパラメーター名 -- // -- create by IBM -- // -- ceate date 2012/10/04 -- // -- last modified -- // --------------------------------------------------------------------------------------- function eiModalWindowActionWithEscape(url,command,Wd,Hi,elements,params) { var newURL = url + "?command=" + command; var wacstoken = window.document.forms[0].elements["_TOKEN"].value; var wacsframe = window.document.forms[0].elements["_FRAMEID"].value; newURL = newURL + "&_FRAMEID=" +"EIMODAL"; newURL = newURL + "&_TOKEN=" +wacstoken; //newURL = newURL + "&_LUID="; newURL = newURL + "&_TARGETID=EIMODAL"; //newURL = newURL + "&_FRAMEID=root&_TOKEN=1250764453968"; if( typeof(Wd) == "undefined" ) Wd = "750px"; if( typeof(Hi) == "undefined" ) Hi = "500px"; //element,paramsが定義されている場合 if( typeof(elements)!="undefined" && typeof(params)!="undefined" ){ // 親のエレメント名の配列 Array_el = elements.split(","); // 子のエレメント名の配列 Array_vl = params.split(","); //エレメント要素をGETで付加 var val = ""; for(var i = 0;i < Array_el.length;i++){ var val = getElementValue(window.document.forms[0].elements[Array_vl[i]]); newURL = newURL + "&" + Array_el[i] + "=" + escapeSJIS( val ); } } mw = window.showModalDialog(newURL,this,"dialogWidth=" + Wd + "; dialogHeight=" + Hi + "; status=yes ; resizable=yes"); } //--------------------------------------------------------------------------------------- //-- eiPopupWindowAction : -- //-- 新規WindowでActionを実行する -- //-- url: 実行するActionURL -- //-- command: 実行するコマンド -- //-- Wd: 子Winの幅 -- //-- Hi: 子Winの高さ -- //-- elements: 親Winから渡したいパラメーター名 -- //-- params: 子Winに渡すパラメーター名 -- //-- create by IBM -- //-- ceate date 2007/02/14 -- //-- last modified 2007/02/14 -- //--------------------------------------------------------------------------------------- function eiPopupWindowAction(url,command,Wd,Hi,Winname,elements,params) { var newURL = url + "?command=" + command; if( typeof(Wd) == "undefined" ) Wd = "750"; if( typeof(Hi) == "undefined" ) Hi = "500"; if( typeof(Winname) == "undefined" ) Winname = "eiPopup"; w_attr = "Width=" + Wd + ",Height=" + Hi; //element,paramsが定義されている場合 if( typeof(elements)!="undefined" && typeof(params)!="undefined" ){ // 親のエレメント名の配列 Array_el = elements.split(","); // 子のエレメント名の配列 Array_vl = params.split(","); //エレメント要素をGETで付加 var val = ""; for(var i = 0;i < Array_el.length;i++){ val = getElementValue(window.document.forms[0].elements[Array_vl[i]]); newURL = newURL + "&" + Array_el[i] + "=" + escapeSJIS( val ); } } w_attr = w_attr+",menubar=yes,scrollbars=yes,status=yes,resizable=yes"; //resizable可能は、ユーザー要件 pw = window.open(newURL,Winname,w_attr); } function getElementValue(element){ var val =""; //typeがnullで要素[0]が存在するelementの場合 if(element && element.type==null && element[0]){ //radioあることを確認 if(element[0].type=="radio"){ for (var j = 0; j < element.length; j++){ //check==trueのもののvalueを取得 if(element[j].checked == true){ val = element[j].value; } } } //checkbox }else if(element.type=="checkbox"){ if(element.checked == true){ val = "on"; }else{ val = "off"; } //radio,checkbox以外の場合 }else if(element){ val = element.value; }else{ val = ""; } return val; } function setElementElement(fromElement, toElement){ var i=0; var j=0; var fromvalue; if(fromElement && toElement){ //From Pulldonw if(fromElement.type == "select-one" ){ var selectedindex = fromElement.selectedIndex; fromvalue = fromElement.options[selectedindex].value; setElementValue(toElement,fromvalue); //From Radio }else if(fromElement.type == null && fromElement[0]){ if (fromElement[0].type == "radio"){ for (i=0; i