/* 엘리먼트를 리턴 */
function $(element_id) {
var obj;
if(DU.browser.msie) {
obj = document.getElementById(element_id);
if(obj == null) {
obj = document.all[element_id]; // w3c 비표준
}
} else {
obj = document.getElementById(element_id);
if(obj == null) {
obj = document.getElementsByName(element_id)[0];
}
}
return obj;
}
/* 엘리먼트(또는 엘리먼트들)을 리턴 */
function $N(element_name) {
return document.getElementsByName(element_name);
}
/* 엘리먼트의 값을 리턴 */
function $F(element_id) {
return $(element_id).value;
}
/**
* @type : function
* @access : public
* @desc : LButton를 확장한 권한 버튼
*
*
* LAuthButton ** * @param : * @author : 홍두희 */ DU.widget.LAuthButton = function(p_oElement, p_oAttributes) { DU.widget.LAuthButton.superclass.constructor.call(this, p_oElement, p_oAttributes); this.initAuthButton(p_oElement, p_oAttributes); }; DU.extend(DU.widget.LAuthButton, DU.widget.LButton, { /** * @description 권한 버튼을 초기화하는 메소드 * @protected * @param p_oElement * dom 객체 * @param p_oAttributes * 추가 속성 객체 * @return {void} * @author 홍두희 */ initAuthButton : function(p_oElement, p_oAttributes) { if (!this.isAuth(p_oElement, p_oAttributes)) { this.destroy(); } }, isAuth : function(p_oElement, p_oAttributes) { return true; } }); /** * @type : function * @access : public * @desc : LButton를 확장한 PBF 버튼
* LPbfButton ** * @param : * @author : 홍두희 */ DU.widget.LPbfButton = function(p_oElement, p_oAttributes) { DU.widget.LPbfButton.superclass.constructor.call(this, p_oElement, p_oAttributes); }; /** * @type : function * @access : public * @desc : 특정 div 내의 버튼을 찾아 쿠키안의 권한을 가지고 버튼을 활성화 한다.
* isAuth ** * @param : * @author : 홍두희 */ DU.extend(DU.widget.LPbfButton, DU.widget.LAuthButton, { isAuth : function(p_oElement, p_oAttributes) { var strAuth = getCookie("pbf.servlet.userAuth"); //var strAuth = DU.util.LCookie.get("pbf.servlet.userAuth"); if(strAuth != null) strAuth = strAuth.simpleReplace("\"", ""); if (strAuth == null || strAuth == "" || strAuth == '\"\"') return true; var arryAuth = strAuth.split(":"); var bChk = false; switch (p_oElement) { case "btnRetrieve" : if (arryAuth[0] == "R") bChk = true; break; case "btnCreate" : if (arryAuth[1] == "C") bChk = true; break; case "btnSave" : if (arryAuth[2] == "U") bChk = true; break; case "btnDelete" : if (arryAuth[3] == "D") bChk = true; break; case "btnPrint" : if (arryAuth[4] == "P") bChk = true; break; case "btnNavi" : if (arryAuth[5] == "N") // 화면 네비게이션 bChk = true; break; case "btnUpload" : if (arryAuth[6] == "W") // 파일 업로드 bChk = true; break; case "btnDownload" : if (arryAuth[7] == "X") // 파일 업로드 bChk = true; break; case "btnApproveYn" : if (arryAuth[8] == "Q") // 승인 bChk = true; break; case "btnDecideYn" : if (arryAuth[9] == "A") // 확정 bChk = true; break; default : bChk = true; } return bChk; } }); /** * @type : function * @access : public * @desc : Common Code List를 위한 LCombo 확장 PBF 콤보
* LPbfCDataSet ** * @param : * @author : 홍두희 */ DU.data.LPbfCDataSet = function(aCode, aId) { var aType; if(!aId) { aId = aCode; aType = 'grid'; } DU.data.LPbfCDataSet.superclass.constructor.call(this, { id:aId, fields:[ {id:'code'}, {id:'value'} ], code:aCode, type:aType }); }; DU.extend(DU.data.LPbfCDataSet, DU.data.LJsonDataSet, { /** * @description Common Code list DataSet을 갖는 LCombo를 반환하는 메소드 * @protected * @param aConfig * Config 객체 * @return LCombo 객체 * @author 윤순혁 * *
* 인자 Config 객체는 일반 LCombo의 생성자 Properties와 동일하게 사용해야한다. * 단, appSysCode Combo(Code Id : APPS000000)의 경우 PBF 고유 옵션을 우선으로 적용한다. * PBF 고유 옵션은 du_config.js의 'project.appSysCodeCombo.defaultProperties' 에서 변경 가능하다. ** */ getCombo : function(aConfig) { var oDsConfig = {}; var oCoConfig = aConfig || {}; oCoConfig.dataSet = this; if (DU.util.LString.startsWith(this.code, '/')) { oDsConfig.url = this.code; oDsConfig.params = {}; oDsConfig.method = 'GET'; } else { oDsConfig.url = '/pbf/common/util/RetrieveCodeList.ajax'; oDsConfig.params = { codeGroup : this.code }; } oDsConfig.sync = true; oCoConfig.id = this.id; if (this.type != 'grid') { var sidCodeId = DU.getConfig().get("$.project.appSysCodeCombo.codeGroup.id") || 'APPS000000'; if (this.code.indexOf(sidCodeId) > -1) { DU.util.LDom.applyIfProperties(oCoConfig, "$.project.appSysCodeCombo");// PBF 고유 옵션으로 세팅 } oCoConfig.applyTo = this.id; } var combo = new DU.widget.LCombo( oCoConfig ); this.load( oDsConfig ); return combo; }, getRadio : function(aConfig) { var url = '/pbf/common/util/RetrieveCodeList.ajax?codeGroup=' + this.code; var result; DU.LConnect.syncRequest("POST", url, { success : function(e) { result = e.responseText; }, failure : function(e) { result = e.responseText; } }); var bChk = true; var config; if (!DU.isEmpty(result)) { var data = eval('(' + result + ')'); data = data[0].records; if(data.length == 0) { bChk = false; } else { var str = '{"items":['; for(var i=0;i
**/ getSingleData : function(qId, urlQuery) { var strRslt = ''; var params; if (typeof(urlQuery) != 'string') { params = urlQuery; urlQuery = ''; } DU.LConnect.syncRequest('post', "/pbf/common/util/RetrieveSingleData.ajax?qId=" + qId + "&qUrlQuery=" + urlQuery, { success : function(e) { strRslt = e.responseText; }, failure : function(e) { strRslt = e.responseText; } }, params); if(strRslt.indexOf('pbf.err.com.noAuthen') > -1) { cfAlertMsg('pbf.err.com.noAuthen'); var task = new DU.util.LDelayedTask(function(){ document.location.href = "/index.html"; }); task.delay(5000); } else if(strRslt.indexOf('pbf.err.com.noAuth') > -1) { cfAlertMsg('pbf.err.com.noAuth'); } return strRslt.trim(); } }); function cfAlertMsg(code, paramArray) { if (!DU.isValue(code) || !DU.isString(code)) { DU.alert(gMm.get('$.base.msg052')); return null; } var msg = cfGetMsg(code, paramArray); DU.alert(msg); return msg; } function cfGetMsg(code, paramArray) { try { code = code.simpleReplace(".", "_"); return (!DU.isValue(paramArray) || !DU.isArray(paramArray)) ? gMm .get('$.message.' + code) : gMm.get('$.message.' + code, paramArray); } catch (e) { return 'Not found message!!!'; } } function cfRetrieveAttach(aAttachFile, atchFileBunchNo) { var objCnt = aAttachFile.substring("attachFile".length, aAttachFile.length); var dataSet = eval('ds_' + aAttachFile); document.getElementById(aAttachFile + 'item').innerHTML = ""; cfGetInputFile(aAttachFile, 0); document.getElementById("atchFileBunchNo" + objCnt).value = atchFileBunchNo; if(atchFileBunchNo == '') { dataSet.clearData(); } else { dataSet.load({ url : '/pbf/common/file/retrieveFileList.ajax', params : {atchFileBunchNo : atchFileBunchNo, appSysCode : gAppSysCode} }); } } function cfCleanAttach(aAttachFile) { var objCnt = aAttachFile.substring("attachFile".length, aAttachFile.length); document.getElementById("atchFileBunchNo" + objCnt).value = ""; cfRetrieveAttach(aAttachFile, ''); document.getElementById(aAttachFile + "item").innerHTML = ""; cfGetInputFile(aAttachFile, 0); } function cfResetAttach(aAttachFile) { document.getElementById(aAttachFile + "item").innerHTML = ""; cfGetInputFile(aAttachFile, 0); } function cfAttach(aAttachFile, fileSeq) { var dataSet = eval('ds_' + aAttachFile); var obj = document.getElementById(aAttachFile + "_" + fileSeq); if (dataSet.attachLimit > 0) { if (dataSet.getCount() >= dataSet.attachLimit) { DU.alert('최대 첨부파일 갯수를 초과하였습니다.(' + dataSet.attachLimit + ')'); cfResetAttach(aAttachFile); return; } } var val = obj.value; var localFileName = val.substring(val.lastIndexOf("\\")+1, val.length); if (dataSet.getCount() > 0) { for(var j=0;j
* params[0] = 'programCode=RETURNURL2010041502'; // 결재 연동 프로그램 코드 (필수) * params[1] = 'appSysCode=co'; // 시스템 코드 (필수) * params[2] = 'elapId=' + dataSet.getNameValue(dataSet.getRow(), 'elapId'); // 결재 문서 번호 * params[3] = 'atchFileBunchNo=117'; // 첨부파일 묶음 번호 * var ozrParams = new Array(); //폼파라미터 * var odiParams = new Array(); //ODI파라미터 * ozrParams[0] = 'par1=' + dataSet.getNameValue(dataSet.getRow(), 'num'); * ozrParams[1] = 'par2=val2'; * odiParams[0] = 'par3=' + dataSet.getNameValue(dataSet.getRow(), 'num'); * odiParams[1] = 'par4=val4'; * cfApprRequestView(params, ozrParams, odiParams); ** @param : params */ function cfApprRequestView(params, ozrParams, odiParams, eapprMode) { var url = '/pbf/ext/common/eappr/RequestApproval.eappr?' + cfGetUrlWithParam(params); if(ozrParams) url += '&' + cfGetOzParam('ozrParamVal', ozrParams); if(odiParams) url += '&' + cfGetOzParam('odiParamVal', odiParams); var h=800; var w=900; var left = (screen.width - w)/2; var top = 100; //(screen.height - h)/2; if(gEapprMode == 'real') { if(!eapprMode || eapprMode == 'test') { var apprViewWindow = window.open(url, "apprViewTarget", "height="+h+",width="+w+",left="+left+",top="+top+",status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes"); } else { cfGetPoppyFrame(document).src = url; } } else { var apprViewWindow = window.open(url, "apprViewTarget", "height="+h+",width="+w+",left="+left+",top="+top+",status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes"); } } /** * @type : function * @access : public * @desc : url에서 param의 value 가져오기 *
cfGetUrlParam("http:~~", "menuCd"); ** @author : 홍두희 */ function cfGetUrlParam(aUrl, aCol){ var strRslt = ""; if(aUrl.indexOf("?") > 0) { var tmp = aUrl.substring(aUrl.indexOf("?") + 1, aUrl.length); var tmpArry = tmp.split("&"); for(i=0;i
* ex) cfOzReportByDB(reportFileNm, exParam, isOpenWindow, innerObj, width, height, option, win) **/ function cfOzReportByDB(reportFileNm, ozrParams, odiParams, isOpenWindow, innerObj, width, height, option, win) { var url = cfOzReportUrl(reportFileNm, ozrParams, odiParams); // 고정 width = 820; height = 650; cfOzReportView(url, reportFileNm, ozrParams, odiParams, null, isOpenWindow, innerObj, width, height, option, win); } /** * @type : function * @access : public * @desc : 오즈 뷰어용 url 얻어오기 * *
* cfOzReportUrl(params); ** * @param : * params */ function cfOzReportUrl(reportFileNm, ozrParams, odiParams) { var url = $reportUrl + ':' + $reportPort + '/common/ozReport/dbReport.jsp?ozrName=' + reportFileNm; if (ozrParams) url += '&ozrParamVal=' + cfGetUrlWithParam(ozrParams, '^'); if (odiParams) url += '&odiParamVal=' + cfGetUrlWithParam(odiParams, '^'); return url; } function cfOzReportView(actionUrl, reportFileNm, ozrParams, odiParams, rdData, isOpenWindow, innerObj, width, height, option, win) { var target = ""; var mainObj = null; if(typeof(innerObj) == "undefined" || innerObj == null){ mainObj = document; }else{ mainObj = innerObj; } if(typeof(isOpenWindow) == "undefined") isOpenWindow = true; if(isOpenWindow){ if(typeof(width) == "undefined") width = screen.width/2 + 100; if(typeof(height) == "undefined") height = screen.height/2 + 100; var top = (screen.height-height)/2; var left = (screen.width-width)/2; target = "reportTargetWindow"; if(win == null){ window.open("/common/include/blank.jsp", target, "top="+top+", left="+left+", height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no"); }else{ win.window.open("/common/include/blank.jsp", target, "top="+top+", left="+left+", height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no"); } } else { if(typeof(width) == "undefined") width="100%"; if(typeof(height) == "undefined") height="460px"; if(typeof(mainObj.id) != "undefined"){ target = "reportTargetFrame_" + mainObj.id; }else{ target = "reportTargetFrame"; } if(typeof($("reportContents")) == "undefined"){ iFrame = null; if(typeof(innerObj) == "undefined" || innerObj == null){ iFrame = document.createElement("