Ext.Msg.bodyPadding="10 0";Ext.Msg.cls="adminAlert";var fromUpdatefirstTab,fromPreviousUpdate,updateSettings,currExpDate,currPwd,currCheckExp,uTypeChange,btnClk=false;Ext.define("EgChangeUserProfile.controller.Main",{extend:"Ext.app.Controller",requires:["EgChangeUserProfile.view.FileUpload","EgChangeUserProfile.view.UserFormContainer","EgChangeUserProfile.view.ElementAssociationForm","EgChangeUserProfile.view.EgMailAlertSuppress","EgChangeUserProfile.view.UserGridPanel","EgChangeUserProfile.view.ShiftsPicker","EgChangeUserProfile.view.VmPattern","Ext.ux.form.MultiSelectSI","Ext.ux.form.ItemSelectorSI","utilities.ScrollCombo","utilities.ErUtils"],views:["Main","EmptyPanel","EgErrorPanel","ComponentGroupedSummaryGrid","ConfigureComponentTypes","VmPattern"],refs:[{selector:"main",ref:"main"},{selector:"fileupload",ref:"fileupload"},{selector:"userformcontainer",ref:"userformcontainer"},{selector:"userformcontainer #eGShiftPeriods",ref:"shifPeroidsCt"},{selector:"elementassociationform",ref:"elementassociationform"},{selector:"egmailalertsuppress",ref:"egmailalertsuppress"},{selector:"shiftspicker",ref:"shiftspicker"},{selector:"configurecomponenttypes",ref:"configurecomponenttypes"},{selector:"vmpattern",ref:"vmpattern"}],init:function(){appCnt=this;
this.buildMainData();this.control({"main":{"boxready":this.afterMainRender},'main button[id="backButton"]':{"click":this.goBack},'userformcontainer scrollcombo[id="userStatus"]':{"select":this.userStatusChange},'userformcontainer treepicker[id="uname"]':{"select":this.onUserIDChange},'userformcontainer treepicker[id="org"]':{"select":this.onOrganizationChange},'userformcontainer combo[id="utype"]':{"select":this.userTypeOnChange},'userformcontainer radiogroup[id="alarmMsgMode"]':{"change":this.setMeasureInMailMode},'main button[id="btnSubmit"]':{"click":this.submitUserDetails},'main button[id="btnNext"]':{"click":this.moveTab},'main button[id="btnPrev"]':{"click":this.movePreviousTab},'userformcontainer checkbox[id="chkuser"]':{},'userformcontainer checkbox[id="Never"]':{"change":this.userValidityChange},'userformcontainer checkbox[id="logoCheck"]':{"change":this.logoConfiguration},'userformcontainer checkbox[id="high"]':{"change":this.showalarmRet},'userformcontainer checkbox[id="medium"]':{"change":this.showalarmRet},'userformcontainer checkbox[id="low"]':{"change":this.showalarmRet},'userformcontainer radiogroup[id="eGRemoteExec"]':{},'userformcontainer combo[id="loginLogo1"]':{"select":this.loginLogoController},'userformcontainer combo[id="monitorLogo1"]':{"select":this.monitorLogoController},'userformcontainer combo[id="reporterLogo1"]':{"select":this.repLogoController},'userformcontainer combo[id="configLogo1"]':{"select":this.configLogoController},"fileupload #uploadUsrIcon":{"click":this.uploadUsrImage},"userformcontainer":{"beforetabchange":this.loadUserTab},"elementassociationform":{"afterrender":this.initUserElements},"egmailalertsuppress":{"afterrender":this.initUserMailConfigs},'elementassociationform combo[id="orgType"]':{"select":this.organizationOnChange},'elementassociationform combo[id="associate"]':{"select":this.associateOnChange},'elementassociationform checkbox[id="compAssociation"]':{"change":this.associateServerType},'elementassociationform combo[id="compType"]':{"select":this.getServerDetails},'elementassociationform combo[id="virtualTypes"]':{"select":this.callServerType},'elementassociationform radiogroup[id="vmSelection"]':{"change":this.getVmTypes},'elementassociationform multiselectfield[id="virtualServers"]':{"change":this.getVmSelectedCheckBox},'elementassociationform button[id="apply"]':{"click":this.assignAndAddMore},'elementassociationform button[id="mailFilterConfig"]':{"click":this.loadMailFilterTab},'elementassociationform button[id="finish"]':{"click":this.submitUserElements},'egmailalertsuppress combo[id="filter"]':{"select":this.popFilterDetails},'egmailalertsuppress combo[id="CompTypes"]':{"select":this.popCompTypes},'egmailalertsuppress combo[id="TestTypes"]':{"select":this.popTestTypes},'egmailalertsuppress combo[id="compTypesIn"]':{"select":this.viewByCriteria},'egmailalertsuppress combo[id="serseg"]':{"select":this.changeByServer},'egmailalertsuppress combo[id="Test"]':{"select":this.changeByTest},'egmailalertsuppress multiselectSi[id="compName"]':{"change":this.changeByComponentName},'egmailalertsuppress button[id="includeMore"]':{"click":this.assignAndAddMoreFilters},'egmailalertsuppress button[id="mailSubmit"]':{"click":this.submitUserFilterElements},'elementassociationform button[id="btnViewElements"]':{"click":this.viewUserAssociatedElements},'egmailalertsuppress button[id="btnViewFilters"]':{"click":this.viewFilteredElements},'egmailalertsuppress trigger[name="searchbox"]':{"change":this.egTitleSearch},'userformcontainer textfield[id="upass"]':{"change":this.passStrength},'userformcontainer textfield[id="confpasswd"]':{"change":this.getConfPass},'userformcontainer radio[id="alarmNotifyNew"]':{change:this.setDDInMailMode},'configurecomponenttypes button[id="btnApply"]':{"click":this.applySeverChange},'vmpattern button[id="patternAssociateBtn"]':{"click":this.viewUserAssociatedElements}});
},configPatternTypes:function(){var b=Ext.getCmp("patternName").getValue();var a=Ext.create("EgChangeUserProfile.view.VmPattern",{text:b}).show();},setDDInMailMode:function(){var a=Ext.getCmp("alarmNotifyNew").getValue();if(a==false||a=="false"){Ext.getCmp("detailsDiagnosisAlerts").setVisible(false);
}else{Ext.getCmp("detailsDiagnosisAlerts").setVisible(true);}},passStrength:function(d){var e=d.getValue();var c=Ext.getCmp("confpasswd").getValue();currPwd=publicJSON["changeObj"];var j=publicJSON["authenticationType"];if(!Ext.isEmpty(j)&&j=="Eg"){var a=currPwd;if(e!=null&&e!=""&&e!=undefined){if(a!=e&&c!=e){updateSettings=true;
}else{if(a==e&&c==e){updateSettings=false;}}}if(uTypeChange!=undefined&&uTypeChange==true){updateSettings=true;}var g=publicJSON.pwdLength;var b=publicJSON.pwdComplexityCount;if(g==""||g<2){g=8;}else{if(g!=""&&g<b){g=b;}}var f=Ext.getCmp("upass").getValue();if(f.length>0){pass=f;}Ext.getCmp("passScore").show();
var h=/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\da-zA-Z]).+$/;var k=/^(?=.*\d)(?=.*[a-zA-Z])(?=.*[^\da-zA-Z]).+$/;var i=/^(?=.*\d)(?=.*[a-zA-Z]).+$/;if(f.length>=g&&h.test(f)){Ext.getCmp("passScore").setText(passStr+": "+Strong);}else{if(f.length>=g&&f.match(k)){Ext.getCmp("passScore").setText(passStr+": "+Good);
}else{if(f.length>=g&&f.match(i)){Ext.getCmp("passScore").setText(passStr+": "+Fair);}else{if(f.length==0){Ext.getCmp("passScore").setText(passLabel1+" "+g+" "+passLabel2);}else{Ext.getCmp("passScore").setText(passStr+": "+Weak);}}}}}},getConfPass:function(f){var e=f.getValue();var d=Ext.getCmp("upass").getValue();
currConfPwd=publicJSON["changeObj"];var b=publicJSON["authenticationType"];if(!Ext.isEmpty(b)&&b=="Eg"){var c=currPwd;if(e!=null&&e!=""&&e!=undefined){if(c!=e&&d!=e){updateSettings=true;}else{if(c==e&&d==e){updateSettings=false;}}}if(uTypeChange!=undefined&&uTypeChange==true){updateSettings=true;}var a=Ext.getCmp("confpasswd").getValue();
if(a.length>0){confPass=a;}}},pwdComplexityCheck:function(e){var l=publicJSON["changeObj"];if(l==e){return"true";}var c="^";var a="";var f=".+$";var n="";var b=".";var m="<br/>";var g=publicJSON.pwdComplexity;if(g!=null&&g!=undefined){if(g.indexOf(",")>-1){n="false#";var i=g.split(",");for(var d=0;d<i.length;
d++){var j=i[d].toLowerCase().trim();if(j=="lc"){a+="(?=.*[a-z])";n+=m+(d+1)+b+" "+userIDValidationMsg69;}else{if(j=="uc"){a+="(?=.*[A-Z])";n+=m+(d+1)+b+" "+userIDValidationMsg70;}else{if(j=="dg"){a+="(?=.*[0-9])";n+=m+(d+1)+b+" "+userIDValidationMsg71;}else{if(j=="sp"){a+="(?=.*[^0-9a-zA-Z])";n+=m+(d+1)+b+" "+userIDValidationMsg72;
}}}}}}else{n="false#";var j=g.toString().toLowerCase().trim();if(j=="lc"){a+="(?=.*[a-z])";n+=userIDValidationMsg69;}else{if(j=="uc"){a+="(?=.*[A-Z])";n+=userIDValidationMsg70;}else{if(j=="dg"){a+="(?=.*[0-9])";n+=userIDValidationMsg71;}else{if(j=="sp"){a+="(?=.*[^0-9a-zA-Z])";n+=userIDValidationMsg72;
}}}}}var h=new RegExp(c+a+f);if(h.test(e)){n="true";}}return n;},buildMainData:function(){Ext.Ajax.request({url:appURL,async:false,method:"POST",timeout:120000,success:function(a){var c=a.responseText;publicJSON=Ext.decode(c);var b=publicJSON["isUsersCreated"];if(b==false){Ext.Ajax.request({url:appURL,async:false,params:{"userStatus":"expired"},method:"POST",timeout:120000,success:function(d){var e=d.responseText;
publicJSON=Ext.decode(e);}});}}});},getErrorMessageTemplate:function(d){var a='<div class="x-table"><table cellspacing="0" width="100%" cellpadding="5" border="0" align="center" class="x-grid-table" style="border:1px solid #c3c3c3"><thead><tr class="x-grid-row"><th class=" x-grid-cell x-grid-cell-first"><div class="x-grid-cell-inner">Error</div></td></tr></thead>';
for(var c in d){if(c=="title"){continue;}var b=d[c];a=a+'<tr class="x-grid-row"><td class=" x-grid-cell x-grid-cell-first"><div class="x-grid-cell-inner" >'+b+"</div></td></tr>";}a=a+"</table></div>";return a;},getVmTypes:function(){try{var a=Ext.getCmp("vmSelection");var b=a.lastValue.vmselectiongrp;
if(!Ext.isEmpty(b)&&b==1){Ext.getCmp("patternContainer").hide();Ext.getCmp("selectorFieldContainer").show();this.getVMs();}else{if(!Ext.isEmpty(b)&&b==2){Ext.getCmp("patternContainer").show();Ext.getCmp("selectorFieldContainer").hide();this.getVMsPattern();}else{if(!Ext.isEmpty(b)&&b==3){Ext.getCmp("selectorFieldContainer").hide();
Ext.getCmp("patternContainer").hide();}}}}catch(c){}},getVmSelectedCheckBox:function(i,b,a,h){updateSettings=false;this.virtualServersChange(i,b,a,h);var f=Ext.getCmp("virtualServers");var d=Ext.getCmp("virtualTypes").getValue();var c=f.getValue();var g=Ext.getCmp("vmSelection");var e=g.lastValue.vmselectiongrp;
if(c=="-1"||c.length==0){return;}if(c.length>1||c.indexOf(d+":*all*")>-1){Ext.getCmp("vmselectionspecific").reset();Ext.getCmp("vmselectionspecific").setDisabled(true);Ext.getCmp("selectorFieldContainer").hide();if(!Ext.isEmpty(e)&&e==2){Ext.getCmp("selectorFieldContainer").hide();Ext.getCmp("patternContainer").show();
this.getVMsPattern();}else{if(!Ext.isEmpty(e)&&e==3){Ext.getCmp("selectorFieldContainer").hide();Ext.getCmp("patternContainer").hide();}}}else{Ext.getCmp("vmselectionspecific").setDisabled(false);if(!Ext.isEmpty(e)&&e==1){Ext.getCmp("patternContainer").hide();Ext.getCmp("selectorFieldContainer").show();
this.getVMs();}else{if(!Ext.isEmpty(e)&&e==2){Ext.getCmp("selectorFieldContainer").hide();Ext.getCmp("patternContainer").show();this.getVMsPattern();}else{if(!Ext.isEmpty(e)&&e==3){Ext.getCmp("selectorFieldContainer").hide();Ext.getCmp("patternContainer").hide();}}}}},getVMsPattern:function(){var d=Ext.getCmp("virtualServers");
var c=d.getValue();if(c=="-1"||c.length==0){return;}var f=Ext.getCmp("virtualTypes").getValue();var a=Ext.getCmp("compType").getValue();var e="&username="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&compType="+encodeURI(a)+"&vServer="+f;var b="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?showAssociatedData=yes&qctr=1&type=vmpattern&"+e;
Ext.Ajax.request({url:b,method:"POST",params:{vHost:encodeURI(c),},timeout:120000,async:false,success:function(g){var j=g.responseText;var h=Ext.decode(j);var i="";try{i=h.pattern;Ext.getCmp("patternName").setValue("");Ext.getCmp("patternName").setValue(i);}catch(k){}}});},getVMs:function(){var f=Ext.getCmp("virtualServers");
var e=f.getValue();var q=this;var i=Ext.getCmp("utype").getValue();var l=Ext.getCmp("compType").getValue();var h=Ext.getCmp("associate").getValue();var j=Ext.getCmp("virtualTypes").getValue();var g=Ext.getCmp("vmselectionspecific").getValue();var a="";if(!isEnterpriseModel){var m=userElementJSON.shareNickAcrossOU!=null&&userElementJSON.shareNickAcrossOU!=undefined&&userElementJSON.shareNickAcrossOU;
var b=userElementJSON.superOrgName;if(m||(!Ext.isEmpty(b)&&b.toLowerCase()=="egenterprise")){a=Ext.getCmp("orgType").getValue();}}var o="associate="+h+"&username="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&qctr=1&compType="+encodeURI(l)+"&assousers="+encodeURIComponent(associatedUserIDs)+"&newusers="+encodeURIComponent(associatedUserIDs)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+i+"&vServer="+j+"&orgName="+encodeURIComponent(parent.filterEncode(a));
if(g){o+="&vmspecific=true";}var n="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?showAssociatedData=yes&qctr=1&selectedTab=3&"+o;Ext.Ajax.request({url:n,method:"POST",params:{vHost:encodeURI(e),},timeout:120000,async:false,success:function(s){var t=s.responseText;userElementJSON=Ext.decode(t);}});
var k=Ext.getCmp("otherHosts");k.getStore().removeAll();var d=userElementJSON["toTitle"];var p=userElementJSON["fromTitle"];k.fromField.getComponent(0).setTitle(d);k.toField.getComponent(0).setTitle(p);var r=userElementJSON["associatedItems"];var c=userElementJSON["disAssociatedItems"];if(k.fromField.store.getCount()>0){k.fromField.store.removeAll();
}if(k.toField.store.getCount()>0){k.toField.store.removeAll();}if(!Ext.isEmpty(r)){k.fromField.store.add(r);}if(!Ext.isEmpty(c)){k.toField.store.add(c);}},getVMServers:function(i,e,b,n){var g=i.getValue();if(g=="-1"||g.length==0){return;}var o=this;var k=Ext.getCmp("utype").getValue();var j=Ext.getCmp("compType").getValue();
var a=Ext.getCmp("associate").getValue();var m=Ext.getCmp("virtualTypes").getValue();var h="associate="+a+"&username="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&qctr=1&compType="+encodeURI(j)+"&assousers="+encodeURIComponent(associatedUserIDs)+"&newusers="+encodeURIComponent(associatedUserIDs)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+k+"&vServer="+m;
var l="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?showAssociatedData=yes&qctr=1&selectedTab=3&"+h;Ext.Ajax.request({url:l,method:"POST",params:{vHost:g},timeout:120000,async:false,success:function(p){var q=p.responseText;userElementJSON=Ext.decode(q);}});var f=Ext.getCmp("otherHosts");f.getStore().removeAll();
var d=userElementJSON["associatedItems"];var c=userElementJSON["disAssociatedItems"];if(f.fromField.store.getCount()>0){f.fromField.store.removeAll();}if(f.toField.store.getCount()>0){f.toField.store.removeAll();}if(!Ext.isEmpty(d)){f.fromField.store.add(d);}if(!Ext.isEmpty(c)){f.toField.store.add(c);
}},callServerType:function(f,j,s){var r=this;updateSettings=false;var l=Ext.getCmp("otherHosts");l.getStore().removeAll();if(l.fromField.store.getCount()>0){l.fromField.store.removeAll();}if(l.toField.store.getCount()>0){l.toField.store.removeAll();}if(f.getValue()=="-1"){var k=Ext.getCmp("virtualServers");
k.getStore().removeAll();return false;}var h=Ext.getCmp("utype").getValue();var m=Ext.getCmp("compType").getValue();var g=Ext.getCmp("associate").getValue();var i=f.getValue();var a="";if(!isEnterpriseModel){var n=userElementJSON.shareNickAcrossOU!=null&&userElementJSON.shareNickAcrossOU!=undefined&&userElementJSON.shareNickAcrossOU;
var c=userElementJSON.superOrgName;if(n||(!Ext.isEmpty(c)&&c.toLowerCase()=="egenterprise")){a=Ext.getCmp("orgType").getValue();}}var q="associate="+g+"&username="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&qctr=1&compType="+encodeURI(m)+"&assousers="+encodeURIComponent(associatedUserIDs)+"&newusers="+encodeURIComponent(associatedUserIDs)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+h+"&vServer="+i+"&orgName="+encodeURIComponent(parent.filterEncode(a));
var o="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?showAssociatedData=yes&qctr=1&selectedTab=3&"+q;r.updateUserElementPage(o);var d=userElementJSON["virtualServers"];var b=Ext.getCmp("virtualServers");b.getStore().suspendEvents(true);EgChangeUserProfile.compRawData=d;b.getStore().loadRawData(d);
try{if(!Ext.isEmpty(s)&&s.length>-1){b.setValue(s);r.virtualServersChange("",s);}else{if(!Ext.isEmpty(j)&&j=="true"){b.setValue(d[0].valueField);r.virtualServersChange("",d[0].valueField);}else{r.virtualServersChange("",[]);}}}catch(p){}b.getStore().resumeEvents();},virtualServersChange:function(l,d,a,j){if(d!=null&&d.length>0){var g=Ext.getCmp("virtualServers");
var f=g.getValue();var i=Ext.getCmp("utype").getValue();var h=Ext.getCmp("virtualTypes").getValue();var k=Ext.getCmp("virtualTypes").getRawValue();var c=Ext.getCmp("associate").getValue();var b="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?getVmSelect=true&showAssociatedData=yes&qctr=1&selectedTab=3&assousers="+encodeURIComponent(associatedUserIDs)+"&username="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom=add&utype="+i+"&associate="+encodeURIComponent(c)+"&selHypervisorType="+h;
if(c=="Independent servers"){var e=Ext.getCmp("associate").getValue();b=b+"&compType="+encodeURIComponent(e)+"&type=allVms&vHost="+encodeURI(f);}Ext.Ajax.request({url:b,method:"POST",async:false,timeout:120000,success:function(m){var q=m.responseText;var n=Ext.decode(q);if(n!=null){var r=n.vm_selection_hash;
var p="";if(r!=undefined&&r!=null){for(var o in r){if(o.indexOf("_vm")>-1){p=r[o];}}}if(p!=null&&p.trim().length>0&&p.indexOf("*all*")>-1){Ext.getCmp("vmselectionall").setValue(true);Ext.getCmp("selectorFieldContainer").hide();Ext.getCmp("patternContainer").hide();}else{if(p!=null&&p.trim().length>0&&p.indexOf("*pattern")>-1){Ext.getCmp("vmselectionpattern").setValue(true);
Ext.getCmp("patternContainer").show();Ext.getCmp("selectorFieldContainer").hide();EgChangeUserProfile.app.getController("Main").getVMsPattern();}else{if(p!=null&&p.trim().length>0){Ext.getCmp("vmselectionspecific").setValue(true);Ext.getCmp("patternContainer").hide();Ext.getCmp("selectorFieldContainer").show();
EgChangeUserProfile.app.getController("Main").getVMs();}else{Ext.getCmp("vmselectionspecific").setValue(false);Ext.getCmp("vmselectionpattern").setValue(false);Ext.getCmp("vmselectionall").setValue(false);Ext.getCmp("selectorFieldContainer").hide();Ext.getCmp("patternContainer").hide();}}}}}});}else{Ext.getCmp("vmselectionspecific").setValue(false);
Ext.getCmp("vmselectionpattern").setValue(false);Ext.getCmp("vmselectionall").setValue(false);Ext.getCmp("selectorFieldContainer").hide();Ext.getCmp("patternContainer").hide();}},setMeasureInMailMode:function(e){var d=e.getValue().msgmode;var a=Ext.getCmp("measure_in_mail_mode");var c=publicJSON["mailAlertSettings"]["measure_in_mail_mode"];
var b=publicJSON["mailAlertSettings"]["selectedMailMode"];a.getStore().loadRawData(c);if(b!=null&&b=="DATA"){a.setValue(b);}else{a.setValue(a.getStore().getAt(0).get("valueField"));}if(d=="T"){a.getStore().removeAt(2);}},userValidityChange:function(g,f,d,e){var c=Ext.getCmp("tmptilldate");var b=g.getValue();
var a=publicJSON["validtill"];if(a=="Never"){currCheckExp=true;}else{currCheckExp=false;}if(currCheckExp!=b){updateSettings=true;}if(b==true){c.setDisabled(true);}else{c.setDisabled(false);}},showAvailableUsers:function(b){var a=b.getValue();var c=Ext.getCmp("availusers");if(a==true){c.show();Ext.getCmp("userpref").body.scroll("bottom",b.getBox().y);
}else{c.hide();Ext.getCmp("userpref").body.scroll("bottom",b.getBox().y);}},loadMailFilterTab:function(){var a=Ext.getCmp("userformcontainer");a.setActiveTab(2);},submitUserElements:function(){updateSettings=false;var q=Ext.getCmp("otherHosts");var o=q.getValue();var n="";if(o!=null){o.toString();}var k="EgChangeUserProfile/data/EgusersiteserverspJson.jsp?disAssociateElements="+n+"&mode=change&date="+new Date().getTime();
var p=this;p.associateValue("finish");var f=userElementJSON["hiddenFields"];p.setHiddenFieldsToForm();var c=this.getElementassociationform().getForm();var i=Ext.getCmp("compType").getValue();var e=Ext.getCmp("virtualServers");if(!Ext.isEmpty(i)&&i=="Virtual_Machine"){var m=Ext.getCmp("virtualTypes").getValue();
if(Ext.isEmpty(m)||m=="-1"){Ext.Msg.alert("Status","Select hypervisor type");return;}var b=e.getValue();if(b=="-1"||b.length==0){Ext.Msg.alert("Status","Select hypervisor hosts");return;}if(b.length>1&&b.indexOf(m+":*all*")>-1){Ext.Msg.alert("Error","All Hosts and other hosts cannot be selected simuntaneously!");
Ext.getCmp("vmselectionspecific").setValue(false);Ext.getCmp("vmselectionpattern").setValue(false);Ext.getCmp("vmselectionall").setValue(false);Ext.getCmp("patternContainer").hide();return;}var j=Ext.getCmp("vmSelection");var h=j.lastValue.vmselectiongrp;if(Ext.isEmpty(h)||h=="-1"){Ext.Msg.alert("Status","Select VM Association");
return;}else{if(h==2){var g=Ext.getCmp("patternName").getValue();if(Ext.isEmpty(g)||g==""){Ext.Msg.alert("Error","Enter a valid pattern");return;}}}}var a="";if(reqFrom!="adduser"){a=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});a.show();}var l=Ext.getCmp("patternName").getValue();l=parent.filterEncode(l);
var d=Ext.getCmp("orgType").getValue();d=parent.filterEncode(d);if(c.isValid()){this.getElementassociationform().submit({url:k,method:"POST",params:{"patternName":l,"orgType":d},timeout:1200,success:function(s,t){var r=Ext.decode(t.response.responseText);if(r.requestStatus!=undefined&&r.requestStatus=="fail"){a.hide();
Ext.Msg.show({title:pageIntnl81,msg:r.result.message1+". "+r.result.message2,buttons:Ext.Msg.OK,icon:"iconExclamation"});var u=Ext.getCmp("compType");p.getServerDetails(u);}else{e.setDisabled(false);if(reqFrom!="adduser"){a.hide();}Ext.Msg.show({title:pageIntnl81,msg:pageIntnl98,buttons:Ext.Msg.OK,width:400,icon:"iconInformation",fn:function(){if((isAlarmEnabled==true||isAlarmEnabled=="true")&&(isFilterMailAlertsEnabled==true||isFilterMailAlertsEnabled=="true")){var v=Ext.getCmp("userformcontainer");
v.setActiveTab(3);}else{p.showUserAddForm();}}});}},failure:function(r,s){e.setDisabled(false);if(reqFrom!="adduser"){a.hide();}}});}},submitUserFilterElements:function(h){var l=this;h.setDisabled(true);if(mailFilterOption=="Descriptors_Only"){var i="EgChangeUserProfile/data/EgMailAlertIncludeSuppresspJson.jsp?reqfrom="+reqFrom+"&userID="+encodeURIComponent(parent.filterEncode(selectedUserID));
l.setFilterValues("finish");var d=Ext.getCmp("exclude");var o=new Array();var c=new Array();var a=d.fromField.store;var j=d.toField.store;for(var k=0;k<a.getCount();k++){var b=a.getAt(k).get("valueField");c.push(b);}for(var k=0;k<j.getCount();k++){var b=j.getAt(k).get("valueField");o.push(b);}if(c.length==0&&o.length==0){Ext.Msg.alert(pageIntnl82,"Please select the required parameters to Exclude/Include");
h.setDisabled(false);return;}var n=Ext.getCmp("compName").getValue();var g=userMailJSON["hiddenFields"];l.setHiddenFiledsForFilters(g,n);var f=l.getEgmailalertsuppress().getForm();var e=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});e.show();if(f.isValid()){this.getEgmailalertsuppress().submit({url:i,method:"POST",timeout:1200,success:function(p,q){e.hide();
Ext.Msg.show({title:pageIntnl82,msg:pageIntnl99,buttons:Ext.Msg.OK,width:400,icon:"iconInformation",fn:function(){l.showUserAddForm();}});},failure:function(p,q){e.hide();}});}}else{var m=Ext.getCmp("filter").getValue();var i="EgChangeUserProfile/data/EgMailAlertSuppresspJson.jsp?reqfrom="+reqFrom+"&userID="+encodeURIComponent(parent.filterEncode(selectedUserID));
l.setFilterValues("finish");var n="";if(m=="filterByDescriptor"){n=Ext.getCmp("compName").getValue();}var g=userMailJSON["hiddenFields"];l.setHiddenFiledsForFilters(g,n);var f=l.getEgmailalertsuppress().getForm();var e=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});e.show();if(f.isValid()){this.getEgmailalertsuppress().submit({url:i,method:"POST",success:function(p,q){e.hide();
Ext.Msg.show({title:pageIntnl82,msg:pageIntnl99,buttons:Ext.Msg.OK,width:400,icon:"iconInformation",fn:function(){l.showUserAddForm();}});},failure:function(p,q){e.hide();l.showUserAddForm();}});}}h.setDisabled(false);},assignAndAddMoreFilters:function(h){var l=this;h.setDisabled(true);if(mailFilterOption=="Descriptors_Only"){var m=Ext.getCmp("filter").getValue();
var i="EgChangeUserProfile/data/EgMailAlertIncludeSuppresspJson.jsp?reqfrom="+reqFrom+"&userID="+encodeURIComponent(parent.filterEncode(selectedUserID));var n=Ext.getCmp("compName").getValue();i=i+"&compNames="+encodeURIComponent(n);var d=Ext.getCmp("exclude");var o=new Array();var c=new Array();var a=d.fromField.store;
var j=d.toField.store;for(var k=0;k<a.getCount();k++){var b=a.getAt(k).get("valueField");c.push(b);}for(var k=0;k<j.getCount();k++){var b=j.getAt(k).get("valueField");o.push(b);}if(c.length==0&&o.length==0){Ext.Msg.alert(pageIntnl82,"Please select the required parameters to Exclude/Include");h.setDisabled(false);
return;}l.setFilterValues("addMore");var g=userMailJSON["hiddenFields"];l.setHiddenFiledsForFilters(g);var f=l.getEgmailalertsuppress().getForm();var e=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});e.show();if(f.isValid()){this.getEgmailalertsuppress().submit({url:i,method:"POST",success:function(p,q){e.hide();
l.showResultText();},failure:function(p,q){e.hide();}});}}else{var m=Ext.getCmp("filter").getValue();var i="EgChangeUserProfile/data/EgMailAlertSuppresspJson.jsp?reqfrom="+reqFrom+"&userID="+encodeURIComponent(parent.filterEncode(selectedUserID));if(m=="-1"){Ext.MessageBox.alert(pageIntnl82,pageIntnl90);
h.setDisabled(false);return;}l.setFilterValues("addMore");var g=userMailJSON["hiddenFields"];var n="";if(m=="filterByDescriptor"){n=Ext.getCmp("compName").getValue();}l.setHiddenFiledsForFilters(g,n);var f=l.getEgmailalertsuppress().getForm();var e=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});
e.show();if(f.isValid()){this.getEgmailalertsuppress().submit({url:i,method:"POST",success:function(p,q){e.hide();l.showResultText();},failure:function(p,q){e.hide();}});}}h.setDisabled(false);},showUserAddForm:function(){if(reqFrom=="adduser"){var b=Ext.getCmp("utype").getValue();window.location.href="EgAddUser.jsp?qctr=1&usertype="+encodeURIComponent(b);
}else{var a=Ext.getCmp("userformcontainer");a.setActiveTab(0);appCnt.onUserIDChange(Ext.getCmp("uname"));}},onItemSelection:function(){btnClk=true;},assignAndAddMore:function(i){updateSettings=false;if(Ext.getCmp("associate").getValue()=="-1"){Ext.MessageBox.alert(pageIntnl81,pageIntnl89);return;}var k="EgChangeUserProfile/data/EgusersiteserverspJson.jsp?mode=change&date="+new Date().getTime();
var n=this;n.associateValue("apply");n.setHiddenFieldsToForm();var h=Ext.getCmp("compType").getValue();var e=Ext.getCmp("virtualServers");if(!Ext.isEmpty(h)&&h=="Virtual_Machine"){var m=Ext.getCmp("virtualTypes").getValue();if(Ext.isEmpty(m)||m=="-1"){Ext.Msg.alert("Status","Select hypervisor type");
return;}var c=e.getValue();if(c=="-1"||c.length==0){Ext.Msg.alert("Status","Select hypervisor hosts");return;}if(c.length>1&&c.indexOf(m+":*all*")>-1){Ext.Msg.alert("Error","All Hosts and other hosts cannot be selected simuntaneously!");Ext.getCmp("vmselectionspecific").setValue(false);Ext.getCmp("vmselectionpattern").setValue(false);
Ext.getCmp("vmselectionall").setValue(false);Ext.getCmp("patternContainer").hide();return;}var j=Ext.getCmp("vmSelection");var g=j.lastValue.vmselectiongrp;if(Ext.isEmpty(g)||g=="-1"){Ext.Msg.alert("Status","Select VM Association");return;}else{if(g==1){if(Ext.getCmp("associate").getValue()=="-1"){Ext.MessageBox.alert(pageIntnl81,pageIntnl89);
return;}}else{if(g==2){var f=Ext.getCmp("patternName").getValue();if(Ext.isEmpty(f)||f==""){Ext.Msg.alert("Error","Enter a valid pattern");return;}}}}}var e=Ext.getCmp("virtualServers");var b=this.getElementassociationform().getForm();var l=Ext.getCmp("patternName").getValue();l=parent.filterEncode(l);
var d=Ext.getCmp("orgType").getValue();d=parent.filterEncode(d);var a=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});a.show();if(b.isValid()){this.getElementassociationform().submit({url:k,timeout:1200,method:"POST",params:{"patternName":l,"orgType":d},success:function(q,v){var w=Ext.decode(v.response.responseText);
if(w.requestStatus!=undefined&&w.requestStatus=="fail"){a.hide();Ext.Msg.show({title:pageIntnl81,msg:w.result.message1+". "+w.result.message2,buttons:Ext.Msg.OK,icon:"iconExclamation"});var x=Ext.getCmp("compType");n.getServerDetails(x);}else{e.setDisabled(false);a.hide();if(btnClk){n.showResultText();
btnClk=false;}else{if(g==2||g==3){n.showResultText();}else{n.showResultText();}}if(g==1){EgChangeUserProfile.app.getController("Main").getVMs();}var t=Ext.getCmp("associate").getValue();var p=Ext.getCmp("compType").getValue();var y=Ext.getCmp("orgType").getValue();if(t=="Zone"||t=="Service"||t=="ServiceGroup"||t=="Segment"||t=="Independent servers"){var z=Ext.getCmp("utype").getValue();
var o="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?showAssociatedData=yes&qctr=1&selectedTab=3&assousers="+encodeURIComponent(associatedUserIDs)+"&username="+encodeURIComponent(selectedUserID)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+z+"&associate="+encodeURIComponent(t)+"&orgName="+encodeURIComponent(parent.filterEncode(y))+"&date="+new Date().getTime();
appCnt.updateUserElementPage(o);var u=userElementJSON.associations;var B=Ext.getCmp("associate");B.getStore().loadRawData(u);B.setValue(t);if(t=="Independent servers"){var r=userElementJSON["componentTypes"];if(!Ext.isEmpty(r)){Ext.getCmp("compType").getStore().loadRawData(r);var A=Ext.getCmp("compType").getStore().findExact("valueField",p);
if(A==-1){Ext.getCmp("compType").setValue(Ext.getCmp("compType").getStore().getAt(0).get("valueField"));}}else{Ext.getCmp("compType").hide();B.setValue(B.getStore().getAt(0).get("valueField"));var s=Ext.getCmp("otherHosts");s.getStore().removeAll();if(s.fromField.store.getCount()>0){s.fromField.store.removeAll();
}if(s.toField.store.getCount()>0){s.toField.store.removeAll();}}}}}},failure:function(o,p){e.setDisabled(false);a.hide();}});}},showResultText:function(){if(Ext.getCmp("resultCt")==null||Ext.getCmp("resultCt")==undefined){var a=Ext.create("Ext.container.Container",{floatable:true,floating:true,id:"resultCt",width:380,items:[{xtype:"component",padding:0,margin:5,cls:"popupAlertUser",html:'<table border="0" width="100%"><tr><td><div class="iconRight" style="margin:4px;float:left"></div><div style="margin:4px;float:left">Changes have been updated successfully.</div><div class="iconClosePopup" style="float:right;margin:4px"></div><td></tr></table>',}]});
var c=Ext.Element.getViewportWidth();a.showAt(c-410,85);Ext.select(".iconClosePopup").on("click",function(){a.destroy();},this);var b=new Ext.util.DelayedTask(function(){a.destroy();});b.delay(2000);}},showEmptyDataText:function(){if(Ext.getCmp("resultCt")==null||Ext.getCmp("resultCt")==undefined){var a=Ext.create("Ext.container.Container",{floatable:true,floating:true,id:"resultCt",width:380,items:[{xtype:"component",padding:0,margin:5,cls:"popupAlertUser",html:'<table border="0" width="100%"><tr><td><div class="iconInfo" style="margin:2px 4px 0px 4px;float:left"></div><div style="margin:4px;float:left">No items found for the selected criteria.</div><div class="iconClosePopup" style="float:right;margin:4px"></div><td></tr></table>',}]});
var c=Ext.Element.getViewportWidth();a.showAt(c-410,85);Ext.select(".iconClosePopup").on("click",function(){a.destroy();},this);var b=new Ext.util.DelayedTask(function(){a.destroy();});b.delay(2000);}},setFilterValues:function(d){var h=userMailJSON["hiddenFields"];var j=Ext.getCmp("hiddenFieldsContainer");
var g=Ext.getCmp("exclude");var i=new Array();var b=new Array();var a=g.fromField.store;var l=g.toField.store;for(var m=0;m<a.getCount();m++){var c=a.getAt(m).get("valueField");b.push(c);}for(var m=0;m<l.getCount();m++){var c=l.getAt(m).get("valueField");i.push(c);}if(userMailJSON["excludedBoxHostVal"]&&userMailJSON["excludedBoxHostVal"]!=undefined){var k=userMailJSON["excludedBoxHostVal"];
if(k!=null&&k!=""){b[b.length]=k;}}if(mailFilterOption=="Descriptors_Only"){var o={xtype:"hiddenfield",name:"excludedBoxVal",value:i};var f={xtype:"hiddenfield",name:"includedBoxVal",value:b};var n={xtype:"hiddenfield",name:"control",value:d};}else{var o={xtype:"hiddenfield",name:"includedBoxVal",value:i};
var f={xtype:"hiddenfield",name:"excludedBoxVal",value:b};var n={xtype:"hiddenfield",name:"control",value:d};}j.removeAll();j.add(o);j.add(f);j.add(n);var e={xtype:"hiddenfield",name:"previousExcVal",value:h.previousExcVal};j.add(e);},setHiddenFiledsForFilters:function(c,b){var a=Ext.getCmp("hiddenFieldsContainer");
for(key in c){if(key=="vsTypes"){continue;}var d=c[key];a.add({xtype:"hiddenfield",name:key,value:d});}a.add({xtype:"hiddenfield",name:"compNames",value:b});},associateValue:function(m){var e=userElementJSON["hiddenFields"];var b=Ext.getCmp("elementassociationform");var d=Ext.getCmp("elementsHiddenContainer");
d.removeAll();var j=Ext.getCmp("associate");var n=Ext.getCmp("otherHosts");var o=new Array();var c=n.fromField.store;for(var f=0;f<c.getCount();f++){var g=c.getAt(f).get("valueField");o.push(parent.filterEncode(g));}d.add({xtype:"hiddenfield",name:"majorType",value:j.getValue()});var a={xtype:"hiddenfield",name:"chosenHosts",value:o};
var q={xtype:"hiddenfield",name:"action",value:m};var k={xtype:"hiddenfield",name:"finalOperation",value:"added"};if(!Ext.isEmpty(e.previousSelectedValue)){var s={xtype:"hiddenfield",name:"previousSelectedValue",value:e.previousSelectedValue};d.add(s);}var s={xtype:"hiddenfield",name:"previousVMs",value:parent.filterEncode(e.previousVMs)};
d.add(s);var s={xtype:"hiddenfield",name:"previouscomponents",value:e.previouscomponents};d.add(s);var s={xtype:"hiddenfield",name:"previoussegments",value:e.previoussegments};d.add(s);var s={xtype:"hiddenfield",name:"previousservicegroup",value:e.previousservicegroup};d.add(s);var s={xtype:"hiddenfield",name:"previousservices",value:e.previousservices};
d.add(s);var s={xtype:"hiddenfield",name:"previouszones",value:e.previouszones};d.add(s);var s={xtype:"hiddenfield",name:"previousextagts",value:e.previousextagts};d.add(s);var s={xtype:"hiddenfield",name:"previousremagts",value:e.previousremagts};d.add(s);d.add(a);d.add(q);d.add(k);var r=j.getValue();
if(!(r=="Segment")||(r=="Service")){if(r=="Zone"){var l=new Array();for(var p=0;p<c.getCount();p++){var g=c.getAt(p).get("valueField");l[p]=",Zone:"+parent.filterEncode(g);}var h={xtype:"hiddenfield",name:"permanentAssociation",value:l};d.add(h);}else{var h={xtype:"hiddenfield",name:"permanentAssociation",value:parent.filterEncode(Ext.getCmp("compType").getValue())};
d.add(h);}}},getServerDetails:function(l){try{var y=Ext.getCmp("patternContainer");if(!Ext.isEmpty(y)&&!y.hidden){y.hide();}}catch(u){}var i=Ext.getCmp("utype").getValue();var x=this;updateSettings=false;var s=l.getValue();var m=Ext.getCmp("associate").getValue();var a="";if(!isEnterpriseModel){var r=userElementJSON.shareNickAcrossOU!=null&&userElementJSON.shareNickAcrossOU!=undefined&&userElementJSON.shareNickAcrossOU;
var b=userElementJSON.superOrgName;if(r||(!Ext.isEmpty(b)&&b.toLowerCase()=="egenterprise")){a=Ext.getCmp("orgType").getValue();}}var d="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?getVmSelect=true&showAssociatedData=yes&qctr=1&selectedTab=3&assousers="+encodeURIComponent(associatedUserIDs)+"&orgName="+encodeURIComponent(parent.filterEncode(a))+"&username="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+i+"&associate="+encodeURIComponent(m)+"&compType="+encodeURIComponent(s)+"&date="+new Date().getTime();
x.updateUserElementPage(d);var p=Ext.getCmp("otherHosts");var h=userElementJSON["toTitle"];var w=userElementJSON["fromTitle"];p.fromField.getComponent(0).setTitle(h);p.toField.getComponent(0).setTitle(w);var z=userElementJSON["associatedItems"];var g=userElementJSON["disAssociatedItems"];p.getStore().removeAll();
if(p.fromField.store.getCount()>0){p.fromField.store.removeAll();}if(p.toField.store.getCount()>0){p.toField.store.removeAll();}if(!Ext.isEmpty(z)){p.fromField.store.add(z);}if(!Ext.isEmpty(g)){p.toField.store.add(g);}if(userElementJSON.isAutoAssociated==true){Ext.getCmp("compAssociation").setValue(true);
}else{Ext.getCmp("compAssociation").setValue(false);}if(userElementJSON.isVMType==true){var v=Ext.getCmp("virtualTypes");var k=Ext.getCmp("virtualServersContainer");v.show();k.show();v.setFieldLabel(userElementJSON.vmTitle1);Ext.getCmp("vmTypeLabel").setText(userElementJSON.vmTitle2);v.getStore().loadRawData(userElementJSON.virtualTypes);
Ext.getCmp("compAssociation").boxLabelEl.update(userElementJSON.autoVMs);Ext.getCmp("vmSelection").show();Ext.getCmp("selectorFieldContainer").hide();var c=userElementJSON.virtualTypes[0].valueField;var q=userElementJSON.vm_selection_hash;var f="";var o="";var j="";for(var n in q){if(n.indexOf("_vm")>-1){j=q[n];
}else{f=n;o=q[n];}}if(f!=undefined&&f!=null&&f.trim().length>0){v.setValue(f);this.callServerType(v,"true",o);}else{if(c!=undefined&&c!=null&&c.trim().length>0){v.setValue(c);this.callServerType(v,"true");}else{v.setValue("-1");}}}else{Ext.getCmp("compAssociation").boxLabelEl.update(userElementJSON.autoComp);
Ext.getCmp("virtualTypes").hide();Ext.getCmp("virtualServersContainer").hide();Ext.getCmp("vmSelection").hide();Ext.getCmp("selectorFieldContainer").show();}},associateServerType:function(e){if(e.getValue()==true){var d=Ext.getCmp("otherHosts");var c=d.toField.store;var b=d.fromField.store;for(var f=0;
f<c.getCount();f++){var a=c.getAt(f);d.fromField.store.add(a);}d.toField.store.removeAll();}},organizationOnChange:function(){var e=this;var h=Ext.getCmp("orgType").getValue();var b=Ext.getCmp("utype").getValue();var d=Ext.getCmp("associate").getValue();updateSettings=false;var a="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?qctr=1&selectedTab=3&assousers="+encodeURIComponent(associatedUserIDs)+"&orgName="+encodeURIComponent(parent.filterEncode(h))+"&username="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+b+"&associate="+encodeURIComponent(d)+"&date="+new Date().getTime();
e.updateUserElementPage(a);var c=userElementJSON.associations;var g=Ext.getCmp("associate");g.getStore().loadRawData(c);g.setValue("-1");var f=Ext.getCmp("otherHosts");if(f.fromField.store.getCount()>0){f.fromField.store.removeAll();}if(f.toField.store.getCount()>0){f.toField.store.removeAll();}this.setLangEntries(userElementJSON.langEntries);
Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();Ext.getCmp("virtualTypes").hide();Ext.getCmp("virtualServersContainer").hide();Ext.getCmp("vmSelection").hide();Ext.getCmp("patternContainer").hide();},associateOnChange:function(l){try{var u=Ext.getCmp("patternContainer");if(!Ext.isEmpty(u)&&!u.hidden){u.hide();
}}catch(p){}var t=this;var a="";if(!isEnterpriseModel){var o=userElementJSON.shareNickAcrossOU!=null&&userElementJSON.shareNickAcrossOU!=undefined&&userElementJSON.shareNickAcrossOU;var b=userElementJSON.superOrgName;if(o||(!Ext.isEmpty(b)&&b.toLowerCase()=="egenterprise")){a=Ext.getCmp("orgType").getValue();
if(a!=null&&a!=undefined&&a.length>0){if(a==-1){Ext.Msg.alert(pageTitle,userIDValidationMsg74);Ext.getCmp("orgType").focus(true);return;}}}}var d="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?qctr=1&selectedTab=3&assousers="+encodeURIComponent(associatedUserIDs)+"&orgName="+encodeURIComponent(parent.filterEncode(a))+"&username="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+j+"&associate="+encodeURIComponent(m)+"&date="+new Date().getTime();
updateSettings=false;var m=l.getValue();Ext.getCmp("virtualTypes").hide();Ext.getCmp("virtualServersContainer").hide();Ext.getCmp("vmSelection").hide();if(m=="-1"){var n=Ext.getCmp("otherHosts");Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();n.getStore().removeAll();if(n.fromField.store.getCount()>0){n.fromField.store.removeAll();
}if(n.toField.store.getCount()>0){n.toField.store.removeAll();}}else{var j=Ext.getCmp("utype").getValue();var d="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?showAssociatedData=yes&qctr=1&selectedTab=3&assousers="+encodeURIComponent(associatedUserIDs)+"&orgName="+encodeURIComponent(parent.filterEncode(a))+"&username="+encodeURIComponent(selectedUserID)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+j+"&associate="+encodeURIComponent(m)+"&date="+new Date().getTime();
t.updateUserElementPage(d);var v=userElementJSON["associatedItems"];var g=userElementJSON["disAssociatedItems"];var i=userElementJSON["toTitle"];var r=userElementJSON["fromTitle"];var n=Ext.getCmp("otherHosts");n.fromField.getComponent(0).setTitle(i);n.toField.getComponent(0).setTitle(r);if(m=="Independent servers"){var s=Ext.getCmp("compType");
var h=Ext.getCmp("compAssociation");s.getStore().loadRawData(userElementJSON["componentTypes"]);s.setValue(s.getStore().getAt(0).get("valueField"));s.show();n.getStore().removeAll();if(n.fromField.store.getCount()>0){n.fromField.store.removeAll();}if(n.toField.store.getCount()>0){n.toField.store.removeAll();
}if(!Ext.isEmpty(v)){n.fromField.store.add(v);}if(!Ext.isEmpty(g)){n.toField.store.add(g);}if(userElementJSON.isAutoAssociated==true){Ext.getCmp("compAssociation").setValue(true);}else{Ext.getCmp("compAssociation").setValue(false);}var q=userElementJSON["isVMType"];if(q==true){var f=userElementJSON["vmTitle1"];
var c=userElementJSON["vmTitle2"];Ext.getCmp("virtualTypes").setFieldLabel(f);Ext.getCmp("vmTypeLabel").setText(c);Ext.getCmp("virtualTypes").show();Ext.getCmp("virtualServersContainer").show();var k=userElementJSON["virtualTypes"];Ext.getCmp("virtualTypes").getStore().loadRawData(k);Ext.getCmp("vmSelection").show();
}t.getServerDetails(s);}else{if(m=="Segment"){Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();n.getStore().removeAll();if(n.fromField.store.getCount()>0){n.fromField.store.removeAll();}if(n.toField.store.getCount()>0){n.toField.store.removeAll();}if(!Ext.isEmpty(v)){n.fromField.store.add(v);
}if(!Ext.isEmpty(g)){n.toField.store.add(g);}if(Ext.isEmpty(v)&&Ext.isEmpty(g)){t.showEmptyDataText();}Ext.getCmp("selectorFieldContainer").show();}else{if(m=="Zone"){Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();n.getStore().removeAll();if(n.fromField.store.getCount()>0){n.fromField.store.removeAll();
}if(n.toField.store.getCount()>0){n.toField.store.removeAll();}if(!Ext.isEmpty(v)){n.fromField.store.add(v);}if(!Ext.isEmpty(g)){n.toField.store.add(g);}if(Ext.isEmpty(v)&&Ext.isEmpty(g)){t.showEmptyDataText();}Ext.getCmp("selectorFieldContainer").show();}else{if(m=="Service"){Ext.getCmp("compType").hide();
Ext.getCmp("compAssociation").hide();n.getStore().removeAll();if(n.fromField.store.getCount()>0){n.fromField.store.removeAll();}if(n.toField.store.getCount()>0){n.toField.store.removeAll();}if(!Ext.isEmpty(v)){n.fromField.store.add(v);}if(!Ext.isEmpty(g)){n.toField.store.add(g);}if(Ext.isEmpty(v)&&Ext.isEmpty(g)){t.showEmptyDataText();
}Ext.getCmp("selectorFieldContainer").show();}else{if(m=="ServiceGroup"){Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();n.getStore().removeAll();if(n.fromField.store.getCount()>0){n.fromField.store.removeAll();}if(n.toField.store.getCount()>0){n.toField.store.removeAll();}if(!Ext.isEmpty(v)){n.fromField.store.add(v);
}if(!Ext.isEmpty(g)){n.toField.store.add(g);}if(Ext.isEmpty(v)&&Ext.isEmpty(g)){t.showEmptyDataText();}Ext.getCmp("selectorFieldContainer").show();}else{if(m=="ExternalAgent"||m=="RemoteAgent"){Ext.getCmp("compType").hide();Ext.getCmp("compAssociation").hide();n.getStore().removeAll();if(n.fromField.store.getCount()>0){n.fromField.store.removeAll();
}if(n.toField.store.getCount()>0){n.toField.store.removeAll();}if(!Ext.isEmpty(v)){n.fromField.store.add(v);}if(!Ext.isEmpty(g)){n.toField.store.add(g);}if(Ext.isEmpty(v)&&Ext.isEmpty(g)){t.showEmptyDataText();}Ext.getCmp("selectorFieldContainer").show();}}}}}}}},uploadUsrImage:function(){var i=this;
var l="gif/jpg/jpeg/png";var h=false;var c=Ext.getCmp("FILE_0");var e=c.getValue();var f=e.substring((e.lastIndexOf("."))+1,e.length);if(!validateSingleByte(c.getValue())){Ext.Msg.alert(pageTitle,userIDValidationMsg62);return false;}if(f.toLowerCase()!="gif"&&f.toLowerCase()!="jpg"&&f.toLowerCase()!="jpeg"&&f.toLowerCase()!="png"){Ext.Msg.alert(pageTitle,userIDValidationMsg63+": '"+l+"'");
return false;}var b="FILE_0_dstFile";var k=filePath;k=k.replace(".gif","."+f);var g=Ext.getCmp("hiddenFieldsContainer");g.removeAll();var d={xtype:"hiddenfield",name:"FILE_0_dstFile",value:k};g.add(d);var i=this;var a=new Ext.LoadMask(Ext.getBody(),{msg:"Uploading..."});a.show();var j=this.getFileupload().getForm();
fileUploadURI=fileUploadURI.replace("fileExt=gif","fileExt="+f);if(j.isValid()){this.getFileupload().submit({url:fileUploadURI,method:"POST",timeout:1200,success:function(m,n){Ext.Msg.show({title:pageTitle,msg:pageIntnl100+".",buttons:Ext.Msg.OK,width:400,icon:"iconInformation"});a.hide();i.updateImageStatus();
Ext.getCmp("fileUpLoader").destroy();},failure:function(m,n){a.hide();Ext.getCmp("fileUpLoader").destroy();}});}},updateImageStatus:function(){var a=Ext.getCmp("fileUpLoader");if(a.getCurrentUploaderInfo()=="login"){isLoginImgUpdated=true;}else{if(a.getCurrentUploaderInfo()=="monitor"){isAdminMonImgUpdated=true;
}else{if(a.getCurrentUploaderInfo()=="reporter"){isRepImgUpdated=true;}else{if(a.getCurrentUploaderInfo()=="config"){isConfigImgUpdated=true;}}}}},monitorLogoController:function(c){var b=c.getValue();var a=Ext.getCmp("monitorLogoIMG");if(b=="show"){a.show();}else{a.hide();}},loginLogoController:function(c){var b=c.getValue();
var a=Ext.getCmp("loginLogoIMG");if(b=="show"){a.show();}else{a.hide();}},repLogoController:function(c){var b=c.getValue();var a=Ext.getCmp("reporterLogoIMG");if(b=="show"){a.show();}else{a.hide();}},configLogoController:function(c){var b=c.getValue();var a=Ext.getCmp("configLogoIMG");if(b=="show"){a.show();
}else{a.hide();}},loadMailShiftAlerts:function(g){var n=/^(\+\d\d)?[0-9]+$/g;var f=g.getValue().mailshift;if(f=="yes"){var k=true;var l=Ext.getCmp("tomailid").getValue();var j=Ext.getCmp("ccmailid").getValue();var i=Ext.getCmp("bccmailid").getValue();var h=Ext.getCmp("escmailid").getValue();var d=validateEmail(l);
var e=validateEmail(j);var m=validateEmail(i);var c=validateEmail(h);if(l==""&&i==""&&j==""){k=false;}if((l!=""&&d==false)||(i!=""&&m==false)||(j!=""&&e==false)){var b=validateMailID(l);var a=validateMailID(i);var o=validateMailID(j);if(!b&&!a&&!o){k=false;}}if(!k){Ext.Msg.alert(pageTitle,userIDValidationMsg23);
Ext.getCmp("emailAlert_1").setValue(true);return false;}Ext.getCmp("emailMailAlert").show();Ext.getCmp("userpref").body.scroll("bottom",g.getBox().y-200);}else{Ext.getCmp("emailMailAlert").hide();Ext.getCmp("userpref").body.scroll("bottom",g.getBox().y-200);}},loadCommandShiftAlerts:function(c){var b=c.getValue().Execshift;
if(b=="yes"){var a=Ext.getCmp("customScript");if(a.getValue()==null||a.getValue()==""){Ext.Msg.alert(pageTitle,userIDValidationMsg40);Ext.getCmp("shiftAlert_1").setValue(true);return false;}else{if(!checkspecial(a.getValue(),"@*+=[]|;\"'<>?~`")){a.focus(true);Ext.getCmp("shiftAlert_1").setValue(true);
return false;}}Ext.getCmp("commandAlert").show();Ext.getCmp("userpref").body.scroll("bottom",c.getBox().y-200);}else{Ext.getCmp("commandAlert").hide();Ext.getCmp("userpref").body.scroll("bottom",c.getBox().y-200);}},loadSMSShiftAlerts:function(e){var m=/^(\+\d\d)?[0-9]+$/g;var d=e.getValue().smsshift;
if(d=="yes"){var l=true;var j=Ext.getCmp("tomailid").getValue();var h=Ext.getCmp("ccmailid").getValue();var g=Ext.getCmp("bccmailid").getValue();var f=Ext.getCmp("escmailid").getValue();var n=(j).match(m);var i=(h).match(m);var c=(g).match(m);var k=(f).match(m);if(j==""&&g==""&&h==""){l=false;}if((j!=""&&n!=j)||(g!=""&&c!=g)||(h!=""&&i!=h)){var b=validateMobileNo(j);
var a=validateMobileNo(g);var o=validateMobileNo(h);if(!b&&!a&&!o){l=false;}}if(!l){Ext.Msg.alert(pageTitle,userIDValidationMsg26);Ext.getCmp("smsAlert_1").setValue(true);return false;}Ext.getCmp("smsAlert").show();Ext.getCmp("userpref").body.scroll("bottom",e.getBox().y-200);}else{Ext.getCmp("smsAlert").hide();
Ext.getCmp("userpref").body.scroll("bottom",e.getBox().y-200);}},loadESCShiftAlerts:function(f){var h=/^(\+\d\d)?[0-9]+$/g;var b=/(((([\+]?([0-9]){4,15})|([\_\#]?([a-zA-Z0-9]+[\ \_\.\-\&\#]?)*[a-zA-Z0-9])+)\@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])|((\+\d\d)?[0-9]+))/g;var e=f.getValue().escshift;
if(e=="yes"){var c=Ext.getCmp("escmailid").getValue();var d=Ext.getCmp("escshiftNo");var a=validateEmail(c);var g=(c).match(h);var i=(c).match(b);if(c!=null&&c==""&&!checkmultiplemailid(c)){Ext.Msg.alert(pageTitle,userIDValidationMsg28);Ext.getCmp("escAlert_1").setValue(true);return false;}if((c!="")&&(a==null||a==false)&&g==null&&i!=c){Ext.Msg.alert(pageTitle,userIDValidationMsg22,function(j){Ext.getCmp("escmailid").focus(true);
});Ext.getCmp("escAlert_1").setValue(true);return false;}Ext.getCmp("escMailAlert").show();Ext.getCmp("userpref").body.scroll("bottom",f.getBox().y-200);}else{Ext.getCmp("escMailAlert").hide();Ext.getCmp("userpref").body.scroll("bottom",f.getBox().y-200);}},eGRemoteExecution:function(b){var a=b.getValue().remotecontrol;
if(a=="true"){Ext.getCmp("execcommands").show();Ext.getCmp("userpref").body.scroll("bottom",b.getBox().y);}else{Ext.getCmp("execcommands").hide();Ext.getCmp("userpref").body.scroll("bottom",b.getBox().y);}},configureMailAlert:function(a){if(a==true){Ext.getCmp("high").setValue(true);Ext.getCmp("medium").setValue(true);
Ext.getCmp("low").setValue(true);Ext.getCmp("frmAlarmContainer").show();}else{Ext.getCmp("high").setValue(false);Ext.getCmp("medium").setValue(false);Ext.getCmp("low").setValue(false);Ext.getCmp("frmAlarmContainer").hide();}},showalarmRet:function(i,h,c,d){var f=Ext.getCmp("high").getValue();var b=Ext.getCmp("medium").getValue();
var a=Ext.getCmp("low").getValue();if(f==true||b==true||a==true){Ext.getCmp("frmAlarmContainer").show();if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no"){Ext.getCmp("customScript").hide();Ext.getCmp("Execshift").hide();}}else{Ext.getCmp("frmAlarmContainer").hide();}try{Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("high").getBox().y-200);
}catch(g){}},logoConfiguration:function(g,f,b,c){var e=Ext.getCmp("imgRepPage");var d=Ext.getCmp("imgConfigPage");var a=publicJSON["isConfigSupported"];if(g.getValue()==true){e.hide();d.hide();}else{if(a==true){e.show();d.show();}else{e.show();}}},onOrganizationChange:function(c){var b=c.getValue();var a=Ext.getCmp("uname").getValue();
if(!Ext.isEmpty(b)&&b!="-1"){var d=publicJSON["organizationValue"];if(!Ext.isEmpty(d)&&d.toLowerCase()!=b.toLowerCase()){Ext.Msg.show({title:pageTitle5,msg:orgChangePrompt,buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(e){if(e=="yes"){appCnt.orgChangeFunction(Ext.getCmp("org"));}else{Ext.getCmp("org").setValue(d);
return false;}}});}else{appCnt.orgChangeFunction(Ext.getCmp("org"));}}else{Ext.Msg.alert(pageTitle,userIDValidationMsg74,function(e){if(e=="ok"){appCnt.onUserIDChange(Ext.getCmp("uname"));Ext.getCmp("org").focus(true);}});Ext.getCmp("userformcontainer").setActiveTab(0);return false;}},orgChangeFunction:function(e){var d=e.getValue();
var a=Ext.getCmp("uname").getValue();var b=Ext.getCmp("userStatus").getValue();var c="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?";Ext.Ajax.request({url:c,method:"POST",timeout:120000,params:"selectedTab=1&qctr=1&username="+encodeURIComponent(a)+"&org="+encodeURIComponent(parent.filterEncode(d))+"&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(b),success:function(h){var l=Ext.decode(h.responseText);
Ext.getCmp("utype").getStore().loadRawData(l["userRolesArr"]);if(l.requestStatus=="failed"){Ext.Msg.show({title:l.errors.title,msg:l.errors.message1+". "+l.errors.message2+".",width:500,buttons:Ext.Msg.OK,icon:"iconError",fn:function(n){if(n=="ok"){appCnt.onUserIDChange(Ext.getCmp("uname"));Ext.getCmp("org").focus(true);
}}});return false;}else{var f=e.getStore().getNodeById(d);var m=f.raw.uvalidtill;Ext.getCmp("tilldate").setValue("");Ext.getCmp("tmptilldate").setValue("");Ext.getCmp("Never").setValue("");if(m!=null&&m!="12/12/9999"){Ext.getCmp("tmptilldate").setValue(m);var k=Ext.getCmp("tmptilldate").getValue();var i=Ext.Date.dateFormat(k,mgrDateFormat);
if(i!=null&&i.length>0){Ext.getCmp("tilldate_h").setValue(i);var g=i+" 23:59:59";Ext.getCmp("tilldate").setValue(g);}Ext.getCmp("tmptilldate").setMaxValue(m);Ext.getCmp("Never").setDisabled(true);Ext.getCmp("Never").setValue(false);}else{Ext.getCmp("tmptilldate").setMaxValue("12/12/9999");Ext.getCmp("Never").setDisabled(false);
Ext.getCmp("Never").setValue(true);}var j=publicJSON["userModel"];Ext.getCmp("utype").getStore().clearFilter();if(!Ext.isEmpty(j)&&j=="Organization"){Ext.getCmp("org").hide();Ext.getCmp("selectedServerListGrid").hide();Ext.getCmp("utype").setValue("none");Ext.getCmp("utype").getStore().filter("isShareRole",true);
}else{if(!Ext.isEmpty(j)&&j=="SubOrganization"){Ext.getCmp("org").show();Ext.getCmp("selectedServerListGrid").show();Ext.getCmp("utype").setValue("none");Ext.getCmp("utype").getStore().filter("isShareRole",true);}else{Ext.getCmp("org").show();Ext.getCmp("selectedServerListGrid").show();if(d.toLowerCase()=="egenterprise"){Ext.getCmp("utype").setValue("none");
}else{Ext.getCmp("utype").setValue("none");Ext.getCmp("utype").getStore().filter("hasallcompaccess",false);}}}}},failure:function(f){}});},userTypeOnChange:function(e){if(e.getValue()!="-1"&&e.getValue()!="none"){var c=this;var a=Ext.getCmp("uname").getValue();var b=Ext.getCmp("userStatus").getValue();
uTypeChange=true;updateSettings=true;var d="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?selectedTab=1&qctr=1&usertype="+encodeURIComponent(e.getValue())+"&username="+encodeURIComponent(a)+"&reqfrom="+reqFrom+"&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(b);Ext.Ajax.request({url:d,method:"POST",timeout:120000,success:function(f){var g=f.responseText;
publicJSON=Ext.decode(g);c.loadUserProfileControls(false,"usertypeCombo");},failure:function(){}});}},onUserIDChange:function(f){var h=this;var k=Ext.getCmp("fieldsContainer");var i=f.getValue();var a=Ext.getCmp("userStatus").getValue();var g=Ext.getCmp("userformcontainer");var b=Ext.getCmp("btnNext");
if(i=="none"||i=="-1"||i.toLowerCase()=="egenterprise"){g.child("#tab2").tab.setDisabled(true);var j=Ext.getCmp("elementFilteringTab");var e=Ext.getCmp("elementAssociationTab");e.removeAll();j.removeAll();g.child("#tab4").tab.hide();g.child("#tab3").tab.hide();b.setDisabled(true);g.child("#tab1").getForm().reset();
Ext.getCmp("changePwd").hide();Ext.getCmp("org").hide();Ext.getCmp("utype").getStore().removeAll();delete j;delete j;if(i.toLowerCase()=="egenterprise"){Ext.Msg.show({title:pageTitle2,msg:usrModWarn1+" "+i+" "+usrModWarn2+".",buttons:Ext.Msg.OK,icon:"iconExclamation"});}return false;}g.child("#tab2").tab.setDisabled(false);
b.setDisabled(false);delete b;delete g;selectedTab="1";var c=new Ext.LoadMask(Ext.getBody(),{msg:"Loading..."});c.show();var d="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?selectedTab=1&qctr=1&username="+encodeURIComponent(i)+"&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(a);
Ext.Ajax.request({url:d,method:"POST",timeout:120000,success:function(l){c.hide();var m=l.responseText;publicJSON=Ext.decode(m);h.hiddenParamsForAuditLog(publicJSON);f.setValue(i);h.loadUserProfileControls(false,"userCombo");},failure:function(){c.hide();}});},hiddenParamsForAuditLog:function(){var e=Array.prototype.slice.call(arguments);
var c=e.pop();if(!Ext.isEmpty(c)){var a=c.hiddenFields;if(!Ext.isEmpty(a)){var b=Ext.getCmp("auditsHiddenContainer");b.removeAll();for(key in a){var d=a[key];b.add({xtype:"hiddenfield",name:key,value:d});}}}},loadUserProfileControls:function(Z,M){inputs=0;mailShiftPeriodsCount=0;smsShiftPeriodsCount=0;
escShiftPeriodsCount=0;ExecShiftPeriodsCount=0;isAlarmEnabled=false;Ext.suspendLayouts();isFromMainPage=true;var a6=this;var bx=publicJSON["userStatus"];Ext.getCmp("userStatus").setValue(bx);var h=Ext.getCmp("fieldsContainer");Ext.getCmp("eGAuth").setValue(true);var aT=Ext.getCmp("loginLogo1");var au=Ext.getCmp("monitorLogo1");
var aH=Ext.getCmp("reporterLogo1");var ai=Ext.getCmp("configLogo1");var ba=Ext.getCmp("timeZone");var ab=Ext.getCmp("utype");var ay=Ext.getCmp("userDataFormat");var aD=Ext.getCmp("upass");var I=Ext.getCmp("confpasswd");var x=Ext.getCmp("domainName");var m=Ext.getCmp("idpName");var at=Ext.getCmp("timeOpt");
var y=publicJSON["utype"];var br=publicJSON["hasmonitoraccess"];var bv=publicJSON["hasallcompaccess"];var a0=publicJSON["authenticationType"];var o=publicJSON.isSAMLLoginEnabled;hideOrganization=publicJSON["hideOrganization"];var bu=Ext.getCmp("uname").getValue();selectedUserID=publicJSON[bu];if(a0=="Eg"){aD.setValue(publicJSON["changeObj"]);
I.setValue(publicJSON["changeObj"]);pass=aD.getValue();confPass=I.getValue();if(o){if(Ext.getCmp("userAuth").isHidden()){Ext.getCmp("eGAuthSAML").setValue(true);}else{Ext.getCmp("eGAuth").setValue(true);}}else{Ext.getCmp("eGAuth").setValue(true);}x.hide();Ext.getCmp("pasCont").show();aD.show();I.show();
m.hide();Ext.getCmp("changePwd").show();var aW=publicJSON["changePwd"];if(!Ext.isEmpty(aW)){if(aW=="true"){Ext.getCmp("changePwd").setValue(true);}else{Ext.getCmp("changePwd").setValue(false);}}}else{if(a0=="SAML"){Ext.getCmp("idpAuthSAML").setValue(true);m.getStore().loadRawData(publicJSON["ssoList"]);
m.setValue(publicJSON["selectedSso"]);m.show();aD.hide();Ext.getCmp("pasCont").hide();x.hide();I.hide();Ext.getCmp("changePwd").hide();}else{if(o){if(Ext.getCmp("userAuth").isHidden()){Ext.getCmp("domainAuthSAML").setValue(true);}else{Ext.getCmp("domainAuth").setValue(true);}}else{Ext.getCmp("domainAuth").setValue(true);
}x.getStore().loadRawData(publicJSON["domainsList"]);x.setValue(publicJSON["selectedDomain"]);aD.hide();Ext.getCmp("pasCont").hide();I.hide();x.show();m.hide();Ext.getCmp("changePwd").hide();}}var l=publicJSON["isDescEnabled"];if(l!=null&&l!=undefined&&(l=="yes"||l=="true")){Ext.getCmp("description").setValue(publicJSON["description"]);
Ext.getCmp("description").show();}ab.getStore().loadRawData(publicJSON["userRolesArr"]);if(hideOrganization==true){Ext.getCmp("org").hide();Ext.getCmp("Never").setDisabled(false);Ext.getCmp("utype").getStore().clearFilter();Ext.getCmp("utype").getStore().filter("isShareRole",true);}else{Ext.getCmp("org").show();
var P={text:"Choose Organization / Organizational Unit",id:"-1",name:"-1",expanded:true,children:publicJSON["organization"]};Ext.getCmp("org").getStore().setRootNode(P);if(M!="usertypeCombo"){Ext.getCmp("org").setValue(publicJSON["organizationValue"]);}var bg=Ext.getCmp("org").getStore().getNodeById(Ext.getCmp("org").getValue());
if(publicJSON["userModel"]=="SubOrganization"){Ext.getCmp("org").setDisabled(true);Ext.getCmp("utype").getStore().clearFilter();Ext.getCmp("utype").getStore().filter("isShareRole",true);}else{Ext.getCmp("org").setDisabled(false);var ap=Ext.getCmp("org").getValue();Ext.getCmp("utype").getStore().clearFilter();
if(!Ext.isEmpty(ap)&&ap.toLowerCase()=="egenterprise"){}else{Ext.getCmp("utype").getStore().filter("hasallcompaccess",false);}}var ap=Ext.getCmp("org").getValue();}if(M!="usertypeCombo"){if(publicJSON["userModel"]!="Organization"){var bg=Ext.getCmp("org").getStore().getNodeById(Ext.getCmp("org").getValue());
var af=bg.raw.uvalidtill;if(af!=null&&af!="12/12/9999"){Ext.getCmp("tmptilldate").setMaxValue(af);Ext.getCmp("Never").setDisabled(true);}else{Ext.getCmp("tmptilldate").setMaxValue("12/12/9999");Ext.getCmp("Never").setDisabled(false);}Ext.getCmp("tmptilldate").setValue("");Ext.getCmp("tilldate").setValue("");
Ext.getCmp("Never").setValue("");}else{Ext.getCmp("tmptilldate").setMaxValue("12/12/9999");Ext.getCmp("Never").setDisabled(false);Ext.getCmp("tmptilldate").setValue("");Ext.getCmp("tilldate").setValue("");Ext.getCmp("Never").setValue("");}}var a8=Ext.getCmp("tmptilldate");currExpDate=a8;var bc=Ext.getCmp("Never");
var d=publicJSON["validtill"];if(M!="usertypeCombo"){if(d=="Never"){bc.setValue(true);a8.setDisabled(true);}else{a8.setDisabled(false);bc.setValue(false);a8.setValue(publicJSON["validtill_h_pre"]);Ext.getCmp("tilldate").setValue(d);Ext.getCmp("tilldate_h").setValue(publicJSON["validtill_h_pre"]);}}ba.getStore().loadRawData(publicJSON["timeZone"]);
ay.getStore().loadRawData(publicJSON["userDataFormat"]);ba.setValue(publicJSON["selectedTimeZone"]);ay.setValue(publicJSON["selectedDateFormat"]);ab.setValue(y);var aw=publicJSON["mailAlertSettings"];var aI=aw["mailSenders"];var f=aw["selectedMailSender"];var aA=Ext.getCmp("mailSenders");aA.getStore().loadRawData(aI);
if(!Ext.isEmpty(f)&&f!=undefined){aA.setValue(f);}else{aA.setValue(aA.getStore().getAt(0).get("valueField"));}var bn=Ext.getCmp("tomailid");var bl=Ext.getCmp("ccmailid");var N=Ext.getCmp("bccmailid");bn.setValue(aw["tomailid"]);bl.setValue(aw["ccmailid"]);N.setValue(aw["bccmailid"]);if(br==true){var K=Ext.getCmp("monitorHomePage");
var J=publicJSON["monitorHomePageSelection"];var aG=Ext.getCmp("userProf_monitorHomeOpt");if(!Ext.isEmpty(aG)){aG.suspendEvents(false);aG.setValue({selectedMonHomeOpt:J});aG.resumeEvents();aG.on("change",function(){var k=aG.getChecked();var i=k[0].inputValue;if(i!=null&&i=="dynamic"){K.getStore().removeAll();
K.getStore().loadRawData(publicJSON["monitoringDomains"]);K.setValue(publicJSON["selectedMonitorDomain"]);}else{K.getStore().removeAll();K.getStore().loadRawData(publicJSON["monhomearray"]);K.setValue(publicJSON["monHomePage"]);}});}if(J!=null&&J=="dynamic"){K.getStore().removeAll();K.getStore().loadRawData(publicJSON["monitoringDomains"]);
K.setValue(publicJSON["selectedMonitorDomain"]);}else{K.getStore().removeAll();K.getStore().loadRawData(publicJSON["monhomearray"]);K.setValue(publicJSON["monHomePage"]);}Ext.getCmp("monitorFieldsContainer").show();Ext.getCmp("mailsmsalerts").show();var bq=Ext.getCmp("measure_in_mail_mode");var bm=Ext.getCmp("alarm_h");
var bh=Ext.getCmp("alarm_m");var bi=Ext.getCmp("alarm_l");var ac=publicJSON["remoteEnabled"];var aR=publicJSON["td"];var aS=publicJSON["alarm_h"];var aN=publicJSON["alarm_m"];var aP=publicJSON["alarm_l"];var A=Ext.getCmp("high");var aB=Ext.getCmp("medium");var p=Ext.getCmp("low");var aw=publicJSON["mailAlertSettings"];
var a2=aw["isShiftPeriodsEnabled"];var Y=aw["high"];var ao=aw["medium"];var aJ=aw["low"];var aF=aw["hasAlramList"];if(M=="usertypeCombo"){var aj=publicJSON["mailAlertSettings"]["measure_in_mail_mode"];var W=publicJSON["mailAlertSettings"]["selectedMailMode"];bq.getStore().loadRawData(aj);bq.setValue(W);
}var ax=Ext.getCmp("mail_filter_optionGrp");if(publicJSON.isFilterControlEnabled==true){ax.show();mailFilterOption=publicJSON.filterControlDefaultSelection;if(mailFilterOption=="Descriptors_Only"){Ext.getCmp("mail_filter_option2").setValue(true);}else{Ext.getCmp("mail_filter_option1").setValue(true);
}}else{ax.hide();}bq.getStore().loadRawData(publicJSON["mailAlertSettings"]["measure_in_mail_mode"]);bq.setValue(publicJSON["mailAlertSettings"]["selectedMailMode"]);if(aF==true){isAlarmEnabled=true;var a3=Ext.getCmp("customScript");var O=Ext.getCmp("escmailid");a3.setValue(aw["customScript"]);if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no"){a3.hide();
Ext.getCmp("Execshift").hide();}if(Y=="checked"){A.setValue(true);}else{A.setValue(false);}if(ao=="checked"){aB.setValue(true);}else{aB.setValue(false);}if(aJ=="checked"){p.setValue(true);}else{p.setValue(false);}var bp=aw["escmailid"];var t=aw["escmailids"];var bj=publicJSON["existLevel"];O.setValue(bp);
var n=Ext.getCmp("escMailIDsDiv");var a1=n.items.length;if(a1>1){var s=new Array();for(var al=0;al<a1;al++){var az=n.items.items[al];if(az==undefined||az.getId()=="staticEscContainer"){continue;}else{s.push(az);}}Ext.suspendLayouts();for(var ak=0;ak<s.length;ak++){n.remove(s[ak]);}Ext.resumeLayouts(true);
s=null;}if(!Ext.isEmpty(t)){for(var ae in t){addEscLevel(t[ae]);}}var a9=aw["notify"];var aX=aw["msgmode"];var aE=aw["dd_in_mail_mode"];if(a9.toLowerCase()=="new"){Ext.getCmp("alarmNotifyNew").setValue(true);}else{Ext.getCmp("alarmNotifyComplete").setValue(true);}if(aX.toLowerCase()=="html"){Ext.getCmp("alarmMsgHtml").setValue(true);
}else{Ext.getCmp("alarmMsgText").setValue(true);}if(aE==true){Ext.getCmp("ddMailYes").setValue(true);}else{Ext.getCmp("ddMailNo").setValue(true);}if(a2==true){a6.getShifPeroidsCt().show();var c=aw["mailshift"];var ag=aw["Execshift"];var e=aw["smsshift"];var bt=aw["escshift"];var j=aw["mailList"];var v=aw["ExeComList"];
var bw=aw["SmsList"];var X=aw["EscList"];var aZ=Ext.getCmp("emailMailAlert");var bo=Ext.getCmp("emailAlert_0");var q=aZ.items.length;if(q>1){var s=new Array();for(var al=0;al<q;al++){var az=aZ.items.items[al];if(az==undefined||az.getId()=="staticMailContainer"){continue;}else{s.push(az);}}Ext.suspendLayouts();
for(var ak=0;ak<s.length;ak++){aZ.remove(s[ak]);}Ext.resumeLayouts(true);s=null;}if(c=="Yes"){bo.setValue(true);aZ.show();var ad=0;for(var aK in j){var az=j[aK];var D=az["mailday"+ad];var r=az["mailshift"+ad];if(parseInt(ad)==0){Ext.getCmp("mailday0").setValue(D);Ext.getCmp("mailshift0").setValue(r);
}else{addMoreShifts("mail",D,r);}ad++;}}else{bo.setValue(false);aZ.hide();}var bf=Ext.getCmp("commandAlert");var L=Ext.getCmp("shiftAlert_0");var S=bf.items.length;if(S>1){var s=new Array();for(var al=0;al<S;al++){var az=bf.items.items[al];if(az==undefined||az.getId()=="staticCmdContainer"){continue;
}else{s.push(az);}}Ext.suspendLayouts();for(var ak=0;ak<s.length;ak++){bf.remove(s[ak]);}Ext.resumeLayouts(true);s=null;}if(ag=="Yes"){L.setValue(true);var ad=0;bf.show();for(var aK in v){var az=v[aK];var ar=az["Execday"+ad];var aL=az["ExecShift"+ad];if(parseInt(ad)==0){Ext.getCmp("Execday0").setValue(ar);
Ext.getCmp("Execshift0").setValue(aL);}else{addMoreShifts("Exec",ar,aL);}ad++;}}else{L.setValue(false);bf.hide();}if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no"){bf.hide();}var ah=Ext.getCmp("smsAlert");var z=Ext.getCmp("smsAlert_0");var Q=ah.items.length;if(Q>1){var s=new Array();
for(var al=0;al<Q;al++){var az=ah.items.items[al];if(az==undefined||az.getId()=="staticSMSContainer"){continue;}else{s.push(az);}}Ext.suspendLayouts();for(var ak=0;ak<s.length;ak++){ah.remove(s[ak]);}Ext.resumeLayouts(true);s=null;}if(e=="Yes"){z.setValue(true);var ad=0;ah.show();for(var aK in bw){var az=bw[aK];
var ar=az["smsday"+ad];var aL=az["smsShift"+ad];if(parseInt(ad)==0){Ext.getCmp("smsday0").setValue(ar);Ext.getCmp("smsshift0").setValue(aL);}else{addMoreShifts("sms",ar,aL);}ad++;}}else{z.setValue(false);ah.hide();}var aV=Ext.getCmp("escMailAlert");var aa=Ext.getCmp("escAlert_0");var an=aV.items.length;
if(an>1){var s=new Array();for(var al=0;al<an;al++){var az=aV.items.items[al];if(az==undefined||az.getId()=="staticESContainer"){continue;}else{s.push(az);}}Ext.suspendLayouts();for(var ak=0;ak<s.length;ak++){aV.remove(s[ak]);}Ext.resumeLayouts(true);s=null;}if(bt=="Yes"){aa.setValue(true);var ad=0;aV.show();
for(var aK in X){var az=X[aK];var ar=az["escday"+ad];var aL=az["escShift"+ad];if(parseInt(ad)==0){Ext.getCmp("escday0").setValue(ar);Ext.getCmp("escshift0").setValue(aL);}else{addMoreShifts("esc",ar,aL);}ad++;}}else{aa.setValue(false);aV.hide();}}else{a6.getShifPeroidsCt().hide();}}else{isAlarmEnabled=false;
var n=Ext.getCmp("escMailIDsDiv");var aZ=Ext.getCmp("emailMailAlert");var be=Ext.getCmp("commandAlert");var av=Ext.getCmp("smsAlert");var aV=Ext.getCmp("escMailAlert");a6.removeDynamicElements(n.items.length,n,"staticEscContainer");a6.removeDynamicElements(aZ.items.length,aZ,"staticMailContainer");a6.removeDynamicElements(be.items.length,be,"staticCmdContainer");
a6.removeDynamicElements(av.items.length,av,"staticSMSContainer");a6.removeDynamicElements(aV.items.length,aV,"staticESContainer");aZ.hide();be.hide();av.hide();aV.hide();}if(aS=="checked"){bm.setValue(true);}else{bm.setValue(false);}if(aN=="checked"){bh.setValue(true);}else{bh.setValue(false);}if(aP=="checked"){bi.setValue(true);
}else{bi.setValue(false);}if(Ext.isEmpty(ac)||ac==undefined||ac=="undefined"||ac==false){Ext.getCmp("eGRemoteExec").hide();Ext.getCmp("execcommands").hide();}else{var E=Ext.getCmp("remotecontrol_1");var F=Ext.getCmp("remotecontrol_2");var aC=Ext.getCmp("execcommands").show();if(publicJSON.remotecontrol==true){aC.show();
E.setValue(true);}else{aC.hide();F.setValue(true);}var aq=Ext.getCmp("execcommands");aq.getStore().loadRawData(publicJSON["execcommands"]);aq.setValue(publicJSON["selectedCommandMode"]);Ext.getCmp("eGRemoteExec").show();}var R=Ext.getCmp("userDashboardCreationPrivilege");var aO=publicJSON["monitorHomeDisable"];
if(aO=="disabled"){K.setDisabled(true);aG.setDisabled(true);R.hide();}else{K.setDisabled(false);aG.setDisabled(false);R.show();}var am=publicJSON["alarmdelete"];var g=publicJSON["acknowledgment"];var bs=publicJSON["dashboardCreationPrivilege"];if(am==true){Ext.getCmp("alarmDeleteYes").setValue(true);
}else{Ext.getCmp("alarmDeleteNo").setValue(true);}if(g==true){Ext.getCmp("acknowledgmentYes").setValue(true);}else{Ext.getCmp("acknowledgmentNo").setValue(true);}if(bs==true){Ext.getCmp("dashboardPrivilegeYes").setValue(true);}else{Ext.getCmp("dashboardPrivilegeNo").setValue(true);}Ext.getCmp("availusers").hide();
Ext.getCmp("autoassociatetousers").hide();Ext.getCmp("selectedServerListGrid").hide();var H=publicJSON["hasAllCompAccess"];if(H==false){if(hideOrganization==false){if(publicJSON["userModel"]=="User"){if(!Ext.isEmpty(publicJSON["isShareRole"])&&publicJSON["isShareRole"]==false){Ext.getCmp("selectedServerListGrid").show();
var B=publicJSON["generalSettings"]["configuredServersList"];if(B!="undefined"&&!Ext.isEmpty(B)){var aQ=Ext.getCmp("selectedServerListGrid");aQ.getStore().loadRawData(publicJSON["generalSettings"]["configuredServersList"]);var T=parseInt(publicJSON["generalSettings"]["configuredServersCount"]);aQ.doLayout();
aQ.view.refresh();if(T>9){aQ.setHeight(100);}}else{var aQ=Ext.getCmp("selectedServerListGrid");aQ.getStore().loadRawData("");}}}else{if(publicJSON["userModel"]=="SubOrganization"){Ext.getCmp("selectedServerListGrid").show();var B=publicJSON["generalSettings"]["configuredServersList"];if(B!="undefined"&&!Ext.isEmpty(B)){var aQ=Ext.getCmp("selectedServerListGrid");
aQ.getStore().loadRawData(publicJSON["generalSettings"]["configuredServersList"]);var T=parseInt(publicJSON["generalSettings"]["configuredServersCount"]);aQ.doLayout();aQ.view.refresh();if(T>9){aQ.setHeight(100);}}else{var aQ=Ext.getCmp("selectedServerListGrid");aQ.getStore().loadRawData("");}}}}}else{Ext.getCmp("selectedServerListGrid").hide();
}if(aR==true){Ext.getCmp("chkuser").show();if(hideOrganization==false){if(publicJSON["userModel"]=="User"){if(!Ext.isEmpty(publicJSON["isShareRole"])&&publicJSON["isShareRole"]==false){Ext.getCmp("autoassociatetousers").show();}}else{if(publicJSON["userModel"]=="SubOrganization"){Ext.getCmp("autoassociatetousers").hide();
}}}var G=publicJSON["AutoAssociated"];var b=publicJSON["userStr"];Ext.getCmp("availusers").getStore().loadRawData(publicJSON["availusers"]);if(G==true){Ext.getCmp("chkuser").setValue(true);Ext.getCmp("availusers").show();if(b.length>0){var aU=b.replace(/~,~/g,",");Ext.getCmp("availusers").setValue(aU);
associatedUserIDs=b;}}else{Ext.getCmp("chkuser").setValue(false);Ext.getCmp("availusers").hide();associatedUserIDs="";}}else{Ext.getCmp("autoassociatetousers").hide();associatedUserIDs="";}}else{Ext.getCmp("monitorFieldsContainer").hide();Ext.getCmp("mailsmsalerts").hide();Ext.getCmp("reporterTimeLine").hide();
Ext.getCmp("autoassociatetousers").hide();Ext.getCmp("selectedServerListGrid").hide();}var u=publicJSON["hasReporterTab"];var C=publicJSON["hasMemReporterChek"];if(u==false||C==false){at.getStore().removeAll();Ext.getCmp("reporterTimeLine").hide();}else{at.getStore().loadRawData(publicJSON["chgTimeOpt"]);
at.setValue(publicJSON["chgTimeOptSeleted"]);Ext.getCmp("reporterTimeLine").show();}var bb=publicJSON["logoArr"];var bk=publicJSON["selectedLoginPageLogo"];var a=publicJSON["selectedAdminPageLogo"];var aM=publicJSON["logoCheck"];aT.getStore().loadRawData(bb);aT.setValue(bk);if(bk=="show"){isLoginImgUpdated=true;
Ext.getCmp("loginLogoIMG").show();}else{isLoginImgUpdated=false;Ext.getCmp("loginLogoIMG").hide();}au.getStore().loadRawData(bb);au.setValue(a);if(a=="show"){isAdminMonImgUpdated=true;Ext.getCmp("monitorLogoIMG").show();}else{isAdminMonImgUpdated=false;Ext.getCmp("monitorLogoIMG").hide();}var aM=Ext.getCmp("logoCheck");
aM.hide();if(y!=null&&y!="AlarmViewer"&&y!="SuperAlarmViewer"){var a4=publicJSON["logoCheck"];if(a4==true){aM.setValue(true);Ext.getCmp("imgRepPage").hide();Ext.getCmp("imgConfigPage").hide();}else{aM.setValue(false);Ext.getCmp("imgRepPage").show();Ext.getCmp("imgConfigPage").show();}aM.show();var V=publicJSON["selectedRepPageLogo"];
aH.getStore().loadRawData(bb);aH.setValue(V);if(V=="show"){isRepImgUpdated=true;Ext.getCmp("reporterLogoIMG").show();}else{isRepImgUpdated=false;Ext.getCmp("reporterLogoIMG").hide();}var U=publicJSON["isConfigSupported"];var aY=Ext.getCmp("imgConfigPage");if(U==true){var bd=publicJSON["selectedConfigPageLogo"];
ai.getStore().loadRawData(bb);ai.setValue(bd);if(bd=="show"){isConfigImgUpdated=true;Ext.getCmp("configLogoIMG").show();}else{isConfigImgUpdated=false;Ext.getCmp("configLogoIMG").hide();}var a5=Ext.getCmp("logoCheck").getValue();if(a5==true){aY.hide();}else{aY.show();}}else{aY.hide();}}else{Ext.getCmp("imgRepPage").hide();
Ext.getCmp("imgConfigPage").hide();}Ext.resumeLayouts(true);var by=Ext.getCmp("elementAssociationTab");var a7=Ext.getCmp("elementFilteringTab");var w=Ext.getCmp("userformcontainer");a7.removeAll();by.removeAll();if(M=="usertypeCombo"){w.child("#tab4").tab.hide();w.child("#tab3").tab.hide();}else{if(bv==true){if(M=="formSubmit"||M=="main"||M=="userCombo"){updateSettings=false;
}if((isAlarmEnabled==true||isAlarmEnabled=="true")&&(isFilterMailAlertsEnabled==true||isFilterMailAlertsEnabled=="true")){a6.loadMailFilterAndConfigTab(Z,M);}else{w.child("#tab3").tab.hide();w.child("#tab4").tab.hide();w.setActiveTab(0);}}else{if(M=="formSubmit"||M=="main"||M=="userCombo"){updateSettings=false;
}if(publicJSON["userModel"]=="Organization"){if(!Ext.isEmpty(publicJSON["ShareCompsAcrossOU"])&&publicJSON["ShareCompsAcrossOU"]=="true"){a6.loadUserElementsTab(Z,M);}else{if((isAlarmEnabled==true||isAlarmEnabled=="true")&&(isFilterMailAlertsEnabled==true||isFilterMailAlertsEnabled=="true")){a6.loadMailFilterAndConfigTab(Z,M);
}else{w.child("#tab3").tab.hide();w.child("#tab4").tab.hide();w.setActiveTab(0);}}}else{if(publicJSON["userModel"]=="User"){if(!Ext.isEmpty(publicJSON["isShareRole"])&&publicJSON["isShareRole"]==false){a6.loadUserElementsTab(Z,M);}else{if((isAlarmEnabled==true||isAlarmEnabled=="true")&&(isFilterMailAlertsEnabled==true||isFilterMailAlertsEnabled=="true")){a6.loadMailFilterAndConfigTab(Z,M);
}else{w.child("#tab3").tab.hide();w.child("#tab4").tab.hide();w.setActiveTab(0);}}}else{if(y!="FannieMae-InfoSec"){a6.loadUserElementsTab(Z,M);}}}}}isFromMainPage=false;},removeDynamicElements:function(d,c,g){if(d>1){var e=new Array();for(var b=0;b<d;b++){var f=c.items.items[b];if(f==undefined||f.getId()==g){continue;
}else{e.push(f);}}Ext.suspendLayouts();for(var a=0;a<e.length;a++){c.remove(e[a]);}Ext.resumeLayouts(true);e=null;}},loadMailFilterAndConfigTab:function(e,c){var d=this;var a=Ext.getCmp("userformcontainer");var b=Ext.getCmp("elementFilteringTab");b.add({xtype:"egmailalertsuppress"});a.child("#tab4").tab.show();
a.child("#tab3").tab.hide();if(c=="formSubmit"||selectedTab=="4"){a.setActiveTab(3);}if(mailFilterOption=="Descriptors_Only"){if(Ext.getCmp("egmailalertsuppress")!=undefined){Ext.getCmp("filter").hide();Ext.getCmp("filterLabelID").show();d.showFilterDetails();Ext.getCmp("btnViewFilters").setText(pageIntnl97);
}}else{if(Ext.getCmp("egmailalertsuppress")!=undefined){Ext.getCmp("filter").show();Ext.getCmp("filterLabelID").hide();Ext.getCmp("btnViewFilters").setText(pageIntnl87);}}},loadUserElementsTab:function(g,d){var e=this;var b=Ext.getCmp("userformcontainer");var f=Ext.getCmp("elementAssociationTab");var a=Ext.getCmp("utype").getValue();
f.add({xtype:"elementassociationform"});b.child("#tab3").tab.show();if((isAlarmEnabled==true||isAlarmEnabled=="true")&&(isFilterMailAlertsEnabled==true||isFilterMailAlertsEnabled=="true")){var c=Ext.getCmp("elementFilteringTab");c.removeAll();c.add({xtype:"egmailalertsuppress"});b.child("#tab4").tab.show();
if(mailFilterOption=="Descriptors_Only"){if(Ext.getCmp("egmailalertsuppress")!=undefined){Ext.getCmp("filter").hide();Ext.getCmp("filterLabelID").show();e.showFilterDetails();Ext.getCmp("btnViewFilters").setText(pageIntnl97);}}else{if(Ext.getCmp("egmailalertsuppress")!=undefined){Ext.getCmp("filter").show();
Ext.getCmp("filterLabelID").hide();Ext.getCmp("btnViewFilters").setText(pageIntnl87);}}}else{b.child("#tab4").tab.hide();}if(d=="formSubmit"&&fromUpdatefirstTab=="Yes"){fromUpdatefirstTab="No";b.setActiveTab(1);}else{if(d=="formSubmit"&&fromPreviousUpdate=="Yes"){fromPreviousUpdate="No";b.setActiveTab(0);
}else{if(d=="formSubmit"){b.setActiveTab(2);}else{if(selectedTab=="3"){b.setActiveTab(2);}else{if(selectedTab=="4"){b.setActiveTab(3);}}}}}},goBack:function(){if(reqfrom=="twofa"){window.location.href=backHref+"&choose=twofa";}else{window.location.href=backHref;}},afterMainRender:function(){if(reqfrom!="navlink"&&reqfrom!="adduser"){Ext.getCmp("backButton").show();
}if(reqfrom=="adduser"&&showAlert=="yes"){Ext.Msg.show({title:"ADD USER",msg:pageIntnl92,icon:"iconInformation",buttons:Ext.Msg.OK});}var m=publicJSON.isSAMLLoginEnabled;if(!Ext.isEmpty(m)&&m){Ext.getCmp("userAuthSAML").show();Ext.getCmp("userAuthSAML").setDisabled(true);Ext.getCmp("userAuth").hide();
Ext.getCmp("userAuth").setDisabled(true);}else{Ext.getCmp("userAuth").show();Ext.getCmp("userAuth").setDisabled(true);Ext.getCmp("userAuthSAML").hide();Ext.getCmp("userAuthSAML").setDisabled(true);}if(!isEnterpriseModel){Ext.getCmp("userAuth").hide();Ext.getCmp("userAuthSAML").hide();}var h=this;var c=Ext.getCmp("main");
var a=Ext.getCmp("btnNext");var i=publicJSON["isUsersCreated"];if(i==true){var e=publicJSON["initialUserStatus"];Ext.getCmp("userStatus").setValue(e);var j=publicJSON["availableUsers"];var l=Ext.getCmp("uname");var k=publicJSON["RootNodeText"];if(Ext.isEmpty(k)){k="Choose Organization / Organizational Unit / User";
}var d={text:k,id:"-1",name:"-1",expanded:true,children:publicJSON["exportDataArr"]};l.getStore().setRootNode(d);l.setValue(selectedUserID);if(selectedUserID!="-1"&&selectedUserID.length>0){a.setDisabled(false);h.loadUserProfileControls(false,"main");h.hiddenParamsForAuditLog(publicJSON);}else{var g=Ext.getCmp("userformcontainer");
g.child("#tab2").tab.setDisabled(true);a.setDisabled(true);Ext.getCmp("org").hide();}h.setLangEntries(publicJSON.langEntries);var f=publicJSON.pwdLength;var b=publicJSON.pwdComplexityCount;if(f==""||f<2){f=8;}else{if(f!=""&&f<b){f=b;}}Ext.getCmp("passScore").setText(passLabel1+" "+f+" "+passLabel2);}else{c.remove(Ext.getCmp("userformcontainer"));
c.add({xtype:"errorpanel",border:false});}},setLangEntries:function(c){for(var a in c){var b=Ext.getCmp(a);if(b==null||b=="undefined"){continue;}if(b.getXType()=="checkboxfield"||b.getXType()=="radiofield"){if(b.boxLabelEl==null||b.boxLabelEl==undefined||b.boxLabelEl=="undefined"){continue;}b.boxLabelEl.update(c[a]);
}else{b.setFieldLabel(c[a]);}}},updateUserPage:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,timeout:120000,success:function(b){var c=b.responseText;publicJSON=Ext.decode(c);}});},showCommandInWindow:function(b){var a=Ext.getCmp("customScript").getValue();b.setDisabled(true);Ext.widget("window",{extend:"Ext.panel.Panel",title:"Command",id:"commandWindow",closeAction:"destory",width:625,height:300,modal:true,scroll:true,autoScroll:true,doClose:function(){b.setDisabled(false);
this.destroy();},padding:"40px 5px 10px 5px",buttonAlign:"center",items:[{xtype:"textareafield",id:"tmpTextArea",cls:"text-area",fieldLabel:"Command",height:160,grow:true,value:a,rows:9,cols:72}],buttons:[{text:"Apply",id:"applyCommand",ui:"newButtonSmall",margin:"0 0 10 0",handler:function(){b.setDisabled(false);
Ext.getCmp("customScript").setValue(Ext.getCmp("tmpTextArea").getValue());Ext.getCmp("commandWindow").destroy();}}]}).show();},showResultWindow:function(b,a){var e=Ext.decode(b);var d=e["requestStatus"];var c="Domain Error";if(d!="success"){Ext.widget("window",{title:c,closeAction:"destory",width:600,height:300,modal:true,scroll:true,autoScroll:true,doClose:function(){var f=this;
a.setDisabled(false);this.destroy();},html:b}).show();}},showResultQBox:function(b){var e=Ext.decode(b);var d=e["requestStatus"];var c="";if(d=="success"){var a=e["result"];c=a.title;}else{var a=e["errors"];c=a.title;}Ext.widget("window",{title:c,closeAction:"destory",width:600,height:300,scroll:true,autoScroll:true,doClose:function(){e="";
this.destroy();},html:b}).show();},getHiddenFields:function(b){var a="";for(key in b){if((key=="previousSelectedValue"||key=="previousVMs"||key=="previouscomponents"||key=="previoussegments"||key=="previousservicegroup"||key=="previousservices"||key=="previouszones"||key=="previousExcVal"||key=="previousextagts"||key=="previousremagts")&&!Ext.isEmpty(key)){continue;
}if(key=="vsTypes"){continue;}a+=key+"="+encodeURIComponent(b[key])+"&";}return a;},setHiddenFieldsToForm:function(){var c=userElementJSON["hiddenFields"];var a=Ext.getCmp("elementassociationform");var b=Ext.getCmp("elementsHiddenContainer");for(key in c){if((key=="previousSelectedValue"||key=="previousVMs"||key=="previouscomponents"||key=="previoussegments"||key=="previousservicegroup"||key=="previousservices"||key=="previouszones"||key=="previousExcVal"||key=="previousextagts"||key=="previousExcVal")&&!Ext.isEmpty(key)){continue;
}if(key=="vsTypes"){continue;}var d=c[key];b.add({xtype:"hiddenfield",name:key,value:d});}},moveTab:function(d){var c=appCnt.validateUserForm();if(c){var b=Ext.getCmp("userformcontainer");b.setActiveTab(1);d.hide();Ext.getCmp("btnSubmit").show();Ext.getCmp("btnPrev").show();var a=Ext.getCmp("utype").getValue();
if(a=="FannieMae-InfoSec"){Ext.getCmp("mailsmssettings").hide();Ext.getCmp("imgAdminPage").hide();Ext.getCmp("imgRepLogin").hide();}}},movePreviousTab:function(b){var a=Ext.getCmp("userformcontainer");a.setActiveTab(0);b.hide();Ext.getCmp("btnSubmit").hide();Ext.getCmp("btnNext").show();},submitUserDetails:function(c){var f=this;
var d=f.validateUserForm();if(d==true){var e=f.getSelectedUsers();var h="";Ext.getCmp("selectedServerListGrid").getStore().each(function(k){if(!Ext.isEmpty(k.get("valueField_1"))){h+=k.get("valueField_1")+",";}if(!Ext.isEmpty(k.get("valueField_2"))){h+=k.get("valueField_2")+",";}if(!Ext.isEmpty(k.get("valueField_3"))){h+=k.get("valueField_3")+",";
}});h=h.substring(0,h.length-1);Ext.getCmp("interestedDomains").setValue(h);var a=new Ext.LoadMask(Ext.getBody(),{msg:"Updating..."});a.show();var g=f.getMain().getForm();Ext.getCmp("availusers").setDisabled(true);var b=Ext.getCmp("virtualServers");if(b!=null&&b!=undefined){b.setDisabled(true);}var i=Ext.getCmp("uname").getValue();
var j=Ext.getCmp("org").getValue();if(g.isValid()){f.getMain().submit({url:"EgChangeUserProfile/data/EgchangeuserprofilepJson.jsp?esCount="+inputs+"&newusers="+encodeURIComponent(e)+"&date="+new Date().getTime(),method:"POST",params:{"uname":i,"org":parent.filterEncode(j)},timeout:1200,success:function(m,y){a.hide();
Ext.getCmp("availusers").setDisabled(false);if(b!=null&&b!=undefined){b.setDisabled(false);}var n=Ext.decode(y.response.responseText);var z=Ext.getCmp("auditsHiddenContainer");if(!Ext.isEmpty(z)){z.removeAll();}if(n.requestStatus=="success"){associatedUserIDs=e;var k=n.hasallcompaccess;isAlarmEnabled=n.isAlarmEnabled;
isFilterMailAlertsEnabled=n.isFilterMailAlertsEnabled;mailFilterOption=n.filterControlDefaultSelection;var o=n.result;updateSettings=false;Ext.Msg.show({title:o.title,msg:o.message1,buttons:Ext.Msg.OK,width:350,icon:"iconInformation"});var l=Ext.getCmp("utype").getValue();if(l=="FannieMae-InfoSec"){var t=Ext.getCmp("userformcontainer");
t.setActiveTab(0);}else{if(o.message1=="The user has been modified successfully."){var q=Ext.getCmp("uname").getValue();var r=Ext.getCmp("upass").getValue();var B=Ext.getCmp("confpasswd").getValue();if(n.isLSPortalUser!=null&&n.isLSPortalUser==true&&n.sendUserDataToCMS!=null&&n.sendUserDataToCMS=="true"&&n.isPwdModified!=null&&n.isPwdModified=="true"){jQuery.ajax({type:"POST",url:"https://www.eginnovations.com/solutions/product_pw_change.php",data:{"Email":q,"New_Password":r},cache:false,success:function(C){var D=C;
},error:function(C){console.log(C);}});}}var w="1";if(k==true){if((isAlarmEnabled==true||isAlarmEnabled=="true")&&(isFilterMailAlertsEnabled==true||isFilterMailAlertsEnabled=="true")){w="4";}}else{w="3";}var s=Ext.getCmp("uname").getValue();var u=Ext.getCmp("userStatus").getValue();var x="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?selectedTab="+w+"&qctr=1&username="+encodeURIComponent(s)+"&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(u);
f.updateUserPage(x);var A=publicJSON["userStatus"];if(!Ext.isEmpty(A)&&u!=A){var x="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?selectedTab="+w+"&qctr=1&username="+encodeURIComponent(s)+"&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(A);f.updateUserPage(x);}var v=publicJSON["RootNodeText"];
if(Ext.isEmpty(v)){v="Choose Organization / Organizational Unit / User";}var p={text:v,id:"-1",name:"-1",expanded:true,children:publicJSON["exportDataArr"]};Ext.getCmp("uname").getStore().setRootNode(p);Ext.getCmp("uname").setValue(s);f.loadUserProfileControls(true,"formSubmit");}}else{var o=n.errors;
Ext.Msg.show({title:o.title,msg:o.message1,buttons:Ext.Msg.OK,width:350,icon:"iconError"});if(o.tabRedirect!=null&&o.tabRedirect!=undefined&&o.tabRedirect=="0"){var t=Ext.getCmp("userformcontainer");t.setActiveTab(0);}}},failure:function(l,m){if(b!=null&&b!=undefined){b.setDisabled(false);}Ext.getCmp("availusers").setDisabled(false);
Ext.Msg.show({title:"Ajax Failed",msg:"Could not update user details.",buttons:Ext.Msg.OK,icon:"iconError"});var k=Ext.getCmp("auditsHiddenContainer");if(!Ext.isEmpty(k)){k.removeAll();}a.hide();}});}}},loadUserAssociations:function(){var b=Ext.getCmp("userAssociate");var a={layout:{type:"hbox"},items:[{xtype:"label",text:"Available user(s)",id:"userLabel",width:320,},{xtype:"multiselectorpanel",cls:"multiselect",height:80,items:[{xtype:"multiselectSi",cls:"multiselect",autoScroll:true,scroll:true,width:300,id:"availusers",name:"availusers",store:Ext.data.Store({fields:["displayField","valueField"],data:publicJSON["availusers"]}),displayField:"displayField",valueField:"valueField",queryMode:"local"}]}]};
b.add(a);b.doLayout();},userStatusChange:function(){var a=new Ext.LoadMask(Ext.getBody(),{msg:"Loading..."});a.show();var b=Ext.getCmp("userStatus").getValue();var c="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?selectedTab=1&qctr=1&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(b);
Ext.Ajax.request({url:c,method:"POST",timeout:120000,success:function(e){a.hide();var i=e.responseText;publicJSON=Ext.decode(i);var k=Ext.getCmp("uname");var j=publicJSON["RootNodeText"];if(Ext.isEmpty(j)){j="Choose Organization / Organizational Unit / User";}if(Ext.isEmpty(publicJSON["exportDataArr"])){if(b=="expired"){Ext.Msg.show({title:pageTitle2,msg:expiredAccMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){Ext.getCmp("userStatus").setValue("active");
appCnt.userStatusChange();}});}else{Ext.Msg.show({title:pageTitle2,msg:activeAccMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){Ext.getCmp("userStatus").setValue("expired");appCnt.userStatusChange();}});}}var f={text:j,id:"-1",name:"-1",expanded:true,children:publicJSON["exportDataArr"]};
k.getStore().setRootNode(f);var d=Ext.getCmp("userformcontainer");d.child("#tab2").tab.setDisabled(true);var h=Ext.getCmp("elementFilteringTab");var g=Ext.getCmp("elementAssociationTab");g.removeAll();h.removeAll();d.child("#tab4").tab.hide();d.child("#tab3").tab.hide();Ext.getCmp("btnNext").setDisabled(true);
Ext.getCmp("uname").reset();Ext.getCmp("org").reset();Ext.getCmp("userAuthSAML").reset();Ext.getCmp("userAuth").reset();Ext.getCmp("domainName").reset();Ext.getCmp("idpName").reset();Ext.getCmp("rdoOperation").reset();Ext.getCmp("utype").reset();Ext.getCmp("upass").reset();Ext.getCmp("passScore").hide();
Ext.getCmp("confpasswd").reset();Ext.getCmp("changePwd").reset();Ext.getCmp("grpname").reset();Ext.getCmp("tmptilldate").reset();Ext.getCmp("tilldate").reset();Ext.getCmp("tilldate_h").reset();Ext.getCmp("dateforpro").reset();Ext.getCmp("Never").reset();Ext.getCmp("description").reset();Ext.getCmp("validate").hide();
Ext.getCmp("changePwd").hide();Ext.getCmp("org").hide();Ext.getCmp("utype").getStore().removeAll();delete h;delete h;}});},loadUserTab:function(l,o,e,k){var m=this;var h=Ext.getCmp("utype").getValue();var g=Ext.getCmp("uname").getValue();var a=Ext.getCmp("userStatus").getValue();var d=o.itemId;var f=Ext.getCmp("btnSubmit");
var c=Ext.getCmp("btnNext");var j=Ext.getCmp("main");var p=Ext.getCmp("btnPrev");if(d=="tab1"){if(updateSettings==true){Ext.Msg.show({title:pageTitle5,msg:pageIntn200,buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(q){if(q=="yes"){fromPreviousUpdate="Yes";m.submitUserDetails();}else{var r="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?username="+encodeURIComponent(g)+"&selectedTab=1&qctr=1&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(a);
Ext.Ajax.request({url:r,method:"POST",timeout:120000,success:function(s){var t=s.responseText;publicJSON=Ext.decode(t);Ext.getCmp("utype").setValue(publicJSON["utype"]);fromPreviousUpdate="Yes";m.loadUserProfileControls(false,"formSubmit");}});}}});}updateSettings=false;Ext.getCmp("btnNext").show();Ext.getCmp("btnSubmit").hide();
if(reqFrom=="adduser"){j.setTitle(pageTitle2);}else{j.setTitle(pageTitle5);}m.hiddenParamsForAuditLog(publicJSON);f.hide();c.show();p.hide();}if(d=="tab2"){if(updateSettings==true){Ext.Msg.show({title:pageTitle5,msg:pageIntn200,buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(q){if(q=="yes"){fromUpdatefirstTab="Yes";
m.submitUserDetails();}else{var r="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?username="+encodeURIComponent(g)+"&selectedTab=1&qctr=1&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(a);Ext.Ajax.request({url:r,method:"POST",timeout:120000,success:function(s){var t=s.responseText;
publicJSON=Ext.decode(t);Ext.getCmp("utype").setValue(publicJSON["utype"]);fromUpdatefirstTab="Yes";m.loadUserProfileControls(false,"formSubmit");}});}}});}updateSettings=false;Ext.getCmp("btnNext").hide();Ext.getCmp("btnSubmit").show();m.hiddenParamsForAuditLog(publicJSON);f.show();c.hide();p.show();
j.setTitle(pageTitle6+" '"+changeDisplayName(selectedUserID)+"'");var n=Ext.getCmp("utype").getValue();if(n=="FannieMae-InfoSec"){Ext.getCmp("mailsmssettings").hide();Ext.getCmp("imgAdminPage").hide();Ext.getCmp("imgRepLogin").hide();}}else{if(d=="tab4"){if(updateSettings==true){Ext.Msg.show({title:pageTitle5,msg:pageIntn200,buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(q){if(q=="yes"){m.submitUserDetails();
}else{var r="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?username="+encodeURIComponent(g)+"&selectedTab=1&qctr=1&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(a);Ext.Ajax.request({url:r,method:"POST",timeout:120000,success:function(s){var t=s.responseText;publicJSON=Ext.decode(t);
Ext.getCmp("utype").setValue(publicJSON["utype"]);m.loadUserProfileControls(false,"formSubmit");}});}}});}updateSettings=false;j.setTitle(pageTitle4+" '"+changeDisplayName(selectedUserID)+"'");f.hide();c.hide();p.hide();var i=Ext.getCmp("uname").getValue();var b="EgChangeUserProfile/data/EgMailAlertSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(i))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom+"&date="+new Date().getTime();
m.updateUserMailSuppressList(b);m.updateFilterComponents();if(mailFilterOption=="Descriptors_Only"){if(Ext.getCmp("egmailalertsuppress")!=undefined){Ext.getCmp("filter").hide();Ext.getCmp("filterLabelID").show();m.showFilterDetails();Ext.getCmp("btnViewFilters").setText(pageIntnl97);}}else{if(Ext.getCmp("egmailalertsuppress")!=undefined){Ext.getCmp("filter").show();
Ext.getCmp("filterLabelID").hide();Ext.getCmp("btnViewFilters").setText(pageIntnl87);}}}else{if(d=="tab3"){if(updateSettings==true){Ext.Msg.show({title:pageTitle5,msg:pageIntn200,buttons:Ext.Msg.YESNO,icon:"iconConfirmation",fn:function(q){if(q=="yes"){m.submitUserDetails();}else{var r="EgChangeUserProfile/data/EgChangeUserProfileJson.jsp?username="+encodeURIComponent(g)+"&selectedTab=1&qctr=1&date="+new Date().getTime()+"&userStatus="+encodeURIComponent(a);
Ext.Ajax.request({url:r,method:"POST",timeout:120000,success:function(s){var t=s.responseText;publicJSON=Ext.decode(t);Ext.getCmp("utype").setValue(publicJSON["utype"]);m.loadUserProfileControls(false,"formSubmit");}});}}});}updateSettings=false;var b="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?showAssociatedData=yes&qctr=1&selectedTab=3&assousers="+encodeURIComponent(associatedUserIDs)+"&username="+encodeURIComponent(selectedUserID)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+h+"&date="+new Date().getTime();
this.updateUserElementPage(b);j.setTitle(pageTitle3+" '"+changeDisplayName(selectedUserID)+"'");Ext.getCmp("elementUserID").setValue(selectedUserID);f.hide();c.hide();p.hide();}}}Ext.Ajax.request({url:"EgChangeUserProfile/data/changeusrprofilehelpJson.jsp?selectTab="+d,method:"POST",timeout:120000});
},updateFilterComponents:function(){var d=this;var b=Ext.getCmp("elementFilteringTab");var f=userMailJSON.isComponentsAssociated;if(f==true){var e=Ext.getCmp("egmailalertsuppress");if(e==null||e=="undefined"||e==undefined){b.removeAll();b.add({xtype:"egmailalertsuppress"});}Ext.getCmp("filterUserID").setValue(selectedUserID);
}else{var a=Ext.getCmp("uname").getValue();var c='<div class="egFlexCenterByColumnWise" style="height:98%"><div class="iconInformation"></div><div class="commonErrorMsgText">No components have been associated for <b>'+"'"+a+"'"+"</b></div></div>";b.removeAll();b.add({xtype:"panel",border:false,flex:1,style:{"text-align":"center"},html:c});
}},initUserElements:function(){if(!isEnterpriseModel){var b=userElementJSON.shareNickAcrossOU!=null&&userElementJSON.shareNickAcrossOU!=undefined&&userElementJSON.shareNickAcrossOU;var g=userElementJSON.superOrgName;if((b&&hideOrganization)||(!Ext.isEmpty(g)&&g.toLowerCase()=="egenterprise")){var a=userElementJSON.organizations;
var c=Ext.getCmp("orgType");c.getStore().loadRawData(a);c.setValue("-1");c.show();}}var d=userElementJSON.associations;var f=Ext.getCmp("associate");f.getStore().loadRawData(d);f.setValue("-1");var e=Ext.getCmp("otherHosts");if(e.fromField.store.getCount()>0){e.fromField.store.removeAll();}if(e.toField.store.getCount()>0){e.toField.store.removeAll();
}this.setLangEntries(userElementJSON.langEntries);},initUserMailConfigs:function(){var f=this;var h=userMailJSON.requestStatus;if(h=="success"){var e=Ext.getCmp("uname").getValue();this.setLangEntries(userMailJSON.langEntries);var b=userMailJSON.filters;var a=userMailJSON.isComponentsAssociated;if(a==true){var i=Ext.getCmp("filter");
i.getStore().loadRawData(b);i.setValue("-1");Ext.getCmp("CompTypes").hide();var c=Ext.getCmp("exclude");if(c.fromField.store.getCount()>0){c.fromField.store.removeAll();}if(c.toField.store.getCount()>0){c.toField.store.removeAll();}}else{var g=Ext.getCmp("userformcontainer");var d=Ext.getCmp("elementFilteringTab");
var e=Ext.getCmp("uname").getValue();var j='<div class="egFlexCenterByColumnWise" style="height:98%"><div class="iconInformation"></div><div class="commonErrorMsgText">No components have been associated for <b>'+"'"+e+"'"+"</b></div></div>";d.removeAll();d.add({xtype:"component",border:false,flex:1,style:{"text-align":"center"},html:j});
}}else{var g=Ext.getCmp("userformcontainer");var d=Ext.getCmp("elementFilteringTab");var j=f.getErrorMessageTemplate(userMailJSON.errors);d.removeAll();d.add({xtype:"component",border:false,padding:160,style:{"text-align":"center"},html:j});}},updateFilterResultPanel:function(){var g=this;var i=Ext.getCmp("userFilterContainer");
var b=userMailJSON.filters;i.removeAll();if(userMailJSON["isFiltersAvailable"]!=null&&userMailJSON["isFiltersAvailable"]!=undefined&&userMailJSON["isFiltersAvailable"]==true){var a=userMailJSON.excludedElements;var h=userMailJSON.gridHeaderMapping;for(var j in a){var c=a[j];if(j=="excludedComponents"||j=="allExcludedLayersByType"||j=="exculdedTestsForAllTypes"||j=="exculdedDescriptor"){var d=h[j];
if(c==""||c.length==0){continue;}var e={xtype:"panel",cls:"outerpanel",border:false,width:"95%",title:d,html:c};i.add(e);}else{var d=h[j];if(Ext.isEmpty(c)){continue;}var f=g.getGridPanel(c,d);i.add(f);}}i.doLayout();}else{var k='<div class = "iconInformation" style="margin:0 auto"></div><div>No elements are excluded for this user</b></div>';
var e={xtype:"component",border:false,padding:120,html:k};i.add(e);}Ext.getCmp("userFilterWindow").doLayout();},updateHTMLFilterResultPanel:function(b){var a=this;Ext.Ajax.request({url:b,method:"POST",timeout:120000,success:function(c){var e=c.responseText;var d=Ext.getCmp("userFilterContainer");d.update(e);
Ext.getCmp("userFilterWindow").doLayout();delete e;delete d;}});},updateDescriptorHTMLFiltePanel:function(b){var a=this;Ext.Ajax.request({url:b,method:"POST",timeout:120000,success:function(c){var e=c.responseText;var d=Ext.getCmp("userFilterContainer");d.update(e);Ext.getCmp("userFilterWindow").doLayout();
delete e;delete d;}});},updateFilterResultPanel2:function(){var f=this;var h=Ext.getCmp("userFilterContainer");var b=userMailJSON.filters;h.removeAll();if(userMailJSON["isFiltersAvailable"]!=null&&userMailJSON["isFiltersAvailable"]!=undefined&&userMailJSON["isFiltersAvailable"]==true){var a=userMailJSON.excludedElements;
var g=userMailJSON.gridHeaderMapping;for(var i in a){var c=a[i];if(i=="exculdedDescriptor"){var d=g[i];if(c==""||c.length==0){continue;}var e={xtype:"panel",cls:"outerpanel",border:false,width:"95%",title:d,html:c};h.add(e);}}}else{var j='<div class = "iconInformation" style="margin:0 auto"></div><div>No elements are included for this user</b></div>';
var e={xtype:"component",border:false,padding:120,html:j};h.add(e);}Ext.getCmp("userFilterWindow").doLayout();},getGridPanel:function(c,b){var f=new Array();f.push("compType_1");f.push("compType_2");f.push("compType_3");var h=new Array();var e=new Array();for(var d in f){var a=f[d];h.push({header:a,dataIndex:a,align:"left",flex:1});
}var g=Ext.widget("usergridpanel",{store:new Ext.data.Store({fields:f,data:c}),sortableColumns:false,ui:"newGridPanel",border:true,title:b,width:"95%",columns:h,viewConfig:{forceFit:true,stripeRows:false},sortable:false,hideable:false,hideHeaders:true});return g;},egTitleSearch:function(c){var k=c.value;
var j=Ext.getCmp("compName").getStore();var l=compNameArrTemp;var f=Ext.getCmp("compName");var b=Ext.getCmp("exclude");b.getStore().removeAll();if(b.fromField.store.getCount()>0){b.fromField.store.removeAll();}if(b.toField.store.getCount()>0){b.toField.store.removeAll();}if(Ext.isEmpty(k)){Ext.get("MyTrigger_searchbox_0").setStyle("display","none");
Ext.get("MyTrigger_searchbox_1").setStyle("display","block");f.getStore().loadRawData(compNameArrTemp);}else{Ext.get("MyTrigger_searchbox_1").setStyle("display","none");Ext.get("MyTrigger_searchbox_0").setStyle("display","block");var f=Ext.getCmp("compName");var d=k;var g=false;var e=new Array();for(var h=0;
h<l.length;h++){var a=l[h]["displayField"];if(a.toLowerCase().indexOf(d.toLowerCase())>-1){g=true;e.push({"displayField":l[h]["displayField"],"valueField":l[h]["valueField"],});}}f.getStore().removeAll();if(g){f.getStore().loadRawData(e);}else{f.store.loadData({"displayField":"No data found","valueField":"-1",},true);
}Ext.getCmp("searchbox").focus();}},popFilterDetails:function(e){var b=this;updateSettings=false;var c="EgChangeUserProfile/data/EgMailAlertSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom;var a=e.getValue();
if(a!="-1"){c=c+"&filterBy="+a;if(a=="filterByCName"||a=="filterByDescriptor"){c=c+"&serverType=-1";}else{if(a=="filterByLayer"||a=="filterByTest"){c=c+"&serverType=filterByAll";}}c=c+"&date="+new Date().getTime();Ext.Ajax.request({url:c,method:"POST",timeout:120000,success:function(i){userMailJSON=Ext.decode(i.responseText);
var h=Ext.getCmp("exclude");var m=userMailJSON["includedAlerts"];var o=userMailJSON["excludedAlerts"];h.getStore().removeAll();if(h.fromField.store.getCount()>0){h.fromField.store.removeAll();}if(h.toField.store.getCount()>0){h.toField.store.removeAll();}if(!Ext.isEmpty(o)){h.fromField.store.add(o);}if(!Ext.isEmpty(m)){h.toField.store.add(m);
}var p=Ext.getCmp("CompTypes");var j=Ext.getCmp("compTypesIn");var n=Ext.getCmp("serverTestsOuterCt");p.hide();j.hide();n.hide();Ext.getCmp("serseg").hide();if(a=="filterByCName"||a=="filterByLayer"||a=="filterByTest"||a=="filterByDescriptor"){var l=Ext.getCmp("CompTypes");var k=userMailJSON["compopnentTypes"];
l.getStore().loadRawData(k);if(a=="filterByCName"||a=="filterByDescriptor"){l.setValue("-1");}else{l.setValue("filterByAll");}if(userMailJSON.isOtherGroupsFound){j.getStore().loadRawData(userMailJSON.viewBy);j.setValue(userMailJSON.displayText);j.show();if(j.getValue()!="cType"){Ext.getCmp("serseg").show();
}}else{j.hide();}p.show();if(a=="filterByDescriptor"){var g=Ext.getCmp("Test");Ext.getCmp("compName").getStore().removeAll();n.show();Ext.getCmp("searchbox").setDisabled(true);Ext.getCmp("searchbox").setValue("");g.show();g.getStore().removeAll();g.getStore().loadRawData(userMailJSON.testArray);g.setValue("-1");
}}var f=Ext.getCmp("TestTypes");if(isConfigEnabled=="true"){if(a=="filterByTest"){f.show();f.getStore().removeAll();f.getStore().loadRawData(userMailJSON.testTypesArr);f.setValue("performance");}else{f.hide();}}else{f.hide();}h.fromField.getComponent(0).setTitle(userMailJSON["itemTitle1"]);h.toField.getComponent(0).setTitle(userMailJSON["itemTitle2"]);
}});}else{Ext.suspendLayouts();var d=Ext.getCmp("exclude");d.fromField.getComponent(0).setTitle("Excluded from alerts");d.toField.getComponent(0).setTitle("Included for alerts");Ext.getCmp("CompTypes").hide();Ext.getCmp("compTypesIn").hide();Ext.getCmp("serseg").hide();Ext.getCmp("serverTestsOuterCt").hide();
Ext.resumeLayouts(true);}},showFilterDetails:function(c){var a=this;var b="EgChangeUserProfile/data/EgMailAlertIncludeSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&filterBy=filterByDescriptor&reqfrom="+reqFrom;Ext.Ajax.request({url:b,method:"POST",timeout:120000,success:function(f){userMailJSON=Ext.decode(f.responseText);
var e=Ext.getCmp("exclude");var j=userMailJSON["includedAlerts"];var l=userMailJSON["excludedAlerts"];e.getStore().removeAll();if(e.fromField.store.getCount()>0){e.fromField.store.removeAll();}if(e.toField.store.getCount()>0){e.toField.store.removeAll();}if(!Ext.isEmpty(l)){e.fromField.store.add(l);}if(!Ext.isEmpty(j)){e.toField.store.add(j);
}var m=Ext.getCmp("CompTypes");var g=Ext.getCmp("compTypesIn");var k=Ext.getCmp("serverTestsOuterCt");m.hide();g.hide();k.hide();Ext.getCmp("serseg").hide();var i=Ext.getCmp("CompTypes");var h=userMailJSON["compopnentTypes"];i.getStore().loadRawData(h);i.setValue("-1");if(userMailJSON.isOtherGroupsFound){g.getStore().loadRawData(userMailJSON.viewBy);
g.setValue(userMailJSON.displayText);g.show();if(g.getValue()!="cType"){Ext.getCmp("serseg").show();}}else{g.hide();}m.show();var d=Ext.getCmp("Test");Ext.getCmp("compName").getStore().removeAll();k.show();d.show();d.getStore().removeAll();d.getStore().loadRawData(userMailJSON.testArray);d.setValue("-1");
}});},viewByCriteria:function(d){updateSettings=false;var b=d.getValue();var c=Ext.getCmp("filter");var i=c.getValue();var e=Ext.getCmp("serseg");var h=Ext.getCmp("CompTypes");var a=Ext.getCmp("Test");var f="";var g=this;if(mailFilterOption=="Descriptors_Only"){f="EgChangeUserProfile/data/EgMailAlertIncludeSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom;
f=f+"&filterBy=filterByDescriptor&compTypesIn="+encodeURIComponent(b)+"&date="+new Date().getTime();Ext.Ajax.request({url:f,method:"POST",timeout:120000,success:function(j){userMailJSON=Ext.decode(j.responseText);var m=Ext.getCmp("exclude");var k=userMailJSON["includedAlerts"];var l=userMailJSON["excludedAlerts"];
m.getStore().removeAll();if(m.fromField.store.getCount()>0){m.fromField.store.removeAll();}if(m.toField.store.getCount()>0){m.toField.store.removeAll();}if(b!="cType"){e.setFieldLabel(userMailJSON.trDisplayText);e.getStore().loadRawData(userMailJSON.viewByType);e.setValue(userMailJSON.selectedGrpText);
e.show();h.getStore().removeAll();h.getStore().loadData([{"displayField":"Not Applicable","valueField":"-1"}]);a.getStore().removeAll();a.getStore().loadData([{"displayField":"Not Applicable","valueField":"-1"}]);Ext.getCmp("compName").getStore().removeAll();Ext.getCmp("searchbox").setDisabled(true);
Ext.getCmp("searchbox").setValue("");}else{g.popFilterDetails(c);e.hide();}if(h.getStore().getCount()>0){h.setValue(h.getStore().getAt(0));}if(a.getStore().getCount()>0){a.setValue(a.getStore().getAt(0));}if(mailFilterOption=="Descriptors_Only"){m.fromField.getComponent(0).setTitle(pageIntnl95);m.toField.getComponent(0).setTitle(pageIntnl96);
}}});}else{f="EgChangeUserProfile/data/EgMailAlertSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom;f=f+"&filterBy="+i+"&compTypesIn="+encodeURIComponent(b)+"&date="+new Date().getTime();Ext.Ajax.request({url:f,method:"POST",timeout:120000,success:function(j){userMailJSON=Ext.decode(j.responseText);
var m=Ext.getCmp("exclude");var k=userMailJSON["includedAlerts"];var l=userMailJSON["excludedAlerts"];m.getStore().removeAll();if(m.fromField.store.getCount()>0){m.fromField.store.removeAll();}if(m.toField.store.getCount()>0){m.toField.store.removeAll();}if(b!="cType"){e.setFieldLabel(userMailJSON.trDisplayText);
e.getStore().loadRawData(userMailJSON.viewByType);e.setValue(userMailJSON.selectedGrpText);e.show();h.getStore().removeAll();h.getStore().loadData([{"displayField":"Not Applicable","valueField":"-1"}]);a.getStore().removeAll();a.getStore().loadData([{"displayField":"Not Applicable","valueField":"-1"}]);
Ext.getCmp("compName").getStore().removeAll();Ext.getCmp("searchbox").setDisabled(true);Ext.getCmp("searchbox").setValue("");}else{g.popFilterDetails(c);e.hide();}if(h.getStore().getCount()>0){h.setValue(h.getStore().getAt(0));}if(a.getStore().getCount()>0){a.setValue(a.getStore().getAt(0));}if(mailFilterOption=="Descriptors_Only"){m.fromField.getComponent(0).setTitle(pageIntnl95);
m.toField.getComponent(0).setTitle(pageIntnl96);}}});}},changeByServer:function(f){updateSettings=false;var d=f.getValue();var a=Ext.getCmp("filter").getValue();var c=Ext.getCmp("compTypesIn").getValue();var b=Ext.getCmp("CompTypes");var g=Ext.getCmp("Test");var e="";if(mailFilterOption=="Descriptors_Only"){e="EgChangeUserProfile/data/EgMailAlertIncludeSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom;
e=e+"&filterBy=filterByDescriptor&compTypesIn="+encodeURIComponent(c)+"&serseg="+encodeURIComponent(d)+"&date="+new Date().getTime();}else{e="EgChangeUserProfile/data/EgMailAlertSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom;
e=e+"&filterBy="+a+"&compTypesIn="+encodeURIComponent(c)+"&serseg="+encodeURIComponent(d)+"&date="+new Date().getTime();}Ext.Ajax.request({url:e,method:"POST",timeout:120000,success:function(h){userMailJSON=Ext.decode(h.responseText);var i=Ext.getCmp("exclude");i.getStore().removeAll();if(i.fromField.store.getCount()>0){i.fromField.store.removeAll();
}if(i.toField.store.getCount()>0){i.toField.store.removeAll();}b.getStore().loadRawData(userMailJSON.compopnentTypes);if(d=="-1"){b.getStore().removeAll();b.getStore().loadData([{"displayField":"Not Applicable","valueField":"-1"}]);}g.getStore().removeAll();g.getStore().loadData([{"displayField":"Not Applicable","valueField":"-1"}]);
Ext.getCmp("compName").getStore().removeAll();Ext.getCmp("searchbox").setDisabled(true);Ext.getCmp("searchbox").setValue("");if(b.getStore().getCount()>0){b.setValue(b.getStore().getAt(0));}if(g.getStore().getCount()>0){g.setValue(g.getStore().getAt(0));}if(mailFilterOption=="Descriptors_Only"){i.fromField.getComponent(0).setTitle(pageIntnl95);
i.toField.getComponent(0).setTitle(pageIntnl96);}}});},changeByTest:function(d){updateSettings=false;var i=d.getValue();var h=Ext.getCmp("filter").getValue();var b=Ext.getCmp("compTypesIn").getValue();var g=Ext.getCmp("CompTypes").getValue();var a=Ext.getCmp("serseg").getValue();var f="no";if(isConfigEnabled=="true"){var c=Ext.getCmp("TestTypes").getValue();
if(c=="configuration"){f="yes";}}var e="";if(mailFilterOption=="Descriptors_Only"){e="EgChangeUserProfile/data/EgMailAlertIncludeSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom;e=e+"&filterBy=filterByDescriptor&compTypesIn="+encodeURIComponent(b)+"&serseg="+encodeURIComponent(a)+"&serverType="+encodeURIComponent(g)+"&Test="+encodeURIComponent(i)+"&date="+new Date().getTime();
}else{e="EgChangeUserProfile/data/EgMailAlertSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom+"&configTestType="+f;e=e+"&filterBy="+h+"&compTypesIn="+encodeURIComponent(b)+"&serseg="+encodeURIComponent(a)+"&serverType="+encodeURIComponent(g)+"&Test="+encodeURIComponent(i)+"&date="+new Date().getTime();
}if(!Ext.isEmpty(i)&&i=="-1"){Ext.getCmp("searchbox").setDisabled(true);Ext.getCmp("searchbox").setValue("");}else{Ext.getCmp("searchbox").setDisabled(false);Ext.getCmp("searchbox").setValue("");}Ext.Ajax.request({url:e,method:"POST",timeout:120000,success:function(k){userMailJSON=Ext.decode(k.responseText);
var l=Ext.getCmp("exclude");l.getStore().removeAll();if(l.fromField.store.getCount()>0){l.fromField.store.removeAll();}if(l.toField.store.getCount()>0){l.toField.store.removeAll();}var j=Ext.getCmp("compName");j.getStore().loadRawData(userMailJSON.compNameArr);compNameArrTemp=userMailJSON.compNameArr;
if(mailFilterOption=="Descriptors_Only"){l.fromField.getComponent(0).setTitle(pageIntnl95);l.toField.getComponent(0).setTitle(pageIntnl96);}}});},changeByComponentName:function(e){var j=e.getValue();if(j==""||j=="-1"){var a=Ext.getCmp("exclude");a.getStore().removeAll();if(a.fromField.store.getCount()>0){a.fromField.store.removeAll();
}if(a.toField.store.getCount()>0){a.toField.store.removeAll();}return;}var i=Ext.getCmp("filter").getValue();var k=Ext.getCmp("Test").getValue();var h=Ext.getCmp("CompTypes").getValue();var b=Ext.getCmp("compTypesIn");var g="";if(mailFilterOption=="Descriptors_Only"){g="EgChangeUserProfile/data/EgMailAlertIncludeSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom;
g=g+"&filterBy=filterByDescriptor&compNames="+encodeURIComponent(j)+"&serverType="+encodeURIComponent(h)+"&Test="+encodeURIComponent(k);if(userMailJSON.isOtherGroupsFound==true){var c=b.getValue();g=g+"&compTypesIn="+c;if(b.getValue()!="cType"){var f=Ext.getCmp("serseg");if(f!=null&&f!=undefined){var d=f.getValue();
if(d!=null&&d!=undefined&&d!=""){g=g+"&serseg="+d;}}}}Ext.Ajax.request({url:g,method:"POST",timeout:120000,success:function(l){userMailJSON=Ext.decode(l.responseText);var o=Ext.getCmp("exclude");o.getStore().removeAll();if(o.fromField.store.getCount()>0){o.fromField.store.removeAll();}if(o.toField.store.getCount()>0){o.toField.store.removeAll();
}var m=userMailJSON["includedAlerts"];var n=userMailJSON["excludedAlerts"];if(!Ext.isEmpty(m)){o.fromField.store.add(m);}if(!Ext.isEmpty(n)){o.toField.store.add(n);}if(mailFilterOption=="Descriptors_Only"){o.fromField.getComponent(0).setTitle(pageIntnl95);o.toField.getComponent(0).setTitle(pageIntnl96);
}}});}else{g="EgChangeUserProfile/data/EgMailAlertSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom;g=g+"&filterBy="+i+"&compNames="+encodeURIComponent(j)+"&serverType="+encodeURIComponent(h)+"&Test="+encodeURIComponent(k);
if(userMailJSON.isOtherGroupsFound==true){var c=b.getValue();g=g+"&compTypesIn="+c;if(b.getValue()!="cType"){var f=Ext.getCmp("serseg");if(f!=null&&f!=undefined){var d=f.getValue();if(d!=null&&d!=undefined&&d!=""){g=g+"&serseg="+d;}}}}Ext.Ajax.request({url:g,method:"POST",timeout:120000,success:function(l){userMailJSON=Ext.decode(l.responseText);
var o=Ext.getCmp("exclude");o.getStore().removeAll();if(o.fromField.store.getCount()>0){o.fromField.store.removeAll();}if(o.toField.store.getCount()>0){o.toField.store.removeAll();}var m=userMailJSON["includedAlerts"];var n=userMailJSON["excludedAlerts"];if(!Ext.isEmpty(n)){o.fromField.store.add(n);}if(!Ext.isEmpty(m)){o.toField.store.add(m);
}if(mailFilterOption=="Descriptors_Only"){o.fromField.getComponent(0).setTitle(pageIntnl95);o.toField.getComponent(0).setTitle(pageIntnl96);}}});}},popCompTypes:function(d){updateSettings=false;var e=Ext.getCmp("uname").getValue();var i=Ext.getCmp("filter").getValue();var g=d.getValue();var b=Ext.getCmp("compTypesIn").getValue();
var a=Ext.getCmp("serseg").getValue();var h="no";if(isConfigEnabled=="true"){var c=Ext.getCmp("TestTypes").getValue();if(c=="configuration"){h="yes";}}var f="";if(mailFilterOption=="Descriptors_Only"){f="EgChangeUserProfile/data/EgMailAlertIncludeSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom;
f=f+"&filterBy=filterByDescriptor&serverType="+encodeURIComponent(g)+"&date="+new Date().getTime()+"&compTypesIn="+encodeURIComponent(b)+"&serseg="+encodeURIComponent(a);Ext.Ajax.request({url:f,method:"POST",timeout:120000,success:function(j){userMailJSON=Ext.decode(j.responseText);var n=Ext.getCmp("exclude");
var k=userMailJSON["includedAlerts"];var m=userMailJSON["excludedAlerts"];n.getStore().removeAll();if(n.fromField.store.getCount()>0){n.fromField.store.removeAll();}if(n.toField.store.getCount()>0){n.toField.store.removeAll();}if(!Ext.isEmpty(m)){n.fromField.store.add(m);}if(!Ext.isEmpty(k)){n.toField.store.add(k);
}var o=Ext.getCmp("serverTestsOuterCt");var l=Ext.getCmp("Test");Ext.getCmp("searchbox").setDisabled(true);Ext.getCmp("searchbox").setValue("");l.getStore().removeAll();Ext.getCmp("compName").getStore().removeAll();l.getStore().loadRawData(userMailJSON.testArray);l.setValue(userMailJSON.selectedDescriptorText);
if(mailFilterOption=="Descriptors_Only"){n.fromField.getComponent(0).setTitle(pageIntnl95);n.toField.getComponent(0).setTitle(pageIntnl96);}}});}else{f="EgChangeUserProfile/data/EgMailAlertSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom+"&configTestType="+h;
f=f+"&filterBy="+i+"&serverType="+encodeURIComponent(g)+"&compTypesIn="+encodeURIComponent(b)+"&serseg="+encodeURIComponent(a)+"&date="+new Date().getTime();Ext.Ajax.request({url:f,method:"POST",timeout:120000,success:function(j){userMailJSON=Ext.decode(j.responseText);var n=Ext.getCmp("exclude");var k=userMailJSON["includedAlerts"];
var m=userMailJSON["excludedAlerts"];n.getStore().removeAll();if(n.fromField.store.getCount()>0){n.fromField.store.removeAll();}if(n.toField.store.getCount()>0){n.toField.store.removeAll();}if(!Ext.isEmpty(m)){n.fromField.store.add(m);}if(!Ext.isEmpty(k)){n.toField.store.add(k);}var o=Ext.getCmp("serverTestsOuterCt");
var l=Ext.getCmp("Test");if(i=="filterByDescriptor"){l.getStore().removeAll();l.getStore().loadRawData(userMailJSON.testArray);l.setValue(userMailJSON.selectedDescriptorText);o.show();Ext.getCmp("compName").getStore().removeAll();Ext.getCmp("searchbox").setDisabled(true);Ext.getCmp("searchbox").setValue("");
l.show();}else{o.hide();l.hide();}if(mailFilterOption=="Descriptors_Only"){n.fromField.getComponent(0).setTitle(pageIntnl95);n.toField.getComponent(0).setTitle(pageIntnl96);}}});}},popTestTypes:function(g){updateSettings=false;var b=Ext.getCmp("filter").getValue();var c=g.getValue();var e=Ext.getCmp("compTypesIn").getValue();
var a=Ext.getCmp("CompTypes").getValue();var h=Ext.getCmp("serseg").getValue();var d="no";if(c=="configuration"){d="yes";}var f="";if(mailFilterOption=="Descriptors_Only"){f="EgChangeUserProfile/data/EgMailAlertIncludeSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom+"&configTestType="+d;
f=f+"&filterBy=filterByDescriptor&compTypesIn="+encodeURIComponent(e)+"&serseg="+encodeURIComponent(h)+"&serverType="+encodeURIComponent(a)+"&Test="+encodeURIComponent(viewByTest)+"&date="+new Date().getTime();}else{f="EgChangeUserProfile/data/EgMailAlertSuppressJson.jsp?selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom+"&serverType="+encodeURIComponent(a)+"&configTestType="+d;
f=f+"&filterBy="+b+"&serverType="+encodeURIComponent(serverType)+"&compTypesIn="+encodeURIComponent(e)+"&serseg="+encodeURIComponent(h)+"&date="+new Date().getTime();}Ext.Ajax.request({url:f,method:"POST",timeout:120000,success:function(i){userMailJSON=Ext.decode(i.responseText);var m=Ext.getCmp("exclude");
var j=userMailJSON["includedAlerts"];var l=userMailJSON["excludedAlerts"];m.getStore().removeAll();if(m.fromField.store.getCount()>0){m.fromField.store.removeAll();}if(m.toField.store.getCount()>0){m.toField.store.removeAll();}if(!Ext.isEmpty(l)){m.fromField.store.add(l);}if(!Ext.isEmpty(j)){m.toField.store.add(j);
}var n=Ext.getCmp("serverTestsOuterCt");var k=Ext.getCmp("Test");if(b=="filterByDescriptor"){k.getStore().removeAll();k.getStore().loadRawData(userMailJSON.testArray);k.setValue(userMailJSON.selectedDescriptorText);n.show();Ext.getCmp("compName").getStore().removeAll();Ext.getCmp("searchbox").setDisabled(true);
Ext.getCmp("searchbox").setValue("");k.show();}else{n.hide();k.hide();}if(mailFilterOption=="Descriptors_Only"){m.fromField.getComponent(0).setTitle(pageIntnl95);m.toField.getComponent(0).setTitle(pageIntnl96);}}});},getSelectedUsers:function(){var a="";if(Ext.getCmp("chkuser").getValue()==true){var b=Ext.getCmp("availusers").getSelected();
for(var c in b){a=a+b[c].get("valueField")+"~,~";}if(a.length>0){a=a.substring(0,a.length-3);}}return a;},updateResultPanel:function(){var c=userElementJSON.isElementsAssociated;var a=Ext.getCmp("userAssociationContainer");var b=Ext.getCmp("elementassociationcontainer");a.removeAll();if(c==true){a.add({xtype:"componentgroupedsummarygrid",store:new Ext.data.Store({fields:["col_1","category","col_2","col_3"],groupField:"category",data:userElementJSON.userTableData,})});
a.doLayout();Ext.getCmp("Expand").show();}else{Ext.getCmp("Expand").hide();var d='<div class = "iconInformation" style="margin:18% auto auto auto"></div><div>'+intnlLabel5+".</div>";var e={xtype:"component",width:"100%",border:false,style:{"text-align":"center"},html:d};a.add(e);}},updateUserMailSuppressList:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,timeout:120000,success:function(b){var c=b.responseText;
userMailJSON=Ext.decode(c);}});},updateUserElementPage:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,timeout:120000,success:function(b){var c=b.responseText;userElementJSON=Ext.decode(c);}});},validateUserForm:function(Z){var aN=this;var q=Ext.getCmp("userformcontainer");var aM=Ext.getCmp("uname").getValue();
if(aM=="-1"||aM=="none"){Ext.Msg.alert(pageTitle,userIDValidationMsg2);q.setActiveTab(0);return false;}var S=Ext.getCmp("org").getValue();if(S=="-1"||S=="none"){Ext.Msg.alert(pageTitle,userIDValidationMsg74,function(i){if(i=="ok"){Ext.getCmp("org").focus(true);}});q.setActiveTab(0);return false;}var aE=Ext.getCmp("utype").getValue();
if(aE=="-1"||aE=="none"){Ext.Msg.alert(pageTitle,userRoleValidationMsg,function(i){if(i=="ok"){Ext.getCmp("utype").focus(true);}});q.setActiveTab(0);return false;}var bc=publicJSON["hasmonitoraccess"];var a0=publicJSON["pwdLength"];var a4=publicJSON["pwdComplexityCount"];if(a0==""||a0<2){a0=8;}else{if(a0!=""&&a0<a4){a0=a4;
}}var af="";var aA="";var aF="";var s="";var aJ="";var a8="";var a1=true;var T=Ext.getCmp("utype").getValue();var w=Ext.getCmp("Never").getValue();var J;var a9;var ae;var B;var P;var G;var x;var aH;var M;var r;var b=" or ";var N="'";J=Ext.getCmp("tomailid");a9=Ext.getCmp("ccmailid");ae=Ext.getCmp("bccmailid");
G=J.getValue();x=a9.getValue();aH=ae.getValue();if(bc==true||bc=="true"){P=Ext.getCmp("escmailid");B=Ext.getCmp("customScript");M=B.getValue();r=P.getValue();}var d=Ext.getCmp("tilldate").getValue();var a6=Ext.getCmp("tilldate_h").getValue();var p=publicJSON.hiddenFields;var C=p.endHr;var h=p.endMin;
var e=p.currentdate;var n=p.startHr;var f=p.startMin;var aR;var aq="";if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){if(Ext.getCmp("eGAuthSAML").getValue()==true){aq="Eg";}else{if(Ext.getCmp("idpAuthSAML").getValue()==true){aq="SAML";}else{aq="Domain";}}}else{if(Ext.getCmp("eGAuth").getValue()==true){aq="Eg";
}else{aq="Domain";}}var aG=true;var ad=true;var au=/^(\+\d\d)?[0-9]+$/g;var aU=/(((([\+]?([0-9]){4,15})|([\_\#]?([a-zA-Z0-9]+[\ \_\.\-\&\#]?)*[a-zA-Z0-9])+)\@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])|((\+\d\d)?[0-9]+))/g;var av=Ext.getCmp("tomailid").getValue();var ar=Ext.getCmp("ccmailid").getValue();
var ap=Ext.getCmp("bccmailid").getValue();var ao=Ext.getCmp("escmailid").getValue();var Q=validateEmail(av);var ay=validateEmail(ar);var l=validateEmail(ap);var z=validateEmail(ao);var a3=(av).match(au);var aL=(ar).match(au);var E=(ap).match(au);var F=(ao).match(au);var A=(av).match(aU);var X=(ar).match(aU);
var U=(ap).match(aU);var D=(ao).match(aU);if(aq=="Eg"){var ah=Ext.getCmp("upass");var aQ=Ext.getCmp("confpasswd");var aS=Ext.getCmp("upass").getValue();aS=Ext.String.trim(aS);var H=Ext.getCmp("confpasswd").getValue();H=Ext.String.trim(H);var a7=publicJSON["changeObj"];var aW=aN.pwdComplexityCheck(aS);
if(aS==""){Ext.Msg.alert(pageTitle,userIDValidationMsg7,function(i){if(i=="ok"){ah.focus(true);}});q.setActiveTab(0);return false;}else{if(Ext.String.trim(aM.toLowerCase())==aS.toLowerCase()){Ext.Msg.show({title:pageTitle,msg:userpassMsg,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){ah.focus(true);
}});q.setActiveTab(0);return false;}else{if(!checkloginpass(aS)){q.setActiveTab(0);ah.focus(true);return false;}else{if((a7!=aS)&&(aS.length<a0)){Ext.Msg.alert(pageTitle,passLabel1+" "+a0+" "+passLabel2,function(i){if(i=="ok"){ah.focus(true);}});q.setActiveTab(0);return false;}else{if(aW.indexOf("false")>-1){var m=aW.substring(aW.indexOf("false#")+6);
Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg73+". "+passLabel1+" "+m+".",width:400,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){ah.focus(true);}});q.setActiveTab(0);return false;}else{if(!ad){Ext.Msg.alert(pageTitle,userIDValidationMsg9,function(i){if(i=="ok"){ah.focus(true);}});
q.setActiveTab(0);return false;}else{if(H==""){Ext.Msg.alert(pageTitle,userIDValidationMsg10,function(i){if(i=="ok"){aQ.focus(true);}});q.setActiveTab(0);return false;}else{if(!checkloginpass(H)){q.setActiveTab(0);aQ.focus(true);return false;}else{if(aS!=H){Ext.Msg.alert(pageTitle,userIDValidationMsg11,function(i){if(i=="ok"){aQ.focus(true);
}});q.setActiveTab(0);return false;}}}}}}}}}}if((G!="")&&(Q==false&&a3==null)&&(A!=av)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg15+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){J.focus(true);}});return false;}else{if(!validateSingleByte(av)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg16+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){J.focus(true);
}});return false;}else{if(aH!=""||x!=""){if(G==""){Ext.Msg.alert(pageTitle,userIDValidationMsg15,function(i){if(i=="ok"){J.focus(true);}});return false;}}}}if((x!="")&&(ay==null||ay==false)&&aL==null&&(X!=ar)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg17+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){a9.focus(true);
}});return false;}else{if(!validateSingleByte(ar)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg18+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){a9.focus(true);}});return false;}else{if((aH!="")&&(l==null||l==false)&&E==null&&U!=ap){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg19+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){ae.focus(true);
}});return false;}else{if(!validateSingleByte(ap)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg20+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){ae.focus(true);}});return false;}}}}if(Ext.getCmp("Never").getValue()==false){var a="";var W=e;var aR=formatDate(new Date(getDateFromFormat(Ext.getCmp("tilldate_h").getValue(),currentDFormat)),"MM/dd/yyyy");
Ext.getCmp("dateforpro").setValue(aR);if(!checkblank(d)){Ext.Msg.alert(pageTitle,userIDValidationMsg13,function(i){if(i=="ok"){Ext.getCmp("tmptilldate").focus(true);}});q.setActiveTab(0);return false;}else{if(!checkUserValidityTime(W,aR,n,C,f,h)){Ext.Msg.alert(pageTitle,userIDValidationMsg14,function(i){if(i=="ok"){Ext.getCmp("tmptilldate").focus(true);
}});q.setActiveTab(0);return false;}}}if(Z=="logoUpload"){return"userValid";}if(bc==true||bc=="true"){var s=Ext.getCmp("high").getValue();var aJ=Ext.getCmp("medium").getValue();var a8=Ext.getCmp("low").getValue();var I=Ext.getCmp("alarm_h").getValue();var c=Ext.getCmp("alarm_m").getValue();var t=Ext.getCmp("alarm_l").getValue();
if(s==true||aJ==true||a8==true){aA=Ext.getCmp("alarmNotify").notify;aF=Ext.getCmp("alarmMsgMode").msgmode;if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no"){if(!B.isVisible()&&!Ext.isEmpty(M)&&M.length>0){M="";}}if(G==""&&M==""){var bb=userIDValidationMsg43+N+userIDValidationMsg44+N+b+N+userIDValidationMsg45+N+".";
var y=500;if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no"){bb=userIDValidationMsg64;y=400;}if(G==""){Ext.Msg.show({title:pageTitle,msg:bb,buttons:Ext.Msg.OK,width:y,icon:"iconExclamation",fn:function(i){J.focus(true);}});return false;}else{Ext.Msg.show({title:pageTitle,msg:bb,buttons:Ext.Msg.OK,width:y,icon:"iconExclamation",fn:function(i){B.focus(true);
}});return false;}}if((G!="")&&(Q==false&&a3==null)&&(A!=av)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg15+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){J.focus(true);}});return false;}else{if(!validateSingleByte(av)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg16+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){J.focus(true);
}});return false;}else{if((x!="")&&(ay==null||ay==false)&&aL==null&&(X!=ar)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg17+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){a9.focus(true);}});return false;}else{if(!validateSingleByte(ar)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg18+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){a9.focus(true);
}});return false;}else{if((aH!="")&&(l==null||l==false)&&E==null&&U!=ap){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg19+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){ae.focus(true);}});return false;}else{if(!validateSingleByte(ap)){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg20+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){ae.focus(true);
}});return false;}}}}}}if(!checkspecial(M,"@*+=[]|;\"'<>?")){B.focus(true);return false;}if(r!=""&&(z==null||z==false)&&F==null&&D!=ao){Ext.Msg.alert(pageTitle,userIDValidationMsg22,function(i){if(i=="ok"){P.focus(true);}});return false;}else{if(!validateSingleByte(ao)){Ext.Msg.alert(pageTitle,userIDValidationMsg21,function(i){if(i=="ok"){P.focus(true);
}});return false;}}if(aH!=""||x!=""){if(G==""){Ext.Msg.alert(pageTitle,userIDValidationMsg15,function(i){if(i=="ok"){Ext.getCmp("tomailid").focus(true);}});return false;}}var L=Ext.getCmp("mailshift").getValue();if(G==""&&L==true){Ext.Msg.alert(pageTitle,userIDValidationMsg23+b+userIDValidationMsg24+N+userIDValidationMsg25+N,function(i){if(i=="ok"){Ext.getCmp("tomailid").focus(true);
}});return false;}if(G!=""&&L=="yes"){var j=true;if((G!=""&&Q==false)||(aH!=""&&l==false)||(x!=""&&ay==false)){var am=validateMailID(av);var al=validateMailID(ap);var ak=validateMailID(ar);if(!am&&!al&&!ak){j=false;}}if(!j){Ext.Msg.alert(pageTitle,userIDValidationMsg23+b+userIDValidationMsg24+N+userIDValidationMsg25+N,function(i){if(i=="ok"){Ext.getCmp("tomailid").focus(true);
}});return false;}}var aT=Ext.getCmp("smsshift").getValue();if(G==""&&aT==true){Ext.Msg.alert(pageTitle,userIDValidationMsg26+b+userIDValidationMsg24+N+userIDValidationMsg27+N,function(i){if(i=="ok"){Ext.getCmp("tomailid").focus(true);}});return false;}if(G!=""&&aT=="yes"){var aX=true;if((G!=""&&a3!=av)||(aH!=""&&E!=ap)||(x!=""&&aL!=ar)){var am=validateMobileNo(av);
var al=validateMobileNo(ap);var ak=validateMobileNo(ar);if(!am&&!al&&!ak){aX=false;}}if(!aX){Ext.Msg.alert(pageTitle,userIDValidationMsg26+b+userIDValidationMsg24+N+userIDValidationMsg27+N,function(i){if(i=="ok"){Ext.getCmp("tomailid").focus(true);}});return false;}}var at="";var ax;if(inputs>0){var az=Ext.getCmp("escmailid");
var aC=az.getValue();var v=validateEmail(aC);var a5=(aC).match(au);var D=(aC).match(aU);if(aC==""){Ext.Msg.alert(pageTitle,userIDValidationMsg28,function(i){if(i=="ok"){az.focus(true);}});return false;}else{if((v==null||v==false)&&a5==null&&D!=aC){Ext.Msg.alert(pageTitle,userIDValidationMsg28,function(i){if(i=="ok"){az.focus(true);
}});return false;}else{if(!validateSingleByte(az.value)){Ext.Msg.alert(pageTitle,userIDValidationMsg29,function(i){if(i=="ok"){az.focus(true);}});return false;}}}}for(var R=0;R<=inputs;R++){var aZ=(("escmailid")+R);var ai=Ext.getCmp(aZ);if(ai==null){continue;}var V=ai.getValue();if(V==""){Ext.Msg.alert(pageTitle,userIDValidationMsg30+(R+2)+userIDValidationMsg31,function(){if(P.getValue()==""){P.focus(true);
}else{ai.focus(true);}});return false;}var aa=validateEmail(V);var aP=(V).match(au);var ag=(V).match(aU);if((aa==null||aa==false)&&aP==null&&ag!=V){Ext.Msg.alert(pageTitle,userIDValidationMsg30+(R+2)+userIDValidationMsg31,function(){if(P.value==""){P.focus(true);}else{ai.focus(true);}});return false;
}else{if(!validateSingleByte(V)){Ext.Msg.alert(pageTitle,userIDValidationMsg30+(R+2)+userIDValidationMsg32);return false;}}}if(aA==""){Ext.Msg.alert(pageTitle,userIDValidationMsg33);return false;}if(aF==""){Ext.Msg.alert(pageTitle,userIDValidationMsg34);return false;}}if(I==false&&c==false&&t==false){Ext.Msg.alert(pageTitle,userIDValidationMsg35);
return false;}}var k=parseInt(noOfShiftPeriods);var L=Ext.getCmp("mailshift").getValue().mailshift;if(L!=null&&L=="yes"){for(var R=0;R<k;R++){var u=Ext.getCmp("mailday"+R);var g=Ext.getCmp("mailshift"+R);if(u==null||g==null){continue;}if((s==true||aJ==true||a8==true)&&(!checkblank(u.getValue())||!checkblank(g.getValue()))){Ext.Msg.alert(pageTitle,userIDValidationMsg36);
return false;}}}var ab=Ext.getCmp("smsshift").getValue().smsshift;if(ab!=null&&ab=="yes"){for(var R=0;R<k;R++){var a2=Ext.getCmp("smsday"+R);var aO=Ext.getCmp("smsshift"+R);if(a2==null||aO==null){continue;}if((s==true||aJ==true||a8==true)&&(!checkblank(a2.getValue())||!checkblank(aO.getValue()))){Ext.Msg.alert(pageTitle,userIDValidationMsg37);
return false;}}}var aI=Ext.getCmp("escshift").getValue().escshift;if(aI!=null&&aI=="yes"){if(P!=null&&P.value==""){Ext.Msg.alert(pageTitle,userIDValidationMsg28+b+userIDValidationMsg24+N+userIDValidationMsg38+N);return false;}for(var R=0;R<k;R++){var o=Ext.getCmp("escday"+R);var aD=Ext.getCmp("escshift"+R);
if(o==null||aD==null){continue;}if((s==true||aJ==true||a8==true)&&(!checkblank(o.getValue())||!checkblank(aD.getValue()))){Ext.Msg.alert(pageTitle,userIDValidationMsg39);return false;}}}var aV=Ext.getCmp("Execshift").getValue().Execshift;if(aV!=null&&aV=="yes"){var ac=Ext.getCmp("customScript").getValue();
if(ac==""){Ext.Msg.alert(pageTitle,userIDValidationMsg40+b+userIDValidationMsg24+N+userIDValidationMsg41+N,function(i){if(i=="ok"){Ext.getCmp("customScript").focus(true);}});return false;}for(var R=0;R<k;R++){var u=Ext.getCmp("Execday"+R);var g=Ext.getCmp("Execshift"+R);if(u==null||g==null){continue;
}if((s==true||aJ==true||a8==true)&&(!checkblank(u.getValue())||!checkblank(g.getValue()))){Ext.Msg.alert(pageTitle,userIDValidationMsg42);return false;}}}var aB=Ext.getCmp("loginLogo1").getValue();var Y=Ext.getCmp("monitorLogo1").getValue();var an=Ext.getCmp("reporterLogo1").getValue();var O=Ext.getCmp("configLogo1").getValue();
if(aB=="hide"){Ext.getCmp("loginImageStatus").setValue("");Ext.getCmp("loginImageUploadStatusForAudit").setValue("no");}else{if(!isLoginImgUpdated){Ext.Msg.alert(pageTitle,uploadImgMsg+" '"+uploadImgMsg4+"'");return false;}Ext.getCmp("loginImageUploadStatusForAudit").setValue("yes");}if(Y=="hide"){Ext.getCmp("monitorImageStatus").setValue("");
Ext.getCmp("monitorImageUploadStatusForAudit").setValue("no");}else{if(!isAdminMonImgUpdated){Ext.Msg.alert(pageTitle,uploadImgMsg+" '"+uploadImgMsg5+"' "+uploadImgMsg1);return false;}Ext.getCmp("monitorImageUploadStatusForAudit").setValue("yes");}if(an=="hide"){Ext.getCmp("reporterImageStatus").setValue("");
Ext.getCmp("reporterImageUploadStatusForAudit").setValue("no");}else{Ext.getCmp("reporterImageUploadStatusForAudit").setValue("yes");}if(O=="hide"){Ext.getCmp("configMgmtImageStatus").setValue("");Ext.getCmp("configMgmtImageUploadStatusForAudit").setValue("no");}else{Ext.getCmp("configMgmtImageUploadStatusForAudit").setValue("yes");
}var aw=Ext.getCmp("logoCheck").getValue();if(aw==true){Ext.getCmp("reporterImageStatus").setValue("");Ext.getCmp("reporterImageUploadStatusForAudit").setValue("no");Ext.getCmp("configMgmtImageStatus").setValue("");Ext.getCmp("configMgmtImageUploadStatusForAudit").setValue("no");}else{if(an=="show"&&T!="AlarmViewer"&&T!="SuperAlarmViewer"){if(!isRepImgUpdated){Ext.Msg.alert(pageTitle,uploadImgMsg+" '"+uploadImgMsg6+"' "+uploadImgMsg1);
return false;}}if(O=="show"&&T!="AlarmViewer"&&T!="SuperAlarmViewer"&&isConfigEnabled=="true"){if(!isConfigImgUpdated){Ext.Msg.alert(pageTitle,uploadImgMsg+" '"+uploadImgMsg7+"' "+uploadImgMsg1);return false;}}}var ba=new Boolean(true);var aj=publicJSON["is2FACFlagEnabled"];var aY=Ext.getCmp("userAuthSAML").isVisible();
var aK=Ext.getCmp("idpAuthSAML").getGroupValue();if(aY&&aK.toLowerCase()=="saml"){ba=new Boolean(false);}if(ba==true&&!Ext.isEmpty(aj)&&aj.toLowerCase()=="yes"){var K=Ext.getCmp("tomailid").getValue();if(Ext.isEmpty(K)||Ext.String.trim(K).length==0){Ext.Msg.show({title:pageTitle,msg:userIDValidationMsg65+". "+userIDValidationMsg66,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(i){Ext.getCmp("tomailid").focus(true);
}});return false;}}return true;},removeVM:function(a){var b="/final/admin/EgChangeUserProfile/data/EgUserSiteServersJson.jsp?qctr=1&reqfrom=removeVM&vmdetails="+encodeURI(parent.filterEncode(a));Ext.Ajax.request({url:b,method:"POST",async:false,timeout:120000,success:function(k){var e=k.responseText;
var j=Ext.getCmp("virtualServers");var g=j.getValue();var l=Ext.getCmp("utype").getValue();var d=Ext.getCmp("associate").getValue();var c="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?showAssociatedData=yes&qctr=1&selectedTab=3&assousers="+encodeURIComponent(associatedUserIDs)+"&username="+encodeURIComponent(selectedUserID)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom=add&utype="+l+"&associate="+encodeURIComponent(d);
if(d=="Independent servers"){var h=Ext.getCmp("associate").getValue();var m=Ext.getCmp("vmselectionall").getValue();var f=Ext.getCmp("vmselectionpattern").getValue();var i=Ext.getCmp("vmselectionspecific").getValue();patternVal=Ext.getCmp("patternName").getValue();if(!Ext.isEmpty(m)&&m){c=c+"&compType="+encodeURIComponent(h)+"&type=allVms&vHost="+encodeURI(g);
}else{if(!Ext.isEmpty(f)&&f){c=c+"&compType="+encodeURIComponent(h)+"&type=vmPattern&vHost="+encodeURI(g);}else{if(!Ext.isEmpty(i)&&i){c=c+"&compType="+encodeURIComponent(h)+"&type=specVms&vHost="+encodeURI(g);}else{c=c+"&compType="+encodeURIComponent(h);}}}}EgChangeUserProfile.app.getController("Main").updateUserElementPage(c);
EgChangeUserProfile.app.getController("Main").updateResultPanel();}});},viewUserAssociatedElements:function(){var a=this;Ext.widget("window",{extend:"Ext.panel.Panel",title:intnlLabel6,id:"userElementsWindow",width:"95%",padding:"5 10 10 10",height:450,modal:true,border:false,autoScroll:true,closeAction:"destory",doClose:function(){this.destroy();
},listeners:{afterrender:function(){var h=Ext.getCmp("virtualServers");var e=h.getValue();var i=Ext.getCmp("utype").getValue();var c=Ext.getCmp("associate").getValue();var b="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?showAssociatedData=yes&qctr=1&selectedTab=3&assousers="+encodeURIComponent(associatedUserIDs)+"&username="+encodeURIComponent(selectedUserID)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom=add&utype="+i+"&associate="+encodeURIComponent(c);
if(c=="Independent servers"){var f=Ext.getCmp("associate").getValue();var j=Ext.getCmp("vmselectionall").getValue();var d=Ext.getCmp("vmselectionpattern").getValue();var g=Ext.getCmp("vmselectionspecific").getValue();patternVal=Ext.getCmp("patternName").getValue();if(!Ext.isEmpty(j)&&j){b=b+"&compType="+encodeURIComponent(f)+"&type=allVms&vHost="+encodeURI(e);
}else{if(!Ext.isEmpty(d)&&d){b=b+"&compType="+encodeURIComponent(f)+"&type=vmPattern&vHost="+encodeURI(e);}else{if(!Ext.isEmpty(g)&&g){b=b+"&compType="+encodeURIComponent(f)+"&type=specVms&vHost="+encodeURI(e);}else{b=b+"&compType="+encodeURIComponent(f);}}}}a.updateUserElementPage(b);a.updateResultPanel();
}},items:[{xtype:"container",layout:"hbox",layout:{type:"hbox",align:"end",pack:"end"},items:[{xtype:"container",flex:1},{xtype:"button",cls:"dummybtuserprofile",id:"Expand",margin:"5 6 0 10",currentStatus:"expanded",html:'<div style="cursor:pointer;text-decoration:underline;float:right;font-size:11px;padding:2px;text-transform: lowercase;" id="exx">collapse all</div>',handler:function(){var d=Ext.getCmp("Expand");
if(d.currentStatus=="expanded"){d.update('<div style="cursor:pointer;text-decoration:underline;float:right;font-size:11px;padding:2px;text-transform: lowercase;" id="exx">expand all</div>');d.currentStatus="collapse";var b=Ext.getCmp("componentgroupedsummarygrid");var c=b.view.getFeature("componentGrouping");
c.collapseAll();}else{d.currentStatus="expanded";d.update('<div style="cursor:pointer;text-decoration:underline;float:right;font-size:11px;padding:2px;text-transform: lowercase;" id="exx">collapse all</div>');var b=Ext.getCmp("componentgroupedsummarygrid");var c=b.view.getFeature("componentGrouping");
c.expandAll();}}}]},{xtype:"container",id:"userAssociationContainer",layout:{type:"hbox",},margin:"5 10 10 10"}]}).show();},viewFilteredElements:function(){var a=this;Ext.widget("window",{extend:"Ext.panel.Panel",id:"userFilterWindow",width:"95%",height:450,border:false,modal:true,autoScroll:true,closeAction:"destory",doClose:function(){this.destroy();
},listeners:{afterrender:function(){if(mailFilterOption=="Descriptors_Only"){var c=filterMessage2+": "+changeDisplayName(selectedUserID);Ext.getCmp("userFilterWindow").setTitle(c);var b="EgChangeUserProfile/data/EgMailAlertIncludeSuppress.jsp?showAssociatedData=yes&selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom+"&date="+new Date().getTime();
a.updateDescriptorHTMLFiltePanel(b);}else{var c=filterMessage+": "+changeDisplayName(selectedUserID);Ext.getCmp("userFilterWindow").setTitle(c);var b="EgChangeUserProfile/data/EgMailAlertSuppress.jsp?showAssociatedData=yes&selectedTab=4&userID="+encodeURIComponent(parent.filterEncode(selectedUserID))+"&mailFilterOption="+mailFilterOption+"&reqfrom="+reqFrom+"&date="+new Date().getTime();
a.updateHTMLFilterResultPanel(b);}}},items:[{xtype:"container",id:"userFilterContainer",layout:{type:"vbox",pack:"center",align:"center"},defaults:{margin:8}}]}).show();},searchComponent:function(b,j){var k=this,c;if(b=="managed"){c="managedSeacrchBox";}else{c="unmanagedSeacrchBox";}if(j==""||j.length==0){Ext.get("MyTrigger_"+c+"_0").setStyle("display","none");
Ext.get("MyTrigger_"+c+"_1").setStyle("display","block");}else{Ext.get("MyTrigger_"+c+"_1").setStyle("display","none");Ext.get("MyTrigger_"+c+"_0").setStyle("display","block");}var d=Ext.getCmp("virtualServers").getValue();var f="";var k=this;var h=Ext.getCmp("utype").getValue();var g=Ext.getCmp("compType").getValue();
var a=Ext.getCmp("associate").getValue();var i=Ext.getCmp("virtualTypes").getValue();var e="associate="+a+"&username="+encodeURIComponent(selectedUserID)+"&qctr=1&compType="+encodeURI(g)+"&assousers="+encodeURIComponent(associatedUserIDs)+"&newusers="+encodeURIComponent(associatedUserIDs)+"&isAlarmEnabled="+isAlarmEnabled+"&filterMailAlt="+isFilterMailAlertsEnabled+"&reqfrom="+reqFrom+"&utype="+h+"&vServer="+i;
if(j.length==0||j=="Search"){f="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?qctr=1&selectedTab=3&"+e;}else{f="EgChangeUserProfile/data/EgUserSiteServersJson.jsp?qctr=1&selectedTab=3&"+e+"&strSearch="+j+"&strComponent="+b;}Ext.Ajax.request({url:f,method:"POST",params:{vHost:encodeURI(d)},async:false,timeout:120000,success:function(l){var n=l.responseText;
userElementJSON=Ext.decode(n);if(b=="managed"){var o=Ext.getCmp("otherHosts");var p=userElementJSON["associatedItems"];if(o.fromField.store.getCount()>0){o.fromField.store.removeAll();}o.fromField.store.add(p);}else{var o=Ext.getCmp("otherHosts");var m=userElementJSON["disAssociatedItems"];if(o.toField.store.getCount()>0){o.toField.store.removeAll();
}o.toField.store.add(m);}}});},onSrvGroupChange:function(e){var c=e.getValue();Ext.getCmp("selectedServerListGrid").getStore().each(function(g){if(!Ext.isEmpty(g.get("valueField_1"))){srvListArray.push(g.get("valueField_1"));}if(!Ext.isEmpty(g.get("valueField_2"))){srvListArray.push(g.get("valueField_2"));
}if(!Ext.isEmpty(g.get("valueField_3"))){srvListArray.push(g.get("valueField_3"));}});var d=Ext.getCmp("selectedCompDetails");if(d.fromField.store.getCount()>0){d.fromField.store.removeAll();}if(d.toField.store.getCount()>0){d.toField.store.removeAll();}var b="EgChangeUserProfile/data/EgConfigureCompTypeJson.jsp?from=commonSettings&DiscOptions="+c+"&ServerDisplay="+srvListArray+"&LoadCount="+loadCount;
this.updateCofigData(b);var f=userCompJSON["generalSettings"]["discSrvrArray"];var a=userCompJSON["generalSettings"]["allSrvrArray"];d.fromField.store.add(f);d.toField.store.add(a);loadCount++;},updateCofigData:function(a){Ext.Ajax.request({url:a,method:"POST",async:false,timeout:120000,success:function(b){var c=b.responseText;
userCompJSON=Ext.decode(c);}});},applySeverChange:function(){var c=this;var d=srvListArray;var b=srvListArray.toString();var a=new Ext.LoadMask(Ext.getBody(),{msg:"Saving..."});a.show();Ext.Ajax.request({url:"EgChangeUserProfile/data/EgConfigureCompTypeJson.jsp?LoadCount="+loadCount,params:{"from":"commonSettings","selectedCompDetails":b},timeout:120000,success:function(f){a.hide();
userCompJSON=Ext.decode(f.responseText);var g=Ext.getCmp("selectedServerListGrid");g.getStore().loadRawData(userCompJSON["generalSettings"]["configuredServersList"]);var e=parseInt(userCompJSON["generalSettings"]["configuredServersCount"]);g.doLayout();g.view.refresh();if(e>9){g.setHeight(100);}Ext.getCmp("resultHeaderCt").show();
isApplied=true;if(isSavedFromPrompt){compSaveMask.hide();Ext.getCmp("configurationWindow").close();}}});},refreshWindow:function(){var a=Ext.getCmp("selectedServerListGrid");a.getStore().loadRawData(userCompJSON["generalSettings"]["configuredServersList"]);a.doLayout();a.view.refresh();}});function validateMailID(b){var f=/^(\+\d\d)?[0-9]+$/g;
var a=b.split(",");var d=a.length;var h=false;if(d!=null&&d==1){var e=validateEmail(a);if(a!=null&&e==true){var h=true;}}else{for(var c=0;c<a.length;c++){var e=validateEmail(a[c]);var g=a[c].match(f);if(a[c]!=null&&e==true){h=true;}else{if(a[c]!=null&&g==a[c]){continue;}else{h=false;break;}}}}return h;
}function validateMobileNo(b){var g=/^(\+\d\d)?[0-9]+$/g;var a=b.split(",");var e=a.length;var c=false;if(e!=null&&e==1){var h=a.toString().match(g);if(a!=null&&h==a.toString()){c=true;}}else{for(var d=0;d<a.length;d++){var h=a[d].match(g);var f=validateEmail(a[d]);if(a[d]!=null&&h==a[d]){c=true;}else{if(a[d]!=null&&f==true){continue;
}else{c=false;break;}}}}return c;}function addContact(){var a=Ext.getCmp("userformcontainer");if(inputs==4){Ext.MessageBox.alert(pageTitle,userIDValidationMsg46);return;}var b=Ext.getCmp("escMailIDsDiv");var e=inputs+2;var c="con_"+inputs;var d={xtype:"container",id:c,layout:"column",items:[{xtype:"textfield",id:"escmailid"+inputs,cls:"textbox",name:"escmailid"+inputs,fieldLabel:"Level "+e,labelAlign:"top",labelSeparator:" ",columnWidth:0.97,margin:"1 0 10 0"},{xtype:"container",columnWidth:0.03,margin:"20 0 5 2",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove level"});
}},style:{background:"none",border:"0px"},handler:function(){removeContact(c);}}]}]};b.add(d);a.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("escmailid").getBox().y-200);inputs++;}function addEscLevel(b){var a=Ext.getCmp("escMailIDsDiv");var e=inputs+2;var c="con_"+inputs;var d={xtype:"container",id:c,layout:"column",items:[{xtype:"textfield",id:"escmailid"+inputs,cls:"textbox",name:"escmailid"+inputs,fieldLabel:"Level "+e,labelAlign:"top",labelSeparator:" ",columnWidth:0.97,margin:"1 0 10 0",value:b,},{xtype:"container",columnWidth:0.03,margin:"20 0 5 2",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove level"});
}},style:{background:"none",border:"0px"},handler:function(){removeContact(c);}}]}]};a.add(d);inputs++;}function removeContact(b){var d=Ext.getCmp("escMailIDsDiv");d.remove(b);inputs--;var g=d.items.length-1;if(g>0){inputs=0;var e=0;for(var c=0;c<=g;c++){var a=Ext.getCmp("con_"+c);if(a==null||a==undefined){continue;
}var h=a.getId();var f=Ext.getCmp("escmailid"+c).getValue();d.remove(h);addEscLevel(f);}}Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("escmailid").getBox().y-200);}function addShifts(e){var d;if(e=="mail"){var b=Ext.getCmp("emailMailAlert");if(mailShiftPeriodsCount==noOfShiftPeriods-1){Ext.MessageBox.alert(pageTitle,userIDValidationMsg47+" ("+noOfShiftPeriods+")");
return;}d=mailShiftPeriodsCount;b.add(getMailShiftTemplate(d,"",""));mailShiftPeriodsCount++;b.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("mailday0").getBox().y-200);}else{if(e=="Exec"){var c=Ext.getCmp("commandAlert");if(ExecShiftPeriodsCount==noOfShiftPeriods-1){Ext.MessageBox.alert(pageTitle,userIDValidationMsg47+" ("+noOfShiftPeriods+")");
return;}d=ExecShiftPeriodsCount;c.add(getExecTemplate(d,"",""));ExecShiftPeriodsCount++;c.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("Execday0").getBox().y-200);}else{if(e=="sms"){var a=Ext.getCmp("smsAlert");if(smsShiftPeriodsCount==noOfShiftPeriods-1){Ext.MessageBox.alert(pageTitle,userIDValidationMsg47+" ("+noOfShiftPeriods+")");
return;}d=smsShiftPeriodsCount;a.add(getSMSTemplate(d,"",""));smsShiftPeriodsCount++;a.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("smsday0").getBox().y-200);}else{if(e=="esc"){var f=Ext.getCmp("escMailAlert");if(escShiftPeriodsCount==noOfShiftPeriods-1){Ext.MessageBox.alert(pageTitle,userIDValidationMsg47+" ("+noOfShiftPeriods+")");
return;}d=escShiftPeriodsCount;f.add(getEscTemplate(d,"",""));escShiftPeriodsCount++;f.doLayout();Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("escday0").getBox().y-200);}}}}}function getMailTemplate(c,a,e,f,d){var b={xtype:"container",margin:5,layout:"column",items:[{xtype:"textfield",id:f,name:f,cls:"textbox",fieldLabel:userIDValidationMsg52,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:a,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showDaysPicker(\''+f+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"textfield",id:d,name:d,cls:"textbox",fieldLabel:userIDValidationMsg53,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:e,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showShiftsPicker(\''+d+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"container",columnWidth:0.04,margin:"22 0 5 30",items:[{xtype:"button",iconCls:"img_addShift",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"add shift period"});
}},style:{background:"none",border:"0px"},handler:function(){addShifts(c);}}]}]};return b;}function insertShiftData(e,d,g){if(e=="mail"){var b=Ext.getCmp("emailMailAlert");b.add(getMailTemplate(e,d,g,"mailday0","mailshift0"));}else{if(e=="Exec"){var c=Ext.getCmp("commandAlert");c.add(getMailTemplate(e,d,g,"Execday0","Execshift0"));
}else{if(e=="sms"){var a=Ext.getCmp("smsAlert");a.add(getMailTemplate(e,d,g,"smsday0","smsshift0"));}else{if(e=="esc"){var f=Ext.getCmp("escMailAlert");f.add(getMailTemplate(e,d,g,"escday0","escshift0"));}}}}}function addMoreShifts(f,d,h){var e;if(f=="mail"){var b=Ext.getCmp("emailMailAlert");e=mailShiftPeriodsCount;
b.add(getMailShiftTemplate(e,d,h));mailShiftPeriodsCount++;b.doLayout();}else{if(f=="Exec"){var c=Ext.getCmp("commandAlert");e=ExecShiftPeriodsCount;c.add(getExecTemplate(e,d,h));ExecShiftPeriodsCount++;c.doLayout();}else{if(f=="sms"){var a=Ext.getCmp("smsAlert");e=smsShiftPeriodsCount;a.add(getSMSTemplate(e,d,h));
smsShiftPeriodsCount++;a.doLayout();}else{if(f=="esc"){var g=Ext.getCmp("escMailAlert");e=escShiftPeriodsCount;g.add(getEscTemplate(e,d,h));escShiftPeriodsCount++;g.doLayout();}}}}}function removeMailShift(a){var b=Ext.getCmp("emailMailAlert");b.remove(a);mailShiftPeriodsCount--;Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("mailday0").getBox().y-200);
}function removeExecShift(a){var b=Ext.getCmp("commandAlert");b.remove(a);ExecShiftPeriodsCount--;Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("Execday0").getBox().y-200);}function removeSMSShift(a){var b=Ext.getCmp("smsAlert");b.remove(a);smsShiftPeriodsCount--;Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("smsday0").getBox().y-200);
}function removeEscShift(a){var b=Ext.getCmp("escMailAlert");b.remove(a);escShiftPeriodsCount--;Ext.getCmp("userpref").body.scroll("bottom",Ext.getCmp("escday0").getBox().y-200);}function getMailShiftTemplate(g,a,d){var f="mailday"+(g+1);var c="mailshift"+(g+1);var e="mailShift_"+g;var b={xtype:"container",id:e,margin:5,layout:"column",items:[{xtype:"textfield",id:f,name:f,cls:"textbox",fieldLabel:userIDValidationMsg52,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:a,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showDaysPicker(\''+f+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"textfield",id:c,name:c,cls:"textbox",fieldLabel:userIDValidationMsg53,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:d,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showShiftsPicker(\''+c+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"container",columnWidth:0.04,margin:"22 0 5 30",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove shift peroid"});
}},style:{background:"none",border:"0px"},handler:function(){removeMailShift(e);}}]}]};return b;}function getExecTemplate(g,a,d){var f="Execday"+(g+1);var c="Execshift"+(g+1);var e="ExecShift_"+g;var b={xtype:"container",id:e,margin:5,layout:"column",items:[{xtype:"textfield",id:f,cls:"textbox",name:f,fieldLabel:userIDValidationMsg52,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:a,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showDaysPicker(\''+f+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"textfield",id:c,cls:"textbox",name:c,fieldLabel:userIDValidationMsg53,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:d,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showShiftsPicker(\''+c+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"container",columnWidth:0.04,margin:"22 0 5 30",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove shift peroid"});
}},style:{background:"none",border:"0px"},handler:function(){removeExecShift(e);}}]}]};return b;}function getSMSTemplate(g,a,d){var f="smsday"+(g+1);var c="smsshift"+(g+1);var e="SMSShift_"+g;var b={xtype:"container",id:e,margin:5,layout:"column",items:[{xtype:"textfield",id:f,cls:"textbox",name:f,fieldLabel:userIDValidationMsg52,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:a,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showDaysPicker(\''+f+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"textfield",id:c,cls:"textbox",name:c,fieldLabel:userIDValidationMsg53,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:d,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showShiftsPicker(\''+c+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"container",columnWidth:0.04,margin:"22 0 5 30",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove shift peroid"});
}},style:{background:"none",border:"0px"},handler:function(){removeSMSShift(e);}}]}]};return b;}function getEscTemplate(g,a,d){var f="escday"+(g+1);var c="escshift"+(g+1);var e="ESCShift_"+g;var b={xtype:"container",id:e,margin:5,layout:"column",items:[{xtype:"textfield",id:f,cls:"textbox",name:f,fieldLabel:userIDValidationMsg52,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:a,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showDaysPicker(\''+f+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"textfield",id:c,cls:"textbox",name:c,fieldLabel:userIDValidationMsg53,labelAlign:"top",labelSeparator:" ",columnWidth:0.4,margin:"1 0 10 20",value:d,readOnly:true,},{xtype:"component",html:'<center><img src="/final/admin/eg_images/calendar.gif" style="cursor:pointer;" border="0" width="20" height="18" onclick="javascript:showShiftsPicker(\''+c+"')\"></center>",columnWidth:0.03,margin:"22 0 5 2"},{xtype:"container",columnWidth:0.04,margin:"22 0 5 30",items:[{xtype:"button",iconCls:"iconMinus",listeners:{afterrender:function(){Ext.create("Ext.tip.ToolTip",{target:this.id,anchor:"top",cls:"yellowTip",trackMouse:true,html:"remove shift peroid"});
}},style:{background:"none",border:"0px"},handler:function(){removeEscShift(e);}}]}]};return b;}function showDaysPicker(e){var d=publicJSON["daysPicker"];var c=Ext.create("Ext.window.Window",{title:"DAYS",width:150,modal:true,doClose:function(){this.destroy();},buttonAlign:"center",items:[{xtype:"multiselectSi",cls:"multiselect",width:200,scroll:true,name:"multiselect",labelAlign:"left",id:"daysList",name:"daysList",store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local"}],buttons:[{text:"Add",id:"daysAdd",name:"daysAdd",ui:"newButtonSmall",margin:"0 0 10 0",handler:function(){var f="";
var h=Ext.getCmp("daysList");var g=h.getSelected();if(!Ext.isEmpty(g)){for(key in g){f=f+g[key].get("valueField")+",";}f=f.substring(0,f.length-1);Ext.getCmp(e).setValue(f);c.destroy();c=null;}else{Ext.MessageBox.alert(pageTitle,"Please choose a day");}}}]}).show();var b=Ext.getCmp("daysList");b.getStore().loadRawData(d);
var a=Ext.getCmp(e).getValue();b.setValue(a);}function showShiftsPicker(a){var c=0;var b=Ext.create("Ext.window.Window",{title:"SHIFTS",requires:["EgChangeUserProfile.view.ShiftsPicker"],width:460,modal:true,id:"shiftsPickerWinow",doClose:function(){tmpShiftPeriodsCount=0;this.destroy();},buttonAlign:"center",items:[{xtype:"shiftspicker",border:false,listeners:{afterrender:function(){var p=Ext.getCmp(a).getValue();
var q=publicJSON["shiftsPickerHour"];var f=publicJSON["shiftsPickerMi"];Ext.getCmp("frHr0").getStore().loadRawData(q);Ext.getCmp("frMi0").getStore().loadRawData(f);Ext.getCmp("toHr0").getStore().loadRawData(q);Ext.getCmp("toMi0").getStore().loadRawData(f);if(Ext.isEmpty(p)){Ext.getCmp("frHr0").setValue(Ext.getCmp("frHr0").getStore().getAt(0).get("valueField"));
Ext.getCmp("frMi0").setValue(Ext.getCmp("frMi0").getStore().getAt(0).get("valueField"));Ext.getCmp("toHr0").setValue(Ext.getCmp("toHr0").getStore().getAt(0).get("valueField"));Ext.getCmp("toMi0").setValue(Ext.getCmp("toMi0").getStore().getAt(0).get("valueField"));}else{var g=p.split(",");var e=1;for(var j=0;
j<g.length;j++){if(e>1){c=c+30;addShiftTimeTemp();}var h=g[j];var n=h.substring(0,h.indexOf("-"));var m=h.substring(h.indexOf("-")+1);var d=n.substring(0,n.indexOf(":"));var l=n.substring(n.indexOf(":")+1);var o=m.substring(0,m.indexOf(":"));var k=m.substring(m.indexOf(":")+1);Ext.getCmp("frHr"+j).setValue(d);
Ext.getCmp("frMi"+j).setValue(l);Ext.getCmp("toHr"+j).setValue(o);Ext.getCmp("toMi"+j).setValue(k);e++;}}}}}],buttons:[{text:"Add",ui:"newButtonSmall",margin:"0 0 10 0",handler:function(){if(checkInputs()){var d="";for(var g=0;g<5;g++){var k=Ext.getCmp("frHr"+g);if(k==null){continue;}var h=Ext.getCmp("frMi"+g);
var j=Ext.getCmp("toHr"+g);var f=Ext.getCmp("toMi"+g);var e=k.value+":"+h.value+"-"+j.value+":"+f.value;d+=e+",";}d=d.substring(0,d.length-1);Ext.getCmp(a).setValue(d);b.destroy();b=null;tmpShiftPeriodsCount=0;}}}]}).show();}function addShiftTime(){var b=Ext.getCmp("shiftspicker");if(tmpShiftPeriodsCount>3){Ext.MessageBox.alert(pageTitle,userIDValidationMsg48);
return;}b.add(getShiftTimeTemplate(tmpShiftPeriodsCount));addValuesToTimePicker(tmpShiftPeriodsCount);tmpShiftPeriodsCount++;var a=Ext.getCmp("shiftsPickerWinow");b.doLayout();}function addShiftTimeTemp(){var b=Ext.getCmp("shiftspicker");b.add(getShiftTimeTemplate(tmpShiftPeriodsCount));addValuesToTimePicker(tmpShiftPeriodsCount);
tmpShiftPeriodsCount++;var a=Ext.getCmp("shiftsPickerWinow");b.doLayout();}function removeShiftTime(b){var c=Ext.getCmp("shiftspicker");c.remove(b);tmpShiftPeriodsCount--;var a=Ext.getCmp("shiftsPickerWinow");c.doLayout();}function getShiftTimeTemplate(g){var e="frHr"+(g+1);var d="frMi"+(g+1);var c="toHr"+(g+1);
var a="toMi"+(g+1);var f="shiftTime"+g;var b={xtype:"container",id:"shiftTime"+g,layout:{type:"hbox",padding:5},items:[{xtype:"fieldcontainer",layout:{type:"hbox",},labelAlign:"top",labelSeparator:" ",fieldLabel:"From",items:[{xtype:"scrollcombo",id:e,name:e,cls:"dropdown",editable:false,store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local",width:100,},{xtype:"tbspacer",width:20},{xtype:"scrollcombo",id:d,name:d,cls:"dropdown",editable:false,store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local",width:50,},]},{xtype:"tbspacer",width:20},{xtype:"fieldcontainer",layout:{type:"hbox",},labelAlign:"top",labelSeparator:" ",fieldLabel:"From",items:[{xtype:"scrollcombo",id:c,name:c,cls:"dropdown",editable:false,store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local",width:100,labelWidth:50,},{xtype:"tbspacer",width:20},{xtype:"scrollcombo",id:a,name:a,cls:"dropdown",editable:false,store:new Ext.data.Store({fields:["displayField","valueField"],data:[]}),displayField:"displayField",valueField:"valueField",queryMode:"local",width:50,},{xtype:"tbspacer",width:20},{xtype:"container",items:[{xtype:"button",iconCls:"iconMinus",style:{background:"none",border:"0px"},handler:function(){removeShiftTime(f);
}}]}]}]};return b;}function addValuesToTimePicker(c){c=c+1;var a=publicJSON["shiftsPickerHour"];var b=publicJSON["shiftsPickerMi"];Ext.getCmp("frHr"+c).getStore().loadRawData(a);Ext.getCmp("frHr"+c).setValue(Ext.getCmp("frHr"+c).getStore().getAt(0).get("valueField"));Ext.getCmp("frMi"+c).getStore().loadRawData(b);
Ext.getCmp("frMi"+c).setValue(Ext.getCmp("frMi"+c).getStore().getAt(0).get("valueField"));Ext.getCmp("toHr"+c).getStore().loadRawData(a);Ext.getCmp("toHr"+c).setValue(Ext.getCmp("toHr"+c).getStore().getAt(0).get("valueField"));Ext.getCmp("toMi"+c).getStore().loadRawData(b);Ext.getCmp("toMi"+c).setValue(Ext.getCmp("toMi"+c).getStore().getAt(0).get("valueField"));
}function checkInputs(){for(var b=0;b<5;b++){var e=Ext.getCmp("frHr"+b);if(e==null){continue;}var c=Ext.getCmp("frMi"+b);var d=Ext.getCmp("toHr"+b);var a=Ext.getCmp("toMi"+b);if((e.value==d.value&&c.value==a.value)||(e.value>d.value)||((e.value==d.value)&&(c.value>a.value))){Ext.MessageBox.alert(pageTitle,userIDValidationMsg49);
return false;}}return true;}function uploadUserImage(c){var i=appCnt.validateUserForm("logoUpload");if(i=="userValid"){var a="";var h="";if(c=="login"){a="../servlet/com.eg.EgFileUpload?fromPage=EgConfigLogoMsg.jsp&uploadFor=login&fileExt=gif&uploadFir=manager/tomcat/webapps/final/admin/eg_images/";h="manager/tomcat/webapps/final/admin/eg_images/";
}else{if(c=="monitor"){a="../servlet/com.eg.EgFileUpload?fromPage=EgConfigLogoMsg.jsp&uploadFor=monitor&fileExt=gif&uploadFir=manager/tomcat/webapps/final/monitor/eg_images/";h="manager/tomcat/webapps/final/monitor/eg_images/";}else{if(c=="reporter"){a="../servlet/com.eg.EgFileUpload?fromPage=EgConfigLogoMsg.jsp&uploadFor=reporter&fileExt=gif&uploadFir=manager/tomcat/webapps/final/reporter/images/";
h="manager/tomcat/webapps/final/reporter/images/";}else{if(c=="config"){a="../servlet/com.eg.EgFileUpload?fromPage=EgConfigLogoMsg.jsp&uploadFor=config&fileExt=gif&uploadFir=manager/tomcat/webapps/final/config/images/";h="manager/tomcat/webapps/final/config/images/";}}}}var g=Ext.getCmp("uname").getValue();
g=changeDisplayName(g);var f=Ext.getCmp("userAuth").getValue().authentication;if(!Ext.isEmpty(publicJSON.isSAMLLoginEnabled)&&publicJSON.isSAMLLoginEnabled){f=Ext.getCmp("userAuthSAML").getValue().authenticationSAML;}if(g!=""&&g!=undefined){var d=g+"_"+c+".gif";if(g.indexOf("/")>-1){var b=g.substring(0,g.indexOf("/"));
var e=g.substring(g.indexOf("/")+1,g.length);if(e.indexOf("(")>-1){e=g.substring(g.indexOf("/")+1,g.indexOf("(")-1);}d=b.toLowerCase()+"_"+e+"_"+c+".gif";}h=h+d;a=a+escape(d);}showUserImageUploader(c,a,h);}}function showUserImageUploader(c,a,b){fileUploadURI=a;filePath=b;var d=Ext.create("Ext.window.Window",{title:"Files to be uploaded",requires:["EgChangeUserProfile.view.FileUpload"],width:500,imageFor:c,id:"fileUpLoader",modal:true,doClose:function(){this.destroy();
},getCurrentUploaderInfo:function(){return this.imageFor;},items:[{xtype:"fileupload",}],}).show();if(!Ext.isEmpty(c)&&c=="login"){Ext.getCmp("specificationId").setValue("Type:GIF, JPEG, PNG, JPG;  Size:300KB;  Resolution:225x70pixels");}}function loadConfigPage(c,d){var b=Ext.getCmp("uname").getValue();
var a="";if(c=="userExternalAgents"){a="/final/admin/EgComponentZones.jsp?username="+b+"&comefrom=userpage&qctr=0&mode=modify&zone="+encodeURIComponent(d);}if(c=="userRemoteAgents"){a="/final/admin/EgComponentZones.jsp?username="+b+"&comefrom=userpage&qctr=0&mode=modify&zone="+encodeURIComponent(d);}if(c=="userZones"){a="/final/admin/EgComponentZones.jsp?username="+b+"&comefrom=userpage&qctr=0&mode=modify&zone="+encodeURIComponent(d);
}if(c=="userServices"){a="/final/admin/EgComponentServices.jsp?username="+b+"&comefrom=userpage&modify=true&site="+encodeURIComponent(d);}if(c=="userServiceGroups"){a="/final/admin/EgComponentServiceGroup.jsp?username="+b+"&returnToMain=userpage&modify=true&site="+encodeURIComponent(d);}if(c=="userSegments"){a="/final/admin/EgComponentSegments.jsp?username="+b+"&returnTo=userpage&qctr=0&segment="+encodeURIComponent(d);
}if(c=="userComponenets"||c=="userAutoComps"){if(d.indexOf("Agg_")!=-1){a="/final/admin/EgAggregateTree.jsp?qctr=1&isAggregateLink=true&reqfrom=modifyuser&username="+encodeURIComponent(b)+"&server="+encodeURIComponent(d)+"&category=-1&isFromModifyUser=true";}else{a="/final/admin/EgDispServer.jsp?username="+b+"&comptype="+d+"&category=-1";
}}window.location.href=a;}function changeDisplayName(d){if(!Ext.isEmpty(d)&&d!="undefined"){if(d.indexOf("/Grp/")!=-1){var f="/Grp/";var b=d.indexOf(f);var c=d.substring(0,b);var e=b+f.length;var a=d.substring(e);d=c+"/"+a+" (Group)";}else{if(d.indexOf("samlsso/")!=-1){var b=d.indexOf("/");var c=d.substring(b+1);
d=c+" (SAML)";}}return d;}return"";}function addAutomanageSrvs(h,f){var c=Ext.getCmp("serverCategoryList").getValue();var g=h.toString();var b;if(g!=null){b=g.split(",");}if(b!=""&&b.length>0){if(selectedCategoryArr.indexOf(c)==-1){selectedCategoryArr.push(c);for(var d=0;d<b.length;d++){var a=b[d];if(srvListArray.indexOf(a)==-1){srvListArray.push(a);
}}if(f.getValue()!==undefined){toFieldData(f);}}else{for(var d=0;d<b.length;d++){var e=b[d];if(srvListArray.indexOf(e)==-1){srvListArray.push(e);}}if(f.getValue()!==undefined){toFieldData(f);}}}else{toFieldData(f);}}function fromFieldData(e){var d=e;var g=d.fromField.store;var f="";var c=g.getCount();
for(var b=0;b<c;b++){var a=g.getAt(b).get("valueField");if(b==(c-1)){f+=a;}else{f+=a+",";}}addAutomanageSrvs(f,e);}function toFieldData(f){unmanageList=f.getValue();var e=unmanageList.toString();var b=e.split(",");if(b!=""&&b.length>0){for(var d=0;d<b.length;d++){var a=b[d];for(var c=0;c<srvListArray.length;
c++){if(srvListArray[c].indexOf(a)!=-1){var g=srvListArray.indexOf(srvListArray[c]);srvListArray.splice(g,1);}}}}}