diff --git a/ChangeLog b/ChangeLog index 4559f8e52..bf03fffef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-06-15 Francis Lachapelle + + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder + -_appendCycleException:firstInstanceCalendarDateRange:fromRow:forRange:toArray:]): + for exceptions in the date range, add the boolean key + "isException" to the dictionary. + (-_flattenCycleRecords:fetchRange:): renamed method (was + -fixupCyclicRecords:fetchRange:). + 2009-06-12 Francis Lachapelle * UI/Contacts/UIxContactEditor.m ([UIxContactEditor diff --git a/NEWS b/NEWS index 40ad6d452..0be6fdbf9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +1.0-2009xxyy (1.0.3) +-------------------- +- improved search behavior of users folders (UIxContactsUserFolders) +- the editor window in the web interface now appears directly when editing an exception occurence of a repeating event (no more dialog window, as in Lightning) + 1.0-20090605 (1.0.2) -------------------- - basic alarm implementation for the web interface diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 08e4588c1..17df7e30f 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -611,7 +611,7 @@ static NSArray *reducedReportQueryFields = nil; /* cycle is in _r. We also have to override the c_startdate/c_enddate with the date values of the reccurence since we use those when displaying events in SOGo Web */ - tmp = [_r startDate]; + tmp = [_r startDate]; [tmp setTimeZone: timeZone]; [md setObject: tmp forKey: @"startDate"]; dateSecs = [NSNumber numberWithInt: [tmp timeIntervalSince1970]]; @@ -627,6 +627,8 @@ static NSArray *reducedReportQueryFields = nil; dateSecs = [NSNumber numberWithInt: [tmp timeIntervalSince1970]]; [md setObject: dateSecs forKey: @"c_recurrence_id"]; + // The first instance date is added to the dictionary so it can + // be used by UIxCalListingActions to compute the DST offset. tmp = [_fir startDate]; [md setObject: tmp forKey: @"cycleStartDate"]; @@ -707,11 +709,19 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir { newRecord = [self fixupRecord: [component quickRecord]]; [newRecord setObject: [NSNumber numberWithInt: 1] - forKey: @"c_iscycle"]; + forKey: @"c_iscycle"]; oldRecord = [ma objectAtIndex: recordIndex]; [newRecord setObject: [oldRecord objectForKey: @"c_recurrence_id"] - forKey: @"c_recurrence_id"]; + forKey: @"c_recurrence_id"]; + + // The first instance date is added to the dictionary so it can + // be used by UIxCalListingActions to compute the DST offset. [newRecord setObject: [fir startDate] forKey: @"cycleStartDate"]; + + // We identified the record as an exception. + [newRecord setObject: [NSNumber numberWithInt: 1] + forKey: @"isException"]; + [ma replaceObjectAtIndex: recordIndex withObject: newRecord]; } else @@ -831,8 +841,8 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir [_ma addObjectsFromArray: recordArray]; } -- (NSArray *) fixupCyclicRecords: (NSArray *) _records - fetchRange: (NGCalendarDateRange *) _r +- (NSArray *) _flattenCycleRecords: (NSArray *) _records + fetchRange: (NGCalendarDateRange *) _r { // TODO: is the result supposed to be sorted by date? NSMutableArray *ma; @@ -1009,7 +1019,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir if (records) { if (r) - records = [self fixupCyclicRecords: records fetchRange: r]; + records = [self _flattenCycleRecords: records fetchRange: r]; if (ma) [ma addObjectsFromArray: records]; else diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 4d58fe4d7..006dee5dd 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -78,7 +78,7 @@ static NSArray *tasksFields = nil; @"c_enddate", @"c_location", @"c_isallday", @"c_classification", @"c_partmails", @"c_partstates", @"c_owner", @"c_iscycle", @"c_nextalarm", - @"c_recurrence_id", nil]; + @"c_recurrence_id", @"isException", nil]; [eventsFields retain]; } if (!tasksFields) diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index a9f0f785b..deefd8dc7 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -93,7 +93,7 @@ function editEvent() { _editEventId(nodes[i].cname, nodes[i].calendar); } else if (selectedCalendarCell) { - if (selectedCalendarCell[0].recurrenceTime) + if (selectedCalendarCell[0].recurrenceTime && !selectedCalendarCell[0].isException) _editRecurrenceDialog(selectedCalendarCell[0], "confirmEditing"); else _editEventId(selectedCalendarCell[0].cname, @@ -406,7 +406,7 @@ function onViewEventCallback(http) { } function editDoubleClickedEvent(event) { - if (this.recurrenceTime) + if (this.recurrenceTime && !this.isException) _editRecurrenceDialog(this, "confirmEditing"); else _editEventId(this.cname, this.calendar); @@ -586,6 +586,7 @@ function eventsListCallback(http) { row.calendar = escape(data[i][1]); if (rTime) row.recurrenceTime = escape(rTime); + row.isException = data[i][15]; var startDate = new Date(); startDate.setTime(data[i][4] * 1000); row.day = startDate.getDayString(); @@ -988,12 +989,14 @@ function newBaseEventDIV(eventRep, event, eventText) { // log ("12 iscycle = " + event[12]); // log ("13 nextalarm = " + event[13]); // log ("14 recurrenceid = " + event[14]); +// log ("15 isexception = " + event[15]); var eventDiv = $(document.createElement("div")); eventDiv.cname = event[0]; eventDiv.calendar = event[1]; if (eventRep.recurrenceTime) eventDiv.recurrenceTime = eventRep.recurrenceTime; + eventDiv.isException = event[15]; eventDiv.addClassName("event"); if (event[13] > 0) eventDiv.addClassName("alarm");