]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1250 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 8 Nov 2007 17:26:28 +0000 (17:26 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 8 Nov 2007 17:26:28 +0000 (17:26 +0000)
21 files changed:
ChangeLog
SoObjects/Appointments/English.lproj/Localizable.strings [deleted file]
SoObjects/Appointments/French.lproj/Localizable.strings [deleted file]
SoObjects/Appointments/GNUmakefile
SoObjects/Appointments/German.lproj/Localizable.strings [deleted file]
SoObjects/Appointments/SOGoAppointmentFolder.m
SoObjects/Contacts/English.lproj/Localizable.strings [deleted file]
SoObjects/Contacts/French.lproj/Localizable.strings [deleted file]
SoObjects/Contacts/German.lproj/Localizable.strings [deleted file]
SoObjects/SOGo/AgenorUserDefaults.m
SoObjects/SOGo/SOGoParentFolder.m
UI/Contacts/English.lproj/Localizable.strings
UI/Contacts/French.lproj/Localizable.strings
UI/Contacts/German.lproj/Localizable.strings
UI/Contacts/UIxContactsListViewContainer.m
UI/Scheduler/English.lproj/Localizable.strings
UI/Scheduler/French.lproj/Localizable.strings
UI/Scheduler/German.lproj/Localizable.strings
UI/Scheduler/UIxCalendarSelector.m
UI/WebServerResources/MailerUI.js
UI/WebServerResources/SchedulerUI.js

index 392b9c753b29d4c7bb942f6ca52fd514907ab614..6fed7866f9356541d6c1c15272cb0a0d8d5e97d9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+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
diff --git a/SoObjects/Appointments/English.lproj/Localizable.strings b/SoObjects/Appointments/English.lproj/Localizable.strings
deleted file mode 100644 (file)
index 95feda9..0000000
+++ /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 (file)
index 11b333c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-"Personal Calendar" = "Agenda personnel";
index a6c0006df45c134e49a0f5d23eb6e59752cb4012..99a7b16590e8521b44b5e9e8fd7dca8860263f22 100644 (file)
@@ -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 (file)
index 95feda9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-"Personal Calendar" = "Personal Calendar";
index 395d92e804911f2aedfe7a2f9c6c8e37c5580020..cd1a553f5ad9cd9ab955d78471be9432ef69157f 100644 (file)
@@ -48,6 +48,7 @@
 #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>
 
@@ -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 (file)
index 56404b0..0000000
+++ /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 (file)
index af4d87c..0000000
+++ /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 (file)
index 95feda9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-"Personal Calendar" = "Personal Calendar";
index 5c7db08dc9d8f42b72048f266a30c472fc653829..e5b541ea5b2bbe2baf836aced0317878257a4f0a 100644 (file)
@@ -163,6 +163,8 @@ static NSString *uidColumnName = @"c_uid";
              else
                values = [NSMutableDictionary new];
            }
+         else
+           values = [NSMutableDictionary new];
 
          ASSIGN (lastFetch, [NSCalendarDate date]);
          defFlags.modified = NO;
index a06e39c9cf21a9d849a18f878bc873a5805fb4fd..c73ed9f12afff0b0ef20dc9fb45d05757f256b20 100644 (file)
@@ -32,6 +32,7 @@
 #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
index 08044be83fdcb247817977ae3db01e08171c2b8a..f1dbba2eabac6cad289a45758e1326b730452a09 100644 (file)
@@ -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";
index 5bf201634767757e710a4e7b6b3c45c51d476370..cb2df47d536d9f460e8f8506bbad4af5d346ae5a 100644 (file)
@@ -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";
index 6d27d4e40af4e29dc2962af10359c14b5002b3e2..b220e74f215b85e5a27d29b89cb4bd5287675344 100644 (file)
@@ -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";
index f472b156056c068673fa2433903154285fe3378c..23c2a5eb5748b0b42c894998a61be6538dfbd575 100644 (file)
 
 - (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
index 0324d2af2f362037ba50f3213503f9c59df79eb5..dbc48efc5fcacc56b1bd3ffad908b5a150ddd7b6 100644 (file)
@@ -87,6 +87,9 @@
 "Reload Remote Calendars" = "Reload Remote Calendars";
 "Properties" = "Properties";
 
+/* Folders */
+"Personal calendar" = "Personal calendar";
+
 /* Misc */
 
 "OpenGroupware.org" = "OpenGroupware.org";
index 7acc16cadc51593239e9689bc043567f6184cb5e..f04263bb28d5917dcb0c0515ba75236bb71f8668 100644 (file)
@@ -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";
index ff8d2f003150583fdd940fede150a46b9859b6bb..da5f595b226fda8e5ffe31676f55b4cf156c22df 100644 (file)
@@ -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";
index 7fad6b0f3c9549ff360dbc193e9db6399e56f459..e60fb6e134e4daa13e1291efa74e63ea3bf76e7d 100644 (file)
@@ -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"];
index cc844680598a626f11ca09890333e740b2f9743e..450b5f2a4e4ff7380e076b693467f3a7b2c0b580 100644 (file)
@@ -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");
index 337d6f45c25b53387b9a82b82e6833f0b2cbb195..c2937c049c9a2d73af76633238d9503eac9659c8 100644 (file)
@@ -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;
 }