]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1279 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 27 Nov 2007 22:12:04 +0000 (22:12 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Tue, 27 Nov 2007 22:12:04 +0000 (22:12 +0000)
29 files changed:
ChangeLog
SOPE/GDLContentStore/ChangeLog
SOPE/GDLContentStore/GCSFolder.m
SoObjects/Appointments/SOGoFreeBusyObject.m
SoObjects/Mailer/SOGoMailFolder.m
SoObjects/Mailer/product.plist
SoObjects/SOGo/SOGoContentObject.m
SoObjects/SOGo/SOGoGCSFolder.m
SoObjects/SOGo/SOGoPermissions.m
UI/Common/UIxFolderActions.m
UI/Common/product.plist
UI/Contacts/UIxContactFoldersView.m
UI/Contacts/UIxContactsUserRightsEditor.m
UI/MailerUI/UIxMailUserRightsEditor.m
UI/MainUI/SOGoUserHomePage.m
UI/MainUI/product.plist
UI/Scheduler/English.lproj/Localizable.strings
UI/Scheduler/French.lproj/Localizable.strings
UI/Scheduler/UIxAppointmentEditor.m
UI/Templates/ContactsUI/UIxContactsUserRightsEditor.wox
UI/Templates/SchedulerUI/UIxAppointmentEditor.wox
UI/WebServerResources/ContactsUI.js
UI/WebServerResources/HTMLElement.js
UI/WebServerResources/SOGoRootPage.js
UI/WebServerResources/SchedulerUI.js
UI/WebServerResources/UIxAppointmentEditor.js
UI/WebServerResources/UIxContactsUserFolders.js
UI/WebServerResources/UIxMailEditor.js
UI/WebServerResources/skycalendar.html

index d5e0e74d9b9bd6a630ba00d1d6555fa3cd461b78..ac7004ae9bc5137663dcb2717fa05ba543dc75f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2007-11-27  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject
+       -aclsForUser:uid]): copy all the roles from the container. If the
+       object is new, make sure the roles contain "ObjectEditor" if and
+       only if "ObjectCreator" is present.
+
+       * SoObjects/SOGo/SOGoGCSFolder.m ([SOGoGCSFolder
+       -aclsForUser:uid]): no longer take the "ObjectReader" role into
+       account.
+
+       * UI/Common/UIxFolderActions.m ([UIxFolderActions
+       -canAccessContentAction]): always return HTTP status 204. We want
+       this because we are relying on the SOPE access control manager to
+       grant access to this method. This requires a fine-tuned access
+       control in SOGo itself...
+
+       * UI/Contacts/UIxContactsUserRightsEditor.m ([-userCanReadObjects])
+       ([-setUserCanReadObjects:userCanReadObjects]): removed methods.
+
+       * UI/MailerUI/UIxMailUserRightsEditor.m ([UIxMailUserRightsEditor
+       -updateRights]): no longer take the "ObjectReader" role into account.
+       ([-userCanReadMails], [-setUserCanReadMails:userCanReadMails]):
+       removed methods.
+
+       * SoObjects/Appointments/SOGoFreeBusyObject.m ([SOGoFreeBusyObject
+       -fetchFreeBusyInfosFrom:_startDateto:_endDate]): specify context
+       when looking up the Calendar folder.
+
 2007-11-26  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * UI/Scheduler/UIxTaskEditor.m ([UIxTaskEditor -todo]): same as below.
index a76a21ab2a723a59cc2784105df751d0b63e5c0a..058a7edb5a55e17c9058ef8a1411e9e0b15495bb 100644 (file)
@@ -1,3 +1,9 @@
+2007-11-27  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * GCSFolder.m ([GCSFolder -versionOfContentWithName:], [GCSFolder
+       -fetchContentWithName:]): ignore records marked as deleted.
+       ([GCSFolder -deletionOfContentWithName:]): don't.
+
 2007-11-04  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * GCSFolder.m ([GCSFolder -writeContent:toName:baseVersion:]): the
index ac0495fd0a500752b7781342ae3c685b8b7c70d3..e6ec63c7ce2ffe17d4753a5f245af2b9f3f20cb1 100644 (file)
@@ -251,13 +251,16 @@ static GCSStringFormatter *stringFormatter = nil;
                               recursive:YES];
 }
 
-- (id)_fetchValueOfColumn:(NSString *)_col inContentWithName:(NSString *)_name{
+- (id) _fetchValueOfColumn: (NSString *)_col
+        inContentWithName: (NSString *)_name
+            ignoreDeleted: (BOOL) ignoreDeleted
+{
   EOAdaptorChannel *channel;
   NSException  *error;
   NSDictionary *row;
   NSArray      *attrs;
   NSString     *result;
-  NSString     *sql;
+  NSMutableString     *sql;
   
   if ((channel = [self acquireStoreChannel]) == nil) {
     [self errorWithFormat:@"could not open storage channel!"];
@@ -265,20 +268,18 @@ static GCSStringFormatter *stringFormatter = nil;
   }
   
   /* generate SQL */
-  
-  sql = @"SELECT ";
-  sql = [sql stringByAppendingString:_col];
-  sql = [sql stringByAppendingString:@" FROM "];
-  sql = [sql stringByAppendingString:[self storeTableName]];
-  sql = [sql stringByAppendingString:@" WHERE c_name = '"];
-  sql = [sql stringByAppendingString:_name];
-  sql = [sql stringByAppendingString:@"'"];
-  
+  sql = [NSMutableString stringWithFormat: @"SELECT %@"
+                        @" FROM %@"
+                        @" WHERE c_name = '%@'",
+                        _col, [self storeTableName], _name];
+  if (ignoreDeleted)
+    [sql appendString: @" AND (c_deleted != 1 OR c_deleted IS NULL)"];
+
   /* run SQL */
   
   if ((error = [channel evaluateExpressionX:sql]) != nil) {
     [self errorWithFormat:@"%s: cannot execute SQL '%@': %@", 
-           __PRETTY_FUNCTION__, sql, error];
+         __PRETTY_FUNCTION__, sql, error];
     [self releaseChannel:channel];
     return nil;
   }
@@ -300,15 +301,18 @@ static GCSStringFormatter *stringFormatter = nil;
 }
 
 - (NSNumber *)versionOfContentWithName:(NSString *)_name {
-  return [self _fetchValueOfColumn:@"c_version" inContentWithName:_name];
+  return [self _fetchValueOfColumn:@"c_version" inContentWithName:_name
+              ignoreDeleted: YES];
 }
 
 - (NSNumber *)deletionOfContentWithName:(NSString *)_name {
-  return [self _fetchValueOfColumn:@"c_deleted" inContentWithName:_name];
+  return [self _fetchValueOfColumn:@"c_deleted" inContentWithName:_name
+              ignoreDeleted: NO];
 }
 
 - (NSString *)fetchContentWithName:(NSString *)_name {
-  return [self _fetchValueOfColumn:@"c_content" inContentWithName:_name];
+  return [self _fetchValueOfColumn:@"c_content" inContentWithName:_name
+              ignoreDeleted: YES];
 }
 
 - (NSDictionary *)fetchContentsOfAllFiles {
index 80390a733c7920c3be9158e576d02141f1a5d525..4aa053f358287c10af18e10634612955778dd4ab 100644 (file)
@@ -80,8 +80,8 @@
 //   SoSecurityManager *sm;
   NSArray *infos;
 
-  calFolder = [[container lookupName: @"Calendar" inContext: nil acquire: NO]
-               lookupName: @"personal" inContext: nil acquire: NO];
+  calFolder = [[container lookupName: @"Calendar" inContext: context acquire: NO]
+               lookupName: @"personal" inContext: context acquire: NO];
 //   sm = [SoSecurityManager sharedSecurityManager];
 //   if (![sm validatePermission: SOGoPerm_FreeBusyLookup
 //            onObject: calFolder
index 96be316136f8cf82b2adce845b5dcd705ea8fb3a..a0cff9ecfc6e7ac34e2ca1d3b89668d79a6ddf9a 100644 (file)
@@ -454,10 +454,8 @@ static NSString *defaultUserID =  @"anyone";
       switch ([imapAcls characterAtIndex: count])
        {
        case 'l':
-         [SOGoAcls addObjectUniquely: SOGoRole_ObjectViewer];
-         break;
        case 'r':
-         [SOGoAcls addObjectUniquely: SOGoRole_ObjectReader];
+         [SOGoAcls addObjectUniquely: SOGoRole_ObjectViewer];
          break;
        case 's':
          [SOGoAcls addObjectUniquely: SOGoMailRole_SeenKeeper];
@@ -505,9 +503,10 @@ static NSString *defaultUserID =  @"anyone";
   while (currentAcl)
     {
       if ([currentAcl isEqualToString: SOGoRole_ObjectViewer])
-       character = 'l';
-      else if ([currentAcl isEqualToString: SOGoRole_ObjectReader])
-       character = 'r';
+       {
+         [imapAcls appendFormat: @"lr"];
+         character = 0;
+       }
       else if ([currentAcl isEqualToString: SOGoMailRole_SeenKeeper])
        character = 's';
       else if ([currentAcl isEqualToString: SOGoMailRole_Writer])
index 2a93d2b7acd6564278e2e42e0ce4d8864db88247..238a6229457eabf6973f9aa8c73f025386e6702c 100644 (file)
@@ -42,7 +42,7 @@
       superclass    = "SOGoMailBaseObject";
       defaultRoles = {
         "View" = ( "Owner", "ObjectViewer" );
-        "Access Contents Information" = ( "Owner", "ObjectReader" );
+        "Access Contents Information" = ( "Owner", "ObjectViewer" );
         "Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
         "Delete Objects" = ( "Owner", "ObjectEraser" );
         "WebDAV Access" = ( "Owner", "ObjectViewer" );
index e45b458f7b5d5ed12ae4ae89ca704da3ba1955c2..1e1d0f795b08d464f2ae5404fd9bbbcd7ca49a92 100644 (file)
   containerAcls = [container aclsForUser: uid];
   if ([containerAcls count] > 0)
     {
-      if ([containerAcls containsObject: SOGoRole_ObjectCreator])
+      [acls addObjectsFromArray: containerAcls];
+      if (isNew)
        {
-         [acls addObject: SOGoRole_ObjectCreator];
-         if (isNew)
+         if ([containerAcls containsObject: SOGoRole_ObjectCreator])
            [acls addObject: SOGoRole_ObjectEditor];
+         else
+           [acls removeObject: SOGoRole_ObjectEditor];
        }
-      if ([containerAcls containsObject: SOGoRole_ObjectReader])
-       [acls addObject: SOGoRole_ObjectViewer];
-      if ([containerAcls containsObject: SOGoRole_ObjectEditor])
-       [acls addObject: SOGoRole_ObjectEditor];
     }
 
   return acls;
index 728d3c3034cd6c1b0a793e3d4166e9f424406cbf..8eb59067e35fb4cf70314125707afcc5759ce487 100644 (file)
@@ -596,8 +596,6 @@ static NSString *defaultUserID = @"<default>";
       containerAcls = [container aclsForUser: uid];
       if ([containerAcls count] > 0)
        {
-         if ([containerAcls containsObject: SOGoRole_ObjectReader])
-           [acls addObject: SOGoRole_ObjectViewer];
 #warning this should be checked
          if ([containerAcls containsObject: SOGoRole_ObjectEraser])
            [acls addObject: SOGoRole_ObjectEraser];
index 0e9769151561461f8472a443cc82c8f665d243c6..d6c25f3a9835e790f18e85a9375c790af11bd22f 100644 (file)
@@ -26,7 +26,6 @@
 NSString *SOGoRole_ObjectCreator = @"ObjectCreator";
 NSString *SOGoRole_ObjectEraser = @"ObjectEraser";
 NSString *SOGoRole_ObjectViewer = @"ObjectViewer";
-NSString *SOGoRole_ObjectReader = @"ObjectReader";
 NSString *SOGoRole_ObjectEditor = @"ObjectEditor";
 
 NSString *SOGoRole_FolderCreator = @"FolderCreator";
index 44d21f6d3633eb9d62aec1ba0d53dd173032c635..d8c65968537ccfc75044a9e1a2b132b54b0abcae 100644 (file)
 
 - (WOResponse *) canAccessContentAction
 {
-#warning IMPROVEMENTS REQUIRED!
-  NSArray *acls;
-//  NSEnumerator *userAcls;
-//  NSString *currentAcl;
+  /* We want this action to be authorized managed by the SOPE's internal acl
+     handling. */
+  return [self responseWith204];
+// #warning IMPROVEMENTS REQUIRED!
+//   NSArray *acls;
+// //  NSEnumerator *userAcls;
+// //  NSString *currentAcl;
 
-  [self _setupContext];
+//   [self _setupContext];
   
-//  NSLog(@"canAccessContentAction %@, owner %@", subscriptionPointer, owner);
-
-  if ([login isEqualToString: owner] || [owner isEqualToString: @"nobody"]) {
-    return [self responseWith204];
-  }
-  else {
-    acls = [clientObject aclsForUser: login];
-//    userAcls = [acls objectEnumerator];
-//    currentAcl = [userAcls nextObject];
-//    while (currentAcl) {
-//      NSLog(@"ACL login %@, owner %@, folder %@: %@",
-//         login, owner, baseFolder, currentAcl);
-//      currentAcl = [userAcls nextObject];
-//    }
-    if (([[clientObject folderType] isEqualToString: @"Contact"]     && [acls containsObject: SOGoRole_ObjectReader]) ||
-       ([[clientObject folderType] isEqualToString: @"Appointment"] && [acls containsObject: SOGoRole_AuthorizedSubscriber])) {
-      return [self responseWith204];
-    }
-  }
+// //  NSLog(@"canAccessContentAction %@, owner %@", subscriptionPointer, owner);
+
+//   if ([login isEqualToString: owner] || [owner isEqualToString: @"nobody"]) {
+//     return [self responseWith204];
+//   }
+//   else {
+//     acls = [clientObject aclsForUser: login];
+// //    userAcls = [acls objectEnumerator];
+// //    currentAcl = [userAcls nextObject];
+// //    while (currentAcl) {
+// //      NSLog(@"ACL login %@, owner %@, folder %@: %@",
+// //      login, owner, baseFolder, currentAcl);
+// //      currentAcl = [userAcls nextObject];
+// //    }
+//     if (([[clientObject folderType] isEqualToString: @"Contact"]
+//      && [acls containsObject: SOGoRole_ObjectViewer]) ||
+//     ([[clientObject folderType] isEqualToString: @"Appointment"]
+//      && [acls containsObject: SOGoRole_AuthorizedSubscriber])) {
+//       return [self responseWith204];
+//     }
+//   }
   
-  return [self responseWithStatus: 403];
+//   return [self responseWithStatus: 403];
 }
 
 - (WOResponse *) _realFolderActivation: (BOOL) makeActive
index ea75a393faeb24b21e6f5367d55cdb5ae5afe785..16cf11bf6f8f70ab3186c7f175fab9e1ce05ac10 100644 (file)
@@ -84,7 +84,7 @@
          actionName = "unsubscribe";
        };
        canAccessContent = {
-         protectedBy = "<public>";
+         protectedBy = "Access Object";
          actionClass = "UIxFolderActions";
          actionName = "canAccessContent";
        };
index a4f7b1a44a298ad553c93ceccf4500ea7ec10dda..9d1f87a1af219ea529f7549565a7fa1f6ee26fe4 100644 (file)
   [folders autorelease];
 
   subfolders = [[parentFolder subFolders] objectEnumerator];
-  currentFolder = [subfolders nextObject];
-  while (currentFolder)
+  while ((currentFolder = [subfolders nextObject]))
     {
       if (![securityManager validatePermission: SOGoPerm_AccessObject
                            onObject: currentFolder inContext: context])
                             forKey: @"type"];
          [folders addObject: currentDictionary];
        }
-      currentFolder = [subfolders nextObject];
     }
 
   return folders;
index 65cb1d11824d3e0f48fce758f31e0501aa3f5f41..a6d43ee01d7ee1c4c4033d43cf0e7bc5210b813f 100644 (file)
   return [userRights containsObject: SOGoRole_ObjectViewer];
 }
 
-- (void) setUserCanReadObjects: (BOOL) userCanReadObjects
-{
-  if (userCanReadObjects)
-    [self appendRight: SOGoRole_ObjectReader];
-  else
-    [self removeRight: SOGoRole_ObjectReader];
-}
-
-- (BOOL) userCanReadObjects
-{
-  return [userRights containsObject: SOGoRole_ObjectReader];
-}
-
 - (void) updateRights
 {
   WORequest *request;
   else
     [self removeRight: SOGoRole_ObjectViewer];
 
-  if ([[request formValueForKey: @"ObjectReader"] length] > 0)
-    [self appendRight: SOGoRole_ObjectReader];
-  else
-    [self removeRight: SOGoRole_ObjectReader];
-
   if ([[request formValueForKey: @"ObjectEraser"] length] > 0)
     [self appendRight: SOGoRole_ObjectEraser];
   else
index 08942a3efb0139a8ba00af9dfb507775db628c2f..c9d3853cbc65bd46ff5aa3e00ebdf79a8981e965 100644 (file)
   return [userRights containsObject: SOGoRole_ObjectViewer];
 }
 
-- (void) setUserCanReadMails: (BOOL) userCanReadMails
-{
-  if (userCanReadMails)
-    [self appendRight: SOGoRole_ObjectReader];
-  else
-    [self removeRight: SOGoRole_ObjectReader];
-}
-
-- (BOOL) userCanReadMails
-{
-  return [userRights containsObject: SOGoRole_ObjectReader];
-}
-
 - (void) setUserCanMarkMailsRead: (BOOL) userCanMarkMailsRead
 {
   if (userCanMarkMailsRead)
   else
     [self removeRight: SOGoRole_ObjectViewer];
 
-  if ([[request formValueForKey: SOGoRole_ObjectReader] length] > 0)
-    [self appendRight: SOGoRole_ObjectReader];
-  else
-    [self removeRight: SOGoRole_ObjectReader];
-
   if ([[request formValueForKey: SOGoMailRole_SeenKeeper] length] > 0)
     [self appendRight: SOGoMailRole_SeenKeeper];
   else
index 8134af2c0bfd1ecaa58b68676093b07fbc21170c..c5f56913e65c4d972f55f696afad2897a4c85bf5 100644 (file)
@@ -95,8 +95,7 @@ static NSString *defaultModule = nil;
   NSNumber *status;
   NSCalendarDate *currentDate;
   
-  record = [records nextObject];
-  while (record)
+  while ((record = [records nextObject]))
     {
       status = [record objectForKey: @"c_status"];
  
@@ -117,8 +116,6 @@ static NSString *defaultModule = nil;
 
       for (count = startInterval; count < endInterval; count++)
         [items replaceObjectAtIndex: count withObject: status];
-
-      record = [records nextObject];
     }
 }
  
index 3eb0a70d5465ca029b05e15bcddb610f178f9e1c..05ffd14643394918967f8544260731335b84d775 100644 (file)
       defaultRoles = {
        "View" = ( "Owner", "ObjectViewer" );
        "Change Images And Files"  = ( "Owner", "ObjectEditor" );
-       "Access Contents Information" = ( "Owner", "ObjectReader" );
+       "Access Object" = ( "Owner", "ObjectViewer", "ObjectEditor", "ObjectCreator", "ObjectEraser" );
+       "Access Contents Information" = ( "Owner", "ObjectViewer" );
         "Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
        "Add Folders" = ( "Owner", "FolderCreator" );
         "ReadAcls" = ( "Owner" );
         "SaveAcls" = ( "Owner" );
         "Delete Objects" = ( "Owner", "ObjectEraser" );
+        "WebDAV Access" = ( "Owner", "ObjectViewer", "ObjectEditor", "ObjectCreator", "ObjectEraser" );
       };
     };
     SOGoContentObject = {
       superclass = "SOGoObject";
+      defaultAccess = "Access Contents Information";
       protectedBy = "Access Object";
       defaultRoles = {
-       "Access Object" = ( "Owner", "ObjectViewer" );
-       "Access Contents Information" = ( "Owner", "ObjectViewer" );
-       "Change Images And Files"  = ( "Owner", "ObjectEditor" );
+       "Access Contents Information" = ( "Owner", "ObjectViewer", "ObjectEditor" );
+       "Change Images And Files" = ( "Owner", "ObjectEditor" );
+      };
+      methods = {
+        DELETE = { 
+          protectedBy = "Delete Objects";
+        };
+       GET = {
+          protectedBy = "Access Contents Information";
+       };
+       PUT = {
+         protectedBy = "Change Images And Files";
+       };
       };
     };
+
     SOGoFolder = {
       superclass = "SOGoObject";
       protectedBy = "Access Object";
       defaultRoles = {
        "Change Images And Files"  = ( "Owner", "ObjectEditor" );
-        "WebDAV Access" = ( "Owner", "AuthorizedSubscriber" );
-       "Access Object" = ( "Owner", "ObjectViewer" );
-       "Access Contents Information" = ( "Owner", "ObjectViewer" );
+       "View" = ( "Owner", "ObjectViewer", "ObjectEditor" );
+       "Access Contents Information" = ( "Owner", "ObjectViewer", "ObjectEditor" );
       };
     };
     SOGoParentFolder = {
index aa8e4c08a49c24ba4f4ca5ba31badaf344c9d54d..494b6d747e101b4f2c6529c7dfb2e7269470800f 100644 (file)
 validate_notitle           = "No title is set, continue?";
 validate_invalid_startdate = "Incorrect startdate field!";
 validate_invalid_enddate   = "Incorrect enddate field!";
-validate_endbeforestart    = "Enddate is before startdate!";
+validate_endbeforestart    = "The end date that you enteterd occurs before the start date.";
 
 "Tasks" = "Tasks";
 "Show completed tasks" = "Show completed tasks";
index d0f002d0fb958670b7af1c7e4523c86f4e6d2967..1688824d978b236020b397a2be882aafc8d83366 100644 (file)
 validate_notitle           = "Le titre n'est pas rempli. Continuer quand-même ?";
 validate_invalid_startdate = "La date de début est invalide !";
 validate_invalid_enddate   = "La date de fin est invalide !";
-validate_endbeforestart    = "La date de fin est avant la date de début !";
+validate_endbeforestart    = "La date de fin est avant la date de début.";
 
 "Tasks" = "Tâches";
 "Show completed tasks" = "Afficher les tâches accomplies";
index 44887adb34dc0ec8c2995adb3712876426a31273..911b2404a99507947097f50aea60683f4b4b63e8 100644 (file)
   iCalRecurrenceRule *rule;
 
   [self event];
-  if (event)
-    {
-      startDate = [event startDate];
-      isAllDay = [event isAllDay];
-      if (isAllDay)
-       endDate = [[event endDate] dateByAddingYears: 0 months: 0 days: -1];
-      else
-       endDate = [event endDate];
-    }
-  else
+  if ([[self clientObject] isNew])
     {
       startDate = [self newStartDate];
       duration = [self queryParameterForKey:@"dur"];
        = [startDate dateByAddingYears: 0 months: 0 days: 0
                     hours: 0 minutes: minutes seconds: 0];
     }
+  else
+    {
+      startDate = [event startDate];
+      isAllDay = [event isAllDay];
+      if (isAllDay)
+       endDate = [[event endDate] dateByAddingYears: 0 months: 0 days: -1];
+      else
+       endDate = [event endDate];
+    }
 
   ASSIGN (aptStartDate, startDate);
   ASSIGN (aptEndDate, endDate);
index 620cfd20a83b2e2f9df0c4d684f6e551c2e25d96..5ed6a6b194f00259e980b40c5228f262ac0c759f 100644 (file)
          var:checked="userCanCreateObjects"/><var:string
          label:value="This person can add cards to this addressbook."/></label>
       <br/>
-      <label><input type="checkbox" class="checkBox"
-         const:name="ObjectEditor"
-         var:checked="userCanEditObjects"/><var:string
-         label:value="This person can edit the cards of this addressbook."/></label>
-      <br/>
       <label><input type="checkbox" class="checkBox"
          const:name="ObjectViewer"
          var:checked="userCanViewObjects"/><var:string
-         label:value="This person can list the content of this addressbook."/></label>
+         label:value="This person can read the cards of this addressbook."/></label>
       <br/>
       <label><input type="checkbox" class="checkBox"
-         const:name="ObjectReader"
-         var:checked="userCanReadObjects"/><var:string
-         label:value="This person can read the cards of this addressbook."/></label>
+         const:name="ObjectEditor"
+         var:checked="userCanEditObjects"/><var:string
+         label:value="This person can edit the cards of this addressbook."/></label>
       <br/>
       <label><input type="checkbox" class="checkBox"
          const:name="ObjectEraser"
index 533f88b0a6cf831ccf23d4d9355973bd8f12d18a..909b253a4588672ef0474105ab15b6be5ca02244 100644 (file)
@@ -10,6 +10,7 @@
   className="UIxComponentEditor"
   var:component="event"
   var:saveURL="saveURL">
+
   <label><span id="allDay" class="content"><input class="checkBox"
         type="checkbox" var:selection="isAllDay"
         var:checked="isAllDay"
index 293a983020d26572c2529cb109bf48ca73b789a1..8b449799ce4ffa3e12c4fc62555f7369f027a3f8 100644 (file)
@@ -74,45 +74,45 @@ function openContactsFolderAtIndex(element) {
 }
 
 function contactsListCallback(http) {
-  if (http.readyState == 4
-      && http.status == 200) {
-    document.contactsListAjaxRequest = null;
-
-    var table = $("contactsList");
-    if (table) {
-      // Update table
-      var data = http.responseText;
-      var html = data.replace(/^(.*\n)*.*(<table(.*\n)*)$/, "$2");
-      var tbody = table.tBodies[0]; 
-      var tmp = document.createElement('div');
-      $(tmp).update(html);
-      table.replaceChild(tmp.firstChild.tBodies[0], tbody);
-    }
-    else {
-      // Add table (doesn't happen .. yet)
-      var div = $("contactsListContent");
-      div.update(http.responseText);
-      table = $("contactsList");
-      configureSortableTableHeaders(table);
-      TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true});
-    }
+  if (http.readyState == 4) {
+    if (http.status == 200) {
+      document.contactsListAjaxRequest = null;
+
+      var table = $("contactsList");
+      if (table) {
+       // Update table
+       var data = http.responseText;
+       var html = data.replace(/^(.*\n)*.*(<table(.*\n)*)$/, "$2");
+       var tbody = table.tBodies[0]; 
+       var tmp = document.createElement('div');
+       $(tmp).update(html);
+       table.replaceChild(tmp.firstChild.tBodies[0], tbody);
+      }
+      else {
+       // Add table (doesn't happen .. yet)
+       var div = $("contactsListContent");
+       div.update(http.responseText);
+       table = $("contactsList");
+       configureSortableTableHeaders(table);
+       TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true});
+      }
     
-    if (sorting["attribute"] && sorting["attribute"].length > 0) {
-       var sortHeader;
-       if (sorting["attribute"] == "displayName")
+      if (sorting["attribute"] && sorting["attribute"].length > 0) {
+       var sortHeader;
+       if (sorting["attribute"] == "displayName")
          sortHeader = $("nameHeader");
-       else if (sorting["attribute"] == "mail")
+       else if (sorting["attribute"] == "mail")
          sortHeader = $("mailHeader");
-       else if (sorting["attribute"] == "screenName")
+       else if (sorting["attribute"] == "screenName")
          sortHeader = $("screenNameHeader");
-       else if (sorting["attribute"] == "org")
+       else if (sorting["attribute"] == "org")
          sortHeader = $("orgHeader");
-       else if (sorting["attribute"] == "phone")
+       else if (sorting["attribute"] == "phone")
          sortHeader = $("phoneHeader");
-       else
+       else
          sortHeader = null;
        
-       if (sortHeader) {
+       if (sortHeader) {
          var sortImages = $(table.tHead).getElementsByClassName("sortImage");
          $(sortImages).each(function(item) {
              item.remove();
@@ -121,19 +121,33 @@ function contactsListCallback(http) {
          var sortImage = createElement("img", "messageSortImage", "sortImage");
          sortHeader.insertBefore(sortImage, sortHeader.firstChild);
          if (sorting["ascending"])
-            sortImage.src = ResourcesURL + "/title_sortdown_12x12.png";
+           sortImage.src = ResourcesURL + "/title_sortdown_12x12.png";
          else
-            sortImage.src = ResourcesURL + "/title_sortup_12x12.png";
-       }
-    }
+           sortImage.src = ResourcesURL + "/title_sortup_12x12.png";
+       }
+      }
 
-    var selected = http.callbackData;
-    if (selected) {
-       for (var i = 0; i < selected.length; i++) {
+      var selected = http.callbackData;
+      if (selected) {
+       for (var i = 0; i < selected.length; i++) {
          var row = $(selected[i]);
          if (row)
-            row.select();
-       }
+           row.select();
+       }
+      }
+    }
+    else {
+      var table = $("contactsList");
+      if (table) {
+       var sortImages = $(table.tHead).getElementsByClassName("sortImage");
+       $(sortImages).each(function(item) {
+           item.remove();
+         });
+       var tBody = $(table.tBodies[0]);
+       var length = tBody.rows.length;
+       for (var i = length - 1; i > -1; i--)
+         tBody.removeChild(tBody.rows[i]);
+      }
     }
   }
   else
index 40414457281a9f554fb3962418c491d942411a18..744510e583ffd502920c7580deb2c215323f2ef6 100644 (file)
@@ -201,11 +201,11 @@ Element.addMethods({
 
   setCaretTo: function(element, pos) { 
     element = $(element);
-    if (element.selectionStart) { // For Mozilla and Safari
+    if (element.selectionStart) {        // For Mozilla and Safari
       element.focus(); 
       element.setSelectionRange(pos, pos); 
     }
-    else if (element.createTextRange) {       // For IE
+    else if (element.createTextRange) {  // For IE
       var range = element.createTextRange(); 
       range.move("character", pos); 
       range.select();
index 7201ce050f9b8233dc3f3aaf99a319347563f48c..d59076ffe056fdde12483c7ac190371f01bdf22e 100644 (file)
@@ -34,8 +34,31 @@ function onLoginClick(event) {
 
 function onLoginCallback(http) {
   if (http.readyState == 4) {
-    if (isHttpStatus204(http.status))
-      window.location.href = ApplicationBaseURL + $("userName").value;
+    if (isHttpStatus204(http.status)) {
+      var userName = $("userName").value;
+      var address = "" + window.location.href;
+      var baseAddress = ApplicationBaseURL + $("userName").value;
+      var altBaseAddress;
+      if (baseAddress[0] == "/") {
+       var parts = address.split("/");
+       var hostpart = parts[2];
+       var protocol = parts[0];
+       baseAddress = protocol + "//" + hostpart + baseAddress;
+      }
+      var altBaseAddress;
+      var parts = baseAddress.split("/");
+      parts.splice(3, 0);
+      altBaseAddress = parts.join("/");
+
+      var newAddress;
+      if ((address.startsWith(baseAddress)
+          || address.startsWith(altBaseAddress))
+         && !address.endsWith("/logoff"))
+       newAddress = address;
+      else
+       newAddress = baseAddress;
+      window.location.href = newAddress;
+    }
   }
 }
 
index 32ea684afbbadd260c88a731fa105860a5e44a95..79be003e6dafc8d7d70431dcb23f5ce2cc777b94 100644 (file)
@@ -24,16 +24,13 @@ var usersRightsWindowHeight = 250;
 var usersRightsWindowWidth = 502;
 
 function newEvent(sender, type) {
-   var day = sender.day;
+   var day = sender.readAttribute("day");
    if (!day)
       day = currentDay;
-
-   var hour = sender.hour;
-   if (!hour)
-      hour = sender.getAttribute("hour");
+   var hour = sender.readAttribute("hour");
    var folder = getSelectedFolder();
-   var folderID = folder.getAttribute("id");
-   var roles = folder.getAttribute("roles");
+   var folderID = folder.readAttribute("id");
+   var roles = folder.readAttribute("roles");
    if (roles) {
      roles = roles.split(",")
        if ($(roles).indexOf("PublicModifier") < 0)
@@ -47,7 +44,6 @@ function newEvent(sender, type) {
       params.push("hm=" + hour);
    if (params.length > 0)
       urlstr += "?" + params.join("&");
-   
    window.open(urlstr, "", "width=490,height=470,resizable=0");
    
    return false; /* stop following the link */
@@ -905,7 +901,7 @@ function assignCalendar(name) {
 }
 
 function popupCalendar(node) {
-   var nodeId = node.getAttribute("inputId");
+   var nodeId = $(node).readAttribute("inputId");
    var input = $(nodeId);
    input.calendar.popup();
 
index 0f441cfa8aea4ddadcccbee903728cbbd64c2994..12a3fe2818a7c15052d81e977a7430c12612f1a0 100644 (file)
@@ -134,15 +134,13 @@ function toggleCycleVisibility(node, nodeName, hiddenValue) {
 
 function addContact(tag, fullContactName, contactId, contactName, contactEmail) {
   var uids = $('uixselector-participants-uidList');
-  log ("contactId: " + contactId);
+
   if (contactId)
     {
       var re = new RegExp("(^|,)" + contactId + "($|,)");
 
-      log ("uids: " + uids);
       if (!re.test(uids.value))
         {
-          log ("no match... realling adding");
           if (uids.value.length > 0)
             uids.value += ',' + contactId;
           else
@@ -154,8 +152,6 @@ function addContact(tag, fullContactName, contactId, contactName, contactEmail)
                               + ResourcesURL + '/abcard.gif" />'
                               + contactName + '</li>');
         }
-      else
-        log ("match... ignoring contact");
     }
 
   return false;
@@ -190,7 +186,6 @@ function _getShadowDate(which) {
   date.setHours(intValue);
   intValue = parseInt(window.timeWidgets[which]['minute'].getAttribute("shadow-value"));
   date.setMinutes(intValue);
-  //   window.alert("shadow: " + date);
 
   return date;
 }
@@ -225,19 +220,40 @@ function setStartDate(newStartDate) {
 }
 
 function setEndDate(newEndDate) {
-  //   window.alert(newEndDate);
   this._setDate('end', newEndDate);
 }
 
-function onAdjustEndTime(event) {
-  var dateDelta = (window.getStartDate().valueOf()
-                   - window.getShadowStartDate().valueOf());
-  //   window.alert(window.getEndDate().valueOf() + '  ' + dateDelta);
-  var newEndDate = new Date(window.getEndDate().valueOf() + dateDelta);
-  window.setEndDate(newEndDate);
-  window.timeWidgets['start']['date'].updateShadowValue();
-  window.timeWidgets['start']['hour'].updateShadowValue();
-  window.timeWidgets['start']['minute'].updateShadowValue();
+function onAdjustTime(event) {
+  var endDate = window.getEndDate();
+  var startDate = window.getStartDate();
+  
+  if ($(this).readAttribute("id").startsWith("start")) {
+    // Start date was changed
+    var delta = window.getShadowStartDate().valueOf() -
+      startDate.valueOf();
+    var newEndDate = new Date(endDate.valueOf() - delta);
+    window.setEndDate(newEndDate);
+    
+    window.timeWidgets['end']['date'].updateShadowValue();
+    window.timeWidgets['end']['hour'].updateShadowValue();
+    window.timeWidgets['end']['minute'].updateShadowValue();
+    window.timeWidgets['start']['date'].updateShadowValue();
+    window.timeWidgets['start']['hour'].updateShadowValue();
+    window.timeWidgets['start']['minute'].updateShadowValue();
+  }
+  else {
+    // End date was changed
+    var delta = endDate.valueOf() - startDate.valueOf();  
+    if (delta < 0) {
+      alert(labels.validate_endbeforestart);
+      var oldEndDate = window.getShadowEndDate();
+      window.setEndDate(oldEndDate);
+
+      window.timeWidgets['end']['date'].updateShadowValue();
+      window.timeWidgets['end']['hour'].updateShadowValue();
+      window.timeWidgets['end']['minute'].updateShadowValue();
+    }
+  }
 }
 
 function onAllDayChanged(event) {
@@ -251,11 +267,18 @@ function initTimeWidgets(widgets) {
   this.timeWidgets = widgets;
 
   Event.observe(widgets['start']['date'], "change",
-               this.onAdjustEndTime, false);
+               this.onAdjustTime, false);
   Event.observe(widgets['start']['hour'], "change",
-               this.onAdjustEndTime, false);
+               this.onAdjustTime, false);
   Event.observe(widgets['start']['minute'], "change",
-               this.onAdjustEndTime, false);
+               this.onAdjustTime, false);
+
+  Event.observe(widgets['end']['date'], "change",
+               this.onAdjustTime, false);
+  Event.observe(widgets['end']['hour'], "change",
+               this.onAdjustTime, false);
+  Event.observe(widgets['end']['minute'], "change",
+               this.onAdjustTime, false);
 
   var allDayLabel = $("allDay");
   var input = $(allDayLabel).childNodesWithTag("input")[0];
index 62faa6c6831d798713ec78c8fb5db94b78614b94..1855cc45e0594c2e06b130270f573b7b6353731b 100644 (file)
@@ -36,8 +36,8 @@ function addLineToTree(tree, parent, line) {
            icon += 'calendar-folder-16x16.png';
         var folderId = userInfos[0] + ":" + folderInfos[1];
         var name = folderInfos[0]; // name has the format "Folername (Firstname Lastname <email>)"
-        var pos = name.indexOf(' (')
-        if (pos !== -1)
+        var pos = name.lastIndexOf(' (')
+        if (pos != -1)
           name = name.substring(0, pos); // strip the part with fullname and email
         tree.add(parent + i, parent, name, 0, '#', folderId,
                  folderInfos[2] + '-folder', '', '', icon, icon);
index ba470c44c1ddf01fe951f9b1ecaffe5f53e59fa0..ed57963663de48545b675b374bee73bfcdd520f7 100644 (file)
@@ -256,7 +256,7 @@ function onTextFocus() {
   }
   if (signatureLength > 0) {
     var length = this.getValue().length - signatureLength - 1;
-    this.selectText(length, length);
+    this.setCaretTo(length);
   }
   Event.stopObserving(this, "focus", onTextFocus);
 }
@@ -282,8 +282,8 @@ function initMailEditor() {
   var sigLimit = textContent.lastIndexOf("--");
   if (sigLimit > -1)
     signatureLength = (textContent.length - sigLimit);
+  textarea.scrollTop = textarea.scrollHeight;
   textarea.observe("focus", onTextFocus);
-  textarea.scrollTop = textarea.offsetHeight;
 
   onWindowResize(null);
   Event.observe(window, "resize", onWindowResize);
index 265205de69b093969c294008ecfb929512e41f5e..0b7b4fa9df86dc4c3684481ec4a7ab0ec05936ec 100644 (file)
@@ -111,20 +111,8 @@ function set_datetime(n_datetime, b_close) {
             ? obj_caller.gen_tsmp(dt_datetime)
             : obj_caller.gen_date(dt_datetime)
           );
-          if (document.initEvent) {
-            var onChangeEvent = document.createEvent("Events");
-            onChangeEvent.initEvent("mousedown", false, true);
-            obj_caller.target.dispatchEvent(onChangeEvent);
-          }
-          else if (document.createEvent) {
-            var onChangeEvent = document.createEvent("UIEvents");
-            onChangeEvent.initEvent("mousedown", false, true);
-            obj_caller.target.dispatchEvent(onChangeEvent);
-          }
-          else {
-            // Francis: add support for IE
-            obj_caller.target.fireEvent("onmousedown");
-          }
+          var adjustTime = window.opener.onAdjustTime.bind(obj_caller.target);
+          adjustTime();
         }
        if (b_close) window.close();
        else obj_caller.popup(dt_datetime.valueOf());