/* - ¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì À̹ÌÁöSET°ü¸® ( SMMRF04400_À̹ÌÁöSET.xrw - JScript ) - Version : 1) : Ver.1.00.01 * ¼öÁ¤ÀÌ·Â: 2008-11-26 fFormInit() °úÄÚµå ºÒ·¯¿À´Â ÇÔ¼ö ÆÄ¶ó¹ÌÅÍ º¯°æ. 2009-04-09 ¿ÀÈÄ 1:23:54 °­ÁöÈÆ - TRMRF04402¸¦ Áß¾ÓÀÇ·á¿ø¿ë TRMRF04403À¸·Î º¯°æ - ¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì */ var refresh_u = 0; var refresh_d = 0; var refresh_a = 0; var sSETLIST = "/root/main/indxlist/item"; var sSETLIST_HIDDEN = "/root/hidden/indxlist/item"; var sMOUSE_CLK_STATUS; //¸¶¿ì½º Ŭ¸¯ Á¿ì¹öư ±¸ºÐ var sTREE_OBJ; //Æ®¸®ºä ±¸ºÐ /** * @desc : ÃʱâÈ­ * @ * @param : 1:À̹ÌÁö°ü¸® * @return : * @--------------------------------------------------- */ function fFormInit(flag) { // Æú´õ¸íĪ popup grup_saveas.visible = "false"; model.removeNodeset("/root/main/list/imglist"); // ºÎ¼­ÄÚµå ¸®½ºÆ® ºÒ·¯¿À±â... //mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/deptlist/orddept", "D"); // Àüü °ú¸¦ ºÒ·¯¿Â´Ù. // °ú ÄÚµå ºÒ·¯¿À´Â ÇÔ¼ö ÆÄ¶ó¹ÌÅÍ º¯°æ. //mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/deptlist/orddept", "O"); mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/deptlist/orddept", "A"); addComboInstance("/root/init/deptlist/orddept", "deptcd^depthngnm", "-^Àüü", "dept"); //Áø·á°ú ÀüüÇ׸ñ Ãß°¡ /*model.setValue("/root/cond/orddeptcd", "-"); reqGetDeptList("/root/send/reqdeptlist", "/root/init/deptlist", "", "012"); model.makeValue("/root/init/deptlist/orddept/deptcd","ALL"); model.makeValue("/root/init/deptlist/orddept/deptnm","Àüü"); */ model.refresh(); model.setValue("/root/send/reqformlist/deptcd",getUserInfo("dutplcecd")); // ºÎ¼­ÄÚµå¿Í »ç¿ëÀÚ ID¸¦ ÇÒ´ç. model.makeValue("/root/send/cond/userid", getUserId()); model.makeValue("/root/send/cond/deptcd", getUserInfo("dutplcecd")); // admin Àΰ¡? º¸¿©Áٰ͸¸ º¸¿©ÁØ´Ù.. // °ü¸®ÀÚ : °³ÀÎ, °ú, Àüü µî·Ï/¼öÁ¤/»èÁ¦ °¡´É // »ç¿ëÀÚ : °³Àθ¸ °¡´É var result = fUserAdmin(); // var result = true; if (result == true) { grup_srch1.visible = "true"; grup_srch2.visible = "true"; model.setValue("/root/send/cond/admin", "true"); } else { grup_srch1.visible = "false"; grup_srch2.visible = "false"; model.setValue("/root/send/cond/admin", "false"); // »ç¿ëÀÚÁ¤º¸ ¼Â... model.setValue("/root/send/cond/userid", getUserId()); model.setValue("/root/send/cond/usernm", getUserInfo("usernm")); model.setValue("/root/send/cond/deptcd", getUserInfo("dutplcecd")); model.setValue("/root/send/cond/jobkind", getUserInfo("jobkindcd")); } // µðÆúÆ® Æ®¸®ºä if (flag == 0 ) { // À̹ÌÁö¸ñ·ÏÀ϶§¸¸ °úÄÚµå ºÎ¿©ÇØÁØ´Ù.. model.setValue("/root/send/reqdata/deptcd", getUserInfo("dutplcecd")); // Switch (°³ÀÎ,°ú,Àüü,À̹ÌÁö¸ñ·Ï) sw_setflag.case_user.selected = "false"; sw_setflag.case_dept.selected = "false"; sw_setflag.case_all.selected = "false"; sw_setflag.case_list.selected = "true"; sw_setflag.refresh(); // °øÅë¼¼¼Çº¯¼ö¿¡¼­ imgelist À¯¹« È®ÀÎ var formflag = getGlobalVariable("emr_gsv_imgeflag"); var sUserId = getGlobalVariable("emr_gsv_imgeflag_userid"); if(sUserId == getUserId() && formflag=="Y"){ var formlist = getGlobalVariable("emr_gsv_imgelist"); model.removeNodeset("/root/main/formlist/item"); setCSVToNode("/root/main/formlist",formlist,"item"); model.refresh(); }else{ submit("TRMMR02501"); model.refresh(); } // ù¹øÂ° º»ÀÎ °ú´Â ¿ÀÇÂÇÏÀÚ!! trv_imgelist.expand(0, true); } else { // Switch (°³ÀÎ,°ú,Àüü,À̹ÌÁö¸ñ·Ï) sw_setflag.case_user.selected = "true"; sw_setflag.case_dept.selected = "false"; sw_setflag.case_all.selected = "false"; sw_setflag.refresh(); model.setValue("/root/send/cond/setflag", "U"); model.removeNodeset("/root/main/indxlist/item"); // °³Àθñ·Ï º¸¿©ÁÖÀÚ~ submit("TRMRF04403"); model.removeNodeset("/root/main/indxlist_u/item"); model.copyNode("/root/main/indxlist_u", "/root/main/indxlist"); model.refresh(); refresh_u = 1; } } /** * @desc : ¹öư Ŭ¸¯ (°³ÀÎ/°ú/Àüü) * @ * @param : * @return : * @--------------------------------------------------- */ function fSetIndxListSelect(setflag){ model.setValue("/root/send/cond/setflag", setflag); grup_saveas.visible = "false"; // °³ÀÎ if (setflag == "U") { btn_user.selected = "true"; if (refresh_u == 0) { // °øÅë¼¼¼Çº¯¼ö¿¡¼­ imgelist À¯¹« È®ÀÎ var formflag = getGlobalVariable("emr_gsv_imgeflag_u"); if(formflag=="Y"){ // imgelistÀÖÀ¸¸é submit ¾ÈÇÔ var formlist = getGlobalVariable("emr_gsv_imgelist_u"); model.removeNodeset("/root/main/indxlist_u/item"); model.removeNodeset("/root/main/indxlist/item"); setCSVToNode("/root/main/indxlist",formlist,"item"); model.copyNode("/root/main/indxlist_u", "/root/main/indxlist"); model.refresh(); }else { submit("TRMRF04403"); model.removeNodeset("/root/main/indxlist_u/item"); model.copyNode("/root/main/indxlist_u", "/root/main/indxlist"); model.refresh(); } } else { model.removeNodeset("/root/main/indxlist/item"); model.copyNode("/root/main/indxlist", "/root/main/indxlist_u"); model.refresh(); } refresh_u = 1; // °ú } else if (setflag == "D") { btn_dept.selected = "true"; if (refresh_d == 0) { // °øÅë¼¼¼Çº¯¼ö¿¡¼­ imgelist À¯¹« È®ÀÎ var formflag = getGlobalVariable("emr_gsv_imgeflag_d"); if(formflag=="Y"){ // formlistÀÖÀ¸¸é submit ¾ÈÇÔ var formlist = getGlobalVariable("emr_gsv_imgelist_d"); model.removeNodeset("/root/main/indxlist_d/item"); model.removeNodeset("/root/main/indxlist/item"); setCSVToNode("/root/main/indxlist",formlist,"item"); model.copyNode("/root/main/indxlist_d", "/root/main/indxlist"); model.refresh(); }else { submit("TRMRF04403"); model.removeNodeset("/root/main/indxlist_d/item"); model.copyNode("/root/main/indxlist_d", "/root/main/indxlist"); model.refresh(); } } else { model.removeNodeset("/root/main/indxlist/item"); model.copyNode("/root/main/indxlist", "/root/main/indxlist_d"); model.refresh(); } refresh_d = 1; // °øÅë } else if (setflag == "A") { btn_all.selected = "true"; if (refresh_a == 0) { // °øÅë¼¼¼Çº¯¼ö¿¡¼­ imgelist À¯¹« È®ÀÎ var formflag = getGlobalVariable("emr_gsv_imgeflag_a"); if(formflag=="Y"){ // imgelistÀÖÀ¸¸é submit ¾ÈÇÔ var formlist = getGlobalVariable("emr_gsv_imgelist_a"); model.removeNodeset("/root/main/indxlist_a/item"); model.removeNodeset("/root/main/indxlist/item"); setCSVToNode("/root/main/indxlist",formlist,"item"); model.copyNode("/root/main/indxlist_a", "/root/main/indxlist"); model.refresh(); }else { submit("TRMRF04403"); model.removeNodeset("/root/main/indxlist_a/item"); model.copyNode("/root/main/indxlist_a", "/root/main/indxlist"); model.refresh(); } } else { model.removeNodeset("/root/main/indxlist/item"); model.copyNode("/root/main/indxlist", "/root/main/indxlist_a"); model.refresh(); } refresh_a = 1; } } /** * @desc : °ú ¼±Åà * @ * @param : * @return : * @--------------------------------------------------- */ function fDeptCDSelect() { submit("TRMRF04403"); model.removeNodeset("/root/main/indxlist_d/item"); model.copyNode("/root/main/indxlist_d", "/root/main/indxlist"); var deptcd = model.getValue("/root/send/cond/deptcd"); model.makeValue("/root/send/savedata/deptcd", deptcd); model.refresh(); } /** * @desc : »ç¿ëÀÚÁ¤º¸ * @ * @param : * @return : * @--------------------------------------------------- */ function fGetUserInfo(userid,usernm,deptcd , instcd) { model.setValue("/root/send/cond/userid", userid); model.setValue("/root/send/cond/usernm", usernm); model.setValue("/root/send/cond/deptcd", deptcd); ipt_saveas_userid.text = usernm; ipt_saveas_userid.refresh(); submit("TRMRF04403") model.makeValue("/root/temp/instcd",instcd); //Á¶È¸ÇÑ »ç¿ëÀÚ ±â°üÄÚµå model.removeNodeset("/root/main/indxlist_u/item"); model.copyNode("/root/main/indxlist_u", "/root/main/indxlist"); model.refresh(); } /* - ¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì¢Ì */ /** * @desc : Æ®¸®ºä ¼Â * @ * @param : * @return : * @--------------------------------------------------- */ function fSetTreeView(){ var setflag = model.getValue("/root/send/cond/setflag"); if (setflag == "U") { sTREE_OBJ = trv_indxlist_u } if (setflag == "D") { sTREE_OBJ = trv_indxlist_d } if (setflag == "A") { sTREE_OBJ = trv_indxlist_a } } /** * @desc : ¸¶¿ì½º ¿À¸¥ÂÊ ¹öư ÆË¾÷â * @ * @param : * @return : * @--------------------------------------------------- * 1. ¸¶¿ì½º ¿ìŬ¸¯Àΰ¡? * 2. °ü¸®ÀÚÀΰ¡? »ç¿ëÀÚÀΰ¡? * 3. ±¸ºÐÀÌ °³ÀÎÀΰ¡? °úÀΰ¡? ÀüüÀΰ¡? * 4. Æú´õÀΰ¡? ÆÄÀÏÀΰ¡? ·çÆ®Àΰ¡? */ function fMouseRghtBtnPopup(){ fSetTreeView(); // °úÁ¤º¸ ¾ò±â // °ú Á¤º¸ °¡Á®¿È. var deptnm = sTREE_OBJ.label; var deptcd = ""; var deptNodeList = findNodeset(model, "/root/init/deptlist/orddept/dept"); for(var idx = 0; idx < deptNodeList.length; idx++) { var subDeptNode = deptNodeList.item(idx); destNode = subDeptNode.selectSingleNode("depthngnm"); if(destNode != null && destNode.text == deptnm) { deptcd = subDeptNode.selectSingleNode("deptcd"); break; } } model.makeValue("/root/send/deptcd", deptcd.text); //model.setValue("/root/send/cond/deptcd", deptcd.text); if(event.button == 3){ if(sTREE_OBJ.isCell(event.target) && sTREE_OBJ.selectedIndex > -1) { var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); var rowpos = item.index + 1; var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth"); var item_length = sTREE_OBJ.length; // ·çÆ®Àΰ¡? (º¸¿©ÁÖ´Â ºÎºÐÀ¸·Î..) if (depth == 1 && item_length > 1) { window.setPopupMenu(false); return; } // °ü¸®ÀÚÀΰ¡? ±¸ºÐÀÌ °³ÀÎÀΰ¡? var admin = model.getValue("/root/send/cond/admin"); var setflag = model.getValue("/root/send/cond/setflag"); if (admin == "true" || setflag == "U") { if(setflag == "A"){ //Àüü´Â ÀÔ·Â¾ÈµÊ return; } if (depth == 2 || (depth == 1 && item_length == 1) ) { // »õÆú´õ window.setPopupMenu(true, "/root/temp/menu2/menu", "label", "func", false); return; } else { var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag"); if (linkflag == "N") { // Æú´õÀΰæ¿ì, »õÆú´õ/Æú´õ¼öÁ¤/Æú´õ»èÁ¦.. window.setPopupMenu(true, "/root/temp/menu/menu", "label", "func", false); return; } else { // ÆÄÀÏÀΰæ¿ì, ÆÄÀÏ»èÁ¦¸¸.. window.setPopupMenu(true, "/root/temp/menu1/menu", "label", "func", false); return; } } } else { window.setPopupMenu(false); } } else { window.setPopupMenu(false); } }else{ window.setPopupMenu(false); } } /** * @desc : »õÆú´õ Ãß°¡ * @ * @param : * @return : * @--------------------------------------------------- */ function fAddDiagSet() { fSetTreeView(); var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); var rowPos = item.index + 1; fSetDiagInfo(rowPos, "i"); model.setValue(sSETLIST_HIDDEN + "/status", "i"); model.setValue("/root/main/iptbox/indxnm", ""); model.refresh(); var depth = model.getValue(sSETLIST_HIDDEN + "/depth"); var itemindxseq = model.getValue(sSETLIST_HIDDEN + "/itemindxseq"); var newSortno = 0; var FolderNodelist = model.instance1.selectNodes(sSETLIST + "[linkflag ='N' and supitemindxseq = '" + itemindxseq + "' and depth = '" + (parseInt(depth) + 1) + "']"); for(var idx = 0; idx < FolderNodelist.length; idx++) { var FolderNode = FolderNodelist.item(idx); if(newSortno < parseInt(FolderNode.selectSingleNode("sortno").text)) newSortno = parseInt(FolderNode.selectSingleNode("sortno").text); } if(depth == "2") { model.setValue(sSETLIST_HIDDEN + "/sortno", (parseInt(newSortno) + 1)); } else { model.setValue(sSETLIST_HIDDEN + "/sortno", newSortno); } fShowWndIptBox(); } /** * @desc : Æú´õ »èÁ¦ * @ * @param : * @return : * @--------------------------------------------------- */ function fDelDiagSet() { // È®ÀÎ ¹öư var ret = messageBox("Á¤¸»","Q001"); if(ret != "6") { return; } fSetTreeView(); var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); var rowPos = item.index + 1; if(fSetDiagInfo(rowPos, "d")!= -1){ fSaveDiagSet("Y"); } } /** * @desc : Æú´õ ¼öÁ¤ * @ * @param : * @return : * @--------------------------------------------------- */ function fUpdtDiagSet(){ fSetTreeView(); var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); var rowPos = item.index + 1; var indxnm = item.label; model.setValue("/root/main/iptbox/indxnm", indxnm); model.refresh(); if(fSetDiagInfo(rowPos, "u")!=-1){ fShowWndIptBox(); } } /** * @desc : À̹ÌÁö SET ÀúÀå * @ * @param : * @return : * @--------------------------------------------------- */ function fSaveDiagSet(linkflag) { grup_saveas.visible = "false"; var indxnm = model.getValue("/root/main/iptbox/indxnm"); if (linkflag == "N" && indxnm == "") { messageBox("Æú´õ¸íĪÀ» ", "C001"); return; } model.setValue(sSETLIST_HIDDEN + "/indxnm" , indxnm); model.setValue(sSETLIST_HIDDEN + "/linkflag" , linkflag); var admin = model.getValue("/root/send/cond/admin"); model.setvalue(sSETLIST_HIDDEN + "/admin" , admin); var setflag = model.getValue("/root/send/cond/setflag"); model.setvalue(sSETLIST_HIDDEN + "/setflag" , setflag); // ±¸ºÐ¿¡ µû¶ó [°ú, »ç¿ëÀÚ] Á¤º¸¸¦ ³Ñ°Ü¾ß Çϴµ¥... // ºÎ¼­ÄÚµå¿Í »ç¿ëÀÚ ID¸¦ ÇÒ´ç. model.makeValue("/root/send/cond/userid", getUserId()); //model.makeValue("/root/send/cond/deptcd", getUserInfo("dutplcecd")); //model.makeValue("/root/send/cond/deptcd", model.getValue("/root/send/deptcd") ); // »ç¿ëÀÚ ºÎ¼­°¡ ¾Æ´Ï¶ó ¼±ÅÃÇÑ ºÎ¼­ÄÚµå model.makeValue("/root/send/cond/deptcd", model.getValue("/root/send/cond/deptcd")); // »ç¿ëÀÚ ºÎ¼­°¡ ¾Æ´Ï¶ó ¼±ÅÃÇÑ ºÎ¼­ÄÚµå var userid = model.getValue("/root/send/cond/userid"); var deptcd = model.getValue("/root/send/cond/deptcd"); if (setflag == "U") { model.setValue(sSETLIST_HIDDEN + "/userid" , userid); model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd); var instcd = model.getValue("/root/temp/instcd"); if(instcd == ""){ model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd")); }else { model.setValue(sSETLIST_HIDDEN + "/instcd" , instcd); } } else if (setflag == "D") { model.setValue(sSETLIST_HIDDEN + "/userid" , ""); model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd); model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd")); } model.copyNode("/root/send/savedata", sSETLIST_HIDDEN); submit("TXMRF03101"); // °³ÀÎ À϶§ userid,deptcd ÀúÀå // adminÀ϶§ °³ÀÎÀúÀå½Ã ÆË¾÷¿¡¼­ ¹ÞÀº userid,deptcd·Î ÀúÀå // adminÀ϶§ °úÀúÀå½Ã instcd : '001' if (setflag == "U") { model.removeNodeset("/root/main/indxlist_u/item"); model.copyNode("/root/main/indxlist_u", "/root/main/indxlist"); refresh_u = 1; refresh_a = 0; trv_indxlist_u.rebuild(); } else if (setflag == "D") { model.removeNodeset("/root/main/indxlist_d/item"); model.copyNode("/root/main/indxlist_d", "/root/main/indxlist"); refresh_d = 1; refresh_a = 0; trv_indxlist_d.rebuild(); } else if (setflag == "A") { model.removeNodeset("/root/main/indxlist_a/item"); model.copyNode("/root/main/indxlist_a", "/root/main/indxlist"); refresh_u = 0; refresh_d = 0; refresh_a = 1; } model.refresh(); } /** * @desc : À̹ÌÁö°ü¸® Æú´õ¸íÀ» ÀÔ·ÂÇÒ InputBox¸¦ º¸¿©ÁÜ. * @ * @param : * @return : * @--------------------------------------------------- */ function fShowWndIptBox(){ grup_saveas.attribute("top") = event.clientY; grup_saveas.visible = "true"; model.setFocus("ipt_saveas_indxnm1"); } /** * @desc : À̹ÌÁö SET Á¶È¸ * @ * @param : * @return : * @--------------------------------------------------- */ function fReqDetlSet() { fSetTreeView(); if (sTREE_OBJ.selectedIndex == 0) { return; } // °ú Á¤º¸ °¡Á®¿È. var deptnm = sTREE_OBJ.label; var deptcdNode = ""; var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); var deptNodeList = findNodeset(model, "/root/init/deptlist/orddept/dept"); for(var idx = 0; idx < deptNodeList.length; idx++) { var subDeptNode = deptNodeList.item(idx); destNode = subDeptNode.selectSingleNode("depthngnm"); if(destNode != null && destNode.text == deptnm) { deptcdNode = subDeptNode.selectSingleNode("deptcd"); model.setValue("/root/send/cond/deptcd", deptcdNode.text); break; } } //var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); //alert(item); var rowpos = item.index + 1; fSetDiagInfo(rowpos); var depth = model.getValue(sSETLIST_HIDDEN + "/depth"); if(depth == 1){ return; } } /** * @desc : À̹ÌÁö SET Á¶È¸ * @ * @param : * @return : * @--------------------------------------------------- */ function fReqDetlSet_Old() { fSetTreeView(); if (sTREE_OBJ.selectedIndex == 0) { return; } var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); //alert(item); var rowpos = item.index + 1; fSetDiagInfo(rowpos); var depth = model.getValue(sSETLIST_HIDDEN + "/depth"); if(depth == 1){ return; } } /** * @desc : Mouse Drag Drop * @ * @param : * @return : void * @authur : * @--------------------------------------------------- */ function fOndrop(){ fSetTreeView(); var rowpos = sTREE_OBJ.mouseRow + 1; var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth"); var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm"); var x = event.clientX; var maxposX = 24 + 16 * (depth - 1) + ( 13 * indxnm.length); var minposX = 24 + 16 * (depth - 1); if(maxposX > x){ fDiagSetDrop(); }else{ return; } } /** * @desc : Mouse Drag Over * @ * @param : * @return : void * @authur : * @--------------------------------------------------- */ function fMouseOver(){ fSetTreeView(); var rowpos = sTREE_OBJ.mouseRow + 1; var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth"); var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm"); var x = event.clientX; var maxposX = 24 + 16 * (depth - 1) + ( 10 * indxnm.length); var minposX = 24 + 16 * (depth - 1); if(maxposX > x){ for ( var i = 0; i < sTREE_OBJ.length; i++ ) { sTREE_OBJ.item(i).attribute("background-color") = "#ffffff"; sTREE_OBJ.item(i).attribute("text-decoration") = ""; } sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ece1ec"; sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = ""; } } /** * @desc : TreeView¿¡ Drag»óÅ·ΠMouse overµÈ °æ¿ì itemÀÇ background color¸¦ clearÇÔ * @ * @param : * @return : void * @authur : * @--------------------------------------------------- */ function fOnDragMouseOver(){ fSetTreeView(); var treeObj = document.controls.item(event.currentTarget); var rowpos = sTREE_OBJ.mouseRow + 1; var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth"); var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm"); var x = event.clientX; var maxposX = 24 + 16 * (depth - 1) + ( 10 * indxnm.length); var minposX = 24 + 16 * (depth - 1); if(maxposX > x){ if( sTREE_OBJ.selectedIndex != treeObj.mouseRow ) { for ( var i = 0; i < treeObj.length; i++ ) { treeObj.item(i).attribute("background-color") = "#ffffff"; treeObj.item(i).attribute("text-decoration") = ""; } treeObj.item(treeObj.mouseRow).attribute("background-color") = "#ece1ec"; treeObj.item(treeObj.mouseRow).attribute("text-decoration") = ""; } } } /** * @desc : À̹ÌÁö SET Drag * @ * @param : * @return : * @--------------------------------------------------- */ function fDiagSetDrag(){ fSetTreeView(); if (sTREE_OBJ.selectedIndex == 0) { return; } var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); var rowpos = item.index + 1; fSetDiagInfo(rowpos, "u"); var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm"); model.setValue("/root/main/iptbox/indxnm", indxnm); model.refresh(); } /** * @desc : À̹ÌÁö SET Drop * @ * @param : * @return : * @--------------------------------------------------- */ function fDiagSetDrop(){ fSetTreeView(); fClrTreeViweSelect(); var admin = model.getValue("/root/send/cond/admin"); var setflag = model.getValue("/root/send/cond/setflag"); // °ü¸®ÀÚÀΰ¡? ±¸ºÐÀÌ °³ÀÎÀΰ¡? if (admin == "true" || setflag == "U") { var treeObj = document.controls.item(event.currentTarget); var rowpos = sTREE_OBJ.mouseRow + 1; var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth"); var itemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq"); var supitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/supitemindxseq"); var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag"); var cmpdepth = model.getValue(sSETLIST_HIDDEN + "/depth"); var cmpitemindxseq = model.getValue(sSETLIST_HIDDEN + "/itemindxseq"); var cmpsupitemindxseq = model.getValue(sSETLIST_HIDDEN + "/supitemindxseq"); var cmplinkflag = model.getValue(sSETLIST_HIDDEN + "/linkflag"); // À̵¿ÇÏ´Â Æú´õ°¡ ÆÄÀÏ ¾Æ·¡·Î À̵¿ÇÏ´Â°Í ¹æÁöÇÔ. if(linkflag == "Y"){ messageBox("Æú´õ°¡ ¾Æ´Ñ À§Ä¡·Î À̵¿", "E001"); sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff"; sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = ""; return; } if(itemindxseq == cmpitemindxseq){ // messageBox("µ¿ÀÏÇÑ À§Ä¡·Î À̵¿", "E001"); sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff"; sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = ""; return; }else if(itemindxseq == cmpsupitemindxseq){ // °°Àº °ú, °°Àº »ç¿ëÀÚ°¡ ¾Æ´Ï¸é À̵¿ÀÌ ¾ÈµÊ. (why? with¹® update°¡ ¾ÈµÇ´Ï±î..) // if (deptcd != cmpdeptcd || userid != cmpuserid) { // messageBox("ÁöÁ¤µÈ À§Ä¡·Î À̵¿", "E001"); // sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff"; // sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = ""; // return; // } } //À̵¿ÇÏ´Â SETÆú´õÀÇ depth°¡ µµÂøÇÏ´Â °÷º¸´Ù ³·Àº ·¹º§ÀÏ °æ¿ì, //ÀÚ½ÅÀÇ child node ¾Æ·¡·Î À̵¿ÇÏ´Â °ÍÀ» ¹æÁöÇÔ. if(cmpdepth < depth){ var rootdepth; var rootitemindxseq; while(cmpdepth != rootdepth){ rootdepth = model.getValue(sSETLIST + "[" + rowpos + "]/depth"); rootitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq"); rowpos--; } if(rootitemindxseq == cmpitemindxseq){ messageBox("ÁöÁ¤µÈ À§Ä¡·Î À̵¿", "E001"); sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff"; sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = ""; return; } } // À̵¿ Æú´õÀÇ (°ú, »ç¿ëÀÚ) Á¤º¸, À̵¿ ´ë»óÀÇ (°ú, »ç¿ëÀÚ) Á¤º¸ var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd"); var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid"); var cmpdeptcd = model.getValue(sSETLIST_HIDDEN + "/deptcd"); var cmpuserid = model.getValue(sSETLIST_HIDDEN + "/userid"); // °°Àº °ú, °°Àº »ç¿ëÀÚ°¡ ¾Æ´Ï¸é À̵¿ÀÌ ¾ÈµÊ. (why? with¹® update°¡ ¾ÈµÇ´Ï±î..) if (deptcd != cmpdeptcd || userid != cmpuserid) { messageBox("ÁöÁ¤µÈ À§Ä¡·Î À̵¿", "E001"); sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff"; sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = ""; return; } // À̵¿ Æú´õÀÇ (°ú, »ç¿ëÀÚ) Á¤º¸¸¦ ¼ÂÇÔ... model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd); model.setValue(sSETLIST_HIDDEN + "/userid" , userid); model.setValue(sSETLIST_HIDDEN + "/supitemindxseq" , itemindxseq); fSaveDiagSet("Y"); } } /** * @desc : Æú´õ¸í °Ë»öÇÒ °æ¿ì °Ë»öÇÑ À§Ä¡·Î focus¸¦ À̵¿ÇÑ´Ù. * @ * @param : * @return : void * @authur : * @--------------------------------------------------- */ function fSrchDiagIndxNM(){ fSetTreeView(); var sFolderNM = model.getValue("/root/main/cond/foldernm"); if (sTREE_OBJ.selectedIndex+1 == sTREE_OBJ.length) { sTREE_OBJ.selectedIndex = 0; } for(var i=sTREE_OBJ.selectedIndex+1; i= 3) // depth°¡ 4ÀÌ»ó ÀΰͺÎÅÍ È®ÀÎ(»èÁ¦´ë»óÀº Æú´õ³ª ÆÄÀÏ) { if(linkflag == "N") depth = 3; // Æú´õ else depth = 4; // ÆÄÀÏ } } model.setValue(sSETLIST_HIDDEN + "/status" , status); model.setValue(sSETLIST_HIDDEN + "/depth" , depth); model.setValue(sSETLIST_HIDDEN + "/path" , path); model.setValue(sSETLIST_HIDDEN + "/itemindxseq" , itemindxseq); // supitemindxseq : »õ·Î¿î µî·ÏÀÌ¸é »óÀ§Á¤º¸, ¼öÁ¤ÀÌ¸é ±âÁ¸Á¤º¸ if(status == "i"){ model.setValue(sSETLIST_HIDDEN + "/supitemindxseq", itemindxseq); }else{ model.setValue(sSETLIST_HIDDEN + "/supitemindxseq", supitemindxseq); } //¿¬°á±¸ºÐÀÌ 'Y' ÀÎ °æ¿ì : À̹ÌÁö¸íĪ¿¡ °ªÀ» ³ÖÁö ¾Ê´Â´Ù.. (2007.06.12) if (linkflag == 'N') { model.setValue(sSETLIST_HIDDEN + "/indxnm" , indxnm); } else { model.setValue(sSETLIST_HIDDEN + "/indxnm" , ""); } model.setValue(sSETLIST_HIDDEN + "/linkflag" , "N"); model.setValue(sSETLIST_HIDDEN + "/linkcd" , ""); // »óÀ§ Á¤º¸ (»ç¿ëÀÚ, °ú) var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid"); var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd"); model.setValue(sSETLIST_HIDDEN + "/userid" , userid); model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd); // ±âº» Á¤º¸ var instflag = model.getValue("/root/send/cond/setflag"); //°³Àΰú±¸ºÐ if(instflag =="U"){ var instcd = model.getValue("/root/temp/instcd"); if(instcd == ""){ model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd")); }else { model.setValue(sSETLIST_HIDDEN + "/instcd" , instcd); } }else{ model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd")); } model.setValue(sSETLIST_HIDDEN + "/indxflag" , "P"); model.setValue(sSETLIST_HIDDEN + "/valiyn" , "Y"); model.setValue(sSETLIST_HIDDEN + "/sortno" , sortno); model.setValue(sSETLIST_HIDDEN + "/comnseq" , 0); model.setValue(sSETLIST_HIDDEN + "/slipno" , 0); // »ç¿ëÀÚ Á¤º¸(°ü¸®ÀÚ, ÀϹݻç¿ëÀÚ) // ±¸ºÐ Á¤º¸(°³ÀÎ,°ú,Àüü) var admin = model.getValue("/root/send/cond/admin"); var setflag = model.getValue("/root/send/cond/setflag"); model.setValue(sSETLIST_HIDDEN + "/admin" , admin); model.setValue(sSETLIST_HIDDEN + "/setflag" , setflag); model.refresh(); } /** * @desc : À̹ÌÁö SET ¿¡ ÆÄÀÏ ¿¬°áÇϱâ * @ * @param : * @return : * @--------------------------------------------------- */ function fAddindx() { fSetTreeView(); // ¼±ÅÃÆú´õ°¡ Àִ°¡? if (sTREE_OBJ.selectedIndex == -1) { messageBox("Æú´õ¸¦ ", "C002"); return; } // ¼±ÅÃÇÑ ¾ÆÀÌÅÛ ·Î¿ì~!! var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); var rowpos = item.index + 1; // ·çÆ®Àΰ¡? (À̵¿ÇÒ ¼ö ¾ø´Ù..) var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth"); if (depth == 0) { messageBox("ÁöÁ¤µÈ À§Ä¡·Î À̵¿", "E001"); return; } // Æú´õÀΰ¡? ÆÄÀÏÀÌ¸é ÆÄÀÏÀ» Ãß°¡ÇÏÁö ¾Ê´Â´Ù. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag"); if (linkflag == "Y") { messageBox("Æú´õ¸¦ ", "C002"); return; } // ¼±ÅÃÇÑ À̹ÌÁö °¡Àִ°¡? var checkflag = "false"; for(var i = grd_imglist.fixedRows; i < grd_imglist.rows; i++) { var flag = model.getValue("/root/main/list/imglist["+ i +"]/check"); if(flag == "true"){ checkflag = "true"; break; } } if(checkflag == "false"){ messageBox("À̹ÌÁö¸¦ ", "C002"); return; } var sortno = model.getValue(sSETLIST + "[" + rowpos + "]/sortno"); //var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex); //var rowpos = item.index + 1; var indxfocus = item.value; model.setValue("/root/temp/indxfocus", indxfocus); for(var i = grd_imglist.fixedRows; i < grd_imglist.rows; i++) { var flag = model.getValue("/root/main/list/imglist["+ i +"]/check"); if(flag=="true" ) { model.setValue("/root/main/list/imglist["+ i +"]/check","false"); var imgecd = model.getValue("/root/main/list/imglist["+ i +"]/imgecd"); model.setValue(sSETLIST_HIDDEN + "/linkcd" , imgecd.substr(0,7)); var userid = model.getValue("/root/send/cond/userid"); var deptcd = model.getValue("/root/send/cond/deptcd"); model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd); // À̹ÌÁö¸íĪ¿¡ °ªÀ» ³ÖÁö ¾Ê´Â´Ù.. (2007.06.12) model.setValue(sSETLIST_HIDDEN + "/indxnm" , ""); model.setValue(sSETLIST_HIDDEN + "/supitemindxseq" , indxfocus); model.setValue(sSETLIST_HIDDEN + "/depth" , ""); model.setValue(sSETLIST_HIDDEN + "/itemindxseq" , ""); model.setValue(sSETLIST_HIDDEN + "/path" , ""); model.setValue(sSETLIST_HIDDEN + "/status" , "i"); model.setValue(sSETLIST_HIDDEN + "/sortno" , sortno); // ±âº» Á¤º¸ var instflag = model.getValue("/root/send/cond/setflag"); //°³Àΰú±¸ºÐ if(instflag == "U") { var instcd = model.getValue("/root/temp/instcd"); if(instcd == "") { model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd")); } //else //{ //model.setValue(sSETLIST_HIDDEN + "/instcd" , instcd); //} model.setValue(sSETLIST_HIDDEN + "/userid" , userid); } else { model.setValue(sSETLIST_HIDDEN + "/userid" , ""); model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("dutplceinstcd")); } model.setValue(sSETLIST_HIDDEN + "/indxflag" , "P"); var admin = model.getValue("/root/send/cond/admin"); model.setValue(sSETLIST_HIDDEN + "/admin" , admin); var setflag = model.getValue("/root/send/cond/setflag"); model.setValue(sSETLIST_HIDDEN + "/setflag" , setflag); model.setValue(sSETLIST_HIDDEN + "/linkflag" , "Y"); model.setValue(sSETLIST_HIDDEN + "/valiyn" , "Y"); model.setValue(sSETLIST_HIDDEN + "/comnseq" , 0); model.setValue(sSETLIST_HIDDEN + "/slipno" , 0); model.copyNode("/root/send/savedata", sSETLIST_HIDDEN); /* var tmpuserid = model.getValue("/root/send/savedata/userid"); if(tmpuserid == "") model.setValue("/root/send/savedata/userid", getUserId()); */ model.makeValue("/root/send/savedata/retflag","ret"); //ÀúÀåÈÄ Á¶È¸¿©ºÎ submit("TXMRF03101"); } } submit("TRMRF04403"); if (setflag == "U") { model.removeNodeset("/root/main/indxlist_u/item"); model.copyNode("/root/main/indxlist_u", "/root/main/indxlist"); } else if (setflag == "D") { model.removeNodeset("/root/main/indxlist_d/item"); model.copyNode("/root/main/indxlist_d", "/root/main/indxlist"); } else if (setflag == "A") { model.removeNodeset("/root/main/indxlist_a/item"); model.copyNode("/root/main/indxlist_a", "/root/main/indxlist"); } model.refresh(); } /** * @desc : °øÅë¼¼¼Çº¯¼ö¿¡ formlistÀúÀåÇϱâ * @ * @param : * @return : * @--------------------------------------------------- */ function fFormsetglobal() { model.toggle("case_list"); var flag = getGlobalVariable("emr_gsv_imgeflag"); //°øÅë¼¼¼Çº¯¼ö¿¡ formlist ÀúÀå if(flag!="Y"){ var reqnode = instance1.selectNodes("/root/main/formlist/item"); var csv = getNodeListCSV(reqnode); setGlobalVariable("emr_gsv_imgeflag","Y"); setGlobalVariable("emr_gsv_imgeflag_userid",getUserId()); setGlobalVariable("emr_gsv_imgelist",csv); } } /** * @desc : °øÅë¼¼¼Çº¯¼ö¿¡ indxlistÀúÀåÇϱâ * @ * @param : * @return : * @--------------------------------------------------- */ function fIndxsetglobal(flag) { var reqnode = instance1.selectNodes("/root/main/indxlist_"+ flag +"/item"); var csv = getNodeListCSV(reqnode); setGlobalVariable("emr_gsv_imgeflag_"+flag, "Y"); setGlobalVariable("emr_gsv_imgelist_"+flag, csv); } /** * @desc : Æ®¸® expand »óÅ ¾ò±â * @ * @param : * @return : * @--------------------------------------------------- */ function fExpandCheck(trvObj) { //alert(trvObj); var Obj = window.document.controls(trvObj); //alert(Obj); // var Obj = trvObj; var expandstr = 0; //Æ®¸® expand °ª ÀúÀå for(var i = 0; i < Obj.length ; i++){ if(Obj.item(i).expanded == 1) { expandstr += "."+i; } } //°øÅë¼¼¼Çº¯¼ö¿¡ ÀúÀå setGlobalVariable("emr_gsv_"+trvObj ,expandstr); //alert("a"); } /** * @desc : Æ®¸® expand »óÅ ¼³Á¤Çϱâ * @ * @param : * @return : * @--------------------------------------------------- */ function fSetTreeExpand(trvObj) { var Obj = window.document.controls(trvObj); var str = getGlobalVariable("emr_gsv_"+trvObj); if(str != ""){ var strlen = str.split('.'); var strArray = new Array(strlen.length); for(var i=0; i