From 88ff515222aea9278b264ec34ddf75573f997ec2 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 12 Oct 2006 20:58:57 +0000 Subject: [PATCH] Monotone-Parent: 666ed5ba35b9152f0dcf8f1e23dcc1824cdac1f6 Monotone-Revision: 3b18f3c2b4f3747d9082d436755de2ea68743aa6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-12T20:58:57 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ .../Appointments/SOGoAppointmentFolder.h | 2 ++ .../Appointments/SOGoAppointmentFolder.m | 20 +++++++++++++++++++ 3 files changed, 26 insertions(+) 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