diff --git a/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs b/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs index 68b4053..855759f 100644 --- a/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs +++ b/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs @@ -40,5 +40,6 @@ namespace AIAHTML5.API.Constants public const string GET_MODESTY_FOR_THIS_LICENSE = "usp_GetModestyForThisLicense"; public const string GET_COUNT_EXPORTED_IMAGE = "usp_GetCountExportedImage"; public const string INSERT_EXPORTED_IMAGE = "usp_InsertExportedImage"; + public const string GET_USER_DETAIL_BYLOGIN_AND_ACCOUNT = "usp_GetUserDetailsByLoginIdandAccount"; } } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs index 16db659..d734730 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs @@ -471,6 +471,35 @@ namespace AIAHTML5.API.Controllers return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); } } + + [HttpPost] + [Route("api/ByPassLoginToOpenModule")] + public HttpResponseMessage ByPassLoginToOpenModule([FromBody]JObject sitedetail) + { + dynamic responseData; + + try + { + string loginId = sitedetail.GetValue("userId").ToString(); + string accountNumber = sitedetail.GetValue("accountNumber").ToString(); + + responseData = AIAHTML5.API.Models.Users.ByPassLoginDetail(loginId, accountNumber); + + if (responseData !=null) + { + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(responseData) }; + } + else + { + return new HttpResponseMessage { StatusCode = HttpStatusCode.BadRequest, Content = new StringContent(AIAConstants.USER_NOT_FOUND) }; + } + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } // PUT api/authenticate/5 public void Put(int id, [FromBody]string value) { @@ -481,4 +510,6 @@ namespace AIAHTML5.API.Controllers { } } + + } \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index a42c72d..03fd4de 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -310,6 +310,44 @@ namespace AIAHTML5.API.Models return objUser; } + internal static User ByPassLoginDetail(string loginId, string accountNumber) + { + User objUser = null; + DBModel objModel = new DBModel(); + + SqlConnection conn = new SqlConnection(dbConnectionString); + SqlCommand cmd = new SqlCommand(); + SqlDataAdapter adapter; + DataSet ds = new DataSet(); + + cmd.Connection = conn; + cmd.CommandText = DBConstants.GET_USER_DETAIL_BYLOGIN_AND_ACCOUNT; + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.AddWithValue("@LoginId", loginId); + cmd.Parameters.AddWithValue("@AccountNumber", accountNumber); + + adapter = new SqlDataAdapter(cmd); + adapter.Fill(ds); + + if (ds != null && ds.Tables.Count > 0) + { + DataTable dt = ds.Tables[0]; + + if (dt.Rows.Count > 0) + { + foreach (DataRow dr in dt.Rows) + { + objUser = new User(); + objUser.LoginId = dr["LoginId"].ToString(); + objUser.Password = dr["Password"].ToString(); + + } + } + } + + return objUser; + } + internal User GetSelectedSettings(int userId) { logger.Debug(" Inside GetSelectedSettings for userId = " + userId); diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 766baa2..b855f3a 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -307,6 +307,12 @@ namespace AIAHTML5.API.Models return result; } + internal static dynamic ByPassLoginDetail(string loginId, string accountNumber) + { + dynamic objUser = DBModel.ByPassLoginDetail(loginId, accountNumber); + + return objUser; + } internal static int SaveUserSelectedSettings(User selectedSettings) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 23cd867..f3d50ab 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -323,10 +323,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; - var $el = $('
' - + '
' + var $el = $('').appendTo('#grid-view'); + + '

'+'('+ value._id+')

' + value._Title + '

').appendTo('#grid-view'); $compile($el)($scope); @@ -349,10 +349,14 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $timeout(function () { $scope.EnableUI(); //open default animation - if($rootScope.siteUrlInfo.mtype!=null) + if($rootScope.siteUrlInfo.mtype!=null && $rootScope.siteUrlInfo.id!=null) { - if($rootScope.siteUrlInfo.mtype=='CA'&& $rootScope.siteUrlInfo.id!=null) - $('#'+$rootScope.siteUrlInfo.id).trigger('click'); + if($rootScope.siteUrlInfo.mtype.toLowerCase()=='ca' && $rootScope.siteUrlInfo.id!="") + { + $('#'+$rootScope.siteUrlInfo.id).trigger('click'); + //$('div[title="'+$rootScope.siteUrlInfo.title+'"]').trigger('click'); + } + // clear detail $rootScope.siteUrlInfo.mtype=null; $rootScope.siteUrlInfo.id=null; @@ -548,9 +552,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; var $el = $('
' - + '
' + + '
').appendTo('#grid-view'); + + '

'+'('+ value._id+')

' + value._Title + '

').appendTo('#grid-view'); $compile($el)($scope); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 6d30b24..a826faf 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -3062,8 +3062,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //We substracted 135, as the difference between flex and html coordinates for same organ is 135 - var actulalX = mousePos.x + horizontlScrollPosition; - var actualY = mousePos.y + verticalScrollPosition; + var actulalX = mousePos.x + Math.round(horizontlScrollPosition)-1; + var actualY = mousePos.y + Math.round(verticalScrollPosition)-1; var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y); @@ -5001,7 +5001,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { if ( $scope.speechbubbleList[m].ids == sub_id1) { - $scope.angle1( $scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, bor_id); + $scope.angle1( $scope.speechbubbleList[m].xaxis-1, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, bor_id); break; } } @@ -5090,7 +5090,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var verticalScrollPosition = canvasDiv.scrollTop; var horizontlScrollPosition = canvasDiv.scrollLeft; - $scope.angle(x-2, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, true,windid); + $scope.angle(x-1, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, true,windid); }, //Update Annotation Cordianate in case of show single Annotation stop: function (evt) { @@ -5173,7 +5173,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ( $scope.speechbubbleList != null || $scope.speechbubbleList != undefined) { for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { if ( $scope.speechbubbleList[m].ids == sub_id1_anno) { - $scope.angle1( $scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, bor_id_anno); + $scope.angle1( $scope.speechbubbleList[m].xaxis-1, $scope.speechbubbleList[m].yaxis-1, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, bor_id_anno); break; } } @@ -5270,7 +5270,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var canvasDiv = document.getElementById('canvasDivDA_' + windid); var verticalScrollPosition = canvasDiv.scrollTop; var horizontlScrollPosition = canvasDiv.scrollLeft; - $scope.angle(x-2, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, false,windid); + $scope.angle(x-1, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, false,windid); }, //Update Annotation Cordianate in case of show single Annotation @@ -5436,10 +5436,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var isHighlightBodyWithCBTermData=$scope.GetwindowStoreData(windowviewid,'isHighlightBodyWithCBTermData'); if (isHighlightBodyWithCBTermData == true) { - var sppechBubbleHTML = "
"; + var sppechBubbleHTML = "
"; } else { - var sppechBubbleHTML = "
"; + var sppechBubbleHTML = "
"; } //Issue #7286 :Undefined annotation should not appear @@ -5523,10 +5523,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var Globe = []; Globe.push({ currentX: x, currentY: y }); document.getElementById('dot_'+windowviewid).style.display = 'block'; - document.getElementById('dot_'+windowviewid).style.left = ((Globe[0].currentX) - 6) + 'px'; - document.getElementById('dot_'+windowviewid).style.top = ((Globe[0].currentY) + 10) + 'px'; + document.getElementById('dot_'+windowviewid).style.left = ((Globe[0].currentX) - 5) + 'px'; + document.getElementById('dot_'+windowviewid).style.top = ((Globe[0].currentY) + 10.5) + 'px'; document.getElementById('bord_'+windowviewid).style.display = 'block'; - document.getElementById('bord_'+windowviewid).style.left = ((Globe[0].currentX) - 2) + 'px'; + document.getElementById('bord_'+windowviewid).style.left = ((Globe[0].currentX) - 1) + 'px'; document.getElementById('bord_'+windowviewid).style.top = ((Globe[0].currentY) + 0) + 'px'; document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.display = 'block'; @@ -5639,10 +5639,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var Globe = []; Globe.push({ currentX: x, currentY: y }); document.getElementById('dot_annotation_'+windowviewid).style.display = 'block'; - document.getElementById('dot_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 6) + 'px'; - document.getElementById('dot_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 10) + 'px'; + document.getElementById('dot_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 5) + 'px'; + document.getElementById('dot_annotation_'+windowviewid).style.top = ((Globe[0].currentY) + 10.5) + 'px'; document.getElementById('bord_annotation_'+windowviewid).style.display = 'block'; - document.getElementById('bord_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 2) + 'px'; + document.getElementById('bord_annotation_'+windowviewid).style.left = ((Globe[0].currentX) - 1) + 'px'; document.getElementById('bord_annotation_'+windowviewid).style.top = ((Globe[0].currentY)) + 'px'; document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.display = 'block'; document.getElementById('sppeachBubble_annotation_' + windowviewid + '-' + termNumber).style.left = (Globe[0].currentX-2) + 'px'; @@ -6139,11 +6139,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.transparencyCanvasHeight = transparencyCanvas.height; $scope.transparencyCanvasWidth = transparencyCanvas.width; + //bind click listener transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener); $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex')); + $(".ui-wrapper").css("left",TransparencyBoxStartX-2+ 'px'); } @@ -7632,8 +7634,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //We substracted 135, as the difference between flex and html coordinates for same organ is 135 - var actulalX = mousePos.x + horizontlScrollPosition; - var actualY = mousePos.y + verticalScrollPosition; + var actulalX = mousePos.x + Math.round(horizontlScrollPosition)-1; + var actualY = mousePos.y + Math.round(verticalScrollPosition)-1; var clickedBodyRegion; var x; var y; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 79e6822..f626657 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -639,6 +639,20 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $('#login').css('visibility', 'visible'); $rootScope.checkRefreshButtonClick = 1; + + $rootScope.siteUrlInfo = { + siteIP: null, + remoteIPAddress: null, + status: null, + accountNumber: null, + edition: null, + urlReferer: null, + calsCreds: null, + userId: null, + password: null, + mtype:null, + id:null + } if (params != null && params != undefined && params != "") { @@ -906,8 +920,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $timeout(function () { if($rootScope.siteUrlInfo.mtype!=null) { - if($rootScope.siteUrlInfo.mtype=='CA') - $('#clinical-animations').trigger('click'); + //currently open CA + $scope.RedirectToModule(); } }, 100); @@ -1006,11 +1020,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else { $location.path('/'); $timeout(function () { - if($rootScope.siteUrlInfo.mtype!=null) - { - if($rootScope.siteUrlInfo.mtype=='CA') - $('#clinical-animations').trigger('click'); - } + //currently open CA + $scope.RedirectToModule(); + }, 100); } } @@ -1051,21 +1063,17 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } + $scope.RedirectToModule = function () { + + if($rootScope.siteUrlInfo.mtype!=null) + { + if($rootScope.siteUrlInfo.mtype.toLowerCase()=='ca') + $('#clinical-animations').trigger('click'); + } + } $scope.ValidateClientSiteUrl = function () { - $rootScope.siteUrlInfo = { - siteIP: null, - remoteIPAddress: null, - status: null, - accountNumber: null, - edition: null, - urlReferer: null, - calsCreds: null, - userId: null, - password: null, - mtype:null, - id:null - } + $rootScope.isCallFromSite = true; var siteInfo = params.split('&'); @@ -1091,13 +1099,13 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } else if (paramInfo[0].toLowerCase() == 'username') { - $rootScope.siteUrlInfo.username = paramInfo[1]; - console.log("$rootScope.siteUrlInfo.username" + $rootScope.siteUrlInfo.username); + $rootScope.siteUrlInfo.userId = paramInfo[1]; + console.log("$rootScope.siteUrlInfo.username" + $rootScope.siteUrlInfo.userId); } - else if (paramInfo[0].toLowerCase() == 'password') { + else if (paramInfo[0].toLowerCase() == 'account') { - $rootScope.siteUrlInfo.password = paramInfo[1]; - // console.log("$rootScope.siteUrlInfo.password" + $rootScope.siteUrlInfo.password); + $rootScope.siteUrlInfo.accountNumber = paramInfo[1]; + console.log("$rootScope.siteUrlInfo.accountNumber" + $rootScope.siteUrlInfo.accountNumber); } @@ -1117,8 +1125,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data // console.log("$rootScope.siteUrlInfo.password " + $rootScope.siteUrlInfo.password); // } - $rootScope.userInfo.username = $rootScope.siteUrlInfo.username; - $rootScope.userInfo.password = $rootScope.siteUrlInfo.password; + //$rootScope.userInfo.username = $rootScope.siteUrlInfo.userId; + //$rootScope.userInfo.password = $rootScope.siteUrlInfo.password; } else { @@ -1141,7 +1149,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else if (paramInfo[0] == 'urlReferer') { $rootScope.siteUrlInfo.urlReferer = paramInfo[1]; - console.log("$rootScope.siteUrlInfo.siteIP" + $rootScope.siteUrlInfo.siteIP); + console.log("$rootScope.siteUrlInfo.urlReferer" + $rootScope.siteUrlInfo.urlReferer); } else if (paramInfo[0] == 'remoteIPAddress') { @@ -1153,11 +1161,36 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } } if (isCalsCredantialForSIte == "True") { - $rootScope.AuthenticateUser($rootScope.userInfo); + if($rootScope.siteUrlInfo.mtype.toLowerCase()=='ca' && $rootScope.siteUrlInfo.userId!=null && $rootScope.siteUrlInfo.accountNumber!=null) + { + AuthenticationService.ByPassLoginToOpenModule($rootScope.siteUrlInfo) + .then( + function (result) { + if(result!=null) + { + $rootScope.userInfo.username = result.userId; + $rootScope.userInfo.password = result.password; + $rootScope.AuthenticateUser($rootScope.userInfo); + } + + }), + function (error) { + console.log(' Error in bypass login = ' + error.statusText); + $rootScope.errorMessage = error; + $("#messageModal").modal('show'); + } + + } + else + { + console.log(' invalid detail in bypass login'); + $rootScope.errorMessage = "authentication is not allowed due to invalid details format .\nPlease pass the correct details again!"; + $("#messageModal").modal('show'); + } + } else { - console.log($rootScope.siteUrlInfo); AuthenticationService.validateClientSite($rootScope.siteUrlInfo) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js index 8a1307d..bb34f4c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js @@ -42,7 +42,26 @@ }); return deferred.promise; }, + ByPassLoginToOpenModule: function (urlDetail) { + var deferred = $q.defer(); + $http.post('/API/api/ByPassLoginToOpenModule', JSON.stringify(urlDetail), { + headers: { + 'Content-Type': 'application/json' + } + }) + .success(function (data, status, headers, config) { + console.log('success') + deferred.resolve(data); + }).error(function (data, status, headers, config) { + console.log('error') + deferred.reject(data); + $rootScope.errorMessage = data; + $("#messageModal").modal('show'); + + }); + return deferred.promise; + }, saveSetings: function (settings) { var deferred = $q.defer(); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html index 154545d..0384030 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html @@ -72,7 +72,7 @@ - {{item._Title}} + ({{item._id}}) {{item._Title}} {{item._BodyRegion}} @@ -88,7 +88,7 @@ - {{item._Title}} + ({{item._id}}) {{item._Title}} {{item._BodyRegion}} diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index fe3a43e..f878d3e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -264,7 +264,7 @@ -