Ext.define("CitrixOverviewApp.controller.CitrixOverviewController",{extend:"Ext.app.Controller",views:["Main"],refs:[{selector:"main",ref:"main"},{selector:"newUtilities",ref:"newUtilities"},{selector:"resultpanel",ref:"resultpanel"},{selector:"nomeasurepanel",ref:"nomeasurepanel"},{selector:"customtrigger",ref:"customtrigger"},{selector:"CitrixOverviewSettings",ref:"citrixOverviewSettings"},{selector:"CitrixOptionSettings",ref:"citrixOptionSettings"},{selector:"CitrixDefaultSettings",ref:"citrixDefaultSettings"}],init:function(){this.control({"newUtilities":{"afterrender":this.loadTools},"resultpanel":{"afterrender":this.hi},"main":{"afterrender":this.afterMainRender,},"citrixOverviewSettings":{"afterrender":this.closeSetting},'citrixDefaultSettings combo[id="er_excwe"]':{},'citrixOptionSettings combo[id="er_option"]':{"select":this.onSelectAnalysisBy},'citrixOptionSettings combo[id="er_site"]':{"select":this.onSelectSiteBy},'citrixDefaultSettings combo[name="reportGeneration"]':{"select":this.reportGenChange},'citrixDefaultSettings button[id="submitViaSetting"]':{"click":this.closeSettingAndSubmit},'citrixDefaultSettings checkbox[id="experAllWidget"]':{"change":this.onChangeExperAllWidget},'citrixOptionSettings button[id="expandSelector"]':{"click":this.expandMe},'citrixOptionSettings button[id="expandXenAppSelector"]':{"click":this.expandXenAppSelector},'citrixOptionSettings trigger[id="compGroupSearch"]':{"change":this.compMultiselect},'citrixOptionSettings trigger[id="xenAppCompSearch"]':{"change":this.xenAppCompMultiselect},"newUtilities > #printTool > button":{"click":this.printReport},"newUtilities > #mailTool > button":{"click":this.sendMail},"newUtilities > #saveTool > button":{"click":this.saveReportAsPDF},"newUtilities > #favoriteTool > button":{"click":this.saveFavorite},"newUtilities > #scheduleTool > button":{"click":this.saveSchedule},'citrixOverviewSettings button[name="save"]':{"click":this.modifyScheduleFavorite},});
},expandMe:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}appConstants.erUtils.expandMultiComboButton(Ext.getCmp("er_siteDirectComponent"),Ext.getCmp("compLbl").text,a);},expandXenAppSelector:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");
}appConstants.erUtils.expandMultiComboButton(Ext.getCmp("er_XenAppComponents"),Ext.getCmp("compXenAppLbl").text,a);},compMultiselect:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}a.toggleTriggger();appConstants.erUtils.filterComboStore(a,Ext.getCmp("er_siteDirectComponent"),appConstants.defaultLoadData["siteDirectComponent"]);
},xenAppCompMultiselect:function(a){if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}a.toggleTriggger();appConstants.erUtils.filterComboStore(a,Ext.getCmp("er_XenAppComponents"),appConstants.defaultLoadData["siteDirectComponent"]);},onChangeExperAllWidget:function(c,b,a){appConstants.experAllWidget=b;
},validateAndCloseSettings:function(){if(this.validateSettings()){Ext.get("configMod").animate({duration:500,to:{y:-500}});return true;}},closeSettingAndSubmit:function(){if(this.validateAndCloseSettings()){this.submitReport(appConstants.buttonId);}},hi:function(){Ext.Ajax.disableCaching=false;Ext.Ajax.on("beforerequest",function(c,a,b){});
Ext.Ajax.on("requestcomplete",function(c,a,b){requestCount++;if(totalPanelCount>0){if(requestCount==totalPanelCount){Ext.getCmp("bookletTool").setDisabled(false);Ext.getCmp("saveTool").setDisabled(false);Ext.getCmp("printTool").setDisabled(false);Ext.getCmp("mailTool").setDisabled(false);}}});},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();Ext.getCmp("submit").hide();}else{Ext.getCmp("bgReportName").hide();Ext.getCmp("submitViaSetting").hide();
Ext.getCmp("moreOptionCloseId").hide();Ext.getCmp("submit").show();}},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);},hideTools: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);},afterMainRender:function(){if(!isSettingsEnabled){this.showConfigDropdown();}var a=appConstants.defaultLoadData.reportTitle;this.getMain().setTitle(a);
var f=appConstants.defaultLoadData;this.setErOptionData(f);var b=Ext.getCmp("er_option");var h=Ext.getCmp("er_site");var i=Ext.getCmp("er_subZone");if(b!=undefined&&b.getValue()!=undefined&&b.getValue()!="-1"&&b.getValue()!="Component"){this.setSiteOptionData(f);h.show();}else{h.hide();}if(f["isSiteOrDirectory"]!=undefined&&f["isSiteOrDirectory"]=="yes"){Ext.getCmp("siteDirectoryComponentsId").show();
this.setSiteDirectoryComponentData(f);}else{Ext.getCmp("siteDirectoryComponentsId").hide();}this.setXenAppComponentData(f);if(f["isLicenseTabEnable"]!=undefined&&f["isLicenseTabEnable"]=="yes"){Ext.getCmp("citrixLicense").show();}else{Ext.getCmp("citrixLicense").hide();}var c=Ext.getCmp("er_timeline");
c.getStore().loadRawData(f["timelineCombo"]);c.setValue(f["selectedTimeline"]);var d=Ext.getCmp("er_stdate");d.setValue(f.startDateForDisplay);d.dataArray=f.startDate;var m=Ext.getCmp("er_sthr");m.setValue(f.startHourForDisplay);m.dataArray=f.startHour;var j=Ext.getCmp("er_enddate");j.setValue(f.endDateForDisplay);
j.dataArray=f.endDate;var g=Ext.getCmp("er_endhr");g.setValue(f.endHourForDisplay);g.dataArray=f.endHour;mgr_stmin=appConstants.defaultLoadData.startmin;mgr_enmin=appConstants.defaultLoadData.endmin;var e=Ext.getCmp("er_logon");e.setValue(f.logonLimit);var k=Ext.getCmp("dispUserDomain");k.setValue(f.dispUserDomain);
var l=Ext.getCmp("er_launch");l.setValue(f.launchLimit);if(f.dispUserDomain!=undefined&&f.dispUserDomain=="true"){Ext.getCmp("dispUserDomain").setValue(true);}else{Ext.getCmp("dispUserDomain").setValue(false);}Ext.getCmp("citrixOptionSettings").add({xtype:"hidden",id:"ID",name:"ID",value:f["ID"]});},onSelectAnalysisBy:function(c){var d=Ext.getCmp("er_option").getValue();
var b="analysisBy="+d+"&buttonId="+appConstants.buttonId;var a=this;appConstants.LoadingMask.show();Ext.Ajax.request({url:"/final/reporter/ErCtxOverviewJSON.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();}else{Ext.getCmp("er_site").hide();}if(f["isSiteOrDirectory"]!=undefined&&f["isSiteOrDirectory"]=="yes"){Ext.getCmp("siteDirectoryComponentsId").show();a.setSiteDirectoryComponentData(f);}else{Ext.getCmp("siteDirectoryComponentsId").hide();}a.setXenAppComponentData(f);if(f["isLicenseTabEnable"]!=undefined&&f["isLicenseTabEnable"]=="yes"){Ext.getCmp("citrixLicense").show();
}else{Ext.getCmp("citrixLicense").hide();}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();b+="&supportedComponents="+appConstants.supportedComponents+"&buttonId="+appConstants.buttonId;
var a=this;appConstants.LoadingMask.show();Ext.Ajax.request({url:"/final/reporter/ErCtxOverviewJSON.jsp",scope:this,method:"POST",params:b,success:function(e){var g=e.responseText;var f=Ext.decode(g);appConstants.defaultLoadData=f;if(f["isSiteOrDirectory"]!=undefined&&f["isSiteOrDirectory"]=="yes"){Ext.getCmp("siteDirectoryComponentsId").show();
a.setSiteDirectoryComponentData(f);}else{Ext.getCmp("siteDirectoryComponentsId").hide();}a.setXenAppComponentData(f);if(f["isLicenseTabEnable"]!=undefined&&f["isLicenseTabEnable"]=="yes"){Ext.getCmp("citrixLicense").show();}else{Ext.getCmp("citrixLicense").hide();}appConstants.LoadingMask.hide();}});
},setSiteDirectoryComponentData:function(a){var b=Ext.getCmp("er_siteDirectComponent");b.getStore().clearFilter(true);b.getStore().loadRawData(a["siteDirectComponent"]);if(!Ext.isEmpty(a.selectedField["selectedSiteOrDirectory"])&&a.selectedField["selectedSiteOrDirectory"]!=undefined){b.setValue(a.selectedField["selectedSiteOrDirectory"]);
}else{b.setValue(a["siteDirectComponent"][0].valueField);}},setXenAppComponentData:function(a){var b=Ext.getCmp("er_XenAppComponents");b.getStore().clearFilter(true);b.getStore().loadRawData(a["xenAppComponents"]);if(!Ext.isEmpty(a.selectedField["selectdXenAppArry"])&&a.selectedField["selectdXenAppArry"]!=undefined){b.setValue(a.selectedField["selectdXenAppArry"]);
}else{b.setValue(a["xenAppComponents"][0].valueField);}},setSiteOptionData:function(b){var c=Ext.getCmp("er_site");var d=Ext.getCmp("er_subZone");var a=Ext.getCmp("er_option");if(b.subZoneCombo!=undefined&&a.getValue()!=undefined&&a.getValue()!="-1"){c.setFieldLabel(a.getRawValue());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"]);d.setFieldLabel(b.selectedField["subZoneLabel"]);c.show();}else{c.hide();}},setErOptionData:function(b){var a=Ext.getCmp("er_option");
var d=b["analysisBy"];a.getStore().loadRawData(d);a.setFieldLabel(b.selectedField["analysisByLabel"]);if(b.selectedField["selectedAnalysisBy"]!=undefined){a.setValue(b.selectedField["selectedAnalysisBy"]);}else{if(d.length>0){var c=d[0];a.setValue(c.valueField);}}},printReport:function(){if(appConstants.experAllWidget){this.exportDataAlert();
return"";}var b="";if(appConstants.columnRowCountPrint!=undefined&&appConstants.columnRowCountPrint!="two"){b="CitrixOverview";}var a="/final/reporter/ErCtxOverviewPrint.jsp?&pdfPrint=yes&inidate="+appConstants.defaultLoadData.inidate+"&buttonId="+appConstants.buttonId+"&columnRowCountPrint="+appConstants.columnRowCountPrint;
parent.printWindowFn(a);},sendMail:function(){if(appConstants.experAllWidget){this.exportDataAlert();return"";}Ext.widget("sendmail").show();},saveSchedule:function(b){if(appConstants.experAllWidget){this.exportDataAlert();return"";}var c=this.getQueryString();var a="/final/reporter/ErSaveSchedule.jsp?er_rtype=CitrixOverview&er_trgttype=CitrixOverview&er_ViewName=ErCtxOverview.jsp&er_RmDispName=CitrixOverview&"+c+"&com.eg.CSRF_NONCE="+csrfToken;
if(Ext.getCmp("er_timeline").getValue()=="Any"){this.showMessage("Chosen timeline not allowed");return;}parent.scheduleWindowFn(a);},saveReportAsPDF:function(){if(appConstants.experAllWidget){this.exportDataAlert();return"";}var b="";if(appConstants.columnRowCountPrint!=undefined&&appConstants.columnRowCountPrint!="two"){b="CitrixOverview";
}var a="../reporter/ErHtmlToSavePdf.jsp?buttonId="+appConstants.buttonId+"&reporttype="+b+"&columnRowCountPrint="+appConstants.columnRowCountPrint;if(Ext.isEmpty(appConstants.erUtils)){appConstants.erUtils=Ext.widget("erutils");}appConstants.erUtils.savePDF(a);},saveFavorite:function(){if(appConstants.experAllWidget){this.exportDataAlert();
return"";}var b=this.getQueryString();var a="/final/reporter/ErSaveFavorite.jsp?er_trgttype=CitrixOverview&er_rtype=CitrixOverview&er_ViewName=ErCtxOverview.jsp&er_RmDispName=CitrixOverview&"+b+"&com.eg.CSRF_NONCE="+csrfToken;if(Ext.getCmp("er_timeline").getValue()=="Any"){this.showMessage("Chosen timeline not allowed");
return;}parent.favouriteWindowFn(a);},modifyScheduleFavorite:function(){var d=this.getQueryString();var c="&er_trgttype=CitrixOverview&er_rtype=CitrixOverview&er_ViewName=ErCtxOverview.jsp&er_RmDispName=CitrixOverview&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=CitrixOverview";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"});},bookletQuery:function(c){if(appConstants.experAllWidget){this.exportDataAlert();return"";}var b="";if(appConstants.columnRowCountPrint!=undefined&&appConstants.columnRowCountPrint!="two"){b="CitrixOverview";
}var a="buttonId="+appConstants.buttonId+"&reporttype="+b+"&columnRowCountPrint="+appConstants.columnRowCountPrint;return a;},bookletScheduleQuery:function(b){if(appConstants.experAllWidget){this.exportDataAlert();return"";}var a=this.getQueryString();a+="&er_rtype=CitrixOverview&er_trgttype=&er_ViewName=ErCtxOverview.jsp&er_RmDispName=CitrixOverview";
return a;},bookletPreview:function(){this.printReport();},submitReport:function(j){this.hideTools();requestCount=0;appConstants.buttonId=j;var g=Ext.getCmp("resultPanel");if(!isSettingsEnabled){this.showConfigDropdown();}var e="";if(appConstants.isSubmit!=null&&appConstants.isSubmit=="true"){e=this.getQueryString();
}else{e=this.getQueryString();if(e==false){return;}}var h=this;var i="foreground";if(isSettingsEnabled){i=Ext.getCmp("reportGeneration").getValue();}if(i=="foreground"){var f=this;var d=appConstants.defaultLoadData.limitforbg;var k=appConstants.defaultLoadData.maxDays;var l=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();l.setHours(b);a.setHours(c);if(!checkTimeLineForBgLimit(d,k,l,a)){Ext.Msg.confirm("Confirm",appConstants.forGrdReportConfirmMsg,function(n){if(n==="no"){Ext.getCmp("reportGeneration").setValue("background");
var m=Ext.getCmp("bgReportName");m.show();m.focus();Ext.getCmp("submitViaSetting").show();Ext.getCmp("moreOptionCloseId").hide();return false;}else{if(n==="yes"){f.submitReportByAjaxCall(e,j);}}},this);}else{f.submitReportByAjaxCall(e,j);}Ext.getCmp("backGroundPanel").hide();}else{e+="&servletName=ErCitrixOverviewReportC&er_rtype=CitrixOverview&er_ViewName=ErCtxOverview.jsp&er_RmDispName=CitrixOverview";
e+="&er_trgttype=CitrixOverview&forwardto=CitrixOverview&er_bgreportfrom=CitrixOverview&bgenabled=Yes&savereport=save&buttonId="+appConstants.buttonId+"&experAllWidget="+appConstants.experAllWidget;if(i=="background"){bgUrl="/final/servlet/com.eg.ErStartBackGroundReportC";}else{if(i=="background-csv"){bgUrl="../servlet/com.eg.ErStartBackGroundReportC?SaveFormat=CSV";
}}appConstants.LoadingMask.show();Ext.Ajax.request({url:bgUrl,scope:this,method:"POST",params:e,success:function(n){var o=Ext.getCmp("backGroundPanel");appConstants.LoadingMask.hide();var q=n.responseText;var p=Ext.decode(q);var r=p.reportVal;var m=r.status;var s="";if(m=="success"){s='<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">'+r.bgstr1+".</br>"+'<a class="backgroundMsgLink" href='+r.queryString+">"+r.bgstr2+"</a></div></td></tr></table></td></tr></table>";
}else{if(m=="duplicate"){s='<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">'+r.bgstr1+".</br>"+'<a class="backgroundMsgLink" href='+r.queryString+">"+r.bgstr2+"</a></div></td></tr></table></td></tr></table>";
}else{s='<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">'+r.bgstr1+"</div></td></tr></table></td></tr></table>";
}}o.update(s);o.show();}});}},getQueryString:function(){var r=true;var v=Ext.getCmp("er_option").getValue();var u="&analysisBy="+v;if(v!="Component"){u+="&er_site="+Ext.getCmp("er_site").getValue();u+="&er_subZone="+Ext.getCmp("er_subZone").getValue();}else{u+="&er_site=null";u+="&er_subZone=null";}var i=Ext.getCmp("er_timeline").getValue();
var f=Ext.getCmp("er_stdate").getValue();var w=Ext.getCmp("er_sthr").getValue();var o=Ext.getCmp("er_enddate").getValue();var d=Ext.getCmp("er_endhr").getValue();f.setHours(w);o.setHours(d);if(!checkDateTime(f,o)){return false;}f=Ext.getCmp("er_stdate").dataArray;w=Ext.getCmp("er_sthr").dataArray;o=Ext.getCmp("er_enddate").dataArray;
d=Ext.getCmp("er_endhr").dataArray;var q="&er_timeline="+i+"&startdate="+f+"&enddate="+o+"&starthr="+w+"&endhr="+d+"&startmin="+mgr_stmin+"&endmin="+mgr_enmin+"&inidate="+appConstants.defaultLoadData.inidate;if(Ext.getCmp("er_siteDirectComponent")!=undefined){var k=Ext.getCmp("er_siteDirectComponent").getValue();
if(k!=undefined){if(k[0]=="-1"){this.showMessage("Director Components is Not Applicable");return false;}if(k.length>1&&(k.indexOf("All")>-1||k.indexOf("all")>-1)){this.showMessage("All and Individual Components are not allowed simultaneously!");return false;}for(var t=0;t<k.length;t++){u+="&er_siteDirectComponent="+k[t];
}}}if(Ext.getCmp("er_XenAppComponents")!=undefined){var x=Ext.getCmp("er_XenAppComponents").getValue();if(x!=undefined){if(x[0]=="-1"){this.showMessage("Xen Components is Not Applicable");return false;}if(x.length>1&&(x.indexOf("All")>-1||x.indexOf("all")>-1)){this.showMessage("All and Individual Components are not allowed simultaneously!");
return false;}for(var t=0;t<x.length;t++){u+="&er_XenAppComponents="+x[t];}}}var h=Ext.getCmp("er_logon").getValue();var g=Ext.getCmp("er_launch").getValue();q+="&er_logon="+h+"&er_launch="+g;q+="&dispUserDomain="+Ext.getCmp("dispUserDomain").getValue();if(Ext.getCmp("er_status")!=undefined){var a=Ext.getCmp("er_status").getValue();
q+="&er_status="+a;}else{q+="&er_status="+appConstants.er_status;}if(Ext.getCmp("er_eventTest")!=undefined){var l=Ext.getCmp("er_eventTest").getValue();q+="&er_eventTest="+l;}else{q+="&er_eventTest="+appConstants.er_eventTest;}var n="";if(isSettingsEnabled){var m=Ext.getCmp("timefrom").getValue();var e=Ext.getCmp("minfrom").getValue();
var j=Ext.getCmp("timeto").getValue();var z=Ext.getCmp("minto").getValue();var b=Ext.getCmp("er_excwe").getValue();var y=Ext.getCmp("reportGeneration").getValue();var p="";if(!checkTimePeriod(m,e,j,z)){return false;}if(y!="foreground"){p=Ext.getCmp("bgReportName").getValue();if(!validateTextBoxWithSpecialChars(p,"Attachment",true)){return false;
}}n="&hourFromUI="+m+"&minFromUI="+e+"&hourToUI="+j+"&minToUI="+z+"&exclweek="+b+"&rGenType="+y+"&bg_reportname="+p;n+="&er_reportgenration="+y+"&bg_reportname="+p;}var s="&userID="+appConstants.defaultLoadData.loginid;u+=q;u+=n;u+=s;u+="&buttonId="+appConstants.buttonId;return u;},submitReportByAjaxCall:function(e,c){requestCount=0;
e+="&method=getButtonInfo&fromMenu="+appConstants.fromMenu;var d=this;var a="/final/reporter/ErCtxOverviewJSON.jsp";var f=Ext.Ajax.requests;for(id in f){if(f.hasOwnProperty(id)){Ext.Ajax.abort(f[id]);}}var b=new Array();if(c=="All"){b.push("citrixUserExperience");b.push("citrixSessions");b.push("citrixApplications");
b.push("citrixEvents");b.push("citrixServer");b.push("citrixLicense");}else{b.push(c);}requestId=Ext.Ajax.request({url:a,scope:this,method:"POST",params:e,success:function(i){requestCount=0;var l=Ext.getCmp("resultPanel");l.removeAll();var j=i.responseText;var k=Ext.decode(j);totalPanelCount=k.totalPanel;
l.show();this.getMain().setTitle(k.reportTitle);if(k["isSiteOrDirectory"]!=undefined&&k["isSiteOrDirectory"]=="yes"){appConstants.siteOrDirectoryLabel=k.selectedField["siteOrDirectoryLabel"];Ext.getCmp("compLbl").setText(appConstants.siteOrDirectoryLabel);Ext.getCmp("expandSelector").setTooltip(appConstants.siteOrDirectoryLabel);
Ext.getCmp("siteDirectoryComponentsId").show();this.setSiteDirectoryComponentData(k);}else{Ext.getCmp("siteDirectoryComponentsId").hide();}this.setXenAppComponentData(k);for(var h in b){var g=b[h];switch(g){case"citrixUserExperience":d.createCitrixUserExperience(k,l,g);break;case"citrixSessions":d.createCitrixUserExperience(k,l,g);
break;case"citrixApplications":d.createCitrixUserExperience(k,l,g);break;case"citrixServer":d.createCitrixUserExperience(k,l,g);break;case"citrixEvents":d.createCitrixEvents(k,l,g);break;case"citrixLicense":d.createCitrixLicense(k,l,g);default:break;}}}});},createCitrixLicense:function(o,c,j){var f=o.buttonInfo;
var b=f[""+j+""];var m=this;var a=new Array();for(var r in b){var h=b[r];if(h.length>0){for(var e=0;e<h.length;e++){var n=h[e];var g=n["type"];var q=n["title"];var p=n["panelName"];var k=n["panelHeight"];k=parseFloat(k);var d=m.getQueryString();d+="&buttonId="+j+"&er_view=submit";var l=d;a.push({xtype:"panel",ui:"multiGraphPanel",title:q,columnWidth:1,id:j+p,name:p,types:g,height:k,autoScroll:true,scroll:false,layout:"column",listeners:{boxready:function(t){var s=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});
s.show();var i="/final/servlet/com.eg.ErCitrixOverviewReportC";d=l+"&panelName="+this.name+"&templateType="+this.types;Ext.Ajax.request({url:i,params:d,scope:this,success:function(u){s.hide();var v=u.responseText;var w=Ext.decode(v);m.loadChart(w,j,this.id,this.types,this.name,k-25,"");},failure:function(u){}});
}}});}}else{a.push({html:'<div><table width="100%" height="100%"><tr><td align="center" valign="middle"><img src="/final/images/Light/nomeasures_custom.png" /></td></tr></table></div>'});}}c.add({xtype:"panel",padding:0,layout:"fit",border:true,scroll:true,bodyPadding:"10 10 5 10",autoScroll:true,defaults:{columnWidth:1,},items:a,});
},createCitrixEvents:function(d,q,j){var z=this;var u=new Array();var x=z.getQueryString();x+="&buttonId="+j+"&er_view=submit";var e=x;var o=d.buttonInfo;var m=o[""+j+""];for(var A in m){var t=m[A];if(t.length>0){var l=new Array();for(var s=0;s<t.length;s++){var v=t[s];var B=v["title"];var y=v["panelName"];
var b=v["panelHeight"];var k=v["panelDetails"];var h=new Array();if(s==0){for(var g in k){var w=k[g];var f=w["panelName"];var a=w["panelHeight"];var c=w["title"];var n=w["type"];if(g==1){h.push({xtype:"container",flex:0.4,layout:{type:"vbox",align:"stretch",pack:"center",},id:j+f,name:f,title:c,height:a,type:n,items:[],listeners:{boxready:function(D){var C=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});
C.show();var i="/final/servlet/com.eg.ErCitrixOverviewReportC";x=e+"&panelName="+this.name+"&templateType="+this.type;Ext.Ajax.request({url:i,params:x,scope:this,success:function(E){C.hide();var F=E.responseText;var G=Ext.decode(F);z.loadChart(G,j,this.id,this.type,this.name,this.height,"");}});}},});
}else{if(g==0){h.push({xtype:"container",flex:0.3,layout:{type:"vbox",align:"stretch",},items:[],id:j+f+g,height:a,name:f,title:c,type:n,listeners:{boxready:function(D){var C=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});C.show();var i="/final/servlet/com.eg.ErCitrixOverviewReportC";x=e+"&panelName="+this.name+"&templateType="+this.type;
Ext.Ajax.request({url:i,params:x,scope:this,success:function(E){C.hide();var F=E.responseText;var G=Ext.decode(F);z.loadChart(G,j,this.id,"template3Pie",this.name,this.height,this.title);},failure:function(E){}});}}});}else{if(g==2||g==3){h.push({xtype:"container",flex:0.3,layout:"fit",items:[],layout:{type:"vbox",align:"stretch",},id:j+f+g,name:f,title:c,type:n,height:a,listeners:{boxready:function(D){var C=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});
C.show();var i="/final/servlet/com.eg.ErCitrixOverviewReportC";x=e+"&panelName="+this.name+"&templateType="+this.type;Ext.Ajax.request({url:i,params:x,scope:this,success:function(E){C.hide();var F=E.responseText;var G=Ext.decode(F);z.loadChart(G,j,this.id,"template2Graph",this.name,this.height,this.title);
},failure:function(E){}});}}});}}}}u.push({title:B,id:j+y,name:y,height:b,layout:{type:"hbox",align:"stretch",pack:"start"},defaults:{padding:"0 10 0 0",cls:"widgetcon",margin:"0 10 0 10",},items:h});}if(s==1){var p="newLineBottomRight";for(var g in k){var w=k[g];var f=w["panelName"];var a=w["panelHeight"];
var c=w["title"];var n=w["type"];if(g==2){p="newLineBottom";}else{if(g==3||g==4){p="newLineRight";}else{if(g==5){p="";}else{p="newLineBottomRight";}}}h.push({xtype:"panel",title:c,cls:p,items:[{xtype:"container",border:true,height:180,id:j+f,name:f,type:n,margin:"0 0 0 -7",listeners:{}}]});}var r=[];
r.push({xtype:"scrollcombo",width:100,cls:"dropdown",editable:false,margin:"0 4px 0 0",name:"er_eventTest",id:"er_eventTest",store:new Ext.data.Store({fields:["displayField","valueField"],data:[{"displayField":"Application","valueField":"AppEvtLogTest_DDD"},{"displayField":"System","valueField":"SystemEvtLogTest_DDD"}]}),displayField:"displayField",valueField:"valueField",queryMode:"local",listeners:{boxready:function(C){var i=appConstants.defaultLoadData;
Ext.getCmp("er_eventTest").setValue(appConstants.er_eventTest);},change:function(G,H,L,J){var C=new Array();C.push("citrixEvents_panel4");C.push("citrixEvents_panel5");C.push("citrixEvents_panel6");C.push("citrixEvents_panel7");C.push("citrixEvents_panel8");C.push("citrixEvents_panel9");for(var G=0;G<C.length;
G++){var K=C[G];var E="citrixEvents"+K;var F=Ext.getCmp(E);F.removeAll();var D=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});F.setLoading(D,F.body);appConstants.er_eventTest=H;var M=z.getQueryString();M+="&buttonId="+j+"&er_view=submit";var I=M;var i="/final/servlet/com.eg.ErCitrixOverviewReportC";
M=I+"&panelName="+K+"&templateType=template2Graph";Ext.Ajax.request({url:i,params:M,scope:this,success:function(P){var T=P.responseText;var U=Ext.decode(T);try{var O="";for(var W in U){if(U.hasOwnProperty(W)){var N=U[W];if(W.indexOf(j)!=-1){O=N.otherInfo;}}}var V=O["panelName"];var R=O["templateType"];
var Y=O["height"];var Q=j+V;var X=Ext.getCmp(Q);X.setLoading(false);z.loadChart(U,j,Q,"template2Graph",V,Y,"");}catch(S){}},failure:function(N){}});}},}});u.push({title:'<span style="margin-left:10px">'+B+"</span>",id:j+y,name:y,height:b,header:{titlePosition:1,items:r},layout:"column",bodyPadding:"0 0 10 10",defaults:{ui:"newPlainPanel",columnWidth:0.33,},items:h});
}}}else{u.push({html:'<div><table width="100%" height="100%"><tr><td align="center" valign="middle"><img src="/final/images/Light/nomeasures_custom.png" /></td></tr></table></div>'});}}q.add({xtype:"panel",padding:0,layout:{type:"column",align:"stretch",pack:"start"},id:j+"events",border:true,scroll:true,bodyPadding:"5 5 5 5",autoScroll:true,defaults:{columnWidth:1,xtype:"panel",ui:"newGraphPanel",margin:"5 5 5 5",bodyPadding:"0 0 10 0",},items:u,});
},createCitrixUserExperience:function(c,j,d){var s=this;var h=c.buttonInfo;var f=h[""+d+""];var k=new Array();for(var t in f){var n=f[t];if(n.length>0){var e=new Array();for(var m=0;m<n.length;m++){var o=n[m];var g=o["type"];var u=o["title"];var q=o["panelName"];var a=o["panelHeight"];a=parseFloat(a);
var p=s.getQueryString();p+="&buttonId="+d+"&er_view=submit";var b=p;var r="center";if(q=="ctxServer_panel11"){r="top";}var l=[];if(q=="userExp_panel3"){l.push({xtype:"scrollcombo",width:100,cls:"dropdown",editable:false,margin:"1px 0 0 0",name:"er_status",id:"er_status",store:new Ext.data.Store({fields:["displayField","valueField"],data:[{"displayField":Average,"valueField":"Avg"},{"displayField":Maximum,"valueField":"Max"}]}),displayField:"displayField",valueField:"valueField",queryMode:"local",listeners:{boxready:function(v){var i=appConstants.defaultLoadData;
Ext.getCmp("er_status").setValue(appConstants.er_status);},change:function(y,z,C,B){var v="citrixUserExperienceuserExp_panel3";var x=Ext.getCmp(v);x.removeAll();if(!x.loading){x.loading=true;}else{x.loading=false;}var w=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});x.setLoading(w,x.body);appConstants.er_status=z;
var D=s.getQueryString();D+="&buttonId="+d+"&er_view=submit";var A=D;var i="/final/servlet/com.eg.ErCitrixOverviewReportC";D=A+"&panelName=userExp_panel3&templateType=template1DigitalWithGraph";Ext.Ajax.request({url:i,params:D,scope:this,success:function(E){x.setLoading(false);var F=E.responseText;var G=Ext.decode(F);
s.loadChart(G,d,v,"template1DigitalWithGraph","userExp_panel3",a,"");},failure:function(E){}});},}});}e.push({xtype:"panel",title:u,id:d+q,name:q,tools:l,type:g,ui:"newGraphPanel",layout:{type:"vbox",align:"stretch",pack:r,},height:a,flex:1,items:[],listeners:{boxready:function(w){var v=new Ext.LoadMask(this.getEl(),{msg:"Loading ..."});
v.show();var i="/final/servlet/com.eg.ErCitrixOverviewReportC";p=b+"&panelName="+this.name+"&templateType="+this.type;Ext.Ajax.request({url:i,params:p,scope:this,success:function(x){v.hide();var y=x.responseText;var z=Ext.decode(y);s.loadChart(z,d,this.id,this.type,this.name,this.height,"");},failure:function(x){}});
},render:function(){var i=Ext.get("infoLink");if(i!=null&&i!=undefined){Ext.get("infoLink").on("mouseover",function(){if(Ext.isEmpty(Ext.getCmp("InfoWindowId"))){var v=Ext.create("Ext.tip.ToolTip",{anchor:"top",anchorToTarget:true,target:"infoLink",scroll:false,layout:"fit",autoHide:true,border:false,width:"auto",id:"InfoWindowId",closable:false,ui:"newTooltipPopup",items:[{xtype:"container",padding:5,html:'<span class="newFont_normal13">Avg Logon Time Per Day Across XenApp Servers</span>',}]}).show();
}});}}}});}}else{k.push({html:'<div><table width="100%" height="100%"><tr><td align="center" valign="middle"><img src="/final/images/Light/nomeasures_custom.png" /></td></tr></table></div>'});}k.push({xtype:"panel",layout:{type:"vbox",align:"stretch",},scroll:true,autoScroll:true,defaults:{xtype:"panel",ui:"newGraphPanel",columnWidth:1,margin:"5 5 5 5",bodyPadding:"0 10 10 10",},items:e});
}j.add({xtype:"panel",padding:0,layout:"column",border:true,scroll:true,bodyPadding:"5 5 5 5",autoScroll:true,defaults:{columnWidth:(1/3),},items:k});},loadChart:function(L,c,k,R,t,M,Y){var G=L[c+t];if(R!=undefined&&G!=undefined){var H=G["isData"];var ab=Ext.getCmp(k);ab.removeAll();if(H){switch(R){case"template1DigitalWithGraph":var l=new Array();
var w=G["digitalChartArry"];var D=G["anyChartObj"];var z=new Array();if(D["minMaxAvg"]!=undefined&&D["minMaxAvg"]=="no"){var P=false;if(D["digitalPercent"]!=undefined){P=true;}var S="";if(P){S+='<table align="center"><tr><td>';}S+='<div style="text-align:center;display:block"><div class="font_normal23" style="line-height:normal">';
var p="";for(var aa=0;aa<w.length;aa++){var O=w[aa];var T="";if(O.bgColor!=undefined){T=O.bgColor;}if(D["digitalPart"]=="two"&&aa==0){p="0 10 0 0";}else{p="0 0 0 0";}var h=O.url;var Q=S;var o=false;if(c+t=="citrixUserExperienceuserExp_panel5"&&O.name=="Launches"){o=true;}if(h!=undefined&&!o){Q+='<a class="anchorLink" href="javascript:void(0);" onclick="javascript:linkURL(\''+h+"');\">"+O.value+"</a>";
}else{Q+=O.value;}Q+='</div><div class="crl"></div><table align="center"><tr><td><div style="background-color:'+T+';width:8px;height:8px;border-radius:4px;">&nbsp;</div></td><td style="padding-left:3px"><div class="font_normal12">'+O.name+"</div></td><tr></table></div>";if(P){Q+="</td>";if(aa==1){Q+='<td><div style="background:'+D["digitalBgColor"]+';padding:5px 4px 3px 4px;margin-left:4px;color:#ffffff;font-family:arial;display:inline-block;text-align:left;line-height:.8em;font-size:12px">'+D["digitalPercent"]+'<span style="font-size:10px">%</span> <br/> <span style="font-size:8px">SLOW</span></div> </td>';
}Q+="</tr></table>";}z.push({xtype:"container",cls:"chartMinmax",html:Q,margin:p,padding:"10 10 8 10",flex:0.5});}l.push({xtype:"container",height:65,layout:{type:"hbox",align:"center",pack:"center",},items:z});}else{var S='<div style="text-align:center;display:block"><div class="font_normal23" style="line-height:normal">';
var b='<table width="100%"><tr>';var J="two";var u="no";if(D["digitalPart"]!=undefined&&D["digitalPart"]=="one"){J="one";}if(D["chartType"]!=undefined&&D["chartType"]=="combinedChart"&&D["multiAxis"]!=undefined&&D["multiAxis"]=="true"){u="yes";}for(var aa=0;aa<w.length;aa++){var O=w[aa];var T="";var N="";
var B="0px";if(O.bgColor!=undefined){T=O.bgColor;B="3px";}var h=O.url;if(h!=undefined){S+='<a class="anchorLink" href="javascript:void(0);" onclick="javascript:linkURL(\''+h+"');\">"+O.value+"</a>";}else{S+=O.value;}S+='</div><div class="crl"></div><table align="center"><tr><td><div style="background-color:'+T+';width:8px;height:8px;border-radius:4px">&nbsp;</div></td><td style="padding-left:'+B+'"><div class="font_normal12">'+O.name+"</div></td></tr></table></div>";
if(aa==0&&J=="two"){z.push({xtype:"container",cls:"chartMinmax",html:S,height:65,margin:"0 10 0 0",padding:"10 10 8 10",flex:0.35});}else{N="";if(aa>=2){N="33%";}b+='<td width="'+N+'"><div style="text-align:center;"><div class="font_normal20" style="line-height:normal">';if(h!=undefined){b+='<a class="anchorLink" href="javascript:void(0);" onclick="javascript:linkURL(\''+h+"');\">"+O.value+"</a>";
}else{b+=O.value;}b+='</div><div class="crl"></div><table align="center"><tr><td><div style="background-color:'+T+';width:8px;height:8px;border-radius:4px;">&nbsp;</div></td><td style="padding-left:'+B+'"><div class="font_normal11">'+O.name+"</div></td></tr></table></div></td>";if(aa!=w.length-1){b+='<td><div class="chartLegendDivider" style="width:1px;"></div></td>';
}}}b+="</tr></table>";z.push({xtype:"container",html:b,margin:"0 0 0 0",padding:"10 10 8 10",height:65,cls:"chartMinmax",flex:0.65});l.push({xtype:"container",height:65,layout:{type:"hbox",align:"center",pack:"center",},items:z});}var q=M-130;if(t=="ctxServer_panel11"){q=M-140;l.push({xtype:"container",margin:"20 0 10 0",html:'<span class="newFont_normal13">Max OS Connection Failures Across XA Servers</span>',});
}l.push({xtype:"container",border:true,height:q,id:"barChartId"+k,listeners:{"boxready":function(ad){try{var d={};if(u=="yes"){d=jQuery.extend(true,{},getHighChartsBarInstance_combine(this.id,this.height+20,""),d);}else{d=jQuery.extend(true,{},getHighChartsBarInstance(this.id,this.height,""),d);}d.setData(D,"<%=currentDateFormat%>","");
d.drawChart();}catch(i){console.log("template one exveption::::::"+this.id+"===>>>>>"+i);}}},});ab.add(l);break;case"template2Graph":var D=G["anyChartObj"];l=new Array();Y=D.titleUi;if(Y!=undefined&&Y!=""){l.push({xtype:"container",margin:"0 0 0 0",html:'<span class="newFont_normal13">'+Y+"</span>",});
}if(k=="citrixLicensectxLicense_panel1"){for(var Z in D){var m=D[Z];var U=m["summaryObj"];var W='<div style="width:100%"><table width="100%" align="center" valign="middle">';W+='<tr><td colspan="4" align="center"><div style="height:195px;width:195px" id="donutId_'+Z+'"></div></td></tr></table></div>';
l.push({xtype:"panel",columnWidth:1,title:m.infoKey,layout:"column",ui:"newGraphPanel",margin:"0 10 10 10",height:M-20,items:[{xtype:"container",border:true,height:M-54,ind:Z,columnWidth:0.6,anyChartObjInfo:m,html:'<div style="height:'+(M-60)+'px" id='+"barChartId"+k+Z+"></div>",listeners:{"boxready":function(ad){try{console.log(this.anyChartObjInfo);
var d={};if(this.anyChartObjInfo.TimeFormatOut!=undefined){d=jQuery.extend(true,{},getHighChartsInstance("barChartId"+k+this.ind,this.height,""),d);}else{d=jQuery.extend(true,{},getHighChartsBarInstance("barChartId"+k+this.ind,this.height,""),d);}d.setData(this.anyChartObjInfo,currentDateFormat,"");d.drawChart();
ab.doComponentLayout();ab.doLayout();}catch(i){console.log("template two exveption::::::"+this.id+"===>>"+i);}}}},{xtype:"container",border:true,height:M-54,columnWidth:0.4,cls:"chartLegendDivider",padding:"0 0 0 10",layout:{type:"column",align:"stretch",},items:[{xtype:"container",cls:"chartMinmax",html:'<div><table width="100%" align="center" valign="middle"><tr><td align="center"><div>Installed</div><div>'+U.Installed+"</div></td></tr></table></div>",margin:"0 10 0 0",padding:"10 10 8 10",columnWidth:0.5},{xtype:"container",cls:"chartMinmax",html:'<div><table width="100%" align="center" valign="middle"><tr><td align="center"><div>Available</div><div>'+U.Available+"</div></td></tr></table></div>",margin:"0 10 0 0",padding:"10 10 8 10",columnWidth:0.5},{xtype:"container",cls:"chartMinmax",html:'<div><table width="100%" align="center" valign="middle"><tr><td align="center"><div>Available(%)</div><div>'+U.Available_PER+"</div></td></tr></table></div>",margin:"10 10 0 0",padding:"10 10 8 10",columnWidth:0.5},{xtype:"container",cls:"chartMinmax",html:'<div><table width="100%" align="center" valign="middle"><tr><td align="center"><div>Daily Used(Avg)</div><div>'+U.Daily_used+"</div></td></tr></table></div>",margin:"10 10 0 0",padding:"10 10 8 10",columnWidth:0.5},{xtype:"container",ind:Z,donutChartObj:U.donutChartObj,html:W,margin:"0 10 0 0",padding:"0 10 8 10",columnWidth:1,layout:"fit",listeners:{"afterrender":function(ad){try{var d={};
d=jQuery.extend(true,{},getHighChartsBarInstance("donutId_"+this.ind,85,85),d);d.setData(this.donutChartObj,"<%=currentDateFormat%>","");d.drawChart();ab.doComponentLayout();ab.doLayout();}catch(i){console.log("template two exveption::::::"+this.id+"===>>"+i);}}}}]}]});}}else{D.titleUi="";l.push({xtype:"container",border:true,height:M-20,id:"barChartId"+k,flex:1,listeners:{"boxready":function(ad){try{var d={};
if(D.TimeFormatOut!=undefined){d=jQuery.extend(true,{},getHighChartsInstance(this.id,this.height,""),d);}else{d=jQuery.extend(true,{},getHighChartsBarInstance(this.id,this.height,""),d);}d.setData(D,currentDateFormat,"");d.drawChart();}catch(i){console.log("template two exveption::::::"+this.id+"===>>"+i);
}}}});}ab.add(l);break;case"template3Pie":var D=G["anyChartObj"];var A=D["legend"];var ac=D["DataSet"][0]["data"];var j='<table height="100%" width="100%" border="0px" style="table-layout: fixed;"><tr><td valign="middle" style="vertical-align:middle" height="100%"><table cellspacing="0" cellpadding="0" valign="middle" width="100%"><tbody>';
for(var X in ac){var O=ac[X];var s=O["name"];var g=O["color"];var F=O["y"];var h=O["url"];var n="100";var a=document.getElementById("viewMain").offsetWidth-40;a=a/3;if(a<=350){n="73";}else{if(a<=450){n="100";}else{if(a<=600){n="180";}else{if(a<=650){n="200";}else{if(a<=800){n="250";}else{if(a>800){n="350";
}}}}}}j+='<tr><td nowrap style="padding-top:2px;padding-right:0px;width:10px;vertical-align:top"><div style="background-color:'+g+';" class="legend"></div></td>';if(t=="citrixEvents_panel1"){n="50";j+='<td class="font_normal11" style="text-overflow: ellipsis;line-height:1.2em;vertical-align:top"><div id="pieLegendId" style="text-overflow: ellipsis; overflow:hidden;width:'+n+'px;"><a href="javascript:void(0);" onclick="javascript:linkURL(\''+h+"');\">"+s+'</a></div></td><td class="font_normal11" style="text-overflow: ellipsis;width:40px;vertical-align:top">'+F+"</td></tr>";
}else{if(h!=undefined&&h!="undefined"&&h!=""){j+='<td class="font_normal11" style="word-wrap:break-word;line-height:1.2em;vertical-align:top"><div id="pieLegendId" data-qtip="'+s+'" style="text-overflow: ellipsis; overflow:hidden;width:'+n+'px;"><a href="javascript:void(0);" onclick="javascript:linkURL(\''+h+"');\">"+s+'</a></div></td><td nowrap class="font_normal11" style="text-overflow: ellipsis;width:40px;vertical-align:top">'+F+"</td></tr>";
}else{j+='<td class="font_normal11" style="word-wrap:break-word;line-height:1.2em;vertical-align:top;"><div id="pieLegendId" data-qtip="'+s+'" style="text-overflow: ellipsis; overflow:hidden;width:'+n+'px;">'+s+'</div></td><td nowrap class="font_normal11" style="text-overflow: ellipsis;width:40px;vertical-align:top">'+F+"</td></tr>";
}}if(O!=undefined&&O.innerMeasure!=undefined){var v=O.innerMeasure;if(v!=undefined){for(var C in v){var x=v[C];j+="<tr><td>&nbsp;</td>";if(x.url!=undefined&&x.url!="undefined"&&x.url!=""){j+='<td class="font_normal11" style="line-height:1.2em;vertical-align:top"><div id="pieLegendId" data-qtip="'+x.name+'" style="text-overflow: ellipsis; overflow:hidden;width:'+n+'px;padding-left:5px;"><a href="javascript:void(0);" onclick="javascript:linkURL(\''+h+"');\">"+x.name+'</a></div></td><td nowrap class="font_normal11" style="text-overflow: ellipsis;width:40px;vertical-align:top">'+x.y+"</td></tr>";
}else{j+='<td class="font_normal11" style="line-height:1.2em;vertical-align:top;"><div id="pieLegendId" data-qtip="'+x.name+'" style="text-overflow: ellipsis; overflow:hidden;width:'+n+'px;padding-left:5px;">'+x.name+'</div></td><td nowrap class="font_normal11" style="text-overflow: ellipsis;width:40px;vertical-align:top">'+x.y+"</td></tr>";
}}}}}j+="</tbody></table></td></tr></table>";l=new Array();if(Y!=undefined&&Y!=""){l.push({xtype:"container",margin:"0 0 0 0",html:'<span class="newFont_normal13">'+Y+"</span>",});}var e=new Array();var V=0.53;if(A!=undefined&&A=="false"){V=1;}e.push({xtype:"container",flex:V,height:M-50,id:"donutChartId"+k,layout:"fit",listeners:{"boxready":function(ad){try{var d={};
d=jQuery.extend(true,{},getHighChartsBarInstance(this.id,150,150),d);d.setData(D,"<%=currentDateFormat%>","");d.drawChart();}catch(i){console.log("template two exveption::::::"+this.id+"===>>"+i);}},},});if(A!=undefined&&A=="false"){}else{e.push({xtype:"container",border:true,flex:0.47,cls:"legendWithValue",style:{"top":"0px","left":"100px"},layout:{type:"fit",align:"center",pack:"center"},html:j});
}l.push({xtype:"panel",layout:{type:"hbox",align:"stretch",},flex:1,items:e});ab.add(l);break;case"template4Grid":var D=G["anyChartObj"];ab.add(this.getGrid(D));break;case"template5DigitalWithBarSameQuery":var w=G["digitalChartArry"];var D=G["anyChartObj"];var l=new Array();var z=new Array();var S='<div style="text-align:center;display:block"><div class="font_normal23" style="line-height:normal">';
var b='<table width="100%"><tr>';var J="two";if(D["digitalPart"]!=undefined&&D["digitalPart"]=="one"){J="one";}var K='<table style="margin-top:10px"><tr>';var E='<div id="" class="" style="width: 100%; height: 25px;margin-bottom:20px">';var I="100";for(var aa=0;aa<w.length;aa++){var O=w[aa];var T="";
var N="";var B="0px";var r=O.color;var y=O.name;if(O.bgColor!=undefined){T=O.bgColor;B="10px";}I=O.spanWidth;if(aa!=0){var f=O.url;E+='<a class="anchorLink" href="javascript:void(0);" onClick="javascript:linkURL(\''+f+'\',);" ><span style="width:'+I+'%;height:23px;" class="'+O.spanClass+'"><b style="visibility:hidden">'+y+"%</b></span></a>";
}if(aa==0&&J=="two"){z.push({xtype:"container",cls:"chartMinmax",html:S+O.value+'</div><div class="crl"></div><table align="center"><tr><td nowrap><div style="background-color:'+T+';width:8px;height:8px;border-radius:4px">&nbsp;</div></td><td nowrap style="padding-left:'+B+'"><div class="font_normal12">'+O.name+"</div></td></tr></table></div>",margin:"0 10 0 0",padding:"10 10 8 10",flex:0.3});
}else{N="";if(aa>=2){N="33%";}b+='<td width="'+N+'"><div style="text-align:center;"><div class="font_normal20" style="line-height:normal">'+O.value+'</div><div class="crl"></div><div class="font_normal11">'+O.name+"</div></td>";if(aa!=w.length-1){b+='<td><div class="chartLegendDivider" style="width:1px;"></div></td>';
}}if(aa!=0){K+='<td><div class="'+O.imageCls+'"></div></td><td style="padding:0px 10px 0px 5px" class="font_normal11">'+O.name+"</td>";}}K+="</tr></table>";E+="</div>";b+="</tr></table>";z.push({xtype:"container",html:b,margin:"0 0 0 0",padding:"10 10 8 10",cls:"chartMinmax",height:65,flex:0.7});l.push({xtype:"container",height:65,margin:"5 5 10 5",layout:{type:"hbox",align:"center",pack:"center",},items:z});
l.push({xtype:"container",border:true,height:M-100,id:"barChartId"+k,listeners:{"boxready":function(ad){try{var d={};d=jQuery.extend(true,{},getHighChartsBarInstance(this.id,this.height,""),d);d.setData(D,"<%=currentDateFormat%>","");d.drawChart();}catch(i){console.log("template one exveption::::::"+this.id+"===>>>>>"+i);
}}},});ab.add(l);default:break;}}else{var l=new Array();if(Y!=undefined&&Y!=""){l.push({xtype:"container",margin:"0 0 0 0",html:'<span class="newFont_normal13">'+Y+"</span>",});}l.push(this.getNoMeasure(G));ab.add(l);}}M="";},getGrid:function(j){var d=new Array();var m=new Array();var e=j.gridColumns;
var h=j.gridData;var a=j.url;var i="";for(var f in e){var c=e[f];var g="left";if(c.indexOf("@@")!=-1){g=c.substring(c.indexOf("@@")+2);c=c.substring(0,c.indexOf("@@"));if(c.indexOf("$m$")!=-1){c=c.substring(0,c.indexOf("$m$"));}}m.push(c);d.push({header:c,align:g,dataIndex:c,width:f==0?200:160,sortable:true,renderer:function(q,t,k,o,s,r,p){i=a;
var u="";var n="";if(q.indexOf("~DD~")!=-1){i=a+"&"+q.substring(q.indexOf("~DD~")+4);q=q.substring(0,q.indexOf("~DD~"));}if(!isNaN(q)&&!isNaN(parseFloat(q))){if(q!=null&&q.indexOf(".")>-1){u=q.substring(q.indexOf("."));n=q.substring(0,q.indexOf("."));q='<span class="decimal-align"><a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+i+"',);\" >"+n+'</a></span><span class="decimal-align2"><a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+i+"',);\" >"+u+"</a></span>";
}else{q='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+i+"',);\" >"+q+"</a>";}}else{q='<a class="anchorLinkDefault" href="javascript:void(0);" onClick="javascript:linkURL(\''+i+"',);\" >"+q+"</a>";}return q;}});}var l=Ext.create("Ext.data.ArrayStore",{fields:m,proxy:{type:"pagingmemory",reader:{type:"array"}},sortable:true,autoLoad:true,data:h,});
var b={xtype:"customgrid",sortableColumns:true,ui:"newGridPanel",id:"grid0",margin:"0 0 0 0",height:210,border:true,scroll:true,autoScroll:true,forceFit:true,store:l,columns:d,};return b;},getNoMeasure:function(a){var b='<div class="egFlexCenterByColumnWise" style="height:100%">';if(a["noMeasureMessage"]!=undefined){if(a["noMeasureIcon"]!=undefined){b+='<div class="'+a["noMeasureIcon"]+'"></div>';
}b+='<div class="commonErrorMsgText">'+a["noMeasureMessage"]+"</div>";}else{b+='<div class="iconInformation"></div><div class="commonErrorMsgText">No Measures Available!</div>';}b+="</div>";return{xtype:"container",flex:1,html:b};},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 c=new Ext.XTemplate('<div style="float:left;margin:-2px 0px 0px 4px;">'+settings+'</div><div style="text-align:right;float:right;"><div class="iconCloseNew" id="closeSettings"></div></div>');
Ext.create("Ext.container.Container",{width:580,padding:5,id:"configMod",ui:"settingsWindowContainer",items:[{xtype:"container",cls:"configMode_popupArrow",style:{"top":"-14px","left":"370px"}},{xtype:"container",html:c.apply(),cls:"containerHeader",style:{"top":"0px","margin":"2px","border":"0px !important"}},{xtype:"citrixOverviewSettings",parent:this}],renderTo:"viewMain"});
var g=Ext.getCmp("timefrom");g.setValue(appConstants.defaultLoadData.sHrForSetting);var a=Ext.getCmp("minfrom");a.setValue(appConstants.defaultLoadData.sMinForSetting);var d=Ext.getCmp("timeto");d.setValue(appConstants.defaultLoadData.eHourForSetting);var f=Ext.getCmp("minto");f.setValue(appConstants.defaultLoadData.eMinForSetting);
var e=Ext.getCmp("er_excwe");e.getStore().loadRawData(appConstants.defaultLoadData.excludeWeekCombo);e.setValue(appConstants.defaultLoadData.sExclweekUI);e.setFieldLabel(appConstants.defaultLoadData.sExclweekLbl);var b=Ext.getCmp("reportGeneration");b.getStore().loadRawData(appConstants.defaultLoadData.reportGenerationCombo);
b.setValue(appConstants.defaultLoadData.sRepGenType);},closeSetting:function(){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:-650}});
return true;}},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;},exportDataAlert:function(){Ext.MessageBox.show({title:"Alert",msg:"Exporting the report may take too long to complete. Choose the Background option to export this report",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
},showMessage:function(a){Ext.MessageBox.show({title:"Citrix Overview Report",msg:a,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});}});