12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048 |
- var lineNo = model.getValue("/root/main/outlineinfo/info/swimlineno"); //총 스윔라인 수
- var cpgflagcd = model.getValue("/root/main/outlineinfo/info/cpgflagcd"); //총 스윔라인 수
- var grpControlCnt; //생성된 총 그룹 컨트롤 갯수(컨트롤 생성시 위치 재배치를 위해 따로 관리)
- var controlCnt; //생성된 컨트롤 갯수(나머지 컨트롤 카운트)
- var dcsCntlCnt = 1; //decision 컨트롤의 총 갯수(인스턴수 마지막 인덱스가 된다)
- var lineYpos;
- var linesControlMaxCnt = new Array(); //스윔라인 영역의 갯수
- var swimlineControlArray = new Array(); //라인 컨트롤의 배열(라인종류를 담는다)
- var selectSectionsLine = new Array(); //4*1 의 변경된 색상을 갖는 라인배열...
- selectSectionsLine[0] = "";
- selectSectionsLine[1] = "";
- selectSectionsLine[2] = "";
- selectSectionsLine[3] = "";
- var swimLineHight = 165; //한 스윔라인의 높이 //<-210
- var swimLineWidth = 815; //스윔라인의 넓이 //<-792
- var selectedLineSection = ""; //선택된 라인(ex:1,2...)
- var selectedControl = null; //선택된 아이템(컨트롤)
- var currentStepCntl = null; //현재 포커스를 가진 아이템(그룹아이디)
- var changedCntl = null; //스텝의 개요를 변경할 때, 이전에 값이 변한 스텝의 id 가 필요함.
- var prevStepCntl = null; //부모가 될 아이템(그룹아이디)
- var childStepCntl = null; //자식이 될 아이템(그룹아이디)
- var maxControlCnt = 2; //한줄 단위로, 최대 default 컨트롤 갯수
- var initControlCnt = 0; //외곽 스윔라인 컨트롤 갯수(나머지 컨트롤을 초기화 할때 initControlCnt 부터 다시 카운트 한다)
- var stepRef = "/root/main/steplist/info";
- var dcsRef = "/root/main/decisionlist/info";
- var tmpIncreaseVal = 0; //임시변수, 스타트포인트의 감소 문제를 해결하고 나면, 삭제 필!
- var outsideControlCnt = 0; //바깥 아웃라인의 라인컨트롤 갯수(컨트롤 생성시, outsideControlCnt+1보다 큰 컨트롤들을 삭제한다)
- var transViewSize = 0;
- var connectionMode = "false";
- var decisionMode = "false";
- var OutLinesOpenerKind = "";
- var readyPrcp = "N";
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : generater 로딩 후 cpg 조회시, outline을 구성하기 위해 초기 변수를 셋팅해준다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function initGlobalVariant(arg1, arg2){
- grpControlCnt = arg1;
- outsideControlCnt = arg2;
- linesControlMaxCnt = new Array();
- for(var i=0; i<parseInt(lineNo); i++){
- var no = i + 1;
- var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + no.toString() + "']");
- linesControlMaxCnt[i] = nodeList.length;
-
- if(linesControlMaxCnt[i] > 2 && linesControlMaxCnt[i] > linesControlMaxCnt[i-1]){
- maxControlCnt = linesControlMaxCnt[i];
- }
- }
-
- nodeList = instance1.selectNodes(dcsRef);
- dcsCntlCnt = nodeList.length + 1;
-
- if(maxControlCnt > 2){
- fAdjustLine("ex", "392");
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : opener에서 스윔라인 수를 수정할 경우, outline 및 모든 컨틀롤 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOutlineCntlInit(){
- for(var i=0; i<=controlCnt; i++){
- var cntlID = swimlineControlArray[i];
- if( !( cntlID == "" || cntlID == null ) ){
- if( cntlID.substr(cntlID.length-3, 1) == "_" ){
- cntlID = cntlID.substr(0, cntlID.length-3);
- }
- grp_swimline.removeChild(cntlID);
- grp_swimline.refresh();
- }
- }
-
- outsideControlCnt = 0;
- tmpIncreaseVal = 0;
- controlCnt = 0;
- grpControlCnt = 0;
- //maxControlCnt = 2;
- //swimlineControlArray.slice(0, swimlineControlArray.length);
- swimlineControlArray = new Array();
- //linesControlMaxCnt.slice(0, linesControlMaxCnt.length);
- //인스턴스를 비운다.
- model.removeNodeset("/root/main/steplist");
- model.removeNodeset("/root/main/decisionlist");
- model.makeNode("/root/main/decisionlist");
- selectSectionsLine[0] = "";
- selectSectionsLine[1] = "";
- selectSectionsLine[2] = "";
- selectSectionsLine[3] = "";
- selectedLineSection = "";
- selectedControl = null;
- currentStepCntl = null;
- changedCntl = null;
- prevStepCntl = null;
- dcsCntlCnt = 1;
- swimLineHight = 165; //한 스윔라인의 높이 //<-210
- swimLineWidth = 815; //스윔라인의 넓이
- maxControlCnt = 2;
- connectionMode = "false";
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize() {
- lineNo = model.getValue("/root/main/outlineinfo/info/swimlineno");
- cpgflagcd = model.getValue("/root/main/outlineinfo/info/cpgflagcd");
- //cpgorddeptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
-
- if( !(lineNo == "0" || lineNo == "") ){
- arrNum = parseInt(lineNo) - 1;
- linesControlMaxCnt = new Array(arrNum);
- }else{
- linesControlMaxCnt = new Array(lineNo);
- }
- //linesControlMaxCnt.slice(0, linesControlMaxCnt.length-1);
- for(var i=0; i<lineNo; i++){
- linesControlMaxCnt[i] = 0;
- }
-
- var y=0;
- var cy=swimLineHight;
- controlCnt = 0;
- grpControlCnt = 0;
-
- //fCreateButton(); //버튼
- ctrlID = "xforms:line" + (controlCnt++);
- ctrl = grp_swimline.createChild("xforms:line", "id:"+ctrlID + "; x1:0px; y1:0px ; x2:" + swimLineWidth + "px; y2: 0px; ");
- swimlineControlArray[controlCnt-1] = ctrlID+"_UW"; //up+width
- for(var i=1; i<=lineNo; i++){
- fCreateSwimLine(y, cy); //가장 윗줄
- y = cy;
- cy = cy + swimLineHight;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 버튼을 생성한다. (사용 안함)
- * @param :
- * @return :
- * @---------------------------------------------------
- *
- function fCreateButton(){
- var button1 = "xforms:button";
- var ctrlID;
- var ctrl = null;
- ctrlID = button1 + (controlCnt++);
- var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + 612 + ";top:" +5 + ";width:42; height:19 ; text:" + "A");
- ctrl.attribute("class") = "btn2_letter2";
- ctrlID = button1 + (controlCnt++);
- var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 45) + ";top:" + 5 + ";width:42; height:19 ; text:" + "D");
- ctrl.attribute("class") = "btn2_letter2";
- ctrlID = button1 + (controlCnt++);
- var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 90) + ";top:" + 5 + ";width:42; height:19 ; text:" + "B");
- ctrl.attribute("class") = "btn2_letter2";
- ctrlID = button1 + (controlCnt++);
- var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 135) + ";top:" + 5 + ";width:42; height:19 ; text:" + "삭제");
- ctrl.attribute("class") = "btn2_letter2";
- }
- */
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 라인을 생성한다.
- * @param : y, cy
- * @return :
- * @---------------------------------------------------
- */
- function fCreateSwimLine(y, cy) {
- var line1 = "xforms:line";
- var ctrlID;
- var ctrl = null;
- var x=0;
- var cx = swimLineWidth;
-
- ctrlID = line1 + (controlCnt++);
- ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + x + "px; y1:" + y + "px; x2:" + x + "px; y2:" + cy+ "px; ");
- swimlineControlArray[controlCnt-1] = ctrlID+"_LH"; //left+height
- ctrlID = line1 + (controlCnt++);
- ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + cx + "px; y1:" + y + "px; x2:" + cx + "px; y2:" + cy+ "px; ");
- swimlineControlArray[controlCnt-1] = ctrlID+"_RH"; //right+height
- ctrlID = line1 + (controlCnt++);
- ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + x + "px; y1:" + cy + "px; x2:" + cx + "px; y2:" + cy+ "px; ");
- swimlineControlArray[controlCnt-1] = ctrlID+"_DW"; //down+width
- ctrl.refresh();
- outsideControlCnt = controlCnt;
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 마지막 스윔라인을 삭제한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDelLastSwimLine(){
- var endPnt = parseInt(outsideControlCnt);
- var cnt = 0;
-
- for (var i=endPnt; i>=0; i--){
- var str = swimlineControlArray[i];
-
- if(!isNull(str)){
- if(str.substr(0,12) != "xforms:group"){
- var cntlStr = str.substr(str.length-2, 2);
- if( cnt<3 && (cntlStr== "DW" || cntlStr == "RH" || cntlStr == "LH") ){
- grp_swimline.removeChild( str.substr(0, str.length-3) );
- swimlineControlArray[i] = "";
- cnt++;
- }else {
- return;
- }
- }
- }
- }
-
- var a = swimlineControlArray.slice(0, (endPnt-3));
- var b = swimlineControlArray.slice(endPnt, swimlineControlArray.length);
- swimlineControlArray.slice(0, swimlineControlArray.length);
- swimlineControlArray = a.concat(b);
- outsideControlCnt = outsideControlCnt - 3;
- //fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 외곽 스윔라인의 길이를 연장한다.
- * @param : flag(extention/reduction), width
- * @return :
- * @---------------------------------------------------
- */
- function fAdjustLine( flag, width ){
- var asLineControl = null;
- var lngth = swimlineControlArray.length;
- var str;
- var width = parseInt(width);
- if(flag == "allEx"){
- if(maxControlCnt <= 3)
- width = 1190 - swimLineWidth - 20;
- else
- width = 0;
-
- transViewSize = width;
- flag = "ex";
- } else if(flag == "allRe"){
- width = transViewSize;
- flag = "re";
- }
-
- if(flag == "ex"){
- for (i=0; i<lngth; i++){
- str = swimlineControlArray[i];
- if( !(str =="" || str == null) ){
- if( str.substr(str.length-2, 2) == "UW" ){
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
- swimLineWidth = parseInt(asLineControl.attribute("x2"));
-
- } else if(str.substr(str.length-2, 2) == "DW" ){
- asLineControl = document.controls(str.substr(0, str.length-3));
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
-
- } else if(str.substr(str.length-2, 2) == "RH" ){
- asLineControl = document.controls(str.substr(0, str.length-3));
- asLineControl.attribute("x1") = parseInt(asLineControl.attribute("x1")) + width;
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
- }
- }
- }
- } else if(flag == "re"){
- for (i=0; i<lngth; i++){
- str = swimlineControlArray[i];
- if( !(str =="" || str == null) ){
- if( str.substr(str.length-2, 2) == "UW" ){
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
-
- swimLineWidth = asLineControl.attribute("x2");
-
- } else if(str.substr(str.length-2, 2) == "DW" ){
- asLineControl = document.controls(str.substr(0, str.length-3));
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
-
- } else if(str.substr(str.length-2, 2) == "RH" ){
- asLineControl = document.controls(str.substr(0, str.length-3));
- asLineControl.attribute("x1") = parseInt(asLineControl.attribute("x1")) - width;
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
- }
- }
- }
- }
- selectedControl = null;
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤을 왼쪽으로 옮긴다. (한꺼번에 모든 컨트롤을 다시 재생성 하므로, 사용 안 함)
- * @param : no
- * @return :
- * @---------------------------------------------------
- *
- function fModeControl( no ){
- //같은 라인에 미리 생성된 아이템의 x1, x2 좌표를 - 시킨다.
- var y1 = (no-1) * swimLineHight;
- var y2 = y1 + swimLineHight;
-
- for(var i = 0; i < grpControlCnt; i++){
- var cntl = document.controls( "xforms:group" + i );
- var cntlY1 = parseInt(cntl.attribute("top"));
- var cntlY2 = parseInt(cntl.attribute("height"));
-
- if(cntlY1 > y1 && (cntlY1+cntlY2) < y2) {
- var orgX = parseInt(cntl.attribute("left"));
- cntl.attribute("left") = orgX - 200;
- }
- }
- }
- */
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 해당 스텝에 대한 노드(인스턴스)를 먼저 생성한다.
- * @param : flag(A/D/B), no(selectedLineSection)
- * @return :
- * @---------------------------------------------------
- */
- function fMakeNode( flag, no ){
- no = parseInt(no);
- grpControlCnt = parseInt(grpControlCnt) + 1;
- linesControlMaxCnt[no-1] = parseInt( linesControlMaxCnt[no-1] ) + 1; // no = 라인수
- model.resetInstanceNode("/root/main/temp/stepinfo/info");
- model.setValue("/root/main/temp/stepinfo/info/stepno", grpControlCnt);
- model.setValue("/root/main/temp/stepinfo/info/stepflagcd", flag);
- model.setValue("/root/main/temp/stepinfo/info/swimlineno", no);
- model.setValue("/root/main/temp/stepinfo/info/refseq", linesControlMaxCnt[no-1]);
- model.setValue("/root/main/temp/stepinfo/info/stepmemo", "");
- model.setValue("/root/main/temp/stepinfo/info/m", "i");
-
- if( maxControlCnt < linesControlMaxCnt[no-1] ){
- maxControlCnt = linesControlMaxCnt[no-1];
- fAdjustLine("ex", "392");
- }
- model.makeNode( stepRef + "[" + grpControlCnt + "]");
- model.copyNode ( stepRef + "[" + grpControlCnt + "]" , "/root/main/temp/stepinfo/info");
- //각 노드셋(stepRef) 마다 menu 를 생성하는 makeValue 문은 삭제했음.
-
- if(selectedControl != null){
- var selID = selectedControl.attribute("id");
- var curNo = parseInt( selID.substr(12, selID.length-12) ) + 1;
-
- //if( model.getValue(stepRef + "[" + curNo + "]/stepno") > selectedLineSection ){
- //★ 추가되는 컨트롤의 라인수 및 조회순서가 selectedControl 보다 크면, 그대로, 작으면 selectedControl 은 -1 (일단 null)
- // selectedControl = null;
- //}
- }
-
- return grpControlCnt;
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤을 생선한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCreateControl(){
- var ctrlID;
- var ctrl = null;
- var grpWidth = 392; //좌표를 기준으로 한 영역의 사이즈 (실제 컨트롤 width=290)
- var halfpoint = grpWidth/2;
- var marginX = 38; //영역 안의 왼쪽 여백 ( 38+ 290 + 38 = 392 )
- var pntCnt = 0; //기준점의 갯수
- var cntlCnt = 0; //해당 라인의 컨트롤 총 갯수
- var y = 0;
- var psition = 0; //k 번째 컨트롤 포지션(포커스된 컨트롤의 라인 내 순서)
- var startPoint = 0; //라인당 컨트롤들을 위치시킬 시작x위치
- stepCnt = parseInt(grpControlCnt); //새로 그릴 스텝(컨트롤) 갯수
-
- var lngth = swimlineControlArray.length - 1;
- var cntlID;
- //아웃라인을 제외한 컨트롤을 모두 삭제
- for(var i=outsideControlCnt; i<=lngth; i++){
- cntlID = swimlineControlArray[i];
- if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
- cntlID = cntlID.substr(0, cntlID.length-3);
- }
- grp_swimline.removeChild(cntlID);
- swimlineControlArray[i] = "";
- }
- controlCnt = outsideControlCnt;
- //lngth = swimlineControlArray.length - outsideControlCnt;
- //swimlineControlArray.slice(outsideControlCnt, lngth);
- swimlineControlArray.slice(0, outsideControlCnt);
- grpControlCnt = 0;
-
- for(var i=1; i<=stepCnt ; i++){
- var flag = model.getValue(stepRef + "[" + i + "]/stepflagcd");
- var lineno = parseInt(model.getValue(stepRef + "[" + i + "]/swimlineno"));
- var position = parseInt(model.getValue(stepRef + "[" + i + "]/refseq"));
- var kind = model.getValue(stepRef + "[" + i + "]/startendflag");
- var times = model.getValue(stepRef + "[" + i + "]/times");
- cntlCnt = linesControlMaxCnt[lineno-1];
- y = ((lineno-1) * swimLineHight) + 20; //122 + 20 + 20 = 165
-
- // ★ 문제... 좌표가 -1씩 줄어든다...
- startPoint = ( (swimLineWidth - (394 * cntlCnt) ) / 2 + 1 ) + ((position-1) * 395);
- //임시 해결책 : 글로벌변수 tmpIncreaseVal 을 계속 증감시켜, startPoint 에 더한다
- startPoint = startPoint - ((position-1) * 1);
-
- //1. 마름모 모양의 라인들과 그리드를 담을 그룹을 생성한다.
- controlCnt++;
- ctrlID = "xforms:group" + (grpControlCnt++);
- var ctrlGrp = grp_swimline.createChild("xforms:group", "id:" + ctrlID + ";left:" + startPoint + "px; top:" + y + "px; width:" + 395 + " px; height:" + 122 + "px;"); //290*135
- swimlineControlArray[outsideControlCnt + (grpControlCnt-1)] = ctrlID;
-
- if( flag == "D" ) {
- //2. 결정 그리드를 생성한다. -> textarea 로 대체...
- var text1 = "xforms:textarea";
- ctrlID = text1 + (controlCnt++);
- ctrl = ctrlGrp.createChild(text1, "id:"+ctrlID + "; ref:" + stepRef + "[" + grpControlCnt + "]/stepmemo; left:" + (marginX+60) + "px; top:" + 40 + "px; width:" + 175 + "px; height:" + 43+ "px; border-width:0px; border-style:solid; scroll:autovscroll; ");
- ctrl.attribute("onmousedown") = "fPopupMenuEvent()"; //이벤트와 컨트롤을 연결하는 동적 이벤트
- ctrl.attribute("xforms-value-changed") = "fSetMemo()";
- ctrl.attribute("DOMFocusIn") = "fFocusIn()";
- //ctrl.attribute("DOMFocusOut") = "fFocusOut()";
- ctrl.attribute("onmouseover") = "fMouseOverEvent()";
- var txtctrl = ctrl;
-
- //ctrl = ctrlGrp.createChild(grid1, "id:"+ ctrlID + "; caption:caption1; nodeset:" + stepRef + "[" + grpControlCnt + "]; colsep:^; rowsep:|; colwidth:165; ellipsis:true; border-width:0; left:" + (marginX+63) + "px; top:" + 45 + "px; width:" + 180 + "px; height:" + 75+ "px; ");
- //var col1 = "xforms:col";
- //ctrlID = col1 + (controlCnt++);
- //ctrl.createChild(col1, "tag:xforms:col; ref:stepmemo; type:input; border-width:0; background-color:transparent; ");
- //ctrl.rebuild();
- //ctrl.rowHidden(0) = true;
-
- //3. 마름모 라인을 생성한다.
- var line1 = "xforms:line";
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + marginX + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 0 + "px; border-width:3");
-
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 120 + "px; x2:" + marginX + "px; y2:" + 60+ "px; border-width:3");
-
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+290) + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 120 + "px; border-width:3");
-
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 0 + "px; x2:" + (marginX+290) + "px; y2:" + 60 + "px; border-width:3");
-
- //시작, 스텝여부를 표시한다.
- if(kind == "S" || kind == "E"){
- fChangeSelectCntl("#ff9900", txtctrl);
- }
-
- //day 정보를 표시한다.
- if(times != ""){
- var leftPos = 270;
- var topPos = 52;
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + 66 + "; top:" + 51 + "; width:20px; height:20px; background-stretch:stretch;");
- ctrlType = "xforms:caption";
- ctrlID = ctrlType + (controlCnt++);
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + 66 + "; top:" + 52 + "; width:30px; height:20px; font-size:8pt; font-weight:bolder;");
- cntl.attribute("text") = "D" + times;
- }
-
- //서식존재 여부를 표시한다.
- if(model.getValue(stepRef + "[" + i + "]/formexistyn") != "Y"){
- var leftPos = 330;
- var topPos = 52;
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/input_s_essential.gif; left:" + leftPos + "; top:" + topPos + "; width:10px; height:10px; background-stretch:stretch;");
- }
-
- } else if( flag == "A" || flag == "B" ) {
- //액션, 브런치 그리드를 생성한다.
- var text2 = "xforms:textarea";
- ctrlID = text2 + (controlCnt++);
- ctrl = ctrlGrp.createChild(text2, "id:"+ctrlID + "; ref:" + stepRef+ "[" + grpControlCnt + "]/stepmemo; left:" + marginX + "px; top:" + 1 + "px; width:" + 290 + "px; height:" + 120+ "px; border-width:3px; border-style:solid; scroll:autovscroll; padding-left:10; padding-top:10; padding-right:10; padding-bottom:10; border-color:#000000; ");
- ctrl.attribute("onmousedown") = "fPopupMenuEvent()";
- ctrl.attribute("xforms-value-changed") = "fSetMemo()";
- ctrl.attribute("DOMFocusIn") = "fFocusIn()";
- //ctrl.attribute("DOMFocusOut") = "fFocusOut()";
- ctrl.attribute("onmouseover") = "fMouseOverEvent()";
-
- //시작, 스텝여부를 표시한다.
- if(kind == "S" || kind == "E"){
- fChangeSelectCntl("#ff9900", ctrl);
- }
-
- //day 정보를 표시한다.
- if(times != ""){
- var leftPos =308;
- var topPos = 1;
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + 32 + "; top:" + 0 + "; width:20px; height:20px; background-stretch:stretch;");
- ctrlType = "xforms:caption";
- ctrlID = ctrlType + (controlCnt++);
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + 32 + "; top:" + 1 + "; width:30px; height:20px; font-size:8pt; font-weight:bolder;");
- cntl.attribute("text") = "D" + times;
- }
-
- //서식존재 여부를 표시한다.
- if(model.getValue(stepRef + "[" + i + "]/formexistyn") != "Y"){
- var leftPos =330;
- var topPos = 1;
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/input_s_essential.gif; left:" + leftPos + "; top:" + topPos + "; width:10px; height:10px; background-stretch:stretch;");
- }
- }
- ctrl.refresh();
- }
-
- // 라인 연결 재설정
- for(var i=1; i<=stepCnt ; i++){
- var cntlKind = model.getValue( stepRef + "[" + i + "]/stepflagcd");
- var cntlno = model.getValue( stepRef + "[" + i + "]/stepno");
- if( cntlKind == "D" ) {
- var dcsnstep = instance1.selectSingleNode( stepRef + "[" + i + "]/dcsnstep");
-
- nodeList = instance1.selectNodes(dcsRef);
- dcsCntlCnt = nodeList.length;
- for(var k=0; k<dcsCntlCnt; k++){
- var node = nodeList.item(k);
- var stepNode = node.selectSingleNode("stepno");
- var lnkNode = node.selectSingleNode("lnkstepno");
-
- if( !isNull(lnkNode.text) && cntlno == stepNode.value ){
- if( dcsnstep != null ){
- if( !isNull(dcsnstep.text) && dcsnstep.text == lnkNode.text)
- fCreateControl_Line( stepNode.text, lnkNode.text, "red" );
- else
- fCreateControl_Line( stepNode.text, lnkNode.text );
- } else {
- fCreateControl_Line( stepNode.text, lnkNode.text );
- }
- }
- }
- dcsCntlCnt++;
- } else {
- var lnkno = model.getValue( stepRef + "[" + i + "]/lnkstepno");
- if( !isNull(lnkno) ){
- fCreateControl_Line( cntlno, lnkno );
- }
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤간의 연결라인을 그려준다.
- * @param : cntlno, lnkno
- * @return :
- * @---------------------------------------------------
- */
- function fCreateControl_Line( cntlno, lnkno, color ){
- currentStepCntl = document.controls("xforms:group" + (parseInt(cntlno)-1) );
- prevStepCntl = document.controls("xforms:group" + (parseInt(lnkno)-1) );
- var frXPoint = parseInt(currentStepCntl.attribute("left")) + (parseInt(currentStepCntl.attribute("width")) / 2 ) -15;
- var frYPoint = parseInt(currentStepCntl.attribute("top")) + parseInt(currentStepCntl.attribute("height"));
- var toXPoint = parseInt(prevStepCntl.attribute("left")) + (parseInt(prevStepCntl.attribute("width")) / 2 ) -15;
- var toYPoint = parseInt(prevStepCntl.attribute("top"));
-
- ctrlID = "xforms:line" + (controlCnt++);
- var ctrl = grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:3;");
- if(color == "red"){
- ctrl.attribute("border-color") = "#ff0000";
- }
-
- swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
- prevStepCntl = null;
- currentStepCntl = null;
-
- ctrl.refresh();
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 하위 스텝을 선택하면, 연결한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetLink(){
- var prntID = currentStepCntl.attribute("id");
- var prntControl = document.controls(prntID);
- prevStepCntl = prntControl; //하위
- //setStepLink(prntControl, null);
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 연결 이벤트시, 목적 컨트롤을 클릭했을 경우, 해당하는 두개의 컨트롤 사이를에 라인을 생성한다.
- * @param : prevStepCntl, currentStepCntl
- * @return :
- * @---------------------------------------------------
- */
- function fConnectToLine(prevStepCntl, currentStepCntl){
- var ctrlID;
- var ctrl = null;
- //비교 대상인 두개 컨트롤 ID
- var prevStepCntlID = prevStepCntl.attribute("id"); //하위(자식)
- var currentCntlID = currentStepCntl.attribute("id"); //상위(부모)
- prevStepCntlID = parseInt( prevStepCntlID.substr(12, prevStepCntlID.length-12) ) + 1;
- currentCntlID = parseInt( currentCntlID.substr(12, currentCntlID.length-12) ) + 1;
-
- //비교 대상인 두개 컨트롤 top과 높이
- var prevStepCntlTop = parseInt(prevStepCntl.attribute("top"));
- var prevStepCntlHigh = parseInt(prevStepCntl.attribute("height"));
- var currentCntlTop = parseInt(currentStepCntl.attribute("top"));
- var currentCntlHigh = parseInt(currentStepCntl.attribute("height"));
-
- if ( prevStepCntlTop == currentCntlTop ) {
- //동일한 컨트롤을 선택한 경우
- prevStepCntl = null;
- return;
- } else {
- var curcntlType = model.getValue( stepRef + "[" + currentCntlID + "]/stepflagcd");
- var preCntlType = model.getValue( stepRef + "[" + prevStepCntlID + "]/stepflagcd");
- var frXPoint = parseInt(prevStepCntl.attribute("left")) + (parseInt(prevStepCntl.attribute("width")) / 2 ) -15;
- var toXPoint = parseInt(currentStepCntl.attribute("left")) + (parseInt(currentStepCntl.attribute("width")) / 2 ) -15;
- var frYPoint;
- var toYPoint;
-
- //하위를 먼저 클릭하고 연결을 결정한 다음, 상단을 클릭한 경우,
- if( prevStepCntlTop > currentCntlTop ) {
- frYPoint = prevStepCntlTop - 1;
- toYPoint = currentCntlTop + currentCntlHigh;
-
- if(curcntlType == "D"){
- model.setValue( stepRef + "[" + currentCntlID + "]/lnkstepno", "" );
- copyNodeType("/root/main/decisionlist", "/root/main/temp/decisioninfo", "after", model, model);
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/stepno", model.getValue(stepRef + "[" + currentCntlID + "]/stepno"));
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/lnkstepno", model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno"));
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/m", "i");
- dcsCntlCnt++;
-
- } else {
- if( model.getValue(stepRef + "[" + currentCntlID + "]/lnkstepno") == "" ) {
- model.setValue( stepRef + "[" + currentCntlID + "]/lnkstepno" , model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno") );
-
- } else {
- var msg = messageBox("Action 및 Branch 스텝은 둘 이상의 하위 Step을 선택 ", "E001");
- return;
- }
- }
- //현재 스텝을 부모 스텝과 연결한다.
- ctrlID = "xforms:line" + (controlCnt++);
- grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:3;");
- swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
-
- //상단을 먼저 클릭하고 연결을 결정한 다음, 하위를 클릭한 경우
- } else if( prevStepCntlTop < currentCntlTop ) {
- frYPoint = prevStepCntlTop + prevStepCntlHigh - 1;
- toYPoint = currentCntlTop;
- if(preCntlType == "D"){
- model.setValue( stepRef + "[" + prevStepCntlID + "]/lnkstepno" , "" );
- copyNodeType("/root/main/decisionlist", "/root/main/temp/decisioninfo", "after", model, model);
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/stepno", model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno"));
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/lnkstepno", model.getValue(stepRef + "[" + currentCntlID + "]/stepno"));
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/m", "i");
- dcsCntlCnt++;
-
- } else {
- if( model.getValue(stepRef + "[" + prevStepCntlID + "]/lnkstepno") == "" ) {
- model.setValue( stepRef + "[" + prevStepCntlID + "]/lnkstepno" , model.getValue(stepRef + "[" + currentCntlID + "]/stepno") );
- } else {
- var msg = messageBox("Action 및 Branch 스텝은 둘 이상의 하위 Step을 선택 ", "E001");
- return;
- }
-
- }
- ctrlID = "xforms:line" + (controlCnt++);
- grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:3;");
- swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
- }
- }
- //prevStepCntl = null;
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 포커스를 갖는 컨트롤의 외곽선 색상을 변경한다.
- * @param : lineColor, cntl
- * @return :
- * @---------------------------------------------------
- */
- function fChangeSelectCntl(lineColor, cntl){
- if( cntl != null ){
- var controlSize = cntl.attribute("width"); //175px or 290px
- var cntlID = cntl.attribute("id");
- if( controlSize == "175px" ) {
- var num = parseInt(cntlID.substr(15, (cntlID.length-1)))+1;
- var line1 = document.controls("xforms:line" + num );
- var line2 = document.controls("xforms:line" + (num+1) );
- var line3 = document.controls("xforms:line" + (num+2) );
- var line4 = document.controls("xforms:line" + (num+3) );
- line1.attribute("border-color") = lineColor;
- line2.attribute("border-color") = lineColor;
- line3.attribute("border-color") = lineColor;
- line4.attribute("border-color") = lineColor;
- } else if( controlSize == "290px" ){
- cntl.attribute("border-color") = lineColor;
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 클릭한 지점의 영역에 해당하는 외곽선의 색상을 변경한다.
- * @param : flag, no
- * @return :
- * @---------------------------------------------------
- */
- function fChangeOutLineCntl(flag, no){
- var asLineControl = null;
- var str;
- var count = 0;
-
- if( !( selectSectionsLine[0] == "" ) && flag == "reset"){
- for(var i=0; i<4; i++){
- str = selectSectionsLine[i];
- if(str != ""){
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#000000";
- asLineControl.attribute("border-width") = "1px";
- selectSectionsLine[i] = "";
- } else{
- return;
- }
- }
- } else if(flag == "select"){
- var lngth = swimlineControlArray.length;
- for(var i=0; i<lngth; i++){
- str = swimlineControlArray[i];
- if( !(str =="" || str == null) ){
- if( str.substr(str.length-2, 2) == "LH" ){
- if(no == count){
- str = swimlineControlArray[i];
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#99ccff";
- asLineControl.attribute("border-width") = "3px";
- selectSectionsLine[0] = str;
-
- str = swimlineControlArray[i+1];
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#99ccff";
- asLineControl.attribute("border-width") = "3px";
- selectSectionsLine[1] = str;
-
- str = swimlineControlArray[i+2];
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#99ccff";
- asLineControl.attribute("border-width") = "3px";
- selectSectionsLine[2] = str;
-
- str = swimlineControlArray[i-1];
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#99ccff";
- asLineControl.attribute("border-width") = "3px";
- selectSectionsLine[3] = str;
- return;
- }
- count++;
- }
- }
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : textarea 의 오른쪽 마우스 버튼 이벤트 생성(팝업메뉴 허용 이벤트)
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPopupMenuEvent(curStepCntl){
- if( isNull(curStepCntl) ){
- var ctrl = null;
- ctrl = (event.target);
- var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
- var id = selControl.parent.attribute("id");
- currentStepCntl = document.controls(id); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
- }else{
- currentStepCntl = document.controls(curStepCntl); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
- }
-
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- opener.model.setValue( "/root/main/stepinfo/info/stepno", model.getValue(stepRef + "[" + curNo + "]/stepno") );
- opener.model.setValue( "/root/main/stepinfo/info/times", model.getValue(stepRef + "[" + curNo + "]/times") );
- opener.ipt_times.refresh();
- opener.model.setValue( "/root/main/stepinfo/info/stepnm", model.getValue(stepRef + "[" + curNo + "]/stepnm") );
- opener.ipt_stepnm.refresh();
- opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo + "]/stepmemo") );
- opener.tar_stepmemo.refresh();
-
- model.setValue("/root/main/temp/selectedstep/stepno", model.getValue(stepRef + "[" + curNo + "]/stepno"));
- model.setValue("/root/main/temp/selectedstep/stepflagcd", model.getValue(stepRef + "[" + curNo + "]/stepflagcd"));
- opener.model.setValue( "/root/main/stepinfo/info/stepflagcd", model.getValue(stepRef + "[" + curNo + "]/stepflagcd"));
- opener.model.setValue( "/root/main/stepinfo/info/setno", model.getValue(stepRef + "[" + curNo + "]/setno"));
- if(event.button == 3){
- event.preventDefault();
- if(opener.window.javascript.OpenerKind != "GPS"){
- window.setPopupMenu(true, "/root/main/outlineinfo/popupmenu/item", "name", "func", false);
- }else {
- if( model.getValue(stepRef + "[" + curNo + "]/stepflagcd") == "D"){
- window.setPopupMenu(true, "/root/main/outlineinfo/popupmenu/item3", "name", "func", false);
- }
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fFocusOut(){
- window.setPopupMenu(false);
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fFocusIn(){
- changedCntl = currentStepCntl;
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 스텝 안의 내용을 처음 입력하거나 변경하면, Opener의 memo 란에 내용이 함께 반영된다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetMemo(){
- //현재 선택된 스텝이 아니라, 이전에 선택되어 수정된 스텝의 내용을 반영해야 함.
- //var curID = currentStepCntl.attribute("id");
- var curID = changedCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
-
- opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo + "]/stepmemo") );
- opener.tar_stepmemo.refresh();
-
- if(model.getValue(stepRef + "[" + curNo + "]/m") != "i"){
- model.setValue(stepRef + "[" + curNo + "]/m", "u");
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 연결설정 모드일 경우, 컨트롤에 마우스를 over 하면 마우스 커서가 바뀐다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fMouseOverEvent(){
- ctrl = (event.target);
- var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
- if(connectionMode == "true"){
- selControl.attribute("cursor ") = "pointer";
- } else {
- selControl.attribute("cursor ") = "default";
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 선택한 지점에 스임라인을 추가한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddSwimLine(){
- if( selectedLineSection != "" ){
- var trgline;
- var trgStepNo;
- //스윔라인을 추가한다.
- var y = parseInt(lineNo) * swimLineHight;
- var cy = y + swimLineHight;
- var lngth = swimlineControlArray.length - 1;
- //아웃라인을 제외한 나머지 컨트롤을 삭제
- for(var i=outsideControlCnt; i<=lngth; i++){
- var cntlID = swimlineControlArray[i];
- if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
- cntlID = cntlID.substr(0, cntlID.length-3);
- }
- grp_swimline.removeChild(cntlID);
- swimlineControlArray[i] = "";
- }
- swimlineControlArray.slice(0, outsideControlCnt);
- controlCnt = outsideControlCnt;
- fCreateSwimLine(y, cy);
-
- lineNo = parseInt(lineNo) + 1;
- model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo);
- opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
- opener.ipt_swimlineno.refresh();
- //배열 인덱스를 하나 더 생성
- linesControlMaxCnt[linesControlMaxCnt.length] = 0;
-
- if( lineNo != parseInt(selectedLineSection)+1 ){
- for(var i=1; i<=grpControlCnt; i++ ){
- trgline = model.getValue(stepRef + "[" + i + "]/swimlineno");
- trgStepNo = model.getValue(stepRef + "[" + i + "]/stepno");
- if( trgline > selectedLineSection ){
- model.setValue( stepRef + "[" + i + "]/swimlineno", parseInt(trgline)+1 );
- }
- }
- var start = parseInt(selectedLineSection)-1;
- var end = linesControlMaxCnt.length-1;
- var a = linesControlMaxCnt.slice(0, selectedLineSection);
- var b = linesControlMaxCnt.slice(selectedLineSection, end);
- var c = linesControlMaxCnt[linesControlMaxCnt.length-1];
- linesControlMaxCnt.slice(0, linesControlMaxCnt.length);
- linesControlMaxCnt = a.concat(c, b);
-
- //추가할 라인의 바로 윗줄 스텝의 연결번호를 지운다.
- var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + selectedLineSection + "']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var lnkNode = node.selectSingleNode("lnkstepno");
- model.setValue(lnkNode, "");
- lnkNode = node.selectSingleNode("stepno");
- var stepNo = model.getValue(lnkNode);
-
- model.removeNodeset(dcsRef + "[stepno = '" + stepNo + "']");
- }
- nodeList = instance1.selectNodes(dcsRef);
- dcsCntlCnt = nodeList.length + 1;
- }
- fCreateControl();
- selectedControl = null;
- currentStepCntl = null;
- prevStepCntl = null;
- //selectedLineSection = "";
-
- }else {
- return;
-
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤이나 스윔라인을 삭제한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDelCntl(){
- var header = "supsetno▦deptcd▦updtdd▦updttm▦setno▦settypecd▦m▩";
- var delSetInfoCSV = "";
-
- if( selectedLineSection != "" ){
- //스윔라인을 삭제한다.
- //fDelSwimLine( selectedLineSection );
-
- var nodeList = instance1.selectNodes(stepRef + "[stepno = '" + selectedLineSection + "' and setno != '']");
- if(nodeList.length >= 1){
- var msg = messageBox("저장된 처방 Set 내용이 존재합니다. \n Step을 삭제하면 처방 정보도 함께 삭제됩니다. \n 정말로 ", "Q001");
- if(msg == 6){
- //yes
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var deptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
- var setno = node.selectSingleNode("setno");
-
- if(cpgflagcd == "01" || cpgflagcd == "W"){
- var settypecd = "W";
- } else if(cpgflagcd == "02" || cpgflagcd == "G"){
- var settypecd = "G";
- }
-
- delSetInfoCSV = delSetInfoCSV + "1▦"+deptcd+"▦OOOOOOOO▦OOOO▦"+setno+"▦"+settypecd+"▦d▩";
- }
-
- ivw_detail.window.javascript.delPrmsPrcpSetInfo(header+delSetInfoCSV);
-
- fDelStep("L", selectedLineSection);
- opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
- opener.ipt_swimlineno.refresh();
-
- } else if(msg == 7) {
- return false;
- }
- } else {
- fDelStep("L", selectedLineSection);
- opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
- opener.ipt_swimlineno.refresh();
- }
-
- }else {
- //스텝 컨트롤을 삭제한다.
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- if( model.getValue( stepRef + "[" + curNo + "]/setno" ) != "" ){
- var msg = messageBox("저장된 처방 Set 내용이 존재합니다. \n Step을 삭제하면 처방 정보도 함께 삭제됩니다. \n 정말로 ", "Q001");
- if(msg == 6){
- //yes
- var nodeList = instance1.selectNodes(stepRef + "[" + curNo + "]");
- var deptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
- var setno = model.getValue(stepRef + "[" + curNo + "]/setno");
-
- if(cpgflagcd == "01" || cpgflagcd == "W"){
- var settypecd = "W";
- } else if(cpgflagcd == "02" || cpgflagcd == "G"){
- var settypecd = "G";
- }
-
- delSetInfoCSV = "1▦"+deptcd+"▦OOOOOOOO▦OOOO▦"+setno+"▦"+settypecd+"▦d▩";
- ivw_detail.window.javascript.delPrmsPrcpSetInfo(header+delSetInfoCSV);
-
- fDelStep("C");
-
- } else if(msg == 7) {
- return false;
- }
- } else {
- fDelStep("C");
- }
- // ★ selectedControl 과 동일하다면 selectedControl를 null 로 셋팅한다.
- // selectedControl = null;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 스윔라인을 삭제한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDelSwimLine(){
- fDelStep("L", selectedLineSection);
- opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
- opener.ipt_swimlineno.refresh();
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 스텝 컨트롤을 삭제한다.
- * @param : flag, no
- * @return :
- * @---------------------------------------------------
- */
- function fDelStep(flag, no){
- if(flag == "C"){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- var lineNumber = parseInt( model.getValue( stepRef + "[" + curNo + "]/swimlineno" ) );
- var stepRefSeq = parseInt( model.getValue( stepRef + "[" + curNo + "]/refseq" ) );
-
- //삭제하려는 라인이 최대갯수의 컨트롤을 갖는 줄이라면, 스윔라인 길이 축소
- if(maxControlCnt > 2 && maxControlCnt == linesControlMaxCnt[lineNumber-1]){
- fAdjustLine("re", "392");
- maxControlCnt--;
- }
-
- //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
- var nodeList = instance1.selectNodes(stepRef + "[stepno = '" + curNo + "']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var iNode = node.selectSingleNode("m");
- if(iNode.text != "i"){
- var destNodeList = instance1.selectNodes("/root/temp/delsteplist");
- var stepNode = model.getValue(node.selectSingleNode("stepno"));
- model.setValue(iNode, "d");
- model.makeNode("/root/temp/delsteplist/info[" + (destNodeList.length) + "]");
- model.copyNode("/root/temp/delsteplist/info[" + (destNodeList.length) + "]", stepRef + "[" + stepNode + "]");
- }
- }
- //opener.window.javascript.fSaveStepInfo();
- //선택된 스텝에 연결된 모든 라인을 없댄다.(하위스텝번호를 없앤다)
- fDelLink( curNo );
-
- model.removeNodeset(stepRef + "[stepno = '" + curNo + "']");
- grpControlCnt = grpControlCnt -1;
-
- for(var i=curNo; i<=grpControlCnt; i++){
- var iSwimlineno = parseInt(model.getValue(stepRef + "[" + i + "]/swimlineno"));
- var iRefseq = parseInt(model.getValue(stepRef + "[" + i + "]/refseq"));
- var iStepno = model.getValue(stepRef + "[" + i + "]/stepno");
- if( lineNumber == iSwimlineno && stepRefSeq < iRefseq ){
- //삭제된 컨트롤과 같은 스윔라인에 존재하는 다음 컨트롤들은 라인당 컨트롤 순번도 -1 씩 감소한다.
- model.setValue( stepRef + "[" + i + "]/refseq", parseInt( iRefseq ) - 1 );
- }
- for(var k=1; k<i; k++){
- if( iStepno == model.getValue(stepRef + "[" + k + "]/lnkstepno") )
- model.setValue( stepRef + "[" + k + "]/lnkstepno", i );
- }
-
- if( (iStepno > curNo) ){
- nodeList = instance1.selectNodes(dcsRef + "[lnkstepno = '" + iStepno + "']");
- for(var k= 0; k<nodeList.length; k++){
- var node = nodeList.item(k);
- var iNode = node.selectSingleNode("lnkstepno");
- model.setValue(iNode, i);
- }
-
- model.setValue( stepRef + "[" + i + "]/stepno", parseInt(iStepno)-1 );
-
- nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + iStepno + "']");
- for(var k= 0; k<nodeList.length; k++){
- var node = nodeList.item(k);
- var iNode = node.selectSingleNode("stepno");
- model.setValue(iNode, i);
- }
- }
- }
- linesControlMaxCnt[lineNumber-1] = linesControlMaxCnt[lineNumber-1] - 1;
- currentStepCntl = null;
-
- }else if(flag == "L"){
- var org_CurrentStepCntl = currentStepCntl;
- var org_SelectedLineSection = selectedLineSection;
-
- var delNodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + no + "']");
-
- for(var i=0; i<delNodeList.length; i++){
- var dstNode = delNodeList.item(i);
- var dstFcsNode = dstNode.selectSingleNode("stepno");
- var curNo = model.getValue(dstFcsNode);
-
- //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
- var iNode = dstNode.selectSingleNode("m");
- if(iNode.text != "i"){
- var destNodeList = instance1.selectNodes("/root/temp/delsteplist");
- var stepNode = model.getValue(dstFcsNode);
- model.setValue(iNode, "d");
- model.makeNode("/root/temp/delsteplist/info[" + (destNodeList.length) + "]");
- model.copyNode("/root/temp/delsteplist/info[" + (destNodeList.length) + "]", stepRef + "[" + stepNode + "]");
- }
-
- fDelLink( curNo );
- }
-
- model.removeNodeset (stepRef + "[swimlineno = '" + no + "']");
-
- var nodeList = instance1.selectNodes(stepRef);
- for(var i= 0; i<nodeList.length; i++){
- var dstNode = nodeList.item(i);
- }
-
- var a = linesControlMaxCnt.slice(0, parseInt(no)-1);
- var b = linesControlMaxCnt.slice(no, linesControlMaxCnt.length);
- linesControlMaxCnt = new Array();
- linesControlMaxCnt = a.concat(b);
-
- grpControlCnt = grpControlCnt - delNodeList.length;
-
- var nodeList = instance1.selectNodes(stepRef + "[swimlineno > '" + no + "']");
- for(var i= 0; i<nodeList.length; i++){
- var dstNode = nodeList.item(i);
- var dstFcsNode = dstNode.selectSingleNode("swimlineno");
- model.setValue(dstFcsNode, parseInt(model.getValue(dstFcsNode)) - 1);
- dstFcsNode = dstNode.selectSingleNode("stepno");
- model.setValue( dstFcsNode, parseInt(model.getValue(dstFcsNode))-delNodeList.length );
- }
-
- //마지막 스윔라인을 삭제한다.
- fDelLastSwimLine();
-
- lineNo--;
- model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo); //총 스윔라인 수
-
- if(org_SelectedLineSection > lineNo){
- selectedLineSection = "";
- currentStepCntl = null;
- selectSectionsLine[0] = "";
- selectSectionsLine[1] = "";
- selectSectionsLine[2] = "";
- selectSectionsLine[3] = "";
- fChangeOutLineCntl("reset", lineNo);
- }else if( org_SelectedLineSection <= lineNo ){
- currentStepCntl = org_CurrentStepCntl;
- selectedLineSection = org_SelectedLineSection;
- }
- }
-
- fCreateControl();
- selectedControl = null;
- prevStepCntl = null;
-
- //alert("selectedLineSection = " + selectedLineSection + " currentStepCntl = " + currentStepCntl.attribute("id"));
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤(인스턴스)을 삭제했다면, 다음 스텝번호들의 시퀀스를 -1 씩 감소시킨다.
- * @param : stepNo, lineNo
- * @return :
- * @---------------------------------------------------
- */
- function fResetSeq(stepNo, lineNo){
- var end = grpControlCnt.length;
- for(var i=stepNo; i<=end; i++){
- var curcntlType = model.getValue( stepRef + "[" + i + "]/stepflagcd");
- if( model.getValue(stepRef + "[" + i + "]/swimlineno") == lineNo ){
- //삭제된 컨트롤과 같은 스윔라인에 존재하는 다음 컨트롤들은 라인당 컨트롤 순번도 -1 씩 감소한다.
- model.setValue( stepRef + "[" + i + "]/refseq", parseInt( model.getValue(stepRef + "[" + i + "]/refseq") ) - 1 );
- }else if( model.getValue(stepRef + "[" + i + "]/swimlineno") > lineNo ){
- for(var k=1; k<i; k++){
- if( model.getValue( stepRef + "[" + i + "]/stepno") == model.getValue(stepRef + "[" + k + "]/lnkstepno") )
- model.setValue( stepRef + "[" + k + "]/lnkstepno", i );
- }
- }
- model.setValue( stepRef + "[" + i + "]/stepno", i-1 );
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤을 연결하는 연결선을 삭제한다.
- * @param : trgNo
- * @return :
- * @---------------------------------------------------
- */
- function fDelLink( trgNo ){
- //현재 컨트롤의 인스턴스에서 lnkstepno 를 삭제한 후, fCreateControl() 를 호출한다.
- if( isNull(trgNo) ){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- } else {
- var curNo = trgNo;
- }
- var type = model.getValue( stepRef + "[" + curNo + "]/stepflagcd" );
- var cntlNo = model.getValue( stepRef + "[" + curNo + "]/stepno");
-
- //1. 선택한 스텝의 하위 스텝과의 연결을 해제한다.
- if( type == "D"){
- //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
- var nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + curNo + "']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var iNode = node.selectSingleNode("m");
- if(iNode.text != "i"){
- var destNodeList = instance1.selectNodes("/root/temp/deldecisionlist");
- var stepNode = model.getValue(node.selectSingleNode("stepno"));
- model.setValue(iNode, "d");
- model.makeNode("/root/temp/deldecisionlist/info[" + (destNodeList.length) + "]");
- model.copyNode("/root/temp/deldecisionlist/info[" + (destNodeList.length) + "]", dcsRef + "[" + stepNode + "]");
- }
- }
-
- model.removeNodeset(dcsRef + "[stepno = '" + curNo + "']");
-
- } else {
- //"A"나 "B"는 해당노드의 lnkstepno만 비워준다.
- model.setValue( stepRef + "[" + curNo + "]/lnkstepno", "" );
- if( model.getValue( stepRef + "[" + curNo + "]/m") != "i"){
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- //swimlineControlArray[curNo-1] = "";
- }
- }
-
- //2. 선택한 스텝의 상위 스텝과의 연결을 해제한다.
- var nodeList = instance1.selectNodes(stepRef + "[lnkstepno = '" + curNo + "']");
- for(var i= 0; i<nodeList.length; i++){
- var dstNode = nodeList.item(i);
- var iNode = dstNode.selectSingleNode("lnkstepno");
- model.setValue( iNode, "" );
- iNode = dstNode.selectSingleNode("m");
- if(iNode.text != "i"){
- model.setValue( iNode, "u" );
- }
- }
-
- //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
- var nodeList = instance1.selectNodes(dcsRef + "[lnkstepno = '" + curNo + "']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var iNode = node.selectSingleNode("m");
- if(iNode.text != "i"){
- var destNodeList = instance1.selectNodes("/root/temp/deldecisionlist");
- var stepNode = model.getValue(node.selectSingleNode("stepno"));
- model.setValue(iNode, "d");
- model.makeNode("/root/temp/deldecisionlist/info[" + (destNodeList.length) + "]");
- model.copyNode("/root/temp/deldecisionlist/info[" + (destNodeList.length) + "]", dcsRef + "[" + stepNode + "]");
- }
- }
-
- model.removeNodeset(dcsRef + "[lnkstepno = '" + curNo + "']");
-
- nodeList = instance1.selectNodes(dcsRef);
- dcsCntlCnt = nodeList.length + 1;
-
- //오른쪽 버튼의 연결삭제를 선택한 경우
- if( isNull(trgNo) ){
- //controlCnt = initControlCnt;
- fCreateControl();
- }
- selectedControl = null;
- currentStepCntl = null;
- prevStepCntl = null;
- selectedLineSection = "";
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 시작 스텝으로 설정한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetStartStep(){
- var curID = currentStepCntl.attribute("id");
- fChildrenCtrlToSelCtrl(curID, "S");
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 종료 스텝으로 설정한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetEndStep(){
- var curID = currentStepCntl.attribute("id");
- fChildrenCtrlToSelCtrl(curID, "E");
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Day 이미지를 생성한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetDayImage(stepno, days){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- var type = model.getValue( stepRef + "[" + curNo + "]/stepflagcd" );
- var times = model.getValue( stepRef + "[" + curNo + "]/times" );
- var no = parseInt(stepno)-1;
-
- if(days != ""){
- if(type == "D"){
- var leftPos = 66; //200
- var topPos = 51; //51
- } else {
- var leftPos = 32; //308
- var topPos =0; //1
- }
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + leftPos + "; top:" + topPos + "; width:20px; height:20px; background-stretch:stretch;");
- ctrlType = "xforms:caption";
- ctrlID = ctrlType + (controlCnt++);
- cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + (topPos+1) + "; width:30px; height:20px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
- cntl.attribute("text") = "D" + days;
- } else{
- fCreateControl();
-
- curID = "xforms:group" + no;
- fChildrenCtrlToSelCtrl(curID);
- }
-
- if( model.getValue(stepRef + "[" + stepno + "]/m") != "i" ){
- model.setValue( stepRef + "[" + stepno + "]/m", "u" );
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Detail 정보를 조회, 저장한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fViewDetailInfo(OpenerKind){
- if( allInfoSave() ){
- //opener.window.javascript.fSizeControl();
- if(cpgflagcd == "01" || cpgflagcd == "W"){
- model.setValue("/root/main/outlineinfo/info/cpgflagcd", "W");
- } else if(cpgflagcd == "02" || cpgflagcd == "G"){
- model.setValue("/root/main/outlineinfo/info/cpgflagcd", "G");
- }
-
- var nodeList = instance1.selectNodes(stepRef);
- var csv = getNodeListCSV(nodeList);
- model.setValue("/root/main/temp/selectedstep/csvlist", csv);
-
- //액션뷰를 클릭할 시, 수행하는 기능 없음!!!
- if(opener.btn_action_tab.selected == true){
- grp_swimline.vscroll.attribute("pos") = "0";
- grp_swimline.hscroll.attribute("pos") = "0";
-
- if( currentStepCntl == null && grpControlCnt == 0 && OpenerKind != "GPS" ){
- var msg = messageBox("스텝을 ", "C002");
- return;
- }else{
- if(currentStepCntl == null && grpControlCnt > 0){
- currentStepCntl = document.controls("xforms:group0");
- model.setValue("/root/main/temp/selectedstep/stepno", model.getValue(stepRef + "[1]/stepno"));
- model.setValue("/root/main/temp/selectedstep/stepflagcd", model.getValue(stepRef + "[1]/stepflagcd"));
- }
- grp_swimline.attribute("overflow") = "hidden";
- opener.cap_outlineinfo.attribute("text") = "Action 정보";
-
- var setno = null;
- var selectedDay = null;
- var saveStatus = null;
- var nodelist = null;
- if(OpenerKind == "GPS"){
- OutLinesOpenerKind = OpenerKind;
- /*
- //DetailView -> actionView
- if( ivw_detail.attribute("src") == "../../../emr/prcpmngtweb/xrw/SPMMP02200_DetailView.xrw" ){
- //처방set 조회
- ivw_detail.window.javascript.fGetPrcpSetList();
- copyNodesetType("/root/main/prcp", "/root/main/prcp", "replace", opener.model, ivw_detail.model);
-
- //프로토콜 처방에 저장된 약속처방인지(상태)를 알기위해 select 한다.
- selectedDay = ivw_detail.window.javascript.selectedDay;
- var pathRef = "/root/main/steppath/info";
- nodelist = opener.instance1.selectNodes(pathRef + "[times = '" + selectedDay + "']");
-
- //OutlineView -> actionView
- }else{
- //처방set 조회
- fGetPrcpList();
- copyNodesetType("/root/main/prcp", "/root/main/prcp", "replace", opener.model, model);
-
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
-
- //프로토콜 처방에 저장된 약속처방인지(상태)를 알기위해 select 한다.
- setno = model.getValue(stepRef + "[" + curNo + "]/setno");
- var pathRef = "/root/main/steppath/info";
- nodelist = opener.instance1.selectNodes(pathRef + "[setno = '" + setno + "']");
- }
-
- //선택한 day가 없어도 오류 안 뜨도록 수정 할 것.
- if( nodelist.length > 0 ){
- var node = nodelist.item(0);
- var stepstat = node.selectSingleNode("stepstat");
- if(stepstat.text == '10'){ //초기
- saveStatus = "I";
- }else if(stepstat.text == '20' || stepstat.text == '30'){ //프로토콜/의사처방
- saveStatus = "-";
- }
-
- //셋번호 및 상태값을 바꾼다.
- var nodelist = opener.instance1.selectNodes("/root/main/prcp/prcplist");
- for(var i=0; i<nodelist.length; i++){
- var node = nodelist.item(i);
-
- if( !isNull(setno) ){
- var setNode = node.selectSingleNode("prcpsetcd");
- model.setValue(setNode, setno);
- }
- var statusNode = node.selectSingleNode("status");
- model.setValue(statusNode, saveStatus);
-
- //저장 flag 를 분별하여 set한다
- }
- }
- */
- readyPrcp == "N";
- ivw_detail.attribute("src") = "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw";
- if(readyPrcp == "Y"){
- ivw_detail.attribute("overflow") = "hidden";
- }
-
- }else{
- OutLinesOpenerKind = "Generater2";
- ivw_detail.attribute("src") = "../../../emr/cpgweb/xrw/SPMMP01400_STEP처방관리.xrw";
- //ivw_detail.window.javascript.fInitData();
- }
- ivw_detail.visible = true;
- }
- return;
-
- }else if(opener.btn_outline_tab.selected == true){
- grp_swimline.attribute("overflow") = "scroll";
- if(OpenerKind != "GPS" && opener.window.javascript.preSelectedTab == "btn_action_tab"){
- ivw_detail.window.javascript.fExePrmsSetInfo();
- }
- ivw_detail.visible = false;
- opener.cap_outlineinfo.attribute("text") = "Outline 정보";
-
- if( ivw_detail.window.javascript.callfCreateControlYN == "Y" ){
- fCreateControl();
- }
- return;
-
- } else if(opener.btn_detail_tab.selected == true){
- if( ivw_detail.attribute("src") != "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw" ||
- ivw_detail.attribute("src") == "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw" && readyPrcp == "Y"){
- grp_swimline.vscroll.attribute("pos") = "0";
- grp_swimline.hscroll.attribute("pos") = "0";
-
- var stepinfo = opener.javascript.getParameter("stepinfo");
- setParameter("stepinfo", stepinfo);
-
- ivw_detail.attribute("src") = "../../../emr/prcpmngtweb/xrw/SPMMP02200_DetailView.xrw";
- grp_swimline.attribute("overflow") = "hidden";
- opener.cap_outlineinfo.attribute("text") = "Detail 정보";
-
- if(OpenerKind == "GPS"){
- OutLinesOpenerKind = OpenerKind;
-
- ivw_detail.cap_drug.attribute("height") = "179px";
- ivw_detail.cap_test.attribute("top") = "228px";
- ivw_detail.cap_test.attribute("height") = "164px";
- ivw_detail.cap_caredelive.attribute("top") = "394px";
- ivw_detail.cap_caredelive.attribute("height") = "124px";
- ivw_detail.cap_form.attribute("top") = "520px";
- ivw_detail.cap_form.attribute("height") = "124px";
- ivw_detail.cap_etc.attribute("top") = "646px";
- ivw_detail.cap_etc.attribute("height") = "117px";
-
- ivw_detail.grd_drug1.attribute("height") = "180px";
- ivw_detail.grd_drug2.attribute("height") = "180px";
- ivw_detail.grd_drug3.attribute("height") = "180px";
- ivw_detail.grd_drug4.attribute("height") = "180px";
- ivw_detail.grd_test1.attribute("top") = "228px";
- ivw_detail.grd_test2.attribute("top") = "228px";
- ivw_detail.grd_test3.attribute("top") = "228px";
- ivw_detail.grd_test4.attribute("top") = "228px";
- ivw_detail.grd_test1.attribute("height") = "165px";
- ivw_detail.grd_test2.attribute("height") = "165px";
- ivw_detail.grd_test3.attribute("height") = "165px";
- ivw_detail.grd_test4.attribute("height") = "165px";
- ivw_detail.grd_caredelive1.attribute("top") = "394px";
- ivw_detail.grd_caredelive2.attribute("top") = "394px";
- ivw_detail.grd_caredelive3.attribute("top") = "394px";
- ivw_detail.grd_caredelive4.attribute("top") = "394px";
- ivw_detail.grd_caredelive1.attribute("height") = "125px";
- ivw_detail.grd_caredelive2.attribute("height") = "125px";
- ivw_detail.grd_caredelive3.attribute("height") = "125px";
- ivw_detail.grd_caredelive4.attribute("height") = "125px";
- ivw_detail.grd_form1.attribute("top") = "520px";
- ivw_detail.grd_form2.attribute("top") = "520px";
- ivw_detail.grd_form3.attribute("top") = "520px";
- ivw_detail.grd_form4.attribute("top") = "520px";
- ivw_detail.grd_form1.attribute("height") = "125px";
- ivw_detail.grd_form2.attribute("height") = "125px";
- ivw_detail.grd_form3.attribute("height") = "125px";
- ivw_detail.grd_form4.attribute("height") = "125px";
- ivw_detail.grd_etc1.attribute("top") = "646px";
- ivw_detail.grd_etc2.attribute("top") = "646px";
- ivw_detail.grd_etc3.attribute("top") = "646px";
- ivw_detail.grd_etc4.attribute("top") = "646px";
- ivw_detail.grd_etc1.attribute("height") = "117px";
- ivw_detail.grd_etc2.attribute("height") = "117px";
- ivw_detail.grd_etc3.attribute("height") = "117px";
- ivw_detail.grd_etc4.attribute("height") = "117px";
- }
- }else{
- opener.btn_action_tab.selected = true;
- opener.btn_action_tab.refresh();
- }
- ivw_detail.visible = true;
- return;
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Detail 정보를 조회, 저장한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCopyPrcpList(){
- copyNodesetType("/root/main/prcp", "/root/main/prcp", "replace", ivw_detail.model, opener.model);
-
- ivw_detail.grd_prcplist.dispatch("onmousedown");
- ivw_detail.window.javascript.appendChildPrcp ( "/root/reset/prcplist", "/root/main/prcp", "main" ); //검색라인추가
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Master 정보를 저장한다.
- * @param :
- * @return : true, false
- * @---------------------------------------------------
- */
- function allInfoSave(){
- if(opener.model.getValue("/root/main/masterinfo/info/cpgno") == "" && opener.model.getValue("/root/main/masterinfo/info/cpgflagcd") == ""){
- var msg = messageBox("Master 정보가 존재하지 않아 실행 ", "E001");
- return;
- }else if(opener.model.getValue("/root/main/masterinfo/info/cpgno") == "" && opener.model.getValue("/root/main/masterinfo/info/cpgflagcd") != ""){
- var msg = messageBox("Master 정보가 저장되지 않았습니다. ", "Q002");
- if(msg == 6){
- //opener.btn_allInfoSave.dispatch("DOMActivate");
- opener.window.javascript.fSaveCPGInfo();
- return true;
-
- } else if(msg == 7) {
- return false;
- }
- }else{
- return true;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 선택한 하나의 스텝만 저장한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveStep(stepNumber){
- //★ 선택된 스텝만 저장하고, 해당 스텝의 저장 flag 만 바꾼다.
- var nodelist = instance1.selectNodes(stepRef + "["+stepNumber+"]");
- var steplistCSV = getNodeListCSV(nodelist);
- var stepCSV = steplistCSV;
- opener.window.javascript.fSaveStepInfo(stepCSV);
-
- model.setValue(stepRef + "[" + stepNumber + "]/m", "");
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 저장 후, status 값이 I 이거나 U 인 것들을 - 상태로 변환, D 인 것은 삭제한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChangeStatus(){
- var nodeList = instance1.selectNodes(stepRef + "[m = 'i' or m = 'u']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var statusNode = node.selectSingleNode("m");
- model.setValue(statusNode, "");
- }
-
- nodeList = instance1.selectNodes(dcsRef + "[m = 'i' or m = 'u']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var statusNode = node.selectSingleNode("m");
- model.setValue(statusNode, "");
- }
-
- model.removeNodeset("/root/temp/delsteplist");
- model.removeNodeset("/root/temp/deldecisionlist");
- model.makeNode("/root/temp/delsteplist");
- model.makeNode("/root/temp/deldecisionlist");
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그룹 컨트롤 아이디를 받아서, currentStepCntl을 설정하고, 자식 컨트롤 중 textarea 컨트롤을 반환받아 selControl로 설정, fChangeSelectCntl()를 호출한다.
- * @param : ctrl, flag(시작, 종료스텝 구분, null이면 그외 스텝)
- * @return :
- * @---------------------------------------------------
- */
- function fChildrenCtrlToSelCtrl(ctrl, flag){
- var selControl = document.controls(ctrl); //현재 선택한 컨트롤(그룹)
- var childrens = selControl.children;
- var elNm = "";
- var curNo = parseInt( ctrl.substr(12, ctrl.length-12) ) + 1;
-
- for(var i=0; i<childrens.length; i++){
- if(childrens.item(i).elementName == "xforms:textarea"){
- elNm = childrens.item(i).attribute("id");
- }
- }
- selControl = document.controls(elNm);
-
- if(flag == "S"){
- if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
- model.setValue( stepRef + "[" + curNo + "]/startendflag", "S" );
- fChangeSelectCntl("#ff9900", selectedControl);
- } else {
- model.setValue( stepRef + "[" + curNo + "]/startendflag", "" );
- fChangeSelectCntl("#000000", selControl);
- }
-
- if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- }
- } else if(flag == "E"){
- if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
- model.setValue( stepRef + "[" + curNo + "]/startendflag", "E" );
- fChangeSelectCntl("#ff9900", selectedControl);
- } else {
- model.setValue( stepRef + "[" + curNo + "]/startendflag", "" );
- fChangeSelectCntl("#000000", selControl);
- }
-
- if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- }
-
- } else {
- currentStepCntl = selControl;
- if(selectedControl != null){
- if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
- fChangeSelectCntl("#000000", selectedControl);
- }else{
- fChangeSelectCntl("#ff9900", selectedControl);
- }
- }
- fChangeSelectCntl("#99ccff", selControl);
- selectedControl = selControl;
- }
-
- var stepnm = opener.model.getValue( "/root/main/stepinfo/info/stepnm");
- var stepmemo = opener.model.getValue( "/root/main/stepinfo/info/stepmemo");
- var steptimes = opener.model.getValue( "/root/main/stepinfo/info/times");
-
- return (stepnm+"|"+stepmemo+"|"+steptimes);
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS에서 일괄 발행을 위한 decision 스텝의 대답을 얻는다.
- * @param : ctrl
- * @return :
- * @---------------------------------------------------
- */
- function fDecision(){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- grd_decision.rowHidden(0) = true;
-
- if(opener.btn_outline_tab.selected == true){
- if(decisionMode == "false"){
- decisionMode = "true";
- var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno");
- model.setValue("/root/main/seldecisionstep", trgStep);
- model.setValue("/root/main/seldecisionstepno", curNo);
-
- }else if(decisionMode == "true"){
- var no = model.getValue("/root/main/seldecisionstepno");
- var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno");
- grd_decision_answlist.addRow(true, true);
- var srcStep = model.getValue("/root/main/seldecisionstep");
- model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/stepno" , srcStep);
- model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/lnkstepno" , trgStep);
- model.makeValue(stepRef + "[" + no + "]/dcsnstep", trgStep);
-
- model.setValue("/root/main/seldecisionstep", "");
- model.setValue("/root/main/seldecisionstepno", "")
- decisionMode = "false";
-
- //CP적용환자 테이블( MMPHAPPT )에 저장한다.
- opener.window.javascript.fInsCPGAppPatInfo( srcStep, trgStep );
- }
-
- }else if(opener.btn_detail_tab.selected == true){
- var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno");
- var nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + trgStep + "']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var lnkStep = node.selectSingleNode("lnkstepno");
- var stepMemo = instance1.selectSingleNode(stepRef + "[stepno = '" + lnkStep + "']/stepmemo");
-
- grd_decision.addRow(true);
- model.setValue("/root/main/seldecision/info["+ (i+1) +"]/stepno" , lnkStep.text);
- model.setValue("/root/main/seldecision/info["+ (i+1) +"]/stepmemo" , stepMemo.text);
-
- grd_decision_answlist.addRow(true, true);
- model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/stepno" , trgStep);
- model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/lnkstepno" , lnkStep);
- }
- grp_dcsgrid.visible = true;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.08
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS가 opener 일 경우, 서식 코드를 조회한다.
- * @param : ctrl
- * @return :
- * @---------------------------------------------------
- */
- function GPS_fGetFormList(flag, val){
- if( flag == "S" ){
- opener.window.javascript.fGetFormList("S", val);
- return;
- }else if( flag == "D" ){
- opener.window.javascript.fGetFormList("D", val);
- return;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.08
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS가 opener 일 경우, 서식 코드를 조회한다. (사용 안 함)
- * @param : mode
- * @return :
- * @---------------------------------------------------
- */
- function fGetPrcpList( mode ){
- if( mode == "step" ){
- if(currentStepCntl != null){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
-
- if(cpgflagcd == "01" || cpgflagcd == "W"){
- var settypecd = "W";
- } else if(cpgflagcd == "02" || cpgflagcd == "G"){
- var settypecd = "G";
- }
-
- model.removeNodeset("/root/send");
- model.makeNode("/root/send");
-
- model.makeValue ( "/root/send/cond1", model.getValue(stepRef + "[" + curNo + "]/setno") );
- model.makeValue ( "/root/send/cond2", settypecd);
-
- model.makeValue ( "/root/send/cpgno", model.getValue("/root/main/outlineinfo/info/cpgno") );
- model.makeValue ( "/root/send/cpghistseq", model.getValue("/root/main/outlineinfo/info/cpghistseq") );
- model.makeValue ( "/root/send/cpgflagcd", cpgflagcd);
- model.makeValue ( "/root/send/dayno", model.getValue(stepRef + "[" + curNo + "]/times") );
- model.makeValue ( "/root/send/setcond", model.getValue(stepRef + "[" + curNo + "]/setno") );
- model.makeValue ( "/root/send/cpgappno", opener.model.getValue("/root/temp/getdata/cpgappno") );
- model.makeValue ( "/root/send/case", "step");
-
- submit("TRMMP02202", false); //submit("TRMMB00202", false) 와 동일
-
- }else if( mode == "step" ){
- ivw_detail.window.javascript.fGetPrcpSetList();
- }
- }
- }
|