refType = 4;
sourceTree = "<group>";
};
+ ADA63205071330AE0058C21C = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = "SOGoAppointment+UIx.h";
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ ADA63206071330AE0058C21C = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.objc;
+ path = "SOGoAppointment+UIx.m";
+ refType = 4;
+ sourceTree = "<group>";
+ };
ADCDE53106ADA8AC00BFCE2B = {
fileEncoding = 5;
indentWidth = 8;
AD73BE7E06CF90EA00226A2D,
AD071B3C06CCFA2000A9EEF4,
AD071B3D06CCFA2000A9EEF4,
+ ADA63205071330AE0058C21C,
+ ADA63206071330AE0058C21C,
AD73BE6106CF8CC500226A2D,
AD73BE6206CF8CC500226A2D,
);
+2004-10-05 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v0.9.84
+
+ * SOGoAppointment+UIx.[hm]: new class providing UIx convenience methods
+
+ * UIxAppointmentView.[m|wox]: added priority and categories
+
+ * UIxAppointmentEditor.[m|wox]: added priority and categories
+
+ * English.lproj/default.strings: new labels
+
2004-09-25 Helge Hess <helge.hess@opengroupware.org>
* UIxCalDateLabel.m: minor code cleanups, fixed compilation on MacOSX
"Name" = "Name";
"Email" = "Email";
"Location" = "Location";
+"Priority" = "Priority";
+"Categories" = "Categories";
"Duration" = "Duration";
"Participants" = "Participants";
"Resources" = "Resources";
"Chart" = "Chart";
"List" = "List";
"Columns" = "Columns";
+
+/* Priorities */
+
+"prio_0" = "Undefined";
+"prio_1" = "High";
+"prio_2" = "High";
+"prio_3" = "High";
+"prio_4" = "High";
+"prio_5" = "Normal";
+"prio_6" = "Low";
+"prio_7" = "Low";
+"prio_8" = "Low";
+"prio_9" = "Low";
+
+/* Appointment categories */
+
+"APPOINTMENT" = "Appointment";
+"NOT IN OFFICE" = "Outside";
+"MEETING" = "Meeting";
+"HOLIDAY" = "Holiday";
+"PHONE CALL" = "Phone";
UIxAppointmentFormatter.m \
iCalPerson+UIx.m \
NSCalendarDate+UIx.m \
+ SOGoAppointment+UIx.m \
UIxComponent+Agenor.m \
\
UIxCalView.m \
--- /dev/null
+/*
+ Copyright (C) 2000-2004 SKYRIX Software AG
+
+ This file is part of OGo
+
+ 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.
+*/
+// $Id$
+
+
+#ifndef __SOGoAppointment_UIx_H_
+#define __SOGoAppointment_UIx_H_
+
+
+#include <SOGoLogic/SOGoAppointment.h>
+
+
+@interface SOGoAppointment (UIx)
+- (NSString *)priorityLabelKey;
+@end
+
+#endif /* __SOGoAppointment_UIx_H_ */
--- /dev/null
+/*
+ Copyright (C) 2000-2004 SKYRIX Software AG
+
+ This file is part of OGo
+
+ 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.
+*/
+// $Id$
+
+
+#include "SOGoAppointment+UIx.h"
+#include "common.h"
+
+@implementation SOGoAppointment (UIx)
+
+- (NSString *)priorityLabelKey {
+ NSString *prio;
+
+ prio = [self priority];
+ if(!prio) {
+ prio = @"0";
+ }
+ else {
+ NSRange r;
+
+ r = [prio rangeOfString:@";"];
+ if(r.length > 0) {
+ prio = [prio substringToIndex:r.location];
+ }
+ }
+ return [NSString stringWithFormat:@"prio_%@", prio];
+}
+
+@end
NSString *comment;
NSArray *participants; /* array of iCalPerson's */
NSArray *resources; /* array of iCalPerson's */
+ NSString *priority;
+ NSArray *categories;
}
- (NSString *)iCalStringTemplate;
[self->title release];
[self->location release];
[self->comment release];
+ [self->priority release];
+ [self->categories release];
[self->iCalString release];
[self->item release];
[super dealloc];
return self->resources;
}
+/* priorities */
+
+- (NSArray *)priorities {
+ /* 0 == undefined
+ 5 == normal
+ 1 == high
+ */
+ return [NSArray arrayWithObjects:
+ @"0", @"5", @"1", nil];
+}
+
+- (NSString *)itemPriorityText {
+ NSString *key;
+
+ key = [NSString stringWithFormat:@"prio_%@", self->item];
+ return [self labelForKey:key];
+}
+
+- (void)setPriority:(NSString *)_priority {
+ ASSIGN(self->priority, _priority);
+}
+- (NSString *)priority {
+ return self->priority;
+}
+
+
+/* categories */
+
+- (NSArray *)categoryItems {
+ // TODO: make this configurable?
+ /*
+ Tasks categories will be modified as follow :
+ – by default (a simple logo or no logo at all),
+ – appointment,
+ – outside,
+ – meeting,
+ – holidays,
+ – phone.
+ */
+ return [NSArray arrayWithObjects:
+ @"APPOINTMENT",
+ @"NOT IN OFFICE",
+ @"MEETING",
+ @"HOLIDAY",
+ @"PHONE CALL",
+ nil];
+}
+
+- (NSString *)itemCategoryText {
+ return [self labelForKey:self->item];
+}
+
+- (void)setCategories:(NSArray *)_categories {
+ ASSIGN(self->categories, _categories);
+}
+- (NSArray *)categories {
+ return self->categories;
+}
+
+
/* iCal */
- (void)setICalString:(NSString *)_s {
- (NSString *)iCalStringTemplate {
static NSString *iCalStringTemplate = \
- @"BEGIN:VCALENDAR\nMETHOD:REQUEST\nPRODID:OpenGroupware.org SOGo 0.9\n"
+ @"BEGIN:VCALENDAR\n"
+ @"METHOD:REQUEST\n"
+ @"PRODID:OpenGroupware.org SOGo 0.9\n"
@"VERSION:2.0\n"
@"BEGIN:VEVENT\n"
@"UID:%@\n"
@"DTEND:%@\n"
@"TRANSP:OPAQUE\n"
@"SEQUENCE:1\n"
+ @"PRIORITY:5\n"
@"%@"
@"END:VEVENT\n"
@"END:VCALENDAR";
[self->startDate setTimeZone:[self viewTimeZone]];
[self->endDate setTimeZone:[self viewTimeZone]];
- self->title = [[_appointment summary] copy];
- self->location = [[_appointment location] copy];
- self->comment = [[_appointment comment] copy];
-
+ self->title = [[_appointment summary] copy];
+ self->location = [[_appointment location] copy];
+ self->comment = [[_appointment comment] copy];
+ self->priority = [[_appointment priority] copy];
+ self->categories = [[_appointment categories] retain];
self->participants = [[_appointment participants] retain];
self->resources = [[_appointment resources] retain];
}
[_appointment setSummary:[self title]];
[_appointment setLocation:[self location]];
-
+ [_appointment setComment:[self comment]];
+ [_appointment setPriority:[self priority]];
+ [_appointment setCategories:[self categories]];
+
attendees = [self participants];
lResources = [self resources];
if ([lResources count] > 0) {
</span>
</td>
</tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Priority" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <var:popup list="priorities"
+ item="item"
+ string="itemPriorityText"
+ selection="priority"
+ />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Categories" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <var:checkbox-list list="categoryItems"
+ item="item"
+ suffix="itemCategoryText"
+ selections="categories"
+ />
+ </span>
+ </td>
+ </tr>
</table>
</td>
</tr>
id appointment;
id attendee;
SOGoDateFormatter *dateFormatter;
+ id item;
}
- (id)appointment;
@implementation UIxAppointmentView
- (void)dealloc {
- [self->appointment release];
- [self->attendee release];
+ [self->appointment release];
+ [self->attendee release];
[self->dateFormatter release];
+ [self->item release];
[super dealloc];
}
return self->attendee;
}
+- (void)setItem:(id)_item {
+ ASSIGN(self->item, _item);
+}
+- (id)item {
+ return self->item;
+}
+
- (SOGoDateFormatter *)dateFormatter {
if (self->dateFormatter == nil) {
self->dateFormatter =
<var:string value="appointment.location" />
</td>
</tr>
+ <tr valign="top">
+ <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
+ <var:string label:value="Priority" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:string label:value="$appointment.priorityLabelKey" />
+ </td>
+ </tr>
</table>
</td>
</tr>
/>
</td>
</tr>
+ <tr valign="top">
+ <td align="right"
+ width="15%"
+ bgcolor="#E8E8E0"
+ class="aptview_text"
+ >
+ <var:string label:value="Categories" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:foreach list="appointment.categories" item="item">
+ <var:string label:value="$item"
+ /><var:entity const:name="nbsp" />
+ </var:foreach>
+ </td>
+ </tr>
<tr valign="top">
<td align="right"
width="15%"
# $Id$
-SUBMINOR_VERSION:=83
+SUBMINOR_VERSION:=84
+# v0.9.84 requires libSOGoLogic v0.9.12
# v0.9.70 requires libNGExtensions v4.3.107
# v0.9.67 requires SOPE 4.3
# v0.9.61 requires libNGExtensions v4.2.102
+2004-10-05 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v0.9.12
+
+ * SOGoAppointment.[hm]: added priority and categories, also fixed bug
+ in setComment:. Introduced hasComment to simplify handling.
+
+ * SOGoAppointmentICalRenderer.m: correctly render priority, categories
+ and comment.
+
2004-09-25 Helge Hess <helge.hess@opengroupware.org>
* fixed compilation on MacOSX (v0.9.11)
*/
@class NSString, NSArray, NSCalendarDate;
-@class iCalPerson;
+@class iCalPerson, iCalEvent;
@interface SOGoAppointment : NSObject
{
id calendar;
- id event;
+ iCalEvent *event;
id participants;
}
- (void)setComment:(NSString *)_value;
- (NSString *)comment;
+- (BOOL)hasComment;
+
+- (void)setPriority:(NSString *)_value;
+- (NSString *)priority;
+- (BOOL)hasPriority;
+
+- (void)setCategories:(NSArray *)_value;
+- (NSArray *)categories;
+- (BOOL)hasCategories;
- (void)setStatus:(NSString *)_value;
- (NSString *)status;
}
- (void)setComment:(NSString *)_value {
+ if([_value length] == 0)
+ _value = nil;
[self->event setComment:_value];
}
- (NSString *)comment {
return [self->event comment];
}
+- (BOOL)hasComment {
+ NSString *s = [self comment];
+ if(!s || [s length] == 0)
+ return NO;
+ return YES;
+}
+
+- (void)setPriority:(NSString *)_value {
+ [self->event setPriority:_value];
+}
+- (NSString *)priority {
+ return [self->event priority];
+}
+- (BOOL)hasPriority {
+ NSString *prio = [self priority];
+ NSRange r;
+
+ if(!prio)
+ return NO;
+
+ r = [prio rangeOfString:@";"];
+ if(r.length > 0) {
+ prio = [prio substringToIndex:r.location];
+ }
+ return [prio isEqualToString:@"0"] ? NO : YES;
+}
+
+- (void)setCategories:(NSArray *)_value {
+ NSString *catString;
+
+ if(!_value || [_value count] == 0) {
+ [self->event setCategories:nil];
+ return;
+ }
+ _value = [_value sortedArrayUsingSelector:@selector(compareAscending:)];
+ catString = [_value componentsJoinedByString:@","];
+ [self->event setCategories:catString];
+ [catString release];
+}
+- (NSArray *)categories {
+ NSString *catString;
+ NSArray *cats;
+ NSRange r;
+
+ catString = [self->event categories];
+ if(!catString) {
+ return [NSArray array];
+ }
+ r = [catString rangeOfString:@";"];
+ if(r.length > 0) {
+ catString = [catString substringToIndex:r.location];
+ }
+ cats = [catString componentsSeparatedByString:@","];
+ return cats;
+}
+- (BOOL)hasCategories {
+ return [self->event categories] != nil ? YES : NO;
+}
- (void)setStatus:(NSString *)_value {
[self->event setStatus:_value];
}
- (NSString *)status {
- return [(iCalEvent *)self->event status];
+ return [self->event status];
}
- (void)setStartDate:(NSCalendarDate *)_date {
[s appendString:[event duration]];
[s appendString:@"\n"];
}
-
+ if([_apt hasPriority]) {
+ [s appendString:@"PRIORITY:"];
+ [s appendString:[_apt priority]];
+ [s appendString:@"\n"];
+ }
+ if([_apt hasCategories]) {
+ NSString *catString;
+
+ catString = [[_apt categories] componentsJoinedByString:@","];
+ [s appendString:@"CATEGORIES:"];
+ [s appendString:catString];
+ [s appendString:@"\n"];
+ }
+ if([_apt hasComment]) {
+ [s appendString:@"COMMENT:"];
+ [s appendString:[_apt comment]];
+ [s appendString:@"\n"];
+ }
+
[s appendString:@"STATUS:"];
[s appendString:[_apt status]];
[s appendString:@"\n"];
+
/* what's all this? */
[s appendString:@"TRANSP:OPAQUE\n"]; /* transparency */
# $Id$
-SUBMINOR_VERSION:=11
+SUBMINOR_VERSION:=12