Author: adrianc
Date: Wed Jun 10 22:13:07 2009 New Revision: 783550 URL: http://svn.apache.org/viewvc?rev=783550&view=rev Log: Added a lookup screen for time duration. Added an example to the Edit Work Effort screen. Added: ofbiz/trunk/framework/common/webcommon/includes/timeDuration.ftl (with props) Modified: ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml ofbiz/trunk/framework/common/config/CommonUiLabels.xml ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml ofbiz/trunk/framework/common/widget/LookupScreens.xml Modified: ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml?rev=783550&r1=783549&r2=783550&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml (original) +++ ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml Wed Jun 10 22:13:07 2009 @@ -136,11 +136,11 @@ </drop-down> </field> - <field name="estimatedMilliSeconds" position="1"/> - <field name="estimatedSetupMillis" position="2"/> - <field name="actualMilliSeconds" position="1"/> - <field name="actualSetupMillis" position="2"/> - <field name="totalMilliSecondsAllowed" position="1"/> + <field name="estimatedMilliSeconds" position="1"><lookup target-form-name="LookupTimeDuration"/></field> + <field name="estimatedSetupMillis" position="2"><lookup target-form-name="LookupTimeDuration"/></field> + <field name="actualMilliSeconds" position="1"><lookup target-form-name="LookupTimeDuration"/></field> + <field name="actualSetupMillis" position="2"><lookup target-form-name="LookupTimeDuration"/></field> + <field name="totalMilliSecondsAllowed" position="1"><lookup target-form-name="LookupTimeDuration"/></field> <field name="totalMoneyAllowed" position="2"/> <field name="quantityToProduce" position="1"/> Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=783550&r1=783549&r2=783550&view=diff ============================================================================== --- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original) +++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Wed Jun 10 22:13:07 2009 @@ -3710,6 +3710,14 @@ <value xml:lang="zh">æ¹æ³</value> <value xml:lang="zh_CN">æ¹æ³</value> </property> + <property key="CommonMilliSecond"> + <value xml:lang="de">Millisekunde</value> + <value xml:lang="en">Millisecond</value> + <value xml:lang="es">milisegundo</value> + <value xml:lang="fr">millisecondes</value> + <value xml:lang="it">Milli Secondi</value> + <value xml:lang="ro">Milisecunde</value> + </property> <property key="CommonMinute"> <value xml:lang="ar">بدÙØ©</value> <value xml:lang="de">Jede Minute</value> Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml?rev=783550&r1=783549&r2=783550&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/common-controller.xml Wed Jun 10 22:13:07 2009 @@ -143,6 +143,10 @@ <response name="success" type="view" value="geoLocation"/> </request-map> + <request-map uri="LookupTimeDuration"> + <response name="success" type="view" value="LookupTimeDuration"/> + </request-map> + <!-- home/last/current mappings --> <request-map uri="backHome"> <security https="true" auth="true"/> @@ -162,6 +166,7 @@ <view-map name="EventMessages" type="screen" page="component://common/widget/CommonScreens.xml#EventMessages"/> <view-map name="LookupLocales" type="screen" page="component://common/widget/LookupScreens.xml#LookupLocales"/> + <view-map name="LookupTimeDuration" type="screen" page="component://common/widget/LookupScreens.xml#TimeDuration"/> <view-map name="LookupTimezones" type="screen" page="component://common/widget/LookupScreens.xml#LookupTimezones"/> <view-map name="LookupVisualThemes" type="screen" page="component://common/widget/LookupScreens.xml#LookupVisualThemes"/> Added: ofbiz/trunk/framework/common/webcommon/includes/timeDuration.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/timeDuration.ftl?rev=783550&view=auto ============================================================================== --- ofbiz/trunk/framework/common/webcommon/includes/timeDuration.ftl (added) +++ ofbiz/trunk/framework/common/webcommon/includes/timeDuration.ftl Wed Jun 10 22:13:07 2009 @@ -0,0 +1,101 @@ +<#-- +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. +--> +<script language="JavaScript" type="text/javascript"> + function setTimeDuration() { + var years = window.document.getElementsByName("years")[0].value; + var weeks = window.document.getElementsByName("weeks")[0].value; + var days = window.document.getElementsByName("days")[0].value; + var hours = window.document.getElementsByName("hours")[0].value; + var minutes = window.document.getElementsByName("minutes")[0].value; + var seconds = window.document.getElementsByName("seconds")[0].value; + var millis = window.document.getElementsByName("millis")[0].value; + var duration = 0; + duration += years == null ? 0 : years * 31536000000; + duration += weeks == null ? 0 : weeks * 604800000; + duration += days == null ? 0 : days * 86400000; + duration += hours == null ? 0 : hours * 3600000; + duration += minutes == null ? 0 : minutes * 60000; + duration += seconds == null ? 0 : seconds * 1000; + duration += millis == null ? 0 : millis; + set_value(duration); + } +</script> +${(parameters.duration)?if_exists}<br/> +<form name="TimeDuration" action="javascript:setTimeDuration()"> + <table cellspacing="0" class="basic-table"> + <tr> + <td class="label">${uiLabelMap.CommonYear}</td> + <td><input type="text" name="years" size="4" maxlength="4"/></td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonWeek}</td> + <td><input type="text" name="weeks" maxlength="2"/></td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonDay}</td> + <td> + <select name="days"> + <#list 0..7 as days> + <option value="${days}">${days}</option> + </#list> + </select> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonHour}</td> + <td> + <select name="hours"> + <#list 0..23 as hours> + <option value="${hours}">${hours}</option> + </#list> + </select> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonMinute}</td> + <td> + <select name="minutes"> + <#list 0..59 as minutes> + <option value="${minutes}">${minutes}</option> + </#list> + </select> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonSecond}</td> + <td> + <select name="seconds"> + <#list 0..59 as seconds> + <option value="${seconds}">${seconds}</option> + </#list> + </select> + </td> + </tr> + <tr> + <td class="label">${uiLabelMap.CommonMilliSecond}</td> + <td><input type="text" name="millis" maxlength="4"/></td> + </tr> + <tr> + <td> </td> + <td> + <input type="submit" value="${uiLabelMap.CommonSet}"/> + </td> + </tr> + </table> +</form> Propchange: ofbiz/trunk/framework/common/webcommon/includes/timeDuration.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/common/webcommon/includes/timeDuration.ftl ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/framework/common/webcommon/includes/timeDuration.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/framework/common/widget/LookupScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/LookupScreens.xml?rev=783550&r1=783549&r2=783550&view=diff ============================================================================== --- ofbiz/trunk/framework/common/widget/LookupScreens.xml (original) +++ ofbiz/trunk/framework/common/widget/LookupScreens.xml Wed Jun 10 22:13:07 2009 @@ -109,4 +109,24 @@ </section> </screen> + <!-- Time Duration Screen --> + <screen name="TimeDuration"> + <section> + <actions> + <set field="title" value="${uiLabelMap.CommonTime}"/> + </actions> + <widgets> + <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml"> + <decorator-section name="body"> + <platform-specific> + <html> + <html-template location="component://common/webcommon/includes/timeDuration.ftl"/> + </html> + </platform-specific> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + </screens> |
Free forum by Nabble | Edit this page |