diff --git a/ChangeLog b/ChangeLog index 23643ecd1..492ae6d9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-10-12 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder -deleteEntriesWithIds:ids]): new method + that delete identified entries in batch. + * UI/SOGoUI/UIxComponent.m ([UIxComponent -jsCloseWithRefreshMethod:methodName]): new method with explicit purpose. diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.h b/SoObjects/Appointments/SOGoAppointmentFolder.h index 7bba091bd..56243dfb1 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.h +++ b/SoObjects/Appointments/SOGoAppointmentFolder.h @@ -75,6 +75,8 @@ - (NSArray *) fetchFreebusyInfosFrom: (NSCalendarDate *) _startDate to: (NSCalendarDate *) _endDate; +- (void) deleteEntriesWithIds: (NSArray *) ids; + /* URL generation */ - (NSString *) baseURLForAptWithUID: (NSString *) _uid diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index fcb30221f..1d1959d17 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -720,6 +720,26 @@ static NSNumber *sharedYes = nil; return [self fetchFields: infos from: _startDate to: _endDate component: _component]; } +- (void) deleteEntriesWithIds: (NSArray *) ids +{ + Class objectClass; + unsigned int count, max; + NSString *currentId; + id deleteObject; + + max = [ids count]; + for (count = 0; count < max; count++) + { + currentId = [ids objectAtIndex: count]; + objectClass + = [self objectClassForResourceNamed: currentId]; + deleteObject = [objectClass objectWithName: currentId + inContainer: self]; + [deleteObject delete]; + [deleteObject primaryDelete]; + } +} + /* URL generation */ - (NSString *) baseURLForAptWithUID: (NSString *)_uid