Ext.define("thinclientapplicationreports.controller.ThinclientApplicationReports",{extend:"Ext.app.Controller",gridColStateParam:"ASC",gridColIndexParam:-1,views:["Main"],refs:[{selector:"main",ref:"main"},{selector:"newUtilities",ref:"newUtilities"},{selector:"thinclientapplicationform",ref:"thinclientapplicationform"},{selector:"egcomponent",ref:"egcomponent"},{selector:"mainform",ref:"mainform"},{selector:"thinclientapplicationsettings",ref:"thinclientapplicationsettings"},{selector:"nomeasurepanel",ref:"nomeasurepanel"},{selector:"backGroundPanel",ref:"backGroundPanel"},{selector:"ReporterSettings",ref:"ReporterSettings"}],init:function(){this.control({"main":{"boxready":this.afterMainRender},"mainform":{"afterrender":this.loadFormElements},"thinclientapplicationsettings":{"afterrender":this.loadSettingsElements},"newUtilities":{"afterrender":this.loadTools},"newUtilities > #printTool > button":{"click":this.printReport},"newUtilities > #saveTool > button":{"click":this.saveReportAsPDF},"newUtilities > #mailTool > button":{"click":this.sendMail},"newUtilities > #csvTool > button":{"click":this.saveCsv},"newUtilities > #favoriteTool > button":{"click":this.saveFavorite},"newUtilities > #scheduleTool > button":{"click":this.saveSchedule},'timeline combo[name="er_mode"]':{"select":this.changeEr_mode},'mainform combo[name="select_farm"]':{"select":this.zoneOnChange},'mainform combo[name="report_category"]':{"select":this.reportCatChange},'mainform combo[name="er_type"]':{"select":this.reportTypeOnChange},'mainform multiselect[name="er_server"]':{"change":this.serverOnChange},'mainform button[id="expandAppln"]':{"click":this.expandAppln},'mainform combo[name="er_compType"]':{"select":this.compTypeOnChange},'mainform combo[name="er_workgrpname"]':{"select":this.workerGroupOnChange},'thinclientapplicationsettings combo[name="reportGeneration"]':{"select":this.reportGenChange},'thinclientapplicationsettings button[id="moreOptionCloseId"]':{"click":this.validateAndCloseSettings},'thinclientapplicationsettings button[id="submitViaSetting"]':{"click":this.closeSettingAndSubmit},'thinclientapplicationsettings textfield[name="exeAppTxtField"]':{"change":this.excludeAppChange},'mainform button[name="submit"]':{"click":this.showResult},'mainform button[name="save"]':{"click":this.goTo},'mainform button[id="panelinsidetoggle"]':{"click":this.toggleForm},'mainform button[id="expandSelectorActivity"]':{"click":this.expandMeActivity},'mainform button[id="expandSelectorUsage"]':{"click":this.expandMeUsage},'mainform trigger[id="compSearch"]':{"change":this.filterMultiselect},'mainform trigger[id="appSearch"]':{"change":this.filterMultiselect},'mainform combo[id="er_option"]':{"select":this.onSelectAnalysisBy},'mainform combo[id="er_site"]':{"select":this.er_siteOnChange}});
},onSelectAnalysisBy:function(c){var b=c.getValue();var d="er_option="+b+"&er_type="+Ext.getCmp("er_type").getValue();var a="";if(targetType=="Application Usage"){a="/final/reporter/ErAppUsageReportJson.jsp";}else{a="/final/reporter/ErCtxApplicationReportJson.jsp";}Ext.Ajax.request({url:a,params:d,success:function(g){var i=Ext.decode(g.responseText);
var h;if(targetType=="Application Usage"){if(b=="Zone"){Ext.getCmp("er_site").hide();h=Ext.getCmp("select_farm");h.getStore().clearFilter(true);h.getStore().loadRawData(i.zoneCombo);h.setFieldLabel(screenLabels["reporter.consolidated.Zone"]);h.setValue(i.selectedZone);h.show();}else{if(b=="Component"){Ext.getCmp("select_farm").hide();
Ext.getCmp("er_site").hide();}else{Ext.getCmp("select_farm").hide();h=Ext.getCmp("er_site");h.getStore().clearFilter(true);h.getStore().loadRawData(i.siteCombo);h.setFieldLabel(i.siteComboLabel);h.setValue(i.selectedSiteCombo);h.show();}}h=Ext.getCmp("er_application_usage");h.getStore().clearFilter(true);
h.getStore().loadRawData(i.applnCombo);h.setValue(i.selectedAppln);h=Ext.getCmp("er_compType");h.getStore().clearFilter(true);h.getStore().loadRawData(i.compTypeCombo);h.setValue(i.selectedCompType);h=Ext.getCmp("er_server");h.getStore().loadRawData(i.componentCombo);h.setValue(i.selectedComponents);
}else{if(b=="Zone"){Ext.getCmp("er_site").hide();h=Ext.getCmp("select_farm");h.getStore().clearFilter(true);h.getStore().loadRawData(i.zoneCombo);h.setValue(i.selectedZone);h.show();}else{if(b=="Component"){Ext.getCmp("select_farm").hide();Ext.getCmp("er_site").hide();}else{Ext.getCmp("select_farm").hide();
h=Ext.getCmp("er_site");h.getStore().clearFilter(true);h.getStore().loadRawData(i.siteCombo);h.setFieldLabel(i.siteComboLabel);h.setValue(i.selectedSiteCombo);h.show();}}h=Ext.getCmp("er_compType");h.getStore().clearFilter(true);h.getStore().loadRawData(i.componentTypeCombo);h.setValue(i.selectedComponentType);
var f=Ext.getCmp("er_type").getValue();if(f=="Yes"){h=Ext.getCmp("select_testmes");h.getStore().clearFilter(true);h.getStore().loadRawData(i.measureCombo);h.setValue(i.selectedMeasure);h.show();Ext.getCmp("egcomponent").hide();}else{Ext.getCmp("select_testmes").hide();h=Ext.getCmp("er_server");h.getStore().loadRawData(i.serverCombo);
h.setValue(i.selectedServer);comboRawData=i.serverCombo;appConstants.rawDataForComponents=comboRawData;h=Ext.getCmp("er_application");h.getStore().loadRawData(i.applnCombo);h.setValue(i.selectedAppln);Ext.getCmp("egcomponent").show();comboRawData=i.applnCombo;appConstants.rawDataForApplication=comboRawData;
}}}});},er_siteOnChange:function(b){var d=b.getValue();var c;var a="";if(targetType=="Application Usage"){a="/final/reporter/ErAppUsageReportJson.jsp";c="er_option="+Ext.getCmp("er_option").getValue()+"&er_site="+encodeURIComponent(d);}else{a="/final/reporter/ErCtxApplicationReportJson.jsp";c="er_option="+Ext.getCmp("er_option").getValue()+"&er_site="+encodeURIComponent(d)+"&er_type="+Ext.getCmp("er_type").getValue();
}Ext.Ajax.request({url:a,params:c,method:"GET",success:function(g){var h;var i=Ext.decode(g.responseText);if(targetType=="Application Usage"){h=Ext.getCmp("er_compType");h.getStore().clearFilter(true);h.getStore().loadRawData(i.compTypeCombo);h.setValue(i.selectedCompType);h=Ext.getCmp("er_application_usage");
h.getStore().clearFilter(true);h.getStore().loadRawData(i.applnCombo);h.setValue(i.selectedAppln);h=Ext.getCmp("er_server");h.getStore().loadRawData(i.componentCombo);h.setValue(i.selectedComponents);}else{h=Ext.getCmp("er_compType");h.getStore().clearFilter(true);h.getStore().loadRawData(i.componentTypeCombo);
h.setValue(i.selectedComponentType);var f=Ext.getCmp("er_type").getValue();if(f=="Yes"){h=Ext.getCmp("select_testmes");h.getStore().clearFilter(true);h.getStore().loadRawData(i.measureCombo);h.setValue(i.selectedMeasure);h.show();Ext.getCmp("egcomponent").hide();}else{Ext.getCmp("select_testmes").hide();
h=Ext.getCmp("er_server");h.getStore().loadRawData(i.serverCombo);h.setValue(i.selectedServer);h=Ext.getCmp("er_application");h.getStore().loadRawData(i.applnCombo);h.setValue(i.selectedAppln);Ext.getCmp("egcomponent").show();}}}});},filterMultiselect:function(b){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}var a=b.getId();if(a=="compSearch"){compStore=appConstants.rawDataForComponents;compName="er_server";}else{if(a=="appSearch"){compStore=appConstants.rawDataForApplication;compName="er_application";}}b.toggleTriggger();appConstants.erUtils.filterComboStore(b,Ext.getCmp(compName),compStore);},changeEr_mode:function(c){var b="";
var a="";if(targetType=="Application Usage"){a=appConstants.publicjsonDataUsage["hiddenfields"]["favorite_id"];b=appConstants.publicjsonDataUsage["hiddenfields"]["fromScheduleModify"];}else{a=appConstants.publicjsonDataActivity["hiddenfields"]["favorite_id"];b=appConstants.publicjsonDataActivity["hiddenfields"]["fromScheduleModify"];
}if(!(a=="undefined"||a==undefined)||!(b==null||b=="null")){return;}Ext.get("configMod").animate({duration:250,to:{y:-530}});this.showResult();},goTo:function(a){appConstants.formButtonId=a.getId();var b="";if(targetType=="Application Usage"){b=appConstants.publicjsonDataUsage["hiddenfields"];}else{b=appConstants.publicjsonDataActivity["hiddenfields"];
}var c=b["fromScheduleModify"];if((c!=null&&c=="Yes")){this.saveSchedule();}else{this.saveFavorite();}},workerGroupOnChange:function(){Ext.getCmp("resultPanel").hide();var a=Ext.getCmp("mainform").getForm();var b="&er_zone="+a.findField("select_farm").getValue()+"&er_compType="+a.findField("er_compType").getValue()+"&er_workgrpname="+a.findField("er_workgrpname").getValue();
Ext.Ajax.request({url:"/final/reporter/ErAppUsageReportJson.jsp",params:b,scope:this,method:"GET",success:function(c){var f=c.responseText;var d=Ext.decode(f);appConstants.publicjsonDataUsage=d;comboRawData=appConstants.publicjsonDataUsage.componentCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedComponents;
comboObject=Ext.getCmp("er_server");appConstants.rawDataForComponents=comboRawData;comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboObject.resumeEvents();comboRawData=appConstants.publicjsonDataUsage.applnCombo;
selectedComboOption=appConstants.publicjsonDataUsage.selectedAppln;comboObject=a.findField("er_application_usage");comboObject.getStore().clearFilter(true);comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);
}}});},compTypeOnChange:function(){Ext.getCmp("resultPanel").hide();var c;var b=Ext.getCmp("report_category").getValue();var f=Ext.getCmp("er_option").getValue();var g="er_option="+f+"&er_compType="+Ext.getCmp("er_compType").getValue();var a=Ext.getCmp("mainform").getForm();if(targetType=="Application Usage"){var d=a.findField("select_farm").getValue();
if(f=="Zone"){g+="&er_zone="+encodeURIComponent(d);}else{g+="&er_site="+encodeURIComponent(Ext.getCmp("er_site").getValue());}}else{if(f=="Zone"){g+="&select_farm="+encodeURIComponent(Ext.getCmp("select_farm").getValue());}else{g+="&er_site="+encodeURIComponent(Ext.getCmp("er_site").getValue());}}if(b=="application_usage"){c="/final/reporter/ErAppUsageReportJson.jsp";
}else{c="/final/reporter/ErCtxApplicationReportJson.jsp";g+="&er_type="+Ext.getCmp("er_type").getValue();}Ext.Ajax.request({url:c,params:g,scope:this,method:"GET",success:function(h){var l=h.responseText;var k=Ext.decode(l);appConstants.publicjsonDataUsage=k;if(b=="application_usage"){var j;j=Ext.getCmp("er_server");
j.getStore().loadRawData(k.componentCombo);j.setValue(k.selectedComponents);if(appConstants.publicjsonDataUsage.hasOwnProperty("workerGroupCombo")){comboRawData=appConstants.publicjsonDataUsage.workerGroupCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedWorkergroup;comboObject=a.findField("er_workgrpname");
comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboObject.resumeEvents();comboObject.show();}else{comboObject=a.findField("er_workgrpname");comboObject.hide();}comboRawData=appConstants.publicjsonDataUsage.componentCombo;
selectedComboOption=appConstants.publicjsonDataUsage.selectedComponents;comboObject=Ext.getCmp("er_server");appConstants.rawDataForComponents=comboRawData;comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);
}comboObject.resumeEvents();comboRawData=appConstants.publicjsonDataUsage.applnCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedAppln;comboObject=a.findField("er_application_usage");comboObject.getStore().clearFilter(true);comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);
}else{comboObject.setValue(comboRawData[0].valueField);}}else{if(a.findField("er_type").getValue()=="No"){if(appConstants.publicjsonDataUsage.hasOwnProperty("workerGroupCombo")){comboRawData=appConstants.publicjsonDataUsage.workerGroupCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedWorkergroup;
comboObject=a.findField("er_workgrpname");comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboObject.resumeEvents();comboObject.show();}else{comboObject=a.findField("er_workgrpname");
comboObject.hide();}comboRawData=appConstants.publicjsonDataUsage.serverCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedServer;comboObject=Ext.getCmp("er_server");comboObject.getStore().loadRawData(comboRawData);appConstants.rawDataForComponents=comboRawData;if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);
}else{comboObject.setValue(comboRawData[0].valueField);}comboRawData=appConstants.publicjsonDataUsage.applnCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedAppln;comboObject=Ext.getCmp("er_application");appConstants.rawDataForApplication=comboRawData;comboObject.getStore().loadRawData(comboRawData);
var i=Ext.getCmp("appLabel");i.setText(k.screenLabels["reporter.thin.Application"]);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}}else{if(appConstants.publicjsonDataUsage.hasOwnProperty("workerGroupCombo")){comboRawData=appConstants.publicjsonDataUsage.workerGroupCombo;
selectedComboOption=appConstants.publicjsonDataUsage.selectedWorkergroup;comboObject=a.findField("er_workgrpname");comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboObject.resumeEvents();
comboObject.show();}else{comboObject=a.findField("er_workgrpname");comboObject.hide();}comboRawData=appConstants.publicjsonDataUsage.measureCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedMeasure;comboObject=a.findField("select_testmes");comboObject.getStore().clearFilter(true);comboObject.getStore().loadRawData(comboRawData);
if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}}}}});},zoneOnChange:function(){Ext.getCmp("resultPanel").hide();var b=Ext.getCmp("mainform").getForm();var c=b.findField("report_category").getValue();var d;var f=b.findField("select_farm").getValue();
var a=b.findField("er_option").getValue();if(f!="-1"){if(c=="application_usage"){d="/final/reporter/ErAppUsageReportJson.jsp?er_zone="+encodeURIComponent(f);}else{if(b.findField("er_type").getValue()!=null){d="/final/reporter/ErCtxApplicationReportJson.jsp?select_farm="+encodeURIComponent(f)+"&er_type="+b.findField("er_type").getValue()+"&er_option="+a;
}else{return;}}Ext.Ajax.request({url:d,scope:this,method:"GET",success:function(g){var m=g.responseText;var k=Ext.decode(m);appConstants.publicjsonDataUsage=k;var j=appConstants.publicjsonDataUsage.screenLabels;if(c=="application_usage"){comboRawData=appConstants.publicjsonDataUsage.compTypeCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedCompType;
comboObject=b.findField("er_compType");comboObject.getStore().clearFilter(true);comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboRawData=appConstants.publicjsonDataUsage.componentCombo;
selectedComboOption=appConstants.publicjsonDataUsage.selectedComponents;comboObject=Ext.getCmp("er_server");appConstants.rawDataForComponents=comboRawData;comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);
}comboRawData=appConstants.publicjsonDataUsage.applnCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedAppln;comboObject=b.findField("er_application_usage");appConstants.rawDataForApplication=comboRawData;comboObject.getStore().clearFilter(true);comboObject.getStore().loadRawData(comboRawData);
if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}}else{comboRawData=appConstants.publicjsonDataUsage.componentTypeCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedComponentType;comboObject=b.findField("er_compType");
comboObject.getStore().clearFilter(true);comboObject.getStore().loadRawData(comboRawData);var i;i=Ext.getCmp("select_testmes");comboObject.getStore().clearFilter(true);i.getStore().loadRawData(k.measureCombo);i.setValue(k.selectedMeasure);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);
}else{comboObject.setValue(comboRawData[0].valueField);}var l=b.findField("er_type").getValue();if(l=="No"){comboRawData=appConstants.publicjsonDataUsage.serverCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedServer;comboObject=Ext.getCmp("er_server");var n=Ext.getCmp("multiSelectLabel");
n.setText(j["reporter.common.Server"]);comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboRawData=appConstants.publicjsonDataUsage.applnCombo;selectedComboOption=appConstants.publicjsonDataUsage.selectedAppln;
comboObject=Ext.getCmp("er_application");appConstants.rawDataForApplication=comboRawData;comboObject.getStore().loadRawData(comboRawData);var h=Ext.getCmp("appLabel");h.setText(k.screenLabels["reporter.thin.Application"]);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);
}else{comboObject.setValue(comboRawData[0].valueField);}}}}});}},serverOnChange:function(f,c,a,i){if(Ext.isEmpty(a)){return;}var b=Ext.getCmp("mainform").getForm();var j=Ext.getCmp("er_server").getValue();if(targetType!="Application Usage"){if(b.findField("er_type").getValue()==null||b.findField("er_type").getValue()==undefined){return;
}}if(j==null||j==""||j.length==0){return;}else{if(j==undefined||j=="-1"||j.indexOf("All")>-1||j.length>1){if(Ext.getCmp("er_perserver")!=undefined){Ext.getCmp("er_perserver").show();}}else{if(Ext.getCmp("er_perserver")!=undefined){Ext.getCmp("er_perserver").hide();}}}var g=b.findField("select_farm").getValue();
var k=b.findField("er_site").getValue();var d=b.findField("er_option").getValue();var h="/final/reporter/ErAppUsageReportJson.jsp?er_compType="+Ext.getCmp("er_compType").getValue()+"&er_server="+Ext.getCmp("er_server").getValue();if(targetType=="Application Usage"){this.updateQStringUsage();if(d=="Zone"){h+="&er_zone="+g;
}else{if(d=="Group"||d=="Segment"||d=="Service"){h+="&er_site="+k;}else{if(d=="Component"){h+="&er_option="+d;}}}}else{this.updateQStringActivity();h="/final/reporter/ErCtxApplicationReportJson.jsp?select_farm="+Ext.getCmp("select_farm").getValue()+"&er_type="+Ext.getCmp("er_type").getValue()+"&er_server="+j;
}Ext.Ajax.request({url:h,params:appConstants.queryStringActivity,scope:this,success:function(l){var o=l.responseText;var n=Ext.decode(o);var m;if(targetType=="Application Usage"){m=Ext.getCmp("er_application_usage");m.getStore().clearFilter(true);m.getStore().loadRawData(n.applnCombo);m.setValue(n.selectedAppln);
}else{comboRawData=n.applnCombo;selectedComboOption=n.selectedAppln;comboObject=Ext.getCmp("er_application");appConstants.rawDataForApplication=comboRawData;comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);
}}}});},reportTypeOnChange:function(){Ext.getCmp("resultPanel").hide();this.getNomeasurepanel().hide();var a=Ext.getCmp("mainform").getForm();var c=a.findField("er_type").getValue();var b="/final/reporter/ErCtxApplicationReportJson.jsp?&er_type="+a.findField("er_type").getValue()+"&er_compType="+a.findField("er_compType").getValue()+"&er_trgttype="+targetType;
var d=a.findField("er_option").getValue();b+="&er_option="+d;if(d=="Zone"){b+="&select_farm="+a.findField("select_farm").getValue();}else{b+="&er_site="+a.findField("er_site").getValue();}Ext.Ajax.request({url:b,scope:this,method:"GET",success:function(k){var h=k.responseText;var p=Ext.decode(h);var o=p.screenLabels;
appConstants.publicjsonDataActivity=p;if(c=="No"){a.findField("select_testmes").hide();a.findField("er_mode").hide();if(p.hasOwnProperty("componentTypeCombo")){comboRawData=p.componentTypeCombo;selectedComboOption=p.selectedComponentType;comboObject=a.findField("er_compType");comboObject.setFieldLabel(o["reporter.common.Component Type"]);
comboObject.getStore().clearFilter(true);comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboObject.show();}if(p.hasOwnProperty("workerGroupCombo")){comboRawData=p.workerGroupCombo;
selectedComboOption=p.selectedWorkergroup;comboObject=a.findField("er_workgrpname");comboObject.setFieldLabel(o["reporter.thin.Worker Group"]);comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);
}comboObject.show();}else{a.findField("er_workgrpname").hide();}comboRawData=p.serverCombo;selectedComboOption=p.selectedServer;comboObject=Ext.getCmp("er_server");var m=Ext.getCmp("multiSelectLabel");m.setText(o["reporter.common.Server"]);var f=Ext.getCmp("expandSelectorActivity");f.setTooltip("<b>"+o["reporter.common.Server"]+"</b>");
appConstants.rawDataForComponents=comboRawData;comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}if(selectedComboOption!=null&&selectedComboOption!=undefined){if(selectedComboOption.indexOf("All")>-1||selectedComboOption.length>1){if(Ext.getCmp("er_perserver")!=undefined){Ext.getCmp("er_perserver").show();
}}}comboRawData=p.applnCombo;selectedComboOption=p.selectedAppln;comboObject=Ext.getCmp("er_application");comboObject.setValue(p.selectedAppln);appConstants.rawDataForApplication=comboRawData;comboObject.getStore().loadRawData(comboRawData);var j=Ext.getCmp("appLabel");j.setText(o["reporter.thin.Application"]);
if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboObject.show();Ext.getCmp("egcomponent").show();var g=Ext.getCmp("sort_by");if(!Ext.isEmpty(g)){g.show();}}else{var g=Ext.getCmp("sort_by");if(!Ext.isEmpty(g)){g.hide();
}if(p.hasOwnProperty("componentTypeCombo")){comboRawData=p.componentTypeCombo;selectedComboOption=p.selectedComponentType;comboObject=a.findField("er_compType");comboObject.setFieldLabel(o["reporter.common.Component Type"]);comboObject.getStore().clearFilter(true);comboObject.getStore().loadRawData(comboRawData);
if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboObject.show();}if(p.hasOwnProperty("workerGroupCombo")){comboRawData=p.workerGroupCombo;selectedComboOption=p.selectedWorkergroup;comboObject=a.findField("er_workgrpname");
comboObject.setFieldLabel(o["reporter.thin.Worker Group"]);comboObject.getStore().loadRawData(comboRawData);if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}comboObject.show();}else{a.findField("er_workgrpname").hide();
}var n=Ext.getCmp("select_testmes");n.getStore().clearFilter(true);n.getStore().loadRawData(p.measureCombo);n.setValue(p.selectedMeasure);Ext.getCmp("egcomponent").hide();if(Ext.getCmp("er_perserver")!=undefined){Ext.getCmp("er_perserver").hide();}a.findField("er_mode").hide();a.findField("select_testmes").show();
}if(isSettingsEnabled){var r=p.reportGenerationCombo;var q=p.reportGeneration;var i=Ext.getCmp("reportGeneration");i.setFieldLabel(o["reporter.common.Report Generation"]);i.getStore().loadRawData(r);i.setValue(q);var l=Ext.getCmp("bgReportName");if(q!=undefined&&q!=null&&q=="foreground"){l.hide();}else{l.show();
}}}});},reportCatChange:function(a){Ext.getCmp("resultPanel").hide();var c=Ext.getCmp("report_category").getValue();if(c=="application_usage"){this.LoadFieldsForUsage();}else{this.LoadFieldsForActivity();}},LoadFieldsForActivity:function(){var b="/final/reporter/ErCtxApplicationReportJson.jsp";var a=Ext.getCmp("mainform").getForm();
Ext.Ajax.request({url:b,scope:this,method:"POST",success:function(c){var f=c.responseText;var d=Ext.decode(f);appConstants.publicjsonDataActivity=d;this.getMain().setTitle(d.reportTitle);this.fillFormFieldsForActivity(d);a.findField("er_type").show();a.findField("select_testmes").show();a.findField("er_mode").show();
if(Ext.getCmp("er_excwe")!=undefined){Ext.getCmp("er_excwe").show();}a.findField("er_type").setValue("Yes");a.findField("er_compType").show();if(d.hasOwnProperty("workerGroupCombo")){a.findField("er_workgrpname").show();}else{a.findField("er_workgrpname").hide();}a.findField("componentMultiSelect").hide();
Ext.getCmp("er_application").hide();}});},LoadFieldsForUsage:function(){var a="/final/reporter/ErAppUsageReportJson.jsp";Ext.Ajax.request({url:a,scope:this,method:"POST",success:function(b){var d=b.responseText;var c=Ext.decode(d);appConstants.publicjsonDataUsage=c;this.getMain().setTitle(c.reportTitle);
this.fillFormFieldsForUsage(c);}});},fillFormFieldsForUsage:function(j){var b=Ext.getCmp("mainform").getForm();b.findField("er_type").hide();b.findField("select_testmes").hide();b.findField("er_mode").hide();if(Ext.getCmp("sh_timeinuse")!=undefined){Ext.getCmp("sh_timeinuse").hide();}if(Ext.getCmp("er_perserver")!=undefined){Ext.getCmp("er_perserver").hide();
}if(Ext.getCmp("er_excwe")!=undefined){Ext.getCmp("er_excwe").hide();}Ext.getCmp("egcomponent").show();Ext.getCmp("er_server").show();b.findField("er_compType").show();b.findField("er_workgrpname").show();b.findField("er_application_usage").show();var c=appConstants.publicjsonDataUsage.hiddenfields;var d=c["fromScheduleModify"];
var h=c["fromFavoriteModify"];if((d!=null&&d=="Yes")||(h!=null&&h=="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 f;var g;var k;var i=j.screenLabels;
f=j.viewApplnCombo;g=j.selectedViewAppln;k=b.findField("report_category");k.setFieldLabel(i["reporter.common.View Application"]);k.getStore().loadRawData(f);if(!Ext.isEmpty(g)){k.setValue(g);}else{k.setValue(f[0].valueField);}var a="";if(j.hasOwnProperty("selectedAnalysisByCombo")){a=j.selectedAnalysisByCombo;
}if(a=="Zone"||Ext.isEmpty(a)){Ext.getCmp("er_site").hide();f=j.zoneCombo;g=j.selectedZone;k=b.findField("select_farm");k.setFieldLabel(i["reporter.common.Zone"]);k.getStore().clearFilter(true);k.getStore().loadRawData(f);if(!Ext.isEmpty(g)){k.setValue(g);}else{k.setValue(f[0].valueField);}}else{if(a=="Segment"){Ext.getCmp("select_farm").hide();
f=j.siteCombo;g=j.selectedSiteCombo;k=b.findField("er_site");k.setFieldLabel("Segment");k.getStore().clearFilter(true);k.getStore().loadRawData(f);if(!Ext.isEmpty(g)){k.setValue(g);}else{k.setValue(f[0].valueField);}k.show();}else{if(a=="Group"){Ext.getCmp("select_farm").hide();f=j.siteCombo;g=j.selectedSiteCombo;
k=b.findField("er_site");k.setFieldLabel("Group");k.getStore().clearFilter(true);k.getStore().loadRawData(f);if(!Ext.isEmpty(g)){k.setValue(g);}else{k.setValue(f[0].valueField);}k.show();}else{if(a=="Service"){Ext.getCmp("select_farm").hide();f=j.siteCombo;g=j.selectedSiteCombo;k=b.findField("er_site");
k.setFieldLabel("Service");k.getStore().clearFilter(true);k.getStore().loadRawData(f);if(!Ext.isEmpty(g)){k.setValue(g);}else{k.setValue(f[0].valueField);}k.show();}else{if(a=="Component"){Ext.getCmp("select_farm").hide();Ext.getCmp("er_site").hide();}}}}}f=j.compTypeCombo;g=j.selectedCompType;k=b.findField("er_compType");
k.setFieldLabel(i["reporter.common.Component Type"]);k.getStore().clearFilter(true);k.getStore().loadRawData(f);if(!Ext.isEmpty(g)){k.setValue(g);}else{k.setValue(f[0].valueField);}if(j.hasOwnProperty("workerGroupCombo")){f=j.workerGroupCombo;g=j.selectedWorkergroup;k=b.findField("er_workgrpname");k.setFieldLabel(i["reporter.thin.Worker Group"]);
k.getStore().loadRawData(f);if(!Ext.isEmpty(g)){k.setValue(g);}else{k.setValue(f[0].valueField);}}else{b.findField("er_workgrpname").hide();}f=j.componentCombo;g=j.selectedComponents;k=Ext.getCmp("er_server");Ext.getCmp("egcomponent").show();k.getStore().loadRawData(f);appConstants.rawDataForComponents=f;
if(!Ext.isEmpty(g)){k.setValue(g);}else{k.setValue(f[0].valueField);}f=j.applnCombo;g=j.selectedAppln;k=b.findField("er_application_usage");k.getStore().clearFilter(true);k.getStore().loadRawData(f);if(!Ext.isEmpty(g)){k.setValue(g);}else{k.setValue(f[0].valueField);}},saveReportAsPDF:function(){var d;
var a=Ext.getCmp("report_category").getValue();if(a=="application_usage"){d=appConstants.publicjsonDataUsage.saveQString;d+="&pageWidthProces=1024&er_option=graph&pdfPrint=yes";}else{d=appConstants.publicjsonDataActivity.saveQString;d+="&printGraph=yes&opt=chart";if(appConstants.publicjsonDataActivity.selectedreportType=="No"){d+="&pageWidthProces=1024&er_view=PRINT";
}}var c="../reporter/ErHtmlToSavePdf.jsp?"+d+"&isPdf=yes";var b=false;if(Ext.getCmp("showLegend")!=undefined){var b=Ext.getCmp("showLegend").getValue();if(b!=null&&b!=undefined&&b!="undefined"){var f="&showLegend="+b;if(c.indexOf(f)==-1){if(c.indexOf("&showLegend=")>-1){if(b.toString()=="true"){c=c.replace("&showLegend=false",f);
}else{c=c.replace("&showLegend=true",f);}}else{c+=f;}}}}if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}c=this.getGridColSortParam(c);appConstants.erUtils.savePDF(c);},bookletQuery:function(g){var d;var a=Ext.getCmp("report_category").getValue();if(a=="application_usage"){d=appConstants.publicjsonDataUsage.saveQString;
d+="&pageWidthProces=1024&er_option=graph&pdfPrint=yes";}else{d=appConstants.publicjsonDataActivity.saveQString;d+="&printGraph=yes&opt=chart";if(appConstants.publicjsonDataActivity.selectedreportType=="No"){d+="&pageWidthProces=1024&er_view=PRINT";}}var c=d+"&isPdf=yes";var b=false;if(Ext.getCmp("showLegend")!=undefined){var b=Ext.getCmp("showLegend").getValue();
if(b!=null&&b!=undefined&&b!="undefined"){var f="&showLegend="+b;if(c.indexOf(f)==-1){if(c.indexOf("&showLegend=")>-1){if(b.toString()=="true"){c=c.replace("&showLegend=false",f);}else{c=c.replace("&showLegend=true",f);}}else{c+=f;}}}}return c;},bookletScheduleQuery:function(f){var c="";var b=Ext.getCmp("mainform").getForm();
var a=Ext.getCmp("report_category").getValue();if(a=="application_activity"){this.updateQStringActivity();var d=b.findField("er_type").getValue();if(d=="Yes"){c=appConstants.queryStringActivity;c+="&er_server=-1&er_application=-1&er_sortby=-1&er_perserver=Yes&showTopusers="+appConstants.publicjsonDataActivity.showTopusers;
}else{c=appConstants.queryStringActivity+"&showTopusers="+appConstants.publicjsonDataActivity.showTopusers;}}else{if(a=="application_usage"){this.updateQStringUsage();c=appConstants.queryStringUsage;}}c=c+"&isPdf=yes";return c;},bookletPreview:function(){this.printReport();},getGridColSortParam:function(f){var b=f.indexOf("er_sortby");
if(b>-1){var d;var c=f.substring(b+10,b+12);if(c=="-1"){d="er_sortby="+c;}else{d="er_sortby="+parseInt(c);}f=f.replace(d,"er_sortby="+this.gridColIndexParam);}else{f+="&er_sortby="+this.gridColIndexParam;}var a="1";if(this.gridColStateParam=="ASC"){a="1";}else{a="0";}return f+"&orderBy="+a;},printReport:function(){var a=Ext.getCmp("report_category").getValue();
var c;if(a=="application_usage"){var d=appConstants.publicjsonDataUsage.saveQString;c="/final/reporter/ErAppUsageReportPrint.jsp?"+d+"&pdfPrint=yes&isChartRequest=true&er_width=450&er_height=250&er_option=graph";}else{var d=appConstants.publicjsonDataActivity.saveQString;c="../servlet/com.eg.ErCtxServerReportC?"+d+"printGraph=yes&pdfPrint=yes";
if(appConstants.publicjsonDataActivity.selectedreportType=="No"){c+="&er_view=PRINT";}}var b=false;if(Ext.getCmp("showLegend")!=undefined){var b=Ext.getCmp("showLegend").getValue();if(b!=null&&b!=undefined&&b!="undefined"){var f="&showLegend="+b;if(c.indexOf(f)==-1){if(c.indexOf("&showLegend=")>-1){if(b.toString()=="true"){c=c.replace("&showLegend=false",f);
}else{c=c.replace("&showLegend=true",f);}}else{c+=f;}}}c=this.getGridColSortParam(c);}parent.printWindowFn(c);},sendMail:function(){var b=Ext.getCmp("showLegend").getValue();if(b!=null&&b!=undefined&&b!="undefined"){drillDownParams="&showLegend="+b;}var a=Ext.widget("sendmail");a.show();},saveCsv:function(){window.location="../servlet/egurkha.reporter.SaveInCSVFormat";
},saveSchedule:function(){var a=Ext.getCmp("mainform").getForm();var d=a.findField("report_category").getValue();var j=this.validateMainForm(false);if(j&&a.findField("er_timeline").getValue()=="Any"){Ext.MessageBox.show({title:"Operation Reports",msg:"Chosen timeline not allowed",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
j=false;}if(j){var h;if(d=="application_activity"){this.updateQStringActivity();var i=a.findField("er_type").getValue();if(i=="Yes"){h="/final/reporter/ErSaveSchedule.jsp?"+appConstants.queryStringActivity;h+="&er_server=-1&er_application=-1&er_sortby=-1&er_perserver=Yes&showTopusers="+appConstants.publicjsonDataActivity.showTopusers;
}else{h="/final/reporter/ErSaveSchedule.jsp?"+appConstants.queryStringActivity+"&showTopusers="+appConstants.publicjsonDataActivity.showTopusers;}}else{if(d=="application_usage"){this.updateQStringUsage();h="/final/reporter/ErSaveSchedule.jsp?"+appConstants.queryStringUsage;}}var g=h+"&com.eg.CSRF_NONCE="+csrfToken;
if(appConstants.formButtonId=="save"){g+="&showSchWindow=no";var c=g.substr(0,g.indexOf("?"));var b=g.substr(g.indexOf("?")+1,g.length-1);var f=Ext.create("Ext.form.Panel");f.submit({url:c,params:b,standardSubmit:true,method:"POST"});}else{parent.scheduleWindowFn(g);}}else{return;}},saveFavorite:function(){var l=this.validateMainForm(false);
var a=Ext.getCmp("mainform").getForm();if(l){var i;var f=a.findField("report_category").getValue();if(f=="application_activity"){this.updateQStringActivity();var j=a.findField("er_type").getValue();if(j=="Yes"){i="/final/reporter/ErSaveFavorite.jsp?"+appConstants.queryStringActivity+"&er_perserver=yes&er_sortby=-1&er_server=-1&er_application=-1&cmd=client";
}else{i="/final/reporter/ErSaveFavorite.jsp?"+appConstants.queryStringActivity+"&cmd=client";}}else{if(f=="application_usage"){this.updateQStringUsage();var c=appConstants.publicjsonDataUsage["hiddenfields"];var k=c["favorite_id"];i="../servlet/com.eg.ErFavoriteC?"+appConstants.queryStringUsage+"&er_view=GRAPH&cmd=client";
}}var h=i+"&er_RmDispName="+appConstants.er_RmDispName+"&com.eg.CSRF_NONCE="+csrfToken;if(appConstants.formButtonId=="save"){if((k=="null"||k=="undefined"||k==undefined)&&appConstants.favorite_id!="null"){k=appConstants.favorite_id;}h+="&showSchWindow=no"+"&FavoriteId="+k;var d=h.substr(0,h.indexOf("?"));
var b=h.substr(h.indexOf("?")+1,h.length-1);var g=Ext.create("Ext.form.Panel");g.submit({url:d,params:b,standardSubmit:true,method:"POST"});}else{parent.favouriteWindowFn(h);}}else{return;}},validateMainForm:function(w){var v=Ext.getCmp("mainform").getForm();var a=null;if(isSettingsEnabled){a=this.getThinclientapplicationsettings().getForm();
}var D=v.findField("er_type").getValue();var u=v.findField("report_category").getValue();if(u=="application_activity"){if(D=="No"){var s=v.findField("er_server");var k=v.findField("er_application");if(s.getValue()=="-1"){Ext.MessageBox.show({title:"Thin Client Application",msg:s.getStore().getAt(0).get("displayField"),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}var b=k.getStore().getAt(0).get("displayField");if(b=="Not Applicable"){Ext.MessageBox.show({title:"Thin Client Application",msg:b,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return false;}}else{var g=v.findField("select_testmes");if(g.getValue()=="-1"){Ext.MessageBox.show({title:"Thin Client Application",msg:g.getStore().getAt(0).get("displayField"),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}}}else{var t=v.findField("er_compType");var m=v.findField("er_server");var k=v.findField("er_application_usage");if(t.getValue()=="-1"){Ext.MessageBox.show({title:"Thin Client Application",msg:t.getStore().getAt(0).get("displayField"),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}if(m.getValue()=="-1"){Ext.MessageBox.show({title:"Thin Client Application",msg:m.getStore().getAt(0).get("displayField"),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return false;}if(k.getValue()=="-1"){Ext.MessageBox.show({title:"Thin Client Application",msg:k.getStore().getAt(0).get("displayField"),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}}var d;if(targetType=="Application Usage"){d=appConstants.publicjsonDataUsage;}else{d=appConstants.publicjsonDataActivity;}var y=true;var n=d["hiddenfields"];var r=n["getMaxDaysInMonth"];var z=this.getSettingsFieldValue(a,"reportGeneration",isSettingsEnabled,"reportGeneration");var E="";
if(!Ext.isEmpty(n["userTimeline"])){E=n["userTimeline"];}var q=v.findField("er_timeline").getValue();var A=v.findField("er_stdate").getValue();var j=v.findField("er_enddate").getValue();var p=v.findField("er_sthr").getValue();var c=v.findField("er_endhr").getValue();A.setHours(p);j.setHours(c);var o=this.getSettingsFieldValue(a,"timefrom",isSettingsEnabled,"selectedTimeFrom");
var C=this.getSettingsFieldValue(a,"minfrom",isSettingsEnabled,"selectedMinsFrom");var i=this.getSettingsFieldValue(a,"timeto",isSettingsEnabled,"selectedTimeTo");var B=this.getSettingsFieldValue(a,"minto",isSettingsEnabled,"selectedMinsTo");if(!checkTimePeriod(o,C,i,B)){y=false;}if(!checkDateTime(A,j)){y=false;
}if(E!=null&&E!="-1"){var l=isUserTimelineLimitExceeded(E,r,A,j);if(!l){Ext.MessageBox.show({title:"Thin Client Application settings",msg:appConstants.userTimelineErrorMsg,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});y=false;}}if(z!=null&&z=="foreground"){var h=n["limitforbg"];if(!Ext.isEmpty(h)){if(w){if(!checkTimeLineForBgLimit(h,r,A,j)){Ext.MessageBox.confirm(confirmMsg,appConstants.forGrdReportConfirmMsg,this.showConfirmResult,this);
y=false;}}}}else{var x=a.findField("bgReportName").getValue();if(!validateTextBoxWithSpecialChars(x,"Attachment",true)){y=false;}}if(y){var f=Ext.getCmp("submit");f.setDisabled(false);return true;}else{return 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();}},showResult:function(){var h=Ext.getCmp("resultPanel");h.removeAll();var c=Ext.getCmp("mainform").getForm();var f=c.findField("er_stdate").getValue();var g=c.findField("er_sthr").getValue();
f.setHours(g);var b=c.findField("er_enddate").getValue();var d=c.findField("er_endhr").getValue();b.setHours(d);var a=checkDateTime(f,b);if(!a){return;}var i=this.validateMainForm(true);if(i){this.submitReport();}},validateSettings:function(){var a=true;var b=Ext.getCmp("reportGeneration").getValue();
if(b!=null&&(b=="background"||b=="background-csv")){var c=Ext.getCmp("bgReportName").getValue();if(!validateTextBoxWithSpecialChars(c,"Attachment",true)){a=false;}}return a;},showConfirmResult:function(d){if(d=="yes"){var b=Ext.getCmp("submit");this.submitReport();}else{this.getReporterSettings().down("button").fireHandler();
var c=this.getThinclientapplicationsettings().getForm();var a=c.findField("reportGeneration");var f=c.findField("bgReportName");a.setValue("background");f.setValue("");f.show();f.focus(false,1000);Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();this.showResult();}},getXmlForUrl:function(b){try{var a;
Ext.Ajax.request({url:b,method:"GET",async:false,success:function(d){var f=d.responseText;a=Ext.decode(f);},failure:function(){alert("I am not loading..."+b);}});return a;}catch(c){alert("[Exception] "+c);}},loadGrid:function(C){var r=Ext.getCmp("resultPanel");var x=Ext.getCmp("mainform").getForm();var h=new Array();
var F=this;if(!Ext.isEmpty(C)){var a=null;if(isSettingsEnabled){a=F.getThinclientapplicationsettings().getForm();}for(var z in C){var d=C[z];var E=d.columns;var t=d.data_units;var A=d.dataArray;var q=d.TOTAL_COLUMN_COUNT;var I={};var w=0;var f=new Array();var p=0;var l=true;for(var H in E){var b=H;var m=new Array();
var c=new Array();m=E[H];if(m!=undefined&&!Ext.isEmpty(m)){for(var v in m){p++;var D=m[v]+" ("+t[b]+")";I[w]=b+"_"+D;c.push({header:D,sortable:true,dataIndex:w,align:"center",doSort:function(j){var i=this.up("grid").store;var J=this.getSortParam();i.sort({property:J,direction:j,sorterFn:function(L,K){L=L.get(J);
K=K.get(J);L=Ext.isNumber(L)?L:parseFloat(String(L),10);K=Ext.isNumber(K)?K:parseFloat(String(K),10);if(j=="ASC"){L=isNaN(L)?999999:L;K=isNaN(K)?999999:K;}else{L=isNaN(L)?0:L;K=isNaN(K)?0:K;}return L>K?1:(L<K?-1:0);}});},renderer:function(Q,J,N,T,L,R,i){if(Q!=undefined&&Q.indexOf(".exe")>-1){Q=replaceAll(Q,".exe","");
}if(Q!=undefined&&Q.indexOf("~")>-1){var S=Q.substring(0,Q.indexOf("~"));var j=Q.substring(Q.indexOf("~")+1);var P=x.findField("er_server").getValue();var O=x.findField("er_compType").getValue();j+="&er_compType="+O;if(P!=null&&P!="undefined"&&P.length>0){for(var M=0;P.length>M;M++){j+="&er_workgroupserver="+P[M];
}}var K=S;if(S!=null&&S=="top.gif"){S="iconArrowUp";Q='<div align="center"><a href="javascript:void(0);" onclick="showDrillDownData(\''+j+'\')" ><div class="'+S+'"></div></a></div>';K="";}else{Q='<div align="center"><a class="anchorLinkDefault" href="javascript:void(0);" onclick="showDrillDownData(\''+j+"')\" >"+S+"</a></div>";
}J.tdAttr='data-qclass=yellowTip data-qtip="'+K+'"';}else{J.tdAttr='data-qclass=yellowTip data-qtip="'+Q+'"';Q=Ext.getCmp("appGrid_0").getDecimalAlignFormat(Q);}return Q;}});w++;}f.push({header:b,locked:false,sortable:true,columns:c});}else{var k=false;if(w==0){k=true;}p++;var u="center";if(H=="Application"){u="left";
}I[w]=b;f.push({header:b,sortable:true,dataIndex:w,minWidth:115,width:115,flex:1,locked:k,align:u,doSort:function(j){var i=this.up("grid").store;var J=this.getSortParam();i.sort({property:J,direction:j,sorterFn:function(L,K){L=L.get(J);K=K.get(J);L=Ext.isNumber(L)?L:parseFloat(String(L),10);K=Ext.isNumber(K)?K:parseFloat(String(K),10);
if(j=="ASC"){L=isNaN(L)?999999:L;K=isNaN(K)?999999:K;}else{L=isNaN(L)?0:L;K=isNaN(K)?0:K;}return L>K?1:(L<K?-1:0);}});},renderer:function(P,J,M,S,K,Q,i){if(P!=undefined&&P.indexOf(".exe")>-1){P=P.replace(".exe","");}if(P!=undefined&&P.indexOf("~")>-1){var R=P.substring(0,P.indexOf("~"));var j=P.substring(P.indexOf("~")+1);
j+="&er_perserver="+F.getSettingsFieldValue(a,"er_perserver",isSettingsEnabled,"selectedAgg");var O=x.findField("er_server").getValue();var N=x.findField("er_compType").getValue();j+="&er_compType="+N;if(O!=null&&O!="undefined"&&O.length>0){for(var L=0;O.length>L;L++){j+="&er_workgroupserver="+O[L];}}if(R!=null&&R=="top.gif"){R="iconArrowUp";
P='<div align="center"><a href="javascript:void(0);" onclick="showDrillDownData(\''+j+'\')" ><div class="'+R+'"></div></a></div>';}else{P='<div align="center"><a class="anchorLinkDefault" href="javascript:void(0);" onclick="showDrillDownData(\''+j+"')\" >"+R+"</a></div>";}}else{J.tdAttr='data-qclass=yellowTip data-qtip="'+P+'"';
P=Ext.getCmp("appGrid_0").getDecimalAlignFormat(P);}return P;}});w++;}}if(p>10){l=false;}var g;if(A.length<gridPageSize){g=true;}else{g=false;}var s=[];for(var H in A[0]){s.push(H);}var y=Ext.create("Ext.data.Store",{fields:s,proxy:{type:"pagingmemory",data:A,reader:{type:"json"},},pageSize:gridPageSize,remoteSort:true,autoLoad:true,sorters:{property:s[0],direction:"ASC"}});
var n;var G;var B=1;var o=Ext.create("Ext.grid.feature.Grouping",{groupHeaderTpl:'{application} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'});h.push({xtype:"panel",margin:"10",ui:"newGraphPanel",title:d.gridTitle,items:[{xtype:"customgrid",store:y,ui:"newGridPanel",sortableColumns:true,needtoFixColumn:true,columns:f,id:"appGrid_"+z,margin:10,border:true,scroll:true,lockedGridConfig:{collapsible:false,forceFit:true,flex:1/5,},features:[o],autoScroll:true,forceFit:l,listeners:{sortchange:function(J,K,L,j,i){F.gridColIndexParam=K.getIndex();
F.gridColStateParam=K.sortState;this.getStore().load();},render:function(i){Ext.defer(function(){},100);}},dockedItems:[{xtype:"pagingtoolbar",cls:"newPagination",dock:"bottom",displayInfo:true,store:y,hidden:g,displayInfo:true,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No topics to display",listeners:{change:function(i,j){n=j.pageCount;
G=j.total;B=j.currentPage;}}}]}]});}r.removeAll();r.add(h);r.show();r.doLayout();}},loadReportData:function(b){var w=Ext.getCmp("report_category").getValue();var o=Ext.getCmp("resultPanel");o.removeAll();var x=this;var t=b.reportData;var l=false;var g=b["chartType"];if(w=="application_activity"){if(b.hasOwnProperty("reportData")){var A=b.selectedreportType;
if(A=="Yes"){Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);var z=new Array();var h=new Array();z=t.chartUrls;noOfchart=z.length;for(var s=0;noOfchart>s;s++){var d=z[s];var q=this.getXmlForUrl(d);
if(!Ext.isEmpty(q)&&q.hasOwnProperty("XML")){l=true;var m,r;if(s==0){m="5 10 10 10";r=0.65;}else{m="5 10 10 0";r=1;}var p={xtype:"panel",data:q,flex:r,ui:"newGraphPanel",title:q.chartTitle,margin:m,id:"fusion"+s};h.push(p);}}if(l){o.add({xtype:"panel",ui:"multiGraphPanel",margin:"10",title:t.title,layout:{type:"hbox",align:"stretch"},items:h});
o.show();if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}for(var s=0;s<noOfchart;s++){var k=Ext.getCmp("fusion"+s);var y=k.data;var t=y.reportData;if(!Ext.isEmpty(y)&&y.hasOwnProperty("XML")){var c=y.innerHtml;var f=y.chartFor;var v=y.chartHight;if(f=="Top"){appConstants.erUtils.updateBarChart(appConstants.chartType,null,y.XML,y.swfpath,y,y.chartHeight-20,y.chartWidth,k);
}else{if(f=="distribution"){appConstants.erUtils.updatePieChart(appConstants.chartType,y,"pieColors","urlLinks","pieLabels",null,y.XML,y.swfpath,y,k);}}}else{k.update('<div><img src="/final/reporter/images/nographformeasure.gif" width="100%" /></div>');}}Ext.getCmp("selectionDetails").setSelectionDetailsData(b.selectionDetails);
}else{this.disableTools();o.hide();this.getNomeasurepanel().doLayout();this.getNomeasurepanel().show();}}else{if(A=="No"){Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);Ext.getCmp("csvTool").setDisabled(false);
appConstants.publicGridData=t.gridArray;this.loadGrid(appConstants.publicGridData);Ext.getCmp("selectionDetails").setSelectionDetailsData(b.selectionDetails);}}}else{this.disableTools();o.hide();this.getNomeasurepanel().doLayout();this.getNomeasurepanel().show();}}else{if(w=="application_usage"){var j;
var a=null;if(isSettingsEnabled){j=Ext.getCmp("graphViews").getValue();}Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);var n=385;var u=Ext.getCmp("showLegend").getValue();if(u){n=440;
}if(g=="highchart"){o.add({xtype:"panel",ui:"newGraphPanel",margin:"10 10 10 10",title:t.title,height:n,style:{"text-align":"center",},items:[{xtype:"container",height:335,id:"highChart_GraphPanel",html:'<div id="highChart" style="width:100%;height:100%;"></div>'},{xtype:"panel",height:55,id:"highChart_legendPanel",margin:"5 10 10 0",style:{"overflow":"hidden",}}]});
}else{o.add({xtype:"panel",margin:"10 10 10 10",ui:"newGraphPanel",title:t.title,style:{"text-align":"center"},items:[{xtype:"image",src:t.imageUrl,width:900,height:580}]});}o.show();if(!isSettingsEnabled){this.showConfigDropdown();}if(isSettingsEnabled){a=this.getThinclientapplicationsettings().getForm();
j=this.getSettingsFieldValue(a,"graphViews",isSettingsEnabled,"er_graphViews");t.imageUrl+="&er_graphViews="+b.er_graphViews;}if(g=="highchart"){reportHighStockChart(t.imageUrl+"&chartType="+g,"highChart",380,90,"");}Ext.getCmp("selectionDetails").setSelectionDetailsData(b.selectionDetails);}}},submitReport:function(){if(!isSettingsEnabled){this.showConfigDropdown();
}var g;var f;var q;var n;var b=Ext.getCmp("mainform").getForm();var l=b.findField("report_category").getValue();appConstants.report_for=l;if(l=="application_activity"){var p=b.findField("er_type").getValue();if(p=="Yes"){g="../servlet/com.eg.ErCtxServerReportC?isSubmit=true&er_server=-1&er_application=-1&er_sortby=-1&er_perserver=Yes&responseType=json";
f="../servlet/com.eg.ErStartBackGroundReportC?isSubmit=true&er_server=-1&er_application=-1&er_sortby=-1&er_perserver=Yes&responseType=json";}else{g="../servlet/com.eg.ErCtxServerReportC?isSubmit=true&responseType=json";f="../servlet/com.eg.ErStartBackGroundReportC?isSubmit=true&responseType=json";q="../servlet/com.eg.ErStartBackGroundReportC?isSubmit=true&SaveFormat=CSV";
appConstants.queryStringActivity+="&er_server="+b.findField("er_server").getValue();}this.updateQStringActivity();n=appConstants.queryStringActivity;}else{this.updateQStringUsage();var i="";if(isSettingsEnabled){var d=Ext.getCmp("showLegend").getValue();if(d!=null&&d!=undefined&&d!="undefined"){i="&showLegend="+d;
}}else{i="&showLegend=true";}n=appConstants.queryStringUsage+i;g="../servlet/com.eg.ErAppUsageReportC?isSubmit=true&responseType=json";f="../servlet/com.eg.ErStartBackGroundReportC?isSubmit=true&responseType=json";}f+="&isPdf=yes";var j=Ext.getCmp("resultPanel");var h=null;if(isSettingsEnabled){h=this.getThinclientapplicationsettings().getForm();
}var a=this.getSettingsFieldValue(h,"reportGeneration",isSettingsEnabled,"reportGeneration");var m="";this.getNomeasurepanel().hide();this.getBackGroundPanel().hide();n+="&er_RmDispName="+appConstants.er_RmDispName;if(a=="foreground"){Ext.Ajax.request({url:g,params:n,method:"POST",scope:this,timout:320000,success:function(r){var t=r.responseText;
var s=Ext.decode(t);if(l=="application_usage"){appConstants.publicjsonDataUsage=s;}else{appConstants.publicjsonDataActivity=s;}this.loadReportData(s);}});}else{if(a=="background"){j.hide();var c="";var o=this;var k=Ext.getCmp("bgReportName").getValue();k=checkFileName(k);Ext.Ajax.request({url:f,params:n+"&bg_reportname="+k,success:function(s){var x=s.responseText;
var v=Ext.decode(x);publicjsonData=v;var w=v.backgroundReportStatus;var r=v.bgGroundMsg;if(w!="undefined"){if(w=="success"){var t=v.bgroundResponseTxt;var y=v.bgroundReportsURL;var u=v.backgroundAnchor;c='<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">'+t+".</br>"+'<a class="backgroundMsgLink" href='+y+">"+u+"</a></div></td></tr></table></td></tr></table>";
}else{if(w=="duplicate"||(r!=null)){var t=v.bgroundResponseTxt;var y=v.bgroundReportsURL;var u=v.backgroundAnchor;c='<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">'+t+".</br>"+'<a class="backgroundMsgLink" href='+y+">"+u+"</a></div></td></tr></table></td></tr></table>";
}else{var t=v.bgroundResponseTxt;c='<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">'+t+"</div></td></tr></table></td></tr></table>";
}}}else{c="<span>ErroR In BackGround Generation</span>";}o.getBackGroundPanel().update(c);o.getBackGroundPanel().show();}});}else{if(a=="background-csv"){j.hide();var c="";var o=this;var k=Ext.getCmp("bgReportName").getValue();k=checkFileName(k);Ext.Ajax.request({url:q,params:n+"&bg_reportname="+k,success:function(s){var x=s.responseText;
var v=Ext.decode(x);publicjsonData=v;var w=v.backgroundReportStatus;var r=v.bgGroundMsg;if(w!="undefined"){if(w=="success"){var t=v.bgroundResponseTxt;var y=v.bgroundReportsURL;var u=v.backgroundAnchor;c='<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">'+t+".</br>"+'<a class="backgroundMsgLink" href='+y+">"+u+"</a></div></td></tr></table></td></tr></table>";
}else{if(w=="duplicate"||(r!=null)){var t=v.bgroundResponseTxt;var y=v.bgroundReportsURL;var u=v.backgroundAnchor;c='<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">'+t+".</br>"+'<a class="backgroundMsgLink" href='+y+">"+u+"</a></div></td></tr></table></td></tr></table>";
}}}else{c="<span>ErroR In BackGround Generation</span>";}o.getBackGroundPanel().update(c);o.getBackGroundPanel().show();}});}}}},excludeAppChange:function(){var d;if(targetType=="Application Usage"){d=appConstants.publicjsonDataUsage;}else{d=appConstants.publicjsonDataActivity;}var a=Ext.getCmp("exeAppTxtField").getValue();
var f=Ext.getCmp("er_type").getValue();if(d.selectedExcludeApp!=a&&f!=undefined&&f=="No"){this.updateQStringActivity();var c=Ext.getCmp("er_server").getValue();if(c==null||c==""||c.length==0){return;}var b="/final/reporter/ErCtxApplicationReportJson.jsp?select_farm="+Ext.getCmp("select_farm").getValue()+"&er_type="+Ext.getCmp("er_type").getValue()+"&er_server="+c;
Ext.Ajax.request({url:b,params:appConstants.queryStringActivity,scope:this,success:function(g){var j=g.responseText;var i=Ext.decode(j);var h;comboRawData=i.applnCombo;selectedComboOption=i.selectedAppln;comboObject=Ext.getCmp("er_application");appConstants.rawDataForApplication=comboRawData;comboObject.getStore().loadRawData(comboRawData);
if(!Ext.isEmpty(selectedComboOption)){comboObject.setValue(selectedComboOption);}else{comboObject.setValue(comboRawData[0].valueField);}}});}},reportGenChange:function(){Ext.getCmp("resultPanel").hide();this.disableTools();var b=this.getThinclientapplicationsettings().getForm();var a=b.findField("reportGeneration").getValue();
Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();if(a=="background"){b.findField("bgReportName").setValue("");Ext.getCmp("bgReportName").show();}else{if(a=="background-csv"){b.findField("bgReportName").setValue("");Ext.getCmp("bgReportName").show();}else{Ext.getCmp("bgReportName").hide();
Ext.getCmp("submitViaSetting").hide();Ext.getCmp("moreOptionCloseId").show();}}},timeLineOnChange:function(){Ext.getCmp("resultPanel").hide();this.disableTools();var a=Ext.getCmp("mainform").getForm();var c=a.findField("er_stdate");var f=a.findField("er_sthr");var b=a.findField("er_enddate");var d=a.findField("er_endhr");
var g=a.findField("er_timeline");if(g.getValue()=="Any"){c.setDisabled(false);f.setDisabled(false);b.setDisabled(false);d.setDisabled(false);}else{g.suspendEvents(true);this.updateQStringActivity();Ext.Ajax.request({url:"/final/reporter/ErCtxApplicationReportJson.jsp",params:appConstants.queryStringActivity,scope:this,success:function(i){var k=i.responseText;
var j=Ext.decode(k);appConstants.publicjsonDataActivity=j;var n=j.startHour;var l=j.endHour;var h=j.startDate;var m=j.endDate;c.setDisabled(true);f.setDisabled(true);b.setDisabled(true);d.setDisabled(true);c.setValue(h);f.setValue(n);b.setValue(m);d.setValue(l);}});g.resumeEvents();}},loadTools:function(){this.getNewUtilities().loadIcon(true,true,true,false,true,true,true,false,false,false,true);
Ext.getCmp("favoriteTool").setDisabled(false);Ext.getCmp("scheduleTool").setDisabled(false);},disableTools:function(){Ext.getCmp("bookletTool").setDisabled(true);Ext.getCmp("saveTool").setDisabled(true);Ext.getCmp("printTool").setDisabled(true);Ext.getCmp("mailTool").setDisabled(true);Ext.getCmp("csvTool").setDisabled(true);
},updateQStringActivity:function(){var r;var u="";var w;var b;var q=Ext.getCmp("mainform").getForm();var a=null;if(isSettingsEnabled){a=this.getThinclientapplicationsettings().getForm();}var y=q.findField("er_type").getValue();r="select_farm="+q.findField("select_farm").getValue()+"&er_type="+y+"&er_excludeApp="+this.getSettingsFieldValue(a,"exeAppTxtField",isSettingsEnabled,"selectedExcludeApp")+"&er_excwe="+this.getSettingsFieldValue(a,"er_excwe",isSettingsEnabled,"excludeWeek")+"&er_reportgenration="+this.getSettingsFieldValue(a,"reportGeneration",isSettingsEnabled,"reportGeneration");
var n=Ext.getCmp("er_option");if(n!=undefined){r+="&er_option="+n.getValue();if(n.getValue()=="Group"||n.getValue()=="Segment"||n.getValue()=="Service"){var j=Ext.getCmp("er_site");r+="&er_site="+j.getValue();}}if(y=="Yes"){r+="&select_testmes="+q.findField("select_testmes").getValue()+"&er_compType="+q.findField("er_compType").getValue()+"&er_mode="+q.findField("er_mode").getValue()+"&sh_timeinuse=No";
}else{var x=q.findField("er_server").getValue();var h=q.findField("er_server").getValue();var o=q.findField("er_application").getValue();if(h!=null&&h!="undefined"&&h.length>0){for(var p=0;h.length>p;p++){r+="&er_workgroupserver="+h[p];}}if(o!=null&&o!="undefined"&&o.length>0){for(var p=0;o.length>p;
p++){r+="&er_application="+encodeURIComponent(o[p]);}}var c=-1;var s=Ext.getCmp("sort_by");if(!Ext.isEmpty(s)){c=Ext.getCmp("sort_by").getValue();}this.gridColStateParam="ASC";this.gridColIndexParam=c;r+="&er_compType="+q.findField("er_compType").getValue()+"&er_sortby="+c+"&sh_timeinuse="+this.getSettingsFieldValue(a,"sh_timeinuse",isSettingsEnabled,"weightedAvg");
if(h==undefined||h=="-1"||h.indexOf("All")>-1||h.length>0){r+="&er_perserver="+this.getSettingsFieldValue(a,"er_perserver",isSettingsEnabled,"selectedAgg")+"&er_server="+q.findField("er_server").getValue();}}var m=this.getSettingsFieldValue(a,"timefrom",isSettingsEnabled,"selectedTimeFrom");var v=this.getSettingsFieldValue(a,"minfrom",isSettingsEnabled,"selectedMinsFrom");
var d=this.getSettingsFieldValue(a,"timeto",isSettingsEnabled,"selectedTimeTo");var t=this.getSettingsFieldValue(a,"minto",isSettingsEnabled,"selectedMinsTo");var w="&er_timeline="+q.findField("er_timeline").getValue()+"&startdate="+q.findField("er_stdate").dataArray+"&enddate="+q.findField("er_enddate").dataArray+"&starthr="+q.findField("er_sthr").dataArray+"&endhr="+q.findField("er_endhr").dataArray+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin;
var i="&timefrom="+m+"&minfrom="+v+"&timeto="+d+"&minto="+t;if(appConstants.publicjsonDataActivity.hasOwnProperty("hiddenfields")){var l=appConstants.publicjsonDataActivity.hiddenfields;for(var g in l){u+="&"+g+"="+l[g];}}var f;if(appConstants.publicjsonDataActivity.hasOwnProperty("selectedWorkergroup")){f="&er_workgrpname="+appConstants.publicjsonDataActivity.selectedWorkergroup;
appConstants.queryStringActivity=r+w+u+i+f;}else{appConstants.queryStringActivity=r+w+u+i;}},updateQStringUsage:function(){var r;var t="";var v;var b;var g=new Array();var h;var q=Ext.getCmp("mainform").getForm();var a=null;if(isSettingsEnabled){a=this.getThinclientapplicationsettings().getForm();h=Ext.getCmp("graphViews").getValue();
}g=Ext.getCmp("er_server").getValue();r="&er_compType="+q.findField("er_compType").getValue()+"&er_application="+encodeURIComponent(q.findField("er_application_usage").getValue())+"&er_reportgenration="+this.getSettingsFieldValue(a,"reportGeneration",isSettingsEnabled,"reportGeneration");if(isSettingsEnabled){r+="&er_graphViews="+h.cType;
}var n=Ext.getCmp("er_option");if(n!=undefined){r+="&er_option="+n.getValue();if(n.getValue()=="Zone"){var o=q.findField("select_farm").getValue();r+="&er_zone="+o;}else{if(n.getValue()=="Group"||n.getValue()=="Segment"||n.getValue()=="Service"){var j=Ext.getCmp("er_site");r+="&er_site="+j.getValue();
}}}if(Ext.get("showLegend")!=null){r=r+"&showLegend="+q.findField("showLegend").getValue();}for(var p=0;g.length>p;p++){r+="&er_component="+g[p];}var v="&er_timeline="+q.findField("er_timeline").getValue()+"&startdate="+q.findField("er_stdate").dataArray+"&enddate="+q.findField("er_enddate").dataArray+"&starthr="+q.findField("er_sthr").dataArray+"&endhr="+q.findField("er_endhr").dataArray+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin;
var m=this.getSettingsFieldValue(a,"timefrom",isSettingsEnabled,"selectedTimeFrom");var u=this.getSettingsFieldValue(a,"minfrom",isSettingsEnabled,"selectedMinsFrom");var c=this.getSettingsFieldValue(a,"timeto",isSettingsEnabled,"selectedTimeTo");var s=this.getSettingsFieldValue(a,"minto",isSettingsEnabled,"selectedMinsTo");
var i="&timefrom="+m+"&minfrom="+u+"&timeto="+c+"&minto="+s;if(appConstants.publicjsonDataUsage.hasOwnProperty("hiddenfields")){var l=appConstants.publicjsonDataUsage.hiddenfields;for(var f in l){t+="&"+f+"="+l[f];}}var d;if(appConstants.publicjsonDataUsage.hasOwnProperty("selectedWorkergroup")){d="&er_workgrpname="+appConstants.publicjsonDataActivity.selectedWorkergroup;
appConstants.queryStringUsage=r+v+t+i+d;}else{appConstants.queryStringUsage=r+v+t+i;}},afterMainRender:function(){var a=this;if(targetType=="Application Usage"){this.refreshReportData(appConstants.publicjsonDataUsage);}else{this.refreshReportData(appConstants.publicjsonDataActivity);}},loadFormElements:function(){registerAjaxEvents();
var a=Ext.getCmp("mainform").getForm();if(targetType=="Application Activity"){Ext.getCmp("showLegend").hide();}else{if(Ext.getCmp("showLegend")!=undefined){if(appConstants.isshowLegend!=undefined&&appConstants.isshowLegend!=null&&appConstants.isshowLegend=="true"||appConstants.isshowLegend==true){Ext.getCmp("showLegend").setValue(true);
}}}if(targetType=="Application Usage"){if(appConstants.er_RmDispName!=null&&appConstants.er_RmDispName!="null"&&appConstants.er_RmDispName!="undefined"){this.getMain().setTitle(appConstants.er_RmDispName);}else{this.getMain().setTitle(appConstants.publicjsonDataUsage.reportTitle);}this.fillFormFieldsForUsage(appConstants.publicjsonDataUsage);
Ext.getCmp("egcomponent").show();if(!hideBackButton){Ext.getCmp("thinclientapplicationform").add({xtype:"hidden",id:"ID",name:"ID",value:appConstants.publicjsonDataUsage["ID"]});}}else{if(appConstants.er_RmDispName!=null&&appConstants.er_RmDispName!="null"&&appConstants.er_RmDispName!="undefined"){this.getMain().setTitle(appConstants.er_RmDispName);
}else{this.getMain().setTitle(appConstants.publicjsonDataActivity.reportTitle);}this.fillFormFieldsForActivity(appConstants.publicjsonDataActivity);if(!hideBackButton){Ext.getCmp("thinclientapplicationform").add({xtype:"hidden",id:"ID",name:"ID",value:appConstants.publicjsonDataActivity["ID"]});}}var n=a.findField("er_type").getValue();
if(targetType=="Application Activity"||targetType=="Application Report"){if(n=="Yes"){Ext.getCmp("egcomponent").hide();}else{Ext.getCmp("egcomponent").show();}}else{Ext.getCmp("multiselectpanel1").hide();}if(targetType=="Application Usage"){jsonData=appConstants.publicjsonDataUsage;}else{jsonData=appConstants.publicjsonDataActivity;
}var l=jsonData.screenLabels;var m=jsonData.timelineCombo;var p=jsonData.selectedTimeline;var c=a.findField("er_timeline");c.setFieldLabel(l["reporter.common.Timeline"]);c.getStore().loadRawData(m);if(!Ext.isEmpty(m)){if(!Ext.isEmpty(p)){c.setValue(p);}else{c.setValue(m[0].valueField);}}var f=a.findField("er_option");
f.getStore().loadRawData(jsonData.analysisByCombo);f.setFieldLabel(l["reporter.thin.Report By"]);if(!Ext.isEmpty(jsonData.selectedAnalysisByCombo)){f.setValue(jsonData.selectedAnalysisByCombo);}else{if(jsonData.analysisByCombo!=undefined){f.setValue(jsonData.analysisByCombo[0].valueField);}}var j=jsonData.startHour;
var d=jsonData.endHour;var h=jsonData.startDate;var b=jsonData.endDate;var g=a.findField("er_stdate");g.setValue(jsonData.startDateForDisplay);g.dataArray=h;var o=a.findField("er_sthr");o.setValue(jsonData.startHourForDisplay);o.dataArray=j;var k=a.findField("er_enddate");k.setValue(jsonData.endDateForDisplay);
k.dataArray=b;var i=a.findField("er_endhr");i.setValue(jsonData.endHourForDisplay);i.dataArray=d;mgr_stmin=jsonData.startmin;mgr_enmin=jsonData.endmin;},refreshReportData:function(a){if(appConstants.isSubmit!=null&&appConstants.isSubmit=="true"){this.gridColStateParam="ASC";this.gridColIndexParam=a.selectedSort;
this.loadReportData(a);}else{if(appConstants.isForceSubmit=="true"){appConstants.isForceSubmit="false";this.showResult();}}},fillFormFieldsForActivity:function(n){var g;var h;var o;var k="false";var c=Ext.getCmp("mainform").getForm();if(n.hasOwnProperty("isSubmit")){var k=n.isSubmit;}var d=appConstants.publicjsonDataActivity.hiddenfields;
var f=d["fromScheduleModify"];var l=d["fromFavoriteModify"];if(f!=null&&f=="Yes"||(l!=null&&l=="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 m=n.screenLabels;appConstants.globalScreenLabels=n.screenLabels;var b="";if(n.hasOwnProperty("selectedAnalysisByCombo")){b=n.selectedAnalysisByCombo;}if(b=="Zone"){Ext.getCmp("er_site").hide();g=n.zoneCombo;h=n.selectedZone;o=c.findField("select_farm");o.setFieldLabel(m["reporter.consolidated.Zone"]);
o.getStore().clearFilter(true);o.getStore().loadRawData(g);if(!Ext.isEmpty(h)){o.setValue(h);}else{o.setValue(g[0].valueField);}}else{if(b=="Segment"){Ext.getCmp("select_farm").hide();g=n.siteCombo;h=n.selectedSiteCombo;o=c.findField("er_site");o.setFieldLabel("Segment");o.getStore().clearFilter(true);
o.getStore().loadRawData(g);if(!Ext.isEmpty(h)){o.setValue(h);}else{o.setValue(g[0].valueField);}o.show();}else{if(b=="Group"){Ext.getCmp("select_farm").hide();g=n.siteCombo;h=n.selectedSiteCombo;o=c.findField("er_site");o.setFieldLabel("Group");o.getStore().clearFilter(true);o.getStore().loadRawData(g);
if(!Ext.isEmpty(h)){o.setValue(h);}else{o.setValue(g[0].valueField);}o.show();}else{if(b=="Service"){Ext.getCmp("select_farm").hide();g=n.siteCombo;h=n.selectedSiteCombo;o=c.findField("er_site");o.setFieldLabel("Service");o.getStore().clearFilter(true);o.getStore().loadRawData(g);if(!Ext.isEmpty(h)){o.setValue(h);
}else{o.setValue(g[0].valueField);}o.show();}else{if(b=="Component"){Ext.getCmp("select_farm").hide();Ext.getCmp("er_site").hide();}else{if(n.hasOwnProperty("zoneCombo")){g=n.zoneCombo;var p=n.selectedZone;o=c.findField("select_farm");o.getStore().loadRawData(g);if(!Ext.isEmpty(p)){o.setValue(p);}else{o.setValue(g[0].valueField);
}o.show();}}}}}}if(n.hasOwnProperty("componentTypeCombo")){g=n.componentTypeCombo;h=n.selectedComponentType;o=c.findField("er_compType");o.setFieldLabel(m["reporter.common.Component Type"]);o.getStore().clearFilter(true);o.getStore().loadRawData(g);if(!Ext.isEmpty(h)){o.setValue(h);}else{o.setValue(g[0].valueField);
}o.show();}if(n.hasOwnProperty("workerGroupCombo")){g=n.workerGroupCombo;h=n.selectedWorkergroup;e=c.findField("er_workgrpname");e.setFieldLabel(m["reporter.thin.Worker Group"]);e.getStore().loadRawData(g);if(!Ext.isEmpty(h)){e.setValue(h);}else{e.setValue(g[0].valueField);}e.show();}else{c.findField("er_workgrpname").hide();
}g=n.viewApplnCombo;h=n.selectedViewAppln;o=c.findField("report_category");o.setFieldLabel(m["reporter.common.View Application"]);o.getStore().loadRawData(g);if(!Ext.isEmpty(h)){o.setValue(h);}else{o.setValue(g[0].valueField);}g=n.reportTypeCombo;h=n.selectedreportType;o=c.findField("er_type");o.setFieldLabel(m["reporter.thin.Report Type"]);
o.getStore().loadRawData(g);if(!Ext.isEmpty(h)){o.setValue(h);}else{o.setValue(g[0].valueField);}if(h=="No"){Ext.getCmp("select_testmes").hide();Ext.getCmp("er_mode").hide();g=n.serverCombo;h=n.selectedServer;o=Ext.getCmp("er_server");var j=Ext.getCmp("multiSelectLabel");j.setText(m["reporter.common.Server"]);
var a=Ext.getCmp("expandSelectorActivity");a.setTooltip("<b>"+m["reporter.common.Server"]+"</b>");var i=Ext.getCmp("egcomponent");o.getStore().loadRawData(g);if(!Ext.isEmpty(h)){o.setValue(h);}else{o.setValue(g[0].valueField);}i.show();if(h!=null&&h!="undefined"){if(h.indexOf("All")>-1||h.length>1){if(Ext.getCmp("er_perserver")!=undefined){Ext.getCmp("er_perserver").show();
}}}g=n.applnCombo;h=n.selectedAppln;o=Ext.getCmp("er_application");appConstants.rawDataForApplication=g;o.getStore().loadRawData(g);if(!Ext.isEmpty(h)){o.setValue(h);}else{o.setValue(g[0].valueField);}o.show();}else{g=n.measureCombo;h=n.selectedMeasure;o=c.findField("select_testmes");o.setFieldLabel(m["reporter.thin.Criteria"]);
o.getStore().clearFilter(true);o.getStore().loadRawData(g);if(!Ext.isEmpty(h)){o.setValue(h);}else{o.setValue(g[0].valueField);}}c.findField("er_option").show();},loadSettingsElements:function(){var b="";var m="";if(targetType=="Application Usage"){b=appConstants.publicjsonDataUsage["hiddenfields"];m=b["favorite_id"];
if(!Ext.isEmpty(m)){Ext.getCmp("reportGeneration").setDisabled(true);}}else{b=appConstants.publicjsonDataActivity["hiddenfields"];m=b["favorite_id"];if(!Ext.isEmpty(m)){Ext.getCmp("reportGeneration").setDisabled(true);}}Ext.getCmp("moreOptionCloseId").show();var f;var g;var o;var c=this.getThinclientapplicationsettings().getForm();
if(targetType=="Application Usage"){jsonData=appConstants.publicjsonDataUsage;}else{jsonData=appConstants.publicjsonDataActivity;}var k=jsonData.screenLabels;Ext.getCmp("timeperiodLbl").setText(k["reporter.common.Time period"]);c.findField("timefrom").setValue(jsonData.selectedTimeFrom);c.findField("minfrom").setValue(jsonData.selectedMinsFrom);
c.findField("timeto").setValue(jsonData.selectedTimeTo);c.findField("minto").setValue(jsonData.selectedMinsTo);stmin=jsonData.startMinForDisplay;enmin=jsonData.endMinForDisplay;updatingAppSettings();if(targetType=="Application Activity"||targetType=="Application Report"){f=jsonData.excludeWeekCombo;g=jsonData.excludeWeek;
o=c.findField("er_excwe");o.setFieldLabel(k["reporter.common.Exclude weekends"]);o.getStore().loadRawData(f);if(!Ext.isEmpty(g)){o.setValue(g);}else{o.setValue(f[0].valueField);}f=jsonData.excludeAppArry;g=jsonData.selectedExcludeApp;o=c.findField("exeAppTxtField");if(!Ext.isEmpty(g)){o.setValue(g);}else{o.setValue(f[0].valueField);
}var l=Ext.getCmp("excludeApplication");l.setFieldLabel(k["reporter.thin.Exclude Applications"]);f=jsonData.weightedAvgCombo;g=jsonData.weightedAvg;o=c.findField("sh_timeinuse");o.setFieldLabel(k["reporter.comparison.Weighted Average"]);o.getStore().loadRawData(f);if(!Ext.isEmpty(g)){o.setValue(g);}else{o.setValue(f[0].valueField);
}f=jsonData.aggbasedOn;g=jsonData.selectedAgg;o=c.findField("er_perserver");o.setFieldLabel(k["reporter.thin.Aggregate across servers"]);o.getStore().loadRawData(f);if(!Ext.isEmpty(g)){o.setValue(g);}else{o.setValue(f[0].valueField);}var h=jsonData.selectedreportType;o=c.findField("sort_by");if(h!=undefined&&h=="No"){g=jsonData.selectedSort;
f=jsonData.sortComboArr;o.getStore().loadRawData(f);o.setFieldLabel(k["reporter.thin.Sort By"]);if(!Ext.isEmpty(g)){o.setValue(g);}else{o.setValue(f[0].valueField);}o.show();}else{g=jsonData.selectedSort;f=jsonData.sortComboArr;o.getStore().loadRawData(f);o.setFieldLabel(k["reporter.thin.Sort By"]);if(!Ext.isEmpty(g)){o.setValue(g);
}else{o.setValue(f[0].valueField);}o.hide();}}var p=jsonData.reportGenerationCombo;var n=jsonData.reportGeneration;var d=c.findField("reportGeneration");d.setFieldLabel(k["reporter.common.Report Generation"]);d.getStore().loadRawData(p);d.setValue(n);if(targetType=="Application Usage"){var o=Ext.getCmp("graphViews");
var g=jsonData.er_graphViews;o=Ext.getCmp("lineView");if(!Ext.isEmpty(g)){if(g=="Area"){o=Ext.getCmp("areaView");}}o.setValue(true);}var j=this;Ext.EventManager.onWindowResize(function(){Ext.get("configMod").setStyle("left","");});Ext.get("closeSettings").on("click",function(){j.validateAndCloseSettings();
});if(targetType=="Application Activity"||targetType=="Application Report"){c.findField("sh_timeinuse").show();c.findField("er_excwe").show();c.findField("er_perserver").hide();var a=Ext.getCmp("mainform").getForm();var i=Ext.getCmp("er_server").getValue();if(a.findField("er_type").getValue()==null||a.findField("er_type").getValue()==undefined){return;
}if(i==null||i==""||i.length==0){return;}else{if(i==undefined||i=="-1"||i.indexOf("All")>-1||i.length>1){if(Ext.getCmp("er_perserver")!=undefined){Ext.getCmp("er_perserver").show();}}else{if(Ext.getCmp("er_perserver")!=undefined){Ext.getCmp("er_perserver").hide();}}}}else{c.findField("sh_timeinuse").hide();
c.findField("er_excwe").hide();c.findField("er_perserver").hide();}},validateAndCloseSettings:function(){var b=this.validateSettings();var a=Ext.getCmp("submit");a.setDisabled(true);if(b){a.setDisabled(false);Ext.get("configMod").animate({duration:500,to:{y:-500}});return true;}return false;},closeSettingAndSubmit:function(){if(this.validateAndCloseSettings()){this.showResult();
}},showConfigDropdown:function(){isSettingsEnabled=true;var a=new Ext.XTemplate('<div style="float:left;margin:0px 0px 0px 0px">'+strMoreOptions+'</div><div style="text-align:right;float:right;"><div class="iconCloseNew" id="closeSettings"></div></div>');Ext.create("Ext.container.Container",{width:565,id:"configMod",ui:"settingsWindowContainer",items:[{xtype:"container",cls:"configMode_popupArrow",style:{"top":"-14px","left":"355px"}},{xtype:"container",html:a.apply(),cls:"containerHeader",style:{"top":"0px","margin":"0px"}},{xtype:"thinclientapplicationsettings",parent:this}],renderTo:"thinclientapplication"});
},LoadDrillDownData:function(d){var c=d.substring(d.indexOf("?")+1);var b=d.substring(0,d.indexOf("?"));var f=Ext.getCmp("resultPanel");var a=this;Ext.Ajax.request({url:b,params:c,method:"POST",margin:"0 10 10 10",scope:this,success:function(p){var i=p.responseText;var r=Ext.decode(i);if(r.hasOwnProperty("DrillDownData")){f.removeAll();
var o=r["DrillDownData"];var h=o["columnDetails"];var u=o["dataAvailable"];var t=o["dataArray"];if(!Ext.isEmpty(t)){var s='<div class="newTable" style="padding:0px 10px 10px 10px" >'+'<table cellspacing="0" cellpadding="0" border="0" width="100%">'+"<thead>"+"<tr>";for(var n in h){s+="<th>"+"<div>"+h[n]+"</div>"+"</th>";
}s+="</tr>"+"</thead>"+"<tbody>"+'<tpl for=".">';for(var q in t){var g=t[q];s+="<tr>";for(var m in g){s+="<td>"+"<div>"+g[m]+"</div>"+"</td>";}s+="</tr>";}s+="</tpl>"+"</tbody>"+"</table>"+"</div>";}if(u){f.add({xtype:"panel",title:o.title,ui:"newGraphPanel",border:true,tools:[{xtype:"button",text:backText,cls:"backbutton",iconCls:"iconBack",margin:"0px 5px 0px 0px",id:"thiClientbckButton",name:"thiClientbckButton",listeners:{"click":function(){a.submitReport();
}}}],html:s});}else{f.removeAll();f.add({xtype:"panel",ui:"newGraphPanel",tools:[{xtype:"button",text:backText,cls:"backbutton",listeners:{"click":function(){a.submitReport();}}}],items:[{xtype:"container",style:{"height":"200px"},html:'<table width="100%" height="100%"><tr><td align="center" valign="middle"><div class="iconExclamation" ></div><div class="commonErrorMsgText"> No Measures Available</div></td></tr></table>'}]});
Ext.getCmp("printTool").setDisabled(true);Ext.getCmp("mailTool").setDisabled(true);}}}});},expandAppln:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}appConstants.erUtils.expandMultiComboButton(Ext.getCmp("er_application"),Ext.getCmp("appLabel").text,a);
},expandMeUsage:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}appConstants.erUtils.expandMultiComboButton(Ext.getCmp("er_server"),Ext.getCmp("systemLabel").text,a);},expandMeActivity:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}appConstants.erUtils.expandMultiComboButton(Ext.getCmp("er_server"),Ext.getCmp("multiSelectLabel").text,a);},getSettingsFieldValue:function(a,h,d,f){var b=null;if(targetType=="Application Usage"){b=appConstants.publicjsonDataUsage;}else{b=appConstants.publicjsonDataActivity;}var g="";if(d){var c=a.findField(h);
if(!Ext.isEmpty(c)){g=c.getValue();}}else{if(b!=null){g=b[f];}}return g;}});