/* (SMMNW04703.xrw - JScript ) - Version : 1) : Ver.1.00.01 - Desc : ÇǺοåâ»óó±â·Ï÷ºÎÆÄÀÏ È­¸é¿¡¼­ »ç¿ëÇÏ´Â ½ºÅ©¸³Æ® */ var isUpdated = false; /** * @group : * @ver : 2008.05.31 * @by : dhkim * @------------------------------------------------------- * @type : function * @access : public * @desc : È­¸éÀ» ÃʱâÈ­ÇÑ´Ù. È­¸é·ÎµùÀÌ ³¡³­ ½ÃÁ¡¿¡ È£ÃâµÈ´Ù. * @param : * @return : * @------------------------------------------------------- */ function fInit(){ model.removeNodeset("/root/main/list/reportlist"); model.removeNodeset("/root/send/attach"); model.resetInstanceNode("/root/send"); var pid = opener.javascript.getParameter('pid'); var grupcd = opener.javascript.getParameter('grupcd'); var obsrecseq = opener.javascript.getParameter('obsrecseq'); //alert(pid + grupcd + obsrecseq); if(pid != '' && grupcd != '' && obsrecseq != ''){ model.removenode('/root/init'); model.makeValue('/root/init/pid', pid); model.makeValue('/root/init/grupcd', grupcd); model.makeValue('/root/init/obsrecseq', obsrecseq); fSearch(); }else{ messageBox('È­¸éÀ» ÃʱâÈ­ ÇÒ ¼ö', 'I004'); } } /** * @group : * @ver : 2008.05.31 * @by : dhkim * @------------------------------------------------------- * @type : function * @access : public * @desc : Á¶°Ç¿¡ ÇØ´çÇϴ ÷ºÎÆÄÀÏÀ» Á¶È¸ÇÑ´Ù. * @param : * @return : * @------------------------------------------------------- */ function fSearch(){ model.removenode('/root/send'); model.makenode('/root/send'); model.copyNode('/root/send', '/root/init'); /*//±×¸®µå ÃʱâÈ­°¡ ¾ÈµÇ¼­ ÀӽùæÆí.. ¼öÁ¤ÇÒ°Í! for(var i = 1; i <= grd_report.rows; i++){ grd_report.deleteRow(i); } //±×¸®µå ÃʱâÈ­°¡ ¾ÈµÇ¼­ ÀӽùæÆí.. ¼öÁ¤ÇÒ°Í! for(var i = 1; i <= grd_attach.rows; i++){ grd_attach.deleteRow(i); }*/ if(!submit('TRMNW04704')){ messageBox('÷ºÎÆÄÀÏ Á¶È¸¸¦', 'E009'); }else{ model.refresh(); } } /** * @group : * @ver : 2008.06.16 * @by : dhkim * @------------------------------------------------------- * @type : function * @access : public * @desc : ÷ºÎÆÄÀÏÀ» ±×¸®µå¿¡ Ãß°¡ÇÑ´Ù. * @param : * @return : * @------------------------------------------------------- */ function fAddRow(){ var maxsize = upload1.attribute("filesize"); files = window.fileDialog("open", "|", true); filelist = files.split("|"); for(var i = 0 ; i < filelist.length ; i++ ) { grd_attach.addRow(false); grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i]; grd_report.addRow(false); grd_report.valueMatrix(grd_report.rows - 1, 0) = filelist[i]; if (!checkFileSize(upload1)){ grd_attach.removeItem(); grd_report.removeItem(); messageBox("ÆÄÀÏ Å©±â°¡ ÃÖ´ëÄ¡("+maxsize+"Byte)¸¦", "E003"); }else{ isUpdated = true; } } } /** * @group : * @ver : 2008.06.16 * @by : dhkim * @------------------------------------------------------- * @type : function * @access : public * @desc : ÷ºÎÆÄÀÏÀ» ÀúÀåÇÑ´Ù. * @param : * @return : * @------------------------------------------------------- */ function fSave(){ if(grd_report.rows < 1 || !isUpdated){ return; } if(submit("TXMNW04701")) { model.removeNodeset("/root/send/attach"); model.resetInstanceNode("/root/send/title"); model.refresh(); }else{ messageBox('÷ºÎÆÄÀÏ ÀúÀåÀ»', 'E009'); return ; } } /** * @group : * @ver : 2008.06.16 * @by : dhkim * @------------------------------------------------------- * @type : function * @access : public * @desc : ¼±ÅÃÇÑ Ã·ºÎÆÄÀÏÀ» »èÁ¦ÇÑ´Ù. * @param : * @return : * @------------------------------------------------------- */ function fDelete(cur_row){ if(cur_row < 0){ messageBox('»èÁ¦ÇÒ ÆÄÀÏÀ»', 'C002'); return; }else{ var rptid = model.getValue("/root/main/list/reportlist["+cur_row+"]/reportid"); var pid = model.getValue("/root/main/list/reportlist["+cur_row+"]/pid"); var grupcd = model.getValue("/root/main/list/reportlist["+cur_row+"]/grupcd"); var obsrecseq = model.getValue("/root/main/list/reportlist["+cur_row+"]/obsrecseq"); var filenm = model.getValue("/root/main/list/reportlist["+cur_row+"]/filenm"); var filesize = model.getValue("/root/main/list/reportlist["+cur_row+"]/filesize"); var filetype = model.getValue("/root/main/list/reportlist["+cur_row+"]/filetype"); var filepath = model.getValue("/root/main/list/reportlist["+cur_row+"]/filepath"); //alert(rptid + ', ' + pid+ ', ' + grupcd + ', ' + obsrecseq + ', ' + filenm + ', ' + filesize + ', ' + filetype + ', ' + filepath); model.removenode("/root/send"); model.makeValue('/root/send/reportid', rptid); model.makeValue('/root/send/pid', pid); model.makeValue('/root/send/grupcd', grupcd); model.makeValue('/root/send/obsrecseq', obsrecseq); model.makeValue('/root/send/filenm', filenm); model.makeValue('/root/send/filesize', filesize); model.makeValue('/root/send/filetype', filetype); model.makeValue('/root/send/filepath', filepath); if(!submit("TXMNW04702")){ messageBox('÷ºÎÆÄÀÏÀÇ »èÁ¦¸¦', 'E009'); } } } /** * @group : * @ver : 2008.05.31 * @by : dhkim * @------------------------------------------------------- * @type : function * @access : public * @desc : ÀúÀåµÇ Àִ ÷ºÎÆÄÀÏÀ» ´Ù¿î·Îµå ÇÑ´Ù. * À̹ÌÁö°¡ ¾Æ´Ï¸é pc¿¡ ¹Ì¸® ÀúÀåÇÑ ÈÄ ÆÄÀÏÀ» ¿¬´Ù.(¹Ì±¸Çö) * @param : * @return : * @------------------------------------------------------- */ function fDownLoad(){ //ÀúÀåµÇ¾î ÀÖ´Â ÆÄÀϸ¸ ¿­ ¼ö ÀÖ´Ù. if(model.getValue('/root/main/list/reportlist[' + (grd_report.row) + ']/reportid') != ''){ //alert(getActionURL("TRMNW04706")); var idx = grd_report.row; var filepath = model.getValue("/root/main/list/reportlist["+idx+"]/filepath"); var filenm = model.getValue("/root/main/list/reportlist["+idx+"]/filenm"); //var isImg = fIsImg(filenm); var realfile = getActionURL("TRMNW04706") + "&filepath=" + filepath; var localfile = window.fileDialog("save", "|", false, filenm, "", "All Files(*.*)|*.*"); if (localfile != "") { model.download(realfile, localfile); window.exec(localfile); } /* if(isImg){ alert(realfile); return; window.exec(realfile); }else{ var localfile = window.fileDialog("save", "|", false, filenm, "", "All Files(*.*)|*.*"); if (localfile != "") { model.download(realfile, localfile); window.exec(localfile); } } */ } } /** * @group : * @ver : 2008.05.31 * @by : dhkim * @------------------------------------------------------- * @type : function * @access : public * @desc : ÇØ´ç ÆÄÀÏ È®ÀåÀÚ°¡ À̹ÌÁö ÆÄÀÏÀÎÁö ¾Æ´ÑÁö ÆÇ´ÜÇÑ´Ù. * @param : * @return : * @------------------------------------------------------- */ function fIsImg(file){ var pos = file.toString().lastIndexOf('.'); var ext = file.toString().substring(pos+1).toLowerCase(); if(ext != 'jpg' || ext != 'jpeg' || ext != 'bmp' || ext != 'gif' || ext != 'png' || ext != 'tif' || ext != 'tiff' || ext != 'tga' || ext != 'pdf' || ext != 'psd' || ext != 'cdr' || ext != 'drw' || ext != 'dxf' || ext != 'kdc' || ext != 'pcd' || ext != 'swf'){ //alert('img'); return true; }else{ //alert('is not img'); return false; } }