+2007-11-08 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * 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 <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoGCSFolder.m ([-compare:otherFolder]): method
+++ /dev/null
-"Personal Calendar" = "Personal Calendar";
+++ /dev/null
-"Personal Calendar" = "Agenda personnel";
Appointments_PRINCIPAL_CLASS = SOGoAppointmentsProduct
-Appointments_LANGUAGES = English French German
-
-Appointments_LOCALIZED_RESOURCE_FILES=Localizable.strings
-
Appointments_OBJC_FILES = \
Product.m \
NSArray+Appointments.m \
+++ /dev/null
-"Personal Calendar" = "Personal Calendar";
#import <SOGo/SOGoCustomGroupFolder.h>
#import <SOGo/LDAPUserManager.h>
#import <SOGo/SOGoPermissions.h>
+#import <SOGo/NSArray+Utilities.h>
#import <SOGo/NSString+Utilities.h>
#import <SOGo/SOGoUser.h>
}
/* 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
+++ /dev/null
-"Personal Address Book" = "Personal Address Book";
+++ /dev/null
-"Personal Address Book" = "Carnet d'adresses personnel";
+++ /dev/null
-"Personal Calendar" = "Personal Calendar";
else
values = [NSMutableDictionary new];
}
+ else
+ values = [NSMutableDictionary new];
ASSIGN (lastFetch, [NSCalendarDate date]);
defFlags.modified = NO;
#import <GDLAccess/EOAdaptorChannel.h>
#import "SOGoGCSFolder.h"
+#import "SOGoPermissions.h"
#import "SOGoUser.h"
#import "SOGoParentFolder.h"
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)
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
"invalidemailwarn" = "invalidemailwarn";
"new" = "new";
+/* Folders */
+"Personal Address Book" = "Personal Address Book";
+
/* Tooltips */
"Create a new address book card" = "Create a new address book card";
"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";
"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";
- (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
"Reload Remote Calendars" = "Reload Remote Calendars";
"Properties" = "Properties";
+/* Folders */
+"Personal calendar" = "Personal calendar";
+
/* Misc */
"OpenGroupware.org" = "OpenGroupware.org";
"Reload Remote Calendars" = "Recharger les agendas distants";
"Properties" = "Propriétés";
+/* Folders */
+"Personal calendar" = "Agenda personnel";
+
/* Misc */
"OpenGroupware.org" = "OpenGroupware.org";
"this year" = "dieses Jahr";
-
/* Menu */
"Calendars" = "Kalenderliste";
"Reload Remote Calendars" = "Externe Kalender neu laden";
"Properties" = "Einstellungen";
+/* Folders */
+"Personal calendar" = "Personal calendar";
+
/* Misc */
"OpenGroupware.org" = "OpenGroupware.org";
- (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++)
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"];
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");
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;
}