var totalAjaxRequest=3;var ajaxRequestCount=1;var isNomeasure=false;Ext.define("BTMSnapshot.controller.BTMSnapshotController",{extend:"Ext.app.Controller",refs:[{selector:"newUtilities",ref:"newUtilities"},{selector:"main",ref:"main"},{selector:"ReporterSettings",ref:"ReporterSettings"}],searchTask:new Ext.util.DelayedTask(function(){appConstants.appObj.getController(appConstants.appController).doSearchFilter();
}),foregroundJspUrl:"/final/reporter/BTMSnapshotJson.jsp",foregroundControllerUrl:"../servlet/com.eg.ErBTMSnapshotC",backgroundControllerUrl:"../servlet/com.eg.ErStartBackGroundReportC",isNewFav:false,init:function(){this.control({"main":{"afterrender":this.boxready},"mainform":{"afterrender":this.loadForm},"newUtilities":{"render":this.loadTools},"newUtilities > #printTool > button":{"click":this.printFile},"newUtilities > #saveTool > button":{"click":this.preAlert},"newUtilities > #mailTool > button":{"click":this.preAlert},"newUtilities > #csvTool > button":{"click":this.preAlert},"newUtilities > #favoriteTool > button":{"click":this.saveFavorite},"newUtilities > #scheduleTool > button":{"click":this.saveSchedule},'egcomponent button[id="compExpand"]':{"click":this.expandMe},'egcomponent trigger[id="compSearch"]':{"change":this.filterMultiselect},'mainform combo[id="er_option"]':{"select":this.onSelectAnalysisBy},'mainform combo[id="er_site"]':{"select":this.onSelectSiteBy},'mainform combo[id="er_compType"]':{"select":this.onSelectCompTypeBy},"btmsnapshotsettings":{"afterrender":this.loadSettings},'btmsnapshotsettings combo[name="reportGeneration"]':{"select":this.onChangeReportGeneration},'btmsnapshotsettings button[id="moreOptionCloseId"]':{"click":this.validateAndCloseSettings},'btmsnapshotsettings button[id="submitViaSetting"]':{"click":this.closeSettingAndSubmit},'btmsnapshotform button[name="submit"]':{"click":this.submitReoprt},'resultpanel button[name="applyFilter"]':{"click":this.applyFilter},'resultpanel button[name="leftApplyFilter"]':{"click":this.showResult},'resultpanel button[name="cancelFilter"]':{"click":this.cancelFilter},'mainform button[id="panelinsidetoggle"]':{"click":this.toggleForm},'resultpanel button[id="collapse_summary_img"]':{"toggle":this.toggleSummary},'resultpanel textfield[name="filterSearchBox"]':{change:this.typewatch},});
},filterMultiselect:function(a){a.toggleTriggger();if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}if(a.getId()=="compSearch"){appConstants.erUtils.filterComboStore(a,Ext.getCmp("er_component"),appConstants.publicJsonData.combo.componentCombo);}},expandMe:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}if(a.getId()=="compExpand"){appConstants.erUtils.expandMultiComboButton(Ext.getCmp("er_component"),componentsTxt,a);}},typewatch:function(b,a){this.searchTask.delay(500);},goTo:function(a){if(appConstants.frmSchModify=="Yes"){this.saveSchedule(a);}else{this.saveFavorite(a);}},saveSchedule:function(d){if(this.validateMainForm(false)&&Ext.getCmp("er_timeline").getValue()=="Any"){Ext.MessageBox.show({title:alert_text,msg:"Chosen timeline not allowed",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}var c="/final/reporter/ErSaveSchedule.jsp?isSubmit=true&"+this.getQueryString(true,true,true)+"&option=data&com.eg.CSRF_NONCE="+csrfToken;if(d.getId()=="save"){if(c!=undefined&&c.indexOf("schedule_id")==-1){c+="&schedule_id="+appConstants.schedule_id;}c+="&showSchWindow=no";var b=c.substr(0,c.indexOf("?"));
var e=c.substr(c.indexOf("?")+1,c.length-1);var a=Ext.create("Ext.form.Panel");a.submit({url:b,params:e,standardSubmit:true,method:"POST"});}else{parent.scheduleWindowFn(c);}},saveFavorite:function(e){var d=this.validateMainForm(false);var c="";if(e.getId()=="save"){this.isNewFav=false;c="/final/reporter/ErSaveFavorite.jsp?isSubmit=true&"+this.getQueryString(true,true,true)+"&er_view=GRAPH&cmd=client&fromFavoriteModify=Yes"+"&er_RmDispName="+appConstants.er_RmDispName+"&com.eg.CSRF_NONCE="+csrfToken;
if(c!=undefined&&c.indexOf("FavoriteId")==-1){c+="&FavoriteId="+appConstants.favorite_id;}c+="&showSchWindow=no";var b=c.substr(0,c.indexOf("?"));var f=c.substr(c.indexOf("?")+1,c.length-1);var a=Ext.create("Ext.form.Panel");a.submit({url:b,params:f,standardSubmit:true,method:"POST"});}else{this.isNewFav=true;
c="../servlet/com.eg.ErFavoriteC?isSubmit=true&"+this.getQueryString(true,true,true)+"&er_view=GRAPH&cmd=client"+"&er_RmDispName="+appConstants.er_RmDispName+"&com.eg.CSRF_NONCE="+csrfToken;parent.favouriteWindowFn(c);}},saveReportAsPDF:function(){var a="../reporter/ErHtmlToSavePdf.jsp?"+appConstants.publicJsonData.urlFields.saveQueryString;
if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}appConstants.erUtils.savePDF(a);},bookletQuery:function(b){var a=appConstants.publicJsonData.urlFields.saveQueryString;return a;},bookletScheduleQuery:function(b){var a="isSubmit=true&"+this.getQueryString(true,true,true)+"&option=data";
return a;},bookletPreview:function(){this.printFile();},printFile:function(){var a="/final/reporter/BTMSnapshotPrint.jsp?"+appConstants.publicJsonData.urlFields.saveQueryString+"&er_view=PRINT&pdfPrint=yes";parent.printWindowFn(a);},sendMail:function(){Ext.widget("sendmail").show();},preAlert:function(b){var a=this;
if(customPaging){Ext.Msg.show({title:"Slice and Dice Analytics",msg:"This report is designed to generate only the rows that you are currently viewing in the user interface. However, if you wish to generate the entire report with all the rows, it is recommended that you generate this report in the background. Do you still want to generate the report with only the rows displayed in the user interface?",cls:"egMsgBox",buttons:Ext.Msg.YESNO,icon:Ext.Msg.QUESTION,fn:function(c){if(c=="yes"){if(b.iconCls=="iconCsv"){a.saveCsv();
}else{if(b.iconCls=="iconPdfDownload"){a.saveReportAsPDF();}else{if(b.iconCls=="iconMail"){a.sendMail();}}}}}});}else{if(b.iconCls=="iconCsv"){a.saveCsv();}else{if(b.iconCls=="iconPdfDownload"){a.saveReportAsPDF();}else{if(b.iconCls=="iconMail"){a.sendMail();}}}}},saveCsv:function(){var c=this;if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}var d="&er_timeline="+Ext.getCmp("er_timeline").getValue()+"&startdate="+Ext.getCmp("er_stdate").dataArray+"&enddate="+Ext.getCmp("er_enddate").dataArray+"&starthr="+Ext.getCmp("er_sthr").getValue()+"&endhr="+Ext.getCmp("er_endhr").getValue()+"&startmin="+Ext.getCmp("er_stmin").getValue()+"&endmin="+Ext.getCmp("er_endmin").getValue();
d+="&er_option="+Ext.getCmp("er_option").getValue();d+="&er_compType="+Ext.getCmp("er_compType").getValue();var b=new Array();b=Ext.getCmp("er_component").getValue();for(var a in b){d+="&er_component="+b[a];}initLdgMask.show();Ext.Ajax.request({url:c.foregroundControllerUrl,params:d+"&requestFor=setCsvData",scope:this,success:function(e){initLdgMask.hide();
window.location="../servlet/egurkha.reporter.SaveInCSVFormat";}});},loadReportData:function(){var g=Ext.getCmp("resultContainer");var q=Ext.getCmp("backGroundPanel");var b=appConstants.publicJsonData.selectedFields.reportGenerationSelected;this.hideResults();var i=Ext.getCmp("er_stdate").getValue();i.setHours(Ext.getCmp("er_sthr").getValue());
var n=Ext.getCmp("er_enddate").getValue();n.setHours(Ext.getCmp("er_endhr").getValue());var o=Ext.Date.dateFormat(Ext.getCmp("er_stdate").getValue(),mgrDateFormat);var f=Ext.Date.dateFormat(Ext.getCmp("er_enddate").getValue(),mgrDateFormat);var c=Ext.getCmp("er_sthr").getValue();var e=Ext.getCmp("er_endhr").getValue();
var d=Ext.getCmp("er_stmin").getValue();var p=Ext.getCmp("er_endmin").getValue();if(o==f&&c==e&&d==p){Ext.MessageBox.show({title:alert_text,msg:_invalidSameTime,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return;}if(b=="background"){var j=appConstants.publicJsonData.labelFields.bgStatus;if(j=="success"){var l=appConstants.publicJsonData.labelFields.bgResponseText;
var m=appConstants.publicJsonData.labelFields.bgAnchor;var k=appConstants.publicJsonData.urlFields.bgUrl;var a=m;q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconSuccess"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+l+".</br>"+'<a class="backgroundMsgLink" href='+k+">"+a+"</a></div></td></tr></table></td></tr></table>");
}else{if(j=="duplicate"){var l=appConstants.publicJsonData.labelFields.bgResponseText;var m=appConstants.publicJsonData.labelFields.bgAnchor;var k=appConstants.publicJsonData.urlFields.bgUrl;var a=m;q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconExclamation"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+l+".</br>"+'<a class="backgroundMsgLink" href='+k+">"+a+"</a></div></td></tr></table></td></tr></table>");
}else{var l=appConstants.publicJsonData.labelFields.bgResponseText;q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconExclamation"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+l+"</a></div></td></tr></table></td></tr></table>");
}}q.show();}else{if(b=="background-xls"){var q=Ext.getCmp("backGroundPanel");var j=appConstants.publicJsonData.labelFields.bgStatus;if(j=="success"){var l=appConstants.publicJsonData.labelFields.bgResponseText;var m=appConstants.publicJsonData.labelFields.bgAnchor;var k=appConstants.publicJsonData.urlFields.bgUrl;
var a=m;q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconSuccess"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+l+".</br>"+'<a class="backgroundMsgLink" href='+k+">"+a+"</a></div></td></tr></table></td></tr></table>");
}else{if(j=="duplicate"){var l=appConstants.publicJsonData.labelFields.bgResponseText;var m=appConstants.publicJsonData.labelFields.bgAnchor;var k=appConstants.publicJsonData.urlFields.bgUrl;var a=m;q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconExclamation"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+l+".</br>"+'<a class="backgroundMsgLink" href='+k+">"+a+"</a></div></td></tr></table></td></tr></table>");
}else{var l=appConstants.publicJsonData.labelFields.bgResponseText;q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconExclamation"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+l+"</a></div></td></tr></table></td></tr></table>");
}}q.show();}else{if(b=="background-csv"){var q=Ext.getCmp("backGroundPanel");var h=Ext.getCmp("bgReportName").getValue();h=checkFileName(h);var j=appConstants.publicJsonData.labelFields.bgStatus;if(j!="undefined"){if(j=="success"){var l=appConstants.publicJsonData.labelFields.bgResponseText;var m=appConstants.publicJsonData.labelFields.bgAnchor;
var k=appConstants.publicJsonData.urlFields.bgUrl;var a=m;q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconSuccess"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+l+".</br>"+'<a class="backgroundMsgLink" href='+k+">"+a+"</a></div></td></tr></table></td></tr></table>");
}else{if(j=="duplicate"){var l=appConstants.publicJsonData.labelFields.bgResponseText;var m=appConstants.publicJsonData.labelFields.bgAnchor;var k=appConstants.publicJsonData.urlFields.bgUrl;var a=m;q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconExclamation"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+l+".</br>"+'<a class="backgroundMsgLink" href='+k+">"+a+"</a></div></td></tr></table></td></tr></table>");
}else{var l=appConstants.publicJsonData.labelFields.bgResponseText;q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconExclamation"></div></td><td><div style="line-height:1.5em" class="font_bold11">'+l+"</a></div></td></tr></table></td></tr></table>");
}}}else{q.update('<table border="0px" width="100%" height="100%"><tr><td align="center" valign="middle"><table style="width:480px;"border="0px"><tr><td><div style="margin:0px 10px 0px 0px;display:block;width:32px;height:32px;float:right;" class="iconSuccess"></div></td><td><div style="line-height:1.5em" class="font_bold11">Error In BackGround Generation</a></div></td></tr></table></td></tr></table>');
}q.show();}else{console.log("No data found for report generation in json");}}}keepResult=false;},loadSummaryData:function(v){if(v!=undefined&&!Ext.isEmpty(v)){var e="";var n="";var m="";var p="";var w="";var s="";if(v.TOTALCOUNT!=undefined){e='<table><tbody><tr><td align="right"><img src="/final/images/spacer.gif" class="iconTransactionsCount"></td><td align="left" style="padding:5px"><span class="newFont_normal24">'+v.TOTALCOUNT+'</span></td></tr><tr><td align="center" colspan="2" style="padding:10px 5px 10px 5px"><span class="font_normal12">'+TransactionsCountTxt+"</span></td></tr></tbody></table>";
Ext.getCmp("totalHtmlId").update(e);}if(v.HEALTHY!=undefined){n='<div class="btmHeatmapDiv" style="border:0px solid red;margin:15px 5px 0px 0px">';var j="",l="",t="",c="";var a="",k="",y="",h="";var q=v.HEALTHY;var f=v.SLOW;var b=v.STALLED;var u=v.ERROR;if(q.indexOf("#")>-1){j=q.substring(q.indexOf("#")+1,q.length);
q=q.substring(0,q.indexOf("#"));a=q;}if(f.indexOf("#")>-1){l=f.substring(f.indexOf("#")+1,f.length);f=f.substring(0,f.indexOf("#"));k=f;}if(b.indexOf("#")>-1){t=b.substring(b.indexOf("#")+1,b.length);b=b.substring(0,b.indexOf("#"));y=b;}if(u.indexOf("#")>-1){c=u.substring(u.indexOf("#")+1,u.length);u=u.substring(0,u.indexOf("#"));
h=u;}q=Math.round(q);b=Math.round(b);f=Math.round(f);u=Math.round(u);var x=q+b+f+u;var d=Math.max(q,b,f,u);var r=0;if(x!=100){r=100-x;}if(q==d){q=q+r;}else{if(b==d){b=b+r;}else{if(f==d){f=f+r;}else{if(u==d){u=u+r;}}}}var g=Ext.select(".btmHeatmapDiv");for(var o=0;o<q;o++){n+='<div class="healthyDiv"></div>';
}for(var o=0;o<f;o++){n+='<div class="slowDiv"></div>';}for(var o=0;o<b;o++){n+='<div class="stalledDiv"></div>';}for(var o=0;o<u;o++){n+='<div class="errorDiv"></div>';}n+="</div>";n+='<div style="vertical-align:middle;">',n+='<div class="font_normal12" style="height:20px;display:flex;justify-content:left;align-items:center;"><div data-qtip="'+Math.round(j)+'" style="width:48px;float:left;text-align:right;padding-right:5px;padding-left:5px">'+a+'%</div><div style="float:left;"> '+HealthyTxt+"</div></div>";
n+='<div class="font_normal12" style="height:20px;display:flex;justify-content:left;align-items:center;"><div data-qtip="'+Math.round(l)+'" style="width:48px;float:left;text-align:right;padding-right:5px;padding-left:5px">'+k+'%</div><div style="float:left"> '+SlowTxt+"</div></div>";n+='<div class="font_normal12" style="height:20px;display:flex;justify-content:left;align-items:center;"><div data-qtip="'+Math.round(t)+'" style="width:48px;float:left;text-align:right;padding-right:5px;padding-left:5px">'+y+'%</div><div style="float:left">'+StalledTxt+"</div></div>";
n+='<div class="font_normal12" style="height:20px;display:flex;justify-content:left;align-items:center;"><div data-qtip="'+Math.round(c)+'" style="width:48px;float:left;text-align:right;padding-right:5px;padding-left:5px">'+h+'%</div><div style="float:left">'+ErrorTxt+"</div></div>";n+="</div>";Ext.getCmp("userExpId").update(n);
}if(v.RESPONSETIME!=undefined){m='<table><tbody><tr><td align="right"><img src="/final/images/spacer.gif" class="iconTimeGray"></td><td align="left" style="padding:5px" class="newFont_normal24">'+v.RESPONSETIME+'<span class="newFont_normal12">&nbsp;'+millSecTxt+'</span></td></tr><tr><td align="center" colspan="2" style="padding:10px 5px 10px 5px;line-height:12px"><span class="font_normal12">'+AverageTxt+" <br/> "+Response_TimeTxt+"</span></td></tr></tbody></table>";
Ext.getCmp("avgResponseId").update(m);}if(v.URLCOUNT!=undefined){p='<table><tbody><tr><td align="right"><img src="/final/images/spacer.gif" class="iconUniqueTransaction"></td><td align="left" style="padding:5px" class="newFont_normal24">'+v.URLCOUNT+'</td></tr><tr><td align="center" colspan="2" style="padding:10px 5px 10px 5px"><span class="font_normal12">'+Unique_BusinessTxt+"<br/>"+TransactionTxt+"</span></td></tr></tbody></table>";
Ext.getCmp("uniqueTransId").update(p);}if(v.AVGSQLTIME!=undefined){w='<table border="0px"><tbody><tr><td align="right"><img src="/final/images/spacer.gif" class="iconDatabase24"></td><td align="left" style="padding:5px" class="newFont_normal24">'+v.AVGSQLTIME+'<span class="newFont_normal12">&nbsp;'+v.AVGSQLTIME_UNIT+'</span></td></tr><tr><td align="center" colspan="2" style="padding:10px 0px 10px 0px" ><span class="font_normal12">'+Average_SQLTxt+" <br/>"+Execution_TimeTxt+"</span></td></tr></tbody></table>";
Ext.getCmp("avgExecutionTimeId").update(w);}if(v.TOTALSQLCOUNT!=undefined){s='<table border="0px"><tbody><tr><td align="right"><img src="/final/images/spacer.gif" class="icon Database24"></td><td align="center" style="padding:5px" class="newFont_normal24">'+v.TOTALSQLCOUNT+'</td></tr><tr><td align="center" colspan="2" style="padding:10px 5px 10px 5px" ><div class="font_normal12">'+Total_SQLTxt+" <div/><div><span>"+CountTxt+'&nbsp;</span><span class="iconInfoCircle" data-qclass="yellowTip" data-qtip="The total number of SQLs for the Top N transactions that are captured and available in Detailed Diagnosis." style="cursor:pointer;padding:0px 8px"></span></div></td></tr></tbody></table>';
Ext.getCmp("executionTimeCountId").update(s);}}},loadGrid:function(p,i){activePage=1;var o=this;var a=true;if(customPaging){a=false;}if(!Ext.isEmpty(p)){var f=new Array();var h=new Array();var c=p.gridCol;var m=p.gridColUI;var g=p.gridData;for(var r in c){var j="center";var n=false;if(r<4){j="left";}if(r==0){n=true;
}var b=c[r];h.push(b);f.push({header:m[r],sortable:a,align:j,width:120,dataIndex:b,renderer:function(A,w,z,C,x,B,t){if(A!=null&&A.indexOf("#@#")>-1){w.tdCls="iconColumn";var v=A.substring(0,A.indexOf("#@#"));var u=A.substring(A.indexOf("#@#")+3,A.length);var y="btm_rum_dd_icons_healthy";if(u=="slow"){y="btm_rum_dd_icons_slow";
u=SlowTxt;}else{if(u=="stalled"){y="btm_rum_dd_icons_stalled";u=StalledTxt;}else{if(u=="error"){y="btm_rum_dd_icons_error";u=ErrorTxt;}else{u=HealthyTxt;}}}return"<a onClick='javascript:loadPopup(\""+v+'");\' href="javascript:void(0)" data-qtip="'+drillDownToolTip+'" data-qclass="yellowTip"> <table><tr><td style="width:25px;"><img src="/final/images/clear.png" class="'+y+'"/></td><td style="width:45px;padding-top:5px;"><span class="btmrum_status">'+u+'</span></td><td><img src="/final/images/clear.png" class="iconDiagnosis" style="vertical-align:middle;margin-left:5px;margin-top:2px;"/></td></tr></table></a>';
}w.tdAttr='data-qclass="yellowTip" data-qtip="'+A.trim()+'"';A=o.getNumberFormat(A);return A;},doSort:function(v){var u=this.up("grid").store;var w=this.getSortParam();var t="no";console.log(w);if(w=="Request Time"){t="yes";}u.sort({property:w,direction:v,sorterFn:function(B,A){B=B.get(w);A=A.get(w);
if(B!=null&&B.indexOf("#@#")>-1){B=B.substring(B.indexOf("#@#")+3,B.length);}if(A!=null&&A.indexOf("#@#")>-1){A=A.substring(A.indexOf("#@#")+3,A.length);}if(B.indexOf(".")>-1&&B.indexOf(" ")>-1){var y=B.substring(0,B.lastIndexOf(" "));var z=new Date(Ext.Date.parse(y,mgrDateFormat));var x=Ext.Date.dateFormat(z,getExtjsDateFormat("MMM-dd-yyyy"));
B=x+B.substring(B.lastIndexOf(" "),B.length);}if(A.indexOf(".")>-1&&A.indexOf(" ")>-1){var y=A.substring(0,A.lastIndexOf(" "));var z=new Date(Ext.Date.parse(y,mgrDateFormat));var x=Ext.Date.dateFormat(z,getExtjsDateFormat("MMM-dd-yyyy"));A=x+A.substring(A.lastIndexOf(" "),A.length);}if(t=="yes"){B=B.substring(0,B.lastIndexOf("-")-1);
A=A.substring(0,A.lastIndexOf("-")-1);}if(!isNaN(B)&&!isNaN(A)){B=Ext.isNumber(B)?B:parseFloat(String(B),10);A=Ext.isNumber(A)?A:parseFloat(String(A),10);if(v=="ASC"){B=isNaN(B)?999999:B;A=isNaN(A)?999999:A;}else{B=isNaN(B)?0:B;A=isNaN(A)?0:A;}}else{if(!isNaN(new Date(B))&&!isNaN(new Date(A))){A=new Date(A).getTime();
B=new Date(B).getTime();}}return B>A?1:(B<A?-1:0);}});}});if(f[f.length-1].dataIndex=="Server Machine"){f[f.length-1].width=170;f[f.length-1].align="left";}if(f[f.length-1].dataIndex=="Business Context"){f[f.length-1].width=170;f[f.length-1].align="left";}if(f[f.length-1].dataIndex=="Request Time"){f[f.length-1].width=180;
}if(f[f.length-1].dataIndex=="Business transaction"){f[f.length-1].width=230;f[f.length-1].align="left";}if(r==0){f[f.length-1].width=150;}if(f[f.length-1].dataIndex=="URL"){f[f.length-1].width=230;}if(f[f.length-1].dataIndex=="Pre Processor Time"){f[f.length-1].width=150;}}var d;if(g!=undefined&&g.length<gridPageSize){d=true;
}else{d=false;}if(customPaging){d=true;}if(!keepResult){Ext.getCmp("gridContainerId").removeAll();}var k;if(customPaging){k=Ext.create("Ext.data.Store",{fields:h,proxy:{type:"pagingmemory",reader:{type:"array",root:"data",totalProperty:"total"}},sorters:{property:h[2],direction:"DESC"},pageSize:gridPageSize,data:g,autoLoad:true,});
}else{k=Ext.create("Ext.data.Store",{fields:h,proxy:{type:"pagingmemory",reader:{type:"array",root:"data",totalProperty:"total"}},sorters:{property:h[2],direction:"DESC"},pageSize:gridPageSize,data:g,autoLoad:true,});}var s=new Array();var e=Ext.widget("customgrid",{store:k,ui:"newGridPanel",border:true,id:"vengat",margin:"0 10 0 10",columns:f,popUpData:"noToolTip",scroll:true,filterDetails:i,autoScroll:true,layout:"fit",listeners:{sortchange:function(w,x,y,v,u){this.getStore().loadPage(activePage);
},render:function(t){Ext.defer(function(){t.columns[2].doSort("DESC");},100);}},dockedItems:[{xtype:"pagingtoolbar",cls:"newPagination",dock:"bottom",id:"pageingTool",displayInfo:true,store:k,hidden:d,displayInfo:true,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No topics to display",listeners:{change:function(t,u){activePage=u.currentPage;
}}}]});var l=Ext.getCmp("gridContainerId");l.removeAll();l.add(e);var q=Ext.getCmp("vengat");if(fromPerBtn){activePage=Math.ceil(g.length/gridPageSize);q.getStore().loadPage(activePage);}else{q.getStore().loadPage(1);}}},loadOverAllPageNavigation:function(b){var m=this;var i=Ext.getCmp("BTMgrid");var l=b["isRangeNeed"];
var a=parseInt(b["dataPageNo"]);var d=parseInt(b["overAllRecCount"]);var k=parseInt(b["recordPerPage"]);var e=((a-1)*Math.ceil(k/gridPageSize))+1;if(fromPerBtn){e=e+activePage-1;}if(d<=k){var c=Ext.getCmp("customPagingId");if(c!=undefined){c.hide();i.doLayout();return;}}if(l!="true"&&a==1){return;}else{var c=Ext.getCmp("customPagingId");
if(c!=undefined){i.remove(c);}var n=false;var h=false;var j=Math.ceil(d/gridPageSize);if(a==1&&e==1){h=true;}if(e==j){n=true;}var g='<div style="text-align:center">Page '+e+" of "+j+"<div>";var f='<div style="text-align:right";">'+Total_RecordsTxt+": "+d+"</div>";appConstants.totalRec=d;i.add({xtype:"container",id:"customPagingId",cls:"paginationOuterContainerBorder",height:28,layout:"column",margin:"0 10 0 10",padding:"5 0 10 0",items:[{xtype:"container",layout:"hbox",columnWidth:0.5,margin:"0 0 10 0",items:[{xtype:"container",width:48,margin:"0 0 10 5",items:[{xtype:"button",id:"firstPageBtn",tooltip:"<b>"+First_PageTxt+"</b>",iconCls:"al_first_enabled",style:{background:"none",border:"0px"},margin:"0 3 0 0",currentPage:a,disabled:h,listeners:{click:function(){fromPerBtn=false;
var q=Ext.getCmp("pageingTool");var o=Ext.getCmp("infolabel");var p=q.store.currentPage-1;if(p==0&&a==1){return;}o.update('<div style="text-align:center">Page '+1+" of "+j+"</div>");if(a>1){appConstants.currentPage=1;keepResult=true;m.showResult(Ext.getCmp("submit"));}else{Ext.getCmp("firstPageBtn").setDisabled(true);
Ext.getCmp("customPer").setDisabled(true);Ext.getCmp("customNext").setDisabled(false);Ext.getCmp("lastPageBtn").setDisabled(false);if(q.fireEvent("beforechange",q,p)!==false){q.store.loadPage(1);}}}}},{xtype:"button",iconCls:"al_previous_enabled",style:{background:"none",border:"0px"},id:"customPer",tooltip:"<b>"+Previous_PageTxt+"</b>",currentPage:a,disabled:h,listeners:{click:function(){fromPerBtn=false;
var r=Ext.getCmp("pageingTool");var p=Ext.getCmp("infolabel");var q=r.store.currentPage-1;if(q==0&&a==1){return;}var o=((a-1)*Math.ceil(k/gridPageSize))+q;p.update('<div style="text-align:center">Page '+o+" of "+j+"</div>");if(q==0&&a>1){fromPerBtn=true;appConstants.currentPage=this.currentPage-1;keepResult=true;
m.showResult(Ext.getCmp("submit"));}else{if(o==1){Ext.getCmp("customPer").setDisabled(true);Ext.getCmp("firstPageBtn").setDisabled(true);}Ext.getCmp("customNext").setDisabled(false);Ext.getCmp("lastPageBtn").setDisabled(false);if(r.fireEvent("beforechange",r,q)!==false){r.store.loadPage(q);}}}}}]},{xtype:"tbseparator",},{xtype:"label",width:101,id:"infolabel",html:g},{xtype:"tbseparator",},{xtype:"container",margin:"0 0 10 0",width:48,items:[{xtype:"button",iconCls:"al_next_enabled",style:{background:"none",border:"0px"},id:"customNext",tooltip:"<b>"+Next_PageTxt+"</b>",margin:"0 3 0 0",currentPage:a,disabled:n,listeners:{"click":function(){fromPerBtn=false;
var r=Ext.getCmp("pageingTool");var p=Ext.getCmp("infolabel");var q=r.store.currentPage+1;var o=((a-1)*Math.ceil(k/gridPageSize))+q;if(o>j){return;}p.update('<div style="text-align:center">Page '+o+" of "+j+"</div>");if(q<=Math.ceil(k/gridPageSize)){Ext.getCmp("customPer").setDisabled(false);Ext.getCmp("firstPageBtn").setDisabled(false);
if(o==j){Ext.getCmp("customNext").setDisabled(true);Ext.getCmp("lastPageBtn").setDisabled(true);}if(r.fireEvent("beforechange",r,q)!==false){r.store.nextPage();}}else{appConstants.currentPage=this.currentPage+1;keepResult=true;m.showResult(Ext.getCmp("submit"));}}}},{xtype:"button",iconCls:"al_last_enabled",style:{background:"none",border:"0px"},id:"lastPageBtn",tooltip:"<b>"+Last_PageTxt+"</b>",currentPage:a,disabled:n,listeners:{"click":function(){fromPerBtn=true;
var r=Ext.getCmp("pageingTool");var p=Ext.getCmp("infolabel");var q=Math.ceil(r.store.totalCount/gridPageSize);var o=((a-1)*Math.ceil(k/gridPageSize))+q;if(o>j){return;}p.update('<div style="text-align:center">Page '+j+" of "+j+"</div>");if(a==Math.ceil(d/k)){Ext.getCmp("customPer").setDisabled(false);
Ext.getCmp("firstPageBtn").setDisabled(false);Ext.getCmp("customNext").setDisabled(true);Ext.getCmp("lastPageBtn").setDisabled(true);if(r.fireEvent("beforechange",r,q)!==false){r.store.loadPage(q);}}else{appConstants.currentPage=Math.ceil(d/k);keepResult=true;m.showResult(Ext.getCmp("submit"));}}}}]},{xtype:"tbseparator",},{xtype:"container",width:25,margin:"0 0 10 0",items:[{xtype:"button",iconCls:"al_refresh_enabled",style:{background:"none",border:"0px"},margin:"0 0 0 0",currentPage:a,listeners:{click:function(){var q=Ext.getCmp("pageingTool");
var o=Ext.getCmp("infolabel");var p=q.store.currentPage;if(q.fireEvent("beforechange",q,p)!==false){q.store.loadPage(p);}}}}]}]},{xtype:"container",margin:"0 0 0 0",columnWidth:0.5,layout:{type:"hbox",pack:"end"},items:{xtype:"label",html:f}}]});}},applyFilter:function(){var a=appConstants.filterDetails;
for(var b in a){var c=a[b];var d=c.id;var f=Ext.getCmp(d+"_left");if(f!=undefined&&!Ext.isEmpty(f)){var e=f.checkedList;c.checkedList=e;appConstants.filterDetails[b]=c;}}this.hideResults();this.showResult(Ext.getCmp("submit"));},cancelFilter:function(){Ext.getCmp("filterWithGridContainer").show();Ext.getCmp("filterAllContainer").hide();
},submitReoprt:function(a){appConstants.fromRunBtn="yes";if(appConstants.filterDetails!=undefined){appConstants.filterDetails=[];}Ext.getCmp("er_timeline").fireEvent("forceSelect",Ext.getCmp("er_timeline"));},showResult:function(a){Ext.getCmp("filterWithGridContainer").show();Ext.getCmp("filterAllContainer").hide();
var b;if(isSettingsEnabled){b=Ext.getCmp("reportGeneration").getValue();}else{b=appConstants.publicJsonData.selectedFields.reportGenerationSelected;}if(b=="foreground"&&this.validateMainForm(true)){if(keepResult){if(Ext.getCmp("vengat")!=undefined){appConstants.filterDetails=Ext.getCmp("vengat").filterDetails;
}}Ext.getCmp("backGroundPanel").hide();this.clearSessionInfo(this.foregroundControllerUrl,this.getQueryString(true,true,true));}else{if(b=="background-csv"&&this.validateMainForm(true)){this.getAjaxDataForSubmit("../servlet/com.eg.ErStartBackGroundReportC?isSubmit=true&SaveFormat=CSV&isBackgroundCSV=Yes",this.getQueryString(true,true,true));
}else{if(b=="background-xls"&&this.validateMainForm(true)){this.getAjaxDataForSubmit("../servlet/com.eg.ErStartBackGroundReportC?isSubmit=true&SaveFormat=XLSX",this.getQueryString(true,true,true));}else{if(b=="background"&&this.validateMainForm(true)){this.getAjaxDataForSubmit(this.backgroundControllerUrl,"isSubmit=true&"+this.getQueryString(true,true,true));
}}}}},clearSessionInfo:function(a,c){var b=this;initLdgMask.show();Ext.Ajax.request({url:a,params:c+"&requestFor=clearSessionInfo&isSubmit=true&keepResult="+keepResult,scope:this,success:function(d){ajaxRequestCount=1;b.initateAjaxDataForSubmit(a,c);}});},initateAjaxDataForSubmit:function(a,c){var b=this;
if(!keepResult){Ext.Ajax.request({url:a,params:c+"&requestFor=reportSummary",scope:this,async:true,success:function(e){var d=Ext.decode(e.responseText);b.loadAjaxSucess(d,"reportSummary",c);ajaxRequestCount++;}});Ext.Ajax.request({url:a,params:c+"&requestFor=sqlSummary",scope:this,async:true,success:function(e){var d=Ext.decode(e.responseText);
b.loadAjaxSucess(d,"sqlSummary",c);ajaxRequestCount++;}});}else{ajaxRequestCount++;ajaxRequestCount++;}Ext.Ajax.request({url:a,params:c+"&requestFor=tableInfo",scope:this,async:true,success:function(e){var d=Ext.decode(e.responseText);b.loadAjaxSucess(d,"tableInfo",c);ajaxRequestCount++;}});},getFilterInfo:function(c){var a=new Ext.LoadMask(Ext.getCmp("filterpanel").getEl(),{msg:"Loading ..."});
a.show();var b=this;Ext.Ajax.request({url:b.foregroundJspUrl,params:c+"&requestFor=getFilterInfo",scope:this,async:true,success:function(e){var d=Ext.decode(e.responseText);b.loadAjaxSucess(d,"getFilterInfo",c);a.hide();}});},loadAjaxSucess:function(j,b,h){var d=Ext.getCmp("resultContainer");Ext.getCmp("appNoMespanel").hide();
Ext.getCmp("resultDataPanel").show();appConstants.publicJsonData.urlFields.saveQueryString=j.urlFields.saveQueryString;if(b=="reportSummary"){if(j.hasOwnProperty("NO_DATA")){isNomeasure=true;}else{Ext.getCmp("summaryPanel").show();Ext.getCmp("filterpanel").show();d.show();Ext.getCmp("nomeasurepanel").hide();
var f=j.gridObj;var c=j.Summary;var e=j.OTHER_INFO;var a=parseInt(e["dataPageNo"]);var g=e["isRangeNeed"];if(g!="true"&&a==1){customPaging=false;}this.loadSummaryData(c);this.loadOverAllPageNavigation(e);}}else{if(b=="sqlSummary"){if(j.hasOwnProperty("NO_DATA")){}else{var c=j.Summary;this.loadSummaryData(c);
}}else{if(b=="tableInfo"){if(j.hasOwnProperty("NO_DATA")){if(appConstants.fromRunBtn!="yes"){appConstants.filterDetails=j.filterDetails;this.loadFiterData(j.filterDetails,j.totalCheckedCount,j);}}else{Ext.getCmp("filterpanel").show();Ext.getCmp("summaryPanel").show();d.show();Ext.getCmp("nomeasurepanel").hide();
var f=j.gridObj;var i=j.filterDetailsGrid;var e=j.OTHER_INFO;var a=parseInt(e["dataPageNo"]);var g=e["isRangeNeed"];if(g!="true"&&a==1){customPaging=false;}this.loadGrid(f,i);if(keepResult){this.loadOverAllPageNavigation(e);}if(appConstants.fromRunBtn=="yes"){this.getFilterInfo(h);}else{appConstants.filterDetails=j.filterDetails;
this.loadFiterData(j.filterDetails,j.totalCheckedCount,j);}}}else{if(b=="getFilterInfo"){appConstants.filterDetails=j.filterDetails;var i=j.filterDetailsGrid;Ext.getCmp("vengat").filterDetails=i;this.loadFiterData(j.filterDetails,j.totalCheckedCount,j);}}}}if(appConstants.fromRunBtn=="yes"&&ajaxRequestCount==1&&appConstants.showMainForm){Ext.getCmp("selectionDetails").setSelectionDetailsData(j.selectionDetails);
}if(ajaxRequestCount==totalAjaxRequest){initLdgMask.hide();if(isNomeasure&&appConstants.fromRunBtn=="yes"){this.disableTools();Ext.getCmp("nomeasurepanel").show();d.hide();}else{if(isNomeasure){this.disableTools();d.show();Ext.getCmp("appNoMespanel").show();Ext.getCmp("resultDataPanel").hide();}else{if(customPaging){this.enableTools();
}else{this.enableTools();}}}appConstants.fromRunBtn="no";fromPerBtn=false;keepResult=false;isNomeasure=false;}},disableTools:function(){Ext.getCmp("saveTool").setDisabled(true);Ext.getCmp("printTool").setDisabled(true);Ext.getCmp("mailTool").setDisabled(true);Ext.getCmp("csvTool").setDisabled(true);if(!appConstants.isDrillDown){Ext.getCmp("bookletTool").setDisabled(true);
}},enableTools:function(){Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);Ext.getCmp("csvTool").setDisabled(false);if(!appConstants.isDrillDown){Ext.getCmp("bookletTool").setDisabled(false);}},hideResults:function(){Ext.getCmp("resultContainer").hide();
Ext.getCmp("backGroundPanel").hide();Ext.getCmp("nomeasurepanel").hide();},onSelectAnalysisBy:function(c){var b=c.getValue();var d="er_option="+b;var a=this;initLdgMask.show();Ext.Ajax.request({url:a.foregroundJspUrl,params:d,scope:this,success:function(e){initLdgMask.hide();a.hideResults();appConstants.publicJsonData=Ext.decode(e.responseText);
if(appConstants.publicJsonData.combo.siteCombo!=undefined){Ext.getCmp("er_site").show();a.loadComboField("er_site","siteCombo","siteComboLabel","selectedSiteCombo",appConstants.publicJsonData,false,null,true);}else{Ext.getCmp("er_site").hide();}a.loadComboField("er_compType","compTypeCombo","compTypeComboLabel","selectedCompTypeCombo",appConstants.publicJsonData,false,null,true);
a.loadComboField("er_component","componentCombo","componentLabel","componentSelected",appConstants.publicJsonData,true,"componentpane",false);}});},onSelectSiteBy:function(b){var a=this;var d=b.getValue();var c="er_option="+Ext.getCmp("er_option").getValue();c+="&er_site="+d;initLdgMask.show();Ext.Ajax.request({url:a.foregroundJspUrl,params:c,scope:this,success:function(e){initLdgMask.hide();
a.hideResults();appConstants.publicJsonData=Ext.decode(e.responseText);a.loadComboField("er_compType","compTypeCombo","compTypeComboLabel","selectedCompTypeCombo",appConstants.publicJsonData,false,null,true);a.loadComboField("er_component","componentCombo","componentLabel","componentSelected",appConstants.publicJsonData,true,"componentpane",false);
}});},onSelectCompTypeBy:function(c){var b=c.getValue();var d="er_compType="+b;d+="&er_site="+Ext.getCmp("er_site").getValue();d+="&er_option="+Ext.getCmp("er_option").getValue();var a=this;initLdgMask.show();Ext.Ajax.request({url:a.foregroundJspUrl,params:d,scope:this,success:function(e){initLdgMask.hide();
a.hideResults();appConstants.publicJsonData=Ext.decode(e.responseText);a.loadComboField("er_component","componentCombo","componentLabel","componentSelected",appConstants.publicJsonData,true,"componentpane",false);}});},getAjaxData:function(a,b){Ext.Ajax.request({url:a,params:b,async:false,scope:this,success:function(c){appConstants.publicJsonData=Ext.decode(c.responseText);
}});},getAjaxDataForSubmit:function(a,c){var b=this;initLdgMask.show();Ext.Ajax.request({url:a,params:c,scope:this,success:function(d){initLdgMask.hide();appConstants.publicJsonData=Ext.decode(d.responseText);b.loadReportData();appConstants.fromRunBtn="no";}});},getQueryString:function(v,h,o){var d;var l,u,e,s,w,c,y;
if(isSettingsEnabled){l=Ext.getCmp("timefrom").getValue();u=Ext.getCmp("minfrom").getValue();e=Ext.getCmp("timeto").getValue();s=Ext.getCmp("minto").getValue();w=Ext.getCmp("er_excwe").getValue();c=Ext.getCmp("reportGeneration").getValue();y=Ext.getCmp("bgReportName").getValue();}else{var k=appConstants.publicJsonData.selectedFields;
l=k.selectedTimeFrom;u=k.selectedMinsFrom;e=k.selectedTimeTo;s=k.selectedMinsTo;w=k.excludeWeekendsSelected;c=k.reportGenerationSelected;y=k.reportNameSelected;}var t=Ext.getCmp("er_option").getValue();d="er_type=No";d+="&er_option="+t;if(t!=undefined&&t!="Component"){d+="&er_site="+Ext.getCmp("er_site").getValue();
}d+="&er_compType="+Ext.getCmp("er_compType").getValue();var b=new Array();b=Ext.getCmp("er_component").getValue();for(var x in b){d+="&er_component="+b[x];}if(o){var i=Ext.getCmp("er_sthr").dataArray;var n=Ext.getCmp("er_stdate").dataArray;var a=Ext.getCmp("er_enddate").dataArray;d+="&er_timeline="+Ext.getCmp("er_timeline").getValue()+"&startdate="+n+"&enddate="+a+"&starthr="+Ext.getCmp("er_sthr").dataArray+"&endhr="+Ext.getCmp("er_endhr").dataArray+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin;
d+="&timefrom="+l+"&minfrom="+u+"&timeto="+e+"&minto="+s;d+="&er_excwe="+w;var b=new Array();if(c=="foreground"){d+="&er_reportgenration="+c+"&responseType=json";}else{y=checkFileName(y);d+="&er_reportgenration="+c+"&bg_reportname="+y;}}if(h){if(appConstants.publicJsonData.hasOwnProperty("hiddenFields")){var j=appConstants.publicJsonData.hiddenFields;
for(var f in j){if(this.isNewFav!=undefined&&this.isNewFav){if(f!=undefined&&f=="ID"){continue;}if(f!=undefined&&f=="FavoriteId"){continue;}}d+="&"+f+"="+j[f];}}}d+="&er_RmDispName="+appConstants.er_RmDispName;d+="&chartType="+appConstants.chartType;d+="&fromRunBtn="+appConstants.fromRunBtn;d+="&viaEntryNode="+appConstants.viaEntryNode;
d+="&drillSes="+appConstants.drillDown;if(v){var g=this.getCheckedInfo();if(g!=undefined&&g.length>0){d+="&checkedFilterData="+this.getCheckedInfo();}var r=Ext.getCmp("durationStartId");var p=Ext.getCmp("durationEndId");var q=Ext.getCmp("guidFieldId");var m=Ext.getCmp("showByID");if(r!=undefined&&r.getValue().length>0){d+="&durationStart="+r.getValue();
}else{if(r==undefined&&appConstants.publicJsonData.durationStart!=undefined){d+="&durationStart="+appConstants.publicJsonData.durationStart;}}if(p!=undefined&&p.getValue().length>0){d+="&durationEnd="+p.getValue();}else{if(p==undefined&&appConstants.publicJsonData.durationEnd!=undefined){d+="&durationEnd="+appConstants.publicJsonData.durationEnd;
}}if(q!=undefined&&q.getValue().length>0){d+="&guidField="+q.getValue();}else{if(q==undefined&&appConstants.publicJsonData.guidField!=undefined){d+="&guidField="+appConstants.publicJsonData.guidField;}}if(m!=undefined){showByVal=Ext.getCmp("showByID").getValue()["testType"];d+="&showBy="+showByVal;}}if(keepResult){d+="&overAllRecCount="+appConstants.totalRec+"&dataPageNo="+appConstants.currentPage;
}else{appConstants.currentPage=1;appConstants.totalRec=0;customPaging=true;}return d;},boxready:function(){var a=this;if(!appConstants.hideBackButton){Ext.getCmp("mainform").add({xtype:"hidden",id:"ID",name:"ID",value:appConstants.publicJsonData["ID"]});}this.getMain().setTitle(appConstants.er_RmDispName);
if(appConstants.frmFavModify!=undefined&&appConstants.frmFavModify=="Yes"){return;}if(appConstants.frmSchModify!=undefined&&appConstants.frmSchModify=="Yes"){return;}if(appConstants.isForceSubmit=="true"||appConstants.isSubmit=="true"){this.clearSessionInfo(this.foregroundControllerUrl,this.getQueryString(true,true,true)+"&checkedFilterData="+checkedFilterData);
}},onChangeReportGeneration:function(a){this.disableTools();Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();if(a.getValue()=="background"){Ext.getCmp("bgReportName").setValue("");Ext.getCmp("bgReportName").show();}else{if(a.getValue()=="background-csv"){Ext.getCmp("bgReportName").setValue("");
Ext.getCmp("bgReportName").show();}else{if(a.getValue()=="background-xls"){Ext.getCmp("bgReportName").setValue("");Ext.getCmp("bgReportName").show();}else{Ext.getCmp("submitViaSetting").hide();Ext.getCmp("moreOptionCloseId").show();Ext.getCmp("bgReportName").hide();}}}},loadForm:function(){this.loadFormFields();
var d=appConstants.frmSchModify;var a=appConstants.frmFavModify;if(d=="Yes"||a=="Yes"){Ext.getCmp("submit").hide();Ext.getCmp("save").show();Ext.getCmp("favoriteTool").setDisabled(true);Ext.getCmp("scheduleTool").setDisabled(true);}else{Ext.getCmp("submit").show();Ext.getCmp("save").hide();}var c=appConstants.publicJsonData.selectedFields.startDateForDisplay;
var b=Ext.getCmp("er_stdate");b.setValue(c);b.dataArray=c;c=appConstants.publicJsonData.selectedFields.endDateForDisplay;b=Ext.getCmp("er_enddate");b.setValue(c);b.dataArray=c;Ext.getCmp("er_sthr").setValue(appConstants.publicJsonData.selectedFields.startHourForDisplay);Ext.getCmp("er_endhr").setValue(appConstants.publicJsonData.selectedFields.endHourForDisplay);
Ext.getCmp("er_sthr").dataArray=appConstants.publicJsonData.selectedFields.startHour;Ext.getCmp("er_endhr").dataArray=appConstants.publicJsonData.selectedFields.endHour;stmin=appConstants.publicJsonData.selectedFields.startMinForDisplay;enmin=appConstants.publicJsonData.selectedFields.endMinForDisplay;
mgr_stmin=appConstants.publicJsonData.selectedFields.startmin;mgr_enmin=appConstants.publicJsonData.selectedFields.endmin;Ext.getCmp("er_stmin").setValue(stmin);Ext.getCmp("er_endmin").setValue(enmin);},toggleSummary:function(b,d,a){var c=Ext.getCmp("collapse_summary_img");if(d){Ext.get("collapse_summary_img").select(".onOffSwitch").animate({duration:200,to:{left:0,},listeners:{afteranimate:function(){c.setText("OFF");
Ext.getCmp("summaryPanel").hide();},scope:this}});}else{Ext.get("collapse_summary_img").select(".onOffSwitch").animate({duration:200,to:{left:20,},listeners:{afteranimate:function(){c.setText("ON");Ext.getCmp("summaryPanel").show();},scope:this}});}},toggleChildTables:function(b){var a=$("#"+b+"_img").hasClass("iconTreeExpand");
if(a){if(b=="durationContainerId"){Ext.getCmp("durationContainerId").show();$("#"+b+"_img").removeClass("iconTreeExpand");$("#"+b+"_img").addClass("iconTreeCollapse");}else{if(b=="radioGrp"){Ext.getCmp("showByID").show();$("#"+b+"_img").removeClass("iconTreeExpand");$("#"+b+"_img").addClass("iconTreeCollapse");
}else{$("#"+b).fadeIn("slow",function(){$("#"+b+"_img").removeClass("iconTreeExpand");$("#"+b+"_img").addClass("iconTreeCollapse");Ext.getCmp("filterContainerId").doLayout();});}}}else{if(b=="durationContainerId"){Ext.getCmp("durationContainerId").hide();$("#"+b+"_img").removeClass("iconTreeCollapse");
$("#"+b+"_img").addClass("iconTreeExpand");}else{if(b=="radioGrp"){Ext.getCmp("showByID").hide();$("#"+b+"_img").removeClass("iconTreeCollapse");$("#"+b+"_img").addClass("iconTreeExpand");}else{$("#"+b).fadeOut("slow",function(){$("#"+b+"_img").removeClass("iconTreeCollapse");$("#"+b+"_img").addClass("iconTreeExpand");
Ext.getCmp("filterContainerId").doLayout();});}}}},loadFiterData:function(a,g,h){if(a!=undefined){var b=Ext.getCmp("filterContainerId");b.removeAll();var d=new Ext.XTemplate('<div class="">','<tpl for=".">','<div class="checkGroups" style="padding:0px">','<div class="checkGroupHead"><img id="{id}_img"style="position:relative;top:4px" src="../images/spacer.gif" class="iconTreeCollapse"  onclick=\'javascript:toggleChildTables("{id}");\'/>{groupHead}&nbsp;','<div class="checkGroupClear" style="width:45px;cursor:pointer;float:right;margin-top:5px;text-align:right;" onclick=\'javascript:clearByGroup("{groupHead}","{id}");\'>',"<tpl if=\"clear == 'yes'\">",'<span style="text-decoration-line:underline;font-weight:400">'+ClearTxt+"</span>","</tpl>","</div>","</div>",'<div id="{id}"  class="btmSlideOut">',"<form>",'<tpl for="child">','<div style="padding:2px;width:200px;white-space:nowrap;overflow:hidden; text-overflow:ellipsis;">','<label class="checkLabel"><input class="htmlCheckbox12" type="checkbox"  id="{parent.id}_{[xindex-1]}" name="input" onclick=\'javascript:filterEventsChange("{value}","{parent.id}",false);\' <tpl if="isChecked">checked</tpl> value="{value}"/><span data-qclass="yellowTip" data-qtip="{value}">{name} </span></label>',"</div>","</tpl>","</form>",'<div class="checkGroupClear" style="width:45px;cursor:pointer;float:right;text-align:right;" onclick=\'javascript:alternateViewFunction("{groupHead}","{id}");\'>',"<tpl if=\"maxView == 'yes'\">",'<span style="text-decoration-line:underline;">more</span>',"</tpl>","</div>","</div>","</div>","</tpl>","</div>",'<div style="both:clear"></div>');
b.add({xtype:"container",hidden:true,html:'<div class="checkGroupHead" style="font-weight:500"><img id="radioGrp_img"style="position:relative;top:4px" src="../images/spacer.gif" class="iconTreeCollapse"  onclick=\'javascript:toggleChildTables("radioGrp");\'/>Show by</div>'});b.add({xtype:"radiogroup",labelSeparator:"",labelAlign:"top",hidden:true,id:"showByID",labelWidth:80,columns:1,margin:"0 0 0 0",padding:0,bodyPadding:0,defaults:{cls:"radiobt",noWrap:true,},items:[{boxLabel:"Both",name:"testType",inputValue:"both",id:"both",width:150,hidden:true},{boxLabel:"Auto Discover Test",name:"testType",inputValue:"auto",id:"auto",width:150},{boxLabel:"Other BTM Test",name:"testType",margin:"0 0 10 0",inputValue:"forced",id:"forced",width:150,},]});
b.add({xtype:"dataview",store:Ext.data.Store({model:checkBoxDataModel,data:a,}),tpl:d});b.add({xtype:"container",html:'<div class="checkGroupHead" style="font-weight:500"><img id="durationContainerId_img"style="position:relative;top:4px" src="../images/spacer.gif" class="iconTreeCollapse"  onclick=\'javascript:toggleChildTables("durationContainerId");\'/>Response Time (ms)</div>'});
b.add({xtype:"container",id:"durationContainerId",layout:"hbox",defaults:{labelSeparator:"",},items:[{xtype:"textfield",width:96,cls:"textbox",fieldLabel:"From",id:"durationStartId",labelWidth:30,value:h.durationStart,margin:"5 3 5 5",maskRe:/[0-9 ]/},{xtype:"textfield",cls:"textbox",fieldLabel:" To ",id:"durationEndId",width:96,labelWidth:20,value:h.durationEnd,margin:"5 5 5 0",maskRe:/[0-9 ]/}]});
b.add({xtype:"container",margin:"5 10 0 0",html:'<div class="checkGroupHead" style="font-weight:500"><img id="guidFieldId_img"style="position:relative;top:4px" src="../images/spacer.gif" class="iconTreeCollapse"  onclick=\'javascript:toggleChildTables("guidFieldId");\'/>Search by GUID</div>',});b.add({xtype:"textfield",cls:"textbox",id:"guidFieldId",value:h.guidField,labelAlign:"top",labelSeparator:"",width:200,margin:"10 10 0 0"});
if(h.showBy!=undefined){if(h.showBy=="both"){Ext.getCmp("both").setValue(true);}else{if(h.showBy=="forced"){Ext.getCmp("forced").setValue(true);}else{Ext.getCmp("auto").setValue(true);}}}else{Ext.getCmp("auto").setValue(true);}var e=Ext.getCmp("selectedCheckValueId");e.removeAll();if(g>0){var j=g;if(j>15){j=15;
}e.show();var d=new Ext.XTemplate('<div style="min-height:24px;max-height:46px;height:auto;overflow:auto">','<div style="padding:2px 0px 2px 2px;float:left" class="resultForFont">'+Filtered_ByTxt+":&nbsp;</div>",'<tpl for=".">',"<form>",'<tpl for="checkedList">',"<tpl>",'<div class="checkValueBg" value="{.}" data-qclass="yellowTip" data-qtip="{.}" onclick=\'javascript:filterEventsChange("{.}","{parent.id}",true);event.stopPropagation();\'><img src="../images/spacer.gif" class="iconClose12" style="vertical-align:text-bottom;position:relative;top:0px">&nbsp;{.}</div>',"</tpl>","</tpl>","</form>","</tpl>",'<div style="clear:both;padding:0px;line-height:1px;"></div>',"</div>");
var i=Ext.getCmp("durationEndId").getValue();var c=Ext.getCmp("durationStartId").getValue();var n="";if(i!=undefined&&c!=undefined&&c!=""&&i!=""){n="Response Time From "+c+" to "+i;}else{if(c!=undefined&&c!=""){n="Response Time From "+c;}else{if(i!=undefined&&i!=""){n="Response Time Upto "+i;}}}var m=new Array();
if(n!=""){console.log("dataJson  ",a);for(var f in a){m.push(a[f]);}var l=new Object();l.id="Response_time";var k=new Array();k.push(n);l.checkedList=k;m.push(l);console.log("updatedDataJson  ",m);}else{m=a;}e.add({xtype:"dataview",store:Ext.data.Store({model:checkBoxDataModel,data:m,}),tpl:d});}else{e.show();
var i=Ext.getCmp("durationEndId").getValue();var c=Ext.getCmp("durationStartId").getValue();var n="";if(i!=undefined&&c!=undefined&&c!=""&&i!=""){n="Response Time From "+c+" to "+i;}else{if(c!=undefined&&c!=""){n="Response Time From "+c;}else{if(i!=undefined&&i!=""){n="Response Time Upto "+i;}else{e.hide();
}}}if(n!=""){e.add({xtype:"container",html:'<div class="checkValueBg" style="max-width:200px" value="'+n+'" data-qclass="yellowTip" data-qtip="'+n+'" onclick=\'javascript:filterEventsChange("'+n+'","Response_time",true);event.stopPropagation();\'><img src="../images/spacer.gif" class="iconClose12" style="vertical-align:text-bottom;position:relative;top:0px">&nbsp;'+n+"</div>"});
}else{e.show();e.add({xtype:"container",html:'<div style="min-height:24px;max-height:46px;height:auto;overflow:auto">'+'<div style="padding:2px 0px 2px 2px;float:left" class="resultForFont">'+Filtered_ByTxt+":&nbsp;</div>"+'<div class="checkValueBg checkValueEmpty" style="max-width:200px" value="Empty" data-qclass="yellowTip" data-qtip="Empty"><img src="../images/spacer.gif" style="vertical-align:text-bottom;position:relative;top:0px">&nbsp;Empty&nbsp;</div>'+"</div>"});
}}}},filterEventsChange:function(g,b,e){var a=appConstants.filterDetails;if(a!=undefined&&b!="Response_time"){for(var d in a){var f=a[d];if(f.id==b){var c=f.checkedList;if(c.indexOf(g)>-1){c.splice(c.indexOf(g),1);}else{c.push(g);}f.checkedList=c;a[d]=f;}}appConstants.filterDetails=a;}else{if(b=="Response_time"){Ext.getCmp("durationStartId").setValue("");
Ext.getCmp("durationEndId").setValue("");}}if(e){this.showResult(Ext.getCmp("submit"));}},MaxViewfilterEventsChange:function(g,b){var e=Ext.getCmp(b+"_left").checkedList;var a=new Array();for(var d in e){var f=e[d];a.push(f);}if(a!=undefined){if(a.indexOf(g)>-1){a.splice(a.indexOf(g),1);}else{a.push(g);
}Ext.getCmp(b+"_left").checkedList=a;if(a.length>0){Ext.getCmp(b+"_chkBtn").setValue(true);}else{Ext.getCmp(b+"_chkBtn").setValue(false);}for(var c in appConstants.dummyArray){if(appConstants.dummyArray[c].value==g){if(appConstants.dummyArray[c].isChecked){appConstants.dummyArray[c].isChecked=false;}else{appConstants.dummyArray[c].isChecked=true;
}break;}}}},clearByGroup:function(h,c){var b=appConstants.filterDetails;if(b!=undefined){var a=false;for(var f in b){var g=b[f];if(g.id==c&&g.checkedList.length>0){g.checkedList=[];var e=g.child;for(var d in e){document.getElementById(c+"_"+d).checked=false;}b[f]=g;a=true;break;}}if(a){appConstants.filterDetails=b;
}}},alternateViewFunction:function(a,b){Ext.getCmp("filterWithGridContainer").hide();Ext.getCmp("filterAllContainer").show();Ext.getCmp("filterSearchBox").setValue("");this.loadMaxFilterAllContainer(b);},loadMaxFilterAllContainer:function(b){var g=Ext.getCmp("groupHeadLeft");var h=this;g.removeAll();
g.add(Ext.create("Ext.container.Container",{html:'<div style="clear:both;margin-bottom:5px;margin-left:10px;" class="font_bold14">'+Refine_byTxt+"</div>"}));var a=appConstants.filterDetails;if(a!=undefined&&a!="undefined"){for(var f=0;f<a.length;f++){var e=a[f];var j="";var d=false;var c="";if(e.id==b){j=" checkBoxButtonPressed";
appConstants.pressedSection=b;}if(e.checkedList!=undefined&&e.checkedList.length>0){d=true;if(e.id!=b){c=" deactivated";}}g.add({xtype:"container",layout:"hbox",height:30,width:204,id:e.id+"_container",cls:"checkBoxButtonNotPressed"+j,margin:"0 0 0 5",padding:"5 0 0 3",items:[{xtype:"checkbox",cls:"checkbox12"+c,margin:"0 5 0 0",id:e.id+"_chkBtn",checked:d,listeners:{"change":function(o){var p=o.id;
p=p.replace("_chkBtn","");if(!o.checked){var m=Ext.getCmp(p+"_left");if(o.hasCls("deactivated")){o.removeCls("deactivated");}if(appConstants.pressedSection==p&&m.checkedList.length>0){var i=appConstants.dummyArray;for(var l in i){i[l].isChecked=false;}var n=Ext.getCmp("allFilterContainerData");var k=n.dummyArray;
k[0].child=i;k[0].checkedList=[];n.getStore().loadRawData(k);}m.checkedList=[];}else{if(appConstants.pressedSection!=p){o.addCls("deactivated");}}}}},{xtype:"label",width:170,style:{"cursor":"pointer"},id:e.id+"_left",checkedList:e.checkedList,text:e.groupHead,listeners:{render:function(i){i.getEl().on("click",function(){var k=i.id;
k=k.replace("_left","");if(appConstants.pressedSection==k){return;}else{if(Ext.getCmp(k+"_chkBtn").hasCls("deactivated")){Ext.getCmp(k+"_chkBtn").removeCls("deactivated");}if(Ext.getCmp(appConstants.pressedSection+"_chkBtn").checked){Ext.getCmp(appConstants.pressedSection+"_chkBtn").addCls("deactivated");
}Ext.getCmp(appConstants.pressedSection+"_container").removeCls("checkBoxButtonPressed");Ext.getCmp(k+"_container").addCls("checkBoxButtonPressed");}h.loadAllFilterContainer(k,true,i.checkedList);appConstants.pressedSection=k;},i);}}}]});}this.loadAllFilterContainer(b,false,null);}else{Ext.getCmp("filterWithGridContainer").show();
Ext.getCmp("filterAllContainer").hide();}},loadAllFilterContainer:function(f,b,c){var a="";if(b){a=this.getQueryString(false,true,true);}else{a=this.getQueryString(true,true,true);}if(b){a+="&checkedFilterData="+this.getMaxViewCheckedInfo(f,c);}a+="&forUniqueData=yes&columnName="+f;var d=this;var e=Ext.getCmp("allFilterContainerData");
e.hide();initLdgMask.show();Ext.Ajax.request({url:d.foregroundControllerUrl,params:a,scope:this,success:function(i){initLdgMask.hide();var j=Ext.decode(i.responseText);var h=j.filterDetails;var g=j.filterDetailsDummy;if(h!=undefined){e.show();e.getStore().loadRawData(h);e.dummyArray=h;appConstants.dummyArray=g[0].child;
}}});},loadFormFields:function(){this.loadComboField("er_option","analysisByCombo","analysisComboLabel","selectedAnalysisByCombo",appConstants.publicJsonData,false,null,true);this.loadComboField("er_timeline","timelineCombo","timelineComboLabel","selectedTimeline",appConstants.publicJsonData,false,null,false);
if(appConstants.publicJsonData.combo.siteCombo!=undefined){Ext.getCmp("er_site").show();this.loadComboField("er_site","siteCombo","siteComboLabel","selectedSiteCombo",appConstants.publicJsonData,false,null,true);}this.loadComboField("er_compType","compTypeCombo","compTypeComboLabel","selectedCompTypeCombo",appConstants.publicJsonData,false,null,true);
this.loadComboField("er_component","componentCombo","componentLabel","componentSelected",appConstants.publicJsonData,true,"componentpane",false);},loadSettings:function(){var c=appConstants.publicJsonData.hiddenFields;var b=c["FavoriteId"];if(!Ext.isEmpty(b)){Ext.getCmp("reportGeneration").setDisabled(true);
}Ext.getCmp("moreOptionCloseId").show();this.loadComboField("er_excwe","excludeWeekendsCombo","excludeWeekendsLabel","excludeWeekendsSelected",appConstants.publicJsonData,false,null,true);this.loadComboField("reportGeneration","reportGenerationCombo","reportGenerationLabel","reportGenerationSelected",appConstants.publicJsonData,false,null,true);
var a=appConstants.publicJsonData.selectedFields;Ext.getCmp("timefrom").setValue(a.selectedTimeFrom);Ext.getCmp("minfrom").setValue(a.selectedMinsFrom);Ext.getCmp("timeto").setValue(a.selectedTimeTo);Ext.getCmp("minto").setValue(a.selectedMinsTo);if(a.hasOwnProperty("reportNameSelected")){Ext.getCmp("bgReportName").setValue(a.reportNameSelected);
}a=null;delete a;},showConfigDropdown:function(){Ext.widget("configform");isSettingsEnabled=true;var a=this;Ext.get("closeSettings").on("click",function(){a.validateAndCloseSettings();});},validateAndCloseSettings:function(){if(this.validateSettings()){Ext.get("configMod").animate({duration:500,to:{y:-500}});
return true;}return false;},closeSettingAndSubmit:function(){if(this.validateAndCloseSettings()){this.showResult();}},loadComboField:function(c,f,g,i,e,b,j,k){var h=Ext.ComponentManager.get(c);if(e.combo.hasOwnProperty(f)){var a=e.combo[f];h.getStore().clearFilter(true);h.getStore().loadRawData(a);if(e.selectedFields.hasOwnProperty(i)){h.setValue(e.selectedFields[i]);
}else{h.setValue(a[0].valueField);}if(k){if(e.labelFields.hasOwnProperty(g)){if(!b){h.setFieldLabel(e.labelFields[g]);}else{Ext.ComponentManager.get(j).setFieldLabel(e.labelFields[g]);}}}if(!b){if(h.isHidden()){h.show();}}else{var d=Ext.ComponentManager.get(j);if(d.isHidden()){d.show();}}}else{if(!b){if(!h.isHidden()){h.hide();
}}else{var d=Ext.ComponentManager.get(j);if(!d.isHidden()){d.hide();}}}},loadTools:function(){if(appConstants.isDrillDown){this.getNewUtilities().loadIcon(true,true,true,false,true,false,false,false,false,false,false);}else{this.getNewUtilities().loadIcon(true,true,true,false,true,true,true,false,false,false,true);
Ext.getCmp("favoriteTool").setDisabled(false);Ext.getCmp("scheduleTool").setDisabled(false);}},toggleForm:function(b){Ext.getCmp("panelinsidetoggle").show();Ext.getCmp("panelinsidetoggle").setDisabled(false);var a=Ext.getCmp("mainform");if(a.isHidden()){a.show();Ext.getCmp("selectionDetails").hide();
}else{a.hide();Ext.getCmp("selectionDetails").show();}},getMessageBox:function(b,a){Ext.MessageBox.show({title:b,msg:a,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return false;},validateMainForm:function(k){var c=appConstants.publicJsonData.hiddenFields;var g=c.getMaxDaysInMonth;var h=c.userTimeline;
var i=Ext.getCmp("er_timeline").getValue();var l=Ext.getCmp("er_stdate").getValue();var a=Ext.getCmp("er_enddate").getValue();var f=Ext.getCmp("er_sthr").getValue();var j=Ext.getCmp("er_endhr").getValue();l.setHours(f);a.setHours(j);var d=appConstants.publicJsonData.selectedFields.reportGenerationSelected;
if(isSettingsEnabled){d=Ext.getCmp("reportGeneration").getValue();}if(h!=null&&h!="-1"){var n=isUserTimelineLimitExceeded(h,g,l,a);if(!n){Ext.MessageBox.show({title:alert_text,msg:_invalidUserTime,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return false;}}obj=Ext.getCmp("er_option");if(obj.getValue()=="-1"){this.getMessageBox(alert_text,reportTypeMsg);
return false;}obj=Ext.getCmp("er_site");if(obj.getValue()==""||(obj.getValue()=="-1"&&!obj.isHidden())){this.getMessageBox(alert_text,pleaseChooseTxt+" "+obj.getFieldLabel());return false;}obj=Ext.getCmp("er_compType");if(obj.getValue()==""||(obj.getValue()=="-1"&&!obj.isHidden())){this.getMessageBox(alert_text,pleaseChooseTxt+" "+obj.getFieldLabel());
return false;}obj=Ext.getCmp("er_component");if(obj.getValue()==""||(obj.getValue()=="-1"&&!obj.isHidden())){this.getMessageBox(alert_text,componentMsg);return false;}var b=obj.getValue();if(b.length>1&&b.indexOf("All")>-1){this.getMessageBox(alert_text,all_singleErrTxt);return false;}if(d=="foreground"){if(k&&!keepResult){var e=c.limitforbg;
if(!Ext.isEmpty(e)){if(!checkTimeLineForBgLimit(e,g,l,a)){Ext.MessageBox.confirm("Confirm",appConstants.forGrdReportConfirmMsg,this.showConfirmResult,this);return false;}}}}else{var m=Ext.getCmp("bgReportName").getValue();if(!validateTextBoxWithSpecialChars(m,"Attachment",true)){return false;}}return true;
},validateMainFormForFavAndSch:function(){var c=appConstants.publicJsonData.hiddenFields;var f=c.getMaxDaysInMonth;var g=c.userTimeline;var h=Ext.getCmp("er_timeline").getValue();var k=Ext.getCmp("er_stdate").getValue();var a=Ext.getCmp("er_enddate").getValue();var e=Ext.getCmp("er_sthr").getValue();
var j=Ext.getCmp("er_endhr").getValue();k.setHours(e);a.setHours(j);var d=appConstants.publicJsonData.selectedFields.reportGenerationSelected;if(isSettingsEnabled){d=Ext.getCmp("reportGeneration").getValue();}if(g!=null&&g!="-1"){var l=isUserTimelineLimitExceeded(g,f,k,a);if(!l){Ext.MessageBox.show({title:alert_text,msg:_invalidUserTime,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}}var i=Ext.getCmp("select_farm");if(i.getValue()=="-1"){this.getMessageBox(alert_text,i.getStore().getAt(0).get("displayField"));return false;}i=Ext.getCmp("er_compType");if(i.getValue()=="-1"){this.getMessageBox(alert_text,compTypeMsg);return false;}i=Ext.getCmp("er_component");if(i.getValue()==""||(i.getValue()=="-1"&&!i.isHidden())){this.getMessageBox(alert_text,componentMsg);
return false;}var b=i.getValue();if(b.length>1&&b.indexOf("All")>-1){this.getMessageBox(alert_text,all_singleErrTxt);return false;}return true;},showConfirmResult:function(c){if(c=="yes"){var b=Ext.getCmp("submit");b.setDisabled(false);if(isSettingsEnabled){Ext.get("configMod").animate({duration:500,to:{y:-500}});
}console.log("keepResult",keepResult);if(keepResult){if(Ext.getCmp("vengat")!=undefined){console.log("test   ",Ext.getCmp("vengat").filterDetails);appConstants.filterDetails=Ext.getCmp("vengat").filterDetails;}}this.clearSessionInfo(this.foregroundControllerUrl,this.getQueryString(true,true,true));}else{this.getReporterSettings().down("button").fireHandler();
var a=Ext.getCmp("reportGeneration");var d=Ext.getCmp("bgReportName");a.setValue("background");d.setValue("");d.show();Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();d.focus(false,1000);validateTextBoxWithSpecialChars(d.getValue(),"Attachment",true);return false;}},validateSettings:function(){var a=true;
var e=Ext.getCmp("reportGeneration").getValue();var c=Ext.getCmp("timefrom").getValue();var d=Ext.getCmp("minfrom").getValue();var b=Ext.getCmp("timeto").getValue();var f=Ext.getCmp("minto").getValue();if(!checkTimePeriod(c,d,b,f)){a=false;}if(e!=null&&(e=="background"||e=="background-xls"||e=="background-csv")){var g=Ext.getCmp("bgReportName").getValue();
if(!validateTextBoxWithSpecialChars(g,"Attachment",true)){a=false;}}return a;},getNumberFormat:function(a){if(!isNaN(a)&&!isNaN(parseFloat(a))||a=="-"){if(a!=null&&a.indexOf(".")>-1){strDecimal=a.substring(a.indexOf("."));str=a.substring(0,a.indexOf("."));a='<span class="decimal-align">'+str+'</span><span class="decimal-align2">'+strDecimal+"</span>";
}else{a='<span class="decimal-align">'+a+"</span>";}}return a;},getCheckedInfo:function(){var f="";var a=appConstants.filterDetails;if(a!=undefined&&!Ext.isEmpty(a)){for(var e in a){var g=a[e];var d=g.checkedList;var c="";for(var b in d){c+=d[b]+",";}if(c.length>0){f+=g.id+"#"+c.substring(0,c.length-1)+"|";
}}}if(f.length>0){f=f.substring(0,f.length-1);f=Ext.widget("erutils").specialCharEncode(f);}return f;},getMaxViewCheckedInfo:function(e,c){var d="";if(c!=undefined&&c.length>0){var b="";for(var a in c){b+=c[a]+",";}if(b.length>0){d+=e+"#"+b.substring(0,b.length-1)+"|";}}if(d.length>0){d=d.substring(0,d.length-1);
d=Ext.widget("erutils").specialCharEncode(d);}return d;},doSearchFilter:function(){var e=Ext.getCmp("filterSearchBox");var c=Ext.getCmp("allFilterContainerData");var g=Ext.getCmp("allFilterContainerData").dummyArray;var d=new Array();if(g!=null&&g!=undefined&&g.length>0){if(Ext.String.trim(e.value).length>0&&(Ext.String.trim(e.value)!=""||Ext.String.trim(e.value)!=null)){var f=RegExp(e.value,"i");
for(var i in appConstants.dummyArray){var a=appConstants.dummyArray[i];if(a!=undefined){var b=false;var h=a.value;b=b||f.test(String(h));if(b){d.push(a);}}}g[0].child=d;}else{for(var i in appConstants.dummyArray){var a=appConstants.dummyArray[i];if(a!=undefined){d.push(a);}}g[0].child=d;}c.getStore().removeAll();
c.getStore().loadRawData(g);e.focus();}}});