ZUM006.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. function flashWrite(filename, width, height)
  2. {
  3. var strObj = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">';
  4. strObj += '<param name="movie" value="'+filename+'">';
  5. strObj += '<param name="wmode" value="transparent">';
  6. strObj += '<param name="quality" value="high">';
  7. strObj += '<embed src="'+filename+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'">';
  8. strObj += '</embed>';
  9. strObj += '</object>';
  10. document.write(strObj);
  11. }
  12. function writeMSXML4(id, codebase, width, height)
  13. {
  14. var obj="";
  15. obj=obj+ "<OBJECT id='"+id+"' CLASSID='CLSID:88D969C0-F192-11D4-A65F-0040963251E5' codebase='"+codebase+"' width='"+width+"' height='"+height+"'>";
  16. obj=obj+ "</OBJECT>";
  17. try {
  18. var obj = new ActiveXObject('Msxml2.DOMDocument.4.0');
  19. }
  20. catch(e) {
  21. document.write(obj);
  22. }
  23. }
  24. function TrustFormViewer(id, filename, controlName, domainName, width, height, docSave, logSave)
  25. {
  26. // Ku 시스템 보안 취약점 개선으로 로컬 개발에서만 로그 나오도록 하고 운영과 교육은 로그 안나오도록 함 (2016.11.10 - smkim)
  27. logSave = (filename.indexOf("999dev") > -1) ? "true" : "false";
  28. var obj="";
  29. obj=obj+ "<OBJECT id='"+id+"' classid='CLSID:4DA55DF4-4825-44CF-9790-4D29E8F02AC7' width='"+width+"' height='"+height+"'>";
  30. obj=obj+ "<PARAM name='src' value='"+filename+"'/>";
  31. obj=obj+ "<PARAM name='controlName' value='"+controlName+"'/>";
  32. obj=obj+ "<PARAM name='domainName' value='"+domainName+"'/>";
  33. obj=obj+ "<PARAM name='documentsave' value='"+docSave+"'/>";
  34. obj=obj+ "<PARAM name='log' value='"+logSave+"'/>";
  35. obj=obj+ "</OBJECT>";
  36. document.write(obj);
  37. }
  38. function TrustFormMenu(id, menuItem, debugLog, msgBox, keepSubMenu, width, height)
  39. {
  40. var obj="";
  41. obj=obj+ "<OBJECT id='"+id+"' CLASSID='CLSID:81FF07A5-9782-45D9-A516-17601D57397D' width='"+width+"' height='"+height+"'>";
  42. obj=obj+ "<PARAM name='MenuItem' value='"+menuItem+"'/>"; //XML 파일을 지정한다.
  43. obj=obj+ "<PARAM name='DebugLog' value='"+debugLog+"'/>"; //로그파일 생성여부를 지정한다.
  44. obj=obj+ "<PARAM name='MsgBox' value='"+msgBox+"'/>"; //메뉴 로딩시 에러 정보를 messageBox로 보여준다.
  45. obj=obj+ "<PARAM name='KeepSubMenu' value='"+keepSubMenu+"'/>"; //열려있던 서브메뉴를 닫는다
  46. obj=obj+ "</OBJECT>";
  47. document.write(obj);
  48. }
  49. function getTrustFormMenu(id, menuItem, debugLog, msgBox, keepSubMenu, width, height)
  50. {
  51. var obj="";
  52. obj=obj+ "<OBJECT id='"+id+"' CLASSID='CLSID:81FF07A5-9782-45D9-A516-17601D57397D' width='"+width+"' height='"+height+"'>";
  53. obj=obj+ "<PARAM name='MenuItem' value='"+menuItem+"'/>"; //XML 파일을 지정한다.
  54. obj=obj+ "<PARAM name='DebugLog' value='"+debugLog+"'/>"; //로그파일 생성여부를 지정한다.
  55. obj=obj+ "<PARAM name='MsgBox' value='"+msgBox+"'/>"; //메뉴 로딩시 에러 정보를 messageBox로 보여준다.
  56. obj=obj+ "<PARAM name='KeepSubMenu' value='"+keepSubMenu+"'/>"; //열려있던 서브메뉴를 닫는다
  57. obj=obj+ "</OBJECT>";
  58. return obj;
  59. }
  60. function TrustFormSmartUpdater(id, codebase, width, height)
  61. {
  62. var obj="";
  63. obj=obj+ "<OBJECT id='"+id+"' CLASSID='CLSID:ED5D862B-6A06-46de-A929-F2C588742CBD' codebase='"+codebase+"' width='"+width+"' height='"+height+"'>";
  64. obj=obj+ "<PARAM name='deleteZipFile' value='true'/>"; // zip 파일을 지운다
  65. obj=obj+ "<PARAM name='registry' value='false'/>"; // registry를 이용하지 않는다.
  66. obj=obj+ "<PARAM name='configDir' value='C:\\\Program Files\\himed'/>"; // config 파일이 저장될 local 경로를 설정
  67. obj=obj+ "<PARAM name='enableLog' value ='true' />"; // log를 남긴다.
  68. obj=obj+ "<PARAM name='selfUi' value ='true' />"; // 자체 UI를 이용한다.
  69. obj=obj+ "<PARAM name='dlgNotClose' value='true' />"; // UI를 하나의 dialog로 사용한다.
  70. obj=obj+ "<PARAM name='fileinuse_hidden' value='skip'/>"; // FileInUse Dialog에서 button을 hidden 할 지 여부
  71. obj=obj+ "<PARAM name='deleteLogLevel' value='1'/>"; // 로그를 value달 전까지 보관 (1은 한달동안의 로그만 보관) added by CBJ 2012.03.23
  72. obj=obj+ "</OBJECT>";
  73. document.write(obj);
  74. }
  75. function TrustFormBroker(id, codebase, width, height)
  76. {
  77. var obj="";
  78. obj=obj+ "<OBJECT id='"+id+"' CLASSID='CLSID:0DFA67D7-B78C-40A7-B583-E7090D5F38C6' codebase='"+codebase+"' width='"+width+"' height='"+height+"'>";
  79. obj=obj+ "</OBJECT>";
  80. document.write(obj);
  81. }
  82. //pageAcl : 소스보기/저장/편집/인쇄/인쇄마킹/화면캡쳐/상태바여부
  83. function SoftCampWebSecurer(id, width, height, pageAcl)
  84. {
  85. var obj="";
  86. obj=obj+ "<OBJECT id='"+id+"' CLASSID='CLSID:6687DEFA-B8AB-4895-B3BD-68DBEEF569DC' width='"+width+"' height='"+height+"'>";
  87. obj=obj+ "<PARAM NAME='PageAcl' VALUE='"+pageAcl+"'>";
  88. obj=obj+ "</OBJECT>";
  89. document.write(obj);
  90. }
  91. var oReport = null;
  92. // rex 30 오픈 관련 (이상준 수정)
  93. var rex_gsPreViewFeatures = "center=yes,scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=855,height=800";
  94. function openReport(rptnames, params, options, prnopt, uniqueId, iveiwerObj) {
  95. // 필수 - 레포트 생성 객체
  96. if (uniqueId == null) {
  97. reportId = makeReportId();
  98. }
  99. else {
  100. reportId = uniqueId;
  101. }
  102. oReport = GetfnParamSet(reportId);
  103. oReport.datatype = "csv";
  104. oReport.event.finishprint = printFinished;
  105. //oReport.event.init = reportInit;
  106. oReport.rptnames = rptnames;
  107. oReport.callback = getCallbackName(options);
  108. var rptNameSplit = null;
  109. var param = null;
  110. var rebId = null;
  111. var subMemoUsed = false;
  112. if(rptnames.length == 1) {
  113. rptNameSplit = rptnames[0].split(":");
  114. oReport.rptname = rptNameSplit[0];
  115. oReport.title = rptNameSplit[1];
  116. param = params[0];
  117. for(key in param) {
  118. if (key.indexOf("user_data",0) == 0) {
  119. // check if dataset name exists.
  120. if(key == "user_data") {
  121. oReport.type = "memo";
  122. oReport.data = param[key];
  123. }
  124. else {
  125. var dataset = key.substring(10);
  126. oReport.sub(dataset).type = "memo";
  127. oReport.sub(dataset).data = param[key];
  128. subMemoUsed = true;
  129. }
  130. }
  131. else if (key.indexOf("xml_data",0) == 0) {
  132. // check if xml dataset name exists.
  133. if(key == "xml_data") {
  134. oReport.type = "memo";
  135. oReport.data = param[key]
  136. oReport.datatype = "xml";
  137. }
  138. else {
  139. var dataset = key.substring(9);
  140. oReport.sub(dataset).type = "memo";
  141. oReport.sub(dataset).data = param[key];
  142. oReport.sub(dataset).datatype = "xml";
  143. subMemoUsed = true;
  144. }
  145. }
  146. else if (key.indexOf("xpath",0) == 0) { // xml repeat data for xml datatype
  147. // check if xml dataset name exists.
  148. if(key == "xpath") {
  149. oReport.xpath = param[key];
  150. }
  151. else {
  152. var dataset = key.substring(6);
  153. oReport.sub(dataset).xpath = param[key];
  154. }
  155. }
  156. else if (key.indexOf("connect_name",0) == 0) { // connect name 처리
  157. // check if dataset name exists.
  158. if (key == "connect_name") {
  159. oReport.connectname = param[key];
  160. }
  161. else {
  162. var dataset = key.substring(13);
  163. oReport.sub(dataset).connectname = param[key];
  164. }
  165. }
  166. else {
  167. oReport.param(key).value = param[key];
  168. }
  169. }
  170. if (subMemoUsed) { // explicitly add "http" type as sub
  171. oReport.sub("*").type="http";
  172. oReport.sub("*").datatype="csv";
  173. }
  174. oReport.param("report_id").value = getReportId(rptNameSplit[0]);
  175. oReport.param("report_nm").value = rptNameSplit[1];
  176. }
  177. else {
  178. // multi-report
  179. var titleStr = "";
  180. for(var i = 0; i < rptnames.length; i++) {
  181. rebId = "reb"+i;
  182. rptNameSplit = rptnames[i].split(":");
  183. oReport.reb(rebId).rptname = rptNameSplit[0];
  184. if (i == 0) {
  185. titleStr = rptNameSplit[1];
  186. } else {
  187. titleStr = titleStr + "," + rptNameSplit[1];
  188. }
  189. oReport.reb(rebId).datatype = "csv";
  190. param = params[i];
  191. for(key in param) {
  192. if (key.indexOf("user_data",0) == 0) {
  193. // check if dataset name exists.
  194. if(key == "user_data") {
  195. oReport.reb(rebId).type = "memo";
  196. oReport.reb(rebId).data = param[key]
  197. }
  198. else {
  199. var dataset = key.substring(10);
  200. oReport.reb(rebId).sub(dataset).type = "memo";
  201. oReport.reb(rebId).sub(dataset).data = param[key];
  202. }
  203. }
  204. else if (key.indexOf("xml_data",0) == 0) {
  205. // check if dataset name exists.
  206. if(key == "xml_data") {
  207. oReport.reb(rebId).type = "memo";
  208. oReport.reb(rebId).data = param[key];
  209. oReport.reb(rebId).datatype = "xml";
  210. }
  211. else {
  212. var dataset = key.substring(9);
  213. oReport.reb(rebId).sub(dataset).type = "memo";
  214. oReport.reb(rebId).sub(dataset).data = param[key];
  215. oReport.reb(rebId).sub(dataset).datatype = "xml";
  216. }
  217. }
  218. else if (key.indexOf("xpath",0) == 0) { // xml repeat data for xml datatype
  219. // check if xml dataset name exists.
  220. if(key == "xpath") {
  221. oReport.reb(rebId).xpath = param[key];
  222. }
  223. else {
  224. var dataset = key.substring(6);
  225. oReport.reb(rebId).sub(dataset).xpath = param[key];
  226. }
  227. }
  228. else if (key.indexOf("connect_name",0) == 0) { // connect name 처리
  229. // check if dataset name exists.
  230. if (key == "connect_name") {
  231. oReport.reb(rebId).connectname = param[key];
  232. }
  233. else {
  234. var dataset = key.substring(13);
  235. oReport.reb(rebId).sub(dataset).connectname = param[key];
  236. }
  237. }
  238. else {
  239. oReport.reb(rebId).param(key).value = param[key];
  240. }
  241. }
  242. oReport.reb(rebId).param("report_id").value = getReportId(rptNameSplit[0]);
  243. oReport.reb(rebId).param("report_nm").value = rptNameSplit[1];
  244. }
  245. oReport.title = titleStr;
  246. }
  247. oReport.printoption = prnopt;
  248. var frompage = 1;
  249. var topage = -1;
  250. var copies = 1;
  251. // parsing prnopt for direct print
  252. if (prnopt != null && prnopt != "") {
  253. var prnopts = prnopt.split(";");
  254. for(var i =0; i< prnopts.length; i++)
  255. {
  256. if (prnopts[i].indexOf("copies=",0) == 0) {
  257. copies = prnopts[i].substring(7);
  258. }
  259. else if (prnopts[i].indexOf("frompage=",0) == 0) {
  260. frompage = prnopts[i].substring(9);
  261. }
  262. else if (prnopts[i].indexOf("topage=",0) == 0) {
  263. topage = prnopts[i].substring(7);
  264. }
  265. }
  266. }
  267. // rexpert30 오픈시 size 조절 2013.02.13 장재현
  268. var rexPreViewArr = rex_gsPreViewFeatures.split(",");
  269. var rexOptions = options.split(";");
  270. var rexWidth = "";
  271. var rexHeight = "";
  272. for(var i = 0; i < rexOptions.length; i++) {
  273. if(rexOptions[i].indexOf("width=",0) == 0) {
  274. rex_gsPreViewFeatures = ""
  275. rexWidth = rexOptions[i];
  276. }
  277. if(rexOptions[i].indexOf("height=",0) == 0) {
  278. rexHeight = rexOptions[i];
  279. }
  280. }
  281. for(var j = 0; j < rexPreViewArr.length; j++){
  282. if(rexPreViewArr[j].indexOf("width=",0) == 0) {
  283. rexPreViewArr[j] = rexWidth;
  284. }
  285. if(rexPreViewArr[j].indexOf("height=",0) == 0) {
  286. rexPreViewArr[j] = rexHeight;
  287. }
  288. if(j+1 == rexPreViewArr.length){
  289. rex_gsPreViewFeatures = rex_gsPreViewFeatures + rexPreViewArr[j]
  290. }else{
  291. rex_gsPreViewFeatures = rex_gsPreViewFeatures + rexPreViewArr[j] + ","
  292. }
  293. }
  294. if (rexWidth == "" && rexHeight == "")
  295. {
  296. rex_gsPreViewFeatures = "center=yes,scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=855,height=800";
  297. }
  298. if(options.indexOf("directprint=1") >= 0) {
  299. var printDialog = true;
  300. if(options.indexOf("printdialog=0") >= 0) {
  301. printDialog = false;
  302. }
  303. oReport.print(printDialog, frompage, topage, copies, ""); // oReport.printoption 으로 함께 지정해야함.
  304. }
  305. else {
  306. oReport.toolbarbuttonoption = options.replace("directprint=0","");
  307. oReport.open(iveiwerObj);
  308. }
  309. }
  310. function getCallbackName(option) {
  311. if (option == null || option == "") {
  312. return null;
  313. }
  314. var opts = option.split(";");
  315. for(var i =0; i< opts.length; i++)
  316. {
  317. if (opts[i].indexOf("callback=",0) == 0) {
  318. return opts[i].substring(9);
  319. }
  320. }
  321. return null;
  322. }
  323. function getReportId(url) {
  324. var start = url.lastIndexOf("/");
  325. var reportId = url.substr(start+1,10);
  326. return reportId;
  327. }
  328. function reportInit(rexCtl, eventName, eventData) {
  329. //rexCtl.SetCss("print.copies=10");
  330. }
  331. function printFinished(rexCtl, eventName, eventData) {
  332. if (typeof ux_callflex == 'function') {
  333. if (eventData != null && eventData.callback != null) {
  334. //alert(eventData.id + "," + eventData.callback);
  335. ux_callflex("reportcallback_"+eventData.callback,eventData);
  336. }
  337. }
  338. }