<#-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <#include "component://webtools/webapp/webtools/tempexpr/tempExprMacros.ftl"/>

${title}

<#if temporalExpression?has_content> <#-- Edit existing expression --> <#if !"INTERSECTION.UNION.DIFFERENCE.SUBSTITUTION"?contains(temporalExpression.tempExprTypeId)>
<#if !"INTERSECTION.UNION.DIFFERENCE.SUBSTITUTION"?contains(temporalExpression.tempExprTypeId)> <#else> <#if temporalExpression.tempExprTypeId == "DATE_RANGE"> <@DateRange formName="updateExpression" fromDate=temporalExpression.date1 toDate=temporalExpression.date2/> <#elseif temporalExpression.tempExprTypeId == "DAY_IN_MONTH"> <@DayInMonth occurrence=temporalExpression.integer2 day=temporalExpression.integer1/> <#elseif temporalExpression.tempExprTypeId == "DAY_OF_MONTH_RANGE"> <@DayOfMonthRange fromDay=temporalExpression.integer1 toDay=temporalExpression.integer2/> <#elseif temporalExpression.tempExprTypeId == "DAY_OF_WEEK_RANGE"> <@DayOfWeekRange fromDay=temporalExpression.integer1 toDay=temporalExpression.integer2/> <#elseif temporalExpression.tempExprTypeId == "FREQUENCY"> <@Frequency formName="updateExpression" fromDate=temporalExpression.date1 freqType=temporalExpression.integer1 freqValue=temporalExpression.integer2/> <#elseif temporalExpression.tempExprTypeId == "DAY_OF_WEEK_RANGE"> <@DayOfWeekRange fromDay=temporalExpression.integer1 toDay=temporalExpression.integer2/> <#elseif temporalExpression.tempExprTypeId == "HOUR_RANGE"> <@HourOfDayRange fromHour=temporalExpression.integer1 toHour=temporalExpression.integer2/> <#elseif temporalExpression.tempExprTypeId == "MINUTE_RANGE"> <@MinuteRange fromMinute=temporalExpression.integer1 toMinute=temporalExpression.integer2/> <#elseif temporalExpression.tempExprTypeId == "MONTH_RANGE"> <@MonthRange fromMonth=temporalExpression.integer1 toMonth=temporalExpression.integer2/> <#elseif temporalExpression.tempExprTypeId == "TIME_OF_DAY_RANGE"> <@TimeOfDayRange fromTime=temporalExpression.string1 toTime=temporalExpression.string2 freqType=temporalExpression.integer1 freqValue=temporalExpression.integer2/> <#elseif "INTERSECTION.UNION.DIFFERENCE.SUBSTITUTION"?contains(temporalExpression.tempExprTypeId)> <#assign candidateIdList = Static["org.ofbiz.service.calendar.ExpressionUiHelper"].getCandidateIncludeIds(delegator, temporalExpression.tempExprId)/> <#if "INTERSECTION.UNION"?contains(temporalExpression.tempExprTypeId)> <#else> <#assign hasInclude = false hasExclude = false hasSubstitution = false/> <#if childExpressionList?has_content> <#list childExpressionList as childExpression> <#if childExpression.exprAssocType == "INCLUDE"> <#assign hasInclude = true/> <#elseif childExpression.exprAssocType == "EXCLUDE"> <#assign hasExclude = true/> <#elseif childExpression.exprAssocType == "SUBSTITUTION"> <#assign hasSubstitution = true/> <#if !hasInclude> <#if !hasExclude> <#if !hasSubstitution && temporalExpression.tempExprTypeId == "SUBSTITUTION"> <#if !"INTERSECTION.UNION.DIFFERENCE.SUBSTITUTION"?contains(temporalExpression.tempExprTypeId)>
${uiLabelMap.TemporalExpressionId} ${temporalExpression.tempExprId}
${uiLabelMap.TemporalExpressionType} ${uiLabelMap.get("TemporalExpression_" + temporalExpression.tempExprTypeId)}
${uiLabelMap.CommonDescription}
${uiLabelMap.CommonDescription} ${temporalExpression.get("description",locale)?if_exists}
${uiLabelMap.TemporalExpressionInclude} <@CreateExprAssocForm formName="includeExpression"/>
${uiLabelMap.TemporalExpressionInclude} <@CreateExprAssocForm formName="includeExpression" exprAssocType="INCLUDE"/>
${uiLabelMap.TemporalExpressionExclude} <@CreateExprAssocForm formName="excludeExpression" exprAssocType="EXCLUDE"/>
${uiLabelMap.TemporalExpression_SUBSTITUTION} <@CreateExprAssocForm formName="substitutionExpression" exprAssocType="SUBSTITUTION"/>
 
<#else> <#else> <#-- Create new expression --> <@CreateForm "DATE_RANGE" CreateDateRange/>
<@CreateForm "DAY_IN_MONTH" DayInMonth/>
<@CreateForm "DAY_OF_MONTH_RANGE" DayOfMonthRange/>
<@CreateForm "DAY_OF_WEEK_RANGE" DayOfWeekRange/>
<@CreateForm "FREQUENCY" CreateFrequency/>
<@CreateForm "HOUR_RANGE" HourOfDayRange/>
<@CreateForm "MINUTE_RANGE" MinuteRange/>
<@CreateForm "MONTH_RANGE" MonthRange/>
<@CreateForm "TIME_OF_DAY_RANGE" TimeOfDayRange/>
<@CreateForm "INTERSECTION"/>
<@CreateForm "UNION"/>
<@CreateForm "DIFFERENCE"/>
<@CreateForm "SUBSTITUTION"/> <#macro CreateForm expressionTypeId="" formContents=NullMacro>
<#assign mapExpression = "TemporalExpression_" + expressionTypeId/> <#assign headingText = uiLabelMap[mapExpression]/> <@formContents/>
${headingText}
${uiLabelMap.TemporalExpressionId} ${uiLabelMap.CommonAutoAssignedId}
${uiLabelMap.CommonDescription}
 
<#macro CreateDateRange> <@DateRange formName="DATE_RANGE"/> <#macro CreateFrequency> <@Frequency formName="FREQUENCY"/> <#macro CreateExprAssocForm formName="" exprAssocType="">