Improved Web interface to handle calendars tags
Monotone-Parent: 6eda087f6dba9f0f98b63f259880cf2d343835d5 Monotone-Revision: 54b80d62e3c706aa43398f889ab394e00c6fa08e Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-08-18T01:03:05 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
ee2ebd206d
commit
e7eb160782
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2009-08-18 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalendarProperties.m ([UIxCalendarProperties
|
||||
-allCalendarSyncTags]): new method that returns a concatenated
|
||||
string of all the sync tags of the other calendars.
|
||||
([UIxCalendarProperties -mustSynchronize]): new method that
|
||||
returns true if the calendar must be synchronized, ie if it's the
|
||||
personal calendar.
|
||||
([UIxCalendarProperties -synchronizeCalendar]): new method that
|
||||
returns true if the calendar must be synchronized or is set to be synchronized.
|
||||
|
||||
* SoObjects/Appointments/SOGoAppointmentFolder.m
|
||||
([SOGoAppointmentFolder -_setCalendarProperty:forKey:]): new
|
||||
common method for all methods that need to set a property in the
|
||||
user's settings.
|
||||
|
||||
2009-08-17 Cyril Robert <crobert@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalListingActions.m: Added support for new user default:
|
||||
|
|
|
@ -66,6 +66,9 @@
|
|||
- (NSString *) syncTag;
|
||||
- (void) setSyncTag: (NSString *) newSyncTag;
|
||||
|
||||
- (BOOL) synchronizeCalendar;
|
||||
- (void) setSynchronizeCalendar: (BOOL) new;
|
||||
|
||||
/* selection */
|
||||
|
||||
- (NSArray *) calendarUIDs;
|
||||
|
|
|
@ -279,6 +279,44 @@ static int davCalendarStartTimeLimit = 0;
|
|||
return objectClass;
|
||||
}
|
||||
|
||||
- (void) _setCalendarProperty: (id) theValue
|
||||
forKey: (NSString *) theKey
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
NSMutableDictionary *calendarSettings;
|
||||
NSMutableDictionary *values;
|
||||
|
||||
settings = [[context activeUser] userSettings];
|
||||
calendarSettings = [settings objectForKey: @"Calendar"];
|
||||
if (!calendarSettings)
|
||||
{
|
||||
calendarSettings = [NSMutableDictionary dictionary];
|
||||
[settings setObject: calendarSettings
|
||||
forKey: @"Calendar"];
|
||||
}
|
||||
values = [calendarSettings objectForKey: theKey];
|
||||
if (theValue)
|
||||
{
|
||||
if (!values)
|
||||
{
|
||||
// Create the property dictionary
|
||||
values = [NSMutableDictionary dictionary];
|
||||
[calendarSettings setObject: values forKey: theKey];
|
||||
}
|
||||
[values setObject: theValue forKey: [self folderReference]];
|
||||
}
|
||||
else if (values)
|
||||
{
|
||||
// Remove the property for the calendar
|
||||
[values removeObjectForKey: [self folderReference]];
|
||||
if ([values count] == 0)
|
||||
// Also remove the property dictionary when empty
|
||||
[calendarSettings removeObjectForKey: theKey];
|
||||
}
|
||||
|
||||
[settings synchronize];
|
||||
}
|
||||
|
||||
- (NSString *) calendarColor
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
|
@ -297,26 +335,12 @@ static int davCalendarStartTimeLimit = 0;
|
|||
|
||||
- (void) setCalendarColor: (NSString *) newColor
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
NSMutableDictionary *calendarSettings;
|
||||
NSMutableDictionary *colors;
|
||||
|
||||
settings = [[context activeUser] userSettings];
|
||||
calendarSettings = [settings objectForKey: @"Calendar"];
|
||||
if (!calendarSettings)
|
||||
{
|
||||
calendarSettings = [NSMutableDictionary dictionary];
|
||||
[settings setObject: calendarSettings
|
||||
forKey: @"Calendar"];
|
||||
}
|
||||
colors = [calendarSettings objectForKey: @"FolderColors"];
|
||||
if (!colors)
|
||||
{
|
||||
colors = [NSMutableDictionary dictionary];
|
||||
[calendarSettings setObject: colors forKey: @"FolderColors"];
|
||||
}
|
||||
[colors setObject: newColor forKey: [self folderReference]];
|
||||
[settings synchronize];
|
||||
if ([newColor length])
|
||||
[self _setCalendarProperty: newColor
|
||||
forKey: @"FolderColors"];
|
||||
else
|
||||
[self _setCalendarProperty: nil
|
||||
forKey: @"FolderColors"];
|
||||
}
|
||||
|
||||
- (BOOL) showCalendarAlarms
|
||||
|
@ -338,27 +362,12 @@ static int davCalendarStartTimeLimit = 0;
|
|||
|
||||
- (void) setShowCalendarAlarms: (BOOL) new
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
NSMutableDictionary *calendarSettings;
|
||||
NSMutableDictionary *values;
|
||||
|
||||
settings = [[context activeUser] userSettings];
|
||||
calendarSettings = [settings objectForKey: @"Calendar"];
|
||||
|
||||
if (!calendarSettings)
|
||||
{
|
||||
calendarSettings = [NSMutableDictionary dictionary];
|
||||
[settings setObject: calendarSettings
|
||||
forKey: @"Calendar"];
|
||||
}
|
||||
values = [calendarSettings objectForKey: @"FolderShowAlarms"];
|
||||
if (!values)
|
||||
{
|
||||
values = [NSMutableDictionary dictionary];
|
||||
[calendarSettings setObject: values forKey: @"FolderShowAlarms"];
|
||||
}
|
||||
[values setObject: [NSNumber numberWithBool: new] forKey: [self folderReference]];
|
||||
[settings synchronize];
|
||||
if (new)
|
||||
[self _setCalendarProperty: nil
|
||||
forKey: @"FolderShowAlarms"];
|
||||
else
|
||||
[self _setCalendarProperty: [NSNumber numberWithBool: new]
|
||||
forKey: @"FolderShowAlarms"];
|
||||
}
|
||||
|
||||
- (BOOL) showCalendarTasks
|
||||
|
@ -380,31 +389,14 @@ static int davCalendarStartTimeLimit = 0;
|
|||
|
||||
- (void) setShowCalendarTasks: (BOOL) new
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
NSMutableDictionary *calendarSettings;
|
||||
NSMutableDictionary *values;
|
||||
|
||||
settings = [[context activeUser] userSettings];
|
||||
calendarSettings = [settings objectForKey: @"Calendar"];
|
||||
|
||||
if (!calendarSettings)
|
||||
{
|
||||
calendarSettings = [NSMutableDictionary dictionary];
|
||||
[settings setObject: calendarSettings
|
||||
forKey: @"Calendar"];
|
||||
}
|
||||
values = [calendarSettings objectForKey: @"FolderShowTasks"];
|
||||
if (!values)
|
||||
{
|
||||
values = [NSMutableDictionary dictionary];
|
||||
[calendarSettings setObject: values forKey: @"FolderShowTasks"];
|
||||
}
|
||||
[values setObject: [NSNumber numberWithBool: new] forKey: [self folderReference]];
|
||||
[settings synchronize];
|
||||
if (new)
|
||||
[self _setCalendarProperty: nil
|
||||
forKey: @"FolderShowTasks"];
|
||||
else
|
||||
[self _setCalendarProperty: [NSNumber numberWithBool: new]
|
||||
forKey: @"FolderShowTasks"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (NSString *) syncTag
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
|
@ -421,29 +413,73 @@ static int davCalendarStartTimeLimit = 0;
|
|||
return syncTag;
|
||||
}
|
||||
|
||||
#warning this code shares a lot with the colour code
|
||||
- (void) setSyncTag: (NSString *) newSyncTag
|
||||
{
|
||||
if ([newSyncTag length])
|
||||
{
|
||||
// Check for duplicated tags
|
||||
NSUserDefaults *settings;
|
||||
NSMutableDictionary *calendarSettings;
|
||||
NSMutableDictionary *syncTags;
|
||||
NSEnumerator *keysList;
|
||||
NSString *key;
|
||||
BOOL hasDuplicate;
|
||||
|
||||
hasDuplicate = NO;
|
||||
settings = [[context activeUser] userSettings];
|
||||
calendarSettings = [settings objectForKey: @"Calendar"];
|
||||
if (!calendarSettings)
|
||||
if (calendarSettings)
|
||||
{
|
||||
calendarSettings = [NSMutableDictionary dictionary];
|
||||
[settings setObject: calendarSettings
|
||||
forKey: @"Calendar"];
|
||||
}
|
||||
syncTags = [calendarSettings objectForKey: @"FolderSyncTags"];
|
||||
if (!syncTags)
|
||||
if (syncTags)
|
||||
{
|
||||
syncTags = [NSMutableDictionary dictionary];
|
||||
[calendarSettings setObject: syncTags forKey: @"FolderSyncTags"];
|
||||
keysList = [syncTags keyEnumerator];
|
||||
while ((key = (NSString*)[keysList nextObject])) {
|
||||
if (![key isEqualToString: [self folderReference]]
|
||||
&& [(NSString*)[syncTags objectForKey: key] isEqualToString: newSyncTag])
|
||||
{
|
||||
hasDuplicate = YES;
|
||||
break;
|
||||
}
|
||||
[syncTags setObject: newSyncTag forKey: [self folderReference]];
|
||||
[settings synchronize];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasDuplicate)
|
||||
[self _setCalendarProperty: newSyncTag
|
||||
forKey: @"FolderSyncTags"];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self _setCalendarProperty: nil
|
||||
forKey: @"FolderSyncTags"];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) synchronizeCalendar
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
NSDictionary *values;
|
||||
id test;
|
||||
BOOL synchronize = NO;
|
||||
|
||||
settings = [[context activeUser] userSettings];
|
||||
values = [[settings objectForKey: @"Calendar"]
|
||||
objectForKey: @"FolderSynchronize"];
|
||||
test = [values objectForKey: [self folderReference]];
|
||||
if (test)
|
||||
synchronize = [test boolValue];
|
||||
|
||||
return synchronize;
|
||||
}
|
||||
|
||||
- (void) setSynchronizeCalendar: (BOOL) new
|
||||
{
|
||||
if (new)
|
||||
[self _setCalendarProperty: [NSNumber numberWithBool: new]
|
||||
forKey: @"FolderSynchronize"];
|
||||
else
|
||||
[self _setCalendarProperty: nil
|
||||
forKey: @"FolderSynchronize"];
|
||||
}
|
||||
|
||||
/* logging */
|
||||
|
|
|
@ -546,7 +546,7 @@
|
|||
oldEvent = (iCalEvent*)[self newOccurenceWithID: recurrenceTime];
|
||||
}
|
||||
|
||||
if ([[[oldEvent parent] firstChildWithTag: @"vevent"] userIsOrganizer: ownerUser])
|
||||
if ([[[oldEvent parent] firstChildWithTag: [self componentTag]] userIsOrganizer: ownerUser])
|
||||
{
|
||||
// The owner is the organizer of the event; handle the modifications
|
||||
|
||||
|
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Tarefa Confidencial)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Nome:";
|
||||
"Color:" = "Cor:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Marca:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Tarefa Confidencial)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Důvěrný úkol)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Název:";
|
||||
"Color:" = "Barva:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Štítek:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Důvěrný úkol)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Vertrouwelijke taak)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Naam:";
|
||||
"Color:" = "Kleur:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Markering:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Vertrouwelijke taak)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Confidential task)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Name:";
|
||||
"Color:" = "Color:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Tag:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Confidential task)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Tâche confidentielle)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Nom :";
|
||||
"Color:" = "Couleur :";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Label :";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Afficher les alarmes";
|
||||
"Show tasks" = "Afficher les tâches";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Tâche confidentielle)";
|
|||
"yearFieldInvalid" = "Veuillez spécifier un chiffre superieur ou égal à 1 dans le champ Année(s).";
|
||||
"appointmentFieldInvalid" = "Veuillez spécifier un chiffre superieur ou égal à 1 dans le champ rendez-vous.";
|
||||
"recurrenceUnsupported" = "Ce type de récurrence n\\'est pas supporté.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Vertrauliche Aufgabe)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Name:";
|
||||
"Color:" = "Farbe:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Tag:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Vertrauliche Aufgabe)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Bizalmas feladat)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Név:";
|
||||
"Color:" = "Szín:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Cimke:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Bizalmas feladat)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Attività confidenziale)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Nome:";
|
||||
"Color:" = "Colore:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Etichetta:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Attività confidenziale)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -25,6 +25,7 @@
|
|||
"Thursday" = "Четверг";
|
||||
"Friday" = "Пятница";
|
||||
"Saturday" = "Суббота";
|
||||
"DayOfTheMonth" = "DayOfTheMonth";
|
||||
|
||||
"Sun" = "Вск";
|
||||
"Mon" = "Пон";
|
||||
|
@ -120,6 +121,7 @@
|
|||
"Forbidden" = "Запрешено";
|
||||
|
||||
/* acls */
|
||||
|
||||
"Default Roles" = "Роли по умолчанию";
|
||||
"User rights for:" = "Права пользователя для:";
|
||||
|
||||
|
@ -390,6 +392,7 @@
|
|||
"reminder_AFTER" = "после";
|
||||
"reminder_START" = "начала события";
|
||||
"reminder_END" = "конца события";
|
||||
"Reminder Details" = "Reminder Details";
|
||||
|
||||
"zoom_400" = "400%";
|
||||
"zoom_200" = "200%";
|
||||
|
@ -497,8 +500,12 @@ vtodo_class2 = "(Confidential task)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Название:";
|
||||
"Color:" = "Цвет:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Tag:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -510,3 +517,7 @@ vtodo_class2 = "(Confidential task)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Tarea confidencial)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Nombre:";
|
||||
"Color:" = "Color:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Redacción:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Tarea confidencial)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to reload the data on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to reload the data on your mobile device.\nContinue?";
|
|
@ -20,7 +20,7 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "SOGoUI/UIxComponent.h"
|
||||
#import <SOGoUI/UIxComponent.h>
|
||||
|
||||
@class NSString;
|
||||
|
||||
|
@ -42,5 +42,13 @@
|
|||
- (BOOL) showCalendarAlarms;
|
||||
- (void) setShowCalendarAlarms: (BOOL) new;
|
||||
|
||||
- (BOOL) synchronizeCalendar;
|
||||
- (void) setSynchronizeCalendar: (BOOL) new;
|
||||
|
||||
- (NSString *) originalCalendarSyncTag;
|
||||
- (NSString *) allCalendarSyncTags;
|
||||
- (BOOL) mustSynchronize;
|
||||
- (NSString *) calendarSyncTag;
|
||||
- (void) setCalendarSyncTag: (NSString *) newTag;
|
||||
|
||||
@end
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
|
||||
|
@ -78,6 +81,59 @@
|
|||
[calendar setCalendarColor: newColor];
|
||||
}
|
||||
|
||||
- (BOOL) synchronizeCalendar
|
||||
{
|
||||
return [self mustSynchronize] || [calendar synchronizeCalendar];
|
||||
}
|
||||
|
||||
- (void) setSynchronizeCalendar: (BOOL) new
|
||||
{
|
||||
[calendar setSynchronizeCalendar: new];
|
||||
}
|
||||
|
||||
- (NSString *) originalCalendarSyncTag
|
||||
{
|
||||
return [calendar syncTag];
|
||||
}
|
||||
|
||||
- (NSString *) allCalendarSyncTags
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
NSMutableDictionary *calendarSettings;
|
||||
NSMutableDictionary *syncTags;
|
||||
NSEnumerator *keysList;
|
||||
NSMutableArray *tags;
|
||||
NSString *key, *result;
|
||||
|
||||
settings = [[context activeUser] userSettings];
|
||||
calendarSettings = [settings objectForKey: @"Calendar"];
|
||||
if (calendarSettings)
|
||||
{
|
||||
syncTags = [calendarSettings objectForKey: @"FolderSyncTags"];
|
||||
if (syncTags)
|
||||
{
|
||||
tags = [NSMutableArray arrayWithCapacity: [syncTags count]];
|
||||
keysList = [syncTags keyEnumerator];
|
||||
while ((key = (NSString*)[keysList nextObject])) {
|
||||
if (![key isEqualToString: [calendar folderReference]])
|
||||
[tags addObject: [syncTags objectForKey: key]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!tags)
|
||||
result = @"";
|
||||
else
|
||||
result = [tags componentsJoinedByString: @","];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (BOOL) mustSynchronize
|
||||
{
|
||||
return [[calendar nameInContainer] isEqualToString: @"personal"];
|
||||
}
|
||||
|
||||
- (NSString *) calendarSyncTag
|
||||
{
|
||||
return [calendar syncTag];
|
||||
|
|
|
@ -500,8 +500,12 @@ vtodo_class2 = "(Tasg gyhoeddus)";
|
|||
/* Properties dialog */
|
||||
"Name:" = "Enw:";
|
||||
"Color:" = "Lliw:";
|
||||
|
||||
"Synchronization" = "Synchronization";
|
||||
"Synchronize" = "Synchronize";
|
||||
"Tag:" = "Tag:";
|
||||
|
||||
"Display" = "Display";
|
||||
"Show alarms" = "Show alarms";
|
||||
"Show tasks" = "Show tasks";
|
||||
|
||||
|
@ -513,3 +517,7 @@ vtodo_class2 = "(Tasg gyhoeddus)";
|
|||
"yearFieldInvalid" = "Please specify a numerical value in the Year(s) field greater or equal to 1.";
|
||||
"appointmentFieldInvalid" = "Please specify a numerical value in the Appointment(s) field greater or equal to 1.";
|
||||
"recurrenceUnsupported" = "This type of recurrence is currently unsupported.";
|
||||
"tagNotDefined" = "You must specify a tag if you want to synchronize this calendar.";
|
||||
"tagAlreadyExists" = "The tag you specified is already associated to another calendar.";
|
||||
"tagHasChanged" = "If you change your calendar's tag, you'll need to perform a slow sync on your mobile device.\nContinue?";
|
||||
"tagWasRemoved" = "If you remove this calendar from synchronization, you'll need to perform a slow sync on your mobile device.\nContinue?";
|
|
@ -14,6 +14,8 @@
|
|||
<input type="hidden" const:name="calendarID" const:id="calendarID"
|
||||
var:value="calendarID"/>
|
||||
<div id="propertiesView">
|
||||
<fieldset>
|
||||
<legend><var:string label:value="Properties" /></legend>
|
||||
<div><span class="label"><var:string label:value="Name:"/></span
|
||||
><span class="content"><input type="text"
|
||||
name="calendarName" id="calendarName"
|
||||
|
@ -30,13 +32,34 @@
|
|||
id="calendarColor"
|
||||
var:value="calendarColor"
|
||||
/></span></div>
|
||||
<div><span class="label"><var:string
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><var:string label:value="Synchronization" /></legend>
|
||||
<div><span class="label"><var:string label:value="Synchronize" /></span
|
||||
><span class="content"><input type="checkbox" const:class="checkBox"
|
||||
name="synchronizeCalendar"
|
||||
id="synchronizeCalendar"
|
||||
var:checked="synchronizeCalendar"
|
||||
var:disabled="mustSynchronize" /></span
|
||||
></div>
|
||||
<var:if condition="mustSynchronize" const:negate="YES"><div><span class="label"><var:string
|
||||
label:value="Tag:"/></span><span class="content"><input type="text"
|
||||
name="calendarSyncTag"
|
||||
id="calendarSyncTag"
|
||||
class="textField"
|
||||
var:value="calendarSyncTag"
|
||||
/></span></div>
|
||||
/><var:if condition="synchronizeCalendar"><input type="hidden"
|
||||
name="originalCalendarSyncTag"
|
||||
id="originalCalendarSyncTag"
|
||||
var:value="originalCalendarSyncTag"
|
||||
/></var:if><input type="hidden"
|
||||
name="allCalendarSyncTags"
|
||||
id="allCalendarSyncTags"
|
||||
var:value="allCalendarSyncTags"
|
||||
/></span></div></var:if>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><var:string label:value="Display" /></legend>
|
||||
<div><span class="label"><var:string label:value="Show alarms" /></span
|
||||
><span class="content"><input type="checkbox" const:class="checkBox"
|
||||
id="showCalendarAlarms" var:checked="showCalendarAlarms" /></span
|
||||
|
@ -45,6 +68,7 @@
|
|||
><span class="content"><input type="checkbox" const:class="checkBox"
|
||||
id="showCalendarTasks" var:checked="showCalendarTasks" /></span
|
||||
></div>
|
||||
</fieldset>
|
||||
<div id="buttons">
|
||||
<input type="button"
|
||||
const:class="button"
|
||||
|
|
|
@ -1822,8 +1822,12 @@ function onCalendarModify(event) {
|
|||
var calendarID = selected.getAttribute("id");
|
||||
var url = ApplicationBaseURL + calendarID + "/properties";
|
||||
var windowID = sanitizeWindowName(calendarID + " properties");
|
||||
if (calendarID == "/personal")
|
||||
var properties = window.open(url, windowID,
|
||||
"width=300,height=150,resizable=0");
|
||||
"width=310,height=250,resizable=0");
|
||||
else
|
||||
var properties = window.open(url, windowID,
|
||||
"width=310,height=270,resizable=0");
|
||||
properties.focus();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
DIV#propertiesView
|
||||
{ overflow: hidden;
|
||||
padding: 5px 5px 0 0; }
|
||||
padding: 5px 5px 0 5px; }
|
||||
|
||||
DIV
|
||||
{ clear: both; }
|
||||
|
||||
FIELDSET
|
||||
{ margin-bottom: 5px; }
|
||||
|
||||
SPAN.label
|
||||
{ cursor: default;
|
||||
width: 10em;
|
||||
|
@ -16,13 +19,9 @@ SPAN.label
|
|||
|
||||
SPAN.content
|
||||
{ display: block;
|
||||
height: 2em;
|
||||
line-height: 1.5em;
|
||||
vertical-align: middle; }
|
||||
|
||||
SPAN.content INPUT
|
||||
{ margin-top: 0; }
|
||||
|
||||
BUTTON#colorButton
|
||||
{ display: none;
|
||||
margin: 1px 0 0 1px;
|
||||
|
|
|
@ -21,10 +21,39 @@ function onOKClick(event) {
|
|||
var calendarName = $("calendarName");
|
||||
var calendarColor = $("calendarColor");
|
||||
var calendarID = $("calendarID");
|
||||
var save = true;
|
||||
var tag = $("calendarSyncTag").value;
|
||||
var originalTag = $("originalCalendarSyncTag");
|
||||
var allTags = $("allCalendarSyncTags");
|
||||
|
||||
if (allTags)
|
||||
allTags = allTags.value.split(",");
|
||||
|
||||
if ($("synchronizeCalendar").checked) {
|
||||
if (tag.blank()) {
|
||||
alert(labels["tagNotDefined"]);
|
||||
save = false;
|
||||
}
|
||||
else if (allTags
|
||||
&& allTags.indexOf(tag) > -1) {
|
||||
alert(labels["tagAlreadyExists"]);
|
||||
save = false;
|
||||
}
|
||||
else if (originalTag
|
||||
&& !originalTag.value.blank()
|
||||
&& tag != originalTag.value)
|
||||
save = confirm(labels["tagHasChanged"]);
|
||||
}
|
||||
else if (originalTag
|
||||
&& !originalTag.value.blank())
|
||||
save = confirm(labels["tagWasRemoved"]);
|
||||
|
||||
if (save)
|
||||
window.opener.updateCalendarProperties(calendarID.value,
|
||||
calendarName.value,
|
||||
calendarColor.value);
|
||||
else
|
||||
Event.stop(event);
|
||||
}
|
||||
|
||||
function onColorClick(event) {
|
||||
|
|
Loading…
Reference in New Issue