You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2008/06/13 23:09:54 UTC
svn commit: r667653 - in /ofbiz/trunk/applications/marketing:
webapp/marketing/WEB-INF/actions/reports/ webapp/sfa/WEB-INF/action/
widget/ widget/sfa/
Author: mrisaliti
Date: Fri Jun 13 14:09:53 2008
New Revision: 667653
URL: http://svn.apache.org/viewvc?rev=667653&view=rev
Log:
Converted some marketing bsh scripts to groovy (Part of issue OFBIZ-1801)
Added:
ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy
- copied, changed from r667620, ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.bsh
ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy
- copied, changed from r667620, ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.bsh
ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy
- copied, changed from r667620, ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh
ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy
- copied, changed from r667620, ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh
Removed:
ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.bsh
ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.bsh
ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh
ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh
Modified:
ofbiz/trunk/applications/marketing/widget/MarketingReportScreens.xml
ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml
ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml
Copied: ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy (from r667620, ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy?p2=ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy&p1=ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.bsh&r1=667620&r2=667653&rev=667653&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.bsh (original)
+++ ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy Fri Jun 13 14:09:53 2008
@@ -17,35 +17,31 @@
* under the License.
*/
-import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.GenericDelegator;
-import org.ofbiz.entity.GenericEntityException;
-import org.ofbiz.entity.transaction.TransactionUtil;
-import org.ofbiz.entity.util.EntityListIterator;
-import org.ofbiz.entity.condition.EntityOperator;
-import org.ofbiz.entity.condition.EntityExpr;
-import org.ofbiz.entity.condition.EntityConditionList;
-import org.ofbiz.marketing.report.ReportHelper;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.Debug;
+import org.ofbiz.entity.transaction.TransactionUtil
+import org.ofbiz.entity.util.EntityListIterator
+import org.ofbiz.entity.condition.EntityOperator
+import org.ofbiz.entity.condition.EntityExpr
+import org.ofbiz.entity.condition.EntityCondition
+import org.ofbiz.entity.condition.EntityConditionList
+import org.ofbiz.marketing.report.ReportHelper
//query for both number of visits and number of orders
marketingCampaignId = request.getParameter("marketingCampaignId");
fromDateStr = request.getParameter("fromDate");
thruDateStr = request.getParameter("thruDate");
-visitConditionList = new LinkedList();
-orderConditionList = new LinkedList();
+visitConditionList = [] as LinkedList;
+orderConditionList = [] as LinkedList;
-if ((fromDateStr != null) && !(fromDateStr.equals(""))) {
+if (fromDateStr && !(fromDateStr.equals(""))) {
visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDateStr));
- orderConditionList.add(EntityCondition.makeCondition("orderDate",EntityOperator.GREATER_THAN_EQUAL_TO,fromDateStr));
+ orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDateStr));
}
-if ((thruDateStr != null) && !(thruDateStr.equals(""))) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate",EntityOperator.LESS_THAN_EQUAL_TO,thruDateStr));
- orderConditionList.add(EntityCondition.makeCondition("orderDate",EntityOperator.LESS_THAN_EQUAL_TO,thruDateStr));
+if (thruDateStr && !(thruDateStr.equals(""))) {
+ visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDateStr));
+ orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDateStr));
}
-if ((marketingCampaignId != null) && !(marketingCampaignId.equals(""))) {
+if (marketingCampaignId && !(marketingCampaignId.equals(""))) {
visitConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId));
orderConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId));
}
@@ -53,9 +49,9 @@
visitConditions = EntityCondition.makeCondition(visitConditionList, EntityOperator.AND);
orderConditions = EntityCondition.makeCondition(orderConditionList, EntityOperator.AND);
-visits = delegator.findList("MarketingCampaignAndVisit", visitConditions, UtilMisc.toSet("marketingCampaignId", "visitId"), UtilMisc.toList("marketingCampaignId"), null, false);
-orders = delegator.findList("MarketingCampaignAndOrderHeader", orderConditions, UtilMisc.toSet("marketingCampaignId", "orderId", "grandTotal"), UtilMisc.toList("marketingCampaignId"), null, false);
+visits = delegator.findList("MarketingCampaignAndVisit", visitConditions, ['marketingCampaignId', 'visitId'] as Set, ['marketingCampaignId'], null, false);
+orders = delegator.findList("MarketingCampaignAndOrderHeader", orderConditions, ['marketingCampaignId', 'orderId', 'grandTotal'] as Set, ['marketingCampaignId'], null, false);
//use this helper to build a List of visits, orders, order totals, and conversion rates
marketingCampaignVisitAndOrders = ReportHelper.calcConversionRates(visits, orders, "marketingCampaignId");
-context.put("marketingCampaignVisitAndOrders", marketingCampaignVisitAndOrders);
+context.marketingCampaignVisitAndOrders = marketingCampaignVisitAndOrders;
\ No newline at end of file
Copied: ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy (from r667620, ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy?p2=ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy&p1=ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.bsh&r1=667620&r2=667653&rev=667653&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.bsh (original)
+++ ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy Fri Jun 13 14:09:53 2008
@@ -17,16 +17,12 @@
* under the License.
*/
-import org.ofbiz.entity.GenericValue;
-import org.ofbiz.entity.GenericDelegator;
-import org.ofbiz.entity.GenericEntityException;
-import org.ofbiz.entity.transaction.TransactionUtil;
-import org.ofbiz.entity.condition.EntityOperator;
-import org.ofbiz.entity.condition.EntityExpr;
-import org.ofbiz.entity.condition.EntityConditionList;
-import org.ofbiz.marketing.report.ReportHelper;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.base.util.Debug;
+import org.ofbiz.entity.transaction.TransactionUtil
+import org.ofbiz.entity.condition.EntityOperator
+import org.ofbiz.entity.condition.EntityExpr
+import org.ofbiz.entity.condition.EntityCondition
+import org.ofbiz.entity.condition.EntityConditionList
+import org.ofbiz.marketing.report.ReportHelper
trackingCodeIdStr = request.getParameter("trackingCodeId");
fromDateStr = request.getParameter("fromDate");
@@ -34,18 +30,18 @@
// query for both number of visits and number of orders
-visitConditionList = new LinkedList();
-orderConditionList = new LinkedList();
+visitConditionList = [] as LinkedList;
+orderConditionList = [] as LinkedList;
-if ((fromDateStr != null) && !(fromDateStr.equals(""))) {
+if (fromDateStr && !(fromDateStr.equals(""))) {
visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDateStr));
- orderConditionList.add(EntityCondition.makeCondition("orderDate",EntityOperator.GREATER_THAN_EQUAL_TO,fromDateStr));
+ orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDateStr));
}
-if ((thruDateStr != null) && !(thruDateStr.equals(""))) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate",EntityOperator.LESS_THAN_EQUAL_TO,thruDateStr));
- orderConditionList.add(EntityCondition.makeCondition("orderDate",EntityOperator.LESS_THAN_EQUAL_TO,thruDateStr));
+if (thruDateStr && !(thruDateStr.equals(""))) {
+ visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDateStr));
+ orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDateStr));
}
-if ((trackingCodeIdStr != null) && !(trackingCodeIdStr.equals(""))) {
+if (trackingCodeIdStr && !(trackingCodeIdStr.equals(""))) {
visitConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeIdStr));
orderConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeIdStr));
}
@@ -53,9 +49,9 @@
visitConditions = EntityCondition.makeCondition(visitConditionList, EntityOperator.AND);
orderConditions = EntityCondition.makeCondition(orderConditionList, EntityOperator.AND);
-visits = delegator.findList("TrackingCodeAndVisit", visitConditions, UtilMisc.toSet("trackingCodeId", "visitId"), UtilMisc.toList("trackingCodeId"), null, false);
-orders = delegator.findList("TrackingCodeAndOrderHeader", orderConditions, UtilMisc.toSet("trackingCodeId", "orderId", "grandTotal"), UtilMisc.toList("trackingCodeId"), null, false);
+visits = delegator.findList("TrackingCodeAndVisit", visitConditions, ['trackingCodeId', 'visitId'] as Set, ['trackingCodeId'], null, false);
+orders = delegator.findList("TrackingCodeAndOrderHeader", orderConditions, ['trackingCodeId', 'orderId', 'grandTotal'] as Set, ['trackingCodeId'], null, false);
// use this helper to build a List of visits, orders, order totals, and conversion rates
trackingCodeVisitAndOrders = ReportHelper.calcConversionRates(visits, orders, "trackingCodeId");
-context.put("trackingCodeVisitAndOrders", trackingCodeVisitAndOrders);
+context.trackingCodeVisitAndOrders = trackingCodeVisitAndOrders;
\ No newline at end of file
Copied: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy (from r667620, ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy?p2=ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy&p1=ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh&r1=667620&r2=667653&rev=667653&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh (original)
+++ ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy Fri Jun 13 14:09:53 2008
@@ -17,77 +17,77 @@
* under the License.
*/
-import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.entity.util.EntityUtil;
-import org.ofbiz.party.contact.ContactHelper;
+import org.ofbiz.entity.util.EntityUtil
+import org.ofbiz.entity.condition.EntityCondition
+import org.ofbiz.party.contact.ContactHelper
-partyId = parameters.get("partyId");
-if(UtilValidate.isNotEmpty(partyId)) {
- party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false);
+partyId = parameters.partyId;
+if (partyId) {
+ party = delegator.findOne("Party", [partyId : partyId], false);
person = party.getRelatedOne("Person");
- contactDetailMap = UtilMisc.toMap("partyId", partyId, "firstName", person.get("firstName"), "lastName", person.get("lastName"), "suffix", person.get("suffix"));
- partyRelationship = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", UtilMisc.toMap("partyIdTo", partyId,
- "roleTypeIdTo", "EMPLOYEE", "roleTypeIdFrom", "LEAD", "partyRelationshipTypeId", "EMPLOYMENT"), UtilMisc.toList("-fromDate"))));
- if(UtilValidate.isNotEmpty(partyRelationship)) {
- contactDetailMap.put("title", partyRelationship.get("positionTitle"));
- partyGroup = delegator.findOne("PartyGroup", UtilMisc.toMap("partyId", partyRelationship.get("partyIdFrom")), false);
- if(UtilValidate.isNotEmpty(partyGroup)) {
- if(UtilValidate.isNotEmpty(partyGroup.get("groupName"))) {
- contactDetailMap.put("groupName", partyGroup.get("groupName"));
+ contactDetailMap = [partyId : partyId, firstName : person.firstName, lastName : person.lastName, suffix : person.suffix];
+ partyRelationship = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findList("PartyRelationship",
+ EntityCondition.makeCondition([partyIdTo : partyId, roleTypeIdTo : 'EMPLOYEE', roleTypeIdFrom : 'LEAD', partyRelationshipTypeId : 'EMPLOYMENT']),
+ null, ['-fromDate'], null, false)));
+ if (partyRelationship) {
+ contactDetailMap.title = partyRelationship.positionTitle;
+ partyGroup = delegator.findOne("PartyGroup", [partyId : partyRelationship.partyIdFrom], false);
+ if (partyGroup) {
+ if (partyGroup.groupName) {
+ contactDetailMap.groupName = partyGroup.groupName;
}
- if(UtilValidate.isNotEmpty(partyGroup.get("officeSiteName"))) {
- contactDetailMap.put("officeSiteName", partyGroup.get("officeSiteName"));
+ if (partyGroup.officeSiteName) {
+ contactDetailMap.officeSiteName = partyGroup.officeSiteName;
}
- if(UtilValidate.isNotEmpty(partyGroup.get("numEmployees"))) {
- contactDetailMap.put("numEmployees", partyGroup.get("numEmployees"));
+ if (partyGroup.numEmployees) {
+ contactDetailMap.numEmployees = partyGroup.numEmployees;
}
}
}
generalContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "GENERAL_LOCATION", "POSTAL_ADDRESS", false));
- if(UtilValidate.isNotEmpty(generalContactMech)) {
- contactDetailMap.put("addrContactMechId", generalContactMech.get("contactMechId"));
+ if (generalContactMech) {
+ contactDetailMap.addrContactMechId = generalContactMech.contactMechId;
postalAddress = generalContactMech.getRelatedOne("PostalAddress");
- if(UtilValidate.isNotEmpty(postalAddress)) {
- contactDetailMap.put("address1", postalAddress.get("address1"));
- contactDetailMap.put("city", postalAddress.get("city"));
- contactDetailMap.put("stateProvinceGeoId", postalAddress.get("stateProvinceGeoId"));
- contactDetailMap.put("countryGeoId", postalAddress.get("countryGeoId"));
- contactDetailMap.put("postalCode", postalAddress.get("postalCode"));
- address2 = postalAddress.get("address2");
- if(UtilValidate.isNotEmpty(address2)) {
- contactDetailMap.put("address2", address2);
+ if (postalAddress) {
+ contactDetailMap.address1 = postalAddress.address1;
+ contactDetailMap.city = postalAddress.city;
+ contactDetailMap.stateProvinceGeoId = postalAddress.stateProvinceGeoId;
+ contactDetailMap.countryGeoId = postalAddress.countryGeoId;
+ contactDetailMap.postalCode = postalAddress.postalCode;
+ address2 = postalAddress.address2;
+ if (address2) {
+ contactDetailMap.address2 = address2;
}
}
}
emailContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false));
- if(UtilValidate.isNotEmpty(emailContactMech)) {
- contactDetailMap.put("emailAddress", emailContactMech.get("infoString"));
- contactDetailMap.put("emailContactMechId", emailContactMech.get("contactMechId"));
+ if (emailContactMech) {
+ contactDetailMap.emailAddress = emailContactMech.infoString;
+ contactDetailMap.emailContactMechId = emailContactMech.contactMechId;
}
phoneContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "PRIMARY_PHONE", "TELECOM_NUMBER", false));
- if(UtilValidate.isNotEmpty(phoneContactMech)) {
- contactDetailMap.put("phoneContactMechId", phoneContactMech.get("contactMechId"));
+ if (phoneContactMech) {
+ contactDetailMap.phoneContactMechId = phoneContactMech.contactMechId;
telecomNumber = phoneContactMech.getRelatedOne("TelecomNumber");
- if(UtilValidate.isNotEmpty(telecomNumber)) {
- countryCode = telecomNumber.get("countryCode");
- if(UtilValidate.isNotEmpty(countryCode)) {
- contactDetailMap.put("countryCode", countryCode);
- }
- areaCode = telecomNumber.get("areaCode");
- if(UtilValidate.isNotEmpty(areaCode)) {
- contactDetailMap.put("areaCode", areaCode);
- }
- contactNumber = telecomNumber.get("contactNumber");
- if(UtilValidate.isNotEmpty(contactNumber)) {
- contactDetailMap.put("contactNumber", contactNumber);
+ if (telecomNumber) {
+ countryCode = telecomNumber.countryCode;
+ if (countryCode) {
+ contactDetailMap.countryCode = countryCode;
+ }
+ areaCode = telecomNumber.areaCode;
+ if (areaCode) {
+ contactDetailMap.areaCode = areaCode;
+ }
+ contactNumber = telecomNumber.contactNumber;
+ if (contactNumber) {
+ contactDetailMap.contactNumber = contactNumber;
}
}
}
partyDataSource = EntityUtil.getFirst(party.getRelated("PartyDataSource"));
- if(UtilValidate.isNotEmpty(partyDataSource)) {
+ if (partyDataSource) {
dataSource = partyDataSource.getRelatedOne("DataSource");
- contactDetailMap.put("leadSource", dataSource.get("description"));
+ contactDetailMap.leadSource = dataSource.description;
}
}
-context.put("contactDetailMap", contactDetailMap);
\ No newline at end of file
+context.contactDetailMap = contactDetailMap;
\ No newline at end of file
Copied: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy (from r667620, ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh)
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy?p2=ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy&p1=ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh&r1=667620&r2=667653&rev=667653&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh (original)
+++ ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy Fri Jun 13 14:09:53 2008
@@ -17,67 +17,63 @@
* under the License.
*/
-import org.ofbiz.base.util.UtilValidate;
-import org.ofbiz.base.util.UtilMisc;
-import org.ofbiz.entity.util.EntityUtil;
-import javolution.util.FastList;
-import org.ofbiz.party.contact.ContactHelper;
+import org.ofbiz.entity.util.EntityUtil
+import org.ofbiz.party.contact.ContactHelper
-FastList contactInfoList=FastList.newInstance();
-partyIdFrom = parameters.get("partyIdFrom");
-partyIdTo = parameters.get("partyIdTo");
-if(UtilValidate.isNotEmpty(partyIdFrom) && UtilValidate.isNotEmpty(partyIdTo)) {
- partyList = UtilMisc.toList(partyIdTo, partyIdFrom);
- partyListItr = partyList.iterator();
- while (partyListItr.hasNext()) {
- partyId = partyListItr.next();
- party = delegator.findOne("Party", UtilMisc.toMap("partyId", partyId), false);
+contactInfoList = [];
+partyIdFrom = parameters.partyIdFrom;
+partyIdTo = parameters.partyIdTo;
+
+if (partyIdFrom && partyIdTo) {
+ partyList = [partyIdTo, partyIdFrom];
+ partyList.each { partyId ->
+ party = delegator.findOne("Party", [partyId : partyId], false);
person = party.getRelatedOne("Person");
- contactDetailMap = UtilMisc.toMap("partyId", partyId, "firstName", person.get("firstName"), "lastName", person.get("lastName"));
+ contactDetailMap = [partyId : partyId, firstName : person.firstName, lastName : person.lastName];
generalContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "GENERAL_LOCATION", "POSTAL_ADDRESS", false));
- if(UtilValidate.isNotEmpty(generalContactMech)) {
- contactDetailMap.put("addrContactMechId", generalContactMech.get("contactMechId"));
+ if (generalContactMech) {
+ contactDetailMap.addrContactMechId = generalContactMech.contactMechId;
postalAddress = generalContactMech.getRelatedOne("PostalAddress");
- if(UtilValidate.isNotEmpty(postalAddress)) {
- contactDetailMap.put("address1", postalAddress.get("address1"));
- contactDetailMap.put("city", postalAddress.get("city"));
- address2 = postalAddress.get("address2");
- if(UtilValidate.isNotEmpty(address2)) {
- contactDetailMap.put("address2", address2);
+ if (postalAddress) {
+ contactDetailMap.address1 = postalAddress.address1;
+ contactDetailMap.city = postalAddress.city;
+ address2 = postalAddress.address2;
+ if (address2) {
+ contactDetailMap.address2 = address2;
}
- geo = delegator.findOne("Geo", UtilMisc.toMap("geoId", postalAddress.get("stateProvinceGeoId")), false);
- contactDetailMap.put("state", geo.get("geoName"));
+ geo = delegator.findOne("Geo", [geoId : postalAddress.stateProvinceGeoId], false);
+ contactDetailMap.state = geo.geoName;
- geo = delegator.findOne("Geo", UtilMisc.toMap("geoId", postalAddress.get("countryGeoId")), false);
- contactDetailMap.put("country", geo.get("geoName"));
+ geo = delegator.findOne("Geo", [geoId : postalAddress.countryGeoId], false);
+ contactDetailMap.country = geo.geoName;
}
}
emailContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false));
- if(UtilValidate.isNotEmpty(emailContactMech)) {
- contactDetailMap.put("primaryEmail", emailContactMech.get("infoString"));
- contactDetailMap.put("emailContactMechId", emailContactMech.get("contactMechId"));
+ if (emailContactMech) {
+ contactDetailMap.primaryEmail = emailContactMech.infoString;
+ contactDetailMap.emailContactMechId = emailContactMech.contactMechId;
}
phoneContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_PHONE", "TELECOM_NUMBER", false));
- if(UtilValidate.isNotEmpty(phoneContactMech)) {
- contactDetailMap.put("phoneContactMechId", phoneContactMech.get("contactMechId"));
+ if (phoneContactMech) {
+ contactDetailMap.phoneContactMechId = phoneContactMech.contactMechId;
telecomNumber = phoneContactMech.getRelatedOne("TelecomNumber");
- if(UtilValidate.isNotEmpty(telecomNumber)) {
- countryCode = telecomNumber.get("countryCode");
- if(UtilValidate.isNotEmpty(countryCode)) {
- contactDetailMap.put("countryCode", countryCode);
+ if (telecomNumber) {
+ countryCode = telecomNumber.countryCode;
+ if (countryCode) {
+ contactDetailMap.countryCode = countryCode;
+ }
+ areaCode = telecomNumber.areaCode;
+ if (areaCode) {
+ contactDetailMap.areaCode = areaCode;
}
- areaCode = telecomNumber.get("areaCode");
- if(UtilValidate.isNotEmpty(areaCode)) {
- contactDetailMap.put("areaCode", areaCode);
+ contactNumber = telecomNumber.contactNumber;
+ if (contactNumber) {
+ contactDetailMap.contactNumber = contactNumber;
}
- contactNumber = telecomNumber.get("contactNumber");
- if(UtilValidate.isNotEmpty(contactNumber)) {
- contactDetailMap.put("contactNumber", contactNumber);
- }
}
}
contactInfoList.add(contactDetailMap);
}
}
-context.put("contactInfoList", contactInfoList);
\ No newline at end of file
+context.contactInfoList = contactInfoList;
\ No newline at end of file
Modified: ofbiz/trunk/applications/marketing/widget/MarketingReportScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/MarketingReportScreens.xml?rev=667653&r1=667652&r2=667653&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/MarketingReportScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/MarketingReportScreens.xml Fri Jun 13 14:09:53 2008
@@ -96,7 +96,7 @@
<set field="titleProperty" value="MarketingTrackingCodeReportTitle"/>
<property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
- <script location="component://marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.bsh"/>
+ <script location="component://marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy"/>
</actions>
<widgets>
<decorator-screen name="CommonMarketReportDecorator">
@@ -127,7 +127,7 @@
<set field="title" value="${uiLabelMap.MarketingTrackingCodeReportTitle}"/>
<property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
- <script location="component://marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.bsh"/>
+ <script location="component://marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy"/>
</actions>
<widgets>
<decorator-screen name="CommonMarketReportDecorator">
Modified: ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml?rev=667653&r1=667652&r2=667653&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/ContactScreens.xml Fri Jun 13 14:09:53 2008
@@ -99,7 +99,7 @@
<set field="titleProperty" value="PageTitleCreateContact"/>
<set field="headerItem" value="Contacts"/>
<set field="tabButtonItem" value="MergeContacts"/>
- <script location="component://marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh"/>
+ <script location="component://marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy"/>
</actions>
<widgets>
<decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
Modified: ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml?rev=667653&r1=667652&r2=667653&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml (original)
+++ ofbiz/trunk/applications/marketing/widget/sfa/LeadScreens.xml Fri Jun 13 14:09:53 2008
@@ -141,7 +141,7 @@
<actions>
<set field="headerItem" value="Leads"/>
<set field="tabButtonItem" value="CloneLead"/>
- <script location="component://marketing/webapp/sfa/WEB-INF/action/cloneLead.bsh"/>
+ <script location="component://marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy"/>
</actions>
<widgets>
<decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
@@ -172,7 +172,7 @@
<section>
<actions>
<set field="headerItem" value="Leads"/>
- <script location="component://marketing/webapp/sfa/WEB-INF/action/mergeContacts.bsh"/>
+ <script location="component://marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy"/>
</actions>
<widgets>
<decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">