From: znek Date: Mon, 28 Jun 2004 18:50:52 +0000 (+0000) Subject: AppointmentView -> first version X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad5f791a1ceead4f4c3680ed0eafae85847b7bfa;p=scalable-opengroupware.org AppointmentView -> first version git-svn-id: http://svn.opengroupware.org/SOGo/trunk@69 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ZideStore/UI-X/ChangeLog b/ZideStore/UI-X/ChangeLog index f5f3d070..1a2266b2 100644 --- a/ZideStore/UI-X/ChangeLog +++ b/ZideStore/UI-X/ChangeLog @@ -1,3 +1,14 @@ +2004-06-28 Marcus Mueller + + * Common/UIxComponent.[hm]: moved -ownMethodName here. + + * Scheduler/UIxCalView.[hm]: removed -ownMethodName, moved to + UIxComponent (reuse). + + * Scheduler/UIxAppointmentView.[hm]: first "draft" of view component. + The look of OGo is resembled closely, but most features are still + missing. + 2004-06-28 Marcus Mueller * Scheduler/GNUmakefile.preamble: links against libSOGoLogic now. diff --git a/ZideStore/UI-X/Common/UIxComponent.h b/ZideStore/UI-X/Common/UIxComponent.h index eab1b730..b3b41f59 100644 --- a/ZideStore/UI-X/Common/UIxComponent.h +++ b/ZideStore/UI-X/Common/UIxComponent.h @@ -41,6 +41,8 @@ /* appends queryParameters to _method if any are set */ - (NSString *)completeHrefForMethod:(NSString *)_method; +- (NSString *)ownMethodName; + @end #endif /* __UIxComponent_H_ */ diff --git a/ZideStore/UI-X/Common/UIxComponent.m b/ZideStore/UI-X/Common/UIxComponent.m index 43534f0e..0a1650e6 100644 --- a/ZideStore/UI-X/Common/UIxComponent.m +++ b/ZideStore/UI-X/Common/UIxComponent.m @@ -120,4 +120,29 @@ return [_method stringByAppendingFormat:@"?%@", qs]; } +- (NSString *)ownMethodName { + NSString *uri; + NSRange r; + + uri = [[[self context] request] uri]; + + /* first: cut off query parameters */ + + r = [uri rangeOfString:@"?" options:NSBackwardsSearch]; + if (r.length > 0) + uri = [uri substringToIndex:r.location]; + + /* next: strip trailing slash */ + + if ([uri hasSuffix:@"/"]) uri = [uri substringToIndex:([uri length] - 1)]; + r = [uri rangeOfString:@"/" options:NSBackwardsSearch]; + + /* then: cut of last path component */ + + if (r.length == 0) // no slash? are we at root? + return @"/"; + + return [uri substringFromIndex:(r.location + 1)]; +} + @end diff --git a/ZideStore/UI-X/Common/calendar.css b/ZideStore/UI-X/Common/calendar.css index ee49f296..34553bb4 100644 --- a/ZideStore/UI-X/Common/calendar.css +++ b/ZideStore/UI-X/Common/calendar.css @@ -1,10 +1,16 @@ -.date_label { - color: #06348b; +.aptview_title { + font-size: 10pt; font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; - font-size: 12pt; + color: #000000; font-weight: bold; } +.aptview_text { + font-size: 10pt; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + color: #000000; +} + .weekoverview_title { font-size: 10pt; font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; diff --git a/ZideStore/UI-X/Common/zidestoreui.css b/ZideStore/UI-X/Common/zidestoreui.css index be032b46..5d1e878c 100644 --- a/ZideStore/UI-X/Common/zidestoreui.css +++ b/ZideStore/UI-X/Common/zidestoreui.css @@ -41,6 +41,14 @@ font.defaultfont { color: #000000; } +.window_label { + color: #06348b; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 12pt; + font-weight: bold; +} + + /* tabs */ .tab { diff --git a/ZideStore/UI-X/Scheduler/UIxAppointmentView.h b/ZideStore/UI-X/Scheduler/UIxAppointmentView.h index 2cf50057..9038594d 100644 --- a/ZideStore/UI-X/Scheduler/UIxAppointmentView.h +++ b/ZideStore/UI-X/Scheduler/UIxAppointmentView.h @@ -3,12 +3,24 @@ #ifndef __ZideStoreUI_UIxAppointmentView_H__ #define __ZideStoreUI_UIxAppointmentView_H__ -#include +#include -@interface UIxAppointmentView : SoComponent +@interface UIxAppointmentView : UIxComponent { + NSString *tabSelection; + id appointment; + id attendee; } +- (id)appointment; + +- (NSString *)attributesTabLink; +- (NSString *)participantsTabLink; + +- (NSString *)completeHrefForMethod:(NSString *)_method + withParameter:(NSString *)_param + forKey:(NSString *)_key; + @end #endif /* __ZideStoreUI_UIxAppointmentView_H__ */ diff --git a/ZideStore/UI-X/Scheduler/UIxAppointmentView.m b/ZideStore/UI-X/Scheduler/UIxAppointmentView.m index e693810f..f69ee747 100644 --- a/ZideStore/UI-X/Scheduler/UIxAppointmentView.m +++ b/ZideStore/UI-X/Scheduler/UIxAppointmentView.m @@ -3,6 +3,8 @@ #include "UIxAppointmentView.h" #include "common.h" #include +#include + @interface NSObject(UsedPrivates) - (SxAptManager *)aptManagerInContext:(id)_ctx; @@ -11,22 +13,91 @@ @implementation UIxAppointmentView - (void)dealloc { + [self->appointment release]; + [self->attendee release]; [super dealloc]; } + +/* accessors */ + + +- (NSString *)tabSelection { + NSString *selection; + + selection = [self queryParameterForKey:@"tab"]; + if(! selection) + selection = @"attributes"; + return selection; +} + +- (void)setAttendee:(id)_attendee { + ASSIGN(self->attendee, _attendee); +} +- (id)attendee { + return self->attendee; +} + + /* backend */ + - (SxAptManager *)aptManager { return [[self clientObject] aptManagerInContext:[self context]]; } -- (id)sogoApt { - NSString *iCalString; - id apt; +- (SOGoAppointment *)appointment { + if(self->appointment == nil) { + NSString *iCalString; + + iCalString = [[self clientObject] valueForKey:@"iCalString"]; + self->appointment = [[SOGoAppointment alloc] initWithICalString:iCalString]; + } + return self->appointment; +} + +- (NSString *)formattedAptStartTime { + NSCalendarDate *date; + + date = [[self appointment] startDate]; + /* TODO: convert this into display timeZone! */ + return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"]; +} + +- (NSString *)formattedAptEndTime { + NSCalendarDate *date; - iCalString = [[self clientObject] iCalString]; - apt = [[NSClassFromString(@"SOGoAppointment") alloc] initWithiCalString:iCalString]; - return apt; + date = [[self appointment] endDate]; + /* TODO: convert this into display timeZone! */ + return [date descriptionWithCalendarFormat:@"%A, %Y-%m-%d %H:%M %Z"]; +} + + +/* hrefs */ + + +- (NSString *)attributesTabLink { + return [self completeHrefForMethod:[self ownMethodName] + withParameter:@"attributes" + forKey:@"tab"]; +} + +- (NSString *)participantsTabLink { + return [self completeHrefForMethod:[self ownMethodName] + withParameter:@"participants" + 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; } @end /* UIxAppointmentView */ diff --git a/ZideStore/UI-X/Scheduler/UIxAppointmentView.wox b/ZideStore/UI-X/Scheduler/UIxAppointmentView.wox index 7d64959e..e60d68b4 100644 --- a/ZideStore/UI-X/Scheduler/UIxAppointmentView.wox +++ b/ZideStore/UI-X/Scheduler/UIxAppointmentView.wox @@ -1,9 +1,149 @@ - + + + + + + + + + + + + + + + +
+ + + + + +
+ Appointment Viewer + +
+
+ + + + + +
+ + + + + + + + +
+ printview + + edit + + delete +
+
+
+ + + + + + + + + + +
+ Title: + + + + +
+ Location: + + + + +
+
+ + + + + + + + + + + +
+ Start time: + + + + +
+ End time: + + + + +
+
+ + + + + + + + + + +
+ Email +
+ + + +
+
+
+
+ +
diff --git a/ZideStore/UI-X/Scheduler/UIxCalDateLabel.wox b/ZideStore/UI-X/Scheduler/UIxCalDateLabel.wox index c5d8b168..4a0c93ae 100644 --- a/ZideStore/UI-X/Scheduler/UIxCalDateLabel.wox +++ b/ZideStore/UI-X/Scheduler/UIxCalDateLabel.wox @@ -4,5 +4,5 @@ xmlns:var="http://www.skyrix.com/od/binding" xmlns:const="http://www.skyrix.com/od/constant" xmlns:rsrc="OGo:url" - const:class="date_label" + const:class="window_label" > \ No newline at end of file diff --git a/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox b/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox index f79f96ae..83b1b0d1 100644 --- a/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox +++ b/ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox @@ -121,6 +121,7 @@ diff --git a/ZideStore/UI-X/Scheduler/UIxCalView.h b/ZideStore/UI-X/Scheduler/UIxCalView.h index 59c49d37..231d6228 100644 --- a/ZideStore/UI-X/Scheduler/UIxCalView.h +++ b/ZideStore/UI-X/Scheduler/UIxCalView.h @@ -42,7 +42,6 @@ /* URLs */ - (NSString *)appointmentViewURL; -- (NSString *)ownMethodName; /* backend */ diff --git a/ZideStore/UI-X/Scheduler/UIxCalView.m b/ZideStore/UI-X/Scheduler/UIxCalView.m index 65eb785b..e68043df 100644 --- a/ZideStore/UI-X/Scheduler/UIxCalView.m +++ b/ZideStore/UI-X/Scheduler/UIxCalView.m @@ -127,31 +127,6 @@ return [NSString stringWithFormat:@"%@/view", pkey]; } -- (NSString *)ownMethodName { - NSString *uri; - NSRange r; - - uri = [[[self context] request] uri]; - - /* first: cut off query parameters */ - - r = [uri rangeOfString:@"?" options:NSBackwardsSearch]; - if (r.length > 0) - uri = [uri substringToIndex:r.location]; - - /* next: strip trailing slash */ - - if ([uri hasSuffix:@"/"]) uri = [uri substringToIndex:([uri length] - 1)]; - r = [uri rangeOfString:@"/" options:NSBackwardsSearch]; - - /* then: cut of last path component */ - - if (r.length == 0) // no slash? are we at root? - return @"/"; - - return [uri substringFromIndex:(r.location + 1)]; -} - /* backend */ diff --git a/ZideStore/UI-X/Scheduler/UIxCalWeekOverview.wox b/ZideStore/UI-X/Scheduler/UIxCalWeekOverview.wox index d5df607e..8faffe1e 100644 --- a/ZideStore/UI-X/Scheduler/UIxCalWeekOverview.wox +++ b/ZideStore/UI-X/Scheduler/UIxCalWeekOverview.wox @@ -118,7 +118,9 @@ - +