SPZMI00201_받은메시지읽기.xfdl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.4">
  3. <TypeDefinition url="..\..\..\default_typedef.xml"/>
  4. <Form id="SPZMI00201" position="absolute 0 0 425 500" titletext="메시지 읽기" onload="SPZME00100_onload" class="frm_POP" enable="true">
  5. <Layouts>
  6. <Layout>
  7. <Static id="Static08" position="absolute 11 45 418 121" class="sta_DA_box"/>
  8. <Static id="cap_sender" text="보낸이" class="cell_1" position="absolute 12 46 85 70"/>
  9. <Static id="cap_senderid" text="보낸이 ID" class="cell_1" position="absolute 12 71 85 95"/>
  10. <Static id="cap_pname" text="환자명" class="cell_1" position="absolute 214 46 287 70" onclick="cap_msgcnts05_onclick"/>
  11. <Button id="btn_send" taborder="1" text="보내기" class="btn4" position="absolute 290 470 358 490" tooltiptext="adfasdfaf" onclick="btn_send_onclick"/>
  12. <Button id="btn_cancel" taborder="2" text="닫기" class="btn4" position="absolute 361 470 417 490" onclick="btn_cancel_onclick"/>
  13. <Static id="Static01" class="hand" position="absolute 5 130 135 150" onclick="Static01_onclick" text="받은 메시지"/>
  14. <Button id="btn_addreceivemsg" taborder="4" text="받은메시지포함" class="btn2" position="absolute 311 302 416 322" onclick="btn_delfile_onclick"/>
  15. <Edit id="ipt_fromnm" taborder="6" lengthunit="utf8" class="input_essential" position="absolute 290 48 413 68" imemode="hangul"/>
  16. <Edit id="ipt_fromaddress" taborder="5" lengthunit="utf8" class="input_essential" position="absolute 88 48 211 68" imemode="alpha"/>
  17. <Edit id="ipt_toaddress" taborder="7" lengthunit="utf8" class="input_essential" position="absolute 88 73 211 93" imemode="alpha"/>
  18. <TextArea id="tar_rsvmsgcnts" taborder="10" position="absolute 11 154 418 294" class="input_essential"/>
  19. <Static id="caption00" text="메시지 읽기" class="sta_POP_title" position="absolute 12 8 161 28"/>
  20. <Button id="Button00" taborder="13" class="btn_POP_cls" position="absolute 399 12 413 25" onclick="Button00_onclick"/>
  21. <Static id="cap_pid" text="환자 ID" onclick="cap_msgcnts05_onclick" class="cell_1" position="absolute 214 71 287 95"/>
  22. <Edit id="ipt_fromnm00" taborder="15" imemode="hangul" lengthunit="utf8" class="input_essential" position="absolute 290 73 413 93"/>
  23. <Static id="cap_sendtime" text="송신시간" class="cell_1" position="absolute 12 96 85 120"/>
  24. <Edit id="ipt_toaddress00" taborder="16" imemode="alpha" lengthunit="utf8" class="input_essential" position="absolute 88 98 211 118"/>
  25. <Static id="cap_msgtype" text="메시지 종류" onclick="cap_msgcnts05_onclick" class="cell_1" position="absolute 214 96 287 120"/>
  26. <Edit id="ipt_fromnm01" taborder="17" imemode="hangul" lengthunit="utf8" class="input_essential" position="absolute 290 98 413 118"/>
  27. <Static id="Static03" text="보낼 메시지" onclick="Static01_onclick" class="hand" position="absolute 5 302 135 322"/>
  28. <TextArea id="tar_msgcnts" taborder="18" class="input_essential" position="absolute 11 324 418 464"/>
  29. <Button id="btn_del" taborder="19" text="삭제" onclick="btn_send_onclick" class="btn4" position="absolute 231 470 287 490" tooltiptext="adfasdfaf"/>
  30. </Layout>
  31. </Layouts>
  32. <Objects>
  33. <Dataset id="ds_file" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  34. <ColumnInfo>
  35. <Column id="filenm" type="STRING" size="256"/>
  36. <Column id="filesize" type="STRING" size="256"/>
  37. <Column id="filedata" type="BLOB" size="256"/>
  38. <Column id="filetype" type="STRING" size="256"/>
  39. </ColumnInfo>
  40. </Dataset>
  41. <Dataset id="ds_msg" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  42. <ColumnInfo>
  43. <Column id="contents" type="STRING" size="256"/>
  44. </ColumnInfo>
  45. </Dataset>
  46. <Dataset id="ds_fromaddress" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
  47. <ColumnInfo>
  48. <Column id="fromaddress" type="STRING" size="256"/>
  49. <Column id="fromname" type="STRING" size="256"/>
  50. <Column id="toaddress" type="STRING" size="256"/>
  51. <Column id="ccaddress" type="STRING" size="256"/>
  52. <Column id="subject" type="STRING" size="256"/>
  53. <Column id="msg" type="STRING" size="256"/>
  54. </ColumnInfo>
  55. </Dataset>
  56. </Objects>
  57. <Bind/>
  58. <Script type="xscript4.0"><![CDATA[/************************************************************************************************
  59. * 파 일 명 : SPZME00100_이메일전송.xfdl
  60. * 작 성 자 : 오은비
  61. * 작 성 일 : 2014.03.06
  62. * 설 명 : 이메일전송
  63. * 수 정 자 :
  64. * 수정이력 :
  65. ************************************************************************************************/
  66. include "com_commonxp::comm_main.xjs"
  67. /******************************* Form Variable *************************************************/
  68. /************************************************************************************************
  69. ******************************** Form Event ****************************************************
  70. ************************************************************************************************/
  71. function btn_clear_onclick(obj:Button, e:ClickEventInfo)
  72. {
  73. lf_Init();
  74. }
  75. function btn_send_onclick(obj:Button, e:ClickEventInfo)
  76. {
  77. lf_Save();
  78. }
  79. function Button00_onclick(obj:Button, e:ClickEventInfo)
  80. {
  81. this.close();
  82. }
  83. function btn_cancel_onclick(obj:Button, e:ClickEventInfo)
  84. {
  85. this.close();
  86. }
  87. function btn_attfile_onclick(obj:Button, e:ClickEventInfo)
  88. {
  89. trace ("파일첨부합니다");
  90. // 파일다이얼로그를 띄워 사용자에게 파일경로를 입력받는다.
  91. var fd = new FileDialog;
  92. var objVFile = fd.open("FileOpen", FileDialog.LOAD); // 단일 파일 선택
  93. if (utlf_isNull(objVFile)) {
  94. return;
  95. }
  96. // 해당 파일을 데이터 셋에 저장한다.
  97. lf_AttachFile(objVFile)
  98. }
  99. function btn_delfile_onclick(obj:Button, e:ClickEventInfo)
  100. {
  101. lf_DelFile();
  102. }
  103. function SPZME00100_onload(obj:Form, e:LoadEventInfo)
  104. {
  105. //frmf_initForm(obj);
  106. /* 버튼 권한 설정
  107. R : Readonly
  108. X : Read Write
  109. P : Print */
  110. btn_clear.enable = frmf_checkAuth("X");
  111. try {
  112. // 팝업 전달값 할당
  113. ipt_fromaddress.value = call_fromaddress;
  114. ipt_fromnm.value = call_fromname;
  115. ipt_toaddress.value = call_toaddress;
  116. ipt_ccaddress.value = call_ccaddress;
  117. ipt_subject.value = call_subject;
  118. tar_msg.value = call_msg;
  119. ipt_msgcnts01.value = 0;
  120. }
  121. catch(e){
  122. lf_Init();
  123. }
  124. }
  125. /************************************************************************************************
  126. Form Function
  127. ************************************************************************************************/
  128. /********************************************************************************
  129. * 설 명 : 초기화 함수.
  130. * argument :
  131. ********************************************************************************/
  132. function lf_Init()
  133. {
  134. //Dataset 초기화
  135. ds_file.clearData();
  136. ipt_fromaddress.value ="";
  137. ipt_fromnm.value = "";
  138. ipt_toaddress.value = "";
  139. ipt_ccaddress.value = "";
  140. ipt_subject.value = "";
  141. tar_msg.value = "";
  142. ipt_msgcnts01.value = 0;
  143. }
  144. /********************************************************************************
  145. * 설 명 : 저장함수
  146. * argument :
  147. ********************************************************************************/
  148. function lf_Save()
  149. {
  150. if(!frmf_chkMdt(["ipt_fromaddress", "ipt_fromnm", "ipt_toaddress", "ipt_subject", "tar_msg"], ["보내는이", "이름", "받는이", "제목", "내용"])) {
  151. return;
  152. }
  153. var sInDsName = dsf_createDsRow("ds_fromaddress"
  154. ,[{col: "fromaddress" , val: ipt_fromaddress.value}
  155. , {col: "fromname" , val: ipt_fromnm.value}
  156. , {col: "toaddress", val: ipt_toaddress.value}
  157. , {col: "ccaddress", val: ipt_ccaddress.value}
  158. , {col: "subject" , val: ipt_subject.value }
  159. , {col: "msg" , val: tar_msg.value}]);
  160. ds_msg.clearData();
  161. tranf_submit({
  162. id: "TXZNE00101"
  163. , service: "emailsenderapp.EmailSender"
  164. , method: "reqExeSendMail"
  165. , inds : "req="+sInDsName+":U attach=ds_file:U"
  166. , outds: "ds_msg=message"
  167. , async: true
  168. , callback: "cbf_TXZNE00101"
  169. });
  170. }
  171. function cbf_TXZNE00101()
  172. {
  173. ds_fromaddress.clearData();
  174. if ( ds_msg.getColumn(0,0) == null) {
  175. alert("전송실패");
  176. } else {
  177. alert(ds_msg.getColumn(0,0));
  178. }
  179. }
  180. /********************************************************************************
  181. * 설 명 : 파일첨부함수
  182. * argument :
  183. ********************************************************************************/
  184. function lf_AttachFile(objVFile)
  185. {
  186. var nRowNum = ds_file.insertRow(0);
  187. // 그 파일의 데이터를 데이터셋의 특정 컬럼에 BLOB 형식으로 write 한다.
  188. var file = dsf_writeFileToDs(objVFile, ds_file, nRowNum, "filedata");
  189. var size = parseInt(ipt_msgcnts01.value)+parseInt(file.filesize);
  190. trace("size : "+size);
  191. if ( size <= 10000000) {
  192. var fnm = file.filenm;
  193. ds_file.setColumn(nRowNum, "filenm", file.filename);
  194. ds_file.setColumn(nRowNum, "filesize", file.filesize);
  195. ds_file.setColumn(nRowNum, "filetype", file.filetype);
  196. //trace("type : "+ file.filetype);
  197. lf_FileSize();
  198. } else {
  199. ds_file.deleteRow(0);
  200. alert ("최대 파일 크기를 확인해주세요.");
  201. }
  202. }
  203. /********************************************************************************
  204. * 설 명 : 파일삭제함수
  205. * argument :
  206. ********************************************************************************/
  207. function lf_DelFile()
  208. {
  209. ds_file.updatecontrol = false;
  210. var bSucc = ds_file.setRowType(ds_file.rowposition, Dataset.ROWTYPE_DELETE);
  211. var sValue = parseInt(ipt_msgcnts01.value) - parseInt(ds_file.getColumn(ds_file.rowposition, 1));
  212. ipt_msgcnts01.value = sValue;
  213. ds_file.deleteRow(ds_file.rowposition);
  214. ds_file.updatecontrol = true;
  215. }
  216. /********************************************************************************
  217. * 설 명 : 파일 크기 합계함수
  218. * argument :
  219. ********************************************************************************/
  220. function lf_FileSize()
  221. {
  222. var rowCnt = ds_file.rowcount;
  223. var sValue=0;
  224. for(var i=0 ; i<rowCnt ; i++){
  225. sValue = sValue + parseInt(ds_file.getColumn(i, 1));
  226. }
  227. ipt_msgcnts01.value = sValue;
  228. }
  229. ]]></Script>
  230. </Form>
  231. </FDL>