]> err.no Git - scalable-opengroupware.org/commitdiff
fixed SOGo bug #1052
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 10 Dec 2004 18:20:35 +0000 (18:20 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 10 Dec 2004 18:20:35 +0000 (18:20 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@469 d1b88da0-ebda-0310-925b-ed51d893ca5b

43 files changed:
SOGo/SOGo.xcode/project.pbxproj
SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m
SOGo/SoObjects/Appointments/Version
SOGo/SoObjects/ChangeLog
SOGo/UI/Common/ChangeLog
SOGo/UI/Common/UIxPageFrame.m
SOGo/UI/Common/UIxPageFrame.wox
SOGo/UI/Common/Version
SOGo/UI/SOGoUI/ChangeLog
SOGo/UI/SOGoUI/SOGoAptFormatter.h
SOGo/UI/SOGoUI/SOGoAptFormatter.m
SOGo/UI/SOGoUI/Version
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/English.lproj/default.strings
SOGo/UI/Scheduler/GNUmakefile
SOGo/UI/Scheduler/UIxAppointmentEditor.m
SOGo/UI/Scheduler/UIxAppointmentEditor.wox
SOGo/UI/Scheduler/UIxAppointmentView.h
SOGo/UI/Scheduler/UIxAppointmentView.m
SOGo/UI/Scheduler/UIxAppointmentView.wox
SOGo/UI/Scheduler/UIxCalDayChartview.m
SOGo/UI/Scheduler/UIxCalDayChartview.wox
SOGo/UI/Scheduler/UIxCalDayListview.m
SOGo/UI/Scheduler/UIxCalDayListview.wox
SOGo/UI/Scheduler/UIxCalDayOverview.wox
SOGo/UI/Scheduler/UIxCalDayPrintview.wox
SOGo/UI/Scheduler/UIxCalInlineAptView.m [new file with mode: 0644]
SOGo/UI/Scheduler/UIxCalInlineAptView.wox [new file with mode: 0644]
SOGo/UI/Scheduler/UIxCalMonthOverview.wox
SOGo/UI/Scheduler/UIxCalMonthPrintview.m
SOGo/UI/Scheduler/UIxCalView.h
SOGo/UI/Scheduler/UIxCalView.m
SOGo/UI/Scheduler/UIxCalWeekChartview.m
SOGo/UI/Scheduler/UIxCalWeekChartview.wox
SOGo/UI/Scheduler/UIxCalWeekColumnsview.wox
SOGo/UI/Scheduler/UIxCalWeekListview.m
SOGo/UI/Scheduler/UIxCalWeekListview.wox
SOGo/UI/Scheduler/UIxCalWeekOverview.wox
SOGo/UI/Scheduler/UIxCalWeekPrintview.m
SOGo/UI/Scheduler/UIxCalWeekPrintview.wox
SOGo/UI/Scheduler/Version
SOGoLogic/SOGoAppointment.h
SOGoLogic/SOGoAppointment.m

index 57de016fb10c5a89258c30d5206a13df0ddd83c5..9c9dbfaa145f7c53b6919e0658debd013a72e91b 100644 (file)
                };
                AD0137A406DF8875000910D8 = {
                        children = (
+                               ADAD40CA0769FFD000AAD24E,
+                               ADAD40C90769FFD000AAD24E,
                                AD73BE8806CF92FC00226A2D,
                                AD73BE8906CF92FC00226A2D,
                                E87208F70692E3D30099CBBD,
                        refType = 4;
                        sourceTree = "<group>";
                };
+               ADAD40C90769FFD000AAD24E = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.xml;
+                       path = UIxCalInlineAptView.wox;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               ADAD40CA0769FFD000AAD24E = {
+                       fileEncoding = 5;
+                       indentWidth = 2;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = UIxCalInlineAptView.m;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
                ADBE3C490726AF4C000FEA6A = {
                        fileEncoding = 5;
                        indentWidth = 2;
                ADDF4DBA06DE0E6500C4E7F8 = {
                        children = (
                                E87206880692E3D10099CBBD,
+                               E87206A00692E3D10099CBBD,
+                               E87206A10692E3D10099CBBD,
                                E872069C0692E3D10099CBBD,
                                E872069D0692E3D10099CBBD,
                                E872069E0692E3D10099CBBD,
                                E872069F0692E3D10099CBBD,
-                               E87206A00692E3D10099CBBD,
-                               E87206A10692E3D10099CBBD,
                                E87206A20692E3D10099CBBD,
                                E87206A30692E3D10099CBBD,
                        );
index fa785701bf270dc741c86d29a487a6aec990eb8c..7303ffe0c035a9e068e35ef023b7391cd51a6a6a 100644 (file)
@@ -198,7 +198,8 @@ static NSTimeZone *MET = nil;
   fields = [NSArray arrayWithObjects:
                      @"uid", @"startdate", @"enddate",
                      @"title", @"participants", @"location", @"isallday",
-                     @"iscycle", @"partmails", @"sequence",
+                     @"iscycle", @"partmails", @"sequence", @"ispublic",
+          @"isopaque", @"status", @"orgmail",
                    nil];
   
   records = [_folder fetchFields:fields matchingQualifier:qualifier];
index 87351aca8ccce9eee61cc5f3452720f2012e0376..faf0dee1f5f07b9acc94a35e00687a72c92232ae 100644 (file)
@@ -1,5 +1,5 @@
 # Version file
 
-SUBMINOR_VERSION:=16
+SUBMINOR_VERSION:=17
 
 # v0.9.13 requires libSOGo v0.9.26
index b95aacbc06992518be521795c38733f4bc6f2e68..be5d83521c63270b0b5c1c9232e10ada6ed7a857 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-10  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * Appointments/SOGoAppointmentFolder.m: added new quickinfo attributes
+         for fetching (v0.9.17)
+
 2004-12-08  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * GNUmakefile: added Sieve product
index 902dfa90182e68250a2de47d9dcd6dd048f07982..50966c620b4d3b43aba6529c8dc7cb45ed767bae 100644 (file)
@@ -1,3 +1,7 @@
+2004-12-09  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * UIxPageFrame.[wox,m]: added -ownerInContext debug info (v0.9.30)
+
 2004-12-08  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * calendar.css: added styles for others' appointments in
index 439e812517d9f356f8a286bdea82b89037204bc8..8e3fb52858ea9646af673b54d92ee589cb4526c3 100644 (file)
@@ -25,7 +25,7 @@
 @interface UIxPageFrame : UIxComponent
 {
   NSString *title;
-  id item;
+  id       item;
 }
 
 @end
@@ -36,8 +36,8 @@
 @implementation UIxPageFrame
 
 - (void)dealloc {
-  [self->item        release];
-  [self->title       release];
+  [self->item  release];
+  [self->title release];
   [super dealloc];
 }
 
@@ -49,7 +49,7 @@
 - (NSString *)title {
   if ([self isUIxDebugEnabled])
     return self->title;
-  
+
   return [self labelForKey:@"OpenGroupware.org"];
 }
 
   return self->item;
 }
 
+- (NSString *)ownerInContext {
+  return [[self clientObject] ownerInContext:[self context]];
+}
+
+
 /* notifications */
 
 - (void)sleep {
index 69224348fea65d5f97baa102c5d5140985f67e20..97a0ba4506f7d6b94fad73fb71b935fe986263af 100644 (file)
                 <td valign="top">clientObject:</td>
                 <td valign="top"><var:string value="clientObject" /></td>
               </tr>
+              <tr>
+                <td valign="top">ownerInContext:</td>
+                <td valign="top"><var:string value="ownerInContext" /></td>
+              </tr>
               <tr>
                 <td valign="top">traversal stack:</td>
                 <td valign="top">
index 824ee0bb8c7f9d7aab5da174562fef877668a20a..cd3c0f2b2498d45d6375c0a1a766d20e74dbba47 100644 (file)
@@ -1,5 +1,5 @@
 # Version file
 
-SUBMINOR_VERSION:=29
+SUBMINOR_VERSION:=30
 
 # v0.9.28 requires NGExtensions v4.5.136
index 57a9ab7a8c7d6141850d92e087edd47586c9159b..5c4d9f4cad38512e5018066236e78f15264926db 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-10  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * SOGoAptFormatter.[hm]: added formatting for private apts, additional
+         cleanup (v0.9.19)
+
 2004-12-08  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * UIxComponent.m: changed to use NGLogging (v0.9.18)
index 62e14b14c738eb30b2aa87609d6ad114e1eab8bd..151e60fc940c1eda1a687a4fbb090dcada09e51c 100644 (file)
 
 @interface SOGoAptFormatter : NSFormatter
 {
-    NSTimeZone *tz;
-    SEL formatAction;
+  NSTimeZone *tz;
+  SEL formatAction;
 }
 
 - (id)initWithDisplayTimeZone:(NSTimeZone *)_tz;
 
 - (void)setTooltip;
 - (void)setFullDetails;
+- (void)setTitleOnly;
+- (void)setShortTitleOnly;
 
+- (void)setPrivateTooltip;
+- (void)setPrivateDetails;
+- (void)setPrivateSuppressAll;
+  
 @end
 
 #endif /* __SOGoAptFormatter_H_ */
index da72100f11348cc759d154c81d161b1379f1d2f4..9168f4e4ae2d07166be3f6d22fadf2761c34f199 100644 (file)
 #include "common.h"
 
 @interface SOGoAptFormatter(PrivateAPI)
+- (NSString *)titleForApt:(id)_apt;
 - (NSString *)shortTitleForApt:(id)_apt;
 - (NSTimeZone *)displayTZ;
+- (void)appendTimeInfoFromApt:(id)_apt toBuffer:(NSMutableString *)_buf;
 @end
 
 @implementation SOGoAptFormatter
   self->formatAction = @selector(fullDetailsForApt:);
 }
 
-- (NSString *)stringForObjectValue:(id)_obj {
-  return [self performSelector:self->formatAction withObject:_obj];
+- (void)setPrivateTooltip {
+  self->formatAction = @selector(tooltipForPrivateApt:);
 }
 
-/* Helpers */
+- (void)setPrivateDetails {
+  self->formatAction = @selector(detailsForPrivateApt:);
+}
 
-- (NSString *)shortTitleForApt:(id)_apt {
-  NSString *title;
-  
-  title = [_apt valueForKey:@"title"];
-  if ([title length] > 12)
-    title = [[title substringToIndex:11] stringByAppendingString:@"..."];
-  
-  return title;
+- (void)setTitleOnly {
+  self->formatAction = @selector(titleForApt:);
+}
+
+- (void)setShortTitleOnly {
+  self->formatAction = @selector(shortTitleForApt:);
+}
+
+- (void)setPrivateSuppressAll {
+  self->formatAction = @selector(suppressApt:);
+}
+
+- (NSString *)stringForObjectValue:(id)_obj {
+  return [self performSelector:self->formatAction withObject:_obj];
 }
 
 /* Private */
   return self->tz;
 }
 
-- (NSString *)fullDetailsForApt:(id)_apt {
+- (void)appendTimeInfoFromApt:(id)_apt toBuffer:(NSMutableString *)_buf {
   NSCalendarDate *startDate, *endDate;
-  NSMutableString *aptDescr;
-  NSString *s;
-  BOOL spansRange;
-    
+  BOOL           spansRange;
+
   spansRange = NO;
-  startDate = [_apt valueForKey:@"startDate"];
+  startDate  = [_apt valueForKey:@"startDate"];
   [startDate setTimeZone:[self displayTZ]];
-  endDate = [_apt valueForKey:@"endDate"];
+  endDate    = [_apt valueForKey:@"endDate"];
   if(endDate != nil) {
     [endDate setTimeZone:[self displayTZ]];
     spansRange = ![endDate isEqualToDate:startDate];
   }
-  aptDescr = [[NSMutableString alloc] init];
-  [aptDescr appendFormat:@"%02i:%02i",
-           [startDate hourOfDay],
-           [startDate minuteOfHour]];
+  [_buf appendFormat:@"%02i:%02i",
+                       [startDate hourOfDay],
+                       [startDate minuteOfHour]];
   if(spansRange) {
-    [aptDescr appendFormat:@", %02i:%02i",
-             [endDate hourOfDay],
-             [endDate minuteOfHour]];
+    [_buf appendFormat:@", %02i:%02i",
+                         [endDate hourOfDay],
+                         [endDate minuteOfHour]];
   }
+}
+
+- (NSString *)titleForApt:(id)_apt {
+  return [_apt valueForKey:@"title"];
+}
+
+- (NSString *)shortTitleForApt:(id)_apt {
+  NSString *title;
   
+  title = [self titleForApt:_apt];
+  if ([title length] > 12)
+    title = [[title substringToIndex:11] stringByAppendingString:@"..."];
+  
+  return title;
+}
+
+- (NSString *)fullDetailsForApt:(id)_apt {
+  NSMutableString *aptDescr;
+  NSString *s;
+    
+  aptDescr = [NSMutableString stringWithCapacity:60];
+  [self appendTimeInfoFromApt:_apt toBuffer:aptDescr];
   if ((s = [_apt valueForKey:@"location"]) != nil) {
     if([s length] > 12)
       s = [[s substringToIndex:11] stringByAppendingString:@"..."];
   if ((s = [_apt valueForKey:@"title"]) != nil)
     [aptDescr appendFormat:@"<br />%@", [self shortTitleForApt:_apt]];
   
-  return [aptDescr autorelease];
+  return aptDescr;
+}
+
+- (NSString *)detailsForPrivateApt:(id)_apt {
+  NSMutableString *aptDescr;
+
+  aptDescr = [NSMutableString stringWithCapacity:25];
+  [self appendTimeInfoFromApt:_apt toBuffer:aptDescr];
+  return aptDescr;
 }
 
 - (NSString *)tooltipForApt:(id)_apt {
     [endDate setTimeZone:[self displayTZ]];
     spansRange = ![endDate isEqualToDate:startDate];
   }
-  aptDescr = [[NSMutableString alloc] init];
+  aptDescr = [NSMutableString stringWithCapacity:60];
   [aptDescr appendString:@"appointment"];
   [aptDescr appendFormat:@"\n%02i:%02i",
            [startDate hourOfDay],
   if ((s = [_apt valueForKey:@"location"]) != nil)
     [aptDescr appendFormat:@"\n%@", s];
     
-  return [aptDescr autorelease];
+  return aptDescr;
+}
+
+- (NSString *)tooltipForPrivateApt:(id)_apt {
+  NSCalendarDate *startDate, *endDate;
+  NSMutableString *aptDescr;
+  BOOL spansRange;
+  
+  spansRange = NO;
+  startDate  = [_apt valueForKey:@"startDate"];
+  [startDate setTimeZone:[self displayTZ]];
+  endDate = [_apt valueForKey:@"endDate"];
+  if(endDate != nil) {
+    [endDate setTimeZone:[self displayTZ]];
+    spansRange = ![endDate isEqualToDate:startDate];
+  }
+  aptDescr = [NSMutableString stringWithCapacity:25];
+  [aptDescr appendString:@"appointment"];
+  [aptDescr appendFormat:@"\n%02i:%02i",
+    [startDate hourOfDay],
+    [startDate minuteOfHour]];
+  if (spansRange) {
+    [aptDescr appendFormat:@" - %02i:%02i",
+      [endDate hourOfDay],
+      [endDate minuteOfHour]];
+  }
+  return aptDescr;
+}
+
+- (NSString *)suppressApt:(id)_apt {
+  return @"";
 }
 
 @end /* SOGoAptFormatter */
index 4c33edb4dced11958f416f92af6482cb6aef99a9..4973dd211cf48726d4863eedadca6417e9b1157f 100644 (file)
@@ -1,5 +1,5 @@
 # $Id$
 
-SUBMINOR_VERSION:=18
+SUBMINOR_VERSION:=19
 
 # v0.9.18 requires NGExtensions v4.5.136
index 1a86657ff61ad0689acbc39739e624bce2166f7f..57b981f9f2f866cc8477bac9ed6728db2acd10ae 100644 (file)
@@ -1,3 +1,32 @@
+2004-12-10  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * v0.9.98
+
+       * English.lproj/default.strings: provided additional localizable
+         strings for event "classification" (private/public).
+
+       * UIxAppointmentView.[wox,m], UIxAppointmentEditor.[wox,m]: added
+         workaround for SOGo bug #1052, private details are hidden now
+         from others. Also, apts are not editable by non-owners any longer.
+
+       * UIxCalView.[hm]: added formatters for private appointments. Also,
+         added flags for caching special information about apts (public,
+         owned) etc. This outphases the use of tooltip.../shortText...
+         for all calviews (with the exception of printviews). Subclasses
+         may need to override -configureFormatters to adjust them according
+         to their needs.
+
+       * UIxCalInlineAptView.[hm]: new view used by all calviews to render
+         appointments using formatters.
+
+       * UIxCalDayOverview.wox, UIxCalDayListview.[wox,m],
+         UIxCalDayChartview.[wox,m], UIxCalDayPrintview.wox,
+         UIxCalWeekOverview.wox, UIxCalWeekListview.[wox,m],
+         UIxCalWeekChartview.[wox,m], UIxCalWeekColumnsview.wox,
+         UIxCalWeekPrintview.[wox.m], UIxCalMonthOverview.wox:
+         changed to use UIxCalInlineAptView and provided -configureFormatters
+         which fixes SOGo bug #1052
+
 2004-12-09  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * v0.9.97
index 16dc7e64d45116acd0f26ea5925543c828e95fe4..3800aa1686e42b8c19a75d775fc5c5d386c84c3a 100644 (file)
 "dayLabelFormat"       = "%Y-%m-%d";
 "today"                        = "today";
 
+
 /* Week */
 
 "Week"                 = "Week";
 "this week"            = "this week";
 
+
 /* Month */
 
 "this month"           = "this month";
 "a3_November"          = "Nov";
 "a3_December"          = "Dec";
 
+
 /* Year */
 
 "this year"            = "this year";
 
+
 /* Menu */
 
 "Calendar"             = "Calendar";
 "Contacts"             = "Contacts";
 
+
 /* Misc */
 
 "OpenGroupware.org"    = "OpenGroupware.org";
 
+
 /* Button titles */
 
 "new"                  = "new";
@@ -79,6 +85,7 @@
 "Save"                 = "Save";
 "Cancel"               = "Cancel";
 
+
 /* Appointments */
 
 "Appointment viewer"   = "Appointment Viewer";
 
 "attributes"           = "Attributes";
 "participants"         = "Participants";
+/* checkbox title */
 "is private"            = "is private";
+/* classification */
+"Public"               = "Public";
+"Private"              = "Private";
+
 
 /* Searching */
 
 "Search appointments"  = "Search appointments";
 "Search in Anais"      = "Search in Anaïs";
 
+
 /* calendar modes */
 
 "Overview"             = "Overview";
 "List"                 = "List";
 "Columns"              = "Columns";
 
+
 /* Priorities */
 
 "prio_0"               = "Undefined";
 "prio_8"               = "Low";
 "prio_9"               = "Low";
 
+
 /* Appointment categories */
 
 "APPOINTMENT"          = "Appointment";
index 796a4ca72c0ab0861577cdac21938055e163d070..090c1911db761be3a4f0d79139f288e9d9d0e79c 100644 (file)
@@ -46,6 +46,7 @@ SchedulerUI_OBJC_FILES =              \
        UIxDatePickerScript.m           \
        UIxTimeSelector.m               \
        UIxTimeDateControl.m            \
+       UIxCalInlineAptView.m           \
 
 SchedulerUI_RESOURCE_FILES += \
        Version         \
@@ -77,6 +78,7 @@ SchedulerUI_RESOURCE_FILES +=         \
        UIxDatePickerScript.wox         \
        UIxTimeSelector.wox             \
        UIxTimeDateControl.wox          \
+       UIxCalInlineAptView.wox         \
 
 SchedulerUI_RESOURCE_FILES += \
        images/next_week.gif                    \
index 5f447c5f183fde6f03e5e3df0dcf3514f4e29b9c..86993d5e9dee1cc1890f77664d8be6fa22bba535 100644 (file)
   [self loadValuesFromICalString:_s];
 }
 
+
+/* access */
+
+- (BOOL)isMyApt {
+  NSString *owner;
+
+  owner = [[self clientObject] ownerInContext:[self context]];
+  if (!owner)
+    return YES;
+  return [owner isEqualToString:[[self user] login]];
+}
+
+- (BOOL)canAccessApt {
+  return [self isMyApt];
+}
+
+- (BOOL)canEditApt {
+  return [self isMyApt];
+}
+
+
 /* actions */
 
 - (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c{
index cc4b2695189746c9dd044445bf80aeb1c31ea0c9..d8dbd0c79b4f34a8b5a32b3f7c84a3be7936a241 100644 (file)
                className="UIxPageFrame"
                title="name"
 >
-  <form var:href="clientObject.baseURL">
-    <table cellspacing="0" cellpadding="5" width="100%">
-      <tr>
-        <td>
-          <table cellpadding="0" cellspacing="0" width="100%">
-            <tr>
-              <td width="5"/>
-              <td class="window_label">
-                <var:string label:value="Appointment editor" /></td>
-              <td width="36" align="right" valign="center">
-                <var:component className="UIxWinClose" />
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <var:if condition="hasErrorText">
-           <div style="background-color: #AA0000;">
-             <var:string value="errorText" />
-            </div>
-            <hr />
-          </var:if>
-
-          <table border="0" cellpadding="2" cellspacing="0" width="100%"
-                 bgcolor="#e8e8e0"
-          >
-            <tr>
-              <td align="left" colspan="2">
-                <span class="aptview_title">
-                  <var:string label:value="Appointment on" /> 
-                  <var:string formatter="titleDateFormatter" 
-                              value="aptStartDate" /></span>
-              </td>
-            </tr>
-            <tr valign="top">
-              <td align="right" width="15%">
-                <span class="aptview_text">
-                  <var:string label:value="Start time" />:
-                </span>
-              </td>
-              <td align="left" bgcolor="#FFFFF0">
-                <span class="aptview_text">
-                  <var:component className="UIxDatePickerScript" />
-                  <var:component className="UIxTimeDateControl"
-                                 const:controlID="startTime"
-                                 date="aptStartDate"
-                  />
-                </span>
-              </td>
-            </tr>
-            <tr valign="top">
-              <td align="right" width="15%">
-                <span class="aptview_text">
-                  <var:string label:value="End time" />:
-                </span>
-              </td>
-              <td align="left" bgcolor="#FFFFF0">
-                <span class="aptview_text">
-                  <var:component className="UIxTimeDateControl"
-                                 const:controlID="endTime"
-                                 date="aptEndDate"
-                  />
-                </span>
-              </td>
-            </tr>
-            <tr valign="top">
-              <td align="right" width="15%">
-                <span class="aptview_text">
-                  <var:string label:value="Title" />:
-                </span>
-              </td>
-              <td align="left" bgcolor="#FFFFF0">
-                <span class="aptview_text">
-                  <input type="text" name="summary" const:size="40"
-                         var:value="title" />
-                </span>
-              </td>
-            </tr>
-            <tr valign="top">
-              <td align="right" width="15%">
-                <span class="aptview_text">
-                  <var:string label:value="Location" />:
-                </span>
-              </td>
-              <td align="left" bgcolor="#FFFFF0">
-                <span class="aptview_text">
-                  <input type="text" name="location" const:size="40"
-                         var:value="location" />
-                </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>
-            <tr valign="top">
-              <td align="right" width="15%">
-                <span class="aptview_text">
-                  <var:string label:value="Classification" />:
-                </span>
-              </td>
-              <td align="left" bgcolor="#FFFFF0">
-                <span class="aptview_text">
-                  <input type="checkbox"
-                         var:selection="isPrivate"
-                         var:checked="isPrivate"
-                  /> <var:string label:value="is private" />
-                </span>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <table border="0" cellpadding="2" cellspacing="0"
-                 width="100%" bgcolor="#e8e8e0"
-          >
-            <tr>
-              <td align="left" colspan="2">
-                <span class="aptview_title">
-                  <var:string label:value="Search participants" /> 
-                </span>
-              </td>
-            </tr>
-            <tr valign="top">
-              <td align="right" width="15%">
-                <span class="aptview_text">
-                  <var:string label:value="Participants" />:</span>
-              </td>
-              <td align="left" bgcolor="#FFFFF0">
-                <span class="aptview_text">
-                  <var:component className="AnaisAttendeeSelector"
-                                 const:selectorID="participant"
-                                 const:role="REQ-PARTICIPANT"
-                                 attendees="participants"
-                                 var:emailForUser="emailForUser"
-                                 var:cnForUser="cnForUser"
-                                 const:withCN="YES"
-                                 const:withAddressBook="YES"
-                  />
-                </span>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <table border="0" cellpadding="2" cellspacing="0" width="100%"
-                 bgcolor="#e8e8e0"
-          >
-            <tr>
-              <td align="left" colspan="2">
-                <span class="aptview_title">
-                  <var:string label:value="Search resources" />
-                </span>
-              </td>
-            </tr>
-            <tr valign="top">
-              <td align="right" width="15%">
-                <span class="aptview_text">
-                  <var:string label:value="Resources" />:
-                </span>
-              </td>
-              <td align="left" bgcolor="#FFFFF0">
-                <span class="aptview_text">
-                  <var:component className="AnaisAttendeeSelector"
-                                 const:selectorID="resource"
-                                 const:role="NON-PARTICIPANT"
-                                 attendees="resources"
-                                 const:withCN="YES"
-                                 const:withAddressBook="YES"
-                  />
-                </span>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <table border="0" cellpadding="2" cellspacing="0" width="100%"
-                 bgcolor="#e8e8e0"
-          >
-            <tr>
-              <td align="left" colspan="2">
-                <span class="aptview_title">
-                  <var:string label:value="Comment" />
-                </span>
-              </td>
-            </tr>
-            <tr valign="top">
-              <td align="right" width="15%">
-                <span class="aptview_text">
-                  <var:string label:value="Comment" />:
-                </span>
-              </td>
-              <td align="left" bgcolor="#FFFFF0">
-                <span class="aptview_text">
-                  <textarea name="comment" rows="8" cols="80" wrap="physical"
-                            var:value="comment" />
-                </span>
-              </td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-      <tr>
-        <td>
-            <input type="submit" label:value="Save" name="save:method" />
-            <span class="button_auto_env"
-            ><a href="../weekoverview"
-                var:queryDictionary="queryParameters"
-                class="button_auto"
-             ><var:string label:value="Cancel" /></a></span>
-            <var:if condition="isUIxDebugEnabled">
-              <input type="submit" value="Test" name="test:method" />
+  <var:if condition="canEditApt"> <!-- workaround -->
+    <form var:href="clientObject.baseURL">
+      <table cellspacing="0" cellpadding="5" width="100%">
+        <tr>
+          <td>
+            <table cellpadding="0" cellspacing="0" width="100%">
+              <tr>
+                <td width="5"/>
+                <td class="window_label">
+                  <var:string label:value="Appointment editor" /></td>
+                <td width="36" align="right" valign="center">
+                  <var:component className="UIxWinClose" />
+                </td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+        <tr>
+          <td>
+            <var:if condition="hasErrorText">
+           <div style="background-color: #AA0000;">
+             <var:string value="errorText" />
+              </div>
+              <hr />
             </var:if>
-        </td>
-      </tr>
-    </table>
-
-    <input type="hidden" name="ical" var:value="iCalString" />
-  </form>
+  
+            <table border="0" cellpadding="2" cellspacing="0" width="100%"
+                   bgcolor="#e8e8e0"
+            >
+              <tr>
+                <td align="left" colspan="2">
+                  <span class="aptview_title">
+                    <var:string label:value="Appointment on" /> 
+                    <var:string formatter="titleDateFormatter" 
+                                value="aptStartDate" /></span>
+                </td>
+              </tr>
+              <tr valign="top">
+                <td align="right" width="15%">
+                  <span class="aptview_text">
+                    <var:string label:value="Start time" />:
+                  </span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <var:component className="UIxDatePickerScript" />
+                    <var:component className="UIxTimeDateControl"
+                                   const:controlID="startTime"
+                                   date="aptStartDate"
+                    />
+                  </span>
+                </td>
+              </tr>
+              <tr valign="top">
+                <td align="right" width="15%">
+                  <span class="aptview_text">
+                    <var:string label:value="End time" />:
+                  </span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <var:component className="UIxTimeDateControl"
+                                   const:controlID="endTime"
+                                   date="aptEndDate"
+                    />
+                  </span>
+                </td>
+              </tr>
+              <tr valign="top">
+                <td align="right" width="15%">
+                  <span class="aptview_text">
+                    <var:string label:value="Title" />:
+                  </span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <input type="text" name="summary" const:size="40"
+                           var:value="title" />
+                  </span>
+                </td>
+              </tr>
+              <tr valign="top">
+                <td align="right" width="15%">
+                  <span class="aptview_text">
+                    <var:string label:value="Location" />:
+                  </span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <input type="text" name="location" const:size="40"
+                           var:value="location" />
+                  </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>
+              <tr valign="top">
+                <td align="right" width="15%">
+                  <span class="aptview_text">
+                    <var:string label:value="Classification" />:
+                  </span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <input type="checkbox"
+                           var:selection="isPrivate"
+                           var:checked="isPrivate"
+                    /> <var:string label:value="is private" />
+                  </span>
+                </td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+        <tr>
+          <td>
+            <table border="0" cellpadding="2" cellspacing="0"
+                   width="100%" bgcolor="#e8e8e0"
+            >
+              <tr>
+                <td align="left" colspan="2">
+                  <span class="aptview_title">
+                    <var:string label:value="Search participants" /> 
+                  </span>
+                </td>
+              </tr>
+              <tr valign="top">
+                <td align="right" width="15%">
+                  <span class="aptview_text">
+                    <var:string label:value="Participants" />:</span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <var:component className="AnaisAttendeeSelector"
+                                   const:selectorID="participant"
+                                   const:role="REQ-PARTICIPANT"
+                                   attendees="participants"
+                                   var:emailForUser="emailForUser"
+                                   var:cnForUser="cnForUser"
+                                   const:withCN="YES"
+                                   const:withAddressBook="YES"
+                    />
+                  </span>
+                </td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+        <tr>
+          <td>
+            <table border="0" cellpadding="2" cellspacing="0" width="100%"
+                   bgcolor="#e8e8e0"
+            >
+              <tr>
+                <td align="left" colspan="2">
+                  <span class="aptview_title">
+                    <var:string label:value="Search resources" />
+                  </span>
+                </td>
+              </tr>
+              <tr valign="top">
+                <td align="right" width="15%">
+                  <span class="aptview_text">
+                    <var:string label:value="Resources" />:
+                  </span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <var:component className="AnaisAttendeeSelector"
+                                   const:selectorID="resource"
+                                   const:role="NON-PARTICIPANT"
+                                   attendees="resources"
+                                   const:withCN="YES"
+                                   const:withAddressBook="YES"
+                    />
+                  </span>
+                </td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+        <tr>
+          <td>
+            <table border="0" cellpadding="2" cellspacing="0" width="100%"
+                   bgcolor="#e8e8e0"
+            >
+              <tr>
+                <td align="left" colspan="2">
+                  <span class="aptview_title">
+                    <var:string label:value="Comment" />
+                  </span>
+                </td>
+              </tr>
+              <tr valign="top">
+                <td align="right" width="15%">
+                  <span class="aptview_text">
+                    <var:string label:value="Comment" />:
+                  </span>
+                </td>
+                <td align="left" bgcolor="#FFFFF0">
+                  <span class="aptview_text">
+                    <textarea name="comment" rows="8" cols="80" wrap="physical"
+                              var:value="comment" />
+                  </span>
+                </td>
+              </tr>
+            </table>
+          </td>
+        </tr>
+        <tr>
+          <td>
+              <input type="submit" label:value="Save" name="save:method" />
+              <span class="button_auto_env"
+              ><a href="../weekoverview"
+                  var:queryDictionary="queryParameters"
+                  class="button_auto"
+               ><var:string label:value="Cancel" /></a></span>
+              <var:if condition="isUIxDebugEnabled">
+                <input type="submit" value="Test" name="test:method" />
+              </var:if>
+          </td>
+        </tr>
+      </table>
+  
+      <input type="hidden" name="ical" var:value="iCalString" />
+    </form>
+  </var:if>
+  <var:if condition="canEditApt" const:negate="YES">
+    Forbidden
+  </var:if>
 </var:component>
index fda112b25fe5cbbe774ae452f83391d32579243d..84dcf5b8082d795de00d23ae7aad020829d0aac4 100644 (file)
 
 - (id)appointment;
 
+/* permissions */
+- (BOOL)canAccessApt;
+- (BOOL)canEditApt;
+  
 - (SOGoDateFormatter *)dateFormatter;
 - (NSCalendarDate *)startTime;
 - (NSCalendarDate *)endTime;
index a892a06b72b6045f1cda6ae2fcc8009e19c53787..9346d7742c4d61d7a8ff56e18388a49c91f18487 100644 (file)
@@ -5,6 +5,7 @@
 #include <SOGoLogic/SOGoAppointment.h>
 #include <Appointments/SOGoAppointmentObject.h>
 #include <SOGoUI/SOGoDateFormatter.h>
+#include "UIxComponent+Agenor.h"
 #include "common.h"
 
 @implementation UIxAppointmentView
   return href;
 }
 
+
+/* access */
+
+- (BOOL)isMyApt {
+  NSString *owner;
+  
+  owner = [[self clientObject] ownerInContext:[self context]];
+  if (!owner)
+    return YES;
+  return [owner isEqualToString:[[self user] login]];
+}
+
+- (BOOL)canAccessApt {
+  if ([self isMyApt])
+    return YES;
+  
+  /* not my apt - can access if it's public */
+  return [[self appointment] isPublic];
+}
+
+- (BOOL)canEditApt {
+  return [self isMyApt];
+}
+
+
 /* action */
 
 - (id)defaultAction {
index 58be703a7bb3e2de725294f5ad2b8c5ee9fe8bbc..1b15f9ef1d4c08a8359bbeec1c4689998777ab60 100644 (file)
                        target="SOGoPrintView"
                     ><var:string label:value="printview" /></a>
                   </td>
-                  <td class="button_auto_env" nowrap="true"
-                      valign='middle' align='center'>
-                    <a class="button_auto"
-                       href="edit"
-                       var:queryDictionary="queryParameters"
-                    ><var:string label:value="edit" /></a>
-                  </td>
+                  <var:if condition="canEditApt">
+                    <td class="button_auto_env" nowrap="true"
+                        valign='middle' align='center'>
+                      <a class="button_auto"
+                         href="edit"
+                         var:queryDictionary="queryParameters"
+                      ><var:string label:value="edit" /></a>
+                    </td>
+                  </var:if>
                   <td class="button_auto_env" nowrap="true"
                       valign='middle' align='center'>
                     <a class="button_auto"
     </tr>
     <tr>
       <td valign="top" width="100%">
-        <table width="100%" border="0" cellpadding="4" cellspacing="0">
-        <!-- general appointment info -->
-        <tr valign="top">
-          <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-            <var:string label:value="Title" />:
-          </td>
-          <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-            <var:string value="appointment.summary" />
-          </td>
-        </tr>
-        <tr valign="top">
-          <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
-            <var:string label:value="Location" />:
-          </td>
-          <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-            <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 width="100%" border="0" cellpadding="4" cellspacing="0">  
+          <!-- general appointment info -->
+          <var:if condition="canAccessApt">  
+            <tr valign="top">
+              <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
+                <var:string label:value="Title" />:
+              </td>
+              <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+                <var:string value="appointment.summary" />
+              </td>
+            </tr>
+            <tr valign="top">
+              <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
+                <var:string label:value="Location" />:
+              </td>
+              <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+                <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>
+          </var:if>
+          <tr valign="top">
+              <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
+                <var:string label:value="Classification" />:
+              </td>
+              <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+                <var:if condition="appointment.isPublic">Public</var:if>
+                <var:if condition="appointment.isPublic"
+                        const:negate="YES"
+                >Private</var:if>
+              </td>
+            </tr>
         </table>
      </td>
     </tr>
                   />
                 </td>
               </tr>
+              <var:if condition="canAccessApt">  
+                <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:string value="categoriesAsString" />
+                  </td>
+                </tr>
+                <tr valign="top">
+                  <td align="right"
+                      width="15%"
+                      bgcolor="#E8E8E0"
+                      class="aptview_text"
+                  >
+                    <var:string label:value="Resources" />:
+                  </td>
+                  <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+                    <var:string value="resourcesAsString"
+                                const:escapeHTML="NO"
+                    />
+                  </td>
+                </tr>
+                <tr valign="top">
+                  <td align="right"
+                      width="15%"
+                      bgcolor="#E8E8E0"
+                      class="aptview_text"
+                  >
+                    <var:string label:value="Organizer" />:
+                  </td>
+                  <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+                    <var:string value="appointment.organizer.cnForDisplay" />
+                  </td>
+                </tr>
+                <tr valign="top">
+                  <td align="right"
+                      width="15%"
+                      bgcolor="#E8E8E0"
+                      class="aptview_text"
+                  >
+                    <var:string label:value="Comment" />:
+                  </td>
+                  <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+                    <var:string value="appointment.comment" const:insertBR="1" />
+                  </td>
+                </tr>
+              </var:if>
+            </table>
+          </uix:tab>
+          <var:if condition="canAccessApt">    
+  
+            <uix:tab const:key="participants"
+                     const:label="participants"
+                     var:href="participantsTabLink"
+            >
+              <table width="100%" border="0" cellpadding="4" cellspacing="0">
               <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:string value="categoriesAsString" />
-                </td>
-              </tr>
-              <tr valign="top">
-                <td align="right"
-                    width="15%"
-                    bgcolor="#E8E8E0"
-                    class="aptview_text"
-                >
-                  <var:string label:value="Resources" />:
+                <td align="left" bgcolor="#E8E8E0" class="aptview_title">
+                    <var:string label:value="Name" />
                 </td>
-                <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="resourcesAsString"
-                              const:escapeHTML="NO"
-                  />
+                <td align="left" bgcolor="#E8E8E0" class="aptview_title">
+                    <var:string label:value="Email" />
                 </td>
               </tr>
+              <var:foreach list="appointment.participants"
+                           item="attendee"
+              >
               <tr valign="top">
-                <td align="right"
-                    width="15%"
-                    bgcolor="#E8E8E0"
-                    class="aptview_text"
-                >
-                  <var:string label:value="Organizer" />:
-                </td>
                 <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="appointment.organizer.cnForDisplay" />
-                </td>
-              </tr>
-              <tr valign="top">
-                <td align="right"
-                    width="15%"
-                    bgcolor="#E8E8E0"
-                    class="aptview_text"
-                >
-                  <var:string label:value="Comment" />:
+                    <var:string value="attendee.cnForDisplay" />
                 </td>
                 <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="appointment.comment" const:insertBR="1" />
+                    <a var:href="attendee.email"
+                    ><var:string value="attendee.rfc822Email" /></a>
                 </td>
               </tr>
-            </table>
-          </uix:tab>
-          <uix:tab const:key="participants"
-                   const:label="participants"
-                   var:href="participantsTabLink"
-          >
-            <table width="100%" border="0" cellpadding="4" cellspacing="0">
-            <tr valign="top">
-              <td align="left" bgcolor="#E8E8E0" class="aptview_title">
-                  <var:string label:value="Name" />
-              </td>
-              <td align="left" bgcolor="#E8E8E0" class="aptview_title">
-                  <var:string label:value="Email" />
-              </td>
-            </tr>
-            <var:foreach list="appointment.participants"
-                         item="attendee"
-            >
-            <tr valign="top">
-              <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:string value="attendee.cnForDisplay" />
-              </td>
-              <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <a var:href="attendee.email"
-                  ><var:string value="attendee.rfc822Email" /></a>
-              </td>
-            </tr>
-            </var:foreach>
-            </table>
-          </uix:tab>
+              </var:foreach>
+              </table>
+            </uix:tab>
+          </var:if>
           <var:if condition="isUIxDebugEnabled">
             <uix:tab const:key="debug"
                      const:label="DEBUG"
index 27243568c7b30cb6f3025842111518bda8ef0923..a6e8d61f729ac0b4fe65c5e4bbbc0a30c69362df 100644 (file)
 @implementation UIxCalDayChartview
 
 - (NSArray *)columns {
-    static NSArray *columns = nil;
-    if(columns == nil) {
-        columns = [[NSArray arrayWithObject:@"0"] retain];
-    }
-    return columns;
+  static NSArray *columns = nil;
+  if(columns == nil) {
+    columns = [[NSArray arrayWithObject:@"0"] retain];
+  }
+  return columns;
 }
 
 - (BOOL)isPadColumn {
@@ -47,7 +47,9 @@
 }
 
 - (NSString *)shortTextForApt {
-    return [[self appointment] valueForKey:@"title"];
+  if (![self canAccessApt])
+    return @"";
+  return [[self appointment] valueForKey:@"title"];
 }
 
 @end
index d3a803877dc63172927ac546f0d353b6616869ba..2c41d811d19d273fc9dbc43b6aaf4dcd871e8f4f 100644 (file)
                                              const:valign="top"
                             >
                               <span class="dayoverview_content_time_link">
-                                <a var:href="appointmentViewURL"
-                                   var:queryDictionary="currentDateQueryParameters"
-                                   var:title="tooltipForApt"
-                                   var:class="aptStyle"
-                                ><var:string value="shortTextForApt"
-                                             const:escapeHTML="NO"
-                                  /></a>
+                                <var:component className="UIxCalInlineAptView"
+                                               appointment="appointment"
+                                               formatter="aptFormatter"
+                                               tooltipFormatter="aptTooltipFormatter"
+                                               url="appointmentViewURL"
+                                               style="aptStyle"
+                                               queryDictionary="currentDayQueryParameters"
+                                               canAccess="canAccessApt"
+                                />
                               </span>
                             </var:matrix-cell>
                           </var:vspan-matrix>
index a33e5e450c7006a344f38ae04437a8c77ccd3450..8d8848f813cd6d0bd66dd44b99d8814645c00dee 100644 (file)
@@ -63,6 +63,8 @@
 }
 
 - (NSString *)shortTextForApt {
+  if (![self canAccessApt])
+    return @"";
   return [[self appointment] valueForKey:@"title"];
 }
 
index 2b9ff18d6d45200e992c3beccee2f829fb5fa221..e2e27b8741d0d22d063d6753471367730495a450 100644 (file)
                                              const:valign="top"
                             >
                               <span class="dayoverview_content_time_link">
-                                <a var:href="appointmentViewURL"
-                                   var:queryDictionary="currentDateQueryParameters"
-                                   var:title="tooltipForApt"
-                                   var:class="aptStyle"
-                                ><var:string value="shortTextForApt"
-                                             const:escapeHTML="NO"
-                                  /></a>
+                                <var:component className="UIxCalInlineAptView"
+                                               appointment="appointment"
+                                               formatter="aptFormatter"
+                                               tooltipFormatter="aptTooltipFormatter"
+                                               url="appointmentViewURL"
+                                               style="aptStyle"
+                                               queryDictionary="currentDayQueryParameters"
+                                               canAccess="canAccessApt"
+                                />
                               </span>
                             </var:matrix-cell>
                           </var:hspan-matrix>
index 20abf6a5bc665519e6e0d00f36b307a590ccbebf..673ed0f8b7844302d825c167138bc3b1813c843e 100644 (file)
                               </span>
                             </td>
                             <td class="dayoverview_content_apts" width="90%">
-                              <var:foreach list="aptsForCurrentDate" item="appointment">
-                                <a var:href="appointmentViewURL"
-                                   var:queryDictionary="currentDateQueryParameters"
-                                   var:title="tooltipForApt"
-                                   var:class="aptStyle"
-                                ><var:string value="shortTextForApt"
-                                             const:escapeHTML="NO"
-                                 /></a>
+                              <var:foreach list="aptsForCurrentDate"
+                                           item="appointment"
+                              >
+                                <var:component className="UIxCalInlineAptView"
+                                               appointment="appointment"
+                                               formatter="aptFormatter"
+                                               tooltipFormatter="aptTooltipFormatter"
+                                               url="appointmentViewURL"
+                                               style="aptStyle"
+                                               queryDictionary="currentDayQueryParameters"
+                                               canAccess="canAccessApt"
+                                />
                                 <br />
                               </var:foreach>
                             </td>
index 9dcdafa9a8c955d97833f2aa3c96bd6c1bb8b5c9..371e2e10be26043125addf2f881ce43903e3ee23 100644 (file)
@@ -30,7 +30,8 @@
           </td>
           <td class="dayprintview_content">
             <var:foreach list="allDayApts" item="appointment">
-              <var:string value="shortTextForApt"
+              <var:string value="appointment"
+                          formatter="aptFormatter"
                           const:escapeHTML="NO"
               />
               <br />
           </td>
           <var:foreach list="aptsForCurrentDate" item="appointment">
             <td class="dayprintview_content">
-              <var:string value="shortTextForApt"
+              <var:string value="appointment"
+                          formatter="aptFormatter"
                           const:escapeHTML="NO"
-                          var:style="aptStyle"
+                          style="aptStyle"
               />
             </td>
-            <var:if condition="minRequiredRowSpan" const:value="1" const:negate="YES">
+            <var:if condition="minRequiredRowSpan"
+                    const:value="1"
+                    const:negate="YES"
+            >
             </var:if>
           </var:foreach>
           <var:if condition="hasNoAptsForCurrentDate">
diff --git a/SOGo/UI/Scheduler/UIxCalInlineAptView.m b/SOGo/UI/Scheduler/UIxCalInlineAptView.m
new file mode 100644 (file)
index 0000000..555254f
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ 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 <NGObjWeb/NGObjWeb.h>
+
+@interface UIxCalInlineAptView : WOComponent
+{
+  id   appointment;
+  id   formatter;
+  id   tooltipFormatter;
+  id   url;
+  id   style;
+  id   queryDictionary;
+  BOOL canAccess;
+}
+
+@end
+
+#include "common.h"
+
+@implementation UIxCalInlineAptView
+
+- (void)dealloc {
+  [self->appointment      release];
+  [self->formatter        release];
+  [self->tooltipFormatter release];
+  [self->url              release];
+  [self->style            release];
+  [self->queryDictionary  release];
+  [super dealloc];
+}
+
+- (void)setAppointment:(id)_appointment {
+  ASSIGN(self->appointment, _appointment);
+}
+- (id)appointment {
+  return self->appointment;
+}
+
+- (void)setFormatter:(id)_formatter {
+  ASSIGN(self->formatter, _formatter);
+}
+- (id)formatter {
+  return self->formatter;
+}
+
+- (void)setTooltipFormatter:(id)_tooltipFormatter {
+  ASSIGN(self->tooltipFormatter, _tooltipFormatter);
+}
+- (id)tooltipFormatter {
+  return self->tooltipFormatter;
+}
+
+- (void)setUrl:(id)_url {
+  ASSIGN(self->url, _url);
+}
+- (id)url {
+  return self->url;
+}
+
+- (void)setStyle:(id)_style {
+  ASSIGN(self->style, _style);
+}
+- (id)style {
+  return self->style;
+}
+
+- (void)setQueryDictionary:(id)_queryDictionary {
+  ASSIGN(self->queryDictionary, _queryDictionary);
+}
+- (id)queryDictionary {
+  return self->queryDictionary;
+}
+
+- (void)setCanAccess:(BOOL)_canAccess {
+  self->canAccess = _canAccess;
+}
+- (BOOL)canAccess {
+  return self->canAccess;
+}
+
+/* helpers */
+
+- (NSString *)tooltip {
+  return [self->tooltipFormatter stringForObjectValue:self->appointment];
+}
+
+@end
diff --git a/SOGo/UI/Scheduler/UIxCalInlineAptView.wox b/SOGo/UI/Scheduler/UIxCalInlineAptView.wox
new file mode 100644 (file)
index 0000000..0e058bb
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version='1.0' standalone='yes'?>
+
+<span xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:var="http://www.skyrix.com/od/binding"
+      xmlns:const="http://www.skyrix.com/od/constant"
+      xmlns:rsrc="OGo:url"
+>
+  <var:if condition="canAccess">
+    <a var:href="url"
+       var:title="tooltip"
+       var:queryDictionary="queryDictionary"
+    ><small><var:string value="appointment"
+                        formatter="formatter"
+                        const:escapeHTML="NO"
+                        style="style"
+            /></small></a>
+  </var:if>
+  <var:if condition="canAccess" const:negate="YES">
+    <small><var:string value="appointment"
+                       formatter="formatter"
+                       const:escapeHTML="NO"
+                       style="style"
+           /></small>
+  </var:if>
+</span>
\ No newline at end of file
index 9606c2e2f9156241fbeb1bb98ac5e28993a819ce..a47689b38304aaa6fd0f37aba13f4d8e432e2c02 100644 (file)
                 >
                   <var:month-info>
                     <var:if condition="hasHolidayInfo">
-                      <var:string value="holidayInfo" const:class="monthoverview_holidayinfo"/>
+                      <var:string value="holidayInfo"
+                                  const:class="monthoverview_holidayinfo"
+                      />
                     </var:if>
                     <var:foreach list="allDayApts" item="appointment">
-                      <a var:href="appointmentViewURL"
-                      ><var:string value="shortTextForApt"
-                                   const:escapeHTML="NO"
-                       /></a>
+                      <var:component className="UIxCalInlineAptView"
+                                     appointment="appointment"
+                                     formatter="aptFormatter"
+                                     tooltipFormatter="aptTooltipFormatter"
+                                     url="appointmentViewURL"
+                                     style="aptStyle"
+                                     canAccess="canAccessApt"
+                      />
                       <br />
                     </var:foreach>
                   </var:month-info>
                     </span>
                   </var:month-title>
                   <var:month>
-                    <a var:href="appointmentViewURL"
-                       class="monthoverview_content_link"
-                       var:title="tooltipForApt"
-                       var:queryDictionary="currentDayQueryParameters"
-                    ><var:string value="shortTextForApt"
-                                 const:escapeHTML="NO"
-                     /></a>
+                    <var:component className="UIxCalInlineAptView"
+                                   appointment="appointment"
+                                   formatter="aptFormatter"
+                                   tooltipFormatter="aptTooltipFormatter"
+                                   url="appointmentViewURL"
+                                   style="aptStyle"
+                                   canAccess="canAccessApt"
+                    />
                     <br />
                   </var:month>
                 </var:month-overview>
index 5dbd2644f7bbbde3312714d74da31afb62e7e88d..9563157a9a65873f37297e3b329e1c489fa5b338 100644 (file)
   NSMutableString *aptDescr;
   NSString        *s;
   BOOL            isMyApt;
+  BOOL            canAccessApt;
   BOOL            spansRange;
   id              apt;
   
-  apt        = [self appointment];
-  isMyApt    = [self isMyApt];
-  spansRange = NO;
-  startDate  = [apt valueForKey:@"startDate"];
+  apt          = [self appointment];
+  isMyApt      = [self isMyApt];
+  canAccessApt = [self canAccessApt];
+  spansRange   = NO;
+  startDate    = [apt valueForKey:@"startDate"];
   [startDate setTimeZone:[self viewTimeZone]];
-  endDate    = [apt valueForKey:@"endDate"];
+  endDate      = [apt valueForKey:@"endDate"];
   if(endDate != nil) {
     [endDate setTimeZone:[self viewTimeZone]];
     spansRange = ![endDate isEqualToDate:startDate];
                              [endDate minuteOfHour]];
   }
   [aptDescr appendFormat:@"</span>,"];
-  if(!isMyApt)
+  if (!isMyApt)
     [aptDescr appendFormat:@"<span class=\"%@\">", [self aptStyle]];
-  s = [apt valueForKey:@"title"];
-  if(s) {
-    [aptDescr appendFormat:@"<br />%@", s];
-  }
-  s = [apt valueForKey:@"location"];
-  if(s) {
-    [aptDescr appendFormat:@"<br />%@", s];
+  if (canAccessApt) {
+    s = [apt valueForKey:@"title"];
+    if(s) {
+      [aptDescr appendFormat:@"<br />%@", s];
+    }
+    s = [apt valueForKey:@"location"];
+    if(s) {
+      [aptDescr appendFormat:@"<br />%@", s];
+    }
   }
   if(!isMyApt)
     [aptDescr appendString:@"</span>"];
index 44a4678a1001c712c4f60f5319af24f83750e133..74b0c6bcac96fca5ce83f3169b8271b9bb215406 100644 (file)
 
 @interface UIxCalView : UIxComponent
 {
-  NSArray        *appointments;
-  NSArray        *allDayApts;
-  id             appointment;
-  NSCalendarDate *currentDay;
+  NSArray          *appointments;
+  NSArray          *allDayApts;
+  id               appointment;
+  NSCalendarDate   *currentDay;
   SOGoAptFormatter *aptFormatter;
   SOGoAptFormatter *aptTooltipFormatter;
+  SOGoAptFormatter *privateAptFormatter;
+  SOGoAptFormatter *privateAptTooltipFormatter;
+
+  struct {
+    unsigned isMyApt      : 1;
+    unsigned canAccessApt : 1;
+    unsigned RESERVED     : 30;
+  } aptFlags;
 }
 
+
+/* config */
+
+- (void)configureFormatters;
+
 /* accessors */
 
 - (NSArray *)appointments;
 - (NSArray *)allDayApts;
 - (id)appointment;
 - (BOOL)isMyApt;
+- (BOOL)canAccessApt; /* protection */
 
 - (BOOL)hasDayInfo;
 - (BOOL)hasHoldidayInfo;
index 5515e3f8058e6f86bdd2dcde4579aeb361960eae..f6a8a267d596e3276cffc34c1a93d27ffb0ecf8c 100644 (file)
@@ -23,16 +23,45 @@ static BOOL shouldDisplayWeekend = NO;
     shouldDisplayWeekend = [ud boolForKey:@"SOGoShouldDisplayWeekend"];
 }
 
+- (id)init {
+  self = [super init];
+  if(self) {
+    NSTimeZone *tz;
+    
+    tz = [self viewTimeZone];
+    self->aptFormatter =
+      [[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
+    self->aptTooltipFormatter =
+      [[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
+    self->privateAptFormatter =
+      [[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
+    self->privateAptTooltipFormatter =
+      [[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
+    [self configureFormatters];
+  }
+  return self;
+}
+
 - (void)dealloc {
-  [self->appointments        release];
-  [self->allDayApts          release];
-  [self->appointment         release];
-  [self->currentDay          release];
-  [self->aptFormatter        release];
-  [self->aptTooltipFormatter release];
+  [self->appointments               release];
+  [self->allDayApts                 release];
+  [self->appointment                release];
+  [self->currentDay                 release];
+  [self->aptFormatter               release];
+  [self->aptTooltipFormatter        release];
+  [self->privateAptFormatter        release];
+  [self->privateAptTooltipFormatter release];
   [super dealloc];
 }
 
+/* subclasses should override this */
+- (void)configureFormatters {
+  [self->aptFormatter setFullDetails];
+  [self->aptTooltipFormatter setTooltip];
+  [self->privateAptFormatter setPrivateDetails];
+  [self->privateAptTooltipFormatter setPrivateTooltip];
+}
+
 /* accessors */
 
 - (void)setAppointments:(NSArray *)_apts {
@@ -43,12 +72,40 @@ static BOOL shouldDisplayWeekend = NO;
 }
 
 - (void)setAppointment:(id)_apt {
+  NSString *mailtoChunk;
+  NSString *myEmail;
+
   ASSIGN(self->appointment, _apt);
+
+  /* cache some info about apt for faster access */
+  
+  mailtoChunk = [_apt valueForKey:@"orgmail"];
+  myEmail     = [self emailForUser];
+  if ([mailtoChunk rangeOfString:myEmail].length > 0) {
+    self->aptFlags.isMyApt      = YES;
+    self->aptFlags.canAccessApt = YES;
+  }
+  else {
+    self->aptFlags.isMyApt      = NO;
+    self->aptFlags.canAccessApt = [[_apt valueForKey:@"ispublic"] boolValue];
+  }
 }
 - (id)appointment {
   return self->appointment;
 }
 
+- (BOOL)isMyApt {
+  return self->aptFlags.isMyApt ? YES : NO;
+}
+
+- (BOOL)canAccessApt {
+  return self->aptFlags.canAccessApt ? YES : NO;
+}
+
+- (BOOL)canNotAccessApt {
+  return self->aptFlags.canAccessApt ? NO : YES;
+}
+
 - (NSDictionary *)aptTypeDict {
   return nil;
 }
@@ -60,32 +117,32 @@ static BOOL shouldDisplayWeekend = NO;
 }
 
 - (SOGoAptFormatter *)aptFormatter {
-  if (self->aptFormatter)
+  if(self->aptFlags.canAccessApt)
     return self->aptFormatter;
-  
-  self->aptFormatter = [[SOGoAptFormatter alloc]
-                         initWithDisplayTimeZone:[self viewTimeZone]];
-  [self->aptFormatter setFullDetails];
-  return self->aptFormatter;
+  return self->privateAptFormatter;
 }
 
 - (SOGoAptFormatter *)aptTooltipFormatter {
-  if (self->aptTooltipFormatter)
+  if(self->aptFlags.canAccessApt)
     return self->aptTooltipFormatter;
-  self->aptTooltipFormatter = [[SOGoAptFormatter alloc]
-                                initWithDisplayTimeZone:[self viewTimeZone]];
-  [self->aptTooltipFormatter setTooltip];
-  return self->aptTooltipFormatter;
+  return self->privateAptTooltipFormatter;
 }
 
 /* TODO: remove this */
 - (NSString *)shortTextForApt {
+  [self warnWithFormat:@"%s IS DEPRECATED!", __PRETTY_FUNCTION__];
+  if (![self canAccessApt])
+    return @"";
   return [[self aptFormatter] stringForObjectValue:self->appointment];
 }
 
 - (NSString *)shortTitleForApt {
   NSString *title;
-    
+
+  [self warnWithFormat:@"%s IS DEPRECATED!", __PRETTY_FUNCTION__];
+
+  if (![self canAccessApt])
+    return @"";
   title = [self->appointment valueForKey:@"title"];
   if ([title length] > 12)
     title = [[title substringToIndex:11] stringByAppendingString:@"..."];
@@ -97,17 +154,6 @@ static BOOL shouldDisplayWeekend = NO;
   return [[self aptTooltipFormatter] stringForObjectValue:self->appointment];
 }
 
-- (BOOL)isMyApt {
-  NSString *mailtoChunk;
-  NSString *myEmail;
-
-  mailtoChunk = [self->appointment valueForKey:@"partmails"];
-  myEmail = [self emailForUser];
-  if ([mailtoChunk rangeOfString:myEmail].length > 0)
-    return YES;
-  return NO;
-}
-
 - (NSString *)aptStyle {
   if (![self isMyApt])
     return @"apt_other";
@@ -163,8 +209,7 @@ static BOOL shouldDisplayWeekend = NO;
     NSNumber *bv;
 
     apt = [apts objectAtIndex:i];
-#warning !! check if isAllDay is correct
-    bv = [apt valueForKey:@"isAllDay"];
+    bv = [apt valueForKey:@"isallday"];
     if ([bv boolValue])
       [filtered addObject:apt];
   }
index 94e746d0fcc0049c29abd7624ab2fbe1adeba307..434a0a0e9ddbd7ced033e2a8c42e1dd4c29c9fe6 100644 (file)
@@ -37,6 +37,7 @@
 #include <NGExtensions/NGCalendarDateRange.h>
 #include <SOGoLogic/AgenorUserManager.h>
 #include <sys/param.h> // MIN, MAX
+#include <SOGoUI/SOGoAptFormatter.h>
 
 @implementation UIxCalWeekChartview
 
@@ -162,10 +163,13 @@ of the current column (currentDay is set to be this date) */
 
 /* descriptions */
 
-- (NSString *)shortTextForApt {
-  return [[self appointment] valueForKey:@"title"];
+- (void)configureFormatters {
+  [super configureFormatters];
+  [self->aptFormatter setTitleOnly];
+  [self->privateAptFormatter setPrivateDetails];
 }
 
+
 /* style sheet */
 
 - (NSString *)titleStyle {
index f028f8f3c9d39b0f0f93d53d464ace1916dcfee8..2d9129cf6ccd37171b10dd551263c1f9a963b872 100644 (file)
                                    const:align="top"
                   >
                     <span class="dayoverview_content_time_link">
-                      <a var:href="appointmentViewURL"
-                         var:queryDictionary="currentDateQueryParameters"
-                         var:title="tooltipForApt"
-                         var:class="aptStyle"
-                      ><var:string value="shortTextForApt"
-                                   const:escapeHTML="NO"
-                        /></a>
+                      <var:component className="UIxCalInlineAptView"
+                                     appointment="appointment"
+                                     formatter="aptFormatter"
+                                     tooltipFormatter="aptTooltipFormatter"
+                                     url="appointmentViewURL"
+                                     style="aptStyle"
+                                     queryDictionary="currentDayQueryParameters"
+                                     canAccess="canAccessApt"
+                      />
                     </span>
                   </var:matrix-cell>
                 </var:vspan-matrix>
index 8fa06be4ac1039cf1ec1c9db79f5215df0077f5a..09a0d59c1013bb98685a23a572f242fbcc4d55bc 100644 (file)
 
   <!-- $Id: SkyNews.html,v 1.3 2003/12/22 16:53:55 helge Exp $ -->
   <table id="skywintable" class="wintable" cellspacing="0" cellpadding="5" width="100%">
-  <tr>
-  <td class="wintitle">
-  <table cellpadding="0" cellspacing="0" width="100%">
-  <tr>
-  <td width="5"/>
-  <td class="wintitle"><var:component className="UIxCalDateLabel"
-                                      startDate="startDate"
-                                      endDate="endDate"
-                                      const:selection="week"
-                       /></td>
-  <td width="36" align="right" valign="center">
-    <var:component className="UIxWinClose" />
-  </td>
-  </tr>
-  </table>
-  </td>
-  </tr>
-
-  <tr>
-  <td id="skywinbodycell" class="wincontent">
-    <table border="0" cellpadding="0" cellspacing="0" width="100%">
-    <tr bgcolor="#e8e8e0">
-    <td align="left">
-      <var:component className="UIxCalBackForthNavView"
-                     methodName="ownMethodName"
-                     prevQueryParameters="prevWeekQueryParameters"
-                     currentQueryParameters="todayQueryParameters"
-                     nextQueryParameters="nextWeekQueryParameters"
-                     label:label="this week"
-      />
-    </td>
-    <td align="right" valign="middle" width="80%">
-      <var:component className="AnaisUidSelector"
-                     calendarUIDs="clientObject.calendarUIDs"
-      />
-    </td>
-    </tr>
-    </table>
-  </td>
-  </tr>
-
-  <tr>
-  <td id="skywinbodycell" class="wincontent">
-  <table border="0" width="100%" cellpadding="0" cellspacing="0">
-  <tr>
-  <td colspan="2">
-    <var:component className="UIxCalSelectTab"
-                   const:selection="week"
-                   currentDate="selectedDate"
-    >
-        <table border="0" cellpadding="4" width="100%" cellspacing="2">
+    <tr>
+      <td class="wintitle">
+        <table cellpadding="0" cellspacing="0" width="100%">
           <tr>
-            <td width="1%" align="left" valign="middle" bgcolor="#e8e8e0">
-              <table border='0' cellpadding='0' cellspacing='0'>
-               <tr>
-                  <td><a href="weekoverview"
-                         var:queryDictionary="queryParameters"
-                      ><img rsrc:src="icon_view_overview.gif"
-                                                  label:title="Overview"
-                                                  label:alt="Overview"
-                                                  border="0"
-                                                  valign="top"
-                                             /></a></td>
-                  <td><a href="weekchartview"
-                         var:queryDictionary="queryParameters"
-                      ><img rsrc:src="icon_view_chart.gif"
-                                                   label:title="Chart"
-                                                   label:alt="Chart"
-                                                   border="0"
-                                                   valign="top"
-                                              /></a></td>
-                  <td><a href="weeklistview"
-                         var:queryDictionary="queryParameters"
-                      ><img rsrc:src="icon_view_list.gif"
-                                                  label:title="List"
-                                                  label:alt="List"
-                                                  border="0"
-                                                  valign="top"
-                                             /></a></td>
-                  <td><img rsrc:src="icon_view_columns_inactive.gif"
-                           label:title="Columns"
-                           label:alt="Columns"
-                           border="0"
-                           valign="top"
-                      /> </td>
-               </tr>
-              </table>
-            </td>
-          
-            <td align="right" bgcolor="#e8e8e0">
-              <table border='0' cellpadding='0' cellspacing='1'>
-                <tr>
-                  <td class="button_auto_env" nowrap="true" valign='middle' 
-                      align='center'>
-                    <a class="button_auto"
-                       href="weekprintview"
-                       var:queryDictionary="queryParameters"
-                       target="SOGoPrintView"
-                    ><var:string label:value="printview" /></a>
-                  </td>
-                  <td class="button_auto_env" nowrap="true" valign='middle' 
-                      align='center'>
-                    <a class="button_auto"
-                       href="proposal"
-                       var:queryDictionary="queryParameters"
-                    ><var:string label:value="proposal" /></a>
-                  </td>
-                </tr>
-              </table>
+            <td width="5"/>
+            <td class="wintitle"><var:component className="UIxCalDateLabel"
+                                                startDate="startDate"
+                                                endDate="endDate"
+                                                const:selection="week"
+                                 /></td>
+            <td width="36" align="right" valign="center">
+              <var:component className="UIxWinClose" />
             </td>
           </tr>
         </table>
-        <table width="100%">
-          <tr valign="top">
-            <td>
-              <table>
-                <tr>
-                  <td>
-                     <var:component className="UIxCalInlineMonthOverview"
-                                    selectedDate="thisMonth"
-                                    const:showYear="YES"
-                                    const:showWeekColumn="YES"
-                                    const:weekSelectionHref="weekcolumnsview"
-                                    const:style="weekcolumnsview_cal"
-                                    const:headerStyle="weekcolumnsview_cal_title"
-                                    const:weekStyle="weekcolumnsview_cal_week"
-                                    const:dayHeaderStyle="weekcolumnsview_cal_day_header"
-                                    const:dayBodyStyle="weekcolumnsview_cal_content"
-                                    const:todayBodyStyle="weekcolumnsview_cal_content_hilite"
-                                    const:inactiveDayBodyStyle="weekcolumnsview_cal_content_dimmed"
-                     />
-                  </td>
-                </tr>
-                <tr>
-                  <td>
-                     <var:component className="UIxCalInlineMonthOverview"
-                                    selectedDate="nextMonth"
-                                    const:showYear="YES"
-                                    const:showWeekColumn="YES"
-                                    const:weekSelectionHref="weekcolumnsview"
-                                    const:style="weekcolumnsview_cal"
-                                    const:headerStyle="weekcolumnsview_cal_title"
-                                    const:weekStyle="weekcolumnsview_cal_week"
-                                    const:dayHeaderStyle="weekcolumnsview_cal_day_header"
-                                    const:dayBodyStyle="weekcolumnsview_cal_content"
-                                    const:todayBodyStyle="weekcolumnsview_cal_content_hilite"
-                                    const:inactiveDayBodyStyle="weekcolumnsview_cal_content_dimmed"
-                     />
-                  </td>
-                </tr>
-              </table>
+      </td>
+    </tr>
+    <tr>
+      <td id="skywinbodycell" class="wincontent">
+        <table border="0" cellpadding="0" cellspacing="0" width="100%">
+          <tr bgcolor="#e8e8e0">
+            <td align="left">
+              <var:component className="UIxCalBackForthNavView"
+                             methodName="ownMethodName"
+                             prevQueryParameters="prevWeekQueryParameters"
+                             currentQueryParameters="todayQueryParameters"
+                             nextQueryParameters="nextWeekQueryParameters"
+                             label:label="this week"
+              />
             </td>
-            <td width="100%">
-              <var:weekcol-view list="appointments"
-                                item="appointment"
-                                weekStart="startDate"
-                                dayIndex="dayIndex"
-                                const:startDateKey="startDate"
-                                const:endDateKey="endDate"
-                                const:titleStyle="weekcolumnsview_title"
-                                contentStyle="contentStyle"
-                                const:class="weekcolumnsview"
-                                const:width="100%"
-                                const:contentColor="#e8e8e0"
-                                const:cellpadding="0"
-                                const:cellspacing="2"
-                                const:hideWeekend="shouldHideWeekend"
+            <td align="right" valign="middle" width="80%">
+              <var:component className="AnaisUidSelector"
+                             calendarUIDs="clientObject.calendarUIDs"
+              />
+            </td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+    <tr>
+      <td id="skywinbodycell" class="wincontent">
+        <table border="0" width="100%" cellpadding="0" cellspacing="0">
+          <tr>
+            <td colspan="2">
+              <var:component className="UIxCalSelectTab"
+                             const:selection="week"
+                             currentDate="selectedDate"
               >
-                <var:weekcol-title>
-                  <table cellpadding="0" width="100%" border="0" cellspacing="0"
-                         var:class="titleStyle">
-                    <tr>
-                      <td align="left" valign="top">
-                        <a href="dayoverview"
-                           var:queryDictionary="currentDayQueryParameters"
-                           class="weekcolumnsview_title_daylink"
-                           ><var:string value="currentDay.dayOfMonth" /></a>
-                      </td>
-                      <td align="center" valign="top" width="97%">
-                        <var:string value="currentDayName" /><br />
-                          [<a href="new"
-                              var:queryDictionary="currentDayQueryParameters"
-                              class="weekcolumnsview_title_newlink"
-                           ><var:string label:value="new" /></a>]
-                      </td>
-                    </tr>
-                  </table>
-                </var:weekcol-title>
-                <var:if condition="hasDayInfo">
-                  <var:weekcol-info>
-                    <var:if condition="hasHolidayInfo">
-                      <var:string value="holidayInfo" 
-                                const:class="weekcolumnsview_holidayinfo" />
-                    </var:if>
-                    <var:foreach list="allDayApts" item="appointment">
-                      <a var:href="appointmentViewURL"
-                         var:queryDictionary="currentDayQueryParameters"
-                        ><var:string value="shortTextForApt"
-                                     const:escapeHTML="NO"
-                         /></a>
-                    </var:foreach>
-                  </var:weekcol-info>
-                </var:if>
-                <var:weekcol>
-                  <a var:href="appointmentViewURL" 
-                    ><small><var:string value="shortTextForApt"
-                                        const:escapeHTML="NO"
-                            /></small></a><br />
-                </var:weekcol>
-              </var:weekcol-view>
+                <table border="0" cellpadding="4" width="100%" cellspacing="2">
+                  <tr>
+                    <td width="1%"
+                        align="left"
+                        valign="middle"
+                        bgcolor="#e8e8e0"
+                    >
+                      <table border='0' cellpadding='0' cellspacing='0'>
+                       <tr>
+                          <td><a href="weekoverview"
+                                 var:queryDictionary="queryParameters"
+                              ><img rsrc:src="icon_view_overview.gif"
+                                                          label:title="Overview"
+                                                          label:alt="Overview"
+                                                          border="0"
+                                                          valign="top"
+                                                     /></a></td>
+                          <td><a href="weekchartview"
+                                 var:queryDictionary="queryParameters"
+                              ><img rsrc:src="icon_view_chart.gif"
+                                                           label:title="Chart"
+                                                           label:alt="Chart"
+                                                           border="0"
+                                                           valign="top"
+                                                      /></a></td>
+                          <td><a href="weeklistview"
+                                 var:queryDictionary="queryParameters"
+                              ><img rsrc:src="icon_view_list.gif"
+                                                          label:title="List"
+                                                          label:alt="List"
+                                                          border="0"
+                                                          valign="top"
+                                                     /></a></td>
+                          <td><img rsrc:src="icon_view_columns_inactive.gif"
+                                   label:title="Columns"
+                                   label:alt="Columns"
+                                   border="0"
+                                   valign="top"
+                              /> </td>
+                       </tr>
+                      </table>
+                    </td>
+                    
+                    <td align="right" bgcolor="#e8e8e0">
+                      <table border='0' cellpadding='0' cellspacing='1'>
+                        <tr>
+                          <td class="button_auto_env"
+                              nowrap="true"
+                              valign='middle'
+                              align='center'
+                          >
+                            <a class="button_auto"
+                               href="weekprintview"
+                               var:queryDictionary="queryParameters"
+                               target="SOGoPrintView"
+                            ><var:string label:value="printview" /></a>
+                          </td>
+                          <td class="button_auto_env"
+                              nowrap="true"
+                              valign="middle"
+                              align="center"
+                          >
+                            <a class="button_auto"
+                               href="proposal"
+                               var:queryDictionary="queryParameters"
+                            ><var:string label:value="proposal" /></a>
+                          </td>
+                        </tr>
+                      </table>
+                    </td>
+                  </tr>
+                </table>
+                <table width="100%">
+                  <tr valign="top">
+                    <td>
+                      <table>
+                        <tr>
+                          <td>
+                             <var:component className="UIxCalInlineMonthOverview"
+                                            selectedDate="thisMonth"
+                                            const:showYear="YES"
+                                            const:showWeekColumn="YES"
+                                            const:weekSelectionHref="weekcolumnsview"
+                                            const:style="weekcolumnsview_cal"
+                                            const:headerStyle="weekcolumnsview_cal_title"
+                                            const:weekStyle="weekcolumnsview_cal_week"
+                                            const:dayHeaderStyle="weekcolumnsview_cal_day_header"
+                                            const:dayBodyStyle="weekcolumnsview_cal_content"
+                                            const:todayBodyStyle="weekcolumnsview_cal_content_hilite"
+                                            const:inactiveDayBodyStyle="weekcolumnsview_cal_content_dimmed"
+                             />
+                          </td>
+                        </tr>
+                        <tr>
+                          <td>
+                             <var:component className="UIxCalInlineMonthOverview"
+                                            selectedDate="nextMonth"
+                                            const:showYear="YES"
+                                            const:showWeekColumn="YES"
+                                            const:weekSelectionHref="weekcolumnsview"
+                                            const:style="weekcolumnsview_cal"
+                                            const:headerStyle="weekcolumnsview_cal_title"
+                                            const:weekStyle="weekcolumnsview_cal_week"
+                                            const:dayHeaderStyle="weekcolumnsview_cal_day_header"
+                                            const:dayBodyStyle="weekcolumnsview_cal_content"
+                                            const:todayBodyStyle="weekcolumnsview_cal_content_hilite"
+                                            const:inactiveDayBodyStyle="weekcolumnsview_cal_content_dimmed"
+                             />
+                          </td>
+                        </tr>
+                      </table>
+                    </td>
+                    <td width="100%">
+                      <var:weekcol-view list="appointments"
+                                        item="appointment"
+                                        weekStart="startDate"
+                                        dayIndex="dayIndex"
+                                        const:startDateKey="startDate"
+                                        const:endDateKey="endDate"
+                                        const:titleStyle="weekcolumnsview_title"
+                                        contentStyle="contentStyle"
+                                        const:class="weekcolumnsview"
+                                        const:width="100%"
+                                        const:contentColor="#e8e8e0"
+                                        const:cellpadding="0"
+                                        const:cellspacing="2"
+                                        const:hideWeekend="shouldHideWeekend"
+                      >
+                        <var:weekcol-title>
+                          <table cellpadding="0" width="100%" border="0" cellspacing="0"
+                                 var:class="titleStyle">
+                            <tr>
+                              <td align="left" valign="top">
+                                <a href="dayoverview"
+                                   var:queryDictionary="currentDayQueryParameters"
+                                   class="weekcolumnsview_title_daylink"
+                                   ><var:string value="currentDay.dayOfMonth" /></a>
+                              </td>
+                              <td align="center" valign="top" width="97%">
+                                <var:string value="currentDayName" /><br />
+                                  [<a href="new"
+                                      var:queryDictionary="currentDayQueryParameters"
+                                      class="weekcolumnsview_title_newlink"
+                                   ><var:string label:value="new" /></a>]
+                              </td>
+                            </tr>
+                          </table>
+                        </var:weekcol-title>
+                        <var:if condition="hasDayInfo">
+                          <var:weekcol-info>
+                            <var:if condition="hasHolidayInfo">
+                              <var:string value="holidayInfo" 
+                                        const:class="weekcolumnsview_holidayinfo" />
+                            </var:if>
+                            <var:foreach list="allDayApts" item="appointment">
+                              <var:component className="UIxCalInlineAptView"
+                                             appointment="appointment"
+                                             formatter="aptFormatter"
+                                             tooltipFormatter="aptTooltipFormatter"
+                                             url="appointmentViewURL"
+                                             style="aptStyle"
+                                             queryDictionary="currentDayQueryParameters"
+                                             canAccess="canAccessApt"
+                              />
+                              <br />
+                            </var:foreach>
+                          </var:weekcol-info>
+                        </var:if>
+                        <var:weekcol>
+                          <var:component className="UIxCalInlineAptView"
+                                         appointment="appointment"
+                                         formatter="aptFormatter"
+                                         tooltipFormatter="aptTooltipFormatter"
+                                         url="appointmentViewURL"
+                                         style="aptStyle"
+                                         queryDictionary="currentDayQueryParameters"
+                                         canAccess="canAccessApt"
+                          />
+                          <br />
+                        </var:weekcol>
+                      </var:weekcol-view>
+                    </td>
+                  </tr>
+                </table>
+              </var:component>
+            </td>
+          </tr>
+          <tr bgcolor="#F5F5E9">
+            <td align="left" width="10"><var:entity const:name="nbsp"/></td>
+            <td align="right"><img 
+               border="0" alt="" 
+               src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif" /></td>
+          </tr>
+          <tr>
+            <td colspan="2" bgcolor="#F5F5E9">
+              <table border="0" width="100%" cellpadding="10" cellspacing="0">
+                <tr />
+              </table>
             </td>
           </tr>
         </table>
-   
-  </var:component>
-  </td>
-  </tr>
-  <tr bgcolor="#F5F5E9">
-  <td align="left" width="10"><var:entity const:name="nbsp"/></td>
-  <td align="right"><img 
-     border="0" alt="" 
-     src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif" /></td>
-  </tr>
-  <tr>
-  <td colspan="2" bgcolor="#F5F5E9">
-  <table border="0" width="100%" cellpadding="10" cellspacing="0">
-  <tr />
-  </table>
-  </td>
-  </tr>
-  </table>
-  </td>
-  </tr>
+      </td>
+    </tr>
   </table>
   <!--
   <hr />
index ea2926999f297b5cd2b5dc6584a64a879c4ed091..a4dbce9279c3ecc6a570bb4e3fb0476ca88c2747 100644 (file)
@@ -36,6 +36,7 @@
 #include "common.h"
 #include <NGExtensions/NGCalendarDateRange.h>
 #include <SOGoLogic/AgenorUserManager.h>
+#include <SOGoUI/SOGoAptFormatter.h>
 
 @implementation UIxCalWeekListview
 
 
 /* descriptions */
 
-- (NSString *)cnForCurrentUid {
-  return [[AgenorUserManager sharedUserManager] getCNForUID:self->currentUid];
+- (void)configureFormatters {
+  [super configureFormatters];
+  [self->aptFormatter setTitleOnly];
+  [self->privateAptFormatter setPrivateDetails];
 }
 
-- (NSString *)shortTextForApt {
-  return [[self appointment] valueForKey:@"title"];
+- (NSString *)cnForCurrentUid {
+  return [[AgenorUserManager sharedUserManager] getCNForUID:self->currentUid];
 }
 
 /* style sheet */
index 311b2476b41a47e282d7caebaaecfd8c2de00d6f..41d2051c68424fe144cd977805e61bfa383766fc 100644 (file)
                                    const:align="top"
                   >
                     <span class="dayoverview_content_time_link">
-                      <a var:href="appointmentViewURL"
-                         var:queryDictionary="currentDateQueryParameters"
-                         var:title="tooltipForApt"
-                         var:class="aptStyle"
-                      ><var:string value="shortTextForApt"
-                                   const:escapeHTML="NO"
-                        /></a>
+                      <var:component className="UIxCalInlineAptView"
+                                     appointment="appointment"
+                                     formatter="aptFormatter"
+                                     tooltipFormatter="aptTooltipFormatter"
+                                     url="appointmentViewURL"
+                                     style="aptStyle"
+                                     queryDictionary="currentDayQueryParameters"
+                                     canAccess="canAccessApt"
+                      />
                     </span>
                   </var:matrix-cell>
                 </var:hspan-matrix>
index 63913c7b633510fddc1c635484e3e7b987c67a4d..5a290f7c4b71c44e4a00f394e220c905aab1740b 100644 (file)
                        const:class="weekoverview_holidayinfo" />
           </var:if>
           <var:foreach list="allDayApts" item="appointment">
-            <a var:href="appointmentViewURL"
-               var:queryDictionary="currentDayQueryParameters"
-               var:class="aptStyle"
-            ><var:string value="appointment"
-                         formatter="aptFormatter"
-                         const:escapeHTML="NO"
-             /></a>
+            <var:component className="UIxCalInlineAptView"
+                           appointment="appointment"
+                           formatter="aptFormatter"
+                           tooltipFormatter="aptTooltipFormatter"
+                           url="appointmentViewURL"
+                           style="aptStyle"
+                           queryDictionary="currentDayQueryParameters"
+                           canAccess="canAccessApt"
+            />
+            <br />
           </var:foreach>
         </var:week-info>
       </var:if>
       <var:week>
-        <a var:href="appointmentViewURL" 
-           var:title="tooltipForApt"
-          ><small><var:string value="appointment"
-                              formatter="aptFormatter"
-                              const:escapeHTML="NO"
-                              style="aptStyle"
-                  /></small></a><br />
+        <var:component className="UIxCalInlineAptView"
+                       appointment="appointment"
+                       formatter="aptFormatter"
+                       tooltipFormatter="aptTooltipFormatter"
+                       url="appointmentViewURL"
+                       style="aptStyle"
+                       canAccess="canAccessApt"
+        />
+        <br />
       </var:week>
     </var:week-overview>
   </var:component>
index ba59e256b9644e064fdf9d1a56b43ff6d3f244b7..6a165cf44a122fe1051d9862c63434f232a1b34e 100644 (file)
   NSMutableString *aptDescr;
   NSString        *s;
   BOOL            isMyApt;
+  BOOL            canAccessApt;
   BOOL            spansRange;
   id              apt;
   
-  apt        = [self appointment];
-  isMyApt    = [self isMyApt];
-  spansRange = NO;
-  startDate  = [apt valueForKey:@"startDate"];
+  apt          = [self appointment];
+  isMyApt      = [self isMyApt];
+  canAccessApt = [self canAccessApt];
+  spansRange   = NO;
+  startDate    = [apt valueForKey:@"startDate"];
   [startDate setTimeZone:[self viewTimeZone]];
-  endDate    = [apt valueForKey:@"endDate"];
+  endDate      = [apt valueForKey:@"endDate"];
   if(endDate != nil) {
     [endDate setTimeZone:[self viewTimeZone]];
     spansRange = ![endDate isEqualToDate:startDate];
   [aptDescr appendFormat:@"</span>,"];
   if(!isMyApt)
     [aptDescr appendFormat:@"<span class=\"%@\">", [self aptStyle]];
-  s = [apt valueForKey:@"title"];
-  if(s) {
-    [aptDescr appendFormat:@"<br />%@", s];
-  }
-  s = [apt valueForKey:@"location"];
-  if(s) {
-    [aptDescr appendFormat:@"<br />%@", s];
+  if (canAccessApt) {
+    s = [apt valueForKey:@"title"];
+    if(s) {
+      [aptDescr appendFormat:@"<br />%@", s];
+    }
+    s = [apt valueForKey:@"location"];
+    if(s) {
+      [aptDescr appendFormat:@"<br />%@", s];
+    }
   }
   if(!isMyApt)
     [aptDescr appendString:@"</span>"];
index 3d02fe9b1c1a29a7fdfe348a8ee61c7c718068db..78e1b41e681f72ec32e33a983d3e543d90d89a78 100644 (file)
@@ -9,67 +9,67 @@
                title="title">
 
   <table border="0" cellpadding="0" cellspacing="0" width="100%">
-  <tr>
-    <td class="weekprintview">
-      <h1 class="weekprintview"><var:string value="title" /></h1>
-      <h2 class="weekprintview"><var:string value="formattedCalendarUIDs" /></h2>
-    </td>
-  </tr>
-  <tr>
-    <td>
-      <var:week-overview list="appointments"
-                         item="appointment"
-                         weekStart="startDate"
-                         dayIndex="dayIndex"
-                         const:startDateKey="startDate"
-                         const:endDateKey="endDate"
-                         const:titleStyle="weekprintview_title"
-                         const:contentStyle="weekprintview_content"
-                         const:cellpadding="5"
-                         const:cellspacing="0"
-                         const:border="1"
-                         const:width="100%"
-      >
-        <var:week-title>
-          <table cellpadding="5"
-                 width="100%"
-                 border="0"
-                 cellspacing="0"
-                 class="weekprintview_title"
-          >
-            <tr>
-              <td align="left" valign="top">
-                <var:string value="currentDay.dayOfMonth"
-                            const:numberformat="02"
-                />
-              </td>
-              <td align="center" valign="top" width="97%">
-                <var:string value="currentDayName" />
-              </td>
-            </tr>
-          </table>
-        </var:week-title>
-        <var:if condition="hasDayInfo">
-          <var:week-info>
-            <var:if condition="hasHolidayInfo">
-              <var:string value="holidayInfo"
-                          const:class="weekprintview_holidayinfo"
-              />
-            </var:if>
-            <var:foreach list="allDayApts" item="appointment">
-              <var:string value="shortTextForApt"
-                          const:escapeHTML="NO"
-              />
-            </var:foreach>
-          </var:week-info>
-        </var:if>
-        <var:week>
-          <var:string value="shortTextForApt"
-                      const:escapeHTML="NO"
-          /> <br />
-        </var:week>
-      </var:week-overview>
+    <tr>
+      <td class="weekprintview">
+        <h1 class="weekprintview"><var:string value="title" /></h1>
+        <h2 class="weekprintview"><var:string value="formattedCalendarUIDs" /></h2>
       </td>
     </tr>
+    <tr>
+      <td>
+        <var:week-overview list="appointments"
+                           item="appointment"
+                           weekStart="startDate"
+                           dayIndex="dayIndex"
+                           const:startDateKey="startDate"
+                           const:endDateKey="endDate"
+                           const:titleStyle="weekprintview_title"
+                           const:contentStyle="weekprintview_content"
+                           const:cellpadding="5"
+                           const:cellspacing="0"
+                           const:border="1"
+                           const:width="100%"
+        >
+          <var:week-title>
+            <table cellpadding="5"
+                   width="100%"
+                   border="0"
+                   cellspacing="0"
+                   class="weekprintview_title"
+            >
+              <tr>
+                <td align="left" valign="top">
+                  <var:string value="currentDay.dayOfMonth"
+                              const:numberformat="02"
+                  />
+                </td>
+                <td align="center" valign="top" width="97%">
+                  <var:string value="currentDayName" />
+                </td>
+              </tr>
+            </table>
+          </var:week-title>
+          <var:if condition="hasDayInfo">
+            <var:week-info>
+              <var:if condition="hasHolidayInfo">
+                <var:string value="holidayInfo"
+                            const:class="weekprintview_holidayinfo"
+                />
+              </var:if>
+              <var:foreach list="allDayApts" item="appointment">
+                <var:string value="shortTextForApt"
+                            const:escapeHTML="NO"
+                />
+              </var:foreach>
+            </var:week-info>
+          </var:if>
+          <var:week>
+            <var:string value="shortTextForApt"
+                        const:escapeHTML="NO"
+            /> <br />
+          </var:week>
+        </var:week-overview>
+        </td>
+      </tr>
   </table>
 </var:component>
index 64f03077813db3a58717a8b35ed75931d640a432..91f73e22c0ceb1eb2a7d352cd95f6de74a0e43f3 100644 (file)
@@ -1,7 +1,8 @@
 # $Id$
 
-SUBMINOR_VERSION:=97
+SUBMINOR_VERSION:=98
 
+# v0.9.98 requires SOGoUI       v0.9.19
 # v0.9.96 requires SOGoLogic    v0.9.27
 # v0.9.94 requires NGExtensions v4.5.136
 # v0.9.84 requires SOGoLogic    v0.9.12
index a45db1469c76c09d1f1bfbb28c590e1a2f09a013..f358d921ddb5c24b2c0ceedd711676d00886b271 100644 (file)
 
 - (void)setAccessClass:(NSString *)_value;
 - (NSString *)accessClass;
+- (BOOL)isPublic;
 
 - (void)setTransparency:(NSString *)_value;
 - (NSString *)transparency;
+- (BOOL)isTransparent;
 
 - (void)removeAllAttendees;
 - (void)addToAttendees:(iCalPerson *)_person;
index bcecc698e452e7e9e41a16de2f9d3a050d5314bb..5d25963b473ed1463dfb991fd8d6e46dd551fa75 100644 (file)
@@ -281,6 +281,9 @@ static NGLogger                  *logger = nil;
     s = @"PUBLIC"; /* default for agenor */
   return s;
 }
+- (BOOL)isPublic {
+  return [[self accessClass] isEqualToString:@"PUBLIC"];
+}
 
 - (void)setTransparency:(NSString *)_value {
   [self debugWithFormat:@"transparency currently unsupported by iCalEvent!"];
@@ -289,6 +292,9 @@ static NGLogger                  *logger = nil;
   [self debugWithFormat:@"returning bogus transparency information!"];
   return @"TRANSPARENT";
 }
+- (BOOL)isTransparent {
+  return [[self transparency] isEqualToString:@"TRANSPARENT"];
+}
 
 - (void)setOrganizer:(iCalPerson *)_organizer {
   [self->event setOrganizer:_organizer];