svn commit: r1199682 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1199682 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy

hansbak-2
Author: hansbak
Date: Wed Nov  9 10:11:24 2011
New Revision: 1199682

URL: http://svn.apache.org/viewvc?rev=1199682&view=rev
Log:
on invoice and orderheader, show logo properly either from party content or party info

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy

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=1199682&r1=1199681&r2=1199682&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 Wed Nov  9 10:11:24 2011
@@ -27,6 +27,7 @@ import org.ofbiz.entity.util.*;
 import org.ofbiz.party.contact.*;
 import org.ofbiz.order.order.OrderReadHelper;
 import java.sql.Timestamp;
+import org.ofbiz.party.content.PartyContentWrapper;
 
 orderHeader = parameters.orderHeader;
 orderId = parameters.orderId;
@@ -118,8 +119,17 @@ if (!partyId) {
 
 // the logo
 partyGroup = delegator.findByPrimaryKey("PartyGroup", [partyId : partyId]);
-if (partyGroup?.logoImageUrl) {
-    logoImageUrl = partyGroup.logoImageUrl;
+if (partyGroup) {
+    partyContentWrapper = new PartyContentWrapper(partyGroup, request);
+    partyContent = partyContentWrapper.getFirstPartyContentByType(partyGroup.partyId , partyGroup, "LGOIMGURL", delegator);
+    if (partyContent) {
+        logoImageUrl = "/content/control/stream?contentId="+partyContent.contentId;
+    }
+}
+if(logoImageUrl == null){
+    if (partyGroup?.logoImageUrl) {
+        logoImageUrl = partyGroup.logoImageUrl;
+    }
 }
 context.logoImageUrl = logoImageUrl;