Ext.define('Forms.Controls.Standard.Button',{extend:'Ext.Button',cls:'kta-button',config:{formIndex:''},causeValidation:true,constructor:function(){this.callParent(arguments);if(!this.style){this.style={};}},initComponent:function(){this.callParent(arguments);},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setPrimaryButton:function(){Forms.Common.Common.SetPrimaryButton(this);},setCauseValidation:function(val){this.causeValidation=val;},setTabIndex:function(val){this.tabIndex=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){this.tooltip=val;},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setControlData:function(buttonText){this.setText(buttonText);this.fireEvent('ValueUpdated',this,buttonText);},setWidth:function(width){this.width=width;},setLabelStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,textalign){var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.on('afterrender',function(){var TextAlignStyleValue;if(textalign=="left") {TextAlignStyleValue='justify-content:flex-start;';} else if(textalign=="right"){TextAlignStyleValue='justify-content:flex-end;';} $('#'+this.getId()+'-btnEl'+'.x-btn-button-center').attr('style',TextAlignStyleValue+$('#'+this.getId()+'-btnEl'+'.x-btn-button-center').attr('style'));$('#'+this.id+' .x-btn-inner').attr('style','font:'+fontStyle+fontsize+"px "+fontname+' !important;'+'color:'+color+' !important ;'+'text-decoration:'+textStyle+' !important ;'+''+'text-align:'+textalign+' !important ;'+$('#'+this.id+' .x-btn-inner').attr('style'));});},setFieldCls:function(cssClass){if(Ext.util.CSS.getRule("."+cssClass)){this.on('afterrender',function(){if(Ext.util.CSS.getRule('.'+cssClass)){var styleTextValue=Ext.util.CSS.getRule("."+cssClass).style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()).attr('style',styleTextValue+$('#'+this.getId()).attr('style'));$('#'+this.getId()+' .x-btn-inner').attr('style','background: none !important;'+styleTextValue+' border: 0px !important;'+$('#'+this.getId()+' .x-btn-inner').attr('style'));var TextAlignStyleValue;if(styleTextValue.indexOf("text-align: left")!==-1||styleTextValue.indexOf("text-align:left")!==-1) {TextAlignStyleValue='justify-content:flex-start;';} else if(styleTextValue.indexOf("text-align: right")!==-1||styleTextValue.indexOf("text-align:right")!==-1) {TextAlignStyleValue='justify-content:flex-end;';} if(TextAlignStyleValue){$('#'+this.getId()+'-btnEl'+'.x-btn-button-center').attr('style',TextAlignStyleValue+$('#'+this.getId()+'-btnEl'+'.x-btn-button-center').attr('style'));}}});}},getControlData:function(){return this.text;},onClickEventHandler:function(){},listeners:{click:function(btn,e,options){this.onClickEventHandler();}}});Ext.define('Forms.Controls.Standard.Calendar',{extend:'Ext.ux.form.DateTime',isFieldValid:true,cls:'KTACalendar',showMandatoryAsterisk:false,config:{formIndex:'',displayTimeField:false,isTextboxOfDateType:false,},constructor:function(){this.callParent(arguments);},initComponent:function(){var me=this;this.suspendEvents(false);this.dateCfg.name=this.getName()+'-datefield';this.timeCfg.name=this.getName()+'-timefield';this.callParent(arguments);if(me.getIsTextboxOfDateType()){this.dateField.on('blur',function(){me.fireDateChanged();});this.timeField.on('blur',function(){me.fireDateChanged();});} else{this.on('change',function(){me.fireDateChanged();});} this.resumeEvents();if(!this.getDisplayTimeField()){this.timeField.setHidden(true);this.timeField.isUserDefinedHidden=true;this.dateField.columnWidth=1;this.timeField.columnWidth=0;} this.dateField.altFormats=this.timeField.altFormats='d-m-Y';},strict:true,allowBlank:true,valueWhenEmpty:null,ignoreServerTimeZoneConversion:false,setIgnoreServerTimeZoneConversion:function(value){this.ignoreServerTimeZoneConversion=value;},getIgnoreServerTimeZoneConversion:function(){return this.ignoreServerTimeZoneConversion;},labelSeparator:'',setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setTabIndex:function(val){this.tabIndex=val;this.dateField.tabIndex=val;this.timeField.tabIndex=val;},setFormIndex:function(val){this.formIndex=val;if(this.dateField){this.dateField.formIndex=val;this.timeField.formIndex=val;}},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){Forms.Common.Common.CreateTooltip(this,val);},setHeight:function(value){this.callParent(arguments);this.dateField.setHeight(value);this.timeField.setHeight(value);},setLabelText:function(text){var text=text==''?' ':Forms.Common.Common.applyHtmlEncode(text);this.setFieldLabel(text);},setLabelAlign:function(align){this.labelAlign=align;},setLabelWidth:function(width){this.labelWidth=width;},setShowMandatoryAsterisk:function(val){this.showMandatoryAsterisk=val;},setMandatory:function(shouldValidate){this.allowBlank=!shouldValidate;this.dateField.allowBlank=!shouldValidate;if(this.getDisplayTimeField()){this.timeField.allowBlank=!shouldValidate;} if(this.showMandatoryAsterisk&&!this.allowBlank){this.addCls('kta-label-class');} else{this.removeCls('kta-label-class');}},setReadOnly:function(value){this.dateField.setReadOnly(value);this.timeField.setReadOnly(value);},setErrorText:function(text){this.dateField.blankText=text;this.timeField.blankText=text;},setHintText:function(text){this.dateField.emptyText=text;this.timeField.emptyText=text;},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setWidth:function(width){this.width=width;},setLabelStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,textalign){Forms.Common.Common.StandardLabelStyle(this,fontname,fontsize,color,bold,italic,underline,strikethrough,overline,textalign);},setStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.on('afterrender',function(){$('#'+this.id+' input').attr('style','font:'+fontStyle+fontsize+"px "+fontname+' !important;'+'color:'+color+' !important ;'+'text-decoration:'+textStyle+' !important ;'+'text-align:'+alignment+' !important ;'+$('#'+this.id+' input').attr('style'));});if(this.emptyText!=''&&Ext.isIE){this.on('focus',function(){if(this.getValue()==null||this.getValue()==''||this.getValue()==undefined){$('#'+this.id+' input').css('color',color);}});}},setFieldCls:function(cssClass){var cssClassObj=Ext.util.CSS.getRule("."+cssClass);var color;if(cssClassObj){color=cssClassObj.style.color;this.on('afterrender',function(){if(this.emptyText!=''&&Ext.isIE&&color){cssClassObj.style.color="";} var styleTextValue=cssClassObj.style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' input').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-text-wrap-default').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-trigger-wrap-default').attr('style',styleTextValue);});} if(this.emptyText!=''&&Ext.isIE&&color){this.on('focus',function(){if(this.getValue()==null||this.getValue()==''||this.getValue()==undefined){$('#'+this.id+' input').css('color',color);}});}},setLabelCls:function(cssClass){if(Ext.util.CSS.getRule("."+cssClass)){this.on('afterrender',function(){var styleTextValue=Ext.util.CSS.getRule("."+cssClass).style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' .x-form-item-label').attr('style',styleTextValue+$('#'+this.getId()+' .x-form-item-label').attr('style'));});}},removeLabel:function(shouldRemove){this.hideLabel=shouldRemove;},reset:function(){this.dateField.suspendEvents(false);this.timeField.suspendEvents(false);this.dateField.reset();this.timeField.reset();this.dateField.resumeEvents();this.timeField.resumeEvents();},setMaxDate:function(maximumDate){if(maximumDate){if(Ext.isDate(maximumDate)){this.dateField.maxValue=maximumDate;} else{this.dateField.maxValue=new Date(maximumDate);}} else{this.dateField.maxValue=null;}},setMinDate:function(minimumDate){if(minimumDate){if(Ext.isDate(minimumDate)){this.dateField.minValue=minimumDate;} else{this.dateField.minValue=new Date(minimumDate);}} else{this.dateField.minValue=null;}},setValueWhenEmpty:function(value){if(value){this.valueWhenEmpty=new Date(value);} else{this.valueWhenEmpty=value;}},getLabelWidth:function(labelWidth){return this.labelWidth;},getValueWhenEmpty:function(){return this.valueWhenEmpty;},dateIsNullable:function(){if(this.valueWhenEmpty==null){return true;} return false;},setIsTextboxOfDateType:function(value){this.isTextboxOfDateType=value;if(value){this.isTextboxDateControl=true;}},dateFormat:function(fmt){this.dateField.format=fmt;},updateInvalidText:function(dateformat){if(dateformat!==null&&dateformat!==''){this.invalidText=Ext.String.format(Forms.Common.Lang.GetLocaleString('3c81fd9b10ff43e7a5a7a2518d7ea754',true),'{0}',dateformat);} else{this.invalidText=Ext.String.format(Forms.Common.Lang.GetLocaleString('3c81fd9b10ff43e7a5a7a2518d7ea754',true),'{0}',Forms.Common.Common.GetCsharptDateFormat());}},updateFormatText:function(){this.dateField.formatText=Forms.Common.Lang.GetLocaleString('11D317E0D5974E0FB6F8D2381E271EE3',true)+Forms.Common.Common.GetCsharptDateFormat();},onRender:function(){this.callParent(arguments);},setControlData:function(dt,target,actualValue,isServerEvent){var propertyUpdated=false;if(target!==undefined){propertyUpdated=Forms.Common.PropertyHelper.SetPropertyValue(this,target,dt,false);} if(!propertyUpdated){this.suspendEvents(false);if(actualValue!=undefined&&actualValue.toString().substring(0,6)=='/Date('){if(isServerEvent&&this.getIgnoreServerTimeZoneConversion()){this.setValue(Forms.Common.Common.getDateWithoutTimezoneConversion(actualValue));} else{var convertedDate=Forms.ConversionHelper.parseJsonDate(actualValue);this.setValue(convertedDate);}} else{this.setValue('');if(dt!=undefined){if(dt!='null'&&dt!=''&&!Ext.isDate(dt)){var newDate=Ext.Date.parse(dt,this.dateField.format);if(!newDate){newDate=Ext.Date.parse(dt,Forms.Common.Common.GetDateTimeFormat());} if(!Ext.isDate(newDate)){newDate=new Date(dt);} if(newDate=='NaN'){newDate=this.parseIEDate(dt);} else if(newDate=='Invalid Date'){newDate=this.parseSafariDate(dt);} if(newDate=='Invalid Date'||newDate=='NaN'){if(dt.indexOf(' ')>-1){var strDatePart=dt.substring(0,dt.indexOf(' '));newDate=new Date(strDatePart);if(newDate=='Invalid Date'||newDate=='NaN'){this.setValue(dt.substring(0,dt.indexOf(' ')));}else{this.setValue(newDate);}} else{this.setValue(dt);}} else{this.setValue(newDate);}} else{this.setValue(dt);}}} this.resumeEvents();this.setCurrentValue(this.getValue());this.fireEvent('ValueUpdated',this,dt);}},setPropertyValue:function(propertyName,value){if(propertyName.toUpperCase()=="ISVALID"){this.dateField.isFieldValid=value;if(this.getDisplayTimeField()){this.timeField.isFieldValid=value;}} else if(propertyName.toUpperCase()=="ERRORMESSAGE"){this.dateField.blankText=value;if(this.getDisplayTimeField()){this.timeField.blankText=value;}}},setCurrentValue:function(text){this.currentValue=text;},getCurrentValue:function(){if(!this.currentValue&&this.valueWhenEmpty&&this.valueWhenEmpty!='NaN'&&this.valueWhenEmpty!='Invalid Date'){return this.valueWhenEmpty;} return this.currentValue;},parseIEDate:function(str){var v=str.split(' ');return new Date(Date.parse(v[1]+" "+v[2]+", "+v[6]+" "+v[3]+" UTC"));},parseSafariDate:function(str){if(str!="Invalid Date"&&str.length>0){var v=str.split(' ');return new Date(Date.parse(v[1]+" "+v[2]+", "+v[3]+" "+v[4]+" UTC"));} else{return'';}},getControlData:function(input){if(input!==undefined&&input.getName()&&Forms.Common.PropertyHelper.IsControlProperty(input.getName())){return Forms.Common.PropertyHelper.GetPropertyValue(this,input.getName());} var value;if(!this.getValue()&&this.valueWhenEmpty){if(this.valueWhenEmpty!='NaN'&&this.valueWhenEmpty!='Invalid Date') value=this.valueWhenEmpty;} else{value=this.getValue();} if(input!==undefined&&input.isServerEvent&&this.getIgnoreServerTimeZoneConversion()){if(Ext.isDate(value)){value=Forms.Common.Common.GetISODateStringWithoutTimeZoneConversion(value);} input.ignoreTimeZone=true;} return value;},getCalculationData:function(){var value=this.getControlData();if(value){return Ext.Date.format(value,Forms.Common.Common.GetDateFormat());} return value;},markInvalid:function(errors){this.dateField.markInvalid(errors);if(this.getDisplayTimeField()){this.timeField.markInvalid(errors);}},onChangeEventHandler:function(control){Forms.Common.Common.resetIsFieldValid(control);this.clearInvalid();Forms.Common.Common.refreshFormControlsForDebugging();},resetIsFieldValid:function(){this.dateField.isFieldValid=true;this.timeField.isFieldValid=true;},listeners:{change:function(tb,newValue,oldValue,options){this.onChangeEventHandler(tb);},afterrender:function(){$("#"+this.getId()+'-triggerWrap').css('float','right');},},fireDateChanged:function(){var currentValue=this.getCurrentValue()?this.getCurrentValue().getTime():null;var controlData=this.getControlData()?this.getControlData().getTime():null;if(currentValue!=controlData){this.setCurrentValue(this.getControlData());if(this.getIsTextboxOfDateType()){this.fireEvent('blurchange',this);}else{this.fireEvent('datechange',this);} Forms.Common.Common.refreshFormControlsForDebugging();}}});Ext.define('Forms.Controls.Standard.Canvas',{extend:'Ext.Component',autoEl:{tag:'canvas',},config:{eventConfigArray:[],ctx:null,canvas:null,applyStyle:false,styleSettings:null,border:0,borderColor:'',backGroundColour:''},listeners:{afterrender:{fn:function(){this.initializeCanvas();}}},constructor:function(config){var me=this;me.eventConfigArray=new Array();Forms.Controls.Standard.Canvas.superclass.constructor.call(this,config);},initializeCanvas:function(){var me=this;if(me.canvas==null&&me.el!=null){me.canvas=me.el.dom;me.ctx=me.canvas.getContext("2d");me.setUpEventHandlers();if(me.applyStyle){me.applyStyleSetting();} me.canvas.height=me.height;me.canvas.width=me.width;me.canvas.style.backgroundColor=me.backGroundColour;me.canvas.style.border=me.borderColor+" "+me.border+"px solid";}},addCanvasListener:function(eventName,eventHandler,eventScope){var me=this;if(me.canvas!=null){me.canvas.addEventListener(arguments);} else{var eventConfig=Ext.create('Forms.Events.EventConfig',{});eventConfig.eventName=eventName;eventConfig.eventHandler=eventHandler;eventConfig.eventScope=eventScope;eventConfig.useCapture=false;this.eventConfigArray.push(eventConfig);}},setUpEventHandlers:function(){var me=this;if(me.eventConfigArray.length>0){for(var i=0;i=2){if(properties[1].toUpperCase()==Forms.Constants.QUERY_ID){me.setQueryId(data)} else if(properties[1].toUpperCase()==Forms.Constants.GROUP_BY_FIELD){me.setGroupByField(data)} else if(properties[1].toUpperCase()==Forms.Constants.GROUP_BY_WORKTYPE_FIELD){me.setGroupByWorkTypeField(data)} else if(properties[1].toUpperCase()==Forms.Constants.QUERY_TYPE_FIELD){me.setQueryType(data)}} else{me.setTitleText(data);}},getControlData:function(input){var me=this;if(input!==undefined&&input.getName()){if(input.getName()==this.name+'.ClickedSegmentTitle'){return me.getSelectedText();} else if(input.getName()==this.name+'.ClickedSegmentCount'){return me.getClickedSegmentCount();} else if(input.getName()==this.name+'.QueryId'){return me.getQueryId();} else if(input.getName()==this.name+'.GroupByField'){return me.getGroupByField();} else if(input.getName()==this.name+'.TotalReturned'){return me.getQueryTotal();} if(input.getName()==this.name){return me.getTitleText();} else{return'';}} return'';},buildChartTitle:function(){var me=this;var title=me.getTitleText();var chartTitle;if(title===null||title===undefined||title===""){chartTitle="Total: "+me.getQueryTotal();} else{chartTitle=title+" ("+me.getQueryTotal()+")";} if(me.getChart()!==null){me.getChart().title=chartTitle;me.getChart().titleStyle.fontWeight=me.getFontWeight();me.getChart().titleStyle.fontStyle=me.getFontStyle();me.getChart().titleStyle.fontFamily=me.getFontFamily();me.getChart().titleStyle.size=me.getFontSize();me.getChart().titleStyle.color=me.getTextColor();me.getChart().titleStyle.textAlignment=(me.getAlignment()=="left"||me.getAlignment()=="")?"Near":(me.getAlignment()=="right"?"Far":"Center");}},createBarChart:function(){var me=this;var chart=new ej.charts.Chart({primaryXAxis:{valueType:'Category',title:'',interval:1,visible:me.getShowLabel(),labelStyle:{fontFamily:me.getChartFontFamily(),size:me.getChartFontSize(),color:me.getChartFontColor(),fontWeight:me.getChartFontWeight(),},majorGridLines:{width:0}},primaryYAxis:{minimum:0,minorTicksPerInterval:5,labelFormat:'{value}',labelStyle:{fontFamily:me.getChartFontFamily(),size:me.getChartFontSize(),color:me.getChartFontColor(),fontWeight:me.getChartFontWeight(),}},chartArea:{border:{width:0}},series:[{type:'Bar',dataSource:[],xName:'name',yName:'value',name:'',marker:{dataLabel:{visible:true,position:'Top',font:{fontWeight:me.getChartFontWeight(),fontFamily:me.getChartFontFamily(),size:me.getChartFontSize(),color:'#ffffff'}}},animation:{enable:false,}}],tooltip:{enable:true},margin:{bottom:me.getInsetPadding().bottom<=10?10:me.getInsetPadding().bottom,left:me.getInsetPadding().left<=10?10:me.getInsetPadding().left,right:me.getInsetPadding().right<=10?10:me.getInsetPadding().right,top:me.getInsetPadding().top<=10?10:me.getInsetPadding().top,},pointRender:function(args){args.fill=Forms.Constants.Colors[args.point.index];},axisLabelRender:function(args){if(args.text.length>me.getLabelLength()){args.text=args.text.substring(0,me.getLabelLength())+"...";}},pointClick:function(args){me.setSelectedText(args.point.x);me.setSelectedValue(args.point.y);me.setClickedSegmentCount(args.point.y);if(me.ItemClickHandler!==null){me.getItemClickHandler();}}});return chart;},createColumnChart:function(){var me=this;var chart=new ej.charts.Chart({primaryXAxis:{valueType:'Category',interval:1,visible:me.getShowLabel(),labelRotation:285,labelStyle:{fontFamily:me.getChartFontFamily(),size:me.getChartFontSize(),color:me.getChartFontColor(),fontWeight:me.getChartFontWeight(),},majorGridLines:{width:0},},margin:{bottom:me.getInsetPadding().bottom<=10?10:me.getInsetPadding().bottom,left:me.getInsetPadding().left<=10?10:me.getInsetPadding().left,right:me.getInsetPadding().right<=10?10:me.getInsetPadding().right,top:me.getInsetPadding().top<=10?10:me.getInsetPadding().top,},chartArea:{border:{width:0}},primaryYAxis:{minimum:0,minorTicksPerInterval:5,labelStyle:{fontFamily:me.getChartFontFamily(),size:me.getChartFontSize(),color:me.getChartFontColor(),fontWeight:me.getChartFontWeight(),},},series:[{type:'Column',xName:'name',yName:'value',name:'',dataSource:[],columnWidth:0.4,marker:{dataLabel:{visible:true,position:'Top',font:{fontFamily:me.getChartFontFamily(),size:me.getChartFontSize(),fontWeight:me.getChartFontWeight(),color:'#ffffff'}}},animation:{enable:false,}}],tooltip:{enable:true},pointRender:function(args){args.fill=Forms.Constants.Colors[args.point.index];},axisLabelRender:function(args){if(args.text.length>me.getLabelLength()){args.text=args.text.substring(0,me.getLabelLength())+"...";}},pointClick:function(args){me.setSelectedText(args.point.x);me.setSelectedValue(args.point.y);me.setClickedSegmentCount(args.point.y);if(me.ItemClickHandler!==null){me.getItemClickHandler();}}});return chart;},createPieChart:function(){var me=this;chart=new ej.charts.AccumulationChart({series:[{dataSource:[],xName:'name',yName:'value',startAngle:0,endAngle:360,innerRadius:me.CreatePieDount(),radius:(100-me.getInnerPadding()).toString()+'%',dataLabel:{visible:true,position:'Inside',font:{fontFamily:me.getChartFontFamily(),size:me.getChartFontSize(),fontWeight:me.getChartFontWeight(),}},width:'100%',height:'100%',animation:{enable:false,}}],legendSettings:{visible:me.getShowLegend(),position:me.getLegendPostion(),textStyle:{fontWeight:me.getChartFontWeight(),fontFamily:me.getChartFontFamily(),size:me.getChartFontSize()},padding:15,toggleVisibility:false},margin:{bottom:me.getInsetPadding().bottom<=10?10:me.getInsetPadding().bottom,left:me.getInsetPadding().left<=10?10:me.getInsetPadding().left,right:me.getInsetPadding().right<=10?10:me.getInsetPadding().right,top:me.getInsetPadding().top<=10?10:me.getInsetPadding().top,},enableSmartLabels:true,tooltip:{enable:true,format:'${point.x} : ${point.y}'},pointClick:function(args){me.setSelectedText(args.point.x);me.setClickedSegmentCount(args.point.y);if(me.ItemClickHandler!==null){me.getItemClickHandler();}}});return chart;},GetActivitiesSummaryWithQuery:function(){var me=this;var useDefaultQuery=false;var queryIdentity=Ext.create('Forms.Custom.Classes.QueryIdentity',{});queryIdentity.setId(me.getQueryId());queryIdentity.setName(me.getQueryName());if(me.getQueryType()===Forms.Constants.QUERY_TYPE.WORKQUEUE||me.getQueryType()===Forms.Constants.QUERY_TYPE.SYSTEM){var activityField=Ext.create('Forms.Custom.Classes.ActivityField',{});if(me.getGroupByField()==""){activityField.setFieldType(2)} else{activityField.setFieldType(me.getGroupByField());} activityField.setMetaDataFieldName(me.getGroupByWorkTypeField());var activityService=Ext.create('Forms.Custom.ServiceCalls.ActivityService',{});activityService.GetActivitiesSummaryWithQuery(me.GetActivitiesSucceeded,me.getSessionId(),queryIdentity,activityField,null,this);} else if(me.getQueryType()===Forms.Constants.QUERY_TYPE.JOBLIST){var jobField=Ext.create('Forms.Custom.Classes.JobField',{});if(me.getGroupByField()==""){jobField.setFieldType(11)} else{jobField.setFieldType(me.getGroupByField());} jobField.setMetaDataFieldName(me.getGroupByWorkTypeField());var jobService=Ext.create('Forms.Custom.ServiceCalls.JobService',{});jobService.GetJobsSummaryWithQuery(me.GetActivitiesSucceeded,me.getSessionId(),queryIdentity,jobField,null,this);}},CreatePieDount:function(){var me=this;if(me.getEnablePieDonut()){return'30%';} else{return'0%';}},GetActivitiesSucceeded:function(serviceResult,chartControl){var response=serviceResult.d;if(response!==undefined){var jobActivitiesSummaryCollection=Ext.create('Forms.Custom.Classes.JobActivitiesSummaryCollection',{});jobActivitiesSummaryCollection.fromObject(response);if(jobActivitiesSummaryCollection.Count()>0){var Othervalue=0;chartControl.chart.series[0].dataSource=[{}];chartControl.chart.refresh();var segment=chartControl.getSegmentNumber();var collection=[];for(var rowIndex=0;rowIndex0){var input=this[0];return input[field.mask.dataName]();} me.settings=Ext.applyIf(me.settings,{placeholder:"_",completed:null});me.defs=me.mask.definitions;me.tests=[];me.partialPosition=mask.length;me.firstNonMaskPos=null;var maskCharacterAsLiteral=false;Ext.each(mask.split(""),function(c,i){if(c=='\\'&&!maskCharacterAsLiteral){maskCharacterAsLiteral=true;me.partialPosition--;me.format.length--;}else if(me.defs[c]&&!maskCharacterAsLiteral){me.tests.push(new RegExp(me.defs[c]));if(me.firstNonMaskPos==null) me.firstNonMaskPos=me.tests.length-1;}else{me.tests.push(null);maskCharacterAsLiteral=false;}});me.fireEvent("unmask");var input=me.field;maskCharacterAsLiteral=false;me.buffer=me.jqmap(mask.split(""),function(i,c){if(c=='\\'&&!maskCharacterAsLiteral){maskCharacterAsLiteral=true;} else if(maskCharacterAsLiteral){maskCharacterAsLiteral=false;return c;} else{return me.defs[c]?me.settings.placeholder:c;}});me.focusText=input.getRawValue();input[me.mask.dataName]=function(){return me.jqmap(buffer,function(i,c){return tests[i]&&c!=settings.placeholder?c:null;}).join('');};if(!input.readOnly){input.on('unmask',function(){this.un('.mask');this[plugin.mask.dataName]=undefined;},input,{single:true});input.on('focus',me.onFocus,me);input.on('blur',function(f){me.checkVal();if(f.getRawValue()!=me.focusText){f.fireEvent('change',f.getRawValue(),me.focusText);}});input.on('keydown',function(f,e){if(me.keydownEvent(f,e)==false){e.preventDefault();}},me);input.on('keypress',function(f,e){if(me.keypressEvent(f,e)==false){e.preventDefault();}},me);input.on('render',function(f){input.inputEl.on(me.pasteEventName,function(){setTimeout(function(){input.caret(me.checkVal(true));},0);});},undefined,{single:true});} me.checkVal();input.caret=me.caret;me.oriGet=Ext.Function.bind(field.getValue,field);Ext.apply(field,{getValue:function(v){val=me.prepareValueToExternalWorld();return val;},setValue:function(v){me.field.setRawValue('');me.clearBuffer(0,me.format.length);me.prepareValueToInternalWorld(v);}});},caret:function(begin,end){if(this.length==0)return;var el=Ext.get(this.inputId);if(typeof begin=='number'){end=(typeof end=='number')?end:begin;if(el.dom.setSelectionRange){el.dom.setSelectionRange(begin,end);}else if(el.dom.createTextRange){var range=el.dom.createTextRange();range.collapse(true);range.moveEnd('character',end);range.moveStart('character',begin);range.select();} return this;}else{if(el.dom.setSelectionRange){begin=el.dom.selectionStart;end=el.dom.selectionEnd;}else if(document.selection&&document.selection.createRange){var range=document.selection.createRange();begin=0-range.duplicate().moveStart('character',-100000);end=begin+range.text.length;} return{begin:begin,end:end};}},unmask:function(){return this.fireEvent("unmask");},onFocus:function(f){var me=this;me.focusText=f.getRawValue();var pos=me.checkVal();me.writeBuffer();var moveCaret=function(){if(pos==me.format.length) f.caret(0,pos);else f.caret(pos);};(Ext.isIE?moveCaret:function(){setTimeout(moveCaret,0)})();},seekNext:function(pos){var me=this;while(++pos<=me.format.length&&!me.tests[pos]);return pos;},seekPrev:function(pos){var me=this;while(--pos>=0&&!me.tests[pos]);return pos;},shiftL:function(begin,end){var me=this;if(begin<0) return;for(var i=begin,j=me.seekNext(end);i=me.format.length) me.settings.completed.call(f);}} return false;}},clearBuffer:function(start,end){var me=this;for(var i=start;itest.length) break;}else if(me.buffer[i]==test.charAt(pos)&&i!=me.partialPosition){pos++;lastMatch=i;}}} if(!allow&&lastMatch+1=me.partialPosition){me.writeBuffer();if(!allow)input.setRawValue(input.getRawValue().substring(0,lastMatch+1));} return(me.partialPosition?i:me.firstNonMaskPos);},isTestOptional:function(test){var isOptional=false;if(!Ext.isEmpty(test)){var testAsString=test.toString();if(testAsString=="/[0-9 ]/"||testAsString=="/[0-9 +-]/"||testAsString=="/[A-Za-z ]/"||testAsString=="/[A-Za-z0-9 ]/"||testAsString=="/./"){isOptional=true;}} return isOptional;},prepareValueToExternalWorld:function(){var me=this;var result=[],valid=true;for(var i=0;i','','{Text}','','{Text} {Value}','','');return tpl;},setControlStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,textAlign,textWidth,valueWidth){var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} var lineHeight;if(fontsize<=24){lineHeight="30px";} else{lineHeight="auto";} var itemStyle='font:'+fontStyle+fontsize+"px "+fontname+';color:'+color+';text-decoration:'+textStyle+';line-height:'+lineHeight+';';var inlineTpl=Ext.create('Ext.XTemplate','','
  • ','','{[typeof values === "string" ? values : Forms.Common.Common.applyHtmlEncode(values["'+this.displayField+'"])]}','','
  • ','
    ');this.tpl=inlineTpl;this.on('afterrender',function(){$('#'+this.id+' input').attr('style','font:'+fontStyle+fontsize+"px "+fontname+' !important;'+'color:'+color+' !important ;'+'text-decoration:'+textStyle+' !important ;'+$('#'+this.id+' input').attr('style'));});},setFieldCls:function(cssClass){if(Ext.util.CSS.getRule("."+cssClass)){this.on('afterrender',function(){var styleTextValue=Ext.util.CSS.getRule("."+cssClass).style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' input').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-text-wrap-default').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-trigger-wrap-default').attr('style',styleTextValue);this.on('expand',function(){$('#'+this.picker.id+' li').attr('style',styleTextValue);});});}},setLabelCls:function(cssClass){if(Ext.util.CSS.getRule("."+cssClass)){this.on('afterrender',function(){var styleTextValue=Ext.util.CSS.getRule("."+cssClass).style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' .x-form-item-label').attr('style',styleTextValue+$('#'+this.getId()+' .x-form-item-label').attr('style'));});}},removeLabel:function(shouldRemove){this.hideLabel=shouldRemove;},getControlData:function(eventInput){if(eventInput!==undefined&&eventInput.getName()&&Forms.Common.PropertyHelper.IsControlProperty(eventInput.getName())){return Forms.Common.PropertyHelper.GetPropertyValue(this,eventInput.getName());} if(eventInput==undefined){if(this.getValue()!=undefined){return this.getValue();} else{return"";}} var boolUseValue=this.useDropDownValue(eventInput.getName());if(boolUseValue){if(this.getValue()!=undefined){return this.getValue();} else{return"";}} else{var recordText="";var record=this.store.findRecord(VALUE_FIELD,this.getValue(),0,false,false,true);if(record!=null){recordText=record.get(TEXT_FIELD);} return recordText;}},setEmptyText:function(text){this.emptyText=text;this.clearSelection();},clearData:function(){this.suspendEvents(false);this.getStore().removeAll();this.clearSelection();this.resumeEvents();},clearSelection:function(){this.suspendEvents(false);this.setIsClearSelection(true);this.resetInternal();this.resumeEvents();},setControlData:function(value,target){var propertyUpdated=false;if(target!==undefined){propertyUpdated=Forms.Common.PropertyHelper.SetPropertyValue(this,target,value,false);} if(!propertyUpdated){this.suspendEvents(false);if(Forms.Common.Common.IsValidJsonDate(value)){value=Forms.Common.Common.ConvertFromJsonDate(value);} this.setInternalValue(value,true);this.resumeEvents();this.setCurrentValue(value);} this.fireEvent('ValueUpdated',this,value);},setCurrentValue:function(value){this.currentValue=value;},getCurrentValue:function(){return this.currentValue;},resetData:function(headerColumns,dataArray){this.suspendEvents(false);this.clearData();if(this.store){this.store.add(dataArray);} else{var itemCollection=Ext.create('Ext.data.Store',{fields:headerColumns,data:dataArray});this.store=itemCollection;} this.resumeEvents();},setColumnData:function(headerColumns,valueArray){this.suspendEvents(false);this.clearData();if(headerColumns.length==0){this.resumeEvents();return;} var displayFieldIndex=0;var valueFieldIndex=0;if(headerColumns.length==2){if(headerColumns[0]==VALUE_FIELD){valueFieldIndex=0;displayFieldIndex=1;} else{valueFieldIndex=1;displayFieldIndex=0;}} var recordArray=[],i;var defaultValue=this.getDefaultValue();if(defaultValue&&(defaultValue[this.displayField])&&this.store.find(this.displayField,defaultValue[this.displayField],0,false,true,true)<0){recordArray.push(defaultValue);} if(valueArray){for(i=0;i=0){var defaultRec=this.store.findRecord(this.displayField,defaultValue[this.displayField],0,false,true,true);this.setValue(defaultRec.get(this.valueField));}else if(this.store.getCount()>0){} this.setCurrentValue(this.getControlData());this.clearInvalid();this.resumeEvents();},setInternalValue:function(value,isPopulate){if(value!==null&&value!==''){var rec=this.store.findRecord('Value',value,0,false,true,true);if(rec){this.setValue(rec.get('Value'));} else{if(isPopulate){this.setValue(value);this.setRawValue(value);}}}},setSelectedItem:function(name,value){this.suspendEvents(false);if(value!==null&&value!==''){var boolUseValue=this.useDropDownValue(name);if(boolUseValue){this.setInternalValue(value,false);} else{var rec=this.findRecordByDisplay(value);if(rec){this.select(rec);this.setRawValue(value);} else{this.setInternalValue(this.lastSelection,false);}} this.fireEvent('ValueUpdated',this,value);} this.setCurrentValue(this.getControlData());this.resumeEvents();},onChangeEventHandler:function(control){Forms.Common.Common.resetIsFieldValid(control);control.clearInvalid();Forms.Common.Common.refreshFormControlsForDebugging();},useDropDownValue:function(name){pos=name.indexOf('.');if(pos>-1){var mapping=name.split('.')[1];if(mapping==TEXT_FIELD){return false;} else{return true;}} return true;},listeners:{'change':function(combo,records,options){this.onChangeEventHandler(combo);}},isValid:function(){var me=this,disabled=me.disabled,validate=me.forceValidation||!disabled;if(me.isUserDefinedHidden||(me.up()&&me.up().isUserDefinedHidden)){me.clearInvalid();return true;} validate=validate?me.validateValue(me.processRawValue(me.getStore()?me.getValue():'')):disabled;if(validate){if(me.isFieldValid){me.clearInvalid();return true;} else{me.markInvalid(me.blankText);return false;}}},getErrors:function(value){var me=this,errors=new Array(),validator=me.validator,emptyText=me.emptyText,allowBlank=me.allowBlank,vtype=me.vtype,vtypes=Ext.form.field.VTypes,regex=me.regex,format=Ext.String.format,msg;value=value||me.processRawValue(me.getStore()?me.getValue():'');if(Ext.isFunction(validator)){msg=validator.call(me,value);if(msg!==true){errors.push(msg);}} if(value==null||value.toString().trim().length<1||value===emptyText){if(!allowBlank){errors.push(me.blankText);} return errors;} if(value.lengthme.maxLength){errors.push(format(me.maxLengthText,me.maxLength));} if(vtype){if(!vtypes[vtype](value,me)){errors.push(me.vtypeText||vtypes[vtype+'Text']);}} if(regex&&!regex.test(value)){errors.push(me.regexText||me.invalidText);} return errors;},fireSelectionChanged:function(){if(this.getControlData()!==this.getCurrentValue()){this.setCurrentValue(this.getControlData());this.fireEvent('selectionchange',this);Forms.Common.Common.refreshFormControlsForDebugging();}},resetInternal:function(){this.reset();this.setCurrentValue(this.getControlData());}});Ext.define('Forms.Controls.Standard.EmbeddedPage',{extend:'Ext.Component',cls:'kta-custom-controls',constructor:function(){this.callParent(arguments);if(!this.style){this.style={};}},initComponent:function(){this.callParent(arguments);this.on('afterRender',function(){Ext.DomHelper.append(Ext.get(this.id),{tag:'div',style:'width: 100%; height:100%; overflow:'+(Forms.Common.Common.IsTouchDevice()?'auto;':'hidden;')+' -webkit-overflow-scrolling : touch; scrolling: yes; border: 1px solid #A2ADB8;',children:[{tag:'iframe',src:this.src,id:this.id+'-iframe',style:'width: 100%; height:100%; overflow:auto; scrolling: yes;'}]});});},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setTabIndex:function(val){this.tabIndex=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){this.tooltip=val;},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setBorder:function(borderWidth){this.borderWidth=borderWidth;if(borderWidth==0) {this.on('afterRender',function(){$('#'+this.id+' div').attr('style','border:0px!important;'+$('#'+this.id+' div').attr('Style'));$('#'+this.id+' iframe').attr('style','border:0px;'+$('#'+this.id+' iframe').attr('Style'));});}},setRoundedCornerBorder:function(){this.on('afterRender',function(){$('#'+this.id+' div').attr('style','border:0px!important;'+$('#'+this.id+' div').attr('Style'));$('#'+this.id+' iframe').attr('style','border-radius:10px; border:0px;'+$('#'+this.id+' iframe').attr('Style'));});},setMandatory:function(shouldValidate){},setControlData:function(text){this.internalSetData(text);this.fireEvent('ValueUpdated',this,text);},internalSetData:function(text){text=Forms.Common.Common.LoadTestForm(text);this.src=text;var iframeElement=$('#'+this.id+' iframe').get(0);var srcNotEmpty=this.src.trim().length>0?true:false;if(srcNotEmpty&&!(this.src.trim().indexOf('?')===0)){if(iframeElement){this.on('afterRender',function(){if(Ext.isIE){$('#'+this.id+' iframe').get(0).contentWindow.document.location.replace(text);} else{$('#'+this.id+' iframe').get(0).contentWindow.location.replace(text);}});if(this.src){try {if(Ext.isIE){$('#'+this.id+' iframe').get(0).contentWindow.document.location.replace(text);} else{$('#'+this.id+' iframe').get(0).contentWindow.location.replace(text);}} catch(ex) {this.on('afterRender',function(){$('#'+this.id+' iframe').attr('src',text);});if(this.src){$('#'+this.id+' iframe').attr('src',text);}}}} else{this.on('afterRender',function(){$('#'+this.id+' iframe').attr('src',text);});if(this.src){$('#'+this.id+' iframe').attr('src',text);}}}},getControlData:function(){this.on('afterRender',function(){return $('#'+this.id+' iframe').attr('src');});},onRender:function(){this.autoEl=Ext.apply({},this.initialConfig,this.autoEl);this.autoEl.src=this.src;this.autoEl.frameborder=this.borderWidth;if(this.el){this.el.dom.src=this.src;} this.callParent(arguments);},setVisible:function(visible){if(visible){if(this.autoEl){this.show();}}else{this.hide();}},setWidth:function(width){this.width=width;}});Ext.define('Forms.Controls.Standard.FileUpload',{extend:'Ext.form.field.File',restrict:[],accept:[],buttonOnly:false,allowBlank:true,labelSeparator:'',buttonWidth:null,buttonHeight:null,fieldHeight:null,labelHeight:null,uploadConfirmed:undefined,constructor:function(){this.callParent(arguments);if(!this.style){this.style={};}},config:{textboxHeight:0,multiple:false,thisForm:'',formIndex:''},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setTabIndex:function(val){this.tabIndex=val;},setFormIndex:function(val){this.designTimeFormIndex=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){Forms.Common.Common.CreateTooltip(this,val);},setAllowedFileTypes:function(arrayValue){this.accept=arrayValue;},setRestrictiveFileTypes:function(arrayValue){this.restrict=arrayValue;},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setLabelText:function(text){this.fieldLabel=text==''?' ':Forms.Common.Common.applyHtmlEncode(text);},setButtonText:function(text){this.buttonText=text==''?' ':text;if(this.applyTriggers){this.applyTriggers(this.triggers);}},setButtonHeight:function(height){this.buttonHeight=height;this.config.triggers.filebutton.component.height=height;},setButtonWidth:function(width){this.buttonWidth=width;this.config.triggers.filebutton.component.width=width;},setLabelAlign:function(align){this.labelAlign=align;},setLabelWidth:function(width){this.labelWidth=width;},setErrorText:function(text){this.blankText=text;},setMandatory:function(shouldValidate){this.allowBlank=!shouldValidate;if(!this.allowBlank){this.addCls('kta-label-class');} else{this.removeCls('kta-label-class');}},refreshEmptyText:function(){var me=this,inputEl=me.inputEl,emptyClsElements=me.emptyClsElements,value,isEmpty,i;if(inputEl){value=me.getValue();isEmpty=!(inputEl.dom.value||(Ext.isArray(value)&&value.length));if(me.placeholderLabel){me.placeholderLabel.setDisplayed(isEmpty);} if(emptyClsElements){for(i=0;i=0) {this.width=width;} else {this.callParent(arguments);}},getControlData:function(eventinput){if(eventinput.getName().split('.')[1]=="Destination"){return this.Destination;} else if(eventinput.getName().split('.')[1]=="FileSize"){return this.FileSize;} else if(eventinput.getName().split('.')[1]=="Overwrite"){return this.Overwrite;} else if(eventinput.getName().split('.')[1]=="StoreInRepository"){return this.StoreInRepository;} else if(eventinput.getName().split('.')[1]=="DocumentId"){return this.DocumentId;} else if(eventinput.getName().split('.')[1]=="FolderId"){return this.FolderId;} else{return this.getRawValue();}},setDestination:function(val){this.Destination=val;},setFileSize:function(val){this.FileSize=val;},setOverWrite:function(val){this.Overwrite=val;},setStoreInRepository:function(val){this.StoreInRepository=val;},setDocumentId:function(val){this.DocumentId=val;},setFolderId:function(val){this.FolderId=val;},setFileLocation:function(val){this.FileLocation=val;},setHeight:function(val){this.fieldHeight=val;if(this.labelAlign=='left'){this.setTextboxHeight(val);} else{this.setTextboxHeight(val-this.labelHeight);} if(this.labelAlign=='left'){if(this.buttonOnly==true){val=Math.max(this.buttonHeight,this.labelHeight);} else{val=Math.max(val,this.buttonHeight,this.labelHeight);}} else{if(this.buttonOnly==true){val=this.buttonHeight+this.labelHeight;} else{if((val-this.labelHeight)>this.buttonHeight||((val-this.labelHeight)==this.buttonHeight)){val=val;} else{val=this.labelHeight+this.buttonHeight;}}} this.height=val;},setAutoSave:function(val){this.AutoSave=val;},setButtonOnly:function(val) {this.buttonOnly=val;},setMultipleFileSelection:function(){if(this.multiple==true){this.fileInputEl.set({multiple:'multiple'});}},setAcceptedFileTypeExtensions:function(){if(this.accept.length>0){var acceptedTypes='';for(var i=0;ithis.width){$('#'+this.getId()+'').find('.x-btn-button').width(this.width-10);$('#'+this.getId()+'').find('.x-form-file-input').width(this.width-10);} else{if(this.button.getWidth()>this.width-this.labelWidth){$('#'+this.getId()+'').find('.x-btn-button').width(this.width-this.labelWidth-10);$('#'+this.getId()+'').find('.x-form-file-input').width(this.width-this.labelWidth-10);}}} else{this.button.setWidth('100%');this.button.setMargin(0);}}},onRender:function(){this.callParent(arguments);},afterRender:function() {this.setMultipleFileSelection();this.setAcceptedFileTypeExtensions();this.setFileInputWidth();this.setFileInputToolTip();this.formIndex=this.designTimeFormIndex;this.button.formIndex=this.designTimeFormIndex;this.fileInputEl.formIndex=this.designTimeFormIndex},reset:function(){var me=this;me.callParent();me.setMultipleFileSelection();me.setAcceptedFileTypeExtensions();me.setFileInputWidth();},onChangeEventHandler:function(){},clearData:function(){this.setRawValue("");},getFiles:function(){return this.fileInputEl.dom.files;},listeners:{change:function(control,newValue,oldValue,options){var restrictedFiles=false,acceptedFiles=false;var inputFiles=this.fileInputEl.dom;var message='';var maxSize=0;var me=this;if(newValue){for(var ind=0;ind=2147482624){Ext.MessageBox.show({buttons:Ext.MessageBox.OK,closable:false,title:Forms.Constants.PRODUCT_NAME,msg:Forms.Common.Lang.GetLocaleString('92E56481D5474A2486647AA521D725A6',true)});control.reset();control.uploadConfirmed=false;control.setRawValue(null);return;} for(var i=0;i0&&Ext.Array.contains(this.restrict,uploadedExtension)){restrictedFiles=true;message=Ext.String.format(Forms.Common.Lang.GetLocaleString('73FFCAC763C74581BED4CF61956BC6DA',true),this.restrict.join().toLowerCase());break;} if(this.accept.length>0&&!Ext.Array.contains(this.accept,uploadedExtension)){acceptedFiles=true;message=Ext.String.format(Forms.Common.Lang.GetLocaleString('73FFCAC763C74581BED4CF61956BC6DB',true),this.accept.join().toLowerCase());break;}} if(restrictedFiles||acceptedFiles){Ext.MessageBox.show({icon:Ext.MessageBox.ERROR,title:Forms.Constants.PRODUCT_NAME,closable:false,buttons:Ext.Msg.YESNO,icon:Ext.Msg.QUESTION,msg:message,fn:function(btn){if(btn==='yes'){if(!control.multiple) {control.reset();control.setRawValue(null);} else{control.uploadConfirmed=true;if(control.AutoSave&&newValue!=''&&inputFiles.files.length>0){UploadFiles(control,'["'+control.name+'"]',me.thisForm)} control.onChangeEventHandler();}} else if(btn==='no'){control.uploadConfirmed=false;control.reset();control.setRawValue(null);}}});} else{control.uploadConfirmed=undefined;if(control.AutoSave&&newValue!=''&&inputFiles.files.length>0){UploadFiles(control,'["'+control.name+'"]',me.thisForm)} control.onChangeEventHandler();}}}}});Ext.define('Forms.Controls.Standard.HorizontalRule',{extend:'Ext.Component',constructor:function(){this.callParent(arguments);if(!this.style){this.style={display:'inline-block'};} this.focusable=true;},cls:'KTAHorizontalRule',config:{formIndex:''},autoEl:{tag:'hr'},setId:function(id){this.id=id;},setColor:function(color){this.on('afterrender',function(){$('#'+this.id).attr('style','border-color:'+color+' !important;'+'color:'+color+' !important ;'+'background-color:'+color+' !important ;'+$('#'+this.id).attr('style'));});},setFieldCls:function(cssClass){this.on('afterrender',function(){if(Ext.util.CSS.getRule('.'+cssClass)){var horStyle=Ext.util.CSS.getRule("."+cssClass).style;var styleTextValue=horStyle.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');color=horStyle.color||horStyle.backgroundColor;var borderstyle='border-color:'+horStyle.borderColor+' !important;' if(color){$('#'+this.getId()).attr('style',styleTextValue+(horStyle.borderColor?borderstyle:'border-color:'+color+' !important;')+'color:'+color+' !important ;'+'background-color:'+color+' !important ;');} else{$('#'+this.getId()).attr('style',styleTextValue);}}});},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setEnable:function(shouldEnable){},setTabIndex:function(val){this.tabIndex=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){this.tooltip=val;},setWidth:function(width){this.width=width;},setMandatory:function(shouldValidate){},onRender:function(){this.autoEl=Ext.apply({},this.initialConfig,this.autoEl);this.callParent(arguments);this.el.dom.tabIndex=this.tabIndex;}});Ext.define('Forms.Controls.Standard.Hyperlink',{extend:'Ext.Component',autoEl:{tag:'a',target:'_self',href:''},cls:'KTAHyperlink',initComponent:function(){this.callParent(arguments);},constructor:function(){this.callParent(arguments);if(!this.style){this.style={display:'inline-block','vertical-align':'top'};};this.autoEl={tag:'a',target:'_self',href:''};this.focusable=true;},setTargetAsNewWindow:function(){this.autoEl.target='_blank';},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setTabIndex:function(val){this.tabIndex=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){Forms.Common.Common.CreateTooltip(this,val);},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setMandatory:function(shouldValidate){},setStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.style['font']=fontStyle+fontsize+"px "+fontname;this.style['color']=color;this.style['text-decoration']=textStyle;this.style['text-align']=alignment;},setFieldCls:function(cssClass){if(Ext.util.CSS.getRule("."+cssClass)){this.on('afterrender',function(){var styleTextValue=Ext.util.CSS.getRule("."+cssClass).style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()).attr('style',styleTextValue);});}},setControlData:function(text){this.setHtml(text);this.href='';if(this.el){this.el.dom.innerHTML=Ext.util.Format.htmlEncode(text);} this.fireEvent('ValueUpdated',this,text);},getControlData:function(){if(this.el) {return this.el.getHtml();} else{return this.html;}},setNavigation:function(text){this.href=text;},onClickEventHandler:function(){},onRender:function(){this.autoEl=Ext.apply({},this.initialConfig,this.autoEl);this.autoEl.href='';this.autoEl.html=Ext.util.Format.htmlEncode(this.html);this.callParent(arguments);this.el.dom.tabIndex=this.tabIndex;}});Ext.define('Forms.Controls.Standard.Image',{extend:'Ext.panel.Panel',modal:false,closable:false,focusable:true,bodyStyle:'background-color: transparent;',border:false,initComponent:function(){this.callParent(arguments);},config:{resizeToFit:true,},constructor:function(){this.callParent(arguments);},cls:'KTAImage kta-custom-controls',setId:function(id){},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setTabIndex:function(val){this.tabIndex=val;},setWidth:function(width){this.width=width;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){Forms.Common.Common.CreateTooltip(this,val);},setEnable:function(shouldEnable){var getInternetExplorerVersion=function(){var rv=10;if(navigator.appName=='Microsoft Internet Explorer'){var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null) rv=parseFloat(RegExp.$1);} return rv;} var ver=getInternetExplorerVersion();if(ver>8.0){this.setDisabled(!shouldEnable);}},setImagesArray:function(imageArray){this.ImageCollection=imageArray;},changeImagesStackOrder:function(stackOrder){if(stackOrder!==undefined){stackOrder=stackOrder.toString().split(',');this.removeAll();var imageLength=this.ImageCollection.length;for(var i=0;i0){var image=this.ImageCollection[stackOrder[i]-1];var imageControl=Ext.create('Ext.Img',{src:image.url,id:Forms.Common.Common.GenerateGUID(),style:'position: absolute; background-color: transparent;',height:this.getResizeToFit()?'100%':'auto',width:this.getResizeToFit()?'100%':'auto',alt:image.alternateText?image.alternateText.replace(/\"/g,'"'):image.alternateText});this.add(imageControl);}}}},setMandatory:function(shouldValidate){},onClickEventHandler:function(){},setControlData:function(){},getControlData:function(){},});Ext.define('Forms.Controls.Standard.Label',{extend:'Ext.form.Label',hideLabel:true,headerSize:0,value:null,displayDateWithoutTime:false,style:{'display':'inline-table','word-break':'break-word','word-wrap':'break-word','vertical-align':'top','min-height':'1.2em','padding-right':'0px'},htmlEncode:true,cls:'kofax-label x-form-item-label-default',initComponent:function(){this.callParent(arguments);},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setEnable:function(shouldEnable){},setMandatory:function(shouldValidate){},setReadOnly:function(val){},setTabIndex:function(val){this.tabIndex=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){Forms.Common.Common.CreateTooltip(this,val);},setStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.on('afterrender',function(){if(this.headerSize&&this.headerSize!=0){$('#'+this.id+'.kofax-header'+this.headerSize).attr('style','display:inline; font:'+fontStyle+fontsize+"px "+fontname+' !important;'+'color:'+color+' !important ;'+'text-decoration:'+textStyle+' !important ;'+'text-align:'+alignment+' !important ;'+$('#'+this.id+'.kofax-label').css('text-align',alignment)+$('#'+this.id+'.kofax-header'+this.headerSize).attr('style'));} else{$('#'+this.id+'.kofax-label').attr('style','font:'+fontStyle+fontsize+"px "+fontname+' !important;'+'color:'+color+' !important ;'+'text-decoration:'+textStyle+' !important ;'+'text-align:'+alignment+' !important ;text-align:'+alignment+' !important ;'+$('#'+this.id+'.kofax-label').attr('style'));}});},onRender:function(){this.callParent(arguments);},getControlData:function(){return this.value;},setControlData:function(data){this.suspendEvents(false);if(Ext.isDate(data)){if(this.displayDateWithoutTime){data=Ext.Date.format(data,Forms.Common.Common.GetDateFormat());} else{data=Ext.Date.format(data,Forms.Common.Common.GetDateTimeFormat());}} if(data==0){data=data.toString();} this.value=data;var headerstyle="display:inline;";if($('#'+this.id+'.kofax-header'+this.headerSize).attr('style')){headerstyle=$('#'+this.id+'.kofax-header'+this.headerSize).attr('style');} var html;switch(this.headerSize){case 1:html='

    '+Forms.Common.Common.applyHtmlEncode(data)+'

    ';break;case 2:html='

    '+Forms.Common.Common.applyHtmlEncode(data)+'

    ';break;case 3:html='

    '+Forms.Common.Common.applyHtmlEncode(data)+'

    ';break;case 4:html='

    '+Forms.Common.Common.applyHtmlEncode(data)+'

    ';break;case 5:html='
    '+Forms.Common.Common.applyHtmlEncode(data)+'
    ';break;case 6:html='
    '+Forms.Common.Common.applyHtmlEncode(data)+'
    ';break;default:html=Forms.Common.Common.applyHtmlEncode(data);break;} if(this.html!==html){this.setHtml(html);} this.resumeEvents();this.fireEvent('ValueUpdated',this,data);},setWidth:function(width){this.width=width;this.callParent(arguments);}});Ext.define('Forms.Controls.Standard.NumericText',{extend:'Ext.form.field.Number',allowBlank:true,hideTrigger:true,allowDecimals:true,decimalPrecision:10,currencySymbol:null,forceDecimalPrecision:true,mouseWheelEnabled:false,labelSeparator:'',isFieldValid:true,currentValue:'',valueWhenEmpty:'',showMandatoryAsterisk:false,config:{formIndex:''},setId:function(id){this.id=id;},constructor:function(){this.callParent(arguments);if(!this.style){this.style={'vertical-align':'top'};}},initComponent:function(){this.callParent(arguments);this.on('afterrender',function(){$('#'+this.id+' input').addClass('x-form-text');});},setAllowDecimal:function(val){if(val==false){this.decimalPrecision=0;} else{this.decimalPrecision=10;}},setAllowDecimal2:function(allowDecimal,precision){if(allowDecimal==false){this.decimalPrecision=0;} else{this.decimalPrecision=precision;}},setCurrencyCode:function(currencyCode){var currentValue=this.getControlData();this.currencySymbol=currencyCode;this.setData(currentValue);},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setTabIndex:function(val){this.tabIndex=val;},setZIndex:function(val){this.style={'z-index':val};},setToolTip:function(val){Forms.Common.Common.CreateTooltip(this,val);},setLabelText:function(text){var text=text==''?' ':Forms.Common.Common.applyHtmlEncode(text);this.setFieldLabel(text);},setLabelWidth:function(width){this.labelWidth=width;},setLabelAlign:function(align){this.labelAlign=align;},setShowMandatoryAsterisk:function(val){this.showMandatoryAsterisk=val;},setMandatory:function(shouldValidate){this.allowBlank=!shouldValidate;if(this.showMandatoryAsterisk&&!this.allowBlank){this.addCls('kta-label-class');} else{this.removeCls('kta-label-class');}},setErrorText:function(text){this.blankText=text;},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setWidth:function(width){this.width=width;},setLabelStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){Forms.Common.Common.StandardLabelStyle(this,fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment);},setStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.on('afterrender',function(){$('#'+this.id+' input').attr('style','font:'+fontStyle+fontsize+"px "+fontname+' !important;'+'color:'+color+' !important ;'+'text-decoration:'+textStyle+' !important ;'+'text-align:'+alignment+' !important ;'+$('#'+this.id+' input').attr('style'));});if(this.emptyText!=''&&Ext.isIE){this.on('focus',function(){if(this.getValue()==null){$('#'+this.id+' input').css('color',color);}});}},setFieldCls:function(cssClass){var cssClassObj=Ext.util.CSS.getRule("."+cssClass);var color;if(cssClassObj){color=cssClassObj.style.color;this.on('afterrender',function(){if(this.emptyText!=''&&Ext.isIE&&color){cssClassObj.style.color="";} var styleTextValue=cssClassObj.style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' input').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-text-wrap-default').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-trigger-wrap-default').attr('style',styleTextValue);});} if(this.emptyText!=''&&Ext.isIE&&color){this.on('focus',function(){if(this.getValue()==null){$('#'+this.id+' input').css('color',color);}});}},setLabelCls:function(cssClass){if(Ext.util.CSS.getRule("."+cssClass)){this.on('afterrender',function(){var styleTextValue=Ext.util.CSS.getRule("."+cssClass).style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' .x-form-item-label').attr('style',styleTextValue+$('#'+this.getId()+' .x-form-item-label').attr('style'));});}},removeLabel:function(shouldRemove){this.hideLabel=shouldRemove;},setHintText:function(text){this.emptyText=text;},setMaxLength:function(length){this.enforceMaxLength=false;if(length!=0){this.maxLength=length;this.enforceMaxLength=true;}},onRender:function(){this.callParent(arguments);},setControlData:function(text,target){var propertyUpdated=false;if(target!==undefined){propertyUpdated=Forms.Common.PropertyHelper.SetPropertyValue(this,target,text,false);} if(!propertyUpdated){this.suspendEvents(false);this.setValue(text);this.resumeEvents();this.setCurrentValue(this.getControlData());} this.fireEvent('ValueUpdated',this,text);},setCurrentValue:function(text){this.currentValue=text;},getCurrentValue:function(){return this.currentValue;},setValue:function(value){if(value){value=this.revokeLocaleDecimalSeparator(value);if(!isNaN(value)){value=value-0;value=value.toFixed(this.decimalPrecision);}} var val=this.applyLocaleDecimalSeparator(value);Forms.Controls.Standard.NumericText.superclass.setValue.call(this,val);if(this.hasFormat()){this.setRawValue(this.getFormattedValue(value));}else{Forms.Controls.Standard.NumericText.superclass.setRawValue.call(this,this.applyLocaleDecimalSeparator(value));}},getLabelWidth:function(labelWidth){return this.labelWidth;},getFormattedValue:function(value){if(Ext.isEmpty(value)||!this.hasFormat()) return value;else{var formattedValue=value;if(isNaN(formattedValue)){formattedValue="0";} formattedValue=Ext.util.Format.currency(value,this.currencySymbol+' ',this.decimalPrecision,false);return formattedValue;}},parseValue:function(value,applyLocaleSeparator){var shouldApplyLocaleDecimalSeparator=(applyLocaleSeparator===undefined)?true:applyLocaleSeparator;value=this.revokeLocaleDecimalSeparator(this.removeFormat(value,true));value=Forms.Controls.Standard.NumericText.superclass.parseValue.call(this,value);value=this.fixPrecision(value);if(shouldApplyLocaleDecimalSeparator){value=this.applyLocaleDecimalSeparator(value);} return value;},removeFormat:function(value,replaceThousandSeparator){if(Ext.isEmpty(value)||!this.formatIsApplied(value)) return value;else{value=value.toString().replace(this.currencySymbol+' ','');if(replaceThousandSeparator){value=value.replace(new RegExp('['+Ext.util.Format.thousandSeparator+']','g'),'');} return value;}},getErrors:function(value){var b=this.removeFormat(value,true);var a=this,c=Ext.form.field.Spinner.prototype.getErrors.call(this,b),e=Ext.String.format,d;if(b.length<1){return c} b=String(b).replace(a.decimalSeparator,'.');if(isNaN(b)){c.push(e(a.nanText,b))} var shouldApplyLocaleDecimalSeparator=false;d=a.parseValue(b,shouldApplyLocaleDecimalSeparator);if(a.minValue===0&&d<0){c.push(this.negativeText)}else if(da.maxValue){c.push(e(a.maxText,a.maxValue))} return c},hasFormat:function(){return!Ext.isEmpty(this.currencySymbol);},formatIsApplied:function(value){if(this.hasFormat()&&value.indexOf(this.currencySymbol)!=-1){return true;} return false;},getControlData:function(input){if(input!==undefined&&input.getName()&&Forms.Common.PropertyHelper.IsControlProperty(input.getName())){return Forms.Common.PropertyHelper.GetPropertyValue(this,input.getName());} if(this.getRawValue()){return this.removeFormat(this.getRawValue(),true);} return this.valueWhenEmpty;},setValueWhenEmpty:function(text){this.valueWhenEmpty=text;},isNullable:function(){if(this.valueWhenEmpty==null){return true;} return false;},onChangeEventHandler:function(control){Forms.Common.Common.resetIsFieldValid(control);},setInputTypeNumber:function(){},listeners:{change:function(tb,newValue,oldValue,options){this.onChangeEventHandler(tb);}},valueToRaw:function(value){var me=this,decimalSeparator=me.decimalSeparator;value=me.parseValue(value);value=me.revokeLocaleDecimalSeparator(value);value=me.fixPrecision(value);value=Ext.isNumber(value)?value:parseFloat(value);if(isNaN(value)){value='';} else{value=value.toFixed(me.decimalPrecision);value=me.revokeLocaleDecimalSeparator(value);} return value;},checkChange:function(){var me=this,newVal,oldVal;if(!me.suspendCheckChange){newVal=me.getRawValue();oldVal=me.lastValue;if(!me.isDestroyed&&me.didValueChange(newVal,oldVal)){me.lastValue=newVal;me.fireEvent('change',me,newVal,oldVal);} me.onChange(newVal,oldVal);}},publishValue:function(){var me=this;if(me.rendered&&!me.getErrors(me.getRawValue()).length){me.publishState('value',me.getRawValue());}},onBlur:function(){var me=this;var val=me.getRawValue();var currentVal=this.getCurrentValue();this.removeCls(this.fieldFocusCls);this.triggerWrap.removeCls(this.triggerWrapFocusCls);this.inputWrap.removeCls(this.inputWrapFocusCls);if(val){if(me.hasFormat()){val=me.removeFormat(val,true);} val=me.revokeLocaleDecimalSeparator(val);if(!isNaN(val)){val=parseFloat(val)} val=val.toFixed(me.decimalPrecision);val=me.applyLocaleDecimalSeparator(val);me.setControlData(val);} if(currentVal!=this.getControlData()){this.setCurrentValue(this.getControlData());Forms.Common.Common.refreshFormControlsForDebugging();this.callParent(arguments);}},applyLocaleDecimalSeparator:function(value){if(value!=null&&value!==undefined){return String(value).replace('.',Ext.util.Format.decimalSeparator);} return'';},revokeLocaleDecimalSeparator:function(value){if(value){return String(value).replace(Ext.util.Format.decimalSeparator,'.');} return'';}});Ext.define('Forms.Controls.Standard.RadioButtonList',{extend:'Ext.form.RadioGroup',cls:'kta-radiogroup',allowBlank:true,labelSeparator:'',showMandatoryAsterisk:false,style:{'vertical-align':'top'},constructor:function(){this.callParent(arguments);},initComponent:function(){this.callParent(arguments);},config:{defaultValue:'',formIndex:''},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setColumns:function(i){this.columns=i;},setTabIndex:function(val){var me=this;this.tabIndex=val;for(var i=0;i0){this.removeAll(destroyChildItems);}},setTabs:function(tabs){for(var i=0;i0&&i==this.getActiveTabIndex()){for(var j=0;j',addItem,deleteItem]});this.addDocked(toolbar);}},initDeleteKeyNavEvent:function(){var me=this;me.keyNav=Ext.create('Ext.util.KeyNav',{target:me.view.el,del:me.onDeleteKey,scope:me});},onDeleteKey:function(){var me=this,selModel=me.getSelectionModel();me.deleteRows(false,selModel.getSelection());},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setHeaderStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var fontStyle='';var textStyle='';var fontWeight='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontWeight='bold ';} if(italic){fontStyle='italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.on('viewready',function(){$('#'+this.id+' .x-column-header span').attr('style','font-weight:'+fontWeight+' !important;font-size:'+fontsize+'px !important;font-style:'+fontStyle+' !important;font-family:'+fontname+' !important; color: '+color+' !important; text-decoration: '+textStyle+' !important;');$('.x-column-header').css('text-align',alignment)});},setDefaultRowStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var me=this;var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.style.font=fontStyle+fontsize+"px "+fontname;this.style.color=color;this.style['text-decoration']=textStyle;var style='font: '+fontStyle+fontsize+'px '+fontname+'; color: '+color+'; text-decoration: '+textStyle+'; text-align:'+alignment+' !important;';var rowAndCellSelector='#@id@ .x-grid-row, ';rowAndCellSelector+='#@id@ .x-grid-cell-inner';rowAndCellSelector=rowAndCellSelector.replace(/@id@/g,this.id);this.applyRowStyles(rowAndCellSelector,'',style);},setHeaderCls:function(cssClass){if(Ext.util.CSS.getRule("."+cssClass)){this.on('afterrender',function(){if(Ext.util.CSS.getRule('.'+cssClass).style.cssText){$('#'+this.id+' .x-grid-header-ct').addClass(cssClass);$('#'+this.id+' .x-column-header-over').addClass(cssClass);$('#'+this.id+' .x-column-header-inner').addClass(cssClass);$('#'+this.id+' .x-grid-header-ct .x-column-header span').addClass(cssClass);$('#'+this.id+' .x-grid-header-ct .x-column-header span').attr('style','border: 0 !important;'+Ext.util.CSS.getRule('.'+cssClass).style.cssText+$('#'+this.getId()+' .x-grid-item').attr('style'));}});}},setDefaultRowCls:function(cssClass){var rowAndCellSelector='#@id@ .x-grid-row, ';rowAndCellSelector+='#@id@ .x-grid-cell-inner';rowAndCellSelector=rowAndCellSelector.replace(/@id@/g,this.id);this.applyRowStyles(rowAndCellSelector,cssClass,'');},setAlternateRowCls:function(cssClass){var rowAndCellSelector='#@id@ .x-grid-item-alt .x-grid-row, ';rowAndCellSelector+='#@id@ .x-grid-item-alt .x-grid-cell-inner';rowAndCellSelector=rowAndCellSelector.replace(/@id@/g,this.id);this.applyRowStyles(rowAndCellSelector,cssClass,'');},setAlternateRowStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var me=this;var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.style.font=fontStyle+fontsize+"px "+fontname;this.style.color=color;this.style['text-decoration']=textStyle;var style='font: '+fontStyle+fontsize+'px '+fontname+' !important; color: '+color+' !important; text-decoration: '+textStyle+' !important; text-align:'+alignment+' !important;';var rowAndCellSelector='#@id@ .x-grid-item-alt .x-grid-row, ';rowAndCellSelector+='#@id@ .x-grid-item-alt .x-grid-cell-inner';rowAndCellSelector=rowAndCellSelector.replace(/@id@/g,this.id);this.applyRowStyles(rowAndCellSelector,'',style);},setSelectedRowCls:function(cssClass){var rowAndCellSelector='#@id@ .x-grid-item.x-grid-item-selected .x-grid-row, ';rowAndCellSelector+='#@id@ .x-grid-item.x-grid-item-selected .x-grid-cell-inner';rowAndCellSelector=rowAndCellSelector.replace(/@id@/g,this.id);this.applyRowStyles(rowAndCellSelector,cssClass,'');},setSelectedRowStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.style.font=fontStyle+fontsize+"px "+fontname;this.style.color=color;this.style['text-decoration']=textStyle;var style='font: '+fontStyle+fontsize+'px '+fontname+' !important; color: '+color+' !important; text-decoration: '+textStyle+' !important; text-align:'+alignment+' !important;';var rowAndCellSelector='#@id@ .x-grid-item.x-grid-item-selected .x-grid-row, ';rowAndCellSelector+='#@id@ .x-grid-item.x-grid-item-selected .x-grid-cell-inner';rowAndCellSelector=rowAndCellSelector.replace(/@id@/g,this.id);this.applyRowStyles(rowAndCellSelector,'',style);},setFrameCls:function(cssClass){this.on('afterrender',function(){if(Ext.util.CSS.getRule('.'+cssClass)){$('#'+this.getId()+' .x-panel-body.x-grid-with-row-lines.x-grid-body.x-panel-body-default.x-layout-fit.x-panel-body-default').attr('style',Ext.util.CSS.getRule('.'+cssClass).style.cssText+$('#'+this.getId()+' .x-panel-body.x-grid-with-row-lines.x-grid-body.x-panel-body-default.x-layout-fit.x-panel-body-default').attr('style'));$('#'+this.getId()+' .x-grid-header-ct.x-docked.x-grid-header-ct-default.x-docked-top.x-grid-header-ct-docked-top').attr('style',Ext.util.CSS.getRule('.'+cssClass).style.cssText+$('#'+this.getId()+' .x-grid-header-ct.x-docked.x-grid-header-ct-default.x-docked-top.x-grid-header-ct-docked-top').attr('style'));var style=Ext.util.CSS.getRule('.'+cssClass).style;var css='';var properties=style.cssText.split(';');for(var i=0;i0){var colName=eventInput.getName().split(".")[1];} if(eventInput.getSelectionMode()==Forms.Constants.SELECTION_MODE.ALL){rowData=this.getAllRows(colName);} else{rowData=this.getSelectedRows(colName);} var dropDownText=this.getDropDownText(colName,rowData,eventInput);if(dropDownText!=null){return dropDownText;} if(eventInput.isServerEvent){if(rowData){rowData=Forms.Common.Common.updateDateValuesInTableRowDataToIgnoreServerTimezoneConversion(rowData,this.getColumns(),colName);} var column=Ext.Array.findBy(this.getColumns(),function(column){return column.dataIndex===colName});if(column&&column.ignoreServerTimeZoneConversion){eventInput.ignoreTimeZone=true;}} return rowData;},getDropDownText:function(colName,rowData,eventInput){function isDropDownColumn(colName,control){var ctrl;for(var i=0;i1){for(i=0;i2){if(columnNames.length>1){if(typeof(valueArray[rowNo][cell])=="string"){columnData[columnNames[cell].split('.')[2]]=valueArray[rowNo][cell].replace(/"/g,""");} else{columnData[columnNames[cell].split('.')[2]]=valueArray[rowNo][cell];}} else{if(typeof(valueArray[rowNo][cell])=="string"){columnData[TEXT_FIELD]=valueArray[rowNo][cell].replace(/"/g,""");columnData[VALUE_FIELD]=valueArray[rowNo][cell].replace(/"/g,""");} else{columnData[TEXT_FIELD]=valueArray[rowNo][cell];columnData[VALUE_FIELD]=valueArray[rowNo][cell];}}} else{columnData[columnNames[cell]]=valueArray[rowNo][cell];}} return columnData;},setControlData:function(columnName,valueArray){var propertyUpdated=false;if(valueArray!==undefined){propertyUpdated=Forms.Common.PropertyHelper.SetPropertyValue(this,valueArray,columnName,false);} if(!propertyUpdated){if((valueArray==undefined||valueArray=='')||(columnName==undefined||columnName=='')){this.clearData();} else{var theStore=this.getStore();var parsedArray=JSON.parse(valueArray);var tempArray=[];for(i=0;i0){this.getSelectionModel().select(0);} $('#'+this.id+'').find('.x-scroller-ct').scrollLeft(0);}}},onRowSelectEventHandler:function(){},onRowDeselectEventHandler:function(){},listeners:{select:function(rowmodel,record,index,options){this.onRowSelectEventHandler();this.fireEvent('ValueUpdated',this);},deselect:function(rowmodel,record,index,options){this.onRowDeselectEventHandler();this.fireEvent('ValueUpdated',this);},edit:function(editor,e,options){if(e.column.editor.xtype=="checkboxfield"&&e.column.editor.value!=false.toString()){if(e.value==true){e.record.set(e.field,1);} else{e.record.set(e.field,0);}} if(e.column.editor.xtype=="numberfield"){if(e.value!=null){e.record.set(e.field,parseFloat(e.value).toFixed(e.column.editor.decimalPrecision));e.grid.getView().refresh();}}}},setValueConvertersForColumns:function(){var me=this;var columns=me.getView().getHeaderCt().getGridColumns();columns.forEach(function(column){if(column.editor&&column.editor.isXType&&column.editor.isXType("combobox")){me.setValueConverterForDropDownColumn(column,me);} else{me.setValueConverterForColumn(column,me);}});},setValueConverterForDropDownColumn:function(dropDownColumn,table){var valueConverter=function(newValue,currentRecord){var foundValue=false;var tableStoreField=this;if(newValue===null) return newValue;dropDownColumn.editor.store.each(function(drpDownRecord){if(newValue==drpDownRecord.get('Value')){foundValue=true;return false;}});if(!foundValue){return table.getStore().indexOf(currentRecord)===-1?(dropDownColumn.editor.defaultValue===undefined?'':dropDownColumn.editor.defaultValue):currentRecord.get(tableStoreField.name);} else{return newValue;}} var columnField;this.store.model.getFields().forEach(function(field){if(field.name===dropDownColumn.dataIndex){columnField=field;return false;}});columnField.convert=valueConverter;},setValueConverterForColumn:function(column,table){var columnField;this.store.model.getFields().forEach(function(field){if(field.name===column.dataIndex){columnField=field;return false;}});var numberFieldConverter=function(newValue,currentRecord){if(newValue===null) return newValue;if(!isNaN(Math.round(newValue))){var columns=table.getColumns();for(var index=0;index0){newValue=parseFloat(newValue).toFixed(columns[index].editor.decimalPrecision);if(isNaN(newValue)){return'';} else{return newValue;}} else if(columns[index].valueWhenEmpty==null&&newValue==''){return newValue;} break;}} return Math.round(newValue)} else{if(table.getStore().indexOf(currentRecord)===-1){return null;} else{return currentRecord.get(this.name)}}};var dateFieldConverter=function(newValue,currentRecord){if(newValue===null) return newValue;if(new Date(newValue)!=='Invalid Date'&&!isNaN(Date.parse(newValue))){return newValue;} else{if(table.getStore().indexOf(currentRecord)===-1){return null;} else{return currentRecord.get(this.name)}}};var booleanFieldConverter=function(newValue,currentRecord){var trueRe=/^\s*(?:true|yes|on|1)\s*$/i;if(typeof newValue==='boolean'){return newValue;} if(newValue===undefined||newValue===null||newValue===''){return null;} return trueRe.test(String(newValue));};switch(column&&column.editor&&column.editor.xtype){case'numberfield':columnField.convert=numberFieldConverter;break;case'datefield':columnField.convert=dateFieldConverter;break;case'textfield':if(column.$className=='Ext.grid.column.Boolean'){columnField.convert=booleanFieldConverter;} break;}},resizeColumns:function(){var grid=this,availableColumns=[];var tableCols=grid.columnManager.getColumns();Ext.each(tableCols,function(col,index){if(!col.isHidden()){availableColumns.push(col);}});if(availableColumns.length>0){availableColumns[availableColumns.length-1].flex=1;delete availableColumns[availableColumns.length-1].width;}},applyRowStyles:function(cssSelector,className,inlineStyle){var style=inlineStyle;if(className&&Ext.util.CSS.getRule("."+className)){style=Ext.util.CSS.getRule("."+className).style.cssText;} document.styleSheets[document.styleSheets.length-1].insertRule(cssSelector+'{ '+style+' }',0);},});Ext.define('Forms.Controls.Standard.TextArea',{extend:'Ext.form.field.TextArea',allowBlank:true,vtype:'',vtypeText:'',labelSeparator:'',valueWhenEmpty:'',usingMask:false,currentValue:'',isFieldValid:true,showMandatoryAsterisk:false,config:{formIndex:''},constructor:function(){this.callParent(arguments);if(!this.style){this.style={'vertical-align':'top'};}},initComponent:function(){this.callParent(arguments);},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setPassword:function(){this.inputType='password';},setEmail:function(){this.inputType="email";this.vtype='email';},setUrl:function(){this.inputType="url";this.vtype='url';},setTabIndex:function(val){this.tabIndex=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){Forms.Common.Common.CreateTooltip(this,val);},setLabelText:function(text){var text=text==''?' ':Forms.Common.Common.applyHtmlEncode(text);this.setFieldLabel(text);},setShowMandatoryAsterisk:function(val){this.showMandatoryAsterisk=val;},setLabelAlign:function(align){this.labelAlign=align;},setMandatory:function(shouldValidate){this.allowBlank=!shouldValidate;if(this.showMandatoryAsterisk&&!this.allowBlank){this.addCls('kta-label-class');} else{this.removeCls('kta-label-class');}},setFormat:function(format){this.vtype=format;},setErrorText:function(text){this.blankText=text;this.vtypeText=text;},setHintText:function(text){this.emptyText=text;},setMaxLength:function(length){this.enforceMaxLength=false;if(length!==0){this.maxLength=length;this.enforceMaxLength=true;}},setMinLength:function(length){if(length!==0){this.minLength=length;}},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setWidth:function(width){this.width=width;},setLabelWidth:function(width){this.labelWidth=width;},setLabelStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,textalign){Forms.Common.Common.StandardLabelStyle(this,fontname,fontsize,color,bold,italic,underline,strikethrough,overline,textalign);},setStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.on('afterrender',function(){$('#'+this.id+' textarea').attr('style','font:'+fontStyle+fontsize+"px "+fontname+' !important;'+'color:'+color+' !important ;'+'text-decoration:'+textStyle+' !important ;'+'text-align:'+alignment+' !important ;'+$('#'+this.id+' textarea').attr('style'));});if(this.emptyText!=''&&Ext.isIE){this.on('focus',function(){if(this.getValue()==''){$('#'+this.id+' textarea').css('color',color);}});}},setFieldCls:function(cssClass){var cssClassObj=Ext.util.CSS.getRule("."+cssClass);var color;if(cssClassObj){color=cssClassObj.style.color;this.on('afterrender',function(){if(this.emptyText!=''&&Ext.isIE&&color){cssClassObj.style.color="";} var styleTextValue=cssClassObj.style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' textarea').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-text-wrap-default').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-trigger-wrap-default').attr('style',styleTextValue);});} if(this.emptyText!=''&&Ext.isIE&&color){this.on('focus',function(){if(this.getValue()==''){$('#'+this.id+' textarea').css('color',color);}});}},setLabelCls:function(cssClass){if(Ext.util.CSS.getRule("."+cssClass)){this.on('afterrender',function(){var styleTextValue=Ext.util.CSS.getRule("."+cssClass).style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' .x-form-item-label').attr('style',styleTextValue+$('#'+this.getId()+' .x-form-item-label').attr('style'));});}},removeLabel:function(shouldRemove){this.hideLabel=shouldRemove;},onRender:function(){this.callParent(arguments);},getErrors:function(value){if(this.usingMask) return Forms.Controls.Standard.TextArea.superclass.getErrors.call(this,this.getValue());else return Forms.Controls.Standard.TextArea.superclass.getErrors.call(this,value);},setControlData:function(text,target){var propertyUpdated=false;if(target!==undefined){propertyUpdated=Forms.Common.PropertyHelper.SetPropertyValue(this,target,text,false);} if(!propertyUpdated){this.suspendEvents(false);this.setValue(text);this.resumeEvents();this.setCurrentValue(this.getValue());} this.fireEvent('ValueUpdated',this,text);},getControlData:function(input){if(input!=undefined&&input.getName()&&Forms.Common.PropertyHelper.IsControlProperty(input.getName())){return Forms.Common.PropertyHelper.GetPropertyValue(this,input.getName());} if(this.getValue()!=undefined&&this.getValue()!=''&&this.getValue()!=null) return this.getValue();return this.valueWhenEmpty;},setCurrentValue:function(text){this.currentValue=text;},getCurrentValue:function(){return this.currentValue;},getLabelWidth:function(labelWidth){return this.labelWidth;},setValueWhenEmpty:function(text){this.valueWhenEmpty=text;},onChangeEventHandler:function(control){Forms.Common.Common.resetIsFieldValid(control);},onBlur:function(){this.removeCls(this.fieldFocusCls);this.triggerWrap.removeCls(this.triggerWrapFocusCls);this.inputWrap.removeCls(this.inputWrapFocusCls);if(this.getCurrentValue()!=this.getControlData()){this.callParent(arguments);this.setCurrentValue(this.getControlData());Forms.Common.Common.refreshFormControlsForDebugging();}},listeners:{change:function(tb,newValue,oldValue,options){this.onChangeEventHandler(tb);}}});Ext.define('Forms.Controls.Standard.TextBox',{extend:'Ext.form.field.Text',allowBlank:true,vtype:'',vtypeText:'',labelSeparator:'',valueWhenEmpty:'',usingMask:false,currentValue:'',isFieldValid:true,showMandatoryAsterisk:false,config:{formIndex:''},cls:'kta-textbox',style:{'vertical-align':'top'},constructor:function(){this.callParent(arguments);if(!this.style){this.style={'vertical-align':'top'};}},initComponent:function(){this.callParent(arguments);},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setPassword:function(){this.inputType='password';},setEmail:function(){this.inputType="email";this.vtype='email';},setUrl:function(){this.inputType="url";this.vtype='url';},setTabIndex:function(val){this.tabIndex=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){Forms.Common.Common.CreateTooltip(this,val);},setLabelText:function(text){var text=text==''?' ':Ext.util.Format.htmlEncode(text);this.setFieldLabel(text);},setLabelAlign:function(align){this.labelAlign=align;},setLabelWidth:function(width){this.labelWidth=width;},setShowMandatoryAsterisk:function(val){this.showMandatoryAsterisk=val;},setMandatory:function(shouldValidate){this.allowBlank=!shouldValidate;if(this.showMandatoryAsterisk&&!this.allowBlank){this.addCls('kta-label-class');} else{this.removeCls('kta-label-class');}},setFormat:function(format){this.vtype=format;},setErrorText:function(text){this.blankText=text;},setMaxLength:function(length){this.enforceMaxLength=false;if(length!=0){this.maxLength=length;this.enforceMaxLength=true;}},setMinLength:function(length){if(length!=0){this.minLength=length;}},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setLabelStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,textalign){Forms.Common.Common.StandardLabelStyle(this,fontname,fontsize,color,bold,italic,underline,strikethrough,overline,textalign);},setStyle:function(fontname,fontsize,color,bold,italic,underline,strikethrough,overline,alignment){var fontStyle='';var textStyle='';if(!bold&&!italic){fontStyle='normal ';} else{if(bold){fontStyle='bold ';} if(italic){fontStyle=fontStyle+'italic ';}} if(!underline&&!strikethrough&&!overline){textStyle='none';} else{if(underline){textStyle='underline ';} if(strikethrough){textStyle=textStyle+'line-through ';} if(overline){textStyle=textStyle+'overline ';}} this.on('afterrender',function(){$('#'+this.id+' input').attr('style','font:'+fontStyle+fontsize+"px "+fontname+' !important;'+'color:'+color+' !important ;'+'text-decoration:'+textStyle+' !important ;'+'text-align:'+alignment+' !important ;'+$('#'+this.id+' input').attr('style'));});if(this.emptyText!=''&&Ext.isIE) {this.on('focus',function(){if(this.getValue()==''){$('#'+this.id+' input').css('color',color);}});}},setFieldCls:function(cssClass){var cssClassObj=Ext.util.CSS.getRule("."+cssClass);var color;if(cssClassObj){color=cssClassObj.style.color;this.on('afterrender',function(){if(this.emptyText!=''&&Ext.isIE&&color){cssClassObj.style.color="";} var styleTextValue=cssClassObj.style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' input').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-text-wrap-default').attr('style',styleTextValue);$('#'+this.getId()+' .x-form-trigger-wrap-default').attr('style',styleTextValue);});} if(this.emptyText!=''&&Ext.isIE&&color){this.on('focus',function(){if(this.getValue()==''){$('#'+this.getId()+' input').css('color',color);}});}},setLabelCls:function(cssClass){if(Ext.util.CSS.getRule("."+cssClass)){this.on('afterrender',function(){var styleTextValue=Ext.util.CSS.getRule("."+cssClass).style.cssText.replace(/ !important;/g,';').replace(/;/g,' !important;');$('#'+this.getId()+' .x-form-item-label').attr('style',styleTextValue+$('#'+this.getId()+' .x-form-item-label').attr('style'));});}},removeLabel:function(shouldRemove){this.hideLabel=shouldRemove;},getErrors:function(value){if(this.usingMask) return Forms.Controls.Standard.TextBox.superclass.getErrors.call(this,this.getValue());else return Forms.Controls.Standard.TextBox.superclass.getErrors.call(this,value);},setControlData:function(text,target){var propertyUpdated=false;if(target!==undefined){propertyUpdated=Forms.Common.PropertyHelper.SetPropertyValue(this,target,text,false);} if(!propertyUpdated){this.suspendEvents(false);text=text?text.toString():text;text=Forms.Common.Common.truncateChars(this.maxLength,text);this.setValue(text);this.resumeEvents();this.setCurrentValue(this.getValue());} this.fireEvent('ValueUpdated',this,text);},setCurrentValue:function(text){this.currentValue=text;},getCurrentValue:function(){return this.currentValue;},getLabelWidth:function(labelWidth){return this.labelWidth;},setWidth:function(width){this.callParent(arguments);},getControlData:function(input){if(input!==undefined&&input.getName()&&Forms.Common.PropertyHelper.IsControlProperty(input.getName())){return Forms.Common.PropertyHelper.GetPropertyValue(this,input.getName());} if(this.getValue()!=undefined&&this.getValue()!=''&&this.getValue()!=null) return this.getValue();return this.valueWhenEmpty;},isNullable:function(){if(this.valueWhenEmpty==null){return true;} return false;},setValueWhenEmpty:function(text){this.valueWhenEmpty=text;},setHintText:function(text){this.emptyText=text;},onChangeEventHandler:function(control){Forms.Common.Common.resetIsFieldValid(control);},onBlur:function(){this.removeCls(this.fieldFocusCls);this.triggerWrap.removeCls(this.triggerWrapFocusCls);this.inputWrap.removeCls(this.inputWrapFocusCls);if(this.getCurrentValue()!=this.getControlData()){this.callParent(arguments);this.setCurrentValue(this.getControlData());Forms.Common.Common.refreshFormControlsForDebugging();}},onRender:function(){this.callParent(arguments);},listeners:{change:function(tb,newValue,oldValue,options){this.onChangeEventHandler(tb);}},valueToRaw:function(value){if(Ext.isDate(value)){return Ext.Date.format(value,Forms.Common.Common.GetDateFormat());} return''+Ext.valueFrom(value,'');},rawToValue:function(rawValue){var prvsValue=this.value;if(prvsValue instanceof Date){if(Ext.Date.format(prvsValue,Forms.Common.Common.GetDateFormat())==rawValue){return prvsValue;}else{var newDate=Ext.Date.parse(rawValue,Forms.Common.Common.GetDateFormat());if(newDate){return newDate;}}} return rawValue;}});Ext.define('Forms.Controls.Standard.Tile',{extend:'Ext.container.Container',config:{activeTabNumber:0,formIndex:'',titleText:'',description:'',imageUrl:'',border:1,imageWidthPercentage:40,id:'',sessionId:Forms.Common.Common.GetSessionID(),refreshInterval:5,queryIdentity:{},defaultBackgroundColor:'rgba(255,0,156,0.8)',conditionalColor:[],count:0,currentQueryID:'',title:'',dynamicQueryName:'',dynamicQueryID:'',dynamicQueryType:'',dynamicFilterField:'',dynamicFilterValue:'',formUserData:{},formAction:{},refreshTimer:null},layout:{type:'vbox',align:'stretch'},style:{backgroundColor:'rgba(255, 191, 0, 1)',width:'100%'},overflowHandler:'scroller',constructor:function(){this.callParent(arguments);if(!this.style){this.style={};} this.dynamicJobFilter=Ext.create('Forms.Custom.Classes.JobFilterOverride',{});this.dynamicActivitFilter=Ext.create('Forms.Custom.Classes.JobActivityFilterOverride',{});},getDynamicFilterField:function(){return this.dynamicFilterField;},setDynamicFilterField:function(value){this.dynamicFilterField=value;this.dynamicFilterFieldSet=true;if(this.dynamicFilterFieldSet&&this.dynamicFilterValueSet){this.updateDynamicFilter(this.dynamicFilterField,this.dynamicFilterValue);this.dynamicFilterFieldSet=this.dynamicFilterValueSet=false;}},getDynamicFilterValue:function(){return this.dynamicFilterValue;},setDynamicFilterValue:function(value){this.dynamicFilterValue=value;this.dynamicFilterValueSet=true;if(this.dynamicFilterFieldSet&&this.dynamicFilterValueSet){this.updateDynamicFilter(this.dynamicFilterField,this.dynamicFilterValue);this.dynamicFilterFieldSet=this.dynamicFilterValueSet=false;}},initComponent:function(){var me=this;this.isUpdateControlFired=false;this.lblTitle=Ext.create('Ext.form.Label',{html:'',flex:2.5,width:'100%',style:{color:'white',overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','padding-left':'20px','padding-top':'15px','padding-right':'10px'}});this.lblQueryCount=Ext.create('Ext.form.Label',{html:'0',width:'100%',style:{color:'white',overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','line-height':'normal'}});this.imageControl=Ext.create('Ext.Img',{id:Forms.Common.Common.GenerateGUID(),style:'background-color: transparent;padding-top:10px;',height:'90%',width:'100%'});this.middlePanel=Ext.create('Ext.container.Container',{flex:5,width:'100%',style:{background:'transparent','padding-left':'20px'},layout:{type:'hbox',align:'stretch'},items:[this.lblQueryCount,this.imageControl]});this.lblDescription=Ext.create('Ext.form.Label',{html:'',flex:2.5,width:'100%',style:{color:'white',overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','padding-left':'20px','padding-top':'10px','padding-right':'10px'}});Ext.applyIf(me,{items:[this.lblTitle,this.middlePanel,this.lblDescription]});me.callParent(arguments);},getControlData:function(input){if(input!=undefined&&input.getName()){if(input.getName()===this.name+'.CurrentQueryName'){return this.getQueryIdentity().Name;} else if(input.getName()===this.name+'.CurrentQueryID'){return this.getQueryIdentity().Id;} else if(input.getName()===this.name+'.Title'){return this.getTitleText();} else if(input.getName()===this.name+'.Count'){return this.getCount();}}},setControlData:function(val,name){var me=this;var properties=name?name.split('.'):name;if(properties&&properties.length>=2){if(properties[1].toUpperCase()==="DYNAMICQUERYNAME"){this.setDynamicQueryName(val);} else if(properties[1].toUpperCase()==="DYNAMICQUERYID"){this.setDynamicQueryID(val);} else if(properties[1].toUpperCase()==="DYNAMICFILTERFIELD"){this.setDynamicFilterField(val);} else if(properties[1].toUpperCase()==="DYNAMICFILTERVALUE"){this.setDynamicFilterValue(val);} else if(properties[1].toUpperCase()==="DYNAMICQUERYTYPE"){this.setDynamicQueryType(val);} else if(properties[1].toUpperCase()==="COUNT"){if(val!==undefined){me.setControlDetails(val);}}}},setUserData:function(data){this.setFormUserData(data);},setControlDetails:function(queryCount){var queryCountText='0';if(queryCount===-1||queryCount===0){queryCount=0;} else{queryCountText=String(queryCount);} this.setCount(queryCount);this.lblQueryCount.setHtml(queryCountText);Forms.Common.Common.CreateTooltip(this.lblQueryCount,queryCountText);this.updateConditionalColor();},setEnable:function(enable){},setVisible:function(shouldVisible){var me=this;if(shouldVisible){me.show();} else{me.hide();}},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setToolTip:function(val){},setBackgroundColor:function(color,controlCls){var me=this;},updateConditionalColor:function(){this.setStyle({backgroundColor:this.getDefaultBackgroundColor()});this.updateFontColor(this.getDefaultBackgroundColor());var conditions=this.getConditionalColor();if(conditions){for(var i=0;iconditions[i].Value){this.setStyle({backgroundColor:conditions[i].ColorCode});this.updateFontColor(conditions[i].ColorCode);break;}}}},updateFontColor:function(backgroundRGBColor){var fontColor=Forms.Common.Common.getContrastingFontColor(backgroundRGBColor);if(this.lblTitle){this.lblTitle.setStyle({color:fontColor});} if(this.lblQueryCount){this.lblQueryCount.setStyle({color:fontColor});} if(this.lblDescription){this.lblDescription.setStyle({color:fontColor});}},setRefreshTimeInterval:function(intervalInMinutes){var me=this;if(intervalInMinutes!="0"&&intervalInMinutes!=0){this.refreshTimer=window.setInterval(function(){me.refresh(me);},parseInt(me.getRefreshInterval()*1000));}},cleanupControl:function(){var me=this;me.stopTimer();},stopTimer:function(){window.clearInterval(this.refreshTimer);},refresh:function(me){me.updateControl();},onClickEventHandler:function(args){args.fireEvent('click');},listeners:{afterrender:function(){this.setTileSettings();var element=this.getEl().dom;var me=this;if(element.addEventListener) element.addEventListener('click',function(){me.fireEvent('click',me.getFormUserData());});},destroy:function(){var element=this.getEl().dom;var me=this;if(element.removeEventListener) element.removeEventListener('click',function(){me.fireEvent('click');});}},GetJobQueryCount:function(){var me=this;var jobService=Ext.create('Forms.Custom.ServiceCalls.JobService',{});var queryIdentity1=me.getQueryIdentityData(me);if(queryIdentity1.getId()||queryIdentity1.getName()){jobService.GetJobsCountWithQuery(me.GetJobsCountWithQueryServiceSucceeded,me.getSessionId(),queryIdentity1,null,me,null);}},GetJobsCountWithQueryServiceSucceeded:function(serviceResult,UserData){var me=UserData;var count=serviceResult.d;if(count!==undefined){me.setControlDetails(count);}},GetActivityQueryCount:function(){var me=this;var activityService=Ext.create('Forms.Custom.ServiceCalls.ActivityService',{});var queryIdentity1=me.getQueryIdentityData(me);if(queryIdentity1.getId()||queryIdentity1.getName()){activityService.GetActivitiesCountWithQuery(me.GetActivityCountWithQueryServiceSucceeded,me.getSessionId(),queryIdentity1,null,me,null);}},GetActivityCountWithQueryServiceSucceeded:function(serviceResult,UserData){var me=UserData;var count=serviceResult.d;if(count!==undefined){me.setControlDetails(count);}},setLabelFonts:function(){this.lblTitle.setStyle({fontSize:'calc('+this.getHeight()*0.10+'px)'});this.lblQueryCount.setStyle({fontSize:'calc('+this.getHeight()*0.42+'px)'});this.lblDescription.setStyle({fontSize:'calc('+this.getHeight()*0.09+'px)'});},setTileSettings:function(){this.setLabelFonts();this.lblTitle.setHtml(this.getTitleText());this.lblDescription.setHtml(this.getDescription());if(this.getImageUrl()&&this.getImageUrl().length>0){this.imageControl.setSrc(this.getImageUrl());this.imageControl.setWidth(this.getImageWidthPercentage()+'%');this.lblQueryCount.setWidth(100-this.getImageWidthPercentage()+'%');} else{this.imageControl.setStyle({display:'none'});} this.setRefreshTimeInterval(this.getRefreshInterval());Forms.Common.Common.CreateTooltip(this.lblTitle,this.getTitleText());Forms.Common.Common.CreateTooltip(this.lblDescription,this.getDescription());if(!this.isUpdateControlFired){if(this.getFormAction()&&(this.getFormAction().Id!==null&&this.getFormAction().Id!==undefined)){this.fireEvent('change');}else{this.GetQueryResultsCount();}}},GetQueryResultsCount:function(){if(this.getQueryIdentity().QueryType===0){this.GetJobQueryCount();} else{this.GetActivityQueryCount();}},updateControl:function(){var me=this;me.isUpdateControlFired=true;var queryIdentity=null;if(me.isDynamicFilterSet()){if(me.getDynamicQueryType()!=''&&me.getDynamicQueryType()!=undefined){me.getQueryIdentity().QueryType=me.getDynamicQueryType();} if(me.getQueryIdentity().QueryType==Forms.Constants.QUERY_TYPE.JOBLIST){queryIdentity=me.getQueryIdentityData(me);var jobService=Ext.create('Forms.Custom.ServiceCalls.JobService',{});jobService.GetJobsCountWithQueryAndMergedFilter(me.GetQueryJobsSucceeded,me.getSessionId(),queryIdentity,me.dynamicJobFilter,me,null);} else{queryIdentity=me.getQueryIdentityData(me);var activityService=Ext.create('Forms.Custom.ServiceCalls.ActivityService',{});activityService.GetActivitiesCountWithQueryAndMergedFilter(me.GetActivitiesSucceeded,me.getSessionId(),queryIdentity,me.dynamicActivitFilter,null,me);}} else if(me.getDynamicQueryID()!=''||me.getDynamicQueryName()!=''){var queryService=Ext.create('Forms.Custom.ServiceCalls.QueryService',{});queryIdentity=me.getQueryIdentityData(me);queryService.GetQueryWithNameOrId(me.GetQueryServiceSucceeded,null,me.getSessionId(),queryIdentity,me);} else{if(this.getFormAction()&&(this.getFormAction().Id!==null&&this.getFormAction().Id!==undefined)){me.fireEvent('change');}else{me.GetQueryResultsCount();}}},GetQueryServiceSucceeded:function(serviceResult,UserData){var me=UserData;var query=serviceResult.d;me.setQueryIdentity(query.Identity);me.GetQueryResultsCount();},GetActivitiesSucceeded:function(serviceResult,userData){var me=userData;var count=serviceResult.d;if(count!==undefined){me.setControlDetails(count);}},getQueryIdentityData:function(me){var queryIdentity=Ext.create('Forms.Custom.Classes.QueryIdentity',{});if(me.getDynamicQueryID()!=''||me.getDynamicQueryName()!=''){queryIdentity.setId(me.getDynamicQueryID());queryIdentity.setName(me.getDynamicQueryName());if(me.getDynamicQueryType()!=''&&me.getDynamicQueryType()!=undefined){queryIdentity.setQueryType(me.getDynamicQueryType());} else{queryIdentity.setQueryType(me.getQueryIdentity().QueryType);}} else{queryIdentity.setId(me.getQueryIdentity().Id);queryIdentity.setQueryType(me.getQueryIdentity().QueryType);} return queryIdentity;},GetQueryJobsSucceeded:function(serviceResult,userData){var me=userData;var count=serviceResult.d;if(count!==undefined){me.setControlDetails(count);}},setAddShadow:function(useShadow){if(useShadow){var marginParts=this.margin.split(' ');if(marginParts.length==4){var topMargin=+(marginParts[0]);var rightMargin=+(marginParts[1]);var bottomMargin=+(marginParts[2]);var leftMargin=+(marginParts[3]);if(rightMargin<4){rightMargin=4;} if(bottomMargin<4){bottomMargin=4;} this.setMargin(topMargin,rightMargin,bottomMargin,leftMargin);} this.setStyle({'box-shadow':'3px 3px 3px #cacacd','border-color':'#cacacd','border-style':'solid'})}},setCursorPointer:function(usePointer){if(usePointer) {this.lblTitle.setStyle({cursor:'pointer'});this.lblQueryCount.setStyle({cursor:'pointer'});this.imageControl.setStyle({cursor:'pointer'});this.lblDescription.setStyle({cursor:'pointer'});}},updateDynamicFilter:function(field,val){if(this.isJobListQuery()){Forms.Controls.Common.updateDynamicJobFilter(field,val,this.dynamicJobFilter);} else{Forms.Controls.Common.updateDynamicActivityFilter(field,val,this.dynamicActivitFilter);}},isDynamicFilterSet:function(){if(this.isJobListQuery()){return Forms.Controls.Common.isDynamicJobFilterSet(this.dynamicJobFilter);} else{return Forms.Controls.Common.isDynamicActivityFilterSet(this.dynamicActivitFilter);}},clearDynamicFilter:function(){this.dynamicJobFilter=Ext.create('Forms.Custom.Classes.JobFilterOverride',{});this.dynamicActivitFilter=Ext.create('Forms.Custom.Classes.JobActivityFilterOverride',{});},isJobListQuery:function(){if(this.getDynamicQueryType()!=''&&this.getDynamicQueryType()!=undefined){return parseInt(this.getDynamicQueryType())===Forms.Constants.QUERY_TYPE.JOBLIST;} return this.getQueryIdentity().QueryType==Forms.Constants.QUERY_TYPE.JOBLIST;}});Ext.define('Forms.Controls.Standard.ToolBar',{extend:'Ext.toolbar.Toolbar',overflowHandler:'scroller',padding:'0 0 1 5',cls:'kta-custom-toolbarcontrol',constructor:function(){this.callParent(arguments);},setEnable:function(shouldEnable){if(!shouldEnable) this.disable();else this.enable();},setBackgroundColor:function(color,controlCls){var me=this;this.on('afterrender',function(){var bgColorStyle='background-color:@color@ !important; '.replace('@color@',color);$('#'+me.getId()).attr('style',bgColorStyle+$('#'+me.getId()).attr('style'));});},});Ext.define('Forms.Controls.Standard.ToolBarButton',{extend:'Ext.Button',causeValidation:true,constructor:function(){this.callParent(arguments);if(!this.style){this.style={};}},initComponent:function(){this.callParent(arguments);},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setCauseValidation:function(val){this.causeValidation=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){this.tooltip=val;},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setControlData:function(buttonText){this.text=buttonText;this.setText(buttonText);this.fireEvent('ValueUpdated',this,buttonText);},setWidth:function(width){this.width=width;},getControlData:function(){return this.text;},onClickEventHandler:function(){},listeners:{click:function(btn,e,options){this.onClickEventHandler();}},});Ext.define('Forms.Controls.Standard.ToolBarMenuItem',{extend:'Ext.menu.Item',causeValidation:true,constructor:function(){this.callParent(arguments);if(!this.style){this.style={};}},initComponent:function(){this.callParent(arguments);},setId:function(id){this.id=id;},setMargin:function(i,j,k,l){this.margin=""+i+" "+j+" "+k+" "+l+"";},setCauseValidation:function(val){this.causeValidation=val;},setZIndex:function(val){this.style['z-index']=val;},setToolTip:function(val){this.tooltip=val;},setEnable:function(shouldEnable){this.setDisabled(!shouldEnable);},setControlData:function(buttonText){this.text=buttonText;this.setText(buttonText);this.fireEvent('ValueUpdated',this,buttonText);},setWidth:function(width){this.width=width;},getControlData:function(){return this.text;},onClickEventHandler:function(){},listeners:{click:function(btn,e,options){this.onClickEventHandler();}},});