]> err.no Git - scalable-opengroupware.org/commitdiff
added 'show/hide rejected appointments' functionality
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 8 Jul 2005 15:48:48 +0000 (15:48 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 8 Jul 2005 15:48:48 +0000 (15:48 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@707 d1b88da0-ebda-0310-925b-ed51d893ca5b

19 files changed:
SOGo/SoObjects/Appointments/ChangeLog
SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m
SOGo/SoObjects/Appointments/Version
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/English.lproj/Localizable.strings
SOGo/UI/Scheduler/UIxCalView.h
SOGo/UI/Scheduler/UIxCalView.m
SOGo/UI/Scheduler/UIxCalWeekListview.m
SOGo/UI/Scheduler/Version
SOGo/UI/Templates/ChangeLog
SOGo/UI/Templates/UIxCalDayChartview.wox
SOGo/UI/Templates/UIxCalDayListview.wox
SOGo/UI/Templates/UIxCalDayOverview.wox
SOGo/UI/Templates/UIxCalMonthOverview.wox
SOGo/UI/Templates/UIxCalWeekChartview.wox
SOGo/UI/Templates/UIxCalWeekColumnsview.wox
SOGo/UI/Templates/UIxCalWeekListview.wox
SOGo/UI/Templates/UIxCalWeekOverview.wox
SOGo/UI/Templates/UIxPageFrame.wox

index 81ccb122b4305a28b918c89dd5766cea4b20b8e4..9efea09c6b216fac97b190b03f9e6797f834fe49 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-08  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * SOGoAppointmentFolder.m: added 'partmails' and 'partstates' to
+         infos returned by -fetchOverviewInfosFrom:to: (v0.9.36)
+
 2005-07-06  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * v0.9.35
index ebd259665486dca687d8636ebd8d746438ed230c..e85d762ae2266ea2c78f25a141de649304d70177 100644 (file)
@@ -396,7 +396,9 @@ static NSTimeZone *MET    = nil;
     infos = [[NSArray alloc] initWithObjects:
                                @"title", 
                                @"location", @"orgmail", @"status", @"ispublic", 
-                               @"isallday", @"priority", nil];
+                               @"isallday", @"priority",
+                               @"partmails", @"partstates",
+                               nil];
   }
   return [self fetchFields:infos
                from:_startDate
index ffe201b88d57ecd693b8ded3795e26036c73444a..b1ee3cc91a66f1af29e13c0b71c330a2985a1ac9 100644 (file)
@@ -1,6 +1,6 @@
 # Version file
 
-SUBMINOR_VERSION:=35
+SUBMINOR_VERSION:=36
 
 # v0.9.32 requires libGDLContentStore v4.5.26
 # v0.9.28 requires libNGiCal          v4.5.47
index 7b80d28ceeb30a788e7169ac553fd40f212acedf..71a3dc462eb3fca42d7fc735df54c8c8eeeae174 100644 (file)
@@ -1,5 +1,21 @@
 2005-07-08  Marcus Mueller  <znek@mulle-kybernetik.com>
 
+       * v0.9.127
+
+       * UIxCalView.[hm]: added -shouldDisplayRejectedAppointments API. Added
+         toggling of hide/show rejected appointments via form values. Added
+         new -filterAppointments: method to support filtering of appointments
+         (currently used for rejected appointments). Fixed -fetchCoreInfos
+         to use proper accessor method. Fixed aptFlags logic to allow access
+         to appointments that don't belong to user but which user is invited
+         to. Cleaned up +initialize a bit.
+       
+       * UIxCalWeekListview.m: added comment and slightly changed
+         -fetchCoreInfos to do the proper thing
+
+       * English.lproj/Localizable.strings: added labels 'show_rejected_apts'
+         and 'hide_rejected_apts'
+
        * v0.9.126
 
        * UIxComponent+Agenor.[hm]: new method -isAccessRestricted, uses the
index 88e4cebc2f4b702ade928124600fd06afd55ee91..8e481dc84e2905379712e35fd5072e249f5f59d1 100644 (file)
@@ -84,7 +84,8 @@
 "proposal"             = "proposal";
 "Save"                 = "Save";
 "Cancel"               = "Cancel";
-
+"show_rejected_apts"    = "Show rejected appointments";
+"hide_rejected_apts"    = "Hide rejected appointments";
 
 /* Schedule */
 
index 74b0c6bcac96fca5ce83f3169b8271b9bb215406..cb3486e1a9a1b70634d0f656a6378a07a0dcb322 100644 (file)
@@ -73,7 +73,8 @@
 - (unsigned)dayStartHour;
 - (unsigned)dayEndHour;
 - (BOOL)shouldDisplayWeekend;
-    
+- (BOOL)shouldDisplayRejectedAppointments;
+
 - (NSCalendarDate *)referenceDateForFormatter;
  
 - (NSCalendarDate *)thisMonth;
index d2095c88bce96e0c4e6eae34ee88d36017eade72..9887514682717b7d64237fdcb2b7a4ba9ccbf122 100644 (file)
@@ -7,6 +7,7 @@
 #include <NGObjWeb/SoUser.h>
 #include <SOGoUI/SOGoAptFormatter.h>
 #include <NGExtensions/NGCalendarDateRange.h>
+#include <NGiCal/NGiCal.h>
 #include "UIxComponent+Agenor.h"
 
 @interface UIxCalView (PrivateAPI)
 static BOOL shouldDisplayWeekend = NO;
 
 + (void)initialize {
-    NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
-    shouldDisplayWeekend = [ud boolForKey:@"SOGoShouldDisplayWeekend"];
+  static BOOL    didInit = NO;
+  NSUserDefaults *ud;
+
+  if (didInit) return;
+
+  ud                   = [NSUserDefaults standardUserDefaults];
+  shouldDisplayWeekend = [ud boolForKey:@"SOGoShouldDisplayWeekend"];
 }
 
 - (id)init {
@@ -67,9 +73,55 @@ static BOOL shouldDisplayWeekend = NO;
   [self->privateAptTooltipFormatter setPrivateTitle:title];
 }
 
+- (NSArray *)filterAppointments:(NSArray *)_apts {
+  NSMutableArray *filtered;
+  unsigned       i, count;
+  NSString       *email;
+
+  count    = [_apts count];
+  if (!count) return _apts;
+  if ([self shouldDisplayRejectedAppointments]) return _apts;
+
+  filtered = [[[NSMutableArray alloc] initWithCapacity:count] autorelease];
+  email    = [self emailForUser];
+
+  for (i = 0; i < count; i++) {
+    NSDictionary *info;
+    NSArray      *partmails;
+    unsigned     p, pCount;
+    BOOL         shouldAdd;
+    
+    shouldAdd = NO;
+    info      = [_apts objectAtIndex:i];
+    partmails = [[info objectForKey:@"partmails"]
+                       componentsSeparatedByString:@"\n"];
+    pCount     = [partmails count];
+    for (p = 0; p < pCount; p++) {
+      NSString *pEmail;
+
+      pEmail = [partmails objectAtIndex:p];
+      if ([pEmail isEqualToString:email]) {
+        NSArray  *partstates;
+        NSString *state;
+
+        partstates = [[info objectForKey:@"partstates"]
+                            componentsSeparatedByString:@"\n"];
+        state      = [partstates objectAtIndex:p];
+        if ([state intValue] != iCalPersonPartStatDeclined)
+          shouldAdd = YES;
+        break;
+      }
+    }
+    if (shouldAdd)
+      [filtered addObject:info];
+  }
+  return filtered;
+}
+
 /* accessors */
 
 - (void)setAppointments:(NSArray *)_apts {
+  _apts = [self filterAppointments:_apts];
   ASSIGN(self->appointments, _apts);
 }
 - (NSArray *)appointments {
@@ -91,8 +143,15 @@ static BOOL shouldDisplayWeekend = NO;
     self->aptFlags.canAccessApt = YES;
   }
   else {
-    self->aptFlags.isMyApt      = NO;
-    self->aptFlags.canAccessApt = [[_apt valueForKey:@"ispublic"] boolValue];
+    NSString *partmails;
+
+    self->aptFlags.isMyApt = NO;
+
+    partmails = [_apt valueForKey:@"partmails"];
+    if ([partmails rangeOfString:myEmail].length)
+      self->aptFlags.canAccessApt = YES;
+    else
+      self->aptFlags.canAccessApt = [[_apt valueForKey:@"ispublic"] boolValue];
   }
 }
 - (id)appointment {
@@ -313,11 +372,36 @@ static BOOL shouldDisplayWeekend = NO;
     folder             = [self clientObject];
     sd                 = [self startDate];
     ed                 = [self endDate];
-    self->appointments = [[folder fetchOverviewInfosFrom:sd to:ed] retain];
+    [self setAppointments:[folder fetchOverviewInfosFrom:sd to:ed]];
   }
   return self->appointments;
 }
 
+/* query parameters */
+
+- (BOOL)shouldDisplayRejectedAppointments {
+  NSString *bv;
+  
+  bv = [[[self context] request] formValueForKey:@"dr"];
+  if (!bv) return NO;
+  return [bv boolValue];
+}
+
+- (NSDictionary *)toggleShowRejectedAptsQueryParameters {
+  NSMutableDictionary *qp;
+  BOOL                shouldDisplay;
+  
+  shouldDisplay = ![self shouldDisplayRejectedAppointments];
+  qp = [[[self queryParameters] mutableCopy] autorelease];
+  [qp setObject:shouldDisplay ? @"1" : @"0" forKey:@"dr"];
+  return qp;
+}
+
+- (NSString *)toggleShowRejectedAptsLabel {
+  if (![self shouldDisplayRejectedAppointments])
+    return @"show_rejected_apts";
+  return @"hide_rejected_apts";
+}
 
 /* date selection & conversion */
 
index fcf4d689c102f09701a67b1a433c523bb3c015ed..e5931b8d134b5fa4b551c4b14c092910739718f7 100644 (file)
@@ -49,6 +49,9 @@
 
 /* fetching */
 
+/* NOTE: this fetches coreInfos instead of overviewInfos
+ * as is done in the superclass!
+ */
 - (NSArray *)fetchCoreInfos {
   if (!self->appointments) {
     id             folder;
@@ -57,7 +60,7 @@
     folder             = [self clientObject];
     sd                 = [self startDate];
     ed                 = [self endDate];
-    self->appointments = [[folder fetchCoreInfosFrom:sd to:ed] retain];
+    [self setAppointments:[folder fetchCoreInfosFrom:sd to:ed]];
   }
   return self->appointments;
 }
index 05f29d4dafc0aacf98be47b46b7ec7b41cd93839..762af8232f410b5b7de800cde36f8fa34bcf5756 100644 (file)
@@ -1,6 +1,6 @@
 # Version file
 
-SUBMINOR_VERSION:=126
+SUBMINOR_VERSION:=127
 
 # v0.9.123 requires Appointments v0.9.35
 # v0.9.123 requires SOGoUI       v0.9.24
index 7e7065b0642287a2bca85d452b6d1fc98dea60ac..6c75b528d66ea2d0d6df6daebcd3375c9410649a 100644 (file)
@@ -1,5 +1,13 @@
 2005-07-08  Marcus Mueller  <znek@mulle-kybernetik.com>
 
+       * UIxCalDayOverview.wox, UIxCalWeekOverview.wox,
+         UIxCalWeekColumnsview.wox, UIxCalDayChartview.wox,
+         UIxCalDayListview.wox, UIxCalWeekChartview.wox,
+         UIxCalMonthOverview.wox, UIxCalWeekListview.wox:
+         added 'hide/show rejected apts' toggle to all views
+
+       * UIxPageFrame.wox: added 'headers' to the debug output
+
        * UIxAppointmentEditor.wox: removed conditionals from UI as they were
          wrongly placed in the template, component does now deal with it
 
index 31bfc904111ad30343f4b7ef987ee31026c631a3..c0090694128b37b98ab28f0be9b4365b7777c39d 100644 (file)
                         </tr>
                       </table>
                     </td>
+                    <td align="left" bgcolor="#e8e8e0" class="button_auto_env">
+                      <a var:href="ownMethodName"
+                         class="button_auto"
+                         var:queryDictionary="toggleShowRejectedAptsQueryParameters"
+                         label:string="$toggleShowRejectedAptsLabel"
+                      />
+                    </td>
                     <td align="right" bgcolor="#e8e8e0">
                       <table border="0" cellpadding="0" cellspacing="1">
                         <tr>
index a96f41589f59f2193a3295a06b34f6bce472ebb3..02ab86aea9b317c9a53e41d6d7aa530a2cb5e256 100644 (file)
                         </tr>
                       </table>
                     </td>
+                    <td align="left" bgcolor="#e8e8e0" class="button_auto_env">
+                      <a var:href="ownMethodName"
+                         class="button_auto"
+                         var:queryDictionary="toggleShowRejectedAptsQueryParameters"
+                         label:string="$toggleShowRejectedAptsLabel"
+                      />
+                    </td>
                     <td align="right" bgcolor="#e8e8e0">
                       <table border="0" cellpadding="0" cellspacing="1">
                         <tr>
index d7dbcc4f5eb85aba0344c2e09de890be2244a11c..add8d753a86c279de7ff1b24cc86ebb86086cc10 100644 (file)
                         </tr>
                       </table>
                     </td>
+                    <td align="left" bgcolor="#e8e8e0" class="button_auto_env">
+                      <a var:href="ownMethodName"
+                         class="button_auto"
+                         var:queryDictionary="toggleShowRejectedAptsQueryParameters"
+                         label:string="$toggleShowRejectedAptsLabel"
+                      />
+                    </td>
                     <td align="right" bgcolor="#e8e8e0">
                       <table border="0" cellpadding="0" cellspacing="1">
                         <tr>
index 29e60365bcc6d971dcc043a1951728908d06da6a..327e6227a7eb69f1337f98d614a2cfa311809332 100644 (file)
               >
                 <table border="0" cellpadding="4" width="100%" cellspacing="2">
                   <tr>
+                    <td align="left" bgcolor="#e8e8e0" class="button_auto_env">
+                      <a var:href="ownMethodName"
+                         class="button_auto"
+                         var:queryDictionary="toggleShowRejectedAptsQueryParameters"
+                         label:string="$toggleShowRejectedAptsLabel"
+                      />
+                    </td>
                     <td align="right" bgcolor="#e8e8e0">
                       <table border="0" cellpadding="0" cellspacing="1">
                         <tr>
index 4b52132ce5e5e4a5b05d12cc47ba933c3000897c..0d74bb71e14d24121b985bd68b15dfbdf73c66c7 100644 (file)
                         </tr>
                       </table>
                     </td>
+                    <td align="left" bgcolor="#e8e8e0" class="button_auto_env">
+                      <a var:href="ownMethodName"
+                         class="button_auto"
+                         var:queryDictionary="toggleShowRejectedAptsQueryParameters"
+                         label:string="$toggleShowRejectedAptsLabel"
+                      />
+                    </td>
                     <td align="right" bgcolor="#e8e8e0">
                       <table border='0' cellpadding='0' cellspacing='1'>
                         <tr>
index 38665dfb058eec053f0ae8b4dfd6bdc3538b7520..243b1632b76da27af151afebe8eacbc9c51904ca 100644 (file)
                        </tr>
                       </table>
                     </td>
-                    
+                    <td align="left" bgcolor="#e8e8e0" class="button_auto_env">
+                      <a var:href="ownMethodName"
+                         class="button_auto"
+                         var:queryDictionary="toggleShowRejectedAptsQueryParameters"
+                         label:string="$toggleShowRejectedAptsLabel"
+                      />
+                    </td>
                     <td align="right" bgcolor="#e8e8e0">
                       <table border='0' cellpadding='0' cellspacing='1'>
                         <tr>
index 05c69f542465cbacdddfbb232eb71d7227971e35..390fd4b13b3d3455e9c3ee460bc706c1b08fdffa 100644 (file)
                        </tr>
                       </table>
                     </td>
-                    
+                    <td align="left" bgcolor="#e8e8e0" class="button_auto_env">
+                      <a var:href="ownMethodName"
+                         class="button_auto"
+                         var:queryDictionary="toggleShowRejectedAptsQueryParameters"
+                         label:string="$toggleShowRejectedAptsLabel"
+                      />
+                    </td>
                     <td align="right" bgcolor="#e8e8e0">
                       <table border='0' cellpadding='0' cellspacing='1'>
                         <tr>
index 581d2e116951daf1c6f64039027ba099a8705fc5..db627bde9941d4c423ebaac614871c060fa7e5fd 100644 (file)
                </tr>
               </table>
             </td>
-          
+            <td align="left" bgcolor="#e8e8e0" class="button_auto_env">
+              <a var:href="ownMethodName"
+                 class="button_auto"
+                 var:queryDictionary="toggleShowRejectedAptsQueryParameters"
+                 label:string="$toggleShowRejectedAptsLabel"
+              />
+            </td>
             <td align="right" bgcolor="#e8e8e0">
               <table border='0' cellpadding='0' cellspacing='1'>
                 <tr>
index 40a3286b0eff3343f8943fc42d0505af4e4f60bb..262707672ef6bc7183282f6e9d769ebcd45fd448 100644 (file)
                   >NO</var:if>  
                 </td>
               </tr>
+              <tr>
+                <td valign="top">Headers:</td>
+                <td valign="top">
+                  <span style="white-space: pre;">
+                  <var:string value="context.request.headers"
+                              const:escapeHTML="YES"
+                  />
+                  </span>
+                </td>
+              </tr>
             </table>
           </td>
         </tr>