123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <!--
- * Name : SPCIT00400_만족도설문지미리보기
- * Summary : 만족도 설문지 미리보기
- * Programmer : 신용준
- * Date Written : 2010.11.11
- * History :
- * Remark :
- -->
- <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
- <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">
- <xhtml:head>
- <xhtml:title>만족도 설문지 미리보기</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <codes/>
- <main>
- <qestlistGrp>
- <qestitemgrupseqno/>
- <qestitemgrupnm/>
- <qestitemgrupdesc/>
- <qestuseyn/>
- <colgstinqestyn/>
- <colgstinqestseqno/>
- </qestlistGrp>
- <qestlist>
- <qestitemgrupseqno/>
- <qestitemgrupnm/>
- <qestitemgrupdesc/>
- <qestuseyn/>
- <colgstinqestyn/>
- <colgstinqestseqno/>
- <qestseqno/>
- <qpaprsortseq/>
- <itemkindcd/>
- <qestitemanswcnt/>
- <qestitemanswchoicolcnt/>
- <qestcnts/>
- <essnanswcnt/>
- <answseqno/>
- <qestitemanswcnts/>
- <divpnt/>
- <answaddcnts/>
- <figrinptyn/>
- <addinptyn/>
- <addflgrinptyn/>
- <essninptyn/>
- <norpaddyn/>
- <nextqestseqno/>
- <descinptyn/>
- </qestlist>
- </main>
- <send>
- <qpaprseqno/>
- <qestitemgrupseqno/>
- </send>
- </root>
- </instance>
- <submission id="TRCIT00402" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/qestlistGrp"/>
- <submission id="TRCIT00401" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/qestlist"/>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../crm/cssaweb/js/CSZ001.js"/>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- // 부모창의 설문지 일련번호를 가져온다.
- var qpaprseqno = opener.window.javascript.getParameter("qpaprseqno");
- model.setValue("/root/send/qpaprseqno", qpaprseqno);
- var tempqestitemgrupseqno = "";
- // 설문지 미리보기(먼저 그룹을 조회함)을 조회 한다.
- if (submit("TRCIT00402")){
- var nodeList = root.selectNodes("/root/main/qestlistGrp");
- // 그룹 정보
- var inLeft = 20;
- var inTop = 40;
- var groupContainer = body;
- var groupIndex = 0;
- var buttons = new Array();
- var selectIndex = 0;
-
- for (var i = 1; i <= nodeList.length; i ++ ) {
- var xPath = "/root/main/qestlistGrp[" + i + "]";
- var qestitemgrupseqno = model.getValue(xPath + "/qestitemgrupseqno");
- var qestseqno= model.getValue(xPath + "/qestseqno");
- var button = makeButton(body, model.getValue(xPath + "/qestitemgrupnm"), 0, 0);
- var sfuncall = "";
- button.attribute("group") = "answers";
-
- //첫번째 그룹 시퀀스를 저장해 놨다가 나중에 그 페이지만 먼저 화면에 뿌린다.
- if (i == 1) {
- tempqestitemgrupseqno = qestitemgrupseqno;
- }
-
- sfuncall = "fnQestItemPrint(" + groupIndex + ", " + qpaprseqno + ", " + qestitemgrupseqno + "); ";
- sfuncall = sfuncall + "groups.selectedIndex = " + groupIndex +";";
- button.attribute("onclick") = sfuncall;
- button.visible = false;
- var buttonWidth = parseInt(button.attribute("width"), 10);
-
- if (inLeft + buttonWidth > 800) {
- inTop += 20;
- inLeft = 20;
- } else {
- inLeft += buttonWidth;
- } // end if
- buttons[groupIndex] = button;
-
- groupContainer = makeCase(groups, "group_" + groupIndex, 0, 0, 800, 1000);
- var explOutput = makeOutput(groupContainer, model.getValue(xPath + "/qestitemgrupdesc"), 10, 20, 760);
-
- arIsGroupContainer[groupIndex] = groupContainer;
- arGroupTop[groupIndex] = 20 + parseInt(explOutput.attribute("height"), 10); // 각각의 그룹에 시작할 위치를 미리 전역 배열에 넣어 놓는다.
- arIsGroupClick[groupIndex] = "0" // 0: 이면 NonCheck 1이면 Check 해당 그룹을 클릭해서 불러왔는가는 체크
- groupIndex ++;
- } // end for
-
- buttons[selectIndex].selected = true;
- groups.selectedIndex = selectIndex;
- groups.attribute("top") = inTop + 20;
-
- // Tab버튼 위치 조정
- inLeft = 20;
- for (var i = 0; i< buttons.length; i ++) {
- var button = buttons[i];
- var buttonWidth = parseInt(button.attribute("width"), 10);
-
- if (inLeft + buttonWidth > 800) {
- inTop -= 20;
- inLeft = 20;
- }
- button.attribute("top") = inTop;
- button.attribute("left") = inLeft;
- button.visible = true;
- inLeft += buttonWidth;
- } // end for
- // groups.refresh();
- buttons = null;
- // 첫패이지는 일단 뿌린다.
- fnQestItemPrint(selectIndex, qpaprseqno, tempqestitemgrupseqno);
- }
- model.refresh();
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-model-construct">
- <![CDATA[
- /*
- var nodeSet = new Array();
- for (var i = 0; i < 5; i++) {
- nodeSet[i] = {"label": "sdfasdfasfasfdasdfafasdf" + i , "value":"value" + i};
- }
- var top = 0;
- var radio = makeRadio(body, "rd1", "/root/example", "/root/codes", nodeSet, 1, 0, top);
- top = top + parseInt(radio.attribute("height") ,10);
- var check = makeCheckbox(body, "ck1", "/root/example", "/root/codes", nodeSet, 1, 0, top, 200);
- top = top + parseInt(check.attribute("height") ,10);
-
- var combo = makeCombo(body, "cb1", "/root/example", "/root/codes", nodeSet, 1, 0, top, 200);
- top = top + parseInt(combo.attribute("height") ,10);
-
- var input = makeInput(body, "ip1", "/root/example", 0, top, 200);
- top = top + parseInt(input.attribute("height") ,10);
-
- var textarea = makeTextarea(body, "ta1", "/root/example", 0, top);
- */
- ]]>
- </script>
- <script type="javascript">
- <![CDATA[
-
- var arGroupTop = new Array(); //각각의 그룹에 시작할 위치를 미리 전역 배열에 넣어 놓는다.
- var arIsGroupClick = new Array(); // 0: 이면 NonCheck 1이면 Check 해당 그룹을 클릭해서 불러왔는가는 체크
- var arIsGroupContainer = new Array(); // 그룹 컨테이너
- // 만족도 설문지화면에 그리는 함수
- var elementName = Array("xforms:choices", "xforms:item", "xforms:label");
- function printChildrenEelementName (prnt) {
- var chld = prnt.children;
- textarea1.value = textarea1.value + prnt.elementName + "\n";
-
- for (var i = 0; i < chld.length; i ++) {
- var elementName = chld.item(i).elementName;
- if (elementName == "xforms:choices" || elementName == "xforms:item" || elementName == "xforms:label" ) {
- printChildrenEelementName(chld.item(i));
- } else {
- textarea1.value = textarea1.value + elementName + "\n";
- }
- }
- }
- function fnQestItemPrint(pGroupIndex, pQpaprseqno, pQestitemgrupseqno) {
- if (arIsGroupClick[pGroupIndex] == "0") {
- model.setValue("/root/send/qpaprseqno", pQpaprseqno);
- model.setValue("/root/send/qestitemgrupseqno", pQestitemgrupseqno);
-
- var columns = new Array("qestitemgrupseqno", "qestitemgrupnm", "qestitemgrupdesc", "qestuseyn", "colgstinqestyn", "colgstinqestseqno", "qestseqno" , "qpaprsortseq",
- "itemkindcd", "qestitemanswcnt" ,"qestitemanswchoicolcnt" , "qestcnts", "essnanswcnt",
- "answseqno", "qestitemanswcnts", "divpnt", "answaddcnts", "figrinptyn",
- "addinptyn", "addflgrinptyn", "essninptyn", "norpaddyn", "nextqestseqno",
- "descinptyn");
-
- // 설문지 그룹별 미리보기
- if (submit("TRCIT00401")){
- var nodeList = root.selectNodes("/root/main/qestlist");
- // 설문 정보
- var poll;
- var pre_qestseqno = -1;
- var arPreDatas = null;
- var arDatas = new Array();
- var rowIndex = 0;
- var left = 10;
- var groupContainer = arIsGroupContainer[pGroupIndex]; // 컨테이너 위치
- var top = arGroupTop[pGroupIndex]; //기존에 각 그룹별 시작 위치
- var isContinuous = false; // 이전 척도연속 여부
- var pollHeight; //맨마지막 Row를 찍을때 시작위치
- var grupHeight; //그룹의 크기를 정한다.
- grupHeight = parseInt(groups.attribute("height"), 10);
- var totDataCnt = 0;
-
- for (var i = 1; i <= nodeList.length; i ++ ) {
- var xPath = "/root/main/qestlist[" + i + "]";
- var qestseqno= model.getValue(xPath + "/qestseqno");
-
- // 설문 문항 출력
- if (qestseqno != pre_qestseqno) {
- if( i != 1) {
- isContinuous = isIdentical(arPreDatas, arDatas);
- if(poll != undefined && poll != null) {
- top += parseInt(poll.attribute("height") ,10);
- if (!isContinuous) {
- top += 10;
- } // end if
- } // end if
- poll = createPoll(groupContainer, arDatas, "/root/value", left, top, !isContinuous);
- // Container 크기를 자동으로 늘리기
- if (top > grupHeight) {
- grupHeight = top;
- }
- }
- arPreDatas = arDatas;
- pre_qestseqno = qestseqno;
- arDatas = new Array();
- rowIndex = 0;
- isContinuous = false;
- totDataCnt++
- } // end i
-
- if(poll != undefined) {
- pollHeight = parseInt(poll.attribute("height"));
- }
-
- var obj = new Object();
-
- for(var j = 0; j < columns.length; j ++) {
- obj[columns[j]] = model.getValue(xPath + "/" + columns[j]);
- } // end for
- arDatas[rowIndex] = obj;
- rowIndex ++;
- } // end for
-
- // 맨 마지막 설문문항 찍기
- if (totDataCnt == 1 && arDatas.length >0 ) {
- top += 10
- poll = createPoll(groupContainer, arDatas, "/root/value", left, top, true);
- }else if (totDataCnt > 1 && arDatas.length >0 ) {
- top = top + parseInt(pollHeight ,10);
- var poll = createPoll(groupContainer, arDatas, "/root/value", left, top, false);
- if (top > grupHeight) {
- grupHeight = top;
- }
- }
- if ( grupHeight > parseInt(groups.attribute("height"), 10) ) {
- groups.attribute("height") = grupHeight + 32 + 70; // 마지막으로 Container 크기를 늘린다.
- }
- arDatas = null;
- arPreDatas = null;
- }
- model.refresh();
- arIsGroupClick[pGroupIndex] = "1"; // 한번 읽은 그룹은 다음에 읽지 않게 표시
- columns = null;
- }
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="1000" pageheight="800" style="margin-left:8; margin-top:8; margin-right:8; margin-bottom:8; ">
- <switch id="groups" style="left:20px; top:30px; width:875px; height:740px; border-width:1px; border-style:solid; "/>
- <group id="bgroup" style="left:830px; top:0px; width:65px; height:27px; ">
- <button id="button9" class="btn4_letter2" style="left:4px; top:2px; width:56px; height:22px; ">
- <caption>닫기</caption>
- <close ev:event="DOMActivate"/>
- </button>
- </group>
- </xhtml:body>
- </xhtml:html>
|