Files
ofbiz-framework/framework/webtools/webapp/webtools/tempexpr/tempExprMaint.ftl
T
Adrian Crum 725c12fc77 More Temporal Expression work:
1. Fixed a bug in the TimeOfDayRange class where it didn't calculate properly across a daylight saving transition.
2. Added interval and count to TimeOfDayRange. Now the next() method will increment according to the new fields.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@718373 13f79535-47bb-0310-9956-ffa450edef68
2008-11-17 20:42:16 +00:00

151 lines
6.7 KiB
Plaintext

<#--
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"/>
<h1>${title}</h1>
<#if temporalExpression?has_content>
<#-- Edit existing expression -->
<table class="basic-table" cellspacing="0">
<tr>
<td class="label">${uiLabelMap.TemporalExpressionId}</td>
<td>${temporalExpression.tempExprId}</td>
</tr>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionType}</td>
<td>${uiLabelMap.get("TemporalExpression_" + temporalExpression.tempExprTypeId)}</td>
</tr>
<#if !"INTERSECTION.UNION.DIFFERENCE"?contains(temporalExpression.tempExprTypeId)>
<form name="updateExpression" method="post" action="<@ofbizUrl>updateTemporalExpression</@ofbizUrl>">
<input type="hidden" name="tempExprId" value="${temporalExpression.tempExprId}"/>
<input type="hidden" name="tempExprTypeId" value="${temporalExpression.tempExprTypeId}"/>
</#if>
<#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 == "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"?contains(temporalExpression.tempExprTypeId)>
<#assign candidateIdList = Static["org.ofbiz.service.calendar.ExpressionUiHelper"].getCandidateIncludeIds(delegator, temporalExpression.tempExprId)/>
<#if "INTERSECTION.UNION"?contains(temporalExpression.tempExprTypeId)>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionInclude}</td>
<td><@CreateExprAssocForm formName="includeExpression"/></td>
</tr>
<#else>
<#assign hasInclude = false hasExclude = false/>
<#if childExpressionList?has_content>
<#list childExpressionList as childExpression>
<#if childExpression.exprAssocType == "INCLUDE">
<#assign hasInclude = true/>
<#elseif childExpression.exprAssocType == "EXCLUDE">
<#assign hasExclude = true/>
</#if>
</#list>
</#if>
<#if !hasInclude>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionInclude}</td>
<td><@CreateExprAssocForm formName="includeExpression" exprAssocType="INCLUDE"/></td>
</tr>
</#if>
<#if !hasExclude>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionExclude}</td>
<td><@CreateExprAssocForm formName="excludeExpression" exprAssocType="EXCLUDE"/></td>
</tr>
</#if>
</#if>
</#if>
<#if !"INTERSECTION.UNION.DIFFERENCE"?contains(temporalExpression.tempExprTypeId)>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="submitBtn" value="${uiLabelMap.CommonSave}"/></td>
</tr>
</form>
</#if>
</table>
<#else>
<#-- Create new expression -->
<@CreateForm "DATE_RANGE" CreateDateRange/>
<hr/>
<@CreateForm "DAY_IN_MONTH" DayInMonth/>
<hr/>
<@CreateForm "DAY_OF_MONTH_RANGE" DayOfMonthRange/>
<hr/>
<@CreateForm "DAY_OF_WEEK_RANGE" DayOfWeekRange/>
<hr/>
<@CreateForm "FREQUENCY" Frequency/>
<hr/>
<@CreateForm "MONTH_RANGE" MonthRange/>
<hr/>
<@CreateForm "TIME_OF_DAY_RANGE" TimeOfDayRange/>
<hr/>
<@CreateForm "INTERSECTION"/>
<hr/>
<@CreateForm "UNION"/>
<hr/>
<@CreateForm "DIFFERENCE"/>
</#if>
<#macro CreateForm expressionTypeId="" formContents=NullMacro>
<form name="${expressionTypeId}" method="post" action="<@ofbizUrl>createTemporalExpression</@ofbizUrl>">
<input type="hidden" name="tempExprTypeId" value="${expressionTypeId}"/>
<table class="basic-table" cellspacing="0">
<#assign mapExpression = "TemporalExpression_" + expressionTypeId/>
<#assign headingText = uiLabelMap[mapExpression]/>
<tr><td colspan="2" class="h2">${headingText}</td></tr>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionId}</td>
<td><input name="tempExprId" type="text" maxlength="20" size="20"/><span class="tooltip">${uiLabelMap.CommonAutoAssignedId}</span></td>
</tr>
<@formContents/>
<tr>
<td>&nbsp;</td>
<td><input type="submit" name="submitBtn" value="${uiLabelMap.CommonSave}"/></td>
</tr>
</table>
</form>
</#macro>
<#macro CreateDateRange>
<@DateRange formName="DATE_RANGE"/>
</#macro>
<#macro CreateExprAssocForm formName="" exprAssocType="">
<form name="${formName}" method="post" action="<@ofbizUrl>createTemporalExpressionAssoc</@ofbizUrl>">
<input type="hidden" name="tempExprId" value="${temporalExpression.tempExprId}"/>
<input type="hidden" name="fromTempExprId" value="${temporalExpression.tempExprId}"/>
<input type="hidden" name="exprAssocType" value="${exprAssocType}"/>
<select name="toTempExprId">
<#list candidateIdList as candidate>
<option value="${candidate}">${candidate}</option>
</#list>
</select>
<input type="submit" name="submitBtn" value="${uiLabelMap.CommonSave}"/>
</form>
</#macro>