var Unibase; (function (Unibase) { let Platform; (function (Platform) { let Membership; (function (Membership) { let Components; (function (Components) { class PopupDetails extends Platform.Core.BaseComponent { init(containerid) { let instance = this; instance.load(null, containerid, null); } loadPopupDetails(containerid) { let instance = this; let invisible = "d-none"; if (Unibase.Themes.Compact.Components.Index.Instance().isIframeObj.isDetailsPage) { invisible = ''; } let html = `
`; $('#' + containerid).html(html); $("#activity_comment_btn").click(function () { $(".comments_section").removeClass("d-none"); }); } loadDetailsIfrme() { let instance = this; } loadDetailsForPopup(Pk_Value, installedappid, message, formid, appconfigid) { let instance = this; if (message != null) { $(".popupDetailsModal").find(".responseMessage").html(message); } if ((formid != null || formid != undefined) && (appconfigid != null || appconfigid != undefined)) { let onclickbtn = `Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(` + formid + `, 0, ` + appconfigid + `, 0, null)`; $("#popupdetails_btn_CreateTask").attr("onclick", onclickbtn); } var fromDate = ""; var toDate = ""; var cf_fromDate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate; var cf_toDate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate; if (cf_fromDate != null && cf_toDate != null) { fromDate = cf_fromDate.toString(); toDate = cf_toDate.toString(); } var expObj = { InstalledAppId: installedappid, RecordId: Pk_Value, FromDate: fromDate, ToDate: toDate }; instance.fileCacheHelper.loadJsFile("platform/widgets/managers/widgetmanager.js", function () { Unibase.Platform.Widgets.Managers.WidgetManager.Instance().getDefaultWidget(expObj).then(function (response) { let data1 = response.result.Data; let template = response.result.TemplateText; let model = JSON.parse(data1); let containerId = Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId(); let formData = response.result.AppConfigurations.filter(function (o) { return o.SettingUrlType == 1; })[0]; let editformbtn = `Unibase.Platform.Helpers.NavigationHelper.Instance().loadForm(` + formData.FormId + `, ` + model[0].pk_id + `, ` + formData.AppConfigurationId + `, 0, null)`; $('#' + containerId).find(".popup-Edit-Form").attr("onclick", editformbtn); $('#' + containerId).on('click', function () { window.parent.postMessage('Edit-Form', '*'); }); let html = '', stagehtml = ''; for (var i = 0; i < response.result.Stages.length; i++) { let data = response.result.Stages[i]; if (data.IsDefault) { stagehtml += ``; } if (Unibase.Platform.Membership.Infos.Identity.getCurrentUser().isAdmin) { html += `${data.StageName}`; } else { if (data.ChangeAll && data.StageRoles == null) { html += `${data.StageName}`; } if (data.StageRoles != null && data.StageRoles.length != 0) { for (var j = 0; j < data.StageRoles.length; j++) { if (data.ChangeAll && (!data.StageRoles[j].ExcludeChangeRole)) { html += `${data.StageName}`; } } } if (data.ChangeAll == false && data.StageRoles != null && data.StageRoles.length > 0) { html += `${data.StageName}`; } } } $('#' + containerId).find('.div_details_stages').html(`${stagehtml} `); let inptParamter = JSON.parse(response.result.Data)[0]; Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters = []; for (const property in inptParamter) { Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.push({ Key: "hf_" + installedappid + "_" + property.toLowerCase(), Value: inptParamter[property], DataType: typeof (inptParamter[property]) }); } Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.push({ Key: "hf_" + installedappid + "_" + "recordid", Value: Pk_Value.toString(), DataType: typeof (Pk_Value) }); instance.fileCacheHelper.loadJsFile("platform/core/helpers/token/tokenhelper.js", function () { let htmlcontent = Unibase.Core.Helpers.TokenHelper.Instance().replace(template, model[0]); $('#' + containerId).find(".popupdetails_app_defaultwidget").html(htmlcontent); $('#' + containerId).find(".popupdetails_app_defaultwidget .biz-detail-avatar").remove(); if ($('#' + containerId).find(".popupdetails_app_defaultwidget .biz-header-sub-text").hasClass("d-flex")) { $('#' + containerId).find(".popupdetails_app_defaultwidget .biz-header-sub-text").addClass("flex-column").removeClass("flex-row flex-wrap"); $('#' + containerId).find(".popupdetails_app_defaultwidget .biz-header-sub-text .fa-rupee").addClass("font-10"); } $('#' + containerId).find(".popupdetails_app_defaultwidget .app_defaultwidget").find(".ml-2").removeClass("ml-2"); $('#' + containerId).find(".popupdetails_app_defaultwidget .app_defaultwidget").find(".d-none.d-sm-block").removeClass("d-none d-sm-block"); }); var obj = Unibase.Themes.Compact.Components.Details.Instance(); if (response.status != Unibase.Data.Status.Error) { if (response.result != null) { var data = response.result.Data; var templatetext = response.result.TemplateText; var stages = response.result.Stages; var installedappinfo = response.result.InstalledApp; var statusinfo = response.result.Status; var permission = response.result.EditScreenPermission; if (data != null && data != "") { if (templatetext != null) { var icon = ''; if (response.result.AppConfigurations.length > 0) { var confightml = ""; $('#popupDetailsModal').find('.div_detailconfigurations_headerbtns').html(''); var appconfigurations = response.result.AppConfigurations; for (var i = 0; i < appconfigurations.length; i++) { if (appconfigurations[i].AppConfigType == Unibase.Platform.Apps.Enums.AppConfigeType.DetailSetting) { instance.settingsURL = appconfigurations[i].SettingUrl; instance.functionURL = appconfigurations[i].JsFunction; confightml = ""; var onclickurl = ""; var settingname = appconfigurations[i].SettingName; var description = appconfigurations[i].Description; var sname = settingname.replace(/ /g, ''); if (description != null && description != "" && description != undefined) { description = appconfigurations[i].Description; } else { description = appconfigurations[i].SettingName; } icon = appconfigurations[i].Icon; if (appconfigurations[i].SettingUrlType == Unibase.Platform.Apps.Enums.SettingUrlType.Form && appconfigurations[i].AppConfigType == Unibase.Platform.Apps.Enums.AppConfigeType.DetailSetting) { onclickurl = "onclick='Unibase.Platform.Helpers.NavigationHelper.Instance().loadDetailSettingForm(" + appconfigurations[i].FormId + ", " + obj._recordId + ", " + appconfigurations[i].AppConfigurationId + ")'"; } if (appconfigurations[i].SettingUrlType == Unibase.Platform.Apps.Enums.SettingUrlType.JsFunction) { onclickurl = ""; } if (appconfigurations[i].Icon != null && appconfigurations[i].Icon != "null" && appconfigurations[i].Icon != "") { confightml += '' + data[i].Body + '
' + confirmtext + '' + '' + rejecttext + 'Close' + '