return [[[self context] activeUser] email];
}
+- (iCalEvent *)authorativeEvent {
+ /* DB is considered master, when in DB, ignore mail organizer */
+ return [self isEventStoredInCalendar]
+ ? [self storedEvent]
+ : [self inEvent];
+}
+
- (BOOL)isLoggedInUserTheOrganizer {
NSString *loginEMail;
return NO;
}
- if ([self isEventStoredInCalendar]) {
- /* DB is considered master, when in DB, ignore mail organizer */
- return [[self storedEvent] isOrganizer:loginEMail];
- }
-
- return [[self inEvent] isOrganizer:loginEMail];
+ return [[self authorativeEvent] isOrganizer:loginEMail];
}
- (BOOL)isLoggedInUserAnAttendee {
[self warnWithFormat:@"Could not determine email of logged in user?"];
return NO;
}
+
+ return [[self authorativeEvent] isParticipant:loginEMail];
+}
+
+/* derived fields */
+
+- (NSString *)organizerDisplayName {
+ iCalPerson *organizer;
+ NSString *cn;
- if ([self isEventStoredInCalendar]) {
- /* DB is considered master, when in DB, ignore mail organizer */
- return [[self storedEvent] isParticipant:loginEMail];
+ if ((organizer = [[self authorativeEvent] organizer]) != nil) {
+ cn = [organizer valueForKey:@"cnForDisplay"];
+ if ([cn isNotNull] && [cn length] > 0)
+ return cn;
+
+ cn = [organizer valueForKey:@"rfc822Email"];
+ if ([cn isNotNull] && [cn length] > 0)
+ return cn;
+
+ return @"[error: unable to derive organizer name]";
}
-
- return [[self inEvent] isParticipant:loginEMail];
+
+ return @"[todo: no organizer set, use 'from']";
}
@end /* UIxMailPartICalViewer */
<fieldset>
<legend>
<var:string label:value="Appointment"/>:
- <var:string value="inEvent.summary" />
+ <var:string value="inEvent.summary" /> <!-- TODO: shorted title -->
+
+ <var:if condition="isLoggedInUserTheOrganizer">
+ (<var:string label:value="organized by you"/>)
+ </var:if>
+ <var:if condition="isLoggedInUserAnAttendee">
+ (<var:string label:value="you are an attendee"/>)
+ </var:if>
</legend>
+
+
+ <var:if condition="inCalendar.method" const:value="REQUEST">
+ <!-- sent to attendees to propose or update a meeting -->
+ <var:if condition="isLoggedInUserAnAttendee">
+ <p>
+ Organizer <var:string value="organizerDisplayName" />
+ invites you to participate in a meeting.
+ </p>
+ <!-- TODO: buttons: accept/decline/tentatively -->
+ </var:if>
+
+ <var:if condition="isLoggedInUserAnAttendee" const:negate="1">
+ <p>
+ Organizer <var:string value="organizerDisplayName" />
+ is proposing a meeting to the attendees. You receive this
+ mail as a notification, you are not scheduled as a participant.
+ </p>
+ </var:if>
+ </var:if>
+
- Method: <var:string value="inCalendar.method" /><br/>
+ <var:if condition="inCalendar.method" const:value="REPLY">
+ <!-- sent to organizer to update the status of the participant -->
+ <p>
+ iMIP 'DELETE' requests are not yet supported by SOGo.
+ </p>
+ </var:if>
+
+
+ <var:if condition="inCalendar.method" const:value="CANCEL">
+ <!-- sent to attendees to notify of the attendee being removed or the
+ event being deleted -->
+ <p>
+ <!-- todo: if there are no attendees, the whole meeting was stopped -->
+ Your invitation or the whole event was canceled.
+ </p>
+ </var:if>
+
+
+ <var:if condition="inCalendar.method" const:value="ADD">
+ <!-- TODO -->
+ <p>
+ iMIP 'ADD' requests are not yet supported by SOGo.
+ </p>
+ </var:if>
+
+
+ <var:if condition="inCalendar.method" const:value="PUBLISH">
+ <!-- none-scheduling event sent to someone for adding to the calendar -->
+ </var:if>
+
TODO: Storage:
<var:if condition="isEventStoredInCalendar">
</var:if>
<br />
- TODO: Organizer:
<var:if condition="isLoggedInUserTheOrganizer">
- You are the organizer!
-
<!--
Possible Status:
REPLY => check whether it matches, if not suggest change, show
-->
</var:if>
<var:if condition="isLoggedInUserTheOrganizer" const:negate="1">
- You are not the organizer!
-
- <var:if condition="isLoggedInUserAnAttendee">
- (you are an attendee)
- </var:if>
- <var:if condition="isLoggedInUserAnAttendee" const:negate="1">
- (you are NOT an attendee:
- <var:string value="loggedInUserEMail"/>)
- </var:if>
<!--
Possible Status:
REQUEST => ACCEPT, TENTATIVELY, DECLINE buttons with comment field
DECLINE-COUNTER
-->
</var:if>
- <br />
<div class="linked_attachment_meta" style="background-color: white;">
<table border="0" class="linked_attachment_meta">
<td><var:string label:value="Organizer"/>:</td>
<td>
<a var:href="inEvent.organizer.email"
- ><var:string value="inEvent.organizer.cnForDisplay" /></a>
+ ><var:string value="organizerDisplayName" /></a>
</td>
</tr>