123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643 |
-
- var gvMyUIDPath = null;
- var gvOpUIDPath = null;
- var gvChUIDPath = null;
- var gvDate = null;
- var gvParamPath = null;
- var gvPropPath = null;
- var gvAuthPath = null;
- var gvTitlePath = null;
- var gvScnTypePath = null;
- var gvErrorMsgPath = null;
- var gvSystemPath = null;
- var gvMenuPath = null;
- var gvMenuGroupCdPath = null;
- var gvMenuPrestDeptCdPath = null;
- var gvMenuItemCdPath = null;
- var gvMenuParamPath = null;
- var gvSystemCd = null;
- var gvReportPath = null;
- var gvSubReportPath = null;
- var gvReportPropsPath = null;
- var gvReportParamsPath = null;
- var gvReportOptionsPath = null;
- var gvPatientInfoPath = null;
- var gvOperationInfoPath = null;
- var gvConsultInfoPath = null;
- var gvPatientInfoFlagPath = null;
- var gvOrderBasicInfoPath = null;
- var gvPopupMenuPath = null;
- var gvHelpPage = null;
- var gvTaskBarHeight = 34;
- var gvDefaultScrWidth = 1211;
- var gvDefaultScrHeight = 784;
- var gvSaveLoc = null;
- var fEssentialBackColor = "#ffe4b5";
- String.prototype.toDate = toDate;
- Date.prototype.getDateFormat = getDateFormat;
- Date.prototype.getAddDate = getAddDate;
- Date.prototype.getDayOfWeek = getDayOfWeek;
- String.prototype.setReplaceWord = setReplaceWord;
- String.prototype.getTrim = getTrim;
- function xforms_model_construct() {
- gvPropPath="/root/properties";
- gvMyUIDPath=gvPropPath+"/uid/myself";
- gvOpUIDPath=gvPropPath+"/uid/opener";
- gvChUIDPath=gvPropPath+"/uid/children/";
- gvParamPath=gvPropPath+"/parameters";
- gvChildClosePath=gvPropPath+"/childclose";
- gvSystemPath=gvPropPath+"/domain";
- gvAuthPath=gvPropPath+"/auth";
- gvMenuPath=gvPropPath+"/menu";
- gvMenuGroupCdPath=gvMenuPath+"/menugroupcd";
- gvMenuPrestDeptCdPath=gvMenuPath+"/menuprestdeptcd";
- gvMenuItemCdPath=gvMenuPath+"/menuitemcd";
- gvMenuParamPath=gvMenuPath+"/menuparam";
- gvTitlePath=gvPropPath+"/title";
- gvScnTypePath=gvPropPath+"/stype";
- gvErrorMsgPath=gvPropPath+"/error";
- gvReportPath=gvPropPath+"/report/mainreport";
- gvSubReportPath=gvPropPath+"/report/subreport";
- gvReportPropsPath=gvReportPath+"/props";
- gvReportParamsPath=gvReportPath+"/params";
- gvReportOptionsPath=gvReportPath+"/options";
- gvPatientInfoPath=gvPropPath+"/patient";
- gvOperationInfoPath=gvPatientInfoPath+"/operationinfo";
- gvConsultInfoPath=gvPatientInfoPath+"/consultinfo";
- gvPatientInfoFlagPath=gvPatientInfoPath+"/patientflag";
- gvOrderBasicInfoPath=gvPropPath+"/orderbasicinfo";
- gvPopupMenuPath=gvPropPath+"/popupmenu";
-
- gvSaveLocPath = gvPropPath + "/saveloc";
- model.makeValue(gvSaveLocPath, "true");
-
-
-
- gvDate = new Date();
- var uid = gvDate.getTime();
- model.makeValue(gvMyUIDPath,uid);
- model.makeValue(gvOpUIDPath,"");
- model.makeValue(gvSystemPath,"");
- }
- function xforms_ready() {
-
- window.setPopupMenu(false);
-
-
-
-
- if(window.type != "iviewer") {
- body.setAttribute("accesskey", "f12");
- }
- }
- function getSystemCd() {
- if (gvSystemCd != null) {
- return gvSystemCd;
- }
- if (htmlwindow.systemcd == undefined) {
- gvSystemCd = "";
- } else {
- gvSystemCd = new String(htmlwindow.systemcd);
- }
- return gvSystemCd;
- }
- function getViewer(name) {
-
-
-
- return null;
- }
- function getScreenID(url) {
- if (url == null) {
- url = document.URL;
- }
- var sp = url.split("/");
- return sp[sp.length-1].split(".")[0].substr(0,10);
- }
- function getMyUID() {
- return model.getValue(gvMyUIDPath);
- }
- function getOpenerUID() {
- return model.getValue(gvOpUIDPath);
- }
- function getChildUID(wid) {
- var cid = model.getValue(gvChUIDPath+wid);
- if (cid==null) { cid=""; }
- return cid;
- }
- function checkOpener() {
- if (isPopup()) {
- return (getOpenerUID()==opener.model.getValue(gvMyUIDPath));
- } else {
- return false;
- }
- }
- function getChildWindow(wid) {
- return findChildWindow(getChildUID(wid));
- }
- function findChildWindow(cid) {
- var child = null;
- for(i=0;i<window.children.length;i++) {
- child = window.children.item(i);
- if (child.model.getValue(gvMyUIDPath)==cid) return child;
- }
- return null;
- }
- function findChildWindowByScreenID(sid) {
- var child = null;
- for(i=0;i<window.children.length;i++) {
- child = window.children.item(i);
- if (child.getScreenID()==sid) return child;
- }
- return null;
- }
- function closeChildWindow() {
- if(model.getValue(gvChildClosePath) == "Y"){
- var childCnt = window.children.length;
- for( var i = childCnt; i > 0; i-- ) {
- window.children.item(i-1).close();
- }
- }
- }
- function setCloseChildWindow(){
- model.makeValue(gvChildClosePath,"Y");
- }
- function isPopup() {
- var stype = window.type;
- if (stype == "iviewer" || stype == "main") {
- return false;
- } else {
- return true;
- }
- }
- function activateChild(wid) {
- var cwnd = window.children.item(wid);
- if (cwnd != null) {
- cwnd.activate();
- }
- }
- function activateOpener() {
- if (isPopup()) {
- opener.activateMyWindow();
- }
- }
- function activateMyWindow() {
- if (isPopup()) {
- window.restore();
- window.activate();
- } else {
- htmlwindow.focus();
- }
- }
- function getScreenDisabled(){
- return body.disabled;
- }
- function setMenuDisabled(type){
- htmlwindow.setMenuDisabled(type);
- }
- function openInternal(openType,id,idType,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos) {
- var url = null;
- var sid = getScreenID(id);
- if (wid == null || wid == "") {
- wid = sid;
- }
- if (prevPos == null) {
- prevPos = true;
- }
- if ( idType == "url" ) { // idType == "url" 이면 ID를 그대로 URL로 open한다.
- url = id;
- } else {
-
- url = getScreenURL(sid);
- }
-
- var prop = null;
- if (monNo == null && xPos == null && yPos == null) {
-
- var viewerObj = getViewer("sysMessage");
- if (viewerObj != null && viewerObj.window.fSetStatusMessage != undefined) {
-
-
-
- var loc = locateCenter(xPos, yPos, userProp);
- xPos = loc[0];
- yPos = loc[1];
- prop = "top:"+yPos+"px;left:"+xPos+"px;width:" + gvDefaultScrWidth + "px;height:" + gvDefaultScrHeight + "px;";
- } else {
-
- prop = "align:center;width:" + gvDefaultScrWidth + "px;height:" + gvDefaultScrHeight + "px;";
- }
- } else {
-
-
-
-
-
-
- loc = locateCenter(xPos, yPos, userProp,monNo);
- xPos = loc[0];
- yPos = loc[1];
- prop="top:"+yPos+"px;left:"+xPos+"px;";
- }
-
- if (userProp != null) {
- prop = prop + userProp;
- }
-
-
- var viewerObj = getViewer("sysMessage");
- var wd = null;
- if (viewerObj != null && viewerObj.window.fGetOpenWindow != undefined) {
-
-
- wd = viewerObj.window.fGetOpenWindow(sid);
- } else {
- if (isPopup() && opener.getScreenID() == sid) {
- wd = opener;
- } else if (getScreenID() == sid) {
- wd = window;
- } else {
- wd = findChildWindowByScreenID(sid);
- }
- }
- var cid = "";
- if (wd != null && openType =="modeless") {
- cid = wd.getMyUID();
- wd.activateMyWindow();
- wd.body.dispatch("onActivate");
- } else {
- window.load(url,openType,wid,prop,ref,resultref);
- if (openType!="replace") {
-
-
- cid = model.getValue(gvChUIDPath+"latest");
- model.makeValue(gvChUIDPath+wid,cid);
- model.makeValue(gvChUIDPath+"latest","");
- }
- }
- return cid;
-
- }
- function navigate(id,monNo,xPos,yPos,wid,ref,resultref, authCode) {
-
- var scrnauth = model.getValue(gvAuthPath);
- setGlobalVariable("scrnauth", scrnauth);
-
- closeChildWindow();
- if (authCode == null) {
- setGlobalVariable("spclscrnauth", getAuthCode(""));
- } else {
- setGlobalVariable("spclscrnauth", getAuthCode(authCode));
- }
-
- return openInternal("replace",id,"scn",monNo,xPos,yPos,wid,ref,resultref);
- }
- function modal(id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos, authCode, resizeType) {
- var rtn = "";
- body.setDisabled(true);
- if (userProp == null) {
- userProp = "min:hidden;max:hidden;";
- } else {
- userProp = "min:hidden;max:hidden;" + userProp;
- }
- if (authCode == null) {
- setGlobalVariable("spclscrnauth", getAuthCode(""));
- } else {
- setGlobalVariable("spclscrnauth", getAuthCode(authCode));
- }
- if (resizeType == null || resizeType == "" || resizeType == "none") {
- setGlobalVariable("resizetype", "none");
- } else if (resizeType == "notaskbar") {
- setGlobalVariable("resizetype", "notaskbar");
- } else if (resizeType == "free") {
- setGlobalVariable("resizetype", "free");
- }
- rtn = openInternal("modal",id,"scn",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
- body.setDisabled(false);
- return rtn;
- }
- function getAuthCode(auth) {
- return "";
- }
- function setSystemMessage(msg) {
-
-
-
-
- }
- function getAbsoluteLocation(mon,xpos,ypos) {
-
-
-
-
- var abspos = new Array(2);
- abspos[0] = xpos;
- abspos[1] = ypos;
- return abspos;
-
- }
- function getRelativeCoordinate(xpos,ypos){
-
-
-
-
-
-
- var coord = new Array(3);
- coord[0] = 1;
- coord[1] = xpos;
- coord[2] = ypos;
- return coord;
-
- }
- function getCurrentMonitorNumber() {
- return getRelativeCoordinate(window.left,window.top)[0];
- }
- function getMonitorSize(monNo) {
-
-
-
-
- var monSize = new Array(2);
- monSize[0] = 1280;
- monSize[1] = 1024;
- return monSize;
-
- }
- function addOpenWindow() {
-
-
- }
- function removeOpenWindow() {
-
-
- }
- function getOpenWindow(sid) {
-
-
-
-
- return null;
- }
- function getMainViewer(){
-
-
-
-
-
-
-
-
- return null;
-
-
-
- }
- function getParameterPath() {
- return gvParamPath;
- }
- function setParameter(name, value){
- var valueNode = instance1.selectSingleNode(gvParamPath+"/"+name+"/"+name+"value");
- model.makeValue(gvParamPath+"/"+name+"/"+name+"value", value);
- }
- function addParameter(name, value){
- var valueNode = instance1.selectSingleNode(gvParamPath+"/"+name+"/"+name+"value");
- if(valueNode==null){
- model.makeValue(gvParamPath+"/"+name+"/"+name+"value", value);
- }else{
- var nameNode = instance1.selectSingleNode(gvParamPath+"/"+name);
- valueNode = instance1.createNode("element", name+"value", "");
- valueNode.text = value;
- nameNode.appendChild(valueNode);
- }
- }
- function getParameter(name, index){
- if (index==null) { index = 1; }
- return model.getValue(gvParamPath+"/"+name+"/"+name+"value["+index+"]");
- }
- function getParameterCount(name){
- return new Number(instance1.selectnodes(gvParamPath+"/"+name+"/"+name+"value").length);
- }
- function removeParameter(name, index){
- if (index==null) { index = 1; }
- model.removeNode(gvParamPath+"/"+name+"/"+name+"value["+index+"]");
- }
- function clearParameter(name){
- model.removeNode(gvParamPath+"/"+name);
- }
- function getBizName(bizCode) {
- var firstChar = bizCode.charAt(2);
- var bizName = "";
- switch(firstChar) {
- case 'P':
- case 'p':
- bizName = "pam";
- break;
- case 'M':
- case 'm':
- bizName = "emr";
- break;
- case 'A':
- case 'a':
- bizName = "ast";
- break;
- case 'L':
- case 'l':
- bizName = "lis";
- break;
- case 'R':
- case 'r':
- bizName = "mis";
- break;
- case 'Z':
- case 'z':
- bizName = "com";
- break;
- case 'S':
- case 's':
- bizName = "sts";
- break;
- case 'C':
- case 'c':
- bizName = "crm";
- break;
- case 'I':
- case 'i':
- bizName = "crc";
- break;
- case 'D':
- case 'd':
- bizName = "crd";
- break;
- case 'T':
- case 't':
- bizName = "tmp";
- break;
- default:
- bizName = "";
- break;
- }
- return bizName;
- }
- function getMainDomain() {
-
- var domainStr = getGlobalVariable("domain");
- if (domainStr == "") {
- domainStr = "http://his999dev.knu.ac.kr:8088";
- }
- return domainStr;
- }
-
- function getDomain(syscd) {
- var domainStr = null;
- if (syscd == null || syscd == "") {
- syscd = model.getValue(gvSystemPath);
- }
- if (syscd == null || syscd == "") {
- domainStr = getMainDomain();
- } else {
- domainStr = getGlobalVariable("sysurl" + syscd.toUpperCase());
- }
- return domainStr;
- }
- function getScreenURL(sid,syscd) {
- return getDomain(syscd)+getScreenURI(sid);
- }
- function getScreenURI(sid) {
- return "/himed/webapps/hit/web/xrw/"+sid+".xrw";
- }
- function getActionURI(submitID) {
- var bizName = getBizName(submitID);
- var scrnID = getScreenID();
- return "/himed/webapps/hit/web/xrw/.live?submit_id="+submitID+"&business_id="+bizName+"&screen_id="+scrnID;
- }
- function getActionURL(submitID) {
- return getDomain()+getActionURI(submitID);
- }
- var gvOnSubmit = false;
- var gvShowAlert = false;
- var gvSuppressError = false;
- var gvForceSubmit = false;
- var gvHtmlRedirect = false;
- var gvSuppressErrorCheck = false;
- function setAlertOn() {
- gvShowAlert = true;
- }
- function setErrorOff(SuppressErrorCheck) {
- gvSuppressError = true;
- if(SuppressErrorCheck == true)
- {
- gvSuppressErrorCheck = true;
- }
- }
- function setErrorOn() {
- gvSuppressError = false;
- gvSuppressErrorCheck = false;
- }
- function setForceOn() {
- gvForceSubmit = true;
- }
- function setHtmlRedirect() {
- gvHtmlRedirect = true;
- }
- function checkTimeout() {
- var timeOut = parseInt(getGlobalVariable("session_timeout"));
- if (isNaN(timeOut) || timeOut <= 0) {
- return false;
- }
- var lastTime = getGlobalVariable("last_submit");
- var curTime = (new Date()).getTime();
- if (curTime - parseInt(lastTime) > (timeOut*60000)) {
- return true;
- } else {
- return false;
- }
- }
- function submit(submitID, refresh, ref, resultref, encoding) {
- var showAlert = gvShowAlert;
- var suppressError = gvSuppressError;
- gvShowAlert = false;
-
- if(gvSuppressErrorCheck == false)
- {
- gvSuppressError = false;
- }
-
-
- if (gvOnSubmit) {
- gvHtmlRedirect = false;
- return false;
- } else {
- gvOnSubmit = true;
- }
-
- var actionURL = getActionURL(submitID)
- + getUserSessionString();
-
- if ( refresh == null ) {
- refresh = true;
- }
-
- var retvalue = false;
-
- try {
- var sid = document.allElement.item(submitID);
- if (!sid) {
- messageBox("Submit["+submitID+"]이 정의되지","E007");
- gvOnSubmit = false;
- gvHtmlRedirect = false;
- return false;
- }
-
-
- if ( ref != null && ref != "" ) {
- sid.setAttribute("ref", ref);
- }
-
- if ( resultref != null && resultref != "" ) {
- sid.setAttribute("resultref", resultref);
- }
-
-
- sid.setAttribute("action", actionURL);
- sid.setAttribute("encoding", "utf-8");
-
-
-
- model.removeNode(gvErrorMsgPath);
-
-
-
-
- var ret = model.send(submitID, refresh, false, false);
-
- if ( ret == 200 ) {
-
- retvalue = showSystemMessage(showAlert,suppressError);
- }
-
-
- } catch (e) {
- if (!suppressError) {
- messageBox("Submit["+submitID+"] 실행을","E009","[exception:"+e+"]");
- }
- retvalue = false;
- }
-
- gvOnSubmit = false;
- gvHtmlRedirect = false;
- return retvalue;
- }
- function submit_old(submitID, refresh, ref, resultref, encoding) {
- var showAlert = gvShowAlert;
- var suppressError = gvSuppressError;
- gvShowAlert = false;
-
- if(gvSuppressErrorCheck == false)
- {
- gvSuppressError = false;
- }
- var islogout = false;
-
- if (!gvForceSubmit) {
- gvForceSubmit = false;
- if (checkTimeout()) {
-
- body.setDisabled(true);
- setParameter("type", "session");
-
- setParameter("islogout", "false");
- modal("SPZUM00400", "", "", "", "", "", "","width:279px;height:180px;align:center;sysmenu:hidden;");
- body.setDisabled(false);
- if (getParameter("islogout") == "true") {
-
- islogout = true;
- } else {
- if (checkTimeout()) {
- gvHtmlRedirect = false;
- return false;
- }
- }
- }
-
- setGlobalVariable("last_submit", (new Date()).getTime());
- }
-
- if (islogout) {
- var status = getViewer("sysMessage");
- status.window.fLogout("session");
- return;
- } else {
-
- if (gvOnSubmit) {
- gvHtmlRedirect = false;
- return false;
- } else {
- gvOnSubmit = true;
- }
-
- var actionURL = getActionURL(submitID)
- + getUserSessionString();
-
- if ( refresh == null ) {
- refresh = true;
- }
-
- var retvalue = false;
-
- try {
- var sid = document.allElement.item(submitID);
- if (!sid) {
- messageBox("Submit["+submitID+"]이 정의되지","E007");
- gvOnSubmit = false;
- gvHtmlRedirect = false;
- return false;
- }
-
-
- if ( ref != null && ref != "" ) {
- sid.setAttribute("ref", ref);
- }
-
- if ( resultref != null && resultref != "" ) {
- sid.setAttribute("resultref", resultref);
- }
-
-
- sid.setAttribute("action", actionURL);
- if (encoding != null && encoding != "") {
- sid.setAttribute("encoding", encoding);
- } else {
- sid.setAttribute("encoding", "utf-8");
- }
-
-
-
- model.removeNode(gvErrorMsgPath);
-
-
- var ret = model.send(submitID, refresh, false, true);
-
- if ( ret == 200 ) {
-
- retvalue = showSystemMessage(showAlert,suppressError);
- }
-
-
- } catch (e) {
- if (!suppressError) {
- messageBox("Submit["+submitID+"] 실행을","E009","[exception:"+e+"]");
- }
- retvalue = false;
- }
-
- gvOnSubmit = false;
- gvHtmlRedirect = false;
- return retvalue;
- }
- }
- function xforms_submit_error() {
- if (error.errorcode == 3003) {
- messageBox("받은 데이터 중 유효하지 않은 문자가 존재하여 화면 출력을","E009","[errorcode:"+error.errorcode+"]");
- m_event.stopPropagation();
- }
- }
- function showSystemMessage(showAlert,suppressError) {
- var type = model.getValue(gvErrorMsgPath+"/type");
- var code = model.getValue(gvErrorMsgPath+"/code");
- var msg = model.getValue(gvErrorMsgPath+"/msg");
- var desc = model.getValue(gvErrorMsgPath+"/description");
- if ( "error" == type ) {
- if (suppressError == null || !suppressError) {
- body.setDisabled(true);
- window.load("../../../com/commonweb/xrw/SPZZZ00100_시스템에러.xrw","modal","","width:514px;height:198px;align:center;",gvErrorMsgPath,"/root/main");
- body.setDisabled(false);
- }
- return false;
- } else {
- setSystemMessage(msg);
- if (showAlert != null && showAlert) {
- messageBox(msg,"I");
- }
- return true;
- }
- }
- function onredirecthtml() {
- if( document.allElement.item(m_event.target).elementName == "xforms:submission" && gvHtmlRedirect == false) {
- m_event.preventDefault();
- m_event.stopPropagation();
- }
- gvHtmlRedirect = false;
- }
- function onerror() {
- var msg = error.description;
- var svrtime = error.errorSource;
- var pctime = (new Date()).getTime();
-
- setGlobalVariable("timediff", svrtime - pctime);
- m_event.stopPropagation();
-
- handleSystemMessage(msg);
- }
- function handleSystemMessage(msg) {
-
- var msgItem = msg.split("|");
- model.makeValue(gvErrorMsgPath+"/type",msgItem[0]);
- model.makeValue(gvErrorMsgPath+"/code",msgItem[1]);
- model.makeValue(gvErrorMsgPath+"/msg",msgItem[2].replace(";","\n"),true);
- var description = "";
- if (msgItem[3] != null && msgItem[3] != "undefined") {
- description = msgItem[3];
- }
- if (msgItem[4] != null && msgItem[4] != "undefined") {
- description = description + "\n" + msgItem[4];
- }
- model.makeValue(gvErrorMsgPath+"/description",description);
- }
-
- function getUserSessionString() {
- var sessionStr = "&macaddr="+getUserInfo("macaddr");
- var isAnonymous = getGlobalVariable("anonymous");
- if (isAnonymous == "true") {
- sessionStr = sessionStr + "&anony_session="+encodeURI(getUserInfos());
- }
- return sessionStr;
- }
-
- function messageBox(pMessage, pCode, pOptMsg) {
- var alertMsg = null;
- var msgTitle = null;
- var msgType = null;
- var msgData = null;
- var msgRtn = "";
-
- switch( pCode.substr(0,1) ){
- case "I": msgTitle = "정보";
- msgType = "64";
- break;
- case "C": msgTitle = "오류";
- msgType = "16";
- break;
- case "E": msgTitle = "경고";
- msgType = "48";
- break;
- case "Q": msgTitle = "확인";
- msgType = "36";
- break;
- case "S": msgTitle = "선택";
- msgType = "35";
- break;
- default : msgTitle = "오류";
- msgType = "16";
- }
-
- switch( pCode ){
- case "I001": alertMsg = " 처리되었습니다."; break;
- case "I002": alertMsg = " 완료되었습니다."; break;
- case "I003": alertMsg = " 필수입력입니다."; break;
- case "I004": alertMsg = " 없습니다."; break;
- case "I005": alertMsg = " 환자입니다."; break;
- case "I006": alertMsg = " 가능합니다."; break;
- case "I007": alertMsg = " 확인하십시오."; break;
- case "I008": alertMsg = " 하십시오."; break;
- case "I009": alertMsg = " 입니다."; break;
- case "I010": alertMsg = " 있습니다."; break;
- case "I011": alertMsg = " 않습니다.";break;
- case "C001": alertMsg = " 입력하십시오."; break;
- case "C002": alertMsg = " 선택하십시오."; break;
- case "C003": alertMsg = " 진행하십시오."; break;
- case "E001": alertMsg = " 할 수 없습니다."; break;
- case "E002": alertMsg = " 권한이 없습니다."; break;
- case "E003": alertMsg = " 초과하였습니다."; break;
- case "E004": alertMsg = " 일치하지 않습니다."; break;
- case "E005": alertMsg = " 선택되었습니다."; break;
- case "E006": alertMsg = " 중복되었습니다."; break;
- case "E007": alertMsg = " 않았습니다."; break;
- case "E008": alertMsg = " 입니다."; break;
- case "E009": alertMsg = " 실패하였습니다."; break;
- case "E010": alertMsg = " 사원만 가능합니다."; break;
- case "E011": alertMsg = " 이전만 가능합니다."; break;
- case "E012": alertMsg = " 이후만 가능합니다."; break;
- case "E013": alertMsg = " 데이터가 없습니다."; break;
- case "E014": alertMsg = " 존재하지 않습니다."; break;
- case "E015": alertMsg = " 자리까지만 가능합니다."; break;
- case "E016": alertMsg = " 유효하지 않습니다."; break;
- case "Q001": alertMsg = " 삭제 하시겠습니까?"; break;
- case "Q002": alertMsg = " 저장 하시겠습니까?"; break;
- case "Q003": alertMsg = " 계속 진행하시겠습니까?"; break;
- case "Q004": alertMsg = " 실행 하시겠습니까?"; break;
- case "Q005": alertMsg = " 조회 하시겠습니까?"; break;
- case "Q006": alertMsg = " 확정 하시겠습니까?"; break;
- case "Q007": alertMsg = " 취소 하시겠습니까?"; break;
- case "Q008": alertMsg = " 추가 하시겠습니까?"; break;
- case "Q009": alertMsg = " 적용 하시겠습니까?"; break;
- case "Q010": alertMsg = " 초기화 하시겠습니까?"; break;
- case "Q011": alertMsg = " 확인 하시겠습니까?"; break;
- case "Q012": alertMsg = " 수정 하시겠습니까?"; break;
- case "Q013": alertMsg = " 선택 하시겠습니까?";break;
- case "Q014": alertMsg = " 등록 하시겠습니까?";break;
- case "Q015": alertMsg = " 재요청 하시겠습니까?";break;
- case "Q016": alertMsg = " 종결된 기록지입니다. 기록내용을 수정하시겠습니까?";break;
- case "S001": alertMsg = " 하시려면 예(Yes)\n아니면 아니오(No)를 선택하십시오."; break;
- case "S002": alertMsg = " 저장하시려면 예(Yes)\n변경하시려면 아니오(No)를 선택하십시오"; break;
- case "S003": alertMsg = " 하시려면 예(Yes)\n" + pOptMsg + " 하시려면 아니오(No)를 선택하십시오.";break;
- case "S004": alertMsg = " 하시려면 예(Yes)\n아니면 아니오(No)\n무시하시려면 취소를 선택하십시오";break;
- case "S005": alertMsg = " 종결된 기록지입니다. 작업유형을 선택하십시오\n\n예 : 기록수정 / 아니오 : 신규기록생성";break;
- case "S006": alertMsg = " 하시려면 예(Yes)\n" + pOptMsg.split("|")[0] + " 하시려면 아니오(No)\n" + pOptMsg.split("|")[1] + " 하시려면 취소를 선택하십시오";break;
- case "S007": alertMsg = " \n재등록 하시려면 예(Yes), " + pOptMsg.split("|")[0] + " 아니오(No), " + pOptMsg.split("|")[1] + " 취소를 선택하십시오.";break;
- default : alertMsg = "";
- }
- if(pOptMsg == null || pOptMsg == ""){
- msgData = pMessage+alertMsg;
- } else {
- if (pCode == "S003" || pCode == "S006" || pCode == "S007") {
- msgData = pMessage+alertMsg;
- } else {
- msgData = pMessage+alertMsg + "\n" + pOptMsg;
- }
- }
- body.setDisabled(true);
- msgRtn = window.showMessageBox( msgData, msgTitle, msgType );
- body.setDisabled(false);
- return msgRtn;
- }
- function getUserId() {
- return getUserInfo("userid");
- }
- function getUserName() {
- return getUserInfo("usernm");
- }
- function getUserInfo(key) {
- if ( getGlobalVariable("userinfos") == "" ) {
-
- }
- return getGlobalVariable(key);
- }
- function getUserInfos() {
- if ( getGlobalVariable("userinfos") == "" ) {
-
- }
- return getGlobalVariable("userinfos");
- }
- function setDefaultUserInfo() {
- var userInfoKeyStr="userid|usernm|posinstcd|posinstnm|posdeptcd|posdeptnm|dutplceinstcd|dutplceinstnm|dutplcecd|dutplcenm|jobkindcd|jobkindnm|jobposcd|jobposnm|jobrespcd|jobrespnm|prfshipflagcd|prfshipflagnm|licnsno|specordyn|deptabbr|orddeptflag|wardflag|systemcd|systemnm|systeminstcd|systeminstnm|logindt|kmiip|kmiport|usergrp|ipaddr|dutinstcd|dutinstnm|dutunitcd|dutunitnm|mpphonno|orginstcd|orginstnm|orgdeptcd|orgdeptnm|userkindcd|ordsupdeptcd";
- var userInfoKeyArr = userInfoKeyStr.split("|");
- var userInfoStr = "";
- try {
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var f = fso.GetFile("session.txt");
- var ts = f.OpenAsTextStream(1);
- userInfoStr = ts.ReadLine();
- ts.Close();
- } catch(e) {
- }
- var userInfoArr = userInfoStr.split("|");
- var len = userInfoKeyArr.length;
- setGlobalVariable("anonymous","true");
- for(i=0;i<len;i++) {
- setGlobalVariable(userInfoKeyArr[i],userInfoArr[i]);
- }
- setGlobalVariable("userinfos", userInfoStr);
- }
- function getPropertyName(key, bizCode){
- var bizName = "";
- var propertyName = "";
- if (bizCode == null || bizCode == "" || bizCode == "undefined")
- {
- bizName = "";
- }else{
- bizName = getBizName(bizCode)+"_";
- }
- return getSystemCd()+"_"+bizName+"gsv_"+key;
- }
- function setGlobalVariable(key, value, bizCode){
- model.setProperty(getPropertyName(key, bizCode), value);
- return true;
- }
- function getGlobalVariable(key, bizCode){
- return model.getProperty(getPropertyName(key, bizCode));
- }
- function screenPrint(){
- modal("SPZUR00200");
- }
- function getImageURL(imgcd, type){
- if (type == null || type == "") {
- type = "gif";
- }
- return getDomain()+"/himed/webapps/com/commonweb/images/"+imgcd+"." + type;
- }
- function getLogoImageURL(syscd){
- return getImageURL("logo"+getLogoImageKey(syscd));
- }
- function getLogoEImageURL(syscd){
- return getImageURL("logo"+getLogoImageKey(syscd)+"e","jpg");
- }
- function getBigLogoImageURL(type, syscd) {
- if (type.toUpperCase() == "H") {
- type == "";
- } else if (type.toUpperCase() == "E") {
- type = "e";
- }
- return getImageURL("biglogo" + getLogoImageKey(syscd) + type, "jpg");
- }
- function getLogoImageKey(syscd){
- var imageKey = "";
- if(syscd == null || syscd == ""){
- syscd = getSystemCd();
- }
- if(syscd.toUpperCase() == "MIS001") {
- imageKey = getUserInfo("dutplceinstcd");
- }else{
- imageKey = syscd.substr(3,3);
- }
-
- return imageKey;
- }
- function openLoadingBar(msg){
- setParameter("msg", msg);
- open("SPZZZ00400", "", "", "", "", "", "","width:327px; height:121px; caption:hidden; resize:false;");
-
-
- }
- function closeLoadingBar(){
- var child = getChildWindow("SPZZZ00400");
- if(child != null) {
- child.close();
- }
- }
- var gvCommonCachePath="/root/hidden/common/cache";
- function copyFromCache(itemname,resultref) {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj == null) {
- return false;
- }
-
- var srcPath = gvCommonCachePath+"/"+itemname;
- model.makeNode(resultref);
-
- var itemnode = viewerObj.window.instance1.selectSingleNode(srcPath);
- if (itemnode == null) {
- return false;
- } else {
-
- var dueDate = itemnode.getAttribute("duedate");
- var curDate = (new Date()).valueOf();
- if (dueDate < curDate) {
- return false;
- }
- }
-
- model.copyNode(resultref,itemnode);
- return true;
- }
- function storeIntoCache(itemname,resultref,duemin) {
- var viewerObj = getViewer("sysMessage");
- if (viewerObj == null) {
- return;
- }
- var destPath = gvCommonCachePath+"/"+itemname;
- viewerObj.window.model.makeNode(destPath);
-
- var itemnode = instance1.selectSingleNode(resultref);
- if (itemnode == null) {
- return;
- }
-
- viewerObj.window.model.copyNode(destPath,itemnode);
- itemnode = viewerObj.window.instance1.selectSingleNode(destPath);
- if (itemnode != null) {
- var dueDate = (new Date()).valueOf();
- if (duemin == null) {
- duemin = 600;
- }
- dueDate = dueDate + duemin*60*1000;
- itemnode.setAttribute("duedate",dueDate);
- }
- }
- function openEmrScrn(scrnid){
- setParameter("SPMMB08400_scrnid", scrnid);
- modal("SPMMB08400", 1, 0, 0, "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
- return true;
- }
- function download(submitid, param, localfile, showui) {
- if (showui == null) {
- showui = true;
- }
-
- model.download(encodeURI(getActionURL(submitid) + param), localfile, showui);
- }
- function DOMActivate(){
-
- if(checkOpener()){
- if(opener.getParameter("domactivate") == "true"){
- var btnobj = document.allElement.item(m_event.target);
- var btnid = btnobj.attribute["id"];
- if(btnid.substring(0, 4) == "btn_"){
- opener.addBtnID(btnid);
- }
- }
- }
- }
- function btnObj(btnID, btnTxt){
- this.btnID = btnID;
- this.btnTxt = btnTxt;
- }
- function getBtnCtrlInfo(){
- var cnt = 0;
- var ctrlID;
- var loopcnt = document.controls.length;
- var btnCtrlArr = new Array();
- for(var i = 0; i < loopcnt; i++){
- ctrlID = document.controls.item(i);
- if(ctrlID.attribute["class"].substring(0, 3)=="btn"){
- btnCtrlArr[cnt] = new btnObj(ctrlID.attribute["id"], ctrlID.attribute["text"]);
- cnt++;
- }
- }
-
- return btnCtrlArr;
- }
-
- function grdBaseColHidn(option, grd_obj, colnm_size, colnm_vol1, colnm_qty1, colnm_vol2, colnm_qty2, colnm_size_qty) {
- var hardcd = "";
- var sysMessageobj = getViewer("sysMessage");
- if (sysMessageobj != null) {
-
-
- hardcd = model.getValue("/root/hidden/grdHardcd/hardcd/hardcd");
- }
-
- if (option == null || option == "" || option == "undefined") {
- option = hardcd;
- }
- if (colnm_size == null || colnm_size == "" || colnm_size == "undefined") {
- sColnm_size = 37;
- } else {
- sColnm_size = colnm_size;
- }
-
- if (grd_obj == null || grd_obj == "" || grd_obj == "undefined") {
- sGrd_objnm = "grd_prcplist";
- } else {
- sGrd_objnm = grd_obj;
- }
-
- if (colnm_vol1 == null || colnm_vol1 == "" || colnm_vol1 == "undefined") {
- sColnm_vol1 = "prcpvol";
- } else {
- sColnm_vol1 = colnm_vol1
- }
-
- if (colnm_qty1 == null || colnm_qty1 == "" || colnm_qty1 == "undefined") {
- sColnm_qty1 = "prcpqty";
- } else {
- sColnm_qty1 = colnm_qty1
- }
-
- if (colnm_vol2 == null || colnm_vol2 == "" || colnm_vol2 == "undefined") {
- sColnm_vol2 = "drprcpetc7";
- } else {
- sColnm_vol2 = colnm_vol2;
- }
-
- if (colnm_qty2 == null || colnm_qty2 == "" || colnm_qty2 == "undefined") {
- sColnm_qty2 = "drprcpetc8";
- } else {
- sColnm_qty2 = colnm_qty2;
- }
-
- if (colnm_size_qty == null || colnm_size_qty == "" || colnm_size_qty == "undefined") {
- sColnm_size_qty = sColnm_size;
- } else {
- sColnm_size_qty = colnm_size_qty;
- }
-
-
- if (option =="A") {
-
- if (grd_obj == null || grd_obj == "" || grd_obj == "undefined") {
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), false);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), sColnm_size);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), sColnm_size_qty);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), sColnm_size);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), sColnm_size_qty);
- }
-
- } else if (option =="B") {
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), true);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), true);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), sColnm_size);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), sColnm_size_qty);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), 0);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), 0);
-
- } else if (option =="C") {
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), true);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), true);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), false);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), 0);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), 0);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), sColnm_size);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), sColnm_size_qty);
-
- } else if (option =="D") {
-
- return hardcd
- } else if (option =="E") {
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), true);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), sColnm_size);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), 0);
- } else if (option =="F") {
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), true);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), false);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), 0);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), sColnm_size);
- } else if (option =="G") {
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), true);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), sColnm_size_qty);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), 0);
- } else if (option =="H") {
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), true);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), false);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), 0);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), sColnm_size_qty);
- } else {
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), false);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), true);
- document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), true);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), sColnm_size);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), sColnm_size_qty);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), 0);
- document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), 0);
- }
- }
- function toDate(pPattern)
- {
- var index = -1;
- var year;
- var month;
- var day;
- var hour = 0;
- var min = 0;
- var sec = 0;
- var ms = 0;
- if(isNull(pPattern)) pPattern = "YYYYMMDD";
- if ((index = pPattern.indexOf("YYYY")) == -1 ) {
- index = pPattern.indexOf("YY");
- year = "20" + this.substr(index, 2);
- } else {
- year = this.substr(index, 4);
- }
- index = pPattern.indexOf("MM");
- month = this.substr(index, 2);
- index = pPattern.indexOf("DD");
- day = this.substr(index, 2);
- if ((index = pPattern.indexOf("hh")) != -1 ) {
- hour = this.substr(index, 2);
- }
- if ((index = pPattern.indexOf("mm")) != -1 ) {
- min = this.substr(index, 2);
- }
- if ((index = pPattern.indexOf("ss")) != -1 ) {
- sec = this.substr(index, 2);
- }
- if ((index = pPattern.indexOf("SS")) != -1 ) {
- ms = this.substr(index, 2);
- }
- return new Date(year, month - 1, day, hour, min, sec, ms);
- }
- function getCurrentDate()
- {
- var sDate = getNewDate();
- rtnDate = sDate.getFullYear();
- rtnDate = rtnDate.toString() + (( sDate.getMonth() + 1 > 9 ) ? sDate.getMonth() + 1 : "0" + (sDate.getMonth() + 1));
- rtnDate = rtnDate.toString() + (( sDate.getDate() > 9 ) ? sDate.getDate() : "0" + sDate.getDate()) ;
- return rtnDate;
- }
- function getDateFormat(pPattern)
- {
- var GLB_MONTH_IN_YEAR = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
- var GLB_DAY_IN_WEEK = new Array("Sunday", "Monday", "Tuesday", "Wednesday","Thursday", "Friday", "Saturday");
- var year = this.getFullYear();
- var month = this.getMonth() + 1;
- var day = this.getDate();
- var dayInWeek = this.getDay();
- var hour24 = this.getHours();
- var ampm = (hour24 < 12) ? 0 : 1;
- var hour12 = (hour24 > 12) ? (hour24 - 12) : hour24;
- var min = this.getMinutes();
- var sec = this.getSeconds();
- var YYYY = "" + year;
- var YY = YYYY.substr(2);
- var MM = (("" + month).length == 1) ? "0" + month : "" + month;
- var MON = GLB_MONTH_IN_YEAR[month-1];
- var DD = (("" + day).length == 1) ? "0" + day : "" + day;
- var DAY = GLB_DAY_IN_WEEK[dayInWeek];
- var HH = (("" + hour12).length == 1) ? "0" + hour12 : "" + hour12;
- var hh = (("" + hour24).length == 1) ? "0" + hour24 : "" + hour24;
- var mm = (("" + min).length == 1) ? "0" + min : "" + min;
- var ss = (("" + sec).length == 1) ? "0" + sec : "" + sec;
- var SS = "" + this.getMilliseconds();
- var a = (a == 0) ? "AM" : "PM";
- var dateStr;
- var index = -1;
- if (typeof(pPattern) == "undefined") {
- dateStr = "YYYYMMDD";
- } else {
- dateStr = pPattern;
- }
- dateStr = dateStr.replace(/a/g, a);
- dateStr = dateStr.replace(/YYYY/g, YYYY);
- dateStr = dateStr.replace(/YY/g, YY);
- dateStr = dateStr.replace(/MM/g, MM);
- dateStr = dateStr.replace(/MON/g, MON);
- dateStr = dateStr.replace(/DD/g, DD);
- dateStr = dateStr.replace(/DAY/g, DAY);
- dateStr = dateStr.replace(/hh/g, hh);
- dateStr = dateStr.replace(/HH/g, HH);
- dateStr = dateStr.replace(/mm/g, mm);
- dateStr = dateStr.replace(/ss/g, ss);
- return dateStr;
- }
- function getNewDate(){
- var rtnDate = new Date();
- var timediff = getGlobalVariable("timediff");
- var serverInterval = 0;
- if(!isNull(timediff) && !isNaN(timediff)){
- serverInterval = parseInt(timediff);
- }
- rtnDate.setTime(rtnDate.getTime() + serverInterval);
-
- return rtnDate;
- }
- function getAddDate(pNum, pKind)
- {
- var rtnDate = this;
- if(isNull(pKind)) pKind = "D";
- switch(pKind){
- case "Y" : rtnDate.setFullYear(this.getFullYear() + pNum);break;
- case "M" : rtnDate.setMonth(this.getMonth() + pNum);break;
- case "D" : rtnDate.setDate(this.getDate() + pNum);break;
- case "h" : rtnDate.setHours(this.getHours() + pNum);break;
- case "m" : rtnDate.setMinutes(this.getMinutes() + pNum);break;
- case "s" : rtnDate.setSeconds(this.getSeconds() + pNum);break;
- }
- return rtnDate;
- }
- function isNull(str){
- return ((str == null || str == "" || str == "undefined") ? true:false);
- }
- var gvFormUpdateYN = false;
- function setCSVToNode(destRef, CSV, nodeSetName) {
- var sColSep = "▦";
- var sRowSep = "▩";
-
- var nodeNameArray = CSV.split(sRowSep)[0].split(sColSep);
-
- var nodeNameArrayCnt = nodeNameArray.length;
-
- if( nodeSetName == null || nodeSetName == "")
- nodeSetName = "list";
-
- var tmpDestNode = instance1.createElement(nodeSetName);
- var tmpDestChildNode;
- var i, j;
- for( i = 0; i < nodeNameArrayCnt; i++ ) {
-
- tmpDestChildNode = instance1.createElement(nodeNameArray[i]);
-
- model.duplicate(tmpDestNode, tmpDestChildNode);
- }
-
- var CSVArray = CSV.split(sRowSep);
-
- var CSVArrayCnt = CSVArray.length - 1;
-
- var srcNode = instance1.selectSingleNode(destRef);
- var nodeValueArray;
-
- for( i = 1; i < CSVArrayCnt; i++ ) {
-
- nodeValueArray = CSVArray[i];
- for ( j = 0; j < nodeNameArrayCnt; j++ ) {
-
- tmpDestNode.childNodes.item(j).text = nodeValueArray.split(sColSep)[j];
- }
- model.duplicate(srcNode, tmpDestNode);
- }
- }
- function addComboItem( comboID, label, value, position ) {
- var comboObj = document.allElement.item(comboID);
-
- var comboItemNodeSet = comboObj.choices.itemset.attribute["nodeset"];
- var comboLabelRef = comboObj.choices.itemset.label.attribute["ref"];
- var comboValueRef = comboObj.choices.itemset.value.attribute["ref"];
- var nodeNn = instance1.selectSingleNode(comboItemNodeSet);
- if (nodeNn == null) {
- model.makeNode(comboItemNodeSet);
- model.makeNode(comboItemNodeSet+"/"+comboLabelRef);
- model.makeNode(comboItemNodeSet+"/"+comboValueRef);
- position = "init";
- }
-
- var itemNode = instance1.createNode("element", instance1.selectSingleNode(comboItemNodeSet).nodeName, "");
- var labelNode = instance1.createNode("element", comboLabelRef, "");
- var valueNode = instance1.createNode("element", comboValueRef, "");
- if( label == null || label == "" ) label = "- 전 체 -";
-
-
- XmlLib.setTextValue(labelNode, label);
- itemNode.appendChild(labelNode);
- if( value == null || value == "" ) value = "";
-
-
- XmlLib.setTextValue(valueNode, value);
- itemNode.appendChild(valueNode);
- if( position == null || position == "" )
- position = "above";
- var destNode = instance1.selectSingleNode(comboItemNodeSet);
- var pDestNode = destNode.parentNode;
- if( position == "above" ) {
- pDestNode.insertBefore(itemNode, destNode);
- } else if ( position == "init" ) {
- pDestNode.insertBefore(itemNode, destNode);
- pDestNode.removeChild(destNode);
- }
- else {
- pDestNode.appendChild(itemNode);
- }
- comboObj.refresh();
- }
- function setImageRefInstance(xpath) {
- var node = instance1.selectSingleNode(xpath);
- if( node == null )
- return;
- node.setAttribute("type","xsd:base64Binary");
- }
- function setInputNodeCurText( mask ) {
- var inputID = m_event.target;
- var inputObj = document.controls.item(inputID);
- var inputRef = inputObj.attribute["ref"];
- if( mask == null )
- model.setValue(inputRef, inputObj.m_heControl.value);
- else
- model.setValue(inputRef, inputObj.m_heControl.value.removeMask(mask));
- inputObj.refresh();
- setFormUpdate();
- }
- function setFormUpdate() {
- gvFormUpdateYN = true;
- }
- function isDataCell() {
- var gridObj = m_event.ptarget.parent;
- if( gridObj.isCell(m_event.target) && gridObj.row >= gridObj.fixedRows && gridObj.col >= gridObj.fixedCols) {
- return true;
- }
- else
- return false;
- }
- function copyNodeType(strDest, strSrc, mode, destModel, srcModel) {
- if( typeof(destModel) == "object" || typeof(destModel) == "undefined" ) {
- if( destModel == null ) {
- destModel = model;
- }
- }
- else {
- if( destModel == "" ) {
- destModel = model;
- }
- }
-
- var destNode = destModel.instances.item(0).selectSingleNode(strDest);
- if( destNode == null )
- return;
- var destChildNodeList = destNode.childNodes;
- if( typeof(srcModel) == "object" || typeof(srcModel) == "undefined" ) {
- if( srcModel == null ) {
- srcModel = model;
- }
- }
- else {
- if( srcModel == "" ) {
- srcModel = model;
- }
- }
-
- var srcNode = srcModel.instances.item(0).selectSingleNode(strSrc);
- if( srcNode == null )
- return;
- var cSrcNode = srcNode.cloneNode(true);
- var cSrcChildNodeList = cSrcNode.childNodes;
- var cSrcChildNode;
- if( cSrcChildNodeList.length == 0 )
- return;
-
- if( mode != "before" ) {
- if( mode == "replace" || mode == null ) {
- removeChildren(strDest, destModel)
- }
- for (var i=0; i<cSrcChildNodeList.length; i++){
- cSrcChildNode = cSrcChildNodeList.item(i);
- model.duplicate(destNode, cSrcChildNode);
- }
- }
-
- else {
-
- for( var i = cSrcChildNodeList.length - 1; i >= 0; i-- ) {
-
- destNode = destModel.instances.item(0).selectSingleNode(strDest);
- cSrcChildNode = cSrcChildNodeList.item(i);
- model.duplicate(destNode, cSrcChildNode, "*[1]");
- }
- }
- }
- function removeChildren( destNodePath, destModel ) {
- var modelObj;
- if( destModel == null ) {
- modelObj = model;
- }
- else
- modelObj = destModel;
- var node = modelObj.instances.item(0).selectSingleNode(destNodePath);
- var childNodeList = node.childNodes;
- var childNode;
- for (var i=0; i< childNodeList.length; i++){
- childNode = childNodeList.item(i);
- node.removeChild( childNode );
- }
- }
- function setCSVToNode(destRef, CSV, nodeSetName) {
- var sColSep = "▦";
- var sRowSep = "▩";
-
- var nodeNameArray = CSV.split(sRowSep)[0].split(sColSep);
-
- var nodeNameArrayCnt = nodeNameArray.length;
-
- if( nodeSetName == null || nodeSetName == "")
- nodeSetName = "list";
-
- var tmpDestNode = instance1.createElement(nodeSetName);
- var tmpDestChildNode;
- var i, j;
- for( i = 0; i < nodeNameArrayCnt; i++ ) {
-
- tmpDestChildNode = instance1.createElement(nodeNameArray[i]);
-
- model.duplicate(tmpDestNode, tmpDestChildNode);
- }
-
- var CSVArray = CSV.split(sRowSep);
-
- var CSVArrayCnt = CSVArray.length - 1;
-
- var srcNode = instance1.selectSingleNode(destRef);
- var nodeValueArray;
-
- for( i = 1; i < CSVArrayCnt; i++ ) {
-
- nodeValueArray = CSVArray[i];
- for ( j = 0; j < nodeNameArrayCnt; j++ ) {
-
- tmpDestNode.childNodes.item(j).text = nodeValueArray.split(sColSep)[j];
- }
- model.duplicate(srcNode, tmpDestNode);
- }
- }
- function getNodeListCSV(nodeList) {
- if( nodeList.length == 0 )
- return;
- var sColSep = "▦";
- var sRowSep = "▩";
- var rCSV = "";
- var childNodeList = nodeList.item(0).childNodes;
- var childNodeCnt = childNodeList.length;
- if( childNodeCnt == 0 )
- return;
- var i, j;
- for( i = 0; i < childNodeCnt - 1; i++) {
- rCSV += childNodeList.item(i).nodeName + sColSep;
- }
- rCSV += childNodeList.item(i).nodeName + sRowSep;
- var node;
- for (var j=0; j<nodeList.length; j++){
- node = nodeList.item(j);
- childNodeList = node.childNodes;
- for( i = 0; i < childNodeCnt - 1; i++) {
- rCSV += childNodeList.item(i).text + sColSep;
- }
- rCSV += childNodeList.item(i).text + sRowSep;
- }
-
- return rCSV;
- }
- var hardcdResultRef = "/root/hidden/hardcd/resultref";
- function makeHardCdResultRef(){ model.makeNode(hardcdResultRef); }
- function removeHardCdResultRef(){ model.removeNode(hardcdResultRef); }
- function mmbfGetHardCodeInfo(ref, rsltref, hardcd){
-
-
- var mmb_rsltref = "/root/hidden/mmb/hardcd";
- model.removeNode(mmb_rsltref);
- model.makeNode(mmb_rsltref);
- model.removeNode(ref);
- model.makeValue(ref + "/hardcd", hardcd);
- if(submit("TRMMB04103", "false", ref, mmb_rsltref)==true){
- model.copyNode(rsltref, mmb_rsltref);
- model.removeNode(mmb_rsltref);
- }
- model.refresh();
- }
- function reqOpRoomList(opschedd, desRef, queryflag, perfdeptcd, perfdrid){
- var resultRef = "/root/hidden/mmo/oproomlist";
- model.makeNode(resultRef);
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/opschedd" , opschedd);
- model.makeValue("/root/send/reqdata/queryflag", queryflag);
- if(queryflag == "detl"){
- model.makeValue("/root/send/reqdata/perfdeptcd", perfdeptcd);
- model.makeValue("/root/send/reqdata/perfdrid" , perfdrid);
-
- }
- var rtnval = submit("TRMMO05704", false, "/root/send/reqdata", resultRef);
- if(rtnval == true){
- copyNodeType(desRef, resultRef, "replace");
- }
- }
- function mmbfGetSubDeptComboList(ref, rsltref, orddeptcd){
- var mmb_rsltref = "/root/hidden/mmb/subdeptinfo";
- model.removeNode(mmb_rsltref);
- model.makeNode(mmb_rsltref);
- model.removeNode(ref);
- model.makeValue(ref + "/orddeptcd", orddeptcd);
- if(submit("TRMMB04106", "false", ref, mmb_rsltref)==true){
- model.copyNode(rsltref, mmb_rsltref);
- model.removeNode(mmb_rsltref);
- }
- model.refresh();
- }
- function mmbfGetDeptCodeComboList(ref, rsltref, orddeptflag, stnddd){
- var mmb_rsltref = "/root/hidden/mmb/orddept";
- model.removeNode(mmb_rsltref);
- model.makeNode(mmb_rsltref);
-
- model.removeNode(ref);
- model.makeValue(ref + "/orddeptflag", orddeptflag);
- if(stnddd != ""){
- model.makeValue(ref + "/stnddd", stnddd);
- }
- if(submit("TRMMB04101", "false", ref, mmb_rsltref)==true){
- model.copyNode(rsltref, mmb_rsltref);
- model.removeNode(mmb_rsltref);
- }
- model.refresh();
- }
- function mmbfGetUserComboList(ref, rsltref, deptcd, jobkindcd, specordyn, drflag, standd, nmdispflag, jobflag, specdrchk){
- var mmb_rsltref = "/root/hidden/mmb/userlist";
- model.removeNode(mmb_rsltref);
- model.makeNode(mmb_rsltref);
-
- model.removeNode(ref);
- model.makeValue(ref + "/deptcd" , deptcd);
- model.makeValue(ref + "/jobkindcd", jobkindcd);
- model.makeValue(ref + "/specordyn", specordyn);
- model.makeValue(ref + "/drflag" , drflag);
- model.makeValue(ref + "/standd" , standd);
-
- model.makeValue(ref + "/jobflag" , jobflag);
- model.makeValue(ref + "/specdrchk" , specdrchk);
-
- if(nmdispflag == "")
- model.makeValue(ref + "/nmdispflag" , "N");
- else
- model.makeValue(ref + "/nmdispflag" , nmdispflag);
-
-
- submit("TRMMB04102", "false", ref, mmb_rsltref);
- model.copyNode(rsltref, mmb_rsltref);
- model.removeNode(mmb_rsltref);
-
- model.refresh();
- }
- function addComboInstance(combopath, nodename, nodeval, parentnode){
- var xmlNode = model.instances.item(0).selectSingleNode(combopath + "/" + parentnode);
- if(xmlNode == null){
- return false;
- }
- nodename = nodename.split("^");
- nodeval = nodeval.split("^");
- if(nodename.length != nodeval.length){
- return false;
- }
-
- var label = model.instances.item(0).createElement(nodename[0]);
- var val = model.instances.item(0).createElement(nodename[1]);
- var combo = model.instances.item(0).createElement(parentnode);
-
-
-
- XmlLib.setTextValue(label, "" + nodeval[0] + "");
- XmlLib.setTextValue(val, "" + nodeval[1] + "");
-
- combo.appendChild(label);
- combo.appendChild(val);
-
- chkNode = model.instances.item(0).selectSingleNode(combopath);
- if(chkNode == null){
- model.makeNode(combopath);
- srcNode = model.instances.item(0).selectSingleNode(combopath);
- }else{
- srcNode = model.instances.item(0).selectSingleNode(combopath);
- }
-
- desNode = model.instances.item(0).selectSingleNode(combopath + "/" + parentnode);
- srcNode.insertBefore(combo, desNode);
- model.refresh();
- return true;
- }
-
- function fPidTrim(pid_path) {
- var pid = model.getValue(pid_path);
-
- pid += '';
- pid = pid.replace(/^\s*|\s*$/g, '');
- model.setValue(pid_path, pid);
- }
- function getArrayData (pData, pRow, pCol, pRowSep, pColSep ) {
- var pRowSep = (pRowSep == null || pRowSep =="" ? "▩" :pRowSep );
- var pColSep = (pColSep == null || pColSep =="" ? "▦" :pColSep );
-
- var arrRow = pData.split(pRowSep);
-
- if(arrRow.length <= pRow) return "";
- var arrCol = arrRow[pRow].split(pColSep);
- if(arrCol.length <= pCol) return "";
- return arrCol[pCol];
- }
- var gvZBCCodeCachePath="/root/hidden/zbccode";
- var zbcResultRef = "/root/hidden/zbc/resultref";
- function makeZbcResultRef(){ model.makeNode(zbcResultRef); }
- function zbcfGetCodeList(cd_grup_id_list, rslt_ref_list, minimum, sortfield_list, sortmethod_list) {
-
- if(minimum == null){
- minimum = true;
- }
-
- var isCached = false;
- if (minimum && sortfield_list == null && sortmethod_list == null) {
- isCached = true;
- var viewerObj = getViewer("sysMessage");
-
- if (viewerObj == null || viewerObj.window.zbcfGetCodeListCache == undefined) {
- isCached = false;
- }
- } else {
-
- isCached = false;
- }
-
- if (isCached) {
-
- viewerObj.window.zbcfGetCodeListCache(null,cd_grup_id_list);
-
-
- for(key in cd_grup_id_list){
- var target_path = rslt_ref_list[key];
- var source_path = gvZBCCodeCachePath + "/"+cd_grup_id_list[key] + "/" + cd_grup_id_list[key];
- var sourceNode = viewerObj.window.instance1.selectNodes(source_path);
-
- for(i=0; i<sourceNode.length; i++){
- model.duplicate(target_path, sourceNode.item(i));
- }
- }
- } else {
-
-
- zbcfGetCodeListSubmit(cd_grup_id_list, rslt_ref_list, minimum, sortfield_list, sortmethod_list);
- }
- }
- function zbcfGetCodeListSubmit(cd_grup_id_list, rslt_ref_list, minimum, sortfield_list, sortmethod_list){
- makeZbcResultRef();
- for (key in cd_grup_id_list){
- addParameter("cdgrupid", cd_grup_id_list[key]);
- if(sortfield_list!=null){
- addParameter("sortfield", sortfield_list[key]);
- }else{
- addParameter("sortfield", "dispseq");
- }
- if(sortmethod_list!=null){
- addParameter("sortmethod", sortmethod_list[key]);
- }else{
- addParameter("sortmethod", "asc");
- }
- }
- var submit_id;
- if(minimum==null){
- minimum = true;
- }
- if(minimum){
- submit_id = "TRZBC00101";
- }else{
- submit_id = "TRZBC00102";
- }
- var success = submit(submit_id, "false", getParameterPath(), zbcResultRef);
- for(key in cd_grup_id_list){
- var target_path = rslt_ref_list[key];
- if(target_path==null){
- target_path = rslt_ref_list[key-1];
- }
- var source_path = zbcResultRef+"/"+cd_grup_id_list[key]+"/"+cd_grup_id_list[key];
- var sourceNode = instance1.selectNodes(zbcResultRef+"/"+cd_grup_id_list[key]+"/"+cd_grup_id_list[key]);
- for(i=0; i<sourceNode.length; i++){
- model.duplicate(target_path, sourceNode.item(i));
- }
- }
- removeZbcResultRef();
- clearParameter("cdgrupid");
- clearParameter("sortfield");
- clearParameter("sortmethod");
- }
- function getCurrentTime()
- {
- var sDate = getNewDate();
- rtnTime = (( sDate.getHours() > 9 ) ? sDate.getHours() : "0" + sDate.getHours());
- rtnTime = rtnTime.toString() + (( sDate.getMinutes() > 9 ) ? sDate.getMinutes() : "0" + sDate.getMinutes());
- rtnTime = rtnTime.toString() + (( sDate.getSeconds() > 9 ) ? sDate.getSeconds() : "0" + sDate.getSeconds());
-
- return rtnTime;
- }
- function getCurrentDateTime(){
- return getCurrentDate() + " " + getCurrentTime();
- }
-
- function getDateCalc(pDate, pDay, pFlag){
- var sDay = new Date(pDate.substr(0,4),pDate.substr(4,2)-1,pDate.substr(6,2));
- if(pFlag == null || pFlag == ""){
- pFlag = "-";
- }
- if(pFlag == "-"){
- sDay.setDate(sDay.getDate()-parseInt(pDay));
- }else if(pFlag == "+"){
- sDay.setDate(sDay.getDate()+parseInt(pDay));
- }
- var sYear = sDay.getYear();
- var sMonth = sDay.getMonth()+1;
- var sday = sDay.getDate();
-
- if(sMonth < 10) sMonth = "0"+sMonth;
- if(sday < 10) sday = "0"+sday;
-
- return sYear.toString()+sMonth.toString()+sday.toString();
- }
- function getDateTime( pDate, pMode ){
- var rtnStr = null;
- sFDate = pDate.getFullYear();
- sFDate = sFDate.toString() + (( pDate.getMonth() + 1 > 9 ) ? pDate.getMonth() + 1 : "0" + (pDate.getMonth() + 1));
- sFDate = sFDate.toString() + (( pDate.getDate() > 9 ) ? pDate.getDate() : "0" + pDate.getDate());
- sFTime = (( pDate.getHours() > 9 ) ? pDate.getHours() : "0" + pDate.getHours());
- sFTime = sFTime.toString() + (( pDate.getMinutes() > 9 ) ? pDate.getMinutes() : "0" + pDate.getMinutes());
- sFSec = (( pDate.getSeconds() > 9 ) ? pDate.getSeconds() : "0" + pDate.getSeconds() );
- var x = new Array("일", "월", "화", "수", "목", "금", "토");
- sWeek = x[pDate.getDay()];
- switch( pMode.toUpperCase() ){
- case 'D':
- rtnStr = sFDate;
- break;
- case 'T':
- rtnStr = sFTime;
- break;
- case 'S':
- rtnStr = sFTime + sFSec;
- break;
- case 'A':
- rtnStr = sFDate + sFTime + sFSec;
- break;
- case 'W':
- rtnStr = sWeek;
- break;
- default:
- rtnStr = sFDate + sFTime;
- }
- return rtnStr;
- }
- function getDayOfWeek(pKind)
- {
- if(pKind.toUpperCase() == "K") {
- var week = new Array("일","월","화","수","목","금","토");
- return week[this.getDay()];
- } else if(pKind.toUpperCase() == "C") {
- var week = new Array("日","月","火","水","木","金","土");
- return week[this.getDay()];
- } else if(pKind.toUpperCase() == "E") {
- var week = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
- return week[this.getDay()];
- } else if(pKind.toUpperCase() == "N") {
- return this.getDay() + "";
- }
- return "";
- }
- function getNodesetCount( nodeSet ) {
-
- var xnList = instance1.selectNodes(nodeSet);
- return null != xnList ? xnList.length : 0;
- }
- function COMN_CONT_RECCNTS()
- {
- this.pid = "";
- this.recfromdt = "";
- this.rectodt = "";
- this.formrecdeptcd = "";
- this.chosflag = "";
- this.formrecseq = "";
- }
- function doReplaceLtGt(path)
- {
- var nodelist = model.instances.item(0).selectNodes(path + "[degnitemkind = 'IMG']/reccnts");
- var shape = "";
- var regLt = /</gi;
- var regGt = />/gi;
- for (var i = 0; i < nodelist.length; i++)
- {
- if (XmlLib.getTextValue(nodelist.item(i)).indexOf("<") == 0)
- {
- shape = XmlLib.getTextValue(nodelist.item(i)).replace(regLt, "<");
- XmlLib.setTextValue(nodelist.item(i), shape.replace(regGt, ">"));
- }
- }
- }
- function copyNodeset(strDest, strSrc, mode, destModel, srcModel)
- {
- if(mode == null)
- mode = "replace";
- if(destModel == null)
- destModel = model;
- if(srcModel == null)
- srcModel = model;
- if(mode == "replace")
- destModel.removeNodeset(strDest);
-
- var destNodeList = destModel.instances.item(0).selectNodes(strDest);
-
- var destListLen = destNodeList.length;
- var srcNodeList = srcModel.instances.item(0).selectNodes(strSrc);
- var prepath_strDest = strDest + "[";
- var idx;
- for(var i = 0; i < srcNodeList.length; i++)
- {
- idx = i + 1 + destListLen;
- var strDest1 = prepath_strDest + idx + "]";
- destModel.makeNode(strDest1);
- var destNode = destModel.instances.item(0).selectSingleNode(strDest1);
- var srcNode = srcNodeList.item(i);
- var srcChildList = srcNode.childNodes;
- for(var j = 0; j < srcChildList.length; j++)
- destNode.appendChild(srcChildList.item(j).cloneNode(true));
- }
- }
- function findNodeset(srchModel, strPath)
- {
- var insXml = srchModel.instances.item(0);
- var destNodeList = insXml.selectNodes(strPath);
- return destNodeList;
- }
- function isSearchString(strSrc, strFind)
- {
- var r, re;
- re = new RegExp(strFind);
- r = re.exec(strSrc);
- if (r)
- {
- return true;
- }
- return false;
- }
- function removeXvgTag(metadata)
- {
- var strMeta = metadata;
- var grpexpSt = new RegExp('(<xvg[^<>]+>)', 'igm');
- var grpexpEd = new RegExp('(</xvg>)', 'igm');
-
- if (grpexpSt.test(strMeta) == true)
- {
- strMeta = strMeta.replace(grpexpSt, '');
- }
-
- if (grpexpEd.test(strMeta) == true)
- {
- strMeta = strMeta.replace(grpexpEd, '');
- }
- return strMeta;
- }
- function setReplaceWord( findWord, replaceWord )
- {
- var tempArray;
- var rtnSting = "";
- tempArray = this.split(findWord);
- for(var i=0; i < tempArray.length-1; i++)
- {
- rtnSting += tempArray[i] + replaceWord;
- }
- rtnSting += tempArray[tempArray.length-1];
- return rtnSting;
- }
- function copyNodesetType(strDest, strSrc, mode, destModel, srcModel) {
- if( typeof(destModel) == "object" || typeof(destModel) == "undefined" ) {
- if( destModel == null ) {
- destModel = model;
- }
- }
- else {
- if( destModel == "" ) {
- destModel = model;
- }
- }
- if( typeof(srcModel) == "object" || typeof(srcModel) == "undefined" ) {
- if( srcModel == null ) {
- srcModel = model;
- }
- }
- else {
- if( srcModel == "" ) {
- srcModel = model;
- }
- }
-
- var destNodeList = destModel.instances.item(0).selectNodes(strDest);
- if( destNodeList == null || destNodeList.length == 0 ) {
- return;
- }
-
- var pDestNode = destNodeList.item(0).parentNode;
- var destLastNodesetName = destNodeList.item(0).nodeName;
-
- var srcNodeList = srcModel.instances.item(0).selectNodes(strSrc);
- if( srcNodeList == null || srcNodeList.length == 0 )
- return;
- if( mode != "before" ) {
- if( mode == "replace" || mode == null ) {
- destModel.removeNodeset(strDest);
- }
- var srcNode;
- var tmpSrcNode;
- while( srcNode = srcNodeList.nextNode() ) {
- tmpSrcNode = srcNode.cloneNode(true);
- tmpSrcNode.nodeName = destLastNodesetName;
-
- model.duplicate(pDestNode, tmpSrcNode);
- }
- }
- else {
-
- var tmpSrcNode;
- for( var i = srcNodeList.length - 1; i >= 0; i-- ) {
- pDestNode = destModel.instances.item(0).selectSingleNode(strDest).parentNode;
- tmpSrcNode = srcNodeList.item(i).cloneNode(true);
- tmpSrcNode.nodeName = destLastNodesetName;
- model.duplicate(pDestNode, tmpSrcNode, "*[1]");
- }
- }
- }
- function getTrim()
- {
- var startPoint = 0;
- var endPoint = this.length;
-
- while( (startPoint < endPoint) && (this.charCodeAt(startPoint) == 32) )
- {
- startPoint++;
- }
-
- while( (startPoint < endPoint) && (this.charCodeAt(endPoint-1) == 32) )
- {
- endPoint--;
- }
-
- return ( (startPoint > 0) || (endPoint < this.length) ) ? this.substring(startPoint, endPoint) : this;
- }
-
- function fGetUserEnvOcsOrdAnsw(ref, rsltref, qestcd){
-
- var mmb_rsltref = "/root/hidden/interface";
- model.removeNode(mmb_rsltref);
- model.makeNode(mmb_rsltref);
- model.removeNode(ref);
- model.makeValue(ref + "/interqestcd", qestcd);
- if(submit("TRMMB01104", "false", ref, mmb_rsltref)==true){
- model.makeNode(rsltref);
- model.copyNode(rsltref, mmb_rsltref);
- model.removeNode(mmb_rsltref);
- }
- }
-
- function userLogout() {
- if ( confirm("로그아웃 하시겠습니까?") ) {
- top.document.location="/himed/webapps/com/hismainweb/jsp/logoutphone.live";
- }
- }
|