From bf8759e007e0f1c95c5ea25bb20d8963672ea2ba Mon Sep 17 00:00:00 2001 From: Adrian Crum Date: Fri, 19 Jun 2009 17:00:19 +0000 Subject: [PATCH] Fixed a problem with iCalendar Organizers and Attendees. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@786581 13f79535-47bb-0310-9956-ffa450edef68 --- .../workeffort/ICalendarWorker.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalendarWorker.java b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalendarWorker.java index 4d6ed8fe1a..80c32139fb 100644 --- a/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalendarWorker.java +++ b/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalendarWorker.java @@ -156,20 +156,26 @@ public class ICalendarWorker { } List relatedParties = EntityUtil.filterByDate(delegator.findList("WorkEffortPartyAssignView", EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, workEffortId), null, null, null, false)); for (GenericValue partyValue : relatedParties) { - ParameterList paramList = new ParameterList(); + ParameterList paramList = null; String partyName = partyValue.getString("groupName"); if (UtilValidate.isEmpty(partyName)) { - partyName = partyValue.getString("firstName") + " " + partyValue.getString("lastName"); + partyName = partyValue.getString("firstName") + "_" + partyValue.getString("lastName"); } - paramList.add(new Cn(partyName)); - // paramList.add(new XParameter(partyIdPropName, partyValue.getString("partyId"))); + partyName = partyName.replace(" ", "_"); try { if ("CAL_ORGANIZER~CAL_OWNER".contains(partyValue.getString("roleTypeId"))) { - eventProps.add(new Organizer("CN:".concat(partyName))); + Organizer organizer = new Organizer("CN:".concat(partyName)); + paramList = organizer.getParameters(); + eventProps.add(organizer); } else { - eventProps.add(new Attendee("CN:".concat(partyName))); + Attendee attendee = new Attendee("CN:".concat(partyName)); + paramList = attendee.getParameters(); + eventProps.add(attendee); } - } catch (Exception e) {} + paramList.add(new XParameter("X-ORG-APACHE-OFBIZ-PARTY-ID", partyValue.getString("partyId"))); + } catch (Exception e) { + Debug.logError(e, "Error while processing related parties: ", module); + } } DateRange range = new DateRange(workEffort.getTimestamp("estimatedStartDate"), workEffort.getTimestamp("estimatedCompletionDate")); eventProps.add(new DtStart(new DateTime(range.start())));