SPZMI00201_받은메시지읽기.xrw 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <?xml version="1.0" encoding="EUC-KR"?>
  2. <?xml-stylesheet href="../../../com/commonweb/css/common.css" type="text/css" ?>
  3. <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">
  4. <script type="javascript" src="../../../com/commonweb/js/common.js"/>
  5. <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
  6. <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
  7. <xhtml:head>
  8. <xhtml:title>메시지 읽기</xhtml:title>
  9. <model id="model1">
  10. <instance id="instance1">
  11. <root xmlns="">
  12. <main>
  13. <pid/>
  14. <!-- 환자아이디 -->
  15. <hngnm/>
  16. <!-- 환자명 -->
  17. <trsmrnm/>
  18. <!-- 보낸이 -->
  19. <trsmrid/>
  20. <!-- 보낸이 ID -->
  21. <trsmreqdt/>
  22. <!-- 송신시간 -->
  23. <msgcnts/>
  24. <!-- 메세지 -->
  25. <recvcnfmyn/>
  26. <!-- 메세지확인여부 -->
  27. <msgtype/>
  28. <!-- 메세지 종류 -->
  29. </main>
  30. <temp/>
  31. <send>
  32. <writemsg>
  33. <recvrid/>
  34. <msgcnts/>
  35. <msgtype>3</msgtype>
  36. <rdo>U</rdo>
  37. </writemsg>
  38. </send>
  39. </root>
  40. </instance>
  41. <script type="javascript" ev:event="xforms-ready">
  42. <![CDATA[
  43. /*
  44. textarea.value = String 이 적용되지 않는 문제로 2007.09.21 instance node 생성 및 매핑작업.
  45. 인스턴스와 매핑한 control 에 대해서는 get/set 작업을 하지 않음.
  46. recvcnfmyn (메세지확인여부), trsmreqdt (송신시간) 은 인스턴스와 매핑하지 않음.
  47. */
  48. if (!checkAuth("x")) { // 화면 권한 체크
  49. var recvcnfmyn = model.getValue("/root/main/recvcnfmyn");//메세지 확인 여부
  50. if (recvcnfmyn == "Y") {
  51. btn_confirm.visible = false; // 확인버튼
  52. cap_msgconfirm.value = "이미 읽은 메세지 입니다.";
  53. } else if (recvcnfmyn == "N") { // 읽지 않은 메세지인 경우 자동으로 읽음으로 변경.
  54. model.setValue("/root/main/recvcnfmyn", "Y"); // 읽은 메세지로 설정
  55. submit("TXZMI00201");
  56. cap_msgconfirm.value = "메세지를 확인하셨습니다.";
  57. }
  58. btn_close.visible = true; // 닫기버튼
  59. btn_delmsg.visible = true; // 삭제버튼
  60. cap_msgconfirm.visible = true; // 보내기버튼
  61. /*
  62. opt_pid.value = model.getValue("/root/main/pid"); //환자 id
  63. opt_hngnm.value = model.getValue("/root/main/hngnm"); //환자명
  64. opt_trsmrnm.value = model.getValue("/root/main/trsmrnm"); //보낸사람
  65. opt_trsmrid.value = model.getValue("/root/main/trsmrid");//송신자 ID
  66. opt_msgtype.value = model.getValue("/root/main/msgtype"); // 메세지 종류
  67. tar_rsvmsgcnts.value = model.getValue("/root/main/msgcnts"); //메세지
  68. */
  69. var tdate = model.getValue("/root/main/trsmreqdt");//송신시간
  70. opt_trsmreqdt.value = tdate.substring(-1,4) + "." + tdate.substring(4,6) + "." + tdate.substring(6,8) +" " + tdate.substring(8,10) + ":" + tdate.substring(10,12); //도착시간
  71. btn_reply.visible = true;
  72. btn_confirm.visible = false; // 확인버튼 disable
  73. btn_close.visible = true; // 닫기버튼 enable
  74. model.setFocus("tar_msgcnts");
  75. }
  76. ]]>
  77. </script>
  78. <submission id="TXZMI00201" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/main" replace="instance" resultref="/root/temp"/>
  79. <submission id="TRZMI00103" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/main" replace="instance" resultref="/root/temp"/>
  80. <submission id="TXZMI00202" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send/writemsg" resultref="/root/temp"/>
  81. </model>
  82. <script type="javascript">
  83. <![CDATA[
  84. // 콤보박스 name/code 쌍 정의 : 2007.09.22 김기호
  85. gv_comboread = "읽음"; //읽음
  86. gv_combounread = "읽지않음"; //읽지않음
  87. /*
  88. * 메시지 길이 체크
  89. */
  90. function calculate_msglen(aro_name, ari_max)
  91. {
  92. var ls_str = aro_name; // 이벤트 일어난 컨트롤ㄹ의 value
  93. var li_str_len = ls_str.length; // 전체 길이
  94. var li_max = ari_max;
  95. var i = 0;
  96. var li_byte = 0;
  97. var li_len = 0;
  98. var ls_one_car = "";
  99. var ls_str2 = "";
  100. for (i=0; i<li_str_len; i++)
  101. {
  102. //한글 추출
  103. ls_one_char = ls_str.charAt(i);
  104. // 한글이면 2를 더한다.
  105. if(escape(ls_one_char).length > 4)
  106. {
  107. li_byte += 3;
  108. }
  109. else
  110. {
  111. //그밖의 경우 1을 더한다.
  112. li_byte++;
  113. }
  114. // 전체 크기가 li_max가 넘지 않으면
  115. if (li_byte <= li_max)
  116. {
  117. li_len = i + 1;
  118. }
  119. }
  120. // 전체 길이 초과하면
  121. if (li_byte > li_max)
  122. {
  123. messageBox("100글자를 초과 입력할 수 없습니다.\n초과된 내용은 자동으로 삭제","I001");
  124. ls_str2 = ls_str.substr(0,li_len);
  125. model.setValue("/root/main/msgcnts",ls_str2);
  126. model.refresh();
  127. return;
  128. }
  129. }
  130. ]]>
  131. </script>
  132. </xhtml:head>
  133. <xhtml:body pagewidth="425" pageheight="460">
  134. <textarea id="tar_msgcnts" ref="/root/send/writemsg/msgcnts" style="left:15px; top:290px; width:395px; height:130px; "/>
  135. <caption id="caption3" class="tit_2" style="left:10px; top:8px; width:87px; height:14px; ">메세지 읽기</caption>
  136. <button id="btn_confirm" class="btn4_letter2" disabled="false" visibility="hidden" style="left:355px; top:430px; width:56px; height:22px; ">
  137. <caption>확인</caption>
  138. <script type="javascript" ev:event="DOMActivate">
  139. <![CDATA[
  140. submit("TXZMI00201");
  141. opener.javaScript.model.resetInstanceNode("/root/main/list_receive");
  142. opener.javaScript.submit("TRZMI00101");
  143. opener.javaScript.grd_receive.rebuildStyle();
  144. opener.javaScript.setRowStyle("grd_receive" , "2" , gv_combounread, "recvcnfmyn");
  145. model.close()
  146. ]]>
  147. </script>
  148. </button>
  149. <output id="opt_trsmrnm" ref="/root/main/trsmrnm" style="left:110px; top:35px; width:100px; height:19px; "/>
  150. <output id="opt_trsmreqdt" style="left:110px; top:85px; width:100px; height:19px; "/>
  151. <output id="opt_msgtype" ref="/root/main/msgtype" style="left:320px; top:85px; width:90px; height:19px; "/>
  152. <output id="opt_trsmrid" ref="/root/main/trsmrid" style="left:110px; top:60px; width:100px; height:19px; "/>
  153. <output id="opt_hngnm" ref="/root/main/hngnm" style="left:320px; top:35px; width:90px; height:19px; "/>
  154. <output id="opt_pid" ref="/root/main/pid" style="left:320px; top:60px; width:90px; height:19px; "/>
  155. <button id="btn_close" class="btn4_letter2" disabled="false" visibility="hidden" style="left:355px; top:430px; width:56px; height:22px; ">
  156. <caption>닫기</caption>
  157. <script type="javascript" ev:event="DOMActivate">
  158. <![CDATA[
  159. // 메세지함의 메세지 리스트 초기화
  160. opener.javaScript.model.resetInstanceNode("/root/main/list_receive");
  161. // 다시 조회
  162. opener.javaScript.submit("TRZMI00101");
  163. opener.javaScript.grd_receive.rebuildStyle();
  164. opener.javaScript.setRowStyle("grd_receive" , "2" , gv_combounread, "recvcnfmyn");
  165. window.close();
  166. ]]>
  167. </script>
  168. </button>
  169. <caption id="cap_msgconfirm" visibility="hidden" style="left:15px; top:431px; width:156px; height:20px; ">* 메세지를 확인하셨습니다.</caption>
  170. <line id="line1" class="line_1" style="x1:10px; y1:30px; x2:410px; y2:30px; "/>
  171. <caption id="cap_senderid" class="cell_1" style="left:10px; top:59px; width:100px; height:23px; vertical-align:middle; ">보낸이 ID</caption>
  172. <caption id="cap_sender" class="cell_1" style="left:10px; top:34px; width:100px; height:23px; font-family:돋움; vertical-align:middle; ">보낸이</caption>
  173. <caption id="cap_sendtime" class="cell_1" style="left:10px; top:84px; width:100px; height:23px; vertical-align:middle; ">송신시간</caption>
  174. <caption id="cap_msgtype" class="cell_1" style="left:220px; top:84px; width:100px; height:23px; vertical-align:middle; ">메시지 종류</caption>
  175. <caption id="cap_pid" class="cell_1" style="left:220px; top:59px; width:100px; height:23px; vertical-align:middle; ">환자 ID</caption>
  176. <caption id="cap_hngnm" class="cell_1" style="left:220px; top:34px; width:100px; height:23px; font-family:돋움; vertical-align:middle; ">환자명</caption>
  177. <textarea id="tar_rsvmsgcnts" ref="/root/main/msgcnts" disabled="true" style="left:15px; top:135px; width:395px; height:125px; "/>
  178. <button id="btn_reply" class="btn4_letter3" visibility="hidden" style="left:282px; top:430px; width:68px; height:22px; ">
  179. <caption>보내기</caption>
  180. <script type="javascript" ev:event="DOMActivate">
  181. <![CDATA[
  182. var msg = model.getValue("/root/send/writemsg/msgcnts");
  183. calculate_msglen(msg, 300);
  184. if (tar_msgcnts.value == "") {
  185. messageBox("메시지는 필수로 ", "C001");
  186. } else {
  187. model.setValue("/root/send/writemsg/recvrid", model.getValue("/root/main/trsmrid"));
  188. submit("TXZMI00202");
  189. model.refresh();
  190. if (model.getValue("/root/temp/succnt/getV") > 0) {
  191. messageBox("메시지 전송이 ", "I002");
  192. } else {
  193. messageBox("메시지 전송이 ","E009");
  194. }
  195. }
  196. ]]>
  197. </script>
  198. </button>
  199. <button id="btn_delmsg" class="btn4_letter2" disabled="false" visibility="hidden" style="left:220px; top:430px; width:56px; height:22px; ">
  200. <caption>삭제</caption>
  201. <script type="javascript" ev:event="DOMActivate">
  202. <![CDATA[
  203. window.close();
  204. ]]>
  205. </script>
  206. </button>
  207. <caption id="caption1" visibility="visible" style="left:10px; top:115px; width:156px; height:20px; ">* 받은 메시지</caption>
  208. <caption id="caption2" visibility="visible" style="left:10px; top:270px; width:156px; height:20px; ">* 보낼 메시지</caption>
  209. <button id="btn_addreceivemsg" class="btn2_letter7" style="left:313px; top:268px; width:97px; height:19px; ">
  210. <caption>받은메시지포함</caption>
  211. <script type="javascript" ev:event="DOMActivate">
  212. <![CDATA[
  213. // 내용이 지워졌음에도 포커스가 이전의 입력위치로 이동하는 것을 막기위해 포커스 아웃/ 재 포커스
  214. var currentText = tar_msgcnts.currentText;
  215. var replymsg = "\n\n=======================\n" + model.getValue("/root/main/msgcnts");
  216. replymsg = currentText + replymsg;
  217. model.setValue("/root/send/writemsg/msgcnts", replymsg);
  218. model.setFocus("tar_msgcnts");
  219. model.refresh();
  220. ]]>
  221. </script>
  222. </button>
  223. </xhtml:body>
  224. </xhtml:html>