Commit 53b7f1aa4118e790e1b81617ccb319747be0a74f
1 parent
8316d5ef
aod course list allowed by license
Showing
40 changed files
with
1307 additions
and
161 deletions
400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj
... | ... | @@ -21,6 +21,7 @@ |
21 | 21 | <IISExpressWindowsAuthentication /> |
22 | 22 | <IISExpressUseClassicPipelineMode /> |
23 | 23 | <WebGreaseLibPath>..\packages\WebGrease.1.5.2\lib</WebGreaseLibPath> |
24 | + <UseGlobalApplicationHostFile /> | |
24 | 25 | </PropertyGroup> |
25 | 26 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
26 | 27 | <DebugSymbols>true</DebugSymbols> |
... | ... | @@ -320,6 +321,9 @@ |
320 | 321 | <Compile Include="Entity\GetCancelledLicenses_Result.cs"> |
321 | 322 | <DependentUpon>AIADBEntity.tt</DependentUpon> |
322 | 323 | </Compile> |
324 | + <Compile Include="Entity\GetCoursesToLicense_Result.cs"> | |
325 | + <DependentUpon>AIADBEntity.tt</DependentUpon> | |
326 | + </Compile> | |
323 | 327 | <Compile Include="Entity\GetCustomerSummary_Result.cs"> |
324 | 328 | <DependentUpon>AIADBEntity.tt</DependentUpon> |
325 | 329 | </Compile> |
... | ... | @@ -729,7 +733,7 @@ |
729 | 733 | <VisualStudio> |
730 | 734 | <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> |
731 | 735 | <WebProjectProperties> |
732 | - <UseIIS>True</UseIIS> | |
736 | + <UseIIS>False</UseIIS> | |
733 | 737 | <AutoAssignPort>True</AutoAssignPort> |
734 | 738 | <DevelopmentServerPort>65397</DevelopmentServerPort> |
735 | 739 | <DevelopmentServerVPath>/</DevelopmentServerVPath> | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs
... | ... | @@ -365,9 +365,11 @@ namespace AIAHTML5.ADMIN.API.Controllers |
365 | 365 | public HttpResponseMessage UpdateLicenseModulesStatus(JObject jsonData) |
366 | 366 | { |
367 | 367 | bool Status = false; |
368 | - Tuple<int, string> LicenseModuleStatus = new Tuple<int, string>( | |
368 | + Tuple<int, string,bool, string> LicenseModuleStatus = new Tuple<int, string,bool, string>( | |
369 | 369 | jsonData["licenseId"].Value<int>(), |
370 | - jsonData["moduleStatusText"].Value<string>()); | |
370 | + jsonData["moduleStatusText"].Value<string>(), | |
371 | + jsonData["isAodOn"].Value<bool>(), | |
372 | + jsonData["CourseListText"].Value<string>()); | |
371 | 373 | try |
372 | 374 | { |
373 | 375 | Status = LicenseModel.UpdateLicenseModulesStatus(dbContext, LicenseModuleStatus); |
... | ... | @@ -387,6 +389,23 @@ namespace AIAHTML5.ADMIN.API.Controllers |
387 | 389 | } |
388 | 390 | } |
389 | 391 | |
392 | + [Route("GetLicenseAodCourse")] | |
393 | + [HttpGet] | |
394 | + public HttpResponseMessage GetLicenseAodCourse(int LicenseId) | |
395 | + { | |
396 | + List<GetCoursesToLicense_Result> courseList; | |
397 | + try | |
398 | + { | |
399 | + courseList = LicenseModel.GetLicenseAodCourse(dbContext, LicenseId); | |
400 | + return Request.CreateResponse(HttpStatusCode.OK, courseList); | |
401 | + } | |
402 | + catch (Exception ex) | |
403 | + { | |
404 | + // Log exception code goes here | |
405 | + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); | |
406 | + } | |
407 | + } | |
408 | + | |
390 | 409 | |
391 | 410 | [Route("CheckAccountNumber")] |
392 | 411 | [HttpGet] |
... | ... | @@ -423,4 +442,5 @@ namespace AIAHTML5.ADMIN.API.Controllers |
423 | 442 | } |
424 | 443 | |
425 | 444 | } |
445 | + | |
426 | 446 | } | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs
... | ... | @@ -121,9 +121,10 @@ namespace AIAHTML5.ADMIN.API.Controllers |
121 | 121 | string tagName = jsonData["tagName"].Value<string>(); |
122 | 122 | long SessionId = jsonData["SessionId"].Value<long>(); |
123 | 123 | bool isSiteUser = jsonData["isSiteUser"].Value<bool>(); |
124 | + bool isAdmin = jsonData["isAdmin"].Value<bool>(); | |
124 | 125 | try |
125 | 126 | { |
126 | - Status = UserModel.ManageUserLoginStatus(dbContext, userId, tagName, SessionId, isSiteUser); | |
127 | + Status = UserModel.ManageUserLoginStatus(dbContext, userId, tagName, SessionId, isSiteUser, isAdmin); | |
127 | 128 | |
128 | 129 | return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); |
129 | 130 | } | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs
... | ... | @@ -3553,7 +3553,7 @@ namespace AIAHTML5.ADMIN.API.Entity |
3553 | 3553 | return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModestySettings", licenseEditionIdParameter, siteIdParameter, isModestyParameter, isSiteUserParameter, status); |
3554 | 3554 | } |
3555 | 3555 | |
3556 | - public virtual int usp_UpdateLicenseModuleStatus(Nullable<int> licenseId, string moduleStatusText, ObjectParameter status) | |
3556 | + public virtual int usp_UpdateLicenseModuleStatus(Nullable<int> licenseId, string moduleStatusText, Nullable<bool> isAodOn, string courseListText, ObjectParameter status) | |
3557 | 3557 | { |
3558 | 3558 | var licenseIdParameter = licenseId.HasValue ? |
3559 | 3559 | new ObjectParameter("LicenseId", licenseId) : |
... | ... | @@ -3563,7 +3563,15 @@ namespace AIAHTML5.ADMIN.API.Entity |
3563 | 3563 | new ObjectParameter("ModuleStatusText", moduleStatusText) : |
3564 | 3564 | new ObjectParameter("ModuleStatusText", typeof(string)); |
3565 | 3565 | |
3566 | - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModuleStatus", licenseIdParameter, moduleStatusTextParameter, status); | |
3566 | + var isAodOnParameter = isAodOn.HasValue ? | |
3567 | + new ObjectParameter("isAodOn", isAodOn) : | |
3568 | + new ObjectParameter("isAodOn", typeof(bool)); | |
3569 | + | |
3570 | + var courseListTextParameter = courseListText != null ? | |
3571 | + new ObjectParameter("CourseListText", courseListText) : | |
3572 | + new ObjectParameter("CourseListText", typeof(string)); | |
3573 | + | |
3574 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModuleStatus", licenseIdParameter, moduleStatusTextParameter, isAodOnParameter, courseListTextParameter, status); | |
3567 | 3575 | } |
3568 | 3576 | |
3569 | 3577 | public virtual int usp_UpdateLicenseUserGroupUsers(Nullable<int> userGroupId, string userIds, ObjectParameter status) |
... | ... | @@ -5003,7 +5011,7 @@ namespace AIAHTML5.ADMIN.API.Entity |
5003 | 5011 | return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertAIAUser", sLoginIdParameter, sPasswordParameter, sFirstnameParameter, sLastnameParameter, iUserTypeIdParameter, sEmailIdParameter, iSecurityQuesIdParameter, sSecurityAnswerParameter, iCreatorIdParameter, iLicenseIdParameter, iEditionIdParameter, status); |
5004 | 5012 | } |
5005 | 5013 | |
5006 | - public virtual ObjectResult<Nullable<bool>> usp_ManageUserLoginStatus(Nullable<int> userId, string tag, Nullable<long> sessionId, Nullable<bool> isSiteUser) | |
5014 | + public virtual ObjectResult<Nullable<bool>> usp_ManageUserLoginStatus(Nullable<int> userId, string tag, Nullable<long> sessionId, Nullable<bool> isSiteUser, Nullable<bool> isAdmin) | |
5007 | 5015 | { |
5008 | 5016 | var userIdParameter = userId.HasValue ? |
5009 | 5017 | new ObjectParameter("userId", userId) : |
... | ... | @@ -5021,7 +5029,20 @@ namespace AIAHTML5.ADMIN.API.Entity |
5021 | 5029 | new ObjectParameter("isSiteUser", isSiteUser) : |
5022 | 5030 | new ObjectParameter("isSiteUser", typeof(bool)); |
5023 | 5031 | |
5024 | - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Nullable<bool>>("usp_ManageUserLoginStatus", userIdParameter, tagParameter, sessionIdParameter, isSiteUserParameter); | |
5032 | + var isAdminParameter = isAdmin.HasValue ? | |
5033 | + new ObjectParameter("isAdmin", isAdmin) : | |
5034 | + new ObjectParameter("isAdmin", typeof(bool)); | |
5035 | + | |
5036 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Nullable<bool>>("usp_ManageUserLoginStatus", userIdParameter, tagParameter, sessionIdParameter, isSiteUserParameter, isAdminParameter); | |
5037 | + } | |
5038 | + | |
5039 | + public virtual ObjectResult<GetCoursesToLicense_Result> GetCoursesToLicense(Nullable<int> licenseId) | |
5040 | + { | |
5041 | + var licenseIdParameter = licenseId.HasValue ? | |
5042 | + new ObjectParameter("licenseId", licenseId) : | |
5043 | + new ObjectParameter("licenseId", typeof(int)); | |
5044 | + | |
5045 | + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<GetCoursesToLicense_Result>("GetCoursesToLicense", licenseIdParameter); | |
5025 | 5046 | } |
5026 | 5047 | } |
5027 | 5048 | } | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx
... | ... | @@ -339,6 +339,9 @@ |
339 | 339 | <Function Name="GetContentList" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
340 | 340 | <Parameter Name="iContentTypeId" Type="int" Mode="In" /> |
341 | 341 | </Function> |
342 | + <Function Name="GetCoursesToLicense" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> | |
343 | + <Parameter Name="licenseId" Type="int" Mode="In" /> | |
344 | + </Function> | |
342 | 345 | <Function Name="GetCustomerSummary" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
343 | 346 | <Parameter Name="sAccoutNumber" Type="varchar" Mode="In" /> |
344 | 347 | <Parameter Name="sLicenseeFullName" Type="varchar" Mode="In" /> |
... | ... | @@ -1413,6 +1416,7 @@ |
1413 | 1416 | <Parameter Name="tag" Type="varchar" Mode="In" /> |
1414 | 1417 | <Parameter Name="sessionId" Type="bigint" Mode="In" /> |
1415 | 1418 | <Parameter Name="isSiteUser" Type="bit" Mode="In" /> |
1419 | + <Parameter Name="isAdmin" Type="bit" Mode="In" /> | |
1416 | 1420 | </Function> |
1417 | 1421 | <Function Name="usp_SaveLabExerciseAttempts" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
1418 | 1422 | <Parameter Name="UserId" Type="int" Mode="In" /> |
... | ... | @@ -1503,6 +1507,8 @@ |
1503 | 1507 | <Function Name="usp_UpdateLicenseModuleStatus" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
1504 | 1508 | <Parameter Name="LicenseId" Type="int" Mode="In" /> |
1505 | 1509 | <Parameter Name="ModuleStatusText" Type="varchar" Mode="In" /> |
1510 | + <Parameter Name="isAodOn" Type="bit" Mode="In" /> | |
1511 | + <Parameter Name="CourseListText" Type="varchar" Mode="In" /> | |
1506 | 1512 | <Parameter Name="Status" Type="bit" Mode="InOut" /> |
1507 | 1513 | </Function> |
1508 | 1514 | <Function Name="usp_UpdateLicenseUserGroupUsers" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo"> |
... | ... | @@ -1912,7 +1918,7 @@ |
1912 | 1918 | <Parameter Name="iEditionId" Mode="In" Type="Byte" /> |
1913 | 1919 | </FunctionImport> |
1914 | 1920 | <FunctionImport Name="GetLicenseBySiteId" ReturnType="Collection(AIADatabaseV5Model.GetLicenseBySiteId_Result)"> |
1915 | - <Parameter Name="sSiteId" Mode="In" Type="Int32" /> | |
1921 | + <Parameter Name="sSiteId" Mode="In" Type="Int32" /> | |
1916 | 1922 | <Parameter Name="sEditionId" Mode="In" Type="Int32" /> |
1917 | 1923 | </FunctionImport> |
1918 | 1924 | <FunctionImport Name="GetLicenseDetailByUserId" ReturnType="Collection(AIADatabaseV5Model.GetLicenseDetailByUserId_Result)"> |
... | ... | @@ -2582,6 +2588,8 @@ |
2582 | 2588 | <FunctionImport Name="usp_UpdateLicenseModuleStatus"> |
2583 | 2589 | <Parameter Name="LicenseId" Mode="In" Type="Int32" /> |
2584 | 2590 | <Parameter Name="ModuleStatusText" Mode="In" Type="String" /> |
2591 | + <Parameter Name="isAodOn" Mode="In" Type="Boolean" /> | |
2592 | + <Parameter Name="CourseListText" Mode="In" Type="String" /> | |
2585 | 2593 | <Parameter Name="Status" Mode="InOut" Type="Boolean" /> |
2586 | 2594 | </FunctionImport> |
2587 | 2595 | <FunctionImport Name="usp_UpdateLicenseUserGroupUsers"> |
... | ... | @@ -3013,6 +3021,10 @@ |
3013 | 3021 | <Parameter Name="tag" Mode="In" Type="String" /> |
3014 | 3022 | <Parameter Name="sessionId" Mode="In" Type="Int64" /> |
3015 | 3023 | <Parameter Name="isSiteUser" Mode="In" Type="Boolean" /> |
3024 | + <Parameter Name="isAdmin" Mode="In" Type="Boolean" /> | |
3025 | + </FunctionImport> | |
3026 | + <FunctionImport Name="GetCoursesToLicense" ReturnType="Collection(AIADatabaseV5Model.GetCoursesToLicense_Result)"> | |
3027 | + <Parameter Name="licenseId" Mode="In" Type="Int32" /> | |
3016 | 3028 | </FunctionImport> |
3017 | 3029 | </EntityContainer> |
3018 | 3030 | <ComplexType Name="DA_GetBaseLayer_Result"> |
... | ... | @@ -4343,6 +4355,11 @@ |
4343 | 4355 | <Property Type="Byte" Name="Id" Nullable="true" /> |
4344 | 4356 | <Property Type="String" Name="Title" Nullable="true" MaxLength="50" /> |
4345 | 4357 | </ComplexType> |
4358 | + <ComplexType Name="GetCoursesToLicense_Result"> | |
4359 | + <Property Type="String" Name="CourseId" Nullable="false" MaxLength="20" /> | |
4360 | + <Property Type="String" Name="CourseName" Nullable="false" MaxLength="150" /> | |
4361 | + <Property Type="Boolean" Name="Status" Nullable="false" /> | |
4362 | + </ComplexType> | |
4346 | 4363 | </Schema> |
4347 | 4364 | </edmx:ConceptualModels> |
4348 | 4365 | <!-- C-S mapping content --> |
... | ... | @@ -6328,6 +6345,15 @@ |
6328 | 6345 | <FunctionImportMapping FunctionImportName="usp_UpdateUserProfile" FunctionName="AIADatabaseV5Model.Store.usp_UpdateUserProfile" /> |
6329 | 6346 | <FunctionImportMapping FunctionImportName="usp_InsertAIAUser" FunctionName="AIADatabaseV5Model.Store.usp_InsertAIAUser" /> |
6330 | 6347 | <FunctionImportMapping FunctionImportName="usp_ManageUserLoginStatus" FunctionName="AIADatabaseV5Model.Store.usp_ManageUserLoginStatus" /> |
6348 | + <FunctionImportMapping FunctionImportName="GetCoursesToLicense" FunctionName="AIADatabaseV5Model.Store.GetCoursesToLicense"> | |
6349 | + <ResultMapping> | |
6350 | + <ComplexTypeMapping TypeName="AIADatabaseV5Model.GetCoursesToLicense_Result"> | |
6351 | + <ScalarProperty Name="CourseId" ColumnName="CourseId" /> | |
6352 | + <ScalarProperty Name="CourseName" ColumnName="CourseName" /> | |
6353 | + <ScalarProperty Name="Status" ColumnName="Status" /> | |
6354 | + </ComplexTypeMapping> | |
6355 | + </ResultMapping> | |
6356 | + </FunctionImportMapping> | |
6331 | 6357 | </EntityContainerMapping> |
6332 | 6358 | </Mapping> |
6333 | 6359 | </edmx:Mappings> | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/GetCoursesToLicense_Result.cs
0 โ 100644
1 | +//------------------------------------------------------------------------------ | |
2 | +// <auto-generated> | |
3 | +// This code was generated from a template. | |
4 | +// | |
5 | +// Manual changes to this file may cause unexpected behavior in your application. | |
6 | +// Manual changes to this file will be overwritten if the code is regenerated. | |
7 | +// </auto-generated> | |
8 | +//------------------------------------------------------------------------------ | |
9 | + | |
10 | +namespace AIAHTML5.ADMIN.API.Entity | |
11 | +{ | |
12 | + using System; | |
13 | + | |
14 | + public partial class GetCoursesToLicense_Result | |
15 | + { | |
16 | + public string CourseId { get; set; } | |
17 | + public string CourseName { get; set; } | |
18 | + public bool Status { get; set; } | |
19 | + } | |
20 | +} | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs
... | ... | @@ -433,12 +433,12 @@ namespace AIAHTML5.ADMIN.API.Models |
433 | 433 | return LicenseModulesStatusList; |
434 | 434 | } |
435 | 435 | |
436 | - public static bool UpdateLicenseModulesStatus(AIADatabaseV5Entities dbContext, Tuple<int, string> LicenseModuleStatus) | |
436 | + public static bool UpdateLicenseModulesStatus(AIADatabaseV5Entities dbContext, Tuple<int, string,bool,string> LicenseModuleStatus) | |
437 | 437 | { |
438 | 438 | var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); |
439 | 439 | try |
440 | 440 | { |
441 | - dbContext.usp_UpdateLicenseModuleStatus(LicenseModuleStatus.Item1, LicenseModuleStatus.Item2, spStatus); | |
441 | + dbContext.usp_UpdateLicenseModuleStatus(LicenseModuleStatus.Item1, LicenseModuleStatus.Item2, LicenseModuleStatus.Item3, LicenseModuleStatus.Item4, spStatus); | |
442 | 442 | return (bool)spStatus.Value; |
443 | 443 | } |
444 | 444 | catch (Exception ex) |
... | ... | @@ -447,6 +447,17 @@ namespace AIAHTML5.ADMIN.API.Models |
447 | 447 | } |
448 | 448 | } |
449 | 449 | |
450 | + public static List<GetCoursesToLicense_Result> GetLicenseAodCourse(AIADatabaseV5Entities dbContext, int LicenseId) | |
451 | + { | |
452 | + List<GetCoursesToLicense_Result> result = new List<GetCoursesToLicense_Result>(); | |
453 | + try | |
454 | + { | |
455 | + result = dbContext.GetCoursesToLicense(LicenseId).ToList(); | |
456 | + } | |
457 | + catch (Exception ex) { } | |
458 | + return result; | |
459 | + } | |
460 | + | |
450 | 461 | public static bool CheckAccountNumber(AIADatabaseV5Entities dbContext, string AccountNo) |
451 | 462 | { |
452 | 463 | var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); | ... | ... |
400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs
... | ... | @@ -65,12 +65,12 @@ namespace AIAHTML5.ADMIN.API.Models |
65 | 65 | return false; |
66 | 66 | } |
67 | 67 | } |
68 | - public static bool ManageUserLoginStatus(AIADatabaseV5Entities dbContext, int userId, string tagName, long SessionId, bool isSiteUser) | |
68 | + public static bool ManageUserLoginStatus(AIADatabaseV5Entities dbContext, int userId, string tagName, long SessionId, bool isSiteUser,bool isAdmin) | |
69 | 69 | { |
70 | 70 | bool loginStatus = false; |
71 | 71 | try |
72 | 72 | { |
73 | - loginStatus = Convert.ToBoolean(dbContext.usp_ManageUserLoginStatus(userId, tagName, SessionId, isSiteUser).FirstOrDefault()); | |
73 | + loginStatus = Convert.ToBoolean(dbContext.usp_ManageUserLoginStatus(userId, tagName, SessionId, isSiteUser, isAdmin).FirstOrDefault()); | |
74 | 74 | |
75 | 75 | return loginStatus; |
76 | 76 | } | ... | ... |
400-SOURCECODE/AIAHTML5.API/Constants/AIAConstants.cs
... | ... | @@ -46,6 +46,7 @@ namespace AIAHTML5.API.Constants |
46 | 46 | public const string LAB_EXERCISE_SAVE_SUCCESS = "Your lab exercise attempt is saved."; |
47 | 47 | public const string LAB_EXERCISE_SAVE_FAILURE = "We are unable to save your lab exercise attempt, please try again."; |
48 | 48 | public const string SAVED_LAB_EXERCISE_NOT_FOUND = "Saved Lab Exercise not found."; |
49 | + public const string NO_COURSE_FOUND = "NO COURSE FOUND"; | |
49 | 50 | public const string VALIDATED_CLIENT = "Valid Client."; |
50 | 51 | public const string INVALID_CLIENT = "InValid Client."; |
51 | 52 | public const string MSG_NOT_AUTHORIZE_SITE_USER = "User is not authorized."; | ... | ... |
400-SOURCECODE/AIAHTML5.API/Constants/DBConstants.cs
... | ... | @@ -44,5 +44,6 @@ namespace AIAHTML5.API.Constants |
44 | 44 | public const string GET_USER_LOGIN_STATUS = "usp_ManageUserLoginStatus"; |
45 | 45 | public const string GET_AOD_AUTHENTICATION_STATUS = "usp_AodAuthenticationStatus"; |
46 | 46 | public const string INSERT_SITE_LOGIN_LOG = "usp_InsertSiteLoginLog"; |
47 | + public const string GET_AOD_COURSE_ITEMS = "GetSelectedCoursesToLicense"; | |
47 | 48 | } |
48 | 49 | } |
49 | 50 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs
... | ... | @@ -535,8 +535,9 @@ namespace AIAHTML5.API.Controllers |
535 | 535 | string tagName = jsonData["tagName"].Value<string>(); |
536 | 536 | long SessionId = jsonData["SessionId"].Value<long>(); |
537 | 537 | bool isSiteUser = jsonData["isSiteUser"].Value<bool>(); |
538 | + bool isAdmin = jsonData["isAdmin"].Value<bool>(); | |
538 | 539 | |
539 | - loginStatus = AIAHTML5.API.Models.Users.GetUserLoginStatus(userId, tagName, SessionId, isSiteUser); | |
540 | + loginStatus = AIAHTML5.API.Models.Users.GetUserLoginStatus(userId, tagName, SessionId, isSiteUser, isAdmin); | |
540 | 541 | |
541 | 542 | return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(loginStatus) }; |
542 | 543 | } |
... | ... | @@ -591,6 +592,28 @@ namespace AIAHTML5.API.Controllers |
591 | 592 | } |
592 | 593 | } |
593 | 594 | |
595 | + [HttpGet] | |
596 | + [Route("api/GetAodCoursesList")] | |
597 | + public HttpResponseMessage GetAodCoursesList([FromUri] int LicenseId) | |
598 | + { | |
599 | + try | |
600 | + { | |
601 | + DBModel db = new DBModel(); | |
602 | + List<AodCourse> courselist = db.GetSelectedCourseList(LicenseId); | |
603 | + | |
604 | + if (courselist.Count>0) | |
605 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(JsonConvert.SerializeObject(courselist)) }; | |
606 | + else | |
607 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(AIAConstants.NO_COURSE_FOUND) }; | |
608 | + | |
609 | + } | |
610 | + catch (Exception e) | |
611 | + { | |
612 | + return new HttpResponseMessage { StatusCode = HttpStatusCode.InternalServerError, Content = new StringContent(AIAConstants.ERROR_IN_FECTHING_DETAILS) }; | |
613 | + | |
614 | + } | |
615 | + | |
616 | + } | |
594 | 617 | // PUT api/authenticate/5 |
595 | 618 | public void Put(int id, [FromBody]string value) |
596 | 619 | { | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/DBModel.cs
... | ... | @@ -350,7 +350,7 @@ namespace AIAHTML5.API.Models |
350 | 350 | return objUser; |
351 | 351 | } |
352 | 352 | |
353 | - internal static string GetUserLoginStatus(int userId,string tagName, long SessionId, bool isSiteUser) | |
353 | + internal static string GetUserLoginStatus(int userId,string tagName, long SessionId, bool isSiteUser,bool isAdmin) | |
354 | 354 | { |
355 | 355 | string status=string.Empty; |
356 | 356 | DBModel objModel = new DBModel(); |
... | ... | @@ -367,6 +367,7 @@ namespace AIAHTML5.API.Models |
367 | 367 | cmd.Parameters.AddWithValue("@tag", tagName); |
368 | 368 | cmd.Parameters.AddWithValue("@sessionId", SessionId); |
369 | 369 | cmd.Parameters.AddWithValue("@isSiteUser", isSiteUser); |
370 | + cmd.Parameters.AddWithValue("@isAdmin", isAdmin); | |
370 | 371 | adapter = new SqlDataAdapter(cmd); |
371 | 372 | adapter.Fill(ds); |
372 | 373 | |
... | ... | @@ -425,6 +426,47 @@ namespace AIAHTML5.API.Models |
425 | 426 | return status; |
426 | 427 | } |
427 | 428 | |
429 | + internal List<AodCourse> GetSelectedCourseList(int licenseId) | |
430 | + { | |
431 | + AodCourse course = null; | |
432 | + List<AodCourse> courselist = new List<AodCourse>(); | |
433 | + | |
434 | + SqlConnection conn = new SqlConnection(dbConnectionString); | |
435 | + SqlCommand cmd = new SqlCommand(); | |
436 | + SqlDataAdapter adapter; | |
437 | + | |
438 | + DataSet ds = new DataSet(); | |
439 | + | |
440 | + cmd.Connection = conn; | |
441 | + cmd.CommandText = DBConstants.GET_AOD_COURSE_ITEMS; | |
442 | + cmd.CommandType = CommandType.StoredProcedure; | |
443 | + | |
444 | + cmd.Parameters.AddWithValue("@licenseId", licenseId); | |
445 | + | |
446 | + adapter = new SqlDataAdapter(cmd); | |
447 | + adapter.Fill(ds); | |
448 | + | |
449 | + if (ds != null && ds.Tables.Count > 0) | |
450 | + { | |
451 | + DataTable dt = ds.Tables[0]; | |
452 | + | |
453 | + if (dt.Rows.Count > 0) | |
454 | + { | |
455 | + foreach (DataRow dr in dt.Rows) | |
456 | + { | |
457 | + course = new AodCourse(); | |
458 | + | |
459 | + course.CourseId= dr["CourseId"].ToString(); | |
460 | + course.CourseName = dr["CourseName"].ToString(); | |
461 | + course.BodySystem = dr["BodySystem"].ToString(); | |
462 | + courselist.Add(course); | |
463 | + } | |
464 | + } | |
465 | + } | |
466 | + | |
467 | + return courselist; | |
468 | + } | |
469 | + | |
428 | 470 | internal User GetSelectedSettings(int userId,bool isSiteUser) |
429 | 471 | { |
430 | 472 | logger.Debug(" Inside GetSelectedSettings for userId = " + userId); | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/User.cs
... | ... | @@ -128,6 +128,13 @@ namespace AIAHTML5.API.Models |
128 | 128 | public int ExptImageLimit { get; set; } |
129 | 129 | } |
130 | 130 | |
131 | + public class AodCourse | |
132 | + { | |
133 | + public string CourseId { get; set; } | |
134 | + public string CourseName { get; set; } | |
135 | + public string BodySystem { get; set; } | |
136 | + } | |
137 | + | |
131 | 138 | public class LicenseUserInsertImageDetail |
132 | 139 | { |
133 | 140 | public int LicenseId { get; set; } | ... | ... |
400-SOURCECODE/AIAHTML5.API/Models/Users.cs
... | ... | @@ -340,10 +340,10 @@ namespace AIAHTML5.API.Models |
340 | 340 | return objUser; |
341 | 341 | } |
342 | 342 | |
343 | - internal static string GetUserLoginStatus(int userId, string tagName, long SessionId, bool isSiteUser) | |
343 | + internal static string GetUserLoginStatus(int userId, string tagName, long SessionId, bool isSiteUser,bool isAdmin) | |
344 | 344 | { |
345 | 345 | string status = null; |
346 | - status = DBModel.GetUserLoginStatus(userId, tagName, SessionId, isSiteUser); | |
346 | + status = DBModel.GetUserLoginStatus(userId, tagName, SessionId, isSiteUser, isAdmin); | |
347 | 347 | |
348 | 348 | return status; |
349 | 349 | } | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js
1 | 1 | ๏ปฟ'use strict'; |
2 | 2 | |
3 | -AIA.controller("AODController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout","DataService", "ModuleService", "$interval", "AIAConstants", | |
4 | -function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout,DataService, ModuleService, $interval, AIAConstants) { | |
3 | +AIA.controller("AODController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout","DataService", "ModuleService", "$interval", "AuthenticationService", "AIAConstants", | |
4 | +function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout,DataService, ModuleService, $interval,AuthenticationService, AIAConstants) { | |
5 | 5 | $scope.ObjectAttribute=function(windowviewid) |
6 | 6 | { |
7 | 7 | var windata={ |
8 | 8 | 'multiwinid': windowviewid, |
9 | 9 | 'AODAnimationData': [], |
10 | 10 | 'moduleName': '', |
11 | - 'aodUrl':'', | |
11 | + 'aodUrl':'AodHome/CoursePlayerAIA', | |
12 | 12 | 'courseId':'', |
13 | - 'uid':'2',//categoty id. courseid cheched in category id | |
13 | + 'uid':'2',//categoty id. courseid checked in category id | |
14 | 14 | 'requestType':'SCORMPackage', |
15 | 15 | 'currentViewTitle': '', |
16 | 16 | 'parentSlugName': '', |
17 | - 'currentSlug': '', | |
18 | - 'imageId': '' | |
17 | + 'currentSlug': '', | |
19 | 18 | }; |
20 | 19 | return windata; |
21 | 20 | } |
... | ... | @@ -109,22 +108,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
109 | 108 | |
110 | 109 | if (index != -1) { |
111 | 110 | // remove module which one is loaded |
112 | - var reffid=$rootScope.AODWindowData[index].imageId; | |
113 | 111 | $rootScope.AODWindowData.splice(index, 1); |
114 | - //remove also stream/source video from close panel from cb | |
115 | - if($rootScope.collectAnimationSource !=undefined) | |
116 | - { | |
117 | - for (var vdx = 0 ; vdx < $rootScope.collectAnimationSource.length; vdx++) { | |
118 | - if(reffid==$rootScope.collectAnimationSource[vdx].imageId) | |
119 | - $rootScope.collectAnimationSource.splice(vdx, 1); | |
120 | - } | |
121 | - } | |
122 | 112 | if ($('#' + panelid).html() != undefined) { |
123 | 113 | |
124 | 114 | $('#' + panelid).remove(); |
125 | 115 | |
126 | 116 | } |
127 | - // $rootScope.resetjsPanelTop(panelid); | |
128 | 117 | } |
129 | 118 | } |
130 | 119 | } |
... | ... | @@ -166,62 +155,45 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
166 | 155 | if ($rootScope.refreshcheck == null) { |
167 | 156 | $location.path('/'); |
168 | 157 | } |
169 | - // code that will be executed ... | |
170 | - // every time this view is loaded | |
171 | - | |
172 | - | |
158 | + | |
173 | 159 | $rootScope.currentActiveModuleTitle = "ADAM ON DEMAND"; |
174 | 160 | |
175 | 161 | $scope.SetAODwindowStoreData($rootScope.MULTI_VIEW_ID, 'moduleName', "ADAM ON DEMAND"); |
176 | 162 | |
177 | 163 | $scope.LoadAODJsonData($rootScope.MULTI_VIEW_ID); |
178 | - | |
179 | - setTimeout(function () { | |
180 | - | |
181 | - //call time interval function until load Illustration data | |
182 | - var timeintval = null; | |
183 | - timeintval = $interval(function () { | |
184 | - var AODAnimationData = $scope.GetAODwindowStoreData($rootScope.MULTI_VIEW_ID, 'AODAnimationData'); | |
185 | - if (AODAnimationData.length>0) { | |
186 | - $scope.stopIntervalAOD(); | |
187 | - $scope.loadAODList($rootScope.MULTI_VIEW_ID); | |
188 | - } | |
189 | - else | |
190 | - { | |
191 | - console.log("waiting for aod Data"); | |
192 | - } | |
193 | - }, 100); | |
194 | - | |
195 | - $scope.stopIntervalAOD = function () { | |
196 | - if (angular.isDefined(timeintval)) { | |
197 | - $interval.cancel(timeintval); | |
198 | - timeintval = undefined; | |
199 | - } | |
200 | - }; | |
201 | - | |
202 | - }, 200); | |
203 | - }; | |
164 | + | |
165 | + }; | |
204 | 166 | |
205 | 167 | $scope.LoadAODJsonData = function (windowviewid) { |
206 | 168 | |
207 | - var promise = DataService.getJson('~/../content/data/json/aod/aod_courselist.json') | |
208 | - promise.then( | |
209 | - function (result) { | |
210 | - | |
211 | - var AODAnimationData = new jinqJs() | |
212 | - .from(result.root.AODData) | |
213 | - .orderBy([{ field: '_BodySystem', sort: 'asc' }]) | |
214 | - .select(); | |
169 | + //LicenseId would be zero for admin and gernal admin | |
170 | + //get this from DB | |
171 | + AuthenticationService.GetAodCoursesList($rootScope.userData.LicenseId) | |
172 | + .then( | |
173 | + function (aodResult) { | |
174 | + if(aodResult.length>0 && aodResult != AIAConstants.NO_COURSE_FOUND) | |
175 | + { | |
215 | 176 | |
216 | - $scope.SetAODwindowStoreData(windowviewid, 'AODAnimationData', AODAnimationData); | |
177 | + var AODAnimationData = new jinqJs() | |
178 | + .from(aodResult) | |
179 | + .orderBy([{ field: 'BodySystem', sort: 'asc' }]) | |
180 | + .select(); | |
217 | 181 | |
218 | - }, | |
219 | - function (error) { | |
220 | - $scope.EnableUI(); | |
221 | - | |
222 | - } | |
223 | - ); | |
182 | + $scope.SetAODwindowStoreData(windowviewid, 'AODAnimationData', AODAnimationData); | |
183 | + | |
184 | + $scope.loadAODList(windowviewid); | |
185 | + } | |
186 | + else | |
187 | + { | |
188 | + $('#errorMessage').text(AIAConstants.NO_COURSE_FOUND_MESSAGE); | |
189 | + $("#messageModal").modal('show'); | |
190 | + $scope.EnableUI(); | |
224 | 191 | |
192 | + } | |
193 | + }, | |
194 | + function (error) { | |
195 | + $scope.EnableUI(); | |
196 | + }) | |
225 | 197 | |
226 | 198 | }; |
227 | 199 | |
... | ... | @@ -232,13 +204,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
232 | 204 | $('#grid-view').empty(); |
233 | 205 | |
234 | 206 | angular.forEach(selectedAODListViewData, function (value, key) { |
235 | - var imagePath = "~/../content/images/aod/thumbnails/" + value._ThumbnailImage; | |
207 | + var imagePath = "~/../content/images/aod/thumbnails/" + value.CourseId+'.jpg'; | |
236 | 208 | |
237 | 209 | |
238 | - var $el = $('<div id="' + value._ImageId + '" class="col-sm-3 col-lg-2" title = "'+ value._Title + '" data-ng-click="openView($event)">' | |
210 | + var $el = $('<div id="' + value.CourseId + '" class="col-sm-3 col-lg-2" title = "'+ value.CourseName + '" data-ng-click="openView($event)">' | |
239 | 211 | + '<div class="thumbnail" ><a href="#">' |
240 | - + '<img id="' + value._Title + '" class="img-responsive" style="width:100%;height:100%;" ng-src="' + imagePath + '" alt="" title="" >' | |
241 | - + '<div class="caption" style="padding:0px;height:80px"><p style="height:15px"><em>'+'ID: '+ value._ImageId + '</em></p><p style="white-space:pre-wrap;height:60px">' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view'); | |
212 | + + '<img id="' + value.CourseName + '" class="img-responsive" style="width:100%;height:100%;" ng-src="' + imagePath + '" alt="" title="" >' | |
213 | + + '<div class="caption" style="padding:0px;height:80px"><p style="height:15px"><em>'+'ID: '+ value.CourseId + '</em></p><p style="white-space:pre-wrap;height:60px">' + value.CourseName + '</p></div></a></div></div>').appendTo('#grid-view'); | |
242 | 214 | |
243 | 215 | $compile($el)($scope); |
244 | 216 | |
... | ... | @@ -300,10 +272,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
300 | 272 | var selectedTileData = []; |
301 | 273 | selectedTileData = new jinqJs() |
302 | 274 | .from(selectedAODListViewData) |
303 | - .where('_ImageId = ' + $event.currentTarget.id) | |
275 | + .where('CourseId = ' + $event.currentTarget.id) | |
304 | 276 | .select(); |
305 | 277 | |
306 | - $rootScope.ViewTitle = selectedTileData[0]._Title; | |
278 | + $rootScope.ViewTitle = selectedTileData[0].CourseName; | |
307 | 279 | } |
308 | 280 | else { |
309 | 281 | $rootScope.ViewTitle = $event.currentTarget.textContent; |
... | ... | @@ -313,35 +285,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
313 | 285 | localStorage.setItem("currentBodyViewId", $event.currentTarget.id); |
314 | 286 | |
315 | 287 | $scope.SetAODwindowStoreData(windowviewid, 'currentViewTitle', $rootScope.ViewTitle); |
316 | - $scope.SetAODwindowStoreData(windowviewid, 'imageId', $event.currentTarget.id); | |
317 | - | |
318 | - var promise = DataService.getJson('~/../content/data/json/aod/aod_courselist_video.json') | |
319 | - promise.then( | |
320 | - function (result) { | |
321 | - // $scope.AnimationData = result; | |
322 | - $scope.AODlistViewData = result.root.AODData; | |
323 | - var id = $scope.GetAODwindowStoreData(windowviewid, 'imageId'); | |
324 | - var clickedAODVideoData = []; | |
325 | - clickedAODVideoData = new jinqJs() | |
326 | - .from($scope.AODlistViewData) | |
327 | - .where('_CourseId == ' + id) | |
328 | - .select(); | |
329 | - | |
330 | - $scope.SetAODwindowStoreData(windowviewid, 'aodUrl', clickedAODVideoData[0]._VideoUrl); | |
331 | - $scope.SetAODwindowStoreData(windowviewid, 'courseId', clickedAODVideoData[0]._CourseId); | |
332 | - | |
333 | - var AODGridViewScrollPosition = $($window).scrollTop(); | |
334 | - localStorage.setItem('AODGridViewScroll', AODGridViewScrollPosition); | |
335 | - $location.url('/AOD-view-detail'); | |
336 | - | |
337 | - }, | |
338 | - function (error) { | |
339 | - | |
340 | - } | |
288 | + $scope.SetAODwindowStoreData(windowviewid, 'courseId', $event.currentTarget.id); | |
341 | 289 | |
342 | - ); | |
290 | + var AODGridViewScrollPosition = $($window).scrollTop(); | |
291 | + localStorage.setItem('AODGridViewScroll', AODGridViewScrollPosition); | |
292 | + $location.url('/AOD-view-detail'); | |
343 | 293 | |
344 | - | |
345 | 294 | } |
346 | 295 | |
347 | 296 | |
... | ... | @@ -435,8 +384,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
435 | 384 | |
436 | 385 | $('#aodvideo_' + windowviewid).attr('src', aodSiteUrl); |
437 | 386 | |
438 | - //var canvasDIvHeight = $('#aodImagePanel_' + windowviewid+ " .jsPanel-content").height(); | |
439 | - // $('#aodContentDiv_'+ windowviewid ).css("height",canvasDIvHeight); | |
440 | 387 | } |
441 | 388 | |
442 | 389 | //Calling methode for save Js Panel Activity for SaveCB | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -341,11 +341,12 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
341 | 341 | var head = $(innerDoc).contents().find("head"); |
342 | 342 | //hide menu link |
343 | 343 | var css = '<style type="text/css">' + |
344 | - // '#topMenuBar{visibility: hidden;} ' + | |
345 | - '.navbar-fixed-top{display: none}'+ | |
346 | - '.pageHeading{margin-top: 2px}'+ | |
347 | - '.sidebar{padding-top: 35px}'+ | |
348 | - '.main{margin-top: 8px}'+ | |
344 | + //'#topMenuBar{visibility: hidden;} ' + | |
345 | + '#topMenuBar{pointer-events: none;opacity:.5} ' + | |
346 | + //'.navbar-fixed-top{display: none}'+ | |
347 | + // '.pageHeading{margin-top: 2px}'+ | |
348 | + // '.sidebar{padding-top: 35px}'+ | |
349 | + // '.main{margin-top: 8px}'+ | |
349 | 350 | |
350 | 351 | '#Link\\/encyclopedia{display: none} ' + |
351 | 352 | // '#curriculum-builder{display: none} ' + |
... | ... | @@ -362,9 +363,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
362 | 363 | |
363 | 364 | '</style>'; |
364 | 365 | |
365 | - var storefunc = '<script> function OpenDefaultModule(iframe){ iframe.contentWindow.document.getElementById(iframe.name).click();}</script>'; | |
366 | + // var storefunc = '<script> function OpenDefaultModule(iframe){ iframe.contentWindow.document.getElementById(iframe.name).click();}</script>'; | |
366 | 367 | $(head).append(css); |
367 | - $(head).append(storefunc); | |
368 | + // $(head).append(storefunc); | |
368 | 369 | |
369 | 370 | var canvasDIvHeight = $("#dvOpenResourcePanel .jsPanel-content").height(); |
370 | 371 | $('#OpenModuleInCB').css('height', canvasDIvHeight); |
... | ... | @@ -377,7 +378,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
377 | 378 | $scope.loadopenresourceContent(head, iframe); |
378 | 379 | } |
379 | 380 | |
380 | - }, 500); | |
381 | + }, 100); | |
381 | 382 | |
382 | 383 | } |
383 | 384 | |
... | ... | @@ -386,7 +387,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
386 | 387 | $timeout(function () { |
387 | 388 | sessionStorage.setItem('isModuleOpenByOpenResource', 'true'); |
388 | 389 | sessionStorage.removeItem('ExitsCBFileDetail'); |
389 | - OpenDefaultModule(iframe); | |
390 | + // OpenDefaultModule(iframe); | |
390 | 391 | |
391 | 392 | }, 500); |
392 | 393 | |
... | ... | @@ -723,11 +724,15 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
723 | 724 | //incase site user login userid is 0 so then using license id |
724 | 725 | //logout site user while reload url without parameter |
725 | 726 | var userId=loggedInUser.Id==0?loggedInUser.LicenseId:loggedInUser.Id; |
727 | + | |
728 | + //licenseId would be zero for admin/gernal admin | |
729 | + var isadminType=loggedInUser.LicenseId==0?true:false; | |
726 | 730 | $scope.checkuserstatus = { |
727 | 731 | userId: userId, |
728 | 732 | tagName: loggedInUser.Id==0?'logout':'update', |
729 | 733 | SessionId:loggedInUser.SessionId, |
730 | - isSiteUser:loggedInUser.isSiteUser | |
734 | + isSiteUser:loggedInUser.isSiteUser, | |
735 | + isAdmin:isadminType | |
731 | 736 | } |
732 | 737 | |
733 | 738 | // this case found when browser closed by user after login. after long time (after 20 min) open site again |
... | ... | @@ -2005,7 +2010,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
2005 | 2010 | userId: null, |
2006 | 2011 | tagName: null, |
2007 | 2012 | SessionId:null, |
2008 | - isSiteUser:false | |
2013 | + isSiteUser:false, | |
2014 | + isAdmin:false | |
2009 | 2015 | } |
2010 | 2016 | console.log('user session start'); |
2011 | 2017 | $rootScope.CheckUserSession('insert'); |
... | ... | @@ -2084,6 +2090,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
2084 | 2090 | $rootScope.userStatus.tagName=tagName; |
2085 | 2091 | $rootScope.userStatus.SessionId=$rootScope.userData.SessionId; |
2086 | 2092 | $rootScope.userStatus.isSiteUser=$rootScope.userData.isSiteUser; |
2093 | + //licenseId would be zero for admin/gernal admin | |
2094 | + $rootScope.userStatus.isAdmin=$rootScope.userData.LicenseId==0?true:false; | |
2087 | 2095 | |
2088 | 2096 | AuthenticationService.ManageUserLoginStatus($rootScope.userStatus) |
2089 | 2097 | .then( |
... | ... | @@ -8501,20 +8509,14 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
8501 | 8509 | setting.modesty =Formatsetting.modesty ; |
8502 | 8510 | setting.skintone = Formatsetting.ethnicity; |
8503 | 8511 | |
8504 | - // var isallowToChange=false; | |
8505 | 8512 | if($rootScope.userData.isSiteUser) |
8506 | 8513 | { |
8507 | 8514 | // send as user id |
8508 | 8515 | setting.userId = $rootScope.userData.siteId; |
8509 | - //isallowToChange=$rootScope.userData.EditionId<3; | |
8510 | 8516 | } |
8511 | 8517 | else |
8512 | 8518 | { |
8513 | 8519 | setting.userId = $rootScope.userData.Id; |
8514 | - //concurrent license | |
8515 | - // only instructor | |
8516 | - //if($rootScope.userData.LicenseId!=0) | |
8517 | - // isallowToChange=$rootScope.userData.EditionId<3; | |
8518 | 8520 | |
8519 | 8521 | } |
8520 | 8522 | |
... | ... | @@ -8531,8 +8533,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data |
8531 | 8533 | setting.isSiteUser=$rootScope.userData.isSiteUser; |
8532 | 8534 | setting.LicenseEditionId=$rootScope.userData.LicenseEditionId; |
8533 | 8535 | |
8534 | - // if(isallowToChange ||$rootScope.userData.LicenseId==0) | |
8535 | - // { | |
8536 | 8536 | AuthenticationService.saveSetings(setting) |
8537 | 8537 | .then( |
8538 | 8538 | function (result) { | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js
... | ... | @@ -553,7 +553,9 @@ AIA.constant("AIAConstants", { |
553 | 553 | "CB_Confirm_Password_Not_Match": "confirm password not matched.", |
554 | 554 | "CB_Add_Slide_First": "Please add slide first to export this section.", |
555 | 555 | "CB_Curriculum_Name_Empty": "Curriculum name is empty!", |
556 | - | |
556 | + "NO_COURSE_FOUND": "NO COURSE FOUND", | |
557 | + "NO_COURSE_FOUND_MESSAGE": "No Selected A.D.A.M. courses found for this user account. Please contact ADAM.", | |
558 | + | |
557 | 559 | "NO_BODY_SYSTEM_AVAILABLE": "Selected body system is not available on this layer.", |
558 | 560 | "COOKIES_MESSAGE": "You need to enable your browser's cookies to run this application.", |
559 | 561 | "SAVED_LAB_EXERCISE_NOT_FOUND": "Saved Lab Exercise not found.", | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js
... | ... | @@ -131,6 +131,28 @@ |
131 | 131 | return deferred.promise; |
132 | 132 | }, |
133 | 133 | |
134 | + GetAodCoursesList: function (licenseId) { | |
135 | + var deferred = $q.defer(); | |
136 | + | |
137 | + $http({ | |
138 | + url: "/API/api/GetAodCoursesList", | |
139 | + method: "GET", | |
140 | + params: { LicenseId: licenseId } | |
141 | + }) | |
142 | + | |
143 | + .success(function (data, status, headers, config) { | |
144 | + deferred.resolve(data); | |
145 | + }).error(function (data, status, headers, config) { | |
146 | + console.log('error') | |
147 | + deferred.reject(data); | |
148 | + $rootScope.isVisibleLogin = true; | |
149 | + $('#errorMessage').text(data); | |
150 | + $("#messageModal").modal('show'); | |
151 | + | |
152 | + }); | |
153 | + return deferred.promise; | |
154 | + }, | |
155 | + | |
134 | 156 | validateClientSite: function (clientInfo) { |
135 | 157 | var deferred = $q.defer(); |
136 | 158 | ... | ... |
400-SOURCECODE/Admin/package-lock.json
... | ... | @@ -507,6 +507,15 @@ |
507 | 507 | "moment": "^2.19.3" |
508 | 508 | } |
509 | 509 | }, |
510 | + "angular2-multiselect-checkbox-dropdown": { | |
511 | + "version": "1.4.0", | |
512 | + "resolved": "https://registry.npmjs.org/angular2-multiselect-checkbox-dropdown/-/angular2-multiselect-checkbox-dropdown-1.4.0.tgz", | |
513 | + "integrity": "sha1-eN+iYuqAPvx9x/ctRmRdcCs59Is=", | |
514 | + "requires": { | |
515 | + "bootstrap": "*", | |
516 | + "font-awesome": "*" | |
517 | + } | |
518 | + }, | |
510 | 519 | "angular4-slimscroll": { |
511 | 520 | "version": "1.0.5", |
512 | 521 | "resolved": "https://registry.npmjs.org/angular4-slimscroll/-/angular4-slimscroll-1.0.5.tgz", |
... | ... | @@ -3855,6 +3864,11 @@ |
3855 | 3864 | } |
3856 | 3865 | } |
3857 | 3866 | }, |
3867 | + "font-awesome": { | |
3868 | + "version": "4.7.0", | |
3869 | + "resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz", | |
3870 | + "integrity": "sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM=" | |
3871 | + }, | |
3858 | 3872 | "for-in": { |
3859 | 3873 | "version": "1.0.2", |
3860 | 3874 | "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", | ... | ... |
400-SOURCECODE/Admin/package.json
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/README.md
0 โ 100644
1 | +# Angular2 Multiselect Dropdown | |
2 | +[](https://www.npmjs.com/package/angular2-multiselect-dropdown) | |
3 | + | |
4 | +Angular 2 multiselect dropdown component for web applications. Easy to integrate and use. | |
5 | + | |
6 | + | |
7 | +# [Documentation](http://cuppalabs.github.io/components/multiselectDropdown) | [Demo](https://cuppalabs.github.io/angular2-multiselect-dropdown). | |
8 | + | |
9 | +## Getting Started | |
10 | +### Installation | |
11 | +- The Mutiselect Dropdown package is published on the [npm](https://www.npmjs.com/package/angular2-multiselect-dropdown) Registry. | |
12 | +- Install the package : | |
13 | + `npm install angular2-multiselect-checkbox-dropdown` | |
14 | + | |
15 | +- Once installed import `AngularMultiSelectModule` from the installed package into your module as follows: | |
16 | + | |
17 | +### Usage | |
18 | +Import `AngularMultiSelectModule` into `NgModule` in `app.module.ts` | |
19 | +```js | |
20 | +import { AngularMultiSelectModule } from 'angular2-multiselect-checkbox-dropdown/angular2-multiselect-dropdown'; | |
21 | + | |
22 | +@NgModule({ | |
23 | + // ... | |
24 | + imports: [ | |
25 | + AngularMultiSelectModule, | |
26 | + ] | |
27 | + // ... | |
28 | +}) | |
29 | + | |
30 | +``` | |
31 | + | |
32 | +Declare the component data variables and options in your component where you want to consume the dropdown component. | |
33 | + | |
34 | +```js | |
35 | + | |
36 | +import { Component, OnInit } from '@angular/core'; | |
37 | + | |
38 | +export class AppComponent implements OnInit { | |
39 | + dropdownList = []; | |
40 | + selectedItems = []; | |
41 | + dropdownSettings = {}; | |
42 | + ngOnInit(){ | |
43 | + this.dropdownList = [ | |
44 | + {"id":1,"itemName":"India"}, | |
45 | + {"id":2,"itemName":"Singapore"}, | |
46 | + {"id":3,"itemName":"Australia"}, | |
47 | + {"id":4,"itemName":"Canada"}, | |
48 | + {"id":5,"itemName":"South Korea"}, | |
49 | + {"id":6,"itemName":"Germany"}, | |
50 | + {"id":7,"itemName":"France"}, | |
51 | + {"id":8,"itemName":"Russia"}, | |
52 | + {"id":9,"itemName":"Italy"}, | |
53 | + {"id":10,"itemName":"Sweden"} | |
54 | + ]; | |
55 | + this.selectedItems = [ | |
56 | + {"id":2,"itemName":"Singapore"}, | |
57 | + {"id":3,"itemName":"Australia"}, | |
58 | + {"id":4,"itemName":"Canada"}, | |
59 | + {"id":5,"itemName":"South Korea"} | |
60 | + ]; | |
61 | + this.dropdownSettings = { | |
62 | + singleSelection: false, | |
63 | + text:"Select Countries", | |
64 | + selectAllText:'Select All', | |
65 | + unSelectAllText:'UnSelect All', | |
66 | + enableSearchFilter: true, | |
67 | + classes:"myclass custom-class" | |
68 | + }; | |
69 | + } | |
70 | + onItemSelect(item:any){ | |
71 | + console.log(item); | |
72 | + console.log(this.selectedItems2); | |
73 | + } | |
74 | + OnItemDeSelect(item:any){ | |
75 | + console.log(item); | |
76 | + console.log(this.selectedItems2); | |
77 | + } | |
78 | + onSelectAll(items: any){ | |
79 | + console.log(items); | |
80 | + } | |
81 | + onDeSelectAll(items: any){ | |
82 | + console.log(items); | |
83 | + } | |
84 | +} | |
85 | +``` | |
86 | + | |
87 | +Add the following component tag in you template | |
88 | +```html | |
89 | +<angular2-multiselect [data]="dropdownList" [(ngModel)]="selectedItems" | |
90 | + [settings]="dropdownSettings" | |
91 | + (onSelect)="onItemSelect($event)" | |
92 | + (onDeSelect)="OnItemDeSelect($event)" | |
93 | + [selectedItems]="selectedItems" | |
94 | + (onSelectAll)="onSelectAll($event)" | |
95 | + (onDeSelectAll)="onDeSelectAll($event)"></angular2-multiselect> | |
96 | + | |
97 | +``` | |
98 | + | |
99 | +### Settings | |
100 | +The following list of settings are supported by the component. Configure the settings to meet your requirement. | |
101 | + | |
102 | +| Setting |Type | Description | Default Value | | |
103 | +|:--- |:--- |:--- |:--- | | |
104 | +| singleSelection | Boolean | To set the dropdown for single item selection only. | false | | |
105 | +| text | String | Text to be show in the dropdown, when no items are selected. | 'Select' | | |
106 | +| enableCheckAll | Boolean | Enable the option to select all items in list | false | | |
107 | +| selectAllText | String | Text to display as the label of select all option | Select All | | |
108 | +| unSelectAllText | String | Text to display as the label of unSelect option | UnSelect All | | |
109 | +| enableSearchFilter | Boolean | Enable filter option for the list. | false | | |
110 | +| maxHeight | Number | Set maximum height of the dropdown list in px. | 300 | | |
111 | +| badgeShowLimit | Number | Limit the number of badges/items to show in the input field. If not set will show all selected. | All | | |
112 | +| classes | String | Custom classes to the dropdown component. Classes are added to the dropdown selector tag. To add multiple classes, the value should be space separated class names.| '' | | |
113 | +| limitSelection | Number | Limit the selection of number of items from the dropdown list. Once the limit is reached, all unselected items gets disabled. | none | | |
114 | + | |
115 | +### Callback Methods | |
116 | +- `onSelect` - Return the selected item on selection. | |
117 | + Example : (onSelect)="onItemSelect($event)" | |
118 | +- `onDeSelect` - Return the un-selected item on un-selecting. | |
119 | + Example : (onDeSelect)="OnItemDeSelect($event)" | |
120 | +- `onSelectAll` - Return the list of all selected items. | |
121 | + Example : (onSelectAll)="onSelectAll($event)" | |
122 | +- `onDeSelectAll` - Returns an empty array. | |
123 | + Example : (onDeSelectAll)="onDeSelectAll($event)" | |
124 | + | |
125 | + | |
126 | +## Run locally | |
127 | +- Clone the repository or downlod the .zip,.tar files. | |
128 | +- Run `npm install` | |
129 | +- Run `ng serve` for a dev server | |
130 | +- Navigate to `http://localhost:4200/` | |
131 | + The app will automatically reload if you change any of the source files. | |
132 | + | |
133 | +## License | |
134 | +MIT License. | ... | ... |
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/angular2-multiselect-dropdown.ts
0 โ 100644
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/package.json
0 โ 100644
1 | +{ | |
2 | + "_args": [ | |
3 | + [ | |
4 | + { | |
5 | + "raw": "angular2-multiselect-checkbox-dropdown", | |
6 | + "scope": null, | |
7 | + "escapedName": "angular2-multiselect-checkbox-dropdown", | |
8 | + "name": "angular2-multiselect-checkbox-dropdown", | |
9 | + "rawSpec": "", | |
10 | + "spec": "latest", | |
11 | + "type": "tag" | |
12 | + }, | |
13 | + "D:\\tamil\\angular-projects\\Angular2-AdminLTE-master" | |
14 | + ] | |
15 | + ], | |
16 | + "_from": "angular2-multiselect-checkbox-dropdown@1.4.0", | |
17 | + "_id": "angular2-multiselect-checkbox-dropdown@1.4.0", | |
18 | + "_inBundle": false, | |
19 | + "_inCache": true, | |
20 | + "_integrity": "sha1-eN+iYuqAPvx9x/ctRmRdcCs59Is=", | |
21 | + "_location": "/angular2-multiselect-checkbox-dropdown", | |
22 | + "_nodeVersion": "6.10.3", | |
23 | + "_npmUser": { | |
24 | + "name": "tamilzh", | |
25 | + "email": "tamilzhchelvan@gmail.com" | |
26 | + }, | |
27 | + "_npmVersion": "3.10.10", | |
28 | + "_phantomChildren": {}, | |
29 | + "_requested": { | |
30 | + "type": "version", | |
31 | + "registry": true, | |
32 | + "raw": "angular2-multiselect-checkbox-dropdown@1.4.0", | |
33 | + "name": "angular2-multiselect-checkbox-dropdown", | |
34 | + "escapedName": "angular2-multiselect-checkbox-dropdown", | |
35 | + "rawSpec": "1.4.0", | |
36 | + "saveSpec": null, | |
37 | + "fetchSpec": "1.4.0" | |
38 | + }, | |
39 | + "_requiredBy": [ | |
40 | + "#USER", | |
41 | + "/" | |
42 | + ], | |
43 | + "_resolved": "https://registry.npmjs.org/angular2-multiselect-checkbox-dropdown/-/angular2-multiselect-checkbox-dropdown-1.4.0.tgz", | |
44 | + "_shasum": "78dfa262ea803efc7dc7f72d46645d702b39f48b", | |
45 | + "_shrinkwrap": null, | |
46 | + "_spec": "angular2-multiselect-checkbox-dropdown@1.4.0", | |
47 | + "_where": "F:\\AIAProject\\400-SOURCECODE\\Admin", | |
48 | + "angular-cli": {}, | |
49 | + "bundleDependencies": false, | |
50 | + "dependencies": { | |
51 | + "bootstrap": "*", | |
52 | + "font-awesome": "*" | |
53 | + }, | |
54 | + "deprecated": false, | |
55 | + "description": "[](https://www.npmjs.com/package/angular2-multiselect-dropdown)", | |
56 | + "devDependencies": {}, | |
57 | + "directories": {}, | |
58 | + "dist": { | |
59 | + "shasum": "346520b7512dc677da738bfcc7249045c2e0efde", | |
60 | + "tarball": "https://registry.npmjs.org/angular2-multiselect-checkbox-dropdown/-/angular2-multiselect-checkbox-dropdown-1.0.0.tgz" | |
61 | + }, | |
62 | + "license": "MIT", | |
63 | + "maintainers": [ | |
64 | + { | |
65 | + "name": "tamilzh", | |
66 | + "email": "tamilzhchelvan@gmail.com" | |
67 | + } | |
68 | + ], | |
69 | + "name": "angular2-multiselect-checkbox-dropdown", | |
70 | + "optionalDependencies": {}, | |
71 | + "private": false, | |
72 | + "scripts": { | |
73 | + "e2e": "ng e2e", | |
74 | + "lint": "ng lint", | |
75 | + "ng": "ng", | |
76 | + "start": "ng serve", | |
77 | + "test": "ng test" | |
78 | + }, | |
79 | + "version": "1.4.0" | |
80 | +} | ... | ... |
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/src/app/angular2-multiselect-dropdown/clickOutside.ts
0 โ 100644
1 | +import {Directive, ElementRef, Output, EventEmitter, HostListener} from '@angular/core'; | |
2 | + | |
3 | +@Directive({ | |
4 | + selector: '[clickOutside]' | |
5 | +}) | |
6 | +export class ClickOutsideDirective { | |
7 | + constructor(private _elementRef: ElementRef) { | |
8 | + } | |
9 | + | |
10 | + @Output() | |
11 | + public clickOutside = new EventEmitter<MouseEvent>(); | |
12 | + | |
13 | + @HostListener('document:click', ['$event', '$event.target']) | |
14 | + public onClick(event: MouseEvent, targetElement: HTMLElement): void { | |
15 | + if (!targetElement) { | |
16 | + return; | |
17 | + } | |
18 | + | |
19 | + const clickedInside = this._elementRef.nativeElement.contains(targetElement); | |
20 | + if (!clickedInside) { | |
21 | + this.clickOutside.emit(event); | |
22 | + } | |
23 | + } | |
24 | +} | |
0 | 25 | \ No newline at end of file | ... | ... |
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/src/app/angular2-multiselect-dropdown/list-filter.ts
0 โ 100644
1 | +import { Pipe, PipeTransform } from '@angular/core'; | |
2 | + | |
3 | +import { ListItem } from './multiselect.model'; | |
4 | + | |
5 | +@Pipe({ | |
6 | + name: 'listFilter', | |
7 | + pure: false | |
8 | +}) | |
9 | +export class ListFilterPipe implements PipeTransform { | |
10 | + transform(items: ListItem[], filter: ListItem): ListItem[] { | |
11 | + if (!items || !filter) { | |
12 | + return items; | |
13 | + } | |
14 | + // filter items array, items which match and return true will be kept, false will be filtered out | |
15 | + return items.filter((item: ListItem) => this.applyFilter(item, filter)); | |
16 | + } | |
17 | + | |
18 | + /** | |
19 | + * Perform the filtering. | |
20 | + * | |
21 | + * @param {Book} book The book to compare to the filter. | |
22 | + * @param {Book} filter The filter to apply. | |
23 | + * @return {boolean} True if book satisfies filters, false if not. | |
24 | + */ | |
25 | + applyFilter(item: ListItem, filter: ListItem): boolean { | |
26 | + if (filter.itemName && item.itemName.toLowerCase().indexOf(filter.itemName.toLowerCase()) === -1) { | |
27 | + return false; | |
28 | + } | |
29 | + return true; | |
30 | + } | |
31 | +} | |
0 | 32 | \ No newline at end of file | ... | ... |
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/src/app/angular2-multiselect-dropdown/multiselect.component.html
0 โ 100644
1 | +<div class="cuppa-dropdown" (clickOutside)="closeDropdown()"> | |
2 | + <div class="selected-list"> | |
3 | + <button class="c-btn" (click)="toggleDropdown()"> | |
4 | + <span style="font-weight:bold">{{settings.text}}</span> | |
5 | + <!-- <span *ngIf="selectedItems.length == 0">{{settings.text}}</span> --> | |
6 | + <!-- <span *ngIf="settings.singleSelection"> --> | |
7 | + <!-- <span *ngFor="let item of selectedItems;trackBy: trackByFn;"> --> | |
8 | + <!-- {{item.itemName}} --> | |
9 | + <!-- </span> --> | |
10 | + <!-- </span> --> | |
11 | + <!-- <div class="c-list" *ngIf="selectedItems.length > 0 && !settings.singleSelection"> --> | |
12 | + <!-- <div class="c-token" *ngFor="let item of selectedItems;trackBy: trackByFn;let k = index" [hidden]="k > settings.badgeShowLimit-1"> --> | |
13 | + <!-- <span class="c-label">{{item.itemName}}</span> --> | |
14 | + <!-- <span class="fa fa-remove" (click)="onItemClick(item)"></span> --> | |
15 | + <!-- </div> --> | |
16 | + <!-- </div> --> | |
17 | + <span *ngIf="selectedItems.length > settings.badgeShowLimit">+{{selectedItems.length - settings.badgeShowLimit }}</span> | |
18 | + <span class="fa" [ngClass]="{'fa-angle-down': !isActive,'fa-angle-up':isActive}"></span> | |
19 | + </button> | |
20 | + </div> | |
21 | + <div class="dropdown-list" [hidden]="!isActive"> | |
22 | + <div class="arrow-up"></div> | |
23 | + <div class="list-area"> | |
24 | + <div class="pure-checkbox select-all" *ngIf="settings.enableCheckAll && !settings.singleSelection && !settings.limitSelection" (click)="toggleSelectAll()"> | |
25 | + <input type="checkbox" [checked]="isSelectAll" [disabled]="settings.limitSelection == selectedItems.length"/> | |
26 | + <label style="font-weight:normal"> | |
27 | + <span [hidden]="isSelectAll">{{settings.selectAllText}}</span> | |
28 | + <span [hidden]="!isSelectAll">{{settings.unSelectAllText}}</span> | |
29 | + </label> | |
30 | + </div> | |
31 | + <div class="list-filter" *ngIf="settings.enableSearchFilter"> | |
32 | + <span class="fa fa-search"></span> | |
33 | + <input type="text" placeholder="Search" [(ngModel)]="filter.itemName"> | |
34 | + </div> | |
35 | + <ul [style.maxHeight] = "settings.maxHeight+'px'" style="position:relative"> | |
36 | + <li *ngFor="let item of data | listFilter:filter; let i = index;" (click)="onItemClick(item,i)" class="pure-checkbox"> | |
37 | + <input type="checkbox" [checked]="isSelected(item)" [disabled]="settings.limitSelection == selectedItems.length && !isSelected(item)"/> | |
38 | + <label style="font-weight:normal">{{item.itemName}}</label> | |
39 | + </li> | |
40 | + </ul> | |
41 | + </div> | |
42 | + </div> | |
43 | +</div> | |
0 | 44 | \ No newline at end of file | ... | ... |
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/src/app/angular2-multiselect-dropdown/multiselect.component.scss
0 โ 100644
1 | + | |
2 | +$base-color: #0079FE; | |
3 | + | |
4 | +.cuppa-dropdown{ | |
5 | + position: relative; | |
6 | +} | |
7 | +.c-btn{ | |
8 | + display: inline-block; | |
9 | + background: #fff; | |
10 | + border: 1px solid #ccc; | |
11 | + border-radius: 3px; | |
12 | + font-size: 14px; | |
13 | + color: #333; | |
14 | +} | |
15 | +.c-btn:focus{ | |
16 | + outline: none; | |
17 | + } | |
18 | +.selected-list{ | |
19 | + .c-list{ | |
20 | + float: left; | |
21 | + padding: 0px; | |
22 | + margin: 0px; | |
23 | + .c-token{ | |
24 | + list-style: none; | |
25 | + padding: 0px 5px; | |
26 | + background: $base-color; | |
27 | + color: #fff; | |
28 | + border-radius: 2px; | |
29 | + margin-right: 4px; | |
30 | + float: left; | |
31 | + .c-label{ | |
32 | + display: block; | |
33 | + float: left; | |
34 | + /*width: 50px; | |
35 | + white-space: nowrap; | |
36 | + text-overflow: ellipsis; | |
37 | + overflow: hidden;*/ | |
38 | + } | |
39 | + .fa-remove{ | |
40 | + margin-left: 1px; | |
41 | + font-size: 12px; | |
42 | + } | |
43 | + } | |
44 | + } | |
45 | + .fa-angle-down, .fa-angle-up{ | |
46 | + font-size: 15pt; | |
47 | + position: absolute; | |
48 | + right: 10px; | |
49 | + top: 25%; | |
50 | + } | |
51 | + button{ | |
52 | + width: 100%; | |
53 | + box-shadow: 0px 1px 5px #959595; | |
54 | + padding: 10px; | |
55 | + } | |
56 | +} | |
57 | +.dropdown-list{ | |
58 | + position: absolute; | |
59 | + padding-top: 14px; | |
60 | + width: 100%; | |
61 | + z-index: 9999; | |
62 | + ul{ | |
63 | + padding: 0px; | |
64 | + list-style: none; | |
65 | + overflow: auto; | |
66 | + margin: 0px; | |
67 | + li{ | |
68 | + padding: 10px 10px; | |
69 | + cursor: pointer; | |
70 | + text-align: left; | |
71 | + } | |
72 | + li:first-child{ | |
73 | + padding-top: 10px; | |
74 | + } | |
75 | + li:last-child{ | |
76 | + padding-bottom: 10px; | |
77 | + } | |
78 | + li:hover{ | |
79 | + background: #f5f5f5; | |
80 | + } | |
81 | + } | |
82 | + ul::-webkit-scrollbar{ | |
83 | + width: 8px; | |
84 | + } | |
85 | + ul::-webkit-scrollbar-thumb{ | |
86 | + background: #cccccc; | |
87 | + border-radius: 5px; | |
88 | + } | |
89 | + ul::-webkit-scrollbar-track{ | |
90 | + background: #f2f2f2; | |
91 | + } | |
92 | +} | |
93 | +.arrow-up { | |
94 | + width: 0; | |
95 | + height: 0; | |
96 | + border-left: 13px solid transparent; | |
97 | + border-right: 13px solid transparent; | |
98 | + border-bottom: 15px solid #fff; | |
99 | + margin-left: 15px; | |
100 | + position: absolute; | |
101 | + top: 0; | |
102 | +} | |
103 | +.list-area{ | |
104 | + border: 1px solid #ccc; | |
105 | + border-radius: 3px; | |
106 | + background: #fff; | |
107 | + margin: 0px; | |
108 | + box-shadow: 0px 1px 5px #959595; | |
109 | +} | |
110 | +.select-all{ | |
111 | + padding: 10px; | |
112 | + border-bottom: 1px solid #ccc; | |
113 | + text-align: left; | |
114 | +} | |
115 | +.list-filter{ | |
116 | + border-bottom: 1px solid #ccc; | |
117 | + position: relative; | |
118 | + input{ | |
119 | + border: 0px; | |
120 | + width: 100%; | |
121 | + height: 35px; | |
122 | + padding: 0px 0px 0px 35px; | |
123 | + } | |
124 | + input:focus{ | |
125 | + outline: none; | |
126 | + } | |
127 | + .fa{ | |
128 | + position: absolute; | |
129 | + top: 10px; | |
130 | + left: 13px; | |
131 | + color: #888; | |
132 | + } | |
133 | +} | |
134 | +.pure-checkbox input[type="checkbox"] { | |
135 | + border: 0; | |
136 | + clip: rect(0 0 0 0); | |
137 | + height: 1px; | |
138 | + margin: -1px; | |
139 | + overflow: hidden; | |
140 | + padding: 0; | |
141 | + position: absolute; | |
142 | + width: 1px; | |
143 | +} | |
144 | +.pure-checkbox input[type="checkbox"]:focus + label:before, | |
145 | +.pure-checkbox input[type="checkbox"]:hover + label:before | |
146 | + { | |
147 | + border-color: $base-color; | |
148 | + background-color: #f2f2f2; | |
149 | +} | |
150 | +.pure-checkbox input[type="checkbox"]:active + label:before { | |
151 | + transition-duration: 0s; | |
152 | +} | |
153 | +.pure-checkbox input[type="checkbox"] + label{ | |
154 | + position: relative; | |
155 | + padding-left: 2em; | |
156 | + vertical-align: middle; | |
157 | + user-select: none; | |
158 | + cursor: pointer; | |
159 | + margin: 0px; | |
160 | + color: #000; | |
161 | +} | |
162 | +.pure-checkbox input[type="checkbox"] + label:before{ | |
163 | + box-sizing: content-box; | |
164 | + content: ''; | |
165 | + color: $base-color; | |
166 | + position: absolute; | |
167 | + top: 50%; | |
168 | + left: 0; | |
169 | + width: 14px; | |
170 | + height: 14px; | |
171 | + margin-top: -9px; | |
172 | + border: 2px solid $base-color; | |
173 | + text-align: center; | |
174 | + transition: all 0.4s ease; | |
175 | +} | |
176 | +.pure-checkbox input[type="checkbox"] + label:after{ | |
177 | + box-sizing: content-box; | |
178 | + content: ''; | |
179 | + background-color: $base-color; | |
180 | + position: absolute; | |
181 | + top: 50%; | |
182 | + left: 4px; | |
183 | + width: 10px; | |
184 | + height: 10px; | |
185 | + margin-top: -5px; | |
186 | + transform: scale(0); | |
187 | + transform-origin: 50%; | |
188 | + transition: transform 200ms ease-out; | |
189 | +} | |
190 | +.pure-checkbox input[type="checkbox"]:disabled + label:before{ | |
191 | + border-color: #cccccc; | |
192 | +} | |
193 | +.pure-checkbox input[type="checkbox"]:disabled:focus + label:before | |
194 | +.pure-checkbox input[type="checkbox"]:disabled:hover + label:before{ | |
195 | + background-color: inherit; | |
196 | +} | |
197 | +.pure-checkbox input[type="checkbox"]:disabled:checked + label:before{ | |
198 | + background-color: #cccccc; | |
199 | +} | |
200 | +.pure-checkbox input[type="checkbox"] + label:after{ | |
201 | + background-color: transparent; | |
202 | + top: 50%; | |
203 | + left: 4px; | |
204 | + width: 8px; | |
205 | + height: 3px; | |
206 | + margin-top: -4px; | |
207 | + border-style: solid; | |
208 | + border-color: #ffffff; | |
209 | + border-width: 0 0 3px 3px; | |
210 | + border-image: none; | |
211 | + transform: rotate(-45deg) scale(0); | |
212 | +} | |
213 | +.pure-checkbox input[type="checkbox"]:checked + label:after{ | |
214 | + content: ''; | |
215 | + transform: rotate(-45deg) scale(1); | |
216 | + transition: transform 200ms ease-out; | |
217 | +} | |
218 | +.pure-checkbox input[type="radio"]:checked + label:before{ | |
219 | + animation: borderscale 300ms ease-in; | |
220 | + background-color: white; | |
221 | +} | |
222 | +.pure-checkbox input[type="radio"]:checked + label:after{ | |
223 | + transform: scale(1); | |
224 | +} | |
225 | +.pure-checkbox input[type="radio"] + label:before{ | |
226 | + border-radius: 50%; | |
227 | +} | |
228 | +.pure-checkbox input[type="checkbox"]:checked + label:before{ | |
229 | + animation: borderscale 200ms ease-in; | |
230 | + background: $base-color; | |
231 | +} | |
232 | +.pure-checkbox input[type="checkbox"]:checked + label:after{ | |
233 | + transform: rotate(-45deg) scale(1); | |
234 | +} | |
235 | +@keyframes borderscale { | |
236 | + 50% { | |
237 | + box-shadow: 0 0 0 2px $base-color; | |
238 | + } | |
239 | +} | |
0 | 240 | \ No newline at end of file | ... | ... |
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/src/app/angular2-multiselect-dropdown/multiselect.component.ts
0 โ 100644
1 | +import { Component, OnInit, NgModule, OnChanges, ViewEncapsulation,forwardRef, Input, Output, EventEmitter, ElementRef, AfterViewInit, Pipe, PipeTransform } from '@angular/core'; | |
2 | +import { FormsModule, NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms'; | |
3 | +import { CommonModule } from '@angular/common'; | |
4 | +import { ListItem , MyException} from './multiselect.model'; | |
5 | +import { DropdownSettings } from './multiselect.interface'; | |
6 | +import { ClickOutsideDirective } from './clickOutside'; | |
7 | +import { ListFilterPipe } from './list-filter'; | |
8 | + | |
9 | +export const DROPDOWN_CONTROL_VALUE_ACCESSOR: any = { | |
10 | + provide: NG_VALUE_ACCESSOR, | |
11 | + useExisting: forwardRef(() => AngularMultiSelect), | |
12 | + multi: true | |
13 | +}; | |
14 | +const noop = () => { | |
15 | +}; | |
16 | + | |
17 | +@Component({ | |
18 | + selector:'angular2-multiselect', | |
19 | + templateUrl: './multiselect.component.html', | |
20 | + host: { '[class]' : 'defaultSettings.classes' }, | |
21 | + styleUrls:['./multiselect.component.scss'], | |
22 | + providers: [DROPDOWN_CONTROL_VALUE_ACCESSOR] | |
23 | +}) | |
24 | + | |
25 | +export class AngularMultiSelect implements OnInit, ControlValueAccessor { | |
26 | + | |
27 | + @Input() | |
28 | + data: Array<ListItem>; | |
29 | + | |
30 | + @Input() | |
31 | + settings:DropdownSettings; | |
32 | + | |
33 | + @Output('onSelect') | |
34 | + onSelect: EventEmitter<ListItem> = new EventEmitter<ListItem>(); | |
35 | + | |
36 | + @Output('onDeSelect') | |
37 | + onDeSelect: EventEmitter<ListItem> = new EventEmitter<ListItem>(); | |
38 | + | |
39 | + @Output('onSelectAll') | |
40 | + onSelectAll: EventEmitter<Array<ListItem>> = new EventEmitter<Array<ListItem>>(); | |
41 | + | |
42 | + @Output('onDeSelectAll') | |
43 | + onDeSelectAll: EventEmitter<Array<ListItem>> = new EventEmitter<Array<ListItem>>(); | |
44 | + | |
45 | + @Input() | |
46 | + selectedItems: Array<ListItem>; | |
47 | + | |
48 | + public isActive: boolean = false; | |
49 | + public isSelectAll: boolean = false; | |
50 | + filter: ListItem = new ListItem(); | |
51 | + defaultSettings:DropdownSettings = { | |
52 | + singleSelection: false, | |
53 | + text:'Select', | |
54 | + enableCheckAll: true, | |
55 | + selectAllText: 'Select All', | |
56 | + unSelectAllText: 'UnSelect All', | |
57 | + enableSearchFilter: false, | |
58 | + maxHeight: 300, | |
59 | + badgeShowLimit: 999999999999, | |
60 | + classes:'' | |
61 | + } | |
62 | + constructor(){ | |
63 | + | |
64 | + } | |
65 | + ngOnInit(){ | |
66 | + this.settings = Object.assign(this.defaultSettings, this.settings); | |
67 | + /* this.selectedItems = []; | |
68 | + for(var t=0;t<this.data.length;t++){ | |
69 | + if(this.data[t]){ | |
70 | + this.selectedItems.push(this.data[t]); | |
71 | + } | |
72 | + }*/ | |
73 | + | |
74 | + } | |
75 | + onItemClick(item: ListItem,index){ | |
76 | + | |
77 | + let found = this.isSelected(item); | |
78 | + let limit = this.selectedItems.length < this.settings.limitSelection ? true : false; | |
79 | + | |
80 | + if(!found){ | |
81 | + if(this.settings.limitSelection){ | |
82 | + if(limit){ | |
83 | + this.addSelected(item); | |
84 | + this.onSelect.emit(item); | |
85 | + } | |
86 | + } | |
87 | + else{ | |
88 | + this.addSelected(item); | |
89 | + this.onSelect.emit(item); | |
90 | + } | |
91 | + | |
92 | + } | |
93 | + else{ | |
94 | + this.removeSelected(item); | |
95 | + this.onDeSelect.emit(item); | |
96 | + } | |
97 | + if(this.isSelectAll || this.data.length > this.selectedItems.length){ | |
98 | + this.isSelectAll = false; | |
99 | + } | |
100 | + if(this.data.length == this.selectedItems.length){ | |
101 | + this.isSelectAll = true; | |
102 | + } | |
103 | + } | |
104 | + private onTouchedCallback: () => void = noop; | |
105 | + private onChangeCallback: (_: any) => void = noop; | |
106 | + | |
107 | + writeValue(value: any) { | |
108 | + if (value !== undefined && value !== null) { | |
109 | + if(this.settings.singleSelection){ | |
110 | + try{ | |
111 | + | |
112 | + if(value.length > 1){ | |
113 | + this.selectedItems = [value[0]]; | |
114 | + throw new MyException(404, { "msg": "Single Selection Mode, Selected Items cannot have more than one item." }); | |
115 | + } | |
116 | + else | |
117 | + this.selectedItems = value; | |
118 | + } | |
119 | + catch(e){ | |
120 | + console.error(e.body.msg); | |
121 | + } | |
122 | + | |
123 | + } | |
124 | + else{ | |
125 | + if(this.settings.limitSelection){ | |
126 | + this.selectedItems = value.splice(0,this.settings.limitSelection); | |
127 | + } | |
128 | + else{ | |
129 | + this.selectedItems = value; | |
130 | + } | |
131 | + } | |
132 | + } else { | |
133 | + this.selectedItems = []; | |
134 | + } | |
135 | + } | |
136 | + | |
137 | + //From ControlValueAccessor interface | |
138 | + registerOnChange(fn: any) { | |
139 | + this.onChangeCallback = fn; | |
140 | + } | |
141 | + | |
142 | + //From ControlValueAccessor interface | |
143 | + registerOnTouched(fn: any) { | |
144 | + this.onTouchedCallback = fn; | |
145 | + } | |
146 | + trackByFn(index,item){ | |
147 | + return item.id; | |
148 | + } | |
149 | + isSelected(clickedItem:ListItem){ | |
150 | + let found = false; | |
151 | + this.selectedItems.forEach(item => { | |
152 | + if(clickedItem.id === item.id){ | |
153 | + found = true; | |
154 | + } | |
155 | + }); | |
156 | + return found; | |
157 | + } | |
158 | + addSelected(item: ListItem){ | |
159 | + if(this.settings.singleSelection){ | |
160 | + this.selectedItems = []; | |
161 | + this.selectedItems.push(item); | |
162 | + } | |
163 | + else | |
164 | + this.selectedItems.push(item); | |
165 | + this.onChangeCallback(this.selectedItems); | |
166 | + } | |
167 | + removeSelected(clickedItem: ListItem){ | |
168 | + this.selectedItems.forEach(item => { | |
169 | + if(clickedItem.id === item.id){ | |
170 | + this.selectedItems.splice(this.selectedItems.indexOf(item),1); | |
171 | + } | |
172 | + }); | |
173 | + this.onChangeCallback(this.selectedItems); | |
174 | + } | |
175 | + toggleDropdown(){ | |
176 | + this.isActive = !this.isActive; | |
177 | + //date 8th july2021 :birendra | |
178 | + if(this.data.length == this.selectedItems.length){ | |
179 | + this.isSelectAll = true; | |
180 | + } | |
181 | + if(this.isActive) | |
182 | + { | |
183 | + $('#courseDiv').css("height","340px"); | |
184 | + } | |
185 | + else | |
186 | + { | |
187 | + $('#courseDiv').css("height","40px"); | |
188 | + } | |
189 | + | |
190 | + } | |
191 | + closeDropdown(){ | |
192 | + this.isActive = false; | |
193 | + $('#courseDiv').css("height","40px"); | |
194 | + } | |
195 | + toggleSelectAll(){ | |
196 | + if(!this.isSelectAll){ | |
197 | + this.selectedItems = []; | |
198 | + this.selectedItems = this.data.slice(); | |
199 | + this.isSelectAll = true; | |
200 | + this.onChangeCallback(this.selectedItems); | |
201 | + this.onSelectAll.emit(this.selectedItems); | |
202 | + } | |
203 | + else{ | |
204 | + this.selectedItems = []; | |
205 | + this.isSelectAll = false; | |
206 | + this.onChangeCallback(this.selectedItems); | |
207 | + this.onDeSelectAll.emit(this.selectedItems); | |
208 | + } | |
209 | + } | |
210 | +} | |
211 | + | |
212 | +@NgModule({ | |
213 | + imports: [ CommonModule,FormsModule ], | |
214 | + declarations: [AngularMultiSelect, ClickOutsideDirective, ListFilterPipe], | |
215 | + exports: [AngularMultiSelect, ClickOutsideDirective, ListFilterPipe] | |
216 | +}) | |
217 | +export class AngularMultiSelectModule { } | ... | ... |
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/src/app/angular2-multiselect-dropdown/multiselect.interface.ts
0 โ 100644
1 | +export interface DropdownSettings{ | |
2 | + singleSelection: Boolean; | |
3 | + text: String; | |
4 | + enableCheckAll : Boolean; | |
5 | + selectAllText: String; | |
6 | + unSelectAllText: String; | |
7 | + enableSearchFilter: Boolean; | |
8 | + maxHeight: Number; | |
9 | + badgeShowLimit: Number; | |
10 | + classes: String; | |
11 | + limitSelection?: Number; | |
12 | +} | |
0 | 13 | \ No newline at end of file | ... | ... |
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/src/app/angular2-multiselect-dropdown/multiselect.model.ts
0 โ 100644
400-SOURCECODE/Admin/src/app/angular2-multiselect-checkbox-dropdown/tsconfig.json
0 โ 100644
1 | +{ | |
2 | + "compileOnSave": false, | |
3 | + "compilerOptions": { | |
4 | + "outDir": "./dist/out-tsc", | |
5 | + "baseUrl": "src", | |
6 | + "sourceMap": true, | |
7 | + "declaration": false, | |
8 | + "moduleResolution": "node", | |
9 | + "emitDecoratorMetadata": true, | |
10 | + "experimentalDecorators": true, | |
11 | + "target": "es5", | |
12 | + "typeRoots": [ | |
13 | + "node_modules/@types" | |
14 | + ], | |
15 | + "lib": [ | |
16 | + "es2016", | |
17 | + "dom" | |
18 | + ] | |
19 | + } | |
20 | +} | ... | ... |
400-SOURCECODE/Admin/src/app/app.component.html
400-SOURCECODE/Admin/src/app/app.component.ts
... | ... | @@ -142,7 +142,8 @@ export class AppComponent implements OnInit { |
142 | 142 | userId: this.global.UserId, |
143 | 143 | tagName: tagname, |
144 | 144 | SessionId:this.global.SessionId, |
145 | - isSiteUser:this.global.isSiteUser | |
145 | + isSiteUser:this.global.isSiteUser, | |
146 | + isAdmin:this.global.isAdmin | |
146 | 147 | }).subscribe(status => { |
147 | 148 | //console.log(status); |
148 | 149 | if(status=='False') |
... | ... | @@ -178,4 +179,13 @@ export class AppComponent implements OnInit { |
178 | 179 | //this.router.navigate([this.global.LiveURL]); |
179 | 180 | } |
180 | 181 | |
182 | + changeOfRoutes() | |
183 | + { | |
184 | + //used to hide nevigation on ipad device while nevigate to page | |
185 | + | |
186 | + $('#navbar').removeClass('navbar-collapse collapse in'); | |
187 | + $('#navbar').addClass('navbar-collapse collapse'); | |
188 | + | |
189 | + } | |
190 | + | |
181 | 191 | } | ... | ... |
400-SOURCECODE/Admin/src/app/app.module.ts
... | ... | @@ -16,6 +16,8 @@ import { BsDatepickerModule, ModalModule } from 'ngx-bootstrap'; |
16 | 16 | import { BsModalService } from 'ngx-bootstrap/modal'; |
17 | 17 | import { BsDropdownModule } from 'ngx-bootstrap'; |
18 | 18 | import { Ng2OrderModule } from 'ng2-order-pipe'; //importing the module |
19 | +import { AngularMultiSelectModule } from './angular2-multiselect-checkbox-dropdown/angular2-multiselect-dropdown'; | |
20 | + | |
19 | 21 | |
20 | 22 | //import { ModalModule } from 'ngx-bootstrap/modal'; |
21 | 23 | import { UpdateUserProfile } from './components/userentity/updateuserprofile.component'; |
... | ... | @@ -86,7 +88,7 @@ import { MyFilterPipe } from './shared/my-filter.pipe'; |
86 | 88 | MyFilterPipe |
87 | 89 | ], |
88 | 90 | imports: [ |
89 | - BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule, | |
91 | + BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule,AngularMultiSelectModule, | |
90 | 92 | BsDatepickerModule.forRoot(), ModalModule.forRoot(), BsDropdownModule.forRoot(), Ng2OrderModule,MomentModule,NgIdleKeepaliveModule.forRoot() |
91 | 93 | //ModalModule.forRoot() |
92 | 94 | // , AngularFireModule.initializeApp(firebaseConfig), | ... | ... |
400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts
... | ... | @@ -120,6 +120,11 @@ export class LicenseService{ |
120 | 120 | .map(this.extractData) |
121 | 121 | .catch((res: Response) => this.handleError(res)); |
122 | 122 | } |
123 | + GetLicenseAodCourse(licenseId: number) { | |
124 | + return this.http.get(this.commonService.resourceBaseUrl + "License/GetLicenseAodCourse?LicenseId=" + licenseId) | |
125 | + .map(this.extractData) | |
126 | + .catch((res: Response) => this.handleError(res)); | |
127 | + } | |
123 | 128 | |
124 | 129 | InsertLicense(obj: any) { |
125 | 130 | //let options = new RequestOptions({ headers: this.headers }); |
... | ... | @@ -266,19 +271,35 @@ export class LicenseService{ |
266 | 271 | .catch((res: Response) => this.handleError(res)); |
267 | 272 | } |
268 | 273 | |
269 | - UpdateLicenseModulesStatus(jsonObj: any) { | |
274 | + UpdateLicenseModulesStatus(jsonObj: any,isAodOn:boolean,CourseList:any) { | |
270 | 275 | //let options = new RequestOptions({ headers: this.headers }); |
271 | 276 | var moduleStatusText = ''; |
277 | + var CourseListText = ''; | |
272 | 278 | jsonObj.lstModuleStatus.forEach(element => { |
273 | 279 | moduleStatusText += element.m_Item1 + '-' + element.m_Item2 + '|'; |
274 | 280 | }); |
275 | 281 | if(moduleStatusText != '') { |
276 | 282 | moduleStatusText = moduleStatusText.substr(0, moduleStatusText.length - 1); |
277 | 283 | } |
284 | + | |
285 | + if(isAodOn) | |
286 | + { | |
287 | + CourseList.forEach(element => { | |
288 | + CourseListText += element.CourseId + ',' + element.Status + '|'; | |
289 | + }); | |
290 | + if(CourseListText != '') { | |
291 | + CourseListText = CourseListText.substr(0, CourseListText.length - 1); | |
292 | + } | |
293 | + | |
294 | + } | |
295 | + | |
278 | 296 | var jsonData = { |
279 | 297 | 'licenseId': jsonObj.licenseId, |
280 | - 'moduleStatusText': moduleStatusText | |
298 | + 'moduleStatusText': moduleStatusText, | |
299 | + 'isAodOn':isAodOn, | |
300 | + 'CourseListText':CourseListText | |
281 | 301 | }; |
302 | + | |
282 | 303 | var headers = new Headers({ |
283 | 304 | 'Content-Type': 'application/json' |
284 | 305 | }); | ... | ... |
400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.html
... | ... | @@ -43,41 +43,52 @@ |
43 | 43 | </div> |
44 | 44 | </div> |
45 | 45 | |
46 | - <div class="col-sm-12 padd-left0 padd-right0"> | |
46 | + <div class="col-sm-12 padd-left0 padd-right0" style="height:720px"> | |
47 | 47 | |
48 | 48 | <div class="well"> |
49 | 49 | <div class="row"> |
50 | - <div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3"> | |
50 | + <div class="col-sm-12 col-sm-offset-0 col-md-10 col-md-offset-1 col-lg-10 col-lg-offset-1"> | |
51 | 51 | <div class="panel-body"> |
52 | 52 | <!-- form --> |
53 | - <form class="form-horizontal" [formGroup]="updateModuleSettingsFrm" (submit)="UpdateLicenseModulesStatus(templatesuccess)"> | |
53 | + <form class="form-horizontal" [formGroup]="updateModuleSettingsFrm"> | |
54 | 54 | <div class="form-group" *ngIf="lstModuleStatus!=null"> |
55 | - <label for="inputPassword3" class="col-sm-3 control-label">Module :</label> | |
56 | - <div class="col-sm-9"> | |
55 | + <label for="inputPassword3" class="col-sm-2 col-md-2 col-lg-3 control-label">Module :</label> | |
56 | + <div class="col-sm-10 col-md-8 col-lg-5"> | |
57 | 57 | <div class="row" *ngFor="let item of this.updateModuleSettingsFrm.controls['lstModuleStatus'].value; let i = index"> |
58 | - <div class="col-sm-6"> | |
58 | + <div class="col-sm-7 col-md-8 col-lg-8"> | |
59 | 59 | <span class="help-block">{{item.m_Item3}}</span> |
60 | 60 | </div> |
61 | - | |
62 | - <div class="col-sm-6"> | |
61 | + <div class="col-sm-3 col-md-3 col-lg-3"> | |
63 | 62 | <label class="radio-inline"> |
64 | - <input name="{{item.m_Item3}}" [value]="true" type="radio" [(ngModel)]="item.m_Item2" [ngModelOptions]="{standalone: true}"> On | |
63 | + <input name="{{item.m_Item3}}" [value]="true" type="radio" [(ngModel)]="item.m_Item2" [ngModelOptions]="{standalone: true}" (change)="handleChange(item.m_Item3,item.m_Item2)"> On | |
65 | 64 | </label> |
66 | 65 | <label class="radio-inline"> |
67 | - <input name="{{item.m_Item3}}" [value]="false" type="radio" [(ngModel)]="item.m_Item2" [ngModelOptions]="{standalone: true}"> Off | |
66 | + <input name="{{item.m_Item3}}" [value]="false" type="radio" [(ngModel)]="item.m_Item2" [ngModelOptions]="{standalone: true}" (change)="handleChange(item.m_Item3,item.m_Item2)"> Off | |
68 | 67 | </label> |
69 | 68 | </div> |
69 | + <div id="courseDiv" class="col-sm-10 col-sm-offset-0 col-md-11 col-md-offset-0 col-lg-10 col-lg-offset-0" *ngIf="item.m_Item2==true && item.m_Item1==17"> | |
70 | + <!-- multiselect.component.html page customized from node module 'angular2-multiselect-checkbox-dropdown'--> | |
71 | + <angular2-multiselect [data]="dropdownList" [(ngModel)]="selectedItems" formControlName="courselist" | |
72 | + [settings]="dropdownSettings" | |
73 | + (onSelect)="onItemSelect($event)" | |
74 | + (onDeSelect)="OnItemDeSelect($event)" | |
75 | + (onSelectAll)="onSelectAll($event)" | |
76 | + (onDeSelectAll)="onDeSelectAll($event)"> | |
77 | + </angular2-multiselect> | |
78 | + </div> | |
70 | 79 | </div> |
71 | 80 | </div> |
72 | - </div> | |
73 | - | |
81 | + | |
82 | + </div> | |
83 | + | |
74 | 84 | <div class="row"> |
75 | - <div class="col-sm-12 marginTop20 text-center"> | |
76 | - <button type="submit" class="btn btn-primary btn-sm" [disabled]="LicenseId == 0"><i class="fa fa-check"></i> Save</button> | |
85 | + <div class="col-sm-12 col-md-12 col-lg-12 marginTop20 text-center"> | |
86 | + <button (click)="UpdateLicenseModulesStatus(templatesuccess)" class="btn btn-primary btn-sm" [disabled]="LicenseId == 0"><i class="fa fa-check"></i> Update</button> | |
77 | 87 | </div> |
78 | 88 | </div> |
79 | 89 | </form> |
80 | 90 | <!-- form --> |
91 | + | |
81 | 92 | </div> |
82 | 93 | </div> |
83 | 94 | ... | ... |
400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.ts
... | ... | @@ -25,6 +25,11 @@ export class LicenseModuleSettings implements OnInit { |
25 | 25 | modalRef: BsModalRef; |
26 | 26 | LicenseId:number=0; |
27 | 27 | AccountNumber:string=''; |
28 | + aodModuleStatus: boolean; | |
29 | + aodAllCourseList=[]; | |
30 | + dropdownList = []; | |
31 | + selectedItems = []; | |
32 | + dropdownSettings = {}; | |
28 | 33 | |
29 | 34 | constructor(private _loadingService: LoadingService, private licenseService: LicenseService, |
30 | 35 | public globalService: GlobalService, |
... | ... | @@ -32,8 +37,10 @@ export class LicenseModuleSettings implements OnInit { |
32 | 37 | private modalService: BsModalService, private _confirmService: ConfirmService) { } |
33 | 38 | |
34 | 39 | ngOnInit(): void { |
40 | + this.aodModuleStatus=false; | |
41 | + | |
35 | 42 | this._loadingService.ShowLoading("global-loading"); |
36 | - $('#accountSelect').chosen({allow_single_deselect:true,width:'200px',placeholder_text_single:'Select Account',search_contains:true }); | |
43 | + $('#accountSelect').chosen({allow_single_deselect:true,width:'250px',placeholder_text_single:'Select Account',search_contains:true }); | |
37 | 44 | |
38 | 45 | this.license = new License(); |
39 | 46 | this.alerts = ''; |
... | ... | @@ -41,6 +48,7 @@ export class LicenseModuleSettings implements OnInit { |
41 | 48 | licenseId: [0], |
42 | 49 | accountNumber: [''], |
43 | 50 | lstModuleStatus: [this.fb.array([])], |
51 | + courselist: [] | |
44 | 52 | }); |
45 | 53 | |
46 | 54 | if (this.globalService.UserType > 2) { |
... | ... | @@ -65,9 +73,9 @@ export class LicenseModuleSettings implements OnInit { |
65 | 73 | var selectedText= $(".chosen-single span" ).text(); |
66 | 74 | this.AccountNumberChanged(selectedValue,selectedText); |
67 | 75 | }); |
68 | - | |
76 | + | |
69 | 77 | } |
70 | - | |
78 | + | |
71 | 79 | openModal(template: TemplateRef<any>) { |
72 | 80 | this.modalRef = this.modalService.show(template); |
73 | 81 | } |
... | ... | @@ -91,8 +99,20 @@ export class LicenseModuleSettings implements OnInit { |
91 | 99 | this.licenseService.GetLicenseModulesStatus(this.LicenseId) |
92 | 100 | .subscribe(st => { |
93 | 101 | this.lstModuleStatus = st; |
102 | + var aod= st.filter(item => item.m_Item1 ==17); //aod module | |
103 | + if(aod[0].m_Item2) | |
104 | + { | |
105 | + this.aodModuleStatus=true; | |
106 | + } | |
107 | + | |
94 | 108 | this.updateModuleSettingsFrm.setControl('lstModuleStatus', this.fb.array(this.lstModuleStatus)); |
95 | 109 | this._loadingService.HideLoading("global-loading"); |
110 | + | |
111 | + if(this.aodModuleStatus) | |
112 | + { | |
113 | + this.LoadAODCourseList(); | |
114 | + } | |
115 | + | |
96 | 116 | }, error => this.error = <any>error); |
97 | 117 | } |
98 | 118 | |
... | ... | @@ -101,6 +121,8 @@ export class LicenseModuleSettings implements OnInit { |
101 | 121 | this.lstModuleStatus = null; |
102 | 122 | this.LicenseId=LicenseId; |
103 | 123 | this.AccountNumber=AccountNumber; |
124 | + this.aodModuleStatus=false; | |
125 | + this.aodAllCourseList=[]; | |
104 | 126 | |
105 | 127 | this.updateModuleSettingsFrm.controls['licenseId'].setValue(LicenseId); |
106 | 128 | this.updateModuleSettingsFrm.controls['accountNumber'].setValue(AccountNumber); |
... | ... | @@ -108,6 +130,96 @@ export class LicenseModuleSettings implements OnInit { |
108 | 130 | |
109 | 131 | } |
110 | 132 | |
133 | + LoadAODCourseList() | |
134 | + { | |
135 | + this._loadingService.ShowLoading("global-loading"); | |
136 | + this.aodAllCourseList=[]; | |
137 | + this.dropdownList = []; | |
138 | + this.selectedItems = []; | |
139 | + this.dropdownSettings = { | |
140 | + singleSelection: false, | |
141 | + text:"AOD Courses List", | |
142 | + selectAllText:'Select All', | |
143 | + unSelectAllText:'UnSelect All', | |
144 | + enableSearchFilter: true, | |
145 | + maxHeight:200, | |
146 | + classes:"myclass custom-class" | |
147 | + }; | |
148 | + | |
149 | + this.licenseService.GetLicenseAodCourse(this.LicenseId) | |
150 | + .subscribe(courselist => { | |
151 | + this.aodAllCourseList = courselist; | |
152 | + var selectedCourse= courselist.filter(item => item.Status ==true); //aod module | |
153 | + | |
154 | + for(var i=0;i<this.aodAllCourseList.length;i++) | |
155 | + { | |
156 | + this.dropdownList.push( | |
157 | + {"id":this.aodAllCourseList[i].CourseId.trim(), | |
158 | + "itemName":this.aodAllCourseList[i].CourseName | |
159 | + }) | |
160 | + } | |
161 | + for(var i=0;i<selectedCourse.length;i++) | |
162 | + { | |
163 | + this.selectedItems.push( | |
164 | + {"id":selectedCourse[i].CourseId.trim(), | |
165 | + "itemName":selectedCourse[i].CourseName | |
166 | + }) | |
167 | + } | |
168 | + | |
169 | + this._loadingService.HideLoading("global-loading"); | |
170 | + | |
171 | + }, error => this.error = <any>error); | |
172 | + | |
173 | + } | |
174 | + updateAodCourseItemList(ischached:any,id:any) | |
175 | + { | |
176 | + let itemIndex = this.aodAllCourseList.findIndex(item => item.CourseId ==id); | |
177 | + this.aodAllCourseList[itemIndex].Status = ischached; | |
178 | + } | |
179 | + onItemSelect(item:any){ | |
180 | + // console.log(item); | |
181 | + // console.log(this.selectedItems); | |
182 | + this.updateAodCourseItemList(true,item.id); | |
183 | + } | |
184 | + OnItemDeSelect(item:any){ | |
185 | + // console.log(item); | |
186 | + this.updateAodCourseItemList(false,item.id); | |
187 | + } | |
188 | + onSelectAll(items: any){ | |
189 | + //console.log(items); | |
190 | + //console.log(this.selectedItems); | |
191 | + for(var ind=0;ind<items.length;ind++) | |
192 | + { | |
193 | + this.updateAodCourseItemList(true,items[ind].id); | |
194 | + } | |
195 | + | |
196 | + } | |
197 | + onDeSelectAll(items: any){ | |
198 | + //console.log(items); | |
199 | + //console.log(this.selectedItems); | |
200 | + // console.log(this.dropdownList); | |
201 | + for(var ind=0;ind<this.dropdownList.length;ind++) | |
202 | + { | |
203 | + this.updateAodCourseItemList(false,this.dropdownList[ind].id); | |
204 | + } | |
205 | + } | |
206 | + handleChange(evmoduleName,moduleValue) { | |
207 | + if (evmoduleName=='A.D.A.M. OnDemand') { | |
208 | + if(moduleValue==true) | |
209 | + { | |
210 | + this.aodModuleStatus=true; | |
211 | + if(this.aodAllCourseList.length==0) | |
212 | + { | |
213 | + this.LoadAODCourseList(); | |
214 | + } | |
215 | + } | |
216 | + else | |
217 | + { | |
218 | + this.aodModuleStatus=false; | |
219 | + } | |
220 | + } | |
221 | + } | |
222 | + | |
111 | 223 | AfterUpdateData(data, template) { |
112 | 224 | if (data.Status == "false") { |
113 | 225 | this.alerts = "<span>License module status update unsuccessfull</span>"; |
... | ... | @@ -117,15 +229,24 @@ export class LicenseModuleSettings implements OnInit { |
117 | 229 | this._loadingService.HideLoading("global-loading"); |
118 | 230 | } |
119 | 231 | |
232 | + ErrorUpdateData(Error:any, template) { | |
233 | + this._confirmService.activate("License module update failed.", "alertMsg"); | |
234 | + this._loadingService.HideLoading("global-loading"); | |
235 | + } | |
236 | + | |
120 | 237 | UpdateLicenseModulesStatus(template: TemplateRef<any>) { |
121 | 238 | this.alerts = ''; |
122 | 239 | if (this.alerts == '') { |
123 | 240 | this._loadingService.ShowLoading("global-loading"); |
124 | 241 | var obj = this.updateModuleSettingsFrm.value; |
125 | - return this.licenseService.UpdateLicenseModulesStatus(obj) | |
242 | + return this.licenseService.UpdateLicenseModulesStatus(obj,this.aodModuleStatus,this.aodAllCourseList) | |
126 | 243 | .subscribe( |
127 | - n => (this.AfterUpdateData(n, template)), | |
128 | - error => this.error = <any>error); | |
244 | + n =>{ | |
245 | + this.AfterUpdateData(n, template) | |
246 | + }, | |
247 | + error =>{ | |
248 | + this.ErrorUpdateData(error, template) | |
249 | + }); | |
129 | 250 | } |
130 | 251 | } |
131 | 252 | ... | ... |
400-SOURCECODE/Admin/src/app/components/UserEntity/user.service.ts
... | ... | @@ -56,7 +56,7 @@ export class UserService { |
56 | 56 | |
57 | 57 | //////////Manage UserLogin Status/////////// |
58 | 58 | ManageUserLoginStatus(obj: any) { |
59 | - var jsonData = { 'userId': obj.userId, 'tagName': obj.tagName,'SessionId': obj.SessionId,'isSiteUser': obj.isSiteUser }; | |
59 | + var jsonData = { 'userId': obj.userId, 'tagName': obj.tagName,'SessionId': obj.SessionId,'isSiteUser': obj.isSiteUser,'isAdmin': obj.isAdmin }; | |
60 | 60 | console.log(obj); |
61 | 61 | var headers = new Headers({ |
62 | 62 | 'Content-Type': 'application/json' | ... | ... |
400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
... | ... | @@ -408,7 +408,9 @@ export class UsersList implements OnInit, AfterViewChecked { |
408 | 408 | this.userservice.ManageUserLoginStatus({ |
409 | 409 | userId: this.selectedId, |
410 | 410 | tagName: 'adminlogout', |
411 | - SessionId:this.global.SessionId | |
411 | + SessionId:this.global.SessionId, | |
412 | + isSiteUser:this.global.isSiteUser, | |
413 | + isAdmin:this.global.isAdmin | |
412 | 414 | }).subscribe(x => { |
413 | 415 | console.log(x); |
414 | 416 | this.EditbuttonStatus=undefined; | ... | ... |
400-SOURCECODE/Admin/src/app/shared/global.ts
... | ... | @@ -29,6 +29,7 @@ export class GlobalService { |
29 | 29 | aiaPingInterval:number=0; |
30 | 30 | SessionId:number=0; |
31 | 31 | isSiteUser:boolean=false; |
32 | + isAdmin:boolean=false; | |
32 | 33 | RemoveColumns: Array<string> = ["Serial_No", "LicenseId","RowNum"] |
33 | 34 | error; |
34 | 35 | public href: string = ""; |
... | ... | @@ -41,7 +42,7 @@ export class GlobalService { |
41 | 42 | var newsessionid = date.getTime();//timestamp is the number of milliseconds that have passed since January 1, 1970 |
42 | 43 | localStorage.setItem('loggedInUserDetails', JSON.stringify( |
43 | 44 | { |
44 | - "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016","aiaIdleTime": 300,"aiaIdleTimeOut": 30,"aiaPingInterval": 10,"SessionId":newsessionid,"isSiteUser":false, "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": { "Id": 0, "AccountNumber": "AIAS000319" }, "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null | |
45 | + "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016","aiaIdleTime": 300,"aiaIdleTimeOut": 30,"aiaPingInterval": 10,"SessionId":newsessionid,"isSiteUser":false,"isAdmin":true, "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": { "Id": 0, "AccountNumber": "AIAS000319" }, "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null | |
45 | 46 | })); |
46 | 47 | } |
47 | 48 | |
... | ... | @@ -57,6 +58,7 @@ export class GlobalService { |
57 | 58 | this.aiaPingInterval=this.loggedInUser.aiaPingInterval; |
58 | 59 | this.SessionId=this.loggedInUser.SessionId; |
59 | 60 | this.isSiteUser=this.loggedInUser.isSiteUser; |
61 | + this.isAdmin=this.loggedInUser.LicenseId==0?true:false;; | |
60 | 62 | |
61 | 63 | } |
62 | 64 | ... | ... |