diff --git a/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java b/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java index c32b6c31ab..84d9d0de8b 100644 --- a/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java +++ b/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java @@ -379,7 +379,7 @@ public class CommunicationEventServices { Map tmpResult = null; // Retrieve a contact list party status - List contactListPartyStatuses = delegator.findByAnd("ContactListPartyStatus", UtilMisc.toMap("contactListId", contactListId, "partyId", contactListPartyAndContactMech.getString("partyId"), "fromDate", contactListPartyAndContactMech.getTimestamp("fromDate"), "statusId", "CLPT_ACCEPTED")); + List contactListPartyStatuses = delegator.findByAnd("ContactListPartyStatus", UtilMisc.toMap("contactListId", contactListId, "partyId", contactListPartyAndContactMech.getString("partyId"), "fromDate", contactListPartyAndContactMech.getTimestamp("fromDate"), "statusId", "CLPT_ACCEPTED"), null, false); GenericValue contactListPartyStatus = EntityUtil.getFirst(contactListPartyStatuses); if (UtilValidate.isNotEmpty(contactListPartyStatus)) { // prepare body parameters @@ -546,7 +546,7 @@ public class CommunicationEventServices { String partyIdFrom = null; GenericValue fromCm; try { - List fromCms = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("infoString", sendFrom), UtilMisc.toList("-fromDate")); + List fromCms = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("infoString", sendFrom), UtilMisc.toList("-fromDate"), false); fromCms = EntityUtil.filterByDate(fromCms); fromCm = EntityUtil.getFirst(fromCms); } catch (GenericEntityException e) { @@ -562,7 +562,7 @@ public class CommunicationEventServices { String contactMechIdTo = null; GenericValue toCm; try { - List toCms = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("infoString", sendTo, "partyId", partyId), UtilMisc.toList("-fromDate")); + List toCms = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("infoString", sendTo, "partyId", partyId), UtilMisc.toList("-fromDate"), false); toCms = EntityUtil.filterByDate(toCms); toCm = EntityUtil.getFirst(toCms); } catch (GenericEntityException e) { @@ -739,7 +739,7 @@ public class CommunicationEventServices { // make sure this isn't a duplicate List commEvents; try { - commEvents = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", messageId)); + commEvents = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", messageId), null, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -835,7 +835,7 @@ public class CommunicationEventServices { if (inReplyTo != null && inReplyTo[0] != null) { GenericValue parentCommEvent = null; try { - List events = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", inReplyTo[0].replaceAll("[<>]", ""))); + List events = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", inReplyTo[0].replaceAll("[<>]", "")), null, false); parentCommEvent = EntityUtil.getFirst(events); } catch (GenericEntityException e) { Debug.logError(e, module); @@ -1215,7 +1215,7 @@ public class CommunicationEventServices { if (messageId != null) { List values; try { - values = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", messageId)); + values = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", messageId), null, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -1247,7 +1247,7 @@ public class CommunicationEventServices { // no communication events found for that message ID; possible this is a NEWSLETTER try { values = delegator.findByAnd("ContactListCommStatus", UtilMisc.toMap("messageId", - messageId)); + messageId), null, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); diff --git a/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java b/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java index 51fb000ea5..26004c4bac 100644 --- a/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java +++ b/applications/party/src/org/ofbiz/party/contact/ContactMechServices.java @@ -166,7 +166,7 @@ public class ContactMechServices { if (!partyId.equals("_NA_")) { // try to find a PartyContactMech with a valid date range try { - List partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate")), true); + List partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate"), false), true); partyContactMech = EntityUtil.getFirst(partyContactMechs); if (partyContactMech == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -281,7 +281,7 @@ public class ContactMechServices { try { // try to find a PartyContactMech with a valid date range - List partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate")), true); + List partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate"), false), true); partyContactMech = EntityUtil.getFirst(partyContactMechs); } catch (GenericEntityException e) { @@ -429,7 +429,7 @@ public class ContactMechServices { if (!partyId.equals("_NA_")) { // try to find a PartyContactMech with a valid date range try { - List partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate")), true); + List partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate"), false), true); partyContactMech = EntityUtil.getFirst(partyContactMechs); if (partyContactMech == null) { return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -640,7 +640,7 @@ public class ContactMechServices { try { contactMech = delegator.findOne("ContactMech", UtilMisc.toMap("contactMechId", contactMechId), false); // try to find a PartyContactMech with a valid date range - List partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate")), true); + List partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), UtilMisc.toList("fromDate"), false), true); partyContactMech = EntityUtil.getFirst(partyContactMechs); } catch (GenericEntityException e) { @@ -811,7 +811,7 @@ public class ContactMechServices { try { Map pcmpFindMap = UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId); //Debug.logInfo("pcmpFindMap = " + pcmpFindMap, module); - List allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap), true); + List allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap, null, false), true); tempVal = EntityUtil.getFirst(allPCMPs); } catch (GenericEntityException e) { @@ -870,7 +870,7 @@ public class ContactMechServices { try { Map pcmpFindMap = UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId); //Debug.logInfo("pcmpFindMap = " + pcmpFindMap, module); - List allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap), true); + List allPCMPs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", pcmpFindMap, null, false), true); tempVal = EntityUtil.getFirst(allPCMPs); } catch (GenericEntityException e) { @@ -1056,7 +1056,7 @@ public class ContactMechServices { verifyHash = HashCrypt.digestHash("MD5", Long.toString(random).getBytes()); List emailAddVerifications = null; try { - emailAddVerifications = delegator.findByAnd("EmailAddressVerification", UtilMisc.toMap("verifyHash", verifyHash)); + emailAddVerifications = delegator.findByAnd("EmailAddressVerification", UtilMisc.toMap("verifyHash", verifyHash), null, false); } catch (GenericEntityException e) { Debug.logError(e.getMessage(), module); return ServiceUtil.returnError(e.getMessage()); diff --git a/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java b/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java index c50530813e..ba95368a8e 100644 --- a/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java +++ b/applications/party/src/org/ofbiz/party/contact/ContactMechWorker.java @@ -62,7 +62,7 @@ public class ContactMechWorker { List allPartyContactMechs = null; try { - List tempCol = delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId)); + List tempCol = delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId), null, false); if (contactMechTypeId != null) { List tempColTemp = FastList.newInstance(); for (GenericValue partyContactMech: tempCol) { @@ -133,7 +133,7 @@ public class ContactMechWorker { List allFacilityContactMechs = null; try { - List tempCol = delegator.findByAnd("FacilityContactMech", UtilMisc.toMap("facilityId", facilityId)); + List tempCol = delegator.findByAnd("FacilityContactMech", UtilMisc.toMap("facilityId", facilityId), null, false); if (contactMechTypeId != null) { List tempColTemp = FastList.newInstance(); for (GenericValue partyContactMech: tempCol) { @@ -205,7 +205,7 @@ public class ContactMechWorker { List allOrderContactMechs = null; try { - allOrderContactMechs = delegator.findByAnd("OrderContactMech", UtilMisc.toMap("orderId", orderId), UtilMisc.toList("contactMechPurposeTypeId")); + allOrderContactMechs = delegator.findByAnd("OrderContactMech", UtilMisc.toMap("orderId", orderId), UtilMisc.toList("contactMechPurposeTypeId"), false); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -262,7 +262,7 @@ public class ContactMechWorker { List allWorkEffortContactMechs = null; try { - List workEffortContactMechs = delegator.findByAnd("WorkEffortContactMech", UtilMisc.toMap("workEffortId", workEffortId)); + List workEffortContactMechs = delegator.findByAnd("WorkEffortContactMech", UtilMisc.toMap("workEffortId", workEffortId), null, false); allWorkEffortContactMechs = EntityUtil.filterByDate(workEffortContactMechs); } catch (GenericEntityException e) { Debug.logWarning(e, module); @@ -338,7 +338,7 @@ public class ContactMechWorker { List partyContactMechs = null; try { - partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId)), true); + partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId), null, false), true); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -387,7 +387,7 @@ public class ContactMechWorker { Iterator typePurposes = null; try { - typePurposes = UtilMisc.toIterator(delegator.findByAnd("ContactMechTypePurpose", UtilMisc.toMap("contactMechTypeId", contactMechTypeId))); + typePurposes = UtilMisc.toIterator(delegator.findByAnd("ContactMechTypePurpose", UtilMisc.toMap("contactMechTypeId", contactMechTypeId), null, false)); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -550,7 +550,7 @@ public class ContactMechWorker { List facilityContactMechs = null; try { - facilityContactMechs = EntityUtil.filterByDate(delegator.findByAnd("FacilityContactMech", UtilMisc.toMap("facilityId", facilityId, "contactMechId", contactMechId)), true); + facilityContactMechs = EntityUtil.filterByDate(delegator.findByAnd("FacilityContactMech", UtilMisc.toMap("facilityId", facilityId, "contactMechId", contactMechId), null, false), true); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -599,7 +599,7 @@ public class ContactMechWorker { Iterator typePurposes = null; try { - typePurposes = UtilMisc.toIterator(delegator.findByAnd("ContactMechTypePurpose", UtilMisc.toMap("contactMechTypeId", contactMechTypeId))); + typePurposes = UtilMisc.toIterator(delegator.findByAnd("ContactMechTypePurpose", UtilMisc.toMap("contactMechTypeId", contactMechTypeId), null, false)); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -692,7 +692,7 @@ public class ContactMechWorker { List allPartyContactMechs = null; try { - allPartyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId)), true); + allPartyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId), null, false), true); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -741,7 +741,7 @@ public class ContactMechWorker { List partyContactMechs = null; try { - partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", curContactMechId)), true); + partyContactMechs = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", partyId, "contactMechId", curContactMechId), null, false), true); } catch (GenericEntityException e) { Debug.logWarning(e, module); } @@ -845,7 +845,7 @@ public class ContactMechWorker { Delegator delegator = postalAddress.getDelegator(); List postalAddresses = FastList.newInstance(); try { - List partyContactMechs = delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", companyPartyId)); + List partyContactMechs = delegator.findByAnd("PartyContactMech", UtilMisc.toMap("partyId", companyPartyId), null, false); partyContactMechs = EntityUtil.filterByDate(partyContactMechs); if (partyContactMechs != null) { for (GenericValue pcm: partyContactMechs) { @@ -927,8 +927,8 @@ public class ContactMechWorker { } // no shortcut, try the longcut to see if there is something with a geoCode associated to the countryGeoId - List geoAssocAndGeoToList = delegator.findByAndCache("GeoAssocAndGeoTo", - UtilMisc.toMap("geoIdFrom", postalAddress.getString("countryGeoId"), "geoCode", postalAddress.getString("postalCode"), "geoAssocTypeId", "REGIONS")); + List geoAssocAndGeoToList = delegator.findByAnd("GeoAssocAndGeoTo", + UtilMisc.toMap("geoIdFrom", postalAddress.getString("countryGeoId"), "geoCode", postalAddress.getString("postalCode"), "geoAssocTypeId", "REGIONS"), null, true); GenericValue geoAssocAndGeoTo = EntityUtil.getFirst(geoAssocAndGeoToList); if (geoAssocAndGeoTo != null) { // save the value to the database for quicker future reference diff --git a/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java b/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java index 95ae1f222c..798ecb2fdd 100644 --- a/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java +++ b/applications/party/src/org/ofbiz/party/content/PartyContentWrapper.java @@ -231,7 +231,7 @@ public class PartyContentWrapper implements ContentWrapper { } public static List getPartyContentTextList(GenericValue party, String partyContentTypeId, Locale locale, String mimeTypeId, Delegator delegator, LocalDispatcher dispatcher) throws GeneralException, IOException { - List partyContentList = delegator.findByAndCache("PartyContent", UtilMisc.toMap("partyId", party.getString("partyId"), "partyContentTypeId", partyContentTypeId), UtilMisc.toList("-fromDate")); + List partyContentList = delegator.findByAnd("PartyContent", UtilMisc.toMap("partyId", party.getString("partyId"), "partyContentTypeId", partyContentTypeId), UtilMisc.toList("-fromDate"), true); partyContentList = EntityUtil.filterByDate(partyContentList); List contentList = FastList.newInstance(); @@ -264,7 +264,7 @@ public class PartyContentWrapper implements ContentWrapper { List partyContentList = null; try { - partyContentList = delegator.findByAndCache("PartyContent", UtilMisc.toMap("partyId", partyId, "partyContentTypeId", partyContentTypeId), UtilMisc.toList("-fromDate")); + partyContentList = delegator.findByAnd("PartyContent", UtilMisc.toMap("partyId", partyId, "partyContentTypeId", partyContentTypeId), UtilMisc.toList("-fromDate"), true); } catch (GeneralException e) { Debug.logError(e, module); } diff --git a/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java b/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java index b560224fed..67cf5498f9 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java +++ b/applications/party/src/org/ofbiz/party/party/PartyRelationshipServices.java @@ -144,7 +144,7 @@ public class PartyRelationshipServices { partyRelationShipList = delegator.findByAnd("PartyRelationship", UtilMisc.toMap(sideChecked, partyId, "roleTypeIdFrom", roleTypeIdFrom, "roleTypeIdTo", roleTypeIdTo, - "partyRelationshipTypeId", partyRelationshipTypeId)); + "partyRelationshipTypeId", partyRelationshipTypeId), null, false); // We consider the last one (in time) as sole active (we try to maintain a unique relationship and keep changes history) partyRelationShipList = EntityUtil.filterByDate(partyRelationShipList); GenericValue oldPartyRelationShip = EntityUtil.getFirst(partyRelationShipList); diff --git a/applications/party/src/org/ofbiz/party/party/PartyServices.java b/applications/party/src/org/ofbiz/party/party/PartyServices.java index 35ae1958cb..a530185cad 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyServices.java +++ b/applications/party/src/org/ofbiz/party/party/PartyServices.java @@ -245,7 +245,7 @@ public class PartyServices { // disable all userlogins for this user when the new status is disabled if (("PARTY_DISABLED").equals(statusId)) { - List userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId)); + List userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId), null, false); for(GenericValue userLogin : userLogins) { if (!"N".equals(userLogin.getString("enabled"))) { userLogin.set("enabled", "N"); @@ -1597,7 +1597,7 @@ public class PartyServices { // update the non-existing party roles List rolesToMove; try { - rolesToMove = delegator.findByAnd("PartyRole", UtilMisc.toMap("partyId", partyId)); + rolesToMove = delegator.findByAnd("PartyRole", UtilMisc.toMap("partyId", partyId), null, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -1689,7 +1689,7 @@ public class PartyServices { // update the non-existing attributes List attrsToMove; try { - attrsToMove = delegator.findByAnd("PartyAttribute", UtilMisc.toMap("partyId", partyId)); + attrsToMove = delegator.findByAnd("PartyAttribute", UtilMisc.toMap("partyId", partyId), null, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); diff --git a/applications/party/src/org/ofbiz/party/party/PartyWorker.java b/applications/party/src/org/ofbiz/party/party/PartyWorker.java index 8d2fe01ecd..b056a44ec0 100644 --- a/applications/party/src/org/ofbiz/party/party/PartyWorker.java +++ b/applications/party/src/org/ofbiz/party/party/PartyWorker.java @@ -110,7 +110,7 @@ public class PartyWorker { public static GenericValue findPartyLatestContactMech(String partyId, String contactMechTypeId, Delegator delegator) { try { - List cmList = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("partyId", partyId, "contactMechTypeId", contactMechTypeId), UtilMisc.toList("-fromDate")); + List cmList = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("partyId", partyId, "contactMechTypeId", contactMechTypeId), UtilMisc.toList("-fromDate"), false); cmList = EntityUtil.filterByDate(cmList); return EntityUtil.getFirst(cmList); } catch (GenericEntityException e) { @@ -161,7 +161,7 @@ public class PartyWorker { public static GenericValue findPartyLatestUserLogin(String partyId, Delegator delegator) { try { - List userLoginList = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId), UtilMisc.toList("-" + ModelEntity.STAMP_FIELD)); + List userLoginList = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId), UtilMisc.toList("-" + ModelEntity.STAMP_FIELD), false); return EntityUtil.getFirst(userLoginList); } catch (GenericEntityException e) { Debug.logError(e, "Error while finding latest UserLogin for party with ID [" + partyId + "]: " + e.toString(), module); @@ -171,7 +171,7 @@ public class PartyWorker { public static Timestamp findPartyLastLoginTime(String partyId, Delegator delegator) { try { - List loginHistory = delegator.findByAnd("UserLoginHistory", UtilMisc.toMap("partyId", partyId), UtilMisc.toList("-fromDate")); + List loginHistory = delegator.findByAnd("UserLoginHistory", UtilMisc.toMap("partyId", partyId), UtilMisc.toList("-fromDate"), false); GenericValue v = EntityUtil.getFirst(loginHistory); if (v != null) { return v.getTimestamp("fromDate"); @@ -502,7 +502,7 @@ public class PartyWorker { if (UtilValidate.isNotEmpty(partyIdentificationTypeId)) { conditions.put("partyIdentificationTypeId", partyIdentificationTypeId); } - partiesFound = delegator.findByAndCache("PartyIdentificationAndParty", conditions, UtilMisc.toList("partyId")); + partiesFound = delegator.findByAnd("PartyIdentificationAndParty", conditions, UtilMisc.toList("partyId"), true); } if (! searchPartyFirst) { diff --git a/applications/party/webapp/partymgr/WEB-INF/actions/communication/FindCommEventContactMechs.groovy b/applications/party/webapp/partymgr/WEB-INF/actions/communication/FindCommEventContactMechs.groovy index 33b99f4b0b..04bcde60e5 100644 --- a/applications/party/webapp/partymgr/WEB-INF/actions/communication/FindCommEventContactMechs.groovy +++ b/applications/party/webapp/partymgr/WEB-INF/actions/communication/FindCommEventContactMechs.groovy @@ -32,11 +32,11 @@ partyIdTo = context.partyIdTo; if (parameters.communicationEventTypeId) { if ("EMAIL_COMMUNICATION".equals(parameters.communicationEventTypeId)) { - userEmailAddresses = delegator.findByAnd("PartyContactWithPurpose", [contactMechTypeId : "EMAIL_ADDRESS" , partyId : partyIdFrom]); + userEmailAddresses = delegator.findByAnd("PartyContactWithPurpose", [contactMechTypeId : "EMAIL_ADDRESS" , partyId : partyIdFrom], null, false); userEmailAddresses = EntityUtil.filterByDate(userEmailAddresses, UtilDateTime.nowTimestamp(), "contactFromDate", "contactThruDate", true); context.userEmailAddresses = userEmailAddresses; - targetEmailAddresses = delegator.findByAnd("PartyContactWithPurpose", [contactMechTypeId : "EMAIL_ADDRESS", partyId : partyIdTo]); + targetEmailAddresses = delegator.findByAnd("PartyContactWithPurpose", [contactMechTypeId : "EMAIL_ADDRESS", partyId : partyIdTo], null, false); targetEmailAddresses = EntityUtil.filterByDate(targetEmailAddresses, UtilDateTime.nowTimestamp(), "contactFromDate", "contactThruDate", true); context.targetEmailAddresses = targetEmailAddresses; } diff --git a/applications/party/webapp/partymgr/WEB-INF/actions/party/EditShoppingList.groovy b/applications/party/webapp/partymgr/WEB-INF/actions/party/EditShoppingList.groovy index 950a26a41f..79d18aae73 100644 --- a/applications/party/webapp/partymgr/WEB-INF/actions/party/EditShoppingList.groovy +++ b/applications/party/webapp/partymgr/WEB-INF/actions/party/EditShoppingList.groovy @@ -45,7 +45,7 @@ if (!partyId && shoppingListId) { context.partyId = partyId; // get the top level shopping lists for the party -allShoppingLists = delegator.findByAnd("ShoppingList", [partyId : partyId], ["listName"]); +allShoppingLists = delegator.findByAnd("ShoppingList", [partyId : partyId], ["listName"], false); shoppingLists = EntityUtil.filterByAnd(allShoppingLists, [parentShoppingListId : null]); context.allShoppingLists = allShoppingLists; context.shoppingLists = shoppingLists; @@ -124,7 +124,7 @@ if (shoppingListId) { context.shoppingListType = shoppingListType; // get the child shopping lists of the current list for the logged in user - childShoppingLists = delegator.findByAndCache("ShoppingList", [partyId : partyId, parentShoppingListId : shoppingListId], ["listName"]); + childShoppingLists = delegator.findByAnd("ShoppingList", [partyId : partyId, parentShoppingListId : shoppingListId], ["listName"], true); // now get prices for each child shopping list... if (childShoppingLists) { childShoppingListDatas = new ArrayList(childShoppingLists.size()); diff --git a/applications/party/webapp/partymgr/WEB-INF/actions/party/GetCurrentCart.groovy b/applications/party/webapp/partymgr/WEB-INF/actions/party/GetCurrentCart.groovy index 8e8d642527..3405f3a6d0 100644 --- a/applications/party/webapp/partymgr/WEB-INF/actions/party/GetCurrentCart.groovy +++ b/applications/party/webapp/partymgr/WEB-INF/actions/party/GetCurrentCart.groovy @@ -22,7 +22,7 @@ import org.ofbiz.entity.util.EntityUtil; partyId = partyId ?: parameters.partyId; savedCart = EntityUtil.getFirst(delegator.findByAnd("ShoppingList", [partyId : partyId, - shoppingListTypeId : "SLT_SPEC_PURP" , listName : "auto-save"])); + shoppingListTypeId : "SLT_SPEC_PURP" , listName : "auto-save"], null, false)); if (savedCart) { context.savedCartListId = savedCart.shoppingListId; diff --git a/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy b/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy index 7224a110a6..a803c62dfa 100644 --- a/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy +++ b/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy @@ -21,7 +21,7 @@ if (userLogin) { companies = delegator.findByAnd("PartyRelationship", [partyIdTo: userLogin.partyId, roleTypeIdTo: "CONTACT", - roleTypeIdFrom: "ACCOUNT"]); + roleTypeIdFrom: "ACCOUNT"], null, false); if (companies) { company = companies[0]; context.myCompanyId = company.partyIdFrom; diff --git a/applications/party/webapp/partymgr/WEB-INF/actions/party/SetRoleVars.groovy b/applications/party/webapp/partymgr/WEB-INF/actions/party/SetRoleVars.groovy index 162d193661..63be3557e8 100644 --- a/applications/party/webapp/partymgr/WEB-INF/actions/party/SetRoleVars.groovy +++ b/applications/party/webapp/partymgr/WEB-INF/actions/party/SetRoleVars.groovy @@ -19,28 +19,28 @@ import org.ofbiz.entity.*; import org.ofbiz.entity.util.EntityUtil; - roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT']); + roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT'], null, false); if (roleTypeAndParty) { context.accountDescription = roleTypeAndParty[0].description; } - roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'CONTACT']); + roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'CONTACT'], null, false); if (roleTypeAndParty) { context.contactDescription = roleTypeAndParty.get(0).description; } - roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'LEAD']); + roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'LEAD'], null, false); if (roleTypeAndParty) { context.leadDescription = roleTypeAndParty.get(0).description; - partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdTo": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"])); + partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdTo": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"], null, false)); if (partyRelationships) { context.partyGroupId = partyRelationships.get(0).partyIdFrom; context.partyId = parameters.partyId; } } - roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT_LEAD']); + roleTypeAndParty = delegator.findByAnd("RoleTypeAndParty", ['partyId': parameters.partyId, 'roleTypeId': 'ACCOUNT_LEAD'], null, false); if (roleTypeAndParty) { context.leadDescription = roleTypeAndParty.get(0).description; - partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdFrom": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"])); + partyRelationships = EntityUtil.filterByDate(delegator.findByAnd("PartyRelationship", ["partyIdFrom": parameters.partyId, "roleTypeIdFrom": "ACCOUNT_LEAD", "roleTypeIdTo": "LEAD", "partyRelationshipTypeId": "EMPLOYMENT"], null, false)); if (partyRelationships) { context.partyGroupId = parameters.partyId; context.partyId = partyRelationships.get(0).partyIdTo; diff --git a/applications/party/webapp/partymgr/WEB-INF/actions/visit/VisitDetails.groovy b/applications/party/webapp/partymgr/WEB-INF/actions/visit/VisitDetails.groovy index bf29603115..2fa456637d 100644 --- a/applications/party/webapp/partymgr/WEB-INF/actions/visit/VisitDetails.groovy +++ b/applications/party/webapp/partymgr/WEB-INF/actions/visit/VisitDetails.groovy @@ -25,7 +25,7 @@ serverHits = null; if (visitId) { visit = delegator.findOne("Visit", [visitId : visitId], false); if (visit) { - serverHits = delegator.findByAnd("ServerHit", [visitId : visitId], ["-hitStartDateTime"]); + serverHits = delegator.findByAnd("ServerHit", [visitId : visitId], ["-hitStartDateTime"], false); } } diff --git a/applications/party/webapp/partymgr/party/findparty.ftl b/applications/party/webapp/partymgr/party/findparty.ftl index e4e25bfe41..060c394b76 100644 --- a/applications/party/webapp/partymgr/party/findparty.ftl +++ b/applications/party/webapp/partymgr/party/findparty.ftl @@ -313,7 +313,7 @@ under the License. <#if partyType?exists> <#if partyType.partyTypeId?has_content && partyType.partyTypeId=="PERSON"> - <#assign partyRelateCom = delegator.findByAnd("PartyRelationship", {"partyIdTo", partyRow.partyId,"roleTypeIdFrom","ACCOUNT","roleTypeIdTo","CONTACT"})> + <#assign partyRelateCom = delegator.findByAnd("PartyRelationship", {"partyIdTo", partyRow.partyId,"roleTypeIdFrom","ACCOUNT","roleTypeIdTo","CONTACT"}, null, false)> <#if partyRelateCom?has_content> <#list partyRelateCom as partyRelationship> <#if partyRelationship.partyIdFrom?has_content>