Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let Common;
  6. (function (Common) {
  7. let Components;
  8. (function (Components) {
  9. class Tenant {
  10. updateTenant() {
  11. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  12. var userInfo = Unibase.Platform.Membership.Infos.Identity.getCurrentUser();
  13. var uri = window.location.href;
  14. uri = uri.slice(0, uri.lastIndexOf('#'));
  15. $("#DetailSetting_" + InstalledAppId + "_UpdateTenant").addClass('btn-success');
  16. $("#DetailSetting_" + InstalledAppId + "_UpdateTenant").click(function () {
  17. var postData = {
  18. TenantId: userInfo.tenantId,
  19. BaseUri: uri
  20. };
  21. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/common/managers/commonmanager.js", function () {
  22. Unibase.Platform.Common.Managers.CommonManager.Instance().updateTenant(postData).then(function (response) {
  23. if (response.status == Unibase.Data.Status.Error) {
  24. MessageHelper.Instance().showError(response.message, "div_message");
  25. }
  26. else {
  27. MessageHelper.Instance().showSuccess(response.message, "div_message");
  28. }
  29. });
  30. });
  31. });
  32. }
  33. switchTenant(tenantId) {
  34. var unibaseId = Unibase.Platform.Membership.Infos.Identity.getCurrentUser().unibaseId;
  35. Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFile("platform/common/managers/commonmanager.js", function () {
  36. Unibase.Platform.Common.Managers.CommonManager.Instance().setTenantAsDefault(tenantId, unibaseId).then(function (response) {
  37. if (response.status == Unibase.Data.Status.Error) {
  38. MessageHelper.Instance().showError(response.message, "div_message");
  39. }
  40. else {
  41. MessageHelper.Instance().showSuccess(response.message, "div_message");
  42. var obj = Unibase.Themes.Compact.Components.Details.Instance();
  43. obj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
  44. obj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  45. Unibase.Themes.Compact.Components.Details.Instance().loadPortlets(obj);
  46. }
  47. });
  48. });
  49. }
  50. static Instance() {
  51. if (this.instance === undefined) {
  52. this.instance = new Tenant();
  53. }
  54. return this.instance;
  55. }
  56. }
  57. Components.Tenant = Tenant;
  58. })(Components = Common.Components || (Common.Components = {}));
  59. })(Common = Platform.Common || (Platform.Common = {}));
  60. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  61. })(Unibase || (Unibase = {}));