mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-28 09:53:23 +00:00
Merge branch 'master' into feature/addMissingStrings2
Conflicts: UI/AdministrationUI/English.lproj/Localizable.strings UI/PreferencesUI/English.lproj/Localizable.strings UI/Templates/PreferencesUI/UIxFilterEditor.wox
This commit is contained in:
@@ -446,6 +446,9 @@ validate_endbeforestart = "The end date that you entered occurs before the st
|
||||
"Month View" = "Month View";
|
||||
"Reload" = "Reload";
|
||||
|
||||
/* Number of selected components in events or tasks list */
|
||||
"selected" = "selected";
|
||||
|
||||
"eventPartStatModificationError" = "Your participation status could not be modified.";
|
||||
|
||||
/* menu */
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
|
||||
/* Searching */
|
||||
|
||||
"view_all" = "Todos los eventos";
|
||||
"view_all" = "Todos";
|
||||
"view_today" = "Hoy";
|
||||
"view_next7" = "Próximos 7 días";
|
||||
"view_next14" = "Próximos 14 días";
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
#import <SOGo/NSCalendarDate+SOGo.h>
|
||||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
#import <SOGo/NSString+Utilities.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <Appointments/iCalEvent+SOGo.h>
|
||||
@@ -59,23 +60,25 @@
|
||||
SoSecurityManager *sm;
|
||||
iCalEvent *event;
|
||||
NSCalendarDate *start, *newStart, *end, *newEnd;
|
||||
NSDictionary *params;
|
||||
NSTimeInterval newDuration;
|
||||
SOGoUserDefaults *ud;
|
||||
NSString *daysDelta, *startDelta, *durationDelta, *destionationCalendar;
|
||||
NSNumber *daysDelta, *startDelta, *durationDelta;
|
||||
NSString *destionationCalendar;
|
||||
NSTimeZone *tz;
|
||||
NSException *ex;
|
||||
SOGoAppointmentFolder *targetCalendar, *sourceCalendar;
|
||||
SOGoAppointmentFolders *folders;
|
||||
|
||||
rq = [context request];
|
||||
params = [[rq contentAsString] objectFromJSONString];
|
||||
|
||||
daysDelta = [rq formValueForKey: @"days"];
|
||||
startDelta = [rq formValueForKey: @"start"];
|
||||
durationDelta = [rq formValueForKey: @"duration"];
|
||||
destionationCalendar = [rq formValueForKey: @"destination"];
|
||||
daysDelta = [params objectForKey: @"days"];
|
||||
startDelta = [params objectForKey: @"start"];
|
||||
durationDelta = [params objectForKey: @"duration"];
|
||||
destionationCalendar = [params objectForKey: @"destination"];
|
||||
|
||||
if ([daysDelta length] > 0
|
||||
|| [startDelta length] > 0 || [durationDelta length] > 0)
|
||||
if (daysDelta || startDelta || durationDelta)
|
||||
{
|
||||
co = [self clientObject];
|
||||
event = (iCalEvent *) [[self clientObject] occurence];
|
||||
@@ -119,7 +122,7 @@
|
||||
[event setLastModified: [NSCalendarDate calendarDate]];
|
||||
ex = [co saveComponent: event];
|
||||
// This condition will be executed only if the event is moved from a calendar to another. If destionationCalendar == 0; there is no calendar change
|
||||
if (![destionationCalendar isEqualToString:@"0"])
|
||||
if ([destionationCalendar length] > 0)
|
||||
{
|
||||
folders = [[self->context activeUser] calendarsFolderInContext: self->context];
|
||||
sourceCalendar = [co container];
|
||||
@@ -151,9 +154,8 @@
|
||||
response = [self responseWith204];
|
||||
}
|
||||
else
|
||||
response
|
||||
= (WOResponse *) [NSException exceptionWithHTTPStatus: 400
|
||||
reason: @"missing 'days', 'start' and/or 'duration' parameters"];
|
||||
response = (WOResponse *) [NSException exceptionWithHTTPStatus: 400
|
||||
reason: @"missing 'days', 'start' and/or 'duration' parameters"];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -595,12 +595,12 @@
|
||||
* @apiSuccess (Success 200) {Boolean} alarm.attendees Alert attendees by email if true and action is email
|
||||
* @apiSuccess (Success 200) {Boolean} alarm.organizer Alert organizer by email if true and action is email
|
||||
*
|
||||
* @apiSuccess {_} ... _From [iCalEvent+SOGo attributes]_
|
||||
* @apiSuccess {_} ... _From [iCalEvent+SOGo attributesInContext:]_
|
||||
*
|
||||
* @apiSuccess (Success 200) {Number} isAllDay 1 if event is all-day
|
||||
* @apiSuccess (Success 200) {Number} isTransparent 1 if the event is not opaque
|
||||
*
|
||||
* @apiSuccess {_} .... _From [iCalEntityObject+SOGo attributes]_
|
||||
* @apiSuccess {_} .... _From [iCalEntityObject+SOGo attributesInContext:]_
|
||||
*
|
||||
* @apiSuccess (Success 200) {Number} sendAppointmentNotifications 1 if notifications must be sent
|
||||
* @apiSuccess (Success 200) {String} component "vevent"
|
||||
@@ -626,7 +626,7 @@
|
||||
* @apiSuccess (Success 200) {String} [attendees.delegatedTo] User that the original request was delegated to
|
||||
* @apiSuccess (Success 200) {String} [attendees.delegatedFrom] User the request was delegated from
|
||||
*
|
||||
* @apiSuccess {_} ..... _From [iCalRepeatableEntityObject+SOGo attributes]_
|
||||
* @apiSuccess {_} ..... _From [iCalRepeatableEntityObject+SOGo attributesInContext:]_
|
||||
*
|
||||
* @apiSuccess (Success 200) {Object} [repeat] Recurrence rule definition
|
||||
* @apiSuccess (Success 200) {String} repeat.frequency Either daily, (every weekday), weekly, (bi-weekly), monthly, or yearly
|
||||
@@ -652,7 +652,8 @@
|
||||
iCalEvent *event;
|
||||
|
||||
BOOL resetAlarm;
|
||||
unsigned int snoozeAlarm;
|
||||
NSInteger offset;
|
||||
NSUInteger snoozeAlarm;
|
||||
|
||||
event = [self event];
|
||||
co = [self clientObject];
|
||||
@@ -662,12 +663,23 @@
|
||||
timeZone = [ud timeZone];
|
||||
eventStartDate = [event startDate];
|
||||
eventEndDate = [event endDate];
|
||||
if (!isAllDay)
|
||||
|
||||
if (isAllDay)
|
||||
{
|
||||
[eventStartDate setTimeZone: timeZone];
|
||||
[eventEndDate setTimeZone: timeZone];
|
||||
eventEndDate = [eventEndDate dateByAddingYears: 0 months: 0 days: -1];
|
||||
|
||||
// Convert the dates to the user's timezone
|
||||
offset = [timeZone secondsFromGMTForDate: eventStartDate];
|
||||
eventStartDate = [eventStartDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0
|
||||
seconds:-offset];
|
||||
offset = [timeZone secondsFromGMTForDate: eventEndDate];
|
||||
eventEndDate = [eventEndDate dateByAddingYears:0 months:0 days:0 hours:0 minutes:0
|
||||
seconds:-offset];
|
||||
}
|
||||
|
||||
[eventStartDate setTimeZone: timeZone];
|
||||
[eventEndDate setTimeZone: timeZone];
|
||||
|
||||
// resetAlarm=yes is set only when we are about to show the alarm popup in the Web
|
||||
// interface of SOGo. See generic.js for details. snoozeAlarm=X is called when the
|
||||
// user clicks on "Snooze for" X minutes, when the popup is being displayed.
|
||||
@@ -704,8 +716,11 @@
|
||||
data = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
[componentCalendar nameInContainer], @"pid",
|
||||
[componentCalendar displayName], @"calendar",
|
||||
[NSNumber numberWithBool: isAllDay], @"isAllDay",
|
||||
[NSNumber numberWithBool: [self isReadOnly]], @"isReadOnly",
|
||||
[NSNumber numberWithBool: [self userHasRSVP]], @"userHasRSVP",
|
||||
[eventStartDate iso8601DateString], @"startDate",
|
||||
[eventEndDate iso8601DateString], @"endDate",
|
||||
[dateFormatter formattedDate: eventStartDate], @"localizedStartDate",
|
||||
[dateFormatter formattedDate: eventEndDate], @"localizedEndDate",
|
||||
[self alarm], @"alarm",
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
|
||||
date = [self startDate];
|
||||
|
||||
return [NSString stringWithFormat: @"%.2d", [date monthOfYear]];
|
||||
return [NSString stringWithFormat: @"%.2d", (int)[date monthOfYear]];
|
||||
}
|
||||
|
||||
- (NSString *) headerMonthString
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
date = [self startDate];
|
||||
|
||||
return [NSString stringWithFormat: @"%d", [date yearOfCommonEra]];
|
||||
return [NSString stringWithFormat: @"%d", (int)[date yearOfCommonEra]];
|
||||
}
|
||||
|
||||
- (NSString *) localizedDayOfWeekName
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
NSArray *weekDays;
|
||||
NSString *currentView, *timeFormat, *currentTableHour;
|
||||
NSCalendarDate *startDate, *currentTableDay;
|
||||
NSMutableArray *daysToDisplay, *calendarsToDisplay, *currentCalendar, *hoursToDisplay;
|
||||
NSMutableArray *daysToDisplay, *calendarsToDisplay, *hoursToDisplay;
|
||||
NSMutableDictionary *currentCalendar;
|
||||
unsigned int numberOfDays;
|
||||
}
|
||||
|
||||
@@ -55,7 +56,7 @@
|
||||
- (NSArray *) calendarsToDisplay;
|
||||
- (void) setCurrentTableDay: (NSCalendarDate *) aTableDay;
|
||||
- (NSCalendarDate *) currentTableDay;
|
||||
- (NSMutableArray *) currentCalendar;
|
||||
- (NSMutableDictionary *) currentCalendar;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/WOResourceManager+SOGo.h>
|
||||
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolders.h>
|
||||
|
||||
#import "UIxCalDayTable.h"
|
||||
|
||||
@class SOGoAppointment;
|
||||
@@ -184,14 +187,13 @@
|
||||
{
|
||||
if (!calendarsToDisplay)
|
||||
{
|
||||
int max=0, i;
|
||||
NSArray *folders;
|
||||
SOGoAppointmentFolders *co;
|
||||
SOGoAppointmentFolder *folder;
|
||||
NSMutableDictionary *calendar;
|
||||
unsigned int count, foldersCount;
|
||||
NSString *folderName, *fDisplayName;
|
||||
NSNumber *isActive;
|
||||
BOOL isActive;
|
||||
|
||||
co = [self clientObject];
|
||||
folders = [co subFolders];
|
||||
@@ -200,8 +202,8 @@
|
||||
for (count = 0; count < foldersCount; count++)
|
||||
{
|
||||
folder = [folders objectAtIndex: count];
|
||||
isActive = [NSNumber numberWithBool: [folder isActive]];
|
||||
if ([isActive intValue] != 0) {
|
||||
isActive = [folder isActive];
|
||||
if (isActive != NO) {
|
||||
calendar = [NSMutableDictionary dictionary];
|
||||
folderName = [folder nameInContainer];
|
||||
fDisplayName = [folder displayName];
|
||||
@@ -214,7 +216,7 @@
|
||||
[calendar setObject: fDisplayName forKey: @"displayName"];
|
||||
[calendar setObject: folderName forKey: @"folder"];
|
||||
[calendar setObject: [folder calendarColor] forKey: @"color"];
|
||||
[calendar setObject: isActive forKey: @"active"];
|
||||
[calendar setObject: [NSNumber numberWithBool:isActive] forKey: @"active"];
|
||||
[calendar setObject: [folder ownerInContext: context]
|
||||
forKey: @"owner"];
|
||||
[calendarsToDisplay addObject: calendar];
|
||||
@@ -235,12 +237,12 @@
|
||||
return currentTableDay;
|
||||
}
|
||||
|
||||
- (void) setCurrentCalendar: (NSMutableArray *) aCalendar
|
||||
- (void) setCurrentCalendar: (NSMutableDictionary *) aCalendar
|
||||
{
|
||||
ASSIGN(currentCalendar, aCalendar);
|
||||
}
|
||||
|
||||
- (NSMutableArray *) currentCalendar
|
||||
- (NSMutableDictionary *) currentCalendar
|
||||
{
|
||||
return currentCalendar;
|
||||
}
|
||||
@@ -282,9 +284,9 @@
|
||||
return [daysToDisplay indexOfObject: currentTableDay];
|
||||
}
|
||||
|
||||
- (NSString *) currentAppointmentHour
|
||||
- (NSNumber *) currentAppointmentHour
|
||||
{
|
||||
return [NSString stringWithFormat: @"%.2d00", [currentTableHour intValue]];
|
||||
return [NSNumber numberWithInt: [currentTableHour intValue]];
|
||||
}
|
||||
|
||||
- (NSString *) labelForDay
|
||||
@@ -292,6 +294,39 @@
|
||||
return [weekDays objectAtIndex: [currentTableDay dayOfWeek]];
|
||||
}
|
||||
|
||||
- (NSString *) labelForMonth
|
||||
{
|
||||
NSCalendarDate *nextDay;
|
||||
NSString *calendarFormat;
|
||||
BOOL isLastOrFirstDay;
|
||||
|
||||
isLastOrFirstDay = NO;
|
||||
calendarFormat = @"%b";
|
||||
|
||||
if ([currentView hasSuffix: @"dayview"])
|
||||
{
|
||||
isLastOrFirstDay = YES;
|
||||
calendarFormat = @"%B";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ([currentTableDay dayOfMonth] == 1)
|
||||
{
|
||||
isLastOrFirstDay = YES;
|
||||
}
|
||||
else if ([currentTableDay dayOfMonth] > 27)
|
||||
{
|
||||
nextDay = [currentTableDay dateByAddingYears: 0
|
||||
months: 0
|
||||
days: 1];
|
||||
if ([nextDay dayOfMonth] == 1)
|
||||
isLastOrFirstDay = YES;
|
||||
}
|
||||
}
|
||||
|
||||
return isLastOrFirstDay? [currentTableDay descriptionWithCalendarFormat: calendarFormat locale: locale] : nil;
|
||||
}
|
||||
|
||||
- (NSString *) labelForDate
|
||||
{
|
||||
return [dateFormatter shortFormattedDate: currentTableDay];
|
||||
@@ -397,18 +432,23 @@
|
||||
numberOfDays];
|
||||
}
|
||||
|
||||
- (NSString *) daysViewClasses
|
||||
{
|
||||
NSString *daysView;
|
||||
// - (NSString *) daysViewClasses
|
||||
// {
|
||||
// NSString *daysView;
|
||||
|
||||
if ([currentView isEqualToString:@"multicolumndayview"])
|
||||
daysView = @"daysView daysViewForMultipleDays";
|
||||
// if ([currentView isEqualToString:@"multicolumndayview"])
|
||||
// daysView = @"daysView daysViewForMultipleDays";
|
||||
|
||||
else
|
||||
daysView = [NSString stringWithFormat: @"daysView daysViewFor%dDays", numberOfDays];
|
||||
// else
|
||||
// daysView = [NSString stringWithFormat: @"daysView daysViewFor%dDays", numberOfDays];
|
||||
|
||||
return daysView;
|
||||
}
|
||||
// return daysView;
|
||||
//}
|
||||
|
||||
// - (NSString *) daysViewHeaderClasses
|
||||
// {
|
||||
// return [NSString stringWithFormat: @"%@ daysHeader", [self daysViewClasses]];
|
||||
// }
|
||||
|
||||
- (NSString *) dayClasses
|
||||
{
|
||||
@@ -416,22 +456,18 @@
|
||||
unsigned int currentDayNbr, realDayOfWeek;
|
||||
|
||||
classes = [NSMutableString string];
|
||||
if ([currentView isEqualToString:@"multicolumndayview"])
|
||||
[classes appendFormat:@"day dayColumn"];
|
||||
else {
|
||||
currentDayNbr = [daysToDisplay indexOfObject: currentTableDay];
|
||||
realDayOfWeek = [currentTableDay dayOfWeek];
|
||||
currentDayNbr = [daysToDisplay indexOfObject: currentTableDay];
|
||||
realDayOfWeek = [currentTableDay dayOfWeek];
|
||||
|
||||
[classes appendFormat: @"day day%d", currentDayNbr];
|
||||
[classes appendFormat: @"day day%d", currentDayNbr];
|
||||
|
||||
if (numberOfDays > 1)
|
||||
if (numberOfDays > 1)
|
||||
{
|
||||
if (realDayOfWeek == 0 || realDayOfWeek == 6)
|
||||
[classes appendString: @" weekEndDay"];
|
||||
if ([currentTableDay isToday])
|
||||
[classes appendString: @" dayOfToday"];
|
||||
}
|
||||
}
|
||||
|
||||
return classes;
|
||||
}
|
||||
@@ -468,4 +504,9 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL) isWeekView
|
||||
{
|
||||
return [currentView isEqualToString:@"weekview"];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
|
||||
date = [self selectedDate];
|
||||
hmString = [NSString stringWithFormat:@"%.2d%.2d",
|
||||
[date hourOfDay], [date minuteOfHour]];
|
||||
(int)[date hourOfDay], (int)[date minuteOfHour]];
|
||||
qp = [[self queryParameters] mutableCopy];
|
||||
[self setSelectedDateQueryParameter:date inDictionary:qp];
|
||||
[qp setObject: hmString forKey:@"hm"];
|
||||
|
||||
@@ -72,18 +72,14 @@
|
||||
rc = [NSMutableDictionary dictionary];
|
||||
request = [context request];
|
||||
folder = [self clientObject];
|
||||
data = [request formValueForKey: @"calendarFile"];
|
||||
if ([data respondsToSelector: @selector(isEqualToString:)])
|
||||
fileContent = (NSString *) data;
|
||||
else
|
||||
{
|
||||
fileContent = [[NSString alloc] initWithData: (NSData *) data
|
||||
encoding: NSUTF8StringEncoding];
|
||||
if (fileContent == nil)
|
||||
fileContent = [[NSString alloc] initWithData: (NSData *) data
|
||||
encoding: NSISOLatin1StringEncoding];
|
||||
[fileContent autorelease];
|
||||
}
|
||||
data = [[[[[request httpRequest] body] parts] lastObject] body];
|
||||
|
||||
fileContent = [[NSString alloc] initWithData: (NSData *) data
|
||||
encoding: NSUTF8StringEncoding];
|
||||
if (fileContent == nil)
|
||||
fileContent = [[NSString alloc] initWithData: (NSData *) data
|
||||
encoding: NSISOLatin1StringEncoding];
|
||||
[fileContent autorelease];
|
||||
|
||||
if (fileContent && [fileContent length]
|
||||
&& [fileContent hasPrefix: @"BEGIN:"])
|
||||
|
||||
@@ -328,16 +328,24 @@ static NSArray *tasksFields = nil;
|
||||
iCalPersonPartStat stat;
|
||||
NSUInteger count, max;
|
||||
|
||||
if ([[theRecord objectForKey: @"c_partmails"] length] > 0 &&
|
||||
[[theRecord objectForKey: @"c_partstates"] length] > 0)
|
||||
states = nil;
|
||||
|
||||
if ([[theRecord objectForKey: @"c_partmails"] length] > 0)
|
||||
{
|
||||
mails = [[theRecord objectForKey: @"c_partmails"] componentsSeparatedByString: @"\n"];
|
||||
states = [[theRecord objectForKey: @"c_partstates"] componentsSeparatedByString: @"\n"];
|
||||
|
||||
// We add some robustness here, in case the quick table had c_partmails defined but
|
||||
// no corresponding c_partstates entries. This can happen if folks toy around the database
|
||||
// or if Funambol was used in the past, with a broken connector.
|
||||
if ([[theRecord objectForKey: @"c_partstates"] length] > 0)
|
||||
states = [[theRecord objectForKey: @"c_partstates"] componentsSeparatedByString: @"\n"];
|
||||
|
||||
max = [mails count];
|
||||
statesDescription = [NSMutableArray arrayWithCapacity: max];
|
||||
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
stat = [[states objectAtIndex: count] intValue];
|
||||
stat = (states ? [[states objectAtIndex: count] intValue] : 0);
|
||||
[statesDescription addObject: [[iCalPerson descriptionForParticipationStatus: stat] lowercaseString]];
|
||||
}
|
||||
|
||||
@@ -356,10 +364,10 @@ static NSArray *tasksFields = nil;
|
||||
NSMutableDictionary *newInfo;
|
||||
NSMutableArray *infos, *quickInfos, *allInfos, *quickInfosName;
|
||||
NSNull *marker;
|
||||
NSString *owner, *role, *calendarName, *iCalString, *recurrenceTime;
|
||||
NSString *owner, *role, *calendarName, *iCalString, *recurrenceTime, *categories;
|
||||
NSRange match;
|
||||
iCalCalendar *calendar;
|
||||
iCalObject *master;
|
||||
iCalEntityObject *master;
|
||||
SOGoAppointmentFolder *currentFolder;
|
||||
SOGoAppointmentFolders *clientObject;
|
||||
SOGoUser *ownerUser;
|
||||
@@ -392,7 +400,7 @@ static NSArray *tasksFields = nil;
|
||||
else if ([criteria isEqualToString:@"entireContent"])
|
||||
{
|
||||
// First search : Through the quick table inside the location, category and title columns
|
||||
quickInfos = [currentFolder fetchCoreInfosFrom: startDate
|
||||
quickInfos = (NSMutableArray *)[currentFolder fetchCoreInfosFrom: startDate
|
||||
to: endDate
|
||||
title: value
|
||||
component: component
|
||||
@@ -408,14 +416,14 @@ static NSArray *tasksFields = nil;
|
||||
}
|
||||
|
||||
// Second research : Every objects except for those already in the quickInfos array
|
||||
allInfos = [currentFolder fetchCoreInfosFrom: startDate
|
||||
allInfos = (NSMutableArray *)[currentFolder fetchCoreInfosFrom: startDate
|
||||
to: endDate
|
||||
title: nil
|
||||
component: component];
|
||||
if (quickInfosFlag == YES)
|
||||
{
|
||||
for (i = ([allInfos count] - 1); i >= 0 ; i--) {
|
||||
if([quickInfosName containsObject:[[allInfos objectAtIndex:i] objectForKey:@"c_name"]])
|
||||
if ([quickInfosName containsObject:[[allInfos objectAtIndex:i] objectForKey:@"c_name"]])
|
||||
[allInfos removeObjectAtIndex:i];
|
||||
}
|
||||
}
|
||||
@@ -425,7 +433,7 @@ static NSArray *tasksFields = nil;
|
||||
{
|
||||
iCalString = [[allInfos objectAtIndex:i] objectForKey:@"c_content"];
|
||||
calendar = [iCalCalendar parseSingleFromSource: iCalString];
|
||||
master = [calendar firstChildWithTag:component];
|
||||
master = (iCalEntityObject *)[calendar firstChildWithTag:component];
|
||||
if (master) {
|
||||
if ([[master comment] length] > 0)
|
||||
{
|
||||
@@ -463,10 +471,10 @@ static NSArray *tasksFields = nil;
|
||||
role = [currentFolder roleForComponentsWithAccessClass: [[newInfo objectForKey: @"c_classification"] intValue]
|
||||
forUser : userLogin];
|
||||
|
||||
if ([role isEqualToString: @"ComponentViewer"])
|
||||
[newInfo setObject: [NSNumber numberWithInt: 1] forKey: @"viewable"];
|
||||
else
|
||||
if ([role isEqualToString: @"ComponentDAndTViewer"])
|
||||
[newInfo setObject: [NSNumber numberWithInt: 0] forKey: @"viewable"];
|
||||
else
|
||||
[newInfo setObject: [NSNumber numberWithInt: 1] forKey: @"viewable"];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,6 +522,11 @@ static NSArray *tasksFields = nil;
|
||||
[newInfo setObject: calendarName
|
||||
forKey: @"calendarName"];
|
||||
|
||||
// Split comma-delimited categories
|
||||
categories = [newInfo objectForKey: @"c_category"];
|
||||
if ([categories length])
|
||||
[newInfo setObject: [categories componentsSeparatedByString: @","] forKey: @"c_category"];
|
||||
|
||||
// Fix empty title
|
||||
if (![[newInfo objectForKey: @"c_title"] length])
|
||||
[self _fixComponentTitle: newInfo withType: component];
|
||||
@@ -892,10 +905,10 @@ static inline iCalPersonPartStat _userStateInEvent (NSArray *event)
|
||||
states = [event objectAtIndex: eventPartStatesIndex];
|
||||
count = 0;
|
||||
max = [participants count];
|
||||
user = [SOGoUser userWithLogin: [event objectAtIndex: eventOwnerIndex]
|
||||
roles: nil];
|
||||
while (state == iCalPersonPartStatOther && count < max)
|
||||
{
|
||||
user = [SOGoUser userWithLogin: [event objectAtIndex: eventOwnerIndex]
|
||||
roles: nil];
|
||||
if ([user hasEmail: [participants objectAtIndex: count]])
|
||||
state = [[states objectAtIndex: count] intValue];
|
||||
else
|
||||
@@ -933,7 +946,7 @@ static inline iCalPersonPartStat _userStateInEvent (NSArray *event)
|
||||
eventStart = eventEnd;
|
||||
eventEnd = swap;
|
||||
[self warnWithFormat: @"event '%@' has end < start: %d < %d",
|
||||
[event objectAtIndex: eventNameIndex], eventEnd, eventStart];
|
||||
[event objectAtIndex: eventNameIndex], eventEnd, eventStart];
|
||||
}
|
||||
|
||||
startSecs = (unsigned int) [startDate timeIntervalSince1970];
|
||||
@@ -986,21 +999,21 @@ static inline iCalPersonPartStat _userStateInEvent (NSArray *event)
|
||||
currentDay = [blocks objectAtIndex: offset];
|
||||
}
|
||||
|
||||
computedEventEnd = eventEnd;
|
||||
computedEventEnd = eventEnd;
|
||||
|
||||
// We add 5 mins to the end date of an event if the end date
|
||||
// is equal or smaller than the event's start date.
|
||||
if (eventEnd <= currentStart)
|
||||
// We add 5 mins to the end date of an event if the end date
|
||||
// is equal or smaller than the event's start date.
|
||||
if (eventEnd <= currentStart)
|
||||
computedEventEnd = currentStart + (5*60);
|
||||
|
||||
eventBlock = [self _eventBlockWithStart: currentStart
|
||||
eventBlock = [self _eventBlockWithStart: currentStart
|
||||
end: computedEventEnd
|
||||
number: number
|
||||
onDay: currentDayStart
|
||||
recurrenceTime: recurrenceTime
|
||||
userState: userState];
|
||||
[currentDay addObject: eventBlock];
|
||||
}
|
||||
[currentDay addObject: eventBlock];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1217,7 +1230,7 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
SOGoAppointmentFolder *folder;
|
||||
NSMutableArray *selectedCalendars;
|
||||
NSArray *folders;
|
||||
NSString *fUID;
|
||||
NSString *fUID, *fName;
|
||||
NSNumber *isActive;
|
||||
unsigned int count, foldersCount;
|
||||
|
||||
@@ -1231,7 +1244,11 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
isActive = [NSNumber numberWithBool: [folder isActive]];
|
||||
if ([isActive intValue] != 0) {
|
||||
fUID = [folder nameInContainer];
|
||||
[selectedCalendars addObject: fUID];
|
||||
fName = [folder displayName];
|
||||
[selectedCalendars addObject: [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
fUID, @"id",
|
||||
fName, @"name",
|
||||
nil]];
|
||||
}
|
||||
}
|
||||
return selectedCalendars;
|
||||
@@ -1289,9 +1306,10 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
{
|
||||
int count, max;
|
||||
NSArray *events, *event, *calendars;
|
||||
NSDictionary *eventsBlocks;
|
||||
NSMutableArray *allDayBlocks, *blocks, *currentDay, *eventsByCalendars, *eventsForCalendar;
|
||||
NSDictionary *eventsBlocks, *calendar;
|
||||
NSMutableArray *allDayBlocks, *blocks, *currentDay, *eventsForCalendar, *eventsByCalendars;
|
||||
NSNumber *eventNbr;
|
||||
NSString *calendarName, *calendarId;
|
||||
BOOL isAllDay;
|
||||
int i, j;
|
||||
|
||||
@@ -1301,20 +1319,25 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
|
||||
if ([currentView isEqualToString: @"multicolumndayview"])
|
||||
{
|
||||
calendars = [self _selectedCalendars];
|
||||
calendars = (NSMutableArray *)[self _selectedCalendars];
|
||||
eventsByCalendars = [NSMutableArray arrayWithCapacity:[calendars count]];
|
||||
for (i = 0; i < [calendars count]; i++) // For each calendar
|
||||
{
|
||||
calendar = [calendars objectAtIndex:i];
|
||||
calendarName = [calendar objectForKey: @"name"];
|
||||
calendarId = [calendar objectForKey: @"id"];
|
||||
eventsForCalendar = [NSMutableArray array];
|
||||
[self _prepareEventBlocks: &blocks withAllDays: &allDayBlocks];
|
||||
for (j = 0; j < [events count]; j++) {
|
||||
if ([[[events objectAtIndex:j] objectAtIndex:eventFolderIndex] isEqualToString:[calendars objectAtIndex:i]]) {
|
||||
if ([[[events objectAtIndex:j] objectAtIndex:eventFolderIndex] isEqualToString: calendarId]) {
|
||||
// Event is in current calendar
|
||||
[eventsForCalendar addObject: [events objectAtIndex:j]];
|
||||
}
|
||||
}
|
||||
eventsBlocks = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
eventsFields, @"eventsFields",
|
||||
calendarId , @"id",
|
||||
calendarName, @"calendarName",
|
||||
eventsFields, @"eventsFields",
|
||||
eventsForCalendar, @"events",
|
||||
allDayBlocks, @"allDayBlocks",
|
||||
blocks, @"blocks", nil];
|
||||
@@ -1336,8 +1359,7 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
[currentDay sortUsingSelector: @selector (compareEventByStart:)];
|
||||
[self _addBlocksWidth: currentDay];
|
||||
}
|
||||
|
||||
[eventsByCalendars insertObject:eventsBlocks atIndex:i];
|
||||
[eventsByCalendars addObject: eventsBlocks];
|
||||
}
|
||||
return [self _responseWithData: eventsByCalendars];
|
||||
}
|
||||
@@ -1373,7 +1395,7 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
[currentDay sortUsingSelector: @selector (compareEventByStart:)];
|
||||
[self _addBlocksWidth: currentDay];
|
||||
}
|
||||
return [self _responseWithData: eventsBlocks];
|
||||
return [self _responseWithData: [NSArray arrayWithObject: eventsBlocks]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,11 @@
|
||||
|
||||
@implementation UIxCalMainView
|
||||
|
||||
- (NSString *) modulePath
|
||||
{
|
||||
return @"Calendar";
|
||||
}
|
||||
|
||||
- (void) checkDefaultModulePreference
|
||||
{
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/* UIxCalMonthView.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006-2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
* Copyright (C) 2006-2015 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -69,7 +67,6 @@
|
||||
|
||||
- (void) setCurrentTableDay: (NSCalendarDate *) newCurrentTableDay;
|
||||
- (NSCalendarDate *) currentTableDay;
|
||||
- (NSString *) labelForCurrentDayCell;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/* UIxCalMonthView.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2006, 2007 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
* Copyright (C) 2006-2015 Inverse inc.
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -235,27 +233,6 @@
|
||||
return currentWeek;
|
||||
}
|
||||
|
||||
- (NSString *) labelForCurrentDayCell
|
||||
{
|
||||
NSCalendarDate *lastDayOfMonth;
|
||||
NSString *label, *monthOfYear;
|
||||
int dayOfMonth;
|
||||
|
||||
dayOfMonth = [currentTableDay dayOfMonth];
|
||||
lastDayOfMonth = [currentTableDay lastDayOfMonth];
|
||||
if (dayOfMonth == 1
|
||||
|| [currentTableDay isDateOnSameDay: lastDayOfMonth])
|
||||
{
|
||||
monthOfYear
|
||||
= [monthNames objectAtIndex: [currentTableDay monthOfYear]];
|
||||
label = [NSString stringWithFormat: @"%d %@", dayOfMonth, monthOfYear];
|
||||
}
|
||||
else
|
||||
label = [NSString stringWithFormat: @"%d", dayOfMonth];
|
||||
|
||||
return label;
|
||||
}
|
||||
|
||||
- (NSString *) headerDayCellClasses
|
||||
{
|
||||
unsigned int dayOfWeek;
|
||||
@@ -265,24 +242,19 @@
|
||||
return [NSString stringWithFormat: @"headerDay day%d", dayOfWeek];
|
||||
}
|
||||
|
||||
- (NSString *) dayHeaderNumber
|
||||
- (NSString *) dayHeaderMonth
|
||||
{
|
||||
NSString *nameOfMonth, *dayHeaderNumber;
|
||||
NSString *nameOfMonth = nil;
|
||||
unsigned int dayOfMonth;
|
||||
|
||||
dayOfMonth = [currentTableDay dayOfMonth];
|
||||
if (dayOfMonth == 1
|
||||
|| [currentTableDay isDateOnSameDay: [currentTableDay lastDayOfMonth]])
|
||||
{
|
||||
nameOfMonth
|
||||
= [self localizedNameForMonthOfYear: [currentTableDay monthOfYear]];
|
||||
dayHeaderNumber = [NSString stringWithFormat: @"%d %@", dayOfMonth,
|
||||
nameOfMonth];
|
||||
nameOfMonth = [self localizedNameForMonthOfYear: [currentTableDay monthOfYear]];
|
||||
}
|
||||
else
|
||||
dayHeaderNumber = [NSString stringWithFormat: @"%d", dayOfMonth];
|
||||
|
||||
return dayHeaderNumber;
|
||||
return nameOfMonth;
|
||||
}
|
||||
|
||||
- (NSString *) dayCellClasses
|
||||
@@ -299,7 +271,7 @@
|
||||
|
||||
[classes appendFormat: @"day weekOf%d week%dof%d day%d",
|
||||
numberOfWeeks,
|
||||
[weeksToDisplay indexOfObject: currentWeek],
|
||||
(int)[weeksToDisplay indexOfObject: currentWeek],
|
||||
numberOfWeeks, dayOfWeek];
|
||||
if (realDayOfWeek == 0 || realDayOfWeek == 6)
|
||||
[classes appendString: @" weekEndDay"];
|
||||
|
||||
@@ -49,6 +49,7 @@ static NSArray *layoutItems = nil;
|
||||
- (void) dealloc
|
||||
{
|
||||
[item release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) setItem: (NSString *) newItem
|
||||
@@ -68,7 +69,7 @@ static NSArray *layoutItems = nil;
|
||||
|
||||
- (NSString *) itemPrintLayoutText
|
||||
{
|
||||
return [self labelForKey: [NSString stringWithFormat: item]];
|
||||
return [self labelForKey: [NSString stringWithFormat: @"%@", item]];
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
* @apiParam {Number} includeInFreeBusy 1 if calendar must be include in freebusy
|
||||
* @apiParam {Number} showCalendarAlarms 1 if alarms must be enabled
|
||||
* @apiParam {Number} showCalendarTasks 1 if tasks must be enabled
|
||||
* @apiParam {Number} synchronize 1 if we enable EAS synchronization for this calendar
|
||||
* @apiParam {Number} reloadOnLogin 1 if calendar is a Web calendar that must be reload when user logins
|
||||
* @apiParam {Object} [notifications] Notification (if active user is the calendar's owner)
|
||||
* @apiParam {Number} notifications.notifyOnPersonalModifications 1 if a mail is sent for each modification made by the owner
|
||||
@@ -108,6 +109,10 @@
|
||||
if ([o isKindOfClass: [NSNumber class]])
|
||||
[calendar setShowCalendarTasks: [o boolValue]];
|
||||
|
||||
o = [params objectForKey: @"synchronize"];
|
||||
if ([o isKindOfClass: [NSNumber class]])
|
||||
[calendar setSynchronize: [o boolValue]];
|
||||
|
||||
values = [params objectForKey: @"notifications"];
|
||||
if ([values isKindOfClass: [NSDictionary class]])
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ _intValueFromHex (NSString *hexString)
|
||||
NSNumber *isActive, *fActiveTasks;
|
||||
SOGoAppointmentFolders *co;
|
||||
SOGoAppointmentFolder *folder;
|
||||
BOOL reloadOnLogin;
|
||||
BOOL reloadOnLogin, synchronize;
|
||||
|
||||
if (!calendars)
|
||||
{
|
||||
@@ -133,6 +133,16 @@ _intValueFromHex (NSString *hexString)
|
||||
[calendar setObject: [NSNumber numberWithBool: [folder showCalendarAlarms]] forKey: @"showCalendarAlarms"];
|
||||
[calendar setObject: [NSNumber numberWithBool: [folder showCalendarTasks]] forKey: @"showCalendarTasks"];
|
||||
|
||||
if ([folder isKindOfClass: [SOGoWebAppointmentFolder class]])
|
||||
synchronize = NO;
|
||||
else
|
||||
synchronize = [folder synchronize];
|
||||
|
||||
if ([[folder nameInContainer] isEqualToString: @"personal"])
|
||||
synchronize = YES;
|
||||
|
||||
[calendar setObject: [NSNumber numberWithBool: synchronize] forKey: @"synchronize"];
|
||||
|
||||
if ([folder isWebCalendar])
|
||||
{
|
||||
urls = [NSMutableDictionary dictionaryWithObject: [folder folderPropertyValueInCategory: @"WebCalendars"]
|
||||
|
||||
@@ -896,7 +896,7 @@ static NSArray *reminderValues = nil;
|
||||
content = [NSMutableString string];
|
||||
response = [context response];
|
||||
|
||||
[content appendFormat: [[self clientObject] contentAsString]];
|
||||
[content appendFormat: @"%@", [[self clientObject] contentAsString]];
|
||||
[response setHeader: @"text/plain; charset=utf-8"
|
||||
forKey: @"content-type"];
|
||||
[response appendContentString: content];
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
[shortWeekDaysList retain];
|
||||
}
|
||||
|
||||
id = [NSString stringWithFormat: @"weekDay%i", [shortWeekDaysList indexOfObject: item]];
|
||||
id = [NSString stringWithFormat: @"weekDay%i", (int)[shortWeekDaysList indexOfObject: item]];
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -182,6 +182,10 @@
|
||||
actionClass = "UIxCalFolderActions";
|
||||
actionName = "import";
|
||||
};
|
||||
UIxCalUserRightsEditor = {
|
||||
protectedBy = "ReadAcls";
|
||||
pageName = "UIxCalUserRightsEditor";
|
||||
};
|
||||
userRights = {
|
||||
protectedBy = "ReadAcls";
|
||||
pageName = "UIxCalUserRightsEditor";
|
||||
|
||||
Reference in New Issue
Block a user