Ext.define("ExternalMonitorApp.controller.ExternalMonitorController",{extend:"Ext.app.Controller",views:["Main"],refs:[{selector:"main",ref:"main"},{selector:"newUtilities",ref:"newUtilities"},{selector:"mainform",ref:"mainform"},{selector:"externalMonitorForm",ref:"externalMonitorForm"},{selector:"externalMonitorAppSettings",ref:"externalMonitorAppSettings"},{selector:"resultpanel",ref:"resultpanel"},{selector:"nomeasurepanel",ref:"nomeasurepanel"},{selector:"backGroundPanel",ref:"backGroundPanel"},{selector:"customtrigger",ref:"customtrigger"},{selector:"ReporterSettings",ref:"ReporterSettings"}],init:function(){this.control({"newUtilities":{"afterrender":this.loadTools},"main":{"afterrender":this.afterMainRender},'mainform button[name="submit"]':{"click":this.submitReport},'mainform button[name="save"]':{"click":this.modifyScheduleFavorite},"newUtilities > #saveTool > button":{"click":this.saveReportAsPDF},"newUtilities > #printTool > button":{"click":this.printReport},"newUtilities > #mailTool > button":{"click":this.sendMail},"newUtilities > #csvTool > button":{"click":this.saveCsv},"newUtilities > #favoriteTool > button":{"click":this.saveFavorite},"newUtilities > #scheduleTool > button":{"click":this.saveSchedule},'mainform button[id="expandSelector"]':{"click":this.expandMe},'externalMonitorForm combo[id="er_type"]':{"select":this.onSelectReportFor},'externalMonitorForm combo[id="er_option"]':{"select":this.onSelectAnalysisBy},'externalMonitorForm combo[id="er_site"]':{"select":this.onSelectSiteBy},'externalMonitorForm combo[id="er_subZone"]':{"select":this.onSelectSiteBy},'externalMonitorForm combo[id="er_compType"]':{"select":this.onSelectComponentType},'externalMonitorForm combo[id="er_externalAgent"]':{"select":this.onSelectExternalAgent},'mainform trigger[id="compSearch"]':{"change":this.compMultiselect},"mainform multiselectfield[id=er_Component]":{},"externalMonitorAppSettings":{"afterrender":this.closeSetting},'externalMonitorAppSettings combo[name="reportGeneration"]':{"select":this.reportGenChange},'externalMonitorAppSettings button[id="moreOptionCloseId"]':{"click":this.validateAndCloseSettings},'externalMonitorAppSettings button[id="submitViaSetting"]':{"click":this.closeSettingAndSubmit},'mainform button[id="panelinsidetoggle"]':{"click":this.toggleForm}});
},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);},afterMainRender:function(){this.getMain().setTitle(appConstants.defaultLoadData.reportTitle);
var e=appConstants.defaultLoadData;this.setReportForData(e);this.setErOptionData(e);var a=Ext.getCmp("er_option");var g=Ext.getCmp("er_site");var h=Ext.getCmp("er_subZone");if(a!=undefined&&a.getValue()!=undefined&&a.getValue()!="Component"&&a.getValue()!="-1"){this.setSiteOptionData(e);g.show();h.show();
}else{g.hide();h.hide();}this.setComponentTypeData(e);this.setExternalAgentData(e);this.setApplciationData(e);this.setComponentData(e);var b=Ext.getCmp("er_timeline");b.getStore().loadRawData(e["timelineCombo"]);b.setValue(e["selectedTimeline"]);var c=Ext.getCmp("er_stdate");c.setValue(e.startDateForDisplay);
c.dataArray=e.startDate;var j=Ext.getCmp("er_sthr");j.setValue(e.startHourForDisplay);j.dataArray=e.startHour;var i=Ext.getCmp("er_enddate");i.setValue(e.endDateForDisplay);i.dataArray=e.endDate;var f=Ext.getCmp("er_endhr");f.setValue(e.endHourForDisplay);f.dataArray=e.endHour;mgr_stmin=appConstants.defaultLoadData.startmin;
mgr_enmin=appConstants.defaultLoadData.endmin;Ext.getCmp("externalMonitorForm").add({xtype:"hidden",id:"ID",name:"ID",value:e["ID"]});if(appConstants.isDrillDown!=undefined&&appConstants.isDrillDown=="true"){var d=Ext.getCmp("mainform");d.hide();Ext.getCmp("panelinsidetoggle").hide();Ext.getCmp("selectionDetails").hide();
}},expandMe:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}appConstants.erUtils.expandMultiComboButton(Ext.getCmp("er_Component"),Ext.getCmp("compLbl").text,a);},setSiteOptionData:function(b){var c=Ext.getCmp("er_site");var d=Ext.getCmp("er_subZone");if(b.subZoneCombo!=undefined){var a=Ext.getCmp("er_option");
c.setFieldLabel(a.getValue());c.getStore().loadRawData(b["siteCombo"]);c.setValue(b.selectedField["selectedSiteCombo"]);var d=Ext.getCmp("er_subZone");d.getStore().loadRawData(b["subZoneCombo"]);d.setValue(b.selectedField["selectedSubZone"]);c.show();d.show();}else{c.hide();d.hide();}},setReportForData:function(b){var a=Ext.getCmp("er_type");
a.getStore().loadRawData(b["reportForCombo"]);if(b.selectedField!=undefined&&b.selectedField["selectedReportFor"]!=undefined){a.setValue(b.selectedField["selectedReportFor"]);}else{var c=b["reportForCombo"];if(c!=undefined&&c.length>0){a.setValue(c[0].valueField);}}},setErOptionData:function(b){var a=Ext.getCmp("er_option");
a.getStore().loadRawData(b["analysisBy"]);if(b.selectedField!=undefined&&b.selectedField["selectedAnalysisBy"]!=undefined){a.setValue(b.selectedField["selectedAnalysisBy"]);}else{var c=b["analysisBy"];if(c!=undefined&&c.length>0){a.setValue(c[0].valueField);}}},setComponentTypeData:function(b){var c=Ext.getCmp("er_compType");
c.getStore().loadRawData(b["compTypeCombo"]);if(b.selectedField!=undefined&&b.selectedField["selectedComponentTypes"]!=undefined){c.setValue(b.selectedField["selectedComponentTypes"]);}else{var a=b["compTypeCombo"];if(a!=undefined&&a.length>0){c.setValue(a[0].valueField);}}},setExternalAgentData:function(a){var b=Ext.getCmp("er_externalAgent");
b.getStore().loadRawData(a["externalAgentCombo"]);if(a.selectedField!=undefined&&a.selectedField["selectedExternalAgent"]!=undefined){b.setValue(a.selectedField["selectedExternalAgent"]);}else{var c=a["externalAgentCombo"];if(c!=undefined&&c.length>0){b.setValue(c[0].valueField);}}},setApplciationData:function(b){if(appConstants.reportFor!=undefined&&!appConstants.applicationComboHidden){var c=Ext.getCmp("er_application");
if(c.isHidden()){c.show();}appConstants.applicationComboHidden=false;if(b.selectedField!=undefined&&b.selectedField["selectedAppLabel"]!=undefined){c.setFieldLabel(b.selectedField["selectedAppLabel"]);}c.getStore().loadRawData(b["applicationCombo"]);if(b.selectedField!=undefined&&b.selectedField["selectedApplication"]!=undefined){c.setValue(b.selectedField["selectedApplication"]);
}else{var a=b["applicationCombo"];if(a!=undefined&&a.length>0){c.setValue(a[0].valueField);}}}},setComponentData:function(a){var b=Ext.getCmp("er_Component");b.getStore().clearFilter(true);b.getStore().loadRawData(a["componentCombo"]);if(!Ext.isEmpty(a.selectedField["selectedComponents"])&&a.selectedField["selectedComponents"]!=undefined){b.setValue(a.selectedField["selectedComponents"]);
}else{if(a["componentCombo"][0].valueField!="-1"){b.setValue(a["componentCombo"][0].valueField);}}},onSelectReportFor:function(c){appConstants.reportFor=Ext.getCmp("er_type").getValue();var b="reportFor="+appConstants.reportFor;var a=this;appConstants.LoadingMask.show();Ext.Ajax.request({url:"/final/reporter/ErExternalMonitorReportJSON.jsp",scope:this,method:"POST",params:b,success:function(d){var f=d.responseText;
var e=Ext.decode(f);appConstants.defaultLoadData=e;a.setErOptionData(e);var g=Ext.getCmp("er_option").getValue();if(g!="Component"&&g!=-1){a.setSiteOptionData(e);Ext.getCmp("er_site").show();Ext.getCmp("er_subZone").show();}else{Ext.getCmp("er_site").hide();Ext.getCmp("er_subZone").hide();}a.setComponentTypeData(e);
a.setExternalAgentData(e);if(appConstants.defaultLoadData.enableAppCombo!=undefined&&appConstants.defaultLoadData.enableAppCombo=="yes"){appConstants.applicationComboHidden=false;}else{appConstants.applicationComboHidden=true;}if(appConstants.reportFor!=undefined&&!appConstants.applicationComboHidden){a.setApplciationData(e);
appConstants.applicationComboHidden=false;Ext.getCmp("er_application").show();}else{appConstants.applicationComboHidden=true;Ext.getCmp("er_application").hide();}a.setComponentData(e);appConstants.LoadingMask.hide();}});},onSelectAnalysisBy:function(c){var d=Ext.getCmp("er_option").getValue();appConstants.reportFor=Ext.getCmp("er_type").getValue();
var b="analysisBy="+d+"&reportFor="+appConstants.reportFor;var a=this;appConstants.LoadingMask.show();Ext.Ajax.request({url:"/final/reporter/ErExternalMonitorReportJSON.jsp",scope:this,method:"POST",params:b,success:function(e){var g=e.responseText;var f=Ext.decode(g);appConstants.defaultLoadData=f;if(d!="Component"){a.setSiteOptionData(f);
Ext.getCmp("er_site").show();if(d=="Zone"){Ext.getCmp("er_subZone").show();}else{Ext.getCmp("er_subZone").hide();}}else{Ext.getCmp("er_site").hide();Ext.getCmp("er_subZone").hide();}a.setComponentTypeData(f);a.setExternalAgentData(f);a.setApplciationData(f);a.setComponentData(f);appConstants.LoadingMask.hide();
}});},onSelectSiteBy:function(c){var d=Ext.getCmp("er_site").getValue();var b="analysisBy="+Ext.getCmp("er_option").getValue()+"&er_site="+d+"&er_subZone="+Ext.getCmp("er_subZone").getValue();appConstants.reportFor=Ext.getCmp("er_type").getValue();b+="&reportFor="+appConstants.reportFor;var a=this;appConstants.LoadingMask.show();
Ext.Ajax.request({url:"/final/reporter/ErExternalMonitorReportJSON.jsp",scope:this,method:"POST",params:b,success:function(e){var g=e.responseText;var f=Ext.decode(g);appConstants.defaultLoadData=f;a.setComponentTypeData(f);a.setExternalAgentData(f);a.setApplciationData(f);a.setComponentData(f);appConstants.LoadingMask.hide();
}});},onSelectComponentType:function(){var d=Ext.getCmp("er_option").getValue();var b=Ext.getCmp("er_compType").getValue();var e="&analysisBy="+d;appConstants.reportFor=Ext.getCmp("er_type").getValue();e+="&reportFor="+appConstants.reportFor;if(!appConstants.enableMultiCompType){e+="&er_compType="+b;
}else{for(var f=0;f<b.length;f++){e+="&er_compType="+b[f];}}var a=this;appConstants.LoadingMask.show();Ext.Ajax.request({url:"/final/reporter/ErExternalMonitorReportJSON.jsp",scope:this,method:"POST",params:e,success:function(c){var h=c.responseText;var g=Ext.decode(h);appConstants.defaultLoadData=g;
a.setComponentData(g);a.setExternalAgentData(g);a.setApplciationData(g);appConstants.LoadingMask.hide();}});},onSelectExternalAgent:function(){var e=Ext.getCmp("er_option").getValue();var d=Ext.getCmp("er_compType").getValue();var g="&analysisBy="+e;appConstants.reportFor=Ext.getCmp("er_type").getValue();
g+="&reportFor="+appConstants.reportFor;if(!appConstants.enableMultiCompType){g+="&er_compType="+d;}else{for(var h=0;h<d.length;h++){g+="&er_compType="+d[h];}}var f=Ext.getCmp("er_externalAgent").getValue();g+="&er_externalAgent="+f;if(appConstants.reportFor!=undefined&&!appConstants.applicationComboHidden){var b=Ext.getCmp("er_application").getValue();
g+="&er_application="+b;}var a=this;appConstants.LoadingMask.show();Ext.Ajax.request({url:"/final/reporter/ErExternalMonitorReportJSON.jsp",scope:this,method:"POST",params:g,success:function(c){var j=c.responseText;var i=Ext.decode(j);appConstants.defaultLoadData=i;a.setComponentData(i);a.setApplciationData(i);
appConstants.LoadingMask.hide();}});},compMultiselect:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}a.toggleTriggger();appConstants.erUtils.filterComboStore(a,Ext.getCmp("er_Component"),appConstants.defaultLoadData["componentCombo"]);},onSelectComponent:function(f){if(appConstants.isDrillDown!=undefined&&appConstants.isDrillDown=="true"){return;
}if(appConstants.isSubmit!=undefined&&appConstants.isSubmit=="true"){return;}var e=Ext.getCmp("er_option").getValue();var d=Ext.getCmp("er_compType").getValue();var g="&analysisBy="+e;appConstants.reportFor=Ext.getCmp("er_type").getValue();g+="&reportFor="+appConstants.reportFor;if(!appConstants.enableMultiCompType){g+="&er_compType="+d;
}else{for(var h=0;h<d.length;h++){g+="&er_compType="+d[h];}}var b=Ext.getCmp("er_Component").getValue();if(b[0]=="-1"){this.showMessage("Components is Not Applicable");return false;}if(b.length>1&&(b.indexOf("All")>-1||b.indexOf("all")>-1)){this.showMessage("Chosen component group not allowed");return false;
}for(var h=0;h<b.length;h++){g+="&er_Component="+b[h];}var a=this;appConstants.LoadingMask.show();Ext.Ajax.request({url:"/final/reporter/ErExternalMonitorReportJSON.jsp",scope:this,method:"POST",params:g,success:function(c){var j=c.responseText;var i=Ext.decode(j);appConstants.defaultLoadData=i;a.setExternalAgentData(i);
a.setApplciationData(i);appConstants.LoadingMask.hide();}});},saveReportAsPDF:function(){appConstants.reportFor=Ext.getCmp("er_type").getValue();var a="../reporter/ErHtmlToSavePdf.jsp?reportFor="+appConstants.reportFor;if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}appConstants.erUtils.savePDF(a);
},bookletQuery:function(b){var a=this.getQueryString();return a;},bookletScheduleQuery:function(b){var a=this.getQueryString();a+="&er_rtype=ExternalMonitorReport&er_trgttype=ExternalMonitorReport&er_ViewName=ErExternalMonitorReport.jsp&er_RmDispName=ExternalMonitorReport";return a;},bookletPreview:function(){this.printReport();
},printReport:function(){appConstants.reportFor=Ext.getCmp("er_type").getValue();var a="/final/reporter/ErExternalMonitorPrint.jsp?pdfPrint=yes&inidate="+appConstants.defaultLoadData.inidate+"&reportFor="+appConstants.reportFor;parent.printWindowFn(a);},sendMail:function(){Ext.widget("sendmail").show();
},saveCsv:function(){window.location="../servlet/com.eg.ErExternalMonitorReportC?er_view=CSV";},saveSchedule:function(b){var c=this.getQueryString();var a="/final/reporter/ErSaveSchedule.jsp?er_rtype=ExternalMonitorReport&er_trgttype=ExternalMonitorReport&er_ViewName=ErExternalMonitorReport.jsp&er_RmDispName=ExternalMonitorReport&"+c;
if(Ext.getCmp("er_timeline").getValue()=="Any"){this.showMessage("Chosen timeline not allowed");return;}parent.scheduleWindowFn(a);},saveFavorite:function(){var b=this.getQueryString();var a="/final/reporter/ErSaveFavorite.jsp?er_trgttype=ExternalMonitorReport&er_rtype=ExternalMonitorReport&er_ViewName=ErExternalMonitorReport.jsp&er_RmDispName=ExternalMonitorReport&"+b;
parent.favouriteWindowFn(a);},modifyScheduleFavorite:function(){var d=this.getQueryString();var c="&er_trgttype=ExternalMonitorReport&er_rtype=ExternalMonitorReport&er_ViewName=ErExternalMonitorReport.jsp&er_RmDispName=ExternalMonitorReport&fromFavoriteModify=Yes&cmd=client";var a="&schedule_id="+appConstants.scheduleID+"&fromScheduleModify=Yes";
var b="&FavoriteId="+appConstants.favoriteID+"&fromFavoriteModify=Yes&er_favorite="+appConstants.erFavorite+"&er_rtype=ExternalMonitorReport";var f="";if(appConstants.isModifyFavorite=="Yes"){f="/final/reporter/ErSaveFavorite.jsp?showSchWindow=no";d+=c+b;}else{f="/final/reporter/ErSaveSchedule.jsp?showSchWindow=no";
d+=c+a;}var e=Ext.create("Ext.form.Panel");e.submit({url:f,params:d,standardSubmit:true,method:"POST"});},submitReport:function(a){Ext.getCmp("er_timeline").fireEvent("forceSelect",Ext.getCmp("er_timeline"));},showResult:function(){Ext.getCmp("panelinsidetoggle").setDisabled(false);if(!isSettingsEnabled){this.showConfigDropdown();
}var e="";if(appConstants.isSubmit!=undefined&&appConstants.isSubmit=="true"){e=this.getQueryString();}else{e=this.getQueryString();if(e==false){return;}}var g=this;var h="foreground";if(isSettingsEnabled){h=Ext.getCmp("reportGeneration").getValue();}if(h=="foreground"){var f=this;var d=appConstants.defaultLoadData.limitforbg;
var i=appConstants.defaultLoadData.maxDays;var j=Ext.getCmp("er_stdate").getValue();var b=Ext.getCmp("er_sthr").getValue();var a=Ext.getCmp("er_enddate").getValue();var c=Ext.getCmp("er_endhr").getValue();j.setHours(b);a.setHours(c);if(!checkTimeLineForBgLimit(d,i,j,a)){Ext.Msg.confirm("Confirm",appConstants.forGrdReportConfirmMsg,function(l){if(l==="no"){this.getReporterSettings().down("button").fireHandler();
Ext.getCmp("reportGeneration").setValue("background");var k=Ext.getCmp("bgReportName");k.show();k.focus(false,1000);Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();return false;}else{if(l==="yes"){f.submitReportByAjaxCall(e);}}},this);}else{f.submitReportByAjaxCall(e);}}else{e+="&servletName=ErExternalMonitorReportC&er_rtype=ExternalMonitorReport&er_ViewName=ErExternalMonitorReport.jsp&er_RmDispName=ExternalMonitorReport";
e+="&er_trgttype=&forwardto=ExternalMonitorReport&er_bgreportfrom=ExternalMonitorReport&bgenabled=Yes&savereport=save";if(h=="background"){bgUrl="/final/servlet/com.eg.ErStartBackGroundReportC";}else{if(h=="background-csv"){bgUrl="../servlet/com.eg.ErStartBackGroundReportC?SaveFormat=CSV";}}appConstants.LoadingMask.show();
this.getNomeasurepanel().hide();Ext.Ajax.request({url:bgUrl,scope:this,method:"POST",params:e,success:function(l){var m=Ext.getCmp("backGroundPanel");appConstants.LoadingMask.hide();var o=l.responseText;var n=Ext.decode(o);var p=n.reportVal;var k=p.status;var q="";if(k=="success"){q='<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">'+p.bgstr1+".</br>"+'<a class="backgroundMsgLink" href='+p.queryString+">"+p.bgstr2+"</a></div></td></tr></table></td></tr></table>";
}else{if(k=="duplicate"){q='<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">'+p.bgstr1+".</br>"+'<a class="backgroundMsgLink" href='+p.queryString+">"+p.bgstr2+"</a></div></td></tr></table></td></tr></table>";
}else{q='<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">'+p.bgstr1+"</div></td></tr></table></td></tr></table>";
}}m.update(q);m.show();}});}},submitReportByAjaxCall:function(c){appConstants.LoadingMask.show();c+="&er_view=submit";var b=this;var a="/final/servlet/com.eg.ErExternalMonitorReportC";this.getNomeasurepanel().hide();this.getBackGroundPanel().hide();Ext.Ajax.request({url:a,scope:this,method:"POST",params:c,success:function(f){var d=Ext.getCmp("resultPanel");
d.removeAll();var i=f.responseText;var k=Ext.decode(i);d.show();if(k.isData!=undefined&&k.isData){Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);Ext.getCmp("selectionDetails").setSelectionDetailsData(k.selectionDetails);
try{if(k.chartView!=undefined&&k.chartView){Ext.getCmp("csvTool").setDisabled(true);var g=new Array();var j=k.testPanelList;for(var n in j){var l=j[n];if(l.type!=undefined){if(l.type=="anyChart"){g.push(b.getAnyChart(l));}else{if(l.type=="flowChart"){g.push(b.getFlowChart(l));}else{if(l.type=="digitalWithChart"){g.push(b.getDigitalWithChart(l));
}else{if(l.type=="overviewPanel"){g.push(b.getOverviewPanel(l));}}}}}}d.add({xtype:"panel",layout:{type:"vbox",align:"stretch"},scroll:true,autoScroll:true,defaults:{xtype:"panel",ui:"newGraphPanel",columnWidth:1,margin:"0 2 0 0",bodyPadding:"0 10 10 10",},items:g});}else{Ext.getCmp("csvTool").setDisabled(false);
var m=b.getGrid("grid0",k);d.add(m);}this.getNomeasurepanel().hide();}catch(h){console.log("==Exception==>>>>"+h);}}else{this.disableTools();d.hide();this.getNomeasurepanel().show();Ext.getCmp("panelinsidetoggle").setDisabled(true);}appConstants.LoadingMask.hide();}});},getOverviewPanel:function(i){var g=i.title;
var e=i.type;var f=i.panelHeight;var c=i.subPanels;var d=this;var h=c[0].internalSubPanelName;var b=d.getQueryString();var a=b;return{xtype:"panel",margin:"0 10 10 10",bodyPadding:"0 0 4 0",padding:0,ui:"newGraphPanel",title:g,height:parseFloat(f),id:e+h,name:h,type:e,layout:{type:"hbox",align:"stretch"},defaults:{},items:[],listeners:{boxready:function(l){var k=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});
k.show();var j="/final/servlet/com.eg.ErExternalMonitorReportC";b=a+"&chartView=yes&panelName="+this.name+"&type="+this.type+"&er_view=submit";Ext.Ajax.request({url:j,params:b,scope:this,success:function(m){k.hide();var n=m.responseText;var o=Ext.decode(n);d.loadChart(o,this.id,this.type,this.name,this.height,"");
},failure:function(m){Ext.MessageBox.alert("Error occured in ExternalMonitorReport.jsp page");}});}}};},getDigitalWithChart:function(l){var j=l.title;var h=l.type;var i=l.panelHeight;var b=l.panelColWidth;var f=l.subPanels;var g=this;var m=new Array();for(var n in f){var a=f[n];var e=a.title;var k=a.internalSubPanelName;
var d=g.getQueryString();var c=d;m.push({xtype:"container",id:h+k,name:k,type:h,margin:"0 0 0 10",cls:a.lineCls,height:parseFloat(i),items:[],listeners:{boxready:function(q){var p=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});p.show();var o="/final/servlet/com.eg.ErExternalMonitorReportC";d=c+"&chartView=yes&panelName="+this.name+"&type="+this.type+"&er_view=submit";
Ext.Ajax.request({url:o,params:d,scope:this,success:function(r){p.hide();var s=r.responseText;var t=Ext.decode(s);g.loadChart(t,this.id,this.type,this.name,this.height,"");},failure:function(r){Ext.MessageBox.alert("Error occured in ExternalMonitorReport.jsp page");}});}}});}return{xtype:"panel",margin:"0 10 10 10",ui:"newGraphPanel",title:j,height:i,layout:{type:"column",align:"stretch"},defaults:{columnWidth:b,},items:m};
},getFlowChart:function(k){var i=k.title;var g=k.type;var h=k.panelHeight;var e=k.subPanels;var l=new Array();var f=this;for(var m in e){var a=e[m];var d=a.title;var j=a.internalSubPanelName;var c=f.getQueryString();var b=c;l.push({xtype:"container",id:g+j,name:j,type:g,margin:"0 0 0 10",cls:a.lineCls,height:parseFloat(h),items:[],listeners:{boxready:function(p){var o=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});
o.show();var n="/final/servlet/com.eg.ErExternalMonitorReportC";c=b+"&chartView=yes&panelName="+this.name+"&type="+this.type+"&er_view=submit";Ext.Ajax.request({url:n,params:c,scope:this,success:function(q){o.hide();var r=q.responseText;var s=Ext.decode(r);},failure:function(q){Ext.MessageBox.alert("Error occured in ExternalMonitorReport.jsp page");
}});}}});}return{xtype:"panel",margin:"0 10 10 10",ui:"newGraphPanel",title:i,height:h,layout:{type:"column",align:"stretch"},defaults:{columnWidth:0.5,},items:l};},getAnyChart:function(m){var k=m.title;var h=m.type;var j=m.panelHeight;var f=m.subPanels;var n=new Array();var g=this;for(var o in f){var a=f[o];
var e=a.title;var l=a.internalSubPanelName;var d=g.getQueryString();var c=d;n.push({xtype:"container",id:h+l,name:l,type:h,margin:"0 0 0 0",padding:"10 0 0 0",panelIndex:o,cls:a.lineCls,height:parseFloat(j),items:[],listeners:{boxready:function(r){var q=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});
q.show();var p="/final/servlet/com.eg.ErExternalMonitorReportC";d=c+"&chartView=yes&panelName="+this.name+"&type="+this.type+"&er_view=submit";Ext.Ajax.request({url:p,params:d,scope:this,success:function(s){q.hide();var t=s.responseText;var u=Ext.decode(t);g.loadChart(u,this.id,this.type,this.name,this.height,this.panelIndex);
},failure:function(s){Ext.MessageBox.alert("Error occured in ExternalMonitorReport.jsp page");}});}}});var i=h+l;var b=i.substring(i.lastIndexOf("_")+1);if(b=="panel2"){n.push({xtype:"container",columnWidth:1,cls:"graphSeperatorLineBottom",id:h+l+"_child",hidden:true,layout:"column",margin:"0 0 10 0",height:parseFloat(j)+10,defaults:{columnWidth:0.5,layout:"fit",margin:"10 0 10 0"},items:[]});
}}return{xtype:"panel",margin:"0 10 10 10",ui:"newGraphPanel",title:k,height:j,layout:{type:"column",align:"stretch"},defaults:{columnWidth:0.5,},items:n};},loadChart:function(e,p,f,u,j,r){var h=e["chartCollection"];if(e["gridCollection"]!=undefined){h=e["gridCollection"];}var a=e["isData"];var b=Ext.getCmp(p);
b.removeAll();var m;var g="0 0 10 10";if(r.length>0&&r%2==0){g="0 0 10 0";}if(a){var t=this;switch(f){case"anyChart":m=new Array();if(h.chartType!=undefined&&h.chartType=="grid"){m.push({xtype:"container",margin:g,html:'<span class="newFont_bold13">'+h.subPanelTitle+"</span>",});m.push(t.getGrid(this.id,e));
var c=p.substring(p.lastIndexOf("_")+1);var i=p;var q=p+"_child";if(c=="panel2"){if(a){Ext.getCmp(q).show();Ext.getCmp(q).add({xtype:"container",cls:"graphSeperatorLineRight",style:{"border-right-width":"1px"},chartCollection:e["chartCollection"],html:'<div class="newFont_bold13">Top 10 Transactions Based on Success (%)</div><div id="left_chart" style="width:100%"></div>',listeners:{"boxready":function(w){try{var k={};
k=jQuery.extend(true,{},getHighChartsBarInstance("left_chart",300,300),k);k.setData(this.chartCollection,"");k.drawChart();}catch(v){console.log("template anychart exveption::::::left_chart===>>"+v);}}}},{xtype:"container",margin:"10 0 0 10",chartCollection:e["avgbarChartCollection"],html:'<div class="newFont_bold13">Top 10 Transactions Based on Average (Secs)</div><div id="right_chart" style="width:100%"></div>',listeners:{"boxready":function(w){try{var k={};
k=jQuery.extend(true,{},getHighChartsBarInstance("right_chart",300,300),k);k.setData(this.chartCollection,"");k.drawChart();}catch(v){console.log("template anychart exveption::::::right_chart===>>"+v);}}}});Ext.getCmp(i).doComponentLayout();}}}else{m.push({xtype:"container",margin:g,html:'<span class="newFont_bold13">'+h.subPanelTitle+"</span>",});
m.push({xtype:"container",border:true,id:"chartId"+p,height:j-40,flex:1,listeners:{"boxready":function(w){try{var k={};if(h.TimeFormatOut!=undefined){k=jQuery.extend(true,{},getHighChartsInstance(this.id,this.height,""),k);}else{k=jQuery.extend(true,{},getHighChartsBarInstance(this.id,this.height,""),k);
}k.setData(h,currentDateFormat,"");k.drawChart();}catch(v){console.log("template anychart exveption::::::"+this.id+"===>>"+v);}}}});}b.add(m);break;case"digitalWithChart":var s=h.digitalObj;m=new Array();m.push({xtype:"container",html:'<table align="center"><tr><td align="right" style="padding-right:5px"><div class="'+s.imageCls+'"></div></td><td style="text-align:left;padding-left:5px" class="newFont_bold28">'+s.value+'</td></tr><tr><td align="right" colspan="2" style="padding:5px 5px 10px 5px"><span class="newFont_normal13">'+s.title+"</span></td></tr></table>",width:"100%",style:{textAlign:"center",width:"50px"}});
m.push({xtype:"container",border:true,id:"chartId"+p,height:j-60,flex:1,listeners:{"boxready":function(w){try{var k={};if(h.TimeFormatOut!=undefined){}else{k=jQuery.extend(true,{},getHighChartsBarInstance(this.id,this.height,""),k);}k.setData(h,currentDateFormat,"");k.drawChart();}catch(v){console.log("template digitalWithChart exveption::::::"+this.id+"===>>"+v);
}}}});b.add(m);break;case"overviewPanel":m=new Array();if(h.fistChartData!=undefined){var o=h.fistChartData;var l=o.firstSummaryList;if(l!=undefined&&l.length>0){for(var n in l){var s=l[n];if(s.value!=undefined){m.push({xtype:"container",autoSize:true,align:"center",height:j,flex:0.22,layout:{type:"vbox",align:"stretch",pack:"center"},defaults:{padding:"6px 5px 5px 5px",width:"100%",style:{textAlign:"center",width:"50px"}},items:[{html:'<table align="center"><tr><td align="right" style="padding-right:5px"><div class="'+s.imageCls+'"></div></td><td style="text-align:left;padding-left:5px" class="newFont_bold28">'+s.value+"</td></td></table>",},{html:'<span class="newFont_normal13">'+s.name+"</span>"}]});
}}}m.push({xtype:"container",align:"center",id:"chartId"+p,flex:0.34,height:j,autoSize:true,border:true,layout:{type:"hbox",align:"stretch",},items:[{xtype:"container",align:"center",id:"chartId1"+p,flex:0.5,border:true,height:j,margin:"0 0 0 0",align:"stretch",listeners:{"boxready":function(w){try{var k={};
k=jQuery.extend(true,{},getHighChartsBarInstance(this.id,this.height,this.height),k);k.setData(o.fistSummaryDonut,currentDateFormat,"");k.drawChart();}catch(v){console.log("template overviewpanel exveption::::::"+this.id+"===>>"+v);}},resize:function(){if(!Ext.isEmpty($(this.id).highcharts())){$(this.id).highcharts().reflow();
}}}},{xtype:"container",id:"chartId2"+p,flex:0.5,height:j,border:true,layout:{type:"vbox",align:"stretch",pack:"center"},items:[{xtype:"container",html:'<table cellpadding="0" cellspacing="0" border="0" ><tr></tr><tr><td><div style="background-color:'+o.successColor+';width:6px;height:6px;border-radius:4px;">&nbsp;</div></td><td style="padding:2px 10px;" class="font_normal11">Success</td><td class="font_normal11">'+o.successPercent+'</td></tr><tr><td><div style="background-color:'+o.failureColor+';width:6px;height:6px;border-radius:4px;">&nbsp;</div></td><td style="padding:2px 10px;" class="font_normal11">Failure</td><td class="font_normal11">'+o.failurePercent+"</td></tr></table>",}]}],});
}b.add(m);break;default:break;}}else{m=new Array();var d="";if(h!=undefined&&h.subPanelTitle!=undefined){d=h.subPanelTitle;}m.push({xtype:"container",padding:g,html:'<span class="newFont_bold13">'+d+"</span>",});m.push(this.getNoMeasure());b.add(m);}},getGrid:function(t,f){var e="";var E=this;var n=new Array();
var l=new Array();var w=f.gridCollection;var b=w.gridColumn;var G=w.gridData;var D=w.requestQueryString;var B=false;if(b.length>8){B=true;}for(var v in b){var h=b[v];var m="center";if(h.align!=undefined&&h.align.length>0){m=h.align;}var y=h.name;var i=h.name;var r=false;if(h.lock!=undefined&&h.lock=="true"){r=true;
}if(y!=undefined&&y.indexOf("(")!=-1){if(y.indexOf("%")>-1){y=y.substring(0,y.indexOf("("))+"<br>"+y.substring(y.indexOf("(")+1,y.lastIndexOf(")"));}else{y=y.substring(0,y.indexOf("("))+"<br>("+y.substring(y.indexOf("(")+1,y.lastIndexOf(")"))+")";}}var C=100;if(h.width!=undefined&&h.width.length>0){C=parseFloat(h.width);
}var u;if(h.subColumnArry!=undefined&&h.subColumnArry.length>0){u=new Array();var q=h.subColumnArry;for(var g in q){var z=q[g];var A=i+z;l.push(A);u.push({header:z,align:"center",dataIndex:A,sortable:true,renderer:function(M,P,I,J,O,N,K){var k="";if(M!=undefined&&M.indexOf("~DDLink")!=-1){k=M.substring(M.indexOf("~DDLink")+7);
M=M.substring(0,M.indexOf("~DDLink"));}if(M!=undefined&&M.indexOf("$")!=-1){var L=M.substring(M.indexOf("$")+1);M=M.substring(0,M.indexOf("$"));P.tdCls="iconColumn";k=D+"&"+k;M="<div style='position:relative;margin:2px auto 2px auto;width:50px;padding:3px 10px 1px 10px;color:#ffffff;border-radius:2px;background:"+L+";'><a class='anchorLinkDefault' style='color:#ffffff;' href='javascript:void(0);' onClick='javascript:linkURL(\""+k+"\")'>"+M+"</a></div>";
}else{if(k.length>0){k=D+"&"+k;M="<a class='anchorLinkDefault' href='javascript:void(0);' onClick='javascript:linkURL(\""+k+"\")'>"+M+"</a>";}}return M;},doSort:function(I){var k=this.up("grid").store;var J=this.getSortParam();k.sort({property:J,direction:I,sorterFn:function(L,K){L=L.get(J);K=K.get(J);
if(L.indexOf("~DDLink")!=-1){L=L.substring(0,L.indexOf("~DDLink"));}if(K.indexOf("~DDLink")!=-1){K=K.substring(0,K.indexOf("~DDLink"));}if(L.indexOf("$")!=-1){L=L.substring(0,L.indexOf("$"));}if(K.indexOf("$")!=-1){K=K.substring(0,K.indexOf("$"));}if(isNaN(L)){L=L.toLowerCase();}if(isNaN(K)){K=K.toLowerCase();
}if(!isNaN(L)&&!isNaN(K)){L=Ext.isNumber(L)?L:parseFloat(String(L),10);K=Ext.isNumber(K)?K:parseFloat(String(K),10);if(I=="ASC"){L=isNaN(L)?999999:L;K=isNaN(K)?999999:K;}else{L=isNaN(L)?0:L;K=isNaN(K)?0:K;}}else{if(!isNaN(new Date(L))&&!isNaN(new Date(K))){K=new Date(K).getTime();L=new Date(L).getTime();
}}return L>K?1:(L<K?-1:0);}});}});}var o={header:y,align:m,width:C,dataIndex:i,sortable:true,columns:u};if(B&&r){o.locked=true;}n.push(o);}else{l.push(h);var o={header:y,align:m,height:55,width:C,dataIndex:i,sortable:true,renderer:function(M,P,I,J,O,N,K){var k="";if(M!=undefined&&M.indexOf("~DDLink")!=-1){k=M.substring(M.indexOf("~DDLink")+7);
M=M.substring(0,M.indexOf("~DDLink"));}if(M!=undefined&&M.indexOf("$")!=-1){var L=M.substring(M.indexOf("$")+1);M=M.substring(0,M.indexOf("$"));P.tdCls="iconColumn";k=D+"&"+k;M="<div style='position:relative;margin:2px auto 2px auto;width:50px;padding:3px 10px 1px 10px;color:#ffffff;border-radius:2px;background:"+L+";'><a class='anchorLinkDefault' href='javascript:void(0);' style='color:#ffffff' onClick='javascript:linkURL(\""+k+"\")'>"+M+"</a></div>";
}else{if(k.length>0){k=D+"&"+k;M="<a class='anchorLinkDefault' href='javascript:void(0);' onClick='javascript:linkURL(\""+k+"\")'>"+M+"</a>";}}if(M!=undefined&&M.indexOf("stageColor")!=-1){var L="#EE2C24";L=M.substring(M.indexOf("stageColor")+10);M='<div style="background-color:'+L+';width:7px;height:7px;border-radius:3px;">&nbsp;</div>';
}return M;},doSort:function(I){var k=this.up("grid").store;var J=this.getSortParam();k.sort({property:J,direction:I,sorterFn:function(L,K){L=L.get(J);K=K.get(J);if(L.indexOf("~DDLink")!=-1){L=L.substring(0,L.indexOf("~DDLink"));}if(K.indexOf("~DDLink")!=-1){K=K.substring(0,K.indexOf("~DDLink"));}if(L.indexOf("$")!=-1){L=L.substring(0,L.indexOf("$"));
}if(K.indexOf("$")!=-1){K=K.substring(0,K.indexOf("$"));}if(isNaN(L)){L=L.toLowerCase();}if(isNaN(K)){K=K.toLowerCase();}if(!isNaN(L)&&!isNaN(K)){L=Ext.isNumber(L)?L:parseFloat(String(L),10);K=Ext.isNumber(K)?K:parseFloat(String(K),10);if(I=="ASC"){L=isNaN(L)?999999:L;K=isNaN(K)?999999:K;}else{L=isNaN(L)?0:L;
K=isNaN(K)?0:K;}}else{if(!isNaN(new Date(L))&&!isNaN(new Date(K))){K=new Date(K).getTime();L=new Date(L).getTime();}}return L>K?1:(L<K?-1:0);}});}};if(B&&r){o.locked=true;}n.push(o);}}var s=7;if(t!=undefined&&t=="grid0"){s=15;}var j=Ext.create("Ext.data.ArrayStore",{fields:l,proxy:{type:"pagingmemory",reader:{type:"array"}},pageSize:s,sortable:true,autoLoad:true,remoteSort:true,data:G});
var x=1;var c=false;if(G.length<=s){c=true;}else{c=false;}var a=true;if(n!=undefined&&n.length>8){a=false;}var H="";var F="";if(t!=undefined&&t=="grid0"){H=w.title;F="newGraphPanel";}var p="0 10 10 10";var d="0 10 10 10";if(H==""){p="0";d="0 0 5 10";}e=Ext.create("Ext.panel.Panel",{title:H,ui:F,margin:p,items:[{xtype:"customgrid",sortableColumns:true,ui:"newGridPanel",id:t,margin:d,border:true,scroll:true,autoScroll:true,forceFit:a,store:j,columns:n,listeners:{render:function(k){}},updateRowSpan:function(){var I=this.columns,N=this.getView(),Q=this.getStore(),M=Q.getCount(),k=I[0],O=k.dataIndex,K=null,J=null;
spanValue=null;for(var S=0;S<M;++S){var R=N.getCellByPosition({row:S,column:0}).dom,L=Q.getAt(S),P=L.get(O);if(P!=undefined&&P.indexOf("~DDLink")!=-1){P=P.substring(0,P.indexOf("~DDLink"));}if(spanValue!=P){if(K!==null){K.rowSpan=J;}Ext.fly(R).setStyle("display","");K=R;J=1;spanValue=P;}else{J++;Ext.fly(R).setStyle("display","none");
}}if(K!==null){K.rowSpan=J;}},dockedItems:[{xtype:"pagingtoolbar",cls:"newPagination",dock:"bottom",store:j,hidden:c,displayInfo:true,displayMsg:"Displaying {0} - {1} of {2}",emptyMsg:"No topics to display",listeners:{change:function(k,I){if(!Ext.isEmpty(I)){x=I.currentPage;}else{x=1;}}}}]}],});return e;
},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);},showConfigDropdown:function(){isSettingsEnabled=true;var d=new Ext.XTemplate('<div style="float:left;margin:0px 0px 0px 0px">More Options</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:d.apply(),cls:"containerHeader",style:{"top":"0px","margin":"0px"}},{xtype:"externalMonitorAppSettings",parent:this}],renderTo:"viewMain"});
var h=Ext.getCmp("timefrom");h.setValue(appConstants.defaultLoadData.sHrForSetting);var a=Ext.getCmp("minfrom");a.setValue(appConstants.defaultLoadData.sMinForSetting);var e=Ext.getCmp("timeto");e.setValue(appConstants.defaultLoadData.eHourForSetting);var g=Ext.getCmp("minto");g.setValue(appConstants.defaultLoadData.eMinForSetting);
var c=this.getExternalMonitorAppSettings().getForm();c.findField("successCritical").setValue(appConstants.defaultLoadData.successCritical);c.findField("successMajor").setValue(appConstants.defaultLoadData.successMajor);c.findField("successMinor").setValue(appConstants.defaultLoadData.successMinor);var f=Ext.getCmp("er_excwe");
f.getStore().loadRawData(appConstants.defaultLoadData.excludeWeekCombo);f.setValue(appConstants.defaultLoadData.sExclweekUI);var b=Ext.getCmp("reportGeneration");b.getStore().loadRawData(appConstants.defaultLoadData.reportGenerationCombo);b.setValue(appConstants.defaultLoadData.sRepGenType);},closeSetting:function(){Ext.getCmp("moreOptionCloseId").show();
var a=this;Ext.get("closeSettings").on("click",function(){if(a.validateSettings()){a.validateAndCloseSettings();}});},validateAndCloseSettings:function(){if(this.validateSettings()){Ext.get("configMod").animate({duration:500,to:{y:-500}});return true;}},closeSettingAndSubmit:function(){if(this.validateAndCloseSettings()){this.submitReport();
}},validateSettings:function(){var a=Ext.getCmp("reportGeneration").getValue();if(a!=null&&(a=="background"||a=="background-csv")){var b=Ext.getCmp("bgReportName").getValue();if(!validateTextBoxWithSpecialChars(b,"Attachment",true)){return false;}}return true;},getQueryString:function(){var q=true;var s=Ext.getCmp("er_type").getValue();
var v=Ext.getCmp("er_option").getValue();var z=Ext.getCmp("er_compType").getValue();var e=Ext.getCmp("er_Component").getValue();if(e.length<1||e[0]=="-1"){this.showMessage("Components is Not Applicable");return false;}if(e.length>1&&(e.indexOf("All")>-1||e.indexOf("all")>-1)){this.showMessage("Chosen component group not allowed");
return false;}appConstants.reportFor=s;var u="&analysisBy="+v;if(v!=undefined&&v!="Component"){u+="&er_site="+Ext.getCmp("er_site").getValue();u+="&er_subZone="+Ext.getCmp("er_subZone").getValue();}if(!appConstants.enableMultiCompType){u+="&er_compType="+z;}else{for(var t=0;t<z.length;t++){u+="&er_compType="+z[t];
}}var g=appConstants.defaultLoadData.drillParams;u+="&er_Component1="+g.er_Component;u+="&er_externalAgent1="+g.er_externalAgent;if(appConstants.reportFor!=undefined&&!appConstants.applicationComboHidden){u+="&er_application1="+g.er_application;}for(var t=0;t<e.length;t++){u+="&er_Component="+e[t];}var h=Ext.getCmp("er_externalAgent").getValue();
u+="&er_externalAgent="+h;if(appConstants.reportFor!=undefined&&!appConstants.applicationComboHidden){var k=Ext.getCmp("er_application").getValue();u+="&er_application="+k;}var i=Ext.getCmp("er_timeline").getValue();var f=Ext.getCmp("er_stdate").getValue();var w=Ext.getCmp("er_sthr").getValue();var n=Ext.getCmp("er_enddate").getValue();
var b=Ext.getCmp("er_endhr").getValue();f.setHours(w);n.setHours(b);if(!checkDateTime(f,n)){return false;}f=Ext.getCmp("er_stdate").dataArray;w=Ext.getCmp("er_sthr").dataArray;n=Ext.getCmp("er_enddate").dataArray;b=Ext.getCmp("er_endhr").dataArray;var p="&er_timeline="+i+"&startdate="+f+"&enddate="+n+"&starthr="+w+"&endhr="+b+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&inidate="+appConstants.defaultLoadData.inidate;
var m="";if(isSettingsEnabled){var l=Ext.getCmp("timefrom").getValue();var d=Ext.getCmp("minfrom").getValue();var j=Ext.getCmp("timeto").getValue();var y=Ext.getCmp("minto").getValue();var a=Ext.getCmp("er_excwe").getValue();var x=Ext.getCmp("reportGeneration").getValue();var o="";if(!checkTimePeriod(l,d,j,y)){return false;
}if(x!="foreground"){o=Ext.getCmp("bgReportName").getValue();if(!validateTextBoxWithSpecialChars(o,"Attachment",true)){return false;}}m="&hourFromUI="+l+"&minFromUI="+d+"&hourToUI="+j+"&minToUI="+y+"&exclweek="+a+"&rGenType="+x+"&bg_reportname="+o;m+="&successCritical="+Ext.getCmp("successCritical").getValue()+"&successMajor="+Ext.getCmp("successMajor").getValue()+"&successMinor="+Ext.getCmp("successMinor").getValue();
m+="&er_reportgenration="+x+"&bg_reportname="+o;}var r="&userID="+appConstants.defaultLoadData.loginid;u+=p;u+=m;u+=r;u+="&reportFor="+appConstants.reportFor;if(appConstants.isDrillDown!=undefined&&appConstants.isDrillDown=="true"){u+="&drillDown=true";}return u;},reportGenChange:function(){Ext.getCmp("resultPanel").hide();
var a=Ext.getCmp("reportGeneration").getValue();if(a!="foreground"){Ext.getCmp("bgReportName").setValue("");Ext.getCmp("bgReportName").show();Ext.getCmp("moreOptionCloseId").hide();Ext.getCmp("submitViaSetting").show();}else{Ext.getCmp("bgReportName").hide();Ext.getCmp("submitViaSetting").hide();Ext.getCmp("moreOptionCloseId").show();
}},showMessage:function(a){Ext.MessageBox.show({title:"External Monitor Report",msg:a,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});},toggleForm:function(b){var a=Ext.getCmp("mainform");Ext.getCmp("panelinsidetoggle").show();if(appConstants.isDrillDown!=undefined&&appConstants.isDrillDown=="true"){return;
}if(a.isHidden()){a.show();Ext.getCmp("selectionDetails").hide();}else{a.hide();Ext.getCmp("selectionDetails").show();}},getNoMeasure:function(){return{xtype:"container",flex:1,html:'<div class="egFlexCenterByColumnWise" style="height:90%"> <div class="iconInformation"></div> <div class="commonErrorMsgText">No Measures Available!</div> </div>'};
},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;}});