123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768 |
- var gRef_MediFormView = "/root/main/medirec/medireccnts";
- var gRef_ViewMediFormView = "/root/main/viewmedirec/medireccnts";
- var IMGE_SZ = 500;
- var gExtnFuncFlag = true;
- var gReclistCnt = "";
- var gFDGWidth = 573;
- var gFDGHeight = 357;
- function fReadyForm()
- {
-
-
- grd_medirec.autoresize = true;
-
- if (isPopup())
- {
- gExtnFuncFlag = false;
- var formnm = opener.window.getParameter("formnm");
- if (formnm != "")
- {
- window.document.title = formnm + " - �̸�����";
- var cont = new COMN_CONT_RECCNTS();
- cont.pid = "";
- cont.recfromdt = "";
- cont.rectodt = "";
- cont.formrecdeptcd = "";
- cont.chosflag = "";
- cont.formrecseq = "-1";
- fAtrerRef(cont);
- }
- }
- }
- function fInitPage(wid, hei)
- {
- body.setAttribute("width", wid);
- body.setAttribute("height", hei);
- grd_medirec.setAttribute("width", wid);
- grd_medirec.setAttribute("height", hei);
-
- grd_medirec.setColWidth(1, wid - 21);
- grd_medirec.refresh();
- grd_medirectmp.refresh();
- }
- function fPreviewData(node)
- {
- model.removeNodeset("/root/main/medirec");
- var node2 = instance1.selectSingleNode("/root/main");
- node2.appendChild(node.cloneNode(true));
- model.refresh();
- var cont = new COMN_CONT_RECCNTS();
- cont.pid = "";
- cont.recfromdt = "";
- cont.rectodt = "";
- cont.formrecdeptcd = "";
- cont.chosflag = "";
- cont.formrecseq = "-1";
- fAtrerRef(cont);
- }
- function fClear()
- {
- model.removeNodeset(gRef_MediFormView);
- model.removeNodeset(gRef_ViewMediFormView);
- model.refresh();
- }
- function fRefRecView(condflag, pid, chosflag, fromdd, todd, stddd, srcformcd, deptcd, formrecseq, arrFormrecseq)
- {
- var path = "/root/send/reqcond/";
- model.makeValue(path+"condflag", condflag);
- model.makeValue(path+"pid", pid );
- model.makeValue(path+"chosflag", chosflag);
- model.makeValue(path+"fromdd", fromdd);
- model.makeValue(path+"todd", todd);
- model.makeValue(path+"stddd", stddd);
- model.makeValue(path+"attr", srcformcd);
- model.makeValue(path+"deptcd", deptcd);
- model.makeValue(path+"keyval", formrecseq);
-
- var submitLength = 1;
- if ( arrFormrecseq != null )
- {
- submitLength = arrFormrecseq.length;
- }
-
-
- for ( i=0; i<submitLength; i++ )
- {
- if ( arrFormrecseq != null && i != 0)
- {
-
- TRMOB04202.setAttribute("add", "bottom");
- model.makeValue(path+"keyval", arrFormrecseq[i]);
- }
- else
- TRMOB04202.setAttribute("add", "");
-
- grd_medirec.setAttribute("ref", "");
- submit("TRMOB04202", false);
-
- var cont = new COMN_CONT_RECCNTS();
- cont.pid = pid;
- cont.recfromdt = fromdd;
- cont.rectodt = todd;
- cont.formrecdeptcd = deptcd;
- cont.chosflag = chosflag;
- cont.formrecseq = formrecseq;
-
- fAtrerRef(cont);
-
- }
- }
- function fRefMediRecCnts(comn_cont_reccnts)
- {
-
-
-
- gFilterCond = "";
-
- var flag = true;
- if (flag)
- {
- model.setValue("/root/send/reqComn/pid", comn_cont_reccnts.pid);
- model.setValue("/root/send/reqComn/recfromdt", comn_cont_reccnts.recfromdt);
- model.setValue("/root/send/reqComn/rectodt", comn_cont_reccnts.rectodt);
- model.setValue("/root/send/reqComn/formrecdeptcd", comn_cont_reccnts.formrecdeptcd);
- model.setValue("/root/send/reqComn/chosflag", comn_cont_reccnts.chosflag);
- model.setValue("/root/send/reqComn/formrecseq", comn_cont_reccnts.formrecseq);
- if (comn_cont_reccnts.formrecseq != "")
- {
- model.setValue("/root/send/reqComn/recfromdt", "-");
- }
- else
- {
- gReclistCnt = comn_cont_reccnts.reclistlength;
- }
- var condflag = "main";
- if (comn_cont_reccnts.formrecseq != null && comn_cont_reccnts.formrecseq != "")
- condflag = "keyval";
- fRefRecView(condflag,
- comn_cont_reccnts.pid,
- comn_cont_reccnts.chosflag,
- comn_cont_reccnts.recfromdt,
- comn_cont_reccnts.rectodt,
- "",
- "",
- comn_cont_reccnts.formrecdeptcd,
- comn_cont_reccnts.formrecseq,
- comn_cont_reccnts.arrFormrecseq);
- }
- }
- function fGetMetaMode(str)
- {
- var strXrw = str;
-
- var regexp = new RegExp('(<Xvg [^<>]+>)', 'igm');
- if (regexp.test(strXrw) == true)
- {
- var xvginfo = strXrw.match(regexp);
- var strRtn = "";
-
- for(var idx =0; idx < xvginfo.length; idx++)
- {
- strRtn += xvginfo[idx];
- }
-
-
- strRtn = strRtn.setReplaceWord("<", "");
- strRtn = strRtn.setReplaceWord(">", "");
- strRtn = strRtn.setReplaceWord("'", "");
-
- var arrAttrs = strRtn.split(" ");
-
- var viewMode = "";
- var viewWidth = "";
- var viewHeight = "";
-
- var strXvgInfo = new Array(3);
- for(var i = 0; i < arrAttrs.length; i++)
- {
- var strSplit = arrAttrs[i].split("=");
-
- if(strSplit[0] == "viewMode") {
- viewMode = strSplit[1];
- strXvgInfo[0] = viewMode;
- continue;
- }
- if(strSplit[0] == "width") {
- viewWidth = strSplit[1];
- strXvgInfo[1] = viewWidth;
- continue;
- }
-
- if(strSplit[0] == "height") {
- viewHeight = strSplit[1];
- strXvgInfo[2] = viewHeight;
- continue;
- }
- }
- return strXvgInfo;
- }
- else
- {
- return "";
- }
- }
- function fAtrerRef(comn_cont_reccnts)
- {
- var cnt = parseInt( getNodesetCount(gRef_MediFormView) );
-
- if(cnt == 0){
- fClear();
- }
-
-
- doReplaceLtGt(gRef_MediFormView);
-
- var path_degnitemkind = gRef_MediFormView + "[#iIdx#]/degnitemkind";
- var path_viewimge = gRef_MediFormView + "[#iIdx#]/viewimge";
- var path_reccnts = gRef_MediFormView + "[#iIdx#]/reccnts";
-
- var path_imgewid = gRef_MediFormView + "[#iIdx#]/imgewid";
- var path_imgehei = gRef_MediFormView + "[#iIdx#]/imgehei";
- var path_viewcnts = gRef_MediFormView + "[#iIdx#]/viewcnts";
-
- var path_degnitemlevlcd = gRef_MediFormView + "[#iIdx#]/degnitemlevlcd";
-
- var chpath_viewimge;
- var chpath_reccnts;
-
- for (var i = 1; i <= cnt; i++)
- {
- try
- {
- chpath_viewimge = path_viewimge.replace("#iIdx#", i);
- chpath_reccnts = path_reccnts.replace("#iIdx#", i);
-
- if (model.getValue(path_degnitemkind.replace("#iIdx#", i)) == "IMG" &&
- (model.getValue(chpath_viewimge) != "" || model.getValue(chpath_reccnts) != "") )
- {
-
- var Localimg = "";
- var degnitemlevlcd = "";
- var IMGListNode = "";
- var strXvgInfo = "";
-
- degnitemlevlcd = model.getValue(path_degnitemlevlcd.replace("#iIdx#", i));
-
- if(degnitemlevlcd != "")
- IMGListNode = findNodeset(model, gRef_MediFormView+ "[degnitemlevlcd='" + degnitemlevlcd + "' and degnitemkind='MTX']");
-
- for(var idx = 0; idx < IMGListNode.length; idx++)
- {
- var imgNode = IMGListNode.item(idx);
- var Localimg = imgNode.selectSingleNode("viewcnts").text;
- }
-
-
- var reccntsValue = model.getValue(path_reccnts.replace("#iIdx#", i));
- var strImgBase64 = model.getValue(path_viewimge.replace("#iIdx#", i));
-
- var shapeinfo = reccntsValue;
-
-
-
-
- reccntsValue = fSetCdata(reccntsValue);
-
- if(reccntsValue != "")
- {
- strXvgInfo = fGetMetaMode(reccntsValue);
- var tmpShape = removeXvgTag(reccntsValue);
-
- }
-
- }
- else if (model.getValue(path_degnitemkind.replace("#iIdx#", i)) == "FDG" && model.getValue(chpath_reccnts) != "")
- {
- var MetaData = model.getValue(path_reccnts.replace("#iIdx#", i));
-
-
-
-
-
-
-
-
-
-
-
-
- setImageRefInstance(path_viewcnts.replace("#iIdx#", i));
- }
- }
- catch (e)
- {
- alert(e);
- }
- }
- grd_medirec.setAttribute("ref", "/root/main/viewmedirec/medireccnts");
-
- if (comn_cont_reccnts.formrecseq != null && comn_cont_reccnts.formrecseq != "")
- {
- copyNodeset(gRef_ViewMediFormView, gRef_MediFormView, "replace", model, model);
-
- fDrawGrid();
- }
- else
- {
- fExeFilter(gFilterCond);
-
- }
- }
-
- var gfontSz = 11;
- function fDrawGrid()
- {
- var fontsz = 11;
- if (fontsz != "")
- {
- gfontSz = fontsz;
- }
- grd_medirec.setVisible(false);
- grd_medirec.rebuild();
- grd_medirectmp.rebuild();
- var colref_viewflag = grd_medirec.colref("viewflag");
- var colref_imgehei = grd_medirec.colref("imgehei");
- var colref_degnitemlevlno = grd_medirec.colref("degnitemlevlno");
- var colref_degnitemkind = grd_medirec.colref("degnitemkind");
- var viewflag;
- var degnitemlevlno;
-
- var ft_std = 0;
- var ft_header = (ft_std + parseInt(gfontSz) + 1) + "pt";
- var ft_cnts = (ft_std + parseInt(gfontSz)) + "pt";
- var ft_tail = (ft_std + parseInt(gfontSz) - 1) + "pt";
- var padng = 15;
- for (var i = 1; i <= grd_medirec.rows; i++)
- {
- viewflag = grd_medirec.valueMatrix(i, colref_viewflag);
- grd_medirec.rowstyle(i, "all", "color") = "#55435d";
- if (viewflag == "data")
- {
- if (grd_medirec.valueMatrix(i, colref_imgehei) == "")
- {
- if (grd_medirec.valueMatrix(i, colref_degnitemkind) == "GSU")
- {
- fSetRowStyle(i, "transparent", "", ft_cnts, (padng * (parseInt(grd_medirec.valueMatrix(i, colref_degnitemlevlno))-1)) + "");
- }
- else
- {
- fSetRowStyle(i, "transparent", "", ft_cnts, (padng * parseInt(grd_medirec.valueMatrix(i, colref_degnitemlevlno))) + "");
- }
- }
- else
- {
- fSetRowStyle(i, "transparent", "", "11", "IMGE");
-
- }
- }
- else if (viewflag == "fstlevl")
- {
- fSetRowStyle(i, "transparent", "bold", ft_cnts, "5");
- }
- else if (viewflag == "formnm")
- {
- fSetRowStyle(i, "#cce8ff", "bold", ft_header, "5");
- }
- else if (viewflag == "recinfo")
- {
- fSetRowStyle(i, "#cce8ff", "", ft_cnts, "5");
- }
- else if (viewflag == "recuser")
- {
- fSetRowStyle(i, "transparent", "", "12", "5");
- }
- }
-
-
- var colref_compflag = grd_medirec.colref("compflag");
- for (var i = 1; i <= grd_medirec.rows; i++)
- {
- viewflag = grd_medirec.valueMatrix(i, colref_viewflag);
- if (grd_medirec.valueMatrix(i, colref_imgehei) != "")
- {
- grd_medirec.setRowHeight(i, parseInt(grd_medirec.valueMatrix(i, colref_imgehei)) + 5);
- }
- else if (viewflag == "formnm")
- {
- grd_medirec.setRowHeight(i, grd_medirec.rowHeight(i) + 5);
- }
- else if (viewflag == "recinfo")
- {
- grd_medirec.setRowHeight(i, grd_medirec.rowHeight(i) + 3);
- }
- else if (viewflag == "recuser")
- {
- grd_medirec.setRowHeight(i, 50);
- }
- }
- grd_medirec.refresh();
- grd_medirectmp.refresh();
- grd_medirec.setVisible(true);
- }
- function fSetRowStyle(rowidx, backColr, fontWei, fontSize, padLeft)
- {
- grd_medirec.rowstyle(rowidx, "data", "background-color") = backColr;
- grd_medirec.rowstyle(rowidx, "data", "font-weight") = fontWei;
- grd_medirec.setRowStyle(rowidx, "data", "font-size", fontSize);
- if (padLeft == "IMGE")
- {
- grd_medirec.setRowStyle(rowidx, "data", "background-position", "center");
- }
- else
- {
- grd_medirec.setRowStyle(rowidx, "data", "padding-left", padLeft);
- grd_medirec.setRowStyle(rowidx, "data", "background-image", "");
- }
- }
- function fCncl()
- {
- grup_menu.setVisible(false);
- }
- var gSrcFormCds = "";
- var gItemBaseCds = "";
- function fFiltering(pArrSrcFormCds, pArrItemBaseCds)
- {
- var stmtForm = "";
- var stmtItem = "";
- if (pArrSrcFormCds != null)
- {
- for (var i = 0; i < pArrSrcFormCds.length; i++)
- {
- if (stmtForm != "")
- stmtForm += " or ";
- stmtForm += "srcformcd='" +pArrSrcFormCds[i]+ "'";
- }
- }
- if (pArrItemBaseCds != null)
- {
- for (var i = 0; i < pArrItemBaseCds.length; i++)
- {
- if (stmtItem != "")
- stmtItem += " or ";
- stmtItem += "fstlevlitembasecd='" +pArrItemBaseCds[i]+ "'";
- }
- }
- var stmt = "";
- if (stmtForm != "")
- {
- stmt = "(" + stmtForm + ")";
- }
- if (stmt != "" && stmtItem != "")
- {
- stmt += " and ";
- }
- if (stmtItem != "")
- {
- stmt += "(" + stmtItem + " or fstlevlitembasecd='-1')";
- }
- if (gFilterCond == stmt)
- {
- return false;
- }
- else
- {
- return fExeFilter(stmt);
- }
- }
- var gFilterCond = "";
- function fExeFilter(stmt)
- {
- var cond = stmt;
- if (stmt == null || stmt == "")
- stmt = "";
- else
- stmt = "[" +stmt+ "]";
- var cnt = getNodesetCount(gRef_MediFormView + stmt);
- if (cnt == 0)
- {
- return false;
- }
- copyNodeset(gRef_ViewMediFormView, gRef_MediFormView + stmt, "replace", model, model);
- grd_medirec.rebuild();
- grd_medirectmp.rebuild();
- fDrawGrid();
- gFilterCond = cond;
- return true;
- }
- function fSetCdata(metadata)
- {
- var strMeta = metadata;
-
-
-
- if(isSearchString(strMeta, "CDATA") == false)
- {
- var strStCaptionOld = "";
- var strEdCaptionOld = "";
- var strStCaptionNew = "";
- var strEdCaptionNew = "";
-
-
- strStCaptionOld = fGetXvgStCaption(strMeta);
- strEdCaptionOld = fGetXvgEdCaption(strMeta);
-
-
- for(var idx = 0; idx < strStCaptionOld.length; idx++)
- {
- if(idx == 0)
- {
-
- strEdCaptionNew = "]]>" + strEdCaptionOld[idx];
- strMeta = strMeta.setReplaceWord(strEdCaptionOld[idx], strEdCaptionNew);
- }
- strStCaptionNew = strStCaptionOld[idx] + "<![CDATA[";
-
- strMeta = strMeta.setReplaceWord(strStCaptionOld[idx], strStCaptionNew);
- }
-
- }
-
- return strMeta;
- }
- function fGetXvgStCaption(metadata)
- {
- var strMeta = metadata;
- var getStCaption = new Array();
- var grpexpSt = new RegExp('(<caption[^<>]+>)', 'igm');
-
- if(grpexpSt.test(strMeta) == true)
- {
- getStCaption = strMeta.match(grpexpSt);
-
- strMeta = strMeta.replace(grpexpSt, "");
- }
-
- if(getStCaption.length > 0)
- return getStCaption;
- else
- return "";
- }
- function fGetXvgEdCaption(metadata)
- {
- var strMeta = metadata;
- var getEdCaption = new Array();
- var grpexpEd = new RegExp('(</caption>)', 'igm');
-
- if (grpexpEd.test(strMeta) == true)
- {
- getEdCaption = strMeta.match(grpexpEd);
-
- strMeta = strMeta.replace(grpexpEd, "");
- }
-
- if(getEdCaption.length > 0)
- return getEdCaption;
- else
- return "";
- }
- function fGetAdjustImgeSize(imgewid, imgehei)
- {
- if ( parseInt(imgewid) > parseInt(IMGE_SZ) && parseInt(imgehei) > parseInt(IMGE_SZ) )
- {
-
- if ( parseInt(imgewid) >= parseInt(imgehei) )
- {
- var newHeight = ( imgehei * IMGE_SZ ) / imgewid;
-
- imgewid = IMGE_SZ;
- imgehei = newHeight;
- }
- else if ( parseInt(imgewid) <= parseInt(imgehei) )
- {
- var newWidth = ( imgewid * IMGE_SZ ) / imgehei;
-
- imgewid = newWidth;
- imgehei = IMGE_SZ;
- }
- else
- {
-
- imgewid = IMGE_SZ;
- imgehei = IMGE_SZ;
- }
- }
- else if ( parseInt(imgewid) > parseInt(IMGE_SZ) )
- {
-
- var newheight = ( imgehei * IMGE_SZ ) / imgewid;
-
- imgewid = IMGE_SZ;
- imgehei = newheight;
- }
- else if ( parseInt(imgehei) > parseInt(IMGE_SZ) )
- {
-
- var newWidth = ( imgewid * IMGE_SZ ) / imgehei;
-
- imgewid = newWidth;
- imgehei = IMGE_SZ;
- }
- else if ( parseInt(imgewid) < parseInt(IMGE_SZ) && parseInt(imgehei) < parseInt(IMGE_SZ) )
- {
-
- if ( parseInt(imgewid) > parseInt(imgehei) )
- {
- var newHeight = ( imgehei * IMGE_SZ ) / imgewid;
-
- imgewid = IMGE_SZ;
- imgehei = newHeight;
- }
- else if ( parseInt(imgewid) < parseInt(imgehei) )
- {
- var newWidth = ( imgewid * IMGE_SZ ) / imgehei;
-
- imgewid = newWidth;
- imgehei = IMGE_SZ;
- }
- else
- {
-
- imgewid = IMGE_SZ;
- imgehei = IMGE_SZ;
- }
- }
- else if ( parseInt(imgewid) < parseInt(IMGE_SZ) )
- {
-
- if ( parseInt(imgehei) > parseInt(IMGE_SZ) )
- {
- var newHeight = ( imgehei * IMGE_SZ ) / imgewid;
-
- imgewid = IMGE_SZ;
- imgehei = newHeight;
- }
- else if ( parseInt(imgehei) < parseInt(IMGE_SZ) )
- {
- var newWidth = ( imgewid * IMGE_SZ ) / imgehei;
-
- imgewid = newWidth;
- imgehei = IMGE_SZ;
- }
- }
- else if ( parseInt(imgehei) < parseInt(IMGE_SZ) )
- {
-
- if ( parseInt(imgewid) > parseInt(IMGE_SZ) )
- {
- var newHeight = ( imgehei * IMGE_SZ ) / imgewid;
-
- imgewid = IMGE_SZ;
- imgehei = newHeight;
- }
- else if ( parseInt(imgewid) < parseInt(IMGE_SZ) )
- {
- var newWidth = ( imgewid * IMGE_SZ ) / imgehei;
-
- imgewid = newWidth;
- imgehei = IMGE_SZ;
- }
- }
- else
- {
-
- imgewid = IMGE_SZ;
- imgehei = IMGE_SZ;
- }
-
- return imgewid + "|" + imgehei;
- }
|