Author: jleroux
Date: Thu Apr 24 11:35:44 2014
New Revision: 1589669
URL: http://svn.apache.org/r1589669
Log:
A patch from Deepak Dixit for "Scale logo to fit content area in PDF which are
based on simple decorator" https://issues.apache.org/jira/browse/OFBIZ-5006
Now logo image will be display over order pdf. Default value set in fop
decorator not working properly, global set to true, Also added check in company
header groovy, if logoImageUrl found in groovy then only set to context else
default will be used.
Also set the logo width in company header fo.ftl as if logo image is large then
it will throw warning related to content overflow on console.
Modified:
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy
ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl
ofbiz/trunk/framework/common/webcommon/error.fo.ftl
ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl
ofbiz/trunk/framework/common/widget/CommonScreens.xml
Modified:
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy?rev=1589669&r1=1589668&r2=1589669&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy
(original)
+++
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy
Thu Apr 24 11:35:44 2014
@@ -130,7 +130,10 @@ if (partyGroup) {
}
}
}
-context.logoImageUrl = logoImageUrl;
+//If logoImageUrl not null then only set it to context else it will override
the default value "/images/ofbiz_powered.gif"
+if (logoImageUrl) {
+ context.logoImageUrl = logoImageUrl;
+}
// the company name
companyName = "Default Company";
Modified:
ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl?rev=1589669&r1=1589668&r2=1589669&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl
(original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl
Thu Apr 24 11:35:44 2014
@@ -19,7 +19,7 @@ under the License.
<#escape x as x?xml>
<fo:block text-align="left">
- <#if logoImageUrl?has_content><fo:external-graphic
src="<@ofbizContentUrl>${logoImageUrl}</@ofbizContentUrl>" overflow="hidden"
height="40px" content-height="scale-to-fit"/></#if>
+ <#if logoImageUrl?has_content><fo:external-graphic
src="<@ofbizContentUrl>${logoImageUrl}</@ofbizContentUrl>" overflow="hidden"
height="40px" content-height="scale-to-fit" content-width="2.00in"/></#if>
</fo:block>
<fo:block font-size="8pt">
Modified: ofbiz/trunk/framework/common/webcommon/error.fo.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/error.fo.ftl?rev=1589669&r1=1589668&r2=1589669&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/error.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/error.fo.ftl Thu Apr 24 11:35:44 2014
@@ -56,7 +56,7 @@ under the License.
<fo:table-cell>
<#if logoImageUrl?exists>
<fo:block>
- <fo:external-graphic src="${logoImageUrl}"
overflow="hidden" height="40px"/>
+ <fo:external-graphic src="${logoImageUrl}"
overflow="hidden" height="40px" content-height="scale-to-fit"/>
</fo:block>
</#if>
</fo:table-cell>
Modified: ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl?rev=1589669&r1=1589668&r2=1589669&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/simple.fo.ftl Thu Apr 24
11:35:44 2014
@@ -56,7 +56,7 @@ under the License.
<fo:table-cell>
<fo:block>
<#if logoImageUrl?exists>
- <fo:external-graphic src="${logoImageUrl}"
overflow="hidden" height="40px"/>
+ <fo:external-graphic src="${logoImageUrl}"
overflow="hidden" height="40px" content-height="scale-to-fit"/>
</#if>
</fo:block>
</fo:table-cell>
Modified: ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=1589669&r1=1589668&r2=1589669&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/common/widget/CommonScreens.xml Thu Apr 24 11:35:44
2014
@@ -511,7 +511,7 @@ under the License.
<section>
<actions>
<property-map resource="CommonUiLabels" map-name="uiLabelMap"
global="true"/>
- <set field="logoImageUrl" value="/images/ofbiz_logo.gif"/>
+ <set field="logoImageUrl" value="/images/ofbiz_logo.gif"
global="true"/>
<property-to-field resource="fop.properties"
field="defaultFontFamily" property="fop.font.family" default="Arial"/>
</actions>
<widgets>