Files
ofbiz-framework/framework/webtools/template/tempexpr/TempExprMacros.ftl
T
Nicolas Malin aec57b51c5 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Third step, move macro ftl libraries and ftl template present on framework common to common theme
At this step, the common-theme is forced like the common component previously.

Main common screens present on CommonScreens.xml, LookupScreens.xml and HelpScreens.xml are moved to common screen with a forced rewrite to common-theme 
Warning this commit is going to follow with a other commit for CommonScreens.xml because LookupScreens.xml and HelpScreens.xml are recreated on common-theme, but to keep the history of CommonScreens.xml it was moved entirely, the second commit restore it with redirect call.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806091 13f79535-47bb-0310-9956-ffa450edef68
2017-08-24 21:55:06 +00:00

178 lines
6.1 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.
-->
<#--
To use these macros in your template, insert the following line in
your template file:
<#include "component://common-theme/template/includes/empExprMacros.ftl"/>
-->
<#include "component://common-theme/template/includes/CommonMacros.ftl"/>
<#assign
occurrenceList = Static["org.apache.ofbiz.service.calendar.ExpressionUiHelper"].getOccurrenceList()
frequencyTypeList = Static["org.apache.ofbiz.service.calendar.ExpressionUiHelper"].getFrequencyValueList(uiLabelMap)
firstDayOfWeek = Static["org.apache.ofbiz.service.calendar.ExpressionUiHelper"].getFirstDayOfWeek(locale)
lastDayOfWeek = Static["org.apache.ofbiz.service.calendar.ExpressionUiHelper"].getLastDayOfWeek(locale)
/>
<#macro DateRange formName="" fromDate="" toDate="">
<tr>
<td class="label">${uiLabelMap.CommonFrom}</td>
<td>
<@DateField formName=formName fieldName="dateRange1" fieldValue=fromDate/>
</td>
</tr>
<tr>
<td class="label">${uiLabelMap.CommonTo}</td>
<td>
<@DateField formName=formName fieldName="dateRange2" fieldValue=toDate/>
</td>
</tr>
</#macro>
<#macro DayInMonth occurrence=0 day=firstDayOfWeek>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionOccurrence}</td>
<td>
<select name="integer2">
<#list 1..5 as i>
<option value="${i}"<#if i == occurrence> selected="selected"</#if>>${i}</option>
</#list>
<#list -1..-5 as i>
<option value="${i}"<#if i == occurrence> selected="selected"</#if>>${i}</option>
</#list>
</select>
</td>
</tr>
<tr>
<td class="label">${uiLabelMap.CommonDay}</td>
<td><@DayOfWeekField fieldName="integer1" fieldValue=day/></td>
</tr>
</#macro>
<#macro DayOfMonthRange fromDay=1 toDay=31>
<tr>
<td class="label">${uiLabelMap.CommonFrom}</td>
<td><@DayOfMonthField fieldName="integer1" fieldValue=fromDay/></td>
</tr>
<tr>
<td class="label">${uiLabelMap.CommonTo}</td>
<td><@DayOfMonthField fieldName="integer2" fieldValue=toDay/></td>
</tr>
</#macro>
<#macro HourOfDayRange fromHour=1 toHour=23>
<tr>
<td class="label">${uiLabelMap.CommonFrom}</td>
<td><@HourOfDayField fieldName="integer1" fieldValue=fromHour/></td>
</tr>
<tr>
<td class="label">${uiLabelMap.CommonTo}</td>
<td><@HourOfDayField fieldName="integer2" fieldValue=toHour/></td>
</tr>
</#macro>
<#macro DayOfWeekRange fromDay=firstDayOfWeek toDay=lastDayOfWeek>
<tr>
<td class="label">${uiLabelMap.CommonFrom}</td>
<td><@DayOfWeekField fieldName="integer1" fieldValue=fromDay/></td>
</tr>
<tr>
<td class="label">${uiLabelMap.CommonTo}</td>
<td><@DayOfWeekField fieldName="integer2" fieldValue=toDay/></td>
</tr>
</#macro>
<#macro Frequency formName="" fromDate="" freqType=-1 freqValue=0>
<tr>
<td class="label">${uiLabelMap.CommonFrom}</td>
<td>
<@DateField formName=formName fieldName="dateFreq1" fieldValue=fromDate/>
</td>
</tr>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionFreqType}</td>
<td>
<select name="integer1">
<#list frequencyTypeList as freqTypeItem>
<option value="${freqTypeItem.value}"<#if freqTypeItem.value == freqType> selected="selected"</#if>>${freqTypeItem.description}</option>
</#list>
</select>
</td>
</tr>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionFreqCount}</td>
<td>
<select name="integer2">
<#list 1..50 as i>
<option value="${i}"<#if i == freqValue> selected="selected"</#if>>${i}</option>
</#list>
</select>
</td>
</tr>
</#macro>
<#macro MinuteRange fromMinute=1 toMinute=59>
<tr>
<td class="label">${uiLabelMap.CommonFrom}</td>
<td><@MinuteField fieldName="integer1" fieldValue=fromMinute/></td>
</tr>
<tr>
<td class="label">${uiLabelMap.CommonTo}</td>
<td><@MinuteField fieldName="integer2" fieldValue=toMinute/></td>
</tr>
</#macro>
<#macro MonthRange fromMonth=0 toMonth=11>
<tr>
<td class="label">${uiLabelMap.CommonFrom}</td>
<td><@MonthField fieldName="integer1" fieldValue=fromMonth/></td>
</tr>
<tr>
<td class="label">${uiLabelMap.CommonTo}</td>
<td><@MonthField fieldName="integer2" fieldValue=toMonth/></td>
</tr>
</#macro>
<#macro TimeOfDayRange fromTime="" toTime="" freqType=11 freqValue=1>
<tr>
<td class="label">${uiLabelMap.CommonFrom}</td>
<td><input type="text" name="string1" value="${fromTime}" maxlength="8" size="8"/><span class="tooltip">${uiLabelMap.TemporalExpressionTimeFormat}</span></td>
</tr>
<tr>
<td class="label">${uiLabelMap.CommonTo}</td>
<td><input type="text" name="string2" value="${toTime}" maxlength="8" size="8"/><span class="tooltip">${uiLabelMap.TemporalExpressionTimeFormat}</span></td>
</tr>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionFreqType}</td>
<td>
<select name="integer1">
<option value="13"<#if freqType == 13> selected="selected"</#if>>${uiLabelMap.CommonSecond}</option>
<option value="12"<#if freqType == 12> selected="selected"</#if>>${uiLabelMap.CommonMinute}</option>
<option value="11"<#if freqType == 11> selected="selected"</#if>>${uiLabelMap.CommonHour}</option>
</select>
</td>
</tr>
<tr>
<td class="label">${uiLabelMap.TemporalExpressionFreqCount}</td>
<td><input type="text" name="integer2" value="${freqValue}" maxlength="8" size="8"/></td>
</tr>
</#macro>