+2004-07-26 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * calendar.css: added styles for dayoverview's content.
+
2004-07-23 Marcus Mueller <znek@mulle-kybernetik.com>
* calendar.css: added styles for dayoverview's calendar.
}
+.dayoverview_content {
+ padding: 1px;
+ margin: 0px 0px 0px 0px;
+ vertical-align: top;
+ font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+ letter-spacing: 0pt;
+ font-size: 9pt;
+}
+
+.dayoverview_content_time {
+ background-color: #d2d2cc;
+ text-align: center;
+}
+
+.dayoverview_content_time_link {
+ font-size: 8pt;
+}
+.dayoverview_content_time_link a {
+ color: #0033cc;
+ text-decoration: none;
+}
+.dayoverview_content_time_link a:hover {
+ color: #ff0000;
+ text-decoration: underline;
+}
+
+.dayoverview_content_apts {
+ color: #0033cc;
+ background-color: #e8e8e0;
+ text-align: left;
+ vertical-align: top;
+}
+
+
.dayoverview_cal {
color: #000000;
font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+2004-07-26 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * UIxComponent.m: added "hm" queryParameter to add hour/minute part to
+ selectedDate which is necessary for appointment proposals. Removed
+ all additional stuff from -dateForDateString: and moved this to
+ -selectedDate. IMHO this is always high-level behaviour which needs to
+ be refined in the appropriate high-level method, not at conversion
+ level.
+
2004-07-21 Marcus Mueller <znek@mulle-kybernetik.com>
* UIxComponent.[hm]: renamed some of the labels to better reflect the
- (NSCalendarDate *)selectedDate {
NSString *s;
NSCalendarDate *cdate;
-
+
s = [self queryParameterForKey:@"day"];
cdate = ([s length] > 0)
? [self dateForDateString:s]
: [NSCalendarDate date];
[cdate setTimeZone:[self viewTimeZone]];
+ s = [self queryParameterForKey:@"hm"];
+ if([s length] == 4) {
+ unsigned hour, minute;
+
+ hour = [[s substringToIndex:2] unsignedIntValue];
+ minute = [[s substringFromIndex:2] unsignedIntValue];
+ cdate = [cdate hour:hour minute:minute];
+ }
+ else {
+ cdate = [cdate hour:12 minute:0];
+ }
return cdate;
}
}
- (NSCalendarDate *)dateForDateString:(NSString *)_dateString {
- NSTimeZone *tz;
-
- tz = [self viewTimeZone];
- /* Note: we should give a time, best is noon to avoid edge conditions */
- _dateString = [_dateString stringByAppendingFormat:@"12:00:00 %@",
- [tz abbreviation]];
return [NSCalendarDate dateWithString:_dateString
- calendarFormat:@"%Y%m%d %H:%M:%S %Z"];
+ calendarFormat:@"%Y%m%d"];
}
+2004-07-26 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v0.9.7
+
+ * UIxCalView.[hm]: new methods for defaults access, -dayStartHour,
+ -dayEndHour and -shouldDisplayWeekend.
+
+ * UIxCalDayOverview.[m|wox]: added content. CSS isn't 100% proper, yet.
+
+ * UIxCalWeekView.m, UIxCalMonthView.m: set startDate/endDate properly.
+
+ * UIxAppointmentEditor.m: fixed a subtle bug in -uriAsFormat that
+ prevented date information from being set properly in newAction:.
+
2004-07-23 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.6
NSRange r;
uri = [[[self context] request] uri];
-
+
/* first: identify query parameters */
r = [uri rangeOfString:@"?" options:NSBackwardsSearch];
if (r.length > 0) {
- uri = [uri substringToIndex:r.location];
qp = [uri substringFromIndex:r.location];
+ uri = [uri substringToIndex:r.location];
}
else
qp = nil;
nextMethod = [NSString stringWithFormat:@"%@/edit", objectId];
uriFormat = [self uriAsFormat];
uri = [[NSString alloc] initWithFormat:uriFormat, nextMethod];
-
req = [[self context] request];
r = [WOResponse responseWithRequest:req];
[r setStatus:302 /* moved */];
#include "UIxCalDayView.h"
+#include <Foundation/Foundation.h>
+#include <NGExtensions/NGExtensions.h>
+
@interface UIxCalDayOverview : UIxCalDayView
{
-
+ NSCalendarDate *currentDate;
+ NSArray *currentApts;
}
@end
@implementation UIxCalDayOverview
+- (void)dealloc {
+ [self->currentDate release];
+ [self->currentApts release];
+ [super dealloc];
+}
+
+- (void)setCurrentDate:(NSCalendarDate *)_date {
+ ASSIGN(self->currentDate, _date);
+}
+- (NSCalendarDate *)currentDate {
+ return self->currentDate;
+}
+
+- (void)setCurrentApts:(NSArray *)_apts {
+ ASSIGN(self->currentApts, _apts);
+}
+- (NSArray *)currentApts {
+ return self->currentApts;
+}
+
+- (NSArray *)dateRange {
+ NSMutableArray *dateRange;
+ unsigned i, count, offset;
+
+ offset = [self dayStartHour];
+ count = [self dayEndHour] - offset;
+ dateRange = [[NSMutableArray alloc] initWithCapacity:count];
+ for(i = 0; i < count; i++) {
+ NSCalendarDate *date;
+
+ date = [[self startDate] hour:offset + i minute:0];
+ [dateRange addObject:date];
+ }
+ return [dateRange autorelease];
+}
+
+
+- (NSArray *)aptsForCurrentDate {
+ NSArray *apts;
+ NSMutableArray *filtered;
+ unsigned i, count;
+ NSCalendarDate *start, *end;
+
+ start = self->currentDate;
+ end = [start dateByAddingYears:0
+ months:0
+ days:0
+ hours:0
+ minutes:59
+ seconds:59];
+
+ apts = [self appointments];
+ filtered = [[NSMutableArray alloc] initWithCapacity:1];
+ count = [apts count];
+ for(i = 0; i < count; i++) {
+ id apt;
+ NSCalendarDate *aptStartDate;
+
+ /* NOTE: appointments are totally opaque objects, we don't know much
+ about them. The reason for this is that they are backend-dependent
+ and we'd like to use UIx for SOGo *and* ZideStore also.
+ We have to accept the fact that we know just a little bit
+ of their API which is completely KVC driven.
+ */
+
+ apt = [apts objectAtIndex:i];
+ aptStartDate = [apt valueForKey:@"startDate"];
+ if([aptStartDate isGreaterThanOrEqualTo:start] &&
+ [aptStartDate isLessThan:end]) {
+ [filtered addObject:apt];
+ }
+ }
+
+ return [filtered autorelease];
+}
+
+- (NSString *)shortTextForApt {
+ NSCalendarDate *startDate, *endDate;
+ NSString *ms;
+
+ startDate = [[self appointment] valueForKey:@"startDate"];
+ [startDate setTimeZone:[self viewTimeZone]];
+ endDate = [[self appointment] valueForKey:@"endDate"];
+ [endDate setTimeZone:[self viewTimeZone]];
+
+ ms = [NSString stringWithFormat:@"%02i:%02i %@",
+ [startDate hourOfDay],
+ [startDate minuteOfHour],
+ [[self appointment] valueForKey:@"title"]];
+ return ms;
+}
+
+
+/* URLs */
+
+- (NSDictionary *)currentDateQueryParameters {
+ NSMutableDictionary *qp;
+ NSString *hmString;
+ NSCalendarDate *date;
+
+ date = [self currentDate];
+ hmString = [NSString stringWithFormat:@"%02d%02d",
+ [date hourOfDay], [date minuteOfHour]];
+ qp = [[self queryParameters] mutableCopy];
+ [self setSelectedDateQueryParameter:date inDictionary:qp];
+ [qp setObject:hmString forKey:@"hm"];
+ return [qp autorelease];
+}
+
+
+/* appointments */
+
+- (NSArray *)appointments {
+ return [self fetchCoreInfos];
+}
+
@end
<td><a href="daychartview"
var:queryDictionary="queryParameters"
><img rsrc:src="icon_apt_chart.gif"
- label:title="Chart"
- label:alt="Chart"
- border="0"
- valign="top"
- /></a></td>
+ label:title="Chart"
+ label:alt="Chart"
+ border="0"
+ valign="top"
+ /></a></td>
<td><a href="daylistview"
var:queryDictionary="queryParameters"
><img rsrc:src="icon_apt_list.gif"
- label:title="List"
- label:alt="List"
- border="0"
- valign="top"
- /></a></td>
+ label:title="List"
+ label:alt="List"
+ border="0"
+ valign="top"
+ /></a></td>
</tr>
</table>
</td>
</table>
</td>
<td>
- TODO: Content
+ <table class="dayoverview_content" width="100%">
+ <var:foreach list="dateRange" item="currentDate">
+ <tr>
+ <td class="dayoverview_content_time">
+ <var:string value="currentDate"
+ const:dateformat="%H:%M"
+ />
+ <br />
+ <span class="dayoverview_content_time_link">
+ [<a href="new"
+ var:queryDictionary="currentDateQueryParameters"
+ ><var:string label:value="new" /></a>]
+ </span>
+ </td>
+ <td class="dayoverview_content_apts">
+ <var:foreach list="aptsForCurrentDate" item="appointment">
+ <a var:href="appointmentViewURL"
+ var:queryDictionary="currentDateQueryParameters"
+ ><var:string value="shortTextForApt" /></a>
+ <br />
+ </var:foreach>
+ </td>
+ </tr>
+ </var:foreach>
+ </table>
</td>
</tr>
</table>
/* fetching */
- (NSCalendarDate *)startDate {
- return [[self selectedDate] beginOfDay];
+ return [[self selectedDate] hour:[self dayStartHour] minute:0];
}
- (NSCalendarDate *)endDate {
- return [[self startDate] endOfDay];
+ return [[self startDate] hour:[self dayEndHour] minute:0];
}
@end
<var:foreach list="allDayApts" item="appointment">
<a var:href="appointmentViewURL"
><var:string value="shortTextForApt"/></a>
+ <br />
</var:foreach>
</var:month-info>
<var:month-label const:orientation="top" dayOfWeek="dayOfWeek" const:class="monthoverview_title">
var:title="shortTextForApt"
var:queryDictionary="currentDayQueryParameters"
><var:string value="shortTitleForApt"/></a>
+ <br />
</var:month>
</var:month-overview>
</var:component>
// $Id$
#include "UIxCalMonthView.h"
+#include <NGExtensions/NGExtensions.h>
#include "common.h"
+
@implementation UIxCalMonthView
- (NSCalendarDate *)startDate {
- return [[[super startDate] firstDayOfMonth] beginOfDay];
+ return [[[super startDate] firstDayOfMonth]
+ hour:[self dayStartHour]
+ minute:0];
}
- (NSCalendarDate *)endDate {
- NSCalendarDate *startDate = [[self startDate] endOfDay];
+ NSCalendarDate *startDate = [[self startDate]
+ hour:[self dayEndHour]
+ minute:0];
return [startDate dateByAddingYears:0
months:0
days:[startDate numberOfDaysInMonth]
- (BOOL)showFullNames;
- (BOOL)showAMPMDates;
+- (unsigned)dayStartHour;
+- (unsigned)dayEndHour;
+- (BOOL)shouldDisplayWeekend;
+
- (NSCalendarDate *)referenceDateForFormatter;
/* URLs */
return NO;
}
+- (unsigned)dayStartHour {
+ return 8;
+}
+
+- (unsigned)dayEndHour {
+ return 19;
+}
+
+- (BOOL)shouldDisplayWeekend {
+ return NO;
+}
+
/* URLs */
// $Id$
#include "UIxCalWeekView.h"
+#include <NGExtensions/NGExtensions.h>
#include "common.h"
@implementation UIxCalWeekView
- (NSCalendarDate *)startDate {
- return [[[super startDate] mondayOfWeek] beginOfDay];
+ return [[[super startDate] mondayOfWeek] hour:[self dayStartHour]
+ minute:0];
}
- (NSCalendarDate *)endDate {
return [[[self startDate] dateByAddingYears:0 months:0 days:7
- hours:0 minutes:0 seconds:0] endOfDay];
+ hours:0 minutes:0 seconds:0]
+ hour:[self dayEndHour] minute:0];
}
/* URLs */
# $Id$
-SUBMINOR_VERSION:=6
+SUBMINOR_VERSION:=7
# 1.1.0 requires NGObjWeb 4.2.202