SPMQP01900.js 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048
  1. var lineNo = model.getValue("/root/main/outlineinfo/info/swimlineno"); //총 스윔라인 수
  2. var cpgflagcd = model.getValue("/root/main/outlineinfo/info/cpgflagcd"); //총 스윔라인 수
  3. var grpControlCnt; //생성된 총 그룹 컨트롤 갯수(컨트롤 생성시 위치 재배치를 위해 따로 관리)
  4. var controlCnt; //생성된 컨트롤 갯수(나머지 컨트롤 카운트)
  5. var dcsCntlCnt = 1; //decision 컨트롤의 총 갯수(인스턴수 마지막 인덱스가 된다)
  6. var lineYpos;
  7. var linesControlMaxCnt = new Array(); //스윔라인 영역의 갯수
  8. var swimlineControlArray = new Array(); //라인 컨트롤의 배열(라인종류를 담는다)
  9. var selectSectionsLine = new Array(); //4*1 의 변경된 색상을 갖는 라인배열...
  10. selectSectionsLine[0] = "";
  11. selectSectionsLine[1] = "";
  12. selectSectionsLine[2] = "";
  13. selectSectionsLine[3] = "";
  14. var swimLineHight = 165; //한 스윔라인의 높이 //<-210
  15. var swimLineWidth = 815; //스윔라인의 넓이 //<-792
  16. var selectedLineSection = ""; //선택된 라인(ex:1,2...)
  17. var selectedControl = null; //선택된 아이템(컨트롤)
  18. var currentStepCntl = null; //현재 포커스를 가진 아이템(그룹아이디)
  19. var changedCntl = null; //스텝의 개요를 변경할 때, 이전에 값이 변한 스텝의 id 가 필요함.
  20. var prevStepCntl = null; //부모가 될 아이템(그룹아이디)
  21. var childStepCntl = null; //자식이 될 아이템(그룹아이디)
  22. var maxControlCnt = 2; //한줄 단위로, 최대 default 컨트롤 갯수
  23. var initControlCnt = 0; //외곽 스윔라인 컨트롤 갯수(나머지 컨트롤을 초기화 할때 initControlCnt 부터 다시 카운트 한다)
  24. var stepRef = "/root/main/steplist/info";
  25. var dcsRef = "/root/main/decisionlist/info";
  26. var tmpIncreaseVal = 0; //임시변수, 스타트포인트의 감소 문제를 해결하고 나면, 삭제 필!
  27. var outsideControlCnt = 0; //바깥 아웃라인의 라인컨트롤 갯수(컨트롤 생성시, outsideControlCnt+1보다 큰 컨트롤들을 삭제한다)
  28. var transViewSize = 0;
  29. var connectionMode = "false";
  30. var decisionMode = "false";
  31. var OutLinesOpenerKind = "";
  32. var readyPrcp = "N";
  33. /**
  34. * @group :
  35. * @ver : 2007.07
  36. * @by : 전지은
  37. * @---------------------------------------------------
  38. * @type : function
  39. * @access : public
  40. * @desc : generater 로딩 후 cpg 조회시, outline을 구성하기 위해 초기 변수를 셋팅해준다.
  41. * @param :
  42. * @return :
  43. * @---------------------------------------------------
  44. */
  45. function initGlobalVariant(arg1, arg2){
  46. grpControlCnt = arg1;
  47. outsideControlCnt = arg2;
  48. linesControlMaxCnt = new Array();
  49. for(var i=0; i<parseInt(lineNo); i++){
  50. var no = i + 1;
  51. var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + no.toString() + "']");
  52. linesControlMaxCnt[i] = nodeList.length;
  53. if(linesControlMaxCnt[i] > 2 && linesControlMaxCnt[i] > linesControlMaxCnt[i-1]){
  54. maxControlCnt = linesControlMaxCnt[i];
  55. }
  56. }
  57. nodeList = instance1.selectNodes(dcsRef);
  58. dcsCntlCnt = nodeList.length + 1;
  59. if(maxControlCnt > 2){
  60. fAdjustLine("ex", "392");
  61. }
  62. }
  63. /**
  64. * @group :
  65. * @ver : 2007.07
  66. * @by : 전지은
  67. * @---------------------------------------------------
  68. * @type : function
  69. * @access : public
  70. * @desc : opener에서 스윔라인 수를 수정할 경우, outline 및 모든 컨틀롤 초기화
  71. * @param :
  72. * @return :
  73. * @---------------------------------------------------
  74. */
  75. function fOutlineCntlInit(){
  76. for(var i=0; i<=controlCnt; i++){
  77. var cntlID = swimlineControlArray[i];
  78. if( !( cntlID == "" || cntlID == null ) ){
  79. if( cntlID.substr(cntlID.length-3, 1) == "_" ){
  80. cntlID = cntlID.substr(0, cntlID.length-3);
  81. }
  82. grp_swimline.removeChild(cntlID);
  83. grp_swimline.refresh();
  84. }
  85. }
  86. outsideControlCnt = 0;
  87. tmpIncreaseVal = 0;
  88. controlCnt = 0;
  89. grpControlCnt = 0;
  90. //maxControlCnt = 2;
  91. //swimlineControlArray.slice(0, swimlineControlArray.length);
  92. swimlineControlArray = new Array();
  93. //linesControlMaxCnt.slice(0, linesControlMaxCnt.length);
  94. //인스턴스를 비운다.
  95. model.removeNodeset("/root/main/steplist");
  96. model.removeNodeset("/root/main/decisionlist");
  97. model.makeNode("/root/main/decisionlist");
  98. selectSectionsLine[0] = "";
  99. selectSectionsLine[1] = "";
  100. selectSectionsLine[2] = "";
  101. selectSectionsLine[3] = "";
  102. selectedLineSection = "";
  103. selectedControl = null;
  104. currentStepCntl = null;
  105. changedCntl = null;
  106. prevStepCntl = null;
  107. dcsCntlCnt = 1;
  108. swimLineHight = 165; //한 스윔라인의 높이 //<-210
  109. swimLineWidth = 815; //스윔라인의 넓이
  110. maxControlCnt = 2;
  111. connectionMode = "false";
  112. }
  113. /**
  114. * @group :
  115. * @ver : 2007.07
  116. * @by : 전지은
  117. * @---------------------------------------------------
  118. * @type : function
  119. * @access : public
  120. * @desc : 초기화
  121. * @param :
  122. * @return :
  123. * @---------------------------------------------------
  124. */
  125. function fInitialize() {
  126. lineNo = model.getValue("/root/main/outlineinfo/info/swimlineno");
  127. cpgflagcd = model.getValue("/root/main/outlineinfo/info/cpgflagcd");
  128. //cpgorddeptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
  129. if( !(lineNo == "0" || lineNo == "") ){
  130. arrNum = parseInt(lineNo) - 1;
  131. linesControlMaxCnt = new Array(arrNum);
  132. }else{
  133. linesControlMaxCnt = new Array(lineNo);
  134. }
  135. //linesControlMaxCnt.slice(0, linesControlMaxCnt.length-1);
  136. for(var i=0; i<lineNo; i++){
  137. linesControlMaxCnt[i] = 0;
  138. }
  139. var y=0;
  140. var cy=swimLineHight;
  141. controlCnt = 0;
  142. grpControlCnt = 0;
  143. //fCreateButton(); //버튼
  144. ctrlID = "xforms:line" + (controlCnt++);
  145. ctrl = grp_swimline.createChild("xforms:line", "id:"+ctrlID + "; x1:0px; y1:0px ; x2:" + swimLineWidth + "px; y2: 0px; ");
  146. swimlineControlArray[controlCnt-1] = ctrlID+"_UW"; //up+width
  147. for(var i=1; i<=lineNo; i++){
  148. fCreateSwimLine(y, cy); //가장 윗줄
  149. y = cy;
  150. cy = cy + swimLineHight;
  151. }
  152. }
  153. /**
  154. * @group :
  155. * @ver : 2007.07
  156. * @by : 전지은
  157. * @---------------------------------------------------
  158. * @type : function
  159. * @access : public
  160. * @desc : 버튼을 생성한다. (사용 안함)
  161. * @param :
  162. * @return :
  163. * @---------------------------------------------------
  164. *
  165. function fCreateButton(){
  166. var button1 = "xforms:button";
  167. var ctrlID;
  168. var ctrl = null;
  169. ctrlID = button1 + (controlCnt++);
  170. var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + 612 + ";top:" +5 + ";width:42; height:19 ; text:" + "A");
  171. ctrl.attribute("class") = "btn2_letter2";
  172. ctrlID = button1 + (controlCnt++);
  173. var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 45) + ";top:" + 5 + ";width:42; height:19 ; text:" + "D");
  174. ctrl.attribute("class") = "btn2_letter2";
  175. ctrlID = button1 + (controlCnt++);
  176. var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 90) + ";top:" + 5 + ";width:42; height:19 ; text:" + "B");
  177. ctrl.attribute("class") = "btn2_letter2";
  178. ctrlID = button1 + (controlCnt++);
  179. var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 135) + ";top:" + 5 + ";width:42; height:19 ; text:" + "삭제");
  180. ctrl.attribute("class") = "btn2_letter2";
  181. }
  182. */
  183. /**
  184. * @group :
  185. * @ver : 2007.07
  186. * @by : 전지은
  187. * @---------------------------------------------------
  188. * @type : function
  189. * @access : public
  190. * @desc : 라인을 생성한다.
  191. * @param : y, cy
  192. * @return :
  193. * @---------------------------------------------------
  194. */
  195. function fCreateSwimLine(y, cy) {
  196. var line1 = "xforms:line";
  197. var ctrlID;
  198. var ctrl = null;
  199. var x=0;
  200. var cx = swimLineWidth;
  201. ctrlID = line1 + (controlCnt++);
  202. ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + x + "px; y1:" + y + "px; x2:" + x + "px; y2:" + cy+ "px; ");
  203. swimlineControlArray[controlCnt-1] = ctrlID+"_LH"; //left+height
  204. ctrlID = line1 + (controlCnt++);
  205. ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + cx + "px; y1:" + y + "px; x2:" + cx + "px; y2:" + cy+ "px; ");
  206. swimlineControlArray[controlCnt-1] = ctrlID+"_RH"; //right+height
  207. ctrlID = line1 + (controlCnt++);
  208. ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + x + "px; y1:" + cy + "px; x2:" + cx + "px; y2:" + cy+ "px; ");
  209. swimlineControlArray[controlCnt-1] = ctrlID+"_DW"; //down+width
  210. ctrl.refresh();
  211. outsideControlCnt = controlCnt;
  212. }
  213. /**
  214. * @group :
  215. * @ver : 2007.07
  216. * @by : 전지은
  217. * @---------------------------------------------------
  218. * @type : function
  219. * @access : public
  220. * @desc : 마지막 스윔라인을 삭제한다.
  221. * @param :
  222. * @return :
  223. * @---------------------------------------------------
  224. */
  225. function fDelLastSwimLine(){
  226. var endPnt = parseInt(outsideControlCnt);
  227. var cnt = 0;
  228. for (var i=endPnt; i>=0; i--){
  229. var str = swimlineControlArray[i];
  230. if(!isNull(str)){
  231. if(str.substr(0,12) != "xforms:group"){
  232. var cntlStr = str.substr(str.length-2, 2);
  233. if( cnt<3 && (cntlStr== "DW" || cntlStr == "RH" || cntlStr == "LH") ){
  234. grp_swimline.removeChild( str.substr(0, str.length-3) );
  235. swimlineControlArray[i] = "";
  236. cnt++;
  237. }else {
  238. return;
  239. }
  240. }
  241. }
  242. }
  243. var a = swimlineControlArray.slice(0, (endPnt-3));
  244. var b = swimlineControlArray.slice(endPnt, swimlineControlArray.length);
  245. swimlineControlArray.slice(0, swimlineControlArray.length);
  246. swimlineControlArray = a.concat(b);
  247. outsideControlCnt = outsideControlCnt - 3;
  248. //fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
  249. }
  250. /**
  251. * @group :
  252. * @ver : 2007.07
  253. * @by : 전지은
  254. * @---------------------------------------------------
  255. * @type : function
  256. * @access : public
  257. * @desc : 외곽 스윔라인의 길이를 연장한다.
  258. * @param : flag(extention/reduction), width
  259. * @return :
  260. * @---------------------------------------------------
  261. */
  262. function fAdjustLine( flag, width ){
  263. var asLineControl = null;
  264. var lngth = swimlineControlArray.length;
  265. var str;
  266. var width = parseInt(width);
  267. if(flag == "allEx"){
  268. if(maxControlCnt <= 3)
  269. width = 1190 - swimLineWidth - 20;
  270. else
  271. width = 0;
  272. transViewSize = width;
  273. flag = "ex";
  274. } else if(flag == "allRe"){
  275. width = transViewSize;
  276. flag = "re";
  277. }
  278. if(flag == "ex"){
  279. for (i=0; i<lngth; i++){
  280. str = swimlineControlArray[i];
  281. if( !(str =="" || str == null) ){
  282. if( str.substr(str.length-2, 2) == "UW" ){
  283. asLineControl = document.controls( str.substr(0, str.length-3) );
  284. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
  285. swimLineWidth = parseInt(asLineControl.attribute("x2"));
  286. } else if(str.substr(str.length-2, 2) == "DW" ){
  287. asLineControl = document.controls(str.substr(0, str.length-3));
  288. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
  289. } else if(str.substr(str.length-2, 2) == "RH" ){
  290. asLineControl = document.controls(str.substr(0, str.length-3));
  291. asLineControl.attribute("x1") = parseInt(asLineControl.attribute("x1")) + width;
  292. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
  293. }
  294. }
  295. }
  296. } else if(flag == "re"){
  297. for (i=0; i<lngth; i++){
  298. str = swimlineControlArray[i];
  299. if( !(str =="" || str == null) ){
  300. if( str.substr(str.length-2, 2) == "UW" ){
  301. asLineControl = document.controls( str.substr(0, str.length-3) );
  302. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
  303. swimLineWidth = asLineControl.attribute("x2");
  304. } else if(str.substr(str.length-2, 2) == "DW" ){
  305. asLineControl = document.controls(str.substr(0, str.length-3));
  306. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
  307. } else if(str.substr(str.length-2, 2) == "RH" ){
  308. asLineControl = document.controls(str.substr(0, str.length-3));
  309. asLineControl.attribute("x1") = parseInt(asLineControl.attribute("x1")) - width;
  310. asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
  311. }
  312. }
  313. }
  314. }
  315. selectedControl = null;
  316. }
  317. /**
  318. * @group :
  319. * @ver : 2007.07
  320. * @by : 전지은
  321. * @---------------------------------------------------
  322. * @type : function
  323. * @access : public
  324. * @desc : 컨트롤을 왼쪽으로 옮긴다. (한꺼번에 모든 컨트롤을 다시 재생성 하므로, 사용 안 함)
  325. * @param : no
  326. * @return :
  327. * @---------------------------------------------------
  328. *
  329. function fModeControl( no ){
  330. //같은 라인에 미리 생성된 아이템의 x1, x2 좌표를 - 시킨다.
  331. var y1 = (no-1) * swimLineHight;
  332. var y2 = y1 + swimLineHight;
  333. for(var i = 0; i < grpControlCnt; i++){
  334. var cntl = document.controls( "xforms:group" + i );
  335. var cntlY1 = parseInt(cntl.attribute("top"));
  336. var cntlY2 = parseInt(cntl.attribute("height"));
  337. if(cntlY1 > y1 && (cntlY1+cntlY2) < y2) {
  338. var orgX = parseInt(cntl.attribute("left"));
  339. cntl.attribute("left") = orgX - 200;
  340. }
  341. }
  342. }
  343. */
  344. /**
  345. * @group :
  346. * @ver : 2007.07
  347. * @by : 전지은
  348. * @---------------------------------------------------
  349. * @type : function
  350. * @access : public
  351. * @desc : 해당 스텝에 대한 노드(인스턴스)를 먼저 생성한다.
  352. * @param : flag(A/D/B), no(selectedLineSection)
  353. * @return :
  354. * @---------------------------------------------------
  355. */
  356. function fMakeNode( flag, no ){
  357. no = parseInt(no);
  358. grpControlCnt = parseInt(grpControlCnt) + 1;
  359. linesControlMaxCnt[no-1] = parseInt( linesControlMaxCnt[no-1] ) + 1; // no = 라인수
  360. model.resetInstanceNode("/root/main/temp/stepinfo/info");
  361. model.setValue("/root/main/temp/stepinfo/info/stepno", grpControlCnt);
  362. model.setValue("/root/main/temp/stepinfo/info/stepflagcd", flag);
  363. model.setValue("/root/main/temp/stepinfo/info/swimlineno", no);
  364. model.setValue("/root/main/temp/stepinfo/info/refseq", linesControlMaxCnt[no-1]);
  365. model.setValue("/root/main/temp/stepinfo/info/stepmemo", "");
  366. model.setValue("/root/main/temp/stepinfo/info/m", "i");
  367. if( maxControlCnt < linesControlMaxCnt[no-1] ){
  368. maxControlCnt = linesControlMaxCnt[no-1];
  369. fAdjustLine("ex", "392");
  370. }
  371. model.makeNode( stepRef + "[" + grpControlCnt + "]");
  372. model.copyNode ( stepRef + "[" + grpControlCnt + "]" , "/root/main/temp/stepinfo/info");
  373. //각 노드셋(stepRef) 마다 menu 를 생성하는 makeValue 문은 삭제했음.
  374. if(selectedControl != null){
  375. var selID = selectedControl.attribute("id");
  376. var curNo = parseInt( selID.substr(12, selID.length-12) ) + 1;
  377. //if( model.getValue(stepRef + "[" + curNo + "]/stepno") > selectedLineSection ){
  378. //★ 추가되는 컨트롤의 라인수 및 조회순서가 selectedControl 보다 크면, 그대로, 작으면 selectedControl 은 -1 (일단 null)
  379. // selectedControl = null;
  380. //}
  381. }
  382. return grpControlCnt;
  383. }
  384. /**
  385. * @group :
  386. * @ver : 2007.07
  387. * @by : 전지은
  388. * @---------------------------------------------------
  389. * @type : function
  390. * @access : public
  391. * @desc : 컨트롤을 생선한다.
  392. * @param :
  393. * @return :
  394. * @---------------------------------------------------
  395. */
  396. function fCreateControl(){
  397. var ctrlID;
  398. var ctrl = null;
  399. var grpWidth = 392; //좌표를 기준으로 한 영역의 사이즈 (실제 컨트롤 width=290)
  400. var halfpoint = grpWidth/2;
  401. var marginX = 38; //영역 안의 왼쪽 여백 ( 38+ 290 + 38 = 392 )
  402. var pntCnt = 0; //기준점의 갯수
  403. var cntlCnt = 0; //해당 라인의 컨트롤 총 갯수
  404. var y = 0;
  405. var psition = 0; //k 번째 컨트롤 포지션(포커스된 컨트롤의 라인 내 순서)
  406. var startPoint = 0; //라인당 컨트롤들을 위치시킬 시작x위치
  407. stepCnt = parseInt(grpControlCnt); //새로 그릴 스텝(컨트롤) 갯수
  408. var lngth = swimlineControlArray.length - 1;
  409. var cntlID;
  410. //아웃라인을 제외한 컨트롤을 모두 삭제
  411. for(var i=outsideControlCnt; i<=lngth; i++){
  412. cntlID = swimlineControlArray[i];
  413. if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
  414. cntlID = cntlID.substr(0, cntlID.length-3);
  415. }
  416. grp_swimline.removeChild(cntlID);
  417. swimlineControlArray[i] = "";
  418. }
  419. controlCnt = outsideControlCnt;
  420. //lngth = swimlineControlArray.length - outsideControlCnt;
  421. //swimlineControlArray.slice(outsideControlCnt, lngth);
  422. swimlineControlArray.slice(0, outsideControlCnt);
  423. grpControlCnt = 0;
  424. for(var i=1; i<=stepCnt ; i++){
  425. var flag = model.getValue(stepRef + "[" + i + "]/stepflagcd");
  426. var lineno = parseInt(model.getValue(stepRef + "[" + i + "]/swimlineno"));
  427. var position = parseInt(model.getValue(stepRef + "[" + i + "]/refseq"));
  428. var kind = model.getValue(stepRef + "[" + i + "]/startendflag");
  429. var times = model.getValue(stepRef + "[" + i + "]/times");
  430. cntlCnt = linesControlMaxCnt[lineno-1];
  431. y = ((lineno-1) * swimLineHight) + 20; //122 + 20 + 20 = 165
  432. // ★ 문제... 좌표가 -1씩 줄어든다...
  433. startPoint = ( (swimLineWidth - (394 * cntlCnt) ) / 2 + 1 ) + ((position-1) * 395);
  434. //임시 해결책 : 글로벌변수 tmpIncreaseVal 을 계속 증감시켜, startPoint 에 더한다
  435. startPoint = startPoint - ((position-1) * 1);
  436. //1. 마름모 모양의 라인들과 그리드를 담을 그룹을 생성한다.
  437. controlCnt++;
  438. ctrlID = "xforms:group" + (grpControlCnt++);
  439. var ctrlGrp = grp_swimline.createChild("xforms:group", "id:" + ctrlID + ";left:" + startPoint + "px; top:" + y + "px; width:" + 395 + " px; height:" + 122 + "px;"); //290*135
  440. swimlineControlArray[outsideControlCnt + (grpControlCnt-1)] = ctrlID;
  441. if( flag == "D" ) {
  442. //2. 결정 그리드를 생성한다. -> textarea 로 대체...
  443. var text1 = "xforms:textarea";
  444. ctrlID = text1 + (controlCnt++);
  445. 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; ");
  446. ctrl.attribute("onmousedown") = "fPopupMenuEvent()"; //이벤트와 컨트롤을 연결하는 동적 이벤트
  447. ctrl.attribute("xforms-value-changed") = "fSetMemo()";
  448. ctrl.attribute("DOMFocusIn") = "fFocusIn()";
  449. //ctrl.attribute("DOMFocusOut") = "fFocusOut()";
  450. ctrl.attribute("onmouseover") = "fMouseOverEvent()";
  451. var txtctrl = ctrl;
  452. //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; ");
  453. //var col1 = "xforms:col";
  454. //ctrlID = col1 + (controlCnt++);
  455. //ctrl.createChild(col1, "tag:xforms:col; ref:stepmemo; type:input; border-width:0; background-color:transparent; ");
  456. //ctrl.rebuild();
  457. //ctrl.rowHidden(0) = true;
  458. //3. 마름모 라인을 생성한다.
  459. var line1 = "xforms:line";
  460. ctrlID = line1 + (controlCnt++);
  461. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + marginX + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 0 + "px; border-width:3");
  462. ctrlID = line1 + (controlCnt++);
  463. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 120 + "px; x2:" + marginX + "px; y2:" + 60+ "px; border-width:3");
  464. ctrlID = line1 + (controlCnt++);
  465. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+290) + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 120 + "px; border-width:3");
  466. ctrlID = line1 + (controlCnt++);
  467. ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 0 + "px; x2:" + (marginX+290) + "px; y2:" + 60 + "px; border-width:3");
  468. //시작, 스텝여부를 표시한다.
  469. if(kind == "S" || kind == "E"){
  470. fChangeSelectCntl("#ff9900", txtctrl);
  471. }
  472. //day 정보를 표시한다.
  473. if(times != ""){
  474. var leftPos = 270;
  475. var topPos = 52;
  476. var cntl;
  477. var ctrlType = "xforms:img";
  478. var ctrlID = ctrlType + (controlCnt++);
  479. ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + 66 + "; top:" + 51 + "; width:20px; height:20px; background-stretch:stretch;");
  480. ctrlType = "xforms:caption";
  481. ctrlID = ctrlType + (controlCnt++);
  482. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + 66 + "; top:" + 52 + "; width:30px; height:20px; font-size:8pt; font-weight:bolder;");
  483. cntl.attribute("text") = "D" + times;
  484. }
  485. //서식존재 여부를 표시한다.
  486. if(model.getValue(stepRef + "[" + i + "]/formexistyn") != "Y"){
  487. var leftPos = 330;
  488. var topPos = 52;
  489. var cntl;
  490. var ctrlType = "xforms:img";
  491. var ctrlID = ctrlType + (controlCnt++);
  492. ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/input_s_essential.gif; left:" + leftPos + "; top:" + topPos + "; width:10px; height:10px; background-stretch:stretch;");
  493. }
  494. } else if( flag == "A" || flag == "B" ) {
  495. //액션, 브런치 그리드를 생성한다.
  496. var text2 = "xforms:textarea";
  497. ctrlID = text2 + (controlCnt++);
  498. 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; ");
  499. ctrl.attribute("onmousedown") = "fPopupMenuEvent()";
  500. ctrl.attribute("xforms-value-changed") = "fSetMemo()";
  501. ctrl.attribute("DOMFocusIn") = "fFocusIn()";
  502. //ctrl.attribute("DOMFocusOut") = "fFocusOut()";
  503. ctrl.attribute("onmouseover") = "fMouseOverEvent()";
  504. //시작, 스텝여부를 표시한다.
  505. if(kind == "S" || kind == "E"){
  506. fChangeSelectCntl("#ff9900", ctrl);
  507. }
  508. //day 정보를 표시한다.
  509. if(times != ""){
  510. var leftPos =308;
  511. var topPos = 1;
  512. var cntl;
  513. var ctrlType = "xforms:img";
  514. var ctrlID = ctrlType + (controlCnt++);
  515. ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + 32 + "; top:" + 0 + "; width:20px; height:20px; background-stretch:stretch;");
  516. ctrlType = "xforms:caption";
  517. ctrlID = ctrlType + (controlCnt++);
  518. cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + 32 + "; top:" + 1 + "; width:30px; height:20px; font-size:8pt; font-weight:bolder;");
  519. cntl.attribute("text") = "D" + times;
  520. }
  521. //서식존재 여부를 표시한다.
  522. if(model.getValue(stepRef + "[" + i + "]/formexistyn") != "Y"){
  523. var leftPos =330;
  524. var topPos = 1;
  525. var cntl;
  526. var ctrlType = "xforms:img";
  527. var ctrlID = ctrlType + (controlCnt++);
  528. ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/input_s_essential.gif; left:" + leftPos + "; top:" + topPos + "; width:10px; height:10px; background-stretch:stretch;");
  529. }
  530. }
  531. ctrl.refresh();
  532. }
  533. // 라인 연결 재설정
  534. for(var i=1; i<=stepCnt ; i++){
  535. var cntlKind = model.getValue( stepRef + "[" + i + "]/stepflagcd");
  536. var cntlno = model.getValue( stepRef + "[" + i + "]/stepno");
  537. if( cntlKind == "D" ) {
  538. var dcsnstep = instance1.selectSingleNode( stepRef + "[" + i + "]/dcsnstep");
  539. nodeList = instance1.selectNodes(dcsRef);
  540. dcsCntlCnt = nodeList.length;
  541. for(var k=0; k<dcsCntlCnt; k++){
  542. var node = nodeList.item(k);
  543. var stepNode = node.selectSingleNode("stepno");
  544. var lnkNode = node.selectSingleNode("lnkstepno");
  545. if( !isNull(lnkNode.text) && cntlno == stepNode.value ){
  546. if( dcsnstep != null ){
  547. if( !isNull(dcsnstep.text) && dcsnstep.text == lnkNode.text)
  548. fCreateControl_Line( stepNode.text, lnkNode.text, "red" );
  549. else
  550. fCreateControl_Line( stepNode.text, lnkNode.text );
  551. } else {
  552. fCreateControl_Line( stepNode.text, lnkNode.text );
  553. }
  554. }
  555. }
  556. dcsCntlCnt++;
  557. } else {
  558. var lnkno = model.getValue( stepRef + "[" + i + "]/lnkstepno");
  559. if( !isNull(lnkno) ){
  560. fCreateControl_Line( cntlno, lnkno );
  561. }
  562. }
  563. }
  564. }
  565. /**
  566. * @group :
  567. * @ver : 2007.07
  568. * @by : 전지은
  569. * @---------------------------------------------------
  570. * @type : function
  571. * @access : public
  572. * @desc : 컨트롤간의 연결라인을 그려준다.
  573. * @param : cntlno, lnkno
  574. * @return :
  575. * @---------------------------------------------------
  576. */
  577. function fCreateControl_Line( cntlno, lnkno, color ){
  578. currentStepCntl = document.controls("xforms:group" + (parseInt(cntlno)-1) );
  579. prevStepCntl = document.controls("xforms:group" + (parseInt(lnkno)-1) );
  580. var frXPoint = parseInt(currentStepCntl.attribute("left")) + (parseInt(currentStepCntl.attribute("width")) / 2 ) -15;
  581. var frYPoint = parseInt(currentStepCntl.attribute("top")) + parseInt(currentStepCntl.attribute("height"));
  582. var toXPoint = parseInt(prevStepCntl.attribute("left")) + (parseInt(prevStepCntl.attribute("width")) / 2 ) -15;
  583. var toYPoint = parseInt(prevStepCntl.attribute("top"));
  584. ctrlID = "xforms:line" + (controlCnt++);
  585. var ctrl = grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:3;");
  586. if(color == "red"){
  587. ctrl.attribute("border-color") = "#ff0000";
  588. }
  589. swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
  590. prevStepCntl = null;
  591. currentStepCntl = null;
  592. ctrl.refresh();
  593. }
  594. /**
  595. * @group :
  596. * @ver : 2007.07
  597. * @by : 전지은
  598. * @---------------------------------------------------
  599. * @type : function
  600. * @access : public
  601. * @desc : 하위 스텝을 선택하면, 연결한다.
  602. * @param :
  603. * @return :
  604. * @---------------------------------------------------
  605. */
  606. function fSetLink(){
  607. var prntID = currentStepCntl.attribute("id");
  608. var prntControl = document.controls(prntID);
  609. prevStepCntl = prntControl; //하위
  610. //setStepLink(prntControl, null);
  611. }
  612. /**
  613. * @group :
  614. * @ver : 2007.07
  615. * @by : 전지은
  616. * @---------------------------------------------------
  617. * @type : function
  618. * @access : public
  619. * @desc : 연결 이벤트시, 목적 컨트롤을 클릭했을 경우, 해당하는 두개의 컨트롤 사이를에 라인을 생성한다.
  620. * @param : prevStepCntl, currentStepCntl
  621. * @return :
  622. * @---------------------------------------------------
  623. */
  624. function fConnectToLine(prevStepCntl, currentStepCntl){
  625. var ctrlID;
  626. var ctrl = null;
  627. //비교 대상인 두개 컨트롤 ID
  628. var prevStepCntlID = prevStepCntl.attribute("id"); //하위(자식)
  629. var currentCntlID = currentStepCntl.attribute("id"); //상위(부모)
  630. prevStepCntlID = parseInt( prevStepCntlID.substr(12, prevStepCntlID.length-12) ) + 1;
  631. currentCntlID = parseInt( currentCntlID.substr(12, currentCntlID.length-12) ) + 1;
  632. //비교 대상인 두개 컨트롤 top과 높이
  633. var prevStepCntlTop = parseInt(prevStepCntl.attribute("top"));
  634. var prevStepCntlHigh = parseInt(prevStepCntl.attribute("height"));
  635. var currentCntlTop = parseInt(currentStepCntl.attribute("top"));
  636. var currentCntlHigh = parseInt(currentStepCntl.attribute("height"));
  637. if ( prevStepCntlTop == currentCntlTop ) {
  638. //동일한 컨트롤을 선택한 경우
  639. prevStepCntl = null;
  640. return;
  641. } else {
  642. var curcntlType = model.getValue( stepRef + "[" + currentCntlID + "]/stepflagcd");
  643. var preCntlType = model.getValue( stepRef + "[" + prevStepCntlID + "]/stepflagcd");
  644. var frXPoint = parseInt(prevStepCntl.attribute("left")) + (parseInt(prevStepCntl.attribute("width")) / 2 ) -15;
  645. var toXPoint = parseInt(currentStepCntl.attribute("left")) + (parseInt(currentStepCntl.attribute("width")) / 2 ) -15;
  646. var frYPoint;
  647. var toYPoint;
  648. //하위를 먼저 클릭하고 연결을 결정한 다음, 상단을 클릭한 경우,
  649. if( prevStepCntlTop > currentCntlTop ) {
  650. frYPoint = prevStepCntlTop - 1;
  651. toYPoint = currentCntlTop + currentCntlHigh;
  652. if(curcntlType == "D"){
  653. model.setValue( stepRef + "[" + currentCntlID + "]/lnkstepno", "" );
  654. copyNodeType("/root/main/decisionlist", "/root/main/temp/decisioninfo", "after", model, model);
  655. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/stepno", model.getValue(stepRef + "[" + currentCntlID + "]/stepno"));
  656. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/lnkstepno", model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno"));
  657. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/m", "i");
  658. dcsCntlCnt++;
  659. } else {
  660. if( model.getValue(stepRef + "[" + currentCntlID + "]/lnkstepno") == "" ) {
  661. model.setValue( stepRef + "[" + currentCntlID + "]/lnkstepno" , model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno") );
  662. } else {
  663. var msg = messageBox("Action 및 Branch 스텝은 둘 이상의 하위 Step을 선택 ", "E001");
  664. return;
  665. }
  666. }
  667. //현재 스텝을 부모 스텝과 연결한다.
  668. ctrlID = "xforms:line" + (controlCnt++);
  669. grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:3;");
  670. swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
  671. //상단을 먼저 클릭하고 연결을 결정한 다음, 하위를 클릭한 경우
  672. } else if( prevStepCntlTop < currentCntlTop ) {
  673. frYPoint = prevStepCntlTop + prevStepCntlHigh - 1;
  674. toYPoint = currentCntlTop;
  675. if(preCntlType == "D"){
  676. model.setValue( stepRef + "[" + prevStepCntlID + "]/lnkstepno" , "" );
  677. copyNodeType("/root/main/decisionlist", "/root/main/temp/decisioninfo", "after", model, model);
  678. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/stepno", model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno"));
  679. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/lnkstepno", model.getValue(stepRef + "[" + currentCntlID + "]/stepno"));
  680. model.setValue(dcsRef + "[" + dcsCntlCnt + "]/m", "i");
  681. dcsCntlCnt++;
  682. } else {
  683. if( model.getValue(stepRef + "[" + prevStepCntlID + "]/lnkstepno") == "" ) {
  684. model.setValue( stepRef + "[" + prevStepCntlID + "]/lnkstepno" , model.getValue(stepRef + "[" + currentCntlID + "]/stepno") );
  685. } else {
  686. var msg = messageBox("Action 및 Branch 스텝은 둘 이상의 하위 Step을 선택 ", "E001");
  687. return;
  688. }
  689. }
  690. ctrlID = "xforms:line" + (controlCnt++);
  691. grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:3;");
  692. swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
  693. }
  694. }
  695. //prevStepCntl = null;
  696. }
  697. /**
  698. * @group :
  699. * @ver : 2007.07
  700. * @by : 전지은
  701. * @---------------------------------------------------
  702. * @type : function
  703. * @access : public
  704. * @desc : 포커스를 갖는 컨트롤의 외곽선 색상을 변경한다.
  705. * @param : lineColor, cntl
  706. * @return :
  707. * @---------------------------------------------------
  708. */
  709. function fChangeSelectCntl(lineColor, cntl){
  710. if( cntl != null ){
  711. var controlSize = cntl.attribute("width"); //175px or 290px
  712. var cntlID = cntl.attribute("id");
  713. if( controlSize == "175px" ) {
  714. var num = parseInt(cntlID.substr(15, (cntlID.length-1)))+1;
  715. var line1 = document.controls("xforms:line" + num );
  716. var line2 = document.controls("xforms:line" + (num+1) );
  717. var line3 = document.controls("xforms:line" + (num+2) );
  718. var line4 = document.controls("xforms:line" + (num+3) );
  719. line1.attribute("border-color") = lineColor;
  720. line2.attribute("border-color") = lineColor;
  721. line3.attribute("border-color") = lineColor;
  722. line4.attribute("border-color") = lineColor;
  723. } else if( controlSize == "290px" ){
  724. cntl.attribute("border-color") = lineColor;
  725. }
  726. }
  727. }
  728. /**
  729. * @group :
  730. * @ver : 2007.07
  731. * @by : 전지은
  732. * @---------------------------------------------------
  733. * @type : function
  734. * @access : public
  735. * @desc : 클릭한 지점의 영역에 해당하는 외곽선의 색상을 변경한다.
  736. * @param : flag, no
  737. * @return :
  738. * @---------------------------------------------------
  739. */
  740. function fChangeOutLineCntl(flag, no){
  741. var asLineControl = null;
  742. var str;
  743. var count = 0;
  744. if( !( selectSectionsLine[0] == "" ) && flag == "reset"){
  745. for(var i=0; i<4; i++){
  746. str = selectSectionsLine[i];
  747. if(str != ""){
  748. asLineControl = document.controls( str.substr(0, str.length-3) );
  749. asLineControl.attribute("border-color") = "#000000";
  750. asLineControl.attribute("border-width") = "1px";
  751. selectSectionsLine[i] = "";
  752. } else{
  753. return;
  754. }
  755. }
  756. } else if(flag == "select"){
  757. var lngth = swimlineControlArray.length;
  758. for(var i=0; i<lngth; i++){
  759. str = swimlineControlArray[i];
  760. if( !(str =="" || str == null) ){
  761. if( str.substr(str.length-2, 2) == "LH" ){
  762. if(no == count){
  763. str = swimlineControlArray[i];
  764. asLineControl = document.controls( str.substr(0, str.length-3) );
  765. asLineControl.attribute("border-color") = "#99ccff";
  766. asLineControl.attribute("border-width") = "3px";
  767. selectSectionsLine[0] = str;
  768. str = swimlineControlArray[i+1];
  769. asLineControl = document.controls( str.substr(0, str.length-3) );
  770. asLineControl.attribute("border-color") = "#99ccff";
  771. asLineControl.attribute("border-width") = "3px";
  772. selectSectionsLine[1] = str;
  773. str = swimlineControlArray[i+2];
  774. asLineControl = document.controls( str.substr(0, str.length-3) );
  775. asLineControl.attribute("border-color") = "#99ccff";
  776. asLineControl.attribute("border-width") = "3px";
  777. selectSectionsLine[2] = str;
  778. str = swimlineControlArray[i-1];
  779. asLineControl = document.controls( str.substr(0, str.length-3) );
  780. asLineControl.attribute("border-color") = "#99ccff";
  781. asLineControl.attribute("border-width") = "3px";
  782. selectSectionsLine[3] = str;
  783. return;
  784. }
  785. count++;
  786. }
  787. }
  788. }
  789. }
  790. }
  791. /**
  792. * @group :
  793. * @ver : 2007.07
  794. * @by : 전지은
  795. * @---------------------------------------------------
  796. * @type : function
  797. * @access : public
  798. * @desc : textarea 의 오른쪽 마우스 버튼 이벤트 생성(팝업메뉴 허용 이벤트)
  799. * @param :
  800. * @return :
  801. * @---------------------------------------------------
  802. */
  803. function fPopupMenuEvent(curStepCntl){
  804. if( isNull(curStepCntl) ){
  805. var ctrl = null;
  806. ctrl = (event.target);
  807. var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
  808. var id = selControl.parent.attribute("id");
  809. currentStepCntl = document.controls(id); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
  810. }else{
  811. currentStepCntl = document.controls(curStepCntl); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
  812. }
  813. var curID = currentStepCntl.attribute("id");
  814. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  815. opener.model.setValue( "/root/main/stepinfo/info/stepno", model.getValue(stepRef + "[" + curNo + "]/stepno") );
  816. opener.model.setValue( "/root/main/stepinfo/info/times", model.getValue(stepRef + "[" + curNo + "]/times") );
  817. opener.ipt_times.refresh();
  818. opener.model.setValue( "/root/main/stepinfo/info/stepnm", model.getValue(stepRef + "[" + curNo + "]/stepnm") );
  819. opener.ipt_stepnm.refresh();
  820. opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo + "]/stepmemo") );
  821. opener.tar_stepmemo.refresh();
  822. model.setValue("/root/main/temp/selectedstep/stepno", model.getValue(stepRef + "[" + curNo + "]/stepno"));
  823. model.setValue("/root/main/temp/selectedstep/stepflagcd", model.getValue(stepRef + "[" + curNo + "]/stepflagcd"));
  824. opener.model.setValue( "/root/main/stepinfo/info/stepflagcd", model.getValue(stepRef + "[" + curNo + "]/stepflagcd"));
  825. opener.model.setValue( "/root/main/stepinfo/info/setno", model.getValue(stepRef + "[" + curNo + "]/setno"));
  826. if(event.button == 3){
  827. event.preventDefault();
  828. if(opener.window.javascript.OpenerKind != "GPS"){
  829. window.setPopupMenu(true, "/root/main/outlineinfo/popupmenu/item", "name", "func", false);
  830. }else {
  831. if( model.getValue(stepRef + "[" + curNo + "]/stepflagcd") == "D"){
  832. window.setPopupMenu(true, "/root/main/outlineinfo/popupmenu/item3", "name", "func", false);
  833. }
  834. }
  835. }
  836. }
  837. /**
  838. * @group :
  839. * @ver : 2007.07
  840. * @by : 전지은
  841. * @---------------------------------------------------
  842. * @type : function
  843. * @access : public
  844. * @desc :
  845. * @param :
  846. * @return :
  847. * @---------------------------------------------------
  848. */
  849. function fFocusOut(){
  850. window.setPopupMenu(false);
  851. }
  852. /**
  853. * @group :
  854. * @ver : 2007.07
  855. * @by : 전지은
  856. * @---------------------------------------------------
  857. * @type : function
  858. * @access : public
  859. * @desc :
  860. * @param :
  861. * @return :
  862. * @---------------------------------------------------
  863. */
  864. function fFocusIn(){
  865. changedCntl = currentStepCntl;
  866. }
  867. /**
  868. * @group :
  869. * @ver : 2007.07
  870. * @by : 전지은
  871. * @---------------------------------------------------
  872. * @type : function
  873. * @access : public
  874. * @desc : 스텝 안의 내용을 처음 입력하거나 변경하면, Opener의 memo 란에 내용이 함께 반영된다.
  875. * @param :
  876. * @return :
  877. * @---------------------------------------------------
  878. */
  879. function fSetMemo(){
  880. //현재 선택된 스텝이 아니라, 이전에 선택되어 수정된 스텝의 내용을 반영해야 함.
  881. //var curID = currentStepCntl.attribute("id");
  882. var curID = changedCntl.attribute("id");
  883. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  884. opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo + "]/stepmemo") );
  885. opener.tar_stepmemo.refresh();
  886. if(model.getValue(stepRef + "[" + curNo + "]/m") != "i"){
  887. model.setValue(stepRef + "[" + curNo + "]/m", "u");
  888. }
  889. }
  890. /**
  891. * @group :
  892. * @ver : 2007.07
  893. * @by : 전지은
  894. * @---------------------------------------------------
  895. * @type : function
  896. * @access : public
  897. * @desc : 연결설정 모드일 경우, 컨트롤에 마우스를 over 하면 마우스 커서가 바뀐다.
  898. * @param :
  899. * @return :
  900. * @---------------------------------------------------
  901. */
  902. function fMouseOverEvent(){
  903. ctrl = (event.target);
  904. var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
  905. if(connectionMode == "true"){
  906. selControl.attribute("cursor ") = "pointer";
  907. } else {
  908. selControl.attribute("cursor ") = "default";
  909. }
  910. }
  911. /**
  912. * @group :
  913. * @ver : 2007.07
  914. * @by : 전지은
  915. * @---------------------------------------------------
  916. * @type : function
  917. * @access : public
  918. * @desc : 선택한 지점에 스임라인을 추가한다.
  919. * @param :
  920. * @return :
  921. * @---------------------------------------------------
  922. */
  923. function fAddSwimLine(){
  924. if( selectedLineSection != "" ){
  925. var trgline;
  926. var trgStepNo;
  927. //스윔라인을 추가한다.
  928. var y = parseInt(lineNo) * swimLineHight;
  929. var cy = y + swimLineHight;
  930. var lngth = swimlineControlArray.length - 1;
  931. //아웃라인을 제외한 나머지 컨트롤을 삭제
  932. for(var i=outsideControlCnt; i<=lngth; i++){
  933. var cntlID = swimlineControlArray[i];
  934. if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
  935. cntlID = cntlID.substr(0, cntlID.length-3);
  936. }
  937. grp_swimline.removeChild(cntlID);
  938. swimlineControlArray[i] = "";
  939. }
  940. swimlineControlArray.slice(0, outsideControlCnt);
  941. controlCnt = outsideControlCnt;
  942. fCreateSwimLine(y, cy);
  943. lineNo = parseInt(lineNo) + 1;
  944. model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo);
  945. opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
  946. opener.ipt_swimlineno.refresh();
  947. //배열 인덱스를 하나 더 생성
  948. linesControlMaxCnt[linesControlMaxCnt.length] = 0;
  949. if( lineNo != parseInt(selectedLineSection)+1 ){
  950. for(var i=1; i<=grpControlCnt; i++ ){
  951. trgline = model.getValue(stepRef + "[" + i + "]/swimlineno");
  952. trgStepNo = model.getValue(stepRef + "[" + i + "]/stepno");
  953. if( trgline > selectedLineSection ){
  954. model.setValue( stepRef + "[" + i + "]/swimlineno", parseInt(trgline)+1 );
  955. }
  956. }
  957. var start = parseInt(selectedLineSection)-1;
  958. var end = linesControlMaxCnt.length-1;
  959. var a = linesControlMaxCnt.slice(0, selectedLineSection);
  960. var b = linesControlMaxCnt.slice(selectedLineSection, end);
  961. var c = linesControlMaxCnt[linesControlMaxCnt.length-1];
  962. linesControlMaxCnt.slice(0, linesControlMaxCnt.length);
  963. linesControlMaxCnt = a.concat(c, b);
  964. //추가할 라인의 바로 윗줄 스텝의 연결번호를 지운다.
  965. var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + selectedLineSection + "']");
  966. for(var i= 0; i<nodeList.length; i++){
  967. var node = nodeList.item(i);
  968. var lnkNode = node.selectSingleNode("lnkstepno");
  969. model.setValue(lnkNode, "");
  970. lnkNode = node.selectSingleNode("stepno");
  971. var stepNo = model.getValue(lnkNode);
  972. model.removeNodeset(dcsRef + "[stepno = '" + stepNo + "']");
  973. }
  974. nodeList = instance1.selectNodes(dcsRef);
  975. dcsCntlCnt = nodeList.length + 1;
  976. }
  977. fCreateControl();
  978. selectedControl = null;
  979. currentStepCntl = null;
  980. prevStepCntl = null;
  981. //selectedLineSection = "";
  982. }else {
  983. return;
  984. }
  985. }
  986. /**
  987. * @group :
  988. * @ver : 2007.07
  989. * @by : 전지은
  990. * @---------------------------------------------------
  991. * @type : function
  992. * @access : public
  993. * @desc : 컨트롤이나 스윔라인을 삭제한다.
  994. * @param :
  995. * @return :
  996. * @---------------------------------------------------
  997. */
  998. function fDelCntl(){
  999. var header = "supsetno▦deptcd▦updtdd▦updttm▦setno▦settypecd▦m▩";
  1000. var delSetInfoCSV = "";
  1001. if( selectedLineSection != "" ){
  1002. //스윔라인을 삭제한다.
  1003. //fDelSwimLine( selectedLineSection );
  1004. var nodeList = instance1.selectNodes(stepRef + "[stepno = '" + selectedLineSection + "' and setno != '']");
  1005. if(nodeList.length >= 1){
  1006. var msg = messageBox("저장된 처방 Set 내용이 존재합니다. \n Step을 삭제하면 처방 정보도 함께 삭제됩니다. \n 정말로 ", "Q001");
  1007. if(msg == 6){
  1008. //yes
  1009. for(var i= 0; i<nodeList.length; i++){
  1010. var node = nodeList.item(i);
  1011. var deptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
  1012. var setno = node.selectSingleNode("setno");
  1013. if(cpgflagcd == "01" || cpgflagcd == "W"){
  1014. var settypecd = "W";
  1015. } else if(cpgflagcd == "02" || cpgflagcd == "G"){
  1016. var settypecd = "G";
  1017. }
  1018. delSetInfoCSV = delSetInfoCSV + "1▦"+deptcd+"▦OOOOOOOO▦OOOO▦"+setno+"▦"+settypecd+"▦d▩";
  1019. }
  1020. ivw_detail.window.javascript.delPrmsPrcpSetInfo(header+delSetInfoCSV);
  1021. fDelStep("L", selectedLineSection);
  1022. opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
  1023. opener.ipt_swimlineno.refresh();
  1024. } else if(msg == 7) {
  1025. return false;
  1026. }
  1027. } else {
  1028. fDelStep("L", selectedLineSection);
  1029. opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
  1030. opener.ipt_swimlineno.refresh();
  1031. }
  1032. }else {
  1033. //스텝 컨트롤을 삭제한다.
  1034. var curID = currentStepCntl.attribute("id");
  1035. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1036. if( model.getValue( stepRef + "[" + curNo + "]/setno" ) != "" ){
  1037. var msg = messageBox("저장된 처방 Set 내용이 존재합니다. \n Step을 삭제하면 처방 정보도 함께 삭제됩니다. \n 정말로 ", "Q001");
  1038. if(msg == 6){
  1039. //yes
  1040. var nodeList = instance1.selectNodes(stepRef + "[" + curNo + "]");
  1041. var deptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
  1042. var setno = model.getValue(stepRef + "[" + curNo + "]/setno");
  1043. if(cpgflagcd == "01" || cpgflagcd == "W"){
  1044. var settypecd = "W";
  1045. } else if(cpgflagcd == "02" || cpgflagcd == "G"){
  1046. var settypecd = "G";
  1047. }
  1048. delSetInfoCSV = "1▦"+deptcd+"▦OOOOOOOO▦OOOO▦"+setno+"▦"+settypecd+"▦d▩";
  1049. ivw_detail.window.javascript.delPrmsPrcpSetInfo(header+delSetInfoCSV);
  1050. fDelStep("C");
  1051. } else if(msg == 7) {
  1052. return false;
  1053. }
  1054. } else {
  1055. fDelStep("C");
  1056. }
  1057. // ★ selectedControl 과 동일하다면 selectedControl를 null 로 셋팅한다.
  1058. // selectedControl = null;
  1059. }
  1060. }
  1061. /**
  1062. * @group :
  1063. * @ver : 2007.07
  1064. * @by : 전지은
  1065. * @---------------------------------------------------
  1066. * @type : function
  1067. * @access : public
  1068. * @desc : 스윔라인을 삭제한다.
  1069. * @param :
  1070. * @return :
  1071. * @---------------------------------------------------
  1072. */
  1073. function fDelSwimLine(){
  1074. fDelStep("L", selectedLineSection);
  1075. opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
  1076. opener.ipt_swimlineno.refresh();
  1077. }
  1078. /**
  1079. * @group :
  1080. * @ver : 2007.07
  1081. * @by : 전지은
  1082. * @---------------------------------------------------
  1083. * @type : function
  1084. * @access : public
  1085. * @desc : 스텝 컨트롤을 삭제한다.
  1086. * @param : flag, no
  1087. * @return :
  1088. * @---------------------------------------------------
  1089. */
  1090. function fDelStep(flag, no){
  1091. if(flag == "C"){
  1092. var curID = currentStepCntl.attribute("id");
  1093. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1094. var lineNumber = parseInt( model.getValue( stepRef + "[" + curNo + "]/swimlineno" ) );
  1095. var stepRefSeq = parseInt( model.getValue( stepRef + "[" + curNo + "]/refseq" ) );
  1096. //삭제하려는 라인이 최대갯수의 컨트롤을 갖는 줄이라면, 스윔라인 길이 축소
  1097. if(maxControlCnt > 2 && maxControlCnt == linesControlMaxCnt[lineNumber-1]){
  1098. fAdjustLine("re", "392");
  1099. maxControlCnt--;
  1100. }
  1101. //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
  1102. var nodeList = instance1.selectNodes(stepRef + "[stepno = '" + curNo + "']");
  1103. for(var i= 0; i<nodeList.length; i++){
  1104. var node = nodeList.item(i);
  1105. var iNode = node.selectSingleNode("m");
  1106. if(iNode.text != "i"){
  1107. var destNodeList = instance1.selectNodes("/root/temp/delsteplist");
  1108. var stepNode = model.getValue(node.selectSingleNode("stepno"));
  1109. model.setValue(iNode, "d");
  1110. model.makeNode("/root/temp/delsteplist/info[" + (destNodeList.length) + "]");
  1111. model.copyNode("/root/temp/delsteplist/info[" + (destNodeList.length) + "]", stepRef + "[" + stepNode + "]");
  1112. }
  1113. }
  1114. //opener.window.javascript.fSaveStepInfo();
  1115. //선택된 스텝에 연결된 모든 라인을 없댄다.(하위스텝번호를 없앤다)
  1116. fDelLink( curNo );
  1117. model.removeNodeset(stepRef + "[stepno = '" + curNo + "']");
  1118. grpControlCnt = grpControlCnt -1;
  1119. for(var i=curNo; i<=grpControlCnt; i++){
  1120. var iSwimlineno = parseInt(model.getValue(stepRef + "[" + i + "]/swimlineno"));
  1121. var iRefseq = parseInt(model.getValue(stepRef + "[" + i + "]/refseq"));
  1122. var iStepno = model.getValue(stepRef + "[" + i + "]/stepno");
  1123. if( lineNumber == iSwimlineno && stepRefSeq < iRefseq ){
  1124. //삭제된 컨트롤과 같은 스윔라인에 존재하는 다음 컨트롤들은 라인당 컨트롤 순번도 -1 씩 감소한다.
  1125. model.setValue( stepRef + "[" + i + "]/refseq", parseInt( iRefseq ) - 1 );
  1126. }
  1127. for(var k=1; k<i; k++){
  1128. if( iStepno == model.getValue(stepRef + "[" + k + "]/lnkstepno") )
  1129. model.setValue( stepRef + "[" + k + "]/lnkstepno", i );
  1130. }
  1131. if( (iStepno > curNo) ){
  1132. nodeList = instance1.selectNodes(dcsRef + "[lnkstepno = '" + iStepno + "']");
  1133. for(var k= 0; k<nodeList.length; k++){
  1134. var node = nodeList.item(k);
  1135. var iNode = node.selectSingleNode("lnkstepno");
  1136. model.setValue(iNode, i);
  1137. }
  1138. model.setValue( stepRef + "[" + i + "]/stepno", parseInt(iStepno)-1 );
  1139. nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + iStepno + "']");
  1140. for(var k= 0; k<nodeList.length; k++){
  1141. var node = nodeList.item(k);
  1142. var iNode = node.selectSingleNode("stepno");
  1143. model.setValue(iNode, i);
  1144. }
  1145. }
  1146. }
  1147. linesControlMaxCnt[lineNumber-1] = linesControlMaxCnt[lineNumber-1] - 1;
  1148. currentStepCntl = null;
  1149. }else if(flag == "L"){
  1150. var org_CurrentStepCntl = currentStepCntl;
  1151. var org_SelectedLineSection = selectedLineSection;
  1152. var delNodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + no + "']");
  1153. for(var i=0; i<delNodeList.length; i++){
  1154. var dstNode = delNodeList.item(i);
  1155. var dstFcsNode = dstNode.selectSingleNode("stepno");
  1156. var curNo = model.getValue(dstFcsNode);
  1157. //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
  1158. var iNode = dstNode.selectSingleNode("m");
  1159. if(iNode.text != "i"){
  1160. var destNodeList = instance1.selectNodes("/root/temp/delsteplist");
  1161. var stepNode = model.getValue(dstFcsNode);
  1162. model.setValue(iNode, "d");
  1163. model.makeNode("/root/temp/delsteplist/info[" + (destNodeList.length) + "]");
  1164. model.copyNode("/root/temp/delsteplist/info[" + (destNodeList.length) + "]", stepRef + "[" + stepNode + "]");
  1165. }
  1166. fDelLink( curNo );
  1167. }
  1168. model.removeNodeset (stepRef + "[swimlineno = '" + no + "']");
  1169. var nodeList = instance1.selectNodes(stepRef);
  1170. for(var i= 0; i<nodeList.length; i++){
  1171. var dstNode = nodeList.item(i);
  1172. }
  1173. var a = linesControlMaxCnt.slice(0, parseInt(no)-1);
  1174. var b = linesControlMaxCnt.slice(no, linesControlMaxCnt.length);
  1175. linesControlMaxCnt = new Array();
  1176. linesControlMaxCnt = a.concat(b);
  1177. grpControlCnt = grpControlCnt - delNodeList.length;
  1178. var nodeList = instance1.selectNodes(stepRef + "[swimlineno > '" + no + "']");
  1179. for(var i= 0; i<nodeList.length; i++){
  1180. var dstNode = nodeList.item(i);
  1181. var dstFcsNode = dstNode.selectSingleNode("swimlineno");
  1182. model.setValue(dstFcsNode, parseInt(model.getValue(dstFcsNode)) - 1);
  1183. dstFcsNode = dstNode.selectSingleNode("stepno");
  1184. model.setValue( dstFcsNode, parseInt(model.getValue(dstFcsNode))-delNodeList.length );
  1185. }
  1186. //마지막 스윔라인을 삭제한다.
  1187. fDelLastSwimLine();
  1188. lineNo--;
  1189. model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo); //총 스윔라인 수
  1190. if(org_SelectedLineSection > lineNo){
  1191. selectedLineSection = "";
  1192. currentStepCntl = null;
  1193. selectSectionsLine[0] = "";
  1194. selectSectionsLine[1] = "";
  1195. selectSectionsLine[2] = "";
  1196. selectSectionsLine[3] = "";
  1197. fChangeOutLineCntl("reset", lineNo);
  1198. }else if( org_SelectedLineSection <= lineNo ){
  1199. currentStepCntl = org_CurrentStepCntl;
  1200. selectedLineSection = org_SelectedLineSection;
  1201. }
  1202. }
  1203. fCreateControl();
  1204. selectedControl = null;
  1205. prevStepCntl = null;
  1206. //alert("selectedLineSection = " + selectedLineSection + " currentStepCntl = " + currentStepCntl.attribute("id"));
  1207. }
  1208. /**
  1209. * @group :
  1210. * @ver : 2007.07
  1211. * @by : 전지은
  1212. * @---------------------------------------------------
  1213. * @type : function
  1214. * @access : public
  1215. * @desc : 컨트롤(인스턴스)을 삭제했다면, 다음 스텝번호들의 시퀀스를 -1 씩 감소시킨다.
  1216. * @param : stepNo, lineNo
  1217. * @return :
  1218. * @---------------------------------------------------
  1219. */
  1220. function fResetSeq(stepNo, lineNo){
  1221. var end = grpControlCnt.length;
  1222. for(var i=stepNo; i<=end; i++){
  1223. var curcntlType = model.getValue( stepRef + "[" + i + "]/stepflagcd");
  1224. if( model.getValue(stepRef + "[" + i + "]/swimlineno") == lineNo ){
  1225. //삭제된 컨트롤과 같은 스윔라인에 존재하는 다음 컨트롤들은 라인당 컨트롤 순번도 -1 씩 감소한다.
  1226. model.setValue( stepRef + "[" + i + "]/refseq", parseInt( model.getValue(stepRef + "[" + i + "]/refseq") ) - 1 );
  1227. }else if( model.getValue(stepRef + "[" + i + "]/swimlineno") > lineNo ){
  1228. for(var k=1; k<i; k++){
  1229. if( model.getValue( stepRef + "[" + i + "]/stepno") == model.getValue(stepRef + "[" + k + "]/lnkstepno") )
  1230. model.setValue( stepRef + "[" + k + "]/lnkstepno", i );
  1231. }
  1232. }
  1233. model.setValue( stepRef + "[" + i + "]/stepno", i-1 );
  1234. }
  1235. }
  1236. /**
  1237. * @group :
  1238. * @ver : 2007.07
  1239. * @by : 전지은
  1240. * @---------------------------------------------------
  1241. * @type : function
  1242. * @access : public
  1243. * @desc : 컨트롤을 연결하는 연결선을 삭제한다.
  1244. * @param : trgNo
  1245. * @return :
  1246. * @---------------------------------------------------
  1247. */
  1248. function fDelLink( trgNo ){
  1249. //현재 컨트롤의 인스턴스에서 lnkstepno 를 삭제한 후, fCreateControl() 를 호출한다.
  1250. if( isNull(trgNo) ){
  1251. var curID = currentStepCntl.attribute("id");
  1252. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1253. } else {
  1254. var curNo = trgNo;
  1255. }
  1256. var type = model.getValue( stepRef + "[" + curNo + "]/stepflagcd" );
  1257. var cntlNo = model.getValue( stepRef + "[" + curNo + "]/stepno");
  1258. //1. 선택한 스텝의 하위 스텝과의 연결을 해제한다.
  1259. if( type == "D"){
  1260. //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
  1261. var nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + curNo + "']");
  1262. for(var i= 0; i<nodeList.length; i++){
  1263. var node = nodeList.item(i);
  1264. var iNode = node.selectSingleNode("m");
  1265. if(iNode.text != "i"){
  1266. var destNodeList = instance1.selectNodes("/root/temp/deldecisionlist");
  1267. var stepNode = model.getValue(node.selectSingleNode("stepno"));
  1268. model.setValue(iNode, "d");
  1269. model.makeNode("/root/temp/deldecisionlist/info[" + (destNodeList.length) + "]");
  1270. model.copyNode("/root/temp/deldecisionlist/info[" + (destNodeList.length) + "]", dcsRef + "[" + stepNode + "]");
  1271. }
  1272. }
  1273. model.removeNodeset(dcsRef + "[stepno = '" + curNo + "']");
  1274. } else {
  1275. //"A"나 "B"는 해당노드의 lnkstepno만 비워준다.
  1276. model.setValue( stepRef + "[" + curNo + "]/lnkstepno", "" );
  1277. if( model.getValue( stepRef + "[" + curNo + "]/m") != "i"){
  1278. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  1279. //swimlineControlArray[curNo-1] = "";
  1280. }
  1281. }
  1282. //2. 선택한 스텝의 상위 스텝과의 연결을 해제한다.
  1283. var nodeList = instance1.selectNodes(stepRef + "[lnkstepno = '" + curNo + "']");
  1284. for(var i= 0; i<nodeList.length; i++){
  1285. var dstNode = nodeList.item(i);
  1286. var iNode = dstNode.selectSingleNode("lnkstepno");
  1287. model.setValue( iNode, "" );
  1288. iNode = dstNode.selectSingleNode("m");
  1289. if(iNode.text != "i"){
  1290. model.setValue( iNode, "u" );
  1291. }
  1292. }
  1293. //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
  1294. var nodeList = instance1.selectNodes(dcsRef + "[lnkstepno = '" + curNo + "']");
  1295. for(var i= 0; i<nodeList.length; i++){
  1296. var node = nodeList.item(i);
  1297. var iNode = node.selectSingleNode("m");
  1298. if(iNode.text != "i"){
  1299. var destNodeList = instance1.selectNodes("/root/temp/deldecisionlist");
  1300. var stepNode = model.getValue(node.selectSingleNode("stepno"));
  1301. model.setValue(iNode, "d");
  1302. model.makeNode("/root/temp/deldecisionlist/info[" + (destNodeList.length) + "]");
  1303. model.copyNode("/root/temp/deldecisionlist/info[" + (destNodeList.length) + "]", dcsRef + "[" + stepNode + "]");
  1304. }
  1305. }
  1306. model.removeNodeset(dcsRef + "[lnkstepno = '" + curNo + "']");
  1307. nodeList = instance1.selectNodes(dcsRef);
  1308. dcsCntlCnt = nodeList.length + 1;
  1309. //오른쪽 버튼의 연결삭제를 선택한 경우
  1310. if( isNull(trgNo) ){
  1311. //controlCnt = initControlCnt;
  1312. fCreateControl();
  1313. }
  1314. selectedControl = null;
  1315. currentStepCntl = null;
  1316. prevStepCntl = null;
  1317. selectedLineSection = "";
  1318. }
  1319. /**
  1320. * @group :
  1321. * @ver : 2007.07
  1322. * @by : 전지은
  1323. * @---------------------------------------------------
  1324. * @type : function
  1325. * @access : public
  1326. * @desc : 시작 스텝으로 설정한다.
  1327. * @param :
  1328. * @return :
  1329. * @---------------------------------------------------
  1330. */
  1331. function fSetStartStep(){
  1332. var curID = currentStepCntl.attribute("id");
  1333. fChildrenCtrlToSelCtrl(curID, "S");
  1334. }
  1335. /**
  1336. * @group :
  1337. * @ver : 2007.07
  1338. * @by : 전지은
  1339. * @---------------------------------------------------
  1340. * @type : function
  1341. * @access : public
  1342. * @desc : 종료 스텝으로 설정한다.
  1343. * @param :
  1344. * @return :
  1345. * @---------------------------------------------------
  1346. */
  1347. function fSetEndStep(){
  1348. var curID = currentStepCntl.attribute("id");
  1349. fChildrenCtrlToSelCtrl(curID, "E");
  1350. }
  1351. /**
  1352. * @group :
  1353. * @ver : 2007.07
  1354. * @by : 전지은
  1355. * @---------------------------------------------------
  1356. * @type : function
  1357. * @access : public
  1358. * @desc : Day 이미지를 생성한다.
  1359. * @param :
  1360. * @return :
  1361. * @---------------------------------------------------
  1362. */
  1363. function fSetDayImage(stepno, days){
  1364. var curID = currentStepCntl.attribute("id");
  1365. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1366. var type = model.getValue( stepRef + "[" + curNo + "]/stepflagcd" );
  1367. var times = model.getValue( stepRef + "[" + curNo + "]/times" );
  1368. var no = parseInt(stepno)-1;
  1369. if(days != ""){
  1370. if(type == "D"){
  1371. var leftPos = 66; //200
  1372. var topPos = 51; //51
  1373. } else {
  1374. var leftPos = 32; //308
  1375. var topPos =0; //1
  1376. }
  1377. var cntl;
  1378. var ctrlType = "xforms:img";
  1379. var ctrlID = ctrlType + (controlCnt++);
  1380. currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + leftPos + "; top:" + topPos + "; width:20px; height:20px; background-stretch:stretch;");
  1381. ctrlType = "xforms:caption";
  1382. ctrlID = ctrlType + (controlCnt++);
  1383. cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + (topPos+1) + "; width:30px; height:20px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
  1384. cntl.attribute("text") = "D" + days;
  1385. } else{
  1386. fCreateControl();
  1387. curID = "xforms:group" + no;
  1388. fChildrenCtrlToSelCtrl(curID);
  1389. }
  1390. if( model.getValue(stepRef + "[" + stepno + "]/m") != "i" ){
  1391. model.setValue( stepRef + "[" + stepno + "]/m", "u" );
  1392. }
  1393. }
  1394. /**
  1395. * @group :
  1396. * @ver : 2007.07
  1397. * @by : 전지은
  1398. * @---------------------------------------------------
  1399. * @type : function
  1400. * @access : public
  1401. * @desc : Detail 정보를 조회, 저장한다.
  1402. * @param :
  1403. * @return :
  1404. * @---------------------------------------------------
  1405. */
  1406. function fViewDetailInfo(OpenerKind){
  1407. if( allInfoSave() ){
  1408. //opener.window.javascript.fSizeControl();
  1409. if(cpgflagcd == "01" || cpgflagcd == "W"){
  1410. model.setValue("/root/main/outlineinfo/info/cpgflagcd", "W");
  1411. } else if(cpgflagcd == "02" || cpgflagcd == "G"){
  1412. model.setValue("/root/main/outlineinfo/info/cpgflagcd", "G");
  1413. }
  1414. var nodeList = instance1.selectNodes(stepRef);
  1415. var csv = getNodeListCSV(nodeList);
  1416. model.setValue("/root/main/temp/selectedstep/csvlist", csv);
  1417. //액션뷰를 클릭할 시, 수행하는 기능 없음!!!
  1418. if(opener.btn_action_tab.selected == true){
  1419. grp_swimline.vscroll.attribute("pos") = "0";
  1420. grp_swimline.hscroll.attribute("pos") = "0";
  1421. if( currentStepCntl == null && grpControlCnt == 0 && OpenerKind != "GPS" ){
  1422. var msg = messageBox("스텝을 ", "C002");
  1423. return;
  1424. }else{
  1425. if(currentStepCntl == null && grpControlCnt > 0){
  1426. currentStepCntl = document.controls("xforms:group0");
  1427. model.setValue("/root/main/temp/selectedstep/stepno", model.getValue(stepRef + "[1]/stepno"));
  1428. model.setValue("/root/main/temp/selectedstep/stepflagcd", model.getValue(stepRef + "[1]/stepflagcd"));
  1429. }
  1430. grp_swimline.attribute("overflow") = "hidden";
  1431. opener.cap_outlineinfo.attribute("text") = "Action 정보";
  1432. var setno = null;
  1433. var selectedDay = null;
  1434. var saveStatus = null;
  1435. var nodelist = null;
  1436. if(OpenerKind == "GPS"){
  1437. OutLinesOpenerKind = OpenerKind;
  1438. /*
  1439. //DetailView -> actionView
  1440. if( ivw_detail.attribute("src") == "../../../emr/prcpmngtweb/xrw/SPMMP02200_DetailView.xrw" ){
  1441. //처방set 조회
  1442. ivw_detail.window.javascript.fGetPrcpSetList();
  1443. copyNodesetType("/root/main/prcp", "/root/main/prcp", "replace", opener.model, ivw_detail.model);
  1444. //프로토콜 처방에 저장된 약속처방인지(상태)를 알기위해 select 한다.
  1445. selectedDay = ivw_detail.window.javascript.selectedDay;
  1446. var pathRef = "/root/main/steppath/info";
  1447. nodelist = opener.instance1.selectNodes(pathRef + "[times = '" + selectedDay + "']");
  1448. //OutlineView -> actionView
  1449. }else{
  1450. //처방set 조회
  1451. fGetPrcpList();
  1452. copyNodesetType("/root/main/prcp", "/root/main/prcp", "replace", opener.model, model);
  1453. var curID = currentStepCntl.attribute("id");
  1454. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1455. //프로토콜 처방에 저장된 약속처방인지(상태)를 알기위해 select 한다.
  1456. setno = model.getValue(stepRef + "[" + curNo + "]/setno");
  1457. var pathRef = "/root/main/steppath/info";
  1458. nodelist = opener.instance1.selectNodes(pathRef + "[setno = '" + setno + "']");
  1459. }
  1460. //선택한 day가 없어도 오류 안 뜨도록 수정 할 것.
  1461. if( nodelist.length > 0 ){
  1462. var node = nodelist.item(0);
  1463. var stepstat = node.selectSingleNode("stepstat");
  1464. if(stepstat.text == '10'){ //초기
  1465. saveStatus = "I";
  1466. }else if(stepstat.text == '20' || stepstat.text == '30'){ //프로토콜/의사처방
  1467. saveStatus = "-";
  1468. }
  1469. //셋번호 및 상태값을 바꾼다.
  1470. var nodelist = opener.instance1.selectNodes("/root/main/prcp/prcplist");
  1471. for(var i=0; i<nodelist.length; i++){
  1472. var node = nodelist.item(i);
  1473. if( !isNull(setno) ){
  1474. var setNode = node.selectSingleNode("prcpsetcd");
  1475. model.setValue(setNode, setno);
  1476. }
  1477. var statusNode = node.selectSingleNode("status");
  1478. model.setValue(statusNode, saveStatus);
  1479. //저장 flag 를 분별하여 set한다
  1480. }
  1481. }
  1482. */
  1483. readyPrcp == "N";
  1484. ivw_detail.attribute("src") = "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw";
  1485. if(readyPrcp == "Y"){
  1486. ivw_detail.attribute("overflow") = "hidden";
  1487. }
  1488. }else{
  1489. OutLinesOpenerKind = "Generater2";
  1490. ivw_detail.attribute("src") = "../../../emr/cpgweb/xrw/SPMMP01400_STEP처방관리.xrw";
  1491. //ivw_detail.window.javascript.fInitData();
  1492. }
  1493. ivw_detail.visible = true;
  1494. }
  1495. return;
  1496. }else if(opener.btn_outline_tab.selected == true){
  1497. grp_swimline.attribute("overflow") = "scroll";
  1498. if(OpenerKind != "GPS" && opener.window.javascript.preSelectedTab == "btn_action_tab"){
  1499. ivw_detail.window.javascript.fExePrmsSetInfo();
  1500. }
  1501. ivw_detail.visible = false;
  1502. opener.cap_outlineinfo.attribute("text") = "Outline 정보";
  1503. if( ivw_detail.window.javascript.callfCreateControlYN == "Y" ){
  1504. fCreateControl();
  1505. }
  1506. return;
  1507. } else if(opener.btn_detail_tab.selected == true){
  1508. if( ivw_detail.attribute("src") != "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw" ||
  1509. ivw_detail.attribute("src") == "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw" && readyPrcp == "Y"){
  1510. grp_swimline.vscroll.attribute("pos") = "0";
  1511. grp_swimline.hscroll.attribute("pos") = "0";
  1512. var stepinfo = opener.javascript.getParameter("stepinfo");
  1513. setParameter("stepinfo", stepinfo);
  1514. ivw_detail.attribute("src") = "../../../emr/prcpmngtweb/xrw/SPMMP02200_DetailView.xrw";
  1515. grp_swimline.attribute("overflow") = "hidden";
  1516. opener.cap_outlineinfo.attribute("text") = "Detail 정보";
  1517. if(OpenerKind == "GPS"){
  1518. OutLinesOpenerKind = OpenerKind;
  1519. ivw_detail.cap_drug.attribute("height") = "179px";
  1520. ivw_detail.cap_test.attribute("top") = "228px";
  1521. ivw_detail.cap_test.attribute("height") = "164px";
  1522. ivw_detail.cap_caredelive.attribute("top") = "394px";
  1523. ivw_detail.cap_caredelive.attribute("height") = "124px";
  1524. ivw_detail.cap_form.attribute("top") = "520px";
  1525. ivw_detail.cap_form.attribute("height") = "124px";
  1526. ivw_detail.cap_etc.attribute("top") = "646px";
  1527. ivw_detail.cap_etc.attribute("height") = "117px";
  1528. ivw_detail.grd_drug1.attribute("height") = "180px";
  1529. ivw_detail.grd_drug2.attribute("height") = "180px";
  1530. ivw_detail.grd_drug3.attribute("height") = "180px";
  1531. ivw_detail.grd_drug4.attribute("height") = "180px";
  1532. ivw_detail.grd_test1.attribute("top") = "228px";
  1533. ivw_detail.grd_test2.attribute("top") = "228px";
  1534. ivw_detail.grd_test3.attribute("top") = "228px";
  1535. ivw_detail.grd_test4.attribute("top") = "228px";
  1536. ivw_detail.grd_test1.attribute("height") = "165px";
  1537. ivw_detail.grd_test2.attribute("height") = "165px";
  1538. ivw_detail.grd_test3.attribute("height") = "165px";
  1539. ivw_detail.grd_test4.attribute("height") = "165px";
  1540. ivw_detail.grd_caredelive1.attribute("top") = "394px";
  1541. ivw_detail.grd_caredelive2.attribute("top") = "394px";
  1542. ivw_detail.grd_caredelive3.attribute("top") = "394px";
  1543. ivw_detail.grd_caredelive4.attribute("top") = "394px";
  1544. ivw_detail.grd_caredelive1.attribute("height") = "125px";
  1545. ivw_detail.grd_caredelive2.attribute("height") = "125px";
  1546. ivw_detail.grd_caredelive3.attribute("height") = "125px";
  1547. ivw_detail.grd_caredelive4.attribute("height") = "125px";
  1548. ivw_detail.grd_form1.attribute("top") = "520px";
  1549. ivw_detail.grd_form2.attribute("top") = "520px";
  1550. ivw_detail.grd_form3.attribute("top") = "520px";
  1551. ivw_detail.grd_form4.attribute("top") = "520px";
  1552. ivw_detail.grd_form1.attribute("height") = "125px";
  1553. ivw_detail.grd_form2.attribute("height") = "125px";
  1554. ivw_detail.grd_form3.attribute("height") = "125px";
  1555. ivw_detail.grd_form4.attribute("height") = "125px";
  1556. ivw_detail.grd_etc1.attribute("top") = "646px";
  1557. ivw_detail.grd_etc2.attribute("top") = "646px";
  1558. ivw_detail.grd_etc3.attribute("top") = "646px";
  1559. ivw_detail.grd_etc4.attribute("top") = "646px";
  1560. ivw_detail.grd_etc1.attribute("height") = "117px";
  1561. ivw_detail.grd_etc2.attribute("height") = "117px";
  1562. ivw_detail.grd_etc3.attribute("height") = "117px";
  1563. ivw_detail.grd_etc4.attribute("height") = "117px";
  1564. }
  1565. }else{
  1566. opener.btn_action_tab.selected = true;
  1567. opener.btn_action_tab.refresh();
  1568. }
  1569. ivw_detail.visible = true;
  1570. return;
  1571. }
  1572. }
  1573. }
  1574. /**
  1575. * @group :
  1576. * @ver : 2007.07
  1577. * @by : 전지은
  1578. * @---------------------------------------------------
  1579. * @type : function
  1580. * @access : public
  1581. * @desc : Detail 정보를 조회, 저장한다.
  1582. * @param :
  1583. * @return :
  1584. * @---------------------------------------------------
  1585. */
  1586. function fCopyPrcpList(){
  1587. copyNodesetType("/root/main/prcp", "/root/main/prcp", "replace", ivw_detail.model, opener.model);
  1588. ivw_detail.grd_prcplist.dispatch("onmousedown");
  1589. ivw_detail.window.javascript.appendChildPrcp ( "/root/reset/prcplist", "/root/main/prcp", "main" ); //검색라인추가
  1590. }
  1591. /**
  1592. * @group :
  1593. * @ver : 2007.07
  1594. * @by : 전지은
  1595. * @---------------------------------------------------
  1596. * @type : function
  1597. * @access : public
  1598. * @desc : Master 정보를 저장한다.
  1599. * @param :
  1600. * @return : true, false
  1601. * @---------------------------------------------------
  1602. */
  1603. function allInfoSave(){
  1604. if(opener.model.getValue("/root/main/masterinfo/info/cpgno") == "" && opener.model.getValue("/root/main/masterinfo/info/cpgflagcd") == ""){
  1605. var msg = messageBox("Master 정보가 존재하지 않아 실행 ", "E001");
  1606. return;
  1607. }else if(opener.model.getValue("/root/main/masterinfo/info/cpgno") == "" && opener.model.getValue("/root/main/masterinfo/info/cpgflagcd") != ""){
  1608. var msg = messageBox("Master 정보가 저장되지 않았습니다. ", "Q002");
  1609. if(msg == 6){
  1610. //opener.btn_allInfoSave.dispatch("DOMActivate");
  1611. opener.window.javascript.fSaveCPGInfo();
  1612. return true;
  1613. } else if(msg == 7) {
  1614. return false;
  1615. }
  1616. }else{
  1617. return true;
  1618. }
  1619. }
  1620. /**
  1621. * @group :
  1622. * @ver : 2007.07
  1623. * @by : 전지은
  1624. * @---------------------------------------------------
  1625. * @type : function
  1626. * @access : public
  1627. * @desc : 선택한 하나의 스텝만 저장한다.
  1628. * @param :
  1629. * @return :
  1630. * @---------------------------------------------------
  1631. */
  1632. function fSaveStep(stepNumber){
  1633. //★ 선택된 스텝만 저장하고, 해당 스텝의 저장 flag 만 바꾼다.
  1634. var nodelist = instance1.selectNodes(stepRef + "["+stepNumber+"]");
  1635. var steplistCSV = getNodeListCSV(nodelist);
  1636. var stepCSV = steplistCSV;
  1637. opener.window.javascript.fSaveStepInfo(stepCSV);
  1638. model.setValue(stepRef + "[" + stepNumber + "]/m", "");
  1639. }
  1640. /**
  1641. * @group :
  1642. * @ver : 2007.07
  1643. * @by : 전지은
  1644. * @---------------------------------------------------
  1645. * @type : function
  1646. * @access : public
  1647. * @desc : 저장 후, status 값이 I 이거나 U 인 것들을 - 상태로 변환, D 인 것은 삭제한다.
  1648. * @param :
  1649. * @return :
  1650. * @---------------------------------------------------
  1651. */
  1652. function fChangeStatus(){
  1653. var nodeList = instance1.selectNodes(stepRef + "[m = 'i' or m = 'u']");
  1654. for(var i= 0; i<nodeList.length; i++){
  1655. var node = nodeList.item(i);
  1656. var statusNode = node.selectSingleNode("m");
  1657. model.setValue(statusNode, "");
  1658. }
  1659. nodeList = instance1.selectNodes(dcsRef + "[m = 'i' or m = 'u']");
  1660. for(var i= 0; i<nodeList.length; i++){
  1661. var node = nodeList.item(i);
  1662. var statusNode = node.selectSingleNode("m");
  1663. model.setValue(statusNode, "");
  1664. }
  1665. model.removeNodeset("/root/temp/delsteplist");
  1666. model.removeNodeset("/root/temp/deldecisionlist");
  1667. model.makeNode("/root/temp/delsteplist");
  1668. model.makeNode("/root/temp/deldecisionlist");
  1669. }
  1670. /**
  1671. * @group :
  1672. * @ver : 2007.07
  1673. * @by : 전지은
  1674. * @---------------------------------------------------
  1675. * @type : function
  1676. * @access : public
  1677. * @desc : 그룹 컨트롤 아이디를 받아서, currentStepCntl을 설정하고, 자식 컨트롤 중 textarea 컨트롤을 반환받아 selControl로 설정, fChangeSelectCntl()를 호출한다.
  1678. * @param : ctrl, flag(시작, 종료스텝 구분, null이면 그외 스텝)
  1679. * @return :
  1680. * @---------------------------------------------------
  1681. */
  1682. function fChildrenCtrlToSelCtrl(ctrl, flag){
  1683. var selControl = document.controls(ctrl); //현재 선택한 컨트롤(그룹)
  1684. var childrens = selControl.children;
  1685. var elNm = "";
  1686. var curNo = parseInt( ctrl.substr(12, ctrl.length-12) ) + 1;
  1687. for(var i=0; i<childrens.length; i++){
  1688. if(childrens.item(i).elementName == "xforms:textarea"){
  1689. elNm = childrens.item(i).attribute("id");
  1690. }
  1691. }
  1692. selControl = document.controls(elNm);
  1693. if(flag == "S"){
  1694. if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
  1695. model.setValue( stepRef + "[" + curNo + "]/startendflag", "S" );
  1696. fChangeSelectCntl("#ff9900", selectedControl);
  1697. } else {
  1698. model.setValue( stepRef + "[" + curNo + "]/startendflag", "" );
  1699. fChangeSelectCntl("#000000", selControl);
  1700. }
  1701. if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
  1702. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  1703. }
  1704. } else if(flag == "E"){
  1705. if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
  1706. model.setValue( stepRef + "[" + curNo + "]/startendflag", "E" );
  1707. fChangeSelectCntl("#ff9900", selectedControl);
  1708. } else {
  1709. model.setValue( stepRef + "[" + curNo + "]/startendflag", "" );
  1710. fChangeSelectCntl("#000000", selControl);
  1711. }
  1712. if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
  1713. model.setValue( stepRef + "[" + curNo + "]/m", "u" );
  1714. }
  1715. } else {
  1716. currentStepCntl = selControl;
  1717. if(selectedControl != null){
  1718. if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
  1719. fChangeSelectCntl("#000000", selectedControl);
  1720. }else{
  1721. fChangeSelectCntl("#ff9900", selectedControl);
  1722. }
  1723. }
  1724. fChangeSelectCntl("#99ccff", selControl);
  1725. selectedControl = selControl;
  1726. }
  1727. var stepnm = opener.model.getValue( "/root/main/stepinfo/info/stepnm");
  1728. var stepmemo = opener.model.getValue( "/root/main/stepinfo/info/stepmemo");
  1729. var steptimes = opener.model.getValue( "/root/main/stepinfo/info/times");
  1730. return (stepnm+"|"+stepmemo+"|"+steptimes);
  1731. }
  1732. /**
  1733. * @group :
  1734. * @ver : 2007.07
  1735. * @by : 전지은
  1736. * @---------------------------------------------------
  1737. * @type : function
  1738. * @access : public
  1739. * @desc : M-GPS에서 일괄 발행을 위한 decision 스텝의 대답을 얻는다.
  1740. * @param : ctrl
  1741. * @return :
  1742. * @---------------------------------------------------
  1743. */
  1744. function fDecision(){
  1745. var curID = currentStepCntl.attribute("id");
  1746. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1747. grd_decision.rowHidden(0) = true;
  1748. if(opener.btn_outline_tab.selected == true){
  1749. if(decisionMode == "false"){
  1750. decisionMode = "true";
  1751. var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno");
  1752. model.setValue("/root/main/seldecisionstep", trgStep);
  1753. model.setValue("/root/main/seldecisionstepno", curNo);
  1754. }else if(decisionMode == "true"){
  1755. var no = model.getValue("/root/main/seldecisionstepno");
  1756. var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno");
  1757. grd_decision_answlist.addRow(true, true);
  1758. var srcStep = model.getValue("/root/main/seldecisionstep");
  1759. model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/stepno" , srcStep);
  1760. model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/lnkstepno" , trgStep);
  1761. model.makeValue(stepRef + "[" + no + "]/dcsnstep", trgStep);
  1762. model.setValue("/root/main/seldecisionstep", "");
  1763. model.setValue("/root/main/seldecisionstepno", "")
  1764. decisionMode = "false";
  1765. //CP적용환자 테이블( MMPHAPPT )에 저장한다.
  1766. opener.window.javascript.fInsCPGAppPatInfo( srcStep, trgStep );
  1767. }
  1768. }else if(opener.btn_detail_tab.selected == true){
  1769. var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno");
  1770. var nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + trgStep + "']");
  1771. for(var i= 0; i<nodeList.length; i++){
  1772. var node = nodeList.item(i);
  1773. var lnkStep = node.selectSingleNode("lnkstepno");
  1774. var stepMemo = instance1.selectSingleNode(stepRef + "[stepno = '" + lnkStep + "']/stepmemo");
  1775. grd_decision.addRow(true);
  1776. model.setValue("/root/main/seldecision/info["+ (i+1) +"]/stepno" , lnkStep.text);
  1777. model.setValue("/root/main/seldecision/info["+ (i+1) +"]/stepmemo" , stepMemo.text);
  1778. grd_decision_answlist.addRow(true, true);
  1779. model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/stepno" , trgStep);
  1780. model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/lnkstepno" , lnkStep);
  1781. }
  1782. grp_dcsgrid.visible = true;
  1783. }
  1784. }
  1785. /**
  1786. * @group :
  1787. * @ver : 2007.08
  1788. * @by : 전지은
  1789. * @---------------------------------------------------
  1790. * @type : function
  1791. * @access : public
  1792. * @desc : M-GPS가 opener 일 경우, 서식 코드를 조회한다.
  1793. * @param : ctrl
  1794. * @return :
  1795. * @---------------------------------------------------
  1796. */
  1797. function GPS_fGetFormList(flag, val){
  1798. if( flag == "S" ){
  1799. opener.window.javascript.fGetFormList("S", val);
  1800. return;
  1801. }else if( flag == "D" ){
  1802. opener.window.javascript.fGetFormList("D", val);
  1803. return;
  1804. }
  1805. }
  1806. /**
  1807. * @group :
  1808. * @ver : 2007.08
  1809. * @by : 전지은
  1810. * @---------------------------------------------------
  1811. * @type : function
  1812. * @access : public
  1813. * @desc : M-GPS가 opener 일 경우, 서식 코드를 조회한다. (사용 안 함)
  1814. * @param : mode
  1815. * @return :
  1816. * @---------------------------------------------------
  1817. */
  1818. function fGetPrcpList( mode ){
  1819. if( mode == "step" ){
  1820. if(currentStepCntl != null){
  1821. var curID = currentStepCntl.attribute("id");
  1822. var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
  1823. if(cpgflagcd == "01" || cpgflagcd == "W"){
  1824. var settypecd = "W";
  1825. } else if(cpgflagcd == "02" || cpgflagcd == "G"){
  1826. var settypecd = "G";
  1827. }
  1828. model.removeNodeset("/root/send");
  1829. model.makeNode("/root/send");
  1830. model.makeValue ( "/root/send/cond1", model.getValue(stepRef + "[" + curNo + "]/setno") );
  1831. model.makeValue ( "/root/send/cond2", settypecd);
  1832. model.makeValue ( "/root/send/cpgno", model.getValue("/root/main/outlineinfo/info/cpgno") );
  1833. model.makeValue ( "/root/send/cpghistseq", model.getValue("/root/main/outlineinfo/info/cpghistseq") );
  1834. model.makeValue ( "/root/send/cpgflagcd", cpgflagcd);
  1835. model.makeValue ( "/root/send/dayno", model.getValue(stepRef + "[" + curNo + "]/times") );
  1836. model.makeValue ( "/root/send/setcond", model.getValue(stepRef + "[" + curNo + "]/setno") );
  1837. model.makeValue ( "/root/send/cpgappno", opener.model.getValue("/root/temp/getdata/cpgappno") );
  1838. model.makeValue ( "/root/send/case", "step");
  1839. submit("TRMMP02202", false); //submit("TRMMB00202", false) 와 동일
  1840. }else if( mode == "step" ){
  1841. ivw_detail.window.javascript.fGetPrcpSetList();
  1842. }
  1843. }
  1844. }