MRF03101.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 서식SET관리 ( SMMRF03100_서식SET.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. */
  8. var sSETLIST = "/root/main/indxlist/item";
  9. var sSETLIST_HIDDEN = "/root/hidden/indxlist/item";
  10. var sMOUSE_CLK_STATUS; //마우스 클릭 좌우버튼 구분
  11. var sTREE_OBJ; //트리뷰 구분
  12. /**
  13. * @desc : 트리뷰 셋
  14. * @
  15. * @param :
  16. * @return :
  17. * @---------------------------------------------------
  18. */
  19. function fSetTreeView(){
  20. var setflag = model.getValue("/root/send/cond/setflag");
  21. if (setflag == "U") {
  22. sTREE_OBJ = trv_indxlist_u
  23. }
  24. if (setflag == "D") {
  25. sTREE_OBJ = trv_indxlist_d
  26. }
  27. if (setflag == "A") {
  28. sTREE_OBJ = trv_indxlist_a
  29. }
  30. }
  31. /**
  32. * @desc : 마우스 오른쪽 버튼 팝업창
  33. * @
  34. * @param :
  35. * @return :
  36. * @---------------------------------------------------
  37. * 1. 마우스 우클릭인가?
  38. * 2. 관리자인가? 사용자인가?
  39. * 3. 구분이 개인인가? 과인가? 전체인가?
  40. * 4. 폴더인가? 파일인가? 루트인가?
  41. */
  42. function fMouseRghtBtnPopup(){
  43. fSetTreeView();
  44. if(event.button == 3){
  45. if(sTREE_OBJ.isCell(event.target) && sTREE_OBJ.selectedIndex > -1) {
  46. var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex);
  47. var rowpos = item.index + 1;
  48. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  49. var item_length = sTREE_OBJ.length;
  50. // 루트인가? (보여주는 부분으로..)
  51. if (depth == 0 && item_length > 1) {
  52. window.setPopupMenu(false); return;
  53. }
  54. // 관리자인가? 구분이 개인인가?
  55. var admin = model.getValue("/root/send/cond/admin");
  56. var setflag = model.getValue("/root/send/cond/setflag");
  57. if (admin == "true" || setflag == "U") {
  58. if (depth < 2) {
  59. window.setPopupMenu(true, "/root/temp/menu2/menu", "label", "func", false); return;
  60. }
  61. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  62. if (linkflag == "N") {
  63. // 폴더인경우, 새폴더/폴더수정/폴더삭제..
  64. window.setPopupMenu(true, "/root/temp/menu/menu", "label", "func", false); return;
  65. } else {
  66. // 파일인경우, 파일삭제만..
  67. window.setPopupMenu(true, "/root/temp/menu1/menu", "label", "func", false); return;
  68. }
  69. } else {
  70. window.setPopupMenu(false);
  71. }
  72. } else {
  73. window.setPopupMenu(false);
  74. }
  75. }else{
  76. window.setPopupMenu(false);
  77. }
  78. }
  79. /**
  80. * @desc : 새폴더 추가
  81. * @
  82. * @param :
  83. * @return :
  84. * @---------------------------------------------------
  85. */
  86. function fAddDiagSet(){
  87. fSetTreeView();
  88. var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex);
  89. var rowPos = item.index + 1;
  90. fSetDiagInfo(rowPos, "i");
  91. model.setValue(sSETLIST_HIDDEN + "/status", "i");
  92. model.setValue("/root/main/iptbox/indxnm", "");
  93. model.refresh();
  94. fShowWndIptBox();
  95. }
  96. /**
  97. * @desc : 폴더 삭제
  98. * @
  99. * @param :
  100. * @return :
  101. * @---------------------------------------------------
  102. */
  103. function fDelDiagSet(){
  104. fSetTreeView();
  105. var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex);
  106. var rowPos = item.index + 1;
  107. if(fSetDiagInfo(rowPos, "d")!= -1){
  108. fSaveDiagSet("Y");
  109. }
  110. }
  111. /**
  112. * @desc : 폴더 수정
  113. * @
  114. * @param :
  115. * @return :
  116. * @---------------------------------------------------
  117. */
  118. function fUpdtDiagSet(){
  119. fSetTreeView();
  120. var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex);
  121. var rowPos = item.index + 1;
  122. var indxnm = item.label;
  123. model.setValue("/root/main/iptbox/indxnm", indxnm);
  124. model.refresh();
  125. if(fSetDiagInfo(rowPos, "u")!=-1){
  126. fShowWndIptBox();
  127. }
  128. }
  129. /**
  130. * @desc : 서식 SET 저장
  131. * @
  132. * @param :
  133. * @return :
  134. * @---------------------------------------------------
  135. */
  136. function fSaveDiagSet(linkflag){
  137. grup_saveas.visible = "false";
  138. var indxnm = model.getValue("/root/main/iptbox/indxnm");
  139. if (linkflag == "N" && indxnm == "") {
  140. messageBox("폴더명칭을 ", "C001");
  141. return;
  142. }
  143. model.setValue(sSETLIST_HIDDEN + "/indxnm" , indxnm);
  144. model.setValue(sSETLIST_HIDDEN + "/linkflag" , linkflag);
  145. var admin = model.getValue("/root/send/cond/admin");
  146. model.setvalue(sSETLIST_HIDDEN + "/admin" , admin);
  147. var setflag = model.getValue("/root/send/cond/setflag");
  148. model.setvalue(sSETLIST_HIDDEN + "/setflag" , setflag);
  149. // 구분에 따라 [과, 사용자] 정보를 넘겨야 하는데...
  150. var userid = model.getValue("/root/send/cond/userid");
  151. var deptcd = model.getValue("/root/send/cond/deptcd");
  152. if (setflag == "U")
  153. {
  154. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  155. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  156. } else if (setflag == "D")
  157. {
  158. model.setValue(sSETLIST_HIDDEN + "/userid" , "");
  159. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  160. }
  161. model.copyNode("/root/send/savedata", sSETLIST_HIDDEN);
  162. submit("TXMRF03101");
  163. if (setflag == "U") {
  164. model.removeNodeset("/root/main/indxlist_u/item");
  165. model.copyNode("/root/main/indxlist_u", "/root/main/indxlist");
  166. refresh_u = 1; refresh_d = 0; refresh_a = 0;
  167. } else if (setflag == "D") {
  168. model.removeNodeset("/root/main/indxlist_d/item");
  169. model.copyNode("/root/main/indxlist_d", "/root/main/indxlist");
  170. refresh_u = 0; refresh_d = 1; refresh_a = 0;
  171. } else if (setflag == "A") {
  172. model.removeNodeset("/root/main/indxlist_a/item");
  173. model.copyNode("/root/main/indxlist_a", "/root/main/indxlist");
  174. refresh_u = 0; refresh_d = 0; refresh_a = 1;
  175. }
  176. model.refresh();
  177. }
  178. /**
  179. * @desc : 서식관리 폴더명을 입력할 InputBox를 보여줌.
  180. * @
  181. * @param :
  182. * @return :
  183. * @---------------------------------------------------
  184. */
  185. function fShowWndIptBox(){
  186. grup_saveas.attribute("top") = event.clientY;
  187. grup_saveas.visible = "true";
  188. }
  189. /**
  190. * @desc : 서식 SET 조회
  191. * @
  192. * @param :
  193. * @return :
  194. * @---------------------------------------------------
  195. */
  196. function fReqDetlSet(){
  197. fSetTreeView();
  198. if (sTREE_OBJ.selectedIndex == 0) {
  199. return;
  200. }
  201. var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex);
  202. var rowpos = item.index + 1;
  203. fSetDiagInfo(rowpos);
  204. var depth = model.getValue(sSETLIST_HIDDEN + "/depth");
  205. if(depth == 1){
  206. return;
  207. }
  208. }
  209. /**
  210. * @desc : Mouse Drag Drop
  211. * @
  212. * @param :
  213. * @return : void
  214. * @authur :
  215. * @---------------------------------------------------
  216. */
  217. function fOndrop(){
  218. fSetTreeView();
  219. var rowpos = sTREE_OBJ.mouseRow + 1;
  220. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  221. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  222. var x = event.clientX;
  223. var maxposX = 24 + 16 * (depth - 1) + ( 13 * indxnm.length);
  224. var minposX = 24 + 16 * (depth - 1);
  225. if(maxposX > x){
  226. fDiagSetDrop();
  227. }else{
  228. return;
  229. }
  230. }
  231. /**
  232. * @desc : Mouse Drag Over
  233. * @
  234. * @param :
  235. * @return : void
  236. * @authur :
  237. * @---------------------------------------------------
  238. */
  239. function fMouseOver(){
  240. fSetTreeView();
  241. var rowpos = sTREE_OBJ.mouseRow + 1;
  242. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  243. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  244. var x = event.clientX;
  245. var maxposX = 24 + 16 * (depth - 1) + ( 10 * indxnm.length);
  246. var minposX = 24 + 16 * (depth - 1);
  247. if(maxposX > x){
  248. for ( var i = 0; i < sTREE_OBJ.length; i++ ) {
  249. sTREE_OBJ.item(i).attribute("background-color") = "#ffffff";
  250. sTREE_OBJ.item(i).attribute("text-decoration") = "";
  251. }
  252. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ece1ec";
  253. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = "";
  254. }
  255. }
  256. /**
  257. * @desc : TreeView에 Drag상태로 Mouse over된 경우 item의 background color를 clear함
  258. * @
  259. * @param :
  260. * @return : void
  261. * @authur :
  262. * @---------------------------------------------------
  263. */
  264. function fOnDragMouseOver(){
  265. fSetTreeView();
  266. var treeObj = document.controls.item(event.currentTarget);
  267. var rowpos = sTREE_OBJ.mouseRow + 1;
  268. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  269. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  270. var x = event.clientX;
  271. var maxposX = 24 + 16 * (depth - 1) + ( 10 * indxnm.length);
  272. var minposX = 24 + 16 * (depth - 1);
  273. if(maxposX > x){
  274. if( sTREE_OBJ.selectedIndex != treeObj.mouseRow ) {
  275. for ( var i = 0; i < treeObj.length; i++ ) {
  276. treeObj.item(i).attribute("background-color") = "#ffffff";
  277. treeObj.item(i).attribute("text-decoration") = "";
  278. }
  279. treeObj.item(treeObj.mouseRow).attribute("background-color") = "#ece1ec";
  280. treeObj.item(treeObj.mouseRow).attribute("text-decoration") = "";
  281. }
  282. }
  283. }
  284. /**
  285. * @desc : 서식 SET Drag
  286. * @
  287. * @param :
  288. * @return :
  289. * @---------------------------------------------------
  290. */
  291. function fDiagSetDrag(){
  292. fSetTreeView();
  293. if (sTREE_OBJ.selectedIndex == 0) {
  294. return;
  295. }
  296. var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex);
  297. var rowpos = item.index + 1;
  298. fSetDiagInfo(rowpos, "u");
  299. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  300. model.setValue("/root/main/iptbox/indxnm", indxnm);
  301. model.refresh();
  302. }
  303. /**
  304. * @desc : 서식 SET Drop
  305. * @
  306. * @param :
  307. * @return :
  308. * @---------------------------------------------------
  309. */
  310. function fDiagSetDrop(){
  311. fSetTreeView();
  312. fClrTreeViweSelect();
  313. var admin = model.getValue("/root/send/cond/admin");
  314. var setflag = model.getValue("/root/send/cond/setflag");
  315. // 관리자인가? 구분이 개인인가?
  316. if (admin == "true" || setflag == "U") {
  317. var treeObj = document.controls.item(event.currentTarget);
  318. var rowpos = sTREE_OBJ.mouseRow + 1;
  319. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  320. var itemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq");
  321. var supitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/supitemindxseq");
  322. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  323. var cmpdepth = model.getValue(sSETLIST_HIDDEN + "/depth");
  324. var cmpitemindxseq = model.getValue(sSETLIST_HIDDEN + "/itemindxseq");
  325. var cmpsupitemindxseq = model.getValue(sSETLIST_HIDDEN + "/supitemindxseq");
  326. var cmplinkflag = model.getValue(sSETLIST_HIDDEN + "/linkflag");
  327. // 이동하는 폴더가 파일 아래로 이동하는것 방지함.
  328. if(linkflag == "Y"){
  329. messageBox("폴더가 아닌 위치로 이동", "E001");
  330. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff";
  331. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = "";
  332. return;
  333. }
  334. if(itemindxseq == cmpitemindxseq){
  335. // messageBox("동일한 위치로 이동", "E001");
  336. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff";
  337. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = "";
  338. return;
  339. }else if(itemindxseq == cmpsupitemindxseq){
  340. // 같은 과, 같은 사용자가 아니면 이동이 안됨. (why? with문 update가 안되니까..)
  341. // if (deptcd != cmpdeptcd || userid != cmpuserid) {
  342. // messageBox("지정된 위치로 이동", "E001");
  343. // sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff";
  344. // sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = "";
  345. // return;
  346. // }
  347. }
  348. //이동하는 SET폴더의 depth가 도착하는 곳보다 낮은 레벨일 경우,
  349. //자신의 child node 아래로 이동하는 것을 방지함.
  350. if(cmpdepth < depth){
  351. var rootdepth;
  352. var rootitemindxseq;
  353. while(cmpdepth != rootdepth){
  354. rootdepth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  355. rootitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq");
  356. rowpos--;
  357. }
  358. if(rootitemindxseq == cmpitemindxseq){
  359. messageBox("지정된 위치로 이동", "E001");
  360. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff";
  361. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = "";
  362. return;
  363. }
  364. }
  365. // 이동 폴더의 (과, 사용자) 정보, 이동 대상의 (과, 사용자) 정보
  366. var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd");
  367. var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid");
  368. var cmpdeptcd = model.getValue(sSETLIST_HIDDEN + "/deptcd");
  369. var cmpuserid = model.getValue(sSETLIST_HIDDEN + "/userid");
  370. // 같은 과, 같은 사용자가 아니면 이동이 안됨. (why? with문 update가 안되니까..)
  371. if (deptcd != cmpdeptcd || userid != cmpuserid) {
  372. messageBox("지정된 위치로 이동", "E001");
  373. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("background-color") = "#ffffff";
  374. sTREE_OBJ.item(sTREE_OBJ.mouseRow).attribute("text-decoration") = "";
  375. return;
  376. }
  377. // 이동 폴더의 (과, 사용자) 정보를 셋함...
  378. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  379. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  380. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq" , itemindxseq);
  381. fSaveDiagSet("Y");
  382. }
  383. }
  384. /**
  385. * @desc : 폴더명 검색할 경우 검색한 위치로 focus를 이동한다.
  386. * @
  387. * @param :
  388. * @return : void
  389. * @authur :
  390. * @---------------------------------------------------
  391. */
  392. function fSrchDiagIndxNM(){
  393. fSetTreeView();
  394. var sFolderNM = model.getValue("/root/main/cond/foldernm");
  395. if (sTREE_OBJ.selectedIndex+1 == sTREE_OBJ.length) {
  396. sTREE_OBJ.selectedIndex = 0;
  397. }
  398. for(var i=sTREE_OBJ.selectedIndex+1; i<sTREE_OBJ.length;i++){
  399. sTREE_OBJ.select(i);
  400. if(sFolderNM == sTREE_OBJ.label){
  401. break;
  402. }
  403. }
  404. fReqDetlSet();
  405. }
  406. /**
  407. * @desc : TreeView 선택된 item의 background color를 clear함
  408. * @
  409. * @param :
  410. * @return : void
  411. * @authur :
  412. * @---------------------------------------------------
  413. */
  414. function fClrTreeViweSelect(){
  415. fSetTreeView();
  416. for(var i = 0; i < sTREE_OBJ.length; i++){
  417. sTREE_OBJ.item(i).attribute("background-color") = "#ffffff";
  418. sTREE_OBJ.item(i).attribute("text-decoration") = "";
  419. }
  420. }
  421. /**
  422. * @desc : 서식 SET INFO SETTING
  423. * @
  424. * @param :
  425. * @return :
  426. * @---------------------------------------------------
  427. */
  428. function fSetDiagInfo(rowpos, status){
  429. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  430. if(status == "u" && depth == 0){
  431. //messageBox("선택한 폴더는 수정", "E001");
  432. return -1;
  433. }else if(status == "d" && depth == 0){
  434. //messageBox("선택한 폴더는 삭제", "E001");
  435. return -1;
  436. }
  437. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  438. var path = model.getValue(sSETLIST + "[" + rowpos + "]/path");
  439. var itemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/itemindxseq");
  440. var supitemindxseq = model.getValue(sSETLIST + "[" + rowpos + "]/supitemindxseq");
  441. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  442. var indxnm = model.getValue(sSETLIST + "[" + rowpos + "]/indxnm");
  443. model.setValue(sSETLIST_HIDDEN + "/status" , status);
  444. model.setValue(sSETLIST_HIDDEN + "/depth" , depth);
  445. model.setValue(sSETLIST_HIDDEN + "/path" , path);
  446. model.setValue(sSETLIST_HIDDEN + "/itemindxseq" , itemindxseq);
  447. // supitemindxseq : 새로운 등록이면 상위정보, 수정이면 기존정보
  448. if(status == "i"){
  449. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq", itemindxseq);
  450. }else{
  451. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq", supitemindxseq);
  452. }
  453. //연결구분이 'Y' 인 경우 : 서식명칭에 값을 넣지 않는다.. (2007.06.12)
  454. if (linkflag == 'N') {
  455. model.setValue(sSETLIST_HIDDEN + "/indxnm" , indxnm);
  456. } else {
  457. model.setValue(sSETLIST_HIDDEN + "/indxnm" , "");
  458. }
  459. model.setValue(sSETLIST_HIDDEN + "/linkflag" , "N");
  460. model.setValue(sSETLIST_HIDDEN + "/linkcd" , "");
  461. // 상위 정보 (사용자, 과)
  462. var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid");
  463. var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd");
  464. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  465. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  466. // 기본 정보
  467. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("posinstcd"));
  468. model.setValue(sSETLIST_HIDDEN + "/indxflag" , "F");
  469. model.setValue(sSETLIST_HIDDEN + "/valiyn" , "Y");
  470. model.setValue(sSETLIST_HIDDEN + "/sortno" , 1000);
  471. model.setValue(sSETLIST_HIDDEN + "/comnseq" , 0);
  472. model.setValue(sSETLIST_HIDDEN + "/slipno" , 0);
  473. // 사용자 정보(관리자, 일반사용자)
  474. // 구분 정보(개인,과,전체)
  475. var admin = model.getValue("/root/send/cond/admin");
  476. var setflag = model.getValue("/root/send/cond/setflag");
  477. model.setValue(sSETLIST_HIDDEN + "/admin" , admin);
  478. model.setValue(sSETLIST_HIDDEN + "/setflag" , setflag);
  479. model.refresh();
  480. }
  481. /**
  482. * @desc : 서식 SET 에 파일 연결하기
  483. * @
  484. * @param :
  485. * @return :
  486. * @---------------------------------------------------
  487. */
  488. function fAddindx(){
  489. fSetTreeView();
  490. // 선택폴더가 있는가?
  491. if (sTREE_OBJ.selectedIndex == -1) {
  492. messageBox("폴더를 ", "C002");
  493. return;
  494. }
  495. // 선택한 아이템 로우~!!
  496. var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex);
  497. var rowpos = item.index + 1;
  498. // 루트인가? (이동할 수 없다..)
  499. var depth = model.getValue(sSETLIST + "[" + rowpos + "]/depth");
  500. if (depth == 0) {
  501. messageBox("지정된 위치로 이동", "E001");
  502. return;
  503. }
  504. // 폴더인가? 파일이면 파일을 추가하지 않는다.
  505. var linkflag = model.getValue(sSETLIST + "[" + rowpos + "]/linkflag");
  506. if (linkflag == "Y") {
  507. messageBox("폴더를 ", "C002");
  508. return;
  509. }
  510. // 선택한 서식이 있는가?
  511. var checkflag = "false";
  512. for(var i = grd_formlist.fixedRows; i < grd_formlist.rows; i++){
  513. var flag = model.getValue("/root/main/formlist/row["+ i +"]/check");
  514. if(flag == "true"){
  515. checkflag = "true";
  516. break;
  517. }
  518. }
  519. if(checkflag == "false"){
  520. messageBox("서식을 ", "C002");
  521. return;
  522. }
  523. var item = sTREE_OBJ.item(sTREE_OBJ.selectedIndex);
  524. var rowpos = item.index + 1;
  525. var indxfocus = item.value;
  526. model.setValue("/root/temp/indxfocus", indxfocus);
  527. for(var i = grd_formlist.fixedRows; i < grd_formlist.rows; i++){
  528. var flag = model.getValue("/root/main/formlist/row["+ i +"]/check");
  529. if(flag=="true" ){
  530. model.setValue("/root/main/formlist/row["+ i +"]/check","false");
  531. var formcd = model.getValue("/root/main/formlist/row["+ i +"]/formcd");
  532. model.setValue(sSETLIST_HIDDEN + "/linkcd" , formcd);
  533. var userid = model.getValue(sSETLIST + "[" + rowpos + "]/userid");
  534. var deptcd = model.getValue(sSETLIST + "[" + rowpos + "]/deptcd");
  535. model.setValue(sSETLIST_HIDDEN + "/userid" , userid);
  536. model.setValue(sSETLIST_HIDDEN + "/deptcd" , deptcd);
  537. // 서식명칭에 값을 넣지 않는다.. (2007.06.12)
  538. model.setValue(sSETLIST_HIDDEN + "/indxnm" , "");
  539. model.setValue(sSETLIST_HIDDEN + "/supitemindxseq" , indxfocus);
  540. model.setValue(sSETLIST_HIDDEN + "/depth" , "");
  541. model.setValue(sSETLIST_HIDDEN + "/itemindxseq" , "");
  542. model.setValue(sSETLIST_HIDDEN + "/path" , "");
  543. model.setValue(sSETLIST_HIDDEN + "/status" , "i");
  544. model.setValue(sSETLIST_HIDDEN + "/sortno" , 1000);
  545. model.setValue(sSETLIST_HIDDEN + "/instcd" , getUserInfo("posinstcd"));
  546. model.setValue(sSETLIST_HIDDEN + "/indxflag" , "F");
  547. var admin = model.getValue("/root/send/cond/admin");
  548. model.setValue(sSETLIST_HIDDEN + "/admin" , admin);
  549. var setflag = model.getValue("/root/send/cond/setflag");
  550. model.setValue(sSETLIST_HIDDEN + "/setflag" , setflag);
  551. model.setValue(sSETLIST_HIDDEN + "/linkflag" , "Y");
  552. model.setValue(sSETLIST_HIDDEN + "/valiyn" , "Y");
  553. model.setValue(sSETLIST_HIDDEN + "/comnseq" , 0);
  554. model.setValue(sSETLIST_HIDDEN + "/slipno" , 0);
  555. model.copyNode("/root/send/savedata", sSETLIST_HIDDEN);
  556. submit("TXMRF03101");
  557. if (setflag == "U") {
  558. model.removeNodeset("/root/main/indxlist_u/item");
  559. model.copyNode("/root/main/indxlist_u", "/root/main/indxlist");
  560. } else if (setflag == "D") {
  561. model.removeNodeset("/root/main/indxlist_d/item");
  562. model.copyNode("/root/main/indxlist_d", "/root/main/indxlist");
  563. } else if (setflag == "A") {
  564. model.removeNodeset("/root/main/indxlist_a/item");
  565. model.copyNode("/root/main/indxlist_a", "/root/main/indxlist");
  566. }
  567. model.refresh();
  568. }
  569. }
  570. }
  571. /**
  572. * @desc : 폼코드 넘겨주기
  573. * @
  574. * @param :
  575. * @return :
  576. * @---------------------------------------------------
  577. */
  578. function fSendFormInfo()
  579. {
  580. fSetTreeView();
  581. var rowpos = sTREE_OBJ.mouseRow + 1;
  582. var formcd = model.getValue("/root/main/indxlist/item" + "[" + rowpos + "]/formcd");
  583. if (formcd != "") {
  584. parent.window.javascript.fOpenNewForm(formcd);
  585. window.close();
  586. }
  587. }
  588. /**
  589. * @desc : 폼코드 넘겨주기
  590. * @
  591. * @param :
  592. * @return :
  593. * @---------------------------------------------------
  594. */
  595. function fSendFormListInfo()
  596. {
  597. var rowpos = trv_formlist.mouseRow + 1;
  598. var formcd = model.getValue("/root/main/formlist/item" + "[" + rowpos + "]/formcd");
  599. if (formcd != "") {
  600. // 부모창의 속성값에 정해준다..
  601. //parent.window.model.makeValue("/root/hidden/parameters/formcd",formcd);
  602. parent.window.javascript.fOpenNewForm(formcd);
  603. // 파라메타값으로 넘겨준다..
  604. window.close();
  605. }
  606. }