SPCIT00200_만족도설문미리보기.xrw 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <!--
  3. * Name : SPCIT00200_만족도설문 미리보기
  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. <qestlist>
  20. <qestitemgrupseqno/>
  21. <qestitemgrupnm/>
  22. <qestitemgrupdesc/>
  23. <qestuseyn/>
  24. <colgstinqestyn/>
  25. <colgstinqestseqno/>
  26. <qestseqno/>
  27. <qpaprsortseq/>
  28. <itemkindcd/>
  29. <qestitemanswcnt/>
  30. <qestitemanswchoicolcnt/>
  31. <qestcnts/>
  32. <essnanswcnt/>
  33. <answseqno/>
  34. <qestitemanswcnts/>
  35. <divpnt/>
  36. <answaddcnts/>
  37. <figrinptyn/>
  38. <addinptyn/>
  39. <addflgrinptyn/>
  40. <essninptyn/>
  41. <norpaddyn/>
  42. <nextqestseqno/>
  43. <descinptyn/>
  44. </qestlist>
  45. </main>
  46. <send>
  47. <qestseqno/>
  48. <qestitemgrupseqno/>
  49. <qestitemlrgcd/>
  50. <qestitemmdlcd/>
  51. </send>
  52. </root>
  53. </instance>
  54. <submission id="TRCIT00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/qestlist"/>
  55. </model>
  56. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  57. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  58. <script type="javascript" src="../../../crm/cssaweb/js/CSZ001.js"/>
  59. <script type="javascript" ev:event="xforms-ready">
  60. <![CDATA[
  61. // 부모창의 설문지 일련번호를 가져온다.
  62. var qestseqno = opener.window.javascript.getParameter("qestseqno");
  63. var qestitemgrupseqno = opener.window.javascript.getParameter("qestitemgrupseqno");
  64. var qestitemlrgcd = opener.window.javascript.getParameter("qestitemlrgcd");
  65. var qestitemmdlcd = opener.window.javascript.getParameter("qestitemmdlcd");
  66. model.setValue("/root/send/qestseqno", qestseqno);
  67. model.setValue("/root/send/qestitemgrupseqno", qestitemgrupseqno);
  68. model.setValue("/root/send/qestitemlrgcd", qestitemlrgcd);
  69. model.setValue("/root/send/qestitemmdlcd", qestitemmdlcd);
  70. var columns = new Array("qestitemgrupseqno", "qestitemgrupnm", "qestitemgrupdesc", "qestuseyn", "colgstinqestyn", "colgstinqestseqno", "qestseqno" , "qpaprsortseq",
  71. "itemkindcd", "qestitemanswcnt" ,"qestitemanswchoicolcnt" , "qestcnts", "essnanswcnt",
  72. "answseqno", "qestitemanswcnts", "divpnt", "answaddcnts", "figrinptyn",
  73. "addinptyn", "addflgrinptyn", "essninptyn", "norpaddyn", "nextqestseqno",
  74. "descinptyn");
  75. // 설문지 미리보기을 조회 한다.
  76. if (submit("TRCIT00201")){
  77. var nodeList = root.selectNodes("/root/main/qestlist");
  78. // 그룹 정보
  79. var inLeft = 20;
  80. var inTop = 40;
  81. var groupContainer = body;
  82. var groupIndex = 0;
  83. var buttons = new Array();
  84. var selectIndex = 0;
  85. // 설문 정보
  86. var poll;
  87. var pre_qestseqno = -1;
  88. var arPreDatas = null;
  89. var arDatas = new Array();
  90. var rowIndex = 0;
  91. var totDataCnt = 0;
  92. var left = 10;
  93. var top = 0;
  94. var isContinuous = false; // 이전 척도연속 여부
  95. var pollHeight; //맨마지막 Row를 찍을때 시작위치
  96. var grupHeight; //그룹의 크기를 정한다.
  97. grupHeight = parseInt(groups.attribute("height"), 10);
  98. for (var i = 1; i <= nodeList.length; i ++ ) {
  99. var xPath = "/root/main/qestlist[" + i + "]";
  100. var qestitemgrupseqno = model.getValue(xPath + "/qestitemgrupseqno");
  101. var qestseqno= model.getValue(xPath + "/qestseqno");
  102. // 처음만 한번 찍는다.
  103. if (i == 1) {
  104. var button =makeButton(body, model.getValue(xPath + "/qestitemgrupnm"), 0, 0);
  105. button.attribute("group") = "answers";
  106. button.attribute("onclick") = "groups.selectedIndex = " + groupIndex +";";
  107. button.visible = false;
  108. var buttonWidth = parseInt(button.attribute("width"), 10);
  109. if (inLeft + buttonWidth > 800) {
  110. inTop += 20;
  111. inLeft = 20;
  112. } else {
  113. inLeft += buttonWidth;
  114. } // end if
  115. buttons[groupIndex] = button;
  116. groupContainer = makeCase(groups, "group_" + groupIndex, 0, 0, 800, 1000);
  117. var explOutput = makeOutput(groupContainer, model.getValue(xPath + "/qestitemgrupdesc"), 10, 20, 760);
  118. top = 20 + parseInt(explOutput.attribute("height"), 10);
  119. } // end if
  120. // 설문 문항 출력
  121. if (qestseqno != pre_qestseqno) {
  122. if( i != 1) {
  123. isContinuous = isIdentical(arPreDatas, arDatas);
  124. if(poll != undefined && poll != null) {
  125. top += parseInt(poll.attribute("height") ,10);
  126. if (!isContinuous) {
  127. top += 10;
  128. } // end if
  129. } // end if
  130. poll = createPoll(groupContainer, arDatas, "/root/value", left, top, !isContinuous);
  131. // Container 크기를 자동으로 늘리기
  132. if (top > grupHeight) {
  133. grupHeight = top;
  134. }
  135. }
  136. arPreDatas = arDatas;
  137. pre_qestseqno = qestseqno;
  138. arDatas = new Array();
  139. rowIndex = 0;
  140. isContinuous = false;
  141. totDataCnt++
  142. } // end i
  143. if(poll != undefined) {
  144. pollHeight = parseInt(poll.attribute("height"), 10);
  145. }
  146. var obj = new Object();
  147. for(var j = 0; j < columns.length; j ++) {
  148. obj[columns[j]] = model.getValue(xPath + "/" + columns[j]);
  149. } // end for
  150. arDatas[rowIndex] = obj;
  151. rowIndex ++;
  152. } // end for
  153. //맨마지막 줄 화면에 출력
  154. if (totDataCnt == 1 && arDatas.length >0 ) {
  155. top += 10
  156. poll = createPoll(groupContainer, arDatas, "/root/value", left, top, true);
  157. }else if (totDataCnt > 1 && arDatas.length >0 ) {
  158. top = top + pollHeight;
  159. var poll = createPoll(groupContainer, arDatas, "/root/value", left, top, false);
  160. // Container 크기를 자동으로 늘리기
  161. if (top > grupHeight) {
  162. grupHeight = top;
  163. }
  164. } // end i
  165. buttons[selectIndex].selected = true;
  166. groups.selectedIndex = selectIndex;
  167. groups.attribute("top") = inTop + 20;
  168. // Tab버튼 위치 조정
  169. inLeft = 20;
  170. var button = buttons[groupIndex];
  171. var buttonWidth = parseInt(button.attribute("width"), 10);
  172. if (inLeft + buttonWidth > 800) {
  173. inTop -= 20;
  174. inLeft = 20;
  175. }
  176. button.attribute("top") = inTop;
  177. button.attribute("left") = inLeft;
  178. button.visible = true;
  179. inLeft += buttonWidth;
  180. if ( grupHeight > parseInt(groups.attribute("height"), 10) ) {
  181. groups.attribute("height") = grupHeight + 32 + 70; // 마지막으로 Container 크기를 늘린다.
  182. }
  183. // groups.refresh();
  184. arDatas = null;
  185. arPreDatas = null;
  186. buttons = null;
  187. }
  188. model.refresh();
  189. columns = null;
  190. ]]>
  191. </script>
  192. <script type="javascript" ev:event="xforms-model-construct">
  193. <![CDATA[
  194. /*
  195. */
  196. ]]>
  197. </script>
  198. <script type="javascript">
  199. <![CDATA[
  200. // 만족도 설문지화면에 그리는 함수
  201. ]]>
  202. </script>
  203. </xhtml:head>
  204. <xhtml:body pagewidth="1000" pageheight="800" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
  205. <switch id="groups" style="left:20px; top:30px; width:875px; height:740px; border-width:1px; border-style:solid; "/>
  206. <group id="bgroup" style="left:830px; top:0px; width:65px; height:27px; ">
  207. <button id="button9" class="btn4_letter2" style="left:4px; top:2px; width:56px; height:22px; ">
  208. <caption>닫기</caption>
  209. <close ev:event="DOMActivate"/>
  210. </button>
  211. </group>
  212. </xhtml:body>
  213. </xhtml:html>