};
AD0137A406DF8875000910D8 = {
children = (
+ ADAD40CA0769FFD000AAD24E,
+ ADAD40C90769FFD000AAD24E,
AD73BE8806CF92FC00226A2D,
AD73BE8906CF92FC00226A2D,
E87208F70692E3D30099CBBD,
refType = 4;
sourceTree = "<group>";
};
+ ADAD40C90769FFD000AAD24E = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = text.xml;
+ path = UIxCalInlineAptView.wox;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ ADAD40CA0769FFD000AAD24E = {
+ fileEncoding = 5;
+ indentWidth = 2;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.objc;
+ path = UIxCalInlineAptView.m;
+ refType = 4;
+ sourceTree = "<group>";
+ };
ADBE3C490726AF4C000FEA6A = {
fileEncoding = 5;
indentWidth = 2;
ADDF4DBA06DE0E6500C4E7F8 = {
children = (
E87206880692E3D10099CBBD,
+ E87206A00692E3D10099CBBD,
+ E87206A10692E3D10099CBBD,
E872069C0692E3D10099CBBD,
E872069D0692E3D10099CBBD,
E872069E0692E3D10099CBBD,
E872069F0692E3D10099CBBD,
- E87206A00692E3D10099CBBD,
- E87206A10692E3D10099CBBD,
E87206A20692E3D10099CBBD,
E87206A30692E3D10099CBBD,
);
fields = [NSArray arrayWithObjects:
@"uid", @"startdate", @"enddate",
@"title", @"participants", @"location", @"isallday",
- @"iscycle", @"partmails", @"sequence",
+ @"iscycle", @"partmails", @"sequence", @"ispublic",
+ @"isopaque", @"status", @"orgmail",
nil];
records = [_folder fetchFields:fields matchingQualifier:qualifier];
# Version file
-SUBMINOR_VERSION:=16
+SUBMINOR_VERSION:=17
# v0.9.13 requires libSOGo v0.9.26
+2004-12-10 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * Appointments/SOGoAppointmentFolder.m: added new quickinfo attributes
+ for fetching (v0.9.17)
+
2004-12-08 Marcus Mueller <znek@mulle-kybernetik.com>
* GNUmakefile: added Sieve product
+2004-12-09 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * UIxPageFrame.[wox,m]: added -ownerInContext debug info (v0.9.30)
+
2004-12-08 Marcus Mueller <znek@mulle-kybernetik.com>
* calendar.css: added styles for others' appointments in
@interface UIxPageFrame : UIxComponent
{
NSString *title;
- id item;
+ id item;
}
@end
@implementation UIxPageFrame
- (void)dealloc {
- [self->item release];
- [self->title release];
+ [self->item release];
+ [self->title release];
[super dealloc];
}
- (NSString *)title {
if ([self isUIxDebugEnabled])
return self->title;
-
+
return [self labelForKey:@"OpenGroupware.org"];
}
return self->item;
}
+- (NSString *)ownerInContext {
+ return [[self clientObject] ownerInContext:[self context]];
+}
+
+
/* notifications */
- (void)sleep {
<td valign="top">clientObject:</td>
<td valign="top"><var:string value="clientObject" /></td>
</tr>
+ <tr>
+ <td valign="top">ownerInContext:</td>
+ <td valign="top"><var:string value="ownerInContext" /></td>
+ </tr>
<tr>
<td valign="top">traversal stack:</td>
<td valign="top">
# Version file
-SUBMINOR_VERSION:=29
+SUBMINOR_VERSION:=30
# v0.9.28 requires NGExtensions v4.5.136
+2004-12-10 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * SOGoAptFormatter.[hm]: added formatting for private apts, additional
+ cleanup (v0.9.19)
+
2004-12-08 Marcus Mueller <znek@mulle-kybernetik.com>
* UIxComponent.m: changed to use NGLogging (v0.9.18)
@interface SOGoAptFormatter : NSFormatter
{
- NSTimeZone *tz;
- SEL formatAction;
+ NSTimeZone *tz;
+ SEL formatAction;
}
- (id)initWithDisplayTimeZone:(NSTimeZone *)_tz;
- (void)setTooltip;
- (void)setFullDetails;
+- (void)setTitleOnly;
+- (void)setShortTitleOnly;
+- (void)setPrivateTooltip;
+- (void)setPrivateDetails;
+- (void)setPrivateSuppressAll;
+
@end
#endif /* __SOGoAptFormatter_H_ */
#include "common.h"
@interface SOGoAptFormatter(PrivateAPI)
+- (NSString *)titleForApt:(id)_apt;
- (NSString *)shortTitleForApt:(id)_apt;
- (NSTimeZone *)displayTZ;
+- (void)appendTimeInfoFromApt:(id)_apt toBuffer:(NSMutableString *)_buf;
@end
@implementation SOGoAptFormatter
self->formatAction = @selector(fullDetailsForApt:);
}
-- (NSString *)stringForObjectValue:(id)_obj {
- return [self performSelector:self->formatAction withObject:_obj];
+- (void)setPrivateTooltip {
+ self->formatAction = @selector(tooltipForPrivateApt:);
}
-/* Helpers */
+- (void)setPrivateDetails {
+ self->formatAction = @selector(detailsForPrivateApt:);
+}
-- (NSString *)shortTitleForApt:(id)_apt {
- NSString *title;
-
- title = [_apt valueForKey:@"title"];
- if ([title length] > 12)
- title = [[title substringToIndex:11] stringByAppendingString:@"..."];
-
- return title;
+- (void)setTitleOnly {
+ self->formatAction = @selector(titleForApt:);
+}
+
+- (void)setShortTitleOnly {
+ self->formatAction = @selector(shortTitleForApt:);
+}
+
+- (void)setPrivateSuppressAll {
+ self->formatAction = @selector(suppressApt:);
+}
+
+- (NSString *)stringForObjectValue:(id)_obj {
+ return [self performSelector:self->formatAction withObject:_obj];
}
/* Private */
return self->tz;
}
-- (NSString *)fullDetailsForApt:(id)_apt {
+- (void)appendTimeInfoFromApt:(id)_apt toBuffer:(NSMutableString *)_buf {
NSCalendarDate *startDate, *endDate;
- NSMutableString *aptDescr;
- NSString *s;
- BOOL spansRange;
-
+ BOOL spansRange;
+
spansRange = NO;
- startDate = [_apt valueForKey:@"startDate"];
+ startDate = [_apt valueForKey:@"startDate"];
[startDate setTimeZone:[self displayTZ]];
- endDate = [_apt valueForKey:@"endDate"];
+ endDate = [_apt valueForKey:@"endDate"];
if(endDate != nil) {
[endDate setTimeZone:[self displayTZ]];
spansRange = ![endDate isEqualToDate:startDate];
}
- aptDescr = [[NSMutableString alloc] init];
- [aptDescr appendFormat:@"%02i:%02i",
- [startDate hourOfDay],
- [startDate minuteOfHour]];
+ [_buf appendFormat:@"%02i:%02i",
+ [startDate hourOfDay],
+ [startDate minuteOfHour]];
if(spansRange) {
- [aptDescr appendFormat:@", %02i:%02i",
- [endDate hourOfDay],
- [endDate minuteOfHour]];
+ [_buf appendFormat:@", %02i:%02i",
+ [endDate hourOfDay],
+ [endDate minuteOfHour]];
}
+}
+
+- (NSString *)titleForApt:(id)_apt {
+ return [_apt valueForKey:@"title"];
+}
+
+- (NSString *)shortTitleForApt:(id)_apt {
+ NSString *title;
+ title = [self titleForApt:_apt];
+ if ([title length] > 12)
+ title = [[title substringToIndex:11] stringByAppendingString:@"..."];
+
+ return title;
+}
+
+- (NSString *)fullDetailsForApt:(id)_apt {
+ NSMutableString *aptDescr;
+ NSString *s;
+
+ aptDescr = [NSMutableString stringWithCapacity:60];
+ [self appendTimeInfoFromApt:_apt toBuffer:aptDescr];
if ((s = [_apt valueForKey:@"location"]) != nil) {
if([s length] > 12)
s = [[s substringToIndex:11] stringByAppendingString:@"..."];
if ((s = [_apt valueForKey:@"title"]) != nil)
[aptDescr appendFormat:@"<br />%@", [self shortTitleForApt:_apt]];
- return [aptDescr autorelease];
+ return aptDescr;
+}
+
+- (NSString *)detailsForPrivateApt:(id)_apt {
+ NSMutableString *aptDescr;
+
+ aptDescr = [NSMutableString stringWithCapacity:25];
+ [self appendTimeInfoFromApt:_apt toBuffer:aptDescr];
+ return aptDescr;
}
- (NSString *)tooltipForApt:(id)_apt {
[endDate setTimeZone:[self displayTZ]];
spansRange = ![endDate isEqualToDate:startDate];
}
- aptDescr = [[NSMutableString alloc] init];
+ aptDescr = [NSMutableString stringWithCapacity:60];
[aptDescr appendString:@"appointment"];
[aptDescr appendFormat:@"\n%02i:%02i",
[startDate hourOfDay],
if ((s = [_apt valueForKey:@"location"]) != nil)
[aptDescr appendFormat:@"\n%@", s];
- return [aptDescr autorelease];
+ return aptDescr;
+}
+
+- (NSString *)tooltipForPrivateApt:(id)_apt {
+ NSCalendarDate *startDate, *endDate;
+ NSMutableString *aptDescr;
+ 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 appendString:@"appointment"];
+ [aptDescr appendFormat:@"\n%02i:%02i",
+ [startDate hourOfDay],
+ [startDate minuteOfHour]];
+ if (spansRange) {
+ [aptDescr appendFormat:@" - %02i:%02i",
+ [endDate hourOfDay],
+ [endDate minuteOfHour]];
+ }
+ return aptDescr;
+}
+
+- (NSString *)suppressApt:(id)_apt {
+ return @"";
}
@end /* SOGoAptFormatter */
# $Id$
-SUBMINOR_VERSION:=18
+SUBMINOR_VERSION:=19
# v0.9.18 requires NGExtensions v4.5.136
+2004-12-10 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * v0.9.98
+
+ * English.lproj/default.strings: provided additional localizable
+ strings for event "classification" (private/public).
+
+ * UIxAppointmentView.[wox,m], UIxAppointmentEditor.[wox,m]: added
+ workaround for SOGo bug #1052, private details are hidden now
+ from others. Also, apts are not editable by non-owners any longer.
+
+ * UIxCalView.[hm]: added formatters for private appointments. Also,
+ added flags for caching special information about apts (public,
+ owned) etc. This outphases the use of tooltip.../shortText...
+ for all calviews (with the exception of printviews). Subclasses
+ may need to override -configureFormatters to adjust them according
+ to their needs.
+
+ * UIxCalInlineAptView.[hm]: new view used by all calviews to render
+ appointments using formatters.
+
+ * UIxCalDayOverview.wox, UIxCalDayListview.[wox,m],
+ UIxCalDayChartview.[wox,m], UIxCalDayPrintview.wox,
+ UIxCalWeekOverview.wox, UIxCalWeekListview.[wox,m],
+ UIxCalWeekChartview.[wox,m], UIxCalWeekColumnsview.wox,
+ UIxCalWeekPrintview.[wox.m], UIxCalMonthOverview.wox:
+ changed to use UIxCalInlineAptView and provided -configureFormatters
+ which fixes SOGo bug #1052
+
2004-12-09 Marcus Mueller <znek@mulle-kybernetik.com>
* v0.9.97
"dayLabelFormat" = "%Y-%m-%d";
"today" = "today";
+
/* Week */
"Week" = "Week";
"this week" = "this week";
+
/* Month */
"this month" = "this month";
"a3_November" = "Nov";
"a3_December" = "Dec";
+
/* Year */
"this year" = "this year";
+
/* Menu */
"Calendar" = "Calendar";
"Contacts" = "Contacts";
+
/* Misc */
"OpenGroupware.org" = "OpenGroupware.org";
+
/* Button titles */
"new" = "new";
"Save" = "Save";
"Cancel" = "Cancel";
+
/* Appointments */
"Appointment viewer" = "Appointment Viewer";
"attributes" = "Attributes";
"participants" = "Participants";
+/* checkbox title */
"is private" = "is private";
+/* classification */
+"Public" = "Public";
+"Private" = "Private";
+
/* Searching */
"Search appointments" = "Search appointments";
"Search in Anais" = "Search in Anaïs";
+
/* calendar modes */
"Overview" = "Overview";
"List" = "List";
"Columns" = "Columns";
+
/* Priorities */
"prio_0" = "Undefined";
"prio_8" = "Low";
"prio_9" = "Low";
+
/* Appointment categories */
"APPOINTMENT" = "Appointment";
UIxDatePickerScript.m \
UIxTimeSelector.m \
UIxTimeDateControl.m \
+ UIxCalInlineAptView.m \
SchedulerUI_RESOURCE_FILES += \
Version \
UIxDatePickerScript.wox \
UIxTimeSelector.wox \
UIxTimeDateControl.wox \
+ UIxCalInlineAptView.wox \
SchedulerUI_RESOURCE_FILES += \
images/next_week.gif \
[self loadValuesFromICalString:_s];
}
+
+/* access */
+
+- (BOOL)isMyApt {
+ NSString *owner;
+
+ owner = [[self clientObject] ownerInContext:[self context]];
+ if (!owner)
+ return YES;
+ return [owner isEqualToString:[[self user] login]];
+}
+
+- (BOOL)canAccessApt {
+ return [self isMyApt];
+}
+
+- (BOOL)canEditApt {
+ return [self isMyApt];
+}
+
+
/* actions */
- (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c{
className="UIxPageFrame"
title="name"
>
- <form var:href="clientObject.baseURL">
- <table cellspacing="0" cellpadding="5" width="100%">
- <tr>
- <td>
- <table cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td width="5"/>
- <td class="window_label">
- <var:string label:value="Appointment editor" /></td>
- <td width="36" align="right" valign="center">
- <var:component className="UIxWinClose" />
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <var:if condition="hasErrorText">
- <div style="background-color: #AA0000;">
- <var:string value="errorText" />
- </div>
- <hr />
- </var:if>
-
- <table border="0" cellpadding="2" cellspacing="0" width="100%"
- bgcolor="#e8e8e0"
- >
- <tr>
- <td align="left" colspan="2">
- <span class="aptview_title">
- <var:string label:value="Appointment on" />
- <var:string formatter="titleDateFormatter"
- value="aptStartDate" /></span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="Start time" />:
- </span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <var:component className="UIxDatePickerScript" />
- <var:component className="UIxTimeDateControl"
- const:controlID="startTime"
- date="aptStartDate"
- />
- </span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="End time" />:
- </span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <var:component className="UIxTimeDateControl"
- const:controlID="endTime"
- date="aptEndDate"
- />
- </span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="Title" />:
- </span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <input type="text" name="summary" const:size="40"
- var:value="title" />
- </span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="Location" />:
- </span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <input type="text" name="location" const:size="40"
- var:value="location" />
- </span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="Priority" />:
- </span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <var:popup list="priorities"
- item="item"
- string="itemPriorityText"
- selection="priority"
- />
- </span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="Categories" />:
- </span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <var:checkbox-list list="categoryItems"
- item="item"
- suffix="itemCategoryText"
- selections="categories"
- />
- </span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="Classification" />:
- </span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <input type="checkbox"
- var:selection="isPrivate"
- var:checked="isPrivate"
- /> <var:string label:value="is private" />
- </span>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table border="0" cellpadding="2" cellspacing="0"
- width="100%" bgcolor="#e8e8e0"
- >
- <tr>
- <td align="left" colspan="2">
- <span class="aptview_title">
- <var:string label:value="Search participants" />
- </span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="Participants" />:</span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <var:component className="AnaisAttendeeSelector"
- const:selectorID="participant"
- const:role="REQ-PARTICIPANT"
- attendees="participants"
- var:emailForUser="emailForUser"
- var:cnForUser="cnForUser"
- const:withCN="YES"
- const:withAddressBook="YES"
- />
- </span>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table border="0" cellpadding="2" cellspacing="0" width="100%"
- bgcolor="#e8e8e0"
- >
- <tr>
- <td align="left" colspan="2">
- <span class="aptview_title">
- <var:string label:value="Search resources" />
- </span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="Resources" />:
- </span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <var:component className="AnaisAttendeeSelector"
- const:selectorID="resource"
- const:role="NON-PARTICIPANT"
- attendees="resources"
- const:withCN="YES"
- const:withAddressBook="YES"
- />
- </span>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table border="0" cellpadding="2" cellspacing="0" width="100%"
- bgcolor="#e8e8e0"
- >
- <tr>
- <td align="left" colspan="2">
- <span class="aptview_title">
- <var:string label:value="Comment" />
- </span>
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%">
- <span class="aptview_text">
- <var:string label:value="Comment" />:
- </span>
- </td>
- <td align="left" bgcolor="#FFFFF0">
- <span class="aptview_text">
- <textarea name="comment" rows="8" cols="80" wrap="physical"
- var:value="comment" />
- </span>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <input type="submit" label:value="Save" name="save:method" />
- <span class="button_auto_env"
- ><a href="../weekoverview"
- var:queryDictionary="queryParameters"
- class="button_auto"
- ><var:string label:value="Cancel" /></a></span>
- <var:if condition="isUIxDebugEnabled">
- <input type="submit" value="Test" name="test:method" />
+ <var:if condition="canEditApt"> <!-- workaround -->
+ <form var:href="clientObject.baseURL">
+ <table cellspacing="0" cellpadding="5" width="100%">
+ <tr>
+ <td>
+ <table cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td width="5"/>
+ <td class="window_label">
+ <var:string label:value="Appointment editor" /></td>
+ <td width="36" align="right" valign="center">
+ <var:component className="UIxWinClose" />
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <var:if condition="hasErrorText">
+ <div style="background-color: #AA0000;">
+ <var:string value="errorText" />
+ </div>
+ <hr />
</var:if>
- </td>
- </tr>
- </table>
-
- <input type="hidden" name="ical" var:value="iCalString" />
- </form>
+
+ <table border="0" cellpadding="2" cellspacing="0" width="100%"
+ bgcolor="#e8e8e0"
+ >
+ <tr>
+ <td align="left" colspan="2">
+ <span class="aptview_title">
+ <var:string label:value="Appointment on" />
+ <var:string formatter="titleDateFormatter"
+ value="aptStartDate" /></span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Start time" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <var:component className="UIxDatePickerScript" />
+ <var:component className="UIxTimeDateControl"
+ const:controlID="startTime"
+ date="aptStartDate"
+ />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="End time" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <var:component className="UIxTimeDateControl"
+ const:controlID="endTime"
+ date="aptEndDate"
+ />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Title" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <input type="text" name="summary" const:size="40"
+ var:value="title" />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Location" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <input type="text" name="location" const:size="40"
+ var:value="location" />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Priority" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <var:popup list="priorities"
+ item="item"
+ string="itemPriorityText"
+ selection="priority"
+ />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Categories" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <var:checkbox-list list="categoryItems"
+ item="item"
+ suffix="itemCategoryText"
+ selections="categories"
+ />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Classification" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <input type="checkbox"
+ var:selection="isPrivate"
+ var:checked="isPrivate"
+ /> <var:string label:value="is private" />
+ </span>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table border="0" cellpadding="2" cellspacing="0"
+ width="100%" bgcolor="#e8e8e0"
+ >
+ <tr>
+ <td align="left" colspan="2">
+ <span class="aptview_title">
+ <var:string label:value="Search participants" />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Participants" />:</span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <var:component className="AnaisAttendeeSelector"
+ const:selectorID="participant"
+ const:role="REQ-PARTICIPANT"
+ attendees="participants"
+ var:emailForUser="emailForUser"
+ var:cnForUser="cnForUser"
+ const:withCN="YES"
+ const:withAddressBook="YES"
+ />
+ </span>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table border="0" cellpadding="2" cellspacing="0" width="100%"
+ bgcolor="#e8e8e0"
+ >
+ <tr>
+ <td align="left" colspan="2">
+ <span class="aptview_title">
+ <var:string label:value="Search resources" />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Resources" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <var:component className="AnaisAttendeeSelector"
+ const:selectorID="resource"
+ const:role="NON-PARTICIPANT"
+ attendees="resources"
+ const:withCN="YES"
+ const:withAddressBook="YES"
+ />
+ </span>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table border="0" cellpadding="2" cellspacing="0" width="100%"
+ bgcolor="#e8e8e0"
+ >
+ <tr>
+ <td align="left" colspan="2">
+ <span class="aptview_title">
+ <var:string label:value="Comment" />
+ </span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%">
+ <span class="aptview_text">
+ <var:string label:value="Comment" />:
+ </span>
+ </td>
+ <td align="left" bgcolor="#FFFFF0">
+ <span class="aptview_text">
+ <textarea name="comment" rows="8" cols="80" wrap="physical"
+ var:value="comment" />
+ </span>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="submit" label:value="Save" name="save:method" />
+ <span class="button_auto_env"
+ ><a href="../weekoverview"
+ var:queryDictionary="queryParameters"
+ class="button_auto"
+ ><var:string label:value="Cancel" /></a></span>
+ <var:if condition="isUIxDebugEnabled">
+ <input type="submit" value="Test" name="test:method" />
+ </var:if>
+ </td>
+ </tr>
+ </table>
+
+ <input type="hidden" name="ical" var:value="iCalString" />
+ </form>
+ </var:if>
+ <var:if condition="canEditApt" const:negate="YES">
+ Forbidden
+ </var:if>
</var:component>
- (id)appointment;
+/* permissions */
+- (BOOL)canAccessApt;
+- (BOOL)canEditApt;
+
- (SOGoDateFormatter *)dateFormatter;
- (NSCalendarDate *)startTime;
- (NSCalendarDate *)endTime;
#include <SOGoLogic/SOGoAppointment.h>
#include <Appointments/SOGoAppointmentObject.h>
#include <SOGoUI/SOGoDateFormatter.h>
+#include "UIxComponent+Agenor.h"
#include "common.h"
@implementation UIxAppointmentView
return href;
}
+
+/* access */
+
+- (BOOL)isMyApt {
+ NSString *owner;
+
+ owner = [[self clientObject] ownerInContext:[self context]];
+ if (!owner)
+ return YES;
+ return [owner isEqualToString:[[self user] login]];
+}
+
+- (BOOL)canAccessApt {
+ if ([self isMyApt])
+ return YES;
+
+ /* not my apt - can access if it's public */
+ return [[self appointment] isPublic];
+}
+
+- (BOOL)canEditApt {
+ return [self isMyApt];
+}
+
+
/* action */
- (id)defaultAction {
target="SOGoPrintView"
><var:string label:value="printview" /></a>
</td>
- <td class="button_auto_env" nowrap="true"
- valign='middle' align='center'>
- <a class="button_auto"
- href="edit"
- var:queryDictionary="queryParameters"
- ><var:string label:value="edit" /></a>
- </td>
+ <var:if condition="canEditApt">
+ <td class="button_auto_env" nowrap="true"
+ valign='middle' align='center'>
+ <a class="button_auto"
+ href="edit"
+ var:queryDictionary="queryParameters"
+ ><var:string label:value="edit" /></a>
+ </td>
+ </var:if>
<td class="button_auto_env" nowrap="true"
valign='middle' align='center'>
<a class="button_auto"
</tr>
<tr>
<td valign="top" width="100%">
- <table width="100%" border="0" cellpadding="4" cellspacing="0">
- <!-- general appointment info -->
- <tr valign="top">
- <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
- <var:string label:value="Title" />:
- </td>
- <td align="left" bgcolor="#FFFFF0" class="aptview_text">
- <var:string value="appointment.summary" />
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
- <var:string label:value="Location" />:
- </td>
- <td align="left" bgcolor="#FFFFF0" class="aptview_text">
- <var:string value="appointment.location" />
- </td>
- </tr>
- <tr valign="top">
- <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
- <var:string label:value="Priority" />:
- </td>
- <td align="left" bgcolor="#FFFFF0" class="aptview_text">
- <var:string label:value="$appointment.priorityLabelKey" />
- </td>
- </tr>
+ <table width="100%" border="0" cellpadding="4" cellspacing="0">
+ <!-- general appointment info -->
+ <var:if condition="canAccessApt">
+ <tr valign="top">
+ <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
+ <var:string label:value="Title" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:string value="appointment.summary" />
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
+ <var:string label:value="Location" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:string value="appointment.location" />
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
+ <var:string label:value="Priority" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:string label:value="$appointment.priorityLabelKey" />
+ </td>
+ </tr>
+ </var:if>
+ <tr valign="top">
+ <td align="right" width="15%" bgcolor="#E8E8E0" class="aptview_text">
+ <var:string label:value="Classification" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:if condition="appointment.isPublic">Public</var:if>
+ <var:if condition="appointment.isPublic"
+ const:negate="YES"
+ >Private</var:if>
+ </td>
+ </tr>
</table>
</td>
</tr>
/>
</td>
</tr>
+ <var:if condition="canAccessApt">
+ <tr valign="top">
+ <td align="right"
+ width="15%"
+ bgcolor="#E8E8E0"
+ class="aptview_text"
+ >
+ <var:string label:value="Categories" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:string value="categoriesAsString" />
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right"
+ width="15%"
+ bgcolor="#E8E8E0"
+ class="aptview_text"
+ >
+ <var:string label:value="Resources" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:string value="resourcesAsString"
+ const:escapeHTML="NO"
+ />
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right"
+ width="15%"
+ bgcolor="#E8E8E0"
+ class="aptview_text"
+ >
+ <var:string label:value="Organizer" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:string value="appointment.organizer.cnForDisplay" />
+ </td>
+ </tr>
+ <tr valign="top">
+ <td align="right"
+ width="15%"
+ bgcolor="#E8E8E0"
+ class="aptview_text"
+ >
+ <var:string label:value="Comment" />:
+ </td>
+ <td align="left" bgcolor="#FFFFF0" class="aptview_text">
+ <var:string value="appointment.comment" const:insertBR="1" />
+ </td>
+ </tr>
+ </var:if>
+ </table>
+ </uix:tab>
+ <var:if condition="canAccessApt">
+
+ <uix:tab const:key="participants"
+ const:label="participants"
+ var:href="participantsTabLink"
+ >
+ <table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr valign="top">
- <td align="right"
- width="15%"
- bgcolor="#E8E8E0"
- class="aptview_text"
- >
- <var:string label:value="Categories" />:
- </td>
- <td align="left" bgcolor="#FFFFF0" class="aptview_text">
- <var:string value="categoriesAsString" />
- </td>
- </tr>
- <tr valign="top">
- <td align="right"
- width="15%"
- bgcolor="#E8E8E0"
- class="aptview_text"
- >
- <var:string label:value="Resources" />:
+ <td align="left" bgcolor="#E8E8E0" class="aptview_title">
+ <var:string label:value="Name" />
</td>
- <td align="left" bgcolor="#FFFFF0" class="aptview_text">
- <var:string value="resourcesAsString"
- const:escapeHTML="NO"
- />
+ <td align="left" bgcolor="#E8E8E0" class="aptview_title">
+ <var:string label:value="Email" />
</td>
</tr>
+ <var:foreach list="appointment.participants"
+ item="attendee"
+ >
<tr valign="top">
- <td align="right"
- width="15%"
- bgcolor="#E8E8E0"
- class="aptview_text"
- >
- <var:string label:value="Organizer" />:
- </td>
<td align="left" bgcolor="#FFFFF0" class="aptview_text">
- <var:string value="appointment.organizer.cnForDisplay" />
- </td>
- </tr>
- <tr valign="top">
- <td align="right"
- width="15%"
- bgcolor="#E8E8E0"
- class="aptview_text"
- >
- <var:string label:value="Comment" />:
+ <var:string value="attendee.cnForDisplay" />
</td>
<td align="left" bgcolor="#FFFFF0" class="aptview_text">
- <var:string value="appointment.comment" const:insertBR="1" />
+ <a var:href="attendee.email"
+ ><var:string value="attendee.rfc822Email" /></a>
</td>
</tr>
- </table>
- </uix:tab>
- <uix:tab const:key="participants"
- const:label="participants"
- var:href="participantsTabLink"
- >
- <table width="100%" border="0" cellpadding="4" cellspacing="0">
- <tr valign="top">
- <td align="left" bgcolor="#E8E8E0" class="aptview_title">
- <var:string label:value="Name" />
- </td>
- <td align="left" bgcolor="#E8E8E0" class="aptview_title">
- <var:string label:value="Email" />
- </td>
- </tr>
- <var:foreach list="appointment.participants"
- item="attendee"
- >
- <tr valign="top">
- <td align="left" bgcolor="#FFFFF0" class="aptview_text">
- <var:string value="attendee.cnForDisplay" />
- </td>
- <td align="left" bgcolor="#FFFFF0" class="aptview_text">
- <a var:href="attendee.email"
- ><var:string value="attendee.rfc822Email" /></a>
- </td>
- </tr>
- </var:foreach>
- </table>
- </uix:tab>
+ </var:foreach>
+ </table>
+ </uix:tab>
+ </var:if>
<var:if condition="isUIxDebugEnabled">
<uix:tab const:key="debug"
const:label="DEBUG"
@implementation UIxCalDayChartview
- (NSArray *)columns {
- static NSArray *columns = nil;
- if(columns == nil) {
- columns = [[NSArray arrayWithObject:@"0"] retain];
- }
- return columns;
+ static NSArray *columns = nil;
+ if(columns == nil) {
+ columns = [[NSArray arrayWithObject:@"0"] retain];
+ }
+ return columns;
}
- (BOOL)isPadColumn {
}
- (NSString *)shortTextForApt {
- return [[self appointment] valueForKey:@"title"];
+ if (![self canAccessApt])
+ return @"";
+ return [[self appointment] valueForKey:@"title"];
}
@end
const:valign="top"
>
<span class="dayoverview_content_time_link">
- <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="currentDayQueryParameters"
+ canAccess="canAccessApt"
+ />
</span>
</var:matrix-cell>
</var:vspan-matrix>
}
- (NSString *)shortTextForApt {
+ if (![self canAccessApt])
+ return @"";
return [[self appointment] valueForKey:@"title"];
}
const:valign="top"
>
<span class="dayoverview_content_time_link">
- <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="currentDayQueryParameters"
+ canAccess="canAccessApt"
+ />
</span>
</var:matrix-cell>
</var:hspan-matrix>
</span>
</td>
<td class="dayoverview_content_apts" width="90%">
- <var:foreach list="aptsForCurrentDate" item="appointment">
- <a var:href="appointmentViewURL"
- var:queryDictionary="currentDateQueryParameters"
- var:title="tooltipForApt"
- var:class="aptStyle"
- ><var:string value="shortTextForApt"
- const:escapeHTML="NO"
- /></a>
+ <var:foreach list="aptsForCurrentDate"
+ item="appointment"
+ >
+ <var:component className="UIxCalInlineAptView"
+ appointment="appointment"
+ formatter="aptFormatter"
+ tooltipFormatter="aptTooltipFormatter"
+ url="appointmentViewURL"
+ style="aptStyle"
+ queryDictionary="currentDayQueryParameters"
+ canAccess="canAccessApt"
+ />
<br />
</var:foreach>
</td>
</td>
<td class="dayprintview_content">
<var:foreach list="allDayApts" item="appointment">
- <var:string value="shortTextForApt"
+ <var:string value="appointment"
+ formatter="aptFormatter"
const:escapeHTML="NO"
/>
<br />
</td>
<var:foreach list="aptsForCurrentDate" item="appointment">
<td class="dayprintview_content">
- <var:string value="shortTextForApt"
+ <var:string value="appointment"
+ formatter="aptFormatter"
const:escapeHTML="NO"
- var:style="aptStyle"
+ style="aptStyle"
/>
</td>
- <var:if condition="minRequiredRowSpan" const:value="1" const:negate="YES">
+ <var:if condition="minRequiredRowSpan"
+ const:value="1"
+ const:negate="YES"
+ >
</var:if>
</var:foreach>
<var:if condition="hasNoAptsForCurrentDate">
--- /dev/null
+/*
+ Copyright (C) 2000-2004 SKYRIX Software AG
+
+ This file is part of OGo
+
+ 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.
+ */
+// $Id$
+
+#include <NGObjWeb/NGObjWeb.h>
+
+@interface UIxCalInlineAptView : WOComponent
+{
+ id appointment;
+ id formatter;
+ id tooltipFormatter;
+ id url;
+ id style;
+ id queryDictionary;
+ BOOL canAccess;
+}
+
+@end
+
+#include "common.h"
+
+@implementation UIxCalInlineAptView
+
+- (void)dealloc {
+ [self->appointment release];
+ [self->formatter release];
+ [self->tooltipFormatter release];
+ [self->url release];
+ [self->style release];
+ [self->queryDictionary release];
+ [super dealloc];
+}
+
+- (void)setAppointment:(id)_appointment {
+ ASSIGN(self->appointment, _appointment);
+}
+- (id)appointment {
+ return self->appointment;
+}
+
+- (void)setFormatter:(id)_formatter {
+ ASSIGN(self->formatter, _formatter);
+}
+- (id)formatter {
+ return self->formatter;
+}
+
+- (void)setTooltipFormatter:(id)_tooltipFormatter {
+ ASSIGN(self->tooltipFormatter, _tooltipFormatter);
+}
+- (id)tooltipFormatter {
+ return self->tooltipFormatter;
+}
+
+- (void)setUrl:(id)_url {
+ ASSIGN(self->url, _url);
+}
+- (id)url {
+ return self->url;
+}
+
+- (void)setStyle:(id)_style {
+ ASSIGN(self->style, _style);
+}
+- (id)style {
+ return self->style;
+}
+
+- (void)setQueryDictionary:(id)_queryDictionary {
+ ASSIGN(self->queryDictionary, _queryDictionary);
+}
+- (id)queryDictionary {
+ return self->queryDictionary;
+}
+
+- (void)setCanAccess:(BOOL)_canAccess {
+ self->canAccess = _canAccess;
+}
+- (BOOL)canAccess {
+ return self->canAccess;
+}
+
+/* helpers */
+
+- (NSString *)tooltip {
+ return [self->tooltipFormatter stringForObjectValue:self->appointment];
+}
+
+@end
--- /dev/null
+<?xml version='1.0' standalone='yes'?>
+
+<span xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+ xmlns:const="http://www.skyrix.com/od/constant"
+ xmlns:rsrc="OGo:url"
+>
+ <var:if condition="canAccess">
+ <a var:href="url"
+ var:title="tooltip"
+ var:queryDictionary="queryDictionary"
+ ><small><var:string value="appointment"
+ formatter="formatter"
+ const:escapeHTML="NO"
+ style="style"
+ /></small></a>
+ </var:if>
+ <var:if condition="canAccess" const:negate="YES">
+ <small><var:string value="appointment"
+ formatter="formatter"
+ const:escapeHTML="NO"
+ style="style"
+ /></small>
+ </var:if>
+</span>
\ No newline at end of file
>
<var:month-info>
<var:if condition="hasHolidayInfo">
- <var:string value="holidayInfo" const:class="monthoverview_holidayinfo"/>
+ <var:string value="holidayInfo"
+ const:class="monthoverview_holidayinfo"
+ />
</var:if>
<var:foreach list="allDayApts" item="appointment">
- <a var:href="appointmentViewURL"
- ><var:string value="shortTextForApt"
- const:escapeHTML="NO"
- /></a>
+ <var:component className="UIxCalInlineAptView"
+ appointment="appointment"
+ formatter="aptFormatter"
+ tooltipFormatter="aptTooltipFormatter"
+ url="appointmentViewURL"
+ style="aptStyle"
+ canAccess="canAccessApt"
+ />
<br />
</var:foreach>
</var:month-info>
</span>
</var:month-title>
<var:month>
- <a var:href="appointmentViewURL"
- class="monthoverview_content_link"
- var:title="tooltipForApt"
- var:queryDictionary="currentDayQueryParameters"
- ><var:string value="shortTextForApt"
- const:escapeHTML="NO"
- /></a>
+ <var:component className="UIxCalInlineAptView"
+ appointment="appointment"
+ formatter="aptFormatter"
+ tooltipFormatter="aptTooltipFormatter"
+ url="appointmentViewURL"
+ style="aptStyle"
+ canAccess="canAccessApt"
+ />
<br />
</var:month>
</var:month-overview>
NSMutableString *aptDescr;
NSString *s;
BOOL isMyApt;
+ BOOL canAccessApt;
BOOL spansRange;
id apt;
- apt = [self appointment];
- isMyApt = [self isMyApt];
- spansRange = NO;
- startDate = [apt valueForKey:@"startDate"];
+ apt = [self appointment];
+ isMyApt = [self isMyApt];
+ canAccessApt = [self canAccessApt];
+ spansRange = NO;
+ startDate = [apt valueForKey:@"startDate"];
[startDate setTimeZone:[self viewTimeZone]];
- endDate = [apt valueForKey:@"endDate"];
+ endDate = [apt valueForKey:@"endDate"];
if(endDate != nil) {
[endDate setTimeZone:[self viewTimeZone]];
spansRange = ![endDate isEqualToDate:startDate];
[endDate minuteOfHour]];
}
[aptDescr appendFormat:@"</span>,"];
- if(!isMyApt)
+ if (!isMyApt)
[aptDescr appendFormat:@"<span class=\"%@\">", [self aptStyle]];
- s = [apt valueForKey:@"title"];
- if(s) {
- [aptDescr appendFormat:@"<br />%@", s];
- }
- s = [apt valueForKey:@"location"];
- if(s) {
- [aptDescr appendFormat:@"<br />%@", s];
+ if (canAccessApt) {
+ s = [apt valueForKey:@"title"];
+ if(s) {
+ [aptDescr appendFormat:@"<br />%@", s];
+ }
+ s = [apt valueForKey:@"location"];
+ if(s) {
+ [aptDescr appendFormat:@"<br />%@", s];
+ }
}
if(!isMyApt)
[aptDescr appendString:@"</span>"];
@interface UIxCalView : UIxComponent
{
- NSArray *appointments;
- NSArray *allDayApts;
- id appointment;
- NSCalendarDate *currentDay;
+ NSArray *appointments;
+ NSArray *allDayApts;
+ id appointment;
+ NSCalendarDate *currentDay;
SOGoAptFormatter *aptFormatter;
SOGoAptFormatter *aptTooltipFormatter;
+ SOGoAptFormatter *privateAptFormatter;
+ SOGoAptFormatter *privateAptTooltipFormatter;
+
+ struct {
+ unsigned isMyApt : 1;
+ unsigned canAccessApt : 1;
+ unsigned RESERVED : 30;
+ } aptFlags;
}
+
+/* config */
+
+- (void)configureFormatters;
+
/* accessors */
- (NSArray *)appointments;
- (NSArray *)allDayApts;
- (id)appointment;
- (BOOL)isMyApt;
+- (BOOL)canAccessApt; /* protection */
- (BOOL)hasDayInfo;
- (BOOL)hasHoldidayInfo;
shouldDisplayWeekend = [ud boolForKey:@"SOGoShouldDisplayWeekend"];
}
+- (id)init {
+ self = [super init];
+ if(self) {
+ NSTimeZone *tz;
+
+ tz = [self viewTimeZone];
+ self->aptFormatter =
+ [[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
+ self->aptTooltipFormatter =
+ [[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
+ self->privateAptFormatter =
+ [[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
+ self->privateAptTooltipFormatter =
+ [[SOGoAptFormatter alloc] initWithDisplayTimeZone:tz];
+ [self configureFormatters];
+ }
+ return self;
+}
+
- (void)dealloc {
- [self->appointments release];
- [self->allDayApts release];
- [self->appointment release];
- [self->currentDay release];
- [self->aptFormatter release];
- [self->aptTooltipFormatter release];
+ [self->appointments release];
+ [self->allDayApts release];
+ [self->appointment release];
+ [self->currentDay release];
+ [self->aptFormatter release];
+ [self->aptTooltipFormatter release];
+ [self->privateAptFormatter release];
+ [self->privateAptTooltipFormatter release];
[super dealloc];
}
+/* subclasses should override this */
+- (void)configureFormatters {
+ [self->aptFormatter setFullDetails];
+ [self->aptTooltipFormatter setTooltip];
+ [self->privateAptFormatter setPrivateDetails];
+ [self->privateAptTooltipFormatter setPrivateTooltip];
+}
+
/* accessors */
- (void)setAppointments:(NSArray *)_apts {
}
- (void)setAppointment:(id)_apt {
+ NSString *mailtoChunk;
+ NSString *myEmail;
+
ASSIGN(self->appointment, _apt);
+
+ /* cache some info about apt for faster access */
+
+ mailtoChunk = [_apt valueForKey:@"orgmail"];
+ myEmail = [self emailForUser];
+ if ([mailtoChunk rangeOfString:myEmail].length > 0) {
+ self->aptFlags.isMyApt = YES;
+ self->aptFlags.canAccessApt = YES;
+ }
+ else {
+ self->aptFlags.isMyApt = NO;
+ self->aptFlags.canAccessApt = [[_apt valueForKey:@"ispublic"] boolValue];
+ }
}
- (id)appointment {
return self->appointment;
}
+- (BOOL)isMyApt {
+ return self->aptFlags.isMyApt ? YES : NO;
+}
+
+- (BOOL)canAccessApt {
+ return self->aptFlags.canAccessApt ? YES : NO;
+}
+
+- (BOOL)canNotAccessApt {
+ return self->aptFlags.canAccessApt ? NO : YES;
+}
+
- (NSDictionary *)aptTypeDict {
return nil;
}
}
- (SOGoAptFormatter *)aptFormatter {
- if (self->aptFormatter)
+ if(self->aptFlags.canAccessApt)
return self->aptFormatter;
-
- self->aptFormatter = [[SOGoAptFormatter alloc]
- initWithDisplayTimeZone:[self viewTimeZone]];
- [self->aptFormatter setFullDetails];
- return self->aptFormatter;
+ return self->privateAptFormatter;
}
- (SOGoAptFormatter *)aptTooltipFormatter {
- if (self->aptTooltipFormatter)
+ if(self->aptFlags.canAccessApt)
return self->aptTooltipFormatter;
- self->aptTooltipFormatter = [[SOGoAptFormatter alloc]
- initWithDisplayTimeZone:[self viewTimeZone]];
- [self->aptTooltipFormatter setTooltip];
- return self->aptTooltipFormatter;
+ return self->privateAptTooltipFormatter;
}
/* TODO: remove this */
- (NSString *)shortTextForApt {
+ [self warnWithFormat:@"%s IS DEPRECATED!", __PRETTY_FUNCTION__];
+ if (![self canAccessApt])
+ return @"";
return [[self aptFormatter] stringForObjectValue:self->appointment];
}
- (NSString *)shortTitleForApt {
NSString *title;
-
+
+ [self warnWithFormat:@"%s IS DEPRECATED!", __PRETTY_FUNCTION__];
+
+ if (![self canAccessApt])
+ return @"";
title = [self->appointment valueForKey:@"title"];
if ([title length] > 12)
title = [[title substringToIndex:11] stringByAppendingString:@"..."];
return [[self aptTooltipFormatter] stringForObjectValue:self->appointment];
}
-- (BOOL)isMyApt {
- NSString *mailtoChunk;
- NSString *myEmail;
-
- mailtoChunk = [self->appointment valueForKey:@"partmails"];
- myEmail = [self emailForUser];
- if ([mailtoChunk rangeOfString:myEmail].length > 0)
- return YES;
- return NO;
-}
-
- (NSString *)aptStyle {
if (![self isMyApt])
return @"apt_other";
NSNumber *bv;
apt = [apts objectAtIndex:i];
-#warning !! check if isAllDay is correct
- bv = [apt valueForKey:@"isAllDay"];
+ bv = [apt valueForKey:@"isallday"];
if ([bv boolValue])
[filtered addObject:apt];
}
#include <NGExtensions/NGCalendarDateRange.h>
#include <SOGoLogic/AgenorUserManager.h>
#include <sys/param.h> // MIN, MAX
+#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalWeekChartview
/* descriptions */
-- (NSString *)shortTextForApt {
- return [[self appointment] valueForKey:@"title"];
+- (void)configureFormatters {
+ [super configureFormatters];
+ [self->aptFormatter setTitleOnly];
+ [self->privateAptFormatter setPrivateDetails];
}
+
/* style sheet */
- (NSString *)titleStyle {
const:align="top"
>
<span class="dayoverview_content_time_link">
- <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="currentDayQueryParameters"
+ canAccess="canAccessApt"
+ />
</span>
</var:matrix-cell>
</var:vspan-matrix>
<!-- $Id: SkyNews.html,v 1.3 2003/12/22 16:53:55 helge Exp $ -->
<table id="skywintable" class="wintable" cellspacing="0" cellpadding="5" width="100%">
- <tr>
- <td class="wintitle">
- <table cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td width="5"/>
- <td class="wintitle"><var:component className="UIxCalDateLabel"
- startDate="startDate"
- endDate="endDate"
- const:selection="week"
- /></td>
- <td width="36" align="right" valign="center">
- <var:component className="UIxWinClose" />
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td id="skywinbodycell" class="wincontent">
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr bgcolor="#e8e8e0">
- <td align="left">
- <var:component className="UIxCalBackForthNavView"
- methodName="ownMethodName"
- prevQueryParameters="prevWeekQueryParameters"
- currentQueryParameters="todayQueryParameters"
- nextQueryParameters="nextWeekQueryParameters"
- label:label="this week"
- />
- </td>
- <td align="right" valign="middle" width="80%">
- <var:component className="AnaisUidSelector"
- calendarUIDs="clientObject.calendarUIDs"
- />
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <td id="skywinbodycell" class="wincontent">
- <table border="0" width="100%" cellpadding="0" cellspacing="0">
- <tr>
- <td colspan="2">
- <var:component className="UIxCalSelectTab"
- const:selection="week"
- currentDate="selectedDate"
- >
- <table border="0" cellpadding="4" width="100%" cellspacing="2">
+ <tr>
+ <td class="wintitle">
+ <table cellpadding="0" cellspacing="0" width="100%">
<tr>
- <td width="1%" align="left" valign="middle" bgcolor="#e8e8e0">
- <table border='0' cellpadding='0' cellspacing='0'>
- <tr>
- <td><a href="weekoverview"
- var:queryDictionary="queryParameters"
- ><img rsrc:src="icon_view_overview.gif"
- label:title="Overview"
- label:alt="Overview"
- border="0"
- valign="top"
- /></a></td>
- <td><a href="weekchartview"
- var:queryDictionary="queryParameters"
- ><img rsrc:src="icon_view_chart.gif"
- label:title="Chart"
- label:alt="Chart"
- border="0"
- valign="top"
- /></a></td>
- <td><a href="weeklistview"
- var:queryDictionary="queryParameters"
- ><img rsrc:src="icon_view_list.gif"
- label:title="List"
- label:alt="List"
- border="0"
- valign="top"
- /></a></td>
- <td><img rsrc:src="icon_view_columns_inactive.gif"
- label:title="Columns"
- label:alt="Columns"
- border="0"
- valign="top"
- /> </td>
- </tr>
- </table>
- </td>
-
- <td align="right" bgcolor="#e8e8e0">
- <table border='0' cellpadding='0' cellspacing='1'>
- <tr>
- <td class="button_auto_env" nowrap="true" valign='middle'
- align='center'>
- <a class="button_auto"
- href="weekprintview"
- var:queryDictionary="queryParameters"
- target="SOGoPrintView"
- ><var:string label:value="printview" /></a>
- </td>
- <td class="button_auto_env" nowrap="true" valign='middle'
- align='center'>
- <a class="button_auto"
- href="proposal"
- var:queryDictionary="queryParameters"
- ><var:string label:value="proposal" /></a>
- </td>
- </tr>
- </table>
+ <td width="5"/>
+ <td class="wintitle"><var:component className="UIxCalDateLabel"
+ startDate="startDate"
+ endDate="endDate"
+ const:selection="week"
+ /></td>
+ <td width="36" align="right" valign="center">
+ <var:component className="UIxWinClose" />
</td>
</tr>
</table>
- <table width="100%">
- <tr valign="top">
- <td>
- <table>
- <tr>
- <td>
- <var:component className="UIxCalInlineMonthOverview"
- selectedDate="thisMonth"
- const:showYear="YES"
- const:showWeekColumn="YES"
- const:weekSelectionHref="weekcolumnsview"
- const:style="weekcolumnsview_cal"
- const:headerStyle="weekcolumnsview_cal_title"
- const:weekStyle="weekcolumnsview_cal_week"
- const:dayHeaderStyle="weekcolumnsview_cal_day_header"
- const:dayBodyStyle="weekcolumnsview_cal_content"
- const:todayBodyStyle="weekcolumnsview_cal_content_hilite"
- const:inactiveDayBodyStyle="weekcolumnsview_cal_content_dimmed"
- />
- </td>
- </tr>
- <tr>
- <td>
- <var:component className="UIxCalInlineMonthOverview"
- selectedDate="nextMonth"
- const:showYear="YES"
- const:showWeekColumn="YES"
- const:weekSelectionHref="weekcolumnsview"
- const:style="weekcolumnsview_cal"
- const:headerStyle="weekcolumnsview_cal_title"
- const:weekStyle="weekcolumnsview_cal_week"
- const:dayHeaderStyle="weekcolumnsview_cal_day_header"
- const:dayBodyStyle="weekcolumnsview_cal_content"
- const:todayBodyStyle="weekcolumnsview_cal_content_hilite"
- const:inactiveDayBodyStyle="weekcolumnsview_cal_content_dimmed"
- />
- </td>
- </tr>
- </table>
+ </td>
+ </tr>
+ <tr>
+ <td id="skywinbodycell" class="wincontent">
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr bgcolor="#e8e8e0">
+ <td align="left">
+ <var:component className="UIxCalBackForthNavView"
+ methodName="ownMethodName"
+ prevQueryParameters="prevWeekQueryParameters"
+ currentQueryParameters="todayQueryParameters"
+ nextQueryParameters="nextWeekQueryParameters"
+ label:label="this week"
+ />
</td>
- <td width="100%">
- <var:weekcol-view list="appointments"
- item="appointment"
- weekStart="startDate"
- dayIndex="dayIndex"
- const:startDateKey="startDate"
- const:endDateKey="endDate"
- const:titleStyle="weekcolumnsview_title"
- contentStyle="contentStyle"
- const:class="weekcolumnsview"
- const:width="100%"
- const:contentColor="#e8e8e0"
- const:cellpadding="0"
- const:cellspacing="2"
- const:hideWeekend="shouldHideWeekend"
+ <td align="right" valign="middle" width="80%">
+ <var:component className="AnaisUidSelector"
+ calendarUIDs="clientObject.calendarUIDs"
+ />
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td id="skywinbodycell" class="wincontent">
+ <table border="0" width="100%" cellpadding="0" cellspacing="0">
+ <tr>
+ <td colspan="2">
+ <var:component className="UIxCalSelectTab"
+ const:selection="week"
+ currentDate="selectedDate"
>
- <var:weekcol-title>
- <table cellpadding="0" width="100%" border="0" cellspacing="0"
- var:class="titleStyle">
- <tr>
- <td align="left" valign="top">
- <a href="dayoverview"
- var:queryDictionary="currentDayQueryParameters"
- class="weekcolumnsview_title_daylink"
- ><var:string value="currentDay.dayOfMonth" /></a>
- </td>
- <td align="center" valign="top" width="97%">
- <var:string value="currentDayName" /><br />
- [<a href="new"
- var:queryDictionary="currentDayQueryParameters"
- class="weekcolumnsview_title_newlink"
- ><var:string label:value="new" /></a>]
- </td>
- </tr>
- </table>
- </var:weekcol-title>
- <var:if condition="hasDayInfo">
- <var:weekcol-info>
- <var:if condition="hasHolidayInfo">
- <var:string value="holidayInfo"
- const:class="weekcolumnsview_holidayinfo" />
- </var:if>
- <var:foreach list="allDayApts" item="appointment">
- <a var:href="appointmentViewURL"
- var:queryDictionary="currentDayQueryParameters"
- ><var:string value="shortTextForApt"
- const:escapeHTML="NO"
- /></a>
- </var:foreach>
- </var:weekcol-info>
- </var:if>
- <var:weekcol>
- <a var:href="appointmentViewURL"
- ><small><var:string value="shortTextForApt"
- const:escapeHTML="NO"
- /></small></a><br />
- </var:weekcol>
- </var:weekcol-view>
+ <table border="0" cellpadding="4" width="100%" cellspacing="2">
+ <tr>
+ <td width="1%"
+ align="left"
+ valign="middle"
+ bgcolor="#e8e8e0"
+ >
+ <table border='0' cellpadding='0' cellspacing='0'>
+ <tr>
+ <td><a href="weekoverview"
+ var:queryDictionary="queryParameters"
+ ><img rsrc:src="icon_view_overview.gif"
+ label:title="Overview"
+ label:alt="Overview"
+ border="0"
+ valign="top"
+ /></a></td>
+ <td><a href="weekchartview"
+ var:queryDictionary="queryParameters"
+ ><img rsrc:src="icon_view_chart.gif"
+ label:title="Chart"
+ label:alt="Chart"
+ border="0"
+ valign="top"
+ /></a></td>
+ <td><a href="weeklistview"
+ var:queryDictionary="queryParameters"
+ ><img rsrc:src="icon_view_list.gif"
+ label:title="List"
+ label:alt="List"
+ border="0"
+ valign="top"
+ /></a></td>
+ <td><img rsrc:src="icon_view_columns_inactive.gif"
+ label:title="Columns"
+ label:alt="Columns"
+ border="0"
+ valign="top"
+ /> </td>
+ </tr>
+ </table>
+ </td>
+
+ <td align="right" bgcolor="#e8e8e0">
+ <table border='0' cellpadding='0' cellspacing='1'>
+ <tr>
+ <td class="button_auto_env"
+ nowrap="true"
+ valign='middle'
+ align='center'
+ >
+ <a class="button_auto"
+ href="weekprintview"
+ var:queryDictionary="queryParameters"
+ target="SOGoPrintView"
+ ><var:string label:value="printview" /></a>
+ </td>
+ <td class="button_auto_env"
+ nowrap="true"
+ valign="middle"
+ align="center"
+ >
+ <a class="button_auto"
+ href="proposal"
+ var:queryDictionary="queryParameters"
+ ><var:string label:value="proposal" /></a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ <table width="100%">
+ <tr valign="top">
+ <td>
+ <table>
+ <tr>
+ <td>
+ <var:component className="UIxCalInlineMonthOverview"
+ selectedDate="thisMonth"
+ const:showYear="YES"
+ const:showWeekColumn="YES"
+ const:weekSelectionHref="weekcolumnsview"
+ const:style="weekcolumnsview_cal"
+ const:headerStyle="weekcolumnsview_cal_title"
+ const:weekStyle="weekcolumnsview_cal_week"
+ const:dayHeaderStyle="weekcolumnsview_cal_day_header"
+ const:dayBodyStyle="weekcolumnsview_cal_content"
+ const:todayBodyStyle="weekcolumnsview_cal_content_hilite"
+ const:inactiveDayBodyStyle="weekcolumnsview_cal_content_dimmed"
+ />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <var:component className="UIxCalInlineMonthOverview"
+ selectedDate="nextMonth"
+ const:showYear="YES"
+ const:showWeekColumn="YES"
+ const:weekSelectionHref="weekcolumnsview"
+ const:style="weekcolumnsview_cal"
+ const:headerStyle="weekcolumnsview_cal_title"
+ const:weekStyle="weekcolumnsview_cal_week"
+ const:dayHeaderStyle="weekcolumnsview_cal_day_header"
+ const:dayBodyStyle="weekcolumnsview_cal_content"
+ const:todayBodyStyle="weekcolumnsview_cal_content_hilite"
+ const:inactiveDayBodyStyle="weekcolumnsview_cal_content_dimmed"
+ />
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td width="100%">
+ <var:weekcol-view list="appointments"
+ item="appointment"
+ weekStart="startDate"
+ dayIndex="dayIndex"
+ const:startDateKey="startDate"
+ const:endDateKey="endDate"
+ const:titleStyle="weekcolumnsview_title"
+ contentStyle="contentStyle"
+ const:class="weekcolumnsview"
+ const:width="100%"
+ const:contentColor="#e8e8e0"
+ const:cellpadding="0"
+ const:cellspacing="2"
+ const:hideWeekend="shouldHideWeekend"
+ >
+ <var:weekcol-title>
+ <table cellpadding="0" width="100%" border="0" cellspacing="0"
+ var:class="titleStyle">
+ <tr>
+ <td align="left" valign="top">
+ <a href="dayoverview"
+ var:queryDictionary="currentDayQueryParameters"
+ class="weekcolumnsview_title_daylink"
+ ><var:string value="currentDay.dayOfMonth" /></a>
+ </td>
+ <td align="center" valign="top" width="97%">
+ <var:string value="currentDayName" /><br />
+ [<a href="new"
+ var:queryDictionary="currentDayQueryParameters"
+ class="weekcolumnsview_title_newlink"
+ ><var:string label:value="new" /></a>]
+ </td>
+ </tr>
+ </table>
+ </var:weekcol-title>
+ <var:if condition="hasDayInfo">
+ <var:weekcol-info>
+ <var:if condition="hasHolidayInfo">
+ <var:string value="holidayInfo"
+ const:class="weekcolumnsview_holidayinfo" />
+ </var:if>
+ <var:foreach list="allDayApts" item="appointment">
+ <var:component className="UIxCalInlineAptView"
+ appointment="appointment"
+ formatter="aptFormatter"
+ tooltipFormatter="aptTooltipFormatter"
+ url="appointmentViewURL"
+ style="aptStyle"
+ queryDictionary="currentDayQueryParameters"
+ canAccess="canAccessApt"
+ />
+ <br />
+ </var:foreach>
+ </var:weekcol-info>
+ </var:if>
+ <var:weekcol>
+ <var:component className="UIxCalInlineAptView"
+ appointment="appointment"
+ formatter="aptFormatter"
+ tooltipFormatter="aptTooltipFormatter"
+ url="appointmentViewURL"
+ style="aptStyle"
+ queryDictionary="currentDayQueryParameters"
+ canAccess="canAccessApt"
+ />
+ <br />
+ </var:weekcol>
+ </var:weekcol-view>
+ </td>
+ </tr>
+ </table>
+ </var:component>
+ </td>
+ </tr>
+ <tr bgcolor="#F5F5E9">
+ <td align="left" width="10"><var:entity const:name="nbsp"/></td>
+ <td align="right"><img
+ border="0" alt=""
+ src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif" /></td>
+ </tr>
+ <tr>
+ <td colspan="2" bgcolor="#F5F5E9">
+ <table border="0" width="100%" cellpadding="10" cellspacing="0">
+ <tr />
+ </table>
</td>
</tr>
</table>
-
- </var:component>
- </td>
- </tr>
- <tr bgcolor="#F5F5E9">
- <td align="left" width="10"><var:entity const:name="nbsp"/></td>
- <td align="right"><img
- border="0" alt=""
- src="/sogod.woa/so/ControlPanel/Products/CommonUI/Resources/corner_right.gif" /></td>
- </tr>
- <tr>
- <td colspan="2" bgcolor="#F5F5E9">
- <table border="0" width="100%" cellpadding="10" cellspacing="0">
- <tr />
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
+ </td>
+ </tr>
</table>
<!--
<hr />
#include "common.h"
#include <NGExtensions/NGCalendarDateRange.h>
#include <SOGoLogic/AgenorUserManager.h>
+#include <SOGoUI/SOGoAptFormatter.h>
@implementation UIxCalWeekListview
/* descriptions */
-- (NSString *)cnForCurrentUid {
- return [[AgenorUserManager sharedUserManager] getCNForUID:self->currentUid];
+- (void)configureFormatters {
+ [super configureFormatters];
+ [self->aptFormatter setTitleOnly];
+ [self->privateAptFormatter setPrivateDetails];
}
-- (NSString *)shortTextForApt {
- return [[self appointment] valueForKey:@"title"];
+- (NSString *)cnForCurrentUid {
+ return [[AgenorUserManager sharedUserManager] getCNForUID:self->currentUid];
}
/* style sheet */
const:align="top"
>
<span class="dayoverview_content_time_link">
- <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="currentDayQueryParameters"
+ canAccess="canAccessApt"
+ />
</span>
</var:matrix-cell>
</var:hspan-matrix>
const:class="weekoverview_holidayinfo" />
</var:if>
<var:foreach list="allDayApts" item="appointment">
- <a var:href="appointmentViewURL"
- var:queryDictionary="currentDayQueryParameters"
- var:class="aptStyle"
- ><var:string value="appointment"
- formatter="aptFormatter"
- const:escapeHTML="NO"
- /></a>
+ <var:component className="UIxCalInlineAptView"
+ appointment="appointment"
+ formatter="aptFormatter"
+ tooltipFormatter="aptTooltipFormatter"
+ url="appointmentViewURL"
+ style="aptStyle"
+ queryDictionary="currentDayQueryParameters"
+ canAccess="canAccessApt"
+ />
+ <br />
</var:foreach>
</var:week-info>
</var:if>
<var:week>
- <a var:href="appointmentViewURL"
- var:title="tooltipForApt"
- ><small><var:string value="appointment"
- formatter="aptFormatter"
- const:escapeHTML="NO"
- style="aptStyle"
- /></small></a><br />
+ <var:component className="UIxCalInlineAptView"
+ appointment="appointment"
+ formatter="aptFormatter"
+ tooltipFormatter="aptTooltipFormatter"
+ url="appointmentViewURL"
+ style="aptStyle"
+ canAccess="canAccessApt"
+ />
+ <br />
</var:week>
</var:week-overview>
</var:component>
NSMutableString *aptDescr;
NSString *s;
BOOL isMyApt;
+ BOOL canAccessApt;
BOOL spansRange;
id apt;
- apt = [self appointment];
- isMyApt = [self isMyApt];
- spansRange = NO;
- startDate = [apt valueForKey:@"startDate"];
+ apt = [self appointment];
+ isMyApt = [self isMyApt];
+ canAccessApt = [self canAccessApt];
+ spansRange = NO;
+ startDate = [apt valueForKey:@"startDate"];
[startDate setTimeZone:[self viewTimeZone]];
- endDate = [apt valueForKey:@"endDate"];
+ endDate = [apt valueForKey:@"endDate"];
if(endDate != nil) {
[endDate setTimeZone:[self viewTimeZone]];
spansRange = ![endDate isEqualToDate:startDate];
[aptDescr appendFormat:@"</span>,"];
if(!isMyApt)
[aptDescr appendFormat:@"<span class=\"%@\">", [self aptStyle]];
- s = [apt valueForKey:@"title"];
- if(s) {
- [aptDescr appendFormat:@"<br />%@", s];
- }
- s = [apt valueForKey:@"location"];
- if(s) {
- [aptDescr appendFormat:@"<br />%@", s];
+ if (canAccessApt) {
+ s = [apt valueForKey:@"title"];
+ if(s) {
+ [aptDescr appendFormat:@"<br />%@", s];
+ }
+ s = [apt valueForKey:@"location"];
+ if(s) {
+ [aptDescr appendFormat:@"<br />%@", s];
+ }
}
if(!isMyApt)
[aptDescr appendString:@"</span>"];
title="title">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td class="weekprintview">
- <h1 class="weekprintview"><var:string value="title" /></h1>
- <h2 class="weekprintview"><var:string value="formattedCalendarUIDs" /></h2>
- </td>
- </tr>
- <tr>
- <td>
- <var:week-overview list="appointments"
- item="appointment"
- weekStart="startDate"
- dayIndex="dayIndex"
- const:startDateKey="startDate"
- const:endDateKey="endDate"
- const:titleStyle="weekprintview_title"
- const:contentStyle="weekprintview_content"
- const:cellpadding="5"
- const:cellspacing="0"
- const:border="1"
- const:width="100%"
- >
- <var:week-title>
- <table cellpadding="5"
- width="100%"
- border="0"
- cellspacing="0"
- class="weekprintview_title"
- >
- <tr>
- <td align="left" valign="top">
- <var:string value="currentDay.dayOfMonth"
- const:numberformat="02"
- />
- </td>
- <td align="center" valign="top" width="97%">
- <var:string value="currentDayName" />
- </td>
- </tr>
- </table>
- </var:week-title>
- <var:if condition="hasDayInfo">
- <var:week-info>
- <var:if condition="hasHolidayInfo">
- <var:string value="holidayInfo"
- const:class="weekprintview_holidayinfo"
- />
- </var:if>
- <var:foreach list="allDayApts" item="appointment">
- <var:string value="shortTextForApt"
- const:escapeHTML="NO"
- />
- </var:foreach>
- </var:week-info>
- </var:if>
- <var:week>
- <var:string value="shortTextForApt"
- const:escapeHTML="NO"
- /> <br />
- </var:week>
- </var:week-overview>
+ <tr>
+ <td class="weekprintview">
+ <h1 class="weekprintview"><var:string value="title" /></h1>
+ <h2 class="weekprintview"><var:string value="formattedCalendarUIDs" /></h2>
</td>
</tr>
+ <tr>
+ <td>
+ <var:week-overview list="appointments"
+ item="appointment"
+ weekStart="startDate"
+ dayIndex="dayIndex"
+ const:startDateKey="startDate"
+ const:endDateKey="endDate"
+ const:titleStyle="weekprintview_title"
+ const:contentStyle="weekprintview_content"
+ const:cellpadding="5"
+ const:cellspacing="0"
+ const:border="1"
+ const:width="100%"
+ >
+ <var:week-title>
+ <table cellpadding="5"
+ width="100%"
+ border="0"
+ cellspacing="0"
+ class="weekprintview_title"
+ >
+ <tr>
+ <td align="left" valign="top">
+ <var:string value="currentDay.dayOfMonth"
+ const:numberformat="02"
+ />
+ </td>
+ <td align="center" valign="top" width="97%">
+ <var:string value="currentDayName" />
+ </td>
+ </tr>
+ </table>
+ </var:week-title>
+ <var:if condition="hasDayInfo">
+ <var:week-info>
+ <var:if condition="hasHolidayInfo">
+ <var:string value="holidayInfo"
+ const:class="weekprintview_holidayinfo"
+ />
+ </var:if>
+ <var:foreach list="allDayApts" item="appointment">
+ <var:string value="shortTextForApt"
+ const:escapeHTML="NO"
+ />
+ </var:foreach>
+ </var:week-info>
+ </var:if>
+ <var:week>
+ <var:string value="shortTextForApt"
+ const:escapeHTML="NO"
+ /> <br />
+ </var:week>
+ </var:week-overview>
+ </td>
+ </tr>
</table>
</var:component>
# $Id$
-SUBMINOR_VERSION:=97
+SUBMINOR_VERSION:=98
+# v0.9.98 requires SOGoUI v0.9.19
# v0.9.96 requires SOGoLogic v0.9.27
# v0.9.94 requires NGExtensions v4.5.136
# v0.9.84 requires SOGoLogic v0.9.12
- (void)setAccessClass:(NSString *)_value;
- (NSString *)accessClass;
+- (BOOL)isPublic;
- (void)setTransparency:(NSString *)_value;
- (NSString *)transparency;
+- (BOOL)isTransparent;
- (void)removeAllAttendees;
- (void)addToAttendees:(iCalPerson *)_person;
s = @"PUBLIC"; /* default for agenor */
return s;
}
+- (BOOL)isPublic {
+ return [[self accessClass] isEqualToString:@"PUBLIC"];
+}
- (void)setTransparency:(NSString *)_value {
[self debugWithFormat:@"transparency currently unsupported by iCalEvent!"];
[self debugWithFormat:@"returning bogus transparency information!"];
return @"TRANSPARENT";
}
+- (BOOL)isTransparent {
+ return [[self transparency] isEqualToString:@"TRANSPARENT"];
+}
- (void)setOrganizer:(iCalPerson *)_organizer {
[self->event setOrganizer:_organizer];