]> err.no Git - scalable-opengroupware.org/commitdiff
work on iCalendar mail viewer
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 15 Jul 2005 11:59:54 +0000 (11:59 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 15 Jul 2005 11:59:54 +0000 (11:59 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@776 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/MailPartViewers/ChangeLog
SOGo/UI/MailPartViewers/UIxMailPartICalViewer.m
SOGo/UI/MailPartViewers/Version
SOGo/UI/Templates/ChangeLog
SOGo/UI/Templates/MailPartViewers/UIxMailPartICalViewer.wox

index 852facbf9a2dd8384ca19d470ff727a1fbb3b3e6..01a7f0b6668cc4f6502a8fd1350cac6c7a51b06e 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-15  Helge Hess  <helge.hess@opengroupware.org>
+
+       * UIxMailPartICalViewer.m: added method to retrieve the authorative
+         event (DB before mail), added a method to return an organizer display
+         name (with appropriate fallbacks) (v0.9.10)
+
 2005-07-15  Helge Hess  <helge.hess@opengroupware.org>
 
        * UIxMailPartICalViewer.m: rewrote not to use SOGoAppointment and to
index 0cc49e0b76895ef7e6caa96e34d459ab08a1ad39..81d842d85d8c78d2e565a8e023be28eb00ba75f3 100644 (file)
   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 */
index 390fe45fc19948121f3e066e36366968e0ae8a12..68132b8feb77d6fafae9d1df1fa0edb12842db4d 100644 (file)
@@ -1,6 +1,6 @@
 # version file
 
-SUBMINOR_VERSION:=9
+SUBMINOR_VERSION:=10
 
 # v0.9.0 requires libNGiCal v4.5.53
 # v0.9.1 requires libNGMime v4.5.213
index d59c5a597f756f1116f892fbea9173ecdda0f5a1..e4df4d1d5de174646d4356b0bc38c2b016f063c1 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-15  Helge Hess  <helge.hess@opengroupware.org>
+
+       * MailPartViewers/UIxMailPartICalViewer.wox: prepared support for iMIP
+         'method' requests
+
 2005-07-14  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * UIxCalScheduleOverview.wox: removed functionality for v0.8 on
index 7edac79e0265a6160aa1173534737ff80a51ab55..f11e0dff74d802d4a8bf4737c291da837e2dc19b 100644 (file)
   <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>