DrawXSLT.js 170 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758
  1. /**
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 진료 - XSLT ( SSMRF001200.xrw - JScript )
  4. * Version :
  5. - Ver.1.00.01
  6. * 개발자: 이경희
  7. * 최초작성일:
  8. - 2008/02/28
  9. * 수정이력:
  10. 2009-01
  11. - fDrawHTMLImge 함수 수정
  12. 2008-12-29
  13. - getNewXSLTStyleVal() 함수 내에 SSL 체크루틴 삭제
  14. - fDrawHTMLImge() 함수 내에 가계도 스타일정보 수정
  15. 2008-12-24
  16. - getNewXSLTStyleVal() 함수 수정
  17. (- 컨트롤에서 폰트 설정을 가져올때 '#' 문자 처리 추가
  18. - Border-Width 속성이 들어간 경우 vertical-align 속성 추가.)
  19. 2008-12-22
  20. - fDrawHTMLGrd() 함수내 그리드 타입이 X, T 인 경우 빈공간 처리 추가
  21. (GetDegnitemnmTrans() 함수 추가)
  22. 2008-12-19
  23. - getNewXSLTStyleVal() 함수 실행시 컨트롤이 그리드인 경우 Style 좌표의 height는 ctrlheight로 변경
  24. - getImgXSLTStyleVal() 함수 생성.
  25. 2008-12
  26. - 테이블에 Style 좌표 삽입
  27. 2008-11-28
  28. - CAL 아이템 생성시 파라미터 변경
  29. - LBL 생성시 label.width, height 좌표 조건 변경
  30. - 배경색이 있는 RCT 생성시 좌표 수정
  31. - 확장컨트롤 생성시 extn.border-style, width 속성을 기본으로 추가함
  32. - getPreXSLTStyle() 파라미터 변경(ctrl.width 값이 없는 경우 width:px로 떨어지는 문제점)
  33. 2008-11-27
  34. - AddBorderStyle() 함수 수정.
  35. - STX 아이템 생성시 좌표 파라미터 수정(parseInt(ctrlPosition.width) -> 0)
  36. - getXSLTStyleVal() 함수에 ISU 아이템 추가.
  37. - LBL 아이템 생성시 Border-Style을 없애고, left, top좌표를 모두 0으로 변경
  38. - ********** STX 아이템 생성시 패턴이 있는 경우 format-number를 사용함. ********* ==> 당분간 삭제
  39. (기존에 저장된 값이 19.6139383202.. 이고 패턴이 '##.99' 인 경우 소수점 3째자리에서 반올림된 값이 나타남.
  40. 저장된 값이 패턴의 자리수와 동일한 경우는 그대로 표현됨.)
  41. 2008-11-26
  42. - STX 아이템의 단위 표현시 위치 수정(Div태그를 추가)
  43. - STX 아이템의 확장컨트롤 표현 시 좌표가 맞지 않는 부분을 수정
  44. - SSL의 확장컨트롤 표현 시 Border-Style을 sunken으로 수정
  45. 2008-11-24
  46. - STX 아이템를 MTX처럼 동일하게 만듬.(Div태그를 추가)
  47. - STX 아이템 normalize-space를 추가
  48. - LBL 아이템에 Div태그를 추가.(엔터없이 내용을 입력한 경우 줄바꿈이 되지 않는 문제)
  49. 2008-11-21
  50. - 단위 태그를 DIV => PRE로 변경
  51. - MTX 아이템 생성시 Pre 태그에 BoederStyle 정보 추가
  52. - CMB 아이템 생성시 Pre 태그에 BoederStyle 정보 추가
  53. 2008-11-20
  54. - MTX 아이템 생성시 Pre 태그에도 좌표정보를 추가
  55. 추가 함수(getPreXSLTStyle)
  56. 2008-11-14
  57. - X축 그리드의 컬럼에 2줄이 있을 경우 한줄로 보이던 문제점 수정
  58. - 일반 테이블의 컬럼이 기록된 줄만 보이던 문제점 수정
  59. - 콤보의 rectermnm 에 normalize-space() 사용
  60. 2008-11-12
  61. - STX/MTX 아이템이 디자인속성에 border-style:solid 속성이 없는 경우 기본으로 넣어주도록 수정
  62. 추가 함수(fCheckDefaultDegnAttr)
  63. 2008-11-12
  64. - 서식내에 Y축 누적 그리드가 있는 경우 간격 조정 로직 추가
  65. 2008-11-10
  66. - Y축 누적 그리드(그리드타입:Y) 수정
  67. 2008-11-08
  68. - 그리드 생성시 정렬 태그 수정
  69. - X축 누적 그리드 수정
  70. 2008-11-07
  71. - BOL 아이템의 디자인아이템명에 '&' 기호가 들어간 서식의 경우 뷰어에서 보이지 않던 문제점 수정(해당 서식 재저장 필요)
  72. 2008-10-30
  73. - 모든 그리드(진단명, 주호소, 수술명, 기타 그리드)의 경우 그리드내용 미입력 시
  74. Height 사이즈가 서식디자인에서 지정한 컨트롤의 사이즈에 맞추어 나오던 문제 수정
  75. - 진단명 수정(R/O, 주진단 조건)
  76. 2008-10-28
  77. - 진단명에서 주진단이 체크되지 않는 부분 수정
  78. - 수술명에서 수술코드가 나오는 부분 삭제
  79. - 그리드 및 진단명, 주호소, 수술명에서 컬럼이 가운데 정렬이 되지 않던 문제 수정
  80. 2008-10-27
  81. - STX 아이템 표현 시 디자인아이템명의 길이에 따라 INPUT아이템의 좌표가 옮겨지도록 수정
  82. - Radio 버튼 미 작성시 Radio 버튼이 아예 보이지 않는 현상 수정
  83. 2008-10-24
  84. - RDO 확장컨트롤 위치 수정
  85. - X축 누적 입력width 수정
  86. 2008-10-23
  87. - 주호소란에서 주호소 코드가 나오는 부분 삭제
  88. - 진단명의 진단코드가 나오는 컬럼 삭제
  89. - 디자인 레벨이 1인 아이템의 경우 굵게 설정
  90. 2008-10-22
  91. - CHK 아이템의 체크박스에 체크한 부분이 나타나지 않는 문제점 수정
  92. - CHK 아이템의 체크박스 확장 컨트롤의 좌표 수정
  93. - MSL_SSU 아이템의 체크박스 확장 컨트롤에 값이 나오지 않는 문제 수정
  94. 2008-10-16
  95. - 선 두께 미지정 시 1px로 설정
  96. - STX컨트롤에 단위가 붙은 경우 단위 띄어쓰기 수정(space 2칸 적용)
  97. - 이미지 사이즈 수정
  98. - 가계도 이미지 지원
  99. - 숨긴 컨트롤(Width, Height 가 모두 0 또는 1인 컨트롤)은 안보이게 수정
  100. - 단위 컨트롤(Width, Height 가 모두 0 또는 1인 컨트롤)도 안보이도록 수정
  101. - 그리드 타입(T)인 경우 수정.
  102. 2008-10-15
  103. - 진단명 수정(R/O, 주 모두 체크가 안된 경우 문제점이 발견되어 수정)
  104. - 숨긴 컨트롤(Width, Height 가 모두 0 인 컨트롤)은 안보이게 수정
  105. 2008-10-10
  106. - rdo, sel 컨트롤에 title 삭제
  107. - css 수정 com->emr
  108. * 기타:
  109. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  110. */
  111. var sXSLTInfo = "";
  112. var sDivHeight = 0;
  113. var sDivWidth = 0;
  114. // Match Template 배열
  115. var g_MatchTemplate = new Array();
  116. // 그리드 컬럼 기본 width
  117. //var g_Base_GrdColWidth = 53;
  118. var g_Base_GrdColWidth = 100;
  119. var g_Base_GrdColHeight = 23;
  120. // 이전 아이템에 Y축 누적 그리드 아이템이 있을 경우 ctrl.top 좌표에 추가로 더해주는 값.
  121. var g_PrevCtrlItemHeightSum = 0;
  122. var g_PrevCtrlItemHeight = 0;
  123. var g_PrevCtrlItemTop = 0;
  124. //var g_PrevItemCnt = 0;
  125. var g_PrevItemGrdTypeY = false;
  126. var g_PreDegnitemKind = "";
  127. /**
  128. * @desc : 위치정보를 변수에 저장
  129. * @
  130. * @param :
  131. * @return :
  132. * @---------------------------------------------------
  133. */
  134. function Position(xObj, yObj, widthObj, heightObj){
  135. this.x = xObj;
  136. this.y = yObj;
  137. this.width = widthObj;
  138. this.height = heightObj;
  139. }
  140. /**
  141. * @desc : Empty XSLT 디자인 생성
  142. * @
  143. * @param :
  144. * @return :
  145. * @---------------------------------------------------
  146. */
  147. function fCreateXSLTDegnBySelfInfo()
  148. {
  149. // 초기화
  150. g_PrevItemGrdTypeY = false;
  151. g_PrevCtrlItemHeightSum = 0;
  152. g_PrevCtrlItemHeight = 0;
  153. g_PrevCtrlItemTop = 0;
  154. for(var tidx = 0; tidx < g_MatchTemplate.length; tidx++)
  155. {
  156. g_MatchTemplate[tidx] = "";
  157. }
  158. var formnm = model.getValue(g_pageInfo.formmastRef + "/formnm");
  159. //model.getValue("");
  160. g_pageInfo = new PAGEINFO();
  161. sXSLTInfo = "<?xml version=\"1.0\" encoding=\"euc-kr\"?>\n";
  162. sXSLTInfo += "<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\n";
  163. sXSLTInfo += "<xsl:template match=\"/\">\n";
  164. sXSLTInfo += "<html>\n";
  165. sXSLTInfo += "\t<head>\n";
  166. if(formnm != "")
  167. sXSLTInfo += "\t\t<title><![CDATA[" + formnm + "]]></title>\n";
  168. else
  169. sXSLTInfo += "\t\t<title>Preview</title>\n";
  170. sXSLTInfo += getStyleCss();
  171. sXSLTInfo += "\t</head>\n";
  172. sXSLTInfo += "\t<body>\n";
  173. //sXSLTInfo += "\t\t<div id=\"page\" style=\"position:absolute; top:5px; border-style:solid; border-width:1px;\">\n";
  174. sXSLTInfo += "\t\t<div id=\"page\" style=\"position:absolute; width:680px; top:5px;\">\n";
  175. var itemcnt = getNodesetCnt(model, g_pageInfo.formdegnRef);
  176. var prevrowno = 0;
  177. // var ctrlSize = new SIZE(0, 0);
  178. var ctrlPosition = new Position(0, 0, 0, 0);
  179. var prevypos = g_pageInfo.curypos;
  180. for(var i=1; i<= itemcnt; i++)
  181. {
  182. var degnitemcd = model.getValue(g_pageInfo.formdegnRef + "[" + i + "]/degnitemcd");
  183. var degnitemno = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/degnitemno");
  184. var supdegnitemno = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/supdegnitemno");
  185. var degnitemkind = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/degnitemkind");
  186. var degnitemnm = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/degnitemnm");
  187. var degnitemlevlno = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/degnitemlevlno");
  188. var degncntrviewflag = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/degncntrviewflag");
  189. var instcd = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/instcd");
  190. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/degnitemlevlcd");
  191. var unitnm = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/unitnm");
  192. var degnxval = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/degnxval");
  193. var degnrowno = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/degnrowno");
  194. var itemuseflag = model.getValue(g_pageInfo.formdegnRef +"[" + i + "]/itemuseflag");
  195. var itemattrval = model.getValue(g_pageInfo.formdegnRef + "[" + i + "]/itemattrval");
  196. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + i + "]/degnattrval");
  197. if ( getStyleValue(degnattrval, "ctrl._printable") == "false" )
  198. continue;
  199. if(degnitemkind == "GSU" || degnitemkind == "SSU" || degnitemkind == "ISU")
  200. continue;
  201. if(degnitemkind == "FRM" && itemuseflag != "F0")
  202. continue;
  203. // degn X좌표가 없는 경우
  204. if(degnxval == '')
  205. degnxval = (parseInt(degnitemlevlno) - 1) * g_pageInfo.indentwidth;
  206. // 디자인아이템 번호가 이전과 다른 경우
  207. if(degnrowno != prevrowno)
  208. {
  209. g_pageInfo.curxpos = g_pageInfo.leftmargin + parseInt(degnxval);
  210. g_pageInfo.rowheight = 20;
  211. }
  212. else
  213. g_pageInfo.curypos = prevypos;
  214. var sDivEndTag = null;
  215. if(degnitemkind != "LNE" && degnitemkind != "RCT" && degnitemkind != "RRT" && degnitemkind != "ELL")
  216. {
  217. //fDrawHTMLDIV(i);
  218. //sDivEndTag = "\t\t\t</div>\n";
  219. }
  220. if(degnitemkind == "RCT")
  221. {
  222. fDrawHTMLObject(i);
  223. //sDivEndTag = "\t\t\t</div>\n";
  224. //sDivEndTag = null;
  225. }
  226. var visible = "visible";
  227. if(degncntrviewflag == "A" || degncntrviewflag == "L") // 컨트롤 보기값이 전체, 라벨
  228. visible = "visible";
  229. else
  230. visible = "hidden";
  231. // caption 처리
  232. if(visible == "visible" && degnitemkind != "FRM" && degnitemkind != "LBL" &&
  233. degnitemkind != "LNE" && degnitemkind != "RCT" && degnitemkind != "RRT" &&
  234. degnitemkind != "ELL" && degnitemkind != "BOL")
  235. ctrlPosition = fDrawHTMLCap(0, 0, i,"label");
  236. if(degncntrviewflag == "L")
  237. {
  238. prevypos = g_pageInfo.curypos;
  239. prevrowno = degnrowno;
  240. g_pageInfo.curxpos += parseInt(g_pageInfo.offsetx) + sDivWidth;
  241. g_pageInfo.curypos += parseInt(g_pageInfo.offsety) + sDivHeight;
  242. if(sDivEndTag != null){
  243. sXSLTInfo += sDivEndTag;
  244. }
  245. //g_PreDegnitemKind = degnitemkind;
  246. continue;
  247. }
  248. switch(degnitemkind)
  249. {
  250. case "RDO":
  251. case "CHK" :
  252. if(ctrlPosition != null)
  253. ctrlPosition = fDrawHTMLRdo(ctrlPosition.width+g_pageInfo.offsetx, 0, i); // O
  254. break;
  255. case "CMB" :
  256. if(ctrlPosition != null)
  257. ctrlPosition = fDrawHTMLCmb(parseInt(ctrlPosition.width) +g_pageInfo.offsetx, 0, i); // O
  258. break;
  259. case "MTX":
  260. if(ctrlPosition != null)
  261. ctrlPosition = fDrawHTMLMtx(parseInt(ctrlPosition.width) +g_pageInfo.offsetx, 0, i);
  262. break;
  263. case "STX" :
  264. // 2008-11-08
  265. // 파라미터 변경 parseInt(ctrlPosition.width) +g_pageInfo.offsetx -> parseInt(ctrlPosition.left)
  266. // 테스트 서식(BPPV 치료기록, Systemic Sclerosis)
  267. if(ctrlPosition != null)
  268. ctrlPosition = fDrawHTMLStx(0, 0, 100, ctrlPosition.height, i, "ctrl"); // O
  269. //ctrlPosition = fDrawHTMLStx(parseInt(ctrlPosition.width), 0, 100, ctrlPosition.height, i, "ctrl"); // O
  270. //ctrlPosition = fDrawHTMLStx(parseInt(ctrlPosition.width) +g_pageInfo.offsetx, 0, 100, ctrlPosition.height, i, "ctrl"); // O
  271. break;
  272. case "CAL" :
  273. if(ctrlPosition != null)
  274. ctrlPosition = fDrawHTMLStx(g_pageInfo.offsetx, 0, 100, ctrlPosition.height, i, "ctrl");
  275. //ctrlPosition = fDrawHTMLStx(parseInt(ctrlPosition.width) +g_pageInfo.offsetx, 0, 100, ctrlPosition.height, i, "ctrl");
  276. break;
  277. case "MSK" :
  278. if(ctrlPosition != null)
  279. ctrlPosition = fDrawHTMLMsk(parseInt(ctrlPosition.width) +g_pageInfo.offsetx, 0, 100, ctrlPosition.height, i);
  280. break;
  281. case "IMG" :
  282. if(ctrlPosition != null)
  283. ctrlPosition = fDrawHTMLImge(0, 0, i);
  284. break;
  285. case "GRD" :
  286. if(ctrlPosition != null)
  287. ctrlPosition = fDrawHTMLGrd(0, ctrlPosition.height + g_pageInfo.offsety, i);
  288. break;
  289. case "LBL":
  290. if(ctrlPosition != null)
  291. ctrlPosition = fDrawHTMLCap(0, 0, i, "label");
  292. break;
  293. case "LNE":
  294. break;
  295. case "RCT":
  296. break;
  297. case "RRT":
  298. break;
  299. case "ELL":
  300. break;
  301. case "FRM" :
  302. break;
  303. case "FDG" :
  304. if(ctrlPosition != null)
  305. ctrlPosition = fDrawHTMLImge(0, 0, i);
  306. break;
  307. case "MSL" :
  308. case "SSL" :
  309. if(ctrlPosition != null)
  310. ctrlPosition = fDrawHTMLSel(parseInt(ctrlPosition.width) +g_pageInfo.offsetx, 0, i);
  311. break;
  312. case "BOL" :
  313. if(ctrlPosition != null)
  314. ctrlPosition = fDrawHTMLBool(parseInt(ctrlPosition.width) +g_pageInfo.offsetx, 0, i);
  315. break;
  316. case "DGN" ://진단명
  317. if(ctrlPosition != null)
  318. ctrlPosition = fDrawXSLTDiagName(0, ctrlPosition.height + g_pageInfo.offsety, i);
  319. break;
  320. case "OPN" ://수술명
  321. if(ctrlPosition != null)
  322. ctrlPosition = fDrawXSLTOpName(0, ctrlPosition.height + g_pageInfo.offsety, i);
  323. break;
  324. case "CCN" ://주호소
  325. if(ctrlPosition != null)
  326. ctrlPosition = fDrawXSLTCCName(0, ctrlPosition.height + g_pageInfo.offsety, i);
  327. break;
  328. }
  329. /*
  330. if(sDivEndTag != null){
  331. sXSLTInfo += sDivEndTag;
  332. }
  333. */
  334. if(degnitemkind != "LNE" && degnitemkind != "RCT" && degnitemkind != "RRT" && degnitemkind != "ELL")
  335. {
  336. prevypos = g_pageInfo.curypos;
  337. prevrowno = degnrowno;
  338. g_pageInfo.curxpos = parseInt(g_pageInfo.offsetx) + parseInt(sDivWidth) + 80;
  339. if(g_pageInfo.rowheight < parseInt(sDivHeight))
  340. g_pageInfo.rowheight = parseInt(sDivHeight);
  341. g_pageInfo.curypos += parseInt(g_pageInfo.offsety) + g_pageInfo.rowheight;
  342. }
  343. //g_PreDegnitemKind = degnitemkind;
  344. }
  345. sXSLTInfo += "\t\t</div>\n";
  346. sXSLTInfo += "\t</body>\n";
  347. sXSLTInfo += "</html>\n";
  348. sXSLTInfo += "</xsl:template>\n";
  349. for(var idx = 0; idx < g_MatchTemplate.length; idx++)
  350. {
  351. sXSLTInfo += g_MatchTemplate[idx];
  352. }
  353. sXSLTInfo += "</xsl:stylesheet>";
  354. return sXSLTInfo;
  355. }
  356. /**
  357. * @desc : DIV 생성
  358. * @
  359. * @param: 1) row - 줄
  360. * @return :
  361. * @---------------------------------------------------
  362. */
  363. function fDrawHTMLDIV(row)
  364. {
  365. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  366. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  367. var degnitemkind = model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemkind");
  368. var divid = "DIV_"+ degnitemno;
  369. var ctrlPosition = new Position(g_pageInfo.curxpos, g_pageInfo.curypos, 400, g_pageInfo.ctrlheight);
  370. var sStyle = "";
  371. sStyle = "style=\"position:absolute; left:0px; top:0px; border-style:none; \"";
  372. /*
  373. if(degnitemkind != "CHK" && degnitemkind != "RDO")
  374. sStyle = "style=\"position:absolute; left:0px; top:0px; border-style:none; \"";
  375. else
  376. sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "grp");
  377. */
  378. sXSLTInfo += "\t\t\t<div id=\""+divid+"\" "+sStyle+">\n";
  379. sDivWidth = ctrlPosition.width;
  380. sDivHeight = ctrlPosition.height;
  381. }
  382. /**
  383. * @desc : 선, 사각형, 둥근사각형, 타원 생성
  384. * @
  385. * @param: 1) row - 줄
  386. * @return :
  387. * @테스트 서식: 2640
  388. * @---------------------------------------------------
  389. */
  390. function fDrawHTMLObject(row)
  391. {
  392. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  393. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  394. var degnitemkind = model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemkind");
  395. var divid = "DIV_"+ degnitemno;
  396. var ctrlid = "";
  397. var ctrlPosition = new Position(g_pageInfo.curxpos, g_pageInfo.curypos, 400, g_pageInfo.ctrlheight);
  398. var sShapeStyle = ""; //getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  399. if(degnitemkind == "RCT")
  400. {
  401. ctrlid = "SHP_" + degnitemno;
  402. }
  403. else if(degnitemkind == "LNE")
  404. {
  405. ctrlid = "LINE" + degnitemno;
  406. }
  407. sShapeStyle = getShapeXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  408. var preid= "RCT_" + degnitemno;
  409. sXSLTInfo += "\t\t\t\t<pre id=\""+preid+"\" "+ sShapeStyle +" ></pre>\n";
  410. /*
  411. sDivWidth = ctrlPosition.width;
  412. sDivHeight = ctrlPosition.height;
  413. var tmpLeft = getStyleValue(degnattrval, "left", "ctrl");
  414. var tmpTop = getStyleValue(degnattrval, "top", "ctrl");
  415. var tmpWidth = getStyleValue(degnattrval, "width", "ctrl");
  416. var tmpHeight = getStyleValue(degnattrval, "height", "ctrl");
  417. sDivStyle = "style=\"position:absolute; left:" + tmpLeft + "px; top:" + tmpTop + "px; width:" + tmpWidth + "px; height:"+ tmpHeight + "px; border-style:solid; border-width:1; \"";
  418. sXSLTInfo += "\t\t\t<div id=\""+divid+"\" "+sDivStyle+">\n";
  419. if(isSearchString(degnattrval, "ctrl.border-style") == false)
  420. {
  421. degnattrval += "ctrl.border-style:solid;";
  422. }
  423. if(isSearchString(degnattrval, "ctrl.border-width") == false)
  424. {
  425. degnattrval += "ctrl.border-width:1;";
  426. }
  427. var sPreStyle = getPreXSLTStyle(null, ctrlPosition, degnattrval, "ctrl");
  428. var preid= "RCT_" + degnitemno;
  429. sXSLTInfo += "\t\t\t\t<pre id=\""+preid+"\" "+ sPreStyle +" ></pre>\n";
  430. */
  431. }
  432. function fDrawHTMLObject_old(row)
  433. {
  434. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  435. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  436. var degnitemkind = model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemkind");
  437. var divid = "DIV_"+ degnitemno;
  438. var ctrlPosition = new Position(g_pageInfo.curxpos, g_pageInfo.curypos, 400, g_pageInfo.ctrlheight);
  439. /*
  440. var sDivStyle = ""; //getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  441. sDivWidth = ctrlPosition.width;
  442. sDivHeight = ctrlPosition.height;
  443. var tmpLeft = getStyleValue(degnattrval, "left", "ctrl");
  444. var tmpTop = getStyleValue(degnattrval, "top", "ctrl");
  445. var tmpWidth = getStyleValue(degnattrval, "width", "ctrl");
  446. var tmpHeight = getStyleValue(degnattrval, "height", "ctrl");
  447. sDivStyle = "style=\"position:absolute; left:" + tmpLeft + "px; top:" + tmpTop + "px; width:" + tmpWidth + "px; top:"+ tmpHeight + "px; border-style:solid; border-width:1; \"";
  448. */
  449. if(isSearchString(degnattrval, "ctrl.border-style") == false)
  450. {
  451. degnattrval += "ctrl.border-style:solid;";
  452. }
  453. if(isSearchString(degnattrval, "ctrl.border-width") == false)
  454. {
  455. degnattrval += "ctrl.border-width:1;";
  456. }
  457. var sPreStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl"); //getPreXSLTStyle(ctrlPosition, degnattrval, "ctrl");
  458. /*
  459. var ctrlLeft = "left:" + tmpLeft + "px";
  460. var ctrlTop = " top:" + tmpTop + "px";
  461. sPreStyle = sPreStyle.setReplaceWord(ctrlLeft, "left:0px");
  462. sPreStyle = sPreStyle.setReplaceWord(ctrlTop, "top:0px");
  463. */
  464. //position:absolute;
  465. //position:absolute; border-style:none;
  466. //sStyle = sStyle.setReplaceWord("position:absolute;", "position:absolute; border-style:none;");
  467. //sXSLTInfo += "\t\t\t<div id=\""+divid+"\" "+sDivStyle+">\n";
  468. /*
  469. sDivWidth = ctrlPosition.width;
  470. sDivHeight = ctrlPosition.height;
  471. var tmpWidth = getStyleValue(degnattrval, "width", "ctrl");
  472. var tmpHeight = getStyleValue(degnattrval, "height", "ctrl");
  473. var ctrlWidth = "width:" + tmpWidth + "px;";
  474. var ctrlHeight = " height:" + tmpHeight + "px;";
  475. sStyle = "style=\"position:absolute; left:0px; top:0px; " + ctrlWidth + ctrlHeight + "border-style:solid; border-width:1; \"";
  476. */
  477. var preid= "RCT_" + degnitemno;
  478. //sStyle = AddBorderStyle(sStyle, degnattrval, "label");
  479. sXSLTInfo += "\t\t\t\t<pre id=\""+preid+"\" "+ sPreStyle +" ></pre>\n";
  480. /*
  481. <div id="DIV_90" style="position:absolute; left:49px; top:50px; border-style:none ">
  482. <pre id="RCT_90" style="position:absolute; left:0px; top:0px; width:115px; height:22px; border-style:solid; border-width:1; "></pre>
  483. </div>
  484. */
  485. }
  486. /**
  487. * @desc : Pre 생성
  488. * @
  489. * @param :
  490. * @return :
  491. * @---------------------------------------------------
  492. */
  493. function fDrawHTMLCap( x, y, row, ctrltype)
  494. {
  495. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  496. var degnitemnm = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemnm");
  497. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  498. var ctrlPosition = new Position(x,y,0,sDivHeight);
  499. ctrlPosition.width += fGetLblWidth(degnitemno, degnitemnm);
  500. if(ctrlPosition.width < 120)
  501. ctrlPosition.width = 120;
  502. /* if(ctrlSize.cx < g_pageInfo.ctrlwidth)
  503. ctrlSize.cx = g_pageInfo.ctrlwidth;
  504. else
  505. ctrlSize.cx += Math.round((10 - (ctrlSize.cx % 10)) / 10) * 10; */
  506. // 디자인 레벨이 1인 아이템의 속성에 Bold가 빠져있으면 추가
  507. var degnitemlevlno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlno");
  508. if(degnitemlevlno == "1")
  509. {
  510. if(isSearchString(degnattrval, "label.font-weight:bold") == false)
  511. {
  512. degnattrval += "label.font-weight:bold;";
  513. }
  514. }
  515. var captionid= "LBL_" + degnitemno;
  516. var sLBLDivStyle = getNewXSLTStyleVal(captionid, ctrlPosition, degnattrval, ctrltype);
  517. // 숨겨진 컨트롤 확인
  518. if(isSearchString(degnattrval, "label.width") == true || isSearchString(degnattrval, "label.height") == true)
  519. {
  520. var tmpWidth = getStyleValue(degnattrval, "width", "label");
  521. var tmpHeight = getStyleValue(degnattrval, "height", "label");
  522. if(tmpWidth == "" && tmpHeight == "")
  523. {
  524. return ctrlPosition;
  525. }
  526. else if(tmpWidth == "")
  527. {
  528. if(parseInt(tmpHeight) < 2)
  529. return ctrlPosition;
  530. }
  531. else if(tmpHeight == "")
  532. {
  533. if(parseInt(tmpWidth) < 2)
  534. return ctrlPosition;
  535. }
  536. else if(tmpWidth != "" && tmpHeight != "")
  537. {
  538. if(parseInt(tmpWidth) < 2 || parseInt(tmpHeight) < 2)
  539. {
  540. return ctrlPosition;
  541. }
  542. }
  543. }
  544. var sLBLPreStyle = sLBLDivStyle;
  545. /*
  546. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  547. // Border-Style이 들어간 버전
  548. var sLBLPreStyle = sLBLDivStyle;
  549. var sLabelLeft = getStyleValue(degnattrval, "left", "label");
  550. var sLabelTop = getStyleValue(degnattrval, "top", "label");
  551. if(sLabelLeft != "")
  552. {
  553. var tmpLeft = "left:" + sLabelLeft + "px";
  554. sLBLPreStyle = sLBLPreStyle.setReplaceWord(tmpLeft, "left:0px");
  555. }
  556. if(sLabelTop != "")
  557. {
  558. var tmpTop = "top:" + sLabelTop + "px";
  559. sLBLPreStyle = sLBLPreStyle.setReplaceWord(tmpTop, "top:0px");
  560. }
  561. sLBLPreStyle = AddBorderStyle(sLBLPreStyle, degnattrval, "label");
  562. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  563. */
  564. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  565. // Div에 Border-Style 정보를 삭제
  566. var sLabelLeft = 0;
  567. var sLabelTop = 0;
  568. /*
  569. var sLabelLeft = getStyleValue(degnattrval, "left", "label");
  570. if(sLabelLeft == "")
  571. sLabelLeft = 0;
  572. else
  573. {
  574. sLabelLeft = parseInt(sLabelLeft);
  575. }
  576. var sLabelTop = getStyleValue(degnattrval, "top", "label");
  577. if(sLabelTop == "")
  578. sLabelTop = 0;
  579. else
  580. {
  581. sLabelTop = parseInt(sLabelTop);
  582. }
  583. */
  584. var sLabelWidth = getStyleValue(degnattrval, "width", "label");
  585. if(sLabelWidth == "")
  586. sLabelWidth = fGetLblWidth(degnitemno, degnitemnm);
  587. else
  588. {
  589. sLabelWidth = parseInt(sLabelWidth);
  590. }
  591. var sLabelHeight = getStyleValue(degnattrval, "height", "label");
  592. if(sLabelHeight == "")
  593. sLabelHeight = 20;
  594. else
  595. {
  596. sLabelHeight = parseInt(sLabelHeight);
  597. }
  598. var sLBLDivStyle = "style=\"position:absolute; left:" + sLabelLeft + "px; top:" + sLabelTop + "px; width:" + sLabelWidth + "px; height:" + sLabelHeight + "px; \"";
  599. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  600. //var captionid= "LBL_" + degnitemno;
  601. /*
  602. if(isSearchString(degnitemnm, "\n") == true)
  603. {
  604. degnitemnm = degnitemnm.setReplaceWord("\n", "]]><br/><![CDATA[");
  605. }
  606. */
  607. // 2008-12-30 ( ) 안에 아이템이 들어가는 경우 공백에 따라 잘 맞지 않는 경우가 생김에 따라 '(' 또는 ')'를 변경해줌.
  608. if(isSearchString(degnitemnm, " \\( ") == true)
  609. degnitemnm = degnitemnm.setReplaceWord(" ( ", " ( ");
  610. if(isSearchString(degnitemnm, " \\) ") == true)
  611. degnitemnm = degnitemnm.setReplaceWord(" ) ", " ) ");
  612. // 텍스트가 MultiLine인 경우 정해진 좌표를 벗어나게 됨에 따라 Pre -> Div 태그로 변경함.
  613. sXSLTInfo += "\t\t\t\t<div id=\""+captionid+"\" "+ sLBLDivStyle +">\n"
  614. + "\t\t\t\t\t<pre id=\""+captionid+"\" "+ sLBLPreStyle +"><![CDATA["+degnitemnm+"]]></pre>\n";
  615. sXSLTInfo += "\t\t\t\t</div>\n";
  616. //sXSLTInfo += "\t\t\t\t<pre id=\""+preid+"\" "+ sStyle +" ><![CDATA["+degnitemnm+"]]></pre>\n";
  617. return ctrlPosition;
  618. }
  619. /**
  620. * @desc : Radio 버튼 생성
  621. * @
  622. * @param :
  623. * @return :
  624. *@history:
  625. 2008-10-21 인쇄시 체크박스 및 라디오버튼이 비활성화된 상태이기 때문에 인쇄가 흐릿하여 비활성화를 삭제함.
  626. 2008-10-22 체크박스된 recitem노드를 찾는 조건 변경
  627. * @---------------------------------------------------
  628. */
  629. function fDrawHTMLRdo( x, y, row)
  630. {
  631. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  632. if(width != "")
  633. width = parseInt(width);
  634. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  635. if(height != "")
  636. height = parseInt(height);
  637. if(width == "")
  638. width = 0;
  639. if(height == "")
  640. height = sDivHeight;
  641. var ctrlPosition = new Position(x, y, width, height);
  642. var cellspacing = 10; // 가로 간격 기본값
  643. var vcellspacing = 0; // 세로 간격 기본값
  644. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  645. // Degnitemno => Degnitemlevlcd 로 변경
  646. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  647. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  648. var degnitemkind = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemkind");
  649. var valgrupcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/valgrupcd");
  650. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  651. var itemattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/itemattrval");
  652. var ctrlid = "";
  653. var ctrlname = "";
  654. if(degnitemkind == "RDO")
  655. ctrlname = "type=\"radio\"";
  656. else if(degnitemkind == "CHK")
  657. ctrlname = "type=\"checkbox\"";
  658. var cnt = getNodesetCnt(model, g_pageInfo.vallistRef + "[grupcd='" + valgrupcd + "']");
  659. var cols = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "cols");
  660. if(cols == "")
  661. cols = cnt;
  662. // 아이템 간격
  663. cellspacing = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "ctrl.subcellspacing");
  664. vcellspacing = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "ctrl.subvcellspacing");
  665. if(cellspacing == "")
  666. cellspacing = 0;
  667. if(vcellspacing == "")
  668. vcellspacing = 0;
  669. // 아이템 라벨 보이기/숨기기 옵션 확인
  670. var sLabelhidden = "on"; // 기본값 보이기
  671. if(isSearchString(degnattrval, "ctrl.sublabel") == true)
  672. {
  673. sLabelhidden = getStyleValue(degnattrval, "ctrl.sublabel");
  674. }
  675. var sLabel = "";
  676. var sValue = "";
  677. var lineWidth = 0;
  678. var lineHeight = 0;
  679. var sComStyle = getXSLTStyleVal(ctrlPosition, degnattrval, degnitemkind);
  680. ctrlid = degnitemkind + "_" + degnitemno;
  681. var sTmpComStyle = getSelXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, degnitemkind);
  682. var sStyle = "";
  683. var sFontStyle = "";
  684. var sLastStyle = "";
  685. var tmplineWidth = 0;
  686. var tmpValueWidth = 0;
  687. var strRdoStyle = new Array(2);
  688. // position
  689. var sLeft = "";
  690. var sTop = "";
  691. var sWidth = "";
  692. var sHeight = "";
  693. var sCols = false;
  694. var sRows = false;
  695. if(document.controls(ctrlid) != null)
  696. {
  697. sLeft = document.controls(ctrlid).attribute("left");
  698. sTop = document.controls(ctrlid).attribute("top");
  699. sWidth = document.controls(ctrlid).attribute("width");
  700. sHeight = document.controls(ctrlid).attribute("height");
  701. sCols = document.controls(ctrlid).attribute("cols");
  702. sRows = document.controls(ctrlid).attribute("rows");
  703. // FontName
  704. var fontfamilyArr = document.controls(ctrlid).attribute("font-family").split(",");
  705. if(fontfamilyArr.length > 0)
  706. {
  707. sFontStyle += getXSLTCtrlAttribute("font-family", fontfamilyArr[0]);
  708. }
  709. else
  710. sFontStyle += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  711. // FontSize
  712. var fontSize = document.controls(ctrlid).attribute("font-size");
  713. if(fontSize != "")
  714. sFontStyle += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  715. else
  716. sFontStyle += getXSLTCtrlAttribute("font-size", "9");
  717. sFontStyle += getXSLTCtrlAttribute("font-weight", document.controls(ctrlid).attribute("font-weight"));
  718. sFontStyle += getXSLTCtrlAttribute("font-style", document.controls(ctrlid).attribute("font-style"));
  719. sFontStyle += getXSLTCtrlAttribute("text-decoration", document.controls(ctrlid).attribute("text-decoration"));
  720. var fontColor = document.controls(ctrlid).attribute("color");
  721. if(fontColor != "")
  722. {
  723. if(fontColor.charAt(0) != "#")
  724. sFontStyle += getXSLTCtrlAttribute("color", "#" + fontColor);
  725. else
  726. sFontStyle += getXSLTCtrlAttribute("color", fontColor);
  727. }
  728. }
  729. else
  730. {
  731. sLeft = getStyleValue(degnattrval, "left", sCtrlType);
  732. sTop= getStyleValue(degnattrval, "top", sCtrlType);
  733. sWidth = getStyleValue(degnattrval, "width", sCtrlType);
  734. sHeight = getStyleValue(degnattrval, "height", sCtrlType);
  735. sFontStyle += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  736. var fontSize = getStyleValue(degnattrval, "font-size", sCtrlType);
  737. if(fontSize != "")
  738. sFontStyle += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  739. else
  740. sFontStyle += getXSLTCtrlAttribute("font-size", "9");
  741. sFontStyle += getXSLTCtrlAttribute("font-weight", getStyleValue(degnattrval, "font-weight", sCtrlType));
  742. sFontStyle += getXSLTCtrlAttribute("font-style", getStyleValue(degnattrval, "font-style", sCtrlType));
  743. sFontStyle += getXSLTCtrlAttribute("text-decoration", getStyleValue(degnattrval, "text-decoration", sCtrlType));
  744. sFontStyle += getXSLTCtrlAttribute("color", getStyleValue(degnattrval, "color", sCtrlType));
  745. }
  746. if(sLeft == "") sLeft = ctrlPosition.x;
  747. else{
  748. sLeft = parseInt(sLeft);
  749. ctrlPosition.x = sLeft;
  750. }
  751. if(sTop=="")
  752. sTop = ctrlPosition.y;
  753. else{
  754. sTop = parseInt(sTop);
  755. ctrlPosition.y = sTop;
  756. }
  757. for(var i =0; i< cnt; i++)
  758. {
  759. sLabel = model.instances(0).selectNodes(g_pageInfo.vallistRef +"[grupcd='" + valgrupcd + "']/valitemnm").item(i).text;
  760. sValue = model.instances(0).selectNodes(g_pageInfo.vallistRef +"[grupcd='" + valgrupcd + "']/valcd").item(i).text;
  761. ctrlid = degnitemkind + "_" + degnitemno+"_"+ i;
  762. //strRdoStyle = getSelSSUXSLTStyleVal(degnitemkind + "_" + degnitemno, ctrlPosition, degnattrval, degnitemkind);
  763. if(degnitemkind == "RDO")
  764. {
  765. sXSLTInfo += "\t\t\t\t<xsl:choose>\n";
  766. sXSLTInfo += "\t\t\t\t\t<xsl:when test=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "']/rectermcd = '" + sValue + "'\">\n";
  767. }
  768. else
  769. {
  770. sXSLTInfo += "\t\t\t\t<xsl:choose>\n";
  771. sXSLTInfo += "\t\t\t\t\t<xsl:when test=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "' and rectermcd='" + sValue + "']/rectermnm[not(.='')]\">\n";
  772. }
  773. //sStyle = sComStyle + "left:"+(parseInt(ctrlPosition.x)+lineWidth) +"px; top:"+ ctrlPosition.y +"px; \"";
  774. sStyle = sComStyle + "left:"+(parseInt(sLeft)+lineWidth) +"px; top:"+ sTop +"px; \"";
  775. sXSLTInfo += "\t\t\t\t\t\t<input " + ctrlname + " id=\"" + ctrlid + "\" "+sStyle+" value=\"" + sValue + "\" checked = \"true\" />\n";
  776. sXSLTInfo += "\t\t\t\t\t</xsl:when>\n";
  777. sXSLTInfo += "\t\t\t\t\t<xsl:otherwise>\n";
  778. sXSLTInfo += "\t\t\t\t\t\t<input "+ctrlname+" id=\""+ctrlid+"\" "+ sStyle +" value=\""+sValue+ "\" /> \n";
  779. sXSLTInfo += "\t\t\t\t\t</xsl:otherwise>\n";
  780. sXSLTInfo += "\t\t\t\t</xsl:choose>\n";
  781. // RDO 및 CHK컨트롤 간격을 20px 줌..
  782. //lineWidth += 20;
  783. lineHeight += 15;
  784. lineWidth += 15;
  785. //sStyle = sComStyle + "top:"+ctrlPosition.y+"px; left:"+(parseInt(ctrlPosition.x)+lineWidth)+"px;\"";
  786. sStyle = sComStyle + "left:"+ (parseInt(sLeft)+lineWidth) +"px; top:"+ sTop +"px;\"";
  787. if(sLabelhidden == "off") {
  788. sLabel = " ";
  789. }
  790. sXSLTInfo += "\t\t\t\t<pre id=\""+ctrlid+"\" "+ sStyle +"><![CDATA["+sLabel+"]]></pre>\n";
  791. var ctrlSpace = parseInt(fGetLblWidth(degnitemno, sLabel)) + parseInt(cellspacing);
  792. lineWidth += ctrlSpace;
  793. tmplineWidth = lineWidth;
  794. if((i + 1) % cols == 0)
  795. {
  796. if(ctrlPosition.width < lineWidth)
  797. ctrlPosition.width = lineWidth;
  798. lineWidth = 0;
  799. tmpValueWidth = fGetLblWidth(degnitemno, sLabel);
  800. if(vcellspacing > 0)
  801. {
  802. sTop += parseInt(vcellspacing);
  803. }
  804. }
  805. // 체크박스 아이템이 한줄이 가득차 다음줄로 넘김.
  806. if(cols != cnt)
  807. {
  808. // 다음줄로 넘기되 마지막 체크박스 아이템이 확장컨트롤을 가진경우
  809. // 확장컨트롤만 다음줄로 넘어가는 경우를 방지하기 위해 마지막 체크 아이템인 경우 생략함.
  810. if( (i+1) < cnt && ((i+1) % cols) == 0)
  811. //ctrlPosition.y += g_pageInfo.ctrlheight;
  812. //sTop += g_pageInfo.ctrlheight;
  813. sTop += 15; // 세로로 컨트롤을 그릴때 간격을 15로 수정.
  814. // 마지막 체크 아이템의 확장 컨트롤의 가로 좌표 보정
  815. if((i+1) == cnt && degnitemkind == "CHK")
  816. {
  817. if(((i+1) % cols) == 0)
  818. ctrlPosition.x += (fGetLblWidth(degnitemno, sLabel) + cellspacing);
  819. else
  820. ctrlPosition.x -= (fGetLblWidth(degnitemno, sLabel) + cellspacing);
  821. }
  822. }
  823. }
  824. //sLastStyle = sComStyle + "top:"+ctrlPosition.y+"px; left:"+(parseInt(ctrlPosition.x)+lineWidth)+"px;\"";
  825. // 확장 컨트롤 좌표 처리
  826. if(degnitemkind == "RDO")
  827. sLastStyle = sComStyle + "top:"+ctrlPosition.y+"px; left:"+(parseInt(ctrlPosition.x)+tmplineWidth)+"px;\"";
  828. else
  829. sLastStyle = sComStyle + "top:"+ctrlPosition.y+"px; left:"+(parseInt(ctrlPosition.x)+lineWidth)+"px;\"";
  830. ctrlPosition.width += ctrlPosition.x;
  831. if(cols == "0")
  832. ctrlPosition.height = g_pageInfo.ctrlheight;
  833. else
  834. ctrlPosition.height = (Math.ceil(cnt / cols) * 15) + Math.ceil(cnt / cols) + 2;
  835. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  836. if(ctrlPosition.height > sDivHeight) sDivHeight = ctrlPosition.height;
  837. g_pageInfo.curxpos += parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  838. if(getStyleValue(itemattrval, "extn") == "visible")
  839. {
  840. var top = ctrlPosition.height - 15;
  841. if(top < 0)
  842. top = 0;
  843. //fDrawHTMLStx(parseInt(ctrlPosition.width) +g_pageInfo.offsetx, top, 100, 20, row, "extn");
  844. var extnWidth = 0;
  845. extnWidth = getStyleValue(degnattrval, "width", "extn");
  846. var extnHeight = 0;
  847. extnHeight = getStyleValue(degnattrval, "height", "extn");
  848. if(lineWidth == 0)
  849. lineWidth = (tmplineWidth -tmpValueWidth); //;
  850. fDrawHTMLStx(degnitemkind == "RDO" ? (parseInt(ctrlPosition.x)+tmplineWidth) : (parseInt(ctrlPosition.x)+lineWidth), ctrlPosition.y, extnWidth != 0 ? extnWidth : 100 , extnHeight != 0 ? extnHeight : 20, row, "extn");
  851. }
  852. return ctrlPosition;
  853. }
  854. /**
  855. * @desc : input 박스 생성
  856. * @
  857. * @param :
  858. * @return :
  859. * @---------------------------------------------------
  860. */
  861. function fDrawHTMLStx(x, y, cx, cy, row, ctrltype)
  862. {
  863. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  864. if(width != "")
  865. width = parseInt(width);
  866. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  867. if(height != "")
  868. height = parseInt(height);
  869. if(width == "")
  870. width = cx;
  871. if(height == "")
  872. height = cy;
  873. if(ctrltype == null)
  874. ctrltype = "ctrl";
  875. var ctrlPosition = new Position(x, y, width, height);
  876. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  877. // Degnitemno => Degnitemlevlcd 로 변경
  878. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  879. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  880. var degnitemnm = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemnm");
  881. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  882. var degnitemkind = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemkind");
  883. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  884. var unitnm = model.getValue(g_pageInfo.formdegnRef + "[degnitemlevlcd = '" + degnitemlevlcd + "']/unitnm"); // 단위명
  885. var itemattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/itemattrval");
  886. var supdegnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/supdegnitemno");
  887. var supdegnitemkind = model.getValue(g_pageInfo.formdegnRef + "[degnitemno = '" + supdegnitemno + "']/degnitemkind");
  888. var suprectermcd = model.getValue(g_pageInfo.formdegnRef + "[degnitemkind='SSU' and degnitemno='" + degnitemno + "' and supdegnitemno='"+ supdegnitemno +"']/termcd");
  889. var ctrlid = "STX_" + degnitemno;
  890. var ref = g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "']/reccnts";
  891. degnattrval = fCheckDefaultDegnAttr(model, degnattrval, "STX", row);
  892. var Pattern = "";
  893. if(isSearchString(degnattrval, "ctrl.format") == true)
  894. {
  895. var roundmode = "";
  896. var roundpos = "";
  897. if(document.controls(ctrlid) != null)
  898. {
  899. roundmode = document.controls(ctrlid).attribute("roundmode");
  900. roundpos = document.controls(ctrlid).attribute("roundposition");
  901. }
  902. else
  903. {
  904. roundmode = getStyleValue(degnattrval, "roundmode", "ctrl");
  905. roundpos = getStyleValue(degnattrval, "roundposition", "ctrl");
  906. }
  907. if(roundmode != "" && roundpos != "")
  908. Pattern = getPatternXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, ctrltype);
  909. }
  910. if(supdegnitemkind == "SSL")
  911. {
  912. ref = g_pageInfo.xsltRecinfoRecitemRef + "[rectermcd='"+ suprectermcd +"' and degnitemno='" + supdegnitemno + "']/reccnts";
  913. }
  914. else if(supdegnitemkind == "MSL")
  915. {
  916. var mslctrl = document.controls("SSU_" + degnitemno);
  917. var colno = mslctrl.attribute("colno");
  918. ref = g_pageInfo.xsltRecinfoRecitemRef + "[degnitemno='" + supdegnitemno + "' and colno = '" + colno + "']/reccnts";
  919. }
  920. else if(supdegnitemkind == "IMG")
  921. {
  922. ref = g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "']/reccnts";
  923. }
  924. ctrlPosition.width = g_pageInfo.ctrlwidth;
  925. //ctrlPosition.width += fGetLblWidth(degnitemno, degnitemnm);
  926. if(ctrltype == "extn")
  927. {
  928. ctrlid = "STX_" + degnitemno;
  929. // 2008-11-28
  930. // extn.visible 인 것들은 아이템 구분없이 extn.border-style값이 없는건 기본으로 extn.border-style:solid 속성을 추가
  931. if(isSearchString(itemattrval, "extn:visible") == true)
  932. {
  933. if(isSearchString(degnattrval, "extn.border-style") == false)
  934. {
  935. degnattrval += "extn.border-style:solid;";
  936. }
  937. if(isSearchString(degnattrval, "extn.border-width") == false)
  938. {
  939. degnattrval += "extn.border-width:1;";
  940. }
  941. }
  942. }
  943. //var sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, ctrltype);
  944. var sStyle = getNewXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, ctrltype);
  945. //sStyle = AddBorderStyle(sStyle, degnattrval, ctrltype);
  946. // 숨겨진 단위 컨트롤 확인
  947. var UnitDivStyle = "";
  948. var UnitPreStyle = "";
  949. var unitid = "UNIT_" + degnitemno;
  950. //var sPreStyle = getPreXSLTStyle(ctrlPosition, degnattrval, ctrltype);
  951. var sPreStyle = getPreXSLTStyle(ctrlid, ctrlPosition, degnattrval, ctrltype);
  952. //sPreStyle = AddBorderStyle(sPreStyle, degnattrval, ctrltype);
  953. if(unitnm != "")
  954. {
  955. var tmpLeft = "";
  956. var tmpTop = "";
  957. var tmpWidth = "";
  958. var tmpHeight = "";
  959. if(document.controls(unitid) != null)
  960. {
  961. tmpLeft = parseInt(document.controls(unitid).attribute("left"));
  962. tmpTop = parseInt(document.controls(unitid).attribute("top"));
  963. tmpWidth = parseInt(document.controls(unitid).attribute("width"));
  964. tmpHeight = parseInt(document.controls(unitid).attribute("height"));
  965. }
  966. else
  967. {
  968. tmpLeft = parseInt(getStyleValue(degnattrval, "left", "unit"));
  969. tmpTop = parseInt(getStyleValue(degnattrval, "top", "unit"));
  970. tmpWidth = parseInt(getStyleValue(degnattrval, "width", "unit"));
  971. tmpHeight = parseInt(getStyleValue(degnattrval, "height", "unit"));
  972. }
  973. // 단위를 숨기지 않았는지 확인.
  974. //if(isSearchString(degnattrval, "unit.width") == true || isSearchString(degnattrval, "unit.height") == true)
  975. //{
  976. if(tmpWidth < 2 || tmpHeight < 2)
  977. {
  978. unitnm = "";
  979. }
  980. else
  981. {
  982. if(tmpWidth == "")
  983. tmpWidth = 120;
  984. if(tmpHeight == "")
  985. tmpHeight = 20;
  986. if(tmpLeft == "")
  987. tmpLeft = 0;
  988. if(tmpTop == "")
  989. tmpRight = 0;
  990. //UnitDivStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "unit");
  991. UnitDivStyle = getNewXSLTStyleVal(unitid, ctrlPosition, degnattrval, "unit");
  992. UnitPreStyle = "style=\"position:absolute; left:0px; top:0px; width:" + tmpWidth + "; height:" + tmpHeight + "; \"";
  993. }
  994. //}
  995. }
  996. if(degnitemkind == "CAL") // 달력형식
  997. {
  998. // 아이템이 STX인 경우 정해진 좌표를 벗어나게 됨에 따라 Pre -> Div 태그로 변경함.
  999. sXSLTInfo += "\t\t\t\t<div id=\""+ctrlid+"\" "+ sStyle +">\n"
  1000. + "\t\t\t\t\t<pre id=\""+ctrlid+"\" "+ sPreStyle +"><xsl:value-of select=\"normalize-space("+ref+")\"/></pre>\n";
  1001. sXSLTInfo += "\t\t\t\t</div>\n";
  1002. }
  1003. else
  1004. {
  1005. if(Pattern != "")
  1006. {
  1007. sXSLTInfo += "\t\t\t\t<div id=\""+ctrlid+"\" "+ sStyle +">\n"
  1008. + "\t\t\t\t\t<pre id=\""+ctrlid+"\" "+ sPreStyle +">\n";
  1009. sXSLTInfo +="\t\t\t\t\t<xsl:choose>\n";
  1010. sXSLTInfo +="\t\t\t\t\t\t<xsl:when test=\"" + ref + "[not(.='')]\">\n";
  1011. //sXSLTInfo +="\t\t\t\t\t\t\t<xsl:value-of select=\"format-number(normalize-space("+ref+"), '" + Pattern + ";(" + Pattern + "')\"/>\n";
  1012. //sXSLTInfo +="\t\t\t\t\t\t\t<xsl:value-of select=\"format-number(normalize-space("+ref+"), '" + Pattern + ";(" + Pattern + ")')\"/>\n";
  1013. sXSLTInfo +="\t\t\t\t\t\t\t<xsl:value-of select=\"format-number(normalize-space("+ref+"), '" + Pattern + "')\"/>\n";
  1014. sXSLTInfo +="\t\t\t\t\t\t</xsl:when>\n";
  1015. sXSLTInfo +="\t\t\t\t\t\t<xsl:otherwise>\n";
  1016. sXSLTInfo +="\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space("+ref+")\"/>\n";
  1017. sXSLTInfo +="\t\t\t\t\t\t</xsl:otherwise>\n";
  1018. sXSLTInfo +="\t\t\t\t\t</xsl:choose>\n";
  1019. sXSLTInfo += "\t\t\t\t\t</pre>\n";
  1020. sXSLTInfo += "\t\t\t\t</div>\n";
  1021. }
  1022. else
  1023. {
  1024. sXSLTInfo += "\t\t\t\t<div id=\""+ctrlid+"\" "+ sStyle +">\n"
  1025. + "\t\t\t\t\t<pre id=\""+ctrlid+"\" "+ sPreStyle +"><xsl:value-of select=\"normalize-space("+ref+")\"/></pre>\n";
  1026. sXSLTInfo += "\t\t\t\t</div>\n";
  1027. }
  1028. /*
  1029. sXSLTInfo += "\t\t\t\t<div id=\""+ctrlid+"\" "+ sStyle +">\n"
  1030. + "\t\t\t\t\t<pre id=\""+ctrlid+"\" "+ sPreStyle +"><xsl:value-of select=\"normalize-space("+ref+")\"/></pre>\n";
  1031. sXSLTInfo += "\t\t\t\t</div>\n";
  1032. */
  1033. if(unitnm != "")
  1034. {
  1035. sXSLTInfo += "\t\t\t\t<div id=\""+ unitid +"\" "+ UnitDivStyle +">\n";
  1036. sXSLTInfo += "\t\t\t\t\t<pre id=\""+ unitid +"\" "+ UnitPreStyle +"><![CDATA[" + unitnm + "]]></pre>\n";
  1037. sXSLTInfo += "\t\t\t\t</div>\n";
  1038. }
  1039. }
  1040. g_pageInfo.curxpos += parseInt(ctrlPosition.x) + parseInt(ctrlPosition.width) + g_pageInfo.offsetx;
  1041. return ctrlPosition;
  1042. }
  1043. /**
  1044. * @desc : combo 생성
  1045. * @
  1046. * @param :
  1047. * @return :
  1048. * @---------------------------------------------------
  1049. */
  1050. function fDrawHTMLCmb(x, y, row)
  1051. {
  1052. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  1053. if(width != "")
  1054. width = parseInt(width);
  1055. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  1056. if(height != "")
  1057. height = parseInt(height);
  1058. if(width == "")
  1059. width = 100;
  1060. if(height == "")
  1061. height = 20;
  1062. var ctrlPosition = new Position(x, y, width, height);
  1063. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1064. // Degnitemno => Degnitemlevlcd 로 변경
  1065. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  1066. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  1067. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  1068. var itemattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/itemattrval");
  1069. var valgrupcd = model.getValue(g_pageInfo.formdegnRef + "[degnitemno='" + degnitemno + "']/valgrupcd");
  1070. var cnt = getNodesetCnt(model, g_pageInfo.vallistRef + "[grupcd='" + valgrupcd + "']");
  1071. var ctrlid = "CMB_" + degnitemno;
  1072. var sLabel = "";
  1073. var sValue = "";
  1074. var sLblWidth = 0;
  1075. var sStyle = "";
  1076. // combo 리스트 중에서 최대 길이 체크
  1077. for(var i =0; i< cnt; i++)
  1078. {
  1079. sLabel = model.instances(0).selectNodes(g_pageInfo.vallistRef + "[grupcd='" + valgrupcd + "']/valitemnm").item(i).text;
  1080. sLblWidth = fGetLblWidth(degnitemno, sLabel);
  1081. if(ctrlPosition.width < sLblWidth)
  1082. ctrlPosition.width = sLblWidth
  1083. }
  1084. //sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  1085. //sStyle = AddBorderStyle(sStyle, degnattrval, "ctrl");
  1086. sStyle = getNewXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  1087. sXSLTInfo +="\t\t\t\t<pre id=\""+ctrlid+"\" "+ sStyle+ "> \n";
  1088. sXSLTInfo +="\t\t\t\t\t<xsl:value-of select=\"normalize-space("+ g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "']/rectermnm)\"/> \n"
  1089. //sXSLTInfo +="\t\t\t\t\t<xsl:value-of select=\""+ g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "']/rectermnm\"/> \n"
  1090. sXSLTInfo +="\t\t\t\t</pre> \n";
  1091. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  1092. if(ctrlPosition.width > sDivHeight)
  1093. sDivHeight = ctrlPosition.height;
  1094. if(getStyleValue(itemattrval, "extn") == "visible")
  1095. {
  1096. ctrlPosition.x = parseInt(ctrlPosition.x) + parseInt(ctrlPosition.width) + g_pageInfo.offsetx;
  1097. // 참고
  1098. var ctrlPosition = fDrawHTMLStx(ctrlPosition.x, 0, 100, 20, row, "extn");
  1099. //var ctrlPosition = fDrawHTMLStx(parseInt(ctrlPosition.width) +g_pageInfo.offsetx, 0, 100, 20, row, "extn");
  1100. }
  1101. g_pageInfo.curxpos += parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  1102. return ctrlPosition;
  1103. }
  1104. /**
  1105. * @desc : textarea 생성
  1106. * @
  1107. * @param :
  1108. * @return :
  1109. * @---------------------------------------------------
  1110. */
  1111. function fDrawHTMLMtx(x, y, row)
  1112. {
  1113. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  1114. if(width != "")
  1115. width = parseInt(width);
  1116. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  1117. if(height != "")
  1118. height = parseInt(height);
  1119. if(width == "")
  1120. width = 400;
  1121. if(height == "")
  1122. height = 300;
  1123. var ctrlPosition = new Position(x, y, width, height);
  1124. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1125. // Degnitemno => Degnitemlevlcd 로 변경
  1126. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  1127. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  1128. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  1129. var fstlevlitemcd = model.getValue(g_pageInfo.recItemRef + "[degnitemno='" + degnitemno + "']/fstlevlitemcd");
  1130. var comuseyn = model.getValue(g_pageInfo.formdegnRef + "[degnitemcd='" + fstlevlitemcd + "' and degnitemlevlno='1']/comuseyn");
  1131. var ctrlid = "";
  1132. ctrlid = "MTX_" + degnitemno;
  1133. ctrlPosition.width = g_pageInfo.ctrlwidth;
  1134. degnattrval = fCheckDefaultDegnAttr(model, degnattrval, "MTX", row);
  1135. //var sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  1136. //sStyle = AddBorderStyle(sStyle, degnattrval, "label");
  1137. var sStyle = getNewXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  1138. //var sPreStyle = getPreXSLTStyle(null, ctrlPosition, degnattrval, "ctrl");
  1139. var sPreStyle = getPreXSLTStyle(ctrlid, ctrlPosition, degnattrval, "ctrl");
  1140. sPreStyle = AddBorderStyle(sPreStyle, degnattrval, "ctrl");
  1141. // 텍스트가 MultiLine인 경우 정해진 좌표를 벗어나게 됨에 따라 Pre -> Div 태그로 변경함.
  1142. sXSLTInfo += "\t\t\t\t<div id=\""+ctrlid+"\" "+ sStyle +"> \n"
  1143. + "\t\t\t\t\t<pre id=\""+ctrlid+"\" "+ sPreStyle +"><xsl:value-of select=\""+g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "']/reccnts\"/></pre>\n";
  1144. sXSLTInfo += "\t\t\t\t</div>\n";
  1145. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  1146. if(ctrlPosition.height > sDivHeight)
  1147. sDivHeight = ctrlPosition.height;
  1148. g_pageInfo.curxpos += parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  1149. return ctrlPosition;
  1150. }
  1151. /**
  1152. * @desc : 기본 속성 추가 로직.
  1153. * @
  1154. * @param :
  1155. * @return :
  1156. * @history:
  1157. 2008-11-13 STX, MTX에 border-style이 없는 경우 기본으로 넣어주도록 수정
  1158. * @---------------------------------------------------
  1159. */
  1160. function fCheckDefaultDegnAttr(model, degnattrval, degnitemkind, row)
  1161. {
  1162. switch(degnitemkind)
  1163. {
  1164. case "RDO":
  1165. break;
  1166. case "STX":
  1167. case "MTX":
  1168. {
  1169. if(isSearchString(degnattrval, "ctrl.border-style") == false)
  1170. {
  1171. degnattrval += "ctrl.border-style:solid;"
  1172. }
  1173. }
  1174. break;
  1175. }
  1176. // 디자인 속성 변경
  1177. model.setValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval", degnattrval, true);
  1178. model.refresh();
  1179. return degnattrval;
  1180. }
  1181. /**
  1182. * @desc : input(hidden) 생성 (secret을 pre으로 처리할 경우 자리수를 어떻게 처리할 것인지..)
  1183. * @
  1184. * @param :
  1185. * @return :
  1186. * @---------------------------------------------------
  1187. */
  1188. function fDrawHTMLMsk(x, y, cx, cy, row)
  1189. {
  1190. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  1191. if(width != "")
  1192. width = parseInt(width);
  1193. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  1194. if(height != "")
  1195. height = parseInt(height);
  1196. if(width == "")
  1197. width = cx;
  1198. if(height == "")
  1199. height = cy;
  1200. var ctrlPosition = new Position(x, y, width, height);
  1201. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1202. // Degnitemno => Degnitemlevlcd 로 변경
  1203. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  1204. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  1205. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  1206. var degnitemkind = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemkind");
  1207. var ctrlid = "MSK_" + degnitemno;
  1208. var ref = g_pageInfo.recItemRef + "[degnitemlevlcd='" + degnitemlevlcd + "']/reccnts";
  1209. ctrlPosition.width = g_pageInfo.ctrlwidth;
  1210. var sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  1211. sXSLTInfo += "\t\t\t\t<pre id=\""+ctrlid+"\" "+ sStyle +" >*******</pre> \n";
  1212. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  1213. if(ctrlPosition.height = sDivHeight)
  1214. sDivHeight = ctrlPosition.height;
  1215. g_pageInfo.curxpos += ctrlPosition.x + parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  1216. return ctrlPosition;
  1217. }
  1218. /**
  1219. * @desc : 이미지 생성
  1220. * @
  1221. * @param :
  1222. * @return :
  1223. * @---------------------------------------------------
  1224. */
  1225. function fDrawHTMLImge(x, y, row)
  1226. {
  1227. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  1228. if(width != "")
  1229. width = parseInt(width);
  1230. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  1231. if(height != "")
  1232. height = parseInt(height);
  1233. if(width == "")
  1234. width = 300;
  1235. if(height == "")
  1236. height = 300;
  1237. var ctrlPosition = new Position(x, y, width, height);
  1238. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1239. // Degnitemno => Degnitemlevlcd 로 변경
  1240. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  1241. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  1242. var degnitemcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemcd");
  1243. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  1244. var degnitemkind = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemkind");
  1245. var imgedit = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/itemattrval"), "imgedit");
  1246. var formdegnseq = model.getValue(g_pageInfo.formmastRef + "/formdegnseq");
  1247. var ctrlid = ""
  1248. var ImgUrl = "";
  1249. if(degnitemkind == "IMG")
  1250. {
  1251. ctrlid = "IMG_" + degnitemno;
  1252. if(imgedit == "Y")
  1253. ImgUrl = getRecImgUrl(degnitemlevlcd);
  1254. else
  1255. ImgUrl = getImgUrl(degnitemcd);
  1256. }
  1257. else if(degnitemkind == "FDG")
  1258. {
  1259. ctrlid = "FDG_" + degnitemno;
  1260. ImgUrl = getRecImgUrl(degnitemlevlcd);
  1261. }
  1262. ImgUrl = ImgUrl.setReplaceWord("&", "&amp;");
  1263. //var sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  1264. var sPosStyle = getImgXSLTStylePos(ctrlid, ctrlPosition, degnattrval, "ctrl"); // 위치좌표
  1265. var sStyle = getImgXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl"); // Style 정보
  1266. //IMG Width, Height
  1267. var ImgSize = "";
  1268. var sImgWidth = "";
  1269. var sImgHeight = "";
  1270. if(document.controls(ctrlid) != null)
  1271. {
  1272. sImgWidth = document.controls(ctrlid).attribute("width");
  1273. sImgHeight = document.controls(ctrlid).attribute("height");
  1274. if(document.controls(ctrlid).attribute("border-style") != "")
  1275. {
  1276. var BdWidth = 0;
  1277. if(getStyleValue(degnattrval, "border-width", "ctrl") != "")
  1278. BdWidth = getStyleValue(degnattrval, "border-width", "ctrl");
  1279. else
  1280. BdWidth = 1;
  1281. sImgHeight = parseInt(sImgHeight) - BdWidth;
  1282. }
  1283. }
  1284. else
  1285. {
  1286. if(degnitemkind == "IMG")
  1287. {
  1288. sImgWidth = getStyleValue(degnattrval, "width", "ctrl");
  1289. sImgHeight = getStyleValue(degnattrval, "height", "ctrl");
  1290. }
  1291. if(degnitemkind == "FDG")
  1292. {
  1293. sImgWidth = getStyleValue(degnattrval, "width", "label");
  1294. sImgHeight = getStyleValue(degnattrval, "height", "label");
  1295. }
  1296. if(getStyleValue(degnattrval, "border-style", "ctrl") != "")
  1297. {
  1298. var BdWidth = 0;
  1299. if(getStyleValue(degnattrval, "border-width", "ctrl") != "")
  1300. BdWidth = getStyleValue(degnattrval, "border-width", "ctrl");
  1301. else
  1302. BdWidth = 1;
  1303. sImgHeight = parseInt(sImgHeight) - BdWidth;
  1304. }
  1305. }
  1306. if(sImgWidth != "")
  1307. ImgSize += " width=\""+sImgWidth+"\" ";
  1308. if(sImgHeight != "")
  1309. ImgSize += " height=\""+sImgHeight+"\"";
  1310. if(degnitemkind == "IMG")
  1311. {
  1312. if(imgedit == "Y")
  1313. {
  1314. sXSLTInfo += "\t\t\t\t<xsl:choose>\n";
  1315. sXSLTInfo += "\t\t\t\t\t<xsl:when test=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemkind='IMG' and degnitemlevlcd='" + degnitemlevlcd + "' and degnitemno='" + degnitemno + "']/unitnm[not(.='')]\">\n";
  1316. // XSLT 변수로 사용되는 이미지url 전달인자는 해당 컨트롤ID 앞에 v를 붙임
  1317. sXSLTInfo += "\t\t\t\t\t\t<xsl:variable name=\"" + "v" + ctrlid + "_width\" select=\"substring-before(" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemkind='IMG' and degnitemlevlcd='" + degnitemlevlcd + "' and degnitemno='" + degnitemno + "']/unitnm, '|')\"/>\n";
  1318. sXSLTInfo += "\t\t\t\t\t\t<xsl:variable name=\"" + "v" + ctrlid + "_height\" select=\"substring-after(" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemkind='IMG' and degnitemlevlcd='" + degnitemlevlcd + "' and degnitemno='" + degnitemno + "']/unitnm, '|')\"/>\n";
  1319. sXSLTInfo += "\t\t\t\t\t\t<xsl:variable name=\"" + "v" + ctrlid + "\">" + ImgUrl + "</xsl:variable>\n";
  1320. sXSLTInfo += "\t\t\t\t\t\t<div " + sPosStyle + ">\n";
  1321. sXSLTInfo += "\t\t\t\t\t\t\t<img id=\"" + ctrlid + "\" " + sStyle + " >\n";
  1322. sXSLTInfo += "\t\t\t\t\t\t\t\t<xsl:attribute name=\"src\">\n";
  1323. sXSLTInfo += "\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$" + "v" + ctrlid + "\"/>\n";
  1324. sXSLTInfo += "\t\t\t\t\t\t\t\t</xsl:attribute>\n";
  1325. sXSLTInfo += "\t\t\t\t\t\t\t\t<xsl:attribute name=\"width\">\n";
  1326. sXSLTInfo += "\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$" + "v" + ctrlid + "_width\"/>\n";
  1327. sXSLTInfo += "\t\t\t\t\t\t\t\t</xsl:attribute>\n";
  1328. sXSLTInfo += "\t\t\t\t\t\t\t\t<xsl:attribute name=\"height\">\n";
  1329. sXSLTInfo += "\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$" + "v" + ctrlid + "_height\"/>\n";
  1330. sXSLTInfo += "\t\t\t\t\t\t\t\t</xsl:attribute>\n";
  1331. sXSLTInfo += "\t\t\t\t\t\t\t</img>\n";
  1332. sXSLTInfo += "\t\t\t\t\t\t</div>\n";
  1333. sXSLTInfo += "\t\t\t\t\t</xsl:when>\n";
  1334. sXSLTInfo += "\t\t\t\t\t<xsl:otherwise>\n";
  1335. sXSLTInfo += "\t\t\t\t\t\t<xsl:variable name=\"" + "v" + ctrlid + "\">" + ImgUrl + "</xsl:variable>\n";
  1336. sXSLTInfo += "\t\t\t\t\t\t<div " + sPosStyle + ">\n";
  1337. // IMG 태그는 Style이 안 먹히므로 Width, Height를 명시해줘야 함.
  1338. sXSLTInfo += "\t\t\t\t\t\t\t<img id=\"" + ctrlid + "\" " + ImgSize + " " + sStyle + " >\n";
  1339. sXSLTInfo += "\t\t\t\t\t\t\t\t<xsl:attribute name=\"src\">\n";
  1340. sXSLTInfo += "\t\t\t\t\t\t\t\t<xsl:copy-of select=\"$" + "v" + ctrlid + "\"/>\n";
  1341. sXSLTInfo += "\t\t\t\t\t\t\t\t</xsl:attribute>\n";
  1342. sXSLTInfo += "\t\t\t\t\t\t\t</img>\n";
  1343. sXSLTInfo += "\t\t\t\t\t\t</div>\n";
  1344. sXSLTInfo += "\t\t\t\t\t</xsl:otherwise>\n";
  1345. sXSLTInfo += "\t\t\t\t</xsl:choose>\n";
  1346. }
  1347. else
  1348. {
  1349. // XSLT 변수로 사용되는 이미지url 전달인자는 해당 컨트롤ID 앞에 v를 붙임
  1350. sXSLTInfo += "\t\t\t\t<xsl:variable name=\"" + "v" + ctrlid + "\">" + ImgUrl + "</xsl:variable>\n";
  1351. sXSLTInfo += "\t\t\t\t\t<div " + sPosStyle + ">\n";
  1352. sXSLTInfo += "\t\t\t\t\t\t<img id=\"" + ctrlid + "\" " + ImgSize + " " + sStyle + " >\n";
  1353. sXSLTInfo += "\t\t\t\t\t\t\t<xsl:attribute name=\"src\">\n";
  1354. sXSLTInfo += "\t\t\t\t\t\t\t<xsl:copy-of select=\"$" + "v" + ctrlid + "\"/>\n";
  1355. sXSLTInfo += "\t\t\t\t\t\t\t</xsl:attribute>\n";
  1356. sXSLTInfo += "\t\t\t\t\t\t</img>\n";
  1357. sXSLTInfo += "\t\t\t\t\t</div>\n";
  1358. }
  1359. }
  1360. else if(degnitemkind == "FDG")
  1361. {
  1362. // XSLT 변수로 사용되는 이미지url 전달인자는 해당 컨트롤ID 앞에 v를 붙임
  1363. sXSLTInfo += "\t\t\t\t<xsl:variable name=\"" + "v" + ctrlid + "\">" + ImgUrl + "</xsl:variable>\n";
  1364. sXSLTInfo += "\t\t\t\t\t<div " + sPosStyle + ">\n";
  1365. sXSLTInfo += "\t\t\t\t\t\t<img id=\"" + ctrlid + "\" " + ImgSize + " " + sStyle + " >\n";
  1366. sXSLTInfo += "\t\t\t\t\t\t\t<xsl:attribute name=\"src\">\n";
  1367. sXSLTInfo += "\t\t\t\t\t\t\t<xsl:copy-of select=\"$" + "v" + ctrlid + "\"/>\n";
  1368. sXSLTInfo += "\t\t\t\t\t\t\t</xsl:attribute>\n";
  1369. sXSLTInfo += "\t\t\t\t\t\t</img>\n";
  1370. sXSLTInfo += "\t\t\t\t\t</div>\n";
  1371. }
  1372. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  1373. if(ctrlPosition.height > sDivHeight)
  1374. sDivHeight = ctrlPosition.height;
  1375. g_pageInfo.curxpos += parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  1376. // ISU 를 그리는 로직
  1377. var elementName = "";
  1378. var ref = "";
  1379. elementName = "type=\"checkbox\"";
  1380. var cellspacing = 15;
  1381. var lblWidth = 0;
  1382. var subcnt = getNodesetCnt(model, g_pageInfo.formdegnRef + "[degnitemkind='ISU' and supdegnitemno='" + degnitemno + "']");
  1383. var sStyle = "";
  1384. var ISUArr = new Array(2);
  1385. for(var j = 0; j < subcnt; j++)
  1386. {
  1387. var subtermcd = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='ISU' and supdegnitemno='" + degnitemno + "']/termcd").item(j).text;
  1388. var subdegnitemno = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='ISU' and supdegnitemno='" + degnitemno + "']/degnitemno").item(j).text;
  1389. var subdegnitemkind = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='ISU' and supdegnitemno='" + degnitemno + "']/degnitemkind").item(j).text;
  1390. var subdegnitemnm = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='ISU' and supdegnitemno='" + degnitemno + "']/degnitemnm").item(j).text;
  1391. var subdegnitemlevlcd = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='ISU' and supdegnitemno='" + degnitemno + "']/degnitemlevlcd").item(j).text;
  1392. var subitemattrval = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='ISU' and supdegnitemno='" + degnitemno + "']/itemattrval").item(j).text;
  1393. var subdegnattrval = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='ISU' and supdegnitemno='" + degnitemno + "']/degnattrval").item(j).text;
  1394. ref = g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + subdegnitemlevlcd + "']/rectermcd";
  1395. //var cvrtRef = ref.setReplaceWord("#colno#", j);
  1396. // DIV를 그린다.
  1397. //var divid = "DIV_" + subdegnitemno;
  1398. var ISURow = row + (j+1);
  1399. lblWidth = fGetLblWidth(degnitemno, subdegnitemnm);
  1400. var ctrlPosition = new Position(x, y, 10 + parseInt(lblWidth), 20);
  1401. var ctrlid = subdegnitemkind + "_" + subdegnitemno;
  1402. //var sISUStyle = getXSLTStyleVal(ctrlPosition, subdegnattrval, "ctrl");
  1403. ISUArr = getSelSSUXSLTStyleVal(ctrlid, ctrlPosition, subdegnattrval, "ctrl");
  1404. ctrlPosition.width = lblWidth;
  1405. //sXSLTInfo += "\t\t\t\t<div id=\""+divid+"\" "+sISUStyle+">\n";
  1406. sXSLTInfo += "\t\t\t\t\t<xsl:choose>\n";
  1407. sXSLTInfo += "\t\t\t\t\t\t<xsl:when test=\""+ ref +" = '"+ subtermcd +"'\"> \n";
  1408. //sXSLTInfo += "\t\t\t\t\t\t<input "+elementName+" id=\""+ctrlid+"\" "+ sISUStyle +" value=\""+subtermcd+ "\" checked = \"true\" /><![CDATA["+subdegnitemnm+"]]>\n";
  1409. sXSLTInfo += "\t\t\t\t\t\t<input "+elementName+" id=\""+ctrlid+"\" " + ISUArr[0] + " value=\""+subtermcd+ "\" checked = \"true\" />\n";
  1410. sXSLTInfo += "\t\t\t\t\t\t</xsl:when>\n";
  1411. sXSLTInfo += "\t\t\t\t\t\t<xsl:otherwise>\n";
  1412. //sXSLTInfo += "\t\t\t\t\t\t<input "+elementName+" id=\""+ctrlid+"\" "+ sISUStyle +" value=\""+subtermcd+ "\" /><![CDATA["+subdegnitemnm+"]]>\n";
  1413. sXSLTInfo += "\t\t\t\t\t\t<input "+elementName+" id=\""+ctrlid+"\" " + ISUArr[0] + " value=\""+subtermcd+ "\" />\n";
  1414. sXSLTInfo += "\t\t\t\t\t\t</xsl:otherwise>\n";
  1415. sXSLTInfo += "\t\t\t\t\t</xsl:choose>\n";
  1416. sXSLTInfo += "\t\t\t\t\t<pre id=\""+ctrlid+"\" " + ISUArr[1] + "><![CDATA["+subdegnitemnm+"]]></pre>\n";
  1417. //sXSLTInfo += "\t\t\t\t</div>\n";
  1418. //sXSLTInfo += "\t\t\t\t<pre "+sISUStyle+"><![CDATA["+subdegnitemnm+"]]></pre> \n";
  1419. }
  1420. return ctrlPosition;
  1421. }
  1422. /**
  1423. * @desc : 그리드 생성
  1424. * @
  1425. * @param :
  1426. * @return :
  1427. * @history: 2008-10-30 이경희 - 테이블 좌표 생성 시 컨트롤의 크기대로 됨에 따라 사이즈가 컨트롤의 height로 맞춰지는 것을
  1428. Div로 한번 더 감싸는 것으로 수정
  1429. * @---------------------------------------------------
  1430. */
  1431. function fDrawHTMLGrd(x, y, row)
  1432. {
  1433. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  1434. if(width != "")
  1435. width = parseInt(width);
  1436. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  1437. if(height != "")
  1438. height = parseInt(height);
  1439. if(width == "")
  1440. width = 500;
  1441. if(height == "")
  1442. height = 300;
  1443. var ctrlPosition = new Position(x, y, width, height);
  1444. var degnitemno = model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemno");
  1445. var degnitemnm = model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemnm");
  1446. var degnitemlevlcd = "";
  1447. if(g_pageInfo.fstLevlItemCd != "")
  1448. degnitemlevlcd = g_pageInfo.fstLevlItemCd + "." + model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemlevlcd");
  1449. else
  1450. degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemlevlcd");
  1451. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  1452. var gridtype = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/itemattrval"), "gridtype");
  1453. var subcnt = getNodesetCnt(model, g_pageInfo.formdegnRef + "[degnitemkind='GSU' and supdegnitemno='" + degnitemno + "']");
  1454. var degnitemlevlcdArr = getDegnitemlevlcd(gridtype, degnitemlevlcd);
  1455. var degnitemcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemcd");
  1456. var ctrlid = "GRD_" + degnitemno;
  1457. var grdcaption = "";
  1458. var grdcolwidth = "";
  1459. var grdcolheight = g_Base_GrdColHeight;
  1460. var recItemCnt = getNodesetCnt(model, g_pageInfo.recItemRef);
  1461. //var sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  1462. var sStyle = getNewXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  1463. var TdFontStyle = getTableXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  1464. // 2008-10-30
  1465. //sXSLTInfo += "\t\t\t\t<div id=\"C_"+ctrlid+"\" "+sStyle+">\n";
  1466. var tmpWidth = getStyleValue(degnattrval, "ctrl.width");
  1467. var tmpHeight = getStyleValue(degnattrval, "ctrl.height");
  1468. sXSLTInfo += "\t\t\t\t<div id=\"C_"+ctrlid+"\" style=\"position:absolute; left:0px; top:0px; width:" + tmpWidth + "px; height:" + tmpHeight + "px; \">\n";
  1469. // Table 에 Style 정보를 추가
  1470. sXSLTInfo += "\t\t\t\t<table id=\""+ctrlid+"\" "+sStyle+" border=\"1\" frame=\"box\" bordercolor=\"silver\" cellspacing=\"0\">\n";
  1471. //sXSLTInfo += "\t\t\t\t<table id=\""+ctrlid+"\" border=\"1\" frame=\"box\" bordercolor=\"silver\" cellspacing=\"0\">\n";
  1472. var StyleArr = new Array();
  1473. if(gridtype == "Y" || gridtype == "G") //Y축 누적
  1474. {
  1475. degnitemcd = getDegnitemcd(gridtype, degnitemlevlcd);
  1476. /*
  1477. if(degnitemlevlcdArr[1] != null)
  1478. {
  1479. var tmpArray = degnitemlevlcdArr[1].split(".");
  1480. var length = tmpArray.length;
  1481. degnitemcd = tmpArray[length-1];
  1482. }
  1483. */
  1484. var colWidths = getStyleValue(degnattrval, "colwidth", "ctrl").split("^");
  1485. var colHeights = getStyleValue(degnattrval, "rowheight", "ctrl").split("^");
  1486. var sTdStyle = "";
  1487. sXSLTInfo += "\t\t\t\t\t<tr bgColor=\"#e0e0e0\">\n";
  1488. for(var j = 0; j < subcnt; j++)
  1489. {
  1490. var subdegnitemnm = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='GSU' and supdegnitemno='" + degnitemno + "']/degnitemnm").item(j).text;
  1491. sTdStyle = "style=\"";
  1492. if(colWidths.length == subcnt)
  1493. sTdStyle += "width:"+ colWidths[j] +"px; ";
  1494. else
  1495. sTdStyle += "width:"+ fGetLblWidth(degnitemno, subdegnitemnm) +"px; ";
  1496. if(colHeights.length == subcnt)
  1497. sTdStyle += "height:"+ colHeights[j] +"px; ";
  1498. else
  1499. sTdStyle += "height:"+ grdcolheight +"px; ";
  1500. sTdStyle = sTdStyle + TdFontStyle + "\"";
  1501. StyleArr[j] = sTdStyle;
  1502. sXSLTInfo += "\t\t\t\t\t\t<td "+ sTdStyle +" align=\"center\"><![CDATA["+subdegnitemnm+"]]></td> \n";
  1503. }
  1504. sXSLTInfo += "\t\t\t\t\t</tr>\n";
  1505. if(gridtype == "Y")
  1506. sXSLTInfo += "\t\t\t\t\t<xsl:apply-templates select=\"" +g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and degnitemcd='" + degnitemcd + "']\"/>\n";
  1507. else
  1508. sXSLTInfo += "\t\t\t\t\t<xsl:apply-templates select=\"" +g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "']\"/>\n";
  1509. }
  1510. else if(gridtype == "X") //X축 누적
  1511. {
  1512. var sColCnt = subcnt; //10;
  1513. var colwidth = g_Base_GrdColWidth;
  1514. var sTdStyle = "";
  1515. var colWidths = getStyleValue(degnattrval, "colwidth", "ctrl").split("^");
  1516. var colHeights = getStyleValue(degnattrval, "rowheight", "ctrl").split("^");
  1517. if(colWidths.length == 0)
  1518. {
  1519. colWidths[0] = colwidth;
  1520. }
  1521. sTdStyle = "style=\"";
  1522. sTdStyle += "width:"+ colWidths[0] +"px; ";
  1523. if(colHeights.length == (subcnt + 1))
  1524. sTdStyle += "height:"+ colHeights[0] +"px; ";
  1525. else
  1526. sTdStyle += "height:"+ grdcolheight +"px; ";
  1527. //sTdStyle += "\"";
  1528. sTdStyle = sTdStyle + TdFontStyle + "\"";
  1529. var Onerow = degnitemlevlcdArr[0];
  1530. // 테이블 컬럼 생성
  1531. // 전체 Table 사이즈에서 colwidth 값으로 Table을 여러개 생성함.
  1532. var totalwidth = getStyleValue(degnattrval, "width", "ctrl");
  1533. var cnt = (totalwidth - colwidth) / g_Base_GrdColWidth;
  1534. sXSLTInfo += "\t\t\t\t\t<tr bgColor=\"#e0e0e0\">\n";
  1535. ///////////////////////////////////////////////////////////////////////////////////////////////////////
  1536. // 1. 첫줄 - 빈 컬럼 만들기
  1537. // column 0
  1538. sXSLTInfo += "\t\t\t\t\t\t<td "+sTdStyle+ " align=\"center\">※</td> \n";
  1539. StyleArr[0] = sTdStyle;
  1540. sTdStyle = "style=\"width:"+ g_Base_GrdColWidth +"px; " + "height:"+ grdcolheight +"px; \"";
  1541. // column 1~ 마지막까지
  1542. for(var rowidx = 1; rowidx <= cnt; rowidx++)
  1543. {
  1544. sXSLTInfo += "\t\t\t\t\t\t<td "+sTdStyle+ " align=\"center\"></td> \n";
  1545. }
  1546. sXSLTInfo += "\t\t\t\t\t</tr>\n";
  1547. var tmpwidth = getStyleValue(degnattrval, "width", "");
  1548. // 전체 row 만큼 반복
  1549. for(var rowidx = 0; rowidx < sColCnt; rowidx++)
  1550. {
  1551. sXSLTInfo += "\t\t\t\t\t<tr>\n";
  1552. var nodelist = findNodeset(model, g_pageInfo.recRef + "/grid/recitem[degnitemlevlcd='" + degnitemlevlcdArr[rowidx][1] + "']");
  1553. var degnitemnm = "";
  1554. if(nodelist != null)
  1555. {
  1556. for(var i = 1; i < nodelist.length; i++)
  1557. {
  1558. var itemNode = nodelist.item(i);
  1559. degnitemnm = itemNode.selectSingleNode("degnitemnm").text;
  1560. if(degnitemnm != "")
  1561. {
  1562. if(isSearchString(degnitemnm, " ") == true)
  1563. {
  1564. degnitemnm = GetDegnitemnmTrans(degnitemnm);
  1565. }
  1566. else
  1567. {
  1568. degnitemnm = "<![CDATA[" + degnitemnm + "]]>";
  1569. }
  1570. break;
  1571. }
  1572. }
  1573. }
  1574. // 한줄씩 column을 생성
  1575. for(var colidx = 0; colidx < cnt; colidx++)
  1576. {
  1577. if(colidx == 0)
  1578. {
  1579. sTdStyle = "style=\"width:"+ colWidths[0] +"px; " + "height:"+ colHeights[rowidx+1] +"px; " + TdFontStyle + " \"";
  1580. //sXSLTInfo += "\t\t\t\t\t\t<td " + sTdStyle + " bgColor=\"#e0e0e0\" align=\"center\"><![CDATA[" + degnitemnm + "]]></td>\n";
  1581. sXSLTInfo += "\t\t\t\t\t\t<td " + sTdStyle + " bgColor=\"#e0e0e0\" align=\"center\">" + degnitemnm + "</td>\n";
  1582. }
  1583. else
  1584. {
  1585. sTdStyle = "style=\"width:"+ g_Base_GrdColWidth +"px; " + "height:"+ colHeights[rowidx+1] +"px; " + TdFontStyle + " \"";
  1586. sXSLTInfo += "\t\t\t\t\t\t<td " + sTdStyle + ">\n";
  1587. sXSLTInfo += "\t\t\t\t\t\t\t<xsl:value-of select=\"normalize-space(" +g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[rowidx][1] + "' and rowno='" + rowidx + "' and colno='" + colidx + "']/reccnts)\"/>\n";
  1588. sXSLTInfo += "\t\t\t\t\t\t</td>\n";
  1589. }
  1590. }
  1591. sXSLTInfo += "\t\t\t\t\t</tr>\n";
  1592. }
  1593. }
  1594. else if(gridtype =="T") //Table
  1595. {
  1596. // itemattrval 단일화
  1597. var subcntList = model.instances(0).selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='GSU' and supdegnitemno='" + degnitemno + "']");
  1598. for(var subidx = 0; subidx < subcntList.length; subidx++)
  1599. {
  1600. var subNode = subcntList.item(subidx);
  1601. var subitemattrval = subNode.selectSingleNode("itemattrval").text;
  1602. if(isSearchString(subitemattrval, "axtype") == true)
  1603. {
  1604. var subColumnType = getStyleValue(subitemattrval, "axflag");
  1605. if(subColumnType == "X")
  1606. {
  1607. subNode.selectSingleNode("itemattrval").text = "axflag:X;";
  1608. }
  1609. else
  1610. {
  1611. subNode.selectSingleNode("itemattrval").text = "axflag:Y;";
  1612. }
  1613. }
  1614. }
  1615. var subcntXrow = getNodesetCnt(model, g_pageInfo.formdegnRef + "[degnitemkind='GSU' and supdegnitemno='" + degnitemno + "' and itemattrval='axflag:X;']");
  1616. var subcntYrow = getNodesetCnt(model, g_pageInfo.formdegnRef + "[degnitemkind='GSU' and supdegnitemno='" + degnitemno + "' and itemattrval='axflag:Y;']");
  1617. var subXList = model.instances(0).selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='GSU' and supdegnitemno='" + degnitemno + "' and itemattrval='axflag:X;']");
  1618. var subYList = model.instances(0).selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='GSU' and supdegnitemno='" + degnitemno + "' and itemattrval='axflag:Y;']");
  1619. var colWidths = getStyleValue(degnattrval, "colwidth", "ctrl").split("^");
  1620. var colHeights = getStyleValue(degnattrval, "rowheight", "ctrl").split("^");
  1621. var colcaption = getStyleValue(degnattrval, "caption", "ctrl");
  1622. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1623. // 1. X축 컬럼을 만듬.
  1624. // ※컬럼 Style을 만듬.
  1625. sTdStyle = "style=\"";
  1626. if(colWidths.length > 0)
  1627. sTdStyle += "width:"+ colWidths[0] +"px; ";
  1628. else
  1629. sTdStyle += "width:"+ colWidths[0] +"px; ";
  1630. //if(colHeights.length == subcntrow)
  1631. if(colHeights.length > 0)
  1632. sTdStyle += "height:"+ colHeights[0] +"px; ";
  1633. else
  1634. sTdStyle += "height:"+ grdcolheight +"px; ";
  1635. //sTdStyle += "\"";
  1636. sTdStyle = sTdStyle + TdFontStyle + "\"";
  1637. StyleArr[0] = sTdStyle;
  1638. //sXSLTInfo += "\t\t\t\t\t<tr bgColor=\"#BBDBFF\">\n"; // css 그리드 배경색 적용 시
  1639. sXSLTInfo += "\t\t\t\t\t<tr bgColor=\"#e0e0e0\">\n";
  1640. if(colcaption != "")
  1641. sXSLTInfo += "\t\t\t\t\t\t<td "+sTdStyle+" align=\"center\"><![CDATA[" + colcaption + "]]></td> \n";
  1642. else
  1643. sXSLTInfo += "\t\t\t\t\t\t<td "+sTdStyle+" align=\"center\"><![CDATA[※]]></td> \n";
  1644. var rowidx = 0;
  1645. // 테이블의 컬럼을 먼저 표현
  1646. for(var j = 1; j <= subcntXrow; j++)
  1647. {
  1648. var label = subXList.item(j-1).selectSingleNode("degnitemnm").text;
  1649. sTdStyle = "style=\"";
  1650. if(colWidths[j] == "")
  1651. sTdStyle += "width:"+ fGetLblWidth(degnitemno, label) +"px; ";
  1652. else
  1653. sTdStyle += "width:"+ colWidths[j] +"px; ";
  1654. if(colHeights[j] != null)
  1655. sTdStyle += "height:"+ colHeights[j] +"px; ";
  1656. else
  1657. sTdStyle += "height:"+ grdcolheight +"px; ";
  1658. //sTdStyle += "\"";
  1659. sTdStyle = sTdStyle + TdFontStyle + "\"";
  1660. StyleArr[j] = sTdStyle;
  1661. sXSLTInfo += "\t\t\t\t\t\t<td "+ StyleArr[j] +" align=\"center\"><![CDATA["+label+"]]></td> \n";
  1662. }
  1663. sXSLTInfo += "\t\t\t\t\t</tr> \n";
  1664. /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1665. // 2. Y축 컬럼을 만듬.
  1666. var colidx = "";
  1667. for(var row = 0; row < subcntYrow; row++)
  1668. {
  1669. var Ylabel = subYList.item(row).selectSingleNode("degnitemnm").text;
  1670. colidx = degnitemlevlcdArr[row];
  1671. sXSLTInfo += "\t\t\t\t\t<tr>\n";
  1672. for(var col = 0; col < colidx.length; col++)
  1673. {
  1674. if(col == 0)
  1675. {
  1676. Ylabel = GetDegnitemnmTrans(Ylabel);
  1677. sXSLTInfo += "\t\t\t\t\t\t<td "+StyleArr[col] + " bgColor=\"#e0e0e0\" align=\"center\">"+Ylabel+"</td>\n";
  1678. /*
  1679. var temp = fGetLblWidth(degnitemno, Ylabel);
  1680. if(parseInt(colWidths[0]) < parseInt(temp))
  1681. {
  1682. }
  1683. if(Ylabel != "")
  1684. {
  1685. lblWidth = fGetLblWidth(degnitemno, subdegnitemnm);
  1686. if(isSearchString(Ylabel, " ") == true)
  1687. {
  1688. Ylabel = GetDegnitemnmTrans(Ylabel);
  1689. }
  1690. }
  1691. sXSLTInfo += "\t\t\t\t\t\t<td "+StyleArr[col] + " bgColor=\"#e0e0e0\" align=\"center\">"+Ylabel+"</td>\n";
  1692. */
  1693. //sXSLTInfo += "\t\t\t\t\t\t<td "+StyleArr[col] +" bgColor=\"#e0e0e0\" align=\"center\"><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + colidx[col] + "' and rowno='" + row + "' and colno='" + col + "']/degnitemnm\"/></td>\n";
  1694. //sXSLTInfo += "\t\t\t\t\t\t<td "+StyleArr[col] + " bgColor=\"#e0e0e0\" align=\"center\"><![CDATA["+Ylabel+"]]></td>\n";
  1695. }
  1696. else
  1697. {
  1698. sXSLTInfo += "\t\t\t\t\t\t<td "+StyleArr[col] +"><pre><xsl:value-of select=\"normalize-space(" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + colidx[col] + "' and rowno='" + row + "' and colno='" + col + "']/reccnts)\"/></pre></td>\n";
  1699. }
  1700. }
  1701. sXSLTInfo += "\t\t\t\t\t</tr>\n";
  1702. }
  1703. }
  1704. sXSLTInfo += "\t\t\t\t</table>\n ";
  1705. sXSLTInfo += "\t\t\t\t</div>\n ";
  1706. var Grdmode = "GRD:" + gridtype;
  1707. fMakeXSLTMatchTemplate(Grdmode, degnitemlevlcdArr, degnitemcd, StyleArr);
  1708. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  1709. if(ctrlPosition.height > sDivHeight)
  1710. sDivHeight = y + ctrlPosition.height;
  1711. g_pageInfo.curxpos += parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  1712. return ctrlPosition;
  1713. }
  1714. /**
  1715. * @desc : 멀티 checkbox, radio 버튼 생성
  1716. * @
  1717. * @param :
  1718. * @return :
  1719. *@history:
  1720. 2008-10-21 인쇄시 체크박스 및 라디오버튼이 비활성화된 상태이기 때문에 인쇄가 흐릿하여 비활성화를 삭제함.
  1721. * @---------------------------------------------------
  1722. */
  1723. function fDrawHTMLSel(x, y, row)
  1724. {
  1725. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1726. // Degnitemno => Degnitemlevlcd 로 변경
  1727. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  1728. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  1729. var degnitemkind = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemkind");
  1730. var elementName = "";
  1731. var ref = "";
  1732. if(degnitemkind == "MSL") // checkbox
  1733. {
  1734. elementName = "type=\"checkbox\"";
  1735. ref = g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "' and colno = '#colno#']/rectermcd";
  1736. }
  1737. else if(degnitemkind == "SSL") //radio
  1738. {
  1739. elementName = "type=\"radio\"";
  1740. ref = g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "']/rectermcd";
  1741. }
  1742. else
  1743. return;
  1744. var cellspacing = 15;
  1745. var lblWidth = 0;
  1746. var subcnt = getNodesetCnt(model, g_pageInfo.formdegnRef + "[degnitemkind='SSU' and supdegnitemno='" + degnitemno + "']");
  1747. var sStyle = "";
  1748. for(var j = 0; j < subcnt; j++)
  1749. {
  1750. var cvrtRef = ref.setReplaceWord("#colno#", j);
  1751. var subtermcd = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='SSU' and supdegnitemno='" + degnitemno + "']/termcd").item(j).text;
  1752. var subdegnitemno = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='SSU' and supdegnitemno='" + degnitemno + "']/degnitemno").item(j).text;
  1753. var subdegnitemkind = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='SSU' and supdegnitemno='" + degnitemno + "']/degnitemkind").item(j).text;
  1754. var subdegnitemnm = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='SSU' and supdegnitemno='" + degnitemno + "']/degnitemnm").item(j).text;
  1755. var subitemattrval = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='SSU' and supdegnitemno='" + degnitemno + "']/itemattrval").item(j).text;
  1756. var subdegnattrval = instance1.selectNodes(g_pageInfo.formdegnRef + "[degnitemkind='SSU' and supdegnitemno='" + degnitemno + "']/degnattrval").item(j).text;
  1757. lblWidth = fGetLblWidth(degnitemno, subdegnitemnm);
  1758. var ctrlid = subdegnitemkind + "_" + subdegnitemno;
  1759. var ctrlPosition = new Position(x, y, 100, 20);
  1760. /*
  1761. var sComStyle = getNewXSLTStyleVal(ctrlid, ctrlPosition, subdegnattrval, degnitemkind);
  1762. ctrlPosition.width = lblWidth;
  1763. sStyle = sComStyle+"top:"+ctrlPosition.y+"px; left:"+ctrlPosition.x+"px;\"";
  1764. */
  1765. //var sComStyle = getSelXSLTStyleVal(ctrlid, ctrlPosition, subdegnattrval, degnitemkind);
  1766. var sTmpStyle = "style=\"position:absolute; ";
  1767. var sStyle = "";
  1768. var ssuLeft = "";
  1769. var ssuTop = "";
  1770. var ssuWidth = "";
  1771. var ssuHeight = "";
  1772. /*
  1773. var FontStyle = "";
  1774. if(document.controls(ctrlid) != null)
  1775. {
  1776. // FontName
  1777. var fontfamilyArr = document.controls(ctrlid).attribute("font-family").split(",");
  1778. if(fontfamilyArr.length > 0)
  1779. {
  1780. FontStyle += getXSLTCtrlAttribute("font-family", fontfamilyArr[0]);
  1781. }
  1782. else
  1783. FontStyle += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  1784. // FontSize
  1785. var fontSize = document.controls(ctrlid).attribute("font-size");
  1786. if(fontSize != "")
  1787. FontStyle += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  1788. else
  1789. FontStyle += getXSLTCtrlAttribute("font-size", "9");
  1790. FontStyle += getXSLTCtrlAttribute("font-weight", document.controls(ctrlid).attribute("font-weight"));
  1791. FontStyle += getXSLTCtrlAttribute("font-style", document.controls(ctrlid).attribute("font-style"));
  1792. FontStyle += getXSLTCtrlAttribute("text-decoration", document.controls(ctrlid).attribute("text-decoration"));
  1793. var fontColor = document.controls(ctrlid).attribute("color");
  1794. if(fontColor != "")
  1795. {
  1796. if(fontColor.charAt(0) != "#")
  1797. FontStyle += getXSLTCtrlAttribute("color", "#" + fontColor);
  1798. else
  1799. FontStyle += getXSLTCtrlAttribute("color", fontColor);
  1800. }
  1801. }
  1802. else
  1803. {
  1804. FontStyle += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  1805. var fontSize = getStyleValue(degnattrval, "font-size", sCtrlType);
  1806. if(fontSize != "")
  1807. FontStyle += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  1808. else
  1809. FontStyle += getXSLTCtrlAttribute("font-size", "9");
  1810. FontStyle += getXSLTCtrlAttribute("font-weight", getStyleValue(degnattrval, "font-weight", sCtrlType));
  1811. FontStyle += getXSLTCtrlAttribute("font-style", getStyleValue(degnattrval, "font-style", sCtrlType));
  1812. FontStyle += getXSLTCtrlAttribute("text-decoration", getStyleValue(degnattrval, "text-decoration", sCtrlType));
  1813. FontStyle += getXSLTCtrlAttribute("color", getStyleValue(degnattrval, "color", sCtrlType));
  1814. }
  1815. // position
  1816. if(document.controls(ctrlid) != null)
  1817. {
  1818. ssuLeft = document.controls(ctrlid).attribute("left");
  1819. }
  1820. else
  1821. ssuLeft = getStyleValue(degnattrval, "left", sCtrlType);
  1822. if(ssuLeft == "") sLeft = pCtrlPosition.x;
  1823. else{
  1824. ssuLeft = parseInt(ssuLeft);
  1825. }
  1826. if(document.controls(ctrlid) != null)
  1827. {
  1828. ssuTop = document.controls(ctrlid).attribute("top");
  1829. }
  1830. else
  1831. ssuTop= getStyleValue(degnattrval, "top", sCtrlType);
  1832. if(ssuTop=="")
  1833. ssuTop = pCtrlPosition.y;
  1834. else{
  1835. ssuTop = parseInt(ssuTop);
  1836. }
  1837. if(document.controls(ctrlid) != null)
  1838. {
  1839. ssuWidth = document.controls(ctrlid).attribute("width");
  1840. }
  1841. else
  1842. ssuWidth= getStyleValue(degnattrval, "width", sCtrlType);
  1843. if(ssuWidth=="")
  1844. ssuWidth = pCtrlPosition.width;
  1845. else{
  1846. ssuWidth = parseInt(ssuWidth);
  1847. }
  1848. if(document.controls(ctrlid) != null)
  1849. {
  1850. ssuHeight = document.controls(ctrlid).attribute("height");
  1851. }
  1852. else
  1853. ssuHeight= getStyleValue(degnattrval, "height", sCtrlType);
  1854. if(ssuHeight=="")
  1855. ssuHeight = pCtrlPosition.height;
  1856. else{
  1857. ssuHeight = parseInt(ssuHeight);
  1858. }
  1859. sStyle = sTmpStyle + FontStyle + "left:" + ssuLeft + "px; top:" + ssuTop + "px; width:" + ssuWidth + "px; height:" + ssuHeight + "px; \"";
  1860. */
  1861. var sStyleArr = new Array(2);
  1862. sStyleArr = getSelSSUXSLTStyleVal(ctrlid, ctrlPosition, subdegnattrval, degnitemkind);
  1863. ctrlPosition.width = lblWidth;
  1864. sXSLTInfo += "\t\t\t\t\t<xsl:choose>\n";
  1865. sXSLTInfo += "\t\t\t\t\t\t<xsl:when test=\""+cvrtRef+" = '"+subtermcd+"'\"> \n";
  1866. // 체크박스 및 라디오버튼 비활성화 삭제
  1867. //sXSLTInfo += "\t\t\t\t\t\t<input "+elementName+" id=\""+ctrlid+"\" "+ sStyle +" value=\""+subtermcd+ "\" checked = \"true\" /> \n";
  1868. sXSLTInfo += "\t\t\t\t\t\t<input "+elementName+" id=\""+ctrlid+"\" "+ sStyleArr[0] +" value=\""+subtermcd+ "\" checked = \"true\" /> \n";
  1869. sXSLTInfo += "\t\t\t\t\t\t</xsl:when>\n";
  1870. sXSLTInfo += "\t\t\t\t\t\t<xsl:otherwise>\n";
  1871. //sXSLTInfo += "\t\t\t\t\t\t<input "+elementName+" id=\""+ctrlid+"\" "+ sStyle +" value=\""+subtermcd+ "\" /> \n";
  1872. sXSLTInfo += "\t\t\t\t\t\t<input "+elementName+" id=\""+ctrlid+"\" "+ sStyleArr[0] +" value=\""+subtermcd+ "\" /> \n";
  1873. sXSLTInfo += "\t\t\t\t\t\t</xsl:otherwise>\n";
  1874. sXSLTInfo += "\t\t\t\t\t</xsl:choose>\n";
  1875. ctrlPosition.x += 20;
  1876. //sStyle = sComStyle+"top:"+ctrlPosition.y+"px; left:"+ctrlPosition.x+"px;\"";
  1877. //sStyle = sTmpStyle + FontStyle + "left:" + (parseInt(ssuLeft)+20) + "px; top:" + ssuTop + "px; width:" + ssuWidth + "px; height:" + ssuHeight + "px; \"";
  1878. //sXSLTInfo += "\t\t\t\t<pre "+sStyle+"><![CDATA["+subdegnitemnm+"]]></pre> \n";
  1879. sXSLTInfo += "\t\t\t\t<pre id=\""+ctrlid+"\" "+sStyleArr[1]+"><![CDATA["+subdegnitemnm+"]]></pre> \n";
  1880. x = parseInt(ctrlPosition.x) + parseInt(ctrlPosition.width) + cellspacing;
  1881. if(getStyleValue(subitemattrval, "extn") == "visible")
  1882. {
  1883. ctrlPosition.x = parseInt(ctrlPosition.x) + parseInt(ctrlPosition.width) + g_pageInfo.offsetx;
  1884. var ctrlPosition = fDrawHTMLStx(ctrlPosition.x, ctrlPosition.y, 100, ctrlPosition.height, row + j + 1, "extn");
  1885. x = parseInt(ctrlPosition.x) + parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  1886. }
  1887. }
  1888. return ctrlPosition;
  1889. }
  1890. /**
  1891. * @desc : <xsl:if> -> <csl:choose> 로 변경
  1892. * @
  1893. * @param :
  1894. * @return :
  1895. * @history : 2008-11-07 이경희 => xpath 비교 조건을 기존의 rectermnm 에서 rectermcd 로 변경, disabled=true 삭제
  1896. * @---------------------------------------------------
  1897. */
  1898. function fDrawHTMLBool(x, y, row)
  1899. {
  1900. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  1901. // Degnitemno => Degnitemlevlcd 로 변경
  1902. var degnitemno = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemno");
  1903. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  1904. var degnitemnm = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemnm");
  1905. var degnitemcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemcd");
  1906. var termcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/termcd");
  1907. var itemattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/itemattrval");
  1908. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  1909. var ctrlPosition = new Position(x, y, 0, parseInt(sDivHeight));
  1910. ctrlPosition.width += fGetLblWidth(degnitemno, degnitemnm);
  1911. if(ctrlPosition.width < 120)
  1912. ctrlPosition.width = 120;
  1913. var ctrlid = "BOL_" + degnitemno;
  1914. //var sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "BOL");
  1915. //sStyle += "top:"+ctrlPosition.y+"px; left:"+ctrlPosition.x+"px; \"";
  1916. var sStyle = getSelXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "BOL");
  1917. sXSLTInfo += "\t\t\t\t<xsl:choose>\n";
  1918. sXSLTInfo += "\t\t\t\t\t<xsl:when test=\""+ g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcd + "']/rectermcd = '"+termcd+"'\"> \n";
  1919. sXSLTInfo += "\t\t\t\t\t\t<input type=\"checkbox\" id=\""+ctrlid+"\" "+sStyle+" value=\""+termcd+ "\" checked = \"true\" /> \n";
  1920. sXSLTInfo += "\t\t\t\t\t</xsl:when> \n";
  1921. sXSLTInfo += "\t\t\t\t\t<xsl:otherwise> \n";
  1922. sXSLTInfo += "\t\t\t\t\t\t<input type=\"checkbox\" id=\""+ctrlid+"\" "+sStyle+" value=\""+termcd+ "\" checked = \"false\"/> \n";
  1923. sXSLTInfo += "\t\t\t\t\t</xsl:otherwise> \n";
  1924. sXSLTInfo += "\t\t\t\t</xsl:choose>\n";
  1925. ctrlPosition.x += 20;
  1926. sXSLTInfo += "\t\t\t\t<pre style=\"position:absolute; top:"+ ctrlPosition.y +"px; left:"+ ctrlPosition.x +"px; \"><![CDATA["+degnitemnm+"]]></pre> \n";
  1927. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  1928. if(ctrlPosition.height > sDivHeight)
  1929. sDivHeight = ctrlPosition.height;
  1930. g_pageInfo.curxpos += parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  1931. if(getStyleValue(itemattrval, "extn") == "visible")
  1932. {
  1933. var subleft = ctrlPosition.x + parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  1934. var top = ctrlPosition.height - 20;
  1935. if(top < 0)
  1936. top = 0;
  1937. fDrawHTMLStx(subleft, top, 100, 20, row, "extn");
  1938. }
  1939. return ctrlPosition;
  1940. }
  1941. /**
  1942. * @desc : 그리드의 컬럼명을 배열로 저장하여 반환한다.
  1943. * @
  1944. * @param :
  1945. * @return :
  1946. * @---------------------------------------------------
  1947. */
  1948. function getDegnitemlevlcd(grdtype, degnitemlevlcd)
  1949. {
  1950. // degnitemlevlcd 를 저장해둔다.
  1951. var degnitemlevlcdArr = new Array();
  1952. // 그리드구조이므로 해당 컬럼의 degnitemlevelcd를 얻어오는 작업
  1953. var GridNodeList = findNodeset(model, g_pageInfo.RecinfoGridRef + "[degnitemlevlcd = '" + degnitemlevlcd + "']");
  1954. if(GridNodeList.length == 0)
  1955. GridNodeList = findNodeset(model, g_pageInfo.initRecinfoGridRef + "[degnitemlevlcd = '" + degnitemlevlcd + "']");
  1956. if(GridNodeList.length > 0)
  1957. {
  1958. if(grdtype == "Y" || grdtype == "G") //Y축 누적
  1959. {
  1960. var subgrdNode = GridNodeList.item(0);
  1961. var recitemNodeList = subgrdNode.selectNodes("recitem");
  1962. for(var idx = 0; idx < recitemNodeList.length; idx++)
  1963. {
  1964. var subrecitemNode = recitemNodeList.item(idx);
  1965. degnitemlevlcdArr[idx] = subrecitemNode.selectSingleNode("degnitemlevlcd").text;
  1966. }
  1967. }
  1968. else if(grdtype == "X") //X축 누적
  1969. {
  1970. for(var row = 0; row < GridNodeList.length; row++)
  1971. {
  1972. var subgrdNode = GridNodeList.item(row);
  1973. var recitemNodeList = subgrdNode.selectNodes("recitem");
  1974. degnitemlevlcdArr[row] = new Array(recitemNodeList.length);
  1975. for(var col = 0; col < recitemNodeList.length; col++)
  1976. {
  1977. var subrecitemNode = recitemNodeList.item(col);
  1978. degnitemlevlcdArr[row][col] = subrecitemNode.selectSingleNode("degnitemlevlcd").text;
  1979. }
  1980. }
  1981. }
  1982. else if(grdtype == "T") //테이블
  1983. {
  1984. for(var row = 0; row < GridNodeList.length; row++)
  1985. {
  1986. var subgrdNode = GridNodeList.item(row);
  1987. var recitemNodeList = subgrdNode.selectNodes("recitem");
  1988. degnitemlevlcdArr[row] = new Array(recitemNodeList.length-1);
  1989. for(var col = 0; col < recitemNodeList.length-1; col++)
  1990. {
  1991. var subrecitemNode = recitemNodeList.item(col+1);
  1992. degnitemlevlcdArr[row][col] = subrecitemNode.selectSingleNode("degnitemlevlcd").text;
  1993. }
  1994. }
  1995. }
  1996. else if(grdtype == "CCN" || grdtype == "DIAG" || grdtype == "OPN")
  1997. {
  1998. var subgrdNode = GridNodeList.item(0);
  1999. var recitemNodeList = subgrdNode.selectNodes("recitem");
  2000. for(var idx = 0; idx < recitemNodeList.length; idx++)
  2001. {
  2002. var subrecitemNode = recitemNodeList.item(idx);
  2003. degnitemlevlcdArr[idx] = subrecitemNode.selectSingleNode("degnitemlevlcd").text;
  2004. }
  2005. }
  2006. }
  2007. return degnitemlevlcdArr;
  2008. }
  2009. /**
  2010. * @desc : 그리드의 컬럼명을 배열로 저장하여 반환한다.
  2011. * @
  2012. * @param :
  2013. * @return :
  2014. * @---------------------------------------------------
  2015. */
  2016. function getDegnitemcd(grdtype, degnitemlevlcd)
  2017. {
  2018. // degnitemlevlcd 를 저장해둔다.
  2019. var degnitemcd = "";
  2020. // 그리드구조이므로 해당 컬럼의 degnitemlevelcd를 얻어오는 작업
  2021. var GridNodeList = findNodeset(model, g_pageInfo.RecinfoGridRef + "[degnitemlevlcd = '" + degnitemlevlcd + "']");
  2022. if(GridNodeList.length == 0)
  2023. GridNodeList = findNodeset(model, g_pageInfo.initRecinfoGridRef + "[degnitemlevlcd = '" + degnitemlevlcd + "']");
  2024. if(GridNodeList.length > 0)
  2025. {
  2026. if(grdtype == "Y" || grdtype == "G") //Y축 누적
  2027. {
  2028. var subgrdNode = GridNodeList.item(0);
  2029. var recitemNodeList = subgrdNode.selectNodes("recitem");
  2030. for(var idx = 0; idx < recitemNodeList.length; idx++)
  2031. {
  2032. var subrecitemNode = recitemNodeList.item(idx);
  2033. var rowno = subrecitemNode.selectSingleNode("rowno").text;
  2034. var colno = subrecitemNode.selectSingleNode("colno").text;
  2035. var degnitemkind = subrecitemNode.selectSingleNode("degnitemkind").text;
  2036. if(rowno == 0 && colno == 0)
  2037. {
  2038. degnitemcd = subrecitemNode.selectSingleNode("degnitemcd").text;
  2039. break;
  2040. }
  2041. }
  2042. }
  2043. else if(grdtype == "X") //X축 누적
  2044. {
  2045. for(var row = 0; row < GridNodeList.length; row++)
  2046. {
  2047. var subgrdNode = GridNodeList.item(row);
  2048. var recitemNodeList = subgrdNode.selectNodes("recitem");
  2049. degnitemlevlcdArr[row] = new Array(recitemNodeList.length);
  2050. for(var col = 0; col < recitemNodeList.length; col++)
  2051. {
  2052. var subrecitemNode = recitemNodeList.item(col);
  2053. degnitemlevlcdArr[row][col] = subrecitemNode.selectSingleNode("degnitemlevlcd").text;
  2054. }
  2055. }
  2056. }
  2057. else if(grdtype == "T") //테이블
  2058. {
  2059. for(var row = 0; row < GridNodeList.length; row++)
  2060. {
  2061. var subgrdNode = GridNodeList.item(row);
  2062. var recitemNodeList = subgrdNode.selectNodes("recitem");
  2063. degnitemlevlcdArr[row] = new Array(recitemNodeList.length-1);
  2064. for(var col = 0; col < recitemNodeList.length-1; col++)
  2065. {
  2066. var subrecitemNode = recitemNodeList.item(col+1);
  2067. degnitemlevlcdArr[row][col] = subrecitemNode.selectSingleNode("degnitemlevlcd").text;
  2068. }
  2069. }
  2070. }
  2071. else if(grdtype == "CCN" || grdtype == "DIAG" || grdtype == "OPN")
  2072. {
  2073. var subgrdNode = GridNodeList.item(0);
  2074. var recitemNodeList = subgrdNode.selectNodes("recitem");
  2075. for(var idx = 0; idx < recitemNodeList.length; idx++)
  2076. {
  2077. var subrecitemNode = recitemNodeList.item(idx);
  2078. degnitemcd = subrecitemNode.selectSingleNode("degnitemlevlcd").text;
  2079. }
  2080. }
  2081. }
  2082. return degnitemcd;
  2083. }
  2084. /**
  2085. * @desc : 진단명 XSLT 생성
  2086. * @
  2087. * @param :
  2088. * @return :
  2089. * @history : 2008-07-25 배경색이 검정색으로 되어 있어 글자가 보이지 않아 삭제.
  2090. 2008-10-23 진단명에서 진단코드 컬럼 삭제
  2091. * @---------------------------------------------------
  2092. */
  2093. function fDrawXSLTDiagName(x, y, row)
  2094. {
  2095. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  2096. if(width != "")
  2097. width = parseInt(width);
  2098. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  2099. if(height != "")
  2100. height = parseInt(height);
  2101. if(width == "")
  2102. width = 500;
  2103. if(height == "")
  2104. height = 300;
  2105. // var ctrlSize = new SIZE(width, height);
  2106. var ctrlPosition = new Position(x, y, width, height);
  2107. var degnitemno = model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemno");
  2108. var degnitemkind = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemkind");
  2109. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  2110. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  2111. var degnitemcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemcd");
  2112. var degnitemlevlcdArr = getDegnitemlevlcd("DIAG", degnitemlevlcd);
  2113. var type = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/itemattrval"), "type");
  2114. var ctrlid = "DGN_" + degnitemno;
  2115. if(type != "btn")
  2116. {
  2117. var grdcaption = new Array("R/O","주","진단명", "Comments");
  2118. //var grdcolwidth = new Array(30,30,360,150);
  2119. var grdcolwidth = new Array(30,30,400,180);
  2120. var grdcolheight = g_Base_GrdColHeight;
  2121. var colWidths = getStyleValue(degnattrval, "colwidth", "ctrl").split("^");
  2122. var colHeights = getStyleValue(degnattrval, "rowheight", "ctrl").split("^");
  2123. /*
  2124. var tmpHeight = getStyleValue(degnattrval, "rowheight", "ctrl");
  2125. if(tmpHeight == "")
  2126. {
  2127. for(var pos=0; pos < grdcaption.length; pos++)
  2128. {
  2129. colHeights[pos] = "23";
  2130. }
  2131. }
  2132. */
  2133. var sTdStyle = "";
  2134. //var sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  2135. var sStyle = getNewXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  2136. var tmpWidth = getStyleValue(degnattrval, "ctrl.width");
  2137. var tmpHeight = getStyleValue(degnattrval, "ctrl.height");
  2138. sXSLTInfo += "\t\t\t\t<div id=\"C_"+ctrlid+"\" style=\"position:absolute; left:0px; top:0px; width:" + tmpWidth + "px; height:" + tmpHeight + "px; \">\n";
  2139. //sXSLTInfo += "\t\t\t\t<div id=\"C_"+ctrlid+"\" style=\"position:absolute; left:0px; top:0px; \">\n";
  2140. // Table 에 Style 정보를 추가
  2141. sXSLTInfo += "\t\t\t\t<table id=\""+ctrlid+"\" "+sStyle+" border=\"1\" frame=\"box\" bordercolor=\"silver\" cellspacing=\"0\">\n";
  2142. //sXSLTInfo += "\t\t\t\t<table id=\""+ctrlid+"\" border=\"1\" frame=\"box\" bordercolor=\"silver\" cellspacing=\"0\">\n";
  2143. sXSLTInfo += "\t\t\t\t\t<tr bgColor=\"#e0e0e0\">\n";
  2144. var StyleArr = new Array();
  2145. var TdFontStyle = getTableXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  2146. for(var j=0; j<grdcaption.length; j++){
  2147. sTdStyle = "style=\"";
  2148. if(colWidths.length == grdcaption.length)
  2149. sTdStyle += "width:"+ colWidths[j] +"px; ";
  2150. else
  2151. sTdStyle += "width:"+ grdcolwidth[j] +"px; ";
  2152. if(colHeights.length == grdcaption.length)
  2153. sTdStyle += "height:"+ colHeights[j] +"px; ";
  2154. else
  2155. sTdStyle += "height:"+ grdcolheight +"px; ";
  2156. sTdStyle = sTdStyle + TdFontStyle + "\"";
  2157. StyleArr[j] = sTdStyle;
  2158. sXSLTInfo += "\t\t\t\t\t\t<td "+ sTdStyle +" align=\"center\"><![CDATA["+grdcaption[j]+"]]></td>\n";
  2159. }
  2160. sXSLTInfo += "\t\t\t\t\t</tr>\n";
  2161. sXSLTInfo += "\t\t\t\t\t<xsl:apply-templates select=\"" +g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[3] + "']\"/>\n";
  2162. //sXSLTInfo += "\t\t\t\t\t<xsl:apply-templates select=\"" +g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "']\"/>\n";
  2163. sXSLTInfo += "\t\t\t\t</table>\n";
  2164. sXSLTInfo += "\t\t\t\t</div>\n";
  2165. }
  2166. fMakeXSLTMatchTemplate("DIAG", degnitemlevlcdArr, degnitemcd, StyleArr);
  2167. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  2168. if(ctrlPosition.height > sDivHeight)
  2169. sDivHeight = ctrlPosition.height;
  2170. g_pageInfo.curxpos += parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  2171. return ctrlPosition;
  2172. }
  2173. /**
  2174. * @group :
  2175. * @ver : 2008.07.24
  2176. * @by : 이경희
  2177. * @modify:
  2178. * @---------------------------------------------------
  2179. * @type : function
  2180. * @access : public
  2181. * @desc : mode에 따라 match template를 생성한다.
  2182. * @param : mode (GRD: 그리드, DIAG: 진단명, CCN: 주호소, OPN: 수술명)
  2183. * @param : degnitemlevlcdArr (degnitemlevlcd의 배열)
  2184. * @return :
  2185. * @---------------------------------------------------
  2186. */
  2187. function fMakeXSLTMatchTemplate(mode, degnitemlevlcdArr, degnitemcd, StyleArr)
  2188. {
  2189. var grdMode = mode.split(":")[0];
  2190. var grdType = mode.split(":")[1];
  2191. for(var idx = 0; idx < g_MatchTemplate.length; idx++)
  2192. {
  2193. var strTemplate = g_MatchTemplate[idx];
  2194. if(strTemplate == "")
  2195. break;
  2196. }
  2197. switch(grdMode)
  2198. {
  2199. case "GRD":
  2200. g_MatchTemplate[idx] = fMakeGridTemplate(grdType, degnitemlevlcdArr, degnitemcd, StyleArr);
  2201. break;
  2202. case "DIAG":
  2203. g_MatchTemplate[idx] = fMakeDiagTemplate(degnitemlevlcdArr, StyleArr);
  2204. break;
  2205. case "CCN":
  2206. g_MatchTemplate[idx] = fMakeCCNTemplate(degnitemlevlcdArr, StyleArr);
  2207. break;
  2208. case "OPN":
  2209. g_MatchTemplate[idx] = fMakeOPNTemplate(degnitemlevlcdArr, StyleArr);
  2210. break;
  2211. }
  2212. }
  2213. function fMakeGridTemplate(gridtype, degnitemlevlcdArr, degnitemcd, StyleArr)
  2214. {
  2215. g_pageInfo = new PAGEINFO();
  2216. var TemplateInfo = "";
  2217. if(gridtype == "Y") //Y축 누적
  2218. {
  2219. TemplateInfo += "\n<xsl:template match=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and degnitemcd = '" + degnitemcd + "']\">\n";
  2220. TemplateInfo += "\t<xsl:variable name=\"rowno\" select=\"rowno\"/>\n";
  2221. TemplateInfo += "\t<tr>\n";
  2222. for(var idx = 1; idx < degnitemlevlcdArr.length; idx++)
  2223. {
  2224. TemplateInfo += "\t\t<td " + StyleArr[idx-1] + "><pre><xsl:value-of select=\"normalize-space(" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[idx] + "' and rowno=$rowno and colno='" + (idx-1) + "']/reccnts)\"/></pre></td>\n";
  2225. //TemplateInfo += "\t\t<td " + StyleArr[idx-1] + "><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[idx] + "' and rowno=$rowno and colno='" + (idx-1) + "']/reccnts\"/></pre></td>\n";
  2226. //TemplateInfo += "\t\t<td><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[idx] + "' and rowno=$rowno and colno='" + (idx-1) + "']/reccnts\"/></pre></td>\n";
  2227. }
  2228. TemplateInfo += "\t</tr>\n";
  2229. TemplateInfo += "</xsl:template>\n";
  2230. }
  2231. else if(gridtype == "G") //G축 누적
  2232. {
  2233. TemplateInfo += "\n<xsl:template match=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "']\">\n";
  2234. TemplateInfo += "\t<xsl:variable name=\"rowno\" select=\"rowno\"/>\n";
  2235. TemplateInfo += "\t<tr>\n";
  2236. for(var idx = 1; idx < degnitemlevlcdArr.length; idx++)
  2237. {
  2238. TemplateInfo += "\t\t<td " + StyleArr[idx-1] + "><pre><xsl:value-of select=\"normalize-space(" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[idx] + "' and rowno=$rowno and colno='" + (idx-1) + "']/reccnts)\"/></pre></td>\n";
  2239. //TemplateInfo += "\t\t<td " + StyleArr[idx-1] + "><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[idx] + "' and rowno=$rowno and colno='" + (idx-1) + "']/reccnts\"/></pre></td>\n";
  2240. //TemplateInfo += "\t\t<td><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[idx] + "' and rowno=$rowno and colno='" + (idx-1) + "']/reccnts\"/></pre></td>\n";
  2241. }
  2242. TemplateInfo += "\t</tr>\n";
  2243. TemplateInfo += "</xsl:template>\n";
  2244. }
  2245. return TemplateInfo;
  2246. }
  2247. /**
  2248. * @group :
  2249. * @ver : 2008.07.24
  2250. * @by : 이경희
  2251. * @modify:
  2252. * @---------------------------------------------------
  2253. * @type : function
  2254. * @access : public
  2255. * @desc : 진단명의 match template를 생성하여 반환한다.
  2256. * @param :
  2257. * @param :
  2258. * @return :
  2259. * @---------------------------------------------------
  2260. */
  2261. function fMakeDiagTemplate(degnitemlevlcdArr, StyleArr)
  2262. {
  2263. g_pageInfo = new PAGEINFO();
  2264. var TemplateInfo = "";
  2265. // CheckBox에 Pre 태그 없는 버전
  2266. // 첫번째 loop는 주진단, 두번째 loop는 R/O
  2267. //for(var idx=0; idx < 2; idx++)
  2268. //{
  2269. TemplateInfo += "\n<xsl:template match=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[3] + "']\">\n";
  2270. TemplateInfo += "\t<xsl:variable name=\"rowno\" select=\"rowno\"/>\n";
  2271. TemplateInfo += "\t<tr>\n";
  2272. // R/O
  2273. TemplateInfo += "\t\t<td "+ StyleArr[0] + ">\n";
  2274. /*
  2275. TemplateInfo += "\t\t\t<xsl:if test=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] +"' and rowno=$rowno and colno='0']/reccnts = 'R'\">\n";
  2276. TemplateInfo += "\t\t\t\t<input type=\"checkbox\" name=\"RO\" checked=\"true\"/></xsl:if>\n";
  2277. TemplateInfo += "\t\t\t<xsl:if test=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] +"' and rowno=$rowno and colno='0']/reccnts != 'R'\">\n";
  2278. TemplateInfo += "\t\t\t\t<input type=\"checkbox\" name=\"RO\"/></xsl:if>\n";
  2279. */
  2280. TemplateInfo += "\t\t\t<xsl:choose>\n";
  2281. TemplateInfo += "\t\t\t\t<xsl:when test=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] +"' and rowno=$rowno and colno='0']/reccnts[(.=\'R')] \">\n";
  2282. TemplateInfo += "\t\t\t\t\t<input type=\"checkbox\" name=\"RO\" checked=\"true\"/>\n";
  2283. TemplateInfo += "\t\t\t\t</xsl:when>\n";
  2284. TemplateInfo += "\t\t\t\t<xsl:otherwise>\n";
  2285. TemplateInfo += "\t\t\t\t\t<input type=\"checkbox\" name=\"RO\"/>\n";
  2286. TemplateInfo += "\t\t\t\t</xsl:otherwise>\n";
  2287. TemplateInfo += "\t\t\t</xsl:choose>\n";
  2288. TemplateInfo += "\t\t</td>\n";
  2289. //}
  2290. //else
  2291. //{
  2292. // 주
  2293. TemplateInfo += "\t\t<td "+ StyleArr[1] + ">\n";
  2294. /*
  2295. TemplateInfo += "\t\t\t<xsl:if test=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[2] +"' and rowno=$rowno and colno='1']/reccnts = 'M'\">\n";
  2296. TemplateInfo += "\t\t\t\t<input type=\"checkbox\" name=\"MS\" checked=\"true\"/></xsl:if>\n";
  2297. TemplateInfo += "\t\t\t<xsl:if test=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[2] +"' and rowno=$rowno and colno='1']/reccnts != 'M'\">\n";
  2298. TemplateInfo += "\t\t\t\t<input type=\"checkbox\" name=\"MS\"/></xsl:if>\n";
  2299. */
  2300. TemplateInfo += "\t\t\t<xsl:choose>\n";
  2301. TemplateInfo += "\t\t\t\t<xsl:when test=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[2] +"' and rowno=$rowno and colno='1']/reccnts[(.=\'M')] \">\n";
  2302. TemplateInfo += "\t\t\t\t\t<input type=\"checkbox\" name=\"MS\" checked=\"true\"/>\n";
  2303. TemplateInfo += "\t\t\t\t</xsl:when>\n";
  2304. TemplateInfo += "\t\t\t\t<xsl:otherwise>\n";
  2305. TemplateInfo += "\t\t\t\t\t<input type=\"checkbox\" name=\"MS\"/>\n";
  2306. TemplateInfo += "\t\t\t\t</xsl:otherwise>\n";
  2307. TemplateInfo += "\t\t\t</xsl:choose>\n";
  2308. TemplateInfo += "\t\t\t</td>\n";
  2309. //}
  2310. // 진단코드
  2311. // 2008-10-23 진단코드 삭제
  2312. //TemplateInfo += "\t\t<td "+ StyleArr[2] + "><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[3] + "' and rowno=$rowno and colno='2']/rectermcd\"/></td>\n";
  2313. // 진단명
  2314. TemplateInfo += "\t\t<td "+ StyleArr[2] + "><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[3] + "' and rowno=$rowno and colno='2']/rectermnm\"/></td>\n";
  2315. // Comments
  2316. TemplateInfo += "\t\t<td "+ StyleArr[3] + "><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[3] + "' and rowno=$rowno and colno='2']/reccnts\"/></td>\n";
  2317. TemplateInfo += "\t</tr>\n";
  2318. TemplateInfo += "</xsl:template>\n";
  2319. //}
  2320. return TemplateInfo;
  2321. }
  2322. /**
  2323. * @group :
  2324. * @ver : 2008.07.24
  2325. * @by : 이경희
  2326. * @modify:
  2327. * @---------------------------------------------------
  2328. * @type : function
  2329. * @access : public
  2330. * @desc : 주호소의 match template를 생성하여 반환한다.
  2331. * @param :
  2332. * @param :
  2333. * @return :
  2334. * @---------------------------------------------------
  2335. */
  2336. function fMakeCCNTemplate(degnitemlevlcdArr, StyleArr)
  2337. {
  2338. g_pageInfo = new PAGEINFO();
  2339. var TemplateInfo = "";
  2340. //TemplateInfo += "\n<xsl:template match=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[0] + "']\">\n";
  2341. TemplateInfo += "\n<xsl:template match=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "']\">\n";
  2342. TemplateInfo += "\t<xsl:variable name=\"rowno\" select=\"rowno\"/>\n";
  2343. TemplateInfo += "\t<tr>\n";
  2344. // 빈칸
  2345. //TemplateInfo += "\t\t<td " + StyleArr[0] + "><pre></pre></td>\n";
  2346. // 주호소코드
  2347. //TemplateInfo += "\t\t<td " + StyleArr[0] + "><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/rectermcd\"/></pre></td>\n";
  2348. /*
  2349. if(StyleArr[0] == null)
  2350. {
  2351. TemplateInfo += "\t\t<td><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/rectermcd\"/></td>\n";
  2352. }
  2353. else
  2354. {
  2355. TemplateInfo += "\t\t<td " + StyleArr[0] + "><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/rectermcd\"/></td>\n";
  2356. }*/
  2357. // 주호소명
  2358. if(StyleArr[0] == null)
  2359. {
  2360. //TemplateInfo += "\t\t<td " + StyleArr[1] + "><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/rectermnm\"/></pre></td>\n";
  2361. TemplateInfo += "\t\t<td><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/rectermnm\"/></td>\n";
  2362. }
  2363. else
  2364. {
  2365. TemplateInfo += "\t\t<td " + StyleArr[0] + "><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/rectermnm\"/></td>\n";
  2366. }
  2367. // Comments
  2368. if(StyleArr[1] == null)
  2369. {
  2370. //TemplateInfo += "\t\t<td " + StyleArr[2] + "><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/reccnts\"/></pre></td>\n";
  2371. TemplateInfo += "\t\t<td><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/reccnts\"/></td>\n";
  2372. }
  2373. else
  2374. {
  2375. TemplateInfo += "\t\t<td " + StyleArr[1] + "><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/reccnts\"/></td>\n";
  2376. }
  2377. // 발생일
  2378. if(StyleArr[2] == null)
  2379. {
  2380. //TemplateInfo += "\t\t<td " + StyleArr[3] + "><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[2] + "' and rowno=$rowno and colno='1']/reccnts\"/></pre></td>\n";
  2381. TemplateInfo += "\t\t<td><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[2] + "' and rowno=$rowno and colno='1']/reccnts\"/></td>\n";
  2382. }
  2383. else
  2384. {
  2385. TemplateInfo += "\t\t<td " + StyleArr[2] + "><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[2] + "' and rowno=$rowno and colno='1']/reccnts\"/></td>\n";
  2386. }
  2387. TemplateInfo += "\t</tr>\n";
  2388. TemplateInfo += "</xsl:template>\n";
  2389. return TemplateInfo;
  2390. }
  2391. /**
  2392. * @group :
  2393. * @ver : 2008.07.24
  2394. * @by : 이경희
  2395. * @modify:
  2396. * @---------------------------------------------------
  2397. * @type : function
  2398. * @access : public
  2399. * @desc : 수술명의 match template를 생성하여 반환한다.
  2400. * @param :
  2401. * @param :
  2402. * @return :
  2403. * @history : 2008-10-28 수술코드 삭제
  2404. * @---------------------------------------------------
  2405. */
  2406. function fMakeOPNTemplate(degnitemlevlcdArr, StyleArr)
  2407. {
  2408. g_pageInfo = new PAGEINFO();
  2409. var TemplateInfo = "";
  2410. TemplateInfo += "\n<xsl:template match=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "']\">\n";
  2411. TemplateInfo += "\t<xsl:variable name=\"rowno\" select=\"rowno\"/>\n";
  2412. TemplateInfo += "\t<tr>\n";
  2413. // 빈칸
  2414. //TemplateInfo += "\t\t<td " + StyleArr[0] + "><pre></pre></td>\n";
  2415. // 수술코드
  2416. //TemplateInfo += "\t\t<td " + StyleArr[0] + "><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/rectermcd\"/></pre></td>\n";
  2417. // 수술명
  2418. TemplateInfo += "\t\t<td " + StyleArr[0] + "><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/rectermnm\"/></pre></td>\n";
  2419. // Comments
  2420. TemplateInfo += "\t\t<td " + StyleArr[1] + "><pre><xsl:value-of select=\"" + g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "' and rowno=$rowno and colno='0']/reccnts\"/></pre></td>\n";
  2421. TemplateInfo += "\t</tr>\n";
  2422. TemplateInfo += "</xsl:template>\n";
  2423. return TemplateInfo;
  2424. }
  2425. /**
  2426. * @desc : 수술 XSLT 생성
  2427. * @
  2428. * @param :
  2429. * @return :
  2430. * @history : 2008-10-28 수술코드 삭제
  2431. * @---------------------------------------------------
  2432. */
  2433. function fDrawXSLTOpName(x, y, row)
  2434. {
  2435. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  2436. if(width != "")
  2437. width = parseInt(width);
  2438. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  2439. if(height != "")
  2440. height = parseInt(height);
  2441. if(width == "")
  2442. width = 500;
  2443. if(height == "")
  2444. height = 300;
  2445. // var ctrlSize = new SIZE(width, height);
  2446. var ctrlPosition = new Position(x, y, width, height);
  2447. var degnitemno = model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemno");
  2448. var degnitemkind = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemkind");
  2449. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  2450. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  2451. var degnitemcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemcd");
  2452. var degnitemlevlcdArr = getDegnitemlevlcd("OPN", degnitemlevlcd);
  2453. var ctrlid = "OPN_" + degnitemno;
  2454. // 2008-10-28 수술코드 삭제
  2455. //var grdcaption = new Array("수술코드","수술명", "Comments");
  2456. //var grdcolwidth = new Array(85,325, 80); // 20, 85, 301, 79
  2457. //var grdcolheight = 23;
  2458. // 2008-10-28 Comments 삭제
  2459. var grdcaption = new Array("수술명", "Comments");
  2460. var grdcolwidth = new Array(470, 170); // 20, 85, 301, 79
  2461. //var grdcaption = new Array("수술명");
  2462. //var OPNCtrlWidth = getStyleValue(degnattrval, "width", "ctrl");
  2463. //var grdcolwidth = new Array(OPNCtrlWidth);
  2464. var grdcolheight = g_Base_GrdColHeight;
  2465. var colWidths = getStyleValue(degnattrval, "colwidth", "ctrl").split("^");
  2466. var colHeights = getStyleValue(degnattrval, "rowheight", "ctrl").split("^");
  2467. var sTdStyle = "";
  2468. //var sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  2469. var sStyle = getNewXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  2470. //sXSLTInfo += "\t\t\t\t<div id=\"COV_"+ctrlid+"\" "+sStyle+" >\n";
  2471. //sXSLTInfo += "\t\t\t\t<div id=\"C_"+ctrlid+"\" style=\"position:absolute; left:0px; top:0px; \">\n";
  2472. var tmpWidth = getStyleValue(degnattrval, "ctrl.width");
  2473. var tmpHeight = getStyleValue(degnattrval, "ctrl.height");
  2474. sXSLTInfo += "\t\t\t\t<div id=\"C_"+ctrlid+"\" style=\"position:absolute; left:0px; top:0px; width:" + tmpWidth + "px; height:" + tmpHeight + "px; \">\n";
  2475. // Table 에 Style 정보를 추가
  2476. sXSLTInfo += "\t\t\t\t<table id=\""+ctrlid+"\" "+sStyle+" border=\"1\" frame=\"box\" bordercolor=\"silver\" cellspacing=\"0\">\n";
  2477. //sXSLTInfo += "\t\t\t\t<table id=\""+ctrlid+"\" border=\"1\" frame=\"box\" bordercolor=\"silver\" cellspacing=\"0\">\n";
  2478. sXSLTInfo += "\t\t\t\t\t<tr bgColor=\"#e0e0e0\">\n";
  2479. var StyleArr = new Array();
  2480. var TdFontStyle = getTableXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  2481. for(var j=0; j<grdcaption.length; j++)
  2482. {
  2483. sTdStyle = "style=\"";
  2484. if(colWidths.length == grdcaption.length)
  2485. sTdStyle += "width:"+ colWidths[j] +"px; ";
  2486. else
  2487. sTdStyle += "width:"+ grdcolwidth[j] +"px; ";
  2488. if(colHeights.length == grdcaption.length)
  2489. sTdStyle += "height:"+ colHeights[j] +"px; ";
  2490. else
  2491. sTdStyle += "height:"+ grdcolheight +"px; ";
  2492. //sTdStyle += "\"";
  2493. sTdStyle = sTdStyle + TdFontStyle + "\"";
  2494. StyleArr[j] = sTdStyle;
  2495. sXSLTInfo += "\t\t\t\t\t\t<td "+sTdStyle+" align=\"center\"><![CDATA["+grdcaption[j]+"]]></td>\n";
  2496. }
  2497. sXSLTInfo += "\t\t\t\t\t</tr>\n";
  2498. sXSLTInfo += "\t\t\t\t\t<xsl:apply-templates select=\"" +g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "']\"/>\n";
  2499. sXSLTInfo += "\t\t\t\t</table>\n";
  2500. sXSLTInfo += "\t\t\t\t</div>\n";
  2501. fMakeXSLTMatchTemplate("OPN", degnitemlevlcdArr, degnitemcd, StyleArr);
  2502. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  2503. if(ctrlPosition.height > sDivHeight)
  2504. sDivHeight = ctrlPosition.height;
  2505. g_pageInfo.curxpos += parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  2506. return ctrlPosition;
  2507. }
  2508. /**
  2509. * @desc : 주호소 XSLT 생성
  2510. * @
  2511. * @param :
  2512. * @return :
  2513. * @---------------------------------------------------
  2514. */
  2515. function fDrawXSLTCCName(x, y, row)
  2516. {
  2517. var width = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "width");
  2518. if(width != "")
  2519. width = parseInt(width);
  2520. var height = getStyleValue(model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval"), "height");
  2521. if(height != "")
  2522. height = parseInt(height);
  2523. if(width == "")
  2524. width = 500;
  2525. if(height == "")
  2526. height = 300;
  2527. var ctrlPosition = new Position(x, y, width, height);
  2528. var degnitemno = model.getValue(g_pageInfo.formdegnRef +"[" + row + "]/degnitemno");
  2529. var degnitemkind = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemkind");
  2530. var degnitemlevlcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemlevlcd");
  2531. var degnattrval = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnattrval");
  2532. var degnitemcd = model.getValue(g_pageInfo.formdegnRef + "[" + row + "]/degnitemcd");
  2533. var degnitemlevlcdArr = getDegnitemlevlcd("CCN", degnitemlevlcd);
  2534. var ctrlid = "CCN_" + degnitemno;
  2535. // 주호소 사이즈 조절
  2536. //var grdcaption = new Array("주호소코드","주호소명","Comments","발생일");
  2537. //var grdcolwidth = new Array(120,180,130,100);
  2538. // ctrl.width 590
  2539. var grdcaption = new Array("주호소명","Comments","발생일");
  2540. var grdcolwidth = new Array(260,230,110);
  2541. var grdcolheight = g_Base_GrdColHeight;
  2542. var colWidths = getStyleValue(degnattrval, "colwidth", "ctrl").split("^");
  2543. var colHeights = getStyleValue(degnattrval, "rowheight", "ctrl").split("^");
  2544. var sTdStyle = "";
  2545. //var sStyle = getXSLTStyleVal(ctrlPosition, degnattrval, "ctrl");
  2546. var sStyle = getNewXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  2547. //sXSLTInfo += "\t\t\t\t<div id=\"COV_"+ctrlid+"\" "+sStyle+" >\n";
  2548. //sXSLTInfo += "\t\t\t\t<div id=\"C_"+ctrlid+"\" style=\"position:absolute; left:0px; top:0px; \">\n";
  2549. var tmpWidth = getStyleValue(degnattrval, "ctrl.width");
  2550. var tmpHeight = getStyleValue(degnattrval, "ctrl.height");
  2551. sXSLTInfo += "\t\t\t\t<div id=\"C_"+ctrlid+"\" style=\"position:absolute; left:0px; top:0px; width:" + tmpWidth + "px; height:" + tmpHeight + "px; \">\n";
  2552. // Table 에 Style 정보를 추가
  2553. sXSLTInfo += "\t\t\t\t<table id=\""+ctrlid+"\" "+sStyle+" border=\"1\" frame=\"box\" bordercolor=\"silver\" cellspacing=\"0\">\n";
  2554. //sXSLTInfo += "\t\t\t\t<table id=\""+ctrlid+"\" border=\"1\" frame=\"box\" bordercolor=\"silver\" cellspacing=\"0\">\n";
  2555. sXSLTInfo += "\t\t\t\t\t<tr bgColor=\"#e0e0e0\">\n";
  2556. var StyleArr = new Array();
  2557. var TdFontStyle = getTableXSLTStyleVal(ctrlid, ctrlPosition, degnattrval, "ctrl");
  2558. for(var j=0; j<grdcaption.length; j++)
  2559. {
  2560. sTdStyle = "style=\"";
  2561. if(colWidths.length == grdcaption.length)
  2562. sTdStyle += "width:"+ colWidths[j] +"px; ";
  2563. else
  2564. sTdStyle += "width:"+ grdcolwidth[j] +"px; ";
  2565. if(colHeights.length == grdcaption.length)
  2566. sTdStyle += "height:"+ colHeights[j] +"px; ";
  2567. else
  2568. sTdStyle += "height:"+ grdcolheight +"px; ";
  2569. //sTdStyle += "\"";
  2570. sTdStyle = sTdStyle + TdFontStyle + "\"";
  2571. StyleArr[j] = sTdStyle;
  2572. sXSLTInfo += "\t\t\t\t\t\t<td "+sTdStyle+" align=\"center\"><![CDATA["+grdcaption[j]+"]]></td>\n";
  2573. }
  2574. sXSLTInfo += "\t\t\t\t\t</tr>\n";
  2575. sXSLTInfo += "\t\t\t\t\t<xsl:apply-templates select=\"" +g_pageInfo.xsltRecinfoRecitemRef + "[degnitemlevlcd='" + degnitemlevlcdArr[1] + "']\"/>\n";
  2576. sXSLTInfo += "\t\t\t\t</table>\n";
  2577. sXSLTInfo += "\t\t\t\t</div>\n";
  2578. fMakeXSLTMatchTemplate("CCN", degnitemlevlcdArr, degnitemcd, StyleArr);
  2579. sDivWidth = ctrlPosition.x + parseInt(ctrlPosition.width);
  2580. if(ctrlPosition.height < sDivHeight)
  2581. sDivHeight = ctrlPosition.height;
  2582. g_pageInfo.curxpos += parseInt(ctrlPosition.width) +g_pageInfo.offsetx;
  2583. return ctrlPosition;
  2584. }
  2585. /**
  2586. * @desc : XSLT 스타일 값을 얻어온다.
  2587. * @
  2588. * @param :
  2589. * @return :
  2590. * @history : 2008-12-10 컨트롤의 폰트 정보를 얻어온다.
  2591. * @---------------------------------------------------
  2592. */
  2593. function getTableXSLTStyleVal(ctrlid, pCtrlPosition, degnattrval, sCtrlType)
  2594. {
  2595. var sStyleMsg = "";
  2596. // Font Style
  2597. if(document.controls(ctrlid) != null)
  2598. {
  2599. // FontName
  2600. var fontfamilyArr = document.controls(ctrlid).attribute("font-family").split(",");
  2601. if(fontfamilyArr.length > 0)
  2602. {
  2603. sStyleMsg += getXSLTCtrlAttribute("font-family", fontfamilyArr[0]);
  2604. }
  2605. else
  2606. sStyleMsg += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  2607. // FontSize
  2608. var fontSize = document.controls(ctrlid).attribute("font-size");
  2609. if(fontSize != "")
  2610. sStyleMsg += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  2611. else
  2612. sStyleMsg += getXSLTCtrlAttribute("font-size", "9");
  2613. sStyleMsg += getXSLTCtrlAttribute("font-weight", document.controls(ctrlid).attribute("font-weight"));
  2614. sStyleMsg += getXSLTCtrlAttribute("font-style", document.controls(ctrlid).attribute("font-style"));
  2615. sStyleMsg += getXSLTCtrlAttribute("text-decoration", document.controls(ctrlid).attribute("text-decoration"));
  2616. sStyleMsg += getXSLTCtrlAttribute("color", document.controls(ctrlid).attribute("color"));
  2617. }
  2618. else
  2619. {
  2620. var fontName = getStyleValue(degnattrval, "font-family", sCtrlType);
  2621. if(fontName != "")
  2622. sStyleMsg += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  2623. else
  2624. sStyleMsg += getXSLTCtrlAttribute("font-family", "돋움");
  2625. var fontSize = getStyleValue(degnattrval, "font-size", sCtrlType);
  2626. if(fontSize != "")
  2627. sStyleMsg += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  2628. else
  2629. sStyleMsg += getXSLTCtrlAttribute("font-size", "9");
  2630. //sStyleMsg += getXSLTCtrlAttribute("font-size", getStyleValue(degnattrval, "font-size", sCtrlType));
  2631. sStyleMsg += getXSLTCtrlAttribute("font-weight", getStyleValue(degnattrval, "font-weight", sCtrlType));
  2632. sStyleMsg += getXSLTCtrlAttribute("font-style", getStyleValue(degnattrval, "font-style", sCtrlType));
  2633. sStyleMsg += getXSLTCtrlAttribute("text-decoration", getStyleValue(degnattrval, "text-decoration", sCtrlType));
  2634. sStyleMsg += getXSLTCtrlAttribute("color", getStyleValue(degnattrval, "color", sCtrlType));
  2635. }
  2636. //Text
  2637. sStyleMsg += getXSLTCtrlAttribute("text-align", getStyleValue(degnattrval, "text-align", sCtrlType));
  2638. sStyleMsg += getXSLTCtrlAttribute("vertical-align", getStyleValue(degnattrval, "vertical-align", sCtrlType));
  2639. sStyleMsg += getXSLTCtrlAttribute("word-wrap", getStyleValue(degnattrval, "word-wrap", sCtrlType));
  2640. sStyleMsg += getXSLTCtrlAttribute("line-spacing", getStyleValue(degnattrval, "line-spacing", sCtrlType));
  2641. sStyleMsg += getXSLTCtrlAttribute("letter-spacing", getStyleValue(degnattrval, "letter-spacing", sCtrlType));
  2642. sStyleMsg += getXSLTCtrlAttribute("text-select", getStyleValue(degnattrval, "text-select", sCtrlType));
  2643. //Padding
  2644. sStyleMsg += getXSLTCtrlAttribute("padding", getStyleValue(degnattrval, "padding", sCtrlType));
  2645. sStyleMsg += getXSLTCtrlAttribute("padding-left", getStyleValue(degnattrval, "padding-left", sCtrlType));
  2646. sStyleMsg += getXSLTCtrlAttribute("padding-top", getStyleValue(degnattrval, "padding-top", sCtrlType));
  2647. sStyleMsg += getXSLTCtrlAttribute("padding-right", getStyleValue(degnattrval, "padding-right", sCtrlType));
  2648. sStyleMsg += getXSLTCtrlAttribute("padding-bottom", getStyleValue(degnattrval, "padding-bottom", sCtrlType));
  2649. //Background
  2650. sStyleMsg += getXSLTCtrlAttribute("background-color", getStyleValue(degnattrval, "background-color", sCtrlType));
  2651. sStyleMsg += getXSLTCtrlAttribute("background-image", getStyleValue(degnattrval, "background-image", sCtrlType));
  2652. sStyleMsg += getXSLTCtrlAttribute("background-repeat", getStyleValue(degnattrval, "background-repeat", sCtrlType));
  2653. sStyleMsg += getXSLTCtrlAttribute("background-stretch", getStyleValue(degnattrval, "background-stretch", sCtrlType));
  2654. sStyleMsg += getXSLTCtrlAttribute("background-position", getStyleValue(degnattrval, "background-position", sCtrlType));
  2655. //Border
  2656. sStyleMsg += getXSLTCtrlAttribute("border-color", getStyleValue(degnattrval, "border-color", sCtrlType));
  2657. sStyleMsg += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  2658. sStyleMsg += getXSLTCtrlAttribute("border-style", getStyleValue(degnattrval, "border-style", sCtrlType));
  2659. //Margin
  2660. sStyleMsg += getXSLTCtrlAttribute("margin", getStyleValue(degnattrval, "margin", sCtrlType));
  2661. sStyleMsg += getXSLTCtrlAttribute("margin-left", getStyleValue(degnattrval, "margin-left", sCtrlType));
  2662. sStyleMsg += getXSLTCtrlAttribute("margin-top", getStyleValue(degnattrval, "margin-top", sCtrlType));
  2663. sStyleMsg += getXSLTCtrlAttribute("margin-right", getStyleValue(degnattrval, "margin-right", sCtrlType));
  2664. sStyleMsg += getXSLTCtrlAttribute("margin-bottom", getStyleValue(degnattrval, "margin-bottom", sCtrlType));
  2665. return sStyleMsg;
  2666. }
  2667. /**
  2668. * @desc : XSLT 스타일 값을 얻어온다.(폰트정보는 컨트롤에서)
  2669. * @
  2670. * @param :
  2671. * @return :
  2672. * @history : 2008-12-10 컨트롤의 폰트 정보를 얻어온다.
  2673. * @---------------------------------------------------
  2674. */
  2675. function getNewXSLTStyleVal(ctrlid, pCtrlPosition, degnattrval, pCtrlType)
  2676. {
  2677. var sLeft = "";
  2678. var sTop= "";
  2679. var sWidth = "";
  2680. var sHeight = "";
  2681. var sStyleMsg = "style=\"position:absolute; ";
  2682. var sCtrlType = null;
  2683. if(pCtrlType != "grp") sCtrlType = pCtrlType;
  2684. if(pCtrlType == "RDO" || pCtrlType == "CHK" || pCtrlType == "BOL" || pCtrlType == "MSL" || pCtrlType == "SSL")
  2685. sCtrlType = "ctrl";
  2686. // position
  2687. if(document.controls(ctrlid) != null)
  2688. {
  2689. sLeft = document.controls(ctrlid).attribute("left");
  2690. }
  2691. else
  2692. sLeft = getStyleValue(degnattrval, "left", sCtrlType);
  2693. if(sLeft == "") sLeft = pCtrlPosition.x;
  2694. else{
  2695. sLeft = parseInt(sLeft);
  2696. pCtrlPosition.x = sLeft;
  2697. }
  2698. //if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  2699. if(pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  2700. sStyleMsg += "left:"+sLeft+"px; ";
  2701. if(document.controls(ctrlid) != null)
  2702. {
  2703. sTop = document.controls(ctrlid).attribute("top");
  2704. }
  2705. else
  2706. sTop= getStyleValue(degnattrval, "top", sCtrlType);
  2707. if(sTop=="")
  2708. sTop = pCtrlPosition.y;
  2709. else{
  2710. sTop = parseInt(sTop);
  2711. pCtrlPosition.y = sTop;
  2712. }
  2713. //if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  2714. if(pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  2715. sStyleMsg += "top:"+sTop+"px; ";
  2716. if(document.controls(ctrlid) != null)
  2717. {
  2718. sWidth = document.controls(ctrlid).attribute("width");
  2719. }
  2720. else
  2721. sWidth = getStyleValue(degnattrval, "width", sCtrlType);
  2722. if(sWidth == "") sWidth = pCtrlPosition.width;
  2723. else
  2724. {
  2725. var strBorderStyle = "";
  2726. if(document.controls(ctrlid) != null)
  2727. strBorderStyle = document.controls(ctrlid).attribute("border-style");
  2728. if(strBorderStyle != "")
  2729. {
  2730. sWidth = parseInt(sWidth) - 1;
  2731. }
  2732. else
  2733. {
  2734. sWidth = parseInt(sWidth);
  2735. }
  2736. pCtrlPosition.width = sWidth;
  2737. }
  2738. //if(pCtrlType != "grp" && pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  2739. if(pCtrlType != "grp" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  2740. sStyleMsg += "width:"+sWidth+"px; ";
  2741. if(document.controls(ctrlid) != null)
  2742. {
  2743. sHeight = document.controls(ctrlid).attribute("height");
  2744. }
  2745. else
  2746. sHeight = getStyleValue(degnattrval, "height", sCtrlType);
  2747. if(sHeight == "") sHeight = pCtrlPosition.height;
  2748. else
  2749. {
  2750. var strBorderStyle = "";
  2751. if(document.controls(ctrlid) != null)
  2752. strBorderStyle = document.controls(ctrlid).attribute("border-style");
  2753. if(strBorderStyle != "")
  2754. {
  2755. sHeight = parseInt(sHeight) - 1;
  2756. }
  2757. else
  2758. {
  2759. sHeight = parseInt(sHeight);
  2760. }
  2761. pCtrlPosition.height = sHeight;
  2762. }
  2763. //if(pCtrlType != "grp" && pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  2764. if(pCtrlType != "grp" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  2765. {
  2766. //sStyleMsg += "height:"+sHeight+"px; ";
  2767. // 테이블 전체 크기를 ctrlheight로 받으면 변경할것.
  2768. // 테이블 전체 크기를 ctrlheight로 받도록 하지 않은 이전 버전에 미리 적용할 경우 테이블이 일그러져 보임.
  2769. var tmpCtrlType ="";
  2770. if(ctrlid != "")
  2771. {
  2772. tmpCtrlType = ctrlid.split("_")[0];
  2773. }
  2774. if(tmpCtrlType == "GRD" || tmpCtrlType == "DGN" || tmpCtrlType == "OPN" || tmpCtrlType == "CCN")
  2775. sStyleMsg += "ctrlheight:"+sHeight+"px; ";
  2776. //sStyleMsg += "height:"+sHeight+"px; ";
  2777. else
  2778. sStyleMsg += "height:"+sHeight+"px; ";
  2779. }
  2780. // Font Style
  2781. if(document.controls(ctrlid) != null)
  2782. {
  2783. // FontName
  2784. var fontfamilyArr = document.controls(ctrlid).attribute("font-family").split(",");
  2785. if(fontfamilyArr.length > 0)
  2786. {
  2787. sStyleMsg += getXSLTCtrlAttribute("font-family", fontfamilyArr[0]);
  2788. }
  2789. else
  2790. sStyleMsg += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  2791. // FontSize
  2792. var fontSize = document.controls(ctrlid).attribute("font-size");
  2793. if(fontSize != "")
  2794. sStyleMsg += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  2795. else
  2796. sStyleMsg += getXSLTCtrlAttribute("font-size", "9");
  2797. sStyleMsg += getXSLTCtrlAttribute("font-weight", document.controls(ctrlid).attribute("font-weight"));
  2798. sStyleMsg += getXSLTCtrlAttribute("font-style", document.controls(ctrlid).attribute("font-style"));
  2799. sStyleMsg += getXSLTCtrlAttribute("text-decoration", document.controls(ctrlid).attribute("text-decoration"));
  2800. var fontColor = document.controls(ctrlid).attribute("color");
  2801. if(fontColor != "")
  2802. {
  2803. if(fontColor.charAt(0) != "#")
  2804. sStyleMsg += getXSLTCtrlAttribute("color", "#" + fontColor);
  2805. else
  2806. sStyleMsg += getXSLTCtrlAttribute("color", fontColor);
  2807. }
  2808. }
  2809. else
  2810. {
  2811. sStyleMsg += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  2812. var fontSize = getStyleValue(degnattrval, "font-size", sCtrlType);
  2813. if(fontSize != "")
  2814. sStyleMsg += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  2815. else
  2816. sStyleMsg += getXSLTCtrlAttribute("font-size", "9");
  2817. //sStyleMsg += getXSLTCtrlAttribute("font-size", getStyleValue(degnattrval, "font-size", sCtrlType));
  2818. sStyleMsg += getXSLTCtrlAttribute("font-weight", getStyleValue(degnattrval, "font-weight", sCtrlType));
  2819. sStyleMsg += getXSLTCtrlAttribute("font-style", getStyleValue(degnattrval, "font-style", sCtrlType));
  2820. sStyleMsg += getXSLTCtrlAttribute("text-decoration", getStyleValue(degnattrval, "text-decoration", sCtrlType));
  2821. sStyleMsg += getXSLTCtrlAttribute("color", getStyleValue(degnattrval, "color", sCtrlType));
  2822. }
  2823. //Text
  2824. if(document.controls(ctrlid) != null)
  2825. {
  2826. var Halign = document.controls(ctrlid).attribute("text-align");
  2827. var Valign = document.controls(ctrlid).attribute("vertical-align");
  2828. if(Halign != "")
  2829. sStyleMsg += getXSLTCtrlAttribute("text-align", Halign);
  2830. else
  2831. sStyleMsg += getXSLTCtrlAttribute("text-align", getStyleValue(degnattrval, "text-align", sCtrlType));
  2832. if(Valign != "")
  2833. sStyleMsg += getXSLTCtrlAttribute("vertical-align", Valign);
  2834. else
  2835. sStyleMsg += getXSLTCtrlAttribute("vertical-align", getStyleValue(degnattrval, "vertical-align", sCtrlType));
  2836. }
  2837. else
  2838. {
  2839. sStyleMsg += getXSLTCtrlAttribute("text-align", getStyleValue(degnattrval, "text-align", sCtrlType));
  2840. sStyleMsg += getXSLTCtrlAttribute("vertical-align", getStyleValue(degnattrval, "vertical-align", sCtrlType));
  2841. }
  2842. sStyleMsg += getXSLTCtrlAttribute("word-wrap", getStyleValue(degnattrval, "word-wrap", sCtrlType));
  2843. sStyleMsg += getXSLTCtrlAttribute("line-spacing", getStyleValue(degnattrval, "line-spacing", sCtrlType));
  2844. sStyleMsg += getXSLTCtrlAttribute("letter-spacing", getStyleValue(degnattrval, "letter-spacing", sCtrlType));
  2845. sStyleMsg += getXSLTCtrlAttribute("text-select", getStyleValue(degnattrval, "text-select", sCtrlType));
  2846. //Padding
  2847. sStyleMsg += getXSLTCtrlAttribute("padding", getStyleValue(degnattrval, "padding", sCtrlType));
  2848. sStyleMsg += getXSLTCtrlAttribute("padding-left", getStyleValue(degnattrval, "padding-left", sCtrlType));
  2849. sStyleMsg += getXSLTCtrlAttribute("padding-top", getStyleValue(degnattrval, "padding-top", sCtrlType));
  2850. sStyleMsg += getXSLTCtrlAttribute("padding-right", getStyleValue(degnattrval, "padding-right", sCtrlType));
  2851. sStyleMsg += getXSLTCtrlAttribute("padding-bottom", getStyleValue(degnattrval, "padding-bottom", sCtrlType));
  2852. //Background
  2853. sStyleMsg += getXSLTCtrlAttribute("background-color", getStyleValue(degnattrval, "background-color", sCtrlType));
  2854. sStyleMsg += getXSLTCtrlAttribute("background-image", getStyleValue(degnattrval, "background-image", sCtrlType));
  2855. sStyleMsg += getXSLTCtrlAttribute("background-repeat", getStyleValue(degnattrval, "background-repeat", sCtrlType));
  2856. sStyleMsg += getXSLTCtrlAttribute("background-stretch", getStyleValue(degnattrval, "background-stretch", sCtrlType));
  2857. sStyleMsg += getXSLTCtrlAttribute("background-position", getStyleValue(degnattrval, "background-position", sCtrlType));
  2858. //Border
  2859. var strBorderStyle = "";
  2860. if(document.controls(ctrlid) != null)
  2861. strBorderStyle = document.controls(ctrlid).attribute("border-style");
  2862. if(strBorderStyle != "")
  2863. {
  2864. sStyleMsg += getXSLTCtrlAttribute("border-style", strBorderStyle);
  2865. if(getStyleValue(degnattrval, "border-width", sCtrlType) != "")
  2866. sStyleMsg += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  2867. else
  2868. sStyleMsg += getXSLTCtrlAttribute("border-width", "1");
  2869. }
  2870. else
  2871. {
  2872. sStyleMsg += getXSLTCtrlAttribute("border-style", getStyleValue(degnattrval, "border-style", sCtrlType));
  2873. sStyleMsg += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  2874. sStyleMsg += getXSLTCtrlAttribute("border-color", getStyleValue(degnattrval, "border-color", sCtrlType));
  2875. }
  2876. //Margin
  2877. sStyleMsg += getXSLTCtrlAttribute("margin", getStyleValue(degnattrval, "margin", sCtrlType));
  2878. sStyleMsg += getXSLTCtrlAttribute("margin-left", getStyleValue(degnattrval, "margin-left", sCtrlType));
  2879. sStyleMsg += getXSLTCtrlAttribute("margin-top", getStyleValue(degnattrval, "margin-top", sCtrlType));
  2880. sStyleMsg += getXSLTCtrlAttribute("margin-right", getStyleValue(degnattrval, "margin-right", sCtrlType));
  2881. sStyleMsg += getXSLTCtrlAttribute("margin-bottom", getStyleValue(degnattrval, "margin-bottom", sCtrlType));
  2882. //if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL" && pCtrlType != "IMG")
  2883. if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "IMG")
  2884. sStyleMsg += "\"";
  2885. return sStyleMsg;
  2886. }
  2887. /**
  2888. * @desc : XSLT 스타일 값을 얻어온다.
  2889. * @
  2890. * @param :
  2891. * @return :
  2892. * @---------------------------------------------------
  2893. */
  2894. function getXSLTStyleVal(pCtrlPosition, degnattrval, pCtrlType)
  2895. {
  2896. var sLeft = "";
  2897. var sTop= "";
  2898. var sWidth = "";
  2899. var sHeight = "";
  2900. var sStyleMsg = "style=\"position:absolute; ";
  2901. var sCtrlType = null;
  2902. if(pCtrlType != "grp") sCtrlType = pCtrlType;
  2903. if(pCtrlType == "RDO" || pCtrlType == "CHK" || pCtrlType == "BOL" || pCtrlType == "MSL" || pCtrlType == "SSL")
  2904. sCtrlType = "ctrl";
  2905. // position
  2906. sLeft = getStyleValue(degnattrval, "left", sCtrlType);
  2907. if(sLeft == "") sLeft = pCtrlPosition.x;
  2908. else{
  2909. sLeft = parseInt(sLeft);
  2910. pCtrlPosition.x = sLeft;
  2911. }
  2912. if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  2913. sStyleMsg += "left:"+sLeft+"px; ";
  2914. sTop= getStyleValue(degnattrval , "top", sCtrlType);
  2915. if(sTop=="")
  2916. sTop = pCtrlPosition.y;
  2917. else{
  2918. sTop = parseInt(sTop);
  2919. pCtrlPosition.y = sTop;
  2920. }
  2921. if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  2922. sStyleMsg += "top:"+sTop+"px; ";
  2923. sWidth = getStyleValue(degnattrval, "width", sCtrlType);
  2924. if(sWidth == "") sWidth = pCtrlPosition.width;
  2925. else{
  2926. sWidth = parseInt(sWidth);
  2927. pCtrlPosition.width = sWidth;
  2928. }
  2929. if(pCtrlType != "grp" && pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  2930. sStyleMsg += "width:"+sWidth+"px; ";
  2931. sHeight = getStyleValue(degnattrval, "height", sCtrlType);
  2932. if(sHeight == "") sHeight = pCtrlPosition.height;
  2933. else{
  2934. sHeight = parseInt(sHeight);
  2935. pCtrlPosition.height = sHeight;
  2936. }
  2937. if(pCtrlType != "grp" && pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  2938. sStyleMsg += "height:"+sHeight+"px; ";
  2939. // Font
  2940. sStyleMsg += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  2941. sStyleMsg += getXSLTCtrlAttribute("font-size", getStyleValue(degnattrval, "font-size", sCtrlType));
  2942. sStyleMsg += getXSLTCtrlAttribute("font-weight", getStyleValue(degnattrval, "font-weight", sCtrlType));
  2943. sStyleMsg += getXSLTCtrlAttribute("font-style", getStyleValue(degnattrval, "font-style", sCtrlType));
  2944. sStyleMsg += getXSLTCtrlAttribute("text-decoration", getStyleValue(degnattrval, "text-decoration", sCtrlType));
  2945. sStyleMsg += getXSLTCtrlAttribute("color", getStyleValue(degnattrval, "color", sCtrlType));
  2946. //Text
  2947. sStyleMsg += getXSLTCtrlAttribute("text-align", getStyleValue(degnattrval, "text-align", sCtrlType));
  2948. sStyleMsg += getXSLTCtrlAttribute("vertical-align", getStyleValue(degnattrval, "vertical-align", sCtrlType));
  2949. sStyleMsg += getXSLTCtrlAttribute("word-wrap", getStyleValue(degnattrval, "word-wrap", sCtrlType));
  2950. sStyleMsg += getXSLTCtrlAttribute("line-spacing", getStyleValue(degnattrval, "line-spacing", sCtrlType));
  2951. sStyleMsg += getXSLTCtrlAttribute("letter-spacing", getStyleValue(degnattrval, "letter-spacing", sCtrlType));
  2952. sStyleMsg += getXSLTCtrlAttribute("text-select", getStyleValue(degnattrval, "text-select", sCtrlType));
  2953. //Padding
  2954. sStyleMsg += getXSLTCtrlAttribute("padding", getStyleValue(degnattrval, "padding", sCtrlType));
  2955. sStyleMsg += getXSLTCtrlAttribute("padding-left", getStyleValue(degnattrval, "padding-left", sCtrlType));
  2956. sStyleMsg += getXSLTCtrlAttribute("padding-top", getStyleValue(degnattrval, "padding-top", sCtrlType));
  2957. sStyleMsg += getXSLTCtrlAttribute("padding-right", getStyleValue(degnattrval, "padding-right", sCtrlType));
  2958. sStyleMsg += getXSLTCtrlAttribute("padding-bottom", getStyleValue(degnattrval, "padding-bottom", sCtrlType));
  2959. //Background
  2960. sStyleMsg += getXSLTCtrlAttribute("background-color", getStyleValue(degnattrval, "background-color", sCtrlType));
  2961. sStyleMsg += getXSLTCtrlAttribute("background-image", getStyleValue(degnattrval, "background-image", sCtrlType));
  2962. sStyleMsg += getXSLTCtrlAttribute("background-repeat", getStyleValue(degnattrval, "background-repeat", sCtrlType));
  2963. sStyleMsg += getXSLTCtrlAttribute("background-stretch", getStyleValue(degnattrval, "background-stretch", sCtrlType));
  2964. sStyleMsg += getXSLTCtrlAttribute("background-position", getStyleValue(degnattrval, "background-position", sCtrlType));
  2965. //Border
  2966. sStyleMsg += getXSLTCtrlAttribute("border-color", getStyleValue(degnattrval, "border-color", sCtrlType));
  2967. sStyleMsg += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  2968. sStyleMsg += getXSLTCtrlAttribute("border-style", getStyleValue(degnattrval, "border-style", sCtrlType));
  2969. //Margin
  2970. sStyleMsg += getXSLTCtrlAttribute("margin", getStyleValue(degnattrval, "margin", sCtrlType));
  2971. sStyleMsg += getXSLTCtrlAttribute("margin-left", getStyleValue(degnattrval, "margin-left", sCtrlType));
  2972. sStyleMsg += getXSLTCtrlAttribute("margin-top", getStyleValue(degnattrval, "margin-top", sCtrlType));
  2973. sStyleMsg += getXSLTCtrlAttribute("margin-right", getStyleValue(degnattrval, "margin-right", sCtrlType));
  2974. sStyleMsg += getXSLTCtrlAttribute("margin-bottom", getStyleValue(degnattrval, "margin-bottom", sCtrlType));
  2975. if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL" && pCtrlType != "IMG")
  2976. sStyleMsg += "\"";
  2977. return sStyleMsg;
  2978. }
  2979. /**
  2980. * @desc : 이미지 컨트롤의 XSLT 스타일 값을 얻어온다.
  2981. * @
  2982. * @param :
  2983. * @return :
  2984. * @history : 2008-12-19 left, top 좌표는 ctrl.left, ctrl.top 좌표가 있어도 0으로 처리함.
  2985. * @---------------------------------------------------
  2986. */
  2987. function getImgXSLTStylePos(ctrlid, pCtrlPosition, degnattrval, pCtrlType)
  2988. {
  2989. var sLeft = "";
  2990. var sTop= "";
  2991. var sWidth = "";
  2992. var sHeight = "";
  2993. var sStyleMsg = "style=\"position:absolute; ";
  2994. var sCtrlType = null;
  2995. if(pCtrlType != "grp") sCtrlType = pCtrlType;
  2996. if(pCtrlType == "RDO" || pCtrlType == "CHK" || pCtrlType == "BOL" || pCtrlType == "MSL" || pCtrlType == "SSL")
  2997. sCtrlType = "ctrl";
  2998. // position
  2999. if(document.controls(ctrlid) != null)
  3000. {
  3001. sLeft = document.controls(ctrlid).attribute("left");
  3002. sTop = document.controls(ctrlid).attribute("top");
  3003. sWidth = document.controls(ctrlid).attribute("width");
  3004. sHeight = document.controls(ctrlid).attribute("height");
  3005. if(document.controls(ctrlid).attribute("border-style") != "")
  3006. {
  3007. var BdWidth = 0;
  3008. if(getStyleValue(degnattrval, "border-width", sCtrlType) != "")
  3009. BdWidth = getStyleValue(degnattrval, "border-width", sCtrlType);
  3010. else
  3011. BdWidth = 1;
  3012. sHeight = parseInt(sHeight) - BdWidth;
  3013. }
  3014. }
  3015. else
  3016. {
  3017. sLeft = getStyleValue(degnattrval, "left", sCtrlType);
  3018. sTop= getStyleValue(degnattrval, "top", sCtrlType);
  3019. sWidth = getStyleValue(degnattrval, "width", sCtrlType);
  3020. sHeight = getStyleValue(degnattrval, "height", sCtrlType);
  3021. if(getStyleValue(degnattrval, "border-style", sCtrlType) != "")
  3022. {
  3023. var BdWidth = 0;
  3024. if(getStyleValue(degnattrval, "border-width", sCtrlType) != "")
  3025. BdWidth = getStyleValue(degnattrval, "border-width", sCtrlType);
  3026. else
  3027. BdWidth = 1;
  3028. sHeight = parseInt(sHeight) - BdWidth;
  3029. }
  3030. }
  3031. if(sLeft == "") sLeft = pCtrlPosition.x;
  3032. else{
  3033. sLeft = parseInt(sLeft);
  3034. pCtrlPosition.x = sLeft;
  3035. }
  3036. if(sTop=="") sTop = pCtrlPosition.y;
  3037. else{
  3038. sTop = parseInt(sTop);
  3039. pCtrlPosition.y = sTop;
  3040. }
  3041. if(sWidth == "") sWidth = pCtrlPosition.width;
  3042. else{
  3043. sWidth = parseInt(sWidth);
  3044. pCtrlPosition.width = sWidth;
  3045. }
  3046. if(sHeight == "") sHeight = pCtrlPosition.height;
  3047. else{
  3048. sHeight = parseInt(sHeight);
  3049. pCtrlPosition.height = sHeight;
  3050. }
  3051. if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  3052. sStyleMsg += "left:"+sLeft+"px; ";
  3053. if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  3054. sStyleMsg += "top:"+sTop+"px; ";
  3055. if(pCtrlType != "grp" && pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  3056. sStyleMsg += "width:"+sWidth+"px; ";
  3057. if(pCtrlType != "grp" && pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  3058. sStyleMsg += "height:"+sHeight+"px; ";
  3059. sStyleMsg += "\"";
  3060. return sStyleMsg;
  3061. }
  3062. /**
  3063. * @desc : 이미지 컨트롤의 XSLT 스타일 값을 얻어온다.
  3064. * @
  3065. * @param :
  3066. * @return :
  3067. * @history : 2008-12-19 left, top 좌표는 ctrl.left, ctrl.top 좌표가 있어도 0으로 처리함.
  3068. * @---------------------------------------------------
  3069. */
  3070. function getImgXSLTStyleVal(ctrlid, pCtrlPosition, degnattrval, pCtrlType)
  3071. {
  3072. var sLeft = "";
  3073. var sTop= "";
  3074. var sWidth = "";
  3075. var sHeight = "";
  3076. var sStyleMsg = "style=\"position:absolute; ";
  3077. var sCtrlType = null;
  3078. if(pCtrlType != "grp") sCtrlType = pCtrlType;
  3079. if(pCtrlType == "RDO" || pCtrlType == "CHK" || pCtrlType == "BOL" || pCtrlType == "MSL" || pCtrlType == "SSL")
  3080. sCtrlType = "ctrl";
  3081. //Text
  3082. sStyleMsg += getXSLTCtrlAttribute("text-align", getStyleValue(degnattrval, "text-align", sCtrlType));
  3083. sStyleMsg += getXSLTCtrlAttribute("vertical-align", getStyleValue(degnattrval, "vertical-align", sCtrlType));
  3084. sStyleMsg += getXSLTCtrlAttribute("word-wrap", getStyleValue(degnattrval, "word-wrap", sCtrlType));
  3085. sStyleMsg += getXSLTCtrlAttribute("line-spacing", getStyleValue(degnattrval, "line-spacing", sCtrlType));
  3086. sStyleMsg += getXSLTCtrlAttribute("letter-spacing", getStyleValue(degnattrval, "letter-spacing", sCtrlType));
  3087. sStyleMsg += getXSLTCtrlAttribute("text-select", getStyleValue(degnattrval, "text-select", sCtrlType));
  3088. //Padding
  3089. sStyleMsg += getXSLTCtrlAttribute("padding", getStyleValue(degnattrval, "padding", sCtrlType));
  3090. sStyleMsg += getXSLTCtrlAttribute("padding-left", getStyleValue(degnattrval, "padding-left", sCtrlType));
  3091. sStyleMsg += getXSLTCtrlAttribute("padding-top", getStyleValue(degnattrval, "padding-top", sCtrlType));
  3092. sStyleMsg += getXSLTCtrlAttribute("padding-right", getStyleValue(degnattrval, "padding-right", sCtrlType));
  3093. sStyleMsg += getXSLTCtrlAttribute("padding-bottom", getStyleValue(degnattrval, "padding-bottom", sCtrlType));
  3094. //Background
  3095. sStyleMsg += getXSLTCtrlAttribute("background-color", getStyleValue(degnattrval, "background-color", sCtrlType));
  3096. sStyleMsg += getXSLTCtrlAttribute("background-image", getStyleValue(degnattrval, "background-image", sCtrlType));
  3097. sStyleMsg += getXSLTCtrlAttribute("background-repeat", getStyleValue(degnattrval, "background-repeat", sCtrlType));
  3098. sStyleMsg += getXSLTCtrlAttribute("background-stretch", getStyleValue(degnattrval, "background-stretch", sCtrlType));
  3099. sStyleMsg += getXSLTCtrlAttribute("background-position", getStyleValue(degnattrval, "background-position", sCtrlType));
  3100. //Border
  3101. var strBorderStyle = "";
  3102. if(document.controls(ctrlid) != null)
  3103. {
  3104. if(document.controls(ctrlid).attribute("border-color") != "")
  3105. sStyleMsg += "border-color:"+document.controls(ctrlid).attribute("border-color")+"; ";
  3106. strBorderStyle = document.controls(ctrlid).attribute("border-style");
  3107. if(strBorderStyle != "")
  3108. {
  3109. sStyleMsg += "border-style:"+document.controls(ctrlid).attribute("border-style")+"; ";
  3110. if(getStyleValue(degnattrval, "border-width", sCtrlType) != "")
  3111. sStyleMsg += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  3112. else
  3113. sStyleMsg += getXSLTCtrlAttribute("border-width", "1");
  3114. }
  3115. }
  3116. else
  3117. {
  3118. sStyleMsg += getXSLTCtrlAttribute("border-style", getStyleValue(degnattrval, "border-style", sCtrlType));
  3119. sStyleMsg += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  3120. sStyleMsg += getXSLTCtrlAttribute("border-color", getStyleValue(degnattrval, "border-color", sCtrlType));
  3121. }
  3122. //Margin
  3123. sStyleMsg += getXSLTCtrlAttribute("margin", getStyleValue(degnattrval, "margin", sCtrlType));
  3124. sStyleMsg += getXSLTCtrlAttribute("margin-left", getStyleValue(degnattrval, "margin-left", sCtrlType));
  3125. sStyleMsg += getXSLTCtrlAttribute("margin-top", getStyleValue(degnattrval, "margin-top", sCtrlType));
  3126. sStyleMsg += getXSLTCtrlAttribute("margin-right", getStyleValue(degnattrval, "margin-right", sCtrlType));
  3127. sStyleMsg += getXSLTCtrlAttribute("margin-bottom", getStyleValue(degnattrval, "margin-bottom", sCtrlType));
  3128. sStyleMsg += "\"";
  3129. return sStyleMsg;
  3130. }
  3131. /**
  3132. * @desc : XSLT 스타일 값을 얻어온다.
  3133. * @
  3134. * @param :
  3135. * @return :
  3136. * @history : 2008-12-10 컨트롤의 폰트 정보를 얻어온다.
  3137. * @---------------------------------------------------
  3138. */
  3139. function getPatternXSLTStyleVal(ctrlid, pCtrlPosition, degnattrval, sCtrlType)
  3140. {
  3141. var sStyleMsg = "";
  3142. var pattern = "#0.";
  3143. var roundmode = "";
  3144. var roundposition = "";
  3145. var format = "";
  3146. if(document.controls(ctrlid) != null)
  3147. {
  3148. roundmode = document.controls(ctrlid).attribute("roundmode");
  3149. roundposition = document.controls(ctrlid).attribute("roundposition");
  3150. //format = document.controls(ctrlid).attribute("format").split(".");
  3151. if(parseInt(roundposition) < 0)
  3152. roundposition = parseInt(roundposition) * (-1);
  3153. else
  3154. roundposition = parseInt(roundposition);
  3155. for(var idx=0; idx < roundposition; idx++)
  3156. {
  3157. pattern += "0";
  3158. }
  3159. }
  3160. return pattern ;
  3161. }
  3162. /**
  3163. * @desc : XSLT 속성을 얻어온다.
  3164. * @
  3165. * @param :
  3166. * @return :
  3167. * @---------------------------------------------------
  3168. */
  3169. function getXSLTCtrlAttribute(type, value){
  3170. if(value != "") return type+":"+value+"; ";
  3171. return "";
  3172. }
  3173. /**
  3174. * @desc : StyleCss 를 반환한다.
  3175. * @
  3176. * @param :
  3177. * @return :
  3178. * @---------------------------------------------------
  3179. */
  3180. function getStyleCss()
  3181. {
  3182. //var styleCss = "<style type=\"text/css\">body, input, select, table, textarea, IMG {border: 0;}, .vs_button {font-family:돋움, Arial ; font-size:12px; } </style>\n";
  3183. //var styleCss = "\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../com/commonweb/css/common.css\" />\n";
  3184. var styleCss = "\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../emr/commonweb/css/emr.css\" />\n";
  3185. return styleCss;
  3186. }
  3187. /**
  3188. * @desc : 편집가능한 이미지 URL을 반환한다.
  3189. * @
  3190. * @param :
  3191. * @return :
  3192. * @---------------------------------------------------
  3193. */
  3194. function getRecImgUrl(degnitemlevlcd)
  3195. {
  3196. return getActionURI("TRMRF01213") + getUserSessionString() + "&pid=<xsl:value-of select=\"/recinfo/formrec/pid\"/>&orddd=<xsl:value-of select=\"/recinfo/formrec/orddd\"/>&cretno=<xsl:value-of select=\"/recinfo/formrec/cretno\"/>&formrecdd=<xsl:value-of select=\"/recinfo/formrec/formrecdd\"/>&formcd=<xsl:value-of select=\"/recinfo/formrec/formcd\"/>&degnitemlevlcd=" + degnitemlevlcd + "&formrechm=<xsl:value-of select=\"/recinfo/formrec/formrechm\"/>";
  3197. //return getActionURI("TRMRF01213") + getUserSessionString() + "&formdegnseq=" + formdegnseq + "&degnitemlevlcd=" + degnitemlevlcd;
  3198. }
  3199. /**
  3200. * @desc : 편집불가능한 이미지 URL을 반환한다.
  3201. * @
  3202. * @param :
  3203. * @return :
  3204. * @---------------------------------------------------
  3205. */
  3206. function getImgUrl(imgecd)
  3207. {
  3208. return getActionURI("TRMRF01212") + getUserSessionString() + "&imgecd=" + imgecd;
  3209. }
  3210. /**
  3211. * @desc : Border 속성이 없을 경우 추가한다.
  3212. * @
  3213. * @param :
  3214. * @return :
  3215. * @---------------------------------------------------
  3216. */
  3217. function AddBorderStyle(sStyle, degnattrval, ctrlType)
  3218. {
  3219. var tmpDegnattrval = degnattrval;
  3220. var borderStyle = getStyleValue(tmpDegnattrval, "border-style", ctrlType);
  3221. if(borderStyle == "solid" || borderStyle == "dotted" || borderStyle == "dashed" || borderStyle == "outset")
  3222. {
  3223. var pxSize = "";
  3224. pxSize = getStyleValue(tmpDegnattrval, "border-width", ctrlType);
  3225. if(pxSize == "")
  3226. {
  3227. pxSize = 1; // 기본 두께
  3228. var pxStyle= borderStyle + "; border-width:" + pxSize;
  3229. sStyle = sStyle.setReplaceWord(borderStyle, pxStyle);
  3230. }
  3231. }
  3232. /*
  3233. else if(borderStyle == "none")
  3234. {
  3235. sStyle += "border-style:none; ";
  3236. }
  3237. */
  3238. return sStyle;
  3239. }
  3240. /**
  3241. * @desc : Pre태그에 포함될 style 정보를 가져온다.
  3242. * @
  3243. * @param :
  3244. * @return :
  3245. * @---------------------------------------------------
  3246. */
  3247. function getPreXSLTStyle(ctrlid, pCtrlPosition, degnattrval, sCtrlType)
  3248. {
  3249. var ctrlWidth = "";
  3250. var ctrlHeight = "";
  3251. if(document.controls(ctrlid) != null)
  3252. {
  3253. ctrlWidth = document.controls(ctrlid).attribute("width");
  3254. ctrlHeight = document.controls(ctrlid).attribute("height");
  3255. }
  3256. else
  3257. {
  3258. ctrlWidth = getStyleValue(degnattrval, "width", sCtrlType);
  3259. ctrlHeight = getStyleValue(degnattrval, "height", sCtrlType);
  3260. }
  3261. if(ctrlWidth == "") ctrlWidth = pCtrlPosition.width;
  3262. else
  3263. {
  3264. var strBorderStyle = "";
  3265. if(document.controls(ctrlid) != null)
  3266. strBorderStyle = document.controls(ctrlid).attribute("border-style");
  3267. if(strBorderStyle != "")
  3268. {
  3269. ctrlWidth = parseInt(ctrlWidth) - 1;
  3270. }
  3271. else
  3272. {
  3273. ctrlWidth = parseInt(ctrlWidth);
  3274. }
  3275. pCtrlPosition.width = ctrlWidth;
  3276. }
  3277. if(ctrlHeight == "") ctrlHeight = pCtrlPosition.height;
  3278. else
  3279. {
  3280. var strBorderStyle = "";
  3281. if(document.controls(ctrlid) != null)
  3282. strBorderStyle = document.controls(ctrlid).attribute("border-style");
  3283. if(strBorderStyle != "")
  3284. {
  3285. ctrlHeight = parseInt(ctrlHeight) - 1;
  3286. }
  3287. else
  3288. {
  3289. ctrlHeight = parseInt(ctrlHeight);
  3290. }
  3291. pCtrlPosition.height = ctrlHeight;
  3292. }
  3293. var preStyle = "style=\"position:absolute; left:0px; top:0px; width:" + parseInt(ctrlWidth) + "px; height:" + parseInt(ctrlHeight) + "px; ";
  3294. // Font Style
  3295. if(document.controls(ctrlid) != null)
  3296. {
  3297. // FontName
  3298. var fontfamilyArr = document.controls(ctrlid).attribute("font-family").split(",");
  3299. if(fontfamilyArr.length > 0)
  3300. {
  3301. preStyle += getXSLTCtrlAttribute("font-family", fontfamilyArr[0]);
  3302. }
  3303. else
  3304. preStyle += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  3305. // FontSize
  3306. var fontSize = document.controls(ctrlid).attribute("font-size");
  3307. if(fontSize != "")
  3308. preStyle += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  3309. else
  3310. preStyle += getXSLTCtrlAttribute("font-size", "9");
  3311. preStyle += getXSLTCtrlAttribute("font-weight", document.controls(ctrlid).attribute("font-weight"));
  3312. preStyle += getXSLTCtrlAttribute("font-style", document.controls(ctrlid).attribute("font-style"));
  3313. preStyle += getXSLTCtrlAttribute("text-decoration", document.controls(ctrlid).attribute("text-decoration"));
  3314. var fontColor = document.controls(ctrlid).attribute("color");
  3315. if(fontColor != "")
  3316. {
  3317. if(fontColor.charAt(0) != "#")
  3318. preStyle += getXSLTCtrlAttribute("color", "#" + fontColor);
  3319. else
  3320. preStyle += getXSLTCtrlAttribute("color", fontColor);
  3321. }
  3322. }
  3323. else
  3324. {
  3325. preStyle += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  3326. var fontSize = getStyleValue(degnattrval, "font-size", sCtrlType);
  3327. if(fontSize != "")
  3328. preStyle += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  3329. else
  3330. preStyle += getXSLTCtrlAttribute("font-size", "9");
  3331. //sStyleMsg += getXSLTCtrlAttribute("font-size", getStyleValue(degnattrval, "font-size", sCtrlType));
  3332. preStyle += getXSLTCtrlAttribute("font-weight", getStyleValue(degnattrval, "font-weight", sCtrlType));
  3333. preStyle += getXSLTCtrlAttribute("font-style", getStyleValue(degnattrval, "font-style", sCtrlType));
  3334. preStyle += getXSLTCtrlAttribute("text-decoration", getStyleValue(degnattrval, "text-decoration", sCtrlType));
  3335. preStyle += getXSLTCtrlAttribute("color", getStyleValue(degnattrval, "color", sCtrlType));
  3336. }
  3337. //Text
  3338. if(document.controls(ctrlid) != null)
  3339. {
  3340. var Halign = document.controls(ctrlid).attribute("text-align");
  3341. var Valign = document.controls(ctrlid).attribute("vertical-align");
  3342. if(Halign != "")
  3343. preStyle += getXSLTCtrlAttribute("text-align", Halign);
  3344. else
  3345. preStyle += getXSLTCtrlAttribute("text-align", getStyleValue(degnattrval, "text-align", sCtrlType));
  3346. if(Valign != "")
  3347. preStyle += getXSLTCtrlAttribute("vertical-align", Valign);
  3348. else
  3349. preStyle += getXSLTCtrlAttribute("vertical-align", getStyleValue(degnattrval, "vertical-align", sCtrlType));
  3350. }
  3351. else
  3352. {
  3353. preStyle += getXSLTCtrlAttribute("text-align", getStyleValue(degnattrval, "text-align", sCtrlType));
  3354. preStyle += getXSLTCtrlAttribute("vertical-align", getStyleValue(degnattrval, "vertical-align", sCtrlType));
  3355. }
  3356. preStyle += getXSLTCtrlAttribute("word-wrap", getStyleValue(degnattrval, "word-wrap", sCtrlType));
  3357. preStyle += getXSLTCtrlAttribute("line-spacing", getStyleValue(degnattrval, "line-spacing", sCtrlType));
  3358. preStyle += getXSLTCtrlAttribute("letter-spacing", getStyleValue(degnattrval, "letter-spacing", sCtrlType));
  3359. preStyle += getXSLTCtrlAttribute("text-select", getStyleValue(degnattrval, "text-select", sCtrlType));
  3360. //Padding
  3361. preStyle += getXSLTCtrlAttribute("padding", getStyleValue(degnattrval, "padding", sCtrlType));
  3362. preStyle += getXSLTCtrlAttribute("padding-left", getStyleValue(degnattrval, "padding-left", sCtrlType));
  3363. preStyle += getXSLTCtrlAttribute("padding-top", getStyleValue(degnattrval, "padding-top", sCtrlType));
  3364. preStyle += getXSLTCtrlAttribute("padding-right", getStyleValue(degnattrval, "padding-right", sCtrlType));
  3365. preStyle += getXSLTCtrlAttribute("padding-bottom", getStyleValue(degnattrval, "padding-bottom", sCtrlType));
  3366. //Background
  3367. preStyle += getXSLTCtrlAttribute("background-color", getStyleValue(degnattrval, "background-color", sCtrlType));
  3368. preStyle += getXSLTCtrlAttribute("background-image", getStyleValue(degnattrval, "background-image", sCtrlType));
  3369. preStyle += getXSLTCtrlAttribute("background-repeat", getStyleValue(degnattrval, "background-repeat", sCtrlType));
  3370. preStyle += getXSLTCtrlAttribute("background-stretch", getStyleValue(degnattrval, "background-stretch", sCtrlType));
  3371. preStyle += getXSLTCtrlAttribute("background-position", getStyleValue(degnattrval, "background-position", sCtrlType));
  3372. //Border
  3373. var strBorderStyle = "";
  3374. if(document.controls(ctrlid) != null)
  3375. strBorderStyle = document.controls(ctrlid).attribute("border-style");
  3376. if(strBorderStyle != "")
  3377. {
  3378. preStyle += getXSLTCtrlAttribute("border-style", strBorderStyle);
  3379. if(getStyleValue(degnattrval, "border-width", sCtrlType) != "")
  3380. preStyle += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  3381. else
  3382. preStyle += getXSLTCtrlAttribute("border-width", "1");
  3383. }
  3384. else
  3385. {
  3386. preStyle += getXSLTCtrlAttribute("border-style", getStyleValue(degnattrval, "border-style", sCtrlType));
  3387. preStyle += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  3388. preStyle += getXSLTCtrlAttribute("border-color", getStyleValue(degnattrval, "border-color", sCtrlType));
  3389. }
  3390. //Margin
  3391. preStyle += getXSLTCtrlAttribute("margin", getStyleValue(degnattrval, "margin", sCtrlType));
  3392. preStyle += getXSLTCtrlAttribute("margin-left", getStyleValue(degnattrval, "margin-left", sCtrlType));
  3393. preStyle += getXSLTCtrlAttribute("margin-top", getStyleValue(degnattrval, "margin-top", sCtrlType));
  3394. preStyle += getXSLTCtrlAttribute("margin-right", getStyleValue(degnattrval, "margin-right", sCtrlType));
  3395. preStyle += getXSLTCtrlAttribute("margin-bottom", getStyleValue(degnattrval, "margin-bottom", sCtrlType));
  3396. /*
  3397. // Font
  3398. preStyle += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  3399. preStyle += getXSLTCtrlAttribute("font-size", getStyleValue(degnattrval, "font-size", sCtrlType));
  3400. preStyle += getXSLTCtrlAttribute("font-weight", getStyleValue(degnattrval, "font-weight", sCtrlType));
  3401. preStyle += getXSLTCtrlAttribute("font-style", getStyleValue(degnattrval, "font-style", sCtrlType));
  3402. preStyle += getXSLTCtrlAttribute("text-decoration", getStyleValue(degnattrval, "text-decoration", sCtrlType));
  3403. preStyle += getXSLTCtrlAttribute("color", getStyleValue(degnattrval, "color", sCtrlType));
  3404. //Text
  3405. preStyle += getXSLTCtrlAttribute("text-align", getStyleValue(degnattrval, "text-align", sCtrlType));
  3406. preStyle += getXSLTCtrlAttribute("vertical-align", getStyleValue(degnattrval, "vertical-align", sCtrlType));
  3407. preStyle += getXSLTCtrlAttribute("word-wrap", getStyleValue(degnattrval, "word-wrap", sCtrlType));
  3408. preStyle += getXSLTCtrlAttribute("line-spacing", getStyleValue(degnattrval, "line-spacing", sCtrlType));
  3409. preStyle += getXSLTCtrlAttribute("letter-spacing", getStyleValue(degnattrval, "letter-spacing", sCtrlType));
  3410. preStyle += getXSLTCtrlAttribute("text-select", getStyleValue(degnattrval, "text-select", sCtrlType));
  3411. //Padding
  3412. preStyle += getXSLTCtrlAttribute("padding", getStyleValue(degnattrval, "padding", sCtrlType));
  3413. preStyle += getXSLTCtrlAttribute("padding-left", getStyleValue(degnattrval, "padding-left", sCtrlType));
  3414. preStyle += getXSLTCtrlAttribute("padding-top", getStyleValue(degnattrval, "padding-top", sCtrlType));
  3415. preStyle += getXSLTCtrlAttribute("padding-right", getStyleValue(degnattrval, "padding-right", sCtrlType));
  3416. preStyle += getXSLTCtrlAttribute("padding-bottom", getStyleValue(degnattrval, "padding-bottom", sCtrlType));
  3417. //Background
  3418. preStyle += getXSLTCtrlAttribute("background-color", getStyleValue(degnattrval, "background-color", sCtrlType));
  3419. preStyle += getXSLTCtrlAttribute("background-image", getStyleValue(degnattrval, "background-image", sCtrlType));
  3420. preStyle += getXSLTCtrlAttribute("background-repeat", getStyleValue(degnattrval, "background-repeat", sCtrlType));
  3421. preStyle += getXSLTCtrlAttribute("background-stretch", getStyleValue(degnattrval, "background-stretch", sCtrlType));
  3422. preStyle += getXSLTCtrlAttribute("background-position", getStyleValue(degnattrval, "background-position", sCtrlType));
  3423. //Border
  3424. preStyle += getXSLTCtrlAttribute("border-color", getStyleValue(degnattrval, "border-color", sCtrlType));
  3425. preStyle += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  3426. preStyle += getXSLTCtrlAttribute("border-style", getStyleValue(degnattrval, "border-style", sCtrlType));
  3427. //Margin
  3428. preStyle += getXSLTCtrlAttribute("margin", getStyleValue(degnattrval, "margin", sCtrlType));
  3429. preStyle += getXSLTCtrlAttribute("margin-left", getStyleValue(degnattrval, "margin-left", sCtrlType));
  3430. preStyle += getXSLTCtrlAttribute("margin-top", getStyleValue(degnattrval, "margin-top", sCtrlType));
  3431. preStyle += getXSLTCtrlAttribute("margin-right", getStyleValue(degnattrval, "margin-right", sCtrlType));
  3432. preStyle += getXSLTCtrlAttribute("margin-bottom", getStyleValue(degnattrval, "margin-bottom", sCtrlType));
  3433. */
  3434. preStyle += " \"";
  3435. return preStyle;
  3436. }
  3437. /**
  3438. * @desc : degnitemnm 에 공백처리를 한다.
  3439. * @
  3440. * @param :
  3441. * @return :
  3442. * @---------------------------------------------------
  3443. */
  3444. function GetDegnitemnmTrans(degnitemnm)
  3445. {
  3446. var spaceStart = false;
  3447. var spaceEnd = false;
  3448. var tempDegnitemnm = "";
  3449. var spaceheader = "<xsl:text disable-output-escaping=\"yes\"><![CDATA[";
  3450. var spacefooter = "]]></xsl:text>";
  3451. var spacetext = "&nbsp;";
  3452. var space = "";
  3453. var strStlen = 0;
  3454. var strEdlen = 0;
  3455. var strtext = "";
  3456. for(var spaceidx = 0; spaceidx < degnitemnm.length; spaceidx++)
  3457. {
  3458. if(degnitemnm.charAt(spaceidx) == " ")
  3459. {
  3460. if(parseInt(degnitemnm.length) <= parseInt(spaceidx+1))
  3461. {
  3462. if(spaceStart == true)
  3463. {
  3464. space += spacetext; // 문자가 빈칸이고 spaceStart -> true이면 빈칸Text를 붙임.
  3465. space += spacefooter;
  3466. tempDegnitemnm += space;
  3467. spaceStart = false;
  3468. strStlen = strEdlen;
  3469. strEdlen++;
  3470. }
  3471. }
  3472. else
  3473. {
  3474. if(degnitemnm.charAt(spaceidx+1) == " ") // 연속 공백인 경우
  3475. {
  3476. if(spaceStart == false) // 문자가 빈칸이고 spaceStart -> false이면 헤더를 붙임.
  3477. {
  3478. // 텍스트 저장하기
  3479. strEdlen = spaceidx;
  3480. strtext = degnitemnm.substring(parseInt(strStlen), parseInt(strEdlen));
  3481. if(isSearchString(strtext, "\n") == true)
  3482. {
  3483. tempDegnitemnm += "<br/>";
  3484. strtext = strtext.setReplaceWord("\n", "");
  3485. }
  3486. tempDegnitemnm += "<![CDATA[";
  3487. tempDegnitemnm += strtext;
  3488. tempDegnitemnm += "]]>";
  3489. strStlen = strEdlen;
  3490. space = spaceheader;
  3491. spaceStart = true;
  3492. }
  3493. space += spacetext; // 문자가 빈칸이고 spaceStart -> true이면 빈칸Text를 붙임.
  3494. strEdlen++;
  3495. }
  3496. else
  3497. {
  3498. if(spaceStart == true) // 문자가 빈칸이고 spaceStart -> true이면 빈칸Text를 붙임.
  3499. {
  3500. space += spacetext;
  3501. }
  3502. strEdlen++;
  3503. continue;
  3504. }
  3505. }
  3506. }
  3507. else
  3508. {
  3509. // 문자열이 빈칸이 아니고 일반 텍스트인 경우
  3510. if(spaceStart == true)
  3511. {
  3512. // 빈칸을 2개 더 붙인다.
  3513. space += spacetext;
  3514. //space += spacetext;
  3515. // Space 텍스트에 footer를 붙이고 임시 디자인아이템명에 붙인다.
  3516. space += spacefooter;
  3517. tempDegnitemnm += space;
  3518. spaceStart = false;
  3519. strStlen = strEdlen;
  3520. }
  3521. continue;
  3522. }
  3523. }
  3524. if(parseInt(strEdlen) < parseInt(degnitemnm.length))
  3525. {
  3526. if(tempDegnitemnm == "")
  3527. {
  3528. strEdlen = 0;
  3529. if(isSearchString(degnitemnm, "\n") == true)
  3530. {
  3531. degnitemnm = degnitemnm.setReplaceWord("\n", "]]><br/><![CDATA[");
  3532. }
  3533. }
  3534. tempDegnitemnm += "<![CDATA[";
  3535. tempDegnitemnm += degnitemnm.substring(parseInt(strEdlen), parseInt(degnitemnm.length));
  3536. tempDegnitemnm += "]]>";
  3537. }
  3538. return tempDegnitemnm;
  3539. }
  3540. /**
  3541. * @desc : RDO, CHK의 XSLT 스타일 값을 얻어온다.(폰트정보는 컨트롤에서)
  3542. * @
  3543. * @param :
  3544. * @return :
  3545. * @history :
  3546. * @---------------------------------------------------
  3547. */
  3548. function getSelXSLTStyleVal(ctrlid, pCtrlPosition, degnattrval, pCtrlType)
  3549. {
  3550. var sLeft = "";
  3551. var sTop= "";
  3552. var sWidth = "";
  3553. var sHeight = "";
  3554. var sStyleMsg = "style=\"position:absolute; ";
  3555. var sCtrlType = null;
  3556. if(pCtrlType != "grp") sCtrlType = pCtrlType;
  3557. if(pCtrlType == "RDO" || pCtrlType == "CHK" || pCtrlType == "BOL" || pCtrlType == "MSL" || pCtrlType == "SSL")
  3558. sCtrlType = "ctrl";
  3559. // position
  3560. if(document.controls(ctrlid) != null)
  3561. {
  3562. sLeft = document.controls(ctrlid).attribute("left")
  3563. }
  3564. else
  3565. sLeft = getStyleValue(degnattrval, "left", sCtrlType);
  3566. if(sLeft == "") sLeft = pCtrlPosition.x;
  3567. else{
  3568. sLeft = parseInt(sLeft);
  3569. pCtrlPosition.x = sLeft;
  3570. }
  3571. sStyleMsg += "left:"+sLeft+"px; ";
  3572. if(document.controls(ctrlid) != null)
  3573. {
  3574. sTop = document.controls(ctrlid).attribute("top")
  3575. }
  3576. else
  3577. sTop= getStyleValue(degnattrval, "top", sCtrlType);
  3578. if(sTop=="")
  3579. sTop = pCtrlPosition.y;
  3580. else{
  3581. sTop = parseInt(sTop);
  3582. pCtrlPosition.y = sTop;
  3583. }
  3584. sStyleMsg += "top:"+sTop+"px; ";
  3585. /*
  3586. if(document.controls(ctrlid) != null)
  3587. {
  3588. sWidth = document.controls(ctrlid).attribute("width")
  3589. }
  3590. else
  3591. sWidth = getStyleValue(degnattrval, "width", sCtrlType);
  3592. if(sWidth == "") sWidth = pCtrlPosition.width;
  3593. else{
  3594. sWidth = parseInt(sWidth);
  3595. pCtrlPosition.width = sWidth;
  3596. }
  3597. sStyleMsg += "width:"+sWidth+"px; ";
  3598. if(document.controls(ctrlid) != null)
  3599. {
  3600. sHeight = document.controls(ctrlid).attribute("height")
  3601. }
  3602. else
  3603. sHeight = getStyleValue(degnattrval, "height", sCtrlType);
  3604. if(sHeight == "") sHeight = pCtrlPosition.height;
  3605. else{
  3606. sHeight = parseInt(sHeight);
  3607. pCtrlPosition.height = sHeight;
  3608. }
  3609. sStyleMsg += "height:"+sHeight+"px; ";
  3610. */
  3611. if(pCtrlType != "grp" && pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "SSL")
  3612. {
  3613. // 테이블 전체 크기를 ctrlheight로 받으면 변경할것.
  3614. // 테이블 전체 크기를 ctrlheight로 받도록 하지 않은 이전 버전에 미리 적용할 경우 테이블이 일그러져 보임.
  3615. /*
  3616. var tmpCtrlType ="";
  3617. if(ctrlid != "")
  3618. {
  3619. tmpCtrlType = ctrlid.split("_")[0];
  3620. }
  3621. if(tmpCtrlType == "TBL" || tmpCtrlType == "DGN" || tmpCtrlType == "OPN" || tmpCtrlType == "CCN")
  3622. sStyleMsg += "ctrlheight:"+sHeight+"px; ";
  3623. else
  3624. sStyleMsg += "height:"+sHeight+"px; ";
  3625. */
  3626. }
  3627. if(document.controls(ctrlid) != null)
  3628. {
  3629. // FontName
  3630. var fontfamilyArr = document.controls(ctrlid).attribute("font-family").split(",");
  3631. if(fontfamilyArr.length > 0)
  3632. {
  3633. sStyleMsg += getXSLTCtrlAttribute("font-family", fontfamilyArr[0]);
  3634. }
  3635. else
  3636. sStyleMsg += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  3637. // FontSize
  3638. var fontSize = document.controls(ctrlid).attribute("font-size");
  3639. if(fontSize != "")
  3640. sStyleMsg += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  3641. else
  3642. sStyleMsg += getXSLTCtrlAttribute("font-size", "9");
  3643. sStyleMsg += getXSLTCtrlAttribute("font-weight", document.controls(ctrlid).attribute("font-weight"));
  3644. sStyleMsg += getXSLTCtrlAttribute("font-style", document.controls(ctrlid).attribute("font-style"));
  3645. sStyleMsg += getXSLTCtrlAttribute("text-decoration", document.controls(ctrlid).attribute("text-decoration"));
  3646. var fontColor = document.controls(ctrlid).attribute("color");
  3647. if(fontColor != "")
  3648. {
  3649. if(fontColor.charAt(0) != "#")
  3650. sStyleMsg += getXSLTCtrlAttribute("color", "#" + fontColor);
  3651. else
  3652. sStyleMsg += getXSLTCtrlAttribute("color", fontColor);
  3653. }
  3654. }
  3655. else
  3656. {
  3657. sStyleMsg += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  3658. var fontSize = getStyleValue(degnattrval, "font-size", sCtrlType);
  3659. if(fontSize != "")
  3660. sStyleMsg += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  3661. else
  3662. sStyleMsg += getXSLTCtrlAttribute("font-size", "9");
  3663. //sStyleMsg += getXSLTCtrlAttribute("font-size", getStyleValue(degnattrval, "font-size", sCtrlType));
  3664. sStyleMsg += getXSLTCtrlAttribute("font-weight", getStyleValue(degnattrval, "font-weight", sCtrlType));
  3665. sStyleMsg += getXSLTCtrlAttribute("font-style", getStyleValue(degnattrval, "font-style", sCtrlType));
  3666. sStyleMsg += getXSLTCtrlAttribute("text-decoration", getStyleValue(degnattrval, "text-decoration", sCtrlType));
  3667. sStyleMsg += getXSLTCtrlAttribute("color", getStyleValue(degnattrval, "color", sCtrlType));
  3668. }
  3669. sStyleMsg += "\"";
  3670. return sStyleMsg;
  3671. }
  3672. /**
  3673. * @desc : SSU의 XSLT 스타일 값을 얻어온다.(폰트정보는 컨트롤에서)
  3674. * @
  3675. * @param :
  3676. * @return :
  3677. * @history :
  3678. * @---------------------------------------------------
  3679. */
  3680. function getSelSSUXSLTStyleVal(ctrlid, pCtrlPosition, degnattrval, pCtrlType)
  3681. {
  3682. var strArr = new Array(2);
  3683. var sLeft = "";
  3684. var sLabelLeft = "";
  3685. var sTop = "";
  3686. var sWidth = "";
  3687. var sHeight = "";
  3688. var sStyleMsg = "style=\"position:absolute; ";
  3689. var sLabelStyleMsg = "style=\"position:absolute; ";
  3690. var sCtrlType = null;
  3691. if(pCtrlType != "grp") sCtrlType = pCtrlType;
  3692. if(pCtrlType == "RDO" || pCtrlType == "CHK" || pCtrlType == "BOL" || pCtrlType == "MSL" || pCtrlType == "SSL")
  3693. sCtrlType = "ctrl";
  3694. // position
  3695. if(document.controls(ctrlid) != null)
  3696. {
  3697. sLeft = document.controls(ctrlid).attribute("left");
  3698. sTop = document.controls(ctrlid).attribute("top");
  3699. sWidth = document.controls(ctrlid).attribute("width");
  3700. sHeight = document.controls(ctrlid).attribute("height");
  3701. }
  3702. else
  3703. {
  3704. sLeft = getStyleValue(degnattrval, "left", sCtrlType);
  3705. sTop= getStyleValue(degnattrval, "top", sCtrlType);
  3706. sWidth = getStyleValue(degnattrval, "width", sCtrlType);
  3707. sHeight = getStyleValue(degnattrval, "height", sCtrlType);
  3708. }
  3709. if(sLeft == "") sLeft = pCtrlPosition.x;
  3710. else{
  3711. sLeft = parseInt(sLeft);
  3712. pCtrlPosition.x = sLeft;
  3713. }
  3714. if(sTop=="")
  3715. sTop = pCtrlPosition.y;
  3716. else{
  3717. sTop = parseInt(sTop);
  3718. pCtrlPosition.y = sTop;
  3719. }
  3720. if(sWidth == "") sWidth = pCtrlPosition.width;
  3721. else{
  3722. sWidth = parseInt(sWidth);
  3723. pCtrlPosition.width = sWidth;
  3724. }
  3725. if(sHeight == "") sHeight = pCtrlPosition.height;
  3726. else{
  3727. sHeight = parseInt(sHeight);
  3728. pCtrlPosition.height = sHeight;
  3729. }
  3730. sStyleMsg += "left:"+sLeft+"px; ";
  3731. sLabelStyleMsg += "left:"+(parseInt(sLeft)+15)+"px; ";
  3732. sStyleMsg += "top:"+sTop+"px; ";
  3733. sLabelStyleMsg += "top:"+sTop+"px; ";
  3734. sStyleMsg += "width:"+sWidth+"px; ";
  3735. sLabelStyleMsg += "width:"+sWidth+"px; ";
  3736. sStyleMsg += "height:"+sHeight+"px; ";
  3737. sLabelStyleMsg += "height:"+sHeight+"px; ";
  3738. // Font
  3739. if(document.controls(ctrlid) != null)
  3740. {
  3741. // FontName
  3742. var fontfamilyArr = document.controls(ctrlid).attribute("font-family").split(",");
  3743. if(fontfamilyArr.length > 0)
  3744. {
  3745. sLabelStyleMsg += getXSLTCtrlAttribute("font-family", fontfamilyArr[0]);
  3746. }
  3747. else
  3748. sLabelStyleMsg += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  3749. // FontSize
  3750. var fontSize = document.controls(ctrlid).attribute("font-size");
  3751. if(fontSize != "")
  3752. sLabelStyleMsg += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  3753. else
  3754. sLabelStyleMsg += getXSLTCtrlAttribute("font-size", "9");
  3755. sLabelStyleMsg += getXSLTCtrlAttribute("font-weight", document.controls(ctrlid).attribute("font-weight"));
  3756. sLabelStyleMsg += getXSLTCtrlAttribute("font-style", document.controls(ctrlid).attribute("font-style"));
  3757. sLabelStyleMsg += getXSLTCtrlAttribute("text-decoration", document.controls(ctrlid).attribute("text-decoration"));
  3758. var fontColor = document.controls(ctrlid).attribute("color");
  3759. if(fontColor != "")
  3760. {
  3761. if(fontColor.charAt(0) != "#")
  3762. sLabelStyleMsg += getXSLTCtrlAttribute("color", "#" + fontColor);
  3763. else
  3764. sLabelStyleMsg += getXSLTCtrlAttribute("color", fontColor);
  3765. }
  3766. }
  3767. else
  3768. {
  3769. sLabelStyleMsg += getXSLTCtrlAttribute("font-family", getStyleValue(degnattrval, "font-family", sCtrlType));
  3770. var fontSize = getStyleValue(degnattrval, "font-size", sCtrlType);
  3771. if(fontSize != "")
  3772. sLabelStyleMsg += getXSLTCtrlAttribute("font-size", (parseInt(fontSize) - 3));
  3773. else
  3774. sLabelStyleMsg += getXSLTCtrlAttribute("font-size", "9");
  3775. sLabelStyleMsg += getXSLTCtrlAttribute("font-weight", getStyleValue(degnattrval, "font-weight", sCtrlType));
  3776. sLabelStyleMsg += getXSLTCtrlAttribute("font-style", getStyleValue(degnattrval, "font-style", sCtrlType));
  3777. sLabelStyleMsg += getXSLTCtrlAttribute("text-decoration", getStyleValue(degnattrval, "text-decoration", sCtrlType));
  3778. sLabelStyleMsg += getXSLTCtrlAttribute("color", getStyleValue(degnattrval, "color", sCtrlType));
  3779. }
  3780. sStyleMsg += "\"";
  3781. sLabelStyleMsg += "\"";
  3782. strArr[0] = sStyleMsg;
  3783. strArr[1] = sLabelStyleMsg;
  3784. return strArr;
  3785. }
  3786. /**
  3787. * @desc : XSLT 스타일 값을 얻어온다.(폰트정보는 컨트롤에서)
  3788. * @
  3789. * @param :
  3790. * @return :
  3791. * @history : 2008-12-10 컨트롤의 폰트 정보를 얻어온다.
  3792. * @---------------------------------------------------
  3793. */
  3794. function getShapeXSLTStyleVal(ctrlid, pCtrlPosition, degnattrval, pCtrlType)
  3795. {
  3796. var sLeft = "";
  3797. var sTop= "";
  3798. var sWidth = "";
  3799. var sHeight = "";
  3800. var sStyleMsg = "style=\"position:absolute; ";
  3801. var sCtrlType = null;
  3802. if(pCtrlType != "grp") sCtrlType = pCtrlType;
  3803. if(pCtrlType == "RDO" || pCtrlType == "CHK" || pCtrlType == "BOL" || pCtrlType == "MSL" || pCtrlType == "SSL")
  3804. sCtrlType = "ctrl";
  3805. // position
  3806. if(document.controls(ctrlid) != null)
  3807. {
  3808. sLeft = document.controls(ctrlid).attribute("left");
  3809. }
  3810. else
  3811. sLeft = getStyleValue(degnattrval, "left", sCtrlType);
  3812. if(sLeft == "") sLeft = pCtrlPosition.x;
  3813. else{
  3814. sLeft = parseInt(sLeft);
  3815. pCtrlPosition.x = sLeft;
  3816. }
  3817. if(pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  3818. sStyleMsg += "left:"+sLeft+"px; ";
  3819. if(document.controls(ctrlid) != null)
  3820. {
  3821. sTop = document.controls(ctrlid).attribute("top");
  3822. }
  3823. else
  3824. sTop= getStyleValue(degnattrval, "top", sCtrlType);
  3825. if(sTop=="")
  3826. sTop = pCtrlPosition.y;
  3827. else{
  3828. sTop = parseInt(sTop);
  3829. pCtrlPosition.y = sTop;
  3830. }
  3831. if(pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  3832. sStyleMsg += "top:"+sTop+"px; ";
  3833. if(document.controls(ctrlid) != null)
  3834. {
  3835. sWidth = document.controls(ctrlid).attribute("width");
  3836. }
  3837. else
  3838. sWidth = getStyleValue(degnattrval, "width", sCtrlType);
  3839. if(sWidth == "") sWidth = pCtrlPosition.width;
  3840. else{
  3841. sWidth = parseInt(sWidth) - 1;
  3842. pCtrlPosition.width = sWidth;
  3843. }
  3844. if(pCtrlType != "grp" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  3845. sStyleMsg += "width:"+sWidth+"px; ";
  3846. if(document.controls(ctrlid) != null)
  3847. {
  3848. sHeight = document.controls(ctrlid).attribute("height");
  3849. }
  3850. else
  3851. sHeight = getStyleValue(degnattrval, "height", sCtrlType);
  3852. if(sHeight == "") sHeight = pCtrlPosition.height;
  3853. else{
  3854. sHeight = parseInt(sHeight) - 1;
  3855. pCtrlPosition.height = sHeight;
  3856. }
  3857. if(pCtrlType != "grp" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL")
  3858. {
  3859. sStyleMsg += "height:"+sHeight+"px; ";
  3860. }
  3861. //Background
  3862. sStyleMsg += getXSLTCtrlAttribute("background-color", getStyleValue(degnattrval, "background-color", sCtrlType));
  3863. sStyleMsg += getXSLTCtrlAttribute("background-image", getStyleValue(degnattrval, "background-image", sCtrlType));
  3864. sStyleMsg += getXSLTCtrlAttribute("background-repeat", getStyleValue(degnattrval, "background-repeat", sCtrlType));
  3865. sStyleMsg += getXSLTCtrlAttribute("background-stretch", getStyleValue(degnattrval, "background-stretch", sCtrlType));
  3866. sStyleMsg += getXSLTCtrlAttribute("background-position", getStyleValue(degnattrval, "background-position", sCtrlType));
  3867. //Border
  3868. var strBorderStyle = "";
  3869. if(document.controls(ctrlid) != null)
  3870. strBorderStyle = document.controls(ctrlid).attribute("border-style");
  3871. if(strBorderStyle != "")
  3872. {
  3873. sStyleMsg += getXSLTCtrlAttribute("border-style", strBorderStyle);
  3874. if(getStyleValue(degnattrval, "border-width", sCtrlType) != "")
  3875. sStyleMsg += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  3876. else
  3877. sStyleMsg += getXSLTCtrlAttribute("border-width", "1");
  3878. }
  3879. else
  3880. {
  3881. sStyleMsg += getXSLTCtrlAttribute("border-style", getStyleValue(degnattrval, "border-style", sCtrlType));
  3882. sStyleMsg += getXSLTCtrlAttribute("border-width", getStyleValue(degnattrval, "border-width", sCtrlType));
  3883. sStyleMsg += getXSLTCtrlAttribute("border-color", getStyleValue(degnattrval, "border-color", sCtrlType));
  3884. }
  3885. if(pCtrlType != "RDO" && pCtrlType != "CHK" && pCtrlType != "BOL" && pCtrlType != "MSL" && pCtrlType != "IMG")
  3886. sStyleMsg += "\"";
  3887. return sStyleMsg;
  3888. }