Commit 7be3b80d931ffa5cb3c4e642d13f413cbbfc7237
1 parent
3d3c8514
Export image bug fixed for new license
Showing
1 changed file
with
75 additions
and
79 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -364,106 +364,102 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
364 | 364 | $location.path('/'); |
365 | 365 | |
366 | 366 | } |
367 | - else { | |
368 | - if (result.LicenseInfo != null && result.LicenseInfo.IsTermAccepted) | |
369 | - { | |
370 | - | |
367 | + else | |
368 | + { | |
369 | + //1. set haveRoleAdmin = false because LicenseInfo is not null | |
370 | + | |
371 | + if (result.LicenseTypeId != 5) { | |
372 | + | |
373 | + $rootScope.haveRoleAdmin = true; | |
374 | + | |
375 | + } | |
376 | + if (result.UserTypeId == 8) { | |
377 | + | |
378 | + $rootScope.haveRoleAdmin = false; | |
379 | + } | |
380 | + | |
381 | + // Remove Admin Link for LicenseEditionId 3/4 of student | |
382 | + if (result.EditionId == 3 || result.EditionId == 4) { | |
383 | + $rootScope.haveRoleAdmin = false; | |
384 | + | |
385 | + } | |
386 | + | |
387 | + if (result.LicenseInfo != null) { | |
388 | + | |
371 | 389 | // set license id |
372 | - $scope.UpdateUserExportImageData(result.Id,'LicenseId',result.LicenseId) | |
390 | + $scope.UpdateUserExportImageData(result.Id, 'LicenseId', result.LicenseId) | |
373 | 391 | |
374 | - // set license type :note 5 for demo/test license | |
375 | - $scope.UpdateUserExportImageData(result.Id,'LicenseTypeId',result.LicenseInfo.LicenseTypeId); | |
376 | - | |
377 | - if(result.UserExportImageDetail!=null) | |
378 | - { | |
392 | + // set license type :note 5 for demo/test license | |
393 | + $scope.UpdateUserExportImageData(result.Id, 'LicenseTypeId', result.LicenseInfo.LicenseTypeId); | |
394 | + | |
395 | + if (result.UserExportImageDetail != null) { | |
379 | 396 | // set already export image count |
380 | - $scope.UpdateUserExportImageData(result.Id,'CountExportImage',result.UserExportImageDetail.CountExportedImage); | |
381 | - | |
382 | - // set Image limit | |
383 | - $scope.UpdateUserExportImageData(result.Id,'ExptImageLimit',result.UserExportImageDetail.ExptImageLimit); | |
397 | + $scope.UpdateUserExportImageData(result.Id, 'CountExportImage', result.UserExportImageDetail.CountExportedImage); | |
384 | 398 | |
385 | - // set is enable for export image | |
386 | - $scope.UpdateUserExportImageData(result.Id,'isExportImage',result.UserExportImageDetail.isExportImage); | |
387 | - } | |
388 | - | |
389 | - | |
390 | - // disable export image option for demo and for cross the Image limit | |
391 | - if(result.LicenseInfo.LicenseTypeId==5 || result.UserExportImageDetail.isExportImage==false) | |
392 | - { | |
393 | - $rootScope.exportImage = "disableSubMenu"; | |
394 | - } | |
399 | + // set Image limit | |
400 | + $scope.UpdateUserExportImageData(result.Id, 'ExptImageLimit', result.UserExportImageDetail.ExptImageLimit); | |
395 | 401 | |
396 | - //0. | |
397 | - $rootScope.userData = result; | |
398 | - $rootScope.userModules = result.Modules; | |
399 | - | |
400 | - //1. set haveRoleAdmin = false because LicenseInfo is not null | |
401 | - | |
402 | - if (result.LicenseTypeId != 5 ) { | |
402 | + // set is enable for export image | |
403 | + $scope.UpdateUserExportImageData(result.Id, 'isExportImage', result.UserExportImageDetail.isExportImage); | |
404 | + } | |
403 | 405 | |
404 | - $rootScope.haveRoleAdmin = true; | |
405 | 406 | |
406 | - } | |
407 | - if (result.UserTypeId == 8) | |
408 | - { | |
409 | - | |
410 | - $rootScope.haveRoleAdmin = false; | |
407 | + // disable export image option for demo and for cross the Image limit | |
408 | + if (result.LicenseInfo.LicenseTypeId == 5 || result.UserExportImageDetail.isExportImage == false) { | |
409 | + $rootScope.exportImage = "exportImage"; | |
411 | 410 | } |
412 | 411 | |
413 | - // Remove Admin Link for LicenseEditionId 3/4 of student | |
414 | - if(result.EditionId==3 ||result.EditionId==4) | |
415 | - { | |
416 | - $rootScope.haveRoleAdmin = false; | |
417 | 412 | |
418 | - } | |
413 | + if (result.LicenseInfo.IsTermAccepted) { | |
419 | 414 | |
420 | - $("#modestyDiv").css("pointer-events", "none"); | |
421 | - $("#modestyDiv").css("opacity", 0.5); | |
422 | - //2. | |
423 | - if ($scope.currentUserDetails == null || $scope.currentUserDetails == undefined || $scope.currentUserDetails == "") { | |
415 | + //0. | |
416 | + $rootScope.userData = result; | |
417 | + $rootScope.userModules = result.Modules; | |
424 | 418 | |
425 | - localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | |
426 | - } | |
419 | + $("#modestyDiv").css("pointer-events", "none"); | |
420 | + $("#modestyDiv").css("opacity", 0.5); | |
421 | + //2. | |
422 | + if ($scope.currentUserDetails == null || $scope.currentUserDetails == undefined || $scope.currentUserDetails == "") { | |
427 | 423 | |
428 | - // 3.ShowAssignedModulesPopup | |
429 | - //isCommingSoonModel =true only when user comes first time on application and login | |
430 | - if (isCommingSoonModel == true) | |
431 | - { | |
424 | + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | |
425 | + } | |
432 | 426 | |
433 | - // ShowAssignedModulesPopup(result.Modules); | |
434 | - } | |
427 | + // 3.ShowAssignedModulesPopup | |
428 | + //isCommingSoonModel =true only when user comes first time on application and login | |
429 | + if (isCommingSoonModel == true) { | |
435 | 430 | |
436 | - //4. | |
437 | - if($scope.rememberChk) | |
438 | - { | |
439 | - | |
440 | - $scope.saveRemeberMeDetails(result, userInfo); | |
441 | - } | |
442 | - | |
443 | - //5. | |
431 | + // ShowAssignedModulesPopup(result.Modules); | |
432 | + } | |
433 | + | |
434 | + //4. | |
435 | + if ($scope.rememberChk) { | |
436 | + | |
437 | + $scope.saveRemeberMeDetails(result, userInfo); | |
438 | + } | |
439 | + | |
440 | + //5. | |
444 | 441 | sessionStorage.setItem("loginSession", "true"); |
445 | 442 | $rootScope.isVisibleLogin = false; |
446 | - | |
447 | - //6. reset the isCommingSoonModel to false in local storage so that upcomming module pop up would not show again to the user after firts time | |
443 | + | |
444 | + //6. reset the isCommingSoonModel to false in local storage so that upcomming module pop up would not show again to the user after firts time | |
448 | 445 | localStorage.setItem('isCommingSoonModel', false); |
449 | - | |
450 | - $location.path('/'); | |
451 | 446 | |
452 | - } | |
453 | - else { | |
454 | - if ($('#dvTerms').length > 0) { | |
455 | - $('#dvTerms').html(result.TermsAndConditionsText); | |
447 | + $location.path('/'); | |
456 | 448 | } |
457 | - $rootScope.isVisibleLogin = true; | |
458 | - $('#dvTermCondition').fadeIn(); | |
459 | - $rootScope.userData = result; | |
460 | - $rootScope.haveRoleAdmin = false; | |
461 | - localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | |
462 | - $location.path('/'); | |
449 | + else { | |
450 | + if ($('#dvTerms').length > 0) { | |
451 | + $('#dvTerms').html(result.TermsAndConditionsText); | |
452 | + } | |
453 | + $rootScope.isVisibleLogin = true; | |
454 | + $('#dvTermCondition').fadeIn(); | |
455 | + $rootScope.userData = result; | |
456 | + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); | |
457 | + $location.path('/'); | |
458 | + } | |
459 | + | |
463 | 460 | } |
464 | - } | |
465 | - | |
466 | - | |
461 | + | |
462 | + } | |
467 | 463 | |
468 | 464 | } |
469 | 465 | ... | ... |