]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1267 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 19 Nov 2007 22:52:24 +0000 (22:52 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 19 Nov 2007 22:52:24 +0000 (22:52 +0000)
43 files changed:
ChangeLog
SoObjects/Appointments/SOGoAppointmentObject.m
SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.html
SoObjects/Mailer/SOGoMailEnglishForward.wo/SOGoMailEnglishForward.wod
SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.html
SoObjects/Mailer/SOGoMailEnglishReply.wo/SOGoMailEnglishReply.wod
SoObjects/Mailer/SOGoMailForward.m
SoObjects/Mailer/SOGoMailFrenchForward.wo/SOGoMailFrenchForward.html
SoObjects/Mailer/SOGoMailFrenchForward.wo/SOGoMailFrenchForward.wod
SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.html
SoObjects/Mailer/SOGoMailFrenchReply.wo/SOGoMailFrenchReply.wod
SoObjects/Mailer/SOGoMailGermanForward.wo/SOGoMailGermanForward.html
SoObjects/Mailer/SOGoMailGermanForward.wo/SOGoMailGermanForward.wod
SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.html
SoObjects/Mailer/SOGoMailGermanReply.wo/SOGoMailGermanReply.wod
SoObjects/Mailer/SOGoMailReply.m
SoObjects/SOGo/SOGoUser.h
SoObjects/SOGo/SOGoUser.m
UI/Common/UIxPageFrame.h
UI/Common/UIxPageFrame.m
UI/Common/product.plist
UI/MailPartViewers/UIxMailPartHTMLViewer.m
UI/MailerUI/UIxMailAccountActions.m
UI/MainUI/product.plist
UI/PreferencesUI/UIxPreferences.m
UI/Scheduler/UIxAppointmentEditor.m
UI/Scheduler/UIxComponentEditor.h
UI/Scheduler/UIxComponentEditor.m
UI/Scheduler/UIxTaskEditor.m
UI/Templates/MailerUI/UIxMailToSelection.wox
UI/Templates/PreferencesUI/UIxPreferences.wox
UI/Templates/SchedulerUI/UIxComponentEditor.wox
UI/Templates/UIxPageFrame.wox
UI/WebServerResources/ContactsUI.js
UI/WebServerResources/HTMLElement.js
UI/WebServerResources/SchedulerUI.js
UI/WebServerResources/UIxAclEditor.js
UI/WebServerResources/UIxAppointmentEditor.js
UI/WebServerResources/UIxComponentEditor.css
UI/WebServerResources/UIxComponentEditor.js
UI/WebServerResources/UIxMailEditor.css
UI/WebServerResources/UIxPreferences.css
UI/WebServerResources/generic.js

index a816760558d7a78e2dc6a008e619e954584d6ab9..fc8949637254a7997a15c9832524f7c4c5d83091 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,42 @@
 2007-11-19  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
+       * UI/PreferencesUI/UIxPreferences.m ([UIxPreferences -signature]):
+       returns the signature for the default identity of the default
+       accouunt...
+       ([UIxPreferences -setSignature:newSignature]): accessor that sets
+       the default signature.
+
+       * UI/MailerUI/UIxMailAccountActions.m ([UIxMailAccountActions
+       -composeAction]): append the message signature to the new draft.
+
+       * SoObjects/Mailer/SOGoMailReply.m ([SOGoMailReply -signature]):
+       same as above.
+
+       * SoObjects/Mailer/SOGoMailForward.m ([SOGoMailForward
+       -signature]): new method that takes the user's signature and put
+       it at the end of the message, if exists.
+
+       * UI/Common/UIxPageFrame.m ([UIxPageFrame -isSuperUser]): new
+       accessor that forwards the call to the active user.
+
+       * SoObjects/SOGo/SOGoUser.m ([SOGoUser -signature]): returns the
+       user default signature.
+       ([SOGoUser -isSuperUser]): declares whether the user is listed
+       among the super users.
+
+       * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
+       -setComponent:newComponent]): retain the component object.
+       ([UIxComponentEditor -organizerIdentity]): new accessor method to
+       handle list of possible organizers.
+
+       * UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor
+       -event]): retain the returned event object.
+
+       * SoObjects/Appointments/SOGoAppointmentObject.m
+       ([SOGoAppointmentObject -saveComponent:newEvent]): reset the
+       organizer only if there are no attendees AND the owner of the
+       component is not the organizer him-/herself.
+
        * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
        -toolbar]): rewrote in a way that ensures that each case is
        handled properly.
index 58de668a1e0bbde17d5ec09b0ef4f5af7b203c9a..dac2f254752ecaec25a0133186258c3c0a84115b 100644 (file)
 {
   iCalEvent *oldEvent;
   NSArray *attendees;
+  SOGoUser *currentUser;
 
   [[newEvent parent] setMethod: @""];
-  if ([newEvent userIsOrganizer: [context activeUser]])
+  currentUser = [context activeUser];
+  if ([newEvent userIsOrganizer: currentUser])
     {
       oldEvent = [self component: NO secure: NO];
       if (oldEvent)
                    toAttendees: attendees];
            }
 
-         if (![[newEvent attendees] count])
+         if (![[newEvent attendees] count]
+             && [[self ownerInContext: context]
+                  isEqualToString: [currentUser login]])
            [[newEvent uniqueChildWithTag: @"organizer"] setValue: 0
                                                         to: @""];
        }
index c1b652eb61cc0bc703cdab62279fdc146dce6ec4..3f50a3f64f9baca52f0daa025833528ad25e0bc2 100644 (file)
@@ -6,3 +6,5 @@ From: <#from/>
 <#hasCc>CC: <#cc/></#hasCc><#hasNewsGroups>Newsgroups: <#newsgroups/></#hasNewsGroups><#hasReferences>References: <#references/></#hasReferences>
 
 <#messageBody/>
+
+<#signature/>
index 517bc8cc176e87ff7a2593d416fd301518687fc2..df237286f4655b0084fb62eb0a26b3b1bc82d4a7 100644 (file)
@@ -67,3 +67,8 @@ messageBody: WOString {
   value = messageBody;
   escapeHTML = NO;
 }
+
+signature: WOString {
+  value = signature;
+  escapeHTML = NO;
+}
index e0274ea001e9c8702d8fc4908394f0c624a3ffd8..0ccbf454965f464aa8963c4cb33101a7390fcabf 100644 (file)
@@ -1,3 +1,5 @@
 On <#date/>, <#from/> wrote:
 
 <#messageBody/>
+
+<#signature/>
index 830cd7a76d5672a2f8725d14ba765a164854e235..7a66a17bf97741828e57f6d8168c84196df42714 100644 (file)
@@ -12,3 +12,8 @@ messageBody: WOString {
   value = messageBody;
   escapeHTML = NO;
 }
+
+signature: WOString {
+  value = signature;
+  escapeHTML = NO;
+}
index ce3545ddb43c85d70cefdd4c625b34a27e6ec471..e666f9b8f7badcfc7f147f1afd3760b12db01fb1 100644 (file)
   return [sourceMail contentForEditing];
 }
 
+- (NSString *) signature
+{
+  NSString *signature, *mailSignature;
+
+  signature = [[context activeUser] signature];
+  if ([signature length])
+    mailSignature = [NSString stringWithFormat: @"--\r\n%@", signature];
+  else
+    mailSignature = @"";
+
+  return mailSignature;
+}
+
 @end
 
 @implementation SOGoMailEnglishForward
index 3ae60f74c9cfd12f58ea19ff82e16370edf6b3ca..6ebbd459813dda40ede9170f0a66b9e378b2cec3 100644 (file)
@@ -6,3 +6,5 @@ De: <#from/>
 <#hasCc>Copie: <#cc/></#hasCc><#hasNewsGroups>Forums de discussion: <#newsgroups/></#hasNewsGroups><#hasReferences>Références: <#references/></#hasReferences>
 
 <#messageBody/>
+
+<#signature/>
index 517bc8cc176e87ff7a2593d416fd301518687fc2..df237286f4655b0084fb62eb0a26b3b1bc82d4a7 100644 (file)
@@ -67,3 +67,8 @@ messageBody: WOString {
   value = messageBody;
   escapeHTML = NO;
 }
+
+signature: WOString {
+  value = signature;
+  escapeHTML = NO;
+}
index 406f945d06c21760fc8ad614f04519768fc6666c..d7f2251034e2779725bcb9f2311e400f74132076 100644 (file)
@@ -1,3 +1,5 @@
 Le <#date/>, <#from/> a Ã©crit:
 
 <#messageBody/>
+
+<#signature/>
index 830cd7a76d5672a2f8725d14ba765a164854e235..7a66a17bf97741828e57f6d8168c84196df42714 100644 (file)
@@ -12,3 +12,8 @@ messageBody: WOString {
   value = messageBody;
   escapeHTML = NO;
 }
+
+signature: WOString {
+  value = signature;
+  escapeHTML = NO;
+}
index 26fa08039f9c146b20685bb26cd3b5e3b07e9709..1260988e42ee769a7cb9ddbd427ff901630dc388 100644 (file)
@@ -6,3 +6,5 @@ Sender: <#from/>
 <#hasCc>Kopie: <#cc/></#hasCc><#hasNewsGroups>Newsgroup: <#newsgroups/></#hasNewsGroups><#hasReferences>Referenzen: <#references/></#hasReferences>
 
 <#messageBody/>
+
+<#signature/>
index 517bc8cc176e87ff7a2593d416fd301518687fc2..df237286f4655b0084fb62eb0a26b3b1bc82d4a7 100644 (file)
@@ -67,3 +67,8 @@ messageBody: WOString {
   value = messageBody;
   escapeHTML = NO;
 }
+
+signature: WOString {
+  value = signature;
+  escapeHTML = NO;
+}
index e0274ea001e9c8702d8fc4908394f0c624a3ffd8..0ccbf454965f464aa8963c4cb33101a7390fcabf 100644 (file)
@@ -1,3 +1,5 @@
 On <#date/>, <#from/> wrote:
 
 <#messageBody/>
+
+<#signature/>
index 830cd7a76d5672a2f8725d14ba765a164854e235..7a66a17bf97741828e57f6d8168c84196df42714 100644 (file)
@@ -12,3 +12,8 @@ messageBody: WOString {
   value = messageBody;
   escapeHTML = NO;
 }
+
+signature: WOString {
+  value = signature;
+  escapeHTML = NO;
+}
index f1758ed6a3751b393503c7106a8078909d03dfb2..9016b469d52c64a3463b1b1b7724a79f5debf92a 100644 (file)
   return [[sourceMail contentForEditing] stringByApplyingMailQuoting];
 }
 
+- (NSString *) signature
+{
+  NSString *signature, *mailSignature;
+
+  signature = [[context activeUser] signature];
+  if ([signature length])
+    mailSignature = [NSString stringWithFormat: @"--\r\n%@", signature];
+  else
+    mailSignature = @"";
+
+  return mailSignature;
+}
+
 @end
 
 @implementation SOGoMailEnglishReply
index 64e1f8a03da52c3ebeb7e09d38b45cf209088adc..d8f80102eb2fdb1c9cbf749f3c62c0c8b50199ee 100644 (file)
@@ -120,6 +120,10 @@ extern NSString *SOGoWeekStartFirstFullWeek;
 - (NSString *) messageForwarding;
 - (NSString *) messageCheck;
 
+- (NSString *) signature;
+
+- (BOOL) isSuperUser;
+
 /* folders */
 
 - (SOGoUserFolder *) homeFolderInContext: (id) context;
index e81214d5eec6f8105c2be589883a79da08969eee..ee12335961abc72850cb0e22e38553f72d6789a9 100644 (file)
@@ -501,6 +501,11 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
   return [[defaultAccount objectForKey: @"identities"] objectAtIndex: 0];
 }
 
+- (NSString *) signature
+{
+  return [[self primaryIdentity] objectForKey: @"signature"];
+}
+
 - (NSString *) messageForwarding
 {
   NSString *messageForwarding;
@@ -612,4 +617,9 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
          && [login isEqualToString: [otherUser login]]);
 }
 
+- (BOOL) isSuperUser
+{
+  return [superUsernames containsObject: login];
+}
+
 @end /* SOGoUser */
index d87126f2343072b50ba5fd74de16e17ff7d639fb..aeb378d1d9c89e1cce216b6216d194093700e5f8 100644 (file)
@@ -65,6 +65,8 @@
 - (void) setToolbar: (NSString *) newToolbar;
 - (NSString *) toolbar;
 
+- (BOOL) isSuperUser;
+
 - (BOOL) isCompatibleBrowser;
 - (BOOL) isIE7Compatible;
 - (BOOL) isMac;
index 9aaa5df61b8b5f360a43bc3df6afef4b2aecbdc2..fda77e28bd9986f1d28552c21c72f77c0712d745 100644 (file)
   return toolbar;
 }
 
+- (BOOL) isSuperUser
+{
+  return [[context activeUser] isSuperUser];
+}
+
 /* browser/os identification */
 
 - (BOOL) isCompatibleBrowser
index 157e7ace7138b45abc2c9b865ee0c9e389f0fe22..ea75a393faeb24b21e6f5367d55cdb5ae5afe785 100644 (file)
@@ -56,7 +56,7 @@
          pageName    = "UIxUserRightsEditor";
        };
        saveUserRights = {
-         protectedBy = "ReadAcls";
+         protectedBy = "SaveAcls";
          pageName    = "UIxUserRightsEditor";
          actionName = "saveUserRights";
        };
index fbe39301f731ef71240f6c7e600dff9638d49688..6be09e6dde978990381c707b30b38b6a6d2e24a7 100644 (file)
 
   css = [handler css];
   if ([css length])
-    cssContent = [NSString stringWithFormat: @"<style type=\"text/css\">%@</style>",
-                          [handler css]];
+    cssContent
+      = [NSString stringWithFormat: @"<style type=\"text/css\">%@</style>",
+                 [handler css]];
   else
     cssContent = @"";
 
index f9d4d2b82dc7e427f1e9fcf2a8fe0055690bfe6d..69fe254d95b79f8ce65d07b69502e8377b4ccc93 100644 (file)
 #import <Foundation/NSDictionary.h>
 #import <Foundation/NSEnumerator.h>
 
-#import <NGObjWeb/WOContext.h>
+#import <NGObjWeb/WOContext+SoObjects.h>
 #import <NGObjWeb/WORequest.h>
 #import <NGObjWeb/WOResponse.h>
 #import <NGImap4/NGImap4Connection.h>
+
 #import <SoObjects/Mailer/SOGoMailAccount.h>
 #import <SoObjects/Mailer/SOGoDraftObject.h>
 #import <SoObjects/Mailer/SOGoDraftsFolder.h>
 #import <SoObjects/SOGo/NSArray+Utilities.h>
 #import <SoObjects/SOGo/NSObject+Utilities.h>
 #import <SoObjects/SOGo/NSString+Utilities.h>
+#import <SoObjects/SOGo/SOGoUser.h>
 
 #import "../Common/WODirectAction+SOGo.h"
 
 {
   SOGoDraftsFolder *drafts;
   SOGoDraftObject *newDraftMessage;
-  NSString *urlBase, *url, *value;
+  NSString *urlBase, *url, *value, *signature;
   NSArray *mailTo;
-  
+  BOOL save;
 
   drafts = [[self clientObject] draftsFolderInContext: context];
   newDraftMessage = [drafts newDraft];
 
+  save = NO;
+
   value = [[self request] formValueForKey: @"mailto"];
   if ([value length] > 0)
     {
       mailTo = [NSArray arrayWithObject: value];
-      [newDraftMessage setHeaders: [NSDictionary dictionaryWithObject: mailTo
-                                                forKey: @"to"]];
-      [newDraftMessage storeInfo];
+      [newDraftMessage
+       setHeaders: [NSDictionary dictionaryWithObject: mailTo
+                                 forKey: @"to"]];
+      save = YES;
+    }
+
+  signature = [[context activeUser] signature];
+  if ([signature length])
+    {
+      [newDraftMessage
+       setText: [NSString stringWithFormat: @"\r\n--\r\n%@", signature]];
+      save = YES;
     }
+  if (save)
+    [newDraftMessage storeInfo];
 
   urlBase = [newDraftMessage baseURLInContext: context];
   url = [urlBase composeURLWithAction: @"edit"
index 664e4cf52e899820ef66f741909f67c93d33d0a1..3eb0a70d5465ca029b05e15bcddb610f178f9e1c 100644 (file)
@@ -24,7 +24,7 @@
        "Access Contents Information" = ( "Owner", "ObjectReader" );
         "Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
        "Add Folders" = ( "Owner", "FolderCreator" );
-        "ReadAcls" = ( "Owner", "AuthorizedSubscriber" );
+        "ReadAcls" = ( "Owner" );
         "SaveAcls" = ( "Owner" );
         "Delete Objects" = ( "Owner", "ObjectEraser" );
       };
index 958675336d3381bc37ee272fdb42e99a6be7e8b0..192d8267e2d289b1b9488d00faac14dbcf4db2f1 100644 (file)
@@ -28,6 +28,7 @@
 #import <NGObjWeb/WOContext.h>
 #import <NGObjWeb/WORequest.h>
 
+#import <SoObjects/SOGo/NSArray+Utilities.h>
 #import <SoObjects/SOGo/NSDictionary+Utilities.h>
 #import <SoObjects/SOGo/SOGoUser.h>
 
@@ -472,7 +473,12 @@ static BOOL shouldDisplayPasswordChange = NO;
 //         string="itemIdentityText" selection="defaultIdentity"/></label>
 - (NSArray *) identitiesList
 {
-  return [user allIdentities];
+  NSDictionary *primaryAccount;
+
+#warning we manage only one account per user at this time...
+  primaryAccount = [[user mailAccounts] objectAtIndex: 0];
+
+  return [primaryAccount objectForKey: @"identities"];
 }
 
 - (NSString *) itemIdentityText
@@ -480,9 +486,9 @@ static BOOL shouldDisplayPasswordChange = NO;
   return [item keysWithFormat: @"%{fullName} <%{email}>"];
 }
 
-- (NSDictionary *) defaultIdentity
+- (NSMutableDictionary *) defaultIdentity
 {
-  NSDictionary *currentIdentity, *defaultIdentity;
+  NSMutableDictionary *currentIdentity, *defaultIdentity;
   NSEnumerator *identities;
 
   defaultIdentity = nil;
@@ -496,6 +502,19 @@ static BOOL shouldDisplayPasswordChange = NO;
   return defaultIdentity;
 }
 
+- (NSString *) signature
+{
+  return [[self defaultIdentity] objectForKey: @"signature"];
+}
+
+- (void) setSignature: (NSString *) newSignature
+{
+  [[self defaultIdentity] setObject: newSignature
+                         forKey: @"signature"];
+  [userDefaults setObject: [user mailAccounts]
+               forKey: @"MailAccounts"];
+}
+
 - (id <WOActionResults>) defaultAction
 {
   id <WOActionResults> results;
index be23c936301f3fe1af7801cd624bcc77160ca217..23d899902b9584a6e8f11a6ce1cca694e20b531b 100644 (file)
 /* template values */
 - (iCalEvent *) event
 {
+  if (!event)
+    {
+      event = (iCalEvent *) [[self clientObject] component: NO secure: NO];
+      [event retain];
+    }
+
   return event;
 }
 
index e9e478c6a1d6b0dd5b7d2ddf9203a570d9582979..12ff2c7b75f7bd54dee30e7804267bc3045fc95d 100644 (file)
@@ -41,6 +41,8 @@
 
   NSString *saveURL;
   NSMutableArray *calendarList;
+  NSMutableArray *organizerList;
+  NSDictionary *organizerIdentity;
   
   /* individual values */
   NSCalendarDate *cycleUntilDate;
@@ -69,6 +71,9 @@
 - (void) setSaveURL: (NSString *) newSaveURL;
 - (NSString *) saveURL;
 
+- (void) setItem: (id) _item;
+- (id) item;
+
 - (NSArray *) categoryList;
 - (void) setCategories: (NSArray *) _categories;
 - (NSArray *) categories;
 - (NSString *) status;
 - (NSString *) itemStatusText;
 
-- (void) setItem: (id) _item;
-- (id) item;
-- (NSString *) itemPriorityText;
-
 - (void) setTitle: (NSString *) _value;
 - (NSString *) title;
 
 - (void) setLocation: (NSString *) _value;
 - (NSString *) location;
 
+- (NSString *) location;
+
 - (void) setComment: (NSString *) _value;
 - (NSString *) comment;
 
index 3916100f496436cccfde39107513502f1d705720..28afec224faa62eb88f32881aba33d89dca04498 100644 (file)
@@ -49,6 +49,7 @@
 #import <SoObjects/Appointments/SOGoTaskObject.h>
 #import <SoObjects/SOGo/iCalEntityObject+Utilities.h>
 #import <SoObjects/SOGo/LDAPUserManager.h>
+#import <SoObjects/SOGo/NSDictionary+Utilities.h>
 #import <SoObjects/SOGo/NSString+Utilities.h>
 #import <SoObjects/SOGo/SOGoUser.h>
 #import <SoObjects/SOGo/SOGoPermissions.h>
@@ -68,6 +69,7 @@
       [self setIsCycleEndNever];
       componentOwner = @"";
       organizer = nil;
+      organizerIdentity = nil;
       attendeesNames = nil;
       attendeesUIDs = nil;
       attendeesEmails = nil;
@@ -84,6 +86,7 @@
   [title release];
   [location release];
   [organizer release];
+  [organizerIdentity release];
   [comment release];
   [priority release];
   [categories release];
@@ -95,6 +98,8 @@
   [attendeesEmails release];
   [calendarList release];
 
+  [component release];
+
   [super dealloc];
 }
 
 
   if (!component)
     {
-      component = newComponent;
+      ASSIGN (component, newComponent);
 
       co = [self clientObject];
       componentOwner = [co ownerInContext: nil];
   return url;
 }
 
+- (NSString *) organizerName
+{
+  return [organizer mailAddress];
+}
+
+- (BOOL) canBeOrganizer
+{
+  NSString *owner;
+  SOGoCalendarComponent *co;
+  SOGoUser *currentUser;
+  BOOL hasOrganizer;
+
+  co = [self clientObject];
+  owner = [co ownerInContext: context];
+  currentUser = [context activeUser];
+
+  hasOrganizer = ([[organizer value: 0] length] > 0);
+
+  return ([co isNew]
+         || ([owner isEqualToString: [currentUser login]]
+             && (!hasOrganizer || [component userIsOrganizer: currentUser])));
+}
+
 - (BOOL) hasOrganizer
 {
-  return (![organizer isVoid]);
+  return ([[organizer value: 0] length] && ![self canBeOrganizer]);
 }
 
-- (NSString *) organizerName
+- (void) setOrganizerIdentity: (NSDictionary *) newOrganizerIdentity
 {
-  return [organizer mailAddress];
+  ASSIGN (organizerIdentity, newOrganizerIdentity);
+}
+
+- (NSDictionary *) organizerIdentity
+{
+  NSArray *allIdentities;
+  NSEnumerator *identities;
+  NSDictionary *currentIdentity;
+  NSString *orgEmail;
+
+  orgEmail = [organizer rfc822Email];
+  if (!organizerIdentity)
+    {
+      if ([orgEmail length])
+       {
+         allIdentities = [[context activeUser] allIdentities];
+         identities = [allIdentities objectEnumerator];
+         while (!organizerIdentity
+                && ((currentIdentity = [identities nextObject])))
+           if ([[currentIdentity objectForKey: @"email"]
+                 caseInsensitiveCompare: orgEmail]
+               == NSOrderedSame)
+             ASSIGN (organizerIdentity, currentIdentity);
+       }
+    }
+
+  return organizerIdentity;
+}
+
+- (NSArray *) organizerList
+{
+  return [[context activeUser] allIdentities];
+}
+
+- (NSString *) itemOrganizerText
+{
+  return [item keysWithFormat: @"%{fullName} <%{email}>"];
 }
 
 - (void) setAttendeesNames: (NSString *) newAttendeesNames
 - (void) _handleOrganizer
 {
   NSString *organizerEmail;
-  SOGoUser *activeUser;
-  NSDictionary *primaryIdentity;
+  NSString *owner, *login;
 
   organizerEmail = [[component organizer] email];
   if ([organizerEmail length] == 0)
     {
-      if ([[component attendees] count] > 0)
+      owner = [[self clientObject] ownerInContext: context];
+      login = [[context activeUser] login];
+      if (![owner isEqualToString: login]
+         || [[component attendees] count] > 0)
        {
          ASSIGN (organizer, [iCalPerson elementWithTag: @"organizer"]);
-         activeUser = [context activeUser];
-         primaryIdentity = [activeUser primaryIdentity];
-         [organizer setCn: [activeUser cn]];
-         [organizer setEmail: [primaryIdentity objectForKey: @"email"]];
+         [organizer setCn: [organizerIdentity objectForKey: @"fullName"]];
+         [organizer setEmail: [organizerIdentity objectForKey: @"email"]];
          [component setOrganizer: organizer];
        }
     }
 
 #warning the following methods probably share some code...
 - (NSString *) _toolbarForOwner: (SOGoUser *) ownerUser
+               andClientObject: (SOGoCalendarComponent *) clientObject
 {
   NSString *toolbarFilename;
   iCalPersonPartStat participationStatus;
     }
   else
     {
-      if ([component isKindOfClass: [iCalEvent class]])
+      if ([clientObject isKindOfClass: [SOGoAppointmentObject class]])
        toolbarFilename = @"SOGoAppointmentObject.toolbar";
       else
        toolbarFilename = @"SOGoTaskObject.toolbar";
 }
 
 - (NSString *) _toolbarForDelegate: (SOGoUser *) ownerUser
+                  andClientObject: (SOGoCalendarComponent *) clientObject
 {
-  SOGoCalendarComponent *clientObject;
   SoSecurityManager *sm;
   NSString *toolbarFilename, *adminToolbar;
   iCalPersonPartStat participationStatus;
 
-  clientObject = [self clientObject];
-
-  if ([component isKindOfClass: [iCalEvent class]])
+  if ([clientObject isKindOfClass: [SOGoAppointmentObject class]])
     adminToolbar = @"SOGoAppointmentObject.toolbar";
   else
     adminToolbar = @"SOGoTaskObject.toolbar";
                        roles: nil];
 
   if ([ownerUser isEqual: [context activeUser]])
-    toolbarFilename = [self _toolbarForOwner: ownerUser];
+    toolbarFilename = [self _toolbarForOwner: ownerUser
+                           andClientObject: clientObject];
   else
-    toolbarFilename = [self _toolbarForDelegate: ownerUser];
+    toolbarFilename = [self _toolbarForDelegate: ownerUser
+                           andClientObject: clientObject];
 
 
   return toolbarFilename;
index 96d520810c56f58d92ce713e48efe105aca18200..8ea3b9edf1b1641d45fce7cc022121c7e83c64d0 100644 (file)
   [statusDate release];
   [status release];
   [statusPercent release];
+  [todo release];
   [super dealloc];
 }
 
 /* template values */
 - (iCalToDo *) todo
 {
+  if (!todo)
+    {
+      todo = (iCalToDo *) [[self clientObject] component: NO secure: NO];
+      [todo retain];
+    }
+
   return todo;
 }
 
 - (id) changeStatusAction
 {
   SOGoTaskObject *clientObject;
-  NSString *newStatus, *iCalString;
+  NSString *newStatus;
 
   clientObject = [self clientObject];
   todo = (iCalToDo *) [clientObject component: NO secure: NO];
+  [todo retain];
   if (todo)
     {
       newStatus = [self queryParameterForKey: @"status"];
          [todo setPercentComplete: @"0"];
          [todo setStatus: @"IN-PROCESS"];
        }
-
-      iCalString = [[clientObject calendar: NO secure: NO] versitString];
-      [clientObject saveContentString: iCalString];
+      [clientObject saveComponent: todo];
     }
 
-  return self;
+  return [self responseWith204];
 }
 
 @end
index c33c588af3ed6b0152e7b2359c8db60b40e76985..fb5e6689491f01ddf0fafe4668dffb5568bf2bfe 100644 (file)
@@ -37,9 +37,8 @@
         </var:foreach>
       </var:foreach>
       <tr class="addressListElement" id="lastRow">
-        <td class="headerField">
+        <td class="headerField" onclick="fancyAddRow(true,'');">
         <var:popup name="currentPopUpId"
-              const:disabled="1"
               list="headers"
               item="item"
               label:displayString="$item"
index 3bf8804b587f0cb0804ead2bc916a2e744cd44a8..bb01400d4fcd3e60b645811773653a6798cd748e 100644 (file)
@@ -19,8 +19,8 @@
            label:value="Calendar Options"/></li>
        <li target="mailOptionsView"><var:string
            label:value="Mail Options"/></li>
-<!--   <li target="identitiesView"><var:string
-           label:value="Identities"/></li> -->
+       <li target="identitiesView"><var:string
+           label:value="Identities"/></li>
        <var:if condition="shouldDisplayPasswordChange">
          <li target="passwordView"><var:string label:value="Password"/></li>
        </var:if>
       </label> -->
       </div>
       <div id="identitiesView" class="tab">
-       <var:multiselection id="identitiesList" item="item"
-         string="itemIdentityText" selection="defaultIdentity">
+       <!--<var:multiselection const:id="identitiesList" item="item"
+         list="identitiesList" displayString="itemIdentityText">
        </var:multiselection>
-       <br/>
+       <br/>-->
+       <var:string label:value="Signature:"/><br/>
+       <textarea const:id="signature" const:name="signature"
+         var:value="signature"/>
       </div>
       <var:if condition="shouldDisplayPasswordChange">
        <div id="passwordView" class="tab">
index 5a4d704283f79af66dcbc95a05ac7374b312acb9..d5c1e9761a136e16f16f6ca365ff158f22be60af 100644 (file)
       </span></span>
       <var:if condition="hasOrganizer"
        ><label id="organizerLabel"><var:string label:value="Organizer:"
-           /><span class="content"><var:string value="organizerName"/></span></label>
+           /><span class="content"><var:string
+             value="organizerName"/></span></label>
       </var:if>
+      <var:if condition="canBeOrganizer"
+       ><label id="organizerListLabel"><var:string label:value="Organizer:"
+           /><span class="content"><var:popup list="organizerList"
+             item="item" string="itemOrganizerText"
+             var:selection="organizerIdentity"/>
+         </span></label></var:if>
       <label id="attendeesLabel"><var:string label:value="Attendees:"
          /><span class="content"
          ><a href="#" id="attendeesHref"><!-- space --></a></span></label>
index e6dbf22e7a4d7ebf0026fd97a7ad04cfa3447f81..ef1a2d6f09204e6d4a45714c3adec56ce746b135 100644 (file)
          <div id="javascriptSafetyNet"><!-- space --></div>
 
          <script type="text/javascript">
-           var ApplicationBaseURL = '<var:string value="applicationPath" />';
+           var ApplicationBaseURL = '<var:string value="applicationPath"/>';
            var ResourcesURL = '/SOGo.woa/WebServerResources';
+           <var:if condition="isSuperUser"
+             >var IsSuperUser = true;
+           </var:if>
+           <var:if condition="isSuperUser" const:negate="YES"
+             >var IsSuperUser = false;
+           </var:if>
            <var:if condition="shortUserNameForDisplay" const:value="anonymous"
              const:negate="YES"
              >var UserFolderURL = '<var:string value="userFolderPath" />';
index 31da8b1774681302939977afc43dcafaaf941401..42ced264f9b9188f3bcd351c78069391f5591a4d 100644 (file)
@@ -709,6 +709,9 @@ function folderRenameCallback(http) {
 }
 
 function onMenuSharing(event) {
+  if ($(this).hasClassName("disabled"))
+    return;
+
    var folders = $("contactFolders");
    var selected = folders.getSelectedNodes()[0];
    var owner = selected.getAttribute("owner");
@@ -723,6 +726,21 @@ function onMenuSharing(event) {
    }
 }
 
+function onContactFoldersMenuPrepareVisibility() {
+  var folders = $("contactFolders");
+  var selected = folders.getSelectedNodes();  
+
+  if (selected.length > 0) {
+    var folderOwner = selected[0].getAttribute("owner");
+    var sharingOption = $(this).down("ul").childElements().last();
+    // Disable the "Sharing" option when address book is not owned by user
+    if (folderOwner == UserLogin || IsSuperUser)
+      sharingOption.removeClassName("disabled");
+    else
+      sharingOption.addClassName("disabled");
+  }
+}
+
 function getMenus() {
    var menus = {};
    menus["contactFoldersMenu"] = new Array(onMenuModify, "-", null,
@@ -732,7 +750,11 @@ function getMenus() {
                                    onMenuWriteToContact, null, "-",
                                    onMenuDeleteContact);
    menus["searchMenu"] = new Array(setSearchCriteria);
-
+   
+   var contactFoldersMenu = $("contactFoldersMenu");
+   if (contactFoldersMenu)
+     contactFoldersMenu.prepareVisibility = onContactFoldersMenuPrepareVisibility;
+   
    return menus;
 }
 
index 378670cab3f331b715d7f21107133e03a517e9d4..40414457281a9f554fb3962418c491d942411a18 100644 (file)
@@ -137,6 +137,9 @@ Element.addMethods({
     if (leftDiff < 0)
       menuLeft -= popup.offsetWidth;
 
+    if (popup.prepareVisibility)
+      popup.prepareVisibility();
+
     popup.setStyle( { top: menuTop + "px",
                      left: menuLeft + "px",
                      visibility: "visible" } );
index 31f3f738b84a5f94b57ef8feb79f78975cae420b..3b4fd32ce3d7e1f75cd5f0c937fc8843d1eaf746 100644 (file)
@@ -481,11 +481,9 @@ function changeDateSelectorDisplay(day, keepCurrentDay) {
 
 function changeCalendarDisplay(data, newView) {
   var url = ApplicationBaseURL + ((newView) ? newView : currentView);
-
-  selectedCalendarCell = null;
-
   var day = null;
   var scrollEvent = null;
+
   if (data) {
     day = data['day'];
     scrollEvent = data['scrollEvent'];
@@ -495,50 +493,39 @@ function changeCalendarDisplay(data, newView) {
     day = currentDay;
 
   if (day) {
-    var divs = $$('div.day[day='+day+']');
-    if (divs.length > 0) {
-      // Don't reload the view if the event is present in current view
-
-      // Find day number
-      var dayNumber;
-      var classes = $w(divs[0].className);
-      for (var i = 0; i < classes.length; i++) {
-       if (classes[i] == 'day')
-         continue;
-       if (classes[i] == 'selectedDay')
-         break;
-       dayNumber = classes[i];
-       break;
-      }
+    if (data) {
+      var divs = $$('div.day[day='+day+']');
+      if (divs.length) {
+       // Don't reload the view if the event is present in current view
+       
+       // Deselect previous day
+       var selectedDivs = $$('div.day.selectedDay');
+       selectedDivs.each(function(div) {
+           div.removeClassName('selectedDay');
+         });
+       
+       // Select new day
+       divs.each(function(div) {
+           div.addClassName('selectedDay');
+         });
+       
+       // Deselect day in date selector
+       if (document.selectedDate)
+         document.selectedDate.deselect();
+       
+       // Select day in date selector
+       var selectedLink = $$('table#dateSelectorTable a[day='+day+']');
+       if (selectedLink.length > 0) {
+         selectedCell = selectedLink[0].up(1);
+         selectedCell.select();
+         document.selectedDate = selectedCell;
+       }
+       
+       // Scroll to event
+       scrollDayView(scrollEvent);     
 
-      // Deselect previous day
-      var selectedDivs = $$('div.day.selectedDay');
-      selectedDivs.each(function(div) {
-         div.removeClassName('selectedDay');
-       });
-      
-      // Select new day
-      selectedDivs = $$('div.day.'+dayNumber);
-      selectedDivs.each(function(div) {
-         div.addClassName('selectedDay');
-       });
-      
-      // Deselect day in date selector
-      if (document.selectedDate)
-       document.selectedDate.deselect();
-      
-      // Select day in date selector
-      var selectedLink = $$('table#dateSelectorTable a[day='+day+']');
-      if (selectedLink.length > 0) {
-       selectedCell = selectedLink[0].up(1);
-       selectedCell.select();
-       document.selectedDate = selectedCell;
+       return false;
       }
-
-      // Scroll to event
-      scrollDayView(scrollEvent);
-
-      return false;
     }
     url += "?day=" + day;
   }
@@ -546,6 +533,8 @@ function changeCalendarDisplay(data, newView) {
 //     log ("switching to view: " + newView);
 //   log ("changeCalendarDisplay: " + url);
 
+  selectedCalendarCell = null;
+
   if (document.dayDisplayAjaxRequest) {
 //     log ("aborting day ajaxrq");
     document.dayDisplayAjaxRequest.aborted = true;
@@ -584,7 +573,15 @@ function onMonthOverview() {
 }
 
 function scrollDayView(scrollEvent) {
+  var divs;
 
+  // Select event in calendar view
+  if (scrollEvent) {
+    divs = $$("div#calendarContent div." + eventClass(scrollEvent));
+    selectCalendarEvent(divs[0]);
+  }
+  
+  // Don't scroll if in month view
   if (currentView == "monthview")
     return;
 
@@ -594,7 +591,7 @@ function scrollDayView(scrollEvent) {
     $(daysView.childNodesWithTag("div")[0]).childNodesWithTag("div");
 
   if (scrollEvent) {
-    var divs = $$("div#calendarContent div." + eventClass(scrollEvent));
+    divs = $$("div#calendarContent div." + eventClass(scrollEvent));
     var classes = $w(divs[0].className);
     for (var i = 0; i < classes.length; i++) {
       if (classes[i].startsWith("starts")) {
@@ -604,6 +601,7 @@ function scrollDayView(scrollEvent) {
     }
   }
   else
+    // Scroll to 8 AM
     offset = hours[8].offsetTop;
 
   daysView.scrollTop = offset - 5;
@@ -659,7 +657,7 @@ function refreshCalendarEvents(scrollEvent) {
       document.refreshCalendarEventsAjaxRequest.aborted = true;
       document.refreshCalendarEventsAjaxRequest.abort();
    }
-   var url = ApplicationBaseURL + "/eventslist?sd=" + sd + "&ed=" + ed;
+   var url = ApplicationBaseURL + "eventslist?sd=" + sd + "&ed=" + ed;
    document.refreshCalendarEventsAjaxRequest
       = triggerAjaxRequest(url, refreshCalendarEventsCallback,
                           {"startDate": sd, "endDate": ed, "scrollEvent": scrollEvent});
@@ -677,8 +675,7 @@ function refreshCalendarEventsCallback(http) {
                          http.callbackData["startDate"],
                          http.callbackData["endDate"]);
     }
-    if (http.callbackData["scrollEvent"])
-      scrollDayView(http.callbackData["scrollEvent"]);
+    scrollDayView(http.callbackData["scrollEvent"]);
   }
   else
      log("AJAX error when refreshing calendar events");
@@ -708,7 +705,8 @@ function drawCalendarEvent(eventData, sd, ed) {
 //    log("viewS: " + viewStartDate);
    var startHour = null;
    var endHour = null;
-
+   
+   var siblings = new Array();
    for (var i = 0; i < days.length; i++)
       if (days[i].earlierDate(viewStartDate) == viewStartDate
          && days[i].laterDate(viewEndDate) == viewEndDate) {
@@ -740,6 +738,8 @@ function drawCalendarEvent(eventData, sd, ed) {
 
         var eventDiv = newEventDIV(eventData[0], eventData[1], starts, lasts,
                                    null, null, title);
+        siblings.push(eventDiv);
+        eventDiv.siblings = siblings;
         var dayString = days[i].getDayString();
 //      log("day: " + dayString);
         var parentDiv = null;
@@ -980,7 +980,7 @@ function _loadTasksHref(href) {
     document.tasksListAjaxRequest.aborted = true;
     document.tasksListAjaxRequest.abort();
   }
-  url = ApplicationBaseURL + "/" + href;
+  url = ApplicationBaseURL + href;
 
   var tasksList = $("tasksList");
   var selectedIds;
@@ -1103,17 +1103,25 @@ function onSearchFormSubmit() {
   return false;
 }
 
-function onCalendarSelectEvent() {
-  var list = $("eventsList");
-  $(list.tBodies[0]).deselectAll();
-
+function selectCalendarEvent(div) {
+  // Select event in calendar view
   if (selectedCalendarCell)
      for (var i = 0; i < selectedCalendarCell.length; i++)
        selectedCalendarCell[i].deselect();
 
-  for (var i = 0; i < this.siblings.length; i++)
-     this.siblings[i].select();
-  selectedCalendarCell = this.siblings;
+  for (var i = 0; i < div.siblings.length; i++)
+     div.siblings[i].select();
+
+  selectedCalendarCell = div.siblings;
+}
+
+function onCalendarSelectEvent() {
+  var list = $("eventsList");
+
+  selectCalendarEvent(this);
+
+  // Select event in events list
+  $(list.tBodies[0]).deselectAll();
   var row = $(this.cname);
   if (row) {
     var div = row.parentNode.parentNode.parentNode;
@@ -1207,7 +1215,7 @@ function updateTaskStatus(event) {
     newStatus = (newStatus ? 0 : 1);
   }
   
-  url = (ApplicationBaseURL + "/" + this.parentNode.calendar
+  url = (ApplicationBaseURL + this.parentNode.calendar
         + "/" + taskId + "/changeStatus?status=" + newStatus);
 
   if (http) {
@@ -1215,7 +1223,7 @@ function updateTaskStatus(event) {
     http.open("POST", url, false /* not async */);
     http.url = url;
     http.send("");
-    if (http.status == 200)
+    if (isHttpStatus204(http.status))
       refreshTasks();
   } else
     log ("no http client?");
@@ -1355,6 +1363,21 @@ function browseURL(anchor, event) {
   return false;
 }
 
+function onCalendarsMenuPrepareVisibility() {
+  var folders = $("calendarList");
+  var selected = folders.getSelectedNodes();  
+
+  if (selected.length > 0) {
+    var folderOwner = selected[0].getAttribute("owner");
+    var sharingOption = $(this).down("ul").childElements().last();
+    // Disable the "Sharing" option when calendar is not owned by user
+    if (folderOwner == UserLogin || IsSuperUser)
+      sharingOption.removeClassName("disabled");
+    else
+      sharingOption.addClassName("disabled");
+  }
+}
+
 function getMenus() {
    var menus = {};
 
@@ -1380,13 +1403,20 @@ function getMenus() {
                                      null, "-", onMenuSharing);
    menus["searchMenu"] = new Array(setSearchCriteria);
 
+   var calendarsMenu = $("calendarsMenu");
+   if (calendarsMenu)
+     calendarsMenu.prepareVisibility = onCalendarsMenuPrepareVisibility;
+
    return menus;
 }
 
 function onMenuSharing(event) {
+  if ($(this).hasClassName("disabled"))
+    return;
+
   var folders = $("calendarList");
   var selected = folders.getSelectedNodes()[0];
-  /* FIXME: activation of the context menu should preferable select the entry
+  /* FIXME: activation of the context menu should preferably select the entry
               above which the event has occured */
   if (selected) {
      var folderID = selected.getAttribute("id");
index 2aee3cfc7947f79f6f6b474f9054108830803d50..5350931e4b16f98fc179dee60e8b41548dc05c44 100644 (file)
@@ -2,6 +2,8 @@
 
 var contactSelectorAction = 'acls-contacts';
 var defaultUserID = '';
+var userRightsHeight;
+var userRightsWidth;
 
 function addUser(userName, userID) {
    if (!$(userID)) {
@@ -20,6 +22,7 @@ function addUserCallback(http) {
 
 function setEventsOnUserNode(node) {
    Event.observe(node, "mousedown", listRowMouseDownHandler);
+   Event.observe(node, "selectstart", listRowMouseDownHandler);
    Event.observe(node, "dblclick", onOpenUserRights);
    Event.observe(node, "click", onRowClick);
 }
@@ -97,8 +100,8 @@ function openRightsForUserID(userID) {
    elements[elements.length-1] = "userRights?uid=" + userID;
 
    window.open(elements.join("/"), "",
-              "width=" + this.userRightsWidth
-              + ",height=" + this.userRightsHeight
+              "width=" + userRightsWidth
+              + ",height=" + userRightsHeight
               + ",resizable=0,scrollbars=0,toolbar=0,"
               + "location=0,directories=0,status=0,menubar=0,copyhistory=0");
 }
@@ -138,8 +141,8 @@ function onAclLoadHandler() {
       Event.observe(buttons[1], "click", onUserRemove);
    }
 
-   this.userRightsHeight = window.opener.getUsersRightsWindowHeight();
-   this.userRightsWidth = window.opener.getUsersRightsWindowWidth();
+   userRightsHeight = window.opener.getUsersRightsWindowHeight();
+   userRightsWidth = window.opener.getUsersRightsWindowWidth();
 }
 
 FastInit.addOnLoad(onAclLoadHandler);
index 6dd1cd4a97963c58f8f9f01f2e6285a9bde41994..0f441cfa8aea4ddadcccbee903728cbbd64c2994 100644 (file)
@@ -23,15 +23,12 @@ var contactSelectorAction = 'calendars-contacts';
 
 function uixEarlierDate(date1, date2) {
   // can this be done in a sane way?
-  //   cuicui = 'year';
   if (date1.getYear()  < date2.getYear()) return date1;
   if (date1.getYear()  > date2.getYear()) return date2;
   // same year
-  //   cuicui += '/month';
   if (date1.getMonth() < date2.getMonth()) return date1;
   if (date1.getMonth() > date2.getMonth()) return date2;
   //   // same month
-  //   cuicui += '/date';
   if (date1.getDate() < date2.getDate()) return date1;
   if (date1.getDate() > date2.getDate()) return date2;
   // same day
@@ -68,10 +65,8 @@ function validateAptEditor() {
     alert(labels.validate_invalid_enddate);
     return false;
   }
-  //   cuicui = '';
   tmpdate = uixEarlierDate(startdate, enddate);
   if (tmpdate == enddate) {
-    //     window.alert(cuicui);
     alert(labels.validate_endbeforestart);
     return false;
   }
index da6488dd1971952a1affbc26ebd4c0d6f41aded2..877ef0c7b213051b4c767379681f33fa41338ed6 100644 (file)
@@ -1,2 +1,5 @@
 #attendeesLabel
 { display: none; }
+
+#organizerListLabel
+{ display: none; }
index 45b91ae6a5714ae01500e83eb4f7372f49b47a2f..4bb5f1145621a07ec97cfe0404b9693d68a0e69e 100644 (file)
 function onPopupAttendeesWindow(event) {
-   if (event)
-      preventDefault(event);
-   window.open(ApplicationBaseURL + "/editAttendees", null, 
-               "width=803,height=573");
+  if (event)
+    preventDefault(event);
+  window.open(ApplicationBaseURL + "/editAttendees", null, 
+             "width=803,height=573");
 
-   return false;
+  return false;
 }
 
 function onSelectPrivacy(event) {
-   if (event.button == 0 || (isSafari() && event.button == 1)) {
-      var node = getTarget(event);
-      if (node.tagName != 'BUTTON')
-       node = $(node).up("button");
-      popupToolbarMenu(node, "privacy-menu");
-      Event.stop(event);
-//       preventDefault(event);
-   }
+  if (event.button == 0 || (isSafari() && event.button == 1)) {
+    var node = getTarget(event);
+    if (node.tagName != 'BUTTON')
+      node = $(node).up("button");
+    popupToolbarMenu(node, "privacy-menu");
+    Event.stop(event);
+    //       preventDefault(event);
+  }
 }
 
 function onPopupUrlWindow(event) {
-   if (event)
-      preventDefault(event);
-
-   var urlInput = document.getElementById("url");
-   var newUrl = window.prompt(labels["Target:"], urlInput.value);
-   if (newUrl != null) {
-      var documentHref = $("documentHref");
-      var documentLabel = $("documentLabel");
-      if (documentHref.childNodes.length > 0) {
-        documentHref.childNodes[0].nodeValue = newUrl;
-        if (newUrl.length > 0)
-           documentLabel.setStyle({ display: "block" });
-        else
-           documentLabel.setStyle({ display: "none" });
-      }
-      else {
-        documentHref.appendChild(document.createTextNode(newUrl)); 
-        if (newUrl.length > 0)
-           documentLabel.setStyle({ display: "block" });
-      }
-      urlInput.value = newUrl;
-   }
-
-   return false;
+  if (event)
+    preventDefault(event);
+
+  var urlInput = document.getElementById("url");
+  var newUrl = window.prompt(labels["Target:"], urlInput.value);
+  if (newUrl != null) {
+    var documentHref = $("documentHref");
+    var documentLabel = $("documentLabel");
+    if (documentHref.childNodes.length > 0) {
+      documentHref.childNodes[0].nodeValue = newUrl;
+      if (newUrl.length > 0)
+       documentLabel.setStyle({ display: "block" });
+      else
+       documentLabel.setStyle({ display: "none" });
+    }
+    else {
+      documentHref.appendChild(document.createTextNode(newUrl)); 
+      if (newUrl.length > 0)
+       documentLabel.setStyle({ display: "block" });
+    }
+    urlInput.value = newUrl;
+  }
+
+  return false;
 }
 
 function onPopupDocumentWindow(event) {
-   var documentUrl = $("url");
+  var documentUrl = $("url");
 
-   preventDefault(event);
-   window.open(documentUrl.value, "SOGo_Document");
+  preventDefault(event);
+  window.open(documentUrl.value, "SOGo_Document");
 
-   return false;
+  return false;
 }
 
 function onMenuSetClassification(event) {
-   event.cancelBubble = true;
+  event.cancelBubble = true;
 
-   var classification = this.getAttribute("classification");
-   if (this.parentNode.chosenNode)
-      this.parentNode.chosenNode.removeClassName("_chosen");
-   this.addClassName("_chosen");
-   this.parentNode.chosenNode = this;
+  var classification = this.getAttribute("classification");
+  if (this.parentNode.chosenNode)
+    this.parentNode.chosenNode.removeClassName("_chosen");
+  this.addClassName("_chosen");
+  this.parentNode.chosenNode = this;
 
-//    log("classification: " + classification);
-   var privacyInput = document.getElementById("privacy");
-   privacyInput.value = classification;
+  //    log("classification: " + classification);
+  var privacyInput = document.getElementById("privacy");
+  privacyInput.value = classification;
 }
 
 function onChangeCalendar(event) {
-   var calendars = $("calendarFoldersList").value.split(",");
-   var form = document.forms["editform"];
-   var urlElems = form.getAttribute("action").split("/");
-   var choice = calendars[this.value];
-   urlElems[urlElems.length-3] = choice;
-   form.setAttribute("action", urlElems.join("/"));
+  var calendars = $("calendarFoldersList").value.split(",");
+  var form = document.forms["editform"];
+  var urlElems = form.getAttribute("action").split("/");
+  var choice = calendars[this.value];
+  urlElems[urlElems.length-3] = choice;
+  form.setAttribute("action", urlElems.join("/"));
 }
 
 function refreshAttendees() {
-   var attendeesLabel = $("attendeesLabel");
-   var attendeesNames = $("attendeesNames");
-   var attendeesHref = $("attendeesHref");
-
-   for (var i = 0; i < attendeesHref.childNodes.length; i++)
-     attendeesHref.removeChild(attendeesHref.childNodes[i]);
-
-   if (attendeesNames.value.length > 0) {
-      attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
-      attendeesLabel.setStyle({ display: "block" });
-   }
-   else
-      attendeesLabel.setStyle({ display: "none" });
+  var attendeesLabel = $("attendeesLabel");
+  var attendeesNames = $("attendeesNames");
+  var attendeesHref = $("attendeesHref");
+  var organizerListLabel = $("organizerListLabel");
+
+  log ("label: "+ organizerListLabel);
+  for (var i = 0; i < attendeesHref.childNodes.length; i++)
+    attendeesHref.removeChild(attendeesHref.childNodes[i]);
+
+  if (attendeesNames.value.length > 0) {
+    attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
+    attendeesLabel.setStyle({ display: "block" });
+    if (organizerListLabel)
+      organizerListLabel.setStyle({ display: "block" });
+  }
+  else {
+    attendeesLabel.setStyle({ display: "none" });
+    if (organizerListLabel)
+      organizerListLabel.setStyle({ display: "none" });
+  }
 }
 
 function initializeAttendeesHref() {
-   var attendeesHref = $("attendeesHref");
-   var attendeesLabel = $("attendeesLabel");
-   var attendeesNames = $("attendeesNames");
-
-   Event.observe(attendeesHref, "click", onPopupAttendeesWindow, false);
-   if (attendeesNames.value.length > 0) {
-      attendeesHref.setStyle({ textDecoration: "underline", color: "#00f" });
-      attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
-      attendeesLabel.setStyle({ display: "block" });
-   }
+  var attendeesHref = $("attendeesHref");
+  var attendeesLabel = $("attendeesLabel");
+  var attendeesNames = $("attendeesNames");
+  var organizerListLabel = $("organizerListLabel");
+
+  Event.observe(attendeesHref, "click", onPopupAttendeesWindow, false);
+  if (attendeesNames.value.length > 0) {
+    if (organizerListLabel)
+      organizerListLabel.setStyle({ display: "block" });
+    attendeesHref.setStyle({ textDecoration: "underline", color: "#00f" });
+    attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
+    attendeesLabel.setStyle({ display: "block" });
+  }
 }
 
 function initializeDocumentHref() {
-   var documentHref = $("documentHref");
-   var documentLabel = $("documentLabel");
-   var documentUrl = $("url");
-
-   Event.observe(documentHref, "click", onPopupDocumentWindow, false);
-   documentHref.setStyle({ textDecoration: "underline", color: "#00f" });
-   if (documentUrl.value.length > 0) {
-      documentHref.appendChild(document.createTextNode(documentUrl.value));
-      documentLabel.setStyle({ display: "block" });
-   }
-
-   var changeUrlButton = $("changeUrlButton");
-   Event.observe(changeUrlButton, "click", onPopupUrlWindow, false);
+  var documentHref = $("documentHref");
+  var documentLabel = $("documentLabel");
+  var documentUrl = $("url");
+
+  Event.observe(documentHref, "click", onPopupDocumentWindow, false);
+  documentHref.setStyle({ textDecoration: "underline", color: "#00f" });
+  if (documentUrl.value.length > 0) {
+    documentHref.appendChild(document.createTextNode(documentUrl.value));
+    documentLabel.setStyle({ display: "block" });
+  }
+
+  var changeUrlButton = $("changeUrlButton");
+  Event.observe(changeUrlButton, "click", onPopupUrlWindow, false);
 }
 
 function initializePrivacyMenu() {
-   var privacy = $("privacy").value.toUpperCase();
-   if (privacy.length > 0) {
-      var privacyMenu = $("privacy-menu").childNodesWithTag("ul")[0];
-      var menuEntries = $(privacyMenu).childNodesWithTag("li");
-      var chosenNode;
-      if (privacy == "CONFIDENTIAL")
-        chosenNode = menuEntries[1];
-      else if (privacy == "PRIVATE")
-        chosenNode = menuEntries[2];
-      else
-        chosenNode = menuEntries[0];
-      privacyMenu.chosenNode = chosenNode;
-      $(chosenNode).addClassName("_chosen");
-   }
+  var privacy = $("privacy").value.toUpperCase();
+  if (privacy.length > 0) {
+    var privacyMenu = $("privacy-menu").childNodesWithTag("ul")[0];
+    var menuEntries = $(privacyMenu).childNodesWithTag("li");
+    var chosenNode;
+    if (privacy == "CONFIDENTIAL")
+      chosenNode = menuEntries[1];
+    else if (privacy == "PRIVATE")
+      chosenNode = menuEntries[2];
+    else
+      chosenNode = menuEntries[0];
+    privacyMenu.chosenNode = chosenNode;
+    $(chosenNode).addClassName("_chosen");
+  }
 }
 
 function onComponentEditorLoad(event) {
-   if (!$("statusPercent"))
-      initializeAttendeesHref();
-   initializeDocumentHref();
-   initializePrivacyMenu();
-   var list = $("calendarList");
-   Event.observe(list, "mousedown",
-                onChangeCalendar.bindAsEventListener(list),
-                false);
-   list.fire("mousedown");
-
-   var menuItems = $("itemPrivacyList").childNodesWithTag("li");
-   for (var i = 0; i < menuItems.length; i++)
-      Event.observe(menuItems[i], "mousedown",
-                   onMenuSetClassification.bindAsEventListener(menuItems[i]),
-                   false);
+  if (!$("statusPercent"))
+    initializeAttendeesHref();
+  initializeDocumentHref();
+  initializePrivacyMenu();
+  var list = $("calendarList");
+  Event.observe(list, "mousedown",
+               onChangeCalendar.bindAsEventListener(list),
+               false);
+  list.fire("mousedown");
+
+  var menuItems = $("itemPrivacyList").childNodesWithTag("li");
+  for (var i = 0; i < menuItems.length; i++)
+    Event.observe(menuItems[i], "mousedown",
+                 onMenuSetClassification.bindAsEventListener(menuItems[i]),
+                 false);
 }
 
 FastInit.addOnLoad(onComponentEditorLoad);
index 328b8a4cdf913f828ccf1b98ce592fa364263a42..87a7c490c93191d789a11071940ed761c1818241 100644 (file)
@@ -61,6 +61,9 @@ SPAN.headerField
 { line-height: 2.0em;
   padding-left: 0.5em; }
 
+TABLE#addressList TR#lastRow SELECT
+{ visibility: hidden; }
+
 DIV#subjectRow INPUT
 { background-image: none;
   width: 60%; }
index 5c03ab96ce0c165fcd0a3c154cb098989359f28d..edd22041c0bff9c79c10a16c1d51d676ba737328 100644 (file)
@@ -22,3 +22,11 @@ DIV#mailOptionsView TEXTAREA
 DIV#passwordView
 { padding-top: 3em;
   padding-right: 10em; }
+
+DIV#identitiesView
+{ padding-top: 5px;
+  padding-left: 5px; }
+
+#signature
+{ width: 380px;
+  height: 125px; }
index c546c7922a43a51465c2fd3e372c953ea436d819..ce7a12ed45171a4c42d9c14348d16ee1f19d6cc7 100644 (file)
@@ -571,6 +571,7 @@ function popupMenu(event, menuId, target) {
 
   if (popup.prepareVisibility)
     popup.prepareVisibility();
+  
   popup.setStyle({ top: menuTop + "px",
                   left: menuLeft + "px",
                   visibility: "visible" });