Ext.define("vdiappactivity.controller.Main",{extend:"Ext.app.Controller",views:["Main"],refs:[{selector:"main",ref:"main"},{selector:"newUtilities",ref:"newUtilities"},{selector:"nomeasurepanel",ref:"nomeasurepanel"},{selector:"backGroundPanel",ref:"backGroundPanel"},{selector:"ReporterSettings",ref:"ReporterSettings"}],init:function(){this.control({'mainform button[id="panelinsidetoggle"]':{"click":this.goTopanelinsidetoggle},"main":{"afterrender":this.defaultLoading},"newUtilities":{"afterrender":this.loadTools},"vdiappactivityConfig":{"afterrender":this.afterSettingsrender},"newUtilities #saveTool button":{"click":this.saveReportAsPDF},"newUtilities > #printTool > button":{"click":this.printFile},"newUtilities > #mailTool > button":{"click":this.sendMail},"newUtilities > #favoriteTool > button":{"click":this.saveFavorite},"newUtilities > #scheduleTool > button":{"click":this.sendToschedule},'vdiappactivityForm combo[name="er_group"]':{"select":this.groupOnChange},'vdiappactivityForm combo[name="group_name"]':{"select":this.groupNameOnChange},'vdiappactivityForm combo[name="includeSubZone"]':{"select":this.includeSubZoneOnChange},'vdiappactivityForm combo[name="er_componentType"]':{"select":this.componentTypeOnChange},'egcomponent combo[name="er_component"]':{"select":this.componentOnChange},'mainform button[name="submit"]':{"click":this.showResult},'mainform button[name="save"]':{"click":this.goTo},'vdiappactivityConfig combo[name="excludeWeek"]':{"select":this.weekendOnChange},'vdiappactivityConfig combo[name="er_timeline"]':{},'vdiappactivityConfig combo[name="reportGeneration"]':{"select":this.reportGenChange},'vdiappactivityConfig button[id="moreOptionCloseId"]':{"click":this.validateAndCloseSettings},'vdiappactivityConfig button[id="submitViaSetting"]':{"click":this.closeSettingAndSubmit},'egcomponent button[id="expandSelector"]':{"click":this.expandMe},'timeline combo[name="er_mode"]':{"change":this.changeEr_mode},'egcomponent trigger[id="compSearch"]':{"change":this.filterMultiselect},'mainform button[id="panelinsidetoggle"]':{"click":this.toggleForm}});
},showConfigDropdown:function(){isSettingsEnabled=true;var a=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",{id:"configMod",ui:"settingsWindowContainer",width:565,items:[{xtype:"container",cls:"configMode_popupArrow",style:{"top":"-14px","left":"380px"}},{xtype:"container",html:a.apply(),cls:"containerHeader",style:{"top":"0px","margin":"0px"}},{xtype:"vdiappactivityConfig",parent:this}],renderTo:"main-body"});
var b=this;Ext.get("closeSettings").on("click",function(){b.validateAndCloseSettings();});},filterMultiselect:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}a.toggleTriggger();appConstants.erUtils.filterComboStore(a,Ext.getCmp("er_component"),appConstants.rawDataForComponents);
},changeEr_mode:function(a){Ext.get("configMod").animate({duration:250,to:{y:-530}});this.showResult();},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 b;},closeSettingAndSubmit:function(){if(this.validateAndCloseSettings()){this.showResult();}},afterSettingsrender:function(){Ext.getCmp("moreOptionCloseId").show();var d=appConstants.publicjsonData.hiddenFields;var k=d["favorite_id"];var j=d["schedule_id"];if((!Ext.isEmpty(k)&&k!="undefined"&&k!=undefined&&k!="null")||(!Ext.isEmpty(j)&&j!="undefined"&&j!=undefined&&j!="null")){Ext.getCmp("reportGeneration").setDisabled(true);
}var i=appConstants.publicjsonData;var a=i.showTopArray;var h=i.screenLabels;var m=i.selectedShowTop;var f=Ext.getCmp("selectedShowTop");f.setFieldLabel(h["reporter.common.Show Top N"]);f.getStore().loadRawData(a);if(!Ext.isEmpty(a)){if(!Ext.isEmpty(m)){f.setValue(m);}else{f.setValue(a[0].valueField);
}}var l=i.excludeArray;var c=i.excludeWeek;f=Ext.getCmp("excludeWeek");f.setFieldLabel(h["reporter.common.Exclude Weekends"]);f.getStore().loadRawData(l);if(!Ext.isEmpty(c)){f.setValue(c);}else{f.setValue(l[0].valueField);}var b=i.timefrom;var e=i.minfrom;var n=i.timeto;var g=i.minto;f=Ext.getCmp("timefrom");
f.setValue(b);f=Ext.getCmp("minfrom");f.setValue(e);f=Ext.getCmp("timeto");f.setValue(n);f=Ext.getCmp("minto");f.setValue(g);a=i.reportGenerationArray;var o=i.er_reportgenration;f=Ext.getCmp("reportGeneration");f.setFieldLabel(h["reporter.consolidated.Report Generation"]);f.getStore().loadRawData(a);
f.setValue(o);},goTo:function(a){appConstants.formButtonId=a.getId();var b=appConstants.publicjsonData.hiddenFields;var c=b["fromFavoriteModify"];if((c!=null&&c=="Yes")){this.saveFavorite();}else{this.sendToschedule();}},loadTools:function(){this.getNewUtilities().loadIcon(true,true,true,false,false,true,true,false,false,false,true);
Ext.getCmp("favoriteTool").setDisabled(false);Ext.getCmp("scheduleTool").setDisabled(false);},showResult:function(){Ext.getCmp("panelinsidetoggle").setDisabled(false);var f=Ext.getCmp("er_stdate").getValue();var h=Ext.getCmp("er_sthr").getValue();f.setHours(h);var b=Ext.getCmp("er_enddate").getValue();
var a=Ext.getCmp("er_endhr").getValue();b.setHours(a);var i=checkDateTime(f,b);if(!i){return;}var c=appConstants.publicjsonData["hiddenFields"]["getMaxDaysInMonth"];var d=appConstants.publicjsonData["hiddenFields"]["userTimeline"];if(d!=null&&d!="-1"){var g=isUserTimelineLimitExceeded(d,c,f,b);if(!g){Ext.MessageBox.show({title:"Resource Usage Settings",msg:_invalidUserTime,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}}var e=this.validateMainForm(true);if(e){this.formSubmit();}else{return;}},validateMainForm:function(h){var k=Ext.getCmp("er_stdate").getValue();var m=Ext.getCmp("er_sthr").getValue();k.setHours(m);var b=Ext.getCmp("er_enddate").getValue();var a=Ext.getCmp("er_endhr").getValue();b.setHours(a);
var j=Ext.getCmp("er_group").getValue();var g=Ext.getCmp("group_name").getValue();var l=Ext.getCmp("er_timeline").getValue();var c=appConstants.publicjsonData.er_reportgenration;if(isSettingsEnabled){c=Ext.getCmp("reportGeneration").getValue();}var e=appConstants.publicjsonData["hiddenFields"]["getMaxDaysInMonth"];
var f=appConstants.publicjsonData["hiddenFields"]["userTimeline"];if(j!=null&&j!="Zone"){var i=Ext.getCmp("er_componentType").getValue();if(i=="-1"||i=="NotApplicable"||i=="notapplicable"){Ext.MessageBox.show({title:"VDI Assessment",msg:Ext.getCmp("er_componentType").getStore().getAt(0).get("displayField"),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return;}}if(j!=null&&j=="Zone"){var i=Ext.getCmp("er_componentType").getValue();if(i=="-1"||i=="NotApplicable"||i=="notapplicable"){Ext.MessageBox.show({title:"VDI Assessment",msg:Ext.getCmp("er_componentType").getStore().getAt(0).get("displayField"),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return;}}if(g!=null){var i=Ext.getCmp("group_name").getValue();if(i=="-1"||i=="NotApplicable"||i=="notapplicable"){Ext.MessageBox.show({title:"VDI Assessment",msg:Ext.getCmp("group_name").getStore().getAt(0).get("displayField"),buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return;}}if(h){if(c!=null&&c=="foreground"){var d=appConstants.publicjsonData["hiddenFields"]["limitforbg"];
if(!Ext.isEmpty(d)){if(!checkTimeLineForBgLimit(d,e,k,b)){Ext.MessageBox.confirm("Confirm",appConstants.forGrdReportConfirmMsg,this.showConfirmResult,this);return false;}}}}return true;},formSubmit:function(){this.updateQueryString();var m;var l=appConstants.publicjsonData.startDate;var d=appConstants.publicjsonData.endDate;
var a=appConstants.publicjsonData.er_reportgenration;if(isSettingsEnabled){Ext.get("configMod").animate({duration:500,to:{y:-500}});a=Ext.getCmp("reportGeneration").getValue();}var i="";var n="";var g="";var o=new Array();o=Ext.getCmp("er_component").getValue();var p=Ext.getCmp("er_stdate").dataArray;
var e=Ext.getCmp("er_enddate").dataArray;if(appConstants.publicjsonData.hasOwnProperty("hiddenFields")){var c=appConstants.publicjsonData.hiddenFields;for(var f in c){if(f=="reporttype"||f=="subtype"){continue;}if(f=="beanstartdate"){var b=formatDate(new Date(getDateFromFormat(p,currentdateFormat_temp)),"dd-MM-yyyy");
i+="&"+f+"="+b;}else{if(f=="beanenddate"){var b=formatDate(new Date(getDateFromFormat(e,currentdateFormat_temp)),"dd-MM-yyyy");i+="&"+f+"="+b;}else{i+="&"+f+"="+c[f];}}}}for(var h=0;o.length>h;h++){g+="&er_component="+o[h];}n=appConstants.queryString+g+i;if(a=="foreground"){n+="&isSubmit=true";m="../servlet/com.eg.ErVDIAssessmentController?beta=json";
}else{if(a=="background"){n+="&throughSchedule=true";m="../servlet/com.eg.ErStartBackGroundReportC";var j=Ext.getCmp("bgReportName").getValue();j=checkFileName(j);n+="&pdfSave=yes&isPdf=yes&bg_reportname="+j;}}appConstants.initLdgMask.show();Ext.Ajax.request({url:m,params:n,scope:this,success:function(k){var r=k.responseText;
var q=Ext.decode(r);appConstants.publicjsonData=q;this.loadReportData(q);}});},saveReportAsPDF:function(){var b=appConstants.publicjsonData.saveQstring;var a="../reporter/ErHtmlToSavePdf.jsp?"+b+"&pdfSave=yes&isPdf=yes";if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}appConstants.erUtils.savePDF(a);},bookletQuery:function(c){var b=appConstants.publicjsonData.saveQstring;var a=b+"&pdfSave=yes&isPdf=yes";return a;},bookletScheduleQuery:function(f){var c="";this.updateQueryString();c+=appConstants.queryString;var e=new Array();if(appConstants.publicjsonData.hasOwnProperty("hiddenFields")){var d=appConstants.publicjsonData.hiddenFields;
for(var a in d){if(a=="reporttype"||a=="subtype"||a=="isSubmit"){continue;}c+="&"+a+"="+d[a];}}e=Ext.getCmp("er_component").getValue();for(var b=0;e.length>b;b++){c+="&er_component="+e[b];}c+="&isPdf=yes";return c;},bookletPreview:function(){this.printFile();},printFile:function(){var b=appConstants.publicjsonData.saveQstring;
var a="../reporter/ErVDIAssessmentPrint.jsp?"+b+"&pdfPrint=yes&pdfSave=yes";parent.printWindowFn(a);},sendMail:function(){var a=Ext.widget("sendmail");a.show();},reportGenChange:function(){Ext.getCmp("resultPanel").hide();this.disableTools();var a=Ext.getCmp("reportGeneration").getValue();if(a=="background"){Ext.getCmp("bgReportName").setValue("");
Ext.getCmp("bgReportName").show();Ext.getCmp("moreOptionCloseId").hide();Ext.getCmp("submitViaSetting").show();}else{Ext.getCmp("bgReportName").hide();Ext.getCmp("moreOptionCloseId").show();Ext.getCmp("submitViaSetting").hide();}},expandMe:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}appConstants.erUtils.expandMultiComboButton(Ext.getCmp("er_component"),Ext.getCmp("componentLabel").text,a);},saveFavorite:function(){var p=this.validateMainForm(false);if(!p){return;}this.updateQueryString();var n;var i="";var e=new Array();var g="";var l=appConstants.publicjsonData.startDate;var b=appConstants.publicjsonData.endDate;
if(appConstants.publicjsonData.hasOwnProperty("hiddenFields")){var c=appConstants.publicjsonData.hiddenFields;for(var f in c){if(f=="reporttype"||f=="subtype"){continue;}i+="&"+f+"="+c[f];}}e=Ext.getCmp("er_component").getValue();for(var h=0;e.length>h;h++){g+="&er_component="+e[h];}n=appConstants.queryString+g+i;
var c=appConstants.publicjsonData.hiddenFields;var o=c["favorite_id"];var m="../servlet/com.eg.ErFavoriteC?"+n+"&isSubmit=true&cmd=client"+"&er_RmDispName="+appConstants.er_RmDispName+"&com.eg.CSRF_NONCE="+csrfToken;if(appConstants.formButtonId=="save"){m+="&showSchWindow=no"+"&FavoriteId="+o;var d=m.substr(0,m.indexOf("?"));
var a=m.substr(m.indexOf("?")+1,m.length-1);var j=Ext.create("Ext.form.Panel");j.submit({url:d,params:a,standardSubmit:true,method:"POST"});}else{parent.favouriteWindowFn(m);}},sendToschedule:function(){var o=this.validateMainForm(false);if(o&&Ext.getCmp("er_timeline").getValue()=="Any"){Ext.MessageBox.show({title:"VDI Assessment-Application Activity",msg:"Chosen timeline not allowed",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
o=false;}if(!o){return;}this.updateQueryString();var n;var i="";var e=new Array();var g="";var l=appConstants.publicjsonData.startDate;var b=appConstants.publicjsonData.endDate;if(appConstants.publicjsonData.hasOwnProperty("hiddenFields")){var c=appConstants.publicjsonData.hiddenFields;for(var f in c){if(f=="reporttype"||f=="subtype"||f=="isSubmit"){continue;
}i+="&"+f+"="+c[f];}}e=Ext.getCmp("er_component").getValue();for(var h=0;e.length>h;h++){g+="&er_component="+e[h];}n=appConstants.queryString+g+i+"&isPdf=yes";var m="/final/reporter/ErSaveSchedule.jsp?"+n+"&com.eg.CSRF_NONCE="+csrfToken;if(appConstants.formButtonId=="save"){m+="&showSchWindow=no";var d=m.substr(0,m.indexOf("?"));
var a=m.substr(m.indexOf("?")+1,m.length-1);var j=Ext.create("Ext.form.Panel");j.submit({url:d,params:a,standardSubmit:true,method:"POST"});}else{parent.scheduleWindowFn(m);}},updateQueryString:function(){var d=appConstants.publicjsonData;var p="&er_timeline="+Ext.getCmp("er_timeline").getValue()+"&startdate="+Ext.getCmp("er_stdate").dataArray+"&enddate="+Ext.getCmp("er_enddate").dataArray+"&starthr="+Ext.getCmp("er_sthr").dataArray+"&endhr="+Ext.getCmp("er_endhr").dataArray+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin;
var q="";var j="";var r=d.selectedShowTop;var h=d.excludeWeek;var c=d.er_reportgenration;var k="&timefrom="+d.timefrom+"&minfrom="+d.minfrom+"&timeto="+d.timeto+"&minto="+d.minto;if(isSettingsEnabled){r=Ext.getCmp("selectedShowTop").getValue();h=Ext.getCmp("excludeWeek").getValue();c=Ext.getCmp("reportGeneration").getValue();
k="&timefrom="+Ext.getCmp("timefrom").getValue()+"&minfrom="+Ext.getCmp("minfrom").getValue()+"&timeto="+Ext.getCmp("timeto").getValue()+"&minto="+Ext.getCmp("minto").getValue();}var s=appConstants.publicjsonData["hiddenFields"]["reporttype"];var o=appConstants.publicjsonData["hiddenFields"]["subtype"];
var l="&reporttype="+s+"&subtype="+o;q="&er_reportType="+s;q+="&er_excwe="+h;q+="&er_mode="+Ext.getCmp("er_mode").getValue();var a=Ext.getCmp("er_group").getValue();var i=Ext.getCmp("er_componentType").getValue();j="er_group="+a+"&er_reportgenration="+c+"&sh_timeinuse="+Ext.getCmp("showTimeArray").getValue()+"&er_showTop="+r;
j+="&er_componentType="+i;j+="&er_component="+Ext.getCmp("er_component").getValue();if(a=="Zone"){var g=Ext.getCmp("includeSubZone").getValue();j+="&includeSubZone="+g;var e=Ext.getCmp("group_name").getValue();j+="&group_name="+e;}if(a=="Segment"||a=="Service"){var e=Ext.getCmp("group_name").getValue();
j+="&group_name="+e;}appConstants.queryString=j+q+k+p+l;var m=appConstants.publicjsonData["hiddenFields"];var b=m["fromFavoriteModify"];var n=m["fromScheduleModify"];var f=m["favorite_id"];appConstants.queryString+="&fromScheduleModify="+n+"&fromFavoriteModify="+b+"&id="+f;appConstants.queryString+="&er_RmDispName="+appConstants.er_RmDispName;
},toggleForm:function(b){Ext.getCmp("panelinsidetoggle").show();var a=Ext.getCmp("mainform");if(a.isHidden()){a.show();Ext.getCmp("selectionDetails").hide();}else{a.hide();Ext.getCmp("selectionDetails").show();}},disableTools:function(){Ext.getCmp("bookletTool").setDisabled(true);Ext.getCmp("saveTool").setDisabled(true);
Ext.getCmp("printTool").setDisabled(true);Ext.getCmp("mailTool").setDisabled(true);},groupOnChange:function(){Ext.getCmp("resultPanel").hide();this.disableTools();this.updateQueryString();Ext.Ajax.request({url:"/final/reporter/ErVDIApplicationActivityJson.jsp",params:appConstants.queryString,scope:this,success:function(a){var c=a.responseText;
var b=Ext.decode(c);appConstants.publicjsonData=b;this.loadGroupNames(b);}});},loadGroupNames:function(o){var p=Ext.getCmp("er_group").getValue();var m=Ext.getCmp("group_name");var a=Ext.getCmp("er_group");var l=o.analysisByArray;var i=Ext.getCmp("er_component");var e=Ext.getCmp("er_componentType");var k=o.componentTypeArray;
var j=o.er_componentType;var d=o.componentArray;appConstants.rawDataForComponents=d;var h=o.er_component;var n=o.screenLabels;if(p=="Zone"){var c=Ext.getCmp("includeSubZone");var b=o.GroupArray;var g=o.group_name;m.setFieldLabel(n["reporter.common.Zone"]);m.getStore().clearFilter(true);m.getStore().loadRawData(b);
m.setValue(b[0].valueField);var f=o.includeSubZoneArray;c.setFieldLabel(n["reporter.thin.Include subzones"]);c.getStore().loadRawData(f);c.setValue(f[0].valueField);var f=o.includeSubZoneArray;c.show();m.show();i.getStore().loadRawData(d);i.setValue(d[0].valueField);i.getStore().clearFilter(true);e.getStore().loadRawData(k);
e.setValue(k[0].valueField);}else{if(p=="Segment"){var b=o.GroupArray;m.setFieldLabel(n["reporter.common.Segment"]);m.getStore().clearFilter(true);m.getStore().loadRawData(b);m.setValue(b[0].valueField);a.getStore().loadRawData(l);a.setValue(p);e.getStore().loadRawData(k);e.setValue(k[0].valueField);
i.getStore().loadRawData(d);i.setValue(d[0].valueField);Ext.getCmp("includeSubZone").hide();m.show();}else{if(p=="Service"){var b=o.GroupArray;m.setFieldLabel(n["reporter.common.Service"]);m.getStore().clearFilter(true);m.getStore().loadRawData(b);m.setValue(b[0].valueField);a.getStore().loadRawData(l);
a.setValue(p);e.getStore().loadRawData(k);e.setValue(k[0].valueField);i.getStore().loadRawData(d);i.setValue(d[0].valueField);Ext.getCmp("includeSubZone").hide();m.show();}else{Ext.getCmp("includeSubZone").hide();m.hide();e.getStore().clearFilter(true);e.getStore().loadRawData(k);e.setValue(k[0].valueField);
i.getStore().loadRawData(d);i.setValue(d[0].valueField);}}}},groupNameOnChange:function(){Ext.getCmp("resultPanel").hide();this.disableTools();this.updateQueryString();Ext.Ajax.request({url:"/final/reporter/ErVDIApplicationActivityJson.jsp",params:appConstants.queryString,scope:this,success:function(a){var c=a.responseText;
var b=Ext.decode(c);appConstants.publicjsonData=b;this.loadComponentTypeCombo(b);}});},includeSubZoneOnChange:function(){Ext.getCmp("resultPanel").hide();this.disableTools();this.updateQueryString();Ext.Ajax.request({url:"/final/reporter/ErVDIApplicationActivityJson.jsp",params:appConstants.queryString,scope:this,success:function(a){var c=a.responseText;
var b=Ext.decode(c);appConstants.publicjsonData=b;this.loadIncludeSubZonesCombo(b);}});},componentTypeOnChange:function(){Ext.getCmp("resultPanel").hide();this.disableTools();this.updateQueryString();Ext.Ajax.request({url:"/final/reporter/ErVDIApplicationActivityJson.jsp",params:appConstants.queryString,scope:this,success:function(a){var c=a.responseText;
var b=Ext.decode(c);appConstants.publicjsonData=b;this.loadComponentCombo(b);}});},componentOnChange:function(){Ext.getCmp("resultPanel").hide();this.disableTools();this.updateQueryString();Ext.Ajax.request({url:"/final/reporter/ErVDIApplicationActivityJson.jsp",params:appConstants.queryString,scope:this,success:function(a){var c=a.responseText;
var b=Ext.decode(c);appConstants.publicjsonData=b;this.loadComponentCombo(b);}});},showOnChange:function(){Ext.getCmp("resultPanel").hide();this.disableTools();},showLoadingIcon:function(){appConstants.initLdgMask.show();},defaultLoading:function(){this.disableTools();if(appConstants.er_RmDispName!=null&&appConstants.er_RmDispName!="null"&&appConstants.er_RmDispName!="undefined"){this.getMain().setTitle(appConstants.er_RmDispName);
}else{this.getMain().setTitle(appConstants.publicjsonData.reportTitle);}this.loadField(appConstants.publicjsonData);if(!hideBackButton){Ext.getCmp("vdiappactivityForm").add({xtype:"hidden",id:"ID",name:"ID",value:appConstants.publicjsonData["ID"]});}this.refreshReportData();},refreshReportData:function(){if(appConstants.isSubmit!=null&&appConstants.isSubmit=="true"){this.loadReportData(appConstants.publicjsonData);
}else{if(appConstants.isForceSubmit=="true"){appConstants.isForceSubmit="false";this.showResult();}}},loadReportData:function(f){this.getNomeasurepanel().hide();this.getBackGroundPanel().hide();var s=Ext.getCmp("resultPanel");var d=appConstants.publicjsonData.er_reportgenration;if(d=="background"){var k="";
var x=f.backgroundReportStatus;s.hide();if(x!="undefined"&&x=="success"){var B=f.bgroundResponseTxt;var r=f.bgroundReportsURL;var v=f.backgroundAnchor;var l=v.substring(0,v.length-3);k='<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">'+B+".</br>"+'<a class="backgroundMsgLink" href='+r+">"+v+"</a></div></td></tr></table></td></tr></table>";
}else{if(x!="undefined"&&x=="duplicate"){var B=f.bgroundResponseTxt;var r=f.bgroundReportsURL;var v=f.backgroundAnchor;var l=v.substring(0,v.length-3);k='<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">'+B+".</br>"+'<a class="backgroundMsgLink" href='+r+">"+v+"</a></div></td></tr></table></td></tr></table>";
}else{var B=f.bgroundResponseTxt;k='<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">'+B+"</div></td></tr></table></td></tr></table>";
}}this.getBackGroundPanel().update(k);this.getBackGroundPanel().show();appConstants.initLdgMask.hide();}else{s.show();Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);if(appConstants.publicjsonData.hasOwnProperty("chartData")){var p=appConstants.publicjsonData.chartData;
var a=p.length;itemsArray=new Array();if(a==0){Ext.getCmp("bookletTool").setDisabled(true);Ext.getCmp("saveTool").setDisabled(true);Ext.getCmp("printTool").setDisabled(true);Ext.getCmp("mailTool").setDisabled(true);}if(a!=null){for(var w=0;a>w;w++){var q=300;var t="chartContainer"+w;var D="fusionPanel"+w;
var j=parseInt(p[w].chartHeight);var o=p[w].drillDownQstring;var c=p[w].chartTitle;o+="&reportName=ErVDIAssessmentDrillDown&drillDown=yes";if(q<j){q=j;}var C=p[w];var b='<table align="center" width="100%" cellspacing="0" cellpadding="0px" border="0px"><tr>';b+='<td align="center">';b+='<table  cellpadding="0" cellspacing="0" class="border eg_whitebg" style="table-layout:fixed" width="90%">';
b+="<tr>";b+="<td>";b+='<div style="text-align:center;margin-left:2px;margin-right:4px;cursor:pointer;cursor:hand;z-index:1000;height:'+q+'" id="'+t+'"  ></div>';b+="</td>";b=b+"</tr>";b=b+"</table>";b=b+"</td>";b=b+"</tr>";b=b+"</table>";o+="&calculatedHeight="+q;reportLayout="column";var A={xtype:"panel",title:c,html:b,ui:"newGraphPanel",margin:"0 10 10 0",frame:false,border:true,id:D,width:550,height:400,scroll:true,autoScroll:true,chartObj:C,containerId:t,padding:0,bodyPadding:"0 0 0 0",dataArray:o,listeners:{afterrender:function(){if(appConstants.chartType=="highchart"){var F=this.chartObj.xAxisLabel;
var E=F.length*25;if(E<320){E=320;}var i={};i=jQuery.extend(true,{},getHighChartsBarInstance(this.containerId,E,400),i);i.setData(this.chartObj,"<%=currentDateFormat%>","");i.drawChart();}}}};itemsArray.push(A);}s.removeAll();s.add(itemsArray);if(a==1){reportLayout="vbox";}s.doLayout();for(var w=0;p.length>w;
w++){break;var C=p[w];var m="myChartId"+w;var t="chartContainer"+w;var n=Ext.getCmp(t);var D="fusionPanel"+w;var y=Ext.getCmp(D);var h=C.XMLData;if(h!="-"){if(appConstants.chartType=="fusionchart"){if(FusionCharts(m)){FusionCharts(m).dispose();}var e=new FusionCharts(C.swfpath,m,"98%","300","0","1");
e.setXMLData(h);e.setTransparent(true);e.render(t);}else{if(appConstants.chartType=="highchart"){var g=C.xAxisLabel;var u=g.length*25;if(u<320){u=320;}var z={};z=jQuery.extend(true,{},getHighChartsBarInstance(t,u,400),z);z.setData(C,"<%=currentDateFormat%>","");z.drawChart();}}}else{Ext.get(t).update('<table width="100%" height="100%"><tr><td align="center" valign="middle"><img src="/final/images/'+strSkin+'/nomeasures_custom.png" /></td></tr></table>');
}}if(a==null||a==1||a==0){s.hide();this.getNomeasurepanel().doLayout();this.getNomeasurepanel().show();}else{Ext.getCmp("selectionDetails").setSelectionDetailsData(f.selectionDetails);}}}appConstants.initLdgMask.hide();}},validateSettings:function(){var j=true;var f=appConstants.publicjsonData["hiddenFields"]["getMaxDaysInMonth"];
var g=appConstants.publicjsonData["hiddenFields"]["userTimeline"];var d=Ext.getCmp("reportGeneration").getValue();var b=Ext.getCmp("timefrom").getValue();var n=Ext.getCmp("minfrom").getValue();var i=Ext.getCmp("timeto").getValue();var c=Ext.getCmp("minto").getValue();var h=Ext.getCmp("er_timeline").getValue();
var l=Ext.getCmp("er_stdate").getValue();var a=Ext.getCmp("er_enddate").getValue();var e=Ext.getCmp("er_sthr").getValue();var k=Ext.getCmp("er_endhr").getValue();l.setHours(e);a.setHours(k);if(!checkTimePeriod(b,n,i,c)){j=false;}if(d!=null&&d=="background"){var m=Ext.getCmp("bgReportName").getValue();
if(!validateTextBoxWithSpecialChars(m,"Attachment",true)){j=false;}}return j;},loadAnalysisByCombo:function(b){var c=Ext.getCmp("er_group");var d=b.anaylsisByArray;var a=b.er_group;c.getStore().loadRawData(d);c.setValue(a);},loadIncludeSubZonesCombo:function(b){var c=Ext.getCmp("er_componentType");var d=b.componentTypeArray;
var a=b.er_componentType;c.getStore().clearFilter(true);c.getStore().loadRawData(d);c.setValue(d[0].valueField);},loadGroupCombo:function(b){var c=Ext.getCmp("group_name");var d=b.GroupArray;var a=b.group_name;c.getStore().clearFilter(true);c.getStore().loadRawData(d);c.setValue(a);},loadComponentTypeCombo:function(b){var c=Ext.getCmp("er_componentType");
var d=b.componentTypeArray;var a=b.er_componentType;c.getStore().clearFilter(true);c.getStore().loadRawData(d);c.setValue(d[0].valueField);c=Ext.getCmp("group_name");d=b.GroupArray;a=b.group_name;c.getStore().clearFilter(true);c.getStore().loadRawData(d);c.setValue(a);},loadComponentCombo:function(b){var c=Ext.getCmp("er_component");
var d=b.componentArray;var a=b.er_component;appConstants.rawDataForComponents=d;c.getStore().loadRawData(d);c.setValue(d[0].valueField);c=Ext.getCmp("er_componentType");d=b.componentTypeArray;a=b.er_componentType;c.getStore().clearFilter(true);c.getStore().loadRawData(d);if(!Ext.isEmpty(a)){c.setValue(a);
}else{c.setValue(d[0].valueField);}},showConfirmResult:function(c){if(c=="yes"){var b=Ext.getCmp("submit");b.setDisabled(false);if(isSettingsEnabled){Ext.get("configMod").animate({duration:500,to:{y:-500}});}this.formSubmit();}else{this.getReporterSettings().down("button").fireHandler();var a=Ext.getCmp("reportGeneration");
var d=Ext.getCmp("bgReportName");a.setValue("background");d.setValue("");d.show();validateTextBoxWithSpecialChars(d.getValue(),"Attachment",true);d.focus(false,1000);Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();return false;}},loadField:function(i){var f="false";if(i.hasOwnProperty("isSubmit")){var f=i.isSubmit;
}var q=appConstants.publicjsonData["hiddenFields"];var u=q["fromScheduleModify"];var d=q["fromFavoriteModify"];if((u!=null&&u=="Yes")||(d!=null&&d=="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 g=i.screenLabels;appConstants.globalScreenLabels=i.screenLabels;var w=i.analysisByArray;var a=i.er_group;var r=Ext.getCmp("er_group");r.setFieldLabel(g["reporter.common.Analysis By"]);r.getStore().loadRawData(w);if(!Ext.isEmpty(w)){if(!Ext.isEmpty(a)){r.setValue(a);}else{r.setValue(w[0].valueField);
}}var m=Ext.getCmp("group_name");var x=Ext.getCmp("er_group");var A=i.analysisByArray;if(a=="Zone"){var w=i.GroupArray;m.setFieldLabel(g["reporter.common.Zone"]);m.getStore().clearFilter(true);m.getStore().loadRawData(w);m.setValue(i.group_name);r=Ext.getCmp("includeSubZone");subrawData=i.includeSubZoneArray;
r.setFieldLabel(g["reporter.thin.Include subzones"]);r.getStore().loadRawData(subrawData);r.setValue(i.includeSubZone);Ext.getCmp("includeSubZone").show();Ext.getCmp("group_name").show();}else{if(a=="Segment"){var e=i.GroupArray;m.setFieldLabel(g["reporter.common.Segment"]);m.getStore().clearFilter(true);
m.getStore().loadRawData(e);if(i.group_name!=null){m.setValue(i.group_name);}else{m.setValue(e[0].valueField);}x.getStore().loadRawData(A);x.setValue(a);Ext.getCmp("includeSubZone").hide();m.show();}else{if(a=="Service"){var e=i.GroupArray;m.setFieldLabel(g["reporter.common.Service"]);m.getStore().clearFilter(true);
m.getStore().loadRawData(e);if(i.group_name!=null){m.setValue(i.group_name);}else{m.setValue(e[0].valueField);}x.getStore().loadRawData(A);x.setValue(a);Ext.getCmp("includeSubZone").hide();m.show();}}}w=i.componentTypeArray;var l=i.er_componentType;r=Ext.getCmp("er_componentType");r.setFieldLabel(g["reporter.common.Component Type"]);
r.getStore().clearFilter(true);r.getStore().loadRawData(w);if(!Ext.isEmpty(w)){if(!Ext.isEmpty(l)){r.setValue(l);}else{r.setValue(w[0].valueField);}}w=i.componentArray;var b=i.er_component;r=Ext.getCmp("er_component");Ext.getCmp("componentLabel").setText(g["reporter.common.Component"]);appConstants.rawDataForComponents=w;
r.getStore().loadRawData(w);if(!Ext.isEmpty(w)){if(!Ext.isEmpty(b)){r.setValue(b);}else{r.setValue(w[0].valueField);}}w=i.showTimeArray;var C=i.sh_timeinuse;r=Ext.getCmp("showTimeArray");r.setFieldLabel(g["reporter.common.Weighted Average"]);r.getStore().loadRawData(w);if(!Ext.isEmpty(w)){if(!Ext.isEmpty(C)){r.setValue(C);
}else{r.setValue(w[0].valueField);}}w=i.timelineCombo;var k=i.selectedTimeline;r=Ext.getCmp("er_timeline");r.setFieldLabel(g["reporter.common.Timeline"]);r.getStore().loadRawData(w);if(!Ext.isEmpty(w)){if(!Ext.isEmpty(k)){r.setValue(k);}else{r.setValue(w[0].valueField);}}var y=i.timefrom;var t=i.minfrom;
var o=i.timeto;var n=i.minto;var v=i.startHour;var p=i.endHour;var h=i.startDate;var c=i.endDate;var j=Ext.getCmp("er_stdate");j.setValue(i.startDateForDisplay);j.dataArray=h;var B=Ext.getCmp("er_sthr");B.setValue(i.startHourForDisplay);B.dataArray=v;var s=Ext.getCmp("er_enddate");s.setValue(i.endDateForDisplay);
s.dataArray=c;var z=Ext.getCmp("er_endhr");z.setValue(i.endHourForDisplay);z.dataArray=p;stmin=i.startMinForDisplay;enmin=i.endMinForDisplay;mgr_stmin=i.startmin;mgr_enmin=i.endmin;updatingAppSettings();}});