123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419 |
- <?xml version="1.0" encoding="EUC-KR"?>
- <?xml-stylesheet type="text/css" href="../../../com/commonweb/css/common.css" ?>
- <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
- <xhtml:head>
- <xhtml:title>Outline View</xhtml:title>
- <model id="model1">
- <instance id="instance1">
- <root xmlns="">
- <main>
- <temp>
- <stepinfo>
- <info>
- <stepno/>
- <stepflagcd/>
- <stepmemo/>
- <lnkstepno/>
- <times/>
- <startendflag/>
- <swimlineno/>
- <refseq/>
- <decirflag/>
- <setno/>
- <settypecd/>
- <m/>
- <stepnm/>
- <formexistyn/>
- <dcsnstep/>
- <orgstepno/>
- <fixedStCntl/>
- <tmpstepnm/>
- <stepattrflag/>
- <stepsettypecd/>
- </info>
- </stepinfo>
- <decisioninfo>
- <info>
- <stepno/>
- <deciseq/>
- <lnkstepno/>
- <m/>
- </info>
- </decisioninfo>
- <selectedstep>
- <stepno/>
- <stepflagcd/>
- <csvlist/>
- </selectedstep>
- <uid/>
- </temp>
- <outlineinfo>
- <info>
- <cpgno/>
- <cpghistseq/>
- <cpgnm/>
- <swimlineno>0</swimlineno>
- <cpgflagcd/>
- <cpgorddeptcd/>
- <settype/>
- </info>
- <menu>
- <popupmenu1>
- <item>
- <name>연결설정</name>
- <func>fSetLink</func>
- </item>
- <item>
- <name>연결해제</name>
- <func>fDelLink</func>
- </item>
- <item>
- <name>-</name>
- <func/>
- </item>
- <item>
- <name>시작스텝</name>
- <func>fSetStartStep</func>
- </item>
- <item>
- <name>종료스텝</name>
- <func>fSetEndStep</func>
- </item>
- <item>
- <name>-</name>
- <func/>
- </item>
- <item>
- <name>입원필요 스텝</name>
- <func>fSetInHospStep</func>
- </item>
- <item>
- <name>퇴원필요 스텝</name>
- <func>fSetDschHospStep</func>
- </item>
- <item>
- <name>-</name>
- <func/>
- </item>
- <item>
- <name>외래예약필요 스텝</name>
- <func>fSetOutHospStep</func>
- </item>
- <item>
- <name>DSC필요 스텝</name>
- <func>fSetDSCHospStep</func>
- </item>
- <item>
- <name>-</name>
- <func/>
- </item>
- <item>
- <name>삭제</name>
- <func>fDelCntl</func>
- </item>
- <item>
- <name>-</name>
- <func/>
- </item>
- <item>
- <name>스텝 상세정보</name>
- <func>fViewDetailPopup</func>
- </item>
- </popupmenu1>
- <popupmenu2>
- <item>
- <name>스윔라인추가</name>
- <func>fAddSwimLine</func>
- </item>
- <item>
- <name>스윔라인삭제</name>
- <func>fDelSwimLine</func>
- </item>
- <item>
- <name>-</name>
- <func/>
- </item>
- <item>
- <name>초기화</name>
- <func>fOutlineCntlInit</func>
- </item>
- </popupmenu2>
- <popupmenu3>
- <item>
- <name>결정하기</name>
- <func>fDecision</func>
- </item>
- </popupmenu3>
- <popupmenu4>
- <item>
- <name>D0 Step 추가</name>
- <func>fAddD0Step</func>
- </item>
- <item>
- <name>-</name>
- <func/>
- </item>
- <item>
- <name>스윔라인추가</name>
- <func>fAddSwimLine</func>
- </item>
- <item>
- <name>스윔라인삭제</name>
- <func>fDelSwimLine</func>
- </item>
- <item>
- <name>-</name>
- <func/>
- </item>
- <item>
- <name>초기화</name>
- <func>fOutlineCntlInit</func>
- </item>
- </popupmenu4>
- <popupmenu5>
- <item>
- <name>시작스텝 선택</name>
- <func>fSetupStartStep</func>
- </item>
- <item>
- <name>종료스텝 선택</name>
- <func>fSetupEndStep</func>
- </item>
- <item>
- <name>-</name>
- <func/>
- </item>
- <item>
- <name>단일 스텝 선택</name>
- <func>fSetupOneStep</func>
- </item>
- </popupmenu5>
- <popupmenu6>
- <item>
- <name>시작스텝 선택</name>
- <func>fSetupStartStep</func>
- </item>
- </popupmenu6>
- <popupmenu7>
- <item>
- <name>결정하기모드 취소</name>
- <func>fCnclDecisionMode</func>
- </item>
- </popupmenu7>
- <popupmenu8>
- <item>
- <name>CP 적용범위 선택</name>
- <func>fSetupCPStep</func>
- </item>
- </popupmenu8>
- </menu>
- </outlineinfo>
- <decisionlist/>
- <seldecision/>
- <seldecisionstep/>
- <seldecisionstepno/>
- <seldecisionlist/>
- <prcp/>
- <sortedsteplist/>
- </main>
- <hidden>
- </hidden>
- <send>
- </send>
- <init>
- </init>
- <temp>
- <copysset>
- <copy>
- </copy>
- </copysset>
- <getvalue/>
- <getdata>
- <authflag/>
- </getdata>
- <selecedkind>
- <kind/>
- </selecedkind>
- <savedfolder>
- <item>
- </item>
- </savedfolder>
- <delsteplist/>
- <deldecisionlist/>
- <decisionlist/>
- <openeruid/>
- <startstepno/>
- <endstepno/>
- </temp>
- </root>
- </instance>
- <script type="javascript" ev:event="xforms-ready">
- <![CDATA[
- OpenerKind = opener.window.javascript.OpenerKind;
-
- fInitialize();
-
- if(opener.window.javascript.OpenerKind == "GPS"){
- opener.window.javascript.fInitializeOutline();
- }else{
- ivw_detail.src= "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw";
- }
- ]]>
- </script>
- <script type="javascript" ev:event="xforms-model-construct-done">
- <![CDATA[
- //권한설정
- if(opener.window.javascript.OpenerKind == "GPS"){
- setSpclScrnAuth("R", false);
- //model.setValue("/root/temp/getdata/authflag", opener.model.getValue("/root/temp/getdata/authflag") );
- //버튼 영역 보이지 않음
- grp_button.visible = false;
- grp_swimline.visible = true;
- //컨트롤 사이즈 변경
- grp_swimline.attribute("width") = "1205px";
- if( parseInt(opener.ivw_outline.attribute("height")) == 766 ){
- grp_swimline.attribute("height") = "764px";
- }else if( parseInt(opener.ivw_outline.attribute("height")) == 480 ){
- grp_swimline.attribute("height") = "478px";
- }else{ // ( parseInt(opener.ivw_outline.attribute("height")) == 883 )
- grp_swimline.attribute("height") = "811px";
- }
- }else{
- if( opener.window.javascript.getAuth() == "10000000" ){
- setSpclScrnAuth("R", false);
- }else{
- //버튼 영역 보이지 않음
- grp_button.visible = true;
- setSpclScrnAuth("X", false);
- }
- }
- ]]>
- </script>
- <submission id="TRMMP02202" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send" resultref="/root/main/prcp"/>
- <submission id="MRMMP01901" mediatype="application/x-www-form-urlencoded" method="post" ref="/root/send"/>
- </model>
- <script type="javascript" src="../../../com/commonweb/js/common.js"/>
- <script type="javascript" src="../../../com/commonweb/js/tfHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/dateHelper.js"/>
- <script type="javascript" src="../../../com/commonweb/js/stringHelper.js"/>
- <script type="javascript">
- <![CDATA[
- // 아래 스크립트는 "SPMMP01900.js" 파일 import로 대체할 예정임!!
- var lineNo = model.getValue("/root/main/outlineinfo/info/swimlineno"); //총 스윔라인 수
- var cpgflagcd = "";
- var cpgflag = "";
- var settype = "";
- var grpControlCnt; //생성된 총 그룹 컨트롤 갯수(컨트롤 생성시 위치 재배치를 위해 따로 관리)
- var controlCnt = 0; //생성된 컨트롤 갯수(나머지 컨트롤 카운트)
- var dcsCntlCnt = 1; //decision 컨트롤의 총 갯수(인스턴수 마지막 인덱스가 된다)
- var lineYpos;
- var linesControlMaxCnt = new Array(); //스윔라인 영역의 갯수
- var swimlineControlArray = new Array(); //라인 컨트롤의 배열(라인종류를 담는다)
- var selectSectionsLine = new Array(); //4*1 의 변경된 색상을 갖는 라인배열...
- selectSectionsLine[0] = "";
- selectSectionsLine[1] = "";
- selectSectionsLine[2] = "";
- selectSectionsLine[3] = "";
- var swimLineHight = 165; //한 스윔라인의 높이 //<-210
- var swimLineWidth = 815; //스윔라인의 넓이 //<-792
- var selectedLineSection = ""; //선택된 라인(ex:1,2...)
- var selectedControl = null; //선택된 아이템(컨트롤)
- var currentStepCntl = null; //현재 포커스를 가진 아이템(그룹아이디)
- var changedCntl = null; //스텝의 개요를 변경할 때, 이전에 값이 변한 스텝의 id 가 필요함.
- var prevStepCntl = null; //부모가 될 아이템(그룹아이디)
- var childStepCntl = null; //자식이 될 아이템(그룹아이디)
- var maxControlCnt = 2; //한줄 단위로, 최대 default 컨트롤 갯수
- var initControlCnt = 0; //외곽 스윔라인 컨트롤 갯수(나머지 컨트롤을 초기화 할때 initControlCnt 부터 다시 카운트 한다)
- var stepRef = "/root/main/steplist/info";
- var dcsRef = "/root/main/decisionlist/info";
- var sortedStepRef = "/root/main/sortedsteplist/info";
- var tmpIncreaseVal = 0; //임시변수, 스타트포인트의 감소 문제를 해결하고 나면, 삭제 필!
- var outsideControlCnt = 0; //바깥 아웃라인의 라인컨트롤 갯수(컨트롤 생성시, outsideControlCnt+1보다 큰 컨트롤들을 삭제한다)
- var transViewSize = 0;
- var connectionMode = "false";
- var decisionMode = "false";
- var readyPrcp = "N";
- var val_callfCreateControlYN = "N"; //약속처방/서식이 등록이 되었는지 여부, 스텝 좌측의 '*' 유무를 가린다
- var OpenerKind = "";
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : generater 로딩 후 cpg 조회시, outline을 구성하기 위해 초기 변수를 셋팅해준다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function initGlobalVariant(arg1, arg2){
- grpControlCnt = arg1;
- outsideControlCnt = arg2;
- linesControlMaxCnt = new Array();
- for(var i=0; i<parseInt(lineNo); i++){
- var no = i + 1;
- var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + no.toString() + "']");
- linesControlMaxCnt[i] = nodeList.length;
-
- if(linesControlMaxCnt[i] > 2 && linesControlMaxCnt[i] > linesControlMaxCnt[i-1]){
- maxControlCnt = linesControlMaxCnt[i];
- }
- }
-
- nodeList = instance1.selectNodes(dcsRef);
- dcsCntlCnt = nodeList.length + 1;
-
- if(maxControlCnt > 2){
- //fAdjustLine("ex", "392");
- fAdjustLine("allEx", "392");
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : opener에서 스윔라인 수를 수정할 경우, outline 및 모든 컨틀롤 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOutlineCntlInit(){
- for(var i=0; i<=controlCnt; i++){
- var cntlID = swimlineControlArray[i];
- if( !( cntlID == "" || cntlID == null ) ){
- if( cntlID.substr(cntlID.length-3, 1) == "_" ){
- cntlID = cntlID.substr(0, cntlID.length-3);
- }
- grp_swimline.removeChild(cntlID);
- grp_swimline.refresh();
- }
- }
-
- outsideControlCnt = 0;
- tmpIncreaseVal = 0;
- controlCnt = 0;
- grpControlCnt = 0;
- //maxControlCnt = 2;
- //swimlineControlArray.slice(0, swimlineControlArray.length);
- swimlineControlArray = new Array();
- //linesControlMaxCnt.slice(0, linesControlMaxCnt.length);
- //인스턴스를 비운다.
- model.removeNodeset("/root/main/steplist");
- model.removeNodeset("/root/main/decisionlist");
- model.makeNode("/root/main/decisionlist");
- selectSectionsLine[0] = "";
- selectSectionsLine[1] = "";
- selectSectionsLine[2] = "";
- selectSectionsLine[3] = "";
- selectedLineSection = "";
- selectedControl = null;
- currentStepCntl = null;
- changedCntl = null;
- prevStepCntl = null;
- dcsCntlCnt = 1;
- swimLineHight = 165; //한 스윔라인의 높이 //<-210
- swimLineWidth = 815; //스윔라인의 넓이
- maxControlCnt = 2;
- connectionMode = "false";
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize() {
-
- model.setValue("/root/temp/getdata/authflag", opener.model.getValue("/root/temp/getdata/authflag") );
-
- lineNo = model.getValue("/root/main/outlineinfo/info/swimlineno");
- cpgflagcd = opener.model.getValue("/root/main/masterinfo/info/cpgflagcd");
- cpgflag = model.getValue("/root/main/outlineinfo/info/cpgflagcd");
- if(cpgflagcd == "01") settype = "W";
- else settype = "G";
-
- if( !(lineNo == "0" || lineNo == "") ){
- arrNum = parseInt(lineNo) - 1;
- linesControlMaxCnt = new Array(arrNum);
- }else{
- linesControlMaxCnt = new Array(lineNo);
- }
- //linesControlMaxCnt.slice(0, linesControlMaxCnt.length-1);
- for(var i=0; i<lineNo; i++){
- linesControlMaxCnt[i] = 0;
- }
-
- var y=0;
- var cy=swimLineHight;
- controlCnt = 0;
- grpControlCnt = 0;
-
- //if( maxControlCnt > 2 ) swimLineWidth = 392 * maxControlCnt; //최대 갯수에 따라 변경됨...
-
- ctrlID = "xforms:line" + (controlCnt++);
- ctrl = grp_swimline.createChild("xforms:line", "id:"+ctrlID + "; x1:0px; y1:0px ; x2:" + swimLineWidth + "px; y2: 0px; ");
- swimlineControlArray[controlCnt-1] = ctrlID+"_UW"; //up+width
- for(var i=1; i<=lineNo; i++){
- fCreateSwimLine(y, cy);
- y = cy; //세로 아웃라인의 y1
- cy = cy + swimLineHight; //세로 아웃라인의 y2
- }
-
- //초기화 시, 아이뷰어의 대상 화면을 결정한다.
- //model.setValue("/root/main/temp/uid", getOpenerUID());
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 버튼을 생성한다. (사용 안함)
- * @param :
- * @return :
- * @---------------------------------------------------
- *
- function fCreateButton(){
- var button1 = "xforms:button";
- var ctrlID;
- var ctrl = null;
- ctrlID = button1 + (controlCnt++);
- var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + 612 + ";top:" +5 + ";width:42; height:19 ; text:" + "A");
- ctrl.attribute("class") = "btn2_letter2";
- ctrlID = button1 + (controlCnt++);
- var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 45) + ";top:" + 5 + ";width:42; height:19 ; text:" + "D");
- ctrl.attribute("class") = "btn2_letter2";
- ctrlID = button1 + (controlCnt++);
- var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 90) + ";top:" + 5 + ";width:42; height:19 ; text:" + "B");
- ctrl.attribute("class") = "btn2_letter2";
- ctrlID = button1 + (controlCnt++);
- var ctrl = body.createChild(button1, "id:" + ctrlID + "; cursor:cursor; left:" + (612 + 135) + ";top:" + 5 + ";width:42; height:19 ; text:" + "삭제");
- ctrl.attribute("class") = "btn2_letter2";
- }
- */
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 라인을 생성한다.
- * @param : y, cy
- * @return :
- * @---------------------------------------------------
- */
- function fCreateSwimLine(y, cy) {
- var line1 = "xforms:line";
- var ctrlID;
- var ctrl = null;
- var x=0;
- var cx = swimLineWidth -2;
-
- ctrlID = line1 + (controlCnt++);
- ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + x + "px; y1:" + y + "px; x2:" + x + "px; y2:" + cy+ "px; ");
- swimlineControlArray[controlCnt-1] = ctrlID+"_LH"; //left+height
- ctrlID = line1 + (controlCnt++);
- ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + cx + "px; y1:" + y + "px; x2:" + cx + "px; y2:" + cy+ "px; ");
- swimlineControlArray[controlCnt-1] = ctrlID+"_RH"; //right+height
- ctrlID = line1 + (controlCnt++);
- ctrl = grp_swimline.createChild(line1, "id:"+ctrlID + "; x1:" + x + "px; y1:" + cy + "px; x2:" + cx + "px; y2:" + cy+ "px; ");
- swimlineControlArray[controlCnt-1] = ctrlID+"_DW"; //down+width
- ctrl.refresh();
- outsideControlCnt = controlCnt;
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 마지막 스윔라인을 삭제한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDelLastSwimLine(){
- var endPnt = parseInt(outsideControlCnt);
- var cnt = 0;
-
- for (var i=endPnt; i>=0; i--){
- var str = swimlineControlArray[i];
-
- if(!isNull(str)){
- if(str.substr(0,12) != "xforms:group"){
- var cntlStr = str.substr(str.length-2, 2);
- if( cnt<3 && (cntlStr== "DW" || cntlStr == "RH" || cntlStr == "LH") ){
- grp_swimline.removeChild( str.substr(0, str.length-3) );
- swimlineControlArray[i] = "";
- cnt++;
- }else {
- return;
- }
- }
- }
- }
-
- var a = swimlineControlArray.slice(0, (endPnt-3));
- var b = swimlineControlArray.slice(endPnt, swimlineControlArray.length);
- swimlineControlArray.slice(0, swimlineControlArray.length);
- swimlineControlArray = a.concat(b);
- outsideControlCnt = outsideControlCnt - 3;
-
- //(요기) 마지막 라인을 삭제 하고 다시 마지막에 라인을 추가했을 때, 라인 선택을 하면 스크립트 오류 발생, 전체 컨트롤을 처음부터 다시 그려줘야 오류가 안 생긴다
- /*
- var stepNodeList = instance1.selectNodes(stepRef);
- var nodeListCSV = getNodeListCSV(stepNodeList);
- opener.window.javascript.fCreateOutLineView(); //fOutlineCntlInit(), fInitialize()
- var agr1 = model.getValue("/root/outlineinfo/swimlineno"); //그려야 할 컨트롤 갯수
- var agr2 = (parseInt(model.getValue("/root/outlineinfo/swimlineno")) * 3) - 1; //아웃라인을 구성하는 라인 컨트롤 갯수
- initGlobalVariant(agr1, agr2);
- setCSVToNode("/root/main/steplist", nodeListCSV, "info");
- */
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 외곽 스윔라인의 길이를 연장한다.
- * @param : flag(extention/reduction), width, alpha(MGPS에서 열때는 width가 더 넓다)
- * @return :
- * @---------------------------------------------------
- */
- function fAdjustLine( flag, width, alpha ){
- //alert( swimLineWidth, + " , " + width, alpha );
- var asLineControl = null;
- var lngth = swimlineControlArray.length;
- var str;
- var width = parseInt(width);
- if(flag == "allEx"){
- if( alpha == "" || alpha == null ) {
- var alphaValue = 0;
- }
- else {
- var alphaValue = parseInt(alpha);
-
- //detail view의 그리드에 대한 사이즈 설정
- if(opener.window.javascript.OpenerKind == "GEN"){
- ivw_detail.attribute("src") = "../../../emr/prcpmngtweb/xrw/SPMMP02200_DetailView.xrw";
- }
- }
-
- if(maxControlCnt <= 3){
- width = 1190 - swimLineWidth - 20 + alphaValue; //20:우측 세로스크롤이 생길 영역의 넓이
- //width = swimLineWidth - 1190;
- }else {
- width = (maxControlCnt * width) - swimLineWidth; //최대 max 스텝수가 3개 이상일 때 벗어나는 오류 조치 (2009.02.25)
- }
- transViewSize = width;
- flag = "ex";
- } else if(flag == "allRe"){
- width = transViewSize;
- flag = "re";
- }
-
- if(flag == "ex"){
- for (i=0; i<lngth; i++){
- str = swimlineControlArray[i];
- if( !(str =="" || str == null) ){
- if( str.substr(str.length-2, 2) == "UW" ){
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
- swimLineWidth = parseInt(asLineControl.attribute("x2"));
-
- } else if(str.substr(str.length-2, 2) == "DW" ){
- asLineControl = document.controls(str.substr(0, str.length-3));
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
-
- } else if(str.substr(str.length-2, 2) == "RH" ){
- asLineControl = document.controls(str.substr(0, str.length-3));
- asLineControl.attribute("x1") = parseInt(asLineControl.attribute("x1")) + width;
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) + width;
- }
- }
- }
- } else if(flag == "re"){
- for (i=0; i<lngth; i++){
- str = swimlineControlArray[i];
- if( !(str =="" || str == null) ){
- if( str.substr(str.length-2, 2) == "UW" ){
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
-
- swimLineWidth = asLineControl.attribute("x2");
-
- } else if(str.substr(str.length-2, 2) == "DW" ){
- asLineControl = document.controls(str.substr(0, str.length-3));
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
-
- } else if(str.substr(str.length-2, 2) == "RH" ){
- asLineControl = document.controls(str.substr(0, str.length-3));
- asLineControl.attribute("x1") = parseInt(asLineControl.attribute("x1")) - width;
- asLineControl.attribute("x2") = parseInt(asLineControl.attribute("x2")) - width;
- }
- }
- }
- }
- selectedControl = null;
-
- if(opener.window.javascript.OpenerKind == "GPS"){
- fCreateControl();
- fInitLoadingForm();
-
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤을 왼쪽으로 옮긴다. (한꺼번에 모든 컨트롤을 다시 재생성 하므로, 사용 안 함)
- * @param : no
- * @return :
- * @---------------------------------------------------
- *
- function fModeControl( no ){
- //같은 라인에 미리 생성된 아이템의 x1, x2 좌표를 - 시킨다.
- var y1 = (no-1) * swimLineHight;
- var y2 = y1 + swimLineHight;
-
- for(var i = 0; i < grpControlCnt; i++){
- var cntl = document.controls( "xforms:group" + i );
- var cntlY1 = parseInt(cntl.attribute("top"));
- var cntlY2 = parseInt(cntl.attribute("height"));
-
- if(cntlY1 > y1 && (cntlY1+cntlY2) < y2) {
- var orgX = parseInt(cntl.attribute("left"));
- cntl.attribute("left") = orgX - 200;
- }
- }
- }
- */
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 해당 스텝에 대한 노드(인스턴스)를 먼저 생성한다.
- * @param : flag(A/D/B), no(selectedLineSection)
- * @return :
- * @---------------------------------------------------
- */
- function fMakeNode( flag, no ){
- if( isNull(opener.model.getValue("/root/main/masterinfo/info/swimlineno")) ){
- messageBox ( "스윔라인 수를", "C001" );
- return;
- }
-
- no = parseInt(no);
- grpControlCnt = parseInt(grpControlCnt) + 1;
- linesControlMaxCnt[no-1] = parseInt( linesControlMaxCnt[no-1] ) + 1; // no = 라인수
- model.resetInstanceNode("/root/main/temp/stepinfo/info");
- model.setValue("/root/main/temp/stepinfo/info/stepno", grpControlCnt);
- model.setValue("/root/main/temp/stepinfo/info/stepflagcd", flag);
- model.setValue("/root/main/temp/stepinfo/info/swimlineno", no);
- model.setValue("/root/main/temp/stepinfo/info/refseq", linesControlMaxCnt[no-1]);
- model.setValue("/root/main/temp/stepinfo/info/stepmemo", "");
- model.setValue("/root/main/temp/stepinfo/info/m", "i");
- model.setValue("/root/main/temp/stepinfo/info/orgstepno", model.getValue("/root/main/temp/stepinfo/info/stepno"));
- if( cpgflagcd == "02" ) {
- model.setValue("/root/main/temp/stepinfo/info/stepnm", flag + grpControlCnt); //2009.03.03 디폴트 추가
- model.setValue("/root/main/temp/stepinfo/info/times", "1"); //CPG는 모든 스텝이 1일차임.
- }
- model.setValue("/root/main/temp/stepinfo/info/stepattrflag", "0/0/0/0"); //CPG의 속성 정보 컬럼
-
- //2008.07.30 pymi control 생성시 control id를 담음
- //model.setNode("/root/main/temp/stepinfo/info/fixedStCntl");
-
- if( maxControlCnt < linesControlMaxCnt[no-1] ){
- maxControlCnt = linesControlMaxCnt[no-1];
- fAdjustLine("ex", "392");
- }
- model.makeNode( stepRef + "[" + grpControlCnt + "]");
- model.copyNode ( stepRef + "[" + grpControlCnt + "]" , "/root/main/temp/stepinfo/info");
- //각 노드셋(stepRef) 마다 menu 를 생성하는 makeValue 문은 삭제했음.
-
- if(selectedControl != null){
- var selID = selectedControl.attribute("id");
- var curNo = parseInt( selID.substr(12, selID.length-12) ) + 1;
-
- //if( model.getValue(stepRef + "[" + curNo + "]/stepno") > selectedLineSection ){
- //★ 추가되는 컨트롤의 라인수 및 조회순서가 selectedControl 보다 크면, 그대로, 작으면 selectedControl 은 -1 (일단 null)
- // selectedControl = null;
- //}
- }
-
- return grpControlCnt;
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤을 생선한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCreateControl(){
- var ctrlID;
- var ctrl = null;
- var grpWidth = 392; //좌표를 기준으로 한 영역의 사이즈 (실제 컨트롤 width=290)
- var halfpoint = grpWidth/2;
- var marginX = 38; //영역 안의 왼쪽 여백 ( 38+ 290 + 38 = 392 )
- var pntCnt = 0; //기준점의 갯수
- var cntlCnt = 0; //해당 라인의 컨트롤 총 갯수
- var y = 0;
- var psition = 0; //k 번째 컨트롤 포지션(포커스된 컨트롤의 라인 내 순서)
- var startPoint = 0; //라인당 컨트롤들을 위치시킬 시작x위치
- stepCnt = parseInt(grpControlCnt); //새로 그릴 스텝(컨트롤) 갯수
-
- var lngth = swimlineControlArray.length - 1;
- var cntlID;
-
- var fcstinhospdayno = opener.model.getValue("/root/main/masterinfo/info/fcstinhospdayno");
-
- //아웃라인을 제외한 컨트롤을 모두 삭제 (스텝 추가/삭제 후 계속 전체 재생성하므로, 아웃라인 제외한 컨트롤 삭제 처리)
- for(var i=outsideControlCnt; i<=lngth; i++){
- cntlID = swimlineControlArray[i];
- if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
- cntlID = cntlID.substr(0, cntlID.length-3);
- }
- grp_swimline.removeChild(cntlID);
- swimlineControlArray[i] = "";
- }
- controlCnt = outsideControlCnt;
- swimlineControlArray.slice(0, outsideControlCnt);
- grpControlCnt = 0;
-
- for(var i=1; i<=stepCnt ; i++){
- var flag = model.getValue(stepRef + "[" + i + "]/stepflagcd");
- var lineno = parseInt(model.getValue(stepRef + "[" + i + "]/swimlineno"));
- var position = parseInt(model.getValue(stepRef + "[" + i + "]/refseq"));
- var kind = model.getValue(stepRef + "[" + i + "]/startendflag");
- var times = model.getValue(stepRef + "[" + i + "]/times");
- var stepnm = model.getValue(stepRef + "[" + i + "]/stepnm");
- var stepno = model.getValue(stepRef + "[" + i + "]/stepno");
- var tmpstepnm = model.getValue(stepRef + "[" + i + "]/tmpstepnm");
- var stepattrflag = model.getValue(stepRef + "[" + i + "]/stepattrflag"); //CP는 표시해줄 필요 없고, CPG일 경우 0이 아니면 O/M/T/MO 존재 표시
-
- cntlCnt = linesControlMaxCnt[lineno-1];
- y = ( (lineno-1) * swimLineHight ) + 20; //122 + 20 + 20 = 165
-
- startPoint = ( (swimLineWidth - (392 * cntlCnt) ) / 2 + 1 ) + ((position-1) * 392); // ★ 문제... 좌표가 -1씩 줄어든다...
- startPoint = startPoint - (position-2);
-
- //1. 마름모 모양의 라인들과 그리드를 담을 그룹을 생성한다.
- controlCnt++;
- ctrlID = "xforms:group" + (grpControlCnt++);
- var ctrlGrp = grp_swimline.createChild("xforms:group", "id:" + ctrlID + ";left:" + startPoint + "px; top:" + y + "px; width:" + 392 + " px; height:" + 122 + "px; background-color:transparent;"); //290*135
- swimlineControlArray[outsideControlCnt + (grpControlCnt-1)] = ctrlID;
-
- if( flag == "D" ) {
- //2. 결정스텝의 textarea를 생성한다.
- var text1 = "xforms:textarea";
- ctrlID = text1 + (controlCnt++);
-
- if(opener.window.javascript.OpenerKind == "GPS"){
- //GPS 창에서는 조회모임 (editable 속성은 디자인 시점에 결정되므로 두가지 케이스로 나눔)
- var txtareactrl = ctrlGrp.createChild(text1, "id:"+ ctrlID + "; ref:" + stepRef + "[" + grpControlCnt + "]/stepmemo; editable:false; left:" + (marginX+60) + "px; top:" + 40 + "px; width:" + 175 + "px; height:" + 43+ "px; border-width:0px; border-style:solid; scroll:autovscroll; ");
-
- }else{
- var txtareactrl = ctrlGrp.createChild(text1, "id:"+ ctrlID + "; ref:" + stepRef + "[" + grpControlCnt + "]/stepmemo; left:" + (marginX+60) + "px; top:" + 40 + "px; width:" + 175 + "px; height:" + 43+ "px; border-width:0px; border-style:solid; scroll:autovscroll; ");
- }
- txtareactrl.refresh();
- txtareactrl.attribute("onmousedown") = "fPopupMenuEvent()"; //이벤트와 컨트롤을 연결하는 동적 이벤트
- txtareactrl.attribute("xforms-value-changed") = "fSetMemo()";
- txtareactrl.attribute("DOMFocusIn") = "fFocusIn()";
- //txtareactrl.attribute("DOMFocusOut") = "fFocusOut()";
- txtareactrl.attribute("onmouseover") = "fMouseOverEvent()";
-
- //3. 마름모 라인을 생성한다.
- var line1 = "xforms:line";
- if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepno + "' and stepstat = '30']") != null ){
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + marginX + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 0 + "px; border-width:2; border-color:#c8e67b;");
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 120 + "px; x2:" + marginX + "px; y2:" + 60+ "px; border-width:2; border-color:#c8e67b;");
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+290) + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 120 + "px; border-width:2; border-color:#c8e67b;");
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 0 + "px; x2:" + (marginX+290) + "px; y2:" + 60 + "px; border-width:2; border-color:#c8e67b;");
-
- }else if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepno + "' and stepstat = '20']") != null ){
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + marginX + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 0 + "px; border-width:2; border-color:#e5f3c2;");
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 120 + "px; x2:" + marginX + "px; y2:" + 60+ "px; border-width:2; border-color:#e5f3c2;");
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+290) + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 120 + "px; border-width:2; border-color:#e5f3c2;");
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 0 + "px; x2:" + (marginX+290) + "px; y2:" + 60 + "px; border-width:2; border-color:#e5f3c2;");
-
- }else{
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + marginX + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 0 + "px; border-width:2");
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 120 + "px; x2:" + marginX + "px; y2:" + 60+ "px; border-width:2");
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+290) + "px; y1:" + 60 + "px; x2:" + (marginX+145) + "px; y2:" + 120 + "px; border-width:2");
- ctrlID = line1 + (controlCnt++);
- ctrlGrp.createChild(line1, "id:"+ ctrlID + "; x1:" + (marginX+145) + "px; y1:" + 0 + "px; x2:" + (marginX+290) + "px; y2:" + 60 + "px; border-width:2");
- }
-
- //day 정보를 표시한다.
- if( !isNull(fcstinhospdayno) || !isNull(tmpstepnm) || cpgflagcd == "02" ){
- var leftPos = 270;
- var topPos = 52;
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + 66 + "; top:" + 51 + "; width:20px; height:20px; background-stretch:stretch;");
- ctrlType = "xforms:caption";
- ctrlID = ctrlType + (controlCnt++);
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + 66 + "; top:" + 52 + "; width:100px; height:20px; font-size:8pt; font-weight:bolder;");
-
- // 2008.07.30 pymi
- //cntl.attribute("text") = "D" + times;
- if( instance1.selectSingleNode(stepRef + "["+ i + "]/fixedStCntl" ) != null ) { // cp 검색의 경우
- cntl.attribute("text") = stepnm;
- model.setValue(stepRef + "["+ i + "]/fixedStCntl", ctrlID);
- } else {
- cntl.attribute("text") = opener.model.getValue("/root/temp/daylist/day[id = '"+ times +"']/nm]");
- model.setValue(stepRef + "["+ i + "]/stepnm", cntl.attribute("text"));
- }
- //2008.08.19 pymi (e)
- }
-
- } else if( flag == "A" || flag == "B" ) {
- //액션, 브런치 스텝의 textarea를 생성한다.
- var text2 = "xforms:textarea";
- ctrlID = text2 + (controlCnt++);
-
- if(opener.window.javascript.OpenerKind == "GPS"){
- if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepno + "' and stepstat = '30']") != null )
- var txtareactrl = ctrlGrp.createChild(text2, "id:"+ ctrlID + "; ref:" + stepRef+ "[" + grpControlCnt + "]/stepmemo; editable:false; left:" + marginX + "px; top:" + 1 + "px; width:" + 290 + "px; height:" + 120+ "px; border-width:2px; border-style:solid; scroll:autovscroll; padding-left:10; padding-top:18; padding-right:10; padding-bottom:10; border-color:#000000; background-color:#c8e67b");
- else if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepno + "' and stepstat = '20']") != null )
- var txtareactrl = ctrlGrp.createChild(text2, "id:"+ ctrlID + "; ref:" + stepRef+ "[" + grpControlCnt + "]/stepmemo; editable:false; left:" + marginX + "px; top:" + 1 + "px; width:" + 290 + "px; height:" + 120+ "px; border-width:2px; border-style:solid; scroll:autovscroll; padding-left:10; padding-top:18; padding-right:10; padding-bottom:10; border-color:#000000; background-color:#e5f3c2");
- else var txtareactrl = ctrlGrp.createChild(text2, "id:"+ ctrlID + "; ref:" + stepRef+ "[" + grpControlCnt + "]/stepmemo; editable:false; left:" + marginX + "px; top:" + 1 + "px; width:" + 290 + "px; height:" + 120+ "px; border-width:2px; border-style:solid; scroll:autovscroll; padding-left:10; padding-top:18; padding-right:10; padding-bottom:10; border-color:#000000;");
-
- }else{
- var txtareactrl = ctrlGrp.createChild(text2, "id:"+ ctrlID + "; ref:" + stepRef+ "[" + grpControlCnt + "]/stepmemo; left:" + marginX + "px; top:" + 1 + "px; width:" + 290 + "px; height:" + 120+ "px; border-width:2px; border-style:solid; scroll:autovscroll; padding-left:10; padding-top:18; padding-right:10; padding-bottom:10; border-color:#000000; ");
-
- }
- txtareactrl.refresh();
- txtareactrl.attribute("border-color") = "#000000";
- txtareactrl.attribute("onmousedown") = "fPopupMenuEvent()";
- txtareactrl.attribute("xforms-value-changed") = "fSetMemo()";
- txtareactrl.attribute("DOMFocusIn") = "fFocusIn()";
- //txtareactrl.attribute("DOMFocusOut") = "fFocusOut()";
- txtareactrl.attribute("onmouseover") = "fMouseOverEvent()";
-
- //day 정보를 표시한다.
- if( !isNull(fcstinhospdayno) || !isNull(tmpstepnm) || cpgflagcd == "02" ){
- var leftPos =308;
- var topPos = 1;
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + 32 + "; top:" + 0 + "; width:20px; height:20px; background-stretch:stretch;");
- ctrlType = "xforms:caption";
- ctrlID = ctrlType + (controlCnt++);
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + 32 + "; top:" + 1 + "; width:100px; height:20px; font-size:8pt; font-weight:bolder;");
- //cntl.attribute("text") = "D" + times + " : "+stepnm;
-
- //2008.07.30 pymi (s)
- if( instance1.selectSingleNode(stepRef + "["+ i + "]/fixedStCntl" ) != null ) { // cp 검색의 경우
- cntl.attribute("text") = stepnm;
- model.setValue(stepRef + "["+ i + "]/fixedStCntl", ctrlID);
- } else { // 생성기에서 재원일수만 넣고 자동으로 outline을 그렸을 경우
- cntl.attribute("text") = opener.model.getValue("/root/temp/daylist/day[id = '"+ times +"']/nm]");
- model.setValue(stepRef + "["+ i + "]/stepnm", cntl.attribute("text"));
- }
- //2008.08.19 pymi (e)
- }
- }
- //시작, 스텝여부를 표시한다.
- if( kind == "S" || kind == "E" ){ //opener.window.javascript.OpenerKind != "GPS" 조건 제거 (2008.12.15)
- fChangeSelectCntl("#ff9900", txtareactrl);
- }
-
- if( model.getValue(stepRef + "[" + i + "]/decirflag") == "I" ){
- // decirflag : 입원필요 스텝
- var leftPos =330;
- var topPos = 20;
- var cntl;
- var ctrlType = "xforms:caption";
- var ctrlID = ctrlType + (controlCnt++);
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
- cntl.attribute("text") = "[입원\n필요]";
- }
- //2008.06.17 pymi(추가)
- if( model.getValue(stepRef + "[" + i + "]/decirflag") == "D" ){
- // decirflag : 퇴원필요 스텝
- var leftPos =330;
- var topPos = 20;
- var cntl;
- var ctrlType = "xforms:caption";
- var ctrlID = ctrlType + (controlCnt++);
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
- cntl.attribute("text") = "[퇴원\n필요]";
- }
-
- if( model.getValue(stepRef + "[" + i + "]/decirflag") == "O" ){
- // decirflag : 외래예약필요 스텝
- var leftPos =330;
- var topPos = 20;
- var cntl;
- var ctrlType = "xforms:caption";
- var ctrlID = ctrlType + (controlCnt++);
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
- cntl.attribute("text") = "[외래\n예약\n필요]";
- }
- //2008.06.17 pymi(종료)
-
- // 2008.08.06 pymi(추가)
- if( model.getValue(stepRef + "[" + i + "]/decirflag") == "C" ){
- // decirflag : DSC 필요 스텝
- var leftPos =330;
- var topPos = 20;
- var cntl;
- var ctrlType = "xforms:caption";
- var ctrlID = ctrlType + (controlCnt++);
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
- cntl.attribute("text") = "[DSC\n필요]";
- }
- // 2008.08.06 pymi(종료)
- /*
- if( opener.window.javascript.OpenerKind == "GPS" ){
- if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + i + "' and prcpdd = '" + getCurrentDate() + "']/stepno") ){
- fChangeSelectCntl("#FF0000", txtareactrl); //당일=빨강색
-
- }else if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + i + "' and (stepstat = '20' or stepstat = '30' )]/stepno") ){
- fChangeSelectCntl("#8EBCFF", txtareactrl); //진행중=하늘색
-
- }else{
- if( kind == "S" || kind == "E" ) //2008.12.06
- fChangeSelectCntl("#ff9900", txtareactrl); //시작/종료=주황색
- }
- }
- */
-
- //서식존재 여부를 표시한다.
- if( cpgflagcd == "01" ){
- if(model.getValue(stepRef + "[" + i + "]/formexistyn") != "Y"){
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- if( flag == "D" ) {
- //Decision
- var leftPos = 330;
- var topPos = 52;
- }else{
- //Action
- var leftPos =330;
- var topPos = 1;
- }
- ctrl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/input_s_essential.gif; left:" + leftPos + "; top:" + topPos + "; background-stretch:stretch;");
- ctrl.hint = "처방 및 서식이 등록되지 않은 스텝입니다.";
- }
- }
-
- //@CPG 속성의 존재 여부 표시한다.
- else if( cpgflagcd == "02" ){
- if(model.getValue(stepRef + "[" + i + "]/formexistyn") == "Y"){
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- if( flag == "D" ) {
- //Decision
- var leftPos = 330;
- var topPos = 52;
- }else{
- //Action
- var leftPos =330;
- var topPos = 1;
- }
- ctrl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/input_essential.gif; left:" + leftPos + "; top:" + topPos + "; background-stretch:stretch;");
- ctrl.hint = "작성해야 할 서식이 등록되어 있습니다.";
- }
-
- var iAttrFlag = stepattrflag.split("/");
- var cntl;
- var topPos = 4;
- var kWidth = 15;
- var ctrlType = "xforms:caption";
- var attrFlagNm = "";
- var attrFlagCd = "";
- for( var k=0; k<iAttrFlag.length; k++ ){
- var leftPos = 238 + ((k+1)*15) + (k+2);
- if( iAttrFlag[k] != "0" ) var colorCd = "#000000"; //검정
- else var colorCd = "#c0c0c0"; //회색
-
- if(k==0) {
- attrFlagNm = "O";
- attrFlagCd = "@O"; //처방 (@O)
- }
- else if(k==1) {
- attrFlagNm = "M";
- attrFlagCd = "@M"; //모니터링 (@M)
- }
- else if(k==2) {
- attrFlagNm = "T";
- attrFlagCd = "@T"; //제한시간 (@T)
- }
- else if(k==3) {
- attrFlagNm = "MO";
- attrFlagCd = "@D"; //약속처방모니터링오더 (@Dummy)
- kWidth = 22;
- }
- var ctrlID = ctrlType + (controlCnt++) + "_" + attrFlagCd; //CPG 속성 정보 아이콘 버튼 => xforms:caption00_@X
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:" + kWidth + "px; height:20px; color:" + colorCd + "; text-align:center; background-color:#ffcc99;");
- cntl.attribute("text") = attrFlagNm;
- cntl.attribute("onmouseover") = "fMouseOverEvent()";
- cntl.attribute("DOMFocusOut") = "fFocusOut()";
- //cntl.attribute("onmousedown") = "fOpenAttrPopupEvent()";
- cntl.attribute("onmousedown") = "fPopupMenuEvent()";
- }
-
- //CPG+CP 인 경우, CP스텝을 표시해줌 (2010.06.28)
- if(model.getValue(stepRef + "[" + i + "]/settypecd") == "W"){
- var leftPos =0;
- var topPos = 0;
- var cntl;
- var ctrlType = "xforms:caption";
- var ctrlID = ctrlType + (controlCnt++);
- cntl = ctrlGrp.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:23px; font-size:8pt; font-weight:bolder; "); //; color:#ff0000
- cntl.attribute("text") = "[CP]";
- }
- } //end CPG 속성
-
- }
-
- //스텝 구간의 시작과 끝 설정 (2010.06.03)
- /*var appScopStartNo = "";
- var appScopEndNo = "";
- var appScopYN = "N";
- if(opener.window.javascript.OpenerKind == "GPS"){
- var appStepScopList = opener.instance1.selectNodes("/root/main/steppath/info[stepstat='30']");
- if( appStepScopList.length > 0 ){
- for(var k=0; k<appStepScopList.length; k++){
- var node = appStepScopList.item(k);
- if(k == 0) appScopStartNo = node.selectSingleNode("stepno").text;
- else if(k == appStepScopList.length-1){
- appScopEndNo = node.selectSingleNode("stepno").text;
- }
- }
- }
- }*/
-
- // 라인 연결 재설정
- for(var i=1; i<=stepCnt ; i++){
- var cntlKind = model.getValue( stepRef + "[" + i + "]/stepflagcd");
- var cntlno = model.getValue( stepRef + "[" + i + "]/stepno");
- //var stepstat = opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + cntlno + "' and stepstat='30']/stepstat");
-
- if( cntlKind == "D" ) {
- var dcsnstep = opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + cntlno + "']/answstepno");
- nodeList = instance1.selectNodes(dcsRef);
- dcsCntlCnt = nodeList.length;
- for(var k=0; k<dcsCntlCnt; k++){
- var node = nodeList.item(k);
- var stepNode = node.selectSingleNode("stepno");
- var lnkNode = node.selectSingleNode("lnkstepno");
-
- if( !isNull(lnkNode.text) && cntlno == stepNode.value ){ //2919 line에서 설정됨..
- if( dcsnstep != null ){
- if( !isNull(dcsnstep.text) && dcsnstep.text == lnkNode.text)
- fCreateControl_Line( stepNode.text, lnkNode.text, "#FF0000" );
- else
- fCreateControl_Line( stepNode.text, lnkNode.text );
- } else {
- fCreateControl_Line( stepNode.text, lnkNode.text );
- }
- }
- //if( cntlno == appScopStartNo ) appScopYN = "Y"; //적용 구간 시작
- //else if( cntlno == appScopEndNo ) appScopYN = "N"; //적용 구간 종료
- }
- dcsCntlCnt++;
- } else {
- var lnkno = model.getValue( stepRef + "[" + i + "]/lnkstepno");
- if( !isNull(lnkno) ){
- /*
- if( cntlno == appScopStartNo ) appScopYN = "Y"; //적용 구간 시작
- if( cntlno == appScopEndNo ) appScopYN = "N"; //적용 구간 종료
- if( appScopYN == "N" ){
- fCreateControl_Line( cntlno, lnkno );
- }else{
- if( lnkno != appScopEndNo )
- fCreateControl_Line( cntlno, lnkno, "#FF0000" );
- else{
- if( stepstat != null && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + lnkno + "' and stepstat='30']") != null )
- fCreateControl_Line( cntlno, lnkno, "#FF0000" );
- else fCreateControl_Line( cntlno, lnkno );
- }
- }
- if( lnkno == appScopEndNo ) appScopYN = "N"; //적용 구간 종료
- */
- if( opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + cntlno + "' and stepstat='30']") != null && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + lnkno + "' and stepstat='30']") != null )
- fCreateControl_Line( cntlno, lnkno, "#FF0000" );
- else
- fCreateControl_Line( cntlno, lnkno );
- }
- }
- }
- }
-
- function fInitLoadingForm(){
- //-------------------------------서식(main) 호출(2008.09.05)---------------------------//
- if( opener.window.javascript.OpenerKind != "GPS" ) return;
- //if( opener.window.javascript.cpgflagcd != "02" ) return;
- if(opener.window.javascript.loadFormTab != "O") return;
-
- //전처방 로딩이 완료되면 진료대상자에서 진료기록을 호출하는 로직
- var mainObj = getMainViewer();
- var srcOrdPatListwnd = mainObj.javascript.getOpenWindow("SMMMO04100");
- //마취기록지에서 처방창을 열경우 마취기록지를 initialize 시키지 않는 로직
- var srcAnstRecwnd = mainObj.javascript.getOpenWindow("SMMMR03700");
- var anstrereload = mainObj.javascript.getParameter("SMMMR03700_refresh");
- if (srcAnstRecwnd != null) {
- var anstrereload = srcAnstRecwnd.javascript.getParameter("SMMMR03700_refresh");
- }
-
- //최초 적용 시, 처방창에서 이미 기록지 호출이 되었으므로, 재호출 안함 -> opener.window.javascript.appstepstatflag != "i" 조건 추가 (2008.09.29)
- if ( anstrereload != "false" && srcOrdPatListwnd != null && opener.window.javascript.appstepstatflag != "i" ) {
- var fstopenflag = opener.model.getValue("/root/temp1/refresh_obj/refreshyn"); //처방화면이 최초 생성 여부
- //alert( "Refresy_YN = " + fstopenflag );
- if( fstopenflag == "N") {
- opener.model.setValue("/root/init/fstopenflag", "Y"); //잠시, 값 치환
- srcOrdPatListwnd.javascript.fChngMainEMRScrn();
- var scrnwnd = getOpenWindow("SPMMB08400");
- if(scrnwnd != null){
- scrnwnd.javascript.fCloseOpenEmrWnd();
- }
- }else return;
-
- }else return;
-
- opener.model.setValue("/root/temp1/refresh_obj/refreshyn", "Y"); //최초조회가 아닌경우, refresh 여부 "Y"
- opener.model.setValue("/root/init/fstopenflag", "N"); //처방최초 open여부를 재설정, 진료기록을 열기위해
-
- //--------------------------------------------------------------------------------//
-
- //2008.09.04 순서 변경
- opener.window.javascript.fMssg(); //Drop 및 퇴원예고 유도... 알림 Message 출력
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤간의 연결라인을 그려준다.
- * @param : cntlno, lnkno
- * @return :
- * @---------------------------------------------------
- */
- function fCreateControl_Line( cntlno, lnkno, color ){
- currentStepCntl = document.controls("xforms:group" + (parseInt(cntlno)-1) );
- prevStepCntl = document.controls("xforms:group" + (parseInt(lnkno)-1) );
- if(currentStepCntl != null && prevStepCntl != null){
- var frXPoint = parseInt(currentStepCntl.attribute("left")) + (parseInt(currentStepCntl.attribute("width")) / 2 ) -15; //★ 오류발생
- var frYPoint = parseInt(currentStepCntl.attribute("top")) + parseInt(currentStepCntl.attribute("height"));
- var toXPoint = parseInt(prevStepCntl.attribute("left")) + (parseInt(prevStepCntl.attribute("width")) / 2 ) -15; // err
- var toYPoint = parseInt(prevStepCntl.attribute("top"));
-
- ctrlID = "xforms:line" + (controlCnt++);
- var ctrl = grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:2;");
- if( !isNull(color) ){
- ctrl.attribute("border-color") = color;
- }
- //connection line
- swimlineControlArray[controlCnt-1] = ctrlID+"_CN";
- /*
- //복잡한 CPG는 연결이 한눈에 들어오지 않으므로, 화살표 표시 추가 (2009.02.26)
- if( cpgflagcd == "02" ){
- var lftXPoint = toXPoint - 5;
- var lftYPoint = toYPoint - 5;
- var rgtXPoint = toXPoint + 5;
- var rgtYPoint = toYPoint + 5;
-
- ctrlID = "xforms:line" + (controlCnt++);
- var ctrl = grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + toXPoint + "px; y1:" + toYPoint + "px; x2:" + frXPoint2 + "px; y2:" + frYPoint2 + "px; border-width:2;");
- if( !isNull(color) ){
- ctrl.attribute("border-color") = color;
- }
- ctrlID = "xforms:line" + (controlCnt++);
- var ctrl = grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + toXPoint + "px; y1:" + toYPoint + "px; x2:" + toXPoint2 + "px; y2:" + toYPoint2 + "px; border-width:2;");
- if( !isNull(color) ){
- ctrl.attribute("border-color") = color;
- }
- }
- */
- prevStepCntl = null;
- currentStepCntl = null;
-
- ctrl.refresh();
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 하위 스텝을 선택하면, 연결한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetLink(){
- var prntID = currentStepCntl.attribute("id");
- var prntControl = document.controls(prntID);
- prevStepCntl = prntControl; //하위
- //setStepLink(prntControl, null);
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 연결 이벤트시, 목적 컨트롤을 클릭했을 경우, 해당하는 두개의 컨트롤 사이를에 라인을 생성한다.
- * @param : prevStepCntl, currentStepCntl
- * @return :
- * @---------------------------------------------------
- */
- function fConnectToLine(prevStepCntl, currentStepCntl){
- var ctrlID;
- var ctrl = null;
- //비교 대상인 두개 컨트롤 ID
- var prevStepCntlID = prevStepCntl.attribute("id"); //하위(자식)
- var currentCntlID = currentStepCntl.attribute("id"); //상위(부모)
-
- if( !isNull(currentCntlID) && !isNull(prevStepCntlID) && currentCntlID.substr(0, 12) == "xforms:group" && prevStepCntlID.substr(0, 12) == "xforms:group" ){
- prevStepCntlID = parseInt( prevStepCntlID.substr(12, prevStepCntlID.length-12) ) + 1;
- currentCntlID = parseInt( currentCntlID.substr(12, currentCntlID.length-12) ) + 1;
-
- //비교 대상인 두개 컨트롤 top과 높이
- var prevStepCntlTop = parseInt(prevStepCntl.attribute("top"));
- var prevStepCntlHigh = parseInt(prevStepCntl.attribute("height"));
- var currentCntlTop = parseInt(currentStepCntl.attribute("top"));
- var currentCntlHigh = parseInt(currentStepCntl.attribute("height"));
- if ( prevStepCntlTop == currentCntlTop ) {
- //동일한 컨트롤을 선택한 경우
- prevStepCntl = null;
- return;
- } else {
- var curcntlType = model.getValue( stepRef + "[" + currentCntlID + "]/stepflagcd");
- var preCntlType = model.getValue( stepRef + "[" + prevStepCntlID + "]/stepflagcd");
- var frXPoint = parseInt(prevStepCntl.attribute("left")) + (parseInt(prevStepCntl.attribute("width")) / 2 ) -15;
- var toXPoint = parseInt(currentStepCntl.attribute("left")) + (parseInt(currentStepCntl.attribute("width")) / 2 ) -15;
- var frYPoint;
- var toYPoint;
-
- //하위를 먼저 클릭하고 연결을 결정한 다음, 상단을 클릭한 경우,
- if( prevStepCntlTop > currentCntlTop ) {
- frYPoint = prevStepCntlTop - 1;
- toYPoint = currentCntlTop + currentCntlHigh;
-
- if( model.getValue( stepRef + "[" + currentCntlID + "]/startendflag") == "E" ){
- //messageBox("종료 Step은 다음 Step을 가질 수", "I004");
- //return;
- model.setValue( stepRef + "[" + currentCntlID + "]/startendflag", "");
- }
- if( model.getValue( stepRef + "[" + prevStepCntlID + "]/startendflag") == "S" ){
- //messageBox("시작 Step 앞에는 스텝이 올 수", "I004");
- //return;
- model.setValue( stepRef + "[" + prevStepCntlID + "]/startendflag", "");
- }
-
- if(curcntlType == "D"){
- model.setValue( stepRef + "[" + currentCntlID + "]/lnkstepno", "" );
- copyNodeType("/root/main/decisionlist", "/root/main/temp/decisioninfo", "after", model, model);
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/stepno", model.getValue(stepRef + "[" + currentCntlID + "]/stepno"));
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/lnkstepno", model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno"));
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/m", "i");
- dcsCntlCnt++;
-
- } else {
- if( model.getValue(stepRef + "[" + currentCntlID + "]/lnkstepno") == "" ) {
- model.setValue( stepRef + "[" + currentCntlID + "]/lnkstepno" , model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno") );
- if(model.getValue(stepRef + "[" + currentCntlID + "]/m") != "i"){
- model.setValue(stepRef + "[" + currentCntlID + "]/m", "u");
- }
-
- } else {
- btn_connection.attribute("text") = "입력";
- connectionMode = "false";
- //messageBox("Action 및 Branch 스텝은 둘 이상의 하위 Step을 선택 ", "E001");
- return;
- }
- }
- //현재 스텝을 부모 스텝과 연결한다.
- ctrlID = "xforms:line" + (controlCnt++);
- grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:2;");
- swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
-
- //상단을 먼저 클릭하고 연결을 결정한 다음, 하위를 클릭한 경우
- } else if( prevStepCntlTop < currentCntlTop ) {
- frYPoint = prevStepCntlTop + prevStepCntlHigh - 1;
- toYPoint = currentCntlTop;
-
- if( model.getValue( stepRef + "[" + prevStepCntlID + "]/startendflag") == "E" ){
- //messageBox("종료 Step은 다음 Step을 가질 수 ", "I004");
- //return;
- model.setValue( stepRef + "[" + prevStepCntlID + "]/startendflag", "");
- }
- if( model.getValue( stepRef + "[" + currentCntlID + "]/startendflag") == "S" ){
- //messageBox("시작 Step 앞에는 스텝이 올 수", "I004");
- //return;
- model.setValue( stepRef + "[" + currentCntlID + "]/startendflag", "");
- }
-
- if(preCntlType == "D"){
- model.setValue( stepRef + "[" + prevStepCntlID + "]/lnkstepno" , "" );
- copyNodeType("/root/main/decisionlist", "/root/main/temp/decisioninfo", "after", model, model);
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/stepno", model.getValue(stepRef + "[" + prevStepCntlID + "]/stepno"));
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/lnkstepno", model.getValue(stepRef + "[" + currentCntlID + "]/stepno"));
- model.setValue(dcsRef + "[" + dcsCntlCnt + "]/m", "i");
- dcsCntlCnt++;
-
- } else {
- if( model.getValue(stepRef + "[" + prevStepCntlID + "]/lnkstepno") == "" ) {
- model.setValue( stepRef + "[" + prevStepCntlID + "]/lnkstepno" , model.getValue(stepRef + "[" + currentCntlID + "]/stepno") );
- if(model.getValue(stepRef + "[" + prevStepCntlID + "]/m") != "i"){
- model.setValue(stepRef + "[" + prevStepCntlID + "]/m", "u");
- }
- } else {
- btn_connection.attribute("text") = "입력";
- connectionMode = "false";
- // messageBox("Action 및 Branch 스텝은 둘 이상의 하위 Step을 선택 ", "E001");
- return;
- }
-
- }
- ctrlID = "xforms:line" + (controlCnt++);
- grp_swimline.createChild("xforms:line", "id:"+ ctrlID + "; x1:" + frXPoint + "px; y1:" + frYPoint + "px; x2:" + toXPoint + "px; y2:" + toYPoint + "px; border-width:2;");
- swimlineControlArray[controlCnt-1] = ctrlID+"_CN"; //connection line
- }
- }
- //prevStepCntl = null;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 포커스를 갖는 컨트롤의 외곽선 색상을 변경한다.
- * @param : lineColor, cntl
- * @return :
- * @---------------------------------------------------
- */
- function fChangeSelectCntl(lineColor, cntl){
- if( cntl != null ){
- var controlSize = cntl.attribute("width"); //175px or 290px //추가된 서식(저장 전)이 있을때, fullsize->축소 때 err
- var cntlID = cntl.attribute("id");
- var num = parseInt(cntlID.substr(15, (cntlID.length-1)))+1;
-
- var parentCtrlID = cntl.parent.attribute("id"); //textarea의 parent 컨트롤인 그룹
- var parentNum = parseInt( parentCtrlID.substr(12, parentCtrlID.length-12) ) + 1;
- if(lineColor == "#000000") lineColor = getStepBaseColor(parentNum);
-
- if( controlSize == "175px" ) {
- var line1 = document.controls("xforms:line" + num );
- var line2 = document.controls("xforms:line" + (num+1) );
- var line3 = document.controls("xforms:line" + (num+2) );
- var line4 = document.controls("xforms:line" + (num+3) );
- line1.attribute("border-color") = lineColor;
- line2.attribute("border-color") = lineColor;
- line3.attribute("border-color") = lineColor;
- line4.attribute("border-color") = lineColor;
-
- } else if( controlSize == "290px" ){
- cntl.attribute("border-color") = lineColor;
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.10
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : GPS일 경우, 기본 스텝 색상으로 복귀할 때, 스텝 적용 상태에 따라 색상을 달리한다.
- * @param : stepNumber
- * @return : lineColor
- * @---------------------------------------------------
- */
- function getStepBaseColor(stepNumber){
-
- //2008.12.15 진행경로를 border 색이 아닌 background 색으로 나타냄.
- /*if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepNumber + "' and prcpdd = '" + getCurrentDate() + "']/stepno") ){
- return "#FF0000";
- }else
- */
- if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepNumber + "' and stepstat = '30' and stepflagcd='D']" )){
- //return "#8EBCFF";
- return "#c8e67b";
- }else if( opener.window.javascript.OpenerKind == "GPS" && opener.instance1.selectSingleNode("/root/main/steppath/info[stepno = '" + stepNumber + "' and stepstat = '20' and stepflagcd='D']" )){
- return "#e5f3c2";
- }else{
- return "#000000";
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 클릭한 지점의 영역에 해당하는 외곽선의 색상을 변경한다.
- * @param : flag, no
- * @return :
- * @---------------------------------------------------
- */
- function fChangeOutLineCntl(flag, no){
- var asLineControl = null;
- var str;
- var count = 0;
-
- if( !( selectSectionsLine[0] == "" ) && flag == "reset"){
- for(var i=0; i<4; i++){
- str = selectSectionsLine[i];
- if(str != ""){
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#000000";
- asLineControl.attribute("border-width") = "1px";
- selectSectionsLine[i] = "";
- } else{
- return;
- }
- }
- } else if(flag == "select"){
- var lngth = swimlineControlArray.length;
- for(var i=0; i<lngth; i++){
- str = swimlineControlArray[i];
- if( !(str =="" || str == null) ){
- if( str.substr(str.length-2, 2) == "LH" ){
- if(no == count){
- str = swimlineControlArray[i];
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#A683B1";
- asLineControl.attribute("border-width") = "2px";
- selectSectionsLine[0] = str;
-
- str = swimlineControlArray[i+1];
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#A683B1";
- asLineControl.attribute("border-width") = "2px";
- selectSectionsLine[1] = str;
-
- str = swimlineControlArray[i+2];
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#A683B1";
- asLineControl.attribute("border-width") = "2px";
- selectSectionsLine[2] = str;
-
- str = swimlineControlArray[i-1];
- asLineControl = document.controls( str.substr(0, str.length-3) );
- asLineControl.attribute("border-color") = "#A683B1";
- asLineControl.attribute("border-width") = "2px";
- selectSectionsLine[3] = str;
- return;
- }
- count++;
- }
- }
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : textarea 의 오른쪽 마우스 버튼 이벤트 생성(팝업메뉴 허용 이벤트)
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPopupMenuEvent(curStepCntl){
- if( isNull(curStepCntl) ){
- var ctrl = null;
- ctrl = (event.target);
- var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
- var id = selControl.parent.attribute("id");
- currentStepCntl = document.controls(id); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
- }else{
- currentStepCntl = document.controls(curStepCntl); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
- }
-
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- opener.model.setValue( "/root/main/stepinfo/info/stepno", model.getValue(stepRef + "[" + curNo + "]/stepno") );
- opener.model.setValue( "/root/main/stepinfo/info/times", model.getValue(stepRef + "[" + curNo + "]/times") );
- opener.ipt_times.refresh();
- opener.ipt_times_old.refresh();
- opener.model.setValue( "/root/main/stepinfo/info/stepnm", model.getValue(stepRef + "[" + curNo + "]/stepnm") );
- opener.ipt_stepnm.refresh();
- opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo + "]/stepmemo") );
- opener.tar_stepmemo.refresh();
- // 2008.08.21 pymi
- //opener.model.setValue( "/root/main/stepinfo/info/daynm", model.getValue(stepRef + "[" + curNo + "]/tmpstepnm") );
- //opener.cmb_stepnm.refresh();
-
- model.setValue("/root/main/temp/selectedstep/stepno", model.getValue(stepRef + "[" + curNo + "]/stepno"));
- model.setValue("/root/main/temp/selectedstep/stepflagcd", model.getValue(stepRef + "[" + curNo + "]/stepflagcd"));
- opener.model.setValue( "/root/main/stepinfo/info/stepflagcd", model.getValue(stepRef + "[" + curNo + "]/stepflagcd"));
- opener.model.setValue( "/root/main/stepinfo/info/setno", model.getValue(stepRef + "[" + curNo + "]/setno"));
- if(event.button == 3){
- event.preventDefault();
- if( opener.window.javascript.OpenerKind != "GPS" ){
- if( opener.model.getValue("/root/temp/getdata/authflag") == "M" || opener.model.getValue("/root/temp1/getdata/authflag") == "M" )
- window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu1/item", "name", "func", false);
- return;
-
- }else{
- if( model.getValue("/root/temp/getdata/authflag") != "U" ) return;
-
- if( model.getValue("/root/main/outlineinfo/info/cpgflagcd") == "02" ){
- if( model.getValue(stepRef + "[" + curNo + "]/stepflagcd") == "D"){
- if( decisionMode == "false" ){
- window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu3/item", "name", "func", false);
- }else{
- window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu7/item", "name", "func", false);
- }
- }else{
- if( model.getValue(stepRef + "[" + curNo + "]/settypecd") == "W" ){
- if( opener.model.getValue("/root/main/steppath/info[stepno='"+curNo+"']/stepstat") == "10" )
- window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu8/item", "name", "func", false);
- else initPopupMenu();
- }else{
- window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu5/item", "name", "func", false);
- }
- }
- }else{
- //중간타기 CP 허용에 따른 시작스텝 설정 메뉴 추가 (2009.02.19)
- var D0stepNode = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[times = '0']/stepno");
- if( opener.model.getValue("/root/temp1/getdata/appstat") < "10" && D0stepNode == null ){ //D0 CP이거나 이미 진행중인 경우 중간타기 불가
- window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu6/item", "name", "func", false);
- }else{
- initPopupMenu();
- }
- }
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fFocusOut(){
- window.setPopupMenu(false);
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fFocusIn(){
- if( currentStepCntl == null ){
- var ctrl = (event.target);
- var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
- var curID = selControl.parent.attribute("id");
- currentStepCntl = document.controls(curID); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
- if( selectedControl == null ){
- selectedControl = currentStepCntl;
- }
- }
-
- changedCntl = currentStepCntl;
-
- opener.ipt_stepnm.disabled = false;
- opener.tar_stepmemo.disabled = false;
- //if(cpgflagcd == "01"){
- opener.ipt_times.disabled = false;
- opener.ipt_times_old.disabled = false;
- //}
- // 2008.08.21 pymi
- if(opener.window.javascript.OpenerKind == "GPS"){
- opener.cmb_stepnm.disabled = false;
- } else {
- if( opener.rdo_ioflagcd.value != "O") opener.cmb_stepnm.disabled = false;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 스텝 안의 내용을 처음 입력하거나 변경하면, Opener의 memo 란에 내용이 함께 반영된다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetMemo(){
- //현재 선택된 스텝이 아니라, 이전에 선택되어 수정된 스텝의 내용을 반영해야 함.
- //var curID = currentStepCntl.attribute("id");
- var ctrl = (event.target);
- var curID = changedCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
-
- var checkChar = model.getValue(stepRef + "[" + curNo + "]/stepmemo");
- //alert ( checkChar.isByteSize(300) );
- if(checkChar.isByteSize(2048) == false){
- //messageBox("한글 300자, ", "E003");
- }
-
- if( opener.tar_stepmemo.disabled == false ){
- //글자 길이 체크한다
- var checkChar = model.getValue(stepRef + "[" + curNo + "]/stepmemo");
- if( getStringLength(checkChar) > 2048 ){
- model.setValue( stepRef + "[" + curNo + "]/stepmemo", checkChar.substr(0, 2048) );
- messageBox("문자열의 길이가 2048 Byte를", "E003");
- }
- opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo + "]/stepmemo") );
-
- // 선택된 스텝이 없을 때 상단의 스텝정보에 데이터 입력을 막기 위해 처리함 (2007.12.17 수정)
- if( ctrl.substr(0, 15) == "xforms:textarea" ){
- var curID2 = currentStepCntl.attribute("id");
- var curNo2 = parseInt( curID2.substr(12, curID2.length-12) ) + 1;
- opener.model.setValue( "/root/main/stepinfo/info/stepmemo", model.getValue(stepRef + "[" + curNo2 + "]/stepmemo") );
- }
-
- opener.tar_stepmemo.refresh();
- changedCntl.refresh();
- }
-
- if(model.getValue(stepRef + "[" + curNo + "]/m") != "i"){
- model.setValue(stepRef + "[" + curNo + "]/m", "u");
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 연결설정 모드일 경우, 컨트롤에 마우스를 over 하면 마우스 커서가 바뀐다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fMouseOverEvent(){
- var ctrl = (event.target);
- var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
- var cntlID = selControl.attribute("id");
- var selMode = connectionMode;
-
- //xforms:caption00_@X
- //cntlID.substr(cntlID.length-3, 1)
- if( cntlID.substr(cntlID.length-3, 2) == "_@" ){
- if( selControl.attribute("color") == "#000000" ){
- selMode = "true";
- }
- }
-
- if(selMode == "true"){
- selControl.attribute("cursor") = "pointer";
- } else {
- selControl.attribute("cursor") = "default";
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 선택한 지점에 스임라인을 추가한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddSwimLine(){
- if( selectedLineSection != "" ){
- var trgline;
- var trgStepNo;
- var org_CurrentStepCntl = currentStepCntl;
-
- //스윔라인을 추가한다.
- var y = parseInt(lineNo) * swimLineHight; //세로 아웃라인의 y1
- var cy = y + swimLineHight; //세로 아웃라인의 y2
- var lngth = swimlineControlArray.length - 1;
- //아웃라인을 제외한 나머지 컨트롤을 삭제
-
- for(var i=outsideControlCnt; i<=lngth; i++){
- var cntlID = swimlineControlArray[i];
- if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
- cntlID = cntlID.substr(0, cntlID.length-3);
- }
- grp_swimline.removeChild(cntlID);
- swimlineControlArray[i] = "";
- }
- /*
- swimlineControlArray.slice(0, outsideControlCnt);
- controlCnt = outsideControlCnt;
- fCreateSwimLine(y, cy);
- */
- //GOTO aaaaaa
-
- lineNo = parseInt(lineNo) + 1;
- model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo);
- opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
- opener.ipt_swimlineno.refresh();
- //배열 인덱스를 하나 더 생성
- linesControlMaxCnt[linesControlMaxCnt.length] = 0;
-
- if( lineNo != parseInt(selectedLineSection)+1 ){
- for(var i=1; i<=grpControlCnt; i++ ){
- trgline = model.getValue(stepRef + "[" + i + "]/swimlineno");
- trgStepNo = model.getValue(stepRef + "[" + i + "]/stepno");
- if( trgline > selectedLineSection ){
- model.setValue( stepRef + "[" + i + "]/swimlineno", parseInt(trgline)+1 );
- }
- }
- var start = parseInt(selectedLineSection)-1;
- var end = linesControlMaxCnt.length-1;
- var a = linesControlMaxCnt.slice(0, selectedLineSection);
- var b = linesControlMaxCnt.slice(selectedLineSection, end);
- var c = linesControlMaxCnt[linesControlMaxCnt.length-1];
- linesControlMaxCnt.slice(0, linesControlMaxCnt.length);
- linesControlMaxCnt = a.concat(c, b);
-
- //추가할 라인의 바로 윗줄 스텝의 연결번호를 지운다.
- var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + selectedLineSection + "']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var lnkNode = node.selectSingleNode("lnkstepno");
- model.setValue(lnkNode, "");
- lnkNode = node.selectSingleNode("stepno");
- var stepNo = model.getValue(lnkNode);
-
- model.removeNodeset(dcsRef + "[stepno = '" + stepNo + "']");
- }
- nodeList = instance1.selectNodes(dcsRef);
- dcsCntlCnt = nodeList.length + 1;
- }
-
- //aaaaaa:
- var org_grpControlCnt = grpControlCnt;
- var org_controlCnt = controlCnt;
- var org_linesControlMaxCnt = linesControlMaxCnt;
- fInitialize();
- grpControlCnt = org_grpControlCnt;
- controlCnt = org_controlCnt;
- linesControlMaxCnt = org_linesControlMaxCnt;
-
- fCreateControl();
- selectedControl = null;
- //currentStepCntl = null;
- prevStepCntl = null;
- //20071120 추가 시작 (라인을 추가하면 추가된 라인에 포커스를 맞춘다)
- currentStepCntl = org_CurrentStepCntl;
- selectedLineSection = parseInt(selectedLineSection) + 1;
- fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
- fChangeOutLineCntl("select", selectedLineSection-1); //전체 선의 색상을 다시 셋팅...
- //20071120 추가 끝
-
- }else {
- return;
-
- }
- }
-
- /**
- * @group :
- * @ver : 2008.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 선택한 지점에 스임라인 윗줄에 D0 swimline과 step을 추가한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddD0Step(){
- if( selectedLineSection != "" ){
- var trgline;
- var trgStepNo;
- var org_CurrentStepCntl = currentStepCntl;
- var lngth = swimlineControlArray.length - 1;
-
- if( instance1.selectSingleNode(stepRef + "/stepno") == null ){
- return;
- }
-
- //아웃라인을 제외한 나머지 컨트롤을 삭제
- for(var i=outsideControlCnt; i<=lngth; i++){
- var cntlID = swimlineControlArray[i];
- if( !(cntlID == "" || cntlID == null) && cntlID.substr(cntlID.length-3, 1) == "_" ){
- cntlID = cntlID.substr(0, cntlID.length-3);
- }
- grp_swimline.removeChild(cntlID);
- swimlineControlArray[i] = "";
- }
-
- //mian viewer의 스윔라인수 값(+1) 변경
- lineNo = parseInt(lineNo) + 1;
- model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo);
- opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
- opener.ipt_swimlineno.refresh();
-
- //<steplist>에 <stepinfo>를 맨 앞에 생성
- model.resetInstanceNode("/root/main/temp/stepinfo/info");
- model.makeNode("/root/main/temp/stepform/info");
- model.copyNode("/root/main/temp/stepform/info", "/root/main/temp/stepinfo/info");
- var srcNode = instance1.selectSingleNode("/root/main/temp/stepform/info");
-
- var desNode = instance1.selectSingleNode(stepRef);
- var lastrow = instance1.selectNodes(stepRef).length;
- var pdesNode = instance1.selectSingleNode(stepRef + "[" + lastrow + "]");
-
- desNode.insertAfter(srcNode, pdesNode);
- lastrow++;
-
- model.removeNodeset("/root/main/temp/stepform/info"); //copy를 위해 임시로 만든 노드 삭제
- model.setValue(stepRef + "[" + lastrow + "]/stepno", ++grpControlCnt); //D0 step 정보 셋팅
- model.setValue(stepRef + "[" + lastrow + "]/stepflagcd", "A");
- model.setValue(stepRef + "[" + lastrow + "]/swimlineno", "1");
- model.setValue(stepRef + "[" + lastrow + "]/refseq", "1");
- model.setValue(stepRef + "[" + lastrow + "]/times", "0");
- model.setValue(stepRef + "[" + lastrow + "]/m", "i");
- model.setValue(stepRef + "[" + lastrow + "]/orgstepno", grpControlCnt);
- model.setValue(stepRef + "[" + lastrow + "]/startendflag", "S");
- model.setValue(stepRef + "[" + lastrow + "]/stepnm", "외래");
- //if( instance1.selectSingleNode("/root/main/sortedsteplist/info/stepno") != null ){
- //다음줄의 Step과 자동 연결
- if( instance1.selectSingleNode("/root/main/steplist/info[swimlineno='1' and refseq='1']/stepno") != null ){
- //model.setValue(stepRef + "[" + lastrow + "]/lnkstepno", model.getValue("/root/main/sortedsteplist/info[1]/stepno"));
- model.setValue(stepRef + "[" + lastrow + "]/lnkstepno", model.getValue("/root/main/steplist/info[swimlineno='1' and refseq='1']/stepno"));
- }
- //}
-
- //모든 step의 swimline 수를 +1 늘림
- for(var i=grpControlCnt-1; i>=1; i-- ){
- trgline = model.getValue(stepRef + "[" + i + "]/swimlineno");
- model.setValue( stepRef + "[" + i + "]/swimlineno", parseInt(trgline)+1 );
- if( model.getValue(stepRef + "[" + i + "]/m") != "i" ){
- model.setValue( stepRef + "[" + i + "]/m", "u");
- }
- //시작 스텝 존재시, 시작스텝 취소
- if( model.getValue(stepRef + "[" + i + "]/startendflag") == "S" ){
- model.setValue( stepRef + "[" + i + "]/startendflag", "");
- }
- //라인의 수와, 컨트롤의 수가 일치하지 않기때문에 밑에서 따로 수행해야 함
- //linesControlMaxCnt[i] = linesControlMaxCnt[i-1];
- }
-
- for( var i=linesControlMaxCnt.length; i>=1; i-- ){
- linesControlMaxCnt[i] = linesControlMaxCnt[i-1];
- }
-
- //linesControlMaxCnt[] 마지막 index 에 step1개 셋팅
- linesControlMaxCnt[0] = 1;
- //alert( linesControlMaxCnt );
-
- var org_grpControlCnt = grpControlCnt;
- var org_controlCnt = controlCnt;
- var org_linesControlMaxCnt = linesControlMaxCnt;
- fInitialize();
- grpControlCnt = org_grpControlCnt;
- controlCnt = org_controlCnt;
- linesControlMaxCnt = org_linesControlMaxCnt;
-
- fCreateControl();
-
- selectedControl = null;
- prevStepCntl = null;
- //라인을 추가하면 추가된 라인에 포커스를 맞춘다
- currentStepCntl = org_CurrentStepCntl;
- selectedLineSection = 1;
- fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
- fChangeOutLineCntl("select", selectedLineSection-1); //전체 선의 색상을 다시 셋팅...
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤이나 스윔라인을 삭제한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDelCntl(){
- var header = "supsetno▦deptcd▦updtdd▦updttm▦setno▦settypecd▦m▩";
- var delSetInfoCSV = "";
-
- if( currentStepCntl == null && isNull(selectedLineSection) ){
- messageBox("삭제할 대상을", "C002");
- return;
- }
-
- if( selectedLineSection != "" ){
- //스윔라인을 삭제한다.
- //fDelSwimLine( selectedLineSection );
-
- var nodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + selectedLineSection + "' and formexistyn = 'Y']");
- if(nodeList.length >= 1){
- var msg = messageBox("저장된 처방 혹은 서식 정보가 존재합니다.\nStep을 삭제하면 처방 및 서식도 함께 삭제됩니다.\n\n정말로 ", "Q001");
- if(msg == 6){
- //yes
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var deptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
- var setno = node.selectSingleNode("setno");
-
- if(cpgflagcd == "01"){
- var settypecd = "W";
- } else if(cpgflagcd == "02"){
- var settypecd = "G";
- }
-
- delSetInfoCSV = delSetInfoCSV + "1▦"+deptcd+"▦OOOOOOOO▦OOOO▦"+setno+"▦"+settypecd+"▦d▩";
- }
-
- opener.window.javascript.delPrmsPrcpSetInfo(header+delSetInfoCSV);
-
- fDelStep("L", selectedLineSection);
- opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
- opener.ipt_swimlineno.refresh();
-
- } else if(msg == 7) {
- return false;
- }
- } else {
- fDelStep("L", selectedLineSection);
- opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
- opener.ipt_swimlineno.refresh();
- }
-
- }else {
- //스텝 컨트롤을 삭제한다.
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- if( model.getValue( stepRef + "[" + curNo + "]/formexistyn" ) == "Y" ){
- var msg = messageBox("저장된 처방 혹은 서식 정보가 존재합니다. \nStep을 삭제하면 처방 및 서식도 함께 삭제됩니다. \n정말로 ", "Q001");
- if(msg == 6){
- //yes
- var nodeList = instance1.selectNodes(stepRef + "[" + curNo + "]");
- var deptcd = model.getValue("/root/main/outlineinfo/info/cpgorddeptcd");
- var setno = model.getValue(stepRef + "[" + curNo + "]/setno");
-
- if(cpgflagcd == "01"){
- var settypecd = "W";
- } else if(cpgflagcd == "02"){
- var settypecd = "G";
- }
-
- delSetInfoCSV = "1▦"+deptcd+"▦OOOOOOOO▦OOOO▦"+setno+"▦"+settypecd+"▦d▩";
- opener.window.javascript.delPrmsPrcpSetInfo(header+delSetInfoCSV);
-
- fDelStep("C");
-
- } else if(msg == 7) {
- return false;
- }
- } else {
- fDelStep("C");
- }
- // ★ selectedControl 과 동일하다면 selectedControl를 null 로 셋팅한다.
- // selectedControl = null;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 스윔라인을 삭제한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDelSwimLine(){
- fDelStep("L", selectedLineSection);
- opener.model.setValue( "/root/main/masterinfo/info/swimlineno", lineNo );
- opener.ipt_swimlineno.refresh();
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 스텝 컨트롤을 삭제한다.
- * @param : flag(C:control, L:line), no
- * @return :
- * @---------------------------------------------------
- */
- function fDelStep(flag, no){
- if(flag == "C"){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- var lineNumber = parseInt( model.getValue( stepRef + "[" + curNo + "]/swimlineno" ) );
- var stepRefSeq = parseInt( model.getValue( stepRef + "[" + curNo + "]/refseq" ) );
- var curStepNo = parseInt( model.getValue( stepRef + "[" + curNo + "]/stepno" ) );
- //삭제하려는 라인이 최대갯수의 컨트롤을 갖는 줄이라면, 스윔라인 길이 축소
- //동일갯수를 갖던 라인이 그대로 있으면 길이 축소 안해야 함.
- var adjustLineYN = "N";
- if(maxControlCnt == curRowCtrlMaxCnt){
- adjustLineYN = "Y";
- var curRowCtrlMaxCnt = linesControlMaxCnt[lineNumber-1];
- for( var i=0; i<linesControlMaxCnt.length; i++ ){
- if( linesControlMaxCnt[i] > curRowCtrlMaxCnt ){
- adjustLineYN = "N";
- break;
- }
- }
- }
- if( adjustLineYN == "Y" ){
- if( grp_swimline.attribute("width") != "835px" ){
- if(maxControlCnt >3){
- fAdjustLine("re", "392");
- maxControlCnt--;
- }
- }else{
- if(maxControlCnt > 2){
- fAdjustLine("re", "392");
- maxControlCnt--;
- }
- }
- }
-
- //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다. (1건이므로 for 필요 없음..)
- var nodeList = instance1.selectNodes(stepRef + "[stepno = '" + curNo + "']");
-
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var iNode = node.selectSingleNode("m");
- if(iNode.text != "i"){
- var destNodeList = instance1.selectNodes("/root/temp/delsteplist/info");
- model.setValue(iNode, "d");
- model.makeNode("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]");
- model.copyNode("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]", node);
- model.setValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/stepno", model.getValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/orgstepno"));
- }
- }
-
- fDelLink( curNo ); //선택된 스텝에 연결된 모든 라인을 없댄다.(하위스텝번호를 없앤다)
-
- model.removeNodeset(stepRef + "[stepno = '" + curNo + "']");
- grpControlCnt = grpControlCnt -1;
-
- var stepList = instance1.selectNodes(stepRef);
- for(var i = curNo; i<= stepList.length; i++){
- var iSwimlineno = parseInt(model.getValue(stepRef + "[" + i + "]/swimlineno"));
- var iRefseq = parseInt(model.getValue(stepRef + "[" + i + "]/refseq"));
- var iStepno = model.getValue(stepRef + "[" + i + "]/stepno");
-
- if( lineNumber == iSwimlineno && stepRefSeq < iRefseq ){
- //삭제된 컨트롤과 같은 스윔라인에 존재하는 다음 컨트롤들은 라인당 컨트롤 순번도 -1 씩 감소한다.
- model.setValue( stepRef + "[" + i + "]/refseq", parseInt( iRefseq ) - 1 );
- }
-
- //for(var k=1; k<=i; k++){
- nodeList = instance1.selectNodes(stepRef + "[lnkstepno = '" + iStepno + "']");
- for(var k= 0; k<nodeList.length; k++){
- var node = nodeList.item(k);
- var iNode = node.selectSingleNode("lnkstepno");
- //model.setValue( stepRef + "[" + k + "]/lnkstepno", i );
- model.setValue(iNode, i);
- }
-
- if( iStepno > curNo ){
- nodeList = instance1.selectNodes(dcsRef + "[lnkstepno = '" + iStepno + "']");
- for(var k= 0; k<nodeList.length; k++){
- var node = nodeList.item(k);
- var iNode = node.selectSingleNode("lnkstepno");
- var mNode = node.selectSingleNode("m");
- model.setValue(iNode, i);
- }
- //@@
- model.setValue( stepRef + "[" + i + "]/stepno", parseInt(iStepno)-1 );
-
- nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + iStepno + "']");
- for(var k= 0; k<nodeList.length; k++){
- var node = nodeList.item(k);
- var iNode = node.selectSingleNode("stepno");
- var mNode = node.selectSingleNode("m");
- model.setValue(iNode, i);
- }
- }
- }
- linesControlMaxCnt[lineNumber-1] = linesControlMaxCnt[lineNumber-1] - 1;
- currentStepCntl = null;
- selectedControl = null;
-
- //선택 스텝 정보를 비운 후 disable
- opener.model.resetInstanceNode("/root/main/stepinfo/info");
- opener.tar_stepmemo.refresh();
- opener.ipt_stepnm.refresh();
- opener.ipt_times.refresh();
- opener.cmb_stepnm.refresh(); //2008.08.19 pymi
- opener.tar_stepmemo.disabled = true;
- opener.ipt_stepnm.disabled = true;
- opener.ipt_times.disabled = true;
- opener.cmb_stepnm.disabled = true; //2008.08.19 pymi
-
- }else if(flag == "L"){
- var org_CurrentStepCntl = currentStepCntl;
- var org_SelectedLineSection = selectedLineSection;
-
- var delNodeList = instance1.selectNodes(stepRef + "[swimlineno = '" + no + "']");
- var delCount = delNodeList.length;
-
- fChgDschTimes(parseInt(no)+1); //2008.11.12
-
- //상위 스텝의 연결스텝번호 수정, 위 아래간의 스텝 연결선 유지 (2008.07.02 추가)
- if( delNodeList.length == 1 && no > 1 ){ //삭제되는 스텝이 1개일 경우 (A버튼)
- var lnkNo = instance1.selectSingleNode(stepRef + "[swimlineno = '" + no + "']/lnkstepno");
- var rowNo = parseInt( instance1.selectSingleNode(stepRef + "[swimlineno = '" + (parseInt(no)-1) + "']/stepno").text );
-
- model.setValue(stepRef + "["+ rowNo +"]/lnkstepno", lnkNo.text);
- if( model.getValue(stepRef + "["+ rowNo +"]/m") != "i" ){
- model.setValue(stepRef + "["+ rowNo +"]/m", "u");
- }
-
- }else if( delNodeList.length >= 2 && no > 1 ){ //삭제되는 스텝이 2개 이상일 경우 (D버튼)
- //var deltNos = instance1.selectNodes(stepRef + "[swimlineno = '" + no + "']");
- if( delNodeList.length > 0 ){
- for( var i=0; i<delNodeList.length; i++ ){
- var deltNode = delNodeList.item(i);
- var deltStepNo = deltNode.selectSingleNode("stepno");
- var deltLnkNo = deltNode.selectSingleNode("lnkstepno");
-
- //dcsRef
- //model.setValue( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/m", "u" );
- //model.setValue( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/lnkstepno", deltLnkNo.text );
- var trgtNos = instance1.selectNodes(dcsRef + "[lnkstepno = '" + deltStepNo.text + "']");
-
- if( trgtNos.length > 0 ){
- /*
- for( var k=trgtNos.length-1; k>=0; k-- ){
- var trgtNode = trgtNos.item(i);
- if( trgtNode.selectSingleNode("m").text != "i" ){
- model.setValue(trgtNode.selectSingleNode("m"), "u");
- }
- model.setValue( trgtNode.selectSingleNode("lnkstepno"), deltLnkNo.text );
- }
- */
- if( instance1.selectSingleNode( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/m" ).text != "i" ){
- model.setValue( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/m", "u" );
- }
- model.setValue( dcsRef + "[lnkstepno = '" + deltStepNo.text + "']/lnkstepno", deltLnkNo.text );
- }
- }
- }
- }
-
- var delStepNoListTxt = "";
-
- //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
- for(var i=0; i<delNodeList.length; i++){
- var dstNode = delNodeList.item(i);
- var dstFcsNode = dstNode.selectSingleNode("stepno");
- var curNo = model.getValue(dstFcsNode);
- var iNode = dstNode.selectSingleNode("m");
- var StepNoNode = dstNode.selectSingleNode("stepno"); // orgstepno
-
- delStepNoListTxt = delStepNoListTxt + StepNoNode.text + "|";
-
- if(iNode.text != "i"){
- var destNodeList = instance1.selectNodes("/root/temp/delsteplist/info");
- model.setValue(iNode, "d");
- model.makeNode("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]");
- model.copyNode("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]", dstNode);
- var stpNo = model.getValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/stepno");
- var orgNo = model.getValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/orgstepno");
- model.setValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/stepno", orgNo);
- model.setValue("/root/temp/delsteplist/info[" + (destNodeList.length+1) + "]/orgstepno", stpNo);
- }
- //연결선 정보 및 컨트롤 삭제
- fDelLink( curNo );
- }
-
- var delNodeLngth = delStepNoListTxt.split("|");
- model.removeNodeset (stepRef + "[swimlineno = '" + no + "']"); //copy 후 인스턴스 삭제
- var a = linesControlMaxCnt.slice(0, parseInt(no)-1);
- var b = linesControlMaxCnt.slice(no, linesControlMaxCnt.length);
- linesControlMaxCnt = new Array();
- linesControlMaxCnt = a.concat(b);
-
- grpControlCnt = grpControlCnt - delCount;
-
- //삭제 스텝 제거 후, 전체 스텝 리스트 loop
- var nodeList = instance1.selectNodes(stepRef);
- for(var i=nodeList.length-1 ; i>=0; i--){
- var dstNode = nodeList.item(i);
- var dstFcsNode = dstNode.selectSingleNode("swimlineno");
- //var addTimesNode = dstNode.selectSingleNode("times"); //2008.11.12
-
- if( dstFcsNode.text > no ){
- model.setValue(dstFcsNode, parseInt(model.getValue(dstFcsNode)) - 1);
- /*
- var ioflag = opener.model.getValue("/root/main/masterinfo/info/ioflagcd");
- f( cpgflagcd == "01" && ioflag == "I" && parseInt(no) > 1 ){ //입원 CP의 경우만 회차 순차적으로 지정(2008.11.12)
- model.setValue(addTimesNode, parseInt(model.getValue(addTimesNode)) - 1);
- }
- */
- }
-
- var dstFcsNode = dstNode.selectSingleNode("stepno");
- var lnkFcsNode = dstNode.selectSingleNode("lnkstepno");
- var mFcsNode = dstNode.selectSingleNode("m");
- var org_dstFcsVal = dstFcsNode.text; //비교대상인 스텝의 원 스텝번호(노드 객체로 비교하면, setvalue로 인해 값이 변한다)
-
- //for(var k=0; k<delNodeLngth.length; k++){
- for(var k=delNodeLngth.length-1; k>=0; k--){
- var delFcsNode = delStepNoListTxt.split("|")[k];
- if( parseInt(delFcsNode) < parseInt(org_dstFcsVal) ){
- //@@
- model.setValue( dstFcsNode, parseInt(model.getValue(dstFcsNode))-1 );
- mFcsNode = dstNode.selectSingleNode("m");
- if( mFcsNode.text != "i" ){
- model.setValue(mFcsNode, "u");
- }
- }
- if( parseInt(delFcsNode) < parseInt(lnkFcsNode.text) ){
- model.setValue( lnkFcsNode, parseInt(model.getValue(lnkFcsNode))-1 );
- mFcsNode = dstNode.selectSingleNode("m");
- if( mFcsNode.text != "i" ){
- model.setValue(mFcsNode, "u");
- }
- }
- }
-
- }
-
- var nodeList = instance1.selectNodes(dcsRef);
- if(nodeList.length > 0 ){
- for(var i=nodeList.length-1 ; i>=0; i--){
- var dstNode = nodeList.item(i);
- var dstFcsNode = dstNode.selectSingleNode("stepno");
- var lnkFcsNode = dstNode.selectSingleNode("lnkstepno");
- var mFcsNode = dstNode.selectSingleNode("m");
- var org_dstFcsVal = dstFcsNode.text; //비교대상인 스텝의 원 스텝번호(노드 객체로 비교하면, setvalue로 인해 값이 변한다)
-
- //for(var k=0; k<delNodeLngth.length; k++){
- for(var k=delNodeLngth.length-1; k>=0; k--){
- var delFcsNode = delStepNoListTxt.split("|")[k];
-
- if( parseInt(delFcsNode) < parseInt(dstFcsNode.text) ){
- model.setValue( dstFcsNode, parseInt(model.getValue(dstFcsNode))-1 );
- mFcsNode = dstNode.selectSingleNode("m");
- if( mFcsNode.text != "i" ){
- model.setValue(mFcsNode, "u");
- }
- }
- if( parseInt(delFcsNode) < parseInt(lnkFcsNode.text) ){
- model.setValue( lnkFcsNode, parseInt(model.getValue(lnkFcsNode))-1 );
- if( mFcsNode.text != "i" ){
- model.setValue(mFcsNode, "u");
- }
- }
- /*
- if( parseInt(delFcsNode.text) <= parseInt(lnkFcsNode.text) ){
- model.setValue( lnkFcsNode, parseInt(model.getValue(lnkFcsNode))-1 );
- if( mFcsNode.text != "i" ){
- model.setValue(mFcsNode, "u");
- }
- }
- */
- }
- }
- }
-
- //마지막 스윔라인을 삭제한다.
- fDelLastSwimLine();
-
- lineNo--;
- model.setValue("/root/main/outlineinfo/info/swimlineno", lineNo); //총 스윔라인 수
-
- if(org_SelectedLineSection > lineNo){
- selectedLineSection = "";
- currentStepCntl = null;
- selectSectionsLine[0] = "";
- selectSectionsLine[1] = "";
- selectSectionsLine[2] = "";
- selectSectionsLine[3] = "";
- fChangeOutLineCntl("reset", lineNo);
- }else if( org_SelectedLineSection <= lineNo ){
- currentStepCntl = org_CurrentStepCntl;
- selectedLineSection = org_SelectedLineSection;
- }
- }
-
- fCreateControl();
- selectedControl = null;
- prevStepCntl = null;
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤(인스턴스)을 삭제했다면, 다음 스텝번호들의 시퀀스를 -1 씩 감소시킨다.
- * @param : stepNo, lineNo
- * @return :
- * @---------------------------------------------------
- */
- function fResetSeq(stepNo, lineNo){
- var end = grpControlCnt.length;
- for(var i=stepNo; i<=end; i++){
- var curcntlType = model.getValue( stepRef + "[" + i + "]/stepflagcd");
- if( model.getValue(stepRef + "[" + i + "]/swimlineno") == lineNo ){
- //삭제된 컨트롤과 같은 스윔라인에 존재하는 다음 컨트롤들은 라인당 컨트롤 순번도 -1 씩 감소한다.
- model.setValue( stepRef + "[" + i + "]/refseq", parseInt( model.getValue(stepRef + "[" + i + "]/refseq") ) - 1 );
- }else if( model.getValue(stepRef + "[" + i + "]/swimlineno") > lineNo ){
- for(var k=1; k<i; k++){
- if( model.getValue( stepRef + "[" + i + "]/stepno") == model.getValue(stepRef + "[" + k + "]/lnkstepno") )
- model.setValue( stepRef + "[" + k + "]/lnkstepno", i );
- }
- }
- model.setValue( stepRef + "[" + i + "]/stepno", i-1 );
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 컨트롤을 연결하는 연결선을 삭제한다.
- * @param : trgNo
- * @return :
- * @---------------------------------------------------
- */
- function fDelLink( trgNo ){
- if(currentStepCntl == null){
- // messageBox("삭제할 대상을", "C002");
- // return;
- }
-
- //현재 컨트롤의 인스턴스에서 lnkstepno 를 삭제한 후, fCreateControl() 를 호출한다.
- if( isNull(trgNo) ){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- var delYN = "N";
- } else {
- var curNo = trgNo;
- var delYN = "Y";
- }
- var type = model.getValue( stepRef + "[" + curNo + "]/stepflagcd" );
- var cntlNo = model.getValue( stepRef + "[" + curNo + "]/stepno");
-
- //1. 선택한 스텝의 하위 스텝과의 연결을 해제한다.
- if( type == "D"){
- //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
- var nodeList = instance1.selectNodes(dcsRef + "[stepno = '" + curNo + "']");
-
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var iNode = node.selectSingleNode("m");
- if(iNode.text != "i"){
- var destNodeList = instance1.selectNodes("/root/temp/deldecisionlist/info");
- var stepNode = model.getValue(node.selectSingleNode("stepno"));
- model.setValue(iNode, "d");
- model.makeNode("/root/temp/deldecisionlist/info[" + (destNodeList.length+1) + "]");
- model.copyNode("/root/temp/deldecisionlist/info[" + (destNodeList.length+1) + "]", node);
- }
- }
- model.removeNodeset(dcsRef + "[stepno = '" + curNo + "']");
-
- } else {
- //"A"나 "B"는 해당노드의 lnkstepno만 비워준다.
- model.setValue( stepRef + "[" + curNo + "]/lnkstepno", "" );
- if( model.getValue( stepRef + "[" + curNo + "]/m") != "i"){ //model.getValue( stepRef + "[" + curNo + "]/m") != "i" && delYN == "N"
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- }
- }
-
- //2. 선택한 스텝의 상위 스텝과의 연결을 해제한다.
- var nodeList = instance1.selectNodes(stepRef + "[lnkstepno = '" + curNo + "']");
- for(var i= 0; i<nodeList.length; i++){
- var dstNode = nodeList.item(i);
- var iNode = dstNode.selectSingleNode("lnkstepno");
- model.setValue( iNode, "" );
- iNode = dstNode.selectSingleNode("m");
- if(iNode.text != "i"){ //iNode.text != "i" && delYN == "N"
- model.setValue( iNode, "u" );
- }
- }
-
- //저장된 데이터 이므로, 삭제할 step 정보를 따로 담아두었다가 한꺼번에 삭제한다.
- var nodeList = instance1.selectNodes(dcsRef + "[lnkstepno = '" + curNo + "']");
- if(nodeList.length > 0 ){
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var iNode = node.selectSingleNode("m");
- if(iNode.text != "i"){
- var destNodeList = instance1.selectNodes("/root/temp/deldecisionlist/info");
- var stepNode = model.getValue(node.selectSingleNode("stepno"));
- model.setValue(iNode, "d");
- model.makeNode("/root/temp/deldecisionlist/info[" + (destNodeList.length+1) + "]");
- model.copyNode("/root/temp/deldecisionlist/info[" + (destNodeList.length+1) + "]", node);
- }
- }
- }
-
- model.removeNodeset(dcsRef + "[lnkstepno = '" + curNo + "']");
-
- nodeList = instance1.selectNodes(dcsRef);
- dcsCntlCnt = nodeList.length + 1;
-
- //오른쪽 버튼의 연결삭제를 선택한 경우
- if( isNull(trgNo) ){
- //controlCnt = initControlCnt;
- fCreateControl();
- }
- selectedControl = null;
- currentStepCntl = null;
- prevStepCntl = null;
- selectedLineSection = "";
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 시작 스텝으로 설정한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetStartStep(){
- var curID = currentStepCntl.attribute("id");
- fChildrenCtrlToSelCtrl(curID, "S");
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 종료 스텝으로 설정한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetEndStep(){
- var curID = currentStepCntl.attribute("id");
- fChildrenCtrlToSelCtrl(curID, "E");
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Day 이미지를 생성한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- *
- * 수정이력: 2008.08 pymi CP 표기법 변경으로 daynm, stepnm 함수 인자 추가
- */
- function fSetDayImage(stepno, days, daynm, stepnm){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- var type = model.getValue( stepRef + "[" + curNo + "]/stepflagcd" );
- var times = model.getValue( stepRef + "[" + curNo + "]/times" );
- var no = parseInt(stepno)-1;
- var curStepnm = "";
-
- if( stepnm != "" || !isNull(stepnm)) curStepnm = "(" +stepnm + ")";
-
- if(days != "" ){
- if(type == "D"){
- var leftPos = 66; //200
- var topPos = 51; //51
- } else {
- var leftPos = 32; //308
- var topPos =0; //1
- }
- var cntl;
- var ctrlType = "xforms:img";
- var ctrlID = ctrlType + (controlCnt++);
- currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; src:../../../com/commonweb/images/icon_startend.gif; left:" + leftPos + "; top:" + topPos + "; width:20px; height:20px; background-stretch:stretch;");
- ctrlType = "xforms:caption";
- ctrlID = ctrlType + (controlCnt++);
-
- // 2008.07.30 pymi (s) 기존의 컨트롤을 삭제한다. : 삭제하지 않으면 text가 겹쳐져보임
- var fixedStCntl = model.getValue(stepRef + "[stepno = '" + stepno + "']/fixedStCntl");
- if( !isNull(fixedStCntl)) currentStepCntl.removeChild(fixedStCntl);
- // 2008.07.30 pymi (e)
-
- cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + (topPos+1) + "; width:100px; height:20px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
-
- // 2008.08.18 pymi CP 표기법을 display
- //cntl.attribute("text") = "D" + days;
- cntl.attribute("text") = daynm + curStepnm;
-
- // 2008.07.30 pymi (s)기존의 컨트롤을 setting
- model.setValue(stepRef + "[stepno = '" + stepno + "']/fixedStCntl", ctrlID);
- model.setValue(stepRef + "[stepno = '" + stepno + "']/stepnm", daynm + curStepnm);
- model.setValue(stepRef + "[stepno = '" + stepno + "']/tmpstepnm", stepnm);
- // 2008.07.30 pymi (e)
- } else{
- fCreateControl();
-
- curID = "xforms:group" + no;
- fChildrenCtrlToSelCtrl(curID);
- }
-
- if( model.getValue(stepRef + "[stepno='"+stepno+"']/m") != "i" ){
- model.setValue( stepRef + "[stepno='"+stepno+"']/m", "u" );
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Detail 정보를 조회, 저장한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fViewDetailInfo(OpenerKind){
- if( allInfoSave() ){
- //opener.window.javascript.fSizeControl();
- if(cpgflagcd == "01"){
- model.setValue("/root/main/outlineinfo/info/cpgflagcd", "W");
- } else if(cpgflagcd == "02"){
- model.setValue("/root/main/outlineinfo/info/cpgflagcd", "G");
- }
-
- var nodeList = instance1.selectNodes(stepRef);
- //var nodeList = instance1.selectNodes(sortedStepRef);
- var csv = getNodeListCSV(nodeList);
- model.setValue("/root/main/temp/selectedstep/csvlist", csv);
-
- if(opener.btn_action_tab.selected == true){
- //grp_swimline.vscroll.attribute("pos") = "0";
- //grp_swimline.hscroll.attribute("pos") = "0"
- var vscrollPos = grp_swimline.vscroll.attribute("pos");
- var hscrollPos = grp_swimline.hscroll.attribute("pos");
- ivw_detail.attribute("top") = vscrollPos;
- ivw_detail.attribute("left") = hscrollPos;
-
- if( currentStepCntl == null && grpControlCnt == 0 && OpenerKind != "GPS" ){
- var msg = messageBox("스텝을 ", "C002");
- return;
- }else{
- if(currentStepCntl == null ){ //currentStepCntl == null && grpControlCnt > 0
- currentStepCntl = document.controls("xforms:group0");
- model.setValue("/root/main/temp/selectedstep/stepno", model.getValue(stepRef + "[1]/stepno"));
- model.setValue("/root/main/temp/selectedstep/stepflagcd", model.getValue(stepRef + "[1]/stepflagcd"));
- }
- grp_swimline.attribute("overflow") = "hidden";
- opener.cap_outlineinfo.attribute("text") = "OCS 정보";
-
- var setno = null;
- var selectedDay = null;
- var saveStatus = null;
- var nodelist = null;
-
- if(OpenerKind != "GPS"){
- if( prevStepCntl == null ){
- // if( ivw_detail.src != "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw" )
- // ivw_detail.attribute("src") = "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw";
- // else{
- ivw_detail.window.javascript.fInitData();
- ivw_detail.visible = true;
- // }
- }else{;
- if( prevStepCntl.attribute("id") != currentStepCntl.attribute("d") ){
- ivw_detail.attribute("src") = "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw";
- }
- }
- }
- //ivw_detail.attribute("overflow") = "scroll";
- //ivw_detail.visible = true;
-
- }
- return;
-
- }else if(opener.btn_outline_tab.selected == true){
- grp_swimline.attribute("overflow") = "scroll";
- //grp_swimline.attribute("height") = swimLineHight * parseInt(lineNo) ;
- //ivw_detail.attribute("height") = swimLineHight * parseInt(lineNo) ;
- //grp_swimline.refresh();
-
- if( OpenerKind != "GPS" && ivw_detail.visible == true ){
- if( val_callfCreateControlYN == "Y" ){
- var org_currentStepCntl = currentStepCntl.attribute("id");
- fCreateControl();
- currentStepCntl = document.controls(org_currentStepCntl);
- var currentStepCntlID = currentStepCntl.attribute("id");
-
- fChildrenCtrlToSelCtrl(currentStepCntlID);
- // fChangeSelectCntl("#A683B1", currentStepCntl);
-
- val_callfCreateControlYN = "N";
- }
- }
-
- if(opener.window.javascript.preSelectedTab == "btn_action_tab" && ivw_detail.attribute("src") == "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw" ){
- if( ivw_detail.instance1.selectSingleNode("/root/main/prcp/prcplist[status != 'S' and status != '-']") || ivw_detail.instance1.selectSingleNode("/root/main/form/forminfo/formlist[status = 'i' or status = 'd' or status = 'u']") ){
- if( opener.model.getValue("/root/temp/getdata/authflag") == "M" ){ //조회모드일 때에는 저장하지 않는다 (!= 'S')
- opener.btn_newver.dispatch("DOMActivate");
- }
- }
- }
-
- opener.cap_outlineinfo.attribute("text") = "OutLine 정보";
- ivw_detail.visible = false;
- return;
-
- } else if(opener.btn_detail_tab.selected == true){
- if( ivw_detail.attribute("src") != "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw"
- || ivw_detail.attribute("src") == "../../../emr/prcpmngtweb/xrw/SMMMO00100_처방.xrw" && readyPrcp == "Y"){
-
- if(OpenerKind != "GPS"){
- if(opener.window.javascript.preSelectedTab == "btn_action_tab" && ivw_detail.attribute("src") == "../../../emr/cpgweb/xrw/SPMQP01400_STEP처방관리.xrw" ){
- opener.btn_newver.dispatch("DOMActivate");
- }
- }
-
- //grp_swimline.vscroll.attribute("pos") = "0";
- //grp_swimline.hscroll.attribute("pos") = "0";
- var vscrollPos = grp_swimline.vscroll.attribute("pos");
- var hscrollPos = grp_swimline.hscroll.attribute("pos");
- ivw_detail.attribute("top") = vscrollPos;
- ivw_detail.attribute("left") = hscrollPos;
-
- var stepinfo = opener.javascript.getParameter("stepinfo");
- setParameter("stepinfo", stepinfo);
-
- ivw_detail.attribute("src") = "../../../emr/prcpmngtweb/xrw/SPMMP02200_DetailView.xrw";
- grp_swimline.attribute("overflow") = "hidden";
- opener.cap_outlineinfo.attribute("text") = "환자계획표";
-
- }else{
- opener.btn_action_tab.selected = true;
- opener.btn_action_tab.refresh();
- }
- ivw_detail.visible = true;
- return;
- }
- }else{
- return false;
- }
- }
- /**
- * @group :
- * @ver : 2007.10
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 선택한 스텝의 상세정보를 팝업으로 본다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fViewDetailPopup(){
- opener.btn_detailpopup.dispatch("DOMActivate");
- }
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Detail 정보를 조회, 저장한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCopyPrcpList(){
- copyNodesetType("/root/main/prcp", "/root/main/prcp", "replace", ivw_detail.model, opener.model);
-
- ivw_detail.grd_prcplist.dispatch("onmousedown");
- ivw_detail.window.javascript.appendChildPrcp ( "/root/reset/prcplist", "/root/main/prcp", "main" ); //검색라인추가
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : Master 정보를 저장한다.
- * @param :
- * @return : true, false
- * @---------------------------------------------------
- */
- function allInfoSave(){
- if( opener.model.getValue("/root/temp/getdata/authflag") != "M" ){
- return true;
- }
- if(opener.model.getValue("/root/main/masterinfo/info/cpgno") == "" && opener.model.getValue("/root/main/masterinfo/info/cpgflagcd") == ""){
- messageBox("Master 정보가 존재하지 않아 실행 ", "E001");
- return;
- }else if(opener.model.getValue("/root/main/masterinfo/info/cpgno") == "" && opener.model.getValue("/root/main/masterinfo/info/cpgflagcd") != ""){
- var msg = messageBox("Master 정보가 저장되지 않았습니다. 임시", "Q002");
- if(msg == 6){
- if( !fCheckEssVal("N") ){
- return;
- if( opener.window.javascript.preSelectedTab == "btn_action_tab" ){
- opener.btn_action_tab.selected = true;
- }else if( opener.window.javascript.preSelectedTab == "btn_detail_tab" ){
- opener.btn_detail_tab.selected = true;
- }
- }
- if( opener.model.getValue("/root/temp/getdata/authflag") == "M" ){
- opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
- return true;
- }
- } else if(msg == 7) {
- return false;
- }
- }else{
- if( (instance1.selectSingleNode(stepRef + "[m = 'i' or m = 'u']/stepno") != null || instance1.selectSingleNode(dcsRef + "[m = 'i' or m = 'u']/stepno") != null
- || instance1.selectSingleNode("/root/temp/delsteplist/info/stepno") != null || instance1.selectSingleNode("/root/temp/deldecisionlist/info/stepno") != null)
- || (ivw_detail.visible == true && (ivw_detail.instance1.selectSingleNode("/root/main/prcp/prcplist[status != 'S' and status != '-']") != null) || ivw_detail.instance1.selectSingleNode("/root/main/form/forminfo/formlist[status = 'i' or status = 'd' or status = 'u']") != null) ){
- var msg = messageBox("저장되지 않은 정보가 존재합니다. 임시", "Q002");
- if(msg == 6){
- if( !fCheckEssVal("N") ){
- return;
- if( opener.window.javascript.preSelectedTab == "btn_action_tab" ){
- opener.btn_action_tab.selected = true;
- }else if( opener.window.javascript.preSelectedTab == "btn_detail_tab" ){
- opener.btn_detail_tab.selected = true;
- }
- }
-
- opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
- return true;
-
- } else if(msg == 7) {
- return false;
- }
- }
-
- return true;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 선택한 하나의 스텝만 저장한다. (앞으로 중점적으로 정리한다!)
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveStep(stepNumber){
- //★ 선택된 스텝만 저장(수정)하고, 해당 스텝의 저장 flag 만 바꾼다.
- /*
- if( isNull(stepNumber) ){
- var nodelist = instance1.selectNodes(stepRef);
- //opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
- }else{
- var nodelist = instance1.selectNodes(stepRef + "["+stepNumber+"]");
- }
- */
- //var nodelist = instance1.selectNodes(stepRef);
- var nodelist = instance1.selectNodes(stepRef + "["+stepNumber+"]");
- var stepCSV = getNodeListCSV(nodelist);
-
- //저장으로 넘겼기 때문에, 알아서 상태를 바꿔준다
- model.setValue(stepRef + "[" + stepNumber + "]/m", "");
- opener.window.javascript.fSaveStepInfo(stepCSV);
-
- //특정 스텝의 프로토콜 변경사항 저장 후, mainviewer의 steplist 노드에도 변경된 setno 정보 변경 (2009.03.02 추가)
- var iSettypecd = instance1.selectSingleNode(stepRef + "[stepno='" + stepNumber + "']/settypecd");
- var iSetno = instance1.selectSingleNode(stepRef + "[stepno='" + stepNumber + "']/setno");
- if( iSettypecd != null && iSetno != null ){
- opener.model.setValue(stepRef+"[stepno='" + stepNumber + "']/settypecd", iSettypecd.text);
- opener.model.setValue(stepRef+"[stepno='" + stepNumber + "']/setno", iSetno.text);
- opener.model.setValue("root/main/sortedsteplist/info[stepno='" + stepNumber + "']/settypecd", iSettypecd.text);
- opener.model.setValue("root/main/sortedsteplist/info[stepno='" + stepNumber + "']/setno", iSetno.text);
- }
- //opener.window.javascript.fSaveWithStepInfo();
- //opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
-
- }
-
- function fTempletSave(){
- opener.btn_newver.dispatch("DOMActivate"); //마스터 정보 및 스텝들을 임시저장한다.
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 저장 후, status 값이 I 이거나 U 인 것들을 - 상태로 변환, D 인 것은 삭제한다.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChangeStatus(){
- var nodeList = instance1.selectNodes(stepRef + "[m = 'i' or m = 'u']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var statusNode = node.selectSingleNode("m");
- model.setValue(statusNode, "");
- var stepnoNode = node.selectSingleNode("stepno");
- var orgstepnoNode = node.selectSingleNode("orgstepno");
- model.setValue(orgstepnoNode,stepnoNode.text);
- }
-
- nodeList = instance1.selectNodes(dcsRef + "[m = 'i' or m = 'u']");
- for(var i= 0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var statusNode = node.selectSingleNode("m");
- model.setValue(statusNode, "");
- }
-
- model.removeNodeset("/root/temp/delsteplist");
- model.removeNodeset("/root/temp/deldecisionlist");
- model.makeNode("/root/temp/delsteplist");
- model.makeNode("/root/temp/deldecisionlist");
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 그룹 컨트롤 아이디를 받아서, currentStepCntl을 설정하고, 자식 컨트롤 중 textarea 컨트롤을 반환받아 selControl로 설정, fChangeSelectCntl()를 호출한다.
- * @param : ctrl, flag(시작, 종료스텝 구분, null이면 그외 스텝)
- * @return :
- * @---------------------------------------------------
- */
- function fChildrenCtrlToSelCtrl(ctrl, flag){
- if( flag != "SET" ){
- var selControl = document.controls(ctrl); //현재 선택한 컨트롤(그룹)
- var childrens = selControl.children;
- }else{
- currentStepCntl = document.controls(ctrl); //현재 선택한 컨트롤(그룹)
- var childrens = currentStepCntl.children;
- }
- var elNm = "";
- var curNo = parseInt( ctrl.substr(12, ctrl.length-12) ) + 1;
-
- for(var i=0; i<childrens.length; i++){
- if(childrens.item(i).elementName == "xforms:textarea"){
- elNm = childrens.item(i).attribute("id");
- }
- }
- var selControl = document.controls(elNm);
- if( flag != "SET" ){
- selectedControl = document.controls(elNm); //2007.12.16 추가(OPS 탭에서 Outline탭으로 옮기고 스텝 선택 시 발생하는 오류때문)
- }
-
- if(flag == "S" && opener.window.javascript.OpenerKind != "GPS" ){
- //시작 스텝 설정
- if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
-
- if( instance1.selectSingleNode(stepRef + "[startendflag='S']") != null ){
- messageBox("시작 Step을 2개 이상 설정", "E001");
- return;
- }
-
- model.setValue( stepRef + "[" + curNo + "]/startendflag", "S" );
- fChangeSelectCntl("#ff9900", selectedControl);
- } else {
- model.setValue( stepRef + "[" + curNo + "]/startendflag", "" );
- fChangeSelectCntl("#000000", selControl);
- }
-
- if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- }
-
- } else if(flag == "E" && opener.window.javascript.OpenerKind != "GPS" ){
- //종료 스텝 설정
- if( isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
- model.setValue( stepRef + "[" + curNo + "]/startendflag", "E" );
- fChangeSelectCntl("#ff9900", selectedControl);
- } else {
- model.setValue( stepRef + "[" + curNo + "]/startendflag", "" );
- fChangeSelectCntl("#000000", selControl);
- }
-
- if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- }
-
- } else if(flag == "H" && opener.window.javascript.OpenerKind != "GPS" ){
- //종료 스텝 설정
- if( cpgflagcd == "01" && isNull(model.getValue(stepRef + "[" + curNo + "]/decirflag")) ){
- model.setValue( stepRef + "[" + curNo + "]/decirflag", "I" );
- //fChangeSelectCntl("#ff9900", selectedControl);
- var leftPos =330;
- var topPos = 20;
- var cntl;
- var ctrlType = "xforms:caption";
- var ctrlID = ctrlType + (controlCnt++);
- cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
- cntl.attribute("text") = "[입원\n필요]";
- } else {
- //2008.06.18 pymi(추가)
- if( (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "D") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "O") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "C")) {
- model.setValue( stepRef + "[" + curNo + "]/decirflag", "I" );
- //2008.06.18 pymi(종료)
- } else {
- model.setValue( stepRef + "[" + curNo + "]/decirflag", "" );
- }
- //fChangeSelectCntl("#000000", selControl);
- fCreateControl();
- }
-
- if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- }
- //2008.06.16 pymi(추가)
- } else if(cpgflagcd == "01" && flag == "D" && opener.window.javascript.OpenerKind != "GPS" ){
- if( isNull(model.getValue(stepRef + "[" + curNo + "]/decirflag")) ){
- model.setValue( stepRef + "[" + curNo + "]/decirflag", "D" );
- //fChangeSelectCntl("#ff9900", selectedControl);
- var leftPos =330;
- var topPos = 20;
- var cntl;
- var ctrlType = "xforms:caption";
- var ctrlID = ctrlType + (controlCnt++);
- cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
- cntl.attribute("text") = "[퇴원\n필요]";
- } else {
- if( (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "I" ) || ( model.getValue(stepRef + "[" + curNo + "]/decirflag") == "O") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "C")) {
- model.setValue(stepRef + "[" + curNo + "]/decirflag", "D" );
- } else {
- model.setValue( stepRef + "[" + curNo + "]/decirflag", "" );
- }
- //fChangeSelectCntl("#000000", selControl);
- fCreateControl();
- }
-
- if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- }
- } else if(cpgflagcd == "01" && flag == "O" && opener.window.javascript.OpenerKind != "GPS" ){
- //외래예약필요 step 처리
- if( isNull(model.getValue(stepRef + "[" + curNo + "]/decirflag")) ){
- model.setValue( stepRef + "[" + curNo + "]/decirflag", "O" );
- //fChangeSelectCntl("#ff9900", selectedControl);
- var leftPos =330;
- var topPos = 20;
- var cntl;
- var ctrlType = "xforms:caption";
- var ctrlID = ctrlType + (controlCnt++);
- cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
- cntl.attribute("text") = "[외래\n예약\n필요]";
- } else {
- if( (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "I" ) || ( model.getValue(stepRef + "[" + curNo + "]/decirflag") == "D") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "C")) {
- model.setValue(stepRef + "[" + curNo + "]/decirflag", "O" );
- } else {
- model.setValue( stepRef + "[" + curNo + "]/decirflag", "" );
- }
- //fChangeSelectCntl("#000000", selControl);
- fCreateControl();
- }
-
- if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- }
- //2008.06.16 pymi(종료)
- //2008.08.06 pymi(s)
- } else if(flag == "C" && opener.window.javascript.OpenerKind != "GPS" ){
- //DSC 필요 step 처리
- if( isNull(model.getValue(stepRef + "[" + curNo + "]/decirflag")) ){
- model.setValue( stepRef + "[" + curNo + "]/decirflag", "C" );
- //fChangeSelectCntl("#ff9900", selectedControl);
- var leftPos =330;
- var topPos = 20;
- var cntl;
- var ctrlType = "xforms:caption";
- var ctrlID = ctrlType + (controlCnt++);
- cntl = currentStepCntl.createChild(ctrlType, "id:"+ ctrlID + "; left:" + leftPos + "; top:" + topPos + "; width:50px; height:50px; font-size:8pt; color:#ff0000; font-weight:bolder; ");
- cntl.attribute("text") = "[DSC\n필요]";
- } else {
- if( (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "I" ) || ( model.getValue(stepRef + "[" + curNo + "]/decirflag") == "D") || (model.getValue(stepRef + "[" + curNo + "]/decirflag") == "O")) {
- model.setValue(stepRef + "[" + curNo + "]/decirflag", "C" );
- } else {
- model.setValue( stepRef + "[" + curNo + "]/decirflag", "" );
- }
- //fChangeSelectCntl("#000000", selControl);
- fCreateControl();
- }
-
- if( model.getValue(stepRef + "[" + curNo + "]/m") != "i" ){
- model.setValue( stepRef + "[" + curNo + "]/m", "u" );
- }
- }
- //2008.08.06 pymi(e)
- else {
- if( flag != "SET" ){
- currentStepCntl = selControl;
- }
- if(selectedControl != null){
- //alert("selectedControl = " + selectedControl.attribute("id"));
- if( opener.window.javascript.OpenerKind == "GPS" ){
- fChangeSelectCntl("#000000", selectedControl);
- }else if( opener.window.javascript.OpenerKind != "GPS" && isNull(model.getValue(stepRef + "[" + curNo + "]/startendflag")) ){
- fChangeSelectCntl("#000000", selectedControl);
- }else{
- fChangeSelectCntl("#ff9900", selectedControl);
- }
- }
-
- //alert("selControl = " + selControl.attribute("id"));
- fChangeSelectCntl("#A683B1", selControl);
- }
-
- //if( flag != "SET" ){
- selectedControl = selControl;
- //}
-
- var stepnm = opener.model.getValue( "/root/main/stepinfo/info/stepnm");
- var stepmemo = opener.model.getValue( "/root/main/stepinfo/info/stepmemo");
- var steptimes = opener.model.getValue( "/root/main/stepinfo/info/times");
-
- return (stepnm+"|"+stepmemo+"|"+steptimes);
- }
-
- /**
- * @group :
- * @ver : 2007.07
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS에서 일괄 발행을 위한 decision 스텝의 대답을 얻는다.
- * @param : ctrl
- * @return :
- * @---------------------------------------------------
- */
- function fDecision(){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno"); //현재 선택한 스텝
-
- grd_decision.rowHidden(0) = true;
-
- if(decisionMode == "false"){
- model.setValue("/root/main/seldecisionstep", trgStep);
- model.setValue("/root/main/seldecisionstepno", curNo);
- decisionMode = "true";
- //currentStepCntl.attribute("id")
- grp_msgbox.attribute("top") = parseInt(currentStepCntl.attribute("top")) + 90;
- grp_msgbox.attribute("left") = parseInt(currentStepCntl.attribute("left")) + 250;
- grp_msgbox.visible = true;
- return;
- }
-
- grp_msgbox.visible = false;
-
- if(opener.btn_outline_tab.selected == true){
- var srcStep = model.getValue("/root/main/seldecisionstep"); //바로 이전에 선택된 (상위 스텝)
-
- //이전 선택된 결정의 상태를 조회하여야 함. 2010.04.28 KHJ
- var appStepStatNode = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+srcStep+"']/stepstat");
-
- //결정된 스텝이 있는지 확인.
- var decisionYNNode = opener.instance1.selectSingleNode("/root/main/steppath/info[stepstat=30]/stepno");
- var appStepStat = "";
- //결정된 스텝이 있다면 30 없다면 10
- if (decisionYNNode != null) appStepStat = "30";
- else appStepStat = "10";
- //스텝 경로에 있는 스텝의 경우 스텝 경로 상태 사용
- if( appStepStatNode != null ) appStepStat = appStepStatNode.text;
-
- var currDcsnStep = model.getValue(stepRef + "[stepno='"+srcStep+"']/dcsnstep"); //결정된 스텝
- var currDcsnStepNo = 0;
- if( !isNull(currDcsnStep) ) currDcsnStepNo = parseInt(currDcsnStep); //결정된 스텝 번호
-
- //이미 결정되어 발행된 스텝인 경우 재설정 불가능 처리
- //if( appStepStat > "10" ){
- if( appStepStat == "30" ){
- messageBox("이미 발행된 스텝은 결정을 변경", "E001"); //불가
- decisionMode = "false";
- return;
- }
-
- //연결된 스텝들 중에서만 선택하도록 처리, 그외에는 return (dcsRef 이용)
- if( instance1.selectSingleNode( dcsRef + "[stepno='"+srcStep+"' and lnkstepno='"+trgStep+"']/stepno" ) == null ){
- if( srcStep == trgStep ) messageBox("결정할 스텝을 선택", "I008"); //하시오
- else messageBox("연결된 스텝 외에는 선택", "E001"); //불가
- decisionMode = "false";
- return;
- }
-
- grd_decision_answlist.addRow(true, true);
-
- model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/stepno" , srcStep);
- model.setValue("/root/main/seldecisionlist/info["+ grd_decision.rows +"]/lnkstepno" , trgStep);
-
- //CP적용환자 테이블( MMPHAPPT )에 저장한다.
- var tSwimlineno = model.getValue(stepRef + "[" + curNo + "]/swimlineno");
- if( !opener.window.javascript.fInsCPGAppPatInfo( "D", srcStep, trgStep, tSwimlineno) ){
- return;
- }
-
- model.setValue("/root/main/seldecisionstep", "");
- model.setValue("/root/main/seldecisionstepno", "")
- decisionMode = "false";
-
- model.makeValue(stepRef + "[stepno='"+srcStep+"']/dcsnstep", trgStep);
- opener.model.makeValue(stepRef + "[stepno='"+srcStep+"']/dcsnstep", trgStep);
- opener.model.setValue("/root/main/steppath/info" + "[stepno='"+srcStep+"']/answstepno" , trgStep);
- }
-
- opener.model.setValue("/root/temp1/refresh_obj/change_gps", "Y");
-
- //적용스템 경로 출력 (2010.05.18 JJE)
- var flag = model.getValue(stepRef + "[stepno='"+trgStep+"']/settypecd");
- if( isNull(flag) ) flag = "G";
- opener.window.javascript.fGetAppScopList( flag );
- }
-
- /**
- * @group :
- * @ver : 2009.04
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS에서 CPG의 decision 취소
- * @param : ctrl
- * @return :
- * @---------------------------------------------------
- */
- function fCnclDecisionMode(){
- grp_msgbox.visible = false;
- decisionMode = "false";
- }
-
- /**
- * @group :
- * @ver : 2007.08
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS가 opener 일 경우, 서식 코드를 조회한다.
- * @param : ctrl
- * @return :
- * @---------------------------------------------------
- */
- function GPS_fGetFormList(flag, val){
- if( flag == "S" ){
- opener.window.javascript.fGetFormList("S", val);
- return;
- }else if( flag == "D" ){
- opener.window.javascript.fGetFormList("D", val);
- return;
- }
- }
-
- /**
- * @group :
- * @ver : 2007.08
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS가 opener 일 경우, 서식 코드를 조회한다. (사용 안 함)
- * @param : mode
- * @return :
- * @---------------------------------------------------
- */
- function fGetPrcpList( mode ){
- if( mode == "step" ){
- if(currentStepCntl != null){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
-
- if(cpgflagcd == "01"){
- var settypecd = "W";
- } else if(cpgflagcd == "02"){
- var settypecd = "G";
- }
-
- model.removeNodeset("/root/send");
- model.makeNode("/root/send");
-
- model.makeValue ( "/root/send/cond1", model.getValue(stepRef + "[" + curNo + "]/setno") );
- model.makeValue ( "/root/send/cond2", settypecd);
-
- model.makeValue ( "/root/send/cpgno", model.getValue("/root/main/outlineinfo/info/cpgno") );
- model.makeValue ( "/root/send/cpghistseq", model.getValue("/root/main/outlineinfo/info/cpghistseq") );
- model.makeValue ( "/root/send/cpgflagcd", cpgflagcd);
- model.makeValue ( "/root/send/dayno", model.getValue(stepRef + "[" + curNo + "]/times") );
- model.makeValue ( "/root/send/setcond", model.getValue(stepRef + "[" + curNo + "]/setno") );
- model.makeValue ( "/root/send/cpgappno", opener.model.getValue("/root/temp1/getdata/cpgappno") );
- model.makeValue ( "/root/send/case", "step");
-
- submit("TRMMP02202", false); //submit("TRMMB00202", false) 와 동일
-
- }else if( mode == "step" ){
- ivw_detail.window.javascript.fGetPrcpSetList();
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2007.10
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 스텝 저장 전, 필수 값 체크를 한다
- * @param : mode
- * @return :
- * @---------------------------------------------------
- */
- function fCheckEssVal( essYN, stepNo ){
- cpgflagcd = opener.model.getValue("/root/main/masterinfo/info/cpgflagcd");
- var fcstinhospdayno = opener.model.getValue("/root/main/masterinfo/info/fcstinhospdayno");
-
- if( instance1.selectSingleNode("/root/main/steplist/info") != null ){
- if( (cpgflagcd == "01" && essYN == "Y") || (cpgflagcd == "02" && !isNull(fcstinhospdayno)) ){
- // 저장 필수체크
- // 1. Day 체크
- if( instance1.selectSingleNode(stepRef + "[times = '']") != null ){
- messageBox("모든 Step의 Day는 ", "I003");
- return false;
- }
- }
-
- // 임시저장+저장 필수체크
- // 2. 시작스텝 체크
- var nodeList = instance1.selectNodes(stepRef);
- var startNodeList = instance1.selectNodes(stepRef + "[startendflag = 'S']");
- var endNodeList = instance1.selectNodes(stepRef + "[startendflag = 'E']");
-
- if( nodeList.length > 1 && startNodeList.length <= 0 ){
- if( instance1.selectSingleNode(stepRef + "[swimlineno='1' and refseq='1']") != null ){
- model.setValue(stepRef + "[swimlineno='1' and refseq='1']/startendflag", "S");
- }else{
- var minLineNo = nodeList.length;
- for(var i=0; i<nodeList.length; i++){
- var node = nodeList.item(i);
- var iSwimLineNo = parseInt(node.selectSingleNode("swimlineno").text);
- if( iSwimLineNo <= minLineNo ){
- minLineNo = iSwimLineNo;
- }
- }
- model.setValue(stepRef + "[swimlineno='"+minLineNo+"' and refseq='1']/startendflag", "S");
- }
-
- }else if( nodeList.length > 1 && startNodeList.length > 1 ){
- messageBox("시작스텝은 둘 이상 존재할 수", "I004");
- return false;
- }
-
- var notStartNodeList = instance1.selectNodes(stepRef + "[startendflag != 'S']");
- if( notStartNodeList.length > 1 ){
- for(var i=0; i<notStartNodeList.length; i++){
- var node = notStartNodeList.item(i);
- var stepNode = node.selectSingleNode("stepno");
-
- var role1 = instance1.selectSingleNode(stepRef + "[lnkstepno='" + stepNode.text + "']");
- var role2 = instance1.selectSingleNode(dcsRef + "[lnkstepno='" + stepNode.text + "']");
- if( role1 == null && role2 == null ){
- messageBox("시작스텝은 둘 이상 존재할 수", "I004");
- return false;
- }
- }
- }
- // 3. 스텝간의 연결 체크(종료스텝 필)
- if( cpgflagcd == "01" && nodeList.length > 1 && endNodeList.length <= 0 ){
- //end스텝 강제 설정 방법 변경 (2008.12.09)
- var maxLineNo = model.getValue("/root/main/outlineinfo/info/swimlineno");
- var notEndNodeList = instance1.selectNodes(stepRef + "[swimlineno='"+ maxLineNo +"']");
- for(var i=0; i<notEndNodeList.length; i++){
- var node = notEndNodeList.item(i);
- var startendflagNode = node.selectSingleNode("startendflag");
- model.setValue(startendflagNode, "E");
- }
- }
- //CPG end스텝 자동 설정 (2009.03.02)
- if( cpgflagcd == "02" && nodeList.length > 1){
- for( var i=nodeList.length-1; i>=0; i-- ){
- var iNode = nodeList.item(i);
- var lnkNode = iNode.selectSingleNode("stepno");
- var startendflag = iNode.selectSingleNode("startendflag");
- var lnkstepno = iNode.selectSingleNode("lnkstepno");
- var stepflagcd = iNode.selectSingleNode("stepflagcd");
- if( isNull(lnkstepno.text) && startendflag.text !='S' && stepflagcd.text == 'A' ){
- var lnkNodes = instance1.selectNodes(stepRef + "[lnkstepno='"+lnkNode.text+"']");
- var dcsNodes = instance1.selectNodes(dcsRef + "[lnkstepno='" + +lnkNode.text + "']");
- if(lnkNodes.length>0 || dcsNodes.length>0 ){
- model.setValue(startendflag, "E");
- }
- }
- }
- }
-
- if( !isNull(fcstinhospdayno) && fcstinhospdayno != "1") { // 하루짜리 CP는 체크 하지 않도록 수정. 2016.03.31 엄영만
- if( instance1.selectSingleNode(stepRef + "[stepflagcd='A' and startendflag!='E' and lnkstepno='']") != null ){
- messageBox("스텝간의 연결 혹은 종료스텝 설정을", "I007") ;
- return false;
- }
- }
-
- //등록일 경우만 check
- if( essYN == "Y" ){
- if( cpgflagcd == "01" ){
- //4. 퇴원필요 Step 처리 여부
- //2008.07.29 pymi 저장시 퇴원필요 step 처리여부
- if(ivw_detail.visible == true) {
- var dschStep = ivw_detail.instance1.selectNodes("/root/main/prcp/prcplist[prcpkindcd = '60' or prcpkindcd = '70']");
- if( dschStep.length > 0 ) {
- curSetno = ivw_detail.model.getValue("/root/hidden/prmsprcpsetdetlset/setno");
- curStepno = ivw_detail.instance1.selectSingleNode("root/temp/steplist/stepinfo[setno ='" + curSetno + "']/stepno");
- if( "D" != instance1.selectSingleNode("/root/main/steplist/info[stepno = '" + curStepno.text + "']/decirflag").text ) {
-
- messageBox("퇴원필요step을 지정", "I008");
- return false;
- }
- }
- }
- }
- }
-
- }else{
- fcstinhospdayno = opener.model.getValue("/root/main/masterinfo/info/fcstinhospdayno");
- if( cpgflagcd != "01" && !isNull(fcstinhospdayno) && fcstinhospdayno != opener.model.getValue("/root/main/masterinfo/info/swimlineno") ){
- if( messageBox("스윔라인수와 재원일수가 일치하지 않아서\n회차 정보를 자동입력할 수 없습니다.\n\n", "Q003") == 7 ){
- return false;
- }
- }
- }
-
- return true;
- }
-
- /**
- * @group :
- * @ver : 2007.10
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 저장 후 셋번호 바뀌면, 스텝에 바뀐 셋 번호를 매핑시킨다
- * @param : mode
- * @return :
- * @---------------------------------------------------
- */
- function fSetStepSetNo(){
- var nodeList = opener.instance1.selectNodes("/root/temp/tempnode/prms");
- var trgNode = null;
- var prmsSetNode = null;
-
- for( var i=0; i<nodeList.length; i++ ){
- var node = nodeList.item(i);
- var oldSetNode = node.selectSingleNode("oldsetno");
- var newSetNode = node.selectSingleNode("newsetno");
-
- trgNode = instance1.selectSingleNode(stepRef + "[setno = '" + oldSetNode.text + "']/setno");
- if(trgNode){
- model.setValue(trgNode, newSetNode.text);
- }
-
- //2007.10.30 추가 (임시저장 할 때, 이전 버전의 셋번호에 업데이트하는 오류 처리)
- if( ivw_detail.visible == true ){
- prmsSetNode = ivw_detail.instance1.selectSingleNode("/root/hidden/prmsprcpsetdetlset[setno = '" + oldSetNode.text + "']/setno");
- if(prmsSetNode != null){
- model.setValue(prmsSetNode, newSetNode.text);
- }
- }
- }
- var nodeList = instance1.selectNodes(stepRef);
- var csv = getNodeListCSV(nodeList);
- model.setValue("/root/main/temp/selectedstep/csvlist", csv);
- //if(opener.btn_action_tab.selected == true ){
- if( ivw_detail.visible == true ){
- ivw_detail.window.javascript.fSetStepSetNo();
- }
- }
-
- /**
- * @group :
- * @ver : 2007.12
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 입원으로 전환되는 스텝임을 정한다
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetInHospStep(){
- var curID = currentStepCntl.attribute("id");
- fChildrenCtrlToSelCtrl(curID, "H");
- }
-
- /**
- * @group :
- * @ver : 2008.06
- * @by : 박유미
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 퇴원으로 전환되는 스텝임을 정한다
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetDschHospStep(){
- var curID = currentStepCntl.attribute("id");
- fChildrenCtrlToSelCtrl(curID, "D");
- }
-
- /**
- * @group :
- * @ver : 2008.06
- * @by : 박유미
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 외래예약 스텝임을 정한다
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetOutHospStep(){
- var curID = currentStepCntl.attribute("id");
- fChildrenCtrlToSelCtrl(curID, "O");
- }
-
- /**
- * @group :
- * @ver : 2008.08
- * @by : 박유미
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : DSC 필요 스텝임을 정한다
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetDSCHospStep(){
- var curID = currentStepCntl.attribute("id");
- fChildrenCtrlToSelCtrl(curID, "C");
- }
- /**
- * @group :
- * @ver : 2008.11
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 삭제하는 라인의 다음 라인이 퇴원일이라면, 퇴원일스텝의 times를 조정해주어야 함. (2008.11.12)
- * @param : no (마지막라인no)
- * @return :
- * @---------------------------------------------------
- */
- function fChgDschTimes(no){
- var ioflag = opener.model.getValue("/root/main/masterinfo/info/ioflagcd");
- if( cpgflagcd == "01" && ioflag == "I" ){
- var dschStepList = instance1.selectNodes(stepRef + "[swimlineno = '" + no + "' and stepnm='퇴원일']");
- if(dschStepList.length > 0){
- for(var i=0; i<dschStepList.length; i++){
- var node = dschStepList.item(i);
- var dschTimesNode = node.selectSingleNode("times");
- var mNode = node.selectSingleNode("m");
- model.setValue(dschTimesNode, parseInt(dschTimesNode.text)-1);
- if(mNode.text != "i") model.setValue(mNode, "u");
- }
- }
- }
- }
-
- /**
- * @group :
- * @ver : 2008.12
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS에서 시작 스텝 설정 시 값 설정
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetupStartStep(){
- fSetupStartEndStep("S");
- }
-
- /**
- * @group :
- * @ver : 2008.12
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS에서 종료 스텝 설정 시 값 설정
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetupEndStep(){
- fSetupStartEndStep("E");
- }
-
- /**
- * @group :
- * @ver : 2008.12
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS에서 해당 스텝만 발행되도록 스텝 설정 시 값 설정
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetupOneStep(){
- //fSetupStartEndStep("S");
- var startFlag1 = opener.instance1.selectSingleNode("/root/main/steppath/info[startendflag='S']/startendflag");
- var startFlag2 = instance1.selectSingleNode(stepRef + "[startendflag='S']/startendflag");
- if( startFlag1 != null ) model.setValue(startFlag1, "");
- if( startFlag2 != null ) model.setValue(startFlag2, "");
-
- fSetupStartEndStep("E");
- }
-
- /**
- * @group :
- * @ver : 2008.12
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : M-GPS에서 시작/종료 스텝 설정 시 값 설정 및 취소
- * @param : flag (S:시작스텝, E:종료스텝)
- * @return :
- * @---------------------------------------------------
- */
- function fSetupStartEndStep( flag ){
- var nFlag = "";
- if( flag == "S" ) nFlag = "E";
- else nFlag = "S";
-
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- var srcStep = "";
- var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno"); //현재 선택한 시작될 스텝
- var startEndFlag = opener.model.getValue("/root/main/steppath/info" + "[" + curNo + "]/startendflag");
-
- /*
- if(opener.btn_outline_tab.selected == true){
- if(startEndFlag == flag){
- //시작스텝 취소 or 종료스텝 취소
- opener.window.javascript.fInsCPGAppPatInfo( flag, srcStep, "" );
-
- }else if(startEndFlag == nFlag){
- //종료스텝 취소-시작스텝 설정 or 시작스텝 취소-종료스텝 설정
-
- }else{
- //CP적용환자 테이블( MMPHAPPT )에 저장한다.
- if( !opener.window.javascript.fInsCPGAppPatInfo( flag, srcStep, trgStep ) ){ //false 리턴시 종료.. 아래 내용 수행 안함
- return;
- }
- }
- }
- */
- //시작스텝 설정 or 취소-종료스텝 설정
- var sFlag = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+trgStep+"']");
- if( sFlag == null ){
- var orgStartStepNo = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[startendflag='"+flag+"']/stepno"); //원래 시작 스텝
- if( orgStartStepNo != null ){
- srcStep = orgStartStepNo.text;
- }
- if( !isNull(srcStep) ){
- model.makeValue(stepRef + "[stepno='"+srcStep+"']/startendflag", ""); //이전 시작스텝 - 설정 취소
- //opener.model.makeValue(stepRef + "[stepno='"+srcStep+"']/startendflag", "");
- if (opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+srcStep+"']/startendflag") != null) {
- opener.model.setValue("/root/main/steppath/info" + "[stepno='"+srcStep+"']/startendflag" , "");
- }
-
- }
-
- //messageBox("결정되지 않은 경로", "I009");
- //return;
- //server에서 decision을 미리 내린다(자동결정기능)
- var tSwimlineno = model.getValue(stepRef + "[" + curNo + "]/swimlineno");
- if( !opener.window.javascript.fInsCPGAppPatInfo( "A", trgStep, "", tSwimlineno) ){
- return;
- }
-
- model.setValue("/root/main/seldecisionstep", "");
- model.setValue("/root/main/seldecisionstepno", "")
- var stepPathList = opener.instance1.selectNodes("/root/main/steppath/info" + "[stepflagcd='D']"); //원래 시작 스텝
- for( var i=0; i<stepPathList.length; i++ ){
- var node = stepPathList.item(i);
- var decNode = node.selectSingleNode("stepno");
- var ansNode = node.selectSingleNode("answstepno");
- model.setValue(stepRef + "[stepno='"+ decNode.text +"']/dcsnstep", ansNode.text);
- opener.model.makeValue(stepRef + "[stepno='"+ decNode.text +"']/dcsnstep", ansNode.text);
- }
-
- //## 스텝 경로 수정 후, 기존 선택된 결정값 초기화 2010.04.30 KHJ
- var DStepNodeList = instance1.selectNodes(stepRef + "[stepflagcd='D']");
- var openerDStepNodeList = opener.instance1.selectNodes("/root/main/steppath/info" + "[stepflagcd='D']");
-
- for (var i=0;i<DStepNodeList.length;i++) {
- var DStepNode = DStepNodeList.item(i);
- var DStepNo = DStepNode.selectSingleNode("stepno");
-
- var sameYN = "N";
- for (var j=0;j<openerDStepNodeList.length;j++) {
- var openerDStepNode = openerDStepNodeList.item(j);
- var openerDStepNo = openerDStepNode.selectSingleNode("stepno");
- if (DStepNo.text == openerDStepNo.text) sameYN = "Y";
- }
- // 스텝 경로에 없는 결정(Decision)은 dcsnstep을 0 처리
- if (sameYN == "N") {
- model.setValue(stepRef + "[stepno='"+DStepNo.text+"']/dcsnstep", "");
- opener.model.makeValue(stepRef + "[stepno='"+ DStepNo.text +"']/dcsnstep", "");
- }
- }
-
- }
-
- var orgStartStepNo = opener.instance1.selectSingleNode("/root/main/steppath/info" + "[startendflag='"+flag+"']/stepno"); //원래 시작 스텝
- if( orgStartStepNo != null ){
- srcStep = orgStartStepNo.text;
- }
-
- if( !isNull(srcStep) ){
- model.makeValue(stepRef + "[stepno='"+srcStep+"']/startendflag", ""); //이전 시작스텝 - 설정 취소
- //opener.model.makeValue(stepRef + "[stepno='"+srcStep+"']/startendflag", "");
- if (opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+srcStep+"']/startendflag") != null) {
- opener.model.setValue("/root/main/steppath/info" + "[stepno='"+srcStep+"']/startendflag" , "");
- }
-
- }
-
- model.makeValue(stepRef + "[stepno='"+trgStep+"']/startendflag", flag);
- //opener.model.makeValue(stepRef + "[stepno='"+trgStep+"']/startendflag", flag);
- if( opener.instance1.selectSingleNode("/root/main/steppath/info" + "[stepno='"+trgStep+"']/startendflag") != null ){
- opener.model.setValue("/root/main/steppath/info" + "[stepno='"+trgStep+"']/startendflag" , flag);
- }
- opener.model.setValue("/root/temp1/refresh_obj/change_gps", "Y");
-
- //적용스템 경로 출력 (2010.05.18 JJE)
- opener.window.javascript.fGetAppScopList();
-
- if( flag == "S" ) model.setValue("/root/temp/startstepno", trgStep);
- else model.setValue("/root/temp/endstepno", trgStep);
-
- //직접 refresh 수행
- fCreateControl();
- selectedControl = null;
- //currentStepCntl = document.controls(id);
- fChangeSelectCntl("#A683B1", currentStepCntl);
- }
-
- /**
- * @group :
- * @ver : 2010.06
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : CPG에서 decision 스텝의 결정을 취소
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCnclDecisionAct(){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- var trgStep = model.getValue(stepRef + "[" + curNo + "]/stepno"); //현재 선택한 스텝
- var tSwimlineno = model.getValue(stepRef + "[" + curNo + "]/swimlineno");
- var appStepStat = opener.model.getValue("/root/main/steppath/info" + "[stepno='"+trgStep+"']/stepstat");
- var appStepStat = opener.model.getValue("/root/main/steppath/info" + "[stepno='"+trgStep+"']/answstepno");
- grd_decision.rowHidden(0) = true;
-
- if( isNull(appStepStat) || appStepStat == 0 ){
- messageBox("현재 미결정 상태", "I009");
- return;
- }
- else if( appStepStat == 30 ){
- messageBox("이미 발행된 스텝은 결정을 변경", "E001"); //불가
- return;
- }
-
- if( !opener.window.javascript.fInsCPGAppPatInfo( "D", trgStep, "0", tSwimlineno) ){
- return;
- }
-
- opener.model.setValue("/root/temp1/refresh_obj/change_gps", "Y");
- opener.window.javascript.fGetAppScopList(); //적용스텝 경로 출력 (2010.05.18 JJE)
-
- fCreateControl();
- selectedControl = null;
- //currentStepCntl = document.controls(curID);
- fChangeSelectCntl("#A683B1", currentStepCntl);
- }
-
- /**
- * @group :
- * @ver : 2010.06
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : CPG+CP 에서, CP 스텝을 적용범위로 지정
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetupCPStep(){
- var OpenPath_StartStep = opener.instance1.selectSingleNode("/root/main/steppath/info[startendflag='S']/startendflag");
- var OpenPath_EndStep = opener.instance1.selectSingleNode("/root/main/steppath/info[startendflag='E']/startendflag");
- var Open_StartStep = opener.instance1.selectSingleNode("/root/main/steplist/info[startendflag='S']/startendflag");
- var Open_EndStep = opener.instance1.selectSingleNode("/root/main/steplist/info[startendflag='E']/startendflag");
- var StartStep = instance1.selectSingleNode("/root/main/steplist/info[startendflag='S']/startendflag");
- var EndStep = instance1.selectSingleNode("/root/main/steplist/info[startendflag='E']/startendflag");
- if( OpenPath_StartStep != null ) model.setValue(OpenPath_StartStep, "");
- if( OpenPath_EndStep != null ) model.setValue(OpenPath_EndStep, "");
- if( Open_StartStep != null ) model.setValue(Open_StartStep, "");
- if( Open_EndStep != null ) model.setValue(Open_EndStep, "");
- if( StartStep != null ) model.setValue(StartStep, "");
- if( EndStep != null ) model.setValue(EndStep, "");
-
- var cpNodeList = opener.instance1.selectNodes("/root/main/steppath/info" + "[settypecd='W']");
- if( cpNodeList.length > 0 ){
- var node = null;
- var startendflagNode = null;
- var stepnoNode = null;
-
- node = cpNodeList.item(0);
- startendflagNode = node.selectSingleNode("startendflag");
- stepnoNode = node.selectSingleNode("stepno");
- model.setValue(startendflagNode, "S");
- opener.model.makeValue("/root/main/steplist/info[stepno='"+stepnoNode.text+"']/startendflag", "S");
- model.makeValue(stepRef + "[stepno='"+stepnoNode.text+"']/startendflag", "S");
- model.setValue("/root/temp/startstepno", stepnoNode.text);
-
- node = cpNodeList.item(cpNodeList.length-1);
- startendflagNode = node.selectSingleNode("startendflag");
- stepnoNode = node.selectSingleNode("stepno");
- model.setValue(startendflagNode, "E");
- opener.model.makeValue("/root/main/steplist/info[stepno='"+stepnoNode.text+"']/startendflag", "E");
- model.makeValue(stepRef + "[stepno='"+stepnoNode.text+"']/startendflag", "E");
- model.setValue("/root/temp/endstepno", stepnoNode.text);
-
- opener.model.setValue("/root/temp1/refresh_obj/change_gps", "Y");
-
- //적용스템 경로 출력 (2010.05.18 JJE)
- opener.window.javascript.fGetAppScopList("W");
-
- //직접 refresh 수행
- fCreateControl();
- selectedControl = null;
- //currentStepCntl = document.controls(id);
- fChangeSelectCntl("#A683B1", currentStepCntl);
- }
- }
-
- function fOpenAttrPopupEvent(){
- alert("function");
- }
-
- /**
- * @group :
- * @ver : 2010.06
- * @by : 전지은
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 생성기 Main의 속성 리스트 항목을 재조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitMainAttList( inqrflag ){
- //opener.window.javascript.fInitAttList();
- var title = "";
- var guide = "";
- if(inqrflag == "R"){
- title = "필수처방 미발행 사유 문진";
- guide = "용도 (미시행사유 입력용), 팝업시점 (퇴원예고)";
- }else if(inqrflag == "D"){
- title = "선택필수처방 미발행 사유 문진";
- guide = "용도 (선택필수 미시행사유 입력용), 팝업시점 (퇴원예고)";
- }
-
- if( opener.instance1.selectSingleNode("/root/main/inqrinfo/inqrheader[inqrflag='"+inqrflag+"']") == null ){
- var i = opener.grd_popup.rows;
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrno", "");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrhistno", "");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/cpgno", "");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/cpghistseq", "");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/title", title);
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrnm", title);
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/guide", guide);
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/pntmflag", "1");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrflag", inqrflag);
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/stepno", "0");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/stepnm", "");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/qestcnts", "");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/cpgappno", "");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqrstatcd", "-");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqroffyn", "-");
- opener.model.makeValue("/root/main/inqrinfo/inqrheader["+i+"]/inqranswdd", "-");
- opener.grd_popup.refresh();
- }
- }
- ]]>
- </script>
- </xhtml:head>
- <xhtml:body pagewidth="835" style="margin:0; margin-left:0; margin-top:0; margin-right:0; margin-bottom:0; ">
- <group id="grp_swimline" overflow="scroll" scroll="auto" style="left:0px; top:0px; width:835px; height:653px; margin:0; margin-left:0; margin-top:0; margin-right:0; margin-bottom:0; ">
- <script type="javascript" ev:event="onmousedown">
- <![CDATA[
- var ctrl = null;
- ctrl = (event.target);
- var selControl = document.controls(ctrl); //현재 선택한 컨트롤(textarea)
- var cX = event.x;
- var cY = event.y;
- var tY = event.targetY;
- var onmouseX = parseInt(grp_swimline.attribute("width")) - 18 ; //803 or ?
-
- //1. 마우스 오른쪽 버튼을 클릭한 경우
- var curID = selControl.parent.attribute("id");
- currentStepCntl = document.controls(curID); //선택한 컨트롤을 담고 있는 그룹 컨트롤(group)
-
- //그룹을 선택했을 경우,
- if(ctrl.substr(0, 12) == "xforms:group" || ctrl.substr(0, 12) == "grp_swimline" && parseInt(cX) < onmouseX && parseInt(cY) < 638){
- if(curID.substr(0, 12) == "grp_swimline"){
- tY = parseInt( selControl.attribute("top") );
- }
-
- //영역 선택 : 현재 Y 지점 위치 = 스크롤의 현재위치를 더한 targetY / 스윔라인 높이 + 1
- var org_selectedLineSection = selectedLineSection;
- selectedLineSection = Math.floor( (parseInt(tY) + parseInt(grp_swimline.vscroll.attribute("pos")) ) / swimLineHight)+1;
- if( ctrl.substr(0, 12) == "xforms:group" ){
- selectedLineSection = Math.floor( parseInt(tY) / swimLineHight)+1;
- }
-
- if(selectedLineSection > lineNo){
- fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
- return;
-
- } else {
- fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
- fChangeOutLineCntl("select", selectedLineSection-1); //전체 선의 색상을 다시 셋팅...
-
- if(selectedControl != null){
- if( isNull(selectedControl.parent.attribute("id")) ){
- return;
- }
- var sCurID = selectedControl.parent.attribute("id"); //error
- sCurID = sCurID.substr(12, sCurID.length-12);
- if( !isNull(model.getValue(stepRef + "[" + (parseInt(sCurID)+1) + "]/startendflag")) ){ //조건삭제 (opener.window.javascript.OpenerKind != "GPS" && ) 2008.12.22
- fChangeSelectCntl("#ff9900", selectedControl);
- }else{
- fChangeSelectCntl("#000000", selectedControl);
- }
- selectedControl = null;
- }
- }
-
- if (event.button == 3 && (ctrl.substr(0, 12) == "xforms:group" || ctrl.substr(0, 12) == "grp_swimline") && parseInt(cX) < 790 && parseInt(cY) < 638){ //cX<795로 고쳐볼것..
- if( opener.model.getValue("/root/temp/getdata/authflag") == "M" && opener.window.javascript.OpenerKind != "GPS" ){
- if( selectedLineSection == 1 && instance1.selectSingleNode(stepRef + "/stepno") != null ){
- window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu4/item", "name", "func", false); //첫번째 라인은 D0 step 추가 메뉴 있음
- }else{
- window.setPopupMenu(true, "/root/main/outlineinfo/menu/popupmenu2/item", "name", "func", false);
- }
- }
- }
-
- //버튼들의 enable/disable
- //btn_initialize.disabled = false;
- btn_start.disabled = true;
- btn_end.disabled = true;
- btn_action.disabled = false;
- btn_decision.disabled = false;
- btn_branch.disabled = false;
- btn_disconnection.disabled = true;
- btn_connection.disabled = false;
- btn_addline.disabled = false;
- btn_remove.disabled = false;
- opener.ipt_stepnm.disabled = true;
- opener.tar_stepmemo.disabled = true;
- opener.ipt_times.disabled = true;
- opener.ipt_times_old.disabled = true;
- opener.cmb_stepnm.disabled = true; // 2008.08.21 pymi
- opener.ipt_stepnm.value = "";
- opener.tar_stepmemo.value = "";
- opener.ipt_times.value = "";
- opener.ipt_times_old.value = "";
- opener.cmb_stepnm.value = ""; // 2008.08.21 pymi
-
- if( opener.instance1.selectSingleNode( "/root/main/stepinfo/info/stepno") != null ){
- opener.model.setValue( "/root/main/stepinfo/info/stepno", "" );
- opener.model.setValue( "/root/main/stepinfo/info/stepmemo", "" );
- opener.model.setValue( "/root/main/stepinfo/info/stepflagcd", "" );
- opener.model.setValue( "/root/main/stepinfo/info/daynm", "" );
- }
- }
-
- else if(ctrl.substr(0, 15) == "xforms:textarea"){
- //fPopupMenuEvent() 후 실행된다.
- if( prevStepCntl == null ) {
- if(connectionMode == "true"){
- prevStepCntl = currentStepCntl;
- }
-
- //단순 컨트롤 선택이라면, 라인의 색상을 바꾼다.
- if(selectedControl != null){
- if( isNull(selectedControl.parent.attribute("id")) ){
- //alert( "selectedControl.parent = null ");
- return;
- }
-
- var sCurID = selectedControl.parent.attribute("id"); //erroor
- sCurID = sCurID.substr(12, sCurID.length-12);
-
- if( !isNull(model.getValue(stepRef + "[" + (parseInt(sCurID)+1) + "]/startendflag")) ){ //조건삭제 (opener.window.javascript.OpenerKind != "GPS" && ) 2008.12.22
- fChangeSelectCntl("#ff9900", selectedControl);
-
- } else {
- fChangeSelectCntl("#000000", selectedControl);
- }
- selectedControl = null;
- }
-
- selectedControl = selControl;
- fChangeSelectCntl("#A683B1", selControl); //현재 선택한 컨트롤의 외곽선 색상을 빨간색으로 설졍
-
- if(selectedLineSection != ""){
- selectedLineSection = "";
- fChangeOutLineCntl("reset"); //전체 선의 색상을 다시 셋팅...
- }
-
- //마우스 우측버튼(메뉴팝업 호출) 시, 수행안하는 action
- if( event.button == 3 ) return;
-
- //M-GPS가 opener 일 경우, 서식 코드를 조회한다.
- if(opener.window.javascript.OpenerKind == "GPS"){
- //결정하기 메뉴 선택 후, 대상 스텝을 선택할 경우, 선택 스텝에 대한 정보를 저장하고, 선의 색상을 바꾼다.
- if(decisionMode == "true"){
- var id = currentStepCntl.attribute("id");
- fDecision();
- fCreateControl();
- selectedControl = null;
- currentStepCntl = document.controls(id);
- fChangeSelectCntl("#A683B1", currentStepCntl);
- }
- }
- } else {
- //컨트롤 간의 연결 시,
- fConnectToLine( prevStepCntl, currentStepCntl );
- prevStepCntl = null ;
- }
-
- //버튼들의 enable/disable
- //btn_initialize.disabled = false;
- btn_action.disabled = true;
- btn_decision.disabled = true;
- btn_branch.disabled = true;
- btn_addline.disabled = true;
- btn_start.disabled = false;
- btn_end.disabled = false;
- btn_connection.disabled = false;
- btn_remove.disabled = false;
- }
-
- else if(ctrl.substr(0, 14) == "xforms:caption"){
- //CPG의 속성 아이콘 선택 시
- var sCurID = selControl.attribute("id");
- if( sCurID.substr(sCurID.length-3, 2) == "_@" ){
- if( selControl.attribute("color") == "#000000" ){
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- var sAttrFlag = sCurID.substr(sCurID.length-1, 1);
-
- switch( sAttrFlag ){
- case "O" :
- opener.window.javascript.fOpenStepDetlInfo();
- break;
- case "M" :
- //opener.model.makeValue("/root/main/masterinfo/info/cpgattadmin", "A");
- //opener.model.makeValue("/root/main/masterinfo/info/stepattadmin", curNo);
- opener.javascript.setParameter("cpgattadmin", "A");
- opener.javascript.setParameter("stepattadmin", curNo);
- opener.window.javascript.fOpenAttAdm();
- break;
- case "T" :
- //opener.model.makeValue("/root/main/masterinfo/info/cpgattadmin", "C");
- //opener.model.makeValue("/root/main/masterinfo/info/stepattadmin", curNo);
- opener.javascript.setParameter("cpgattadmin", "C");
- opener.javascript.setParameter("stepattadmin", curNo);
- opener.window.javascript.fOpenAttAdm();
- break;
- case "D" :
- break;
- default :
- break;
- }
-
- }
- }
- }
- ]]>
- </script>
- <script type="javascript" ev:event="DOMFocusOut">
- <![CDATA[
- window.setPopupMenu(false);
- ]]>
- </script>
- <iviewer id="ivw_detail" visibility="hidden" style="left:0px; top:0px; width:835px; height:653px; "/>
- <input id="ipt_swimlineno" ref="/root/main/outlineinfo/info/swimlineno" visibility="hidden" style="left:793px; top:45px; width:20px; height:19px; "/>
- <group id="grp_dcsgrid" visibility="hidden" style="left:0px; top:445px; width:420px; height:205px; ">
- <shape id="roundrect1" class="roundrect_btnset" appearance="roundrect" ellipsewidth="20" ellipseheight="20" style="left:0px; top:0px; width:420px; height:205px; "/>
- <img id="img1" src="../../../com/commonweb/images/icon_n.gif" style="left:7px; top:10px; width:10px; height:13px; background-stretch:stretch; "/>
- <caption id="caption2" style="left:20px; top:5px; width:380px; height:23px; ">결정할 Step을 선택한 후 '확인'을 눌러주세요!</caption>
- <button id="button2" class="btn2_letter2" style="left:323px; top:180px; width:42px; height:19px; ">
- <caption>확인</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
-
- ]]>
- </script>
- </button>
- <button id="button3" class="btn2_letter2" style="left:368px; top:180px; width:42px; height:19px; ">
- <caption>취소</caption>
- <script type="javascript" ev:event="DOMActivate">
- <![CDATA[
- grp_dcsgrid.visible = false;
- ]]>
- </script>
- </button>
- <datagrid id="grd_decision" nodeset="/root/main/seldecision/info" autoresize="true" caption="stepmemo^stepno^lnkstepno" colsep="^" colwidth="383, 100, 100" mergecellsfixedrows="bycolrec" rowsep="|" style="left:10px; top:30px; width:400px; height:145px; ">
- <col ref="stepnm"/>
- <col ref="stepno" visibility="hidden"/>
- <col ref="lnkstepno" visibility="hidden"/>
- </datagrid>
- <datagrid id="grd_decision_answlist" nodeset="/root/main/seldecisionlist/info" autoresize="true" caption="stepno^lnkstep" colsep="^" colwidth="50, 50" mergecellsfixedrows="bycolrec" rowsep="|" style="left:305px; top:100px; width:105px; height:75px; ">
- <col ref="stepno" visibility="hidden"/>
- <col ref="lnkstepno" visibility="hidden"/>
- </datagrid>
- <input id="ipt_dcs_stepno" visibility="hidden" style="left:380px; top:80px; width:30px; height:19px; "/>
- </group>
- <group id="group1" visibility="hidden" style="left:720px; top:45px; width:70px; height:20px; ">
- <caption id="cap_monitoringyn" style="left:16px; top:0px; width:15px; height:20px; text-align:center; background-color:#ffcc99; ">M</caption>
- <caption id="cap_orderyn" style="left:0px; top:0px; width:15px; height:20px; text-align:center; background-color:#ffcc99; ">O</caption>
- <caption id="cap_limtmyn" style="left:32px; top:0px; width:15px; height:20px; color:#000000; text-align:center; background-color:#ffcc99; ">T</caption>
- <caption id="cap_monitoringorderyn" style="left:48px; top:0px; width:22px; height:20px; color:#c0c0c0; text-align:center; background-color:#ffcc99; ">MO</caption>
- </group>
- <group id="grp_msgbox" visibility="hidden" overflow="scroll" style="left:685px; top:65px; width:125px; height:55px; ">
- <caption id="cap_msgbox" autoresize="true" style="left:5px; top:5px; width:117px; height:45px; color:#ff0000; text-align:center; ">
- <![CDATA[결정할 Action 스텝을
- 선택하십시오.]]>
- </caption>
- </group>
- </group>
- <group id="grp_button" visibility="hidden" style="left:557px; top:4px; width:256px; height:43px; background-color:transparent; ">
- <button id="btn_branch" class="btn2_letter2" visibility="hidden" style="left:205px; top:20px; width:42px; height:19px; ">
- <caption>D</caption>
- </button>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- var ctrl = null;
- ctrl = (event.target);
- var selControl = document.controls(ctrl);
- var controlText = selControl.attribute("text");
- var controlID = selControl.attribute("id");
-
- if(event.button == 1){
- if(ctrl.substr(0, 4) == "btn_"){
- switch( controlID ){
- case "btn_remove" :
- fDelCntl();
- break;
-
- case "btn_start" :
- if ( currentStepCntl == null ){
- messageBox("스텝을", "C002");
- return;
- }
- fSetStartStep();
- break;
-
- case "btn_end" :
- if ( currentStepCntl == null ){
- messageBox("스텝을", "C002");
- return;
- }
- fSetEndStep();
- break;
-
- case "btn_connection" :
- if(controlText == "입력"){
- selControl.attribute("text") = "연결";
- connectionMode = "true";
- btn_disconnection.disabled = true;
- }else{
- selControl.attribute("text") = "입력";
- connectionMode = "false";
- currentStepCntl == null;
- btn_disconnection.disabled = false;
- }
- model.refresh();
- break;
-
- case "btn_disconnection" :
- if ( currentStepCntl == null ){
- messageBox("스텝을", "C002");
- return;
- }
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- fDelLink();
- break;
-
- case "btn_detailinfo" :
- if(currentStepCntl != null)
- fViewDetailInfo();
- break;
-
- case "btn_addline" :
- fAddSwimLine();
- break;
-
- case "btn_initialize" :
- //fOutlineCntlInit();
- opener.model.setValue("/root/main/masterinfo/info/swimlineno", "");
- lineNo = "";
- opener.ipt_swimlineno.refresh();
- opener.window.javascript.fCreateOutLineView();
- /*
- opener.model.setValue("/root/main/masterinfo/info/swimlineno", "");
- lineNo = "";
- opener.ipt_swimlineno.disabled = false;
- opener.ipt_swimlineno.refresh();
- //fInitialize();
- linesControlMaxCnt = new Array(0);
- */
- break;
-
- default :
- if ( isNull(selectedLineSection) ){
- messageBox("스윔라인을", "C002");
- return;
- }
-
- if(selectedLineSection > lineNo){
- messageBox("스윔라인을", "C002");
- return;
- }
-
- if(controlText == "A"){
- var rtnNum = fMakeNode("A", selectedLineSection);
-
- } else if(controlText == "D"){
- var rtnNum = fMakeNode("D", selectedLineSection);
-
- } else if(controlText == "B"){
- var rtnNum = fMakeNode("B", selectedLineSection);
-
- }
- fCreateControl(); //컨트롤 재배치를 위해 컨트롤을 모두 삭제한 후, 다시 생성한다.
- currentStepCntl = document.controls( "xforms:group" + (rtnNum-1) ); //모든 컨트롤이 다시생되면, 방금 전 생성한 컨트롤에 포커스를 맞춘다.
-
- break;
- }
- }
- }
- ]]>
- </script>
- <button id="btn_action" class="btn_number" style="left:62px; top:1px; width:39px; height:19px; ">
- <caption>A</caption>
- </button>
- <button id="btn_decision" class="btn_number" style="left:104px; top:1px; width:39px; height:19px; ">
- <caption>D</caption>
- </button>
- <button id="btn_start" class="btn_number" style="left:146px; top:1px; width:42px; height:19px; ">
- <caption>S</caption>
- </button>
- <button id="btn_end" class="btn_number" style="left:188px; top:1px; width:39px; height:19px; ">
- <caption>E</caption>
- </button>
- <button id="btn_connection" class="btn_number" style="left:62px; top:22px; width:39px; height:19px; ">
- <caption>입력</caption>
- <hint>
- <![CDATA[ 현재 설정된 모드를 알려줍니다. ]]>
- </hint>
- </button>
- <button id="btn_initialize" class="btn2_letter3" visibility="hidden" style="left:186px; top:22px; width:53px; height:19px; ">
- <caption>초기화</caption>
- </button>
- <button id="btn_addline" class="btn2_letter4" style="left:146px; top:22px; width:64px; height:19px; ">
- <caption>라인추가</caption>
- </button>
- <button id="btn_remove" class="btn_number" style="left:212px; top:22px; width:42px; height:19px; ">
- <caption>삭제</caption>
- </button>
- <button id="btn_disconnection" class="btn_number" style="left:104px; top:22px; width:39px; height:19px; ">
- <caption>해제</caption>
- </button>
- <caption id="caption1" visibility="hidden" style="left:243px; top:4px; width:10px; height:20px; ">
- <![CDATA[a]]>
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- //alert(swimlineControlArray);
- //alert ( "parent : " + selectedControl.parent.attribute("id") + ", " + selectedControl.attribute("id") );
- if( currentStepCntl != null ){
- var curID = currentStepCntl.attribute("id");
- var curNo = parseInt( curID.substr(12, curID.length-12) ) + 1;
- }else{
- var curNo = "";
- }
-
- alert("curNo = " + curNo + " , grpControlCnt = " + grpControlCnt + ", swimlineControlArray = " + swimlineControlArray);
- ]]>
- </script>
- </caption>
- </group>
- <!--
- <script type="javascript" ev:event="onclick">
- <![CDATA[
- model.alert(event.target);
- ]]>
- </script>
- -->
- </xhtml:body>
- </xhtml:html>
|