FR.addNotification={actionsList:[],setActor:function(data){if(data.users.length>0){var user=data.users[0];this.formPanel.actorDisplay.setValue(user.name);this.formPanel.actor.setValue("user|"+user.uid)}else{if(data.groups.length>0){var group=data.groups[0];this.formPanel.actorDisplay.setValue(group.name);this.formPanel.actor.setValue("group|"+group.gid)}}}};Ext.each(FR.actions,function(act){FR.addNotification.actionsList.push({xtype:"checkbox",name:"actions[]",inputValue:act.k,boxLabel:act.t})});FR.addNotification.formPanel=new FR.components.editForm({title:"Add rule",autoScroll:true,layout:"form",items:[{xtype:"fieldset",disabled:FR.system.isFree||FR.system.isFreelancer,disabledMaskText:FR.T("Available in the %1 version").replace("%1",'<a href="https://filerun.com/get-enterprise" target="_blank">Enterprise FileRun</a>'),labelWidth:150,width:500,defaults:{width:300},items:[{xtype:"hidden",ref:"../actor",name:"actor",value:""},{xtype:"trigger",ref:"../actorDisplay",name:"actor_name",editable:false,fieldLabel:"User or group",value:"",triggerClass:"fa fa-user-plus",onTriggerClick:function(e,btn){if(!this.chooser){this.chooser=new UserChooser({URLRoot:FR.URLRoot,showSelf:true})}this.chooser.show(btn,FR.addNotification.setActor,FR.addNotification);this.chooser.clearChecked()}},{xtype:"checkboxgroup",fieldLabel:"Actions",columns:1,cls:"x-form-field-like",items:FR.addNotification.actionsList},{xtype:"textarea",fieldLabel:"Notify e-mail address",name:"email_address",value:""}]}],tbar:[{text:"Add rule",cls:"fr-btn-primary",disabled:FR.system.isFree||FR.system.isFreelancer,ref:"saveBtn",handler:function(){var editForm=this.ownerCt.ownerCt;var opts={url:FR.URLRoot+"/?module=notifications&section=cpanel&page=add&action=add",maskText:"Saving changes..."};editForm.submitForm(opts)}}]});Ext.getCmp("gridTabPanel").add(FR.addNotification.formPanel);FR.addNotification.formPanel.show();