From: znek Date: Fri, 10 Dec 2004 18:20:35 +0000 (+0000) Subject: fixed SOGo bug #1052 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8db8fae6c7bdb51443bae1ff6573d5063f29a877;p=scalable-opengroupware.org fixed SOGo bug #1052 git-svn-id: http://svn.opengroupware.org/SOGo/trunk@469 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SOGo.xcode/project.pbxproj b/SOGo/SOGo.xcode/project.pbxproj index 57de016f..9c9dbfaa 100644 --- a/SOGo/SOGo.xcode/project.pbxproj +++ b/SOGo/SOGo.xcode/project.pbxproj @@ -168,6 +168,8 @@ }; AD0137A406DF8875000910D8 = { children = ( + ADAD40CA0769FFD000AAD24E, + ADAD40C90769FFD000AAD24E, AD73BE8806CF92FC00226A2D, AD73BE8906CF92FC00226A2D, E87208F70692E3D30099CBBD, @@ -1512,6 +1514,23 @@ refType = 4; sourceTree = ""; }; + ADAD40C90769FFD000AAD24E = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text.xml; + path = UIxCalInlineAptView.wox; + refType = 4; + sourceTree = ""; + }; + ADAD40CA0769FFD000AAD24E = { + fileEncoding = 5; + indentWidth = 2; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = UIxCalInlineAptView.m; + refType = 4; + sourceTree = ""; + }; ADBE3C490726AF4C000FEA6A = { fileEncoding = 5; indentWidth = 2; @@ -2317,12 +2336,12 @@ ADDF4DBA06DE0E6500C4E7F8 = { children = ( E87206880692E3D10099CBBD, + E87206A00692E3D10099CBBD, + E87206A10692E3D10099CBBD, E872069C0692E3D10099CBBD, E872069D0692E3D10099CBBD, E872069E0692E3D10099CBBD, E872069F0692E3D10099CBBD, - E87206A00692E3D10099CBBD, - E87206A10692E3D10099CBBD, E87206A20692E3D10099CBBD, E87206A30692E3D10099CBBD, ); diff --git a/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m b/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m index fa785701..7303ffe0 100644 --- a/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -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]; diff --git a/SOGo/SoObjects/Appointments/Version b/SOGo/SoObjects/Appointments/Version index 87351aca..faf0dee1 100644 --- a/SOGo/SoObjects/Appointments/Version +++ b/SOGo/SoObjects/Appointments/Version @@ -1,5 +1,5 @@ # Version file -SUBMINOR_VERSION:=16 +SUBMINOR_VERSION:=17 # v0.9.13 requires libSOGo v0.9.26 diff --git a/SOGo/SoObjects/ChangeLog b/SOGo/SoObjects/ChangeLog index b95aacbc..be5d8352 100644 --- a/SOGo/SoObjects/ChangeLog +++ b/SOGo/SoObjects/ChangeLog @@ -1,3 +1,8 @@ +2004-12-10 Marcus Mueller + + * Appointments/SOGoAppointmentFolder.m: added new quickinfo attributes + for fetching (v0.9.17) + 2004-12-08 Marcus Mueller * GNUmakefile: added Sieve product diff --git a/SOGo/UI/Common/ChangeLog b/SOGo/UI/Common/ChangeLog index 902dfa90..50966c62 100644 --- a/SOGo/UI/Common/ChangeLog +++ b/SOGo/UI/Common/ChangeLog @@ -1,3 +1,7 @@ +2004-12-09 Marcus Mueller + + * UIxPageFrame.[wox,m]: added -ownerInContext debug info (v0.9.30) + 2004-12-08 Marcus Mueller * calendar.css: added styles for others' appointments in diff --git a/SOGo/UI/Common/UIxPageFrame.m b/SOGo/UI/Common/UIxPageFrame.m index 439e8125..8e3fb528 100644 --- a/SOGo/UI/Common/UIxPageFrame.m +++ b/SOGo/UI/Common/UIxPageFrame.m @@ -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"]; } @@ -60,6 +60,11 @@ return self->item; } +- (NSString *)ownerInContext { + return [[self clientObject] ownerInContext:[self context]]; +} + + /* notifications */ - (void)sleep { diff --git a/SOGo/UI/Common/UIxPageFrame.wox b/SOGo/UI/Common/UIxPageFrame.wox index 69224348..97a0ba45 100644 --- a/SOGo/UI/Common/UIxPageFrame.wox +++ b/SOGo/UI/Common/UIxPageFrame.wox @@ -74,6 +74,10 @@ clientObject: + + ownerInContext: + + traversal stack: diff --git a/SOGo/UI/Common/Version b/SOGo/UI/Common/Version index 824ee0bb..cd3c0f2b 100644 --- a/SOGo/UI/Common/Version +++ b/SOGo/UI/Common/Version @@ -1,5 +1,5 @@ # Version file -SUBMINOR_VERSION:=29 +SUBMINOR_VERSION:=30 # v0.9.28 requires NGExtensions v4.5.136 diff --git a/SOGo/UI/SOGoUI/ChangeLog b/SOGo/UI/SOGoUI/ChangeLog index 57a9ab7a..5c4d9f4c 100644 --- a/SOGo/UI/SOGoUI/ChangeLog +++ b/SOGo/UI/SOGoUI/ChangeLog @@ -1,3 +1,8 @@ +2004-12-10 Marcus Mueller + + * SOGoAptFormatter.[hm]: added formatting for private apts, additional + cleanup (v0.9.19) + 2004-12-08 Marcus Mueller * UIxComponent.m: changed to use NGLogging (v0.9.18) diff --git a/SOGo/UI/SOGoUI/SOGoAptFormatter.h b/SOGo/UI/SOGoUI/SOGoAptFormatter.h index 62e14b14..151e60fc 100644 --- a/SOGo/UI/SOGoUI/SOGoAptFormatter.h +++ b/SOGo/UI/SOGoUI/SOGoAptFormatter.h @@ -30,15 +30,21 @@ @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_ */ diff --git a/SOGo/UI/SOGoUI/SOGoAptFormatter.m b/SOGo/UI/SOGoUI/SOGoAptFormatter.m index da72100f..9168f4e4 100644 --- a/SOGo/UI/SOGoUI/SOGoAptFormatter.m +++ b/SOGo/UI/SOGoUI/SOGoAptFormatter.m @@ -24,8 +24,10 @@ #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 @@ -53,20 +55,28 @@ 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 */ @@ -75,30 +85,48 @@ 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:@"..."]; @@ -107,7 +135,15 @@ if ((s = [_apt valueForKey:@"title"]) != nil) [aptDescr appendFormat:@"
%@", [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 { @@ -124,7 +160,7 @@ [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], @@ -140,7 +176,37 @@ 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 */ diff --git a/SOGo/UI/SOGoUI/Version b/SOGo/UI/SOGoUI/Version index 4c33edb4..4973dd21 100644 --- a/SOGo/UI/SOGoUI/Version +++ b/SOGo/UI/SOGoUI/Version @@ -1,5 +1,5 @@ # $Id$ -SUBMINOR_VERSION:=18 +SUBMINOR_VERSION:=19 # v0.9.18 requires NGExtensions v4.5.136 diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index 1a86657f..57b981f9 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,32 @@ +2004-12-10 Marcus Mueller + + * 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 * v0.9.97 diff --git a/SOGo/UI/Scheduler/English.lproj/default.strings b/SOGo/UI/Scheduler/English.lproj/default.strings index 16dc7e64..3800aa16 100644 --- a/SOGo/UI/Scheduler/English.lproj/default.strings +++ b/SOGo/UI/Scheduler/English.lproj/default.strings @@ -21,11 +21,13 @@ "dayLabelFormat" = "%Y-%m-%d"; "today" = "today"; + /* Week */ "Week" = "Week"; "this week" = "this week"; + /* Month */ "this month" = "this month"; @@ -56,19 +58,23 @@ "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"; @@ -108,7 +115,12 @@ "attributes" = "Attributes"; "participants" = "Participants"; +/* checkbox title */ "is private" = "is private"; +/* classification */ +"Public" = "Public"; +"Private" = "Private"; + /* Searching */ @@ -118,6 +130,7 @@ "Search appointments" = "Search appointments"; "Search in Anais" = "Search in Anaïs"; + /* calendar modes */ "Overview" = "Overview"; @@ -125,6 +138,7 @@ "List" = "List"; "Columns" = "Columns"; + /* Priorities */ "prio_0" = "Undefined"; @@ -138,6 +152,7 @@ "prio_8" = "Low"; "prio_9" = "Low"; + /* Appointment categories */ "APPOINTMENT" = "Appointment"; diff --git a/SOGo/UI/Scheduler/GNUmakefile b/SOGo/UI/Scheduler/GNUmakefile index 796a4ca7..090c1911 100644 --- a/SOGo/UI/Scheduler/GNUmakefile +++ b/SOGo/UI/Scheduler/GNUmakefile @@ -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 \ diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 5f447c5f..86993d5e 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -593,6 +593,27 @@ [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{ diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox index cc4b2695..d8dbd0c7 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox @@ -7,259 +7,264 @@ className="UIxPageFrame" title="name" > -
- - - - - - - - - - - - - - -
- - - - - -
- - - -
-
- -
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - : - - - - - - -
- - : - - - - - -
- - : - - - - - -
- - : - - - - - -
- - : - - - - - -
- - : - - - - - -
- - : - - - - - -
-
- - - - - - - - -
- - - -
- - : - - - - -
-
- - - - - - - - -
- - - -
- - : - - - - - -
-
- - - - - - -
- - - -
- - : - - - -