diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj index 2b60b11..c08ba31 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj @@ -21,6 +21,7 @@ ..\packages\WebGrease.1.5.2\lib + true @@ -320,6 +321,9 @@ AIADBEntity.tt + + AIADBEntity.tt + AIADBEntity.tt @@ -729,7 +733,7 @@ - True + False True 65397 / diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index aed9fea..1745af0 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -365,9 +365,11 @@ namespace AIAHTML5.ADMIN.API.Controllers public HttpResponseMessage UpdateLicenseModulesStatus(JObject jsonData) { bool Status = false; - Tuple LicenseModuleStatus = new Tuple( + Tuple LicenseModuleStatus = new Tuple( jsonData["licenseId"].Value(), - jsonData["moduleStatusText"].Value()); + jsonData["moduleStatusText"].Value(), + jsonData["isAodOn"].Value(), + jsonData["CourseListText"].Value()); try { Status = LicenseModel.UpdateLicenseModulesStatus(dbContext, LicenseModuleStatus); @@ -387,6 +389,23 @@ namespace AIAHTML5.ADMIN.API.Controllers } } + [Route("GetLicenseAodCourse")] + [HttpGet] + public HttpResponseMessage GetLicenseAodCourse(int LicenseId) + { + List courseList; + try + { + courseList = LicenseModel.GetLicenseAodCourse(dbContext, LicenseId); + return Request.CreateResponse(HttpStatusCode.OK, courseList); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + [Route("CheckAccountNumber")] [HttpGet] @@ -423,4 +442,5 @@ namespace AIAHTML5.ADMIN.API.Controllers } } + } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs index 6eb4669..b811649 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs @@ -121,9 +121,10 @@ namespace AIAHTML5.ADMIN.API.Controllers string tagName = jsonData["tagName"].Value(); long SessionId = jsonData["SessionId"].Value(); bool isSiteUser = jsonData["isSiteUser"].Value(); + bool isAdmin = jsonData["isAdmin"].Value(); try { - Status = UserModel.ManageUserLoginStatus(dbContext, userId, tagName, SessionId, isSiteUser); + Status = UserModel.ManageUserLoginStatus(dbContext, userId, tagName, SessionId, isSiteUser, isAdmin); return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index 39f165b..3a68d29 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -3553,7 +3553,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModestySettings", licenseEditionIdParameter, siteIdParameter, isModestyParameter, isSiteUserParameter, status); } - public virtual int usp_UpdateLicenseModuleStatus(Nullable licenseId, string moduleStatusText, ObjectParameter status) + public virtual int usp_UpdateLicenseModuleStatus(Nullable licenseId, string moduleStatusText, Nullable isAodOn, string courseListText, ObjectParameter status) { var licenseIdParameter = licenseId.HasValue ? new ObjectParameter("LicenseId", licenseId) : @@ -3563,7 +3563,15 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("ModuleStatusText", moduleStatusText) : new ObjectParameter("ModuleStatusText", typeof(string)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModuleStatus", licenseIdParameter, moduleStatusTextParameter, status); + var isAodOnParameter = isAodOn.HasValue ? + new ObjectParameter("isAodOn", isAodOn) : + new ObjectParameter("isAodOn", typeof(bool)); + + var courseListTextParameter = courseListText != null ? + new ObjectParameter("CourseListText", courseListText) : + new ObjectParameter("CourseListText", typeof(string)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModuleStatus", licenseIdParameter, moduleStatusTextParameter, isAodOnParameter, courseListTextParameter, status); } public virtual int usp_UpdateLicenseUserGroupUsers(Nullable userGroupId, string userIds, ObjectParameter status) @@ -5003,7 +5011,7 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertAIAUser", sLoginIdParameter, sPasswordParameter, sFirstnameParameter, sLastnameParameter, iUserTypeIdParameter, sEmailIdParameter, iSecurityQuesIdParameter, sSecurityAnswerParameter, iCreatorIdParameter, iLicenseIdParameter, iEditionIdParameter, status); } - public virtual ObjectResult> usp_ManageUserLoginStatus(Nullable userId, string tag, Nullable sessionId, Nullable isSiteUser) + public virtual ObjectResult> usp_ManageUserLoginStatus(Nullable userId, string tag, Nullable sessionId, Nullable isSiteUser, Nullable isAdmin) { var userIdParameter = userId.HasValue ? new ObjectParameter("userId", userId) : @@ -5021,7 +5029,20 @@ namespace AIAHTML5.ADMIN.API.Entity new ObjectParameter("isSiteUser", isSiteUser) : new ObjectParameter("isSiteUser", typeof(bool)); - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction>("usp_ManageUserLoginStatus", userIdParameter, tagParameter, sessionIdParameter, isSiteUserParameter); + var isAdminParameter = isAdmin.HasValue ? + new ObjectParameter("isAdmin", isAdmin) : + new ObjectParameter("isAdmin", typeof(bool)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction>("usp_ManageUserLoginStatus", userIdParameter, tagParameter, sessionIdParameter, isSiteUserParameter, isAdminParameter); + } + + public virtual ObjectResult GetCoursesToLicense(Nullable licenseId) + { + var licenseIdParameter = licenseId.HasValue ? + new ObjectParameter("licenseId", licenseId) : + new ObjectParameter("licenseId", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("GetCoursesToLicense", licenseIdParameter); } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index 3e05020..a1f36b4 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -339,6 +339,9 @@ + + + @@ -1413,6 +1416,7 @@ + @@ -1503,6 +1507,8 @@ + + @@ -1912,7 +1918,7 @@ - + @@ -2582,6 +2588,8 @@ + + @@ -3013,6 +3021,10 @@ + + + + @@ -4343,6 +4355,11 @@ + + + + + @@ -6328,6 +6345,15 @@ + + + + + + + + + diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetCoursesToLicense_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetCoursesToLicense_Result.cs new file mode 100644 index 0000000..efd5fc3 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetCoursesToLicense_Result.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AIAHTML5.ADMIN.API.Entity +{ + using System; + + public partial class GetCoursesToLicense_Result + { + public string CourseId { get; set; } + public string CourseName { get; set; } + public bool Status { get; set; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index f3662ac..ec8b34a 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -433,12 +433,12 @@ namespace AIAHTML5.ADMIN.API.Models return LicenseModulesStatusList; } - public static bool UpdateLicenseModulesStatus(AIADatabaseV5Entities dbContext, Tuple LicenseModuleStatus) + public static bool UpdateLicenseModulesStatus(AIADatabaseV5Entities dbContext, Tuple LicenseModuleStatus) { var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); try { - dbContext.usp_UpdateLicenseModuleStatus(LicenseModuleStatus.Item1, LicenseModuleStatus.Item2, spStatus); + dbContext.usp_UpdateLicenseModuleStatus(LicenseModuleStatus.Item1, LicenseModuleStatus.Item2, LicenseModuleStatus.Item3, LicenseModuleStatus.Item4, spStatus); return (bool)spStatus.Value; } catch (Exception ex) @@ -447,6 +447,17 @@ namespace AIAHTML5.ADMIN.API.Models } } + public static List GetLicenseAodCourse(AIADatabaseV5Entities dbContext, int LicenseId) + { + List result = new List(); + try + { + result = dbContext.GetCoursesToLicense(LicenseId).ToList(); + } + catch (Exception ex) { } + return result; + } + public static bool CheckAccountNumber(AIADatabaseV5Entities dbContext, string AccountNo) { var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs index 8c65375..2c3615b 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs @@ -65,12 +65,12 @@ namespace AIAHTML5.ADMIN.API.Models return false; } } - public static bool ManageUserLoginStatus(AIADatabaseV5Entities dbContext, int userId, string tagName, long SessionId, bool isSiteUser) + public static bool ManageUserLoginStatus(AIADatabaseV5Entities dbContext, int userId, string tagName, long SessionId, bool isSiteUser,bool isAdmin) { bool loginStatus = false; try { - loginStatus = Convert.ToBoolean(dbContext.usp_ManageUserLoginStatus(userId, tagName, SessionId, isSiteUser).FirstOrDefault()); + loginStatus = Convert.ToBoolean(dbContext.usp_ManageUserLoginStatus(userId, tagName, SessionId, isSiteUser, isAdmin).FirstOrDefault()); return loginStatus; } diff --git a/400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs b/400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs index 89a0d67..1e9fee5 100644 --- a/400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs +++ b/400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs @@ -46,6 +46,7 @@ namespace AIAHTML5.API.Constants public const string LAB_EXERCISE_SAVE_SUCCESS = "Your lab exercise attempt is saved."; public const string LAB_EXERCISE_SAVE_FAILURE = "We are unable to save your lab exercise attempt, please try again."; public const string SAVED_LAB_EXERCISE_NOT_FOUND = "Saved Lab Exercise not found."; + public const string NO_COURSE_FOUND = "NO COURSE FOUND"; public const string VALIDATED_CLIENT = "Valid Client."; public const string INVALID_CLIENT = "InValid Client."; public const string MSG_NOT_AUTHORIZE_SITE_USER = "User is not authorized."; diff --git a/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs b/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs index 4a8b00e..bfaf6d8 100644 --- a/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs +++ b/400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs @@ -44,5 +44,6 @@ namespace AIAHTML5.API.Constants public const string GET_USER_LOGIN_STATUS = "usp_ManageUserLoginStatus"; public const string GET_AOD_AUTHENTICATION_STATUS = "usp_AodAuthenticationStatus"; public const string INSERT_SITE_LOGIN_LOG = "usp_InsertSiteLoginLog"; + public const string GET_AOD_COURSE_ITEMS = "GetSelectedCoursesToLicense"; } } \ 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 084d929..33ac18a 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs @@ -535,8 +535,9 @@ namespace AIAHTML5.API.Controllers string tagName = jsonData["tagName"].Value(); long SessionId = jsonData["SessionId"].Value(); bool isSiteUser = jsonData["isSiteUser"].Value(); + bool isAdmin = jsonData["isAdmin"].Value(); - loginStatus = AIAHTML5.API.Models.Users.GetUserLoginStatus(userId, tagName, SessionId, isSiteUser); + loginStatus = AIAHTML5.API.Models.Users.GetUserLoginStatus(userId, tagName, SessionId, isSiteUser, isAdmin); return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(loginStatus) }; } @@ -591,6 +592,28 @@ namespace AIAHTML5.API.Controllers } } + [HttpGet] + [Route("api/GetAodCoursesList")] + public HttpResponseMessage GetAodCoursesList([FromUri] int LicenseId) + { + try + { + DBModel db = new DBModel(); + List courselist = db.GetSelectedCourseList(LicenseId); + + if (courselist.Count>0) + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(JsonConvert.SerializeObject(courselist)) }; + else + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.NO_COURSE_FOUND) }; + + } + catch (Exception e) + { + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.ERROR_IN_FECTHING_DETAILS) }; + + } + + } // PUT api/authenticate/5 public void Put(int id, [FromBody]string value) { diff --git a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs index 9e64f2c..c93417d 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs @@ -350,7 +350,7 @@ namespace AIAHTML5.API.Models return objUser; } - internal static string GetUserLoginStatus(int userId,string tagName, long SessionId, bool isSiteUser) + internal static string GetUserLoginStatus(int userId,string tagName, long SessionId, bool isSiteUser,bool isAdmin) { string status=string.Empty; DBModel objModel = new DBModel(); @@ -367,6 +367,7 @@ namespace AIAHTML5.API.Models cmd.Parameters.AddWithValue("@tag", tagName); cmd.Parameters.AddWithValue("@sessionId", SessionId); cmd.Parameters.AddWithValue("@isSiteUser", isSiteUser); + cmd.Parameters.AddWithValue("@isAdmin", isAdmin); adapter = new SqlDataAdapter(cmd); adapter.Fill(ds); @@ -425,6 +426,47 @@ namespace AIAHTML5.API.Models return status; } + internal List GetSelectedCourseList(int licenseId) + { + AodCourse course = null; + List courselist = new List(); + + SqlConnection conn = new SqlConnection(dbConnectionString); + SqlCommand cmd = new SqlCommand(); + SqlDataAdapter adapter; + + DataSet ds = new DataSet(); + + cmd.Connection = conn; + cmd.CommandText = DBConstants.GET_AOD_COURSE_ITEMS; + cmd.CommandType = CommandType.StoredProcedure; + + cmd.Parameters.AddWithValue("@licenseId", licenseId); + + 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) + { + course = new AodCourse(); + + course.CourseId= dr["CourseId"].ToString(); + course.CourseName = dr["CourseName"].ToString(); + course.BodySystem = dr["BodySystem"].ToString(); + courselist.Add(course); + } + } + } + + return courselist; + } + internal User GetSelectedSettings(int userId,bool isSiteUser) { logger.Debug(" Inside GetSelectedSettings for userId = " + userId); diff --git a/400-SOURCECODE/AIAHTML5.API/Models/User.cs b/400-SOURCECODE/AIAHTML5.API/Models/User.cs index b0ae88f..3848846 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/User.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/User.cs @@ -128,6 +128,13 @@ namespace AIAHTML5.API.Models public int ExptImageLimit { get; set; } } + public class AodCourse + { + public string CourseId { get; set; } + public string CourseName { get; set; } + public string BodySystem { get; set; } + } + public class LicenseUserInsertImageDetail { public int LicenseId { get; set; } diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 3ddd15c..88d467a 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -340,10 +340,10 @@ namespace AIAHTML5.API.Models return objUser; } - internal static string GetUserLoginStatus(int userId, string tagName, long SessionId, bool isSiteUser) + internal static string GetUserLoginStatus(int userId, string tagName, long SessionId, bool isSiteUser,bool isAdmin) { string status = null; - status = DBModel.GetUserLoginStatus(userId, tagName, SessionId, isSiteUser); + status = DBModel.GetUserLoginStatus(userId, tagName, SessionId, isSiteUser, isAdmin); return status; } diff --git a/400-SOURCECODE/AIAHTML5.API/Web.config b/400-SOURCECODE/AIAHTML5.API/Web.config index a6bd9fe..752b3e8 100644 --- a/400-SOURCECODE/AIAHTML5.API/Web.config +++ b/400-SOURCECODE/AIAHTML5.API/Web.config @@ -39,8 +39,8 @@ - - + + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js index 4eacf2c..85b15a2 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js @@ -68,15 +68,15 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } } - $rootScope.Get3DWindowId = function () { - // handle for single window - if ($rootScope.TheeDWindowData.length > 0) { - for (var x = 0 ; x < $rootScope.TheeDWindowData.length; x++) { + // access from home controller + $rootScope.Set3DwindowData=function(windowviewid,keyname,data) { + for(var x=0 ;x < $rootScope.TheeDWindowData.length;x++){ - return $rootScope.TheeDWindowData[x].multiwinid; + if($rootScope.TheeDWindowData[x].multiwinid==windowviewid) + { + $rootScope.TheeDWindowData[x][keyname]=data; } } - else return 0; } $scope.DisableUI = function () { @@ -228,7 +228,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location "mType": 'THREE_D_ANATOMY', "windowTitle": $event.currentTarget.textContent, "size": { height: 600, width: 900 }, - "position": { x: 300, y: 110 } + "position": { x: 1, y: 30 } }; window.parent.AIAModuleOpenResourceInfo(ThreeDopenData); @@ -272,9 +272,10 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } $rootScope.Open3DModelBodyMain = function () { - $scope.DisableUI(); if ($rootScope.isCallFromOtherModule) { $scope.ThreeDModuleData = ModuleService.getModuleData("THREE_D_ANATOMY"); + if($scope.ThreeDModuleData.length<1) return; + $scope.DisableUI(); $scope.readyToLoad = true; $rootScope.ThreeDWindowLoadComplete = false; $scope.wincount = 1; @@ -312,6 +313,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } else { + $scope.DisableUI(); $scope.Open3DModelBody(null); } } @@ -409,21 +411,23 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $scope.jsPanelHeight = 560; $scope.jsPanelLeft = $scope.ThreeDOpenInOtherModules.position.x; - if ($scope.ThreeDOpenInOtherModules.position.x < 20) - $scope.jsPanelLeft = 20; + if ($scope.ThreeDOpenInOtherModules.position.x <= 1) + $scope.jsPanelLeft = 0; $scope.jsPanelTop = $scope.ThreeDOpenInOtherModules.position.y; - + if ($scope.ThreeDOpenInOtherModules.position.y < 30) + $scope.jsPanelTop = 30; + if($location.url()!= "/curriculum-builder-detail") { - $scope.jsPanelLeft = 1; - $scope.jsPanelTop = $rootScope.cBModulejsPanelTop(); + $scope.jsPanelLeft = 1; + $scope.jsPanelTop = 85; } } else { $scope.jsPanelWidth = $(window).outerWidth() - 20; - $scope.jsPanelHeight = $(window).outerHeight() - 90; + $scope.jsPanelHeight = $(window).outerHeight() - 140; $scope.jsPanelLeft = 1; - $scope.jsPanelTop = 70; + $scope.jsPanelTop = 55; } @@ -435,7 +439,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location theme: 'success', currentController: '3dAController', parentSlug: $scope.Get3DwindowStoreData(windowviewid, 'parentSlugName'), - content: '
' + + content: '
' + '' + '
', title: tittle, @@ -449,6 +453,9 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location height: $scope.jsPanelHeight }, onminimized:function (panel) { + var pnlName=panel[0].id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; var isAutoCalled = $scope.Get3DwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { @@ -458,6 +465,9 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $scope.Set3DwindowStoreData(windowviewid, 'maximised',false); }, onmaximized:function (panel) { + var pnlName=panel[0].id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; var isAutoCalled = $scope.Get3DwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { @@ -465,8 +475,23 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } $scope.Set3DwindowStoreData(windowviewid, 'maximised',true); $scope.Set3DwindowStoreData(windowviewid, 'minimised',false); + var canvasDIvHeight = $('#ThreeDImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#thContentDiv_'+ windowviewid ).css("height",canvasDIvHeight); + var $ua = navigator.userAgent; + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { + var aodheight = screen.height; + if(aodheight>=1024) + { + $("#ThreeDImagePanel_"+windowviewid).css('height',canvasDIvHeight+30-150); + $('#ThreeDImagePanel_' + windowviewid+ " .jsPanel-content").css('height',canvasDIvHeight-150); + $('#thContentDiv_'+windowviewid).css('height',canvasDIvHeight-150); + } + } }, onnormalized:function (panel) { + var pnlName=panel[0].id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; var isAutoCalled = $scope.Get3DwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { @@ -474,24 +499,35 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } $scope.Set3DwindowStoreData(windowviewid, 'minimised',false); $scope.Set3DwindowStoreData(windowviewid, 'maximised',false); + var canvasDIvHeight = $('#ThreeDImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#thContentDiv_'+ windowviewid ).css("height",canvasDIvHeight); + $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { stop: function (event, ui) { - var len = (event.currentTarget.id).split("_").length; - var windowviewid = (event.currentTarget.id).split("_")[len - 1]; + var pnlName=event.currentTarget.id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; $scope.Set3DwindowStoreData(windowviewid, 'width', ui.size.width); $scope.Set3DwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.Set3DwindowStoreData(windowviewid, 'y', ui.position.top); + $scope.Set3DwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; + var canvasDIvHeight = $('#ThreeDImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#thContentDiv_'+ windowviewid ).css("height",canvasDIvHeight); + $rootScope.resetMenuOptionOnClick(pnlName); } }, draggable: { stop: function( event, ui ) { - var len = (event.currentTarget.id).split("_").length; - var windowviewid = (event.currentTarget.id).split("_")[len - 1]; + var pnlName=event.currentTarget.id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; $scope.Set3DwindowStoreData(windowviewid, 'y', ui.position.top); $scope.Set3DwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; + $rootScope.resetMenuOptionOnClick(pnlName); } }, @@ -508,6 +544,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location else { $scope.jsPanel3D.normalize(); } + $rootScope.AllPanelObject(windowviewid,$scope.jsPanel3D); // set false after initial call of min,max or normal $scope.Set3DwindowStoreData(windowviewid, 'minmaxAutoEvent', false); $scope.Set3DwindowStoreData(windowviewid, 'y', $scope.jsPanelTop); @@ -524,14 +561,8 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, "slug": $scope.Get3DwindowStoreData(windowviewid, 'currentSlug') }); - - - } - - if (!$rootScope.isCallFromOtherModule) { - $('#ThreeDView').css("height", $(window).outerHeight()-10); - - $('#ThreeDView').css("width", $(window).outerWidth()-20); + var canvasDIvHeight = $('#ThreeDImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#thContentDiv_'+ windowviewid ).css("height",canvasDIvHeight); } //Calling methode for save Js Panel Activity for SaveCB @@ -548,6 +579,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $rootScope.ThreeDWindowLoadComplete = true; } + $scope.JsPanelMouseEnter(windowviewid); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index a7c1a68..b8acb19 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -548,7 +548,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { - $('#grid-view').css({"height":"690","overflow":"scroll"}); + $('#grid-view').css({"height":"670","overflow":"scroll"}); $('#ListViewDiv').css({"height":"450","overflow":"scroll"}); } } @@ -689,7 +689,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout localStorage.setItem("SearchText", currentSearchtext); if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) { if ($scope.query.SearchText == "undefined" || ($scope.query.SearchText == null || $scope.query.SearchText == "")) { - $rootScope.errorMessage = AIAConstants.PLEASE_ENTER_SEARCH_TEXT; + $('#errorMessage').text(AIAConstants.PLEASE_ENTER_SEARCH_TEXT); $("#messageModal").modal('show'); $scope.EnableUI(); return false; @@ -972,7 +972,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout "mType": 'ADAM_IMAGES', "windowTitle": $rootScope.ViewTitle, "size": { height: 600, width: 900 }, - "position": { x: 300, y: 110 } + "position": { x: 1, y: 30 } }; window.parent.AIAModuleOpenResourceInfo(AIDopenData); @@ -1017,9 +1017,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $rootScope.OpenAdamImageViewMain = function () { - $scope.DisableUI(); + if ($rootScope.isCallFromOtherModule) { $scope.AIModuleData = ModuleService.getModuleData("ADAM_IMAGES"); + if($scope.AIModuleData.length<1) return; + $scope.DisableUI(); $scope.readyToLoad = true; $rootScope.AIWindowLoadComplete = false; $scope.wincount = 1; @@ -1042,6 +1044,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($scope.wincount == winlen && $rootScope.AIWindowLoadComplete == true) { $scope.stopInterval(); $scope.$emit("LoadModuleComplete", "ADAM_IMAGES"); + } @@ -1057,6 +1060,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { + $scope.DisableUI(); $scope.OpenAdamImageView(null); } } @@ -1158,20 +1162,22 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.jsPanelHeight = 540; $scope.jsPanelLeft = $scope.aiOpenInOtherModules.position.x; - if ($scope.aiOpenInOtherModules.position.x < 20) - $scope.jsPanelLeft = 20; + if ($scope.aiOpenInOtherModules.position.x <= 1) + $scope.jsPanelLeft =0; $scope.jsPanelTop = $scope.aiOpenInOtherModules.position.y; + if ($scope.aiOpenInOtherModules.position.y < 30) + $scope.jsPanelTop = 30; if($location.url()!= "/curriculum-builder-detail") { - $scope.jsPanelLeft = 1; - $scope.jsPanelTop = $rootScope.cBModulejsPanelTop(); + $scope.jsPanelLeft = 1; + $scope.jsPanelTop = 85; } } else { $scope.jsPanelWidth = $(window).innerWidth() - 30; $scope.jsPanelHeight =$(window).innerHeight() - 150; - $scope.jsPanelLeft = 15; - $scope.jsPanelTop = 70; + $scope.jsPanelLeft = 1; + $scope.jsPanelTop = 55; } @@ -1201,6 +1207,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout height: $scope.jsPanelHeight }, onminimized:function (panel) { + var pnlName=panel[0].id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; var isAutoCalled = $scope.GetAIwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { @@ -1210,6 +1219,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetAIwindowStoreData(windowviewid, 'maximised',false); }, onmaximized:function (panel) { + var pnlName=panel[0].id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; var isAutoCalled = $scope.GetAIwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { @@ -1219,9 +1231,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetAIwindowStoreData(windowviewid, 'minimised',false); var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); + $rootScope.resetMenuOptionOnClick(pnlName); }, onnormalized:function (panel) { + var pnlName=panel[0].id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; var isAutoCalled = $scope.GetAIwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { @@ -1231,26 +1247,33 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetAIwindowStoreData(windowviewid, 'maximised',false); var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); + $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { stop: function (event, ui) { - var len = (event.currentTarget.id).split("_").length; - var windowviewid = (event.currentTarget.id).split("_")[len - 1]; + var pnlName=event.currentTarget.id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; $scope.SetAIwindowStoreData(windowviewid, 'width', ui.size.width); $scope.SetAIwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetAIwindowStoreData(windowviewid, 'y', ui.position.top); + $scope.SetAIwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); + $rootScope.resetMenuOptionOnClick(pnlName); } }, draggable: { stop: function( event, ui ) { - var len = (event.currentTarget.id).split("_").length; - var windowviewid = (event.currentTarget.id).split("_")[len - 1]; + var pnlName=event.currentTarget.id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; $scope.SetAIwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetAIwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; + $rootScope.resetMenuOptionOnClick(pnlName); } }, @@ -1267,6 +1290,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout else { $scope.jsPanelAI.normalize(); } + $rootScope.AllPanelObject(windowviewid,$scope.jsPanelAI); + // set false after initial call of min,max or normal $scope.SetAIwindowStoreData(windowviewid, 'minmaxAutoEvent', false); $scope.SetAIwindowStoreData(windowviewid, 'y', $scope.jsPanelTop); @@ -1278,27 +1303,24 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); - // console.log($rootScope.OpenAdamImages); - if (!$rootScope.isCallFromOtherModule) { - $('#AIView').css("height", $(window).innerHeight()-100); - $('#AIView').css("width",$(window).innerWidth()-100); - } $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); var canvas = document.getElementById("canvasAI_" + windowviewid); var canvasPaint = document.getElementById("canvasPaintAI_" + windowviewid); - - canvas.height = canvasDIvHeight-30; - canvasPaint.height = canvasDIvHeight-30; + var $ua = navigator.userAgent; if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { canvas.width = screen.width-20; canvasPaint.width = screen.width-20; + canvas.height = screen.height-130; + canvasPaint.height = screen.height-130; } else - { + { + canvas.height = screen.height-280; + canvasPaint.height = screen.height-280; canvas.width = screen.width-40; canvasPaint.width = screen.width-40; } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js index 656e811..423112f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js @@ -1,21 +1,20 @@ 'use strict'; -AIA.controller("AODController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout","DataService", "ModuleService", "$interval", "AIAConstants", -function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout,DataService, ModuleService, $interval, AIAConstants) { +AIA.controller("AODController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout","DataService", "ModuleService", "$interval", "AuthenticationService", "AIAConstants", +function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout,DataService, ModuleService, $interval,AuthenticationService, AIAConstants) { $scope.ObjectAttribute=function(windowviewid) { var windata={ 'multiwinid': windowviewid, 'AODAnimationData': [], 'moduleName': '', - 'aodUrl':'', + 'aodUrl':'AodHome/CoursePlayerAIA', 'courseId':'', - 'uid':'2',//categoty id. courseid cheched in category id + 'uid':'2',//categoty id. courseid checked in category id 'requestType':'SCORMPackage', 'currentViewTitle': '', 'parentSlugName': '', - 'currentSlug': '', - 'imageId': '' + 'currentSlug': '', }; return windata; } @@ -109,22 +108,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (index != -1) { // remove module which one is loaded - var reffid=$rootScope.AODWindowData[index].imageId; $rootScope.AODWindowData.splice(index, 1); - //remove also stream/source video from close panel from cb - if($rootScope.collectAnimationSource !=undefined) - { - for (var vdx = 0 ; vdx < $rootScope.collectAnimationSource.length; vdx++) { - if(reffid==$rootScope.collectAnimationSource[vdx].imageId) - $rootScope.collectAnimationSource.splice(vdx, 1); - } - } if ($('#' + panelid).html() != undefined) { $('#' + panelid).remove(); } - // $rootScope.resetjsPanelTop(panelid); } } } @@ -166,62 +155,45 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($rootScope.refreshcheck == null) { $location.path('/'); } - // code that will be executed ... - // every time this view is loaded - - + $rootScope.currentActiveModuleTitle = "ADAM ON DEMAND"; $scope.SetAODwindowStoreData($rootScope.MULTI_VIEW_ID, 'moduleName', "ADAM ON DEMAND"); $scope.LoadAODJsonData($rootScope.MULTI_VIEW_ID); - - setTimeout(function () { - - //call time interval function until load Illustration data - var timeintval = null; - timeintval = $interval(function () { - var AODAnimationData = $scope.GetAODwindowStoreData($rootScope.MULTI_VIEW_ID, 'AODAnimationData'); - if (AODAnimationData.length>0) { - $scope.stopIntervalAOD(); - $scope.loadAODList($rootScope.MULTI_VIEW_ID); - } - else - { - console.log("waiting for aod Data"); - } - }, 100); - - $scope.stopIntervalAOD = function () { - if (angular.isDefined(timeintval)) { - $interval.cancel(timeintval); - timeintval = undefined; - } - }; - - }, 200); - }; + + }; $scope.LoadAODJsonData = function (windowviewid) { - var promise = DataService.getJson('~/../content/data/json/aod/aod_courselist.json') - promise.then( - function (result) { - - var AODAnimationData = new jinqJs() - .from(result.root.AODData) - .orderBy([{ field: '_BodySystem', sort: 'asc' }]) - .select(); + //LicenseId would be zero for admin and gernal admin + //get this from DB + AuthenticationService.GetAodCoursesList($rootScope.userData.LicenseId) + .then( + function (aodResult) { + if(aodResult.length>0 && aodResult != AIAConstants.NO_COURSE_FOUND) + { - $scope.SetAODwindowStoreData(windowviewid, 'AODAnimationData', AODAnimationData); + var AODAnimationData = new jinqJs() + .from(aodResult) + .orderBy([{ field: 'BodySystem', sort: 'asc' }]) + .select(); - }, - function (error) { - $scope.EnableUI(); - - } - ); + $scope.SetAODwindowStoreData(windowviewid, 'AODAnimationData', AODAnimationData); + + $scope.loadAODList(windowviewid); + } + else + { + $('#errorMessage').text(AIAConstants.NO_COURSE_FOUND_MESSAGE); + $("#messageModal").modal('show'); + $scope.EnableUI(); + } + }, + function (error) { + $scope.EnableUI(); + }) }; @@ -232,13 +204,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#grid-view').empty(); angular.forEach(selectedAODListViewData, function (value, key) { - var imagePath = "~/../content/images/aod/thumbnails/" + value._ThumbnailImage; + var imagePath = "~/../content/images/aod/thumbnails/" + value.CourseId+'.jpg'; - var $el = $('
' + var $el = $('').appendTo('#grid-view'); + + '' + + '

'+'ID: '+ value.CourseId + '

' + value.CourseName + '

').appendTo('#grid-view'); $compile($el)($scope); @@ -300,10 +272,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var selectedTileData = []; selectedTileData = new jinqJs() .from(selectedAODListViewData) - .where('_ImageId = ' + $event.currentTarget.id) + .where('CourseId = ' + $event.currentTarget.id) .select(); - $rootScope.ViewTitle = selectedTileData[0]._Title; + $rootScope.ViewTitle = selectedTileData[0].CourseName; } else { $rootScope.ViewTitle = $event.currentTarget.textContent; @@ -313,35 +285,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout localStorage.setItem("currentBodyViewId", $event.currentTarget.id); $scope.SetAODwindowStoreData(windowviewid, 'currentViewTitle', $rootScope.ViewTitle); - $scope.SetAODwindowStoreData(windowviewid, 'imageId', $event.currentTarget.id); - - var promise = DataService.getJson('~/../content/data/json/aod/aod_courselist_video.json') - promise.then( - function (result) { - // $scope.AnimationData = result; - $scope.AODlistViewData = result.root.AODData; - var id = $scope.GetAODwindowStoreData(windowviewid, 'imageId'); - var clickedAODVideoData = []; - clickedAODVideoData = new jinqJs() - .from($scope.AODlistViewData) - .where('_CourseId == ' + id) - .select(); - - $scope.SetAODwindowStoreData(windowviewid, 'aodUrl', clickedAODVideoData[0]._VideoUrl); - $scope.SetAODwindowStoreData(windowviewid, 'courseId', clickedAODVideoData[0]._CourseId); - - var AODGridViewScrollPosition = $($window).scrollTop(); - localStorage.setItem('AODGridViewScroll', AODGridViewScrollPosition); - $location.url('/AOD-view-detail'); - - }, - function (error) { - - } + $scope.SetAODwindowStoreData(windowviewid, 'courseId', $event.currentTarget.id); - ); + var AODGridViewScrollPosition = $($window).scrollTop(); + localStorage.setItem('AODGridViewScroll', AODGridViewScrollPosition); + $location.url('/AOD-view-detail'); - } @@ -361,11 +310,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var uid = $scope.GetAODwindowStoreData(windowviewid, 'uid'); var requestType = $scope.GetAODwindowStoreData(windowviewid, 'requestType'); var aodSiteUrl = aodlink+"?SessionId=" + $rootScope.userData.SessionId + "&Courseid=" + courseid + "&type="+requestType +"&uID=" + uid+ ",_self"; + //var aodSiteUrl = aodlink+"?SessionId=1625199179202" + "&Courseid=" + courseid + "&type="+requestType +"&uID=" + uid+ ",_self"; $scope.jsPanelWidth = $(window).outerWidth() - 20; $scope.jsPanelHeight = $(window).outerHeight() - 140; $scope.jsPanelLeft = 1; - $scope.jsPanelTop = 70; + $scope.jsPanelTop = 55; if (aodlink.length > 0 ) { $scope.jsPanelVideo = $.jsPanel({ @@ -374,8 +324,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout theme: 'success', currentController: 'AODController', parentSlug: $scope.GetAODwindowStoreData(windowviewid, 'parentSlugName'), - content: '
' + - ''+ + content: '
' + + ''+ '
', title: tittle, position: { @@ -388,13 +338,39 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout height: $scope.jsPanelHeight }, controls: { buttons: 'closeonly' }, + onmaximized:function (panel) { + var pnlName=panel[0].id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#aodImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#aodContentDiv_'+ windowviewid ).css("height",canvasDIvHeight); + var $ua = navigator.userAgent; + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { + var aodheight = screen.height; + if(aodheight>=1024) + { + $("#aodImagePanel_"+windowviewid).css('height',canvasDIvHeight+30-100); + $('#aodImagePanel_' + windowviewid+ " .jsPanel-content").css('height',canvasDIvHeight-100); + $('#aodContentDiv_'+windowviewid).css('height',canvasDIvHeight-100); + } + } + }, resizable: { start:function(event, ui) { - var len = (event.currentTarget.id).split("_").length; - var windowviewid = (event.currentTarget.id).split("_")[len - 1]; + var pnlName=event.currentTarget.id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; $('#aodvideo_'+windowviewid).css("display",'block'); - + }, + stop:function(event, ui) + { + var pnlName=event.currentTarget.id; + var len = (pnlName).split("_").length; + var windowviewid = (pnlName).split("_")[len - 1]; + + var canvasDIvHeight = $('#aodImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#aodContentDiv_'+ windowviewid ).css("height",canvasDIvHeight); } }, @@ -402,15 +378,14 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.jsPanelVideo.maximize(); + $rootScope.AllPanelObject(windowviewid,$scope.jsPanelVideo); $scope.SetAODwindowStoreData(windowviewid, 'currentSlug', 'AOD-view-detail'); $('html, body').animate({ scrollTop: 0 }); $('#aodvideo_' + windowviewid).attr('src', aodSiteUrl); - } - $('#AODView').css("height", $(window).outerHeight() - 20); - - $('#AODView').css("width", $(window).outerWidth() - 30); + } + //Calling methode for save Js Panel Activity for SaveCB $scope.PanelActivity(); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 997edc0..53b3288 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -114,15 +114,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } - $rootScope.GetCAWindowId = function () { - // handle for single window - if ($rootScope.CAWindowData.length > 0) { - for (var x = 0 ; x < $rootScope.CAWindowData.length; x++) { + // access from home controller + $rootScope.SetCAwindowData=function(windowviewid,keyname,data) { + for(var x=0 ;x < $rootScope.CAWindowData.length;x++){ - return $rootScope.CAWindowData[x].multiwinid; + if($rootScope.CAWindowData[x].multiwinid==windowviewid) + { + $rootScope.CAWindowData[x][keyname]=data; } } - else return 0; } $scope.DisableUI = function () { @@ -695,8 +695,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { - $('#grid-view').css({"height":"720","overflow":"scroll"}); - $('#ListViewDiv').css({"height":"480","overflow":"scroll"}); + $('#grid-view').css({"height":"696","overflow":"scroll"}); + $('#ListViewDiv').css({"height":"460","overflow":"scroll"}); } } $scope.scroll = function () { @@ -732,7 +732,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout "textVisible": true, "windowTitle": $rootScope.ViewTitle, "size": { height: 600, width: 900 }, - "position": { x: 300, y: 110 } + "position": { x: 1, y: 30 } }; window.parent.AIAModuleOpenResourceInfo(CADopenData); @@ -783,9 +783,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $rootScope.openCABodyViewMain = function () { - $scope.DisableUI(); + if ($rootScope.isCallFromOtherModule) { $scope.CAModuleData = ModuleService.getModuleData("CLINICAL_ANIMATIONS"); + if($scope.CAModuleData.length<1) return; + $scope.DisableUI(); $scope.readyToLoad = true; $rootScope.CAWindowLoadComplete = false; $scope.wincount = 1; @@ -823,6 +825,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { + $scope.DisableUI(); $scope.openBodyView(null); } } @@ -960,15 +963,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($scope.caOpenInOtherModules.size.height < 510) $scope.jsPanelHeight = 510; - $scope.jsPanelLeft = $scope.caOpenInOtherModules.position.x; - if ($scope.caOpenInOtherModules.position.x < 20) - $scope.jsPanelLeft = 20; - $scope.jsPanelTop = $scope.caOpenInOtherModules.position.y; - - if($location.url()!= "/curriculum-builder-detail") { - $scope.jsPanelLeft = 1; - $scope.jsPanelTop = $rootScope.cBModulejsPanelTop(); - } + $scope.jsPanelLeft = $scope.caOpenInOtherModules.position.x; + if ($scope.caOpenInOtherModules.position.x <= 1) + $scope.jsPanelLeft = 0; + $scope.jsPanelTop = $scope.caOpenInOtherModules.position.y; + if ($scope.caOpenInOtherModules.position.y < 30) + $scope.jsPanelTop = 30; + + if($location.url()!= "/curriculum-builder-detail") { + $scope.jsPanelLeft = 1; + $scope.jsPanelTop = 85; + } } } @@ -976,7 +981,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.jsPanelWidth = $(window).outerWidth()-30; $scope.jsPanelHeight = $(window).outerHeight() - 105; $scope.jsPanelLeft = 1; - $scope.jsPanelTop = 70; + $scope.jsPanelTop = 55; } @@ -988,7 +993,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout currentController: 'CAController', parentSlug: $scope.GetCAwindowStoreData(windowviewid, 'parentSlugName'), content: '' + - '