From: wolfgang Date: Thu, 8 Nov 2007 17:26:28 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1250 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b7fdb0c8d0f35632e14ca1210bbc9d4f5057ea0;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1250 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index 392b9c75..6fed7866 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2007-11-08 Wolfgang Sourdeau + + * UI/Scheduler/UIxCalendarSelector.m ([UIxCalendarSelector + -calendars]): same as below. + + * UI/Contacts/UIxContactsListViewContainer.m + ([UIxContactsListViewContainer -currentContactFolderName]): + translate the display name if its the default one. + + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder -create]): overriden method that invokes + its ancestor and then activate itself within the user settings. + + * SoObjects/SOGo/SOGoParentFolder.m ([SOGoParentFolder + -appendPersonalSources]): when the user is the owner of the + current folder, we create the "personal" folder if it doesn't + exist by invoking "create". + + * SoObjects/SOGo/AgenorUserDefaults.m ([AgenorUserDefaults + -primaryFetchProfile]): when no row is returned, we initialize + "values" to a new dictionary. This solves a bug where the defaults + would not be initialized properly. + 2007-11-07 Wolfgang Sourdeau * SoObjects/SOGo/SOGoGCSFolder.m ([-compare:otherFolder]): method diff --git a/SoObjects/Appointments/English.lproj/Localizable.strings b/SoObjects/Appointments/English.lproj/Localizable.strings deleted file mode 100644 index 95feda9f..00000000 --- a/SoObjects/Appointments/English.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ -"Personal Calendar" = "Personal Calendar"; diff --git a/SoObjects/Appointments/French.lproj/Localizable.strings b/SoObjects/Appointments/French.lproj/Localizable.strings deleted file mode 100644 index 11b333c2..00000000 --- a/SoObjects/Appointments/French.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ -"Personal Calendar" = "Agenda personnel"; diff --git a/SoObjects/Appointments/GNUmakefile b/SoObjects/Appointments/GNUmakefile index a6c0006d..99a7b165 100644 --- a/SoObjects/Appointments/GNUmakefile +++ b/SoObjects/Appointments/GNUmakefile @@ -6,10 +6,6 @@ WOBUNDLE_NAME = Appointments Appointments_PRINCIPAL_CLASS = SOGoAppointmentsProduct -Appointments_LANGUAGES = English French German - -Appointments_LOCALIZED_RESOURCE_FILES=Localizable.strings - Appointments_OBJC_FILES = \ Product.m \ NSArray+Appointments.m \ diff --git a/SoObjects/Appointments/German.lproj/Localizable.strings b/SoObjects/Appointments/German.lproj/Localizable.strings deleted file mode 100644 index 95feda9f..00000000 --- a/SoObjects/Appointments/German.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ -"Personal Calendar" = "Personal Calendar"; diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 395d92e8..cd1a553f 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -48,6 +48,7 @@ #import #import #import +#import #import #import @@ -962,6 +963,40 @@ static NSNumber *sharedYes = nil; } /* folder management */ +- (BOOL) create +{ + BOOL rc; + NSMutableArray *folderSubscription; + NSUserDefaults *userSettings; + NSMutableDictionary *calendarSettings; + SOGoUser *ownerUser; + + rc = [super create]; + if (rc) + { + ownerUser = [SOGoUser userWithLogin: [self ownerInContext: context] + roles: nil]; + userSettings = [ownerUser userSettings]; + calendarSettings = [userSettings objectForKey: @"Calendar"]; + if (!calendarSettings) + { + calendarSettings = [NSMutableDictionary dictionary]; + [userSettings setObject: calendarSettings forKey: @"Calendar"]; + } + folderSubscription + = [calendarSettings objectForKey: @"ActiveFolders"]; + if (!folderSubscription) + { + folderSubscription = [NSMutableArray array]; + [calendarSettings setObject: folderSubscription + forKey: @"ActiveFolders"]; + } + [folderSubscription addObjectUniquely: nameInContainer]; + [userSettings synchronize]; + } + + return rc; +} - (id) lookupHomeFolderForUID: (NSString *) _uid inContext: (id)_ctx diff --git a/SoObjects/Contacts/English.lproj/Localizable.strings b/SoObjects/Contacts/English.lproj/Localizable.strings deleted file mode 100644 index 56404b01..00000000 --- a/SoObjects/Contacts/English.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ -"Personal Address Book" = "Personal Address Book"; diff --git a/SoObjects/Contacts/French.lproj/Localizable.strings b/SoObjects/Contacts/French.lproj/Localizable.strings deleted file mode 100644 index af4d87c3..00000000 --- a/SoObjects/Contacts/French.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ -"Personal Address Book" = "Carnet d'adresses personnel"; diff --git a/SoObjects/Contacts/German.lproj/Localizable.strings b/SoObjects/Contacts/German.lproj/Localizable.strings deleted file mode 100644 index 95feda9f..00000000 --- a/SoObjects/Contacts/German.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ -"Personal Calendar" = "Personal Calendar"; diff --git a/SoObjects/SOGo/AgenorUserDefaults.m b/SoObjects/SOGo/AgenorUserDefaults.m index 5c7db08d..e5b541ea 100644 --- a/SoObjects/SOGo/AgenorUserDefaults.m +++ b/SoObjects/SOGo/AgenorUserDefaults.m @@ -163,6 +163,8 @@ static NSString *uidColumnName = @"c_uid"; else values = [NSMutableDictionary new]; } + else + values = [NSMutableDictionary new]; ASSIGN (lastFetch, [NSCalendarDate date]); defFlags.modified = NO; diff --git a/SoObjects/SOGo/SOGoParentFolder.m b/SoObjects/SOGo/SOGoParentFolder.m index a06e39c9..c73ed9f1 100644 --- a/SoObjects/SOGo/SOGoParentFolder.m +++ b/SoObjects/SOGo/SOGoParentFolder.m @@ -32,6 +32,7 @@ #import #import "SOGoGCSFolder.h" +#import "SOGoPermissions.h" #import "SOGoUser.h" #import "SOGoParentFolder.h" @@ -81,13 +82,30 @@ return @"Personal"; } +- (void) _createPersonalFolder +{ + NSArray *roles; + SOGoGCSFolder *folder; + + roles = [[context activeUser] rolesForObject: self inContext: context]; + if ([roles containsObject: SoRole_Owner]) + { + folder = [subFolderClass objectWithName: @"personal" inContainer: self]; + [folder setDisplayName: [self defaultFolderName]]; + [folder + setOCSPath: [NSString stringWithFormat: @"%@/personal", OCSPath]]; + if ([folder create]) + [subFolders setObject: folder forKey: @"personal"]; + } +} + - (void) _fetchPersonalFolders: (NSString *) sql withChannel: (EOAdaptorChannel *) fc { NSArray *attrs; NSDictionary *row; - SOGoGCSFolder *folder; BOOL hasPersonal; + SOGoGCSFolder *folder; NSString *key; if (!subFolderClass) @@ -111,17 +129,8 @@ row = [fc fetchAttributes: attrs withZone: NULL]; } -// if (!hasPersonal) -// { -// folder = [subFolderClass objectWithName: @"personal" inContainer: self]; -// personalName = [self labelForKey: [self defaultFolderName]]; -// [folder setDisplayName: personalName]; -// path = [NSString stringWithFormat: @"/Users/%@/%@/personal", -// [self ownerInContext: context], -// nameInContainer]; -// [folder setOCSPath: path]; -// [subFolders setObject: folder forKey: @"personal"]; -// } + if (!hasPersonal) + [self _createPersonalFolder]; } - (void) appendPersonalSources diff --git a/UI/Contacts/English.lproj/Localizable.strings b/UI/Contacts/English.lproj/Localizable.strings index 08044be8..f1dbba2e 100644 --- a/UI/Contacts/English.lproj/Localizable.strings +++ b/UI/Contacts/English.lproj/Localizable.strings @@ -32,6 +32,9 @@ "invalidemailwarn" = "invalidemailwarn"; "new" = "new"; +/* Folders */ +"Personal Address Book" = "Personal Address Book"; + /* Tooltips */ "Create a new address book card" = "Create a new address book card"; diff --git a/UI/Contacts/French.lproj/Localizable.strings b/UI/Contacts/French.lproj/Localizable.strings index 5bf20163..cb2df47d 100644 --- a/UI/Contacts/French.lproj/Localizable.strings +++ b/UI/Contacts/French.lproj/Localizable.strings @@ -39,6 +39,9 @@ "invalidemailwarn" = "Champ de l'email invalide, continuer quand même ?"; "new" = "Nouveau"; +/* Folders */ +"Personal Address Book" = "Carnet d'adresses personnel"; + /* Tooltips */ "Create a new address book card" = "Créer une nouvelle fiche"; diff --git a/UI/Contacts/German.lproj/Localizable.strings b/UI/Contacts/German.lproj/Localizable.strings index 6d27d4e4..b220e74f 100644 --- a/UI/Contacts/German.lproj/Localizable.strings +++ b/UI/Contacts/German.lproj/Localizable.strings @@ -39,6 +39,9 @@ "invalidemailwarn" = "Champ de l'email invalide, continuer quand même ?"; "new" = "Neu"; +/* Folders */ +"Personal Address Book" = "Personal Address Book"; + "htmlMailFormat_UNKNOWN" = "Unbekannt"; "htmlMailFormat_FALSE" = "Reintext"; "htmlMailFormat_TRUE" = "HTML"; diff --git a/UI/Contacts/UIxContactsListViewContainer.m b/UI/Contacts/UIxContactsListViewContainer.m index f472b156..23c2a5eb 100644 --- a/UI/Contacts/UIxContactsListViewContainer.m +++ b/UI/Contacts/UIxContactsListViewContainer.m @@ -95,7 +95,14 @@ - (NSString *) currentContactFolderName { - return [currentFolder displayName]; + NSString *folderName, *defaultFolderName; + + folderName = [currentFolder displayName]; + defaultFolderName = [[currentFolder container] defaultFolderName]; + if ([folderName isEqualToString: folderName]) + folderName = [self labelForKey: folderName]; + + return folderName; } - (NSString *) currentContactFolderOwner diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 0324d2af..dbc48efc 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -87,6 +87,9 @@ "Reload Remote Calendars" = "Reload Remote Calendars"; "Properties" = "Properties"; +/* Folders */ +"Personal calendar" = "Personal calendar"; + /* Misc */ "OpenGroupware.org" = "OpenGroupware.org"; diff --git a/UI/Scheduler/French.lproj/Localizable.strings b/UI/Scheduler/French.lproj/Localizable.strings index 7acc16ca..f04263bb 100644 --- a/UI/Scheduler/French.lproj/Localizable.strings +++ b/UI/Scheduler/French.lproj/Localizable.strings @@ -88,6 +88,9 @@ "Reload Remote Calendars" = "Recharger les agendas distants"; "Properties" = "Propriétés"; +/* Folders */ +"Personal calendar" = "Agenda personnel"; + /* Misc */ "OpenGroupware.org" = "OpenGroupware.org"; diff --git a/UI/Scheduler/German.lproj/Localizable.strings b/UI/Scheduler/German.lproj/Localizable.strings index ff8d2f00..da5f595b 100644 --- a/UI/Scheduler/German.lproj/Localizable.strings +++ b/UI/Scheduler/German.lproj/Localizable.strings @@ -62,7 +62,6 @@ "this year" = "dieses Jahr"; - /* Menu */ "Calendars" = "Kalenderliste"; @@ -77,6 +76,9 @@ "Reload Remote Calendars" = "Externe Kalender neu laden"; "Properties" = "Einstellungen"; +/* Folders */ +"Personal calendar" = "Personal calendar"; + /* Misc */ "OpenGroupware.org" = "OpenGroupware.org"; diff --git a/UI/Scheduler/UIxCalendarSelector.m b/UI/Scheduler/UIxCalendarSelector.m index 7fad6b0f..e60fb6e1 100644 --- a/UI/Scheduler/UIxCalendarSelector.m +++ b/UI/Scheduler/UIxCalendarSelector.m @@ -103,15 +103,17 @@ colorForNumber (unsigned int number) - (NSArray *) calendars { NSArray *folders; + SOGoAppointmentFolders *co; SOGoAppointmentFolder *folder; NSMutableDictionary *calendar; unsigned int count, max; - NSString *folderName; + NSString *folderName, *fDisplayName; NSNumber *isActive; if (!calendars) { - folders = [[self clientObject] subFolders]; + co = [self clientObject]; + folders = [co subFolders]; max = [folders count]; calendars = [[NSMutableArray alloc] initWithCapacity: max]; for (count = 0; count < max; count++) @@ -119,11 +121,12 @@ colorForNumber (unsigned int number) folder = [folders objectAtIndex: count]; calendar = [NSMutableDictionary dictionary]; folderName = [folder nameInContainer]; - [calendar setObject: - [NSString stringWithFormat: @"/%@", folderName] + fDisplayName = [folder displayName]; + if ([fDisplayName isEqualToString: [co defaultFolderName]]) + fDisplayName = [self labelForKey: fDisplayName]; + [calendar setObject: [NSString stringWithFormat: @"/%@", folderName] forKey: @"id"]; - [calendar setObject: [folder displayName] - forKey: @"displayName"]; + [calendar setObject: fDisplayName forKey: @"displayName"]; [calendar setObject: folderName forKey: @"folder"]; [calendar setObject: colorForNumber (count) forKey: @"color"]; diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index cc844680..450b5f2a 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -57,8 +57,8 @@ function toggleMailSelect(sender) { function openAddressbook(sender) { var urlstr; - - urlstr = ApplicationBaseURL + "/../Contacts/?popup=YES"; + + urlstr = ApplicationBaseURL + "../Contacts/?popup=YES"; var w = window.open(urlstr, "Addressbook", "width=640,height=400,resizable=1,scrollbars=1,toolbar=0," + "location=no,directories=0,status=0,menubar=0,copyhistory=0"); diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 337d6f45..c2937c04 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -537,16 +537,14 @@ function scrollDayView(scrollEvent) { if (scrollEvent && scrollEvent.siblings) { var classes = scrollEvent.siblings[0].getAttribute("class").split(" "); - for (var i = 0; i < classes.length; i++) { + for (var i = 0; i < classes.length; i++) if (classes[i].startsWith("starts")) { var starts = Math.floor(parseInt(classes[i].substr(6)) / 4); offset = hours[starts].offsetTop; } - } } - else { + else offset = hours[8].offsetTop; - } daysView.scrollTop = offset - 5; }