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:30:15 UTC
svn commit: r1576378 - in /ofbiz/trunk/applications/marketing:
webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy
widget/MarketingReportScreens.xml
Author: jleroux
Date: Tue Mar 11 15:30:15 2014
New Revision: 1576378
URL: http://svn.apache.org/r1576378
Log:
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/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy
ofbiz/trunk/applications/marketing/widget/MarketingReportScreens.xml
Modified: ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy?rev=1576378&r1=1576377&r2=1576378&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy (original)
+++ ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy Tue Mar 11 15:30:15 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/trunk/applications/marketing/widget/MarketingReportScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/MarketingReportScreens.xml?rev=1576378&r1=1576377&r2=1576378&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/MarketingReportScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/MarketingReportScreens.xml Tue Mar 11 15:30:15 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>