1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- 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 = '<form id="frm_BizgazeSupport_AllocatedTo" method="post" data-validate="parsley" class="w-f bg-white"><div class="bg-white b-b modal-header pa-10"><strong id="">Allocated To</strong></div><div style="height: 627px; overflow: hidden auto;" class="simple-scroll-bar modal-body bg-cyan-light-5"><div id = "bizgaze_ValidationSummary" class="clear" > </div><div class="card"><div class="card-body"><div class="floating-label-form-group-with-value" id="div_AllocatedTo"><label for="lbl_AllocatedId">Allocated To <span class="text-danger"> *</span></label ><select style="width:100%" id = "txt_AllocatedName" class="form-control value-control floating-label-control required" data-isdynamic="false" /><input type="hidden" id = "hf_AllocatedId"/><label for= "Validation" id = "lblValidation_AllocatedTo"></label><input type="hidden" id="hfFormPropertyId"/></div></div></div></div><div class="b-t bg-white modal-footer pa-10"><a href="javascript:;" id="btn_CloseAllocate" class="btn btn-light btn-sm mr-auto">Close</a><a href= "javascript:;" id = "btn_SaveAllocate" class="btn_SaveAllocate btn btn-primary btn-sm">Save</a></div></form>';
- 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 = {}));
|