svn commit: r792247 - /ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r792247 - /ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java

adrianc
Author: adrianc
Date: Wed Jul  8 18:20:27 2009
New Revision: 792247

URL: http://svn.apache.org/viewvc?rev=792247&view=rev
Log:
A couple of iCalendar bug fixes.

Modified:
    ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java

Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java?rev=792247&r1=792246&r2=792247&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java (original)
+++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalConverter.java Wed Jul  8 18:20:27 2009
@@ -625,14 +625,21 @@
         PropertyList propertyList = component.getProperties();
         setMapElement(serviceMap, "scopeEnumId", fromClazz(propertyList));
         setMapElement(serviceMap, "description", fromDescription(propertyList));
-        setMapElement(serviceMap, "estimatedStartDate", fromDtStart(propertyList));
-        setMapElement(serviceMap, "estimatedMilliSeconds", fromDuration(propertyList));
-        setMapElement(serviceMap, "lastModifiedDate", fromLastModified(propertyList));
         setMapElement(serviceMap, "locationDesc", fromLocation(propertyList));
         setMapElement(serviceMap, "priority", fromPriority(propertyList));
         setMapElement(serviceMap, "currentStatusId", fromStatus(propertyList));
         setMapElement(serviceMap, "workEffortName", fromSummary(propertyList));
         setMapElement(serviceMap, "universalId", fromUid(propertyList));
+        // Set some fields to null so calendar clients can revert changes
+        serviceMap.put("estimatedStartDate", null);
+        serviceMap.put("estimatedCompletionDate", null);
+        serviceMap.put("estimatedMilliSeconds", null);
+        serviceMap.put("lastModifiedDate", null);
+        serviceMap.put("actualCompletionDate", null);
+        serviceMap.put("percentComplete", null);
+        setMapElement(serviceMap, "estimatedStartDate", fromDtStart(propertyList));
+        setMapElement(serviceMap, "estimatedMilliSeconds", fromDuration(propertyList));
+        setMapElement(serviceMap, "lastModifiedDate", fromLastModified(propertyList));
         if ("VTODO".equals(component.getName())) {
             setMapElement(serviceMap, "actualCompletionDate", fromCompleted(propertyList));
             setMapElement(serviceMap, "percentComplete", fromPercentComplete(propertyList));
@@ -873,7 +880,6 @@
             loadRelatedParties(relatedParties, componentProps, context);
         }
         if (newComponent) {
-            DateRange range = new DateRange(workEffort.getTimestamp("estimatedStartDate"), workEffort.getTimestamp("estimatedCompletionDate"));
             if (UtilValidate.isNotEmpty(workEffort.getString("tempExprId"))) {
                 TemporalExpression tempExpr = TemporalExpressionWorker.getTemporalExpression(delegator, workEffort.getString("tempExprId"));
                 if (tempExpr != null) {
@@ -883,8 +889,6 @@
                         replaceProperty(componentProps, new Description("Error while converting recurrence: " + e));
                     }
                 }
-            } else {
-                componentProps.add(new DtEnd(new DateTime(range.end())));
             }
             getAlarms(workEffort, alarms);
         }