
var destroy=(function(destroy){function $destroy(node){while(node.lastChild)
destroy(node.lastChild);if(node.parentNode)
node.parentNode.removeChild(node);};return destroy=destroy.clearAttributes?function(node){if(node.clearAttributes)
node.clearAttributes();$destroy(node);}:$destroy;})(document.createElement("script"));Integrify={version:"5.0",oauth:null,loadDate:new Date(),defaultPageSize:15,resources:{},service:{root:null,proxy:null,client_root:null,default_datatype:"script"},central:{root:null},getCurrentCulture:function(){return jQuery.cookie("iapi_culture");},setCurrentCulture:function(culture){var c=culture.split(",")[0];jQuery.cookie("iapi_culture",c);},source_culture:"en-US",debugging:true};Integrify.apply=function(C,D,B){if(B){Integrify.apply(C,B);}
if(C&&D&&typeof D=="object"){for(var A in D){C[A]=D[A]}}
return C};Integrify.applyIf=function(o,c,r){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}
else
if(typeof o[p]=="object"&&r){if(typeof r=="number"){r--;}
Integrify.applyIf(o[p],c[p],r);}}}
return o;};(function(){Integrify.apply(Integrify,{extend:function(){var io=function(o){for(var m in o){this[m]=o[m]}};var oc=Object.prototype.constructor;return function(sb,sp,overrides){if(typeof sp=="object"){overrides=sp;sp=sb;sb=overrides.constructor!=oc?overrides.constructor:function(){sp.apply(this,arguments)}}
var F=function(){},sbp,spp=sp.prototype;F.prototype=spp;sbp=sb.prototype=new F();sbp.constructor=sb;sb.superclass=spp;if(spp.constructor==oc){spp.constructor=sp}
sb.override=function(o){Integrify.override(sb,o)};sbp.override=io;Integrify.override(sb,overrides);sb.extend=function(o){Integrify.extend(sb,o)};return sb;}}(),override:function(origclass,overrides){if(overrides){var p=origclass.prototype;for(var method in overrides){p[method]=overrides[method]}}},addScript:function(ref){var script=document.createElement('script');script.src=ref;script.type="text/javascript";document.getElementsByTagName('head')[0].appendChild(script);},logout:function(){var svcAdapter=new Integrify.ServiceAdapter({getEndpnt:"/logout/{datatype}/"},this);svcAdapter.getData(function(rsp,err){if(!err){jQuery.cookie('iapi_token',null);window.location=Integrify.service.client_root+"?logout=true";}});},purge:function(d){var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof d[n]==='function'){d[n]=null;}}}
a=d.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){Integrify.purge(d.childNodes[i]);}}},clearAttributes:function(n){if(n.clearAttributes){n.clearAttributes();}},destroy:function(n){while(n.lastChild){Integrify.clearAttributes(n.lastChild);Integrify.destroy(n.lastChild);}
Integrify.clearAttributes(n);if(n.parentNode)
n.parentNode.removeChild(n);}});})();Integrify.parseMsDate=function(value){var formatStr="m/d/Y g:i A";var minimumDateStr="-62135596800000";if((null==value)||(value.toString().indexOf(minimumDateStr)!=-1)||(value.toString().indexOf("0001-01-01")!=-1))
return"";if(Integrify.CurrentUser!==null&&Integrify.CurrentUser.Properties&&Integrify.CurrentUser.Properties[1][1]){formatStr=Integrify.CurrentUser.Properties[1][1];}
if(value!=null&&value.toString().length>0&&value.indexOf("Date")!==-1){if((value.indexOf("-")!=-1)&&(value.lastIndexOf("-")!=value.indexOf("(-")+1)){return eval("new "+value.substr(1,value.length-8)+")").format(formatStr);}
else{return eval("new "+value.substr(1,value.length-2)).format(formatStr);}}
else
if(value!=null&&value.indexOf("Date")==-1&&(value.indexOf("/")!==-1||value.indexOf("-")!==-1)){var parsedDate=new Date(value.replace(/\-/gi,"/"));if(value.indexOf(":")!==-1){return parsedDate.format(formatStr);}
else{if(formatStr.toUpperCase().indexOf("H")!=-1){formatStr=formatStr.substr(0,formatStr.toUpperCase().indexOf("H"));}
return parsedDate.format(formatStr);}}
else{return"";}}
Integrify.parseDateObj=function(value){var minimumDateStr="-62135596800000";var dateObj=null;if((null==value)||(value.toString().indexOf(minimumDateStr)!=-1)||(value.toString().indexOf("0001-01-01")!=-1))
return"";if(value!=null&&value.toString().length>0&&value.indexOf("Date")!==-1){if((value.indexOf("-")!=-1)&&(value.lastIndexOf("-")!=value.indexOf("(-")+1)){dateObj=eval("new "+value.substr(1,value.length-8)+")");}
else{dateObj=eval("new "+value.substr(1,value.length-2));}}
else
if(value!=null&&value.indexOf("Date")==-1&&(value.indexOf("/")!==-1||value.indexOf("-")!==-1)){dateObj=new Date(value.replace(/\-/gi,"/"));}
else{dateObj="";}
return dateObj;}
Integrify.parseMsDate=function(value){var dateObj=Integrify.parseDateObj(value);return dateObj===""?"":Integrify.formatDate(dateObj,value);}
Integrify.formatDate=function(dateObj,value){var formatStr="m/d/Y g:i A";if(value===null||value===""){return"";}
else{if(Integrify.CurrentUser!==null&&Integrify.CurrentUser.Properties&&Integrify.CurrentUser.Properties[1][1]){formatStr=Integrify.CurrentUser.Properties[1][1];}
if(value.indexOf("Date(")!=-1){return dateObj.format(formatStr);}
else{if(value.indexOf(":")!==-1){return dateObj.format(formatStr);}
else{if(formatStr.toUpperCase().indexOf("H")!=-1){formatStr=formatStr.substr(0,formatStr.toUpperCase().indexOf("H"));}
return dateObj.format(formatStr);}}}}
Integrify.reformatMsDate=function(value,formatStr){if(value!=null&&value.toString().length>0&&value.indexOf("(-")==-1){if(value.indexOf("-")==-1){return eval("new "+value.substr(1,value.length-2)).format(formatStr);}
else{return eval("new "+value.substr(1,value.length-8)+")").format(formatStr);}}}
Integrify.clearMasks=function(){jQuery(".ext-el-mask").remove();jQuery(".ext-el-mask-msg").remove();}
Integrify.monthList=function(monthsBack){var mList=[];var today=new Date();var y=today.getFullYear();var m=today.getMonth();while(monthsBack>=0){if(m==0){m=11;y=y-1;}
else{m-=1;}
today.setFullYear(y);today.setMonth(m);mList.push([y+"-"+m,today.format("M Y")]);--monthsBack;}
return mList;}
Integrify.wraptext=function(value){if(value){return("<div style='white-space:normal;'>"+value.replace(new RegExp("\\n","g"),"<br>")+"</div>");}}
Integrify.renderPriority=function(value){var color;var priority;if(value){switch(value){case"1-Low":color="yellow";priority=_tl("Low");break;case"2-Medium":color="orange";priority=_tl("Medium");break;case"3-High":color="red";priority=_tl("High");break;}
return'<span style="background-color:'+color+';padding:2px">'+priority+'</span>';}
else
return"";}
Integrify.renderMilestone=function(v,p,rec){if(!v||v===""){return _tl("Started");}
else{return v;}}
Integrify.activateWidget=function(widget_id,callback){Integrify.scriptLoader.load([widget_id],callback);}
Integrify.CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";Integrify.randStr=function genRandomStr(length){var chars=Integrify.CHARS;var result="";for(var i=0;i<length;++i){var rnum=Math.floor(Math.random()*chars.length);result+=chars.substring(rnum,rnum+1);}
return result;}
Integrify.getQueryStringParams=function(querystring){var qKeys={};var re=/[?&]([^=]+)(?:=([^&]*))?/g;var matchInfo;while(matchInfo=re.exec(querystring)){qKeys[matchInfo[1]]=matchInfo[2];}
return qKeys;}
Integrify.ServiceAdapter=function(config,scope){this.scope=scope;if(config){Integrify.apply(this,config);}}
Integrify.ServiceAdapter.prototype={getEndpnt:null,postEndpnt:null,epParams:null,requireSig:true,formId:null,twoPartPost:false,baseEndpt:null,errorCallback:function(data,status,error){var errorobj=null;var endpoint="";Integrify.clearMasks();try{jQuery.each(arguments,function(index,arg){if(arg&&arg.errorMessage){errorobj=arg;}
else
if(typeof(arg)=="string"&&arg.indexOf("http://")!=-1){endpoint=arg;}});if(errorobj){var c=confirm(errorobj.errorMessage+"\n\n"+endpoint+"\n"+"Show Detail?");if(c){alert(errorobj.errorStack);}}}
catch(e){alert(e.message+"\n\n\Your request could not be processed. GET Endpoint: "+this.getEndpnt+", POST Endpoint: "+this.getEndpnt);}},transactionKey:null,processData:function(options){if(!this.baseEndpt)
{this.baseEndpt=Integrify.service.root;}
var signed_url=options.endpoint;if(!options.method){options.method="GET";}
if(!options.errorCallback){options.errorCallback=this.errorCallback;}
if(!options.dataType){options.dataType=Integrify.service.default_datatype;}
if(!options.scope){options.scope=this.scope;}
if(typeof(options.oauth_required)=="undefined"){options.oauth_required=Integrify.service.oauth_required;}
if(typeof(options.oauth_required)=="undefined"){options.oauth_required=true;}
if(!this.requireSig)
{options.oauth_required=false;}
var tmpCallback="json_"+OAuth.nonce(5);if(!signed_url){signed_url=options.method=="GET"?this.getEndpnt:this.postEndpnt;};if(signed_url.substr(0,1)=="/"){signed_url=this.baseEndpt+signed_url;}
if(!options.urlDataType){options.urlDataType=!options.dataType?"script":options.dataType;if(options.urlDataType=="jsonp"){options.urlDataType="json";}
else
if(options.urlDataType=="xml"){options.dataType="xml";}}
signed_url=signed_url.replace('{datatype}',options.urlDataType);if(options.dataType=="script"){if(signed_url.indexOf("iapi_var")==-1){signed_url=signed_url+(signed_url.indexOf("?")==-1?"?":"&")+"callback={callback}";}}
if(!(this.twoPartPost==true&&options.method=='POST')){signed_url=signed_url.replace('{callback}',tmpCallback);}
if(options.formatParams){for(var key in options.formatParams){signed_url=signed_url.replace('{'+key+'}',encodeURIComponent(options.formatParams[key]));}}
var ref=this;if(options.oauth_required==true){if(Integrify.oauth.settings.reqInProgress==false){Integrify.oauth.settings.callbackFunc=function(){ref.processData(options);};signed_url=Integrify.oauth.signRequest(signed_url,options.method);if(!Integrify.oauth.settings.signThroughProxy&&Integrify.service.proxy&&signed_url!=null){signed_url=Integrify.service.proxy+encodeURIComponent(signed_url);}}
else{signed_url=null;setTimeout(function(){ref.processData(options)},1000);}}
else
if(Integrify.service.proxy){signed_url=Integrify.service.proxy+encodeURIComponent(signed_url);}
if(signed_url!=null){if(this.twoPartPost==true&&options.method=="POST"){this.postToCachedResponse(signed_url,options.callback);}
else{var ajaxCallback;var ref=this;if(options.dataType=="script"){window[tmpCallback]=function(tmp){if(tmp&&tmp.errorMessage){try{options.successCallback.call(options.scope,undefined,tmp,signed_url);}
catch(e){options.errorCallback.call(options.scope,tmp,signed_url);}}
else{options.successCallback.call(options.scope,tmp);}
window[tmpCallback]=undefined;try{delete window[tmpCallback];}
catch(e){}};}
else
ajaxCallback=function(data){options.successCallback.call(options.scope,data);};jQuery.ajax({type:options.method,url:signed_url,dataType:options.dataType==="text/xml"?"text":options.dataType,cache:false,timeout:Integrify.ajaxTimeout||60000,data:(options.postData?JSON.stringify(options.postData):undefined),contentType:(options.method==="GET"?undefined:(options.contentType||"application/json")),processData:(!options.postData?true:false),success:ajaxCallback,error:function(data,status,error){if(status==="timeout"){options.errorCallback.call(options.scope,{errorMessage:"Request has timed-out",errorStack:signed_url},status,error,signed_url);}
else{try{options.successCallback.call(options.scope,undefined,data,signed_url);}
catch(e){options.errorCallback.call(options.scope,data,status,error,signed_url);}}}});}}},getData:function(callback,formatParams){var processOptions={successCallback:callback,formatParams:formatParams,method:'GET'};var addArgs=arguments.length>2?arguments[2]:{};if(addArgs){jQuery.each(addArgs,function(key,val){processOptions[key]=val;});}
this.processData(processOptions);},postData:function(callback,formatParams,data){var postOptions={successCallback:callback,formatParams:formatParams,method:'POST',postData:data};var addArgs=arguments.length>3?arguments[3]:{};if(addArgs){jQuery.each(addArgs,function(key,val){postOptions[key]=val;});}
this.processData(postOptions);},getCachedResponse:function(jqueryframe,callback){io=jqueryframe[0];doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;var url=Integrify.getKeyFromURL(doc.location.search,'iapi_rdir');this.dataUrl=unescape(unescape(url));this.processData(callback,{},undefined,"GET")
jqueryframe.unbind();setTimeout(function(){jqueryframe.remove();},100);},postToCachedResponse:function(url,callback){thisform=jQuery('#'+this.formId);var id='jqFormIO'+(new Date().getTime());this.transactionKey=id;var jquery_io=jQuery('<iframe id="'+id+'" name="'+id+'" />');var io=jquery_io[0];jquery_io.css({position:'absolute',top:'-1000px',left:'-1000px'})
if(jQuery.browser.msie||jQuery.browser.opera)
io.src='javascript:false;document.write("");';var t=thisform.attr('target'),a=thisform.attr('action');thisform.attr({target:id,encoding:'multipart/form-data',enctype:'multipart/form-data',method:'POST',action:url});jquery_io.appendTo('body');var ref=this;io.attachEvent?io.attachEvent('onload',function(){ref.getCachedResponse(jquery_io,callback);}):io.addEventListener('load',function(){ref.getCachedResponse(jquery_io,callback);},false);thisform.submit();}}
Integrify.DataMgr=function(c){this.svcAdapter=new Integrify.ServiceAdapter(c,this);this.svcAdapter.baseEndpt=Integrify.service.root;}
Integrify.DataMgr.prototype={svcAdapter:undefined}
Integrify.CentralMgr=function(c){this.svcAdapter=new Integrify.ServiceAdapter(c,this);this.svcAdapter.baseEndpt=Integrify.central.root;this.svcAdapter.requireSig=false;}
Integrify.CentralMgr.prototype={svcAdapter:undefined}
Integrify.PrefMgr=function(){this.preferences=[];Integrify.PrefMgr.superclass.constructor.call(this);}
Integrify.extend(Integrify.PrefMgr,Integrify.DataMgr,{loading:false,preferences:this.preferences=[],loadedCallback:undefined,loadPrefs:function(parent_key,callback){this.loadedCallback=callback;this.loading=true;if(!parent_key){parent_key='';}
var formatParams={parent_key:parent_key};this.svcAdapter.getData(function(data){while(data.length>0){var p=data.shift();this.preferences.push({key:p.Key,value:p.Value});}
this.loading=false;if(this.loadedCallback){this.loadedCallback.call();}},formatParams);},getPref:function(key,partial){var matches=[];jQuery.each(this.preferences,function(index,pref){if(pref.key.toLowerCase()==key.toLowerCase()||(partial&&pref.key.toLowerCase().indexOf(key.toLowerCase())!=-1)){matches.push(pref);}});return matches;},getPrefMatch:function(val,partial){var matches=[];jQuery.each(this.preferences,function(index,pref){if(pref.value==val||(partial&&pref.value.indexOf(val)!=-1)){matches.push(pref);}});return matches;},setMultiPrefs:function(prefs,parent_key,usePost){var formatParams={parent_key:(parent_key||"")};if(!usePost){var prefsJoined="";jQuery.each(prefs,function(){if(prefsJoined!=""){prefsJoined+="|";}
prefsJoined+=this.key+":"+this.value;});formatParams["preferences"]=prefsJoined;this.svcAdapter.getData(function(data){return data;},formatParams,{endpoint:this.svcAdapter.setMultiPrefEndpnt});}
else{var reformattedPrefs=[];while(prefs.length>0){var p=prefs.shift();reformattedPrefs.push({Key:p.key,Value:p.value});}
this.svcAdapter.postData(function(data){return data;},formatParams,reformattedPrefs,{endpoint:this.svcAdapter.postMultiPrefEndpnt});}}});Integrify.GlobalizationMgr=function(){this.sourceCache=[],this.localizedCache={};Integrify.GlobalizationMgr.superclass.constructor.call(this);}
Integrify.extend(Integrify.GlobalizationMgr,Integrify.DataMgr,{loading:false,sourceCache:this.sourceCache=[],localizedCache:this.localizedCache={},currentCulture:function(){Integrify.getCurrentCulture();},buildCacheFile:false,sourceCache:this.sourceCache={culture:null,items:[]},localizeText:function(defaultlabel){if(this.localizedCache[defaultlabel]==undefined){if(this.localizedCache.sysadmin=="True"&&this.sourceCache.indexOf(defaultlabel)==-1){this.sourceCache.push(defaultlabel);}
return defaultlabel;}
else{return this.localizedCache[defaultlabel];}},loadUserLabels:function(callback){this.loadedCallback=callback;this.loading=true;this.svcAdapter.getData(function(data){this.localizedCache=new Object();while(data.length>0){var p=data.shift();this.localizedCache[p.Key]=p.Value;}
this.loading=false;if(this.loadedCallback){this.loadedCallback.call();}},'');},saveSourceLabels:function(callback){this.loadedCallback=callback;this.loading=true;this.svcAdapter.postData(function(data){this.loading=false;if(this.loadedCallback){this.loadedCallback.call();}},{},this.sourceCache);}});Integrify.HelpMgr=function(){this.helpMap=[];Integrify.HelpMgr.superclass.constructor.call(this);}
Integrify.extend(Integrify.HelpMgr,Integrify.CentralMgr,{loading:false,helpMap:this.helpMap=[],displayHelp:function(helpId){if(Integrify.central.root){addWidgetToPortal({id:'centralhelp',target:'win',data:{FeatureID:helpId}});}
else
{alert("This system is not configured to access Integrify Central.")}},addHelpTool:function(container,helpId){var win=container.findParentByType("window");var container;if(win==null){container=container;}
else{container=this.ownerCt;}
mgr=this;container.addTool({id:"centralhelp",iconCls:"icon-help",qtip:_tl("Help"),align:"left",handler:function(){mgr.displayHelp(helpId);}});},getInlineHelpLink:function(helpId,icoParentCls){icoParentCls=icoParentCls||"grid-icon";var icoCls="icon-help";var ico="<a href=\"javascript:void(null)\" onclick=\"Integrify.helpMgr.displayHelp('"+helpId+"');\">"
ico+="<img src=\""+Ext.BLANK_IMAGE_URL+"\" class=\""+icoParentCls+" "+icoCls+"\" style=\"cursor:pointer\"";ico+="\"/></a>";return ico;}});Integrify.widget={};Integrify.widget.Widget=function(){}
Integrify.widget.Widget.prototype={component:undefined,init:function(o){},load:function(){}}
Integrify.glblMgr=new Integrify.GlobalizationMgr();Integrify.glblMgr.svcAdapter.postEndpnt='/localization/save-default-list/{datatype}/';Integrify.glblMgr.svcAdapter.getEndpnt='/localization/user-label-list/{datatype}/';Integrify.glblMgr.svcAdapter.cultureEndpnt='/localization/culture-codes/{datatype}/?oauth_consumer_key={consumer_key}';var _tl=function(text,tag){return Integrify.glblMgr.localizeText(text,tag);};Integrify.CurrentUser={}
Integrify.ContactMgr=function(){Integrify.ContactMgr.superclass.constructor.call(this);}
Integrify.extend(Integrify.ContactMgr,Integrify.DataMgr,{loadedCallback:undefined,loadCurrentContact:function(callback){this.loadedCallback=callback;var formatParams={};this.svcAdapter.getEndpnt="/contacts/current/{datatype}/";this.svcAdapter.getData(function(data){Integrify.CurrentUser=data;if(this.loadedCallback){this.loadedCallback.call(this);}},formatParams);}});Integrify.downloadFile=function(owner_sid,owner_type,object_sid,object_type){var downloadLink=Integrify.oauth.signRequest("/files/stream/?owner_sid="+owner_sid+"&owner_type="+owner_type+"&object_sid="+object_sid+"&object_type="+object_type,"SIG_GET");var downloadWin=window.open(downloadLink,"downloadWin");}
Integrify.downloadFile2=function(owner_sid,owner_type,object_sid,object_type,file_id,file_type){var downloadLink=Integrify.oauth.signRequest("/files/stream/?owner_sid="+owner_sid+"&owner_type="+owner_type+"&object_sid="+object_sid+"&object_type="+object_type+"&file_id="+file_id,"SIG_GET");var downloadWin=window.open(downloadLink,"downloadWin");}
Integrify.exportrequestPDF=function(request_sid){var downloadLink=Integrify.oauth.signRequest("/request/pdfexport/?instance="+request_sid,"SIG_GET");var downloadWin=window.open(downloadLink,"downloadWin");}
Integrify.exportFormPDF=function(task_sid){var downloadLink=Integrify.oauth.signRequest("/request/formpdfexport/"+task_sid,"SIG_GET");var downloadWin=window.open(downloadLink,"downloadWin");}
Integrify.genIcon=function(icoCls,tip,icoParentCls){icoParentCls=icoParentCls||"grid-icon";var ico="<img src=\""+Ext.BLANK_IMAGE_URL+"\" class=\""+icoParentCls+" "+icoCls+"\" style=\"cursor:pointer\"";if(tip){ico+=" ext:qtip=\""+tip+"\"";}
ico+=" />";return ico;}
Integrify.contactLinkRenderer=function(v,m,rec){if(rec.data.ContactType&&rec.data.ContactType===1){return"<span style='cursor:pointer' ext:qtip=\""+_tl("Click to view the user's profile")+"\">"+rec.data.Name+"</span>";}
else{return v;}}
Integrify.contactTypeRenderer=function(v,m,rec){if(v===1){return Integrify.genIcon("icon-user",_tl("User"));}
else
if(v==2){return Integrify.genIcon("icon-group",_tl("Group"));}
else
if(v===4){return Integrify.genIcon("icon-rolemember",_tl("Role"));}
else
return Integrify.genIcon("icon-dynamic",_tl("Dynamic"));}
Integrify.removeFilters=function(filtersToRemove){this.dataParams.filters=this.dataParams.filters||[];if(typeof(this.dataParams.filters)=="string"){this.dataParams.filters=eval(this.dataParams.filters);}
var newFilters=[];while(this.dataParams.filters.length>0){var filter=this.dataParams.filters.shift();if(filtersToRemove.indexOf(filter.field)==-1){newFilters.push(filter);}}
this.dataParams.filters=newFilters;}
Integrify.renameFilter=function(filterName,newFilterName){this.dataParams.filters=this.dataParams.filters||[];if(typeof(this.dataParams.filters)=="string"){this.dataParams.filters=eval(this.dataParams.filters);}
for(var f=0;f<this.dataParams.filters.length;++f){if(this.dataParams.filters[f].field===filterName){this.dataParams.filters[f].field=newFilterName;}}}
Integrify.updateDataFilter=function(filterCfg){this.dataParams.filters=this.dataParams.filters||[];if(typeof(this.dataParams.filters)==="string"){this.dataParams.filters=eval(this.dataParams.filters);}
var removeFilter=false;var filterVal=filterCfg.data.value;var filterComparison=filterCfg.data.comparison;var filterType=filterCfg.data.type;if(filterVal&&typeof(filterVal)==="object"&&filterVal.getDate){filterCfg.data.value=filterVal.format("Y-m-d");}
else
if(!filterVal&&filterComparison==="date"){removeFilter=true;}
filterCfg.data.type=filterType||"string";if(filterComparison.indexOf("null")==-1&&!filterCfg.inquery&&(filterVal===""||filterVal===null)){removeFilter=true;}
var existFilterIndex=-1;for(var i=0;i<this.dataParams.filters.length;++i){var eFilter=this.dataParams.filters[i];if(eFilter.field==filterCfg.field&&eFilter.data.comparison==filterComparison){existFilterIndex=i;break;}}
if(existFilterIndex!=-1){if(removeFilter){this.dataParams.filters.splice(existFilterIndex,1);}
else{Integrify.applyIf(filterCfg.data,this.dataParams.filters[existFilterIndex].data);Integrify.apply(this.dataParams.filters[existFilterIndex],filterCfg);}}
else
if(!removeFilter){this.dataParams.filters.push(filterCfg);}
this.dataParams.filters=JSON.stringify(this.dataParams.filters);};Integrify.getMatchingFilter=function(field,comparison){var existingFilters=this.dataParams.filters||[];var matchingFilter=null;if(typeof(this.dataParams.filters)=="string"){existingFilters=eval(this.dataParams.filters);}
for(var i=0;i<existingFilters.length;++i){var eFilter=existingFilters[i];if(eFilter.field==field&&eFilter.data.comparison==comparison){matchingFilter=eFilter;break;}}
return matchingFilter;};Integrify.enums={};Integrify.EnumMgr=function(){Integrify.EnumMgr.superclass.constructor.call(this);}
Integrify.extend(Integrify.EnumMgr,Integrify.DataMgr,{get:function(id){if(Integrify.enums[id]){var enumObj=Integrify.enums[id];if(enumObj.items){return enumObj.items;}}},loadEnum:function(id,callback,callobj,epParams,additionalItems){var enumObj=Integrify.enums[id];var ref=this;enumObj.queue=enumObj.queue||[];enumObj.queue.push({callback:callback,callobj:callobj,additionalItems:additionalItems});if(!enumObj.loading){enumObj.loading=true;this.svcAdapter.getData(function(data){enumObj.items=data;enumObj.loading=false;while(enumObj.queue.length>0){var qObj=enumObj.queue.shift();if(qObj.additionalItems){data=data.concat(additionalItems);}
qObj.callback.call(qObj.callobj,data);}},epParams,{endpoint:enumObj.endpoint});}},fillDynamicEnum:function(cmp,epParams,fillEndpoint,callback){this.svcAdapter.getData(function(data){cmp.data=data.Data||data;cmp.filled=true;callback.call(cmp,cmp.data);},epParams,{endpoint:fillEndpoint});},filterItems:function(enumid,val,index,retSingle){var items=this.get(enumid);var matches=jQuery.grep(items,function(item){return item[index]==val;});if(matches.length>0){return!retSingle?matches:matches[0];}
else
return null;},filterItemsByMask:function(enumid,val,index,retSingle){var items=this.get(enumid);var matches=jQuery.grep(items,function(item){return(item[index]&val)==val;});if(matches.length>0){return!retSingle?matches:matches[0];}
else
return null;},getItemIndex:function(enumid,val,index){var items=this.get(enumid);if(typeof(items[0])=="string"){return items.indexOf(val);}
else{var matchIndex=-1;jQuery.each(items,function(i,obj){if(obj==val||obj[index]==val){matchIndex=i;}});return matchIndex;}}});Integrify.tranformArrayToJsonList=function(arrayList){var properties=arrayList[0];var proplength=properties.length;var jsonList=[];for(var i=1;i<arrayList.length;++i){var jsonObj={};for(var j=0;j<proplength;++j){jsonObj[properties[j]]=arrayList[i][j];}
jsonList.push(jsonObj);}
return jsonList;}
Integrify.tranformJsonListToArray=function(jsonList,propertyArray){var arrayList=[];if(!propertyArray){propertyArray=[];for(var k in jsonList[0]){propertyArray.push(k);}}
arrayList.push(propertyArray);for(var i=0;i<jsonList.length;++i){var row=[];for(var j=0;j<propertyArray.length;++j){row.push(jsonList[i][propertyArray[j]]);}
arrayList.push(row);}
return row;}
Integrify.transformObjToKeyValArray=function(jObj){var keyValArray=[];jQuery.each(jObj,function(n,v){keyValArray.push([n,v]);});return keyValArray;}
Integrify.transformKeyValArrayToObj=function(keyValArray){var objData={};if(Ext.isArray(keyValArray)){for(var i=0;i<keyValArray.length;++i){objData[keyValArray[i][0]]=keyValArray[i][1]}}
return objData;}
Integrify.formatStringWithJson=function(str,jObj){if(str.indexOf("{")!=-1){for(var k in jObj){str=str.replace(new RegExp("{"+k+"}","gi"),jObj[k]);}}
return str;}
Integrify.focusEl=function(el){el.focus();}
Integrify.enums.Manager=new Integrify.EnumMgr();Integrify.enums["DataType"]={items:[[1,"string"],[2,"numeric"],[2,"int"],[4,"datetime"],[8,"list"],[16,"count"],[32,"sum"]]};Integrify.enums["TimeInterval"]={items:[[1,"minutes"],[60,"hours"],[1440,"days"]]};Integrify.enums["YesNo"]={items:[[1,"Yes"],[0,"No"]]};Integrify.enums["BitOp"]={items:["AND","OR"]};Integrify.enums["Required"]=Integrify.enums["YesNo"];Integrify.enums["PublishStatus"]={items:[[0,"Development"],[1,"Testing"],[2,"Production"],[3,"Inactive"]]};Integrify.enums["WidgetType"]={items:[[1,"Grid"],[2,"Chart"],[3,"Metric"],[4,"Other"]]};Integrify.enums["StyleTemplate"]={endpoint:"/styletemplates/{datatype}/"};Integrify.enums["ContactProps"]={endpoint:"/process/ruleprops/Contact/{datatype}/"};Integrify.enums["InstanceProps"]={endpoint:"/process/ruleprops/Request/{datatype}/"};Integrify.enums["TaskStatus"]={items:["Initialized","Started","Completed","Cancelled","Excluded","Evaluated","Failed","Timed_Out"]};Integrify.enums["ObjectType"]={items:["Unknown","Process","Category","Form","Group","System","Contact","Role","Report","Widget","BizTime","Holiday","Instance","Tab"]}
Integrify.enums["InstanceSources"]={items:[["Task_State","Status",1],["Task_Input","Data",1],["Requester","Requester",0],["Client","Client",0],["Task_Completer","Task Completer",1],["Task_Recipient","Task Recipient",1],["Requester_Manager","Requester's Manager",0],["Client_Manager","Client's Manager",0],["Task_Completer_Manager","Task Completer's Manager",1],["Task_Recipient_Manager","Task Recipient's Manager",1],["Request","Request",0],["Fixed_Value","Fixed Value",0]]};Integrify.enums["Operators"]={items:[["Is","Is",15],["Is_Not","Is Not",15],["Contains","Contains",9],["Not_Contains","Does Not Contain",9],["Begins_With","Starts With",9],["Greater_Than","Is Greater Than",7],["Greater_Than_Eq_To","Is Greater Than or Equal To",7],["Ends_With","Ends With",9],["Less_Than","Is Less Than",7],["Less_Than_Eq_To","Is Less Than Or Equal To",7],["Is_Empty","Is Empty",15],["Is_Not_Empty","Is Not Empty",15],["Range","Is In Date Range",4],["Majority","Is Majority",7]]};Integrify.enums["TimeZones"]={endpoint:"/utilities/timezone/{datatype}/"};Integrify.enums["Languages"]={endpoint:"/utilities/languages/{datatype}/"};Integrify.enums["Locales"]={endpoint:"/utilities/locales/{datatype}/"};Integrify.enums["Groups"]={endpoint:"/groups/list/simple/{datatype}/"};Integrify.enums["QuestionType"]={items:["Calendar","ContactSearch","MultiContactSearch","EmailAddress","FileAttachment","Hyperlink","LineItem","LineItemSum","LongText","MultiChoiceCheckbox","MultiChoiceRadioButton","MultiChoiceSelectList","MultiFileAttachment","Number","Password","SearchBox","ShortText","TimeZone","YesNo"]};Integrify.enums["QuestionTypeField"]={items:["idatefield","multicontactsearch","multicontactsearch","textfield","ifilefield","label","iroweditor","iroweditor","textarea","checkboxgroup","radiogroup","combo","ifilefield","numberfield","textfield","iformsearchbox","textfield","combo","combo"]};Integrify.enums["PermissionType"]={items:[[0,"None"],[1,"ViewConfig"],[2,"Edit"],[4,"Create"],[8,"Delete"],[16,"Run"],[32,"Participate"],[64,"Grant"],[128,"Manage"],[256,"Monitor"]]};Integrify.enums["TaskProps"]={items:[["Name","Name"],["TaskType","Type"],["TaskState","Status"],["RecipientName","Recipient Name"],["CreatedDate","Date Assigned"],["StartDate","Date Started"],["EndDate","Date Completed"],["RecipientCnt","Assigned Count"],["RecipientReq","Required Count"],["RecipientComplete","Complete Count"],["HoursAssignToStart","Time to Start (Hours)"],["HoursStartToComplete","Time from Start to Complete (Hours)"],["HoursAssignToComplete","Total Time from Assigned to Completion (Hours)"],["MinutesAssignToStart","Time to Start (Minutes)"],["MinutesStartToComplete","Time from Start to Complete (Minutes)"],["MinutesAssignToComplete","Total Time from Assigned to Completion (Minutes)"],["DaysAssignToStart","Time to Start (Days)"],["DaysStartToComplete","Time from Start to Complete (Days)"],["DaysAssignToComplete","Total Time from Assigned to Completion (Days)"]]};Integrify.enums["AnyData"]={items:[["Label","Label={Label}"],["ID","ID={ID}"],["Prop","Property={Property}"]]};Integrify.enums["DateRange"]={items:[["1","Today"],["3","Last 3 Days"],["7","Last Week"],["30","Last 30 Days"],["90","Last 90 Days"]]};function GetReqInfo(fieldName){var frameFormID=unescape(document.location).split('c=')[1];var parentDictRef=parent.Integrify.PageFieldsDict[frameFormID];var formCmp=parent.Ext.getCmp(parentDictRef.GetReqInfoCmpID);if(!formCmp.reqInfo){var client_sid="";var request_name="";var request_sid="";var process_sid="";if(formCmp.task){process_sid=formCmp.task.BaseTask.ProcessSID;if(formCmp.task.InstanceSID){request_sid=formCmp.task.InstanceSID;}}
if(formCmp.client_sid!==undefined){client_sid=formCmp.client_sid;}
if(formCmp.request_name!==undefined){request_name=formCmp.request_name;}
var rsp=eval(jQuery.ajax({url:Integrify.oauth.signRequest("/requests/info/json/?process_sid="+process_sid+"&request_sid="+request_sid+"&client_sid="+client_sid),async:false,cache:false}).responseText);formCmp.reqInfo=Integrify.transformKeyValArrayToObj(rsp);}
var retval=formCmp.reqInfo[fieldName];if(!retval){retval="";}
return retval;};Integrify.getFormButton=function(buttonName,formObj){var frameFormID=unescape(document.location).split('c=')[1];formObj=formObj||parent.Ext.getCmp(parent.Integrify.PageFieldsDict[frameFormID].GetReqInfoCmpID);var buttonToReturn=null;if(formObj){if(isNaN(buttonName)){for(var i=0;i<formObj.buttons.length;++i){if(formObj.buttons[i].getText().toLowerCase()==buttonName.toLowerCase()){buttonToReturn=formObj.buttons[i];break;}}}
else{buttonToReturn=formObj.buttons[buttonName];}}
return buttonToReturn;}
