123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/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">
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <xhtml:head>
- <xhtml:title>메시지 읽기</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <pid/>
- <!-- 환자아이디 -->
- <hngnm/>
- <!-- 환자명 -->
- <trsmrnm/>
- <!-- 보낸이 -->
- <trsmrid/>
- <!-- 보낸이 ID -->
- <trsmreqdt/>
- <!-- 송신시간 -->
- <msgcnts/>
- <!-- 메세지 -->
- <recvcnfmyn/>
- <!-- 메세지확인여부 -->
- <msgtype/>
- <!-- 메세지 종류 -->
- </main>
- <temp/>
- <send>
- <writemsg>
- <recvrid/>
- <msgcnts/>
- <msgtype>3</msgtype>
- <rdo>U</rdo>
- </writemsg>
- </send>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- /*
- textarea.value = String 이 적용되지 않는 문제로 2007.09.21 instance node 생성 및 매핑작업.
- 인스턴스와 매핑한 control 에 대해서는 get/set 작업을 하지 않음.
- recvcnfmyn (메세지확인여부), trsmreqdt (송신시간) 은 인스턴스와 매핑하지 않음.
- */
- if (!checkAuth("x")) { // 화면 권한 체크
- var recvcnfmyn = model.getValue("/root/main/recvcnfmyn");//메세지 확인 여부
- if (recvcnfmyn == "Y") {
- btn_confirm.visible = false; // 확인버튼
- cap_msgconfirm.value = "이미 읽은 메세지 입니다.";
- } else if (recvcnfmyn == "N") { // 읽지 않은 메세지인 경우 자동으로 읽음으로 변경.
- model.setValue("/root/main/recvcnfmyn", "Y"); // 읽은 메세지로 설정
- submit("TXZMI00201");
- cap_msgconfirm.value = "메세지를 확인하셨습니다.";
- }
- btn_close.visible = true; // 닫기버튼
- btn_delmsg.visible = true; // 삭제버튼
- cap_msgconfirm.visible = true; // 보내기버튼
-
- /*
- opt_pid.value = model.getValue("/root/main/pid"); //환자 id
- opt_hngnm.value = model.getValue("/root/main/hngnm"); //환자명
- opt_trsmrnm.value = model.getValue("/root/main/trsmrnm"); //보낸사람
- opt_trsmrid.value = model.getValue("/root/main/trsmrid");//송신자 ID
- opt_msgtype.value = model.getValue("/root/main/msgtype"); // 메세지 종류
- tar_rsvmsgcnts.value = model.getValue("/root/main/msgcnts"); //메세지
- */
- var tdate = model.getValue("/root/main/trsmreqdt");//송신시간
- opt_trsmreqdt.value = tdate.substring(-1,4) + "." + tdate.substring(4,6) + "." + tdate.substring(6,8) +" " + tdate.substring(8,10) + ":" + tdate.substring(10,12); //도착시간
-
- btn_reply.visible = true;
- btn_confirm.visible = false; // 확인버튼 disable
- btn_close.visible = true; // 닫기버튼 enable
-
- model.setFocus("tar_msgcnts");
- }
- ]]>
- </script>
- <submission id="TXZMI00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/main" replace="instance" resultref="/root/temp"/>
- <submission id="TRZMI00103" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/main" replace="instance" resultref="/root/temp"/>
- <submission id="TXZMI00202" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/writemsg" resultref="/root/temp"/>
- </model>
- <script type="javascript">
- <![CDATA[
- // 콤보박스 name/code 쌍 정의 : 2007.09.22 김기호
- gv_comboread = "읽음"; //읽음
- gv_combounread = "읽지않음"; //읽지않음
- /*
- * 메시지 길이 체크
- */
- function calculate_msglen(aro_name, ari_max)
- {
- var ls_str = aro_name; // 이벤트 일어난 컨트롤ㄹ의 value
- var li_str_len = ls_str.length; // 전체 길이
-
- var li_max = ari_max;
- var i = 0;
- var li_byte = 0;
- var li_len = 0;
- var ls_one_car = "";
- var ls_str2 = "";
-
- for (i=0; i<li_str_len; i++)
- {
- //한글 추출
- ls_one_char = ls_str.charAt(i);
-
- // 한글이면 2를 더한다.
- if(escape(ls_one_char).length > 4)
- {
- li_byte += 3;
- }
- else
- {
- //그밖의 경우 1을 더한다.
- li_byte++;
- }
-
- // 전체 크기가 li_max가 넘지 않으면
- if (li_byte <= li_max)
- {
- li_len = i + 1;
- }
- }
-
- // 전체 길이 초과하면
- if (li_byte > li_max)
- {
- messageBox("100글자를 초과 입력할 수 없습니다.\n초과된 내용은 자동으로 삭제","I001");
- ls_str2 = ls_str.substr(0,li_len);
- model.setValue("/root/main/msgcnts",ls_str2);
- model.refresh();
- return;
- }
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="425" pageheight="460">
- <textarea id="tar_msgcnts" ref="/root/send/writemsg/msgcnts" style="left:15px; top:290px; width:395px; height:130px; "/>
- <caption id="caption3" class="tit_2" style="left:10px; top:8px; width:87px; height:14px; ">메세지 읽기</caption>
- <button id="btn_confirm" class="btn4_letter2" disabled="false" visibility="hidden" style="left:355px; top:430px; width:56px; height:22px; ">
- <caption>확인</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- submit("TXZMI00201");
- opener.javaScript.model.resetInstanceNode("/root/main/list_receive");
- opener.javaScript.submit("TRZMI00101");
- opener.javaScript.grd_receive.rebuildStyle();
- opener.javaScript.setRowStyle("grd_receive" , "2" , gv_combounread, "recvcnfmyn");
- model.close()
- ]]>
- </script>
- </button>
- <output id="opt_trsmrnm" ref="/root/main/trsmrnm" style="left:110px; top:35px; width:100px; height:19px; "/>
- <output id="opt_trsmreqdt" style="left:110px; top:85px; width:100px; height:19px; "/>
- <output id="opt_msgtype" ref="/root/main/msgtype" style="left:320px; top:85px; width:90px; height:19px; "/>
- <output id="opt_trsmrid" ref="/root/main/trsmrid" style="left:110px; top:60px; width:100px; height:19px; "/>
- <output id="opt_hngnm" ref="/root/main/hngnm" style="left:320px; top:35px; width:90px; height:19px; "/>
- <output id="opt_pid" ref="/root/main/pid" style="left:320px; top:60px; width:90px; height:19px; "/>
- <button id="btn_close" class="btn4_letter2" disabled="false" visibility="hidden" style="left:355px; top:430px; width:56px; height:22px; ">
- <caption>닫기</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- // 메세지함의 메세지 리스트 초기화
- opener.javaScript.model.resetInstanceNode("/root/main/list_receive");
- // 다시 조회
- opener.javaScript.submit("TRZMI00101");
- opener.javaScript.grd_receive.rebuildStyle();
- opener.javaScript.setRowStyle("grd_receive" , "2" , gv_combounread, "recvcnfmyn");
- window.close();
- ]]>
- </script>
- </button>
- <caption id="cap_msgconfirm" visibility="hidden" style="left:15px; top:431px; width:156px; height:20px; ">* 메세지를 확인하셨습니다.</caption>
- <line id="line1" class="line_1" style="x1:10px; y1:30px; x2:410px; y2:30px; "/>
- <caption id="cap_senderid" class="cell_1" style="left:10px; top:59px; width:100px; height:23px; vertical-align:middle; ">보낸이 ID</caption>
- <caption id="cap_sender" class="cell_1" style="left:10px; top:34px; width:100px; height:23px; font-family:돋움; vertical-align:middle; ">보낸이</caption>
- <caption id="cap_sendtime" class="cell_1" style="left:10px; top:84px; width:100px; height:23px; vertical-align:middle; ">송신시간</caption>
- <caption id="cap_msgtype" class="cell_1" style="left:220px; top:84px; width:100px; height:23px; vertical-align:middle; ">메시지 종류</caption>
- <caption id="cap_pid" class="cell_1" style="left:220px; top:59px; width:100px; height:23px; vertical-align:middle; ">환자 ID</caption>
- <caption id="cap_hngnm" class="cell_1" style="left:220px; top:34px; width:100px; height:23px; font-family:돋움; vertical-align:middle; ">환자명</caption>
- <textarea id="tar_rsvmsgcnts" ref="/root/main/msgcnts" disabled="true" style="left:15px; top:135px; width:395px; height:125px; "/>
- <button id="btn_reply" class="btn4_letter3" visibility="hidden" style="left:282px; top:430px; width:68px; height:22px; ">
- <caption>보내기</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- var msg = model.getValue("/root/send/writemsg/msgcnts");
- calculate_msglen(msg, 300);
-
- if (tar_msgcnts.value == "") {
- messageBox("메시지는 필수로 ", "C001");
- } else {
- model.setValue("/root/send/writemsg/recvrid", model.getValue("/root/main/trsmrid"));
- submit("TXZMI00202");
- model.refresh();
-
- if (model.getValue("/root/temp/succnt/getV") > 0) {
- messageBox("메시지 전송이 ", "I002");
- } else {
- messageBox("메시지 전송이 ","E009");
- }
- }
- ]]>
- </script>
- </button>
- <button id="btn_delmsg" class="btn4_letter2" disabled="false" visibility="hidden" style="left:220px; top:430px; width:56px; height:22px; ">
- <caption>삭제</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- window.close();
- ]]>
- </script>
- </button>
- <caption id="caption1" visibility="visible" style="left:10px; top:115px; width:156px; height:20px; ">* 받은 메시지</caption>
- <caption id="caption2" visibility="visible" style="left:10px; top:270px; width:156px; height:20px; ">* 보낼 메시지</caption>
- <button id="btn_addreceivemsg" class="btn2_letter7" style="left:313px; top:268px; width:97px; height:19px; ">
- <caption>받은메시지포함</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- // 내용이 지워졌음에도 포커스가 이전의 입력위치로 이동하는 것을 막기위해 포커스 아웃/ 재 포커스
- var currentText = tar_msgcnts.currentText;
- var replymsg = "\n\n=======================\n" + model.getValue("/root/main/msgcnts");
- replymsg = currentText + replymsg;
- model.setValue("/root/send/writemsg/msgcnts", replymsg);
- model.setFocus("tar_msgcnts");
- model.refresh();
- ]]>
- </script>
- </button>
- </xhtml:body>
- </xhtml:html>
|