123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378 |
- /**
- * @---------------------------------------------------
- * @desc : 입력/수정 모드에 따라 답변 컨트롤을 활성화 시킨다.
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fDisableMainDataControls(disabled)
- {
- //tar_fstrpttxt.editable = disabled;
- //tar_rpttxt.editable = disabled;
- }
- /**
- * @---------------------------------------------------
- * @desc : 추가할 수 있게 초기화
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fInsertMode()
- {
- model.setValue("/root/main/mode/modelabel", "사용자요구사항>등록");
- model.setValue("/root/main/mode/modestatus", "insert");
- fInitMainData(false);
- // 현재 세션정보 저장
- model.setValue("/root/main/data/posinstnm", getUserInfo("posinstnm"));
- model.setValue("/root/main/data/posdeptnm", getUserInfo("posdeptnm"));
- model.setValue("/root/main/data/usernm", getUserInfo("usernm"));
- model.setValue("/root/main/data/userid", getUserInfo("userid"));
- }
- /**
- * @---------------------------------------------------
- * @desc : 수정할 수 있게 초기화
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fUpdateMode()
- {
- model.setValue("/root/main/mode/modelabel", "사용자요구사항>수정");
- model.setValue("/root/main/mode/modestatus", "update");
- fInitMainData(true);
-
- model.setValue("/root/main/data/updateuserid", getUserInfo("userid"));
- }
- /**
- * @---------------------------------------------------
- * @desc : 파일 더블클릭시 파일 다운받아서 열기
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fFileExcute(host, port, user, pass, pathRemote, filename)
- {
- var fso, folder;
- var temp_path = "C:\\tempReq";
- var pathLocal;
-
- FSO = new ActiveXObject("Scripting.FileSystemObject");
- // 객체 생성 실패하면 리턴
- if (FSO == null)
- {
- return;
- }
- // 시스템 드라이브가 없다면..
- if (FSO.DriveExists("C") == false)
- {
- return;
- }
- // 임시디렉토리가 없으면 생성
- if (FSO.FolderExists(temp_path) == false)
- {
- folder = FSO.CreateFolder(temp_path);
- }
- // 로컬 경로
- pathLocal = temp_path + "\\" + filename;
- if (FSO.FileExists (pathLocal) == false)
- {
- var ret = getFiles(host, port, user, pass, pathRemote, pathLocal);
- }
-
- // 파일 열기
- window.exec(pathLocal, "");
- }
- /**
- * @---------------------------------------------------
- * @desc : ftp 파일 다운로드
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function getFiles(host, port, user, pass, pathRemote, pathLocal)
- {
- var result;
-
- objSFT.Host = host;
- objSFT.Port = port;
- objSFT.Account = user;
- objSFT.Password = pass;
- objSFT.Connect();
-
- if(objSFT.IsOnline() == false) return false;
-
- //alert("pathRemote : " + pathRemote + "\npathLocal : " + pathLocal);
-
- result = objSFT.GetFiles(pathRemote, pathLocal);
- objSFT.Close();
-
- return result;
- }
- /**
- * @---------------------------------------------------
- * @desc : ftp 파일 업로드
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function putFiles(host, port, user, pass, pathRemote, pathLocal)
- {
- var result;
-
- objSFT.Host = host;
- objSFT.Port = port;
- objSFT.Account = user;
- objSFT.Password = pass;
- objSFT.Connect();
-
- if(objSFT.IsOnline() == false) return false;
- //alert("pathRemote : " + pathRemote + "\npathLocal : " + pathLocal);
-
- result = objSFT.PutFile(pathRemote, pathLocal);
- objSFT.Close();
-
- return result;
- }
- /**
- * @---------------------------------------------------
- * @desc : ftp 파일 삭제
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function delRemoteFiles(host, port, user, pass, pathRemote)
- {
- var result;
-
- objSFT.Host = host;
- objSFT.Port = port;
- objSFT.Account = user;
- objSFT.Password = pass;
- objSFT.Connect();
-
- if(objSFT.IsOnline() == false) return false;
- result = objSFT.DeleteFile(pathRemote);
- objSFT.Close();
-
- return result;
- }
- /**
- * @---------------------------------------------------
- * @desc : 데이터 입력 전 null 값 체크
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fValueCheck()
- {
- var tmp;
-
-
- tmp = model.getValue("/root/main/data/instcd");
- if (tmp == "") {
- messageBox("발의기관은","I003");
- model.setFocus("combo4");
- return false;
- }
-
- tmp = model.getValue("/root/main/data/reqdeptnm");
- if (tmp == "") {
- messageBox("요청부서는","I003");
- model.setFocus("ipt_reqdeptnm");
- return false;
- }
-
- tmp = model.getValue("/root/main/data/requsernm");
- if (tmp == "") {
- messageBox("요청자명은","I003");
- model.setFocus("ipt_requsernm");
- return false;
- }
-
- tmp = model.getValue("/root/main/data/telno");
- if (tmp == "") {
- messageBox("전화번호는","I003");
- model.setFocus("ipt_telno");
- return false;
- }
-
- tmp = model.getValue("/root/main/data/reqgubun");
- if (tmp == "") {
- messageBox("요청구분은","I003");
- model.setFocus("combo5");
- return false;
- }
-
- tmp = model.getValue("/root/main/data/impcd");
- if (tmp == "") {
- messageBox("중요도는","I003");
- model.setFocus("combo6");
- return false;
- }
-
- tmp = model.getValue("/root/main/data/prcstitl");
- if (tmp == "") {
- messageBox("요청제목은","I003");
- model.setFocus("ipt_prcstitl");
- return false;
- }
-
- tmp = model.getValue("/root/main/data/prcsmsg");
- if (tmp == "") {
- messageBox("요청내용은","I003");
- model.setFocus("tar_prcsmsg");
- return false;
- }
-
- tmp = model.getValue("/root/main/data/reqpart");
- if (tmp == "") {
- messageBox("요청분야는","I003");
- model.setFocus("ipt_reqpart");
- return false;
- }
-
- tmp = model.getValue("/root/main/data/appinst");
- if (tmp == "") {
- messageBox("적용병원은 ","I003");
- model.setFocus("input3");
- return false;
- }
-
-
-
-
- return true;
-
-
-
- }
- /**
- * @---------------------------------------------------
- * @desc : 세자리로 폴더명 맞추기 위한 함수. 세자리가 안넘으면 세자리로 맞추고, 넘으면 뒤에 세자리로 맞춘다.
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function flpad(str,n,ch) {
-
- str = String(str);
- var result = "";
- var len = str.length;
-
- if ( len < n )
- {
- for ( var i=0; i<(n-len); i++ )
- {
- result += ch;
- }
-
- result += str;
- }
- else
- {
- result = str.substring(str.length-3);
- }
-
- return result;
- }
- function fCheckFileOpen(filepath){
- var fso;
- fso = new ActiveXObject("Scripting.FileSystemObject");
-
- // 객체 생성 실패하면 리턴
- if (fso == null)
- {
- return;
- }
-
- if (fso.FileExists(filepath) == false)
- {
- return;
- }
-
-
- var strFileName, strFilePath, strTmpFile, strExt;
- strExt = fso.GetExtensionName (filepath);
- strFilePath = fso.GetParentFolderName (filepath);
- strFileName = fso.GetFileName (filepath);
-
- if (strExt.toUpperCase() == "DOC" || strExt.toUpperCase() == "DOCX" ){
- strTmpFile = "~$" + strFileName.substring(2, getStringLength(strFileName));
- strTmpFile = strFilePath + "\\" + strTmpFile;
- if ( fso.FileExists(strTmpFile) ) {
- messageBox("파일이 오픈되어 있어 첨부", "E001");
- fso = null;
- return false;
- }
- }
-
- if (strExt.toUpperCase() == "XLSX" || strExt.toUpperCase() == "PPTX" ){
- strTmpFile = "~$" + strFileName;
- strTmpFile = strFilePath + "\\" + strTmpFile;
- if ( fso.FileExists(strTmpFile) ) {
- messageBox("파일이 오픈되어 있어 첨부", "E001");
- fso = null;
- return false;
- }
- }
-
-
- if( strExt.toUpperCase() == "XLS" || strExt.toUpperCase() == "PPT"){
- if(messageBox("파일이 오픈되어 있는지 확인할 수 없으니 열려있다면 파일을 닫고 진행하여 주십시요.", "Q003") == 7){
- fso = null;
- return false;
- }
- }
-
- fso = null;
-
- return true;
- }
|