You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/03/11 16:33:11 UTC

svn commit: r1576381 - in /ofbiz/branches/release12.04: ./ applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy applications/marketing/widget/MarketingReportScreens.xml

Author: jleroux
Date: Tue Mar 11 15:33:10 2014
New Revision: 1576381

URL: http://svn.apache.org/r1576381
Log:
"Applied fix from trunk for revision: 1576378  " 
------------------------------------------------------------------------
r1576378 | jleroux | 2014-03-11 16:30:15 +0100 (mar. 11 mars 2014) | 13 lignes

Fix a bug reported by Rong Nguyen "Tracking code report in Marketing doesn't work" https://issues.apache.org/jira/browse/OFBIZ-5556

I did not use Rong's proposed patch
The problem was simple and due to an error I made in r703816. 
I then replaced
-if (trackingCodeIdStr && !(trackingCodeIdStr.equals(""))) {
by
+if (trackingCodeIdSt) {
which was wrong
Then trying to fix an error reported somewhere (not mentioned) Hans went in a wrong direction with r761539+761541

So I reverted r761539+761541 and fixed the issue above in a clean way by setting the field in the calling screen. This way there are no possible issues with i10n and NPEs.

------------------------------------------------------------------------


Modified:
    ofbiz/branches/release12.04/   (props changed)
    ofbiz/branches/release12.04/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy
    ofbiz/branches/release12.04/applications/marketing/widget/MarketingReportScreens.xml

Propchange: ofbiz/branches/release12.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1576378

Modified: ofbiz/branches/release12.04/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy?rev=1576381&r1=1576380&r2=1576381&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy (original)
+++ ofbiz/branches/release12.04/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy Tue Mar 11 15:33:10 2014
@@ -24,23 +24,22 @@ import org.ofbiz.entity.condition.Entity
 import org.ofbiz.entity.condition.EntityConditionList
 import org.ofbiz.marketing.report.ReportHelper
 
-trackingCodeIdStr = request.getParameter("trackingCodeId");
 // query for both number of visits and number of orders
 
 visitConditionList = [] as LinkedList;
 orderConditionList = [] as LinkedList;
 
-if (parameters.fromDate) {
-    visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, parameters.fromDate));
-    orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, parameters.fromDate));
+if (fromDate) {
+    visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
+    orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate));
 }
-if (parameters.thruDate) {
-     visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, parameters.thruDate));
-     orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, parameters.thruDate));
+if (thruDate) {
+     visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate));
+     orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate));
 }
-if (parameters.trackingCodeId) {
-     visitConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, parameters.trackingCodeId));
-     orderConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, parameters.trackingCodeId));
+if (trackingCodeId) {
+     visitConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeId));
+     orderConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeId));
 }
 
 visitConditions = EntityCondition.makeCondition(visitConditionList, EntityOperator.AND);

Modified: ofbiz/branches/release12.04/applications/marketing/widget/MarketingReportScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release12.04/applications/marketing/widget/MarketingReportScreens.xml?rev=1576381&r1=1576380&r2=1576381&view=diff
==============================================================================
--- ofbiz/branches/release12.04/applications/marketing/widget/MarketingReportScreens.xml (original)
+++ ofbiz/branches/release12.04/applications/marketing/widget/MarketingReportScreens.xml Tue Mar 11 15:33:10 2014
@@ -86,6 +86,7 @@ under the License.
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="fromDate" from-field="requestParameters.fromDate" type="Timestamp"/>
                 <set field="thruDate" from-field="requestParameters.thruDate" type="Timestamp"/>
+                <set field="trackingCodeId" from-field="requestParameters.trackingCodeId"/>
                 <script location="component://marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy"/>
             </actions>
             <widgets>