/* 엘리먼트를 리턴 */ 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 * */ callUrl : function(url, urlQuery, syncType, protocol) { var params; if(!protocol) protocol = "GET"; if (typeof(urlQuery) != 'string') { params = urlQuery; urlQuery = ''; protocol = "POST"; } else { url = url + "?" + urlQuery; } if (syncType != 'async') { var result; DU.LConnect.syncRequest(protocol, url, { success : function(e) { result = e.responseText; }, failure : function(e) { result = e.responseText; } }, params); return result; } else { DU.LConnect.asyncRequest(protocol, url, { success : function(e) { }, failure : function(e) { } }, params); } }, /** * @description DB 조회를 통해 특정 값을 조회 * @param qId * util.xml에 명시된 navi ID * @param param * 호출 param * @return String * @author PBF *
	 * 
*/ 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"; document.getElementById(aAttachFile + "item").insertAdjacentHTML("afterEnd", str); } } function cfFileDelete(aAttachFile) { var objCnt = aAttachFile.substring("attachFile".length, aAttachFile.length); var dataSet = eval('ds_' + aAttachFile); if(dataSet.isInsertRow(dataSet.getRow()) == true) { dataSet.removeAt(dataSet.getRow()); } else { var fileSeq = dataSet.getAt(dataSet.getRow()).get("fileSeq"); if(!fileSeq) return; if(confirm('파일을 삭제하시겠습니까?')){ document.getElementById("deleteList" + objCnt).value = document.getElementById("deleteList" + objCnt).value + "," + fileSeq; dataSet.removeAt(dataSet.getRow()); } } } function cfMultiUploadFile( dataSet, aCallbackFunction, aPolicy ) { // 첨부파일 묶음 max 번호 추출 var maxCnt; for(maxCnt=5;maxCnt>0;maxCnt--){ try { var dsName = ""; if(maxCnt == 1) dsName = "ds_attachFile"; else dsName = "ds_attachFile" + maxCnt; if(eval(dsName)) { break; } } catch (e) { } } for(var j=0;j -1; inx--) { if (dataSet.isRowSelectMark(inx)) { dataSet.removeAt(inx); cnt++; } } if(dataSet.getRow() < 0) return; if(cnt == 0) { dataSet.removeAt(dataSet.getRow()); } } /** * @type : function * @access : public * @desc : 드리드 엑셀 파일 다운로드 */ function cfDownloadTempExcel(aDataSet, aBtnDownload) { var tm = new DU.data.LTransactionManager(); tm.on('success', function(e) { var serverFileName = e.responseText; cfGetPoppyFrame(document).src = '/pbf/common/file/ExportTempExcel.dev?event=download&serverFileName=' + serverFileName; }); tm.on('failure', function(e) { errorMsg = DU.trim(e.responseText); if(errorMsg == "") { errorMsg = gMm.get('$.base.msg101'); } DU.alert(errorMsg); }); var btnDownload = new DU.widget.LPbfButton(aBtnDownload); btnDownload.on('click', function(){ DU.confirm({text:cfAlertMsg('pbf.cfm.com.export'),handlerYes:function(){ for(var j=0;j