1 |
- var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(i){class r extends t.Core.BaseComponent{jsFiles(){return["platform/portlets/managers/portletmanager.js","platform/permission/managers/permissionmanager.js","platform/widgets/managers/widgetmanager.js","platform/portlets/requests/portlet.js","platform/permission/managers/permissionmanager.js","platform/widgets/requests/widgetrole.js","platform/portlets/requests/portletrole.js","platform/widgets/components/widgetpermission.js"]}cssFiles(){return[]}html(){return'<div id="divWidgetPermissions"> <header class="header bg-light"> <input type="hidden" id="hfApplyType" value="" /> <strong><span class="permissionHeading"><\/span><span class="portletname"><\/span><\/strong> <\/header> <div class="scrollable"><div class="wrapper"> <div id="div_PortletMessage" class="clear m-b-sm"> <\/div><div class="row"><div class="col-sm-12"><strong>Is Trackable ?<\/strong><label class="switch pull-right"><input id="Ch_IsTrackable" data-group="Viewable" onchange="_bizgazePortlet_DashboardPortetPermission.Tracking();" type="checkbox"><span><\/span><\/label><\/div><\/div><div class="row"><div class="col-sm-12"><strong>Everyone can view?<\/strong> <label class="switch pull-right"> <input id="chkIsPortletViewable" data-group="Viewable" type="checkbox"> <span><\/span> <\/label> <\/div> <\/div> <div class="row" id="divPortletViewRoles"> <div class="col-sm-12 m-b"><label>Roles that <strong>can<\/strong> view<\/label> <input type="hidden" id="hfPortletViewRoles" /> <select multiple="multiple" style="width:100%" class="txtPortletViewRoles"><\/select><\/div><\/div><div class="row" id="divPortletexcludeViewRoles"><div class="col-sm-12 m-b">'+`<label>Roles that <strong>can't</strong> view</label>`+'<input type="hidden" id="hfPortletExcludeViewRoles" /><select multiple="multiple" id="txtPortletExcludeViewRoles" style="width:100%" class="txtPortletExcludeViewRoles"><\/select><\/div><\/div><br/><div class="row" id="divWPStages"><\/div> <\/div><\/div><div class="footer bg-light"><a href="javascript:;" id="btn_PortletPermissions_close" onclick="Unibase.Platform.Widgets.Components.Widget.Instance().ClosePermissionModal()" class="btn btn-secondary btn-sm mr-auto">Close<\/a><\/div><\/div>'}load(){var i=this,t=0,u=n.Themes.Providers.DetailHelper.installedAppId;let r=n.Themes.Providers.Detail_Settings.Instance().ActivePortlets.findIndex(n=>n.InstalledAppId==u);t=r!=-1?n.Themes.Providers.Detail_Settings.Instance().ActivePortlets[r].ActivePortletId:Number($("#hf_PortletId").val());$("#btn_PortletPermissions_close").click(function(){n.Platform.Helpers.NavigationHelper.Instance().closePopUp();$(".btn_addportlt").removeClass("hidden");$(".btnEdit_portlet").removeClass("hidden");$(".manage_pPermissions").removeClass("hidden");$(".btn_dltportlet").removeClass("hidden")});$("#chkIsPortletViewable").change(function(){i.setPortletViewable(t)});$("#Ch_IsTrackable").change(function(){i.Tracking(t)});n.Platform.Widgets.Components.WidgetPermission.Instance().showPermissions(t,"portlet",0)}Tracking(t){var r=this,i=$("#Ch_IsTrackable").prop("checked");this.fileCacheHelper.loadJsFile("platform/portlets/requests/portlet.js",function(){let r=new n.Platform.Portlets.Requests.Portlet;r.PortletId=t;r.IsTrackable=i;n.Platform.Portlets.Managers.PortletManager.Instance().updateTracking(r).then(function(t){t.status!=n.Data.Status.Error?MessageHelper.Instance().showSuccess(t.message,"div_PortletMessage"):MessageHelper.Instance().showError(t.message,"div_PortletMessage")})})}setPortletViewable(t){var i=$("#chkIsPortletViewable").prop("checked");i?$("#divPortletViewRoles").hide():$("#divPortletViewRoles").show();n.Platform.Portlets.Managers.PortletManager.Instance().setViewable(t,i).then(function(t){t.status!=n.Data.Status.Error?MessageHelper.Instance().showSuccess(t.message,"div_PortletMessage"):MessageHelper.Instance().showError(t.message,"div_PortletMessage")})}DataBind(t){n.Platform.Portlets.Managers.PortletManager.Instance().getPortlet(t).then(function(t){t.result.IsMandatory==!0?$("#divPortletViewRoles").hide():$("#divPortletViewRoles").show();t.result.IsTrackable&&$("#Ch_IsTrackable").prop("checked",!0);t.result.ViewAllStages?$("#tblWPStages").hide():$("#tblWPStages").show();$("#chkIsPortletViewable").prop("checked",t.result.IsMandatory);$("#chkAllStages").prop("checked",t.result.ViewAllStages);n.Platform.Widgets.Components.WidgetPermission.Instance().loadViewRoles(t.result.IsMandatory)})}changeStagePortletPermissions(t,i,r){var u={PortletId:i,Portlet_StageId:t,Status:r};n.Platform.Portlets.Managers.PortletManager.Instance().savePortletStage(u).then(function(t){t.status!=n.Data.Status.Error?MessageHelper.Instance().showSuccess(t.message,"div_WidgetMessage"):MessageHelper.Instance().showError(t.message,"div_WidgetMessage")})}setViewToAllStages(t,i){n.Platform.Portlets.Managers.PortletManager.Instance().setViewToAllStages(t,i).then(function(t){t.status==n.Data.Status.Success?(t.result.ViewAllStages?$("#tblWPStages").hide():$("#tblWPStages").show(),MessageHelper.Instance().showSuccess(t.message,"div_WidgetMessage")):MessageHelper.Instance().showError(t.message,"div_WidgetMessage")})}static Instance(){return this._instance===undefined&&(this._instance=new r),this._instance}}i.PortletPermission=r})(r=i.Components||(i.Components={}))})(i=t.Portlets||(t.Portlets={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|