+2005-07-05 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * SOGoAppointmentFolder.m: fetch new priority field in core infos
+ (v0.9.34)
+
2005-07-04 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoAppointmentFolder.m: fetch new priority field in overview infos
@"status", @"ispublic",
@"isallday", @"isopaque",
@"participants", @"partmails",
- @"partstates", @"sequence", nil];
+ @"partstates", @"sequence", @"priority", nil];
}
return [self fetchFields:infos
from:_startDate
# Version file
-SUBMINOR_VERSION:=33
+SUBMINOR_VERSION:=34
# v0.9.32 requires libGDLContentStore v4.5.26
# v0.9.28 requires libNGiCal v4.5.47
+2005-07-05 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * calendar.css: added appointment priority styles (v0.9.37)
+
2005-03-23 Marcus Mueller <znek@mulle-kybernetik.com>
* renamed "default.strings" to "Localizable.strings" (v0.9.36)
# Version file
-SUBMINOR_VERSION:=36
+SUBMINOR_VERSION:=37
# v0.9.28 requires NGExtensions v4.5.136
font-style: italic;
}
+.apt_prio0, .apt_prio5, .apt_prio6, .apt_prio7, .apt_prio8, .apt_prio9 {
+ font-weight: normal;
+}
+
+.apt_prio1, .apt_prio2, .apt_prio3, .apt_prio4 {
+ font-weight: bold;
+}
+
+
.anais_me {
color: #0000FF;
}
+2005-07-05 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * SOGoAptFormatter.[hm]: new API. -stringForObjectValue: is deprecated
+ now and should not be used anymore. Formatting needs a referenceDate
+ in order to properly display time ranges. Time ranges are currently
+ rendered in SOGoAptFormatter, but this should probably be delegated
+ to a natural language aware auxiliary (date-)formatter. Also, some
+ new formatting options have been introduced. (v0.9.24)
+
2005-01-26 Marcus Mueller <znek@mulle-kybernetik.com>
* SOGoDateFormatter.[hm]: new method -setFrenchDateFormat: to override
@interface SOGoAptFormatter : NSFormatter
{
NSTimeZone *tz;
- SEL formatAction;
- NSString *privateTitle;
+ SEL formatAction;
+ NSString *privateTitle;
+ BOOL omitsEndDate;
}
- (id)initWithDisplayTimeZone:(NSTimeZone *)_tz;
- (void)setTooltip;
+- (void)setSingleLineFullDetails;
- (void)setFullDetails;
- (void)setTitleOnly;
- (void)setShortTitleOnly;
+- (void)setOmitsEndDate;
- (void)setPrivateTooltip;
- (void)setPrivateDetails;
- (void)setPrivateTitle:(NSString *)_privateTitle;
- (NSString *)privateTitle;
-
+
+- (NSString *)stringForObjectValue:(id)_obj
+ referenceDate:(NSCalendarDate *)_refDate;
+
@end
#endif /* __SOGoAptFormatter_H_ */
#include "common.h"
@interface SOGoAptFormatter(PrivateAPI)
-- (NSString *)titleForApt:(id)_apt;
-- (NSString *)shortTitleForApt:(id)_apt;
+- (NSString *)titleForApt:(id)_apt :(NSCalendarDate *)_refDate;
+- (NSString *)shortTitleForApt:(id)_apt :(NSCalendarDate *)_refDate;
- (NSTimeZone *)displayTZ;
-- (void)appendTimeInfoFromApt:(id)_apt toBuffer:(NSMutableString *)_buf;
+
+- (void)appendTimeInfoForDate:(NSCalendarDate *)_date
+ usingReferenceDate:(NSCalendarDate *)_refDate
+ toBuffer:(NSMutableString *)_buf;
+
+- (void)appendTimeInfoFromApt:(id)_apt
+ usingReferenceDate:(NSCalendarDate *)_refDate
+ toBuffer:(NSMutableString *)_buf;
+@end
+
+// TODO: Clean this up, put it into NGExtensions!
+@interface NSCalendarDate (UIxCalMonthOverviewExtensions_UsedPrivates)
+- (BOOL)isDateInSameMonth:(NSCalendarDate *)_other;
@end
@implementation SOGoAptFormatter
/* accessors */
- (void)setTooltip {
- self->formatAction = @selector(tooltipForApt:);
+ self->formatAction = @selector(tooltipForApt::);
+}
+
+- (void)setSingleLineFullDetails {
+ self->formatAction = @selector(singleLineFullDetailsForApt::);
}
- (void)setFullDetails {
- self->formatAction = @selector(fullDetailsForApt:);
+ self->formatAction = @selector(fullDetailsForApt::);
}
- (void)setPrivateTooltip {
- self->formatAction = @selector(tooltipForPrivateApt:);
+ self->formatAction = @selector(tooltipForPrivateApt::);
}
- (void)setPrivateDetails {
- self->formatAction = @selector(detailsForPrivateApt:);
+ self->formatAction = @selector(detailsForPrivateApt::);
}
- (void)setTitleOnly {
- self->formatAction = @selector(titleForApt:);
+ self->formatAction = @selector(titleForApt::);
}
- (void)setShortTitleOnly {
- self->formatAction = @selector(shortTitleForApt:);
+ self->formatAction = @selector(shortTitleForApt::);
}
- (void)setPrivateSuppressAll {
- self->formatAction = @selector(suppressApt:);
+ self->formatAction = @selector(suppressApt::);
}
- (void)setPrivateTitleOnly {
- self->formatAction = @selector(titleOnlyForPrivateApt:);
+ self->formatAction = @selector(titleOnlyForPrivateApt::);
}
- (void)setPrivateTitle:(NSString *)_privateTitle {
return self->privateTitle;
}
+- (void)setOmitsEndDate {
+ self->omitsEndDate = YES;
+}
+
- (NSString *)stringForObjectValue:(id)_obj {
- return [self performSelector:self->formatAction withObject:_obj];
+ [self warnWithFormat:@"%s called, please use "
+ @"stringForObjectValue:referenceDate: instead!",
+ __PRETTY_FUNCTION__];
+ return [self stringForObjectValue:_obj referenceDate:nil];
+}
+
+- (NSString *)stringForObjectValue:(id)_obj
+ referenceDate:(NSCalendarDate *)_refDate
+{
+ return [self performSelector:self->formatAction
+ withObject:_obj
+ withObject:_refDate];
}
/* Private */
return self->tz;
}
-- (void)appendTimeInfoFromApt:(id)_apt toBuffer:(NSMutableString *)_buf {
- NSCalendarDate *startDate, *endDate;
+- (void)appendTimeInfoForDate:(NSCalendarDate *)_date
+ usingReferenceDate:(NSCalendarDate *)_refDate
+ toBuffer:(NSMutableString *)_buf
+{
+ /* several cases:
+ * 12:00
+ * 12:00 - 13:00
+ * 12:00 (07-05) - 13:00 (07-07)
+ * 12:00 (12-30-2004) - 13:00 (01-01-2005)
+ */
+
+ [_buf appendFormat:@"%02i:%02i",
+ [_date hourOfDay],
+ [_date minuteOfHour]];
+ if (_refDate && ![_date isDateOnSameDay:_refDate]) {
+ [_buf appendFormat:@" (%02i-%02i",
+ [_date monthOfYear],
+ [_date dayOfMonth]];
+ if ([_date yearOfCommonEra] != [_refDate yearOfCommonEra])
+ [_buf appendFormat:@"-%04i", [_date yearOfCommonEra]];
+ [_buf appendString:@")"];
+ }
+}
+
+- (void)appendTimeInfoFromApt:(id)_apt
+ usingReferenceDate:(NSCalendarDate *)_refDate
+ toBuffer:(NSMutableString *)_buf
+{
+ NSCalendarDate *startDate, *endDate, *date;
+ NSTimeZone *dtz;
BOOL spansRange;
spansRange = NO;
+ dtz = [self displayTZ];
startDate = [_apt valueForKey:@"startDate"];
- [startDate setTimeZone:[self displayTZ]];
+ [startDate setTimeZone:dtz];
endDate = [_apt valueForKey:@"endDate"];
if(endDate != nil) {
- [endDate setTimeZone:[self displayTZ]];
+ [endDate setTimeZone:dtz];
spansRange = ![endDate isEqualToDate:startDate];
}
- [_buf appendFormat:@"%02i:%02i",
- [startDate hourOfDay],
- [startDate minuteOfHour]];
- if(spansRange) {
- [_buf appendFormat:@", %02i:%02i",
- [endDate hourOfDay],
- [endDate minuteOfHour]];
+ if (_refDate)
+ [_refDate setTimeZone:dtz];
+
+#if 0
+ if (!_refDate || [startDate isDateOnSameDay:_refDate])
+ date = startDate;
+ else
+ date = [startDate hour:0 minute:0];
+#else
+ date = startDate;
+#endif
+
+ [self appendTimeInfoForDate:date
+ usingReferenceDate:_refDate
+ toBuffer:_buf];
+
+ if (spansRange && !self->omitsEndDate) {
+ [_buf appendString:@" - "];
+#if 0
+ if (!_refDate || [endDate isDateOnSameDay:_refDate])
+ date = endDate;
+ else
+ date = [endDate hour:23 minute:59];
+#else
+ date = endDate;
+#endif
+ [self appendTimeInfoForDate:date
+ usingReferenceDate:_refDate
+ toBuffer:_buf];
}
}
-- (NSString *)titleForApt:(id)_apt {
+- (NSString *)titleForApt:(id)_apt :(NSCalendarDate *)_refDate {
return [_apt valueForKey:@"title"];
}
-- (NSString *)shortTitleForApt:(id)_apt {
+- (NSString *)shortTitleForApt:(id)_apt :(NSCalendarDate *)_refDate {
NSString *title;
- title = [self titleForApt:_apt];
+ title = [self titleForApt:_apt :_refDate];
if ([title length] > 12)
title = [[title substringToIndex:11] stringByAppendingString:@"..."];
return title;
}
-- (NSString *)fullDetailsForApt:(id)_apt {
+- (NSString *)singleLineFullDetailsForApt:(id)_apt :(NSCalendarDate *)_refDate {
NSMutableString *aptDescr;
- NSString *s;
+ NSString *s;
+
+ aptDescr = [NSMutableString stringWithCapacity:60];
+ [self appendTimeInfoFromApt:_apt
+ usingReferenceDate:_refDate
+ toBuffer:aptDescr];
+ if ((s = [_apt valueForKey:@"location"]) != nil) {
+ [aptDescr appendFormat:@"; (%@)", s];
+ }
+ if ((s = [_apt valueForKey:@"title"]) != nil)
+ [aptDescr appendFormat:@"; %@", [self titleForApt:_apt :_refDate]];
+ return aptDescr;
+}
+
+- (NSString *)fullDetailsForApt:(id)_apt :(NSCalendarDate *)_refDate {
+ NSMutableString *aptDescr;
+ NSString *s;
aptDescr = [NSMutableString stringWithCapacity:60];
- [self appendTimeInfoFromApt:_apt toBuffer:aptDescr];
+ [self appendTimeInfoFromApt:_apt
+ usingReferenceDate:_refDate
+ toBuffer:aptDescr];
if ((s = [_apt valueForKey:@"location"]) != nil) {
if([s length] > 12)
s = [[s substringToIndex:11] stringByAppendingString:@"..."];
[aptDescr appendFormat:@" (%@)", s];
}
if ((s = [_apt valueForKey:@"title"]) != nil)
- [aptDescr appendFormat:@"<br />%@", [self shortTitleForApt:_apt]];
+ [aptDescr appendFormat:@"<br />%@", [self shortTitleForApt:_apt :_refDate]];
return aptDescr;
}
-- (NSString *)detailsForPrivateApt:(id)_apt {
+- (NSString *)detailsForPrivateApt:(id)_apt :(NSCalendarDate *)_refDate {
NSMutableString *aptDescr;
NSString *s;
aptDescr = [NSMutableString stringWithCapacity:40];
- [self appendTimeInfoFromApt:_apt toBuffer:aptDescr];
+ [self appendTimeInfoFromApt:_apt
+ usingReferenceDate:_refDate
+ toBuffer:aptDescr];
if ((s = [self privateTitle]) != nil)
[aptDescr appendFormat:@"<br />%@", s];
return aptDescr;
}
-- (NSString *)titleOnlyForPrivateApt:(id)_apt {
+- (NSString *)titleOnlyForPrivateApt:(id)_apt :(NSCalendarDate *)_refDate {
NSString *s;
s = [self privateTitle];
return s;
}
-- (NSString *)tooltipForApt:(id)_apt {
- NSCalendarDate *startDate, *endDate;
+- (NSString *)tooltipForApt:(id)_apt :(NSCalendarDate *)_refDate {
NSMutableString *aptDescr;
NSString *s;
- BOOL spansRange;
-
- spansRange = NO;
- startDate = [_apt valueForKey:@"startDate"];
- [startDate setTimeZone:[self displayTZ]];
- endDate = [_apt valueForKey:@"endDate"];
- if(endDate != nil) {
- [endDate setTimeZone:[self displayTZ]];
- spansRange = ![endDate isEqualToDate:startDate];
- }
+
aptDescr = [NSMutableString stringWithCapacity:60];
- [aptDescr appendFormat:@"%02i:%02i",
- [startDate hourOfDay],
- [startDate minuteOfHour]];
- if (spansRange) {
- [aptDescr appendFormat:@" - %02i:%02i",
- [endDate hourOfDay],
- [endDate minuteOfHour]];
- }
-
+ [self appendTimeInfoFromApt:_apt
+ usingReferenceDate:_refDate
+ toBuffer:aptDescr];
if ((s = [_apt valueForKey:@"title"]) != nil)
[aptDescr appendFormat:@"\n%@", s];
if ((s = [_apt valueForKey:@"location"]) != nil)
return aptDescr;
}
-- (NSString *)tooltipForPrivateApt:(id)_apt {
- NSCalendarDate *startDate, *endDate;
+- (NSString *)tooltipForPrivateApt:(id)_apt :(NSCalendarDate *)_refDate {
NSMutableString *aptDescr;
NSString *s;
- BOOL spansRange;
- spansRange = NO;
- startDate = [_apt valueForKey:@"startDate"];
- [startDate setTimeZone:[self displayTZ]];
- endDate = [_apt valueForKey:@"endDate"];
- if(endDate != nil) {
- [endDate setTimeZone:[self displayTZ]];
- spansRange = ![endDate isEqualToDate:startDate];
- }
aptDescr = [NSMutableString stringWithCapacity:25];
- [aptDescr appendFormat:@"%02i:%02i",
- [startDate hourOfDay],
- [startDate minuteOfHour]];
- if (spansRange) {
- [aptDescr appendFormat:@" - %02i:%02i",
- [endDate hourOfDay],
- [endDate minuteOfHour]];
- }
-
+ [self appendTimeInfoFromApt:_apt
+ usingReferenceDate:_refDate
+ toBuffer:aptDescr];
if ((s = [self privateTitle]) != nil)
[aptDescr appendFormat:@"\n%@", s];
return aptDescr;
}
-- (NSString *)suppressApt:(id)_apt {
+- (NSString *)suppressApt:(id)_apt :(NSCalendarDate *)_refDate {
return @"";
}
# $Id$
-SUBMINOR_VERSION:=23
+SUBMINOR_VERSION:=24
# v0.9.18 requires NGExtensions v4.5.136
+2005-07-05 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v0.9.123
+
+ * UIxCalWeekOverview.m, UIxCalWeekColumnsview.m,
+ UIxCalDayChartview.m, UIxCalDayListview.m,
+ UIxCalMonthOverview.m, UIxCalDayOverview.m: properly adjust formatter
+
+ * UIxCalDayOverview.m: fixed bugs in -aptsForCurrentDate and properly
+ override -allDayApts to also display appointments spanning ranges
+
+ * UIxCalWeekChartview.m: fixed bugs in -isRowActive logic
+
+ * UIxCalDayView.m: fixed bugs in filtering and range logic
+
+ * UIxCalView.m: added a deprecation warning, some code cleanup
+
+ * UIxCalInlineAptView.m: added new 'referenceDate' binding which will
+ be used with the revised appointment formatter to properly display
+ time ranges. Also adds 'priority' style information when this can
+ be found in the appointment.
+
+ * GNUmakefile: added new image resource
+
+ * images/apt_icon_private.gif: new resource for private appointments
+
2005-03-23 Marcus Mueller <znek@mulle-kybernetik.com>
* renamed "default.strings" to "Localizable.strings" (v0.9.122)
images/last.gif \
images/green_corner.gif \
images/invisible_space_2.gif \
+ images/apt_icon_private.gif \
SchedulerUI_LOCALIZED_RESOURCE_FILES += \
Localizable.strings \
@end
#include "common.h"
+#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalDayChartview
+- (void)configureFormatters {
+ [super configureFormatters];
+
+ [self->aptFormatter setShortTitleOnly];
+}
+
- (NSArray *)columns {
static NSArray *columns = nil;
if(columns == nil) {
@end
#include "common.h"
+#include <SOGoUI/SOGoAptFormatter.h>
#include <SOGo/AgenorUserManager.h>
#include <SOGo/SoObjects/Appointments/SOGoAppointmentFolder.h>
@implementation UIxCalDayListview
- (void)dealloc {
- [self->uids release];
+ [self->uids release];
[self->currentUid release];
[super dealloc];
}
+- (void)configureFormatters {
+ [super configureFormatters];
+
+ [self->aptFormatter setShortTitleOnly];
+}
+
/* accessors */
- (NSArray *)uids {
#include "UIxCalDayOverview.h"
#include "common.h"
+#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalDayOverview
return count == 0 ? 1 : count;
}
+/* overriding */
+
+- (void)configureFormatters {
+ [super configureFormatters];
+
+ [self->aptFormatter setSingleLineFullDetails];
+ [self->aptTooltipFormatter setTooltip];
+}
+
+- (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;
+
+ apt = [apts objectAtIndex:i];
+ aptStartDate = [apt valueForKey:@"startDate"];
+ if([aptStartDate isGreaterThanOrEqualTo:start] &&
+ [aptStartDate isLessThan:end])
+ {
+ [filtered addObject:apt];
+ }
+ }
+
+ return [filtered autorelease];
+}
+
+- (NSArray *)allDayApts {
+ NSCalendarDate *start;
+ NSArray *apts;
+ NSMutableArray *filtered;
+ unsigned i, count;
+
+ if (self->allDayApts)
+ return self->allDayApts;
+
+ start = [self startDate];
+ apts = [self appointments];
+ filtered = [[NSMutableArray alloc] initWithCapacity:1];
+ count = [apts count];
+ for (i = 0; i < count; i++) {
+ id apt;
+ NSNumber *bv;
+
+ apt = [apts objectAtIndex:i];
+ bv = [apt valueForKey:@"isallday"];
+ if ([bv boolValue]) {
+ [filtered addObject:apt];
+ }
+ else {
+ NSCalendarDate *aptStartDate;
+
+ aptStartDate = [apt valueForKey:@"startDate"];
+ if([aptStartDate isLessThan:start]) {
+ [filtered addObject:apt];
+ }
+ }
+ }
+
+ ASSIGN(self->allDayApts, filtered);
+ [filtered release];
+ return self->allDayApts;
+}
+
@end
or after are also fine */
NSCalendarDate *min, *max;
- NSArray *aptDateRanges;
+ NSArray *aptDateRanges;
min = [[self startDate] hour:[self dayStartHour] minute:0];
- max = [[self startDate] hour:[self dayEndHour] minute:0];
+ max = [[self startDate] hour:[self dayEndHour] minute:0];
aptDateRanges = [[self appointments] valueForKey:@"startDate"];
if([aptDateRanges count] != 0) {
NSCalendarDate *d;
aptDateRanges = [aptDateRanges sortedArrayUsingSelector:@selector(compareAscending:)];
- d = [aptDateRanges objectAtIndex:0];
- min = (NSCalendarDate *)[d earlierDate:min];
- d = [aptDateRanges objectAtIndex:[aptDateRanges count] - 1];
- max = (NSCalendarDate *)[d laterDate:max];
+ d = [aptDateRanges objectAtIndex:0];
+ if ([d isDateOnSameDay:min])
+ min = (NSCalendarDate *)[d earlierDate:min];
+ d = [aptDateRanges objectAtIndex:[aptDateRanges count] - 1];
+ if ([d isDateOnSameDay:max])
+ max = (NSCalendarDate *)[d laterDate:max];
}
return [self _getDatesFrom:min to:max];
- (NSArray *)_getDatesFrom:(NSCalendarDate *)_from to:(NSCalendarDate *)_to {
NSMutableArray *dates;
- unsigned i, count, offset;
+ unsigned i, count, offset;
offset = [_from hourOfDay];
- count = ([_to hourOfDay] + 1) - offset;
- dates = [[NSMutableArray alloc] initWithCapacity:count];
+ count = ([_to hourOfDay] + 1) - offset;
+ dates = [[NSMutableArray alloc] initWithCapacity:count];
for(i = 0; i < count; i++) {
NSCalendarDate *date;
}
- (NSArray *)aptsForCurrentDate {
- NSArray *apts;
- NSMutableArray *filtered;
- unsigned i, count;
- NSCalendarDate *start, *end;
-
- start = self->currentDate;
- end = [start dateByAddingYears:0
+ 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;
- 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];
+ /* 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];
+ }
+ else {
+ /* multiple day range? */
+ NSCalendarDate *aptEndDate;
+
+ if ((aptEndDate = [apt valueForKey:@"endDate"])) {
+ if ([aptEndDate isLessThanOrEqualTo:end] ||
+ ([aptStartDate isLessThan:start] &&
+ [aptEndDate isGreaterThan:end]))
+ {
+ [filtered addObject:apt];
}
+ }
}
-
- return [filtered autorelease];
+ }
+
+ return [filtered autorelease];
}
- (BOOL)hasAptsForCurrentDate {
- return [[self aptsForCurrentDate] count] != 0;
+ return [[self aptsForCurrentDate] count] != 0;
}
@end
id url;
id style;
id queryDictionary;
+ id referenceDate;
BOOL canAccess;
}
@end
#include "common.h"
+#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalInlineAptView
[self->url release];
[self->style release];
[self->queryDictionary release];
+ [self->referenceDate release];
[super dealloc];
}
ASSIGN(self->style, _style);
}
- (id)style {
+ NSNumber *prio;
+
+ if ((prio = [self->appointment valueForKey:@"priority"])) {
+ return [NSString stringWithFormat:@"%@ apt_prio%@", self->style, prio];
+ }
return self->style;
}
return self->queryDictionary;
}
+- (void)setReferenceDate:(id)_referenceDate {
+ ASSIGN(self->referenceDate, _referenceDate);
+}
+- (id)referenceDate {
+ return self->referenceDate;
+}
+
- (void)setCanAccess:(BOOL)_canAccess {
self->canAccess = _canAccess;
}
/* helpers */
+- (NSString *)title {
+ return [self->formatter stringForObjectValue:self->appointment
+ referenceDate:[self referenceDate]];
+}
+
- (NSString *)tooltip {
- return [self->tooltipFormatter stringForObjectValue:self->appointment];
+ return [self->tooltipFormatter stringForObjectValue:self->appointment
+ referenceDate:[self referenceDate]];
}
@end
// $Id$
#include "UIxCalMonthOverview.h"
-#include <NGExtensions/NGExtensions.h>
+#include "common.h"
+#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalMonthOverview
-
- (void)dealloc {
- [self->currentWeekStart release];
- [super dealloc];
+ [self->currentWeekStart release];
+ [super dealloc];
+}
+
+- (void)configureFormatters {
+ [super configureFormatters];
+
+ [self->aptFormatter setShortTitleOnly];
}
- (void)setDayIndex:(int)_idx {
self = [super init];
if(self) {
NSTimeZone *tz;
-
+
tz = [self viewTimeZone];
self->aptFormatter =
[[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
}
- (NSString *)tooltipForApt {
- return [[self aptTooltipFormatter] stringForObjectValue:self->appointment];
+ [self warnWithFormat:@"%s IS DEPRECATED!", __PRETTY_FUNCTION__];
+ return [[self aptTooltipFormatter] stringForObjectValue:self->appointment
+ referenceDate:[self currentDay]];
}
- (NSString *)aptStyle {
- (NSArray *)allDayApts {
NSArray *apts;
NSMutableArray *filtered;
- unsigned i, count;
+ unsigned i, count;
if (self->allDayApts)
return self->allDayApts;
count = [apts count];
filtered = [[NSMutableArray alloc] initWithCapacity:3];
for (i = 0; i < count; i++) {
- id apt;
+ id apt;
NSNumber *bv;
apt = [apts objectAtIndex:i];
- bv = [apt valueForKey:@"isallday"];
+ bv = [apt valueForKey:@"isallday"];
if ([bv boolValue])
[filtered addObject:apt];
}
/* row is active, if apt intersects hour range */
- (BOOL)isRowActive {
- NSCalendarDate *aptStart, *aptEnd;
- int aptStartHour, aptEndHour;
-
- aptStart = [self->appointment valueForKey:@"startDate"];
- aptEnd = [self->appointment valueForKey:@"endDate"];
+ NSCalendarDate *aptStart, *aptEnd, *date;
+ int aptStartHour, aptEndHour;
+ BOOL isStartOnSameDay, isEndOnSameDay;
+
+ aptStart = [self->appointment valueForKey:@"startDate"];
+ aptEnd = [self->appointment valueForKey:@"endDate"];
+ date = [self currentDay];
+ isStartOnSameDay = [aptStart isDateOnSameDay:date];
+ isEndOnSameDay = [aptEnd isDateOnSameDay:date];
+
+ if (!isStartOnSameDay && !isEndOnSameDay)
+ return YES;
aptStartHour = [aptStart hourOfDay];
aptEndHour = [aptEnd hourOfDay];
-
- return (([self hour] >= aptStartHour) &&
- ([self hour] <= aptEndHour));
+ if (isStartOnSameDay && isEndOnSameDay)
+ return (([self hour] >= aptStartHour) &&
+ ([self hour] <= aptEndHour));
+ if (!isStartOnSameDay)
+ return [self hour] <= aptEndHour;
+ return [self hour] >= aptStartHour;
}
/* item is active, if apt's dateRange intersects the range
@end
#include "common.h"
+#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalWeekColumnsview
+- (void)configureFormatters {
+ [super configureFormatters];
+
+ [self->aptFormatter setOmitsEndDate];
+}
+
- (void)setDayIndex:(char)_idx {
NSCalendarDate *d;
#include "UIxCalWeekOverview.h"
#include "common.h"
+#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalWeekOverview
+- (void)configureFormatters {
+ [super configureFormatters];
+
+ [self->aptFormatter setOmitsEndDate];
+}
+
- (void)setDayIndex:(char)_idx {
NSCalendarDate *d;
# Version file
-SUBMINOR_VERSION:=122
+SUBMINOR_VERSION:=123
+# v0.9.123 requires SOGoUI v0.9.24
# v0.9.115 requires NGiCal v4.5.44
# v0.9.113 requires libSOGo v0.9.30
# v0.9.112 requires SOGoLogic v0.9.12
+2005-07-05 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * UIxCalDayOverview.wox, UIxCalInlineAptView.wox,
+ UIxCalWeekOverview.wox, UIxCalWeekColumnsview.wox,
+ UIxCalDayChartview.wox, UIxCalDayListview.wox,
+ UIxCalWeekChartview.wox, UIxCalMonthOverview.wox: added referenceDate
+ bindings for all UIxAptInlineViews
+
+ * UIxAppointmentEditor.wox: added redirect in case user who is not
+ allowed to edit view tries to do so
+
2005-07-04 Marcus Mueller <znek@mulle-kybernetik.com>
* UIxCalDayOverview.wox, UIxCalWeekOverview.wox,
</form>
</var:if>
<var:if condition="canEditApt" const:negate="YES">
- Forbidden
+ Forbidden ... <var:redirect const:setURL="view" />
</var:if>
</var:component>
url="appointmentViewURL"
style="aptStyle"
queryDictionary="currentDayQueryParameters"
+ referenceDate="currentDate"
canAccess="canAccessApt"
/>
</span>
url="appointmentViewURL"
style="aptStyle"
queryDictionary="currentDayQueryParameters"
+ referenceDate="currentDate"
canAccess="canAccessApt"
/>
</span>
</td>
<td class="dayoverview_content_apts" width="90%">
<var:foreach list="allDayApts" item="appointment">
- <a var:href="appointmentViewURL"
- var:queryDictionary="currentDateQueryParameters"
- var:title="tooltipForApt"
- var:class="aptStyle"
- ><var:string value="shortTextForApt"
- const:escapeHTML="NO"
- /></a>
+ <var:component className="UIxCalInlineAptView"
+ appointment="appointment"
+ formatter="aptFormatter"
+ tooltipFormatter="aptTooltipFormatter"
+ url="appointmentViewURL"
+ style="aptStyle"
+ queryDictionary="currentDateQueryParameters"
+ referenceDate="selectedDate"
+ canAccess="canAccessApt"
+ />
<br />
</var:foreach>
</td>
url="appointmentViewURL"
style="aptStyle"
queryDictionary="currentDayQueryParameters"
+ referenceDate="currentDate"
canAccess="canAccessApt"
/>
<br />
<a var:href="url"
var:title="tooltip"
var:queryDictionary="queryDictionary"
- ><small><var:string value="appointment"
- formatter="formatter"
+ ><small><var:string value="title"
const:escapeHTML="NO"
style="style"
/></small></a>
</var:if>
<var:if condition="canAccess" const:negate="YES">
- <small><var:string value="appointment"
- formatter="formatter"
+ <img rsrc:src="apt_icon_private.gif" />
+ <small><var:string value="title"
const:escapeHTML="NO"
style="style"
/></small>
tooltipFormatter="aptTooltipFormatter"
url="appointmentViewURL"
style="aptStyle"
+ referenceDate="currentDay"
canAccess="canAccessApt"
/>
<br />
var:queryDictionary="currentDayQueryParameters"
><var:string value="currentDay.dayOfMonth"/></a>
</span>
- <br/>
+ <!-- removed for 0.8
+ <br/>
<span class="monthoverview_day_new">
<a href="new"
var:queryDictionary="currentDayQueryParameters"
>[<var:string label:value="new"/>]</a>
- </span>
+ </span>-->
</var:month-title>
<var:month>
<var:component className="UIxCalInlineAptView"
tooltipFormatter="aptTooltipFormatter"
url="appointmentViewURL"
style="aptStyle"
+ referenceDate="currentDay"
canAccess="canAccessApt"
/>
<br />
url="appointmentViewURL"
style="aptStyle"
queryDictionary="currentDayQueryParameters"
+ referenceDate="currentDay"
canAccess="canAccessApt"
/>
</span>
url="appointmentViewURL"
style="aptStyle"
queryDictionary="currentDayQueryParameters"
+ referenceDate="currentDay"
canAccess="canAccessApt"
/>
<br />
url="appointmentViewURL"
style="aptStyle"
queryDictionary="currentDayQueryParameters"
+ referenceDate="currentDay"
canAccess="canAccessApt"
/>
<br />
tooltipFormatter="aptTooltipFormatter"
url="appointmentViewURL"
style="aptStyle"
+ referenceDate="currentDay"
queryDictionary="currentDayQueryParameters"
canAccess="canAccessApt"
/>
tooltipFormatter="aptTooltipFormatter"
url="appointmentViewURL"
style="aptStyle"
+ referenceDate="currentDay"
canAccess="canAccessApt"
/>
<br />