Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

userlockunlockstatus.js 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let InviteUsers;
  6. (function (InviteUsers) {
  7. let Components;
  8. (function (Components) {
  9. class UserLockUnLockStatus extends Platform.Core.BaseComponent {
  10. cssFiles() {
  11. return [];
  12. }
  13. jsFiles() {
  14. return ['platform/membership/managers/accountmanager.js'];
  15. }
  16. html(id, containerid) {
  17. let html = ``;
  18. return html;
  19. }
  20. load(id, containerid, callback) {
  21. }
  22. init(containerid) {
  23. var instance = this;
  24. instance.fileCacheHelper.loadJsFile("platform/membership/managers/accountmanager.js", function () {
  25. Unibase.Platform.Membership.Managers.AccountManager.Instance();
  26. instance.render(containerid);
  27. });
  28. }
  29. render(containerid) {
  30. var instance = this;
  31. let html = `<div class="invite-section-container" id="invitesection_div">
  32. <div class="" id="UserLockStatusDiv" >
  33. <div class="card invite-card">
  34. <div class="card-header border-1">
  35. <span class="biz-highlight-bg-color">Lock &amp; UnLock</span>
  36. </div>
  37. <div class="card-body bg-white px-20 py-5">
  38. <div class="row my-sm-2">
  39. <div class="col-6 my-2 ">
  40. <button
  41. class="btn btn-outline-red rounded-4 font-14 p-3 text-left" onclick='' id="btnChangeLockStatus"><i
  42. class="fa fa-lock mr-5 font-18"></i>
  43. Lock User</button>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="col-12 p-0" id="UserUnLockStatusDiv">
  50. <div class="card">
  51. <div class="card-header border-1">
  52. <span class="biz-highlight-bg-color">Lock &amp; UnLock</span>
  53. </div>
  54. <div class="card-body px-20 py-5" >
  55. <div class="row my-sm-2">
  56. <div class="col-6 my-2 ">
  57. <button
  58. class="btn btn-outline-green rounded-4 font-14 p-3 text-left font-weight-500" id="btnChangeUnLockStatus"><i
  59. class="fa fa-unlock-alt font-18 mr-5"></i>
  60. UnLock</button>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. `;
  68. $("." + containerid).append(html);
  69. instance.loadDetails();
  70. }
  71. loadDetails() {
  72. $("#UserUnLockStatusDiv").hide();
  73. let instance = this;
  74. $("#btnChangeLockStatus").click(function () {
  75. var status = "Lock";
  76. let tenantid = Unibase.Platform.Membership.Infos.Identity.currentUser.tenantId;
  77. bootbox.confirm("User gets " + status + " Are you sure?", function (result) {
  78. if (result) {
  79. Unibase.Platform.Membership.Managers.AccountManager.Instance().ChangeUsersLockStatus(status, tenantid).then(function (response) {
  80. MessageHelper.Instance().showSuccess(response.message, '');
  81. $("#UserLockStatusDiv").hide();
  82. $("#UserUnLockStatusDiv").show();
  83. });
  84. }
  85. });
  86. });
  87. $("#btnChangeUnLockStatus").click(function () {
  88. var status = "UnLock";
  89. let tenantid = Unibase.Platform.Membership.Infos.Identity.currentUser.tenantId;
  90. bootbox.confirm("User gets " + status + " Are you sure?", function (result) {
  91. if (result) {
  92. Unibase.Platform.Membership.Managers.AccountManager.Instance().ChangeUsersLockStatus(status, tenantid).then(function (response) {
  93. MessageHelper.Instance().showSuccess(response.message, '');
  94. $("#UserUnLockStatusDiv").hide();
  95. $("#UserLockStatusDiv").show();
  96. });
  97. }
  98. });
  99. });
  100. instance.LockDetails();
  101. }
  102. LockDetails() {
  103. let instance = this;
  104. let status = "";
  105. let tenantid = Unibase.Platform.Membership.Infos.Identity.currentUser.tenantId;
  106. Unibase.Platform.Membership.Managers.AccountManager.Instance().ValidateUsersLockStatus(tenantid).then(function (response) {
  107. if (response != undefined && response.toString() == "Lock") {
  108. instance.lockstatus = 'Lock';
  109. $("#UserLockStatusDiv").hide();
  110. $("#UserUnLockStatusDiv").show();
  111. }
  112. else if (response != undefined && response.toString() == "UnLock") {
  113. instance.lockstatus = 'Un-Lock';
  114. $("#UserUnLockStatusDiv").hide();
  115. $("#UserLockStatusDiv").show();
  116. }
  117. });
  118. }
  119. static Instance() {
  120. if (this.instance === undefined) {
  121. this.instance = new UserLockUnLockStatus();
  122. }
  123. return this.instance;
  124. }
  125. }
  126. Components.UserLockUnLockStatus = UserLockUnLockStatus;
  127. })(Components = InviteUsers.Components || (InviteUsers.Components = {}));
  128. })(InviteUsers = Platform.InviteUsers || (Platform.InviteUsers = {}));
  129. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  130. })(Unibase || (Unibase = {}));