From: znek Date: Thu, 14 Jul 2005 16:26:32 +0000 (+0000) Subject: more features for homepage and appointment view X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5169d619e7758060fc8e11863ce5b7e82cdfd687;p=scalable-opengroupware.org more features for homepage and appointment view git-svn-id: http://svn.opengroupware.org/SOGo/trunk@759 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SOGo.xcodeproj/project.pbxproj b/SOGo/SOGo.xcodeproj/project.pbxproj index 710cadee..8032f7bd 100644 --- a/SOGo/SOGo.xcodeproj/project.pbxproj +++ b/SOGo/SOGo.xcodeproj/project.pbxproj @@ -57,7 +57,7 @@ AD071F6606CE66DF00A9EEF4 /* README */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 8; lastKnownFileType = text; path = README; sourceTree = ""; tabWidth = 8; }; AD0A0ACC07A8093400D3B8EF /* UIxMailWindowCloser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIxMailWindowCloser.m; sourceTree = ""; }; AD152B6F06AC159A002375D2 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 8; lastKnownFileType = text; path = ChangeLog; sourceTree = ""; tabWidth = 8; usesTabs = 1; }; - AD273D4D077315640064794B /* UIxCalParticipationStatusView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIxCalParticipationStatusView.m; sourceTree = ""; }; + AD273D4D077315640064794B /* UIxCalParticipationStatusView.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = UIxCalParticipationStatusView.m; sourceTree = ""; tabWidth = 2; }; AD2C74A3071A9FF70087E027 /* README */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = README; sourceTree = ""; }; AD2C74A5071A9FF70087E027 /* UIxEnvelopeAddressFormatter.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = UIxEnvelopeAddressFormatter.m; sourceTree = ""; }; AD2C74A6071A9FF70087E027 /* UIxMailAccountsView.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = UIxMailAccountsView.m; sourceTree = ""; }; diff --git a/SOGo/UI/Common/ChangeLog b/SOGo/UI/Common/ChangeLog index a973f725..b0ba614d 100644 --- a/SOGo/UI/Common/ChangeLog +++ b/SOGo/UI/Common/ChangeLog @@ -1,7 +1,13 @@ 2005-07-14 Marcus Mueller + * v0.9.42 + + * calendar.css: further refined new css + + * v0.9.41 + * calendar.css, uix.css: added homepagefont and added 'title' class - to use in the scheduler overview (v0.9.41) + to use in the scheduler overview 2005-07-13 Marcus Mueller diff --git a/SOGo/UI/Common/Version b/SOGo/UI/Common/Version index e13dc403..b3e64836 100644 --- a/SOGo/UI/Common/Version +++ b/SOGo/UI/Common/Version @@ -1,5 +1,5 @@ # Version file -SUBMINOR_VERSION:=41 +SUBMINOR_VERSION:=42 # v0.9.28 requires NGExtensions v4.5.136 diff --git a/SOGo/UI/Common/calendar.css b/SOGo/UI/Common/calendar.css index 8097ff41..53b4364f 100644 --- a/SOGo/UI/Common/calendar.css +++ b/SOGo/UI/Common/calendar.css @@ -50,12 +50,19 @@ font-size: 10pt; } -.title { +.titlefont { font-size: 12pt; font-weight: bold; +} + +.titleheader { background-color: #d8d8d0; } +.buttonheader { + text-align: right; +} + th.schedoverview_title { font-size: 10pt; font-weight: bold; diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index 8f70e0db..b92e6e54 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,21 @@ +2005-07-14 Marcus Mueller + + * v0.9.133 + + * UIxAppointmentView.m: supports accept/decline from participants + tab now + + * UIxAppointmentEditor.m: fixed redirect url after accept/decline + + * UIxCalParticipationStatusView.m: added accessor for partStat, so + partStat isn't accidentaly lost + + * UIxCalScheduleOverview.m: is able to suppress rendering of + rejected and accepted foreign appointments now based on formValue + + * English.lproj/Localizable.strings: new labels for + UIxCalScheduleOverview + 2005-07-14 Helge Hess * UIxAppointmentView.m: fixed a small memory leak when creating the @@ -5,11 +23,14 @@ 2005-07-14 Marcus Mueller + * v0.9.131 + * product.plist: removed 'schedule' method from SOGoAppointmentFolder - (v0.9.131) + + * v0.9.130 * UIxCalView.m: removed resourcePath stuff as this isn't used - anywhere anymore (and it shouldn't) (v0.9.130) + anywhere anymore (and it shouldn't) 2005-07-13 Marcus Mueller diff --git a/SOGo/UI/Scheduler/English.lproj/Localizable.strings b/SOGo/UI/Scheduler/English.lproj/Localizable.strings index 121eb359..0cae556a 100644 --- a/SOGo/UI/Scheduler/English.lproj/Localizable.strings +++ b/SOGo/UI/Scheduler/English.lproj/Localizable.strings @@ -98,6 +98,8 @@ "accept" = "Accept"; "decline" = "Decline"; "more participants" = "more participants"; +"Hide already accepted and rejected appointments" = "Hide already accepted and rejected appointments"; +"Show already accepted and rejected appointments" = "Show already accepted and rejected appointments"; /* Appointments */ diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index e971ea0c..032099e7 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -1079,7 +1079,7 @@ reason:[ex reason]]; } - return [self redirectToLocation:[self _completeURIForMethod:@".."]]; + return [self redirectToLocation:[self _completeURIForMethod:@"../view"]]; } @end /* UIxAppointmentEditor */ diff --git a/SOGo/UI/Scheduler/UIxAppointmentView.h b/SOGo/UI/Scheduler/UIxAppointmentView.h index 84dcf5b8..7e5483d2 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentView.h +++ b/SOGo/UI/Scheduler/UIxAppointmentView.h @@ -9,7 +9,6 @@ @interface UIxAppointmentView : UIxComponent { - NSString *tabSelection; id appointment; id attendee; SOGoDateFormatter *dateFormatter; diff --git a/SOGo/UI/Scheduler/UIxAppointmentView.m b/SOGo/UI/Scheduler/UIxAppointmentView.m index 51f5f691..febffc05 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentView.m +++ b/SOGo/UI/Scheduler/UIxAppointmentView.m @@ -22,11 +22,16 @@ #include "UIxAppointmentView.h" #include #include +#include #include #include #include "UIxComponent+Agenor.h" #include "common.h" +@interface UIxAppointmentView (PrivateAPI) +- (BOOL)isAttendeeActiveUser; +@end + @implementation UIxAppointmentView - (void)dealloc { @@ -55,6 +60,23 @@ return self->attendee; } +- (BOOL)isAttendeeActiveUser { + NSString *email, *attEmail; + + email = [[[self context] activeUser] email]; + attEmail = [[self attendee] rfc822Email]; + return [email isEqualToString:attEmail]; +} +- (BOOL)showAcceptButton { + return [[self attendee] participationStatus] != iCalPersonPartStatAccepted; +} +- (BOOL)showRejectButton { + return [[self attendee] participationStatus] != iCalPersonPartStatDeclined; +} +- (NSString *)attendeeStatusColspan { + return [self isAttendeeActiveUser] ? @"1" : @"2"; +} + - (void)setItem:(id)_item { ASSIGN(self->item, _item); } diff --git a/SOGo/UI/Scheduler/UIxCalParticipationStatusView.m b/SOGo/UI/Scheduler/UIxCalParticipationStatusView.m index a08adacf..2796b2c0 100644 --- a/SOGo/UI/Scheduler/UIxCalParticipationStatusView.m +++ b/SOGo/UI/Scheduler/UIxCalParticipationStatusView.m @@ -20,13 +20,11 @@ */ // $Id$ - #include - @interface UIxCalParticipationStatusView : WOComponent { - int partStat; + int partStat; } - (NSString *)participationStatus; @@ -39,28 +37,31 @@ @implementation UIxCalParticipationStatusView - (void)setPartStat:(id)_partStat { - self->partStat = [_partStat intValue]; + self->partStat = [_partStat intValue]; +} +- (int)partStat { + return self->partStat; } - (NSString *)participationStatus { - switch (self->partStat) { - case iCalPersonPartStatNeedsAction: - return @"NEEDS-ACTION"; - case iCalPersonPartStatAccepted: - return @"ACCEPTED"; - case iCalPersonPartStatDeclined: - return @"DECLINED"; - case iCalPersonPartStatTentative: - return @"TENTATIVE"; - case iCalPersonPartStatDelegated: - return @"DELEGATED"; - } - return @"OTHER"; + switch (self->partStat) { + case iCalPersonPartStatNeedsAction: + return @"NEEDS-ACTION"; + case iCalPersonPartStatAccepted: + return @"ACCEPTED"; + case iCalPersonPartStatDeclined: + return @"DECLINED"; + case iCalPersonPartStatTentative: + return @"TENTATIVE"; + case iCalPersonPartStatDelegated: + return @"DELEGATED"; + } + return @"OTHER"; } - (NSString *)participationStatusLabel { - return [NSString stringWithFormat:@"partStat_%@", - [self participationStatus]]; + return [NSString stringWithFormat:@"partStat_%@", + [self participationStatus]]; } @end diff --git a/SOGo/UI/Scheduler/UIxCalScheduleOverview.m b/SOGo/UI/Scheduler/UIxCalScheduleOverview.m index 2f490e8e..5522a1e7 100644 --- a/SOGo/UI/Scheduler/UIxCalScheduleOverview.m +++ b/SOGo/UI/Scheduler/UIxCalScheduleOverview.m @@ -55,6 +55,12 @@ - (unsigned)truncatedParticipantsCount; - (BOOL)didTruncateParticipants; +- (NSString *)getUserPartStateFromApt:(id)_apt; + +- (BOOL)shouldIgnoreRejectedAppointments; +- (BOOL)shouldIgnoreAcceptedAppointments; +- (BOOL)shouldShowRejectedAndAcceptedAppointments; + @end #include @@ -154,7 +160,12 @@ } - (BOOL)hasUserAppointments { + // NOTE: this has been disabled for Agenor 0.8 on client's request +#if 1 + return NO; +#else return [[self userAppointments] count] > 0; +#endif } - (BOOL)hasForeignAppointments { return [[self foreignAppointments] count] > 0; @@ -208,6 +219,51 @@ return self->userParticipationStatus; } +- (BOOL)shouldIgnoreRejectedAppointments { + return ![self shouldShowRejectedAndAcceptedAppointments]; +} + +- (BOOL)shouldIgnoreAcceptedAppointments { + return ![self shouldShowRejectedAndAcceptedAppointments]; +} + +- (BOOL)shouldShowRejectedAndAcceptedAppointments { + NSString *value; + + value = [[[self context] request] formValueForKey:@"dr"]; + if (!value) return NO; + return [value boolValue]; +} + +- (NSString *)toggleShowHideAptsQueryParameter { + BOOL shouldShow; + + shouldShow = [self shouldShowRejectedAndAcceptedAppointments]; + return shouldShow ? @"0" : @"1"; +} + +- (NSString *)toggleShowHideAptsText { + if ([self shouldShowRejectedAndAcceptedAppointments]) + return @"Hide already accepted and rejected appointments"; + return @"Show already accepted and rejected appointments"; +} + + +- (NSString *)getUserPartStateFromApt:(id)_apt { + NSString *email; + NSArray *ps, *pms; + unsigned idx; + + email = [self emailForUser]; + pms = [[_apt valueForKey:@"partmails"] + componentsSeparatedByString:@"\n"]; + idx = [pms indexOfObject:email]; + if (idx == NSNotFound) return nil; + ps = [[_apt valueForKey:@"partstates"] + componentsSeparatedByString:@"\n"]; + return [ps objectAtIndex:idx]; +} + /* fetching */ @@ -269,10 +325,30 @@ apt = [apts objectAtIndex:i]; orgEmail = [apt objectForKey:@"orgmail"]; - if (orgEmail && [orgEmail isEqualToString:userEmail]) + if (orgEmail && [orgEmail isEqualToString:userEmail]) { [self->userApts addObject:apt]; - else - [self->foreignApts addObject:apt]; + } + else { + BOOL shouldAdd = YES; + + if ([self shouldIgnoreAcceptedAppointments] || + [self shouldIgnoreRejectedAppointments]) + { + NSString *userPartStat; + + userPartStat = [self getUserPartStateFromApt:apt]; + if (userPartStat) { + if ([self shouldIgnoreAcceptedAppointments] && + [userPartStat isEqualToString:@"1"]) + shouldAdd = NO; + else if ([self shouldIgnoreRejectedAppointments] && + [userPartStat isEqualToString:@"2"]) + shouldAdd = NO; + } + } + if (shouldAdd) + [self->foreignApts addObject:apt]; + } } [self->userApts sortUsingKeyOrderArray:orders]; [self->foreignApts sortUsingKeyOrderArray:orders]; diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index 0999fc5b..6e9de41a 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,6 +1,6 @@ # Version file -SUBMINOR_VERSION:=132 +SUBMINOR_VERSION:=133 # v0.9.123 requires Appointments v0.9.35 # v0.9.123 requires SOGoUI v0.9.24 diff --git a/SOGo/UI/Templates/ChangeLog b/SOGo/UI/Templates/ChangeLog index 30d55b94..d59c5a59 100644 --- a/SOGo/UI/Templates/ChangeLog +++ b/SOGo/UI/Templates/ChangeLog @@ -1,3 +1,11 @@ +2005-07-14 Marcus Mueller + + * UIxCalScheduleOverview.wox: removed functionality for v0.8 on + client's request + + * UIxAppointmentView.wox: added accept/decline functionality in + participants tab + 2005-07-14 Helge Hess * UIxMailAccountView.wox: directly access the clientObject to get share diff --git a/SOGo/UI/Templates/UIxAppointmentView.wox b/SOGo/UI/Templates/UIxAppointmentView.wox index 398ca96a..af737e3c 100644 --- a/SOGo/UI/Templates/UIxAppointmentView.wox +++ b/SOGo/UI/Templates/UIxAppointmentView.wox @@ -221,7 +221,11 @@ - + @@ -236,11 +240,34 @@ - + + + + + + + + + + + diff --git a/SOGo/UI/Templates/UIxCalScheduleOverview.wox b/SOGo/UI/Templates/UIxCalScheduleOverview.wox index 9d46d97e..d06013dc 100644 --- a/SOGo/UI/Templates/UIxCalScheduleOverview.wox +++ b/SOGo/UI/Templates/UIxCalScheduleOverview.wox @@ -13,11 +13,22 @@ class="schedoverview" > - + - + @@ -99,12 +110,13 @@ + + --> @@ -153,6 +165,7 @@ + +