Commit b9e0d9ed63ee33977e96cdf3ba8115ce59a015c8
Merge branch 'Develop-IPAD-MAC' into QA-IPAD-MAC
Showing
3 changed files
with
183 additions
and
171 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -475,8 +475,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -475,8 +475,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
475 | 475 | ||
476 | //disable whole div because till now jspanel is not created. enable when jspanel gets disabled because | 476 | //disable whole div because till now jspanel is not created. enable when jspanel gets disabled because |
477 | //than jspanel will take care of disabling/enabling ui | 477 | //than jspanel will take care of disabling/enabling ui |
478 | - document.getElementById('daBodyview').style.pointerEvents = "none"; | ||
479 | - document.getElementById('daBodyview').style.opacity = "0.5"; | 478 | + |
479 | + if (document.getElementById('daBodyview') != null) { | ||
480 | + document.getElementById('daBodyview').style.pointerEvents = "none"; | ||
481 | + document.getElementById('daBodyview').style.opacity = "0.5"; | ||
482 | + } | ||
480 | 483 | ||
481 | //Check if browser 'REFRESHED' or 'RELOADED' | 484 | //Check if browser 'REFRESHED' or 'RELOADED' |
482 | if ($rootScope.CommonData != null) { | 485 | if ($rootScope.CommonData != null) { |
@@ -507,7 +510,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -507,7 +510,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
507 | 510 | ||
508 | $rootScope.loadSearchData(); | 511 | $rootScope.loadSearchData(); |
509 | 512 | ||
510 | - console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); | 513 | + console.log('currentBodyViewId picked from localStorage: ' + currentBodyViewId); |
511 | 514 | ||
512 | var openViews; | 515 | var openViews; |
513 | if ($rootScope.openViews != null || $rootScope.openViews != undefined) { | 516 | if ($rootScope.openViews != null || $rootScope.openViews != undefined) { |
@@ -584,15 +587,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -584,15 +587,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
584 | console.log('html is compiled ' + document.getElementById('daView')) | 587 | console.log('html is compiled ' + document.getElementById('daView')) |
585 | 588 | ||
586 | if (document.getElementById('daView') != null) { | 589 | if (document.getElementById('daView') != null) { |
587 | - | ||
588 | - $scope.loadDAView(currentBodyViewId); | 590 | + $scope.loadDAView(currentBodyViewId); |
589 | } | 591 | } |
590 | else | 592 | else |
591 | { | 593 | { |
592 | - $compile(daBodyviewElement.contents())($scope); | 594 | + // this is a work around solution for a bug where DA does not load for long and user need to close the DA partially opened |
595 | + // view, now we are programmatically closing the hung view and when user will reopen the DA view from tile then it will | ||
596 | + // open without any issue. | ||
597 | + $("#daImagePanel .jsglyph-remove").click(); | ||
598 | + | ||
593 | console.log('html is compiled in else ' + document.getElementById('daView')) | 599 | console.log('html is compiled in else ' + document.getElementById('daView')) |
594 | - | ||
595 | - $scope.loadDAView(currentBodyViewId); | ||
596 | 600 | ||
597 | } | 601 | } |
598 | 602 | ||
@@ -724,7 +728,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -724,7 +728,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
724 | }); | 728 | }); |
725 | } | 729 | } |
726 | 730 | ||
727 | - $(document).on("click", "#daImagePanel .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () { | 731 | + $(document).on("click", "#daImagePanel .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () { |
732 | + | ||
728 | $rootScope.selectedBodySystemName = 'All'; | 733 | $rootScope.selectedBodySystemName = 'All'; |
729 | $rootScope.selectedBodySystemId = 0; | 734 | $rootScope.selectedBodySystemId = 0; |
730 | $rootScope.searchSelectedText = ''; | 735 | $rootScope.searchSelectedText = ''; |
@@ -1887,14 +1892,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -1887,14 +1892,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
1887 | } | 1892 | } |
1888 | ); | 1893 | ); |
1889 | } | 1894 | } |
1890 | - //else if ($scope.ColoredImageSRC.length == totalCanvas) | ||
1891 | - //{ | ||
1892 | - // // dispatch event for enabling rest UI | ||
1893 | - // alert('all canvas drawn'); | ||
1894 | - // $scope.EnableUI(); | ||
1895 | - //} | ||
1896 | - | ||
1897 | - //-NIKI-for solving extarct issue 8286 | 1895 | + |
1898 | 1896 | ||
1899 | var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR'); | 1897 | var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR'); |
1900 | 1898 | ||
@@ -1910,11 +1908,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -1910,11 +1908,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
1910 | } | 1908 | } |
1911 | 1909 | ||
1912 | 1910 | ||
1913 | - | ||
1914 | - // | ||
1915 | - | ||
1916 | - // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) | ||
1917 | - | 1911 | + |
1918 | if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | 1912 | if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { |
1919 | 1913 | ||
1920 | if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { | 1914 | if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { |
@@ -1958,18 +1952,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -1958,18 +1952,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
1958 | $scope.highLightBody(); | 1952 | $scope.highLightBody(); |
1959 | } | 1953 | } |
1960 | else { | 1954 | else { |
1955 | + | ||
1956 | + //This block is executed when normal body is created and no further process like highlight,extract, etc | ||
1961 | $rootScope.isLoading = false; | 1957 | $rootScope.isLoading = false; |
1962 | $('#spinner').css('visibility', 'hidden'); | 1958 | $('#spinner').css('visibility', 'hidden'); |
1963 | - //debugger; | 1959 | + |
1964 | $scope.EnableUI(); | 1960 | $scope.EnableUI(); |
1961 | + | ||
1965 | } | 1962 | } |
1966 | } | 1963 | } |
1967 | - else { | ||
1968 | - $rootScope.isLoading = false; | ||
1969 | - $('#spinner').css('visibility', 'hidden'); | ||
1970 | - //debugger; | ||
1971 | - $scope.EnableUI(); | ||
1972 | - } | 1964 | + |
1973 | } | 1965 | } |
1974 | 1966 | ||
1975 | console.log('DrawMirroredImage- ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); | 1967 | console.log('DrawMirroredImage- ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); |
@@ -2326,8 +2318,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -2326,8 +2318,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
2326 | ); | 2318 | ); |
2327 | } | 2319 | } |
2328 | 2320 | ||
2329 | - //-NIKI-for solving extarct issue 8286 | ||
2330 | - | 2321 | + |
2331 | var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId); | 2322 | var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId); |
2332 | 2323 | ||
2333 | if (imageCanvas != null || imageCanvas != undefined) { | 2324 | if (imageCanvas != null || imageCanvas != undefined) { |
@@ -2341,9 +2332,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -2341,9 +2332,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
2341 | 2332 | ||
2342 | $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar; | 2333 | $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar; |
2343 | } | 2334 | } |
2344 | - // | ||
2345 | - | ||
2346 | - | 2335 | + |
2347 | if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | 2336 | if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { |
2348 | 2337 | ||
2349 | if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { | 2338 | if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { |
@@ -2394,18 +2383,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -2394,18 +2383,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
2394 | 2383 | ||
2395 | } | 2384 | } |
2396 | else { | 2385 | else { |
2386 | + //This block is executed when normal body is created and no further process like highlight,extract, etc | ||
2397 | $rootScope.isLoading = false; | 2387 | $rootScope.isLoading = false; |
2398 | $('#spinner').css('visibility', 'hidden'); | 2388 | $('#spinner').css('visibility', 'hidden'); |
2399 | - //debugger; | ||
2400 | $scope.EnableUI(); | 2389 | $scope.EnableUI(); |
2401 | } | 2390 | } |
2402 | } | 2391 | } |
2403 | - else { | ||
2404 | - $rootScope.isLoading = false; | ||
2405 | - $('#spinner').css('visibility', 'hidden'); | ||
2406 | - //debugger; | ||
2407 | - $scope.EnableUI(); | ||
2408 | - } | 2392 | + |
2409 | } | 2393 | } |
2410 | 2394 | ||
2411 | console.log('DrawImage- ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); | 2395 | console.log('DrawImage- ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); |
@@ -3058,9 +3042,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | @@ -3058,9 +3042,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l | ||
3058 | grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0); | 3042 | grayCanvasContext.putImageData($rootScope.grayImageDataList[parseInt(i)], 0, 0); |
3059 | } | 3043 | } |
3060 | } | 3044 | } |
3061 | - $scope.message = AIAConstants.NO_BODY_SYSTEM_AVAILABLE; | ||
3062 | - $("#daMessageModal").modal('show'); | ||
3063 | - | 3045 | + |
3064 | 3046 | ||
3065 | $scope.message = AIAConstants.NO_BODY_SYSTEM_AVAILABLE; | 3047 | $scope.message = AIAConstants.NO_BODY_SYSTEM_AVAILABLE; |
3066 | $("#daMessageModal").modal('show'); | 3048 | $("#daMessageModal").modal('show'); |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
1 | ๏ปฟ'use strict'; | 1 | ๏ปฟ'use strict'; |
2 | 2 | ||
3 | -AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants", "UserModules", "LoginMessageConstants", "AdminService", "$http", "AdminConstants", "UserTypeConstants", | ||
4 | -function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, $http, AdminConstants, UserTypeConstants) { | 3 | +AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants", "UserModules", "LoginMessageConstants", "AdminService", "$http", "AdminConstants", "UserTypeConstants", "AIAConstants", |
4 | +function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, $http, AdminConstants, UserTypeConstants,AIAConstants) { | ||
5 | 5 | ||
6 | //$scope.pageToOpen = { | 6 | //$scope.pageToOpen = { |
7 | // name: 'MainMenu' | 7 | // name: 'MainMenu' |
@@ -111,117 +111,138 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -111,117 +111,138 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
111 | $("body.modal-open").css("padding-right", "0px"); | 111 | $("body.modal-open").css("padding-right", "0px"); |
112 | 112 | ||
113 | } | 113 | } |
114 | - $rootScope.initializeAIA = function () { | ||
115 | 114 | ||
116 | - $rootScope.isLoading = false; | ||
117 | - | ||
118 | - var url = $location.url(); | 115 | + $rootScope.promptUserForCookies= function() |
116 | + { | ||
117 | + $rootScope.errorMessage = AIAConstants.COOKIES_MESSAGE; | ||
118 | + $("#messageModal").modal('show'); | ||
119 | + | ||
120 | + } | ||
121 | + | ||
122 | + | ||
123 | + $rootScope.initializeAIA = function () { | ||
124 | + | ||
125 | + if (navigator.cookieEnabled) { | ||
119 | 126 | ||
120 | - if (url.indexOf('?unb:') != -1) { | 127 | + $rootScope.isLoading = false; |
121 | 128 | ||
122 | - $rootScope.isVisibleLogin = true; | ||
123 | - $rootScope.UnblockUser(); | ||
124 | - } | ||
125 | - else if (url.indexOf('?em:') != -1) { | 129 | + var url = $location.url(); |
130 | + | ||
131 | + //unblock user | ||
132 | + if (url.indexOf('?unb:') != -1) { | ||
126 | 133 | ||
127 | - $rootScope.isVisibleLogin = false; | ||
128 | - $rootScope.isVisibleResetPass = true; | 134 | + $rootScope.isVisibleLogin = true; |
135 | + $rootScope.UnblockUser(); | ||
136 | + } | ||
137 | + else if (url.indexOf('?em:') != -1) { | ||
138 | + | ||
139 | + $rootScope.isVisibleLogin = false; | ||
140 | + $rootScope.isVisibleResetPass = true; | ||
141 | + } | ||
142 | + else { | ||
143 | + $rootScope.isVisibleLogin = true; | ||
144 | + $rootScope.isVisibleResetPass = false; | ||
145 | + getUserDetails(); | ||
146 | + } | ||
129 | } | 147 | } |
148 | + | ||
130 | else { | 149 | else { |
150 | + | ||
131 | $rootScope.isVisibleLogin = true; | 151 | $rootScope.isVisibleLogin = true; |
132 | - $rootScope.isVisibleResetPass = false; | ||
133 | - getUserDetails(); | 152 | + |
153 | + $rootScope.promptUserForCookies(); | ||
134 | } | 154 | } |
135 | 155 | ||
136 | 156 | ||
137 | } | 157 | } |
138 | 158 | ||
139 | - $rootScope.AuthenticateUser = function (userInfo) { | ||
140 | - $rootScope.errorMessage = ""; | ||
141 | - if (userInfo.username == "" || userInfo.username == null || userInfo.password == "" || userInfo.password == null) { | 159 | + $rootScope.AuthenticateUser = function (userInfo) |
160 | + { | ||
161 | + if (navigator.cookieEnabled) { | ||
142 | 162 | ||
143 | - // alert(LoginMessageConstants.USER_CREDENTIALS_MISSING); | ||
144 | - $rootScope.errorMessage = LoginMessageConstants.USER_CREDENTIALS_MISSING; | ||
145 | - $("#messageModal").modal('show'); | ||
146 | - } | ||
147 | - else { | 163 | + $rootScope.errorMessage = ""; |
164 | + if (userInfo.username == "" || userInfo.username == null || userInfo.password == "" || userInfo.password == null) { | ||
148 | 165 | ||
149 | - AuthenticationService.authenticateUser(userInfo) | ||
150 | - .then( | 166 | + // alert(LoginMessageConstants.USER_CREDENTIALS_MISSING); |
167 | + $rootScope.errorMessage = LoginMessageConstants.USER_CREDENTIALS_MISSING; | ||
168 | + $("#messageModal").modal('show'); | ||
169 | + } | ||
170 | + else { | ||
151 | 171 | ||
152 | - function (result) { | ||
153 | - if (result == LoginConstants.USER_NOT_FOUND) { | ||
154 | - $rootScope.isVisibleLogin = true; | ||
155 | - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); | ||
156 | - $rootScope.errorMessage = LoginMessageConstants.INVALID_USER; | ||
157 | - $("#messageModal").modal('show'); | ||
158 | - } | ||
159 | - else { | ||
160 | - if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) { | 172 | + AuthenticationService.authenticateUser(userInfo) |
173 | + .then( | ||
161 | 174 | ||
162 | - if ($("#messageModal").length > 0) { | ||
163 | - $("#messageModal").modal('hide'); | ||
164 | - } | ||
165 | - if (result.LoginFailureCauseId!=undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_PASSWORD_NOT_MATCH) { | ||
166 | - $rootScope.isVisibleLogin = true; | ||
167 | - $rootScope.errorMessage = LoginMessageConstants.INVALID_PASSWORD; | ||
168 | - $("#messageModal").modal('show'); | ||
169 | - } | ||
170 | - else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_ID_BLOCKED_24_HRS) | ||
171 | - { | ||
172 | - $rootScope.isVisibleLogin = true; | ||
173 | - $rootScope.errorMessage = LoginMessageConstants.USER_BLOCKED; | ||
174 | - $("#messageModal").modal('show'); | ||
175 | - } | ||
176 | - else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) | ||
177 | - { | ||
178 | - $rootScope.isVisibleLogin = true; | ||
179 | - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
180 | - $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
181 | - $("#messageModal").modal('show'); | ||
182 | - } | ||
183 | - else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { | ||
184 | - $rootScope.isVisibleLogin = true; | ||
185 | - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
186 | - $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
187 | - $("#messageModal").modal('show'); | ||
188 | - } | ||
189 | - else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { | ||
190 | - $rootScope.isVisibleLogin = true; | ||
191 | - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
192 | - $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
193 | - $("#messageModal").modal('show'); | ||
194 | - } | ||
195 | - else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) { | ||
196 | - $rootScope.isVisibleLogin = true; | ||
197 | - $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
198 | - $("#messageModal").modal('show'); | ||
199 | - } | ||
200 | - else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) { | ||
201 | - $rootScope.isVisibleLogin = true; | ||
202 | - $rootScope.errorMessage = LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
203 | - $("#messageModal").modal('show'); | ||
204 | - } | ||
205 | - else if ( (result.LicenseInfo!= null) && (result.LicenseInfo!= undefined) && (!result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) { | ||
206 | - $rootScope.isVisibleLogin = true; | ||
207 | - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
208 | - $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE; | ||
209 | - $("#messageModal").modal('show'); | ||
210 | - } | ||
211 | - else if ((result.LicenseInfo!= null) && (result.LicenseInfo!= undefined) && (result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) { | ||
212 | - $rootScope.isVisibleLogin = true; | ||
213 | - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
214 | - $("#messageModal").modal('show'); | ||
215 | - } | ||
216 | - else if ((result.LicenseInfo!= null) && (result.LicenseInfo!= undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) { | ||
217 | - $rootScope.isVisibleLogin = true; | ||
218 | - $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE; | ||
219 | - $("#messageModal").modal('show'); | ||
220 | - } | ||
221 | - else { | ||
222 | - | ||
223 | - //if (result.UserType == UserTypeConstants.SUPER_ADMIN && result.IsActive) { //(!result.IsSubscriptionExpired) && | ||
224 | - if (result.LicenseId == 0 && result.IsActive) { | 175 | + function (result) { |
176 | + if (result == LoginConstants.USER_NOT_FOUND) { | ||
177 | + $rootScope.isVisibleLogin = true; | ||
178 | + // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); | ||
179 | + $rootScope.errorMessage = LoginMessageConstants.INVALID_USER; | ||
180 | + $("#messageModal").modal('show'); | ||
181 | + } | ||
182 | + else { | ||
183 | + if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) { | ||
184 | + | ||
185 | + if ($("#messageModal").length > 0) { | ||
186 | + $("#messageModal").modal('hide'); | ||
187 | + } | ||
188 | + if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_PASSWORD_NOT_MATCH) { | ||
189 | + $rootScope.isVisibleLogin = true; | ||
190 | + $rootScope.errorMessage = LoginMessageConstants.INVALID_PASSWORD; | ||
191 | + $("#messageModal").modal('show'); | ||
192 | + } | ||
193 | + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_ID_BLOCKED_24_HRS) { | ||
194 | + $rootScope.isVisibleLogin = true; | ||
195 | + $rootScope.errorMessage = LoginMessageConstants.USER_BLOCKED; | ||
196 | + $("#messageModal").modal('show'); | ||
197 | + } | ||
198 | + else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { | ||
199 | + $rootScope.isVisibleLogin = true; | ||
200 | + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
201 | + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
202 | + $("#messageModal").modal('show'); | ||
203 | + } | ||
204 | + else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { | ||
205 | + $rootScope.isVisibleLogin = true; | ||
206 | + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
207 | + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
208 | + $("#messageModal").modal('show'); | ||
209 | + } | ||
210 | + else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) { | ||
211 | + $rootScope.isVisibleLogin = true; | ||
212 | + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
213 | + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
214 | + $("#messageModal").modal('show'); | ||
215 | + } | ||
216 | + else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) { | ||
217 | + $rootScope.isVisibleLogin = true; | ||
218 | + $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
219 | + $("#messageModal").modal('show'); | ||
220 | + } | ||
221 | + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) { | ||
222 | + $rootScope.isVisibleLogin = true; | ||
223 | + $rootScope.errorMessage = LoginMessageConstants.USER_INACTIVE_MESSAGE; | ||
224 | + $("#messageModal").modal('show'); | ||
225 | + } | ||
226 | + else if ((result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) { | ||
227 | + $rootScope.isVisibleLogin = true; | ||
228 | + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
229 | + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE; | ||
230 | + $("#messageModal").modal('show'); | ||
231 | + } | ||
232 | + else if ((result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) { | ||
233 | + $rootScope.isVisibleLogin = true; | ||
234 | + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.'; | ||
235 | + $("#messageModal").modal('show'); | ||
236 | + } | ||
237 | + else if ((result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) { | ||
238 | + $rootScope.isVisibleLogin = true; | ||
239 | + $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE; | ||
240 | + $("#messageModal").modal('show'); | ||
241 | + } | ||
242 | + else { | ||
243 | + | ||
244 | + //if (result.UserType == UserTypeConstants.SUPER_ADMIN && result.IsActive) { //(!result.IsSubscriptionExpired) && | ||
245 | + if (result.LicenseId == 0 && result.IsActive) { | ||
225 | $rootScope.userData = result; | 246 | $rootScope.userData = result; |
226 | $rootScope.userModules = result.Modules; | 247 | $rootScope.userModules = result.Modules; |
227 | $rootScope.isVisibleLogin = false; | 248 | $rootScope.isVisibleLogin = false; |
@@ -233,42 +254,49 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | @@ -233,42 +254,49 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic | ||
233 | } | 254 | } |
234 | else { | 255 | else { |
235 | if (result.LicenseInfo != null && result.LicenseInfo.IsTermAccepted) { | 256 | if (result.LicenseInfo != null && result.LicenseInfo.IsTermAccepted) { |
236 | - $rootScope.userData = result; | ||
237 | - $rootScope.userModules = result.Modules; | ||
238 | - $rootScope.isVisibleLogin = false; | ||
239 | - $rootScope.haveRoleAdmin = false; | ||
240 | - localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | ||
241 | - ShowAssignedModulesPopup(result.Modules); | ||
242 | - $location.path('/'); | 257 | + $rootScope.userData = result; |
258 | + $rootScope.userModules = result.Modules; | ||
259 | + $rootScope.isVisibleLogin = false; | ||
260 | + $rootScope.haveRoleAdmin = false; | ||
261 | + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | ||
262 | + ShowAssignedModulesPopup(result.Modules); | ||
263 | + $location.path('/'); | ||
243 | 264 | ||
265 | + } | ||
266 | + else { | ||
267 | + if ($('#dvTerms').length > 0) { | ||
268 | + $('#dvTerms').html(result.TermsAndConditionsText); | ||
244 | } | 269 | } |
245 | - else { | ||
246 | - if ($('#dvTerms').length > 0) { | ||
247 | - $('#dvTerms').html(result.TermsAndConditionsText); | ||
248 | - } | ||
249 | - $rootScope.isVisibleLogin = true; | ||
250 | - $('#dvTermCondition').fadeIn(); | ||
251 | - $rootScope.userData = result; | ||
252 | - $rootScope.haveRoleAdmin = false; | ||
253 | - localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | ||
254 | - $location.path('/'); | ||
255 | - } | 270 | + $rootScope.isVisibleLogin = true; |
271 | + $('#dvTermCondition').fadeIn(); | ||
272 | + $rootScope.userData = result; | ||
273 | + $rootScope.haveRoleAdmin = false; | ||
274 | + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | ||
275 | + $location.path('/'); | ||
256 | } | 276 | } |
257 | - | ||
258 | } | 277 | } |
259 | - | 278 | + |
260 | } | 279 | } |
280 | + | ||
261 | } | 281 | } |
262 | - }), | ||
263 | - | ||
264 | - function (error) { | ||
265 | - console.log(' Error in authentication = ' + error.statusText); | ||
266 | - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | ||
267 | - $rootScope.isVisibleLogin = true; | ||
268 | - $rootScope.errorMessage = error; | ||
269 | - $("#messageModal").modal('show'); | ||
270 | - } | 282 | + } |
283 | + }), | ||
284 | + | ||
285 | + function (error) { | ||
286 | + console.log(' Error in authentication = ' + error.statusText); | ||
287 | + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | ||
288 | + $rootScope.isVisibleLogin = true; | ||
289 | + $rootScope.errorMessage = error; | ||
290 | + $("#messageModal").modal('show'); | ||
291 | + } | ||
292 | + } | ||
271 | } | 293 | } |
294 | + | ||
295 | + else | ||
296 | + { | ||
297 | + $rootScope.promptUserForCookies(); | ||
298 | + } | ||
299 | + | ||
272 | } | 300 | } |
273 | 301 | ||
274 | function ShowAssignedModulesPopup(userModules) { | 302 | function ShowAssignedModulesPopup(userModules) { |
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
@@ -492,11 +492,13 @@ AIA.constant("UserModules", [ | @@ -492,11 +492,13 @@ AIA.constant("UserModules", [ | ||
492 | } | 492 | } |
493 | ]); | 493 | ]); |
494 | 494 | ||
495 | -AIA.constant("AIAConstants", { | ||
496 | 495 | ||
496 | +AIA.constant("AIAConstants", { | ||
497 | "NO_BODY_SYSTEM_AVAILABLE": "Selected body system is not available on this layer.", | 497 | "NO_BODY_SYSTEM_AVAILABLE": "Selected body system is not available on this layer.", |
498 | + "COOKIES_MESSAGE": "You need to enable your browser's cookies to run this application.", | ||
498 | }) | 499 | }) |
499 | 500 | ||
501 | + | ||
500 | AIA.config(function ($routeProvider, pages, $locationProvider) { | 502 | AIA.config(function ($routeProvider, pages, $locationProvider) { |
501 | 503 | ||
502 | $locationProvider.html5Mode(true); | 504 | $locationProvider.html5Mode(true); |