1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
2 | <mx:HDividedBox
|
---|
3 | xmlns:mx="http://www.adobe.com/2006/mxml"
|
---|
4 | xmlns:log="gov.va.med.edp.view.log.*"
|
---|
5 | xmlns:reports="gov.va.med.edp.view.reports.*"
|
---|
6 | xmlns:board="gov.va.med.edp.view.board.*"
|
---|
7 | xmlns:config="gov.va.med.edp.view.config.*"
|
---|
8 | xmlns:debug="gov.va.med.edp.view.debug.*"
|
---|
9 | xmlns:widget="gov.va.med.edp.widget.*"
|
---|
10 | xmlns:pt-model="gov.va.med.edp.pt.demog.model.*"
|
---|
11 | xmlns:pt-ctrl="gov.va.med.edp.pt.demog.control.*"
|
---|
12 | xmlns:pt-dao="gov.va.med.edp.pt.demog.dao.*"
|
---|
13 | width="100%" height="100%"
|
---|
14 | paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0"
|
---|
15 | creationComplete="activateAutoScroll();">
|
---|
16 |
|
---|
17 | <mx:Script>
|
---|
18 | <![CDATA[
|
---|
19 | import gov.va.med.edp.widget.OkCancelDialog;
|
---|
20 | import gov.va.med.edp.view.debug.LastNetworkCallView;
|
---|
21 | import mx.events.CloseEvent;
|
---|
22 | import mx.events.ItemClickEvent;
|
---|
23 | import mx.core.Container;
|
---|
24 | import gov.va.med.edp.model.TrackingModelLocator;
|
---|
25 | import gov.va.med.edp.control.SwitchAppViewEvent;
|
---|
26 | import gov.va.med.edp.vo.LookupVO;
|
---|
27 | import gov.va.med.edp.util.AccessibilityTools;
|
---|
28 | import gov.va.med.edp.util.AutoScrollView;
|
---|
29 |
|
---|
30 | [Embed(source="EDIS_Small.png")]
|
---|
31 | [Bindable]
|
---|
32 | private var EDIS_LOGO:Class;
|
---|
33 |
|
---|
34 | [Bindable]
|
---|
35 | public var model:TrackingModelLocator = TrackingModelLocator.getInstance();
|
---|
36 |
|
---|
37 | private var nextView: int;
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * Function: activateAutoScroll()
|
---|
41 | * Parameters:
|
---|
42 | * NA
|
---|
43 | * Description:
|
---|
44 | * Activate auto scroll screen when component is not visible
|
---|
45 | * Created by: jtorreno
|
---|
46 | * Date: 2008.05.08
|
---|
47 | **/
|
---|
48 | private function activateAutoScroll(): void
|
---|
49 | {
|
---|
50 | AutoScrollView.setupFocusViewportWatcher(this, focusManager);
|
---|
51 | }
|
---|
52 |
|
---|
53 | private function displayLastBrokerCallView(): void
|
---|
54 | {
|
---|
55 | trackingViews.addChildAt(new LastNetworkCallView(), trackingViews.getChildren().length);
|
---|
56 | trackingViews.selectedChild = lastNetworkCallView;
|
---|
57 | }
|
---|
58 |
|
---|
59 | private function findView(appView: int): Container
|
---|
60 | {
|
---|
61 | appList.callLater(hiliteView);
|
---|
62 |
|
---|
63 | switch (appView) {
|
---|
64 | case TrackingModelLocator.VIEW_APP_NO_VIEWS:
|
---|
65 | return noneView;
|
---|
66 | case TrackingModelLocator.VIEW_APP_SIGN_IN:
|
---|
67 | case TrackingModelLocator.VIEW_APP_TRIAGE:
|
---|
68 | case TrackingModelLocator.VIEW_APP_UPDATE:
|
---|
69 | case TrackingModelLocator.VIEW_APP_DISPOSITION:
|
---|
70 | case TrackingModelLocator.VIEW_APP_EDIT_CLOSED:
|
---|
71 | return logEntryView;
|
---|
72 | case TrackingModelLocator.VIEW_APP_DISPLAY_BOARD:
|
---|
73 | return boardView;
|
---|
74 | case TrackingModelLocator.VIEW_APP_ASSIGN_STAFF:
|
---|
75 | return staffView;
|
---|
76 | case TrackingModelLocator.VIEW_APP_REPORTS:
|
---|
77 | return reportsView;
|
---|
78 | case TrackingModelLocator.VIEW_APP_CONFIGURE:
|
---|
79 | return configView;
|
---|
80 | default:
|
---|
81 | return noneView;
|
---|
82 | }
|
---|
83 | }
|
---|
84 |
|
---|
85 | private function hiliteView(): void
|
---|
86 | {
|
---|
87 |
|
---|
88 | if (trackingViews.selectedChild == lastNetworkCallView) {
|
---|
89 | debugLink.styleName = "linkSelected";
|
---|
90 | appList.enabled = false;
|
---|
91 | } else {
|
---|
92 | debugLink.styleName = "linkUnSelected";
|
---|
93 | appList.enabled = true;
|
---|
94 | }
|
---|
95 |
|
---|
96 | }
|
---|
97 |
|
---|
98 | private function attemptSwitchView(event: ItemClickEvent): void
|
---|
99 | {
|
---|
100 | // there's got to be a better way
|
---|
101 | nextView = (event.item as LookupVO).data;
|
---|
102 |
|
---|
103 | var curView: int = model.appViewState;
|
---|
104 | var curViewIsLog: Boolean = (
|
---|
105 | (curView == TrackingModelLocator.VIEW_APP_SIGN_IN) ||
|
---|
106 | (curView == TrackingModelLocator.VIEW_APP_TRIAGE) ||
|
---|
107 | (curView == TrackingModelLocator.VIEW_APP_UPDATE) ||
|
---|
108 | (curView == TrackingModelLocator.VIEW_APP_DISPOSITION) );
|
---|
109 | var nextViewIsLog: Boolean = (
|
---|
110 | (nextView == TrackingModelLocator.VIEW_APP_SIGN_IN) ||
|
---|
111 | (nextView == TrackingModelLocator.VIEW_APP_TRIAGE) ||
|
---|
112 | (nextView == TrackingModelLocator.VIEW_APP_UPDATE) ||
|
---|
113 | (nextView == TrackingModelLocator.VIEW_APP_DISPOSITION) );
|
---|
114 |
|
---|
115 | if (model.logEdit.dirty && ((nextViewIsLog == false) ||
|
---|
116 | (curView == TrackingModelLocator.VIEW_APP_EDIT_CLOSED))) {
|
---|
117 | OkCancelDialog.show("Are you sure you want to change views?\n\n" +
|
---|
118 | "You have unsaved changes.\nIf you continue, you will lose the changes.\n\n" +
|
---|
119 | "Press OK to continue and lose the changes.\n" +
|
---|
120 | "Press Cancel to stay and save the changes.", "Discard Changes?", attemptSwitchHandler, appList);
|
---|
121 | } else {
|
---|
122 | if ((curViewIsLog == false) && (nextViewIsLog)) {
|
---|
123 | // refresh the current entry
|
---|
124 | logEntryView.logEntrySelector.switchLogEntry();
|
---|
125 | }
|
---|
126 | switchView(nextView);
|
---|
127 | }
|
---|
128 | }
|
---|
129 |
|
---|
130 | private function attemptSwitchHandler(event: CloseEvent): void
|
---|
131 | {
|
---|
132 | if (event.detail == OkCancelDialog.OK) {
|
---|
133 | logEntryView.logEntryEditor.cancelEdit();
|
---|
134 | switchView(nextView);
|
---|
135 | } else {
|
---|
136 | nextView = model.appViewState;
|
---|
137 | switchView(model.appViewState);
|
---|
138 | }
|
---|
139 | }
|
---|
140 |
|
---|
141 | private function switchView(newView: int): void
|
---|
142 | {
|
---|
143 | var e: SwitchAppViewEvent = new SwitchAppViewEvent(SwitchAppViewEvent.EVENT_SWITCH_APP_VIEW);
|
---|
144 | e.view = newView;
|
---|
145 | e.dispatch();
|
---|
146 | appList.selectedIndex = getSelectedTab(newView);
|
---|
147 | }
|
---|
148 |
|
---|
149 | private function showHelp(): void
|
---|
150 | {
|
---|
151 | var helpUrl:String = model.helpContextRootURL + model.appViewHelp(model.appViewState) + ".html";
|
---|
152 | var request: URLRequest = new URLRequest(helpUrl);
|
---|
153 | navigateToURL(request, "_blank");
|
---|
154 | }
|
---|
155 |
|
---|
156 | private function getSelectedTab(appView: int): int
|
---|
157 | {
|
---|
158 | for (var i: int = 0; i < model.appViewList.length; i++) {
|
---|
159 | if (appView == model.appViewList[i].data) return i;
|
---|
160 | }
|
---|
161 | return 0;
|
---|
162 | }
|
---|
163 | ]]>
|
---|
164 | </mx:Script>
|
---|
165 |
|
---|
166 | <mx:VBox
|
---|
167 | width="90" height="100%"
|
---|
168 | horizontalScrollPolicy="off" verticalScrollPolicy="off" tabChildren="true" paddingLeft="6" paddingBottom="6">
|
---|
169 | <mx:HBox width="100%" horizontalAlign="left" verticalAlign="bottom">
|
---|
170 | <!-- <mx:Image source="{EDIS_LOGO}"/>-->
|
---|
171 | <mx:Label text="v{model.appClientVersion}" styleName="lightLabel" />
|
---|
172 | </mx:HBox>
|
---|
173 | <mx:Spacer height="2"/>
|
---|
174 | <widget:LinkButtonTabBar
|
---|
175 | id="appList"
|
---|
176 | direction="vertical"
|
---|
177 | dataProvider="{model.appViewList}"
|
---|
178 | itemClick="attemptSwitchView(event)"
|
---|
179 | tabStyleName="linkUnSelected" selectedTabTextStyleName="linkSelected" tabIndex="1" width="100%"/>
|
---|
180 | <mx:Spacer height="100%"/>
|
---|
181 | <widget:LinkButton id="debugLink"
|
---|
182 | label="Debug"
|
---|
183 | click="displayLastBrokerCallView()"
|
---|
184 | visible="{model.session.debugEnabled}"
|
---|
185 | focusEnabled="true"
|
---|
186 | height="20"
|
---|
187 | textAlign="left"
|
---|
188 | tabIndex="100001" width="100%" paddingLeft="2" paddingRight="2"/>
|
---|
189 | <widget:LinkButton
|
---|
190 | label="Logout"
|
---|
191 | textAlign="left"
|
---|
192 | height="20"
|
---|
193 | id="logoutBtn"
|
---|
194 | focusEnabled="true"
|
---|
195 | click="model.logout()"
|
---|
196 | tabIndex="100002" width="100%" paddingLeft="2" paddingRight="2"/>
|
---|
197 | </mx:VBox>
|
---|
198 |
|
---|
199 | <mx:VBox
|
---|
200 | width="100%" height="100%" tabChildren="true">
|
---|
201 | <mx:Canvas
|
---|
202 | id="titleArea"
|
---|
203 | width="100%" tabChildren="true">
|
---|
204 | <mx:Label
|
---|
205 | id="lblTitle"
|
---|
206 | text="{model.appViewTitle(model.appViewState)}"
|
---|
207 | toolTip="{model.appViewTitle(model.appViewState)}"
|
---|
208 | horizontalCenter="0"
|
---|
209 | paddingTop="0" paddingBottom="0"
|
---|
210 | styleName="viewTitle"/>
|
---|
211 | <!-- because of the accessibility bug with LinkButtons, Make them look like link buttons for common look and feel-->
|
---|
212 | <widget:LinkButton
|
---|
213 | icon="@Embed(source='help.png')"
|
---|
214 | id="help"
|
---|
215 | focusEnabled="true"
|
---|
216 | initialize="{AccessibilityTools.accessComponentName(help,'Help')}"
|
---|
217 | right="6" top="2"
|
---|
218 | click="showHelp();" tabIndex="100000"/>
|
---|
219 | </mx:Canvas>
|
---|
220 |
|
---|
221 | <mx:ViewStack
|
---|
222 | id="trackingViews"
|
---|
223 | width="100%" height="100%"
|
---|
224 | selectedChild="{findView(model.appViewState)}">
|
---|
225 |
|
---|
226 | <mx:Canvas id="noneView">
|
---|
227 | <mx:Label horizontalCenter="0" verticalCenter="0" text="No Views Configured"/>
|
---|
228 | </mx:Canvas>
|
---|
229 |
|
---|
230 | <log:LogEntryView id="logEntryView" ptChecksController="{ptChecksController}" patientChecksModel="{model.patientChecksModel}"/>
|
---|
231 | <board:DisplayBoard id="boardView"/>
|
---|
232 | <reports:ReportsContainerView id="reportsView"/>
|
---|
233 | <config:ConfigStaff id="staffView"/>
|
---|
234 | <config:ConfigView id="configView"/>
|
---|
235 | <debug:LastNetworkCallView id="lastNetworkCallView"/>
|
---|
236 | </mx:ViewStack>
|
---|
237 |
|
---|
238 | </mx:VBox>
|
---|
239 |
|
---|
240 | <pt-ctrl:PatientChecksController id="ptChecksController" model="{model.patientChecksModel}" dao="{ptChecksDao}"/>
|
---|
241 | <pt-dao:CairngormPatientChecksDao id="ptChecksDao" logArea="{model.logArea}"/>
|
---|
242 | </mx:HDividedBox>
|
---|