mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-11 03:15:10 +00:00
Monotone-Parent: 843a82037dc71e1dd55379b4245e267fe0b6e025
Monotone-Revision: 7ccd1ab7beef95f5bf3ce66708988dbf11332387 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-07T18:12:20 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#import <NGObjWeb/SoObject.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <NGObjWeb/NSException+HTTP.h>
|
||||
@@ -46,6 +48,7 @@
|
||||
aptEndDate = nil;
|
||||
item = nil;
|
||||
event = nil;
|
||||
isAllDay = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -66,11 +69,12 @@
|
||||
/* icalendar values */
|
||||
- (BOOL) isAllDay
|
||||
{
|
||||
return NO;
|
||||
return isAllDay;
|
||||
}
|
||||
|
||||
- (void) setIsAllDay: (BOOL) newIsAllDay
|
||||
{
|
||||
isAllDay = newIsAllDay;
|
||||
}
|
||||
|
||||
- (void) setAptStartDate: (NSCalendarDate *) newAptStartDate
|
||||
@@ -263,6 +267,7 @@
|
||||
ASSIGN (aptStartDate, startDate);
|
||||
ASSIGN (aptEndDate, endDate);
|
||||
|
||||
|
||||
/* here comes the code for initializing repeat, reminder and isAllDay... */
|
||||
|
||||
return self;
|
||||
@@ -313,14 +318,25 @@
|
||||
inContext: (WOContext *) _ctx
|
||||
{
|
||||
SOGoAppointmentObject *clientObject;
|
||||
int nbrDays;
|
||||
|
||||
clientObject = [self clientObject];
|
||||
event = (iCalEvent *) [clientObject component: YES];
|
||||
|
||||
[super takeValuesFromRequest: _rq inContext: _ctx];
|
||||
|
||||
[event setStartDate: aptStartDate];
|
||||
[event setEndDate: aptEndDate];
|
||||
if (isAllDay)
|
||||
{
|
||||
nbrDays = ((float) abs ([aptEndDate timeIntervalSinceDate: aptStartDate])
|
||||
/ 86400) + 1;
|
||||
[event setAllDayWithStartDate: aptStartDate
|
||||
duration: nbrDays];
|
||||
}
|
||||
else
|
||||
{
|
||||
[event setStartDate: aptStartDate];
|
||||
[event setEndDate: aptEndDate];
|
||||
}
|
||||
if ([clientObject isNew])
|
||||
[event setTransparency: @"OPAQUE"];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user