Skip to content

Commit

Permalink
A patch from Pierre Smits for "Replace Static["org.ofbiz.base.util.Ut…
Browse files Browse the repository at this point in the history
…ilProperties"].getPropertyValue in .ftl files with EntityUtilProperties variant" https://issues.apache.org/jira/browse/OFBIZ-6884

Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue is used in several .ftl files. 

Replaces with EnittyUtilProperties variant where appropriate.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1728959 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
JacquesLeRoux committed Feb 7, 2016
1 parent 228b2f1 commit 7237624
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions applications/party/webapp/partymgr/party/editcontactmech.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ under the License.

<td>
<select name="countryGeoId" id="editcontactmechform_countryGeoId">
${screens.render("component://common/widget/CommonScreens.xml#countries")}
${screens.render("component://common/widget/CommonScreens.xml#countries")}
<#if (mechMap.postalAddress??) && (mechMap.postalAddress.countryGeoId??)>
<#assign defaultCountryGeoId = mechMap.postalAddress.countryGeoId>
<#else>
<#assign defaultCountryGeoId = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "country.geo.id.default")>
<#assign defaultCountryGeoId = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("general.properties", "country.geo.id.default")>
</#if>
<option selected="selected" value="${defaultCountryGeoId}">
<#assign countryGeo = delegator.findOne("Geo",Static["org.ofbiz.base.util.UtilMisc"].toMap("geoId",defaultCountryGeoId), false)>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ under the License.
<#if (mechMap.postalAddress??) && (mechMap.postalAddress.countryGeoId??)>
<#assign defaultCountryGeoId = mechMap.postalAddress.countryGeoId>
<#else>
<#assign defaultCountryGeoId = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "country.geo.id.default")>
<#assign defaultCountryGeoId = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("general.properties", "country.geo.id.default")>
</#if>
<option selected="selected" value="${defaultCountryGeoId}">
<#assign countryGeo = delegator.findOne("Geo",Static["org.ofbiz.base.util.UtilMisc"].toMap("geoId",defaultCountryGeoId), false)>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ under the License.
var autocomp = [
<#if autocompleteOptions?has_content>
<#if !displayReturnField??>
<#assign displayReturnField = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.displayReturnField")>
<#assign displayReturnField = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.displayReturnField")>
</#if>
<#list autocompleteOptions as autocompleteOption>
{
Expand Down
16 changes: 8 additions & 8 deletions framework/common/webcommon/includes/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ under the License.
</#if>
</div>
</#if>
<#assign jGrowlPosition = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.position")>
<#assign jGrowlWidth = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.width")>
<#assign jGrowlHeight = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.height")>
<#assign jGrowlSpeed = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.speed")>
<#assign jGrowlPosition = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValuee("widget.properties", "widget.jgrowl.position")>
<#assign jGrowlWidth = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.width")>
<#assign jGrowlHeight = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.height")>
<#assign jGrowlSpeed = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.speed")>

<script>showjGrowl("${uiLabelMap.CommonShowAll}","${uiLabelMap.CommonCollapse}", "${uiLabelMap.CommonHideAllNotifications}", "${jGrowlPosition}", "${jGrowlWidth}", "${jGrowlHeight}", "${jGrowlSpeed}");</script>
<#-- display the event messages -->
Expand All @@ -68,10 +68,10 @@ under the License.
</#list>
</#if>
</div>
<#assign jGrowlPosition = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.position")>
<#assign jGrowlWidth = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.width")>
<#assign jGrowlHeight = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.height")>
<#assign jGrowlSpeed = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.speed")>
<#assign jGrowlPosition = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.position")>
<#assign jGrowlWidth = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.width")>
<#assign jGrowlHeight = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.height")>
<#assign jGrowlSpeed = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.jgrowl.speed")>
<script>showjGrowl("${uiLabelMap.CommonShowAll}","${uiLabelMap.CommonCollapse}", "${uiLabelMap.CommonHideAllNotifications}", "${jGrowlPosition}", "${jGrowlWidth}", "${jGrowlHeight}", "${jGrowlSpeed}");</script>
</#if>
</#escape>
16 changes: 8 additions & 8 deletions framework/widget/templates/htmlFormMacroLibrary.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ under the License.
require
/><#t/>
<#if ajaxEnabled?has_content && ajaxEnabled>
<#assign defaultMinLength = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.defaultMinLength")>
<#assign defaultDelay = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.defaultDelay")>
<#assign defaultMinLength = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.defaultMinLength")>
<#assign defaultDelay = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.defaultDelay")>
<script language="JavaScript" type="text/javascript">ajaxAutoCompleter('${ajaxUrl}', false, ${defaultMinLength!2}, ${defaultDelay!300});</script><#lt/>
</#if>
</#macro>
Expand Down Expand Up @@ -640,21 +640,21 @@ Parameter: tabindex, String, optional - HTML tabindex number.
<#local ajaxUrl = id + "," + ajaxUrl + ",ajaxLookup=Y" />
</#if>
<#if (!showDescription?has_content)>
<#local showDescriptionProp = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.lookup.showDescription", "N")>
<#local showDescriptionProp = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.lookup.showDescription", "N")>
<#if "Y" == showDescriptionProp>
<#local showDescription = "true" />
<#else>
<#local showDescription = "false" />
</#if>
</#if>
<#if (!position?has_content)>
<#local position = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.lookup.position", "topleft")>
<#local position = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.lookup.position", "topleft")>
</#if>
<#if (!width?has_content)>
<#local width = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.lookup.width", "620")>
<#local width = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.lookup.width", "620")>
</#if>
<#if (!height?has_content)>
<#local height = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.lookup.height", "500")>
<#local height = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.lookup.height", "500")>
</#if>
<#if ajaxEnabled?has_content && ajaxEnabled>
<script type="text/javascript">
Expand Down Expand Up @@ -691,8 +691,8 @@ Parameter: tabindex, String, optional - HTML tabindex number.
);"></a><#rt>
<#else>
<#if ajaxEnabled?has_content && ajaxEnabled>
<#assign defaultMinLength = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.defaultMinLength")>
<#assign defaultDelay = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.defaultDelay")>
<#assign defaultMinLength = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.defaultMinLength")>
<#assign defaultDelay = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("widget.properties", "widget.autocompleter.defaultDelay")>
<#local ajaxUrl = ajaxUrl + "&amp;_LAST_VIEW_NAME_=" + lastViewName />
<#if !ajaxUrl?contains("searchValueFieldName=")>
<#if descriptionFieldName?has_content && showDescription == "true">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,9 @@ $(function(){
<form method="post" action="<@ofbizUrl>additem</@ofbizUrl>" name="addform" style="margin: 0;">
<fieldset>
<#assign inStock = true />
<#assign commentEnable = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("order.properties", "order.item.comment.enable")>
<#assign commentEnable = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("order.properties", "order.item.comment.enable")>
<#if commentEnable.equals("Y")>
<#assign orderItemAttr = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("order.properties", "order.item.attr.prefix")>
<#assign orderItemAttr = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("order.properties", "order.item.attr.prefix")>
${uiLabelMap.CommonComment}&nbsp;<input type="text" name="${orderItemAttr}comment"/>
</#if>
<#-- Variant Selection -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ under the License.
<#if (postalAddress??) && (postalAddress.countryGeoId??)>
<#assign defaultCountryGeoId = postalAddress.countryGeoId>
<#else>
<#assign defaultCountryGeoId = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "country.geo.id.default")>
<#assign defaultCountryGeoId = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("general.properties", "country.geo.id.default")>
</#if>
<option selected="selected" value="${defaultCountryGeoId}">
<#assign countryGeo = delegator.findOne("Geo",Static["org.ofbiz.base.util.UtilMisc"].toMap("geoId",defaultCountryGeoId), false)>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ will generally always be reserved for the logo at the top of the page.
<@fieldErrors fieldName="CUSTOMER_COUNTRY"/>
<select name="CUSTOMER_COUNTRY" id="newuserform_countryGeoId">
${screens.render("component://common/widget/CommonScreens.xml#countries")}
<#assign defaultCountryGeoId = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "country.geo.id.default")>
<#assign defaultCountryGeoId = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("general.properties", "country.geo.id.default")>
<option selected="selected" value="${defaultCountryGeoId}">
<#assign countryGeo = delegator.findOne("Geo",Static["org.ofbiz.base.util.UtilMisc"].toMap("geoId",defaultCountryGeoId), false)>
${countryGeo.get("geoName",locale)}
Expand Down
4 changes: 2 additions & 2 deletions specialpurpose/ecommerce/webapp/ecommerce/login.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<#assign janrainEnabled = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("ecommerce.properties", "janrain.enabled")>
<#assign appName = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("ecommerce.properties", "janrain.appName")>
<#assign janrainEnabled = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("ecommerce.properties", "janrain.enabled")>
<#assign appName = Static["org.ofbiz.entity.util.EntityUtilProperties"].getPropertyValue("ecommerce.properties", "janrain.appName")>
<#if janrainEnabled == "Y">
<script type="text/javascript">
(function() {
Expand Down

0 comments on commit 7237624

Please sign in to comment.