From 769b78c78f0d1a8d6d026384de214aaebd44c8ab Mon Sep 17 00:00:00 2001 From: helge Date: Tue, 19 Jul 2005 07:42:02 +0000 Subject: [PATCH] some code cleanup git-svn-id: http://svn.opengroupware.org/SOGo/trunk@813 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/Scheduler/ChangeLog | 5 ++ SOGo/UI/Scheduler/GNUmakefile | 36 +------------- SOGo/UI/Scheduler/UIxAppointmentEditor.m | 49 +++++-------------- SOGo/UI/Scheduler/Version | 2 +- SOGo/UI/Scheduler/iCalRecurrenceRule+SOGo.m | 52 +++++++++++++++++++++ 5 files changed, 72 insertions(+), 72 deletions(-) create mode 100644 SOGo/UI/Scheduler/iCalRecurrenceRule+SOGo.m diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index d75e98ae..b1adf6a1 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,8 @@ +2005-07-19 Helge Hess + + * UIxAppointmentEditor.m: moved iCalRecurrenceRule to separate file + (v0.9.137) + 2005-07-18 Marcus Mueller * UIxCalView.m: provide label "empty title" as -titlePlaceholder for diff --git a/SOGo/UI/Scheduler/GNUmakefile b/SOGo/UI/Scheduler/GNUmakefile index e3f14068..85099348 100644 --- a/SOGo/UI/Scheduler/GNUmakefile +++ b/SOGo/UI/Scheduler/GNUmakefile @@ -48,45 +48,13 @@ SchedulerUI_OBJC_FILES = \ UIxCalInlineAptView.m \ UIxCalScheduleOverview.m \ UIxCalParticipationStatusView.m \ + \ + iCalRecurrenceRule+SOGo.m \ SchedulerUI_RESOURCE_FILES += \ Version \ product.plist -ifeq ($(bundlewox),yes) - -SchedulerUI_RESOURCE_FILES += \ - UIxAptTableView.wox \ - UIxCalDayOverview.wox \ - UIxCalDayChartview.wox \ - UIxCalDayListview.wox \ - UIxCalDayPrintview.wox \ - UIxCalWeekOverview.wox \ - UIxCalWeekChartview.wox \ - UIxCalWeekListview.wox \ - UIxCalWeekColumnsview.wox \ - UIxCalWeekPrintview.wox \ - UIxCalMonthOverview.wox \ - UIxCalMonthPrintview.wox \ - UIxCalYearOverview.wox \ - UIxCalInlineMonthOverview.wox \ - UIxAppointmentView.wox \ - UIxAppointmentPrintview.wox \ - UIxAppointmentEditor.wox \ - UIxCalSelectTab.wox \ - UIxCalDateLabel.wox \ - UIxCalBackForthNavView.wox \ - UIxAppointmentProposal.wox \ - UIxDatePicker.wox \ - UIxDatePickerScript.wox \ - UIxTimeSelector.wox \ - UIxTimeDateControl.wox \ - UIxCalInlineAptView.wox \ - UIxCalScheduleOverview.wox \ - UIxCalParticipationStatusView.wox \ - -endif - SchedulerUI_RESOURCE_FILES += \ images/next_week.gif \ images/previous_week.gif \ diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 5acb46fa..b2b99090 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -784,9 +784,10 @@ [_appointment setTransparency:[self transparency]]; #if 0 - /* bad, bad, bad! - * Organizer is no form value, thus we MUST NOT change it - */ + /* + Note: bad, bad, bad! + Organizer is no form value, thus we MUST NOT change it + */ [_appointment setOrganizer:self->organizer]; #endif attendees = [self participants]; @@ -827,7 +828,10 @@ /* access */ - (BOOL)isMyApt { - if (!self->organizer) return YES; // assume this is safe to do, right? + if (self->organizer == nil) + return YES; // assume this is safe to do, right? + + // TODO: this should check a set of emails against the SoUser return [[self->organizer rfc822Email] isEqualToString:[self emailForUser]]; } @@ -1053,14 +1057,15 @@ reason:@"unable to parse appointment"]; } - p = [apt findParticipantWithEmail:[self emailForUser]]; - if (!p) { + if ((p = [apt findParticipantWithEmail:[self emailForUser]]) == nil) { /* 404 == Not found */ return [NSException exceptionWithHTTPStatus:404 reason:@"user does not participate in this " @"appointment"]; } - if(_accept) + + // TODO: add tentative + if (_accept) [p setParticipationStatus:iCalPersonPartStatAccepted]; else [p setParticipationStatus:iCalPersonPartStatDeclined]; @@ -1085,33 +1090,3 @@ } @end /* UIxAppointmentEditor */ - - -/* HACK ALERT - This is a pretty ugly (unfortunately necessary) hack to map our limited - set of recurrence rules back to the popup list -*/ -@interface iCalRecurrenceRule (UsedPrivates) -- (NSString *)freq; -- (NSString *)byDayList; -@end /* iCalRecurrenceRule (UsedPrivates) */ - -@implementation iCalRecurrenceRule (SOGoExtensions) - -- (NSString *)cycleRepresentationForSOGo { - NSMutableString *s; - - s = [NSMutableString stringWithCapacity:20]; - [s appendString:@"FREQ="]; - [s appendString:[self freq]]; - if ([self repeatInterval] != 1) { - [s appendFormat:@";INTERVAL=%d", [self repeatInterval]]; - } - if (self->byDay.mask != 0) { - [s appendString:@";BYDAY="]; - [s appendString:[self byDayList]]; - } - return s; -} - -@end /* iCalRecurrenceRule (SOGoExtensions) */ diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index 3a0c1d4f..7e185334 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,6 +1,6 @@ # Version file -SUBMINOR_VERSION:=136 +SUBMINOR_VERSION:=137 # v0.9.136 requires SOGoUI v0.9.30 # v0.9.123 requires Appointments v0.9.35 diff --git a/SOGo/UI/Scheduler/iCalRecurrenceRule+SOGo.m b/SOGo/UI/Scheduler/iCalRecurrenceRule+SOGo.m new file mode 100644 index 00000000..6d42ca80 --- /dev/null +++ b/SOGo/UI/Scheduler/iCalRecurrenceRule+SOGo.m @@ -0,0 +1,52 @@ +/* + Copyright (C) 2004-2005 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#include +#include "common.h" + +/* HACK ALERT + This is a pretty ugly (unfortunately necessary) hack to map our limited + set of recurrence rules back to the popup list +*/ +@interface iCalRecurrenceRule (UsedPrivates) +- (NSString *)freq; +- (NSString *)byDayList; +@end /* iCalRecurrenceRule (UsedPrivates) */ + +@implementation iCalRecurrenceRule (SOGoExtensions) + +- (NSString *)cycleRepresentationForSOGo { + NSMutableString *s; + + s = [NSMutableString stringWithCapacity:20]; + [s appendString:@"FREQ="]; + [s appendString:[self freq]]; + if ([self repeatInterval] != 1) { + [s appendFormat:@";INTERVAL=%d", [self repeatInterval]]; + } + if (self->byDay.mask != 0) { + [s appendString:@";BYDAY="]; + [s appendString:[self byDayList]]; + } + return s; +} + +@end /* iCalRecurrenceRule (SOGoExtensions) */ -- 2.39.5