mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-20 02:45:25 +00:00
Monotone-Parent: 6f3f424424e1dc4ae51e22f8072993e3bd8ff14a
Monotone-Revision: f69d60b9d521e7955f8e0a7051cb02f730a5b031 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-31T23:01:12 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
2006-10-31 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalInlineAptView.m ([UIxCalInlineAptView
|
||||
-displayStyle]): new method that returns a string containing the
|
||||
css style relative to the current appointment cell. This code is
|
||||
currently inactive but might be reused later.
|
||||
|
||||
* UI/WebServerResources/SchedulerUI.js: added code to handle the
|
||||
display of the selected day (the day pointed by the mouse, or the
|
||||
current day when changing the view).
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
*/
|
||||
// $Id: UIxCalInlineAptView.m 885 2005-07-21 16:41:34Z znek $
|
||||
|
||||
#import <Foundation/NSDictionary.h>
|
||||
|
||||
#import <NGObjWeb/NGObjWeb.h>
|
||||
|
||||
@interface UIxCalInlineAptView : WOComponent
|
||||
{
|
||||
id appointment;
|
||||
NSDictionary *appointment;
|
||||
id formatter;
|
||||
id tooltipFormatter;
|
||||
id url;
|
||||
@@ -54,10 +56,10 @@
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)setAppointment:(id)_appointment {
|
||||
- (void) setAppointment: (NSDictionary *)_appointment {
|
||||
ASSIGN(appointment, _appointment);
|
||||
}
|
||||
- (id)appointment {
|
||||
- (NSDictionary *)appointment {
|
||||
return appointment;
|
||||
}
|
||||
|
||||
@@ -146,6 +148,35 @@
|
||||
[appointment objectForKey: @"owner"]];
|
||||
}
|
||||
|
||||
- (NSString *) displayStyle
|
||||
{
|
||||
NSCalendarDate *startDate, *endDate, *dayStart, *dayEnd;
|
||||
int sSeconds, eSeconds, deltaMinutes;
|
||||
unsigned int height;
|
||||
NSTimeZone *uTZ;
|
||||
|
||||
uTZ = [referenceDate timeZone];
|
||||
dayStart = [referenceDate beginOfDay];
|
||||
dayEnd = [referenceDate endOfDay];
|
||||
|
||||
sSeconds = [[appointment objectForKey: @"startdate"] intValue];
|
||||
eSeconds = [[appointment objectForKey: @"enddate"] intValue];
|
||||
startDate = [NSCalendarDate dateWithTimeIntervalSince1970: sSeconds];
|
||||
[startDate setTimeZone: uTZ];
|
||||
if ([startDate earlierDate: dayStart] == startDate)
|
||||
startDate = dayStart;
|
||||
endDate = [NSCalendarDate dateWithTimeIntervalSince1970: eSeconds];
|
||||
[endDate setTimeZone: uTZ];
|
||||
if ([endDate earlierDate: dayEnd] == dayEnd)
|
||||
endDate = dayEnd;
|
||||
|
||||
deltaMinutes = (([endDate hourOfDay] - [startDate hourOfDay]) * 60
|
||||
+ [endDate minuteOfHour] - [startDate minuteOfHour]);
|
||||
height = ceil(deltaMinutes / 15) * 25;
|
||||
|
||||
return [NSString stringWithFormat: @"height: %d%%;", height];
|
||||
}
|
||||
|
||||
/* helpers */
|
||||
|
||||
- (NSString *) title
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
var:aptCName="appointment.c_name"
|
||||
var:title="tooltip"
|
||||
var:queryDictionary="queryDictionary">
|
||||
<span var:class="displayClasses">
|
||||
<div var:class="displayClasses">
|
||||
<var:if condition="appointment.isRecurrentEvent">
|
||||
<!-- TODO: maxime needs to provide an image instead! -->
|
||||
<var:string const:value="[R]" style="style" />
|
||||
@@ -21,13 +21,13 @@
|
||||
<img rsrc:src="apt_icon_private.gif" />
|
||||
</var:if>
|
||||
<var:string value="title" const:escapeHTML="NO" style="style" />
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
</var:if>
|
||||
<var:if condition="canAccess" const:negate="YES">
|
||||
<span var:class="displayClasses">
|
||||
<img rsrc:src="apt_icon_private.gif" />
|
||||
<var:string value="title" const:escapeHTML="NO" style="style" />
|
||||
</span>
|
||||
</var:if>
|
||||
</span>
|
||||
</var:if>
|
||||
</container>
|
||||
|
||||
Reference in New Issue
Block a user