common.js.soonsu 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550
  1. var gvMyUIDPath = null;
  2. var gvOpUIDPath = null;
  3. var gvChUIDPath = null;
  4. var gvDate = null;
  5. var gvParamPath = null;
  6. var gvPropPath = null;
  7. var gvAuthPath = null;
  8. var gvTitlePath = null;
  9. var gvScnTypePath = null;
  10. var gvErrorMsgPath = null;
  11. var gvSystemPath = null;
  12. var gvMenuPath = null;
  13. var gvMenuGroupCdPath = null;
  14. var gvMenuPrestDeptCdPath = null;
  15. var gvMenuItemCdPath = null;
  16. var gvMenuParamPath = null;
  17. var gvSystemCd = null;
  18. var gvReportPath = null;
  19. var gvSubReportPath = null;
  20. var gvReportPropsPath = null;
  21. var gvReportParamsPath = null;
  22. var gvReportOptionsPath = null;
  23. var gvPatientInfoPath = null;
  24. var gvOperationInfoPath = null;
  25. var gvConsultInfoPath = null;
  26. var gvPatientInfoFlagPath = null;
  27. var gvOrderBasicInfoPath = null;
  28. var gvPopupMenuPath = null;
  29. var gvHelpPage = null;
  30. var gvTaskBarHeight = 34;
  31. var gvDefaultScrWidth = 1211;
  32. var gvDefaultScrHeight = 784;
  33. var gvSaveLoc = null;
  34. var fEssentialBackColor = "#ffe4b5";
  35. function xforms_model_construct() {
  36. gvPropPath="/root/properties";
  37. gvMyUIDPath=gvPropPath+"/uid/myself";
  38. gvOpUIDPath=gvPropPath+"/uid/opener";
  39. gvChUIDPath=gvPropPath+"/uid/children/";
  40. gvParamPath=gvPropPath+"/parameters";
  41. gvChildClosePath=gvPropPath+"/childclose";
  42. gvSystemPath=gvPropPath+"/domain";
  43. gvAuthPath=gvPropPath+"/auth";
  44. gvMenuPath=gvPropPath+"/menu";
  45. gvMenuGroupCdPath=gvMenuPath+"/menugroupcd";
  46. gvMenuPrestDeptCdPath=gvMenuPath+"/menuprestdeptcd";
  47. gvMenuItemCdPath=gvMenuPath+"/menuitemcd";
  48. gvMenuParamPath=gvMenuPath+"/menuparam";
  49. gvTitlePath=gvPropPath+"/title";
  50. gvScnTypePath=gvPropPath+"/stype";
  51. gvErrorMsgPath=gvPropPath+"/error";
  52. gvReportPath=gvPropPath+"/report/mainreport";
  53. gvSubReportPath=gvPropPath+"/report/subreport";
  54. gvReportPropsPath=gvReportPath+"/props";
  55. gvReportParamsPath=gvReportPath+"/params";
  56. gvReportOptionsPath=gvReportPath+"/options";
  57. gvPatientInfoPath=gvPropPath+"/patient";
  58. gvOperationInfoPath=gvPatientInfoPath+"/operationinfo";
  59. gvConsultInfoPath=gvPatientInfoPath+"/consultinfo";
  60. gvPatientInfoFlagPath=gvPatientInfoPath+"/patientflag";
  61. gvOrderBasicInfoPath=gvPropPath+"/orderbasicinfo";
  62. gvPopupMenuPath=gvPropPath+"/popupmenu";
  63. gvSaveLocPath = gvPropPath + "/saveloc";
  64. model.makeValue(gvSaveLocPath, "true");
  65. gvDate = new Date();
  66. var uid = gvDate.getTime();
  67. model.makeValue(gvMyUIDPath,uid);
  68. model.makeValue(gvOpUIDPath,"");
  69. model.makeValue(gvSystemPath,"");
  70. if (isPopup()) {
  71. model.setValue(gvOpUIDPath,opener.model.getValue(gvMyUIDPath));
  72. opener.model.makeValue(gvChUIDPath+"latest",uid);
  73. var spclauth = getGlobalVariable("spclscrnauth");
  74. setGlobalVariable("spclscrnauth", "");
  75. if (spclauth != "") {
  76. model.makeValue(gvAuthPath, spclauth);
  77. } else {
  78. model.makeValue(gvAuthPath, opener.model.getValue(gvAuthPath));
  79. }
  80. model.makeValue(gvMenuParamPath,opener.model.getValue(gvMenuParamPath));
  81. model.setValue(gvSystemPath,getGlobalVariable("systemcode"),true);
  82. setGlobalVariable("systemcode","");
  83. setWindowSize();
  84. initTitle();
  85. addOpenWindow();
  86. } else {
  87. initTitle();
  88. var spclauth = getGlobalVariable("spclscrnauth");
  89. setGlobalVariable("spclscrnauth", "");
  90. if (spclauth != "") {
  91. setGlobalVariable("scrnauth", spclauth);
  92. }
  93. setScreenAuth();
  94. setScreenMenuParameter();
  95. }
  96. setScreenMenuGroup();
  97. setScreenMenuItem();
  98. setScreenPrestDeptCd();
  99. m_event.stopPropagation();
  100. }
  101. function xforms_ready() {
  102. window.setPopupMenu(false);
  103. window.setIcon(htmlwindow.faviconURL);
  104. if(window.type != "iviewer") {
  105. body.setAttribute("accesskey", "f12");
  106. }
  107. }
  108. function xforms_close() {
  109. if( document.allElement.item(m_event.currentTarget).elementName == "xhtml:head" ) {
  110. m_event.stopPropagation();
  111. return;
  112. }
  113. if ( isPopup() ) {
  114. opener.model.removenode(gvChUIDPath+"child::*[text()=""+getMyUID()+""]");
  115. if(window.type == "modal"){
  116. var viewerObj = getViewer("sysMessage");
  117. if (viewerObj != null && viewerObj.window.fGetLastModal != undefined){
  118. var modalWindowNm = viewerObj.window.fGetLastModal(getMyUID());
  119. if(modalWindowNm != null && modalWindowNm != ""){
  120. messageBox("���� ���� ���ȭ���� ���� ��","C003","("+modalWindowNm.split('|')[3]+")");
  121. }
  122. }
  123. }
  124. }
  125. }
  126. function xforms_model_destruct() {
  127. if( document.allElement.item(m_event.currentTarget).elementName == "xhtml:head" ) {
  128. m_event.stopPropagation();
  129. return;
  130. }
  131. var mainClose = getGlobalVariable("mainclose");
  132. if ( mainClose != "Y")
  133. {
  134. if ( isPopup() ) {
  135. if (getSaveLoc() == "true") {
  136. setScreenLocation(getScreenID(),window.left,window.top);
  137. } else if (getSaveLoc == "false") {
  138. }
  139. removeOpenWindow();
  140. }
  141. }
  142. }
  143. function setSaveLoc(type) {
  144. model.setValue(gvSaveLocPath, type);
  145. }
  146. function getSaveLoc() {
  147. return model.getValue(gvSaveLocPath);
  148. }
  149. function onaccesskey(){
  150. if (m_event.keyCode == "123") {
  151. getHelpPage();
  152. m_event.stopPropagation();
  153. }
  154. }
  155. function initTitle() {
  156. var titleValue = null;
  157. var syscd = model.getValue(gvSystemPath);
  158. var msgViewer = getViewer("sysMessage");
  159. if( syscd == null || syscd == "") {
  160. titleValue = document.title;
  161. } else {
  162. titleValue = document.title + "(" + getGlobalVariable("sysname"+syscd) + ")";
  163. }
  164. model.makeValue(gvTitlePath,titleValue);
  165. if (!isPopup() && getGlobalVariable("userinfos") != "" && typeof(parent) == "undefined") {
  166. var scrnTitle = "" ;
  167. var tmpTitle = "";
  168. scrnTitle += htmlwindow.systemSymbol + " ";
  169. if (titleValue.indexOf(htmlwindow.systemSymbol) > -1) {
  170. scrnTitle += titleValue.substring(titleValue.indexOf("]")+2, titleValue.indexOf("��")); // titleValue.indexOf("��")���� ����� �ƴ� �� + ������ 1�� Ư��������
  171. } else {
  172. scrnTitle += titleValue;
  173. }
  174. scrnTitle += " ";
  175. scrnTitle += "[" +getUserInfo("systeminstnm") + "]";
  176. scrnTitle += "��������������������";
  177. scrnTitle += new String(htmlwindow.vision) + " ";
  178. scrnTitle += getUserInfo("dutplcenm") + " ";
  179. scrnTitle += getUserName() + " ";
  180. scrnTitle += getTitleLoginDate() + " ";
  181. scrnTitle += new String(htmlwindow.wasname);
  182. htmldocument.title = scrnTitle;
  183. }
  184. if (isPopup()) {
  185. var popupTitle = "";
  186. popupTitle += htmlwindow.systemSymbol + " ";
  187. popupTitle += titleValue;
  188. popupTitle += " ";
  189. popupTitle += "[" + getUserInfo("systeminstnm") + "]" + " ";
  190. document.title = popupTitle;
  191. }
  192. }
  193. function getTitle() {
  194. return model.getValue(gvTitlePath);
  195. }
  196. function getTitleLoginDate() {
  197. var weekarr = new Array("��", "��", "ȭ", "��", "��", "��", "��");
  198. var dt = getUserInfo("logindt");
  199. var dtyear = dt.substring(0,4);
  200. var dtmonth = dt.substring(4,6);
  201. var dtday = dt.substring(6,8);
  202. var dthour = dt.substring(8,10);
  203. var dtmin = dt.substring(10,12);
  204. var dtval = new Date(dtmonth+"/"+dtday+"/"+dtyear);
  205. var dtweek = weekarr[dtval.getDay()];
  206. var dtstr = dtyear + "��" + dtmonth + "��" + dtday + "�� (" + dtweek + ") " + dthour +"��" + dtmin +"��";
  207. return dtstr;
  208. }
  209. function getMISSystemCd() {
  210. var systemcd = getSystemCd();
  211. var systeminstcd = systemcd.substring(3,6);
  212. var missystemcd = "";
  213. if (systeminstcd == "011" || systeminstcd == "012" || systeminstcd == "013" || systeminstcd == "014") {
  214. missystemcd = "MIS001";
  215. } else {
  216. missystemcd = "MIS" + systeminstcd;
  217. }
  218. return missystemcd;
  219. }
  220. function getSystemCd() {
  221. if (gvSystemCd != null) {
  222. return gvSystemCd;
  223. }
  224. if (htmlwindow.systemcd == undefined) {
  225. gvSystemCd = "";
  226. } else {
  227. gvSystemCd = new String(htmlwindow.systemcd);
  228. }
  229. return gvSystemCd;
  230. }
  231. function getViewer(name) {
  232. return viewer.item(getSystemCd()+"_"+name);
  233. }
  234. function setScreenMenuGroup(){
  235. model.makeValue(gvMenuGroupCdPath, getGlobalVariable("menugroupcd"));
  236. }
  237. function setScreenMenuItem(){
  238. model.makeValue(gvMenuItemCdPath, getGlobalVariable("menuitemcd"));
  239. }
  240. function setScreenPrestDeptCd(){
  241. model.makeValue(gvMenuPrestDeptCdPath, getGlobalVariable("prestdeptcd"));
  242. }
  243. function getScreenPrestDeptCd(){
  244. return model.getValue(gvMenuPrestDeptCdPath);
  245. }
  246. function setScreenMenuParameter(){
  247. model.makeValue(gvMenuParamPath, getGlobalVariable("menuparam"));
  248. if(window.type != "iviewer") setGlobalVariable("menuparam","");
  249. }
  250. function getScreenMenuParameter(){
  251. return model.getValue(gvMenuParamPath);
  252. }
  253. function getScreenID(url) {
  254. if (url == null) {
  255. url = document.URL;
  256. }
  257. var sp = url.split("/");
  258. return sp[sp.length-1].split(".")[0].substr(0,10);
  259. }
  260. function setScreenAuth(auth){
  261. var viewerObj = getViewer("bizMain");
  262. if ( viewerObj == null ) {
  263. setGlobalVariable("scrnauth","11100000");
  264. }
  265. model.makeValue(gvAuthPath, getGlobalVariable("scrnauth"));
  266. if(window.type != "iviewer") setGlobalVariable("scrnauth","");
  267. }
  268. function setSpclScrnAuth(auth, flag) {
  269. model.makeValue(gvAuthPath, getAuthCode(auth));
  270. if (flag == null) {
  271. flag = true;
  272. }
  273. if (flag == true) {
  274. setScreenBtnDisabled();
  275. }
  276. }
  277. function checkAuth(auth) {
  278. var f = auth.charAt(0);
  279. var a = getAuth();
  280. var v = '0';
  281. switch(f) {
  282. case 'r':
  283. case 'R':
  284. v = a.charAt(0);
  285. break;
  286. case 'x':
  287. case 'X':
  288. v = a.charAt(1);
  289. break;
  290. case 'p':
  291. case 'P':
  292. v = a.charAt(2);
  293. break;
  294. }
  295. if (v == '1') {
  296. return true;
  297. } else {
  298. return false;
  299. }
  300. }
  301. function getAuth() {
  302. return model.getValue(gvAuthPath);
  303. }
  304. function setScreenBtnDisabled( documentObj ) {
  305. if (documentObj == null) {
  306. documentObj = document;
  307. }
  308. var childObjCnt = documentObj.controls.length;
  309. var childObj;
  310. for (var i=0; i < childObjCnt; i++) {
  311. childObj = documentObj.controls.item(i);
  312. if (childObj.elementName == "xforms:iviewer") {
  313. setScreenBtnDisabled( childObj.document );
  314. } else if (childObj.elementName == "xforms:button") {
  315. var btnAuth = childObj.attribute["_auth"];
  316. if(btnAuth.toUpperCase() == "R" || btnAuth.toUpperCase() == "X" || btnAuth.toUpperCase() == "P"){
  317. childObj.setDisabled(!checkAuth(btnAuth));
  318. }
  319. }
  320. }
  321. }
  322. function getMyUID() {
  323. return model.getValue(gvMyUIDPath);
  324. }
  325. function getOpenerUID() {
  326. return model.getValue(gvOpUIDPath);
  327. }
  328. function getChildUID(wid) {
  329. var cid = model.getValue(gvChUIDPath+wid);
  330. if (cid==null) { cid=""; }
  331. return cid;
  332. }
  333. function checkOpener() {
  334. if (isPopup()) {
  335. return (getOpenerUID()==opener.model.getValue(gvMyUIDPath));
  336. } else {
  337. return false;
  338. }
  339. }
  340. function getChildWindow(wid) {
  341. return findChildWindow(getChildUID(wid));
  342. }
  343. function findChildWindow(cid) {
  344. var child = null;
  345. for(i=0;i<window.children.length;i++) {
  346. child = window.children.item(i);
  347. if (child.model.getValue(gvMyUIDPath)==cid) return child;
  348. }
  349. return null;
  350. }
  351. function findChildWindowByScreenID(sid) {
  352. var child = null;
  353. for(i=0;i<window.children.length;i++) {
  354. child = window.children.item(i);
  355. if (child.getScreenID()==sid) return child;
  356. }
  357. return null;
  358. }
  359. function closeChildWindow() {
  360. if(model.getValue(gvChildClosePath) == "Y"){
  361. var childCnt = window.children.length;
  362. for( var i = childCnt; i > 0; i-- ) {
  363. window.children.item(i-1).close();
  364. }
  365. }
  366. }
  367. function setCloseChildWindow(){
  368. model.makeValue(gvChildClosePath,"Y");
  369. }
  370. function isPopup() {
  371. var stype = window.type;
  372. if (stype == "iviewer" || stype == "main") {
  373. return false;
  374. } else {
  375. return true;
  376. }
  377. }
  378. function activateChild(wid) {
  379. var cwnd = window.children.item(wid);
  380. if (cwnd != null) {
  381. cwnd.activate();
  382. }
  383. }
  384. function activateOpener() {
  385. if (isPopup()) {
  386. opener.activateMyWindow();
  387. }
  388. }
  389. function activateMyWindow() {
  390. if (isPopup()) {
  391. window.restore();
  392. window.activate();
  393. } else {
  394. htmlwindow.focus();
  395. }
  396. }
  397. function getScreenDisabled(){
  398. return body.disabled;
  399. }
  400. function setMenuDisabled(type){
  401. htmlwindow.setMenuDisabled(type);
  402. }
  403. function locateCenter(xPos, yPos, userProp, monNo) {
  404. var taskbarHeight = 0;
  405. if (monNo == "" || monNo == null) {
  406. monNo = getCurrentMonitorNumber();
  407. }
  408. monNo = parseInt(monNo)-1;
  409. if (monNo < 0) {
  410. monNo = 0;
  411. } else if (monNo == 0) {
  412. taskbarHeight = gvTaskBarHeight;
  413. }
  414. var monSize = getMonitorSize(monNo);
  415. var width = gvDefaultScrWidth, height = gvDefaultScrHeight;
  416. if (monSize[0] < width) {
  417. width = monSize[0];
  418. }
  419. if (monSize[1] < height + taskbarHeight) {
  420. height = monSize[1] - taskbarHeight;
  421. }
  422. if (userProp != null) {
  423. var wexp = new RegExp("(width:)([0-9]+)(px)", "gi");
  424. var hexp = new RegExp("(height:)([0-9]+)(px)", "gi");
  425. var w = userProp.match(wexp);
  426. var h = userProp.match(hexp);
  427. if (w != null && w.length == 1) {
  428. width = w[0].match(new RegExp("([0-9]+)", "gi"));
  429. }
  430. if (h != null && h.length == 1) {
  431. height = h[0].match(new RegExp("([0-9]+)", "gi"));
  432. }
  433. }
  434. if (xPos == "" || xPos == null) {
  435. if (width != "") {
  436. xPos = parseInt(monSize[0])/2 - width/2;
  437. if (xPos < 0) {
  438. xPos = 0;
  439. }
  440. } else {
  441. xPos = 0;
  442. }
  443. } else {
  444. if (parseInt(xPos) < 0) {
  445. xPos = 0;
  446. }
  447. }
  448. if (yPos == "" || yPos == null) {
  449. if (height != "") {
  450. yPos = monSize[1]/2 - height/2 - taskbarHeight;
  451. if (yPos < 0) {
  452. yPos = 0;
  453. }
  454. } else {
  455. yPos = 0;
  456. }
  457. } else {
  458. if (parseInt(yPos) < 0) {
  459. yPos = 0;
  460. }
  461. }
  462. loc = getAbsoluteLocation(monNo,xPos,yPos);
  463. return loc;
  464. }
  465. function openInternal(openType,id,idType,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos) {
  466. if (!checkTimeout()) {
  467. setGlobalVariable("last_submit", (new Date()).getTime());
  468. }
  469. var url = null;
  470. var sid = getScreenID(id);
  471. if (wid == null || wid == "") {
  472. wid = sid;
  473. }
  474. if (prevPos == null) {
  475. prevPos = true;
  476. }
  477. if ( idType == "url" ) { // idType == "url" �̸� ID�� �״�� URL�� open�Ѵ�.
  478. url = id;
  479. } else {
  480. url = getScreenURL(sid);
  481. }
  482. var prop = null;
  483. if (monNo == null && xPos == null && yPos == null) {
  484. var viewerObj = getViewer("sysMessage");
  485. if (viewerObj != null && viewerObj.window.fSetStatusMessage != undefined) {
  486. var loc = locateCenter(xPos, yPos, userProp);
  487. xPos = loc[0];
  488. yPos = loc[1];
  489. prop = "top:"+yPos+"px;left:"+xPos+"px;width:" + gvDefaultScrWidth + "px;height:" + gvDefaultScrHeight + "px;";
  490. } else {
  491. prop = "align:center;width:" + gvDefaultScrWidth + "px;height:" + gvDefaultScrHeight + "px;";
  492. }
  493. } else {
  494. var xyPos = getScreenLocation(sid);
  495. var loc = null;
  496. if ( prevPos && xyPos != "") {
  497. loc = xyPos.split("|");
  498. } else {
  499. loc = locateCenter(xPos, yPos, userProp,monNo);
  500. }
  501. xPos = loc[0];
  502. yPos = loc[1];
  503. prop="top:"+yPos+"px;left:"+xPos+"px;";
  504. }
  505. if (userProp != null) {
  506. prop = prop + userProp;
  507. }
  508. var viewerObj = getViewer("sysMessage");
  509. var wd = null;
  510. if (viewerObj != null && viewerObj.window.fGetOpenWindow != undefined) {
  511. wd = viewerObj.window.fGetOpenWindow(sid);
  512. } else {
  513. if (isPopup() && opener.getScreenID() == sid) {
  514. wd = opener;
  515. } else if (getScreenID() == sid) {
  516. wd = window;
  517. } else {
  518. wd = findChildWindowByScreenID(sid);
  519. }
  520. }
  521. var cid = "";
  522. if (wd != null && openType =="modeless") {
  523. cid = wd.getMyUID();
  524. wd.activateMyWindow();
  525. wd.body.dispatch("onActivate");
  526. } else {
  527. window.load(url,openType,wid,prop,ref,resultref);
  528. if (openType!="replace") {
  529. cid = model.getValue(gvChUIDPath+"latest");
  530. model.makeValue(gvChUIDPath+wid,cid);
  531. model.makeValue(gvChUIDPath+"latest","");
  532. }
  533. }
  534. return cid;
  535. }
  536. function open(id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos, authCode, resizeType) {
  537. if (userProp == null) {
  538. userProp = "max:hidden;";
  539. } else {
  540. userProp = "max:hidden;" + userProp;
  541. }
  542. if (authCode == null) {
  543. setGlobalVariable("spclscrnauth", getAuthCode(""));
  544. } else {
  545. setGlobalVariable("spclscrnauth", getAuthCode(authCode));
  546. }
  547. if (resizeType == null || resizeType == "" || resizeType == "none") {
  548. setGlobalVariable("resizetype", "none");
  549. } else if (resizeType == "notaskbar") {
  550. setGlobalVariable("resizetype", "notaskbar");
  551. } else if (resizeType == "free") {
  552. setGlobalVariable("resizetype", "free");
  553. }
  554. return openInternal("modeless",id,"scn",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
  555. }
  556. function navigate(id,monNo,xPos,yPos,wid,ref,resultref, authCode) {
  557. var scrnauth = model.getValue(gvAuthPath);
  558. setGlobalVariable("scrnauth", scrnauth);
  559. closeChildWindow();
  560. if (authCode == null) {
  561. setGlobalVariable("spclscrnauth", getAuthCode(""));
  562. } else {
  563. setGlobalVariable("spclscrnauth", getAuthCode(authCode));
  564. }
  565. return openInternal("replace",id,"scn",monNo,xPos,yPos,wid,ref,resultref);
  566. }
  567. function modal(id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos, authCode, resizeType) {
  568. var rtn = "";
  569. body.setDisabled(true);
  570. if (userProp == null) {
  571. userProp = "min:hidden;max:hidden;";
  572. } else {
  573. userProp = "min:hidden;max:hidden;" + userProp;
  574. }
  575. if (authCode == null) {
  576. setGlobalVariable("spclscrnauth", getAuthCode(""));
  577. } else {
  578. setGlobalVariable("spclscrnauth", getAuthCode(authCode));
  579. }
  580. if (resizeType == null || resizeType == "" || resizeType == "none") {
  581. setGlobalVariable("resizetype", "none");
  582. } else if (resizeType == "notaskbar") {
  583. setGlobalVariable("resizetype", "notaskbar");
  584. } else if (resizeType == "free") {
  585. setGlobalVariable("resizetype", "free");
  586. }
  587. rtn = openInternal("modal",id,"scn",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
  588. body.setDisabled(false);
  589. return rtn;
  590. }
  591. function getAuthCode(auth) {
  592. var authCode = "";
  593. switch (auth.toUpperCase()) {
  594. case 'R': authCode = "10000000"; break;
  595. case 'X': authCode = "11000000"; break;
  596. case 'P': authCode = "11100000"; break;
  597. default : authCode = "";
  598. }
  599. return authCode;
  600. }
  601. function openUrl(url,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos, authCode) {
  602. if (userProp == null) {
  603. userProp = "max:hidden;";
  604. } else {
  605. userProp = "max:hidden;" + userProp;
  606. }
  607. if (authCode == null) {
  608. setGlobalVariable("spclscrnauth", getAuthCode(""));
  609. } else {
  610. setGlobalVariable("spclscrnauth", getAuthCode(authCode));
  611. }
  612. return openInternal("modeless",url,"url",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
  613. }
  614. function navigateUrl(url,monNo,xPos,yPos,wid,ref,resultref, authCode) {
  615. var scrnauth = model.getValue(gvAuthPath);
  616. setGlobalVariable("scrnauth", scrnauth);
  617. if (authCode == null) {
  618. setGlobalVariable("spclscrnauth", getAuthCode(""));
  619. } else {
  620. setGlobalVariable("spclscrnauth", getAuthCode(authCode));
  621. }
  622. return openInternal("replace",url,"url",monNo,xPos,yPos,wid,ref,resultref);
  623. }
  624. function modalUrl(url,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos, authCode) {
  625. if (userProp == null) {
  626. userProp = "min:hidden;max:hidden;";
  627. } else {
  628. userProp = "min:hidden;max:hidden;" + userProp;
  629. }
  630. if (authCode == null) {
  631. setGlobalVariable("spclscrnauth", getAuthCode(""));
  632. } else {
  633. setGlobalVariable("spclscrnauth", getAuthCode(authCode));
  634. }
  635. return openInternal("modal",url,"url",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
  636. }
  637. function openExternal(syscd,id,monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos) {
  638. var url = getScreenURL(id,syscd);
  639. setGlobalVariable("systemcode", syscd.toUpperCase());
  640. var cid = openInternal("modeless",url,"url",monNo,xPos,yPos,wid,ref,resultref,userProp,prevPos);
  641. setGlobalVariable("systemcode", "");
  642. return cid;
  643. }
  644. function openHtml(url,wid,prop) {
  645. var rtn = null;
  646. if (prop == null) {
  647. rtn = htmlwindow.open(url,wid);
  648. } else {
  649. rtn = htmlwindow.open(url,wid,prop);
  650. }
  651. return rtn;
  652. }
  653. function setWindowSize(){
  654. var taskbarHeight = 0;
  655. var pageWidth = body.attribute["pagewidth"] == "" ? gvDefaultScrWidth : parseInt(body.attribute["pagewidth"]);
  656. var pageHeight = body.attribute["pageheight"] == "" ? gvDefaultScrHeight + 16 : parseInt(body.attribute["pageheight"]) + 16;
  657. var monNo = getCurrentMonitorNumber();
  658. monNo = parseInt(monNo)-1;
  659. if (monNo < 0) {
  660. monNo = 0;
  661. } else if (monNo == 0) {
  662. taskbarHeight = gvTaskBarHeight;
  663. }
  664. var captionSize = Math.abs(app.registry("HKEY_CURRENT_USER", "Control Panel\\Desktop\\WindowMetrics", "CaptionHeight" , "STRING"))/15;
  665. var paddedSize = Math.abs(app.registry("HKEY_CURRENT_USER", "Control Panel\\Desktop\\WindowMetrics", "PaddedBorderWidth" , "STRING"))/15;
  666. var marginWidth = 8 + (paddedSize * 2);
  667. var marginHeight = ((paddedSize * 2 )+captionSize)+9;
  668. body.setAttribute("margin-top", 8);
  669. body.setAttribute("margin-bottom", 8);
  670. var wWidth = pageWidth+marginWidth;
  671. var wHeight = pageHeight+marginHeight;
  672. var monSize = getMonitorSize(monNo);
  673. if (monSize[0] < wWidth) {
  674. wWidth = monSize[0];
  675. }
  676. var resizeType = getGlobalVariable("resizetype");
  677. if (resizeType == "notaskbar") {
  678. if (monSize[1] < wHeight) {
  679. wHeight = monSize[1];
  680. if (wWidth < monSize[0]) {
  681. wWidth += 16;
  682. }
  683. }
  684. } else if (resizeType == "none") {
  685. if (monSize[1] < wHeight + taskbarHeight) {
  686. wHeight = monSize[1] - taskbarHeight;
  687. if (wWidth < monSize[0]) {
  688. wWidth += 16;
  689. }
  690. }
  691. } else if (resizeType == "free") {
  692. }
  693. window.setSize(wWidth, wHeight);
  694. }
  695. function setSystemMessage(msg) {
  696. var viewerObj = getViewer("sysMessage");
  697. if (viewerObj != null && viewerObj.window.fSetStatusMessage != undefined) {
  698. viewerObj.window.fSetStatusMessage(msg);
  699. }
  700. }
  701. function setScreenLocation(sid,xpos,ypos) {
  702. var viewerObj = getViewer("sysMessage");
  703. if (viewerObj != null && viewerObj.window.fSetScreenLocation != undefined) {
  704. viewerObj.window.fSetScreenLocation(sid,xpos,ypos);
  705. }
  706. }
  707. function getScreenLocation(sid) {
  708. var viewerObj = getViewer("sysMessage");
  709. if (viewerObj != null && viewerObj.window.fGetScreenLocation != undefined) {
  710. return viewerObj.window.fGetScreenLocation(sid);
  711. } else {
  712. return "";
  713. }
  714. }
  715. function getAbsoluteLocation(mon,xpos,ypos) {
  716. var viewerObj = getViewer("sysMessage");
  717. if (viewerObj != null && viewerObj.window.fGetAbsoluteCoordinate != undefined) {
  718. return viewerObj.window.fGetAbsoluteCoordinate(mon,xpos,ypos);
  719. } else {
  720. var abspos = new Array(2);
  721. abspos[0] = xpos;
  722. abspos[1] = ypos;
  723. return abspos;
  724. }
  725. }
  726. function getRelativeCoordinate(xpos,ypos){
  727. var viewerObj = getViewer("sysMessage");
  728. if (viewerObj != null && viewerObj.window.fGetRelativeCoordinate != undefined) {
  729. var coord = viewerObj.window.fGetRelativeCoordinate(xpos,ypos);
  730. coord[0] = coord[0]+1;
  731. return coord;
  732. } else {
  733. var coord = new Array(3);
  734. coord[0] = 1;
  735. coord[1] = xpos;
  736. coord[2] = ypos;
  737. return coord;
  738. }
  739. }
  740. function getCurrentMonitorNumber() {
  741. return getRelativeCoordinate(window.left,window.top)[0];
  742. }
  743. function getMonitorSize(monNo) {
  744. var viewerObj = getViewer("sysMessage");
  745. if (viewerObj != null && viewerObj.window.fGetMonitorSize != undefined) {
  746. return viewerObj.window.fGetMonitorSize(monNo);
  747. } else {
  748. var monSize = new Array(2);
  749. monSize[0] = 1280;
  750. monSize[1] = 1024;
  751. return monSize;
  752. }
  753. }
  754. function addOpenWindow() {
  755. var viewerObj = getViewer("sysMessage");
  756. if (viewerObj != null && viewerObj.window.fAddOpenWindow != undefined) {
  757. viewerObj.window.fAddOpenWindow(getScreenID()+"|"+getMyUID()+"|"+window.type+"|"+getTitle(),window);
  758. }
  759. }
  760. function removeOpenWindow() {
  761. var viewerObj = getViewer("sysMessage");
  762. if (viewerObj != null && viewerObj.window.fRemoveOpenWindow != undefined) {
  763. viewerObj.window.fRemoveOpenWindow(getScreenID()+"|"+getMyUID()+"|"+window.type+"|"+getTitle());
  764. }
  765. }
  766. function getOpenWindow(sid) {
  767. var viewerObj = getViewer("sysMessage");
  768. if (viewerObj != null && viewerObj.window.fGetOpenWindow != undefined) {
  769. return viewerObj.window.fGetOpenWindow(sid);
  770. } else {
  771. return null;
  772. }
  773. }
  774. function getMainViewer(){
  775. var viewerObj = getViewer("bizMain");
  776. if ( viewerObj == null )
  777. {
  778. viewerObj = htmldocument.allElement.TFViewer1;
  779. }
  780. if ( viewerObj == null )
  781. {
  782. return null;
  783. } else{
  784. return viewerObj.window;
  785. }
  786. }
  787. function getParameterPath() {
  788. return gvParamPath;
  789. }
  790. function setParameter(name, value){
  791. var valueNode = instance1.selectSingleNode(gvParamPath+"/"+name+"/"+name+"value");
  792. model.makeValue(gvParamPath+"/"+name+"/"+name+"value", value);
  793. }
  794. function addParameter(name, value){
  795. var valueNode = instance1.selectSingleNode(gvParamPath+"/"+name+"/"+name+"value");
  796. if(valueNode==null){
  797. model.makeValue(gvParamPath+"/"+name+"/"+name+"value", value);
  798. }else{
  799. var nameNode = instance1.selectSingleNode(gvParamPath+"/"+name);
  800. valueNode = instance1.createNode("element", name+"value", "");
  801. valueNode.text = value;
  802. nameNode.appendChild(valueNode);
  803. }
  804. }
  805. function getParameter(name, index){
  806. if (index==null) { index = 1; }
  807. return model.getValue(gvParamPath+"/"+name+"/"+name+"value["+index+"]");
  808. }
  809. function getParameterCount(name){
  810. return new Number(instance1.selectnodes(gvParamPath+"/"+name+"/"+name+"value").length);
  811. }
  812. function removeParameter(name, index){
  813. if (index==null) { index = 1; }
  814. model.removeNode(gvParamPath+"/"+name+"/"+name+"value["+index+"]");
  815. }
  816. function clearParameter(name){
  817. model.removeNode(gvParamPath+"/"+name);
  818. }
  819. function getBizName(bizCode) {
  820. var firstChar = bizCode.charAt(2);
  821. var bizName = "";
  822. switch(firstChar) {
  823. case 'P':
  824. case 'p':
  825. bizName = "pam";
  826. break;
  827. case 'M':
  828. case 'm':
  829. bizName = "emr";
  830. break;
  831. case 'A':
  832. case 'a':
  833. bizName = "ast";
  834. break;
  835. case 'L':
  836. case 'l':
  837. bizName = "lis";
  838. break;
  839. case 'R':
  840. case 'r':
  841. bizName = "mis";
  842. break;
  843. case 'Z':
  844. case 'z':
  845. bizName = "com";
  846. break;
  847. case 'S':
  848. case 's':
  849. bizName = "sts";
  850. break;
  851. case 'C':
  852. case 'c':
  853. bizName = "crm";
  854. break;
  855. case 'I':
  856. case 'i':
  857. bizName = "crc";
  858. break;
  859. case 'D':
  860. case 'd':
  861. bizName = "crd";
  862. break;
  863. case 'T':
  864. case 't':
  865. bizName = "tmp";
  866. break;
  867. default:
  868. bizName = "";
  869. break;
  870. }
  871. return bizName;
  872. }
  873. function getMainDomain() {
  874. var domainStr = getGlobalVariable("domain");
  875. if (domainStr == "") {
  876. domainStr = "http://his999dev.knu.ac.kr:8088";
  877. }
  878. return domainStr;
  879. }
  880. function getDomain(syscd) {
  881. var domainStr = null;
  882. if (syscd == null || syscd == "") {
  883. syscd = model.getValue(gvSystemPath);
  884. }
  885. if (syscd == null || syscd == "") {
  886. domainStr = getMainDomain();
  887. } else {
  888. domainStr = getGlobalVariable("sysurl" + syscd.toUpperCase());
  889. }
  890. return domainStr;
  891. }
  892. function getScreenURL(sid,syscd) {
  893. return getDomain(syscd)+getScreenURI(sid);
  894. }
  895. function getScreenURI(sid) {
  896. return "/himed/webapps/hit/web/xrw/"+sid+".xrw";
  897. }
  898. function getActionURI(submitID) {
  899. var bizName = getBizName(submitID);
  900. var scrnID = getScreenID();
  901. return "/himed/webapps/hit/web/xrw/.live?submit_id="+submitID+"&business_id="+bizName+"&screen_id="+scrnID;
  902. }
  903. function getActionURL(submitID) {
  904. return getDomain()+getActionURI(submitID);
  905. }
  906. var gvOnSubmit = false;
  907. var gvShowAlert = false;
  908. var gvSuppressError = false;
  909. var gvForceSubmit = false;
  910. var gvHtmlRedirect = false;
  911. var gvSuppressErrorCheck = false;
  912. function setAlertOn() {
  913. gvShowAlert = true;
  914. }
  915. function setErrorOff(SuppressErrorCheck) {
  916. gvSuppressError = true;
  917. if(SuppressErrorCheck == true)
  918. {
  919. gvSuppressErrorCheck = true;
  920. }
  921. }
  922. function setErrorOn() {
  923. gvSuppressError = false;
  924. gvSuppressErrorCheck = false;
  925. }
  926. function setForceOn() {
  927. gvForceSubmit = true;
  928. }
  929. function setHtmlRedirect() {
  930. gvHtmlRedirect = true;
  931. }
  932. function checkTimeout() {
  933. var timeOut = parseInt(getGlobalVariable("session_timeout"));
  934. if (isNaN(timeOut) || timeOut <= 0) {
  935. return false;
  936. }
  937. var lastTime = getGlobalVariable("last_submit");
  938. var curTime = (new Date()).getTime();
  939. if (curTime - parseInt(lastTime) > (timeOut*60000)) {
  940. return true;
  941. } else {
  942. return false;
  943. }
  944. }
  945. function submit(submitID, refresh, ref, resultref, encoding) {
  946. var showAlert = gvShowAlert;
  947. var suppressError = gvSuppressError;
  948. gvShowAlert = false;
  949. if(gvSuppressErrorCheck == false)
  950. {
  951. gvSuppressError = false;
  952. }
  953. var islogout = false;
  954. if (!gvForceSubmit) {
  955. gvForceSubmit = false;
  956. if (checkTimeout()) {
  957. body.setDisabled(true);
  958. setParameter("type", "session");
  959. setParameter("islogout", "false");
  960. modal("SPZUM00400", "", "", "", "", "", "","width:279px;height:180px;align:center;sysmenu:hidden;");
  961. body.setDisabled(false);
  962. if (getParameter("islogout") == "true") {
  963. islogout = true;
  964. } else {
  965. if (checkTimeout()) {
  966. gvHtmlRedirect = false;
  967. return false;
  968. }
  969. }
  970. }
  971. setGlobalVariable("last_submit", (new Date()).getTime());
  972. }
  973. if (islogout) {
  974. var status = getViewer("sysMessage");
  975. status.window.fLogout("session");
  976. return;
  977. } else {
  978. if (gvOnSubmit) {
  979. gvHtmlRedirect = false;
  980. return false;
  981. } else {
  982. gvOnSubmit = true;
  983. }
  984. var actionURL = getActionURL(submitID)
  985. + getUserSessionString();
  986. if ( refresh == null ) {
  987. refresh = true;
  988. }
  989. var retvalue = false;
  990. try {
  991. var sid = document.allElement.item(submitID);
  992. if (!sid) {
  993. messageBox("Submit["+submitID+"]�� ���ǵ���","E007");
  994. gvOnSubmit = false;
  995. gvHtmlRedirect = false;
  996. return false;
  997. }
  998. if ( ref != null && ref != "" ) {
  999. sid.setAttribute("ref", ref);
  1000. }
  1001. if ( resultref != null && resultref != "" ) {
  1002. sid.setAttribute("resultref", resultref);
  1003. }
  1004. sid.setAttribute("action", actionURL);
  1005. if (encoding != null && encoding != "") {
  1006. sid.setAttribute("encoding", encoding);
  1007. } else {
  1008. sid.setAttribute("encoding", "utf-8");
  1009. }
  1010. model.removeNode(gvErrorMsgPath);
  1011. var ret = model.send(submitID, refresh, false, true);
  1012. if ( ret == 200 ) {
  1013. retvalue = showSystemMessage(showAlert,suppressError);
  1014. } else {
  1015. if (!suppressError) {
  1016. messageBox("Submit["+submitID+"] ������","E009","[ret:"+ret+"]");
  1017. }
  1018. retvalue = false;
  1019. }
  1020. } catch (e) {
  1021. if (!suppressError) {
  1022. messageBox("Submit["+submitID+"] ������","E009","[exception:"+e+"]");
  1023. }
  1024. retvalue = false;
  1025. }
  1026. gvOnSubmit = false;
  1027. gvHtmlRedirect = false;
  1028. return retvalue;
  1029. }
  1030. }
  1031. function xforms_submit_error() {
  1032. if (error.errorcode == 3003) {
  1033. messageBox("���� ������ �� ��ȿ���� ���� ���ڰ� �����Ͽ� ȭ�� �����","E009","[errorcode:"+error.errorcode+"]");
  1034. m_event.stopPropagation();
  1035. }
  1036. }
  1037. function showSystemMessage(showAlert,suppressError) {
  1038. var type = model.getValue(gvErrorMsgPath+"/type");
  1039. var code = model.getValue(gvErrorMsgPath+"/code");
  1040. var msg = model.getValue(gvErrorMsgPath+"/msg");
  1041. var desc = model.getValue(gvErrorMsgPath+"/description");
  1042. if ( "error" == type ) {
  1043. if (suppressError == null || !suppressError) {
  1044. body.setDisabled(true);
  1045. window.load("../../../com/commonweb/xrw/SPZZZ00100_�ý��ۿ���.xrw","modal","","width:514px;height:198px;align:center;",gvErrorMsgPath,"/root/main");
  1046. body.setDisabled(false);
  1047. }
  1048. return false;
  1049. } else {
  1050. setSystemMessage(msg);
  1051. if (showAlert != null && showAlert) {
  1052. messageBox(msg,"I");
  1053. }
  1054. return true;
  1055. }
  1056. }
  1057. function onredirecthtml() {
  1058. if( document.allElement.item(m_event.target).elementName == "xforms:submission" && gvHtmlRedirect == false) {
  1059. m_event.preventDefault();
  1060. m_event.stopPropagation();
  1061. }
  1062. gvHtmlRedirect = false;
  1063. }
  1064. function onerror() {
  1065. var msg = error.description;
  1066. var svrtime = error.errorSource;
  1067. var pctime = (new Date()).getTime();
  1068. setGlobalVariable("timediff", svrtime - pctime);
  1069. m_event.stopPropagation();
  1070. handleSystemMessage(msg);
  1071. }
  1072. function handleSystemMessage(msg) {
  1073. var msgItem = msg.split("|");
  1074. model.makeValue(gvErrorMsgPath+"/type",msgItem[0]);
  1075. model.makeValue(gvErrorMsgPath+"/code",msgItem[1]);
  1076. model.makeValue(gvErrorMsgPath+"/msg",msgItem[2].replace(";","\n"),true);
  1077. var description = "";
  1078. if (msgItem[3] != null && msgItem[3] != "undefined") {
  1079. description = msgItem[3];
  1080. }
  1081. if (msgItem[4] != null && msgItem[4] != "undefined") {
  1082. description = description + "\n" + msgItem[4];
  1083. }
  1084. model.makeValue(gvErrorMsgPath+"/description",description);
  1085. }
  1086. function getUserSessionString() {
  1087. var sessionStr = "&macaddr="+getUserInfo("macaddr");
  1088. var isAnonymous = getGlobalVariable("anonymous");
  1089. if (isAnonymous == "true") {
  1090. sessionStr = sessionStr + "&anony_session="+encodeURI(getUserInfos());
  1091. }
  1092. return sessionStr;
  1093. }
  1094. function messageBox(pMessage, pCode, pOptMsg) {
  1095. var alertMsg = null;
  1096. var msgTitle = null;
  1097. var msgType = null;
  1098. var msgData = null;
  1099. var msgRtn = "";
  1100. switch( pCode.substr(0,1) ){
  1101. case "I": msgTitle = "����";
  1102. msgType = "64";
  1103. break;
  1104. case "C": msgTitle = "����";
  1105. msgType = "16";
  1106. break;
  1107. case "E": msgTitle = "���";
  1108. msgType = "48";
  1109. break;
  1110. case "Q": msgTitle = "Ȯ��";
  1111. msgType = "36";
  1112. break;
  1113. case "S": msgTitle = "����";
  1114. msgType = "35";
  1115. break;
  1116. default : msgTitle = "����";
  1117. msgType = "16";
  1118. }
  1119. switch( pCode ){
  1120. case "I000": alertMsg = ""; break;
  1121. case "I001": alertMsg = " ó���Ǿ���ϴ�."; break;
  1122. case "I002": alertMsg = " �Ϸ�Ǿ���ϴ�."; break;
  1123. case "I003": alertMsg = " �ʼ��Է��Դϴ�."; break;
  1124. case "I004": alertMsg = " ����ϴ�."; break;
  1125. case "I005": alertMsg = " ȯ���Դϴ�."; break;
  1126. case "I006": alertMsg = " �����մϴ�."; break;
  1127. case "I007": alertMsg = " Ȯ���Ͻʽÿ�."; break;
  1128. case "I008": alertMsg = " �Ͻʽÿ�."; break;
  1129. case "I009": alertMsg = " �Դϴ�."; break;
  1130. case "I010": alertMsg = " �ֽ��ϴ�."; break;
  1131. case "I011": alertMsg = " �ʽ��ϴ�.";break;
  1132. case "C000": alertMsg = ""; break;
  1133. case "C001": alertMsg = " �Է��Ͻʽÿ�."; break;
  1134. case "C002": alertMsg = " �����Ͻʽÿ�."; break;
  1135. case "C003": alertMsg = " �����Ͻʽÿ�."; break;
  1136. case "E000": alertMsg = ""; break;
  1137. case "E001": alertMsg = " �� �� ����ϴ�."; break;
  1138. case "E002": alertMsg = " ������ ����ϴ�."; break;
  1139. case "E003": alertMsg = " �ʰ��Ͽ����ϴ�."; break;
  1140. case "E004": alertMsg = " ��ġ���� �ʽ��ϴ�."; break;
  1141. case "E005": alertMsg = " ���õǾ���ϴ�."; break;
  1142. case "E006": alertMsg = " �ߺ��Ǿ���ϴ�."; break;
  1143. case "E007": alertMsg = " �ʾҽ��ϴ�."; break;
  1144. case "E008": alertMsg = " �Դϴ�."; break;
  1145. case "E009": alertMsg = " �����Ͽ����ϴ�."; break;
  1146. case "E010": alertMsg = " ��� �����մϴ�."; break;
  1147. case "E011": alertMsg = " ���� �����մϴ�."; break;
  1148. case "E012": alertMsg = " ���ĸ� �����մϴ�."; break;
  1149. case "E013": alertMsg = " �����Ͱ� ����ϴ�."; break;
  1150. case "E014": alertMsg = " �������� �ʽ��ϴ�."; break;
  1151. case "E015": alertMsg = " �ڸ������� �����մϴ�."; break;
  1152. case "E016": alertMsg = " ��ȿ���� �ʽ��ϴ�."; break;
  1153. case "Q000": alertMsg = ""; break;
  1154. case "Q001": alertMsg = " ���� �Ͻðڽ��ϱ�?"; break;
  1155. case "Q002": alertMsg = " ���� �Ͻðڽ��ϱ�?"; break;
  1156. case "Q003": alertMsg = " ��� �����Ͻðڽ��ϱ�?"; break;
  1157. case "Q004": alertMsg = " ���� �Ͻðڽ��ϱ�?"; break;
  1158. case "Q005": alertMsg = " ��ȸ �Ͻðڽ��ϱ�?"; break;
  1159. case "Q006": alertMsg = " Ȯ�� �Ͻðڽ��ϱ�?"; break;
  1160. case "Q007": alertMsg = " ��� �Ͻðڽ��ϱ�?"; break;
  1161. case "Q008": alertMsg = " �߰� �Ͻðڽ��ϱ�?"; break;
  1162. case "Q009": alertMsg = " ��� �Ͻðڽ��ϱ�?"; break;
  1163. case "Q010": alertMsg = " �ʱ�ȭ �Ͻðڽ��ϱ�?"; break;
  1164. case "Q011": alertMsg = " Ȯ�� �Ͻðڽ��ϱ�?"; break;
  1165. case "Q012": alertMsg = " ���� �Ͻðڽ��ϱ�?"; break;
  1166. case "Q013": alertMsg = " ���� �Ͻðڽ��ϱ�?";break;
  1167. case "Q014": alertMsg = " ��� �Ͻðڽ��ϱ�?";break;
  1168. case "Q015": alertMsg = " ���û �Ͻðڽ��ϱ�?";break;
  1169. case "Q016": alertMsg = " ����� ������Դϴ�. ��ϳ����� �����Ͻðڽ��ϱ�?";break;
  1170. case "S001": alertMsg = " �Ͻ÷��� ��(Yes)\n�ƴϸ� �ƴϿ�(No)�� �����Ͻʽÿ�."; break;
  1171. case "S002": alertMsg = " �����Ͻ÷��� ��(Yes)\n�����Ͻ÷��� �ƴϿ�(No)�� �����Ͻʽÿ�"; break;
  1172. case "S003": alertMsg = " �Ͻ÷��� ��(Yes)\n" + pOptMsg + " �Ͻ÷��� �ƴϿ�(No)�� �����Ͻʽÿ�.";break;
  1173. case "S004": alertMsg = " �Ͻ÷��� ��(Yes)\n�ƴϸ� �ƴϿ�(No)\n�����Ͻ÷��� ��Ҹ� �����Ͻʽÿ�";break;
  1174. case "S005": alertMsg = " ����� ������Դϴ�. �۾������� �����Ͻʽÿ�\n\n�� : ��ϼ��� / �ƴϿ� : �űԱ�ϻ�";break;
  1175. case "S006": alertMsg = " �Ͻ÷��� ��(Yes)\n" + pOptMsg.split("|")[0] + " �Ͻ÷��� �ƴϿ�(No)\n" + pOptMsg.split("|")[1] + " �Ͻ÷��� ��Ҹ� �����Ͻʽÿ�";break;
  1176. case "S007": alertMsg = " \n���� �Ͻ÷��� ��(Yes), " + pOptMsg.split("|")[0] + " �ƴϿ�(No), " + pOptMsg.split("|")[1] + " ��Ҹ� �����Ͻʽÿ�.";break;
  1177. default : alertMsg = "";
  1178. }
  1179. if(pOptMsg == null || pOptMsg == ""){
  1180. msgData = pMessage+alertMsg;
  1181. } else {
  1182. if (pCode == "S003" || pCode == "S006" || pCode == "S007") {
  1183. msgData = pMessage+alertMsg;
  1184. } else {
  1185. msgData = pMessage+alertMsg + "\n" + pOptMsg;
  1186. }
  1187. }
  1188. body.setDisabled(true);
  1189. msgRtn = window.showMessageBox( msgData, msgTitle, msgType );
  1190. body.setDisabled(false);
  1191. return msgRtn;
  1192. }
  1193. function getUserId() {
  1194. return getUserInfo("userid");
  1195. }
  1196. function getUserName() {
  1197. return getUserInfo("usernm");
  1198. }
  1199. function getUserInfo(key) {
  1200. if ( getGlobalVariable("userinfos") == "" ) {
  1201. setDefaultUserInfo();
  1202. }
  1203. return getGlobalVariable(key);
  1204. }
  1205. function getUserInfos() {
  1206. if ( getGlobalVariable("userinfos") == "" ) {
  1207. setDefaultUserInfo();
  1208. }
  1209. return getGlobalVariable("userinfos");
  1210. }
  1211. function setDefaultUserInfo() {
  1212. var userInfoKeyStr="userid|usernm|posinstcd|posinstnm|posdeptcd|posdeptnm|dutplceinstcd|dutplceinstnm|dutplcecd|dutplcenm|jobkindcd|jobkindnm|jobposcd|jobposnm|jobrespcd|jobrespnm|prfshipflagcd|prfshipflagnm|licnsno|specordyn|deptabbr|orddeptflag|wardflag|systemcd|systemnm|systeminstcd|systeminstnm|logindt|kmiip|kmiport|usergrp|ipaddr|dutinstcd|dutinstnm|dutunitcd|dutunitnm|mpphonno|orginstcd|orginstnm|orgdeptcd|orgdeptnm|userkindcd|ordsupdeptcd";
  1213. var userInfoKeyArr = userInfoKeyStr.split("|");
  1214. var userInfoStr = "";
  1215. try {
  1216. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1217. var f = fso.GetFile("session.txt");
  1218. var ts = f.OpenAsTextStream(1);
  1219. userInfoStr = ts.ReadLine();
  1220. ts.Close();
  1221. } catch(e) {
  1222. }
  1223. var userInfoArr = userInfoStr.split("|");
  1224. var len = userInfoKeyArr.length;
  1225. setGlobalVariable("anonymous","true");
  1226. for(i=0;i<len;i++) {
  1227. setGlobalVariable(userInfoKeyArr[i],userInfoArr[i]);
  1228. }
  1229. setGlobalVariable("userinfos", userInfoStr);
  1230. }
  1231. function getPropertyName(key, bizCode){
  1232. var bizName = "";
  1233. var propertyName = "";
  1234. if (bizCode == null || bizCode == "" || bizCode == "undefined")
  1235. {
  1236. bizName = "";
  1237. }else{
  1238. bizName = getBizName(bizCode)+"_";
  1239. }
  1240. return getSystemCd()+"_"+bizName+"gsv_"+key;
  1241. }
  1242. function setGlobalVariable(key, value, bizCode){
  1243. model.setProperty(getPropertyName(key, bizCode), value);
  1244. return true;
  1245. }
  1246. function getGlobalVariable(key, bizCode){
  1247. return model.getProperty(getPropertyName(key, bizCode));
  1248. }
  1249. function getUserGroupList() {
  1250. var usergrp = getUserInfo("usergrp");
  1251. if (usergrp == null || usergrp == "") {
  1252. return null;
  1253. } else {
  1254. return usergrp.split(",");
  1255. }
  1256. }
  1257. function checkUserGroup(grpname) {
  1258. var usergrplist = getUserGroupList();
  1259. if (usergrplist == null) {
  1260. return false;
  1261. }
  1262. for(var i=0;i<usergrplist.length;i++) {
  1263. if (grpname == usergrplist[i]) {
  1264. return true;
  1265. }
  1266. }
  1267. return false;
  1268. }
  1269. function setPatientInfo(key, value) {
  1270. var viewerObj = getViewer("patientInfo");
  1271. if ( viewerObj != null){
  1272. if ( key != "pid" && value.split("|")[0] == getPatientId()){
  1273. return viewerObj.window.fSetPatientInfo(key, value.split("|")[1]);
  1274. }else{
  1275. return viewerObj.window.fSetPatientInfo(key, value);
  1276. }
  1277. }
  1278. return false;
  1279. }
  1280. function setPatientInfos(values){
  1281. var viewerObj = getViewer("patientInfo");
  1282. if ( viewerObj != null ){
  1283. return viewerObj.window.fSetPatientInfos(values);
  1284. }
  1285. return false;
  1286. }
  1287. function delPatientInfos(){
  1288. var viewerObj = getViewer("patientInfo");
  1289. if ( viewerObj != null ){
  1290. return viewerObj.window.fDelPatientInfos();
  1291. }
  1292. return false;
  1293. }
  1294. function getPatientInfo(key) {
  1295. var viewerObj = getViewer("patientInfo");
  1296. if ( viewerObj != null ){
  1297. return viewerObj.window.fGetPatientInfo(key);
  1298. }
  1299. return "";
  1300. }
  1301. function getPatientInfos() {
  1302. var viewerObj = getViewer("patientInfo");
  1303. if ( viewerObj != null ){
  1304. return viewerObj.window.fGetPatientInfos();
  1305. }
  1306. return "";
  1307. }
  1308. function getPatientId() {
  1309. var viewerObj = getViewer("patientInfo");
  1310. if ( viewerObj != null ){
  1311. return viewerObj.window.fGetPatientId();
  1312. }
  1313. return "";
  1314. }
  1315. function getPatientName() {
  1316. var viewerObj = getViewer("patientInfo");
  1317. if ( viewerObj != null ){
  1318. return viewerObj.window.fGetPatientName();
  1319. }
  1320. return "";
  1321. }
  1322. function setPatientFlag(value){
  1323. var viewerObj = getViewer("patientInfo");
  1324. if ( viewerObj != null){
  1325. return viewerObj.window.fSetPatientFlag(value);
  1326. }
  1327. return false;
  1328. }
  1329. function setPatientInfoDetail(srcPath){
  1330. var viewerObj = getViewer("patientInfo");
  1331. var srcPath = instance1.selectSingleNode(srcPath);
  1332. if ( viewerObj != null && srcPath != null){
  1333. var destPath = viewerObj.window.fGetPatientInfoPath();
  1334. if( destPath != ""){
  1335. viewerObj.window.model.makeNode(destPath);
  1336. viewerObj.window.model.copyNode(destPath, srcPath);
  1337. return viewerObj.window.fCheckPatientId(destPath, "paminfo");
  1338. }else{
  1339. messageBox("ȯ�ڱ�����","E014");
  1340. }
  1341. }
  1342. return false;
  1343. }
  1344. function setPatientInfoDetailByKey(key, value) {
  1345. var viewerObj = getViewer("patientInfo");
  1346. if ( viewerObj != null){
  1347. if (key == "pid") {
  1348. return viewerObj.window.fSetPatientInfoDetailByKey(key, value);
  1349. } else {
  1350. if (value.split("|")[0] == getPatientId()) {
  1351. return viewerObj.window.fSetPatientInfoDetailByKey(key, value.split("|")[1]);
  1352. }
  1353. }
  1354. }
  1355. return false;
  1356. }
  1357. function getPatientInfoDetail(key) {
  1358. var viewerObj = getViewer("patientInfo");
  1359. if ( viewerObj != null ){
  1360. return viewerObj.window.fGetPatientInfoDetail(key);
  1361. }
  1362. return "";
  1363. }
  1364. function getPatientInfoDetails(destPath) {
  1365. var viewerObj = getViewer("patientInfo");
  1366. var destPath = instance1.selectSingleNode(destPath);
  1367. if ( viewerObj != null && destPath != null){
  1368. srcPath = viewerObj.window.fGetPatientInfoPath();
  1369. if(srcPath != ""){
  1370. srcPath = viewerObj.window.instance1.selectSingleNode(srcPath);
  1371. if(srcPath != null){
  1372. model.copyNode(destPath, srcPath);
  1373. return true;
  1374. }
  1375. }
  1376. }
  1377. return false;
  1378. }
  1379. function setOperationInfo(srcPath){
  1380. var viewerObj = getViewer("patientInfo");
  1381. var srcPath = instance1.selectSingleNode(srcPath);
  1382. if ( viewerObj != null && srcPath != null){
  1383. viewerObj.window.model.makeNode(gvOperationInfoPath);
  1384. viewerObj.window.model.copyNode(gvOperationInfoPath, srcPath);
  1385. return viewerObj.window.fCheckPatientId(gvOperationInfoPath, "operation");
  1386. }
  1387. return false;
  1388. }
  1389. function setOperationInfoDetailByKey(key, value) {
  1390. var viewerObj = getViewer("patientInfo");
  1391. if ( viewerObj != null){
  1392. if (key == "pid") {
  1393. return viewerObj.window.fSetOperationInfoDetailByKey(key, value);
  1394. } else {
  1395. if (value.split("|")[0] == getPatientId()) {
  1396. return viewerObj.window.fSetOperationInfoDetailByKey(key, value.split("|")[1]);
  1397. }
  1398. }
  1399. }
  1400. return false;
  1401. }
  1402. function getOperationInfo(key){
  1403. var viewerObj = getViewer("patientInfo");
  1404. if ( viewerObj != null){
  1405. return viewerObj.window.fGetOperationInfo(key);
  1406. }
  1407. return "";
  1408. }
  1409. function getOperationInfos(destPath){
  1410. var viewerObj = getViewer("patientInfo");
  1411. var destPath = instance1.selectSingleNode(destPath);
  1412. if ( viewerObj != null && destPath != null){
  1413. var srcPath = viewerObj.window.instance1.selectSingleNode(gvOperationInfoPath);
  1414. if(srcPath != null){
  1415. model.copyNode(destPath, srcPath);
  1416. return true;
  1417. }
  1418. }
  1419. return false;
  1420. }
  1421. function setConsultInfo(srcPath){
  1422. var viewerObj = getViewer("patientInfo");
  1423. var srcPath = instance1.selectSingleNode(srcPath);
  1424. if ( viewerObj != null && srcPath != null){
  1425. viewerObj.window.model.makeNode(gvConsultInfoPath);
  1426. viewerObj.window.model.copyNode(gvConsultInfoPath, srcPath);
  1427. return viewerObj.window.fCheckPatientId(gvConsultInfoPath, "consult");
  1428. }
  1429. return false;
  1430. }
  1431. function setConsultInfoDetailByKey(key, value) {
  1432. var viewerObj = getViewer("patientInfo");
  1433. if ( viewerObj != null){
  1434. if (key == "pid") {
  1435. return viewerObj.window.fSetConsultInfoDetailByKey(key, value);
  1436. } else {
  1437. if (value.split("|")[0] == getPatientId()) {
  1438. return viewerObj.window.fSetConsultInfoDetailByKey(key, value.split("|")[1]);
  1439. }
  1440. }
  1441. }
  1442. return false;
  1443. }
  1444. function getConsultInfo(key){
  1445. var viewerObj = getViewer("patientInfo");
  1446. if ( viewerObj != null){
  1447. return viewerObj.window.fGetConsultInfo(key);
  1448. }
  1449. return "";
  1450. }
  1451. function getConsultInfos(destPath) {
  1452. var viewerObj = getViewer("patientInfo");
  1453. var destPath = instance1.selectSingleNode(destPath);
  1454. if ( viewerObj != null && destPath != null){
  1455. var srcPath = viewerObj.window.instance1.selectSingleNode(gvConsultInfoPath);
  1456. if(srcPath != null){
  1457. model.copyNode(destPath, srcPath);
  1458. return true;
  1459. }
  1460. }
  1461. return false;
  1462. }
  1463. function getOrderBasicInfo(destPath){
  1464. var viewerObj = getViewer("sysMessage");
  1465. var destPath = instance1.selectSingleNode(destPath);
  1466. if ( viewerObj != null && destPath != null){
  1467. var srcPath = viewerObj.window.instance1.selectSingleNode(gvOrderBasicInfoPath);
  1468. if(srcPath != null){
  1469. model.copyNode(destPath, srcPath);
  1470. return true;
  1471. }
  1472. }
  1473. return false;
  1474. }
  1475. function exeReportPreview(rid, dataType, paramsXPath, submitId, print, printDialog, fileType, fileName, fileDialog, closeYn, monNo, parentObjId, printPaperBin, userService, showButton, printCount, zoomRate, printOption, dataXPath, mainDataXPath, subDataXPath)
  1476. {
  1477. var reportNode = instance1.selectSingleNode(gvReportPath);
  1478. var syscd = getSystemCd();
  1479. syscd = syscd.substr(3,3);
  1480. if(syscd == "") syscd = "001";
  1481. if(reportNode != null){
  1482. model.removeNodeset(gvReportPath);
  1483. }
  1484. model.makeNode(gvReportPath);
  1485. model.makeNode(gvReportParamsPath);
  1486. model.makeNode(gvReportPropsPath);
  1487. model.makeNode(gvReportOptionsPath);
  1488. paramsXPath = instance1.selectSingleNode(paramsXPath);
  1489. if(paramsXPath != null){
  1490. model.copyNode(gvReportParamsPath, paramsXPath);
  1491. }
  1492. model.makeValue(gvReportParamsPath+"/userid", getUserId());
  1493. model.makeValue(gvReportParamsPath+"/logoimgurl", getImageURL("error_logo"+getLogoImageKey()));
  1494. model.makeValue(gvReportParamsPath+"/url", rid);
  1495. model.makeValue(gvReportPropsPath+"/rex_rptname", rid);
  1496. model.makeValue(gvReportPropsPath+"/rex_datatype", dataType);
  1497. model.makeValue(gvReportPropsPath+"/rex_submitid", submitId);
  1498. model.makeValue(gvReportPropsPath+"/rex_userservice", userService);
  1499. model.makeValue(gvReportPropsPath+"/rex_data_xpath", dataXPath);
  1500. model.makeValue(gvReportPropsPath+"/rex_xpath", mainDataXPath);
  1501. model.makeValue(gvReportPropsPath+"/rex_xpath1", subDataXPath);
  1502. model.makeValue(gvReportOptionsPath+"/rex_print", print);
  1503. model.makeValue(gvReportOptionsPath+"/rex_printdialog", printDialog);
  1504. model.makeValue(gvReportOptionsPath+"/rex_printpaperbin", printPaperBin);
  1505. model.makeValue(gvReportOptionsPath+"/rex_filetype", fileType);
  1506. model.makeValue(gvReportOptionsPath+"/rex_filename", fileName);
  1507. model.makeValue(gvReportOptionsPath+"/rex_filedialog", fileDialog);
  1508. model.makeValue(gvReportOptionsPath+"/rex_close", closeYn);
  1509. model.makeValue(gvReportOptionsPath+"/rex_showbutton", showButton);
  1510. model.makeValue(gvReportOptionsPath+"/rex_printcount", printCount);
  1511. model.makeValue(gvReportOptionsPath+"/rex_zoomrate", zoomRate);
  1512. model.makeValue(gvReportOptionsPath+"/rex_printoption", printOption);
  1513. if(parentObjId == null || parentObjId == ""){
  1514. if(document.allElement.item("ivr_report") == null){
  1515. setParameter("onready","true");
  1516. modal("SPZUR00100", monNo);
  1517. }else{
  1518. ivr_report.window.fInitRexpert();
  1519. }
  1520. }else{
  1521. var parentObj = document.allElement.item(parentObjId);
  1522. if(parentObj != null){
  1523. var childObj = document.allElement.item("ivr_"+parentObjId);
  1524. if(childObj != null){
  1525. childObj.window.fInitRexpert();
  1526. }
  1527. }
  1528. }
  1529. }
  1530. function makeReportPreview(left, top, width, height, parentObjId){
  1531. if(left==null || top==null || width==null || height==null){
  1532. messageBox("�̸����� ũ��������", "I004");
  1533. }else{
  1534. if(parentObjId == null || parentObjId == ""){
  1535. if(document.allElement.item("ivr_report") == null){
  1536. if(document.allElement.item("grp_biz") == null){
  1537. body.createChild("xforms:iviewer", "id:ivr_report; src:../../../com/commonweb/xrw/SPZUR00100_���?.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
  1538. "px;");
  1539. }else{
  1540. grp_biz.createChild("xforms:iviewer", "id:ivr_report; src:../../../com/commonweb/xrw/SPZUR00100_���?.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
  1541. "px;");
  1542. }
  1543. }
  1544. }else{
  1545. var parentObj = document.allElement.item(parentObjId);
  1546. if(parentObj != null){
  1547. parentObj.createChild("xforms:iviewer", "id:ivr_"+parentObjId+"; src:../../../com/commonweb/xrw/SPZUR00100_���?.xrw; left:"+left+"px; top:"+top+"px; width:"+width+"px; height:"+height+
  1548. "px;");
  1549. childObj = document.allElement.item("ivr_"+parentObjId);
  1550. }
  1551. }
  1552. }
  1553. }
  1554. function resetReportPreview(parentObjId){
  1555. if(parentObjId == null || parentObjId == ""){
  1556. if(document.allElement.item("ivr_report") == null){
  1557. var child = getChildWindow("SPZUR00100");
  1558. if(child != null){
  1559. child.fCloseReport();
  1560. }
  1561. }else{
  1562. ivr_report.window.fCloseReport();
  1563. }
  1564. }else{
  1565. var parentObj = document.allElement.item(parentObjId);
  1566. if(parentObj != null){
  1567. childObj = document.allElement.item("ivr_"+parentObjId);
  1568. if(childObj != null){
  1569. childObj.window.fCloseReport();
  1570. }
  1571. }
  1572. }
  1573. }
  1574. function removeReportPreview(parentObjId){
  1575. if(parentObjId == null || parentObjId == ""){
  1576. if(document.allElement.item("ivr_report") != null){
  1577. parentObjId = document.allElement.item("ivr_report").parent.attribute["id"];
  1578. document.allElement.item(parentObjId).removeChild("ivr_report");
  1579. }
  1580. }else{
  1581. var parentObj = document.allElement.item(parentObjId);
  1582. if(parentObj != null){
  1583. parentObj.removeChild("ivr_"+parentObjId);
  1584. }
  1585. }
  1586. }
  1587. function screenPrint(){
  1588. modal("SPZUR00200");
  1589. }
  1590. function getImageURL(imgcd, type){
  1591. if (type == null || type == "") {
  1592. type = "gif";
  1593. }
  1594. return getDomain()+"/himed/webapps/com/commonweb/images/"+imgcd+"." + type;
  1595. }
  1596. function getLogoImageURL(syscd){
  1597. return getImageURL("logo"+getLogoImageKey(syscd));
  1598. }
  1599. function getLogoEImageURL(syscd){
  1600. return getImageURL("logo"+getLogoImageKey(syscd)+"e","jpg");
  1601. }
  1602. function getBigLogoImageURL(type, syscd) {
  1603. if (type.toUpperCase() == "H") {
  1604. type == "";
  1605. } else if (type.toUpperCase() == "E") {
  1606. type = "e";
  1607. }
  1608. return getImageURL("biglogo" + getLogoImageKey(syscd) + type, "jpg");
  1609. }
  1610. function getLogoImageKey(syscd){
  1611. var imageKey = "";
  1612. if(syscd == null || syscd == ""){
  1613. syscd = getSystemCd();
  1614. }
  1615. if(syscd.toUpperCase() == "MIS001") {
  1616. imageKey = getUserInfo("dutplceinstcd");
  1617. }else{
  1618. imageKey = syscd.substr(3,3);
  1619. }
  1620. return imageKey;
  1621. }
  1622. function openLoadingBar(msg){
  1623. setParameter("msg", msg);
  1624. open("SPZZZ00400", "", "", "", "", "", "","width:327px; height:121px; caption:hidden; resize:false;");
  1625. }
  1626. function closeLoadingBar(){
  1627. var child = getChildWindow("SPZZZ00400");
  1628. if(child != null) {
  1629. child.close();
  1630. }
  1631. }
  1632. function openPasswordValidate(titlemsg, helpMsg){
  1633. setParameter("titlemsg", titlemsg);
  1634. setParameter("helpmsg", helpMsg);
  1635. modal("SPZUM00400", "", "", "", "", "", "","width:280px;height:270px;align:center;");
  1636. return getParameter("pwdvalid");
  1637. }
  1638. var gvCommonCachePath="/root/hidden/common/cache";
  1639. function copyFromCache(itemname,resultref) {
  1640. var viewerObj = getViewer("sysMessage");
  1641. if (viewerObj == null) {
  1642. return false;
  1643. }
  1644. var srcPath = gvCommonCachePath+"/"+itemname;
  1645. model.makeNode(resultref);
  1646. var itemnode = viewerObj.window.instance1.selectSingleNode(srcPath);
  1647. if (itemnode == null) {
  1648. return false;
  1649. } else {
  1650. var dueDate = itemnode.getAttribute("duedate");
  1651. var curDate = (new Date()).valueOf();
  1652. if (dueDate < curDate) {
  1653. return false;
  1654. }
  1655. }
  1656. model.copyNode(resultref,itemnode);
  1657. return true;
  1658. }
  1659. function storeIntoCache(itemname,resultref,duemin) {
  1660. var viewerObj = getViewer("sysMessage");
  1661. if (viewerObj == null) {
  1662. return;
  1663. }
  1664. var destPath = gvCommonCachePath+"/"+itemname;
  1665. viewerObj.window.model.makeNode(destPath);
  1666. var itemnode = instance1.selectSingleNode(resultref);
  1667. if (itemnode == null) {
  1668. return;
  1669. }
  1670. viewerObj.window.model.copyNode(destPath,itemnode);
  1671. itemnode = viewerObj.window.instance1.selectSingleNode(destPath);
  1672. if (itemnode != null) {
  1673. var dueDate = (new Date()).valueOf();
  1674. if (duemin == null) {
  1675. duemin = 600;
  1676. }
  1677. dueDate = dueDate + duemin*60*1000;
  1678. itemnode.setAttribute("duedate",dueDate);
  1679. }
  1680. }
  1681. function setHelp(width, height, scnID) {
  1682. if (width == null || width == "" || width == "undefined") {
  1683. width = "800";
  1684. }
  1685. if (height == null || height == "" || height == "undefined") {
  1686. height = "600";
  1687. }
  1688. if (scnID == null || height == "" || scnID == "undefined") {
  1689. scnID = getScreenID();
  1690. }
  1691. setParameter(scnID + "_help_width", width);
  1692. setParameter(scnID + "_help_height", height);
  1693. }
  1694. function getHelpPage() {
  1695. var scnID = getScreenID();
  1696. if (getSystemCd().substring(0, 3).toUpperCase() == "DEV") {
  1697. alert("�ش� ȯ�濡���� �¶��ε����� �������� �ʽ��ϴ�.\n\n�ڡ� ���� ȯ�� �ڡ�\n1. ���� HIS(his012dev)\n2. ���� MIS(mis001dev)\n3. ���� CRM(crm001dev)\n4. ���� HIS(his012edu)\n5. ���� MIS(mis001edu)\n6. � HIS(his012)\n7. � MIS(mis001)");
  1698. return;
  1699. }
  1700. if (gvHelpPage == null || gvHelpPage.closed) {
  1701. gvHelpPage = openHtml(getDomain() + "/docs/help/" + getBizName(scnID) + "/" + scnID + ".htm","Help","scrollbars=yes,toolbar=no,width=800,height=600");
  1702. } else {
  1703. gvHelpPage.focus();
  1704. }
  1705. }
  1706. function openEmrScrn(scrnid){
  1707. setParameter("SPMMB08400_scrnid", scrnid);
  1708. modal("SPMMB08400", 1, 0, 0, "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
  1709. return true;
  1710. }
  1711. function download(submitid, param, localfile, showui) {
  1712. if (showui == null) {
  1713. showui = true;
  1714. }
  1715. model.download(encodeURI(getActionURL(submitid) + param), localfile, showui);
  1716. }
  1717. function DOMActivate(){
  1718. if(checkOpener()){
  1719. if(opener.getParameter("domactivate") == "true"){
  1720. var btnobj = document.allElement.item(m_event.target);
  1721. var btnid = btnobj.attribute["id"];
  1722. if(btnid.substring(0, 4) == "btn_"){
  1723. opener.addBtnID(btnid);
  1724. }
  1725. }
  1726. }
  1727. }
  1728. function btnObj(btnID, btnTxt){
  1729. this.btnID = btnID;
  1730. this.btnTxt = btnTxt;
  1731. }
  1732. function getBtnCtrlInfo(){
  1733. var cnt = 0;
  1734. var ctrlID;
  1735. var loopcnt = document.controls.length;
  1736. var btnCtrlArr = new Array();
  1737. for(var i = 0; i < loopcnt; i++){
  1738. ctrlID = document.controls.item(i);
  1739. if(ctrlID.attribute["class"].substring(0, 3)=="btn"){
  1740. btnCtrlArr[cnt] = new btnObj(ctrlID.attribute["id"], ctrlID.attribute["text"]);
  1741. cnt++;
  1742. }
  1743. }
  1744. return btnCtrlArr;
  1745. }
  1746. function grdBaseColHidn(option, grd_obj, colnm_size, colnm_vol1, colnm_qty1, colnm_vol2, colnm_qty2, colnm_size_qty) {
  1747. var hardcd = "";
  1748. var sysMessageobj = getViewer("sysMessage");
  1749. if (sysMessageobj != null) {
  1750. hardcd = sysMessageobj.window.instance1.selectSingleNode("/root/properties/orderbasicinfo/hardcdlist/hardcd[hardcdno='230']/hardcd").text;
  1751. }
  1752. if (option == null || option == "" || option == "undefined") {
  1753. option = hardcd;
  1754. }
  1755. if (colnm_size == null || colnm_size == "" || colnm_size == "undefined") {
  1756. sColnm_size = 37;
  1757. } else {
  1758. sColnm_size = colnm_size;
  1759. }
  1760. if (grd_obj == null || grd_obj == "" || grd_obj == "undefined") {
  1761. sGrd_objnm = "grd_prcplist";
  1762. } else {
  1763. sGrd_objnm = grd_obj;
  1764. }
  1765. if (colnm_vol1 == null || colnm_vol1 == "" || colnm_vol1 == "undefined") {
  1766. sColnm_vol1 = "prcpvol";
  1767. } else {
  1768. sColnm_vol1 = colnm_vol1
  1769. }
  1770. if (colnm_qty1 == null || colnm_qty1 == "" || colnm_qty1 == "undefined") {
  1771. sColnm_qty1 = "prcpqty";
  1772. } else {
  1773. sColnm_qty1 = colnm_qty1
  1774. }
  1775. if (colnm_vol2 == null || colnm_vol2 == "" || colnm_vol2 == "undefined") {
  1776. sColnm_vol2 = "drprcpetc7";
  1777. } else {
  1778. sColnm_vol2 = colnm_vol2;
  1779. }
  1780. if (colnm_qty2 == null || colnm_qty2 == "" || colnm_qty2 == "undefined") {
  1781. sColnm_qty2 = "drprcpetc8";
  1782. } else {
  1783. sColnm_qty2 = colnm_qty2;
  1784. }
  1785. if (colnm_size_qty == null || colnm_size_qty == "" || colnm_size_qty == "undefined") {
  1786. sColnm_size_qty = sColnm_size;
  1787. } else {
  1788. sColnm_size_qty = colnm_size_qty;
  1789. }
  1790. if (option =="A") {
  1791. if (grd_obj == null || grd_obj == "" || grd_obj == "undefined") {
  1792. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), false);
  1793. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), false);
  1794. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), false);
  1795. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), false);
  1796. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), sColnm_size);
  1797. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), sColnm_size_qty);
  1798. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), sColnm_size);
  1799. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), sColnm_size_qty);
  1800. }
  1801. } else if (option =="B") {
  1802. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), false);
  1803. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), false);
  1804. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), true);
  1805. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), true);
  1806. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), sColnm_size);
  1807. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), sColnm_size_qty);
  1808. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), 0);
  1809. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), 0);
  1810. } else if (option =="C") {
  1811. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), true);
  1812. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), true);
  1813. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), false);
  1814. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), false);
  1815. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), 0);
  1816. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), 0);
  1817. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), sColnm_size);
  1818. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), sColnm_size_qty);
  1819. } else if (option =="D") {
  1820. return hardcd
  1821. } else if (option =="E") {
  1822. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), false);
  1823. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), true);
  1824. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), sColnm_size);
  1825. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), 0);
  1826. } else if (option =="F") {
  1827. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), true);
  1828. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), false);
  1829. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), 0);
  1830. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), sColnm_size);
  1831. } else if (option =="G") {
  1832. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), false);
  1833. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), true);
  1834. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), sColnm_size_qty);
  1835. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), 0);
  1836. } else if (option =="H") {
  1837. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), true);
  1838. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), false);
  1839. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), 0);
  1840. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), sColnm_size_qty);
  1841. } else {
  1842. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), false);
  1843. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), false);
  1844. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), true);
  1845. document.allElement.item(sGrd_objnm).setColHidden(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), true);
  1846. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol1), sColnm_size);
  1847. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty1), sColnm_size_qty);
  1848. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_vol2), 0);
  1849. document.allElement.item(sGrd_objnm).setColWidth(document.allElement.item(sGrd_objnm).colRef(sColnm_qty2), 0);
  1850. }
  1851. }
  1852. function fPrintRexbar(rexnm, closeYn, printCount, dataXPath, paramsXPath, infoXPath){
  1853. var posx = '';
  1854. var posy = '';
  1855. var printnm = '';
  1856. if(infoXPath == "" || infoXPath == "undefined" || infoXPath == null) infoXPath = "/root/main/barcdprntsetup/prntsetupinfo";
  1857. if(model.getValue(infoXPath + "/setupinfo/rexgbn") != "1") return false;
  1858. try{
  1859. if(model.getXpathValue("count(" + infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/barnm)") > "0"){
  1860. posx = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/xpos");
  1861. posy = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/ypos");
  1862. printnm = model.getValue(infoXPath + "/setupinfo/pcl/pcllist[barnm='"+rexnm+"']/prtnm");
  1863. }else{
  1864. posx = model.getValue(infoXPath + "/setupinfo/blank/left");
  1865. posy = model.getValue(infoXPath + "/setupinfo/blank/top");
  1866. printnm = model.getValue(infoXPath + "/setupinfo/comm01/setupval");
  1867. }
  1868. if(posx == '') posx = "0";
  1869. if(posy == '') posy = "0";
  1870. if(closeYn == "true") printnm = "";
  1871. exeReportPreview(rexnm, 'XMLSTR', paramsXPath, '', printnm,
  1872. '', '', '', '', '',
  1873. '', '', '', '', '',
  1874. printCount, '', 'offsetx=' + posx + ';offsety=' + posy + ';', dataXPath, '',
  1875. '');
  1876. }
  1877. catch(e){
  1878. alert("��½� ���� �߻��Ͽ����ϴ�\n" + e);
  1879. return true;
  1880. }
  1881. return true;
  1882. }