//--------------------------------------------------------------------
//	Filter Screen Elements Template File
//--------------------------------------------------------------------

//---------------------------------------------------------------------
// Definition of Filter Submit Component
//---------------------------------------------------------------------
Begin Component function.Apply
	Begin Counter OnlyMainFrame
		when(ExistsAndEqual($UserData.UM, "1"))
		{
			value = 1
		}
		else
		{
			value = 0
		}
	End
	Begin Counter IsApprovals
			when(eq($Info.IsSupported.Approval,1) && eq(%User.ApplicationFeatures.Approvals.IsChecked, 1))
			{
				value = 1
			}
			else
			{
				value=0
			}
	End
	

	Begin Counter IsJobArchiving
		when(eq($Info.IsSupported.JobArchiving,1) && eq(%User.ApplicationFeatures.JobArchiving.IsChecked, 1))
		{
			value = 1
		}
		else
		{
			value=0
		}
	End		

	Begin Counter IsExpand
		when(eq($Info.IsSupported.ExpandReportList,1) && eq(%User.ApplicationFeatures.FilterExpandFeature.ischecked, 1))
		{
			value = 1
		}
		else
		{
			value=0
		}
	End		

	Begin Counter IsApprovalsInReportList
				when( (ExistsAndEqual($Info.IsSupported.ApprovalsInReportList,1)) && (eq(Counter.IsApprovals(),1)) )
				{
					value = 1
				}
				else
				{
					value = 0
				}
	End

	
	Begin Event.OnClick
		Begin OpenWindow
			TargetWindow = WindowByName					{ const }

			when(eq(Counter.OnlyMainFrame(), 1))
			{
				TargetWindowName = WA_MAIN_FRAME		{ const }
			}
			else // build the entire frameset
			{
				TargetWindowName = WA_MAIN				{ const }
			}

			Begin Request
				RequestType = ReportListWindow			{ const }
				FID = (*)Action("GetFID()")				{ const }
				Lang = $Params.Lang						{ const }

				when(exists($UserData.RLF))
				{
					ReportListFields = $UserData.RLF	{ const }
				}

				when(exists($UserData.Sort))
				{
					Sort = (*) Action("getSort()") { const }
				}

				when(eq(Counter.OnlyMainFrame(), 1))
				{
					SID = WhenExists($STD.csid, $params.sid)					{ const }
					ElemTemplate	= "folderandreportlistflat.txt"		{ const }
					StrTemplate		= "folderandreportlistflat.htm"		{ const }
					NoBrowserCache	= %User.Applicationfeatures.ReportListInBrowserCacheFeature.value { const }
					Mode = FLAT							{ const }
				}
				else // build the entire frameset
				{
					ElemTemplate = "folderscreenparts.txt"	{ const }
					StrTemplate = "wascreenparts.htm"	{ const }
					Mode = NONE							{ const }
				}

				Filter = (*) Action("getResult()")		{ const }
								
				when(exists($std.gtc))
				{
					gettotalcount = $std.gtc 
				}
				if(noteq(Counter.OnlyMainFrame(), 1))
				{
					Begin VariableAttribute u
						SID = WhenExists($STD.csid, $params.sid)				{ const }
						WSF = $Info.IsSupported.WithSubfolders { const }
					End
				}
			End
		End
	End
End

//--------------------------------------------------------------------
// Definition of General Report Parameters EditBoxes and comboboxes
//--------------------------------------------------------------------

if(eq(Counter.IsJobArchiving(),1))
{
	if(eq(%User.Applicationfeatures.FilterJobIdFeature.ischecked , 1) )
	{
		Begin Component	Filter.JobId
			Begin StrVariable Value
				when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterJobIdFeatureReadOnly.value , 0))
				{
					Value = Replace(Replace( $FilterInfo.JobId , "\", "\\"), "'", "\'")
				}
				else
				{
					Value = Replace(Replace( %User.Applicationfeatures.FilterJobIdFeatureDefaultValue.value, "\", "\\"), "'", "\'")
				}
			End
	
			Begin StrVariable ClassName
				when(eq(%User.Applicationfeatures.FilterJobIdFeatureReadOnly.value , 1) )
				{
					Value = "readonly class=readonly"
				}
				else
				{
					Value = String()
				}
			End
	
	
			Begin Label
				Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterJobIdFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=JobIDEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=JobIdEdit>', 'JobIDEdit', (" + %User.Applicationfeatures.FilterApprovalNameFeatureMandatory.value + "==1))"
				EscapeType = None
			End
		End
	
		// set default value for reset
		Begin Component Filter.JobIdDefault
			Begin Label
				Label = String()
				EscapeType = None
			End
		End
	}
	else //hidden
	{
		Begin Component Filter.JobId
			Begin Label
				Label = "getFieldHTML('', '', '<input type=hidden name=JobIdEdit>', 'JobIdEdit', 0, 1)"
				EscapeType = None
			End
		End
	}

	if(eq(%User.Applicationfeatures.FilterCCFeature.ischecked , 1) )
	{
		Begin Component	Filter.CC
			Begin StrVariable Value
				when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterCCFeatureReadOnly.value , 0))
				{
					Value = Replace(Replace( $FilterInfo.CC , "\", "\\"), "'", "\'")
				}
				else
				{
					Value = Replace(Replace( %User.Applicationfeatures.FilterCCFeatureDefaultValue.value, "\", "\\"), "'", "\'")
				}
			End
	
			Begin StrVariable ClassName
				when(eq(%User.Applicationfeatures.FilterCCFeatureReadOnly.value , 1) )
				{
					Value = "readonly class=readonly"
				}
				else
				{
					Value = String()
				}
			End
	
	
			Begin Label
				Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterCCFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=CCEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=CCEdit>', 'CCEdit', (" + %User.Applicationfeatures.FilterApprovalNameFeatureMandatory.value + "==1))"
				EscapeType = None
			End
		End
	
		// set default value for reset
		Begin Component Filter.CCDefault
			Begin Label
				Label = String()
				EscapeType = None
			End
		End
	}
	else //hidden
	{
		Begin Component Filter.CC
			Begin Label
				Label = "getFieldHTML('', '', '<input type=hidden name=CCEdit>', 'CCEdit', 0, 1)"
				EscapeType = None
			End
		End
	}
	if(eq(%User.Applicationfeatures.FilterSystemIdFeature.ischecked , 1) )
	{
		Begin Component	Filter.SystemId
			Begin StrVariable Value
				when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterSystemIdFeatureReadOnly.value , 0))
				{
					Value = Replace(Replace( $FilterInfo.SystemId , "\", "\\"), "'", "\'")
				}
				else
				{
					Value = Replace(Replace( %User.Applicationfeatures.FilterSystemIdFeatureDefaultValue.value, "\", "\\"), "'", "\'")
				}
			End
	
			Begin StrVariable ClassName
				when(eq(%User.Applicationfeatures.FilterSystemIdFeatureReadOnly.value , 1) )
				{
					Value = "readonly class=readonly"
				}
				else
				{
					Value = String()
				}
			End
	
	
			Begin Label
				Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterSystemIdFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=SystemIdEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=SystemIdEdit>', 'SystemIdEdit', (" + %User.Applicationfeatures.FilterApprovalNameFeatureMandatory.value + "==1))"
				EscapeType = None
			End
		End
	
		// set default value for reset
		Begin Component Filter.SystemIdDefault
			Begin Label
				Label = String()
				EscapeType = None
			End
		End
	}
	else //hidden
	{
		Begin Component Filter.SystemId
			Begin Label
				Label = "getFieldHTML('', '', '<input type=hidden name=SystemIdEdit>', 'SystemIdEdit', 0, 1)"
				EscapeType = None
			End
		End
	}	
}
else //empty
{
	Begin Component Filter.JobId
		Begin Label
			Label = "''"
			EscapeType = None
		End
	End

	Begin Component Filter.CC
		Begin Label
			Label = "''"
			EscapeType = None
		End
	End

	Begin Component Filter.SystemId
		Begin Label
			Label = "''"
			EscapeType = None
		End
	End

}
if(eq(Counter.IsApprovals(),1))
{
	if(eq(%User.Applicationfeatures.FilterApprovalNameFeature.ischecked , 1) )
	{
		Begin Component	Filter.ApprovalName
			Begin StrVariable Value
				when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterApprovalNameFeatureReadOnly.value , 0))
				{
					Value = Replace(Replace( $FilterInfo.ApprovalName , "\", "\\"), "'", "\'")
				}
				else
				{
					Value = Replace(Replace( %User.Applicationfeatures.FilterApprovalNameFeatureDefaultValue.value, "\", "\\"), "'", "\'")
				}
			End
	
			Begin StrVariable ClassName
				when(eq(%User.Applicationfeatures.FilterApprovalNameFeatureReadOnly.value , 1) )
				{
					Value = "readonly class=readonly"
				}
				else
				{
					Value = String()
				}
			End
	
	
			Begin Label
				Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterApprovalNameFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=ApprovalNameEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=ApprovalNameEdit>', 'ApprovalNameEdit', (" + %User.Applicationfeatures.FilterApprovalNameFeatureMandatory.value + "==1))"
				EscapeType = None
			End
		End
	
		// set default value for reset
		Begin Component Filter.ApprovalNameDefault
			Begin Label
				//Label = Replace(Replace(%User.Applicationfeatures.FilterApprovalNameFeatureDefaultValue.value, "\", "\\"), "'", "\'")
				Label = String()
				EscapeType = None
			End
		End
	}
	else //hidden
	{
		Begin Component Filter.ApprovalName
			Begin Label
				Label = "getFieldHTML('', '', '<input type=hidden name=ApprovalNameEdit>', 'ApprovalNameEdit', 0, 1)"
				EscapeType = None
			End
		End
	}

Begin Component Filter.ApprovalStatusFeature
	Begin Label
		Label = %User.Applicationfeatures.FilterApprovalStatusFeature.ischecked
	End
End

	if(eq(%User.Applicationfeatures.FilterApprovalStatusFeature.ischecked , 1) )
	{
				Begin Component Filter.ApprovalStatusDefault
					Begin Label
						Label = %User.Applicationfeatures.FilterApprovalStatusDefaultValueFeature.value
					End
				End

				Begin Component Filter.ApprovalStatusCurrent
					Begin Label
						Label = WhenExists($FilterInfo.approvalstatus)
					End
				End
				
				if(eq(%User.Applicationfeatures.FilterApprovalStatusAllFeature.ischecked, 1))
				{
					Begin Component Filter.ApprovalStatusAllOption
						Begin Label
							Label = "<option value=z>{!WA Approvals.All}</option>"
							EscapeType=JS
						End
					End
				}
				
				if(eq(%User.Applicationfeatures.FilterApprovalStatusCandidateFeature.ischecked,1))
				{
					Begin Component Filter.ApprovalStatusCandidateOption
						Begin Label
							when( eq(Counter.IsApprovalsInReportList(),1) )
							{
								Label = "<option value=c>{!WA Approvals.WaitApproval}</option>"
							}
							else
							{
								Label = "<option value=c>{!WA Approvals.Candidate}</option>"
							}
							EscapeType=JS
						End
					End
				}
				
				if(eq(%User.Applicationfeatures.FilterApprovalStatusApproveFeature.ischecked,1))
				{
					Begin Component Filter.ApprovalStatusApproveOption
						Begin Label
							Label = "<option value=a>{!WA Approvals.Approved}</option>"
							EscapeType=JS
						End
					End
				}
				
				if(eq(%User.Applicationfeatures.FilterApprovalStatusApproveFeature.ischecked,1))
				{
					Begin Component Filter.ApprovalStatusRejectOption
						Begin Label
							Label = "<option value=r>{!WA Approvals.Rejected}</option>"
							EscapeType=JS
						End
					End
				}
				
				if(eq(%User.Applicationfeatures.FilterApprovalStatusReadOnly.value, 1))
				{
					Begin Component Filter.ApprovalStatusReadOnly
						Begin Label
							Label = "disabled class=readonly"
							EscapeType=JS
						End
					End
				}
	}


}
else //empty
	{
		Begin Component Filter.ApprovalName
			Begin Label
				Label = "''"
				EscapeType = None
			End
		End
		Begin Component Filter.ApprovalStatus
			Begin Label
				Label = "''"
				EscapeType = None
			End
		End
	}

if(eq(%User.Applicationfeatures.FilterReportNameFeature.ischecked , 1) )
{
	Begin Component	Filter.ReportName
		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportNameFeatureReadOnly.value, 0) ) //check current filter
			{
				Value = Replace(Replace( $FilterInfo.ReportName , "\", "\\"), "'", "\'")
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterReportNameFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterReportNameFeatureReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End


		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterReportNameFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=ReportNameEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=ReportNameEdit>', 'ReportNameEdit', (" + %User.Applicationfeatures.FilterReportNameFeatureMandatory.value + "==1))"
			EscapeType = None
		End
	End

	// set default value for reset
	Begin Component Filter.ReportNameDefault
		Begin Label
			Label = Replace(Replace(%User.Applicationfeatures.FilterReportNameFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			EscapeType = None
		End
	End
}
else //hidden
{
	Begin Component Filter.ReportName
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=ReportNameEdit>', 'ReportNameEdit', 0, 1)"
			EscapeType = None
		End
	End
}

if(eq(%User.Applicationfeatures.FilterJobNameFeature.ischecked , 1) )
{
	Begin Component	Filter.JobName

		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterJobNameFeatureReadOnly.value , 0))
			{
				Value = Replace(Replace( $FilterInfo.JobName , "\", "\\"), "'", "\'")
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterJobNameFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterJobNameFeatureReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End


		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterJobNameFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=JobNameEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=JobNameEdit>', 'JobNameEdit', (" + %User.Applicationfeatures.FilterJobNameFeatureMandatory.value + "==1))"
			EscapeType = None

		End
	End

	// set default value for reset
		Begin Component Filter.JobNameDefault
			Begin Label
				Label = Replace(Replace(%User.Applicationfeatures.FilterJobNameFeatureDefaultValue.value, "\", "\\"), "'", "\'")
				EscapeType = None
			End

		End

}
else //hidden
{
	Begin Component Filter.JobName
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=JobNameEdit>', 'JobNameEdit', 0, 1)"
			EscapeType = None
		End
	End
}


if(eq(%User.Applicationfeatures.FilterRemarkFeature.ischecked , 1))
{
	Begin Component	Filter.Remark
		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterRemarkFeatureReadOnly.value , 0) )
			{
				Value = Replace(Replace( $FilterInfo.Remark , "\", "\\"), "'", "\'")
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterRemarkFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterRemarkFeatureReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End


		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterRemarkFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=RemarkEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=RemarkEdit>', 'RemarkEdit', (" + %User.Applicationfeatures.FilterRemarkFeatureMandatory.value + "==1))"
			EscapeType = None

		End
	End

	// set default value for reset
	Begin Component Filter.RemarkDefault
			Begin Label
				Label = Replace(Replace(%User.Applicationfeatures.FilterRemarkFeatureDefaultValue.value, "\", "\\"), "'", "\'")
				EscapeType = None
			End

		End
}
else //hidden
{
	Begin Component Filter.Remark
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=RemarkEdit>', 'RemarkEdit', 0, 1)"
			EscapeType = None
		End
	End
}

if(eq(%User.Applicationfeatures.FilterRemarkFeature2.ischecked , 1))
{
	Begin Component	Filter.Remark2
		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterRemarkFeature2ReadOnly.value , 0) )
			{
				Value = Replace(Replace( $FilterInfo.Remark2 , "\", "\\"), "'", "\'")
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterRemarkFeature2DefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterRemarkFeature2ReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End


		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterRemarkFeature2{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=Remark2Edit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=Remar2kEdit>', 'Remark2Edit', (" + %User.Applicationfeatures.FilterRemarkFeature2Mandatory.value + "==1))"
			EscapeType = None

		End
	End

	// set default value for reset
	Begin Component Filter.Remark2Default
			Begin Label
				Label = Replace(Replace(%User.Applicationfeatures.FilterRemarkFeature2DefaultValue.value, "\", "\\"), "'", "\'")
				EscapeType = None
			End

		End
}
else //hidden
{
	Begin Component Filter.Remark2
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=Remark2Edit>', 'RemarkEdit', 0, 1)"
			EscapeType = None
		End
	End
}

if(eq(%User.Applicationfeatures.FilterRemarkFeature3.ischecked , 1))
{
	Begin Component	Filter.Remark3
		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterRemarkFeature3ReadOnly.value , 0) )
			{
				Value = Replace(Replace( $FilterInfo.Remark3 , "\", "\\"), "'", "\'")
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterRemarkFeature3DefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterRemarkFeature3ReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End


		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterRemarkFeature3{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=Remark3Edit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=Remar2kEdit>', 'Remark3Edit', (" + %User.Applicationfeatures.FilterRemarkFeature3Mandatory.value + "==1))"
			EscapeType = None

		End
	End

	// set default value for reset
	Begin Component Filter.Remark3Default
			Begin Label
				Label = Replace(Replace(%User.Applicationfeatures.FilterRemarkFeature3DefaultValue.value, "\", "\\"), "'", "\'")
				EscapeType = None
			End

		End
}
else //hidden
{
	Begin Component Filter.Remark3
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=Remark3Edit>', 'RemarkEdit', 0, 1)"
			EscapeType = None
		End
	End
}

if(eq(%User.Applicationfeatures.FilterCategoryFeature.ischecked , 1) )
{
	Begin Component	Filter.Category

		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterCategoryFeatureReadOnly.value , 0))
			{
				Value = Replace(Replace( $FilterInfo.Category , "\", "\\"), "'", "\'")
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterCategoryFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterCategoryFeatureReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End


		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterCategoryFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=CategoryEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=CategoryEdit>', 'CategoryEdit', (" + %User.Applicationfeatures.FilterCategoryFeatureMandatory.value + "==1))"
			EscapeType = None

		End
	End

	// set default value for reset
	Begin Component Filter.CategoryDefault
			Begin Label
				Label = Replace(Replace(%User.Applicationfeatures.FilterCategoryFeatureDefaultValue.value, "\", "\\"), "'", "\'")
				EscapeType = None
			End

		End
}
else //hidden
{
	Begin Component Filter.Category
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=CategoryEdit>', 'CategoryEdit', 0, 1)"
			EscapeType = None
		End
	End
}

if(eq(%User.Applicationfeatures.FilterIndexFeature.ischecked , 1))
{
	Begin Component	Filter.IndexName
		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterIndexFeatureReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End

		Begin StrVariable Value
			when( ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterIndexFeatureReadOnly.value , 0) )
			{
				Value = String() //put in JS
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterIndexNameFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterIndexNameFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=IndexNameEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=IndexNameEdit>', 'IndexNameEdit', (" + %User.Applicationfeatures.FilterIndexFeatureMandatory.value + "==1))"
			EscapeType = None
		End
	End

	// set default value for reset
	Begin Component Filter.IndexNameDefault
		Begin Label
			Label = Replace(Replace(%User.Applicationfeatures.FilterIndexNameFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			EscapeType = None
		End
	End

	Begin Component	Filter.IndexValue
		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter)  && eq(%User.Applicationfeatures.FilterIndexFeatureReadOnly.value , 0))
			{
				Value = String() //put in JS
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterIndexValueFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterIndexValueFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=IndexValueEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=IndexValueEdit>', 'IndexValueEdit', (" + %User.Applicationfeatures.FilterIndexFeatureMandatory.value + "==1))"
			EscapeType = None
		End
	End

	// set default value for reset
	Begin Component Filter.IndexValueDefault
		Begin Label
			Label = Replace(Replace(%User.Applicationfeatures.FilterIndexValueFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			EscapeType = None
		End
	End
}
else //hidden
{
	Begin Component Filter.IndexName
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=IndexNameEdit>', 'IndexNameEdit', 0, 1)"
			EscapeType = None
		End
	End

	Begin Component Filter.IndexValue
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=IndexValueEdit>', 'IndexValueEdit', 0, 1)"
			EscapeType = None
		End
	End
}

//---------------------------------------------------------------------------
// Definition of the Index Component (need for setting index names / values
// to corresponding edit boxes
//---------------------------------------------------------------------------
Begin Component	Filter.Index
	Begin Label
		Label = $FilterInfo.Index
		EscapeType = JS
	End
End

if(eq(%User.Applicationfeatures.FilterRecipientFeature.ischecked , 1) )
{
	Begin Component	Filter.Recipient
		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterRecipientFeatureReadOnly.value , 0))
			{
				Value = Replace(Replace( $FilterInfo.Recipient , "\", "\\"), "'", "\'")
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterRecipientFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterRecipientFeatureReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End


		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterRecipientFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=RecipientEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=RecipientEdit>', 'RecipientEdit', (" + %User.Applicationfeatures.FilterRecipientFeatureMandatory.value + "==1))"
			EscapeType = None
		End
	End

	// set default value for reset
	Begin Component Filter.RecipientDefault
		Begin Label
			Label = Replace(Replace(%User.Applicationfeatures.FilterRecipientFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			EscapeType = None
		End
	End
}
else //hidden
{
	Begin Component Filter.Recipient
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=RecipientEdit>', 'RecipientEdit', 0, 1)"
			EscapeType = None
		End
	End
}

if(eq($Info.IsSupported.FullTextSearch, true) && eq(%User.Applicationfeatures.FilterFullSearchFeature.ischecked , 1) )
{
	Begin Component	Filter.FullSearch
		Begin StrVariable Value
			when( ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterFullSearchFeatureReadOnly.value , 0) )
			{
				Value = Replace(Replace( $FilterInfo.FullSearch , "\", "\\"), "'", "\'")
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterFullSearchFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterFullSearchFeatureReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End

		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterFullSearchFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=FullSearchEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=FullSearchEdit>', 'FullSearchEdit', (" + %User.Applicationfeatures.FilterFullSearchFeatureMandatory.value + "==1))"
			EscapeType = None

		End
	End

	// set default value for reset
	Begin Component Filter.FullSearchDefault
		Begin Label
			Label = Replace(Replace(%User.Applicationfeatures.FilterFullSearchFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			EscapeType = None
		End
	End
}
else //hidden
{
	Begin Component Filter.FullSearch
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=FullSearchEdit>', 'FullSearchEdit', 0, 1)"
			EscapeType = None
		End
	End
}

if(ExistsAndEqual($Info.IsSupported.Versions, true) && eq(%User.Applicationfeatures.FilterVersionFeature.ischecked, 1) )
{
	Begin Component	Filter.Version

		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterVersionFeatureReadOnly.value , 0))
			{
				Value = $FilterInfo.Version
			}
			else
			{
				Value = %User.Applicationfeatures.FilterVersionFeatureDefaultValue.value
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterVersionFeatureReadOnly.value, 1))
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End

		Begin Label
			Label = "getFieldHTML('" + EscapeJS(%User.Applicationfeatures.FilterVersionFeature{!WA Lang.DesktopName}.value)
					+ "', ':', {!WA Lang.ConcatFunction}('<input type=text name=VersionEdit " + StrVariable.ClassName()
					+ " value=" +DoubleQuote() + EscapeJS(EscapeHTML(StrVariable.Value())) + DoubleQuote()
					+ " size=5 id=VersionEdit>', '   ','<select name=VersionCombo dir={!WA lang.UIMode}><option><option value=#last>{!WA Filter.LastVersion}<option value=#all>{!WA Filter.AllVersions}</select>'), 'VersionEdit')"
			EscapeType = None
		End
	End

	// set default value for reset
	Begin Component Filter.VersionDefault
		Begin Label
			Label = Replace(Replace(%User.Applicationfeatures.FilterVersionFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			EscapeType = None
		End
	End
}
else //hidden
{
	Begin Component Filter.Version
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=VersionEdit>', 'VersionEdit', 0, 1)"
			EscapeType = None
		End
	End
}

if(ExistsAndEqual($Info.IsSupported.Generations, true) && eq(%User.Applicationfeatures.FilterGenerationFeature.ischecked , 1) )
{
	Begin Component	Filter.Generation

		Begin StrVariable Value
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterGenerationFeatureReadOnly.value , 0))
			{
				Value = Replace(Replace( $FilterInfo.Generation , "\", "\\"), "'", "\'")
			}
			else
			{
				Value = Replace(Replace( %User.Applicationfeatures.FilterGenerationFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			}
		End

		Begin StrVariable ClassName
			when(eq(%User.Applicationfeatures.FilterGenerationFeatureReadOnly.value , 1) )
			{
				Value = "readonly class=readonly"
			}
			else
			{
				Value = String()
			}
		End

		Begin Label
			Label = "getFieldHTML('" + Replace(Replace(%User.Applicationfeatures.FilterGenerationFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "', ':', '<input type=text name=GenerationEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=30 id=GenerationEdit>', 'GenerationEdit', (" + %User.Applicationfeatures.FilterGenerationFeatureMandatory.value + "==1))"
			EscapeType = None
		End
	End

	// set default value for reset
	Begin Component Filter.GenerationDefault
		Begin Label
			Label = Replace(Replace(%User.Applicationfeatures.FilterGenerationFeatureDefaultValue.value, "\", "\\"), "'", "\'")
			EscapeType = None
		End
	End
}
else //hidden
{
	Begin Component Filter.Generation
		Begin Label
			Label = "getFieldHTML('', '', '<input type=hidden name=GenerationEdit>', 'GenerationEdit', 0, 1)"
			EscapeType = None
		End
	End
}

//----------------------------------------------------------------
// Definition of the "Text Reports" Checkbox Component
//----------------------------------------------------------------
Begin Component	Filter.TextReportsCheck
	if(eq(%User.Applicationfeatures.FilterReportTypeTextFeature.ischecked , 1) )
	{
		Begin CheckBox
			id = TextReportsCheckBox
			Name = TextReportsCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportTypeTextFeatureReadOnly.value , 0) ) //check current filter
			{
				Checked = $FilterInfo.MFReports
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterReportTypeTextFeatureDefaultSelected.Value
			}
			Label = %User.Applicationfeatures.FilterReporttypeTextFeature{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
			LabelClass = Text
		End
	}
	else
	{
		Begin Label
			when( eq(%User.Applicationfeatures.FilterReportTypeTextFeatureDefaultSelected.Value, 0) )
			{
				label ="<input type=hidden name=TextReportsCheckBox value='0'>"
			}
			else
			{
				label ="<input type=hidden name=TextReportsCheckBox value='1'>"
			}

			EscapeType=None
		End
	}
End

Begin Component Filter.TextReportsDefault
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypeTextFeatureDefaultSelected.Value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.TextReportsReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypeTextFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

//----------------------------------------------------------------
// Definition of the "AFP Reports" Checkbox Component
//----------------------------------------------------------------
Begin Component	Filter.AFPReportsCheck
	if(eq(%User.Applicationfeatures.FilterReportTypeAFPFeature.ischecked , 1) )
	{
		Begin CheckBox
			id = AFPReportsCheckBox
			Name = AFPReportsCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportTypeAFPFeatureReadOnly.value , 0) ) //check current filter
			{
				Checked = $FilterInfo.AFPReports
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterReportTypeAFPFeatureDefaultSelected.Value
			}
			Label = %User.Applicationfeatures.FilterReporttypeAFPFeature{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
			LabelClass = Text
		End
	}
	else
	{
		Begin Label
			when( eq(%User.Applicationfeatures.FilterReportTypeAFPFeatureDefaultSelected.Value, 0) )
			{
				label ="<input type=hidden name=AFPReportsCheckBox value='0'>"
			}
			else
			{
				label ="<input type=hidden name=AFPReportsCheckBox value='1'>"
			}

			EscapeType=None
		End
	}
End

Begin Component Filter.AFPReportsDefault
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypeAFPFeatureDefaultSelected.Value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End

End

Begin Component Filter.AFPReportsReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypeAFPFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

//----------------------------------------------------------------
// Definition of the "Xerox Reports" Checkbox Component
//----------------------------------------------------------------
Begin Component	Filter.XeroxReportsCheck
	if(eq(%User.Applicationfeatures.FilterReportTypeXeroxFeature.ischecked , 1) )
	{
		Begin CheckBox
			id = XeroxReportsCheckBox
			Name = XeroxReportsCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportTypeXeroxFeatureReadOnly.value , 0) ) //check current filter
			{
				Checked = $FilterInfo.CCIFReports
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterReportTypeXeroxFeatureDefaultSelected.Value
			}
			Label = %User.Applicationfeatures.FilterReporttypeXeroxFeature{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
			LabelClass = Text
		End
	}
	else
	{
		Begin Label
			when( eq(%User.Applicationfeatures.FilterReportTypeXeroxFeatureDefaultSelected.Value, 0) )
			{
				label ="<input type=hidden name=XeroxReportsCheckBox value='0'>"
			}
			else
			{
				label ="<input type=hidden name=XeroxReportsCheckBox value='1'>"
			}

			EscapeType=None
		End
	}
End

Begin Component Filter.XeroxReportsDefault
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypeXeroxFeatureDefaultSelected.Value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.XeroxReportsReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypeXeroxFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

//----------------------------------------------------------------
// Definition of the "PDF Reports" Checkbox Component
//----------------------------------------------------------------
Begin Component	Filter.PDFReportsCheck
	if(eq(%User.Applicationfeatures.FilterReportTypePDFFeature.ischecked , 1) )
	{
		Begin CheckBox
			id = PDFReportsCheckBox
			Name = PDFReportsCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportTypePDFFeatureReadOnly.value , 0) ) //check current filter
			{
				Checked = $FilterInfo.PDFReports
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterReportTypePDFFeatureDefaultSelected.Value
			}
			Label = %User.Applicationfeatures.FilterReporttypePDFFeature{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
			LabelClass = Text
		End
	}
	else
	{
		Begin Label
			when( eq(%User.Applicationfeatures.FilterReportTypePDFFeatureDefaultSelected.Value, 0) )
			{
				label ="<input type=hidden name=PDFReportsCheckBox value='0'>"
			}
			else
			{
				label ="<input type=hidden name=PDFReportsCheckBox value='1'>"
			}

			EscapeType=None
		End
	}
End

Begin Component Filter.PDFReportsDefault
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypePDFFeatureDefaultSelected.Value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.PDFReportsReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypePDFFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

//----------------------------------------------------------------
// Definition of the "Other Reports" Checkbox Component
//----------------------------------------------------------------
Begin Component	Filter.OtherReportsCheck
	if(eq(%User.Applicationfeatures.FilterReportTypeOtherFeature.ischecked , 1) )
	{
		Begin CheckBox
			id = OtherReportsCheckBox
			Name = OtherReportsCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportTypeOtherFeatureReadOnly.value , 0) ) //check current filter
			{
				Checked = $FilterInfo.PCReports
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterReportTypeOtherFeatureDefaultSelected.Value
			}
			Label = %User.Applicationfeatures.FilterReporttypeOtherFeature{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
			LabelClass = Text
		End
	}
	else
	{
		Begin Label
			when( eq(%User.Applicationfeatures.FilterReportTypeOtherFeatureDefaultSelected.Value, 0) )
			{
				label ="<input type=hidden name=OtherReportsCheckBox value='0'>"
			}
			else
			{
				label ="<input type=hidden name=OtherReportsCheckBox value='1'>"
			}

			EscapeType=None
		End
	}
End


Begin Component Filter.OtherReportsDefault
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypeOtherFeatureDefaultSelected.Value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.OtherReportsReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReporttypeOtherFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

//------------------------------------------------------------------
// Definition of the Status Checkboxes (Active, History & Migrated) & History & Migrated combined
//------------------------------------------------------------------
Begin Component	Filter.ActiveCheck
	Begin Counter IsReportStatus
		when(eq(%User.Applicationfeatures.FilterReportStatusFeature.ischecked , 1))
		{
			value = 1
		}
		else
		{
			value = 0
		}
	End

	if(eq(Counter.IsReportStatus(), 1) && eq(%User.Applicationfeatures.FilterReportStatusActiveFeature.ischecked , 1))
	{
		Begin CheckBox
			id = ActiveCheckBox
			Name = ActiveCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportStatusActiveFeatureReadOnly.value , 0) ) //check current filter
			{
				Checked = $FilterInfo.Active
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterReportStatusActiveFeatureDefaultSelected.Value
			}
			Label = %User.Applicationfeatures.FilterReportStatusActiveFeature{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
		End
	}
	else
	{
		Begin Label
			when( eq(%User.Applicationfeatures.FilterReportStatusActiveFeatureDefaultSelected.Value, 0) ) //check current filter
			{
				label ="<input type=hidden name=ActiveCheckBox value='0'>"
			}
			else
			{
				label ="<input type=hidden name=ActiveCheckBox value='1'>"
			}

			EscapeType=None
		end
	}
End

Begin Component Filter.ActiveReportDefault
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportStatusActiveFeatureDefaultSelected.Value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.ActiveReportReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportStatusActiveFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component	Filter.HistoryCheck
	if(eq(Counter.IsReportStatus(), 1) && eq(%User.Applicationfeatures.FilterReportStatusHistoryFeature.ischecked , 1) && !eq(%User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeature.ischecked,1) )
	{
		Begin CheckBox
			id = HistoryCheckBox
			Name = HistoryCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportStatusHistoryFeatureReadOnly.value , 0) ) //check current filter
			{
				Checked = $FilterInfo.History
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterReportStatusHistoryFeatureDefaultSelected.Value
			}
			Label = %User.Applicationfeatures.FilterReportStatusHistoryFeature{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
		End
	}
	else
	{
		Begin Label
			when( eq(%User.Applicationfeatures.FilterReportStatusHistoryFeatureDefaultSelected.Value, 1) || eq(%User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeatureDefaultSelected.Value, 1) ) //check current filter
			{
				label ="<input type=hidden name=HistoryCheckBox value='1'>"
			}
			else
			{
				label ="<input type=hidden name=HistoryCheckBox value='0'>"
			}

			EscapeType=None
		end
	}
End

Begin Component Filter.HistoryReportDefault
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportStatusHistoryFeatureDefaultSelected.Value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.HistoryReportReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportStatusHistoryFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component	Filter.MigratedCheck
	if(eq(Counter.IsReportStatus(), 1) && eq(%User.Applicationfeatures.FilterReportStatusMigratedFeature.ischecked , 1) && !eq(%User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeature.ischecked,1) )
	{
		Begin CheckBox
			id = MigratedCheckBox
			Name = MigratedCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportStatusMigratedFeatureReadOnly.value , 0) ) //check current filter
			{
				Checked = $FilterInfo.Migrated
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterReportStatusMigratedFeatureDefaultSelected.Value
			}
			Label = %User.Applicationfeatures.FilterReportStatusMigratedFeature{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
		End
	}
	else
	{
		Begin Label
			when( eq(%User.Applicationfeatures.FilterReportStatusMigratedFeatureDefaultSelected.Value, 1) || eq(%User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeatureDefaultSelected.Value, 1) ) //check current filter
			{
				label ="<input type=hidden name=MigratedCheckBox value='1'>"
			}
			else
			{
				label ="<input type=hidden name=MigratedCheckBox value='0'>"
			}

			EscapeType=None
		end
	}
End

Begin Component Filter.MigratedReportDefault
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportStatusMigratedFeatureDefaultSelected.Value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.MigratedReportReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportStatusMigratedFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End


Begin Component	Filter.HistoryAndMigratedCombinedCheck
	if(eq(Counter.IsReportStatus(), 1) && eq(%User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeature.ischecked,1) )
	{
		Begin CheckBox
			id = HistoryAndMigratedCombinedCheckBox
			Name = HistoryAndMigratedCombinedCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterReportStatusHistoryFeatureReadOnly.value , 0) ) //check current filter
			{
				Checked = Mult($FilterInfo.History, $FilterInfo.Migrated) // result will be 1 only if hostru and migrated will be 1
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeature.Value
			}
			Label = %User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeature{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
		End
	}
End

Begin Component Filter.HistoryAndMigratedCombinedReportDefault
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeatureDefaultSelected.Value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.HistoryAndMigratedCombinedReportReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End


//---------------------------------------------------------------------------------
// Definition of the General Checkboxes (Apply to subfolders & Include subfolders)
//---------------------------------------------------------------------------------
Begin Component	ApplyToAllFoldersCheckBox
	if(eq($Info.IsSupported.WithSubfolders, true) && eq(%User.Applicationfeatures.FilterApplyToAllFoldersFeature.ischecked, 1))
	{
		Begin CheckBox
			id = ApplyToAllFoldersCheckBox
			Name = ApplyToAllFoldersCheckBox
			Checked = $FilterInfo.ApplyOnSubFolders
			Label = "{!WA Filter.ApplyAll}"
			RTL = {!WA lang.IsRTL}
			Disabled = %User.Applicationfeatures.FilterApplyToAllFoldersFeatureReadOnly.value
		End
	}
	else
	{
		Begin Label
			label = "<input type=hidden name=ApplyToAllFoldersCheckBox>"
			EscapeType = None
		End
	}
End

Begin Component ApplyToAllFoldersDefault
	Begin Label
		Label = %User.Applicationfeatures.FilterApplyToAllFoldersFeatureDefaultSelected.value
		EscapeType = None
	End
End

Begin Component IncludeSubfoldersValue
	Begin Label
		when(eq($Info.IsSupported.IncludeSubfolders, true) && eq(%User.Applicationfeatures.FilterIncludeSubfoldersFeature.ischecked, 1) )
		{
			Label = WhenExists($FilterInfo.Child, "0")
		}
		else
		{
			Label = "-1"
		}

		EscapeType = None
	End
End

Begin Component IncludeSubfoldersDefault
	Begin Label
		Label = %User.Applicationfeatures.FilterIncludeSubfoldersFeatureDefaultValue.value
		EscapeType = None
	End
End

Begin Component Filter.IncludeSubfoldersReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterIncludeSubfoldersFeatureReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

//-------------------------------------------------------------------
// Date UI
//-------------------------------------------------------------------
Begin Component Filter.ShowDateRangeUI
	Begin Label
		when(eq(%User.Applicationfeatures.FilterDateRangeFeature.ischecked,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.FromDateDefault
	Begin Label
		Label = %User.Applicationfeatures.FilterDateFromDefaultValueFeature.value
	End
End

Begin Component Filter.ToDateDefault
	Begin Label
		Label = %User.Applicationfeatures.FilterDateToDefaultValueFeature.value
	End
End

Begin Component Filter.ShowDateTypeUI
	Begin Label
		when(eq(%User.Applicationfeatures.FilterDateTypeFeature.ischecked,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.DateTypeDefault
	Begin Label
		Label = %User.Applicationfeatures.FilterDateTypeDefaultValueFeature.value
	End
End

if(eq(%User.Applicationfeatures.FilterDateTypeDecollatedFeature.ischecked, 1))
{
	Begin Component Filter.DecollatedOption
		Begin Label
			Label = "<option value=2>{!WA Filter.Decollated}</option>"
			EscapeType=JS
		End
	End
}

if(eq(%User.Applicationfeatures.FilterDateTypeOrderedFeature.ischecked,1))
{
	Begin Component Filter.OrderedOption
		Begin Label
			Label = "<option value=3>{!WA Filter.Ordered}</option>"
			EscapeType=JS
		End
	End
}

if(eq(%User.Applicationfeatures.FilterDateTypeRunFeature.ischecked,1))
{
	Begin Component Filter.RunOption
		Begin Label
			Label = "<option value=4>{!WA Filter.Run}</option>"
			EscapeType=JS
		End
	End
}

if(eq(%User.Applicationfeatures.FilterDateTypeReadOnly.value, 1))
{
	Begin Component Filter.DateTypeReadOnly
		Begin Label
			Label = "disabled class=readonly"
			EscapeType=JS
		End
	End
}

Begin Component Filter.ShowTimeRangeUI
	Begin Label
		when(eq(%User.Applicationfeatures.FilterTimeRangeFeature.ischecked,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.FromTimeDefault
	Begin Label
			Label = %User.Applicationfeatures.FilterTimeFromDefaultValueFeature.value
	End
End

Begin Component Filter.ToTimeDefault
	Begin Label
		Label = %User.Applicationfeatures.FilterTimeToDefaultValueFeature.value
	End
End
//----------------------------------------------------------------
// Definition of the Date From EditBox Component
//----------------------------------------------------------------
Begin Component	Filter.DateFromEdit
	Begin StrVariable CurrentDateFormat
		value = %User.GeneralSettings.CurrentDateFormat
	End
	
	Begin StrVariable CurrentDateSeparator
		value = %User.GeneralSettings.CurrentDateSeparator
	End

	Begin StrVariable Value
		when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterDateRangeReadOnly.value , 0) )  //check current filter
		{
			Value = Replace(Replace( $FilterInfo.DateFrom , "\", "\\"), "'", "\'")
		}
		else
		{
			Value = Replace(Replace( %User.Applicationfeatures.FilterDateFromDefaultValueFeature.value, "\", "\\"), "'", "\'")
		}
	End

	Begin StrVariable ClassName
		when(eq(%User.Applicationfeatures.FilterDateRangeReadOnly.value , 1) )
		{
			Value = "readonly class=readonly"
		}
		else
		{
			Value = String()
		}
	End

	Begin Label
		Label = "<input type=text name=DateFromEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=10 id=DateFromEdit>"
		EscapeType = JS
	End
End

//----------------------------------------------------------------
// Definition of the Date To EditBox Component
//----------------------------------------------------------------
Begin Component	Filter.DateToEdit
	Begin StrVariable Value
		when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterDateRangeReadOnly.value , 0) ) //check current filter
		{
			Value = Replace(Replace( $FilterInfo.DateTo , "\", "\\"), "'", "\'")
		}
		else
		{
			Value = Replace(Replace( %User.Applicationfeatures.FilterDateToDefaultValueFeature.value, "\", "\\"), "'", "\'")
		}
	End

	Begin StrVariable ClassName
		when(eq(%User.Applicationfeatures.FilterDateRangeReadOnly.value , 1) )
		{
			Value = "readonly class=readonly"
		}
		else
		{
			Value = String()
		}
	End


	Begin Label
		Label = "<input type=text name=DateToEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=10 id=DateToEdit>"
		EscapeType = JS
	End
End

//----------------------------------------------------------------
// Definition of the Time From EditBox Component
//----------------------------------------------------------------
Begin Component	Filter.TimeFromEdit
	Begin StrVariable Value
		when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterTimeRangeReadOnly.value , 0) )
		{
			Value = Replace(Replace( $FilterInfo.TimeFrom , "\", "\\"), "'", "\'")
		}
		else
		{
			Value = Replace(Replace( %User.Applicationfeatures.FilterTimeFromDefaultValueFeature.value, "\", "\\"), "'", "\'")
		}
	End

	Begin StrVariable ClassName
		when(eq(%User.Applicationfeatures.FilterTimeRangeReadOnly.value , 1) )
		{
			Value = "readonly class=readonly"
		}
		else
		{
				Value = String()
		}
	End

	Begin Label
		Label = "<input type=text name=TimeFromEdit " + StrVariable.ClassName() + " value=" +DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=10 maxlength=8 id=TimeFromEdit>"
		EscapeType = JS
	End
End

//----------------------------------------------------------------
// Definition of the Date To EditBox Component
//----------------------------------------------------------------
Begin Component	Filter.TimeToEdit
	Begin StrVariable Value
		when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterTimeRangeReadOnly.value , 0) )
		{
			Value = Replace(Replace( $FilterInfo.TimeTo , "\", "\\"), "'", "\'")
		}
		else
		{
			Value = Replace(Replace( %User.Applicationfeatures.FilterTimeToDefaultValueFeature.value, "\", "\\"), "'", "\'")
		}
	End

	Begin StrVariable ClassName
		when(eq(%User.Applicationfeatures.FilterTimeRangeReadOnly.value , 1) )
		{
			Value = "readonly class=readonly"
		}
		else
		{
				Value = String()
		}
	End


	Begin Label
		Label = "<input type=text name=TimeToEdit " + StrVariable.ClassName() + " value=" + DoubleQuote() + StrVariable.Value() + DoubleQuote() + " size=10 maxlength=8 id=TimeToEdit>"
		EscapeType = JS
	End
End

//----------------------------------------------------------------
// Definition of the Current Date Label Component
//----------------------------------------------------------------
Begin Component	Filter.Date.CurrentDateLabel
	Begin Label
		Label = $CurrentDate
	End
End

//----------------------------------------------------------------
// Definition of the Current Date Format Label Component
//----------------------------------------------------------------
Begin Component	Filter.Date.CurrentDateFormat
	Begin Label
		Label = StrVariable.CurrentDateFormat()
	End
End

Begin Component	Filter.Date.CurrentDateSeparator
	Begin Label
		Label = StrVariable.CurrentDateSeparator()
	End
End

Begin Component	Filter.Date.CurrentDateFormatLabel
	Begin StrVariable FormatLabel
		value = replace(StrVariable.CurrentDateFormat(), "dd", "{!WA Filter.DD}")
	End

	Begin StrVariable FormatLabel
		value = replace(StrVariable.FormatLabel(), "mm", "{!WA Filter.MM}")
	End

	Begin StrVariable FormatLabel
		value = replace(StrVariable.FormatLabel(), "yyyy", "{!WA Filter.YYYY}")
	End
	
	Begin StrVariable FormatLabel
		value = replace(StrVariable.FormatLabel(), "/", StrVariable.CurrentDateSeparator())
	End

	Begin Label
		Label	= StrVariable.FormatLabel()
	End
End

//----------------------------------------------------------------
// Definition of Date Type
//----------------------------------------------------------------
Begin Component Filter.DateType
	Begin Label
		Label = String($FilterInfo.DateType)
	End
End
//----------------------------------------------------------------
// Definition of FilterInfo
//----------------------------------------------------------------
Begin Component Filter.FilterInfo
	if(exists($FilterInfo.Filter) && noteq($FilterInfo.Filter, String("") ))
	{
		Begin Label
			Label = "true"
		End
	}

End
//----------------------------------------------------------------
// Definition of Index Tab Image
//----------------------------------------------------------------
Begin Component HasGlobalIndex
	Begin Counter HasGlobalIndex
		when( (eq($Info.IsSupported.GlobalSqlIndex, true) || eq($Info.IsSupported.GlobalTreeIndex, true)) && eq(%User.Applicationfeatures.FilterGlobalIndexFeature.ischecked , 1) )
		{
		value =1
		}
		else
		{
		value=0
		}
	End
	Begin Label
		when(eq(Counter.HasGlobalIndex(),1))
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
	End
End

//For check if the MFR repository
Begin Component Filter.GlobalTreeIndex
	Begin Label
		when(eq($Info.IsSupported.GlobalTreeIndex, true) && eq($Info.IsSupported.HostPrint, true))
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
	End
End

Begin Component Filter.ExpandCollapseAllIndexesNodes
	Begin Label
		when(eq($Info.IsSupported.GlobalTreeIndex, true) && eq($Info.IsSupported.HostPrint, true) && eq(%User.Applicationfeatures.FilterGlobalIndexFeatureExpandCollapseAllIndexesNodesFeature.ischecked , 1))
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
	End
End


Begin Component LanguageConvert
	Begin Label
		when(eq("{!WA lang.Mode}", "convert"))
		{
			label = "true"
		}
		else
		{
			label = "false"
		}
	End
End

Begin Component OpenSaveFilterWindow
	Begin Event.OnClick
		Begin OpenWindow
			TargetWindow			= WindowByName
			TargetWindowName		= SavePreDefineFilterDialog
			TargetWindowParameters	= "toolbar=0,statusbar=0,menubar=0,resizable=0,width=415,height=117"
			targetwindowopener		= (*) action("window.name")

			Begin Request
				RequestType		= base
				ElemTemplate	= "empty.txt"
				StrTemplate		= "filter_management.htm"
				ErrorFlowStr	= "onerrorclose.htm"
				ErrorFlowElem	= "onerrorclose.txt"
				Lang = $Params.Lang
			End
		End
	End
End

Begin Component	Filter.FID
	Begin Label
		Label= $Params.FID
		EscapeType = JS
	End
End

Begin Component Filter.SID
	Begin Label
		Label = WhenExists($STD.csid, $params.sid)
		EscapeType = JS
	End
End

Begin Component Filter.Mode
	Begin Label
		// MPR
		when(eq($Info.IsSupported.GlobalSqlIndex, true))
		{
			label = SQL
		}
		else
		{
			// Mainframe
			when (eq($Info.IsSupported.GlobalTreeIndex, true) && eq($Info.IsSupported.HostPrint, true))
			{
				label = MFSQL
			}
			else
			{
				label = TREE
			}
		}
	End
End

Begin Component FilterByTimeOnlySupported
	Begin Label
		when (exists($Info.IsSupported.FilterByTimeOnly) && eq($Info.IsSupported.FilterByTimeOnly, true))
		{
			label = "true"
		}
		else
		{
			label = "false"
		}
		EscapeType = NONE
	End
End

Begin Component StoreFilters
	Begin Counter IsStoreFilter
		when(eq(%User.Applicationfeatures.FilterStorage.ischecked, 1))
		{
			value=1
		}
		else
		{
			value = 0
		}

	End

	Begin Label
		when(eq(Counter.IsStoreFilter(),1))
		{
			label = "true"
		}
		else
		{
			label = "false"
		}
		EscapeType = None
	End
End

Begin Component StoreFilterInFile
	Begin Label
		when(eq(Counter.IsStoreFilter(), 1) && eq(%User.Applicationfeatures.FilterStorageType.value, 3))
		{
			label = "true"
		}
		else
		{
			label = "false"
		}
		EscapeType = None
	End
End

Begin Component FilterSave
	Begin Label
		when(eq(Counter.IsStoreFilter(), 1) && eq(%User.Applicationfeatures.FilterStorageSave.ischecked, 1))
		{
			label = "true"
		}
		else
		{
			label = "false"
		}
		EscapeType = None
	End
End

Begin Component FilterDelete
	Begin Label
		when(eq(Counter.IsStoreFilter(), 1) && eq(%User.Applicationfeatures.FilterStorageDelete.ischecked, 1))
		{
			label = "true"
		}
		else
		{
			label = "false"
		}
		EscapeType = None
	End
End

Begin Component FilterStorageDefault
	Begin Label
		when(eq(Counter.IsStoreFilter(), 1) && eq(%User.Applicationfeatures.FilterStorageDefault.ischecked, 1))
		{
			label = "true"
		}
		else
		{
			label = "false"
		}
		EscapeType = None
	End
End

Begin Component FilterStorageLastUsed
	Begin Label
		when(eq(Counter.IsStoreFilter(), 1) && eq(%User.Applicationfeatures.FilterStorageLastUsed.ischecked, 1) )
		{
			label = "true"
		}
		else
		{
			label = "false"
		}
		EscapeType = None
	End
End
#include "filterhelper.txt"


//Index Tab

//NEW INDEX UI SECTION
Begin Component Index.JAVASCRIPT
if(eq(Counter.HasGlobalIndex(),1))
{
	Begin Label
			label = "<script src='{!WA Common.HtmlsDir}/js_index.js'></script>"
			EscapeType = NONE
		End

	if( eq($Info.IsSupported.GlobalSqlIndex, 1) )
	{
		Begin Label
			label = "<script src='{!WA Common.HtmlsDir}/js_index_dsr.js'></script>"
			EscapeType = NONE
		End
	}

	if (eq($Info.IsSupported.globaltreeindex, 1) )
	{
		Begin Label
			label = "<script src='{!WA Common.HtmlsDir}/js_index_mfr.js'></script>"
			EscapeType = NONE
		End
	}
}
End

Begin Component Index.IndexValuesRequestQS
	Begin QueryString
		Begin Request
			RequestType = GlobalIndexValues  {const}
			SID = WhenExists($STD.csid, $params.sid)  {const}
			FID =  (*) Action("GetFID()")
			mask = (*) Action("szMask")
			indexpath = (*) Action("szIndexPath")
			valueid = (*) Action("szValueID")
			value = (*) Action("szValue")
			direction = (*) Action("szDirection")
			IncludeSubfolders=(*) Action("IsIncludeSubfolders()")
			RetrieveLevel=(*) Action("RetrieveLevel")
			ElemTemplate = "indexvaluerequest.txt"		{ const }
			StrTemplate     = "indexvaluerequest.htm"		{ const }
		End
	End
End

Begin Component Index.IndexNameRequestQS
	Begin QueryString
		Begin Request
			RequestType = GlobalIndex
			SID = WhenExists($STD.csid, $params.sid)
			FID =  (*) Action("GetFID()")
			IncludeSubfolders=(*) Action("IsIncludeSubfolders()")
			mode=INFO
			ElemTemplate = "indexnamerequest.txt"		{ const }
			StrTemplate     = "indexvaluerequest.htm"		{ const }
		End
	End
End

Begin Component  HideHelp
	if(eq(%User.Applicationfeatures.Helpfeature.ischecked , 0) )
	{
		Begin Label
			label = "HideHelpUI();"
		End
	}
End

//---------------------------------------------------------------------------------------------------
//                Application Feature support
//---------------------------------------------------------------------------------------------------
Begin Component  HasReportParametersTab
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportParametersFeature.ischecked , 0) )
		{
			label = "false"
		}
		else
		{
			label = "true"
		}
		EscapeType = None
	End
End


Begin Component  HasDateAndTimeTab
	Begin Label
		when(eq(%User.Applicationfeatures.FilterDateAndTimeFeature.ischecked , 0))
		{
			label = "false"
		}
		else
		{
			label = "true"
		}
		EscapeType = None
	End
End

Begin Component  HasReportTypeTab
	Begin Label
		when(eq(%User.Applicationfeatures.FilterReportTypeFeature.ischecked , 0) )
		{
			label = "false"
		}
		else
		{
			label = "true"
		}
		EscapeType = None
	End
End

Begin Component  Filter.ReportStatus
	Begin Label
		when(eq(Counter.IsReportStatus(),1) )
		{
			label = "true"
		}
		else
		{
			label = "false"
		}
	End
End

Begin Component  Filter.ReportStatusLabel
	Begin Label
		label = %User.Applicationfeatures.FilterReportStatusFeature{!WA Lang.DesktopName}.value
		EscapeType=JS
	End
End

Begin Component Filter.TwoDigitYearAnchor
	Begin Label
		label = %User.GeneralSettings.CurrentTwoDigitYearAnchor
		EscapeType = NONE
	End
End


//----------------------------------------------------------------
// Definition of the "Other Reports" Checkbox Component
//----------------------------------------------------------------
Begin Component	Filter.LastReportOnlyReportsCheck
	Begin Counter LastReportOnlySupport
		when(eq($Info.IsSupported.LastReportOnly,1))
		{
			value=1
		}
		else
		{
			 value=0
		 }
	End	
	
	if(eq(Counter.LastReportOnlySupport(),1) && eq(%User.Applicationfeatures.FilterLastReportOnlyFeature.ischecked , 1))
	{
		Begin Label
			label="<div id=LastReportOnly>"
			EscapeType=None
		End
		
		Begin CheckBox
			id = LastReportOnlyCheckBox
			Name = LastReportOnlyCheckBox
			when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterLastReportOnlyReadOnly.value , 0)  )//check current filter
			{
				when(NotEq(Find($FilterInfo.Filter, "2500"), NotFound()))
				{
					Checked =  	1
				}
				else
				{
				  	Checked =  	0
				  }
					
			}
			else
			{
				Checked = %User.Applicationfeatures.FilterLastReportOnlyDefaultValueFeature.Value
			}
			Label = %User.Applicationfeatures.FilterLastReportOnly{!WA Lang.DesktopName}.value
			RTL = {!WA lang.IsRTL}
			LabelClass = Text
		End
		
		Begin Label
			label="</div>"
			EscapeType=None
		End
		
	}
	else
	{
		Begin Label
			when( eq(Counter.LastReportOnlySupport(),1) && eq(%User.Applicationfeatures.FilterLastReportOnlyDefaultValueFeature.Value, 1) )
			{
				label ="<input type=hidden name=LastReportOnlyCheckBox value='1'>"
			}
			else
			{
				label ="<input type=hidden name=LastReportOnlyCheckBox value='0'>"
			}

			EscapeType=None
		End
	}
End


Begin Component Filter.LastReportOnlyDefault
	Begin Label
		when(eq(Counter.LastReportOnlySupport(),1)  && eq(%User.Applicationfeatures.FilterLastReportOnlyDefaultValueFeature.Value,1))
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
	End
End

Begin Component Filter.LastReportOnlyReadOnly
	Begin Label
		when(eq(%User.Applicationfeatures.FilterLastReportOnlyReadOnly.value,0))
		{
			Label = "false"
		}
		else
		{
			Label = "true"
		}
	End
End

Begin Component Filter.IsApprovals
	Begin Label
		when(eq(Counter.IsApprovals(),1))
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
		End
End

Begin Component Filter.IsJobArchiving
	Begin Label
		when(eq(Counter.IsJobArchiving(),1))
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
		End
End

if( (eq(Counter.IsApprovals(),1)) || (eq(Counter.IsJobArchiving(),1)) )
{
	Begin Component Filter.RegularRadioButton
		
		Begin radio
				ID = regular
				Label = "{!WA Filter.AllReports}"
				LabelClass = Text
		    Name = Approvals
		    Value = 0
		  	when(ExistsAndEqual($FilterInfo.Approvals, 1) || ExistsAndEqual($FilterInfo.JobArchiving, 1))
        {
	    		Checked = 0
	    	}
	    	else
		    {
		         Checked = 1
		    }
		  End
	End
	if (eq(Counter.IsApprovals(),1))
	{
		Begin Component Filter.ApprovalRadioButton
			Begin radio
					ID = approvals
					Label = "{!WA Filter.ApprovalReports}"
					LabelClass = Text
			    Name = Approvals
			    Value = 1
			    when(ExistsAndEqual($FilterInfo.Approvals, 1))
	        {
		    		Checked = 1
		    	}
		    	else
			    {
			         Checked = 0
			    }
			  End
		End
	}
	if (eq(Counter.IsJobArchiving(),1))
	{
		Begin Component Filter.JobArchivingRadioButton
			Begin radio
					ID = jobarchiving
					Label = "{!WA Filter.JobArchiving}"
					LabelClass = Text
			    Name = JobArchiving
			    Value = 1
			    when(ExistsAndEqual($FilterInfo.JobArchiving, 1))
	        {
		    		Checked = 1
		    	}
		    	else
			    {
			         Checked = 0
			    }
			  End
		End
	}

}

if(eq(Counter.IsJobArchiving(),1))
{
	Begin Component Filter.RegularRadioButton
		Begin radio
				ID = regular
				Label = "{!WA Filter.AllReports}"
				LabelClass = Text
		    Name = Approvals
		    Value = 0
		  	when(ExistsAndEqual($FilterInfo.Approvals, 1) || ExistsAndEqual($FilterInfo.JobArchiving, 1) )
        {
	    		Checked = 0
	    	}
	    	else
		    {
		         Checked = 1
		    }
		  End
	End
	
	Begin Component Filter.ApprovalRadioButton
		Begin radio
				ID = approvals
				Label = "{!WA Filter.ApprovalReports}"
				LabelClass = Text
		    Name = Approvals
		    Value = 1
		    when(ExistsAndEqual($FilterInfo.Approvals, 1))
        {
	    		Checked = 1
	    	}
	    	else
		    {
		         Checked = 0
		    }
		  End
	End
}


if(eq(Counter.IsExpand(),1))
{
	Begin Component	Filter.ExpandCheck
		if( eq(%User.Applicationfeatures.FilterExpandFeature.ischecked , 1) )
		{
			Begin CheckBox
				id = expandcheckbox
				Name = ExpandCheckBox
				when(ExistsAndNotEmpty($FilterInfo.Filter) && eq(%User.Applicationfeatures.FilterExpandFeatureReadOnly.value , 0) ) //check current filter
				{
					Checked = WhenExists($FilterInfo.Expand)
				}
				else
				{
					Checked = %User.Applicationfeatures.FilterExpandFeatureDefaultSelected.Value
				}
				Label = %User.Applicationfeatures.FilterExpandFeature{!WA Lang.DesktopName}.value
				RTL = {!WA lang.IsRTL}
			End
		}
		else
		{
			Begin Label
				when( eq(%User.Applicationfeatures.FilterExpandFeatureDefaultSelected.Value, 1) ) //check current filter
				{
					label ="<input type=hidden name=ExpandCheckBox value='1'>"
				}
				else
				{
					label ="<input type=hidden name=ExpandCheckBox value='0'>"
				}
	
				EscapeType=None
			end
		}
	End
	
	Begin Component Filter.ExpandedReportDefault
		Begin Label
			when(eq(%User.Applicationfeatures.FilterExpandFeatureDefaultSelected.Value,0))
			{
				Label = "false"
			}
			else
			{
				Label = "true"
			}
		End
	End
	
	Begin Component Filter.ExpandedReportReadOnly
		Begin Label
			when(eq(%User.Applicationfeatures.FilterExpandFeatureReadOnly.value,0))
			{
				Label = "false"
			}
			else
			{
				Label = "true"
			}
		End
	End
}

Begin Component Filter.MandatoryFields
	if(eq(Counter.IsApprovals(),1))
	{
		Begin Label
					Label = "new Field('approvalname',Visual2Log('" +  Replace(Replace(%User.Applicationfeatures.FilterApprovalNameFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "'),(" + %User.Applicationfeatures.FilterApprovalNameFeatureMandatory.value + "==1)),"
					EscapeType = NONE
		End
	}
	Begin Label
				Label = "new Field('reportname',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterReportNameFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "'),(" + %User.Applicationfeatures.FilterReportNameFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End

	Begin Label
				Label = "new Field('jobname',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterJobNameFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "'),(" + %User.Applicationfeatures.FilterJobNameFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End

	Begin Label
				Label = "new Field('jobid',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterJobIdFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "'),(" + %User.Applicationfeatures.FilterJobNameFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End

	Begin Label
				Label = "new Field('remark',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterRemarkFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "'),(" + %User.Applicationfeatures.FilterRemarkFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End

	Begin Label
				Label = "new Field('remark2',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterRemarkFeature2{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'")  + "'),(" + %User.Applicationfeatures.FilterRemarkFeature2Mandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('remark3',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterRemarkFeature3{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'")  + "'),(" + %User.Applicationfeatures.FilterRemarkFeature3Mandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('category',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterCategoryFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'")  + "'),(" + %User.Applicationfeatures.FilterCategoryFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('index',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterIndexValueFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "'),(" + %User.Applicationfeatures.FilterIndexFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('recipient',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterRecipientFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "'),(" + %User.Applicationfeatures.FilterRecipientFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('fullsearch',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterFullSearchFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'")  + "'),(" + %User.Applicationfeatures.FilterFullSearchFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('version',Visual2Log('" + EscapeJS(%User.Applicationfeatures.FilterVersionFeature{!WA Lang.DesktopName}.value) + "'),(" + %User.Applicationfeatures.FilterVersionFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('systemid',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterSystemIdFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "'),(" + %User.Applicationfeatures.FilterVersionFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('generation',Visual2Log('" + Replace(Replace(%User.Applicationfeatures.FilterGenerationFeature{!WA Lang.DesktopName}.value, "\", "\\"), "'", "\'") + "'),(" + %User.Applicationfeatures.FilterGenerationFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('daterange',Visual2Log('" + "{!WA Filter.DateTimeTab}" + "'),(" + %User.Applicationfeatures.FilterDateRangeFeatureMandatory.value + "==1)),"
				EscapeType = NONE
	End
	Begin Label
				Label = "new Field('timerange',Visual2Log('" + "{!WA Filter.DateTimeTab}" + "'),(" + %User.Applicationfeatures.FilterTimeRangeFeatureMandatory.value + "==1))"
				EscapeType = NONE
	End
End


Begin Component Filter.HistoryAndMigratedCombined
	Begin Label 
		Label = %User.Applicationfeatures.FilterReportStatusHistoryAndMigratedCombinedFeature.ischecked
	End
End
	
Begin Component UserDataSort
	Begin Label
			Label = WhenExists($UserData.Sort)
	End
End
				
					
Begin Component Filter.ApprovalsInReportList
	Begin Label
		when( eq(Counter.IsApprovalsInReportList(),1) )
		{
			Label = "true"
		}
		else
		{
			Label = "false"
		}
	End
End
	
	
Begin Component Filter.HostUpperCase
	Begin Label
		Label = GetHostUpperCase()
	End
End
