// 솔루션 기본 이메일 정규식 보완 var EXPR_EMAIL_EXT="^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$"; function getSerializeParamObject(formObj) { var ret = {}; if($(formObj).length==0) return ret; var array = $(formObj).serializeArray(); if(array==null || array.length==0) return ret; for(var i= 0, iEnd=array.length; i"+defaultLabel+""); } var appendOptions = function(ctrl, begin, end, append, selectValue) { for(var i=begin; append > 0 ? i<=end : i>=end ; i+=append ) { ival = (i<10?'0':'')+i; sval = i==(selectValue!=null?selectValue:'') ? ' selected' : ''; $(ctrl).append(""); } } if(isValidCtrl(ctrlYear)) { var today = new Date(); appendDefaultOption(ctrlYear, defLabel, defValue); appendOptions(ctrlYear, today.getFullYear()-10, 1900, -1, selectYear); } if(isValidCtrl(ctrlMonth)) { appendDefaultOption(ctrlMonth, defLabel, defValue); appendOptions(ctrlMonth, 1, 12, 1, selectMonth); } if(isValidCtrl(ctrlDay)) { appendDefaultOption(ctrlDay, defLabel, defValue); appendOptions(ctrlDay, 1, 31, 1, selectDay); } bindBreakBackspaceKeyDown(ctrlYear); bindBreakBackspaceKeyDown(ctrlMonth); bindBreakBackspaceKeyDown(ctrlDay); } function bindBreakBackspaceKeyDown(ctrl) { $(ctrl).keydown(function f(){ if(event.keyCode == 8){ if(event.preventDefault) event.preventDefault(); else event.returnValue = false; } }); } // 실제 달력에 존재하는 년/월/일인지 체크 function isValidYmd(year, month, day) { var check = toDate(year + '-' + month + '-' + day); return check.format('yyyyMMdd') == year+month+day; } function toDate(val) { return val ? new Date(val.substring(0, 4), parseInt(val.substring(5, 7), 10)-1, val.substring(8, 10)) : new Date(); } // 담당자 선택 팝업 function popupUser() { return _openModalWin(WebUtil.getContextUrl('portal/common/org.do')+'?mode=popupUser', 550, 450); } // 담당자 선택 팝업 : 특정 그룹 관리자 선택 function popupGroupManager(groupCode) { return _openModalWin(WebUtil.getContextUrl('portal/common/org.do')+'?mode=popupGroupManager&groupCode='+groupCode, 550, 450); } function popupSelectGroupOrg() { return _popupSelectGroupTree('ELAND', 'ORG'); } function popupSelectGroupCem() { return _popupSelectGroupTree('ELAND', 'CEM'); } function popupSelectGroupEmp() { return _popupSelectGroupTree('ELAND', 'EMP'); } function popupSelectGroupCmp() { return _popupSelectGroupTree('ELAND', 'CMP'); } function _popupSelectGroupTree(domainCode, typeCode, parentGroupCode) { var mode = typeCode=='CEM'?'popupCemGroupTree':'popupGroupTree'; var url = WebUtil.getContextUrl('portal/common/org.do?mode=' + mode); if(domainCode != null && typeof(domainCode) != 'undefined') url += ('&domain=' + domainCode); if(typeCode != null && typeof(typeCode) != 'undefined') url += ('&type=' + typeCode); if(parentGroupCode != null && typeof(parentGroupCode) != 'undefined') url += ('&group=' + parentGroupCode); return _openModalWin(url, 300, 400); } function _openModalWin(url, width, heigth, args, params) { args = typeof(args) == 'undefined' || args == null ? new Object() : args; var features = null; if(typeof(params) == 'undefined' || params == null) { var sb = new StringBuffer(), cnt = 0; for (var param in params) { if (cnt++ > 0) sb.append(";"); sb.append(param).append(":").append(encodeURIComponent(eval('params.' + param))); } features = sb.append(';dialogWidth:').append(width).append('px;dialogHeight:').append(heigth).append('px;').toString(); } else { features = 'dialogWidth:'+width+'px;dialogHeight:'+heigth+'px;scroll:no;status:no;help:no;scrollbars:no'; } return window.showModalDialog(url, args, features); } function isStrNotNull(val) { return val!=undefined && val!=null && val!='' && val!='null'; }