SPCIT00400_만족도설문지미리보기.xrw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * Name : SPCIT00400_만족도설문지미리보기
  4. * Summary : 만족도 설문지 미리보기
  5. * Programmer : 신용준
  6. * Date Written : 2010.11.11
  7. * History :
  8. * Remark :
  9. -->
  10. <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
  11. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  12. <xhtml:head>
  13. <xhtml:title>만족도 설문지 미리보기</xhtml:title>
  14. <model id="model1">
  15. <instance id="instance1">
  16. <root xmlns="">
  17. <codes/>
  18. <main>
  19. <qestlistGrp>
  20. <qestitemgrupseqno/>
  21. <qestitemgrupnm/>
  22. <qestitemgrupdesc/>
  23. <qestuseyn/>
  24. <colgstinqestyn/>
  25. <colgstinqestseqno/>
  26. </qestlistGrp>
  27. <qestlist>
  28. <qestitemgrupseqno/>
  29. <qestitemgrupnm/>
  30. <qestitemgrupdesc/>
  31. <qestuseyn/>
  32. <colgstinqestyn/>
  33. <colgstinqestseqno/>
  34. <qestseqno/>
  35. <qpaprsortseq/>
  36. <itemkindcd/>
  37. <qestitemanswcnt/>
  38. <qestitemanswchoicolcnt/>
  39. <qestcnts/>
  40. <essnanswcnt/>
  41. <answseqno/>
  42. <qestitemanswcnts/>
  43. <divpnt/>
  44. <answaddcnts/>
  45. <figrinptyn/>
  46. <addinptyn/>
  47. <addflgrinptyn/>
  48. <essninptyn/>
  49. <norpaddyn/>
  50. <nextqestseqno/>
  51. <descinptyn/>
  52. </qestlist>
  53. </main>
  54. <send>
  55. <qpaprseqno/>
  56. <qestitemgrupseqno/>
  57. </send>
  58. </root>
  59. </instance>
  60. <submission id="TRCIT00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/qestlistGrp"/>
  61. <submission id="TRCIT00401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/qestlist"/>
  62. </model>
  63. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  64. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  65. <script type="javascript" src="../../../crm/cssaweb/js/CSZ001.js"/>
  66. <script type="javascript" ev:event="xforms-ready">
  67. <![CDATA[
  68. // 부모창의 설문지 일련번호를 가져온다.
  69. var qpaprseqno = opener.window.javascript.getParameter("qpaprseqno");
  70. model.setValue("/root/send/qpaprseqno", qpaprseqno);
  71. var tempqestitemgrupseqno = "";
  72. // 설문지 미리보기(먼저 그룹을 조회함)을 조회 한다.
  73. if (submit("TRCIT00402")){
  74. var nodeList = root.selectNodes("/root/main/qestlistGrp");
  75. // 그룹 정보
  76. var inLeft = 20;
  77. var inTop = 40;
  78. var groupContainer = body;
  79. var groupIndex = 0;
  80. var buttons = new Array();
  81. var selectIndex = 0;
  82. for (var i = 1; i <= nodeList.length; i ++ ) {
  83. var xPath = "/root/main/qestlistGrp[" + i + "]";
  84. var qestitemgrupseqno = model.getValue(xPath + "/qestitemgrupseqno");
  85. var qestseqno= model.getValue(xPath + "/qestseqno");
  86. var button = makeButton(body, model.getValue(xPath + "/qestitemgrupnm"), 0, 0);
  87. var sfuncall = "";
  88. button.attribute("group") = "answers";
  89. //첫번째 그룹 시퀀스를 저장해 놨다가 나중에 그 페이지만 먼저 화면에 뿌린다.
  90. if (i == 1) {
  91. tempqestitemgrupseqno = qestitemgrupseqno;
  92. }
  93. sfuncall = "fnQestItemPrint(" + groupIndex + ", " + qpaprseqno + ", " + qestitemgrupseqno + "); ";
  94. sfuncall = sfuncall + "groups.selectedIndex = " + groupIndex +";";
  95. button.attribute("onclick") = sfuncall;
  96. button.visible = false;
  97. var buttonWidth = parseInt(button.attribute("width"), 10);
  98. if (inLeft + buttonWidth > 800) {
  99. inTop += 20;
  100. inLeft = 20;
  101. } else {
  102. inLeft += buttonWidth;
  103. } // end if
  104. buttons[groupIndex] = button;
  105. groupContainer = makeCase(groups, "group_" + groupIndex, 0, 0, 800, 1000);
  106. var explOutput = makeOutput(groupContainer, model.getValue(xPath + "/qestitemgrupdesc"), 10, 20, 760);
  107. arIsGroupContainer[groupIndex] = groupContainer;
  108. arGroupTop[groupIndex] = 20 + parseInt(explOutput.attribute("height"), 10); // 각각의 그룹에 시작할 위치를 미리 전역 배열에 넣어 놓는다.
  109. arIsGroupClick[groupIndex] = "0" // 0: 이면 NonCheck 1이면 Check 해당 그룹을 클릭해서 불러왔는가는 체크
  110. groupIndex ++;
  111. } // end for
  112. buttons[selectIndex].selected = true;
  113. groups.selectedIndex = selectIndex;
  114. groups.attribute("top") = inTop + 20;
  115. // Tab버튼 위치 조정
  116. inLeft = 20;
  117. for (var i = 0; i< buttons.length; i ++) {
  118. var button = buttons[i];
  119. var buttonWidth = parseInt(button.attribute("width"), 10);
  120. if (inLeft + buttonWidth > 800) {
  121. inTop -= 20;
  122. inLeft = 20;
  123. }
  124. button.attribute("top") = inTop;
  125. button.attribute("left") = inLeft;
  126. button.visible = true;
  127. inLeft += buttonWidth;
  128. } // end for
  129. // groups.refresh();
  130. buttons = null;
  131. // 첫패이지는 일단 뿌린다.
  132. fnQestItemPrint(selectIndex, qpaprseqno, tempqestitemgrupseqno);
  133. }
  134. model.refresh();
  135. ]]>
  136. </script>
  137. <script type="javascript" ev:event="xforms-model-construct">
  138. <![CDATA[
  139. /*
  140. var nodeSet = new Array();
  141. for (var i = 0; i < 5; i++) {
  142. nodeSet[i] = {"label": "sdfasdfasfasfdasdfafasdf" + i , "value":"value" + i};
  143. }
  144. var top = 0;
  145. var radio = makeRadio(body, "rd1", "/root/example", "/root/codes", nodeSet, 1, 0, top);
  146. top = top + parseInt(radio.attribute("height") ,10);
  147. var check = makeCheckbox(body, "ck1", "/root/example", "/root/codes", nodeSet, 1, 0, top, 200);
  148. top = top + parseInt(check.attribute("height") ,10);
  149. var combo = makeCombo(body, "cb1", "/root/example", "/root/codes", nodeSet, 1, 0, top, 200);
  150. top = top + parseInt(combo.attribute("height") ,10);
  151. var input = makeInput(body, "ip1", "/root/example", 0, top, 200);
  152. top = top + parseInt(input.attribute("height") ,10);
  153. var textarea = makeTextarea(body, "ta1", "/root/example", 0, top);
  154. */
  155. ]]>
  156. </script>
  157. <script type="javascript">
  158. <![CDATA[
  159. var arGroupTop = new Array(); //각각의 그룹에 시작할 위치를 미리 전역 배열에 넣어 놓는다.
  160. var arIsGroupClick = new Array(); // 0: 이면 NonCheck 1이면 Check 해당 그룹을 클릭해서 불러왔는가는 체크
  161. var arIsGroupContainer = new Array(); // 그룹 컨테이너
  162. // 만족도 설문지화면에 그리는 함수
  163. var elementName = Array("xforms:choices", "xforms:item", "xforms:label");
  164. function printChildrenEelementName (prnt) {
  165. var chld = prnt.children;
  166. textarea1.value = textarea1.value + prnt.elementName + "\n";
  167. for (var i = 0; i < chld.length; i ++) {
  168. var elementName = chld.item(i).elementName;
  169. if (elementName == "xforms:choices" || elementName == "xforms:item" || elementName == "xforms:label" ) {
  170. printChildrenEelementName(chld.item(i));
  171. } else {
  172. textarea1.value = textarea1.value + elementName + "\n";
  173. }
  174. }
  175. }
  176. function fnQestItemPrint(pGroupIndex, pQpaprseqno, pQestitemgrupseqno) {
  177. if (arIsGroupClick[pGroupIndex] == "0") {
  178. model.setValue("/root/send/qpaprseqno", pQpaprseqno);
  179. model.setValue("/root/send/qestitemgrupseqno", pQestitemgrupseqno);
  180. var columns = new Array("qestitemgrupseqno", "qestitemgrupnm", "qestitemgrupdesc", "qestuseyn", "colgstinqestyn", "colgstinqestseqno", "qestseqno" , "qpaprsortseq",
  181. "itemkindcd", "qestitemanswcnt" ,"qestitemanswchoicolcnt" , "qestcnts", "essnanswcnt",
  182. "answseqno", "qestitemanswcnts", "divpnt", "answaddcnts", "figrinptyn",
  183. "addinptyn", "addflgrinptyn", "essninptyn", "norpaddyn", "nextqestseqno",
  184. "descinptyn");
  185. // 설문지 그룹별 미리보기
  186. if (submit("TRCIT00401")){
  187. var nodeList = root.selectNodes("/root/main/qestlist");
  188. // 설문 정보
  189. var poll;
  190. var pre_qestseqno = -1;
  191. var arPreDatas = null;
  192. var arDatas = new Array();
  193. var rowIndex = 0;
  194. var left = 10;
  195. var groupContainer = arIsGroupContainer[pGroupIndex]; // 컨테이너 위치
  196. var top = arGroupTop[pGroupIndex]; //기존에 각 그룹별 시작 위치
  197. var isContinuous = false; // 이전 척도연속 여부
  198. var pollHeight; //맨마지막 Row를 찍을때 시작위치
  199. var grupHeight; //그룹의 크기를 정한다.
  200. grupHeight = parseInt(groups.attribute("height"), 10);
  201. var totDataCnt = 0;
  202. for (var i = 1; i <= nodeList.length; i ++ ) {
  203. var xPath = "/root/main/qestlist[" + i + "]";
  204. var qestseqno= model.getValue(xPath + "/qestseqno");
  205. // 설문 문항 출력
  206. if (qestseqno != pre_qestseqno) {
  207. if( i != 1) {
  208. isContinuous = isIdentical(arPreDatas, arDatas);
  209. if(poll != undefined && poll != null) {
  210. top += parseInt(poll.attribute("height") ,10);
  211. if (!isContinuous) {
  212. top += 10;
  213. } // end if
  214. } // end if
  215. poll = createPoll(groupContainer, arDatas, "/root/value", left, top, !isContinuous);
  216. // Container 크기를 자동으로 늘리기
  217. if (top > grupHeight) {
  218. grupHeight = top;
  219. }
  220. }
  221. arPreDatas = arDatas;
  222. pre_qestseqno = qestseqno;
  223. arDatas = new Array();
  224. rowIndex = 0;
  225. isContinuous = false;
  226. totDataCnt++
  227. } // end i
  228. if(poll != undefined) {
  229. pollHeight = parseInt(poll.attribute("height"));
  230. }
  231. var obj = new Object();
  232. for(var j = 0; j < columns.length; j ++) {
  233. obj[columns[j]] = model.getValue(xPath + "/" + columns[j]);
  234. } // end for
  235. arDatas[rowIndex] = obj;
  236. rowIndex ++;
  237. } // end for
  238. // 맨 마지막 설문문항 찍기
  239. if (totDataCnt == 1 && arDatas.length >0 ) {
  240. top += 10
  241. poll = createPoll(groupContainer, arDatas, "/root/value", left, top, true);
  242. }else if (totDataCnt > 1 && arDatas.length >0 ) {
  243. top = top + parseInt(pollHeight ,10);
  244. var poll = createPoll(groupContainer, arDatas, "/root/value", left, top, false);
  245. if (top > grupHeight) {
  246. grupHeight = top;
  247. }
  248. }
  249. if ( grupHeight > parseInt(groups.attribute("height"), 10) ) {
  250. groups.attribute("height") = grupHeight + 32 + 70; // 마지막으로 Container 크기를 늘린다.
  251. }
  252. arDatas = null;
  253. arPreDatas = null;
  254. }
  255. model.refresh();
  256. arIsGroupClick[pGroupIndex] = "1"; // 한번 읽은 그룹은 다음에 읽지 않게 표시
  257. columns = null;
  258. }
  259. }
  260. ]]>
  261. </script>
  262. </xhtml:head>
  263. <xhtml:body pagewidth="1000" pageheight="800" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
  264. <switch id="groups" style="left:20px; top:30px; width:875px; height:740px; border-width:1px; border-style:solid; "/>
  265. <group id="bgroup" style="left:830px; top:0px; width:65px; height:27px; ">
  266. <button id="button9" class="btn4_letter2" style="left:4px; top:2px; width:56px; height:22px; ">
  267. <caption>닫기</caption>
  268. <close ev:event="DOMActivate"/>
  269. </button>
  270. </group>
  271. </xhtml:body>
  272. </xhtml:html>