]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1274 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 22 Nov 2007 16:33:38 +0000 (16:33 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 22 Nov 2007 16:33:38 +0000 (16:33 +0000)
33 files changed:
ChangeLog
SOPE/NGCards/ChangeLog
SOPE/NGCards/iCalEntityObject.m
SoObjects/Appointments/SOGoAppointmentFolder.h
SoObjects/Appointments/SOGoAppointmentFolder.m
SoObjects/Appointments/SOGoGroupAppointmentFolder.m
SoObjects/Mailer/SOGoMailBodyPart.m
SoObjects/Mailer/SOGoMailObject.m
SoObjects/SOGo/NSCalendarDate+SOGo.h
SoObjects/SOGo/NSCalendarDate+SOGo.m
UI/Common/UIxAclEditor.m
UI/MailPartViewers/UIxMailPartHTMLViewer.m
UI/MailPartViewers/UIxMailRenderingContext.m
UI/MainUI/SOGoRootPage.m
UI/Scheduler/UIxCalListingActions.h
UI/Scheduler/UIxCalListingActions.m
UI/Scheduler/UIxComponentEditor.h
UI/Scheduler/UIxComponentEditor.m
UI/Templates/SchedulerUI/UIxComponentEditor.wox
UI/Templates/UIxAclEditor.wox
UI/WebServerResources/ContactsUI.css
UI/WebServerResources/ContactsUI.js
UI/WebServerResources/MailerUI.css
UI/WebServerResources/MailerUI.js
UI/WebServerResources/SOGoRootPage.js
UI/WebServerResources/SchedulerUI.js
UI/WebServerResources/UIxAppointmentEditor.css
UI/WebServerResources/UIxAttendeesEditor.css
UI/WebServerResources/UIxComponentEditor.css
UI/WebServerResources/UIxComponentEditor.js
UI/WebServerResources/UIxMailEditor.js
UI/WebServerResources/generic.js
UI/WebServerResources/iefixes.css

index 2f24b0ec70d554c05243654e86d0569dc43d4e2d..b4f6d4fd791e69078bdf66d808e0fe7efcd78cb0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,50 @@
+2007-11-22  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/SOGo/NSCalendarDate+SOGo.m ([NSCalendarDate
+       +distantFuture]): rewrote method to return an object that is
+       compatible with NSCalendarDate, unlike the implementation in
+       GNUstep.
+       ([NSCalendarDate +distantPast]): same as above.
+
+2007-11-21  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * UI/MailPartViewers/UIxMailPartHTMLViewer.m: fixed infinite loop
+       when charset is us-ascii, match it to ascii rather than none.
+
+       * SoObjects/Appointments/SOGoAppointmentFolder.m
+       ([SOGoAppointmentFolder
+       -fetchFields:_fieldsfromFolder:_folderfrom:_startDateto:_endDatetitle:titlecomponent:_component]):
+       added search on the c_title column too.
+
+       * UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions
+       -eventsListAction]): take the "search" url parameter into account.
+       ([UIxCalListingActions -eventsListAction]): fetch events matching
+       the title filter too.
+
+       * UI/MainUI/SOGoRootPage.m ([SOGoRootPage -connectAction]): the
+       user infos are now posted as "application/x-www-form-urlencoded".
+       So we have to have like a form has been posted.
+
+2007-11-21  Francis Lachapelle  <flachapelle@inverse.ca>
+
+       * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
+       -calendarList]): also returns the calendar of the current
+       event. This is required so the proper calender is selected when
+       you view an event to which you don't have write access.
+
+       * UI/Common/UIxAclEditor.m ([UIxAclEditor -currentUserIsOwner]): 
+       also returns true for super users.
+
+2007-11-21  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject
+       -lookupImap4BodyPartKey:inContext:]): return a correct body part
+       when "0" is requested, taking its mime-type into account.
+
+       * UI/MailPartViewers/UIxMailRenderingContext.m
+       ([UIxMailRenderingContext -flatContentForPartPath:_partPath]):
+       return content for part "0", which would be the message body.
+
 2007-11-20  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * UI/MailPartViewers/UIxMailPartHTMLViewer.m
index 55ec998f42445f0bd33c9e1c8a117482f2155f79..75c6d547e09840161b8c4ed6491e8f639fb20ce4 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-22  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * iCalEntityObject.m ([iCalEntityObject -compare:otherObject]):
+       safely compare between objects which may be nil.
+
 2007-11-18  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * iCalPerson.m ([-rsvp]): return lowercase string.
index 53a51c1f625a4c8b118f54a80ae9bfa36d9a8451..45ac1f90c7d1f10a566839496248f9f537dd5d77 100644 (file)
   return nil; /* not found */
 }
 
+- (NSComparisonResult) _compareValue: (id) selfValue
+                          withValue: (id) otherValue
+{
+  NSComparisonResult result;
+
+  if (selfValue)
+    {
+      if (otherValue)
+       result = [selfValue compare: otherValue];
+      else
+       result = NSOrderedDescending;
+    }
+  else
+    {
+      if (otherValue)
+       result = NSOrderedAscending;
+      else
+       result = NSOrderedSame;
+    }
+
+  return result;
+}
+
 - (NSComparisonResult) _compareVersions: (iCalEntityObject *) otherObject
 {
   NSComparisonResult result;
 
-  result = [[self sequence] compare: [otherObject sequence]];
+  result = [self _compareValue: [self sequence]
+                withValue: [otherObject sequence]];
   if (result == NSOrderedSame)
-    result = [[self lastModified] compare: [otherObject lastModified]];
+    result = [self _compareValue: [self lastModified]
+                  withValue: [otherObject lastModified]];
 
   return result;
 }
index 27a24c9adc703ea4690cf8c43f35e137990c4c82..851b4855b88b852ef7faaf8ce696976e67d938eb 100644 (file)
                fromFolder: (GCSFolder *) _folder
                      from: (NSCalendarDate *) _startDate
                        to: (NSCalendarDate *) _endDate
+                   title: (NSString *) title
                 component: (id) _component;
 
 - (NSArray * ) fetchFields: (NSArray *) _fields
                       from: (NSCalendarDate *) _startDate
                         to: (NSCalendarDate *) _endDate
+                    title: (NSString *) title
                  component: (id) _component;
 
 - (NSArray *) fetchCoreInfosFrom: (NSCalendarDate *) _startDate
                               to: (NSCalendarDate *) _endDate
+                          title: (NSString *) title
                        component: (id) _component;
 
 - (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) _startDate
index b6f295a2e3894a92296abec1530ef69b94ec3418..9d740ed7f6832fa7fb63cca2f77674474ded0831 100644 (file)
@@ -266,6 +266,7 @@ static NSNumber   *sharedYes = nil;
       currentFilter = [filters objectAtIndex: 0];
       apts = [self fetchCoreInfosFrom: [currentFilter objectForKey: @"start"]
                    to: [currentFilter objectForKey: @"end"]
+                  title: [currentFilter objectForKey: @"title"]
                    component: [currentFilter objectForKey: @"name"]];
       appointments = [apts objectEnumerator];
       appointment = [appointments nextObject];
@@ -801,12 +802,14 @@ static NSNumber   *sharedYes = nil;
                fromFolder: (GCSFolder *) _folder
                      from: (NSCalendarDate *) _startDate
                        to: (NSCalendarDate *) _endDate 
+                   title: (NSString *) title
                 component: (id) _component
 {
   EOQualifier *qualifier;
   NSMutableArray *fields, *ma = nil;
   NSArray *records;
-  NSString *sql, *dateSqlString, *componentSqlString, *privacySqlString;
+  NSString *sql, *dateSqlString, *titleSqlString, *componentSqlString,
+               *privacySqlString;
   NGCalendarDateRange *r;
 
   if (_folder == nil) {
@@ -827,6 +830,12 @@ static NSNumber   *sharedYes = nil;
       dateSqlString = @"";
     }
 
+  if ([title length])
+    titleSqlString = [NSString stringWithFormat: @"AND (c_title"
+                              @" isCaseInsensitiveLike: '%%%@%%')", title];
+  else
+    titleSqlString = @"";
+
   componentSqlString = [self _sqlStringForComponent: _component];
   privacySqlString = [self _privacySqlString];
 
@@ -840,8 +849,9 @@ static NSNumber   *sharedYes = nil;
   if (logger)
     [self debugWithFormat:@"should fetch (%@=>%@) ...", _startDate, _endDate];
 
-  sql = [NSString stringWithFormat: @"(c_iscycle = 0)%@%@%@",
-                  dateSqlString, componentSqlString, privacySqlString];
+  sql = [NSString stringWithFormat: @"(c_iscycle = 0)%@%@%@%@",
+                  dateSqlString, titleSqlString,
+                 componentSqlString, privacySqlString];
 
   /* fetch non-recurrent apts first */
   qualifier = [EOQualifier qualifierWithQualifierFormat: sql];
@@ -860,7 +870,8 @@ static NSNumber   *sharedYes = nil;
   /* fetch recurrent apts now. we do NOT consider the date range when doing that
      as the c_startdate/c_enddate of a recurring event is always set to the first
      recurrence - others are generated on the fly */
-  sql = [NSString stringWithFormat: @"(c_iscycle = 1)%@%@", componentSqlString, privacySqlString];
+  sql = [NSString stringWithFormat: @"(c_iscycle = 1)%@%@%@", titleSqlString,
+                 componentSqlString, privacySqlString];
 
   qualifier = [EOQualifier qualifierWithQualifierFormat: sql];
 
@@ -896,6 +907,7 @@ static NSNumber   *sharedYes = nil;
 - (NSArray *) fetchFields: (NSArray *) _fields
                      from: (NSCalendarDate *) _startDate
                        to: (NSCalendarDate *) _endDate 
+                   title: (NSString *) title
                 component: (id) _component
 {
   GCSFolder *folder;
@@ -908,6 +920,7 @@ static NSNumber   *sharedYes = nil;
 
   return [self fetchFields: _fields fromFolder: folder
                from: _startDate to: _endDate
+              title: title
                component: _component];
 }
 
@@ -921,11 +934,13 @@ static NSNumber   *sharedYes = nil;
                              @"c_isopaque", @"c_status", nil];
 
   return [self fetchFields: infos from: _startDate to: _endDate
+              title: nil
                component: @"vevent"];
 }
 
 - (NSArray *) fetchCoreInfosFrom: (NSCalendarDate *) _startDate
                               to: (NSCalendarDate *) _endDate
+                          title: (NSString *) title
                        component: (id) _component
 {
   static NSArray *infos = nil; // TODO: move to a plist file
@@ -940,7 +955,7 @@ static NSNumber   *sharedYes = nil;
                              @"c_partstates", @"c_sequence", @"c_priority", @"c_cycleinfo",
                             nil];
 
-  return [self fetchFields: infos from: _startDate to: _endDate
+  return [self fetchFields: infos from: _startDate to: _endDate title: title
                component: _component];
 }
 
index ad33f26d6a11f038bf667b7a5c4a7a8ba906241e..28b8da8a942ecf56800897158cddaf7e016fc981 100644 (file)
     results = [aptFolder fetchFields: _fields
                          from: _startDate
                          to: _endDate
+                        title: nil
                          component: _component];
     if (![results isNotNull]) continue;
     
index e770fa92ca9563a51d1f9cdbafb8c6e28a136fef..fd4ebf41d5faae4e762020e9f9bf0aae9c014455 100644 (file)
@@ -368,14 +368,11 @@ static BOOL debugOn = NO;
     classString = @"SOGoMessageMailBodyPart";
   else
     {
-      NSLog (@"unhandled mime type: '%@'", mimeType);
-      classString = nil;
+      classString = @"SOGoMailBodyPart";
+//       NSLog (@"unhandled mime type: '%@'", mimeType);
     }
 
-  if (classString)
-    klazz = NSClassFromString (classString);
-  else
-    klazz = [SOGoMailBodyPart class];
+  klazz = NSClassFromString (classString);
 
   return klazz;
 }
index c2a5bd0e40309c6b29ac4eb0643f9ef795dd3a83..086bdfb44a738fd13de5fae616049ed5d3a9708f 100644 (file)
@@ -756,22 +756,29 @@ static BOOL debugSoParts       = NO;
 
   /* We don't have parts here but we're trying to download the message's
      content that could be an image/jpeg, as an example */
-  if ([parts count] == 0)
+  if ([parts count] == 0 && ![_key intValue])
     {
-      return [SOGoMailBodyPart objectWithName: @"1" inContainer: self];
+      partDesc = [self bodyStructure];
+      _key = @"1";
+    }
+  else
+    {
+      part = [_key intValue] - 1;
+      if (part > -1 && part < [parts count])
+       partDesc = [parts objectAtIndex: part];
+      else
+       partDesc = nil;
     }
 
-  part = [_key intValue] - 1;
-  if (part > -1 && part < [parts count])
+  if (partDesc)
     {
-      partDesc = [parts objectAtIndex: part];
       mimeType = [[partDesc keysWithFormat: @"%{type}/%{subtype}"] lowercaseString];
       clazz = [SOGoMailBodyPart bodyPartClassForMimeType: mimeType
                                inContext: _ctx];
     }
   else
     clazz = Nil;
-
+    
   return [clazz objectWithName:_key inContainer: self];
 }
 
index ca6d710d3341ccdd77e38cc8e007ca0a04698bf5..61ad14f1dc69e5baf7b05ba6f958fad2c150624c 100644 (file)
@@ -41,6 +41,9 @@
 
 - (NSString *) rfc822DateString;
 
++ (id) distantFuture;
++ (id) distantPast;
+
 @end
 
 #endif /* NSCALENDARDATE_SCHEDULER_H */
index c3cd249216b60cc87c562ebc7f983effe2a299af..1084f066a37b3e9ad9e98c63a3f72cbdc2e10582 100644 (file)
@@ -136,4 +136,29 @@ static NSString *rfc822Months[] = {@"", @"Jan", @"Feb", @"Mar", @"Apr",
              timeZoneShift];
 }
 
+#define secondsOfDistantFuture 63113990400.0
+#define secondsOfDistantPast -63113817600.0
+
++ (id) distantFuture
+{
+  static NSCalendarDate *date = nil;
+
+  if (!date)
+    date
+      = [[self alloc] initWithTimeIntervalSinceReferenceDate: secondsOfDistantFuture];
+
+  return date;
+}
+
++ (id) distantPast
+{
+  static NSCalendarDate *date = nil;
+
+  if (!date)
+    date
+      = [[self alloc] initWithTimeIntervalSinceReferenceDate: secondsOfDistantPast];
+
+  return date;
+}
+
 @end
index 123bd49610b24e07a4ff875e840e69602dfbdfd2..7d7936c4a998f01512066eda247ff6fcf4085202 100644 (file)
@@ -30,6 +30,7 @@
 #import <SoObjects/SOGo/SOGoContentObject.h>
 #import <SoObjects/SOGo/SOGoPermissions.h>
 #import <SoObjects/SOGo/NSArray+Utilities.h>
+#import <SoObjects/SOGo/SOGoUser.h>
 
 #import "UIxAclEditor.h"
 
   return [self _displayNameForUID: currentUser];
 }
 
-- (NSString *) toolbar
-{
-  NSString *currentLogin, *ownerLogin;
-
-  currentLogin = [[context activeUser] login];
-  ownerLogin = [[self clientObject] ownerInContext: context];
-
-  return (([ownerLogin isEqualToString: currentLogin])
-          ? @"SOGoAclOwner.toolbar" : @"SOGoAclAssistant.toolbar");
-}
-
 - (void) setUserUIDS: (NSString *) retainedUsers
 {
   if ([retainedUsers length] > 0)
 - (BOOL) currentUserIsOwner
 {
   SOGoObject *clientObject;
+  SOGoUser *user;
   NSString *currentUserLogin, *ownerLogin;
-
+  
   clientObject = [self clientObject];
   ownerLogin = [clientObject ownerInContext: context];
-  currentUserLogin = [[context activeUser] login];
-
-  return [ownerLogin isEqualToString: currentUserLogin];
+  user = [context activeUser];
+  currentUserLogin = [user login];
+  
+  return ([ownerLogin isEqualToString: currentUserLogin]
+         || ([user respondsToSelector: @selector (isSuperUser)]
+             && [user isSuperUser]));
 }
 
 // - (id <WOActionResults>) addUserInAcls
index c93c83b26606a8b60cc0500e2a0017f541bcb287..c88f04d5617e5a4caea18e9d11f0f7bc50e2873d 100644 (file)
 - (xmlCharEncoding) _xmlCharsetForCharset: (NSString *) charset
 {
   struct { NSString *name; xmlCharEncoding encoding; } xmlEncodings[] = {
-    { @"us-ascii", XML_CHAR_ENCODING_NONE},
+    { @"us-ascii", XML_CHAR_ENCODING_ASCII},
     { @"utf-8", XML_CHAR_ENCODING_UTF8},
     { @"utf-16le", XML_CHAR_ENCODING_UTF16LE},
     { @"utf-16be",  XML_CHAR_ENCODING_UTF16BE},
     { @"iso-8859-9", XML_CHAR_ENCODING_8859_9},
     { @"iso-2022-jp", XML_CHAR_ENCODING_2022_JP},
 //     { @"iso-2022-jp", XML_CHAR_ENCODING_SHIFT_JIS},
-    { @"euc-jp", XML_CHAR_ENCODING_EUC_JP},
-    { @"us-ascii", XML_CHAR_ENCODING_ASCII}};
+    { @"euc-jp", XML_CHAR_ENCODING_EUC_JP}};
   unsigned count;
   xmlCharEncoding encoding;
 
index 11d289f39b3ebaef7b0a54da8d4f89de8e2c18c1..74494f4d2ea8aa27c2a5f17839b7b2228d88e1b9 100644 (file)
@@ -117,10 +117,14 @@ static BOOL showNamedTextAttachmentsInline = NO;
 - (NSData *) flatContentForPartPath: (NSArray *) _partPath
 {
   NSString *pid;
-  
-  pid = _partPath ? [_partPath componentsJoinedByString:@"."] : @"";
+  NSData *content;
+
+  pid = _partPath ? [_partPath componentsJoinedByString: @"."] : @"";
+  content = [[self flatContents] objectForKey: pid];
+  if (!content && ![pid intValue])
+    content = [flatContents objectForKey: @""];
 
-  return [[self flatContents] objectForKey:pid];
+  return content;
 }
 
 /* viewer components */
index 8b82c41010a6f7ef9a261cfdfad7fc50e4f79199..5b6b6364e00ca3610ac84e86f01449436e5f99dd 100644 (file)
 - (id <WOActionResults>) connectAction
 {
   WOResponse *response;
+  WORequest *request;
   WOCookie *authCookie;
   SOGoWebAuthenticator *auth;
   NSString *cookieValue, *cookieString;
 
   auth = [[WOApplication application]
           authenticatorInContext: context];
+  request = [context request];
   response = [self responseWith204];
   cookieString = [NSString stringWithFormat: @"%@:%@",
-                          [self queryParameterForKey: @"userName"],
-                          [self queryParameterForKey: @"password"]];
+                          [request formValueForKey: @"userName"],
+                          [request formValueForKey: @"password"]];
   cookieValue = [NSString stringWithFormat: @"basic %@",
                          [cookieString stringByEncodingBase64]];
   authCookie = [WOCookie cookieWithName: [auth cookieNameInContext: context]
index 7ef811d3d04d602d6e525ac4b175620d2f341aca..cb81e40f7d9158fc7aba61d243ce754150182355 100644 (file)
@@ -41,6 +41,7 @@
   NSMutableDictionary *componentsData;
   NSCalendarDate *startDate;
   NSCalendarDate *endDate;
+  NSString *title;
   NSString *userLogin;
   WORequest *request;
   SOGoDateFormatter *dateFormatter;
index 0937d932ec24d22d6bf7cfddc65e48ecc3593b8c..3346c739e6ce5fae55659c351394bd745c44ab66 100644 (file)
 
   param = [request formValueForKey: @"filterpopup"];
   if ([param length] > 0)
-    [self _setupDatesWithPopup: param andUserTZ: userTZ];
+    {
+      [self _setupDatesWithPopup: param andUserTZ: userTZ];
+      title = [request formValueForKey: @"search"];
+    }
   else
     {
       param = [request formValueForKey: @"sd"];
        {
          currentInfos = [[currentFolder fetchCoreInfosFrom: startDate
                                         to: endDate
+                                        title: title
                                         component: component] objectEnumerator];
 
          while ((newInfo = [currentInfos nextObject]))
index 12ff2c7b75f7bd54dee30e7804267bc3045fc95d..34b2688dae280e2739cdd39fd24cd6e6c0fc8aa9 100644 (file)
@@ -74,6 +74,8 @@
 - (void) setItem: (id) _item;
 - (id) item;
 
+- (SOGoAppointmentFolder *) componentCalendar;
+
 - (NSArray *) categoryList;
 - (void) setCategories: (NSArray *) _categories;
 - (NSArray *) categories;
index 49083d4eaeb841ce4bce16a7627a62e549b0ebd7..9e5f812f8acc00b0fc8b857e368a68ea60466405 100644 (file)
 
 - (NSArray *) calendarList
 {
-  SOGoAppointmentFolder *currentCalendar;
+  SOGoAppointmentFolder *calendar, *currentCalendar;
   SOGoAppointmentFolders *calendarParent;
   NSEnumerator *allCalendars;
   SoSecurityManager *sm;
       calendarParent
        = [[context activeUser] calendarsFolderInContext: context];
       sm = [SoSecurityManager sharedSecurityManager];
+      calendar = [self componentCalendar];
       allCalendars = [[calendarParent subFolders] objectEnumerator];
       while ((currentCalendar = [allCalendars nextObject]))
-       if (![sm validatePermission: perm
+       if ([calendar isEqual: currentCalendar] ||
+           ![sm validatePermission: perm
                 onObject: currentCalendar
                 inContext: context])
          [calendarList addObject: currentCalendar];
index 2c01d63eca808eb07f59a6e74d8fcfa8eb405327..84b1d03246db495466f206227e66b33af2a057f2 100644 (file)
@@ -48,7 +48,7 @@
           <var:popup const:id="calendarList"
            list="calendarList" item="item"
             string="calendarDisplayName"
-           selection="componentCalendar"
+           var:selection="componentCalendar"
            /></span></span>
       <span class="checkBoxList"><var:string label:value="Priority:" />
          <span class="content"><var:popup list="priorities" item="item"
index b967c8974d2fc131b684a09d82db52931a3f9f2a..85ec945645e67a5092a7ed0f92fd7e92e8e005d0 100644 (file)
@@ -8,7 +8,7 @@
   xmlns:rsrc="OGo:url"
   className="UIxPageFrame"
   title="title"
-  var:toolbar="toolbar"
+  const:toolbar="SOGoAclOwner.toolbar"
   const:popup="YES">
 
   <form id="aclForm" const:href="saveAcls">
index 97d1d7f269d4ecdf4e4ab214328e550fef2ab9e6..65f6b3dc8e29eca01cee82f3ef35935d27987e5a 100644 (file)
@@ -73,7 +73,7 @@ DIV#contactsListContent
   padding-left: 1em;
 }
 
-table.titletable
+TABLE.titletable
 {
   height: 24px;
   vertical-align: middle;
@@ -81,7 +81,7 @@ table.titletable
   padding-left: 6px;
 }
 
-td.titlecell
+TD.titlecell
 {
   height: 22px;
   vertical-align: middle;
@@ -89,7 +89,7 @@ td.titlecell
   white-space: nowrap;
 }
 
-table.titletable td.titlecell SELECT
+TABLE.titletable TD.titlecell SELECT
 { 
   display: -moz-popup;
   border-top: 1px solid #fff;
@@ -174,6 +174,7 @@ TABLE#contactsList
 TABLE#contactsList TD,
 TABLE#contactsList TH
 { overflow: hidden;
+  line-height: 16px;
   white-space: nowrap; } /* pre, normal, nowrap */
 
 TABLE#contactsList TH
index 42ced264f9b9188f3bcd351c78069391f5591a4d..293a983020d26572c2529cb109bf48ca73b789a1 100644 (file)
@@ -452,7 +452,7 @@ function onFolderSelectionChange() {
 }
 
 function refreshCurrentFolder() {
-   openContactsFolder(currentContactFolder, true);
+  openContactsFolder(currentContactFolder, true);
 }
 
 function onConfirmContactSelection(event) {
@@ -476,7 +476,7 @@ function onConfirmContactSelection(event) {
       var cid = rows[i].getAttribute("contactid");
       var cname = '' + rows[i].getAttribute("contactname");
       var email = '' + rows[i].cells[1].innerHTML;
-      opener.window.addContact(tag, currentContactFolderName + '/' + cname,
+      window.opener.addContact(tag, currentContactFolderName + '/' + cname,
                               cid, cname, email);
    }
 
@@ -784,6 +784,10 @@ function initContacts(event) {
      configureSortableTableHeaders(table);
      TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true});
    }
+
+   // Default sort options
+   sorting["attribute"] = "displayName";
+   sorting["ascending"] = true;
 }
 
 FastInit.addOnLoad(initContacts);
index 04970b43a2c66c8117ae0e0054e6267437e36df9..a0a3dcfe9c9721e8a6daa845d5e2a5826fc717d3 100644 (file)
@@ -391,7 +391,7 @@ TD.mailer_fieldname
   text-align: right;
   font-weight: bold;
   vertical-align: top;
-  width: 6em;
+  width: 7em;
 }
 
 TD.mailer_fieldvalue
index 9af0b91e38077dd28d3ccceaa80c66f9c0868bdc..e452b4367c147007a4465b5a7cadbf79774092f2 100644 (file)
@@ -9,11 +9,13 @@ if (typeof textMailAccounts != 'undefined') {
     mailAccounts = new Array();
 }
 
-var currentMessages = {};
-var maxCachedMessages = 20;
-var cachedMessages = new Array();
-var currentMailbox = null;
-var currentMailboxType = "";
+var Mailer = {
+ currentMessages: {},
+ maxCachedMessages: 20,
+ cachedMessages: new Array(),
+ currentMailbox: null,
+ currentMailboxType: ""
+};
 
 var usersRightsWindowHeight = 320;
 var usersRightsWindowWidth = 400;
@@ -41,7 +43,7 @@ function openMessageWindow(msguid, url) {
 function onMessageDoubleClick(event) {
   var action;
 
-  if (currentMailboxType == "draft")
+  if (Mailer.currentMailboxType == "draft")
     action = "edit";
   else
     action = "popupview";
@@ -129,7 +131,10 @@ function markMailReadInWindow(win, msguid) {
 
 function openMessageWindowsForSelection(action, firstOnly) {
   if (document.body.hasClassName("popup")) {
-    return true;
+    var url = window.location.href;
+    var parts = url.split("/");
+    parts[parts.length-1] = action;
+    window.location.href = parts.join("/");
   }
   else {
     var messageList = $("messageList");
@@ -137,7 +142,7 @@ function openMessageWindowsForSelection(action, firstOnly) {
     if (rows.length > 0) {
       for (var i = 0; i < rows.length; i++) {
        openMessageWindow(rows[i].substr(4),
-                         ApplicationBaseURL + currentMailbox
+                         ApplicationBaseURL + Mailer.currentMailbox
                          + "/" + rows[i].substr(4)
                          + "/" + action);
        if (firstOnly)
@@ -163,7 +168,7 @@ function mailListMarkMessage(event) {
     action = 'markMessageUnread';
     markread = false;
   }
-  var url = ApplicationBaseURL + currentMailbox + "/" + msguid + "/" + action;
+  var url = ApplicationBaseURL + Mailer.currentMailbox + "/" + msguid + "/" + action;
 
   var data = { "window": window, "msguid": msguid, "markread": markread };
   triggerAjaxRequest(url, mailListMarkMessageCallback, data);
@@ -215,10 +220,10 @@ function deleteSelectedMessages(sender) {
     for (var i = 0; i < rowIds.length; i++) {
       var url;
       var rowId = rowIds[i].substr(4);
-      var messageId = currentMailbox + "/" + rowId;
+      var messageId = Mailer.currentMailbox + "/" + rowId;
       url = ApplicationBaseURL + messageId + "/trash";
       deleteMessageRequestCount++;
-      var data = { "id": rowId, "mailbox": currentMailbox, "messageId": messageId };
+      var data = { "id": rowId, "mailbox": Mailer.currentMailbox, "messageId": messageId };
       triggerAjaxRequest(url, deleteSelectedMessagesCallback, data);
     }
   } else {
@@ -233,12 +238,12 @@ function deleteSelectedMessagesCallback(http) {
     if (isHttpStatus204(http.status)) {
       var data = http.callbackData;
       deleteCachedMessage(data["messageId"]);
-      if (currentMailbox == data["mailbox"]) {
+      if (Mailer.currentMailbox == data["mailbox"]) {
        
        var div = $('messageContent');
-       if (currentMessages[currentMailbox] == data["id"]) {
+       if (Mailer.currentMessages[Mailer.currentMailbox] == data["id"]) {
          div.update();
-         currentMessages[currentMailbox] = null;       
+         Mailer.currentMessages[Mailer.currentMailbox] = null; 
        }
 
        var row = $("row_" + data["id"]);
@@ -246,6 +251,9 @@ function deleteSelectedMessagesCallback(http) {
 //     row.addClassName("deleted"); // when we'll offer "mark as deleted"
 
        deleteMessageRequestCount--;
+      
+       if (deleteMessageRequestCount == 0)
+         openMailbox(data["mailbox"], true);
       }
     }
   }
@@ -272,7 +280,7 @@ function moveMessages(rowIds, folder) {
 
     /* send AJAX request (synchronously) */
          
-    var messageId = currentMailbox + "/" + rowIds[i];
+    var messageId = Mailer.currentMailbox + "/" + rowIds[i];
     url = (ApplicationBaseURL + messageId
           + "/move?tofolder=" + folder);
     http = createHTTPClient();
@@ -282,10 +290,10 @@ function moveMessages(rowIds, folder) {
       var row = $("row_" + rowIds[i]);
       row.parentNode.removeChild(row);
       deleteCachedMessage(messageId);
-      if (currentMessages[currentMailbox] == rowIds[i]) {
+      if (Mailer.currentMessages[Mailer.currentMailbox] == rowIds[i]) {
        var div = $('messageContent');
        div.update();
-       currentMessages[currentMailbox] = null;
+       Mailer.currentMessages[Mailer.currentMailbox] = null;
       }
     }
     else /* request failed */
@@ -335,9 +343,9 @@ function onMailboxTreeItemClick(event) {
   $("searchValue").value = "";
   initCriteria();
 
-  currentMailboxType = this.parentNode.getAttribute("datatype");
-  if (currentMailboxType == "account" || currentMailboxType == "additional") {
-    currentMailbox = mailbox;
+  Mailer.currentMailboxType = this.parentNode.getAttribute("datatype");
+  if (Mailer.currentMailboxType == "account" || Mailer.currentMailboxType == "additional") {
+    Mailer.currentMailbox = mailbox;
     $("messageContent").update();
     var table = $("messageList");
     var head = table.tHead;
@@ -356,18 +364,18 @@ function onMailboxTreeItemClick(event) {
 function _onMailboxMenuAction(menuEntry, error, actionName) {
   var targetMailbox = menuEntry.mailbox.fullName();
 
-  if (targetMailbox == currentMailbox)
+  if (targetMailbox == Mailer.currentMailbox)
     window.alert(labels[error]);
   else {
     var message;
     if (document.menuTarget.tagName == "DIV")
-      message = currentMessages[currentMailbox];
+      message = Mailer.currentMessages[Mailer.currentMailbox];
     else
       message = document.menuTarget.getAttribute("id").substr(4);
 
-    var urlstr = (URLForFolderID(currentMailbox) + "/" + message
+    var urlstr = (URLForFolderID(Mailer.currentMailbox) + "/" + message
                  + "/" + actionName + "?folder=" + targetMailbox);
-    triggerAjaxRequest(urlstr, folderRefreshCallback, currentMailbox);
+    triggerAjaxRequest(urlstr, folderRefreshCallback, Mailer.currentMailbox);
   }
 }
 
@@ -400,14 +408,14 @@ function onComposeMessage() {
 }
 
 function composeNewMessage() {
-  var account = currentMailbox.split("/")[1];
+  var account = Mailer.currentMailbox.split("/")[1];
   var url = ApplicationBaseURL + "/" + account + "/compose";
   openMailComposeWindow(url);
 }
 
 function openMailbox(mailbox, reload, idx) {
-  if (mailbox != currentMailbox || reload) {
-    currentMailbox = mailbox;
+  if (mailbox != Mailer.currentMailbox || reload) {
+    Mailer.currentMailbox = mailbox;
     var url = ApplicationBaseURL + encodeURI(mailbox) + "/view?noframe=1";
     var messageContent = $("messageContent");
     messageContent.update();
@@ -415,7 +423,7 @@ function openMailbox(mailbox, reload, idx) {
 
     var currentMessage;
     if (!idx) {
-      currentMessage = currentMessages[mailbox];
+      currentMessage = Mailer.currentMessages[mailbox];
       if (currentMessage) {
        loadMessage(currentMessage);
        url += '&pageforuid=' + currentMessage;
@@ -458,7 +466,7 @@ function openMailbox(mailbox, reload, idx) {
 }
 
 function openMailboxAtIndex(event) {
-  openMailbox(currentMailbox, true, this.getAttribute("idx"));
+  openMailbox(Mailer.currentMailbox, true, this.getAttribute("idx"));
 
   Event.stop(event);
 }
@@ -545,7 +553,7 @@ function quotasCallback(http) {
     }
     
     if (hasQuotas) {
-      var treePath = currentMailbox.split("/");
+      var treePath = Mailer.currentMailbox.split("/");
       var quotasMB = new Array();
       for (var i = 2; i < treePath.length; i++)
        quotasMB.push(treePath[i].substr(6));
@@ -637,11 +645,11 @@ function deleteCachedMessage(messageId) {
   var done = false;
   var counter = 0;
 
-  while (counter < cachedMessages.length
+  while (counter < Mailer.cachedMessages.length
         && !done)
-    if (cachedMessages[counter]
-       && cachedMessages[counter]['idx'] == messageId) {
-      cachedMessages.splice(counter, 1);
+    if (Mailer.cachedMessages[counter]
+       && Mailer.cachedMessages[counter]['idx'] == messageId) {
+      Mailer.cachedMessages.splice(counter, 1);
       done = true;
     }
     else
@@ -652,11 +660,11 @@ function getCachedMessage(idx) {
   var message = null;
   var counter = 0;
 
-  while (counter < cachedMessages.length
+  while (counter < Mailer.cachedMessages.length
         && message == null)
-    if (cachedMessages[counter]
-       && cachedMessages[counter]['idx'] == currentMailbox + '/' + idx)
-      message = cachedMessages[counter];
+    if (Mailer.cachedMessages[counter]
+       && Mailer.cachedMessages[counter]['idx'] == Mailer.currentMailbox + '/' + idx)
+      message = Mailer.cachedMessages[counter];
     else
       counter++;
 
@@ -668,14 +676,14 @@ function storeCachedMessage(cachedMessage) {
   var timeOldest = -1;
   var counter = 0;
 
-  if (cachedMessages.length < maxCachedMessages)
-    oldest = cachedMessages.length;
+  if (Mailer.cachedMessages.length < Mailer.maxCachedMessages)
+    oldest = Mailer.cachedMessages.length;
   else {
-    while (cachedMessages[counter]) {
+    while (Mailer.cachedMessages[counter]) {
       if (oldest == -1
-         || cachedMessages[counter]['time'] < timeOldest) {
+         || Mailer.cachedMessages[counter]['time'] < timeOldest) {
        oldest = counter;
-       timeOldest = cachedMessages[counter]['time'];
+       timeOldest = Mailer.cachedMessages[counter]['time'];
       }
       counter++;
     }
@@ -684,7 +692,7 @@ function storeCachedMessage(cachedMessage) {
       oldest = 0;
   }
 
-  cachedMessages[oldest] = cachedMessage;
+  Mailer.cachedMessages[oldest] = cachedMessage;
 }
 
 function onMessageSelectionChange() {
@@ -693,8 +701,8 @@ function onMessageSelectionChange() {
   if (rows.length == 1) {
     var idx = rows[0].substr(4);
 
-    if (currentMessages[currentMailbox] != idx) {
-      currentMessages[currentMailbox] = idx;
+    if (Mailer.currentMessages[Mailer.currentMailbox] != idx) {
+      Mailer.currentMessages[Mailer.currentMailbox] = idx;
       loadMessage(idx);
     }
   }
@@ -710,7 +718,7 @@ function loadMessage(idx) {
 
   markMailInWindow(window, idx, true);
   if (cachedMessage == null) {
-    var url = (ApplicationBaseURL + currentMailbox + "/"
+    var url = (ApplicationBaseURL + Mailer.currentMailbox + "/"
               + idx + "/view?noframe=1");
     document.messageAjaxRequest
       = triggerAjaxRequest(url, messageCallback, idx);
@@ -729,8 +737,7 @@ function configureLinksInMessage() {
   var mailContentDiv = document.getElementsByClassName('mailer_mailcontent',
                                                       messageDiv)[0];
   if (!document.body.hasClassName("popup"))
-    Event.observe(mailContentDiv, "contextmenu",
-                 onMessageContentMenu.bindAsEventListener(mailContentDiv));
+    mailContentDiv.observe("contextmenu", onMessageContentMenu);
   var anchors = messageDiv.getElementsByTagName('a');
   for (var i = 0; i < anchors.length; i++)
     if (anchors[i].href.substring(0,7) == "mailto:") {
@@ -771,8 +778,8 @@ function onICalendarButtonClick(event) {
   if (link) {
     var urlstr = link + "/" + this.action;
     triggerAjaxRequest(urlstr, ICalendarButtonCallback,
-                      currentMailbox + "/"
-                      + currentMessages[currentMailbox]);
+                      Mailer.currentMailbox + "/"
+                      + Mailer.currentMessages[Mailer.currentMailbox]);
   }
   else
     log("no link");
@@ -782,10 +789,10 @@ function ICalendarButtonCallback(http) {
   if (http.readyState == 4)
     if (isHttpStatus204(http.status)) {
       var oldMsg = http.callbackData;
-      var msg = currentMailbox + "/" + currentMessages[currentMailbox];
+      var msg = Mailer.currentMailbox + "/" + Mailer.currentMessages[Mailer.currentMailbox];
       if (oldMsg == msg) {
        deleteCachedMessage(oldMsg);
-       loadMessage(currentMessages[currentMailbox]);
+       loadMessage(Mailer.currentMessages[Mailer.currentMailbox]);
       }
     }
     else {
@@ -802,6 +809,11 @@ function resizeMailContent() {
 }
 
 function onMessageContentMenu(event) {
+  var element = getTarget(event);
+  if (element.tagName == 'A' && element.href.substring(0,7) == "mailto:")
+    // Don't show the default contextual menu; let the click propagate to 
+    // other observers
+    return true;
   popupMenu(event, 'messageContentMenu', this);
 }
 
@@ -811,6 +823,8 @@ function onMessageEditDraft(event) {
 
 function onEmailAddressClick(event) {
   popupMenu(event, 'addressMenu', this);
+  preventDefault(event);
+  return false;
 }
 
 function onMessageAnchorClick(event) {
@@ -830,7 +844,7 @@ function messageCallback(http) {
     
     if (http.callbackData) {
       var cachedMessage = new Array();
-      cachedMessage['idx'] = currentMailbox + '/' + http.callbackData;
+      cachedMessage['idx'] = Mailer.currentMailbox + '/' + http.callbackData;
       cachedMessage['time'] = (new Date()).getTime();
       cachedMessage['text'] = http.responseText;
       if (cachedMessage['text'].length < 30000)
@@ -915,7 +929,7 @@ function onMenuViewMessageSource(event) {
   var rows = messageList.getSelectedRowsId();
 
   if (rows.length > 0) {
-    var url = (ApplicationBaseURL + currentMailbox + "/"
+    var url = (ApplicationBaseURL + Mailer.currentMailbox + "/"
               + rows[0].substr(4) + "/viewsource");
     openMailComposeWindow(url);
   }
@@ -941,7 +955,9 @@ function newContactFromEmail(event) {
 }
 
 function onEmailTo(event) {
-  return openMailTo(this.innerHTML.strip());
+  openMailTo(this.innerHTML.strip());
+  preventDefault(event);
+  return false;
 }
 
 function newEmailTo(sender) {
@@ -988,11 +1004,11 @@ function onHeaderClick(event) {
 }
 
 function refreshCurrentFolder() {
-  openMailbox(currentMailbox, true);
+  openMailbox(Mailer.currentMailbox, true);
 }
 
 function refreshFolderByType(type) {
-  if (currentMailboxType == type)
+  if (Mailer.currentMailboxType == type)
     refreshCurrentFolder();
 }
 
@@ -1013,7 +1029,7 @@ var mailboxSpanDrop = function(data) {
 
   if (data) {
     var folder = this.parentNode.parentNode.getAttribute("dataname");
-    if (folder != currentMailbox)
+    if (folder != Mailer.currentMailbox)
       success = (moveMessages(data, folder) == 0);
   }
   else
@@ -1182,6 +1198,10 @@ function initMailer(event) {
     initMailboxTree();
     initMessageCheckTimer();
   }
+
+  // Default sort options
+  sorting["attribute"] = "date";
+  sorting["ascending"] = false;
 }
 
 function initMessageCheckTimer() {
@@ -1365,7 +1385,7 @@ function onLoadMailboxesCallback(http) {
   //       var treeNodes = document.getElementsByClassName("dTreeNode", tree);
   //       var i = 0;
   //       while (i < treeNodes.length
-  //        && treeNodes[i].getAttribute("dataname") != currentMailbox)
+  //        && treeNodes[i].getAttribute("dataname") != Mailer.currentMailbox)
   //    i++;
   //       if (i < treeNodes.length) {
   //    //     log("found mailbox");
@@ -1445,13 +1465,13 @@ function onMenuEmptyTrash(event) {
   var urlstr = URLForFolderID(folderID) + "/emptyTrash";
   triggerAjaxRequest(urlstr, folderOperationCallback, folderID);
 
-  if (folderID == currentMailbox) {
+  if (folderID == Mailer.currentMailbox) {
     var div = $('messageContent');
     for (var i = div.childNodes.length - 1; i > -1; i--)
       div.removeChild(div.childNodes[i]);
     refreshCurrentFolder();
   }
-  var msgID = currentMessages[folderID];
+  var msgID = Mailer.currentMessages[folderID];
   if (msgID)
     deleteCachedMessage(folderID + "/" + msgID);
 }
@@ -1481,17 +1501,17 @@ function onMenuChangeToTrashFolder(event) {
 
 function onMenuLabelNone() {
   var rowId = document.menuTarget.getAttribute("id").substr(4);
-  var messageId = currentMailbox + "/" + rowId;
+  var messageId = Mailer.currentMailbox + "/" + rowId;
   var urlstr = ApplicationBaseURL + messageId + "/removeAllLabels";
   triggerAjaxRequest(urlstr, messageFlagCallback,
-                    { mailbox: currentMailbox, msg: rowId, label: null } );
+                    { mailbox: Mailer.currentMailbox, msg: rowId, label: null } );
 }
 
 function _onMenuLabelFlagX(flag) {
   var flags = document.menuTarget.getAttribute("labels").split(" ");
 
   var rowId = document.menuTarget.getAttribute("id").substr(4);
-  var messageId = currentMailbox + "/" + rowId;
+  var messageId = Mailer.currentMailbox + "/" + rowId;
 
   var operation = "add";
   if (flags.indexOf("label" + flag) > -1)
@@ -1499,7 +1519,7 @@ function _onMenuLabelFlagX(flag) {
   var urlstr = (ApplicationBaseURL + messageId
                + "/" + operation + "Label" + flag);
   triggerAjaxRequest(urlstr, messageFlagCallback,
-                    { mailbox: currentMailbox, msg: rowId,
+                    { mailbox: Mailer.currentMailbox, msg: rowId,
                       label: operation + flag } );
 }
 
@@ -1535,7 +1555,7 @@ function folderRefreshCallback(http) {
   if (http.readyState == 4
       && isHttpStatus204(http.status)) {
     var oldMailbox = http.callbackData;
-    if (oldMailbox == currentMailbox)
+    if (oldMailbox == Mailer.currentMailbox)
       refreshCurrentFolder();
   }
   else
@@ -1546,7 +1566,7 @@ function messageFlagCallback(http) {
   if (http.readyState == 4
       && isHttpStatus204(http.status)) {
     var data = http.callbackData;
-    if (data["mailbox"] == currentMailbox) {
+    if (data["mailbox"] == Mailer.currentMailbox) {
       var row = $("row_" + data["msg"]);
       var operation = data["label"];
       if (operation) {
index cad1169e02471d2e0892fb122d02881e27cd166d..7201ce050f9b8233dc3f3aaf99a319347563f48c 100644 (file)
@@ -20,11 +20,13 @@ function onLoginClick(event) {
   var password = $("password").value;
 
   if (userName.length > 0) {
-    var url = ($("connectForm").getAttribute("action")
-              + "?userName=" + userName
-              + "&password=" + password);
+    var url = $("connectForm").getAttribute("action");
+    var parameters = ("userName=" + userName + "&password=" + password);
     document.cookie = "";
-    triggerAjaxRequest(url, onLoginCallback);
+    triggerAjaxRequest(url, onLoginCallback, null, parameters,
+                      { "Content-type": "application/x-www-form-urlencoded",
+                        "Content-length": parameters.length,
+                        "Connection": "close" });
   }
 
   preventDefault(event);
@@ -32,9 +34,8 @@ function onLoginClick(event) {
 
 function onLoginCallback(http) {
   if (http.readyState == 4) {
-    if (isHttpStatus204(http.status)) {
+    if (isHttpStatus204(http.status))
       window.location.href = ApplicationBaseURL + $("userName").value;
-    }
   }
 }
 
index 3b4fd32ce3d7e1f75cd5f0c937fc8843d1eaf746..5ca53f52154cc4b96db8859074afdc1b2ddd6707 100644 (file)
@@ -660,7 +660,8 @@ function refreshCalendarEvents(scrollEvent) {
    var url = ApplicationBaseURL + "eventslist?sd=" + sd + "&ed=" + ed;
    document.refreshCalendarEventsAjaxRequest
       = triggerAjaxRequest(url, refreshCalendarEventsCallback,
-                          {"startDate": sd, "endDate": ed, "scrollEvent": scrollEvent});
+                          {"startDate": sd, "endDate": ed,
+                           "scrollEvent": scrollEvent});
 }
 
 function refreshCalendarEventsCallback(http) {
@@ -1005,11 +1006,23 @@ function onHeaderClick(event) {
   preventDefault(event);
 }
 
+function refreshCurrentFolder() {
+  refreshEvents();
+}
+
 function refreshEvents() {
-   return _loadEventHref("eventslist?desc=" + sortOrder
-                        + "&sort=" + sortKey
-                        + "&day=" + currentDay
-                        + "&filterpopup=" + listFilter);
+  var titleSearch;
+  var value = search["value"];
+  if (value && value.length)
+    titleSearch = "&search=" + value;
+  else
+    titleSearch = "";
+
+  return _loadEventHref("eventslist?desc=" + sortOrder
+                       + "&sort=" + sortKey
+                       + "&day=" + currentDay
+                       + titleSearch
+                       + "&filterpopup=" + listFilter);
 }
 
 function refreshTasks() {
@@ -1097,12 +1110,6 @@ function onYearMenuItemClick(event) {
   changeDateSelectorDisplay(year + month + "01", true);
 }
 
-function onSearchFormSubmit() {
-  log ("search not implemented");
-
-  return false;
-}
-
 function selectCalendarEvent(div) {
   // Select event in calendar view
   if (selectedCalendarCell)
index b02026e5883f3ba6d0342d777f89459eb0ef12de..0a0383293eeb3cb59fee6948fd51181ca965c341 100644 (file)
@@ -77,6 +77,9 @@ SPAN.content
   left: 8em;
   right: 1em; }
 
+SPAN.content
+{ line-height: 2em; }
+
 SPAN.content A
 { line-height: 2em; }
 
index 48873f787b93eee9486287b9d25eb4b7ee2761d2..808d0012a7cf66972c2de66d39c00b0195fcabbf 100644 (file)
@@ -58,10 +58,17 @@ TABLE#freeBusy TD.attendees IMG
   top: 0.5em; }
 
 TABLE#freeBusy TD.attendees INPUT
-{ width: 11.5em;
+{ background-image: url('/SOGo.woa/WebServerResources/abcard.gif');
+  background-repeat: no-repeat;
+  background-position: 2px center;
+  width: 11.5em;
   margin: 0px;
+  padding-left: 24px;
   margin-left: 5px; }
 
+TABLE#freeBusy TR.futureAttendee INPUT
+{ background-image: none; }
+
 TABLE#freeBusy TR.freeBusyHeader2 TH
 { font-weight: normal; }
 
index 877ef0c7b213051b4c767379681f33fa41338ed6..e526abfbfdd20eaf8cf0b0df7beee6b2d690c025 100644 (file)
@@ -1,5 +1,2 @@
 #attendeesLabel
-{ display: none; }
-
-#organizerListLabel
-{ display: none; }
+{ display: none; }
\ No newline at end of file
index 4bb5f1145621a07ec97cfe0404b9693d68a0e69e..59dfff2d35491a20b1b347f793c233e5e6e7b05e 100644 (file)
@@ -81,22 +81,16 @@ function refreshAttendees() {
   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" });
   }
 }
 
@@ -104,12 +98,9 @@ function initializeAttendeesHref() {
   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" });
index 80faf8cd183a33769ed5c220d232aa415c6fb107..c5a6f602b4626017fa19044aefc87d4eeb78a3ff 100644 (file)
@@ -8,16 +8,16 @@ function onContactAdd() {
   var selector = null;
   var selectorURL = '?popup=YES&selectorId=mailer-contacts';
  
-  if (MailEditor.addressBook)
+  if (MailEditor.addressBook && MailEditor.addressBook.open && !MailEditor.addressBook.closed)
     MailEditor.addressBook.focus();
   else {
-    urlstr = ApplicationBaseURL 
+    var urlstr = ApplicationBaseURL 
       + "../Contacts/"
       + contactSelectorAction + selectorURL;
     MailEditor.addressBook = window.open(urlstr, "_blank",
                                         "width=640,height=400,resizable=1,scrollbars=0");
     MailEditor.addressBook.selector = selector;
-    MailEditor.addressBook.opener = this;
+    MailEditor.addressBook.opener = self;
     MailEditor.addressBook.focus();
   }
   
@@ -392,7 +392,7 @@ function onMailEditorClose(event) {
     }
   }
 
-  if (MailEditor.addressBook)
+  if (MailEditor.addressBook && MailEditor.addressBook.open && !MailEditor.addressBook.closed)
     MailEditor.addressBook.close();
 
   Event.stopObserving(window, "beforeunload", onMailEditorClose);
index ce7a12ed45171a4c42d9c14348d16ee1f19d6cc7..a7f526f33eecf88343eda1c54beb18326abdd461 100644 (file)
@@ -290,7 +290,7 @@ function appendDifferentiator(url) {
   return url_nocache;
 }
 
-function triggerAjaxRequest(url, callback, userdata) {
+function triggerAjaxRequest(url, callback, userdata, content, headers) {
   var http = createHTTPClient();
 
   activeAjaxRequests += 1;
@@ -323,7 +323,11 @@ function triggerAjaxRequest(url, callback, userdata) {
        log(backtrace());
       }
     };
-    http.send(null);
+    if (headers) {
+      for (var i in headers)
+       http.setRequestHeader(i, headers[i]);
+    }
+    http.send(content);
   }
   else {
     log("triggerAjaxRequest: error creating HTTP Client!");
@@ -575,7 +579,7 @@ function popupMenu(event, menuId, target) {
   popup.setStyle({ top: menuTop + "px",
                   left: menuLeft + "px",
                   visibility: "visible" });
-
+  
   document.currentPopupMenu = popup;
 
   $(document.body).observe("click", onBodyClickMenuHandler);
@@ -821,7 +825,7 @@ function setSearchCriteria(event) {
   var searchValue = $("searchValue");
   var searchCriteria = $("searchCriteria");
 
-  searchValue.setAttribute("ghost-phrase", this.innerHTML);
+  searchValue.ghostPhrase = this.innerHTML;
   searchCriteria.value = this.getAttribute('id');
   
   if (this.parentNode.chosenNode)
@@ -831,18 +835,12 @@ function setSearchCriteria(event) {
 }
 
 function checkSearchValue(event) {
-  var form = event.target;
   var searchValue = $("searchValue");
-  var ghostPhrase = searchValue.getAttribute('ghost-phrase');
 
-  if (searchValue.value == ghostPhrase)
+  if (searchValue.value == searchValue.ghostPhrase)
     searchValue.value = "";
 }
 
-function onSearchChange() {
-  log ("onSearchChange()...");
-}
-
 function configureSearchField() {
   var searchValue = $("searchValue");
   var searchOptions = $("searchOptions");
@@ -875,7 +873,7 @@ function onSearchMouseDown(event) {
 }
 
 function onSearchFocus() {
-  ghostPhrase = this.getAttribute("ghost-phrase");
+  ghostPhrase = this.ghostPhrase;
   if (this.value == ghostPhrase) {
     this.value = "";
     this.setAttribute("modified", "");
@@ -887,14 +885,16 @@ function onSearchFocus() {
 }
 
 function onSearchBlur(event) {
-  var ghostPhrase = this.getAttribute("ghost-phrase");
-
   if (!this.value) {
     this.setAttribute("modified", "");
     this.setStyle({ color: "#aaa" });
-    this.value = ghostPhrase;
-    refreshCurrentFolder();
-  } else if (this.value == ghostPhrase) {
+    this.value = this.ghostPhrase;
+    search["value"] = "";
+    if (searchValue.lastSearch != "") {
+      searchValue.lastSearch = "";
+      refreshCurrentFolder();
+    }
+  } else if (this.value == this.ghostPhrase) {
     this.setAttribute("modified", "");
     this.setStyle({ color: "#aaa" });
   } else {
@@ -913,31 +913,32 @@ function onSearchKeyDown(event) {
 function onSearchFormSubmit(event) {
   var searchValue = $("searchValue");
   var searchCriteria = $("searchCriteria");
-  var ghostPhrase = searchValue.getAttribute('ghost-phrase');
    
-  if (searchValue.value == ghostPhrase) return;
-
-  search["criteria"] = searchCriteria.value;
-  search["value"] = searchValue.value;
-
-  refreshCurrentFolder();
+  if (searchValue.value != searchValue.ghostPhrase
+      && searchValue.value != searchValue.lastSearch) {
+    search["criteria"] = searchCriteria.value;
+    search["value"] = searchValue.value;
+    searchValue.lastSearch = searchValue.value;
+    refreshCurrentFolder();
+  }
 }
 
 function initCriteria() {
   var searchCriteria = $("searchCriteria");
   var searchValue = $("searchValue");
  
-  if (!searchValue) return;
-
-  var searchOptions = $("searchOptions").childNodesWithTag("li");
-  if (searchOptions.length > 0) {
-    var firstChild = searchOptions[0];
-    searchCriteria.value = $(firstChild).getAttribute('id');
-    searchValue.setAttribute('ghost-phrase', firstChild.innerHTML);
-    if (searchValue.value == '') {
-      searchValue.value = firstChild.innerHTML;
-      searchValue.setAttribute("modified", "");
-      searchValue.setStyle({ color: "#aaa" });
+  if (searchValue) {
+    var searchOptions = $("searchOptions").childNodesWithTag("li");
+    if (searchOptions.length > 0) {
+      var firstChild = searchOptions[0];
+      searchCriteria.value = $(firstChild).getAttribute('id');
+      searchValue.ghostPhrase = firstChild.innerHTML;
+      searchValue.lastSearch = "";
+      if (searchValue.value == '') {
+       searchValue.value = firstChild.innerHTML;
+       searchValue.setAttribute("modified", "");
+       searchValue.setStyle({ color: "#aaa" });
+      }
     }
   }
 }
index 2faaf0eebb8bdb3ef3ebf21365399b615842f75f..b9ebf1373de87fecf5c8115d3b3bc6544f23b9db 100644 (file)
@@ -43,9 +43,13 @@ UL#userList
 { top: 3em; }
 
 /* MailerUI */
+
 IMG.dragMessage
 { filter: alpha(opacity=70); }
 
+TD.mailer_fieldname
+{ width: 8em; }
+
 /* SchedulerUI */
 
 DIV[class~="event"]._selected > DIV.eventInside