From e495b9afb8a08332f823eb9c6c34fa88e6596524 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 19 Jun 2007 17:56:35 +0000 Subject: [PATCH] Monotone-Parent: 4f0272f926f26c8a39d7b00154a9b6dd2d17a27a Monotone-Revision: 5369f3639a0ee9aca9aab181450a38f9e22e9b47 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-19T17:56:35 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 + UI/Scheduler/UIxTaskView.h | 40 --- UI/Scheduler/UIxTaskView.m | 294 ---------------------- UI/Templates/SchedulerUI/UIxTaskView.wox | 299 ----------------------- 4 files changed, 2 insertions(+), 633 deletions(-) delete mode 100644 UI/Scheduler/UIxTaskView.h delete mode 100644 UI/Scheduler/UIxTaskView.m delete mode 100644 UI/Templates/SchedulerUI/UIxTaskView.wox diff --git a/ChangeLog b/ChangeLog index 6019f4a8c..3130278d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2007-06-19 Wolfgang Sourdeau + * UI/Scheduler/UIxTaskView.[hm]: removed unused module. + * UI/Scheduler/UIxAppointmentView.[hm]: removed unused module. * SoObjects/SOGo/WOContext+Agenor.[hm]: removed unused module. diff --git a/UI/Scheduler/UIxTaskView.h b/UI/Scheduler/UIxTaskView.h deleted file mode 100644 index 51678d718..000000000 --- a/UI/Scheduler/UIxTaskView.h +++ /dev/null @@ -1,40 +0,0 @@ -// $Id: UIxTaskView.h 768 2005-07-15 00:13:01Z helge $ - -#ifndef __SOGo_UIxTaskView_H__ -#define __SOGo_UIxTaskView_H__ - -#include - -@class NSCalendarDate; -@class iCalToDo; -@class iCalPerson; -@class SOGoDateFormatter; - -@interface UIxTaskView : UIxComponent -{ - iCalToDo* task; - iCalPerson* attendee; - SOGoDateFormatter *dateFormatter; - id item; -} - -- (iCalToDo *) task; - -/* permissions */ -- (BOOL)canAccessApt; -- (BOOL)canEditApt; - -- (SOGoDateFormatter *)dateFormatter; -- (NSCalendarDate *)startTime; -- (NSCalendarDate *)endTime; - -- (NSString *)attributesTabLink; -- (NSString *)participantsTabLink; - -- (NSString *)completeHrefForMethod:(NSString *)_method - withParameter:(NSString *)_param - forKey:(NSString *)_key; - -@end - -#endif /* __SOGo_UIxTaskView_H__ */ diff --git a/UI/Scheduler/UIxTaskView.m b/UI/Scheduler/UIxTaskView.m deleted file mode 100644 index 0af814079..000000000 --- a/UI/Scheduler/UIxTaskView.m +++ /dev/null @@ -1,294 +0,0 @@ -/* - Copyright (C) 2004-2005 SKYRIX Software AG - - This file is part of OpenGroupware.org. - - 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. -*/ - -#import "UIxTaskView.h" -#import -#import -#import -#import -#import -#import "UIxComponent+Scheduler.h" -#import "common.h" - -@interface UIxTaskView (PrivateAPI) -- (BOOL)isAttendeeActiveUser; -@end - -@implementation UIxTaskView - -- (void)dealloc { - [task release]; - [attendee release]; - [dateFormatter release]; - [item release]; - [super dealloc]; -} - -/* accessors */ - -- (NSString *)tabSelection { - NSString *selection; - - selection = [self queryParameterForKey:@"tab"]; - if (selection == nil) - selection = @"attributes"; - return selection; -} - -- (void)setAttendee:(id)_attendee { - ASSIGN(attendee, _attendee); -} -- (id)attendee { - return attendee; -} - -- (BOOL)isAttendeeActiveUser { - NSString *email, *attEmail; - - email = [[[self context] activeUser] primaryEmail]; - attendee = [self attendee]; - attEmail = [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(item, _item); -} -- (id)item { - return item; -} - -- (SOGoDateFormatter *)dateFormatter { - if (dateFormatter == nil) { - dateFormatter = - [[SOGoDateFormatter alloc] initWithLocale:[self locale]]; - [dateFormatter setFullWeekdayNameAndDetails]; - } - return dateFormatter; -} - -- (NSCalendarDate *) startTime -{ - NSCalendarDate *date; - NSTimeZone *timeZone; - - timeZone = [[context activeUser] timeZone]; - date = [[self task] startDate]; - [date setTimeZone: timeZone]; - - return date; -} - -- (NSCalendarDate *) endTime -{ - NSCalendarDate *date; - NSTimeZone *timeZone; - - timeZone = [[context activeUser] timeZone]; - date = [[self task] due]; - [date setTimeZone: timeZone]; - - return date; -} - -- (NSString *)resourcesAsString { - NSArray *resources, *cns; - - resources = [[self task] resources]; - cns = [resources valueForKey:@"cnForDisplay"]; - return [cns componentsJoinedByString:@"
"]; -} - -- (NSString *) categoriesAsString -{ - NSEnumerator *categories; - NSArray *rawCategories; - NSMutableArray *l10nCategories; - NSString *currentCategory, *l10nCategory; - - rawCategories - = [[task categories] componentsSeparatedByString: @","]; - l10nCategories = [NSMutableArray arrayWithCapacity: [rawCategories count]]; - categories = [rawCategories objectEnumerator]; - currentCategory = [categories nextObject]; - while (currentCategory) - { - l10nCategory - = [self labelForKey: [currentCategory stringByTrimmingSpaces]]; - if (l10nCategory) - [l10nCategories addObject: l10nCategory]; - currentCategory = [categories nextObject]; - } - - return [l10nCategories componentsJoinedByString: @", "]; -} - -// task.organizer.cnForDisplay -- (NSString *) eventOrganizer -{ - CardElement *organizer; - - organizer = [[self task] uniqueChildWithTag: @"organizer"]; - - return [organizer value: 0 ofAttribute: @"cn"]; -} - -- (NSString *) priorityLabelKey -{ - return [NSString stringWithFormat: @"prio_%@", [task priority]]; -} - -/* backend */ - -- (iCalToDo *) task -{ - SOGoTaskObject *clientObject; - - if (!task) - { - clientObject = [self clientObject]; - task = (iCalToDo *) [clientObject component: NO]; - [task retain]; - } - - return task; -} - -/* hrefs */ - -- (NSString *)attributesTabLink { - return [self completeHrefForMethod:[self ownMethodName] - withParameter:@"attributes" - forKey:@"tab"]; -} - -- (NSString *)participantsTabLink { - return [self completeHrefForMethod:[self ownMethodName] - withParameter:@"participants" - forKey:@"tab"]; -} - -- (NSString *)debugTabLink { - return [self completeHrefForMethod:[self ownMethodName] - withParameter:@"debug" - forKey:@"tab"]; -} - -- (NSString *)completeHrefForMethod:(NSString *)_method - withParameter:(NSString *)_param - forKey:(NSString *)_key -{ - NSString *href; - - [self setQueryParameter:_param forKey:_key]; - href = [self completeHrefForMethod:[self ownMethodName]]; - [self setQueryParameter:nil forKey:_key]; - return href; -} - - -/* access */ - -- (BOOL)isMyApt { - NSString *email; - iCalPerson *organizer; - - email = [[[self context] activeUser] primaryEmail]; - organizer = [[self task] organizer]; - if (!organizer) return YES; // assume this is correct to do, right? - return [[organizer rfc822Email] isEqualToString:email]; -} - -- (BOOL)canAccessApt { - NSString *email; - NSArray *partMails; - - if ([self isMyApt]) - return YES; - - /* not my apt - can access if it's public */ - if ([[[self task] accessClass] isEqualToString: @"PUBLIC"]) - return YES; - - /* can access it if I'm invited :-) */ - email = [[[self context] activeUser] primaryEmail]; - partMails = [[[self task] participants] valueForKey:@"rfc822Email"]; - return [partMails containsObject: email]; -} - -- (BOOL)canEditApt { - return [self isMyApt]; -} - - -/* action */ - -- (id)defaultAction { - if ([self task] == nil) { - return [NSException exceptionWithHTTPStatus:404 /* Not Found */ - reason:@"could not locate task"]; - } - - return self; -} - -- (BOOL)isDeletableClientObject { - return [[self clientObject] respondsToSelector:@selector(delete)]; -} - -- (id)deleteAction { - NSException *ex; - id url; - - if ([self task] == nil) { - return [NSException exceptionWithHTTPStatus:404 /* Not Found */ - reason:@"could not locate task"]; - } - - if (![self isDeletableClientObject]) { - /* return 400 == Bad Request */ - return [NSException exceptionWithHTTPStatus:400 - reason:@"method cannot be invoked on " - @"the specified object"]; - } - - if ((ex = [[self clientObject] delete]) != nil) { - // TODO: improve error handling - [self debugWithFormat:@"failed to delete: %@", ex]; - return ex; - } - - url = [[[self clientObject] container] baseURLInContext:[self context]]; - return [self redirectToLocation:url]; -} - -@end /* UIxTaskView */ diff --git a/UI/Templates/SchedulerUI/UIxTaskView.wox b/UI/Templates/SchedulerUI/UIxTaskView.wox deleted file mode 100644 index 3944c333c..000000000 --- a/UI/Templates/SchedulerUI/UIxTaskView.wox +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - - - - - - -
- - - - - -
-
-
- - - - - - - - - - - - - - - - - - - - -
- : - - -
- : - - -
- : - - -
- : - - Public - Private -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- : - - -
- : - - -
- : - - -
- : - - -
- : - - -
-
- - - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - - - - - - - - -
-
-
- - - SOGo Server - -
- Client: -
- Group:
- Deletable:
- Generation:
- MsgClass:
- -
- As iCal:
-
- -
- As Mail:
-
- -
-
-
-
-