var Bizgaze; (function (Bizgaze) { let Apps; (function (Apps) { let Support; (function (Support) { let Components; (function (Components) { class AllocatedTo extends Unibase.Platform.Core.BaseComponent { jsFiles() { return ['libs/parsley/parsley.min.js', 'apps/support/managers/supportmanager.js', 'apps/support/managers/supportmanager.js', 'tenants/themes/compact/components/details/details.js']; } cssFiles() { return []; } html() { let html = '
'; return html; } load(id, containerid, callback) { var instance = this; instance.loadUsers(); } loadUsers() { var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId; let ticketgroupid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_ticketgroupid").Value; var url = _appsettings.server_url() + '/apis/v4/bizgaze/support/tickets/getroleticketgroups/ticketgroupid/' + ticketgroupid; AutoCompleteHelper.getHelper().Create("#txt_AllocatedName", "#hf_AllocatedId", url, function (result) { }); $("#btn_CloseAllocate").click(function () { Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp(); }); $("#btn_SaveAllocate").click(function () { if ($("#txt_AllocatedName").val() != null) { Bizgaze.Apps.Support.Components.AllocatedTo.Instance().save(); } else { $("#div_AllocatedTo").addClass("form-group-required"); MessageHelper.Instance().showError("Please Select Contact", 'bizgaze_ValidationSummary'); } }); let allocatedid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_allocatedto").Value; let allocatedtoname = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_allocatedtoname").Value; var selectedAllocatetoname = new Option(allocatedtoname, allocatedid, true); if (selectedAllocatetoname.value != "0") { $("#txt_AllocatedName").append(selectedAllocatetoname); $("#hf_AllocatedId").val(allocatedid); } } save() { var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId; Bizgaze.Apps.Support.Managers.SupportManager.Instance().UpdateAllocate(Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_ticketid").Value), $("#hf_AllocatedId").val()).then(function () { Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp(); var detailobj = Unibase.Themes.Compact.Components.Details.Instance(); detailobj._recordId = Unibase.Themes.Providers.DetailHelper.recordId; detailobj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId; detailobj._containerId = $("._bizgaze_detail_container:visible").attr("id"); var idetailObj = detailobj; detailobj.loadPortlets(idetailObj); MessageHelper.Instance().showSuccess("User Allocated Successfully", ''); }); } static Instance() { if (this.instance === undefined) { this.instance = new Bizgaze.Apps.Support.Components.AllocatedTo(); } return this.instance; } } Components.AllocatedTo = AllocatedTo; })(Components = Support.Components || (Support.Components = {})); })(Support = Apps.Support || (Apps.Support = {})); })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {})); })(Bizgaze || (Bizgaze = {}));