+2004-08-05 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v0.9.7
+
+ * calendar.css: commented some styles out, because they don't really do
+ what I think they should do. Someone with better knowledge of CSS should
+ look into this.
+
2004-08-02 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.6
# $Id$
-SUBMINOR_VERSION:=6
+SUBMINOR_VERSION:=7
.dayoverview_cal_day_header {
background-color: #d2d2cc;
text-align: center;
- vertical-align: middle;
+ vertical-align: top;
font-size: 11pt;
- width: 20px;
- padding: 2px 2px 2px 2px;
- margin: 2px 2px 2px 2px;
+// width: 24px;
+// padding: 2px 2px 2px 2px;
+// margin: 2px 2px 2px 2px;
}
.dayoverview_cal_content {
color: #0033cc;
background-color: #e8e8e0;
text-align: center;
- vertical-align: middle;
+ vertical-align: top;
}
.dayoverview_cal_content_hilite {
color: #0033cc;
background-color: #fffff0;
text-align: center;
- vertical-align: middle;
+ vertical-align: top;
}
.dayoverview_cal_content_selected {
color: #0033cc;
background-color: #d2d2cc;
text-align: center;
- vertical-align: middle;
+ vertical-align: top;
}
.dayoverview_cal_content_dimmed a {
color: #5a5a5a;
+2004-08-05 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v0.9.14
+
+ * UIxCalDayOverview.[hm]: refactored currentDate -> moved to
+ UIxCalDayView.[hm].
+
+ * UIxCalDayView.[hm]: added currentDate and accompanied functionality.
+
+ * UIxCalView.[hm]: added -tooltipForApt.
+
+ * UIxCalDayChartview.[wox|m]: implemented.
+
+ * UIxCalInlineMonthOverview.wox: cosmetic changes.
+
+ * UIxCalDayOverview.wox, UIxCalWeekOverview.wox, UIxCalMonthOverview.wox:
+ uses "tooltipForApt" for view hyperlinks.
+
2004-08-02 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.13
@implementation UIxCalDayChartview
+- (NSArray *)columns {
+ static NSArray *columns = nil;
+ if(columns == nil) {
+ columns = [[NSArray arrayWithObject:@"0"] retain];
+ }
+ return columns;
+}
+
+- (BOOL)isPadColumn {
+ return NO;
+}
+
+- (NSString *)shortTextForApt {
+ return [[self appointment] valueForKey:@"title"];
+}
+
@end
className="UIxPageFrame"
title="name"
>
- <table id="skywintable" class="wintable" cellspacing="0" cellpadding="5" width="100%">
+ <table id="skywintable"
+ class="wintable"
+ cellspacing="0"
+ cellpadding="5"
+ width="100%"
+ >
<tr>
<td class="wintitle">
<table cellpadding="0" cellspacing="0" width="100%">
<td id="skywinbodycell" class="wincontent">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#e8e8e0">
- <td align="left" valign="middle" width="80%">TODO: controls</td><!-- 99% -->
+ <td align="left"
+ valign="middle"
+ width="80%"
+ >TODO: controls</td><!-- 99% -->
<td align="right">
<var:component className="UIxCalBackForthNavView"
methodName="ownMethodName"
const:selection="day"
currentDate="selectedDate"
>
- <table border="0" cellpadding="4" width="100%" cellspacing="2">
+ <table border="0"
+ cellpadding="4"
+ width="100%"
+ cellspacing="2"
+ >
<tr>
- <td width="1%" align="left" valign="middle" bgcolor="#e8e8e0">
+ <td width="1%"
+ align="left"
+ valign="middle"
+ bgcolor="#e8e8e0"
+ >
<table border='0' cellpadding='0' cellspacing='0'>
<tr>
<td><a href="dayoverview"
<td align="right" bgcolor="#e8e8e0">
<table border="0" cellpadding="0" cellspacing="1">
<tr>
- <td class="button_auto_env" nowrap="true" valign="middle" align="center">
+ <td class="button_auto_env"
+ nowrap="true"
+ valign="middle"
+ align="center"
+ >
<a class="button_auto"
href="dayprintview"
var:queryDictionary="queryParameters"
target="SOGoPrintView"
><var:string label:value="printview"/></a>
</td>
- <td class="button_auto_env" nowrap="true" valign="middle" align="center">
+ <td class="button_auto_env"
+ nowrap="true"
+ valign="middle"
+ align="center"
+ >
<a class="button_auto"
href="proposal"
var:queryDictionary="queryParameters"
<var:component className="UIxCalInlineMonthOverview"
selectedDate="thisMonth"
const:showYear="1"
- const:daySelectionHref="dayoverview"
+ const:daySelectionHref="daychartview"
const:showWeekColumn="0"
const:style="dayoverview_cal"
const:headerStyle="dayoverview_cal_title"
<var:component className="UIxCalInlineMonthOverview"
selectedDate="nextMonth"
const:showYear="1"
- const:daySelectionHref="dayoverview"
+ const:daySelectionHref="daychartview"
const:showWeekColumn="0"
const:style="dayoverview_cal"
const:headerStyle="dayoverview_cal_title"
</tr>
</table>
</td>
- <td>
+ <td width="100%">
<table class="dayoverview_content" width="100%">
- <var:foreach list="dateRange" item="currentDate">
- <tr>
- <td class="dayoverview_content_time">
+ <td width="100%" valign="top">
+ <var:vspan-matrix list="appointments"
+ item="appointment"
+ rows="dateRange"
+ row="currentDate"
+ columns="columns"
+ column="isPadColumn"
+ itemActive="isCurrentDateInApt"
+ const:rowHeight="8"
+ const:width="100%"
+ const:border="0"
+ const:cellpading="5"
+ const:cellspacing="2"
+ >
+ <var:matrix-label const:elementName="td"
+ const:position="left"
+ const:bgcolor="#e8e8e0"
+ const:width="2"
+ >
<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>
+ </var:matrix-label>
+ <!-- TODO: use css instead! -->
+ <var:matrix-empty const:elementName="td"
+ const:bgcolor="#efefe7"
+ >
+ </var:matrix-empty>
+ <!-- TODO: use css instead! -->
+ <var:matrix-cell const:elementName="td"
+ const:bgcolor="#d6d6ce"
+ const:valign="top"
+ >
+ <a var:href="appointmentViewURL"
+ var:queryDictionary="currentDateQueryParameters"
+ var:title="tooltipForApt"
+ ><var:string value="shortTextForApt" /></a>
+ </var:matrix-cell>
+ </var:vspan-matrix>
+ </td>
</table>
</td>
</tr>
@interface UIxCalDayOverview : UIxCalDayView
{
- NSCalendarDate *currentDate;
NSArray *currentApts;
}
-
-- (void)setCurrentDate:(NSCalendarDate *)_date;
-- (NSCalendarDate *)currentDate;
-
- (void)setCurrentApts:(NSArray *)_apts;
- (NSArray *)currentApts;
-- (NSArray *)aptsForCurrentDate;
-
-- (BOOL)hasNoAptsForCurrentDate;
- (int)minRequiredRowSpan;
-
-- (NSDictionary *)currentDateQueryParameters;
@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);
}
return self->currentApts;
}
-- (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];
-}
-
-- (BOOL)hasNoAptsForCurrentDate {
- return [[self aptsForCurrentDate] count] == 0;
-}
-
- (int)minRequiredRowSpan {
unsigned count = [[self aptsForCurrentDate] count];
return count == 0 ? 1 : count;
}
-- (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];
-}
-
@end
<var:foreach list="allDayApts" item="appointment">
<a var:href="appointmentViewURL"
var:queryDictionary="currentDateQueryParameters"
+ var:title="tooltipForApt"
><var:string value="shortTextForApt" /></a>
<br />
</var:foreach>
<var:foreach list="aptsForCurrentDate" item="appointment">
<a var:href="appointmentViewURL"
var:queryDictionary="currentDateQueryParameters"
+ var:title="tooltipForApt"
><var:string value="shortTextForApt" /></a>
<br />
</var:foreach>
@interface UIxCalDayView : UIxCalView
{
+ NSCalendarDate *currentDate;
}
+- (void)setCurrentDate:(NSCalendarDate *)_date;
+- (NSCalendarDate *)currentDate;
+- (BOOL)isCurrentDateInApt;
+
+- (NSDictionary *)currentDateQueryParameters;
+
- (NSArray *)dateRange;
+/* appointments */
+- (NSArray *)aptsForCurrentDate;
+- (BOOL)hasAptsForCurrentDate;
+
@end
#endif /* __UIxCalDayView_H_ */
#include "common.h"
@interface UIxCalDayView (PrivateAPI)
+- (BOOL)isCurrentDateInApt:(id)_apt;
- (NSArray *)_getDatesFrom:(NSCalendarDate *)_from to:(NSCalendarDate *)_to;
@end
@implementation UIxCalDayView
+- (void)dealloc {
+ [self->currentDate release];
+ [super dealloc];
+}
+
+- (void)setCurrentDate:(NSCalendarDate *)_date {
+ ASSIGN(self->currentDate, _date);
+}
+- (NSCalendarDate *)currentDate {
+ return self->currentDate;
+}
+
+- (BOOL)isCurrentDateInApt {
+ return [self isCurrentDateInApt:[self appointment]];
+}
+
+- (BOOL)isCurrentDateInApt:(id)_apt {
+ NSCalendarDate *start, *end, *aptStartDate, *aptEndDate;
+
+ start = self->currentDate;
+ end = [start dateByAddingYears:0
+ months:0
+ days:0
+ hours:0
+ minutes:59
+ seconds:59];
+
+ aptStartDate = [_apt valueForKey:@"startDate"];
+ aptEndDate = [_apt valueForKey:@"endDate"];
+
+ /* does apt fully enclose start/end? */
+ if([start isGreaterThanOrEqualTo:aptStartDate] &&
+ [end isLessThanOrEqualTo:aptEndDate])
+ return YES;
+ if([aptStartDate isGreaterThanOrEqualTo:start] &&
+ [aptStartDate isLessThan:end])
+ return YES;
+ if([aptEndDate isGreaterThan:start] &&
+ [aptEndDate isLessThanOrEqualTo:end])
+ return YES;
+
+ return NO;
+}
- (NSArray *)dateRange {
/* default range is from dayStartHour to dayEndHour. Any values before
return [self queryParametersBySettingSelectedDate:date];
}
+- (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];
+}
+
/* fetching */
return [self fetchCoreInfos];
}
+- (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];
+}
+
+- (BOOL)hasAptsForCurrentDate {
+ return [[self aptsForCurrentDate] count] != 0;
+}
+
@end
>
<tr var:class="headerStyle">
<td>
- <var:if condition="hasMonthSelectionHref"><a var:href="monthSelectionHref"
- var:queryDictionary="currentMonthQueryParameters"
- ><var:string value="headerString" /></a>
+ <var:if condition="hasMonthSelectionHref"
+ ><a var:href="monthSelectionHref"
+ var:queryDictionary="currentMonthQueryParameters"
+ ><var:string value="headerString" /></a>
</var:if>
- <var:if condition="hasMonthSelectionHref" const:negate="YES"><var:string value="headerString" /></var:if>
+ <var:if condition="hasMonthSelectionHref"
+ const:negate="YES"
+ ><var:string value="headerString" /></var:if>
</td>
</tr>
<tr>
var:queryDictionary="currentWeekQueryParameters"
><var:string value="weekOfYear" /></a>
</var:if>
- <var:if condition="hasWeekSelectionHref" const:negate="YES">
+ <var:if condition="hasWeekSelectionHref"
+ const:negate="YES"
+ >
<var:string value="weekOfYear" />
</var:if>
</var:month-label>
var:queryDictionary="currentDayQueryParameters"
><var:string value="currentDay.dayOfMonth"/></a>
</var:if>
- <var:if condition="hasDaySelectionHref" const:negate="YES">
+ <var:if condition="hasDaySelectionHref"
+ const:negate="YES"
+ >
<var:string value="currentDay.dayOfMonth"/>
</var:if>
</span>
<var:month>
<a var:href="appointmentViewURL"
class="monthoverview_content_link"
- var:title="shortTextForApt"
+ var:title="tooltipForApt"
var:queryDictionary="currentDayQueryParameters"
><var:string value="shortTitleForApt"/></a>
<br />
- (NSString *)aptTypeIcon;
- (NSString *)shortTextForApt;
- (NSString *)shortTitleForApt;
+- (NSString *)tooltipForApt;
- (NSString *)appointmentViewURL;
- (id)holidayInfo;
return title;
}
+- (NSString *)tooltipForApt {
+ NSCalendarDate *startDate, *endDate;
+ NSMutableString *aptDescr;
+ NSString *s;
+ BOOL spansRange;
+ id apt;
+
+ apt = [self appointment];
+ spansRange = NO;
+ startDate = [apt valueForKey:@"startDate"];
+ [startDate setTimeZone:[self viewTimeZone]];
+ endDate = [apt valueForKey:@"endDate"];
+ if(endDate != nil) {
+ [endDate setTimeZone:[self viewTimeZone]];
+ spansRange = ![endDate isEqualToDate:startDate];
+ }
+ aptDescr = [[NSMutableString alloc] init];
+ [aptDescr appendString:[self labelForKey:@"appointment"]];
+ [aptDescr appendFormat:@"\n%02i:%02i",
+ [startDate hourOfDay],
+ [startDate minuteOfHour]];
+ if(spansRange) {
+ [aptDescr appendFormat:@" - %02i:%02i",
+ [endDate hourOfDay],
+ [endDate minuteOfHour]];
+ }
+ s = [apt valueForKey:@"title"];
+ if(s) {
+ [aptDescr appendFormat:@"\n%@", s];
+ }
+ s = [apt valueForKey:@"location"];
+ if(s) {
+ [aptDescr appendFormat:@"\n%@", s];
+ }
+ return [aptDescr autorelease];
+}
+
- (NSCalendarDate *)referenceDateForFormatter {
return [self selectedDate];
}
</var:if>
<var:week>
<a var:href="appointmentViewURL"
+ var:title="tooltipForApt"
><small><var:string value="shortTextForApt" /></small></a><br />
</var:week>
</var:week-overview>
# $Id$
-SUBMINOR_VERSION:=13
+SUBMINOR_VERSION:=14