FR.logSearch={actionsList:[]};Ext.each(FR.actions,function(act){FR.logSearch.actionsList.push(new Ext.form.Checkbox({name:"actions["+act.k+"]",inputValue:act.k,boxLabel:act.t,checked:false}))});FR.logSearch.formPanel=new FR.components.editForm({title:"Search Activity Logs",layout:"form",autoScroll:true,items:[{xtype:"fieldset",width:500,defaults:{width:250},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>'),items:[{xtype:"textfield",fieldLabel:"Keyword",name:"search",value:""},{xtype:"datefield",fieldLabel:"Date start",name:"date_start",value:""},{xtype:"datefield",fieldLabel:"Date end",name:"date_end",value:""},{fieldLabel:"Action",xtype:"checkboxgroup",columns:1,height:150,width:250,autoScroll:true,style:"padding:5px;border:1px solid var(--sBCol)",items:FR.logSearch.actionsList},{xtype:"panel",width:355,style:"margin-bottom:5px",bbar:["->",{text:FR.T("Select all"),cls:"fr-btn-smaller",handler:function(){Ext.each(FR.logSearch.actionsList,function(c){c.setValue(true)})}},{text:FR.T("Clear all"),cls:"fr-btn-smaller",handler:function(){Ext.each(FR.logSearch.actionsList,function(c){c.setValue(false)})}}]},{xtype:"userslistfield",name:"users",only:"users",value:"",showSelf:true,fieldLabel:FR.T("Users"),tcfg:{height:150,width:250}}]}],tbar:[{text:"Search",cls:"fr-btn-primary",iconCls:"fa-search",disabled:FR.system.isFree||FR.system.isFreelancer,handler:function(){var editForm=this.ownerCt.ownerCt;var store=FR.grid.panel.getStore();store.baseParams=Ext.apply({limit:FR.system.gridItemsPerPage},editForm.form.getValues());Ext.getCmp("gridTab").show();store.load()}},{text:"Export",cls:"fr-btn-primary",iconCls:"fa-download",style:"margin-left:5px",disabled:FR.system.isFree||FR.system.isFreelancer,handler:function(){var frm=document.createElement("FORM");frm.action=FR.URLRoot+"/?module=logs&section=cpanel&page=list&export=1";frm.method="POST";frm.target="_blank";Ext.iterate(this.ownerCt.ownerCt.form.getFieldValues(),function(k,v){var inpt=document.createElement("INPUT");inpt.type="hidden";inpt.name=k;if(k=="date_end"||k=="date_start"){if(v){inpt.value=v.format("m/d/Y")}else{inpt.value=""}}else{inpt.value=v}frm.appendChild(inpt)});Ext.getBody().dom.appendChild(frm);frm.submit();Ext.get(frm).remove()}}]});Ext.getCmp("gridTabPanel").add(FR.logSearch.formPanel);FR.logSearch.formPanel.show();