]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1091 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 28 Jun 2007 20:44:49 +0000 (20:44 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 28 Jun 2007 20:44:49 +0000 (20:44 +0000)
34 files changed:
ChangeLog
SoObjects/Appointments/product.plist
UI/Common/English.lproj/Localizable.strings
UI/Common/French.lproj/Localizable.strings
UI/Common/GNUmakefile
UI/Common/UIxSortButton.m [deleted file]
UI/Common/UIxSortableTableHeader.m [deleted file]
UI/Contacts/UIxContactsListView.h
UI/Contacts/UIxContactsListView.m
UI/MailerUI/English.lproj/Localizable.strings
UI/MailerUI/French.lproj/Localizable.strings
UI/MailerUI/UIxMailFilterPanel.m
UI/MailerUI/UIxMailListView.h
UI/MailerUI/UIxMailListView.m
UI/MailerUI/common.h
UI/MainUI/product.plist
UI/PreferencesUI/UIxJSONPreferences.m
UI/SOGoUI/UIxComponent.m
UI/Scheduler/French.lproj/Localizable.strings
UI/Templates/ContactsUI/UIxContactsListView.wox
UI/Templates/MailerUI/UIxMailFilterPanel.wox
UI/Templates/MailerUI/UIxMailListView.wox
UI/Templates/MailerUI/UIxMailMainFrame.wox
UI/WebServerResources/ContactsUI.css
UI/WebServerResources/ContactsUI.js
UI/WebServerResources/MailerUI.css
UI/WebServerResources/MailerUI.js
UI/WebServerResources/UIxAclEditor.js
UI/WebServerResources/UIxAttendeesEditor.js
UI/WebServerResources/UIxComponentEditor.js
UI/WebServerResources/UIxContactsUserFolders.js
UI/WebServerResources/events.js
UI/WebServerResources/generic.css
UI/WebServerResources/generic.js

index f08a575f60d9ac312fd8539c6ec6cae27e1b75f8..24e07bf263862ef1818c20d1f999c6663ff8c5f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,53 @@
+2007-06-28  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * UI/Common/UIxSortButton.m: removed useless class module.
+
+       * UI/Common/UIxSortableTableHeader.m: removed useless class
+       module.
+
+       * UI/Contacts/UIxContactsListView.m ([UIxContactsListView
+       -contactInfos]): use the "asc" url parameter instead of "desc" to
+       determine the ordering.
+       ([-sortOrdering]): removed method.
+       ([UIxContactsListView -init]): removed the "searchText" ivar.
+       (general): the template no longer use the UIxSortableTableHeader
+       components.
+
+       * UI/MailerUI/UIxMailListView.m ([UIxMailListView
+       -defaultSortKey]): default sort following the messages arrival
+       instead of their date.
+       ([-isSortedDescending]): removed method.
+       ([-imap4SortOrdering]): use the "asc" url parameter instead of
+       "desc" to determine the ordering.
+       (general): the template no longer use the UIxSortableTableHeader
+       components.
+
+2007-06-27  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * UI/MailerUI/UIxMailListView.m ([UIxMailListView -sleep]):
+       removed method.
+       ([-setQualifier:_msg], [-qualifier]): removed methods.
+       ([UIxMailListView -defaultAction]): added code to handle the
+       search criteria and value passed as url parameters. Also, we now
+       handle the same search criterias as Thunderbird/Icedove.
+
+2007-06-22  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * UI/PreferencesUI/UIxJSONPreferences.m ([UIxJSONPreferences
+       -jsonDefaultsAction]): bug fix: returns a WOResponse instance with
+       the string instead of the string itself.
+       ([UIxJSONPreferences -jsonSettingsAction]): same as above.
+
+       * SoObjects/SOGo/SOGoUser.m ([SOGoUser +initialize]): new module
+       bool var "acceptAnyUser" that is set when the AuthenticationMethod
+       user default is nil.
+       ([SOGoUser -initWithLogin:newLoginroles:newRoles]):
+       unconditionnally returns an instance whenever acceptAnyUser is set.
+
+2007-06-21  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
+
+       * Main/sogod.m (main): prevent SOGo from running as root.
+
 2007-06-19  Wolfgang Sourdeau  <wsourdeau@inverse.ca>
 
        * SoObjects/SOGo/SOGoUser.m ([SOGoUser
index 1fb47e4d7424dc61fbe0008f8890a15aa88bc05f..d70b2faad499663e47f691c5c86e57bd26a88e44 100644 (file)
@@ -11,7 +11,7 @@
     SOGoAppointmentFolder = {
       superclass = "SOGoFolder";
       defaultRoles = {
-        "FreeBusyLookup" = ( "Owner", "FreeBusy", "AuthorizedSubscriber" );
+/*        "FreeBusyLookup" = ( "Owner", "FreeBusy", "AuthorizedSubscriber" );  */
        "ViewWholePublicRecords" = ( "Owner", "PublicResponder", "PublicModifier", "PublicViewer" );
        "ViewDAndTOfPublicRecords" = ( "Owner", "PublicDAndTViewer" );
        "ModifyPublicRecords" = ( "Owner", "PublicModifier" );
@@ -29,7 +29,7 @@
       };
     };
     SOGoGroupAppointmentFolder = {
-      superclass    = "SOGoAppointmentFolder";
+      superclass = "SOGoAppointmentFolder";
     };
     SOGoCalendarComponent = {
       superclass = "SOGoContentObject";
       };
     };
     SOGoAppointmentObject = {
-      superclass    = "SOGoCalendarComponent";
+      superclass = "SOGoCalendarComponent";
     };
     SOGoTaskObject = {
       superclass    = "SOGoCalendarComponent";
     };
     SOGoFreeBusyObject = {
-      superclass    = "SOGoContentObject";
-      protectedBy = "<public>";
+      superclass = "SOGoContentObject";
+      protectedBy = "Access Contents Information";
+      defaultRoles = {
+       "Access Contents Information" = ( "Owner", "Authenticated" );
+        "WebDAV Access" = ( "Owner", "Authenticated" );
+      };
     };
   };
 }
index 4ac925e1ea5d438972ff4cda1f22ea9da32d0e2d..bb9c1bf5d4d951da48b9ce80e761944f2ce0f1cf 100644 (file)
@@ -9,6 +9,7 @@
 "Calendar" = "Calendar";
 "Address Book" = "Address Book";
 "Mail" = "Mail";
+"Preferences" = "Preferences";
 "Logoff" = "Logoff";
 "Right Administration" = "Right Administration";
 "Log Console (dev.)" = "Log Console (dev.)";
index c18c40680d774ed27fb7826d63a915bd185aa00f..5264f182aac17704aeb7f6a5c96af801f6ba6dda 100644 (file)
@@ -7,6 +7,7 @@
 "Calendar" = "Agenda";
 "Address Book" = "Carnet d'adresses";
 "Mail" = "Courrier";
+"Preferences" = "Préférences";
 "Logoff" = "Quitter";
 "Right Administration" = "Partage";
 "Log Console (dev.)" = "Journal (dév.)";
index 9adbb6dc38061673be512a345afdecb0b4f84f8b..cd4320a210436abf97285321e8fc5d2adb7c651e 100644 (file)
@@ -12,7 +12,6 @@ CommonUI_OBJC_FILES +=                \
        CommonUIProduct.m       \
        UIxPageFrame.m          \
        UIxPrintPageFrame.m     \
-       UIxSortButton.m         \
        UIxAppNavView.m         \
        \
        UIxAclEditor.m  \
@@ -23,8 +22,6 @@ CommonUI_OBJC_FILES +=                \
        UIxTabItem.m            \
        UIxUserRightsEditor.m   \
        \
-       UIxSortableTableHeader.m \
-       \
        UIxToolbar.m
 
 CommonUI_RESOURCE_FILES += \
diff --git a/UI/Common/UIxSortButton.m b/UI/Common/UIxSortButton.m
deleted file mode 100644 (file)
index fb4d335..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-  Copyright (C) 2004-2005 SKYRIX Software AG
-
-  This file is part of OpenGroupware.org.
-
-  OGo is free software; you can redistribute it and/or modify it under
-  the terms of the GNU Lesser General Public License as published by the
-  Free Software Foundation; either version 2, or (at your option) any
-  later version.
-
-  OGo is distributed in the hope that it will be useful, but WITHOUT ANY
-  WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
-  License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with OGo; see the file COPYING.  If not, write to the
-  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-  02111-1307, USA.
-*/
-
-#include <NGObjWeb/WOComponent.h>
-
-@interface UIxSortButton : WOComponent
-@end
-
-@implementation UIxSortButton
-@end /* UIxSortButton */
-
diff --git a/UI/Common/UIxSortableTableHeader.m b/UI/Common/UIxSortableTableHeader.m
deleted file mode 100644 (file)
index 6686252..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- Copyright (C) 2004-2005 SKYRIX Software AG
- This file is part of OpenGroupware.org.
- OGo is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
- OGo is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
- License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with OGo; see the file COPYING.  If not, write to the
- Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
-*/
-
-#include <NGObjWeb/SoComponent.h>
-
-/*
-  UIxSortableTableHeader
-
-  TODO: document.
-
-  Note: needs to inherit from SoComponent so that resource lookup properly
-        works!
-*/
-
-@interface UIxSortableTableHeader : SoComponent
-{
-  NSString     *label;
-  NSString     *sortKey;
-  NSString     *href;
-  NSDictionary *queryDictionary;
-  BOOL         isDefault;
-}
-
-@end
-
-#include "common.h"
-
-@implementation UIxSortableTableHeader
-
-- (void)dealloc {
-  [self->label           release];
-  [self->sortKey         release];
-  [self->href            release];
-  [self->queryDictionary release];
-  [super dealloc];
-}
-
-/* Accessors */
-
-- (void)setLabel:(NSString *)_label {
-  ASSIGNCOPY(self->label, _label);
-}
-- (NSString *)label {
-  return self->label;
-}
-
-- (void)setSortKey:(NSString *)_sortKey {
-  ASSIGNCOPY(self->sortKey, _sortKey);
-}
-
-- (NSString *)sortKey {
-  return self->sortKey;
-}
-
-- (void)setHref:(NSString *)_href {
-  ASSIGNCOPY(self->href, _href);
-}
-- (NSString *)href {
-  return self->href;
-}
-
-- (void)setQueryDictionary:(NSDictionary *)_queryDictionary {
-  ASSIGN(self->queryDictionary, _queryDictionary);
-}
-- (NSDictionary *)queryDictionary {
-  return self->queryDictionary;
-}
-
-- (id)singleQueryValueForKey:(NSString *)_key {
-  id so;
-  
-  so = [self->queryDictionary objectForKey:_key];
-  if (![so isNotNull]) return nil;
-  
-  if (![so isKindOfClass:[NSArray class]])
-    return so;
-  
-  return ([so count] > 0) ? [so objectAtIndex:0] : nil;
-}
-
-- (void)setIsDefault:(BOOL)_isDefault {
-  self->isDefault = _isDefault;
-}
-- (BOOL)isDefault {
-  return self->isDefault;
-}
-
-/* derived accessors */
-
-- (BOOL) isSelected
-{
-  NSString *so;
-  so = [self singleQueryValueForKey:@"sort"];
-
-  return ((so)
-          ? [so isEqualToString:self->sortKey]
-          : isDefault);
-}
-
-- (BOOL)isSortedDescending
-{
-  NSString *desc;
-
-  desc = [[[self context] request] formValueForKey:@"desc"];
-
-  return ((desc)
-          ? [desc boolValue]
-          : YES);
-}
-
-@end /* UIxSortableTableHeader */
index 92b4a72e4a90178fecc734119ca6920cd93f6870..ed952fffa23906ec12b2041ce7cf8a68816aa077 100644 (file)
@@ -31,7 +31,6 @@
 
 @interface UIxContactsListView : UIxComponent
 {
-  NSString *searchText;
   NSDictionary *currentContact;
   NSString *selectorComponentClass;
 }
index 64c8fd906dcc968642920598295a2effd4cb1792..a68239d21c89eb730d0d4215af6e63a6f2e1ca22 100644 (file)
   return self;
 }
 
-- (void) dealloc
-{
-  if (searchText)
-    [searchText release];
-  [super dealloc];
-}
-
 /* accessors */
 
 - (void) setCurrentContact: (NSDictionary *) _contact
   return currentContact;
 }
 
-- (void) setSearchText: (NSString *) _txt
-{
-  ASSIGNCOPY (searchText, _txt);
-}
-
-- (id) searchText
-{
-  if (!searchText)
-    [self setSearchText: [self queryParameterForKey:@"search"]];
-
-  return searchText;
-}
-
 - (id <WOActionResults>) mailerContactsAction
 {
   selectorComponentClass = @"UIxContactsMailerSelection";
   NSString *s;
   
   s = [self queryParameterForKey: @"sort"];
-  if ([s length] == 0)
+  if (![s length])
     s = [self defaultSortKey];
 
   return s;
 }
 
-- (NSComparisonResult) sortOrdering
-{
-  return ([[self queryParameterForKey:@"desc"] boolValue]
-          ? NSOrderedDescending
-          : NSOrderedAscending);
-}
-
 - (NSArray *) contactInfos
 {
   id <SOGoContactFolder> folder;
+  NSString *ascending, *searchText, *valueText;
+  NSComparisonResult ordering;
 
   folder = [self clientObject];
 
-  return [folder lookupContactsWithFilter: [self searchText]
-                 sortBy: [self sortKey]
-                 ordering: [self sortOrdering]];
-}
+  ascending = [self queryParameterForKey: @"asc"];
+  ordering = ((![ascending length] || [ascending boolValue])
+             ? NSOrderedAscending : NSOrderedDescending);
 
-/* notifications */
+  searchText = [self queryParameterForKey: @"search"];
+  if ([searchText length] > 0)
+    valueText = [self queryParameterForKey: @"value"];
+  else
+    valueText = nil;
 
-- (void) sleep
-{
-  if (searchText)
-    {
-      [searchText release];
-      searchText = nil;
-    }
-  currentContact = nil;
-//   [allRecords release];
-//   allRecords = nil;
-//   [filteredRecords release];
-//   filteredRecords = nil;
-  [super sleep];
+  return [folder lookupContactsWithFilter: valueText
+                 sortBy: [self sortKey]
+                 ordering: ordering];
 }
 
 /* actions */
index 16c3021c23cc2da3d67c5c443869d5f42d8caa4e..26912cf699b3f2cfd6bae713847c69c4fc09335e 100644 (file)
 
 /* MailListView */
 
-"Subject or Sender contains" = "Subject or Sender contains";
+"Sender" = "Sender";
+"Subject or Sender" = "Subject or Sender";
+"To or Cc" = "To or Cc";
+"Entire Message" = "Entire Message";
+
 "Date"          = "Date";
 "View"          = "View";
 "All"           = "All";
index 252b1eb2413d62965f10e787f98d3b65f3d10260..c9fe7dfa05180db733f2d367eae78803ebe37795 100644 (file)
 
 "View:"         = "Voir :";
 
-"Subject or Sender contains" = "Sujet ou Expéditeur contient ";
+"Sender" = "Expéditeur";
+"Subject or Sender" = "Sujet ou expéditeur";
+"To or Cc" = "Pour ou Copie à";
+"Entire Message" = "Message Complet";
+
 "Date"          = "Date";
 "All"           = "Tous";
 "Unread"        = "Non lus";
index bb81e965a54739a4dbd4f58396eed5979c04a45e..a28dd8000d6f694904d4cd135bb6c6f5f9b8f401 100644 (file)
 
 @implementation UIxMailFilterPanel
 
-static NSArray      *filters           = nil;
-static NSDictionary *filterToQualifier = nil;
+static NSArray *filters = nil;
+// static NSDictionary *filterToQualifier = nil;
 
 + (void)initialize {
   // TODO: also available: answered, draft [custom: NotJunk and Junk]
   // Note: we currently cannot use: "flags != 'deleted'"
   static NSString *quals[] = {
-    @"all",     nil,
-    @"read",    @"flags = 'seen'   AND NOT (flags = 'deleted')",
-    @"unread",  @"flags = 'unseen' AND NOT (flags = 'deleted')",
+    @"all", nil,
+    @"read", @"flags = 'seen' AND NOT (flags = 'deleted')",
+    @"unread", @"flags = 'unseen' AND NOT (flags = 'deleted')",
     @"deleted", @"flags = 'deleted'",
     @"flagged", @"flags = 'flagged'",
     nil, nil
@@ -63,7 +63,7 @@ static NSDictionary *filterToQualifier = nil;
     }
   }
   
-  filterToQualifier = [md copy];
+//   filterToQualifier = [md copy];
   filters           = [ma copy];
   [md release]; md = nil;
   [ma release]; ma = nil;
@@ -80,106 +80,110 @@ static NSDictionary *filterToQualifier = nil;
   return self;
 }
 
-- (void)dealloc {
-  [self->searchCriteria release];
-  [self->searchText release];
+- (void) dealloc
+{
+  [searchCriteria release];
+  [searchText release];
   [super dealloc];
 }
 
 /* accessors */
 
-- (void)setSearchText: (NSString *)_txt
+- (void) setSearchText: (NSString *) _txt
 {
-  ASSIGNCOPY(self->searchText, _txt);
+  ASSIGN (searchText, _txt);
 }
 
-- (void)setSearchCriteria: (NSString *)_txt
+- (void) setSearchCriteria: (NSString *) _txt
 {
-  ASSIGNCOPY(self->searchText, _txt);
+  ASSIGN (searchText, _txt);
 }
 
-- (NSString *)searchText
+- (NSString *) searchText
 {
-  if (self->searchText == nil)
+  if (!searchText)
     {
-      self->searchText = 
-       [[[[self context] request] formValueForKey:@"search"] copy];
+      searchText = [[context request] formValueForKey: @"value"];
+      [searchText retain];
     }
-  return self->searchText;
+
+  return searchText;
 }
 
-- (NSString *)searchCriteria
+- (NSString *) searchCriteria
 {
-  if (self->searchCriteria == nil)
+  if (!searchCriteria)
     {
-      self->searchCriteria = 
-       [[[[self context] request] formValueForKey:@"criteria"] copy];
+      searchCriteria = [[context request] formValueForKey: @"criteria"];
+      [searchCriteria retain];
     }
-  return self->searchCriteria;
+
+  return searchCriteria;
 }
 
 /* filters */
 
-- (NSArray *)filters
+- (NSArray *) filters
 {
   return filters;
 }
 
 /* qualifiers */
 
-- (EOQualifier *) searchTextQualifier
-{
-  EOQualifier *q;
-  NSString *s;
+// - (EOQualifier *) searchTextQualifier
+// {
+//   EOQualifier *q;
+//   NSString *s;
   
-  s = [self searchText];
-  if ([s length] == 0)
-    return nil;
+//   s = [self searchText];
+//   if ([s length] == 0)
+//     return nil;
   
-  q = [EOQualifier qualifierWithQualifierFormat:
-                    @"(subject doesContain: %@) OR "
-                    @"(from doesContain: %@)",
-                    s, s];
-  return q;
-}
-
-- (NSString *)filterLabel
-{
-#if 1
-  return [[[self context] page] labelForKey:[self valueForKey:@"filter"]];
-#else
-  return [self valueForKey:@"filter"];
-#endif
-}
-
-- (NSString *)selectedFilter
-{
-  return  [[[self context] request] formValueForKey:@"filterpopup"];
-}
-
-- (EOQualifier *)filterQualifier
-{
-  NSString *selectedFilter;
+//   q = [EOQualifier qualifierWithQualifierFormat:
+//                  @"(subject doesContain: %@) OR "
+//                  @"(from doesContain: %@)",
+//                  s, s];
+//   return q;
+// }
+
+// - (NSString *) filterLabel
+// {
+// #if 1
+//   return [[context page] labelForKey:[self valueForKey:@"filter"]];
+// #else
+//   return [self valueForKey:@"filter"];
+// #endif
+// }
+
+// - (NSString *) selectedFilter
+// {
+//   return  [[context request] formValueForKey: @"filterpopup"];
+// }
+
+// - (EOQualifier *) filterQualifier
+// {
+//   NSString *selectedFilter;
   
-  selectedFilter = [self selectedFilter];
+//   selectedFilter = [self selectedFilter];
   
-  return [selectedFilter length] > 0
-    ? [filterToQualifier objectForKey:selectedFilter] : nil;
-}
-
-- (EOQualifier *) qualifier
-{
-  EOQualifier *sq, *fq;
-  NSArray *qa;
+//   return [selectedFilter length] > 0
+//     ? [filterToQualifier objectForKey:selectedFilter] : nil;
+// }
+
+// - (EOQualifier *) qualifier
+// {
+//   EOQualifier *sq, *fq;
+//   NSArray *qa;
   
-  sq = [self searchTextQualifier];
-  fq = [self filterQualifier];
+//   sq = [self searchTextQualifier];
+//   fq = [self filterQualifier];
   
-  if (fq == nil) return sq;
-  if (sq == nil) return fq;
+//   if (fq == nil) return sq;
+//   if (sq == nil) return fq;
   
-  qa = [NSArray arrayWithObjects:fq, sq, nil];
-  return [[[EOAndQualifier alloc] initWithQualifierArray:qa] autorelease];
-}
+//   qa = [NSArray arrayWithObjects:fq, sq, nil];
+
+//   return [[[EOAndQualifier alloc] initWithQualifierArray:qa] autorelease];
+// }
 
 @end /* UIxMailFilterPanel */
index 7d7fd458a1721df7e908a101db9c496b9094c7b7..fddbfea8bfb5a30c307f0d0089ab9b9d41e1b216 100644 (file)
   NSTimeZone *userTimeZone;
 }
 
-- (NSString *)defaultSortKey;
-- (NSString *)imap4SortKey;
-- (NSString *)imap4SortOrdering;
-
-- (BOOL)isSortedDescending;
+- (NSString *) defaultSortKey;
+- (NSString *) imap4SortKey;
+- (NSString *) imap4SortOrdering;
 
 @end
 
index f0a2ff930345594c7fc47dbd1751d16886a8cbd2..b63b740c1ca65c4c14ae0406efdfaa153cfe1244 100644 (file)
@@ -36,6 +36,8 @@
 #import <NGExtensions/NSNull+misc.h>
 #import <NGExtensions/NSString+misc.h>
 
+#import <EOControl/EOQualifier.h>
+
 #import <SoObjects/Mailer/SOGoMailFolder.h>
 #import <SoObjects/Mailer/SOGoMailObject.h>
 #import <SoObjects/SOGo/SOGoDateFormatter.h>
@@ -48,38 +50,42 @@ static int attachmentFlagSize = 8096;
 
 @implementation UIxMailListView
 
+- (id) init
+{
+  SOGoUser *user;
+
+  if ((self = [super init]))
+    {
+      qualifier = nil;
+      user = [context activeUser];
+      ASSIGN (dateFormatter, [user dateFormatterInContext: context]);
+      ASSIGN (userTimeZone, [user timeZone]);
+    }
+
+  return self;
+}
+
 - (void) dealloc 
 {
-  [self->qualifier  release];
-  [self->sortedUIDs release];
-  [self->messages   release];
-  [self->message    release];
+  [qualifier release];
+  [sortedUIDs release];
+  [messages release];
+  [message release];
   [dateFormatter release];
   [userTimeZone release];
   [super dealloc];
 }
 
-/* notifications */
-
-- (void) sleep 
-{
-  [self->qualifier  release]; self->qualifier  = nil;
-  [self->sortedUIDs release]; self->sortedUIDs = nil;
-  [self->messages   release]; self->messages   = nil;
-  [self->message    release]; self->message    = nil;
-  [super sleep];
-}
-
 /* accessors */
 
-- (void)setMessage:(id)_msg
+- (void) setMessage: (id) _msg
 {
-  ASSIGN(self->message, _msg);
+  ASSIGN(message, _msg);
 }
 
 - (id) message 
 {
-  return self->message;
+  return message;
 }
 
 - (NSString *) messageDate
@@ -92,16 +98,6 @@ static int attachmentFlagSize = 8096;
   return [dateFormatter formattedDateAndTime: messageDate];
 }
 
-- (void) setQualifier: (EOQualifier *) _msg 
-{
-  ASSIGN(self->qualifier, _msg);
-}
-
-- (EOQualifier *) qualifier 
-{
-  return self->qualifier;
-}
-
 - (BOOL) showToAddress 
 {
   NSString *ftype;
@@ -179,7 +175,7 @@ static int attachmentFlagSize = 8096;
   /* Note: see SOGoMailManager.m for allowed IMAP4 keys */
   static NSArray *keys = nil;
   if (keys == nil) {
-    keys = [[NSArray alloc] initWithObjects:
+    keys = [[NSArray alloc] initWithObjects: @"UID",
                              @"FLAGS", @"ENVELOPE", @"RFC822.SIZE", nil];
   }
   return keys;
@@ -187,39 +183,29 @@ static int attachmentFlagSize = 8096;
 
 - (NSString *) defaultSortKey 
 {
-  return @"DATE";
+  return @"ARRIVAL";
 }
 
 - (NSString *) imap4SortKey 
 {
   NSString *sort;
   
-  sort = [[[self context] request] formValueForKey:@"sort"];
+  sort = [[context request] formValueForKey: @"sort"];
 
-  if ([sort length] == 0)
+  if (![sort length])
     sort = [self defaultSortKey];
 
   return [sort uppercaseString];
 }
 
-- (BOOL) isSortedDescending
-{
-  NSString *desc;
-
-  desc = [[[self context] request] formValueForKey:@"desc"];
-
-  return ((desc)
-          ? [desc boolValue]
-          : YES);
-}
-
 - (NSString *) imap4SortOrdering 
 {
-  NSString *sort;
+  NSString *sort, *ascending;
 
   sort = [self imap4SortKey];
 
-  if ([self isSortedDescending])
+  ascending = [[context request] formValueForKey: @"asc"];
+  if (![ascending boolValue])
     sort = [@"REVERSE " stringByAppendingString: sort];
 
   return sort;
@@ -227,27 +213,27 @@ static int attachmentFlagSize = 8096;
 
 - (NSRange) fetchRange 
 {
-  if (self->firstMessageNumber == 0)
+  if (firstMessageNumber == 0)
     return NSMakeRange(0, messagesPerPage);
-  return NSMakeRange(self->firstMessageNumber - 1, messagesPerPage);
+  return NSMakeRange(firstMessageNumber - 1, messagesPerPage);
 }
 
 - (NSArray *) sortedUIDs 
 {
   if (!sortedUIDs)
     {
-      sortedUIDs 
-        = [[self clientObject] fetchUIDsMatchingQualifier: [self qualifier]
-                               sortOrdering: [self imap4SortOrdering]];
+      sortedUIDs
+        = [[self clientObject] fetchUIDsMatchingQualifier: qualifier
+                              sortOrdering: [self imap4SortOrdering]];
       [sortedUIDs retain];
     }
 
-  return self->sortedUIDs;
+  return sortedUIDs;
 }
 
 - (unsigned int) totalMessageCount 
 {
-  return [self->sortedUIDs count];
+  return [sortedUIDs count];
 }
 
 - (BOOL) showsAllMessages 
@@ -330,16 +316,9 @@ static int attachmentFlagSize = 8096;
   NSArray  *msgs;
   NSRange  r;
   unsigned len;
-  SOGoUser *user;
   
-  if (self->messages != nil)
-    return self->messages;
-
-  user = [context activeUser];
-  if (!dateFormatter)
-    dateFormatter = [user dateFormatterInContext: context];
-  if (!userTimeZone)
-    ASSIGN (userTimeZone, [user timeZone]);
+  if (messages != nil)
+    return messages;
 
   r    = [self fetchBlock];
   uids = [self sortedUIDs];
@@ -347,9 +326,10 @@ static int attachmentFlagSize = 8096;
     /* only need to restrict if we have a lot */
     uids = [uids subarrayWithRange:r];
   
-  msgs = [[self clientObject] fetchUIDs:uids parts:[self fetchKeys]];
-  self->messages = [[msgs valueForKey:@"fetch"] retain];
-  return self->messages;
+  msgs = [[self clientObject] fetchUIDs: uids parts: [self fetchKeys]];
+  messages = [[msgs valueForKey: @"fetch"] retain];
+
+  return messages;
 }
 
 /* URL processing */
@@ -432,25 +412,26 @@ static int attachmentFlagSize = 8096;
 {
   NSString *uid;
   
-  if ((uid = [[[self context] request] formValueForKey:@"uid"]) == nil)
+  if ((uid = [[context request] formValueForKey: @"uid"]) == nil)
     return nil;
 
-  return [[self clientObject] lookupName:uid inContext:[self context]
-                             acquire:NO];
+  return [[self clientObject] lookupName: uid
+                             inContext: context
+                             acquire: NO];
 }
 
 /* actions */
 
 - (BOOL) isJavaScriptRequest 
 {
-  return [[[[self context] request] formValueForKey:@"jsonly"] boolValue];
+  return [[[context request] formValueForKey:@"jsonly"] boolValue];
 }
 
 - (id) javaScriptOK 
 {
   WOResponse *r;
 
-  r = [[self context] response];
+  r = [context response];
   [r setStatus:200 /* OK */];
   return r;
 }
@@ -473,17 +454,57 @@ static int attachmentFlagSize = 8096;
   return firstMessage;
 }
 
+- (void) _setQualifierForCriteria: (NSString *) criteria
+                        andValue: (NSString *) value
+{
+  [qualifier release];
+
+  if ([criteria isEqualToString: @"subject"])
+    qualifier = [EOQualifier qualifierWithQualifierFormat:
+                              @"(subject doesContain: %@)",
+                            value];
+  else if ([criteria isEqualToString: @"sender"])
+    qualifier = [EOQualifier qualifierWithQualifierFormat:
+                            @"(from doesContain: %@)",
+                            value];
+  else if ([criteria isEqualToString: @"subject_or_sender"])
+    qualifier = [EOQualifier qualifierWithQualifierFormat:
+                              @"(subject doesContain: %@) OR "
+                            @"(from doesContain: %@)",
+                            value, value];
+  else if ([criteria isEqualToString: @"to_or_cc"])
+    qualifier = [EOQualifier qualifierWithQualifierFormat:
+                              @"(to doesContain: %@) OR "
+                            @"(cc doesContain: %@)",
+                            value, value];
+  else if ([criteria isEqualToString: @"entire_message"])
+    qualifier = [EOQualifier qualifierWithQualifierFormat:
+                            @"(message doesContain: %@)",
+                            value];
+  else
+    qualifier = nil;
+
+  [qualifier retain];
+}
+
 - (id) defaultAction 
 {
   WORequest *request;
-  NSString *specificMessage;
+  NSString *specificMessage, *searchCriteria, *searchValue;
 
-  request = [[self context] request];
+  request = [context request];
 
   [[self clientObject] flushMailCaches];
 
   specificMessage = [request formValueForKey: @"pageforuid"];
-  self->firstMessageNumber
+  searchCriteria = [request formValueForKey: @"search"];
+  searchValue = [request formValueForKey: @"value"];
+  if ([searchCriteria length] > 0
+      && [searchValue length] > 0)
+    [self _setQualifierForCriteria: searchCriteria
+         andValue: searchValue];
+
+  firstMessageNumber
     = ((specificMessage)
        ? [self firstMessageOfPageFor: [specificMessage intValue]]
        : [[request formValueForKey:@"idx"] intValue]);
@@ -550,19 +571,24 @@ static int attachmentFlagSize = 8096;
 {
   // TODO: we might want to flush the caches?
   NSException *error;
-  id client;
-  
-  if ((client = [self clientObject]) == nil) {
-    return [NSException exceptionWithHTTPStatus:404 /* Not Found */
-                       reason:@"did not find mail folder"];
-  }
-  
-  if ((error = [[self clientObject] expunge]) != nil)
-    return error;
+  id clientObject;
+
+  clientObject = [self clientObject];
+  if (clientObject)
+    {
+      error = [clientObject expunge];
+      if (!error)
+       {
+         if ([clientObject respondsToSelector: @selector(flushMailCaches)])
+           [clientObject flushMailCaches];
+         return [self redirectToLocation:@"view"];
+       }
+    }
+  else
+    error = [NSException exceptionWithHTTPStatus:404 /* Not Found */
+                        reason: @"did not find mail folder"];
   
-  if ([client respondsToSelector:@selector(flushMailCaches)])
-    [client flushMailCaches];
-  return [self redirectToLocation:@"view"];
+  return error;
 }
 
 @end
index 9e98639ce8e5c5b3b94d4998744ca9ce8257d18d..ca5c2267c1313e1de51db80673313b38b9a450de 100644 (file)
@@ -19,6 +19,7 @@
   02111-1307, USA.
 */
 
+#warning importing common is baaaad
 #import <Foundation/Foundation.h>
 
 #if LIB_FOUNDATION_LIBRARY
index ed1eaaed727ddbc0f9dff8bd38111a15168e5bad..c751208bb5d9328ea3f861d0fa87a332c19f2535 100644 (file)
@@ -12,7 +12,7 @@
       superclass  = "SoComponent";
       protectedBy = "View";
       defaultRoles = {
-        "View" = ( "Authenticated", "FreeBusy" );
+        "View" = ( "Authenticated" );
       };
     };
     SOGoObject = {
index 96f1d35f9905959d88e482d8acd6b08a71d101df..0b18a97b889d63dc9e1b4a378f352e23e3f1726b 100644 (file)
 
 #import <NGObjWeb/WOContext+SoObjects.h>
 #import <NGObjWeb/WODirectAction.h>
+#import <NGObjWeb/WOResponse.h>
 
+#import <SoObjects/SOGo/NSObject+Utilities.h>
 #import <SoObjects/SOGo/SOGoUser.h>
 
 #import "UIxJSONPreferences.h"
 
 @implementation UIxJSONPreferences
 
+- (WOResponse *) _makeResponse: (NSString *) jsonText
+{
+  WOResponse *response;
+
+  response = [context response];
+  [response setHeader: @"text/plain; charset=utf-8"
+           forKey: @"content-type"];
+  [response appendContentString: jsonText];
+
+  return response;
+}
+
 - (WOResponse *) jsonDefaultsAction
 {
   NSUserDefaults *defaults;
 
   defaults = [[context activeUser] userDefaults];
 
-  return [defaults jsonRepresentation];
+  return [self _makeResponse: [defaults jsonRepresentation]];
 }
 
 - (WOResponse *) jsonSettingsAction
@@ -46,7 +60,7 @@
 
   settings = [[context activeUser] userSettings];
 
-  return [settings jsonRepresentation];
+  return [self _makeResponse: [settings jsonRepresentation]];
 }
 
 @end
index 9332a7e5c3fa487de4b79b76b3bb778fcaaca5fe..e0b7f2cab0f838dde3a5ab98f9d58e0e5447cf52 100644 (file)
@@ -129,9 +129,8 @@ static BOOL uixDebugEnabled = NO;
 
 - (void) dealloc
 {
-  [self->queryParameters release];
-  if (_selectedDate)
-    [_selectedDate release];
+  [queryParameters release];
+  [_selectedDate release];
   [super dealloc];
 }
 
@@ -161,7 +160,7 @@ static BOOL uixDebugEnabled = NO;
           value = [[part substringFromIndex:(r.location + r.length)] 
                     stringByUnescapingURL];
         }
-      [self->queryParameters setObject:value forKey:key];
+      [queryParameters setObject:value forKey:key];
       part = [e nextObject];
     }
 }
@@ -195,10 +194,10 @@ static BOOL uixDebugEnabled = NO;
   NSRange   r;
   NSString *qs;
   
-  if (self->queryParameters)
-    return self->queryParameters;
+  if (queryParameters)
+    return queryParameters;
 
-  self->queryParameters = [[NSMutableDictionary alloc] initWithCapacity:8];
+  queryParameters = [[NSMutableDictionary alloc] initWithCapacity:8];
 
   req = [[self context] request];
   uri = [req uri];
@@ -212,7 +211,7 @@ static BOOL uixDebugEnabled = NO;
   /* add form values */
   [self addKeepAliveFormValuesToQueryParameters];
 
-  return self->queryParameters;
+  return queryParameters;
 }
 
 - (NSDictionary *) queryParameters
index 5da57be7df180fc42111dc6920fb63983c2ed37a..0ce5f40d19b378eb16c28faf932ba977b382ff65 100644 (file)
 "Search appointments" = "Recherche de rendez-vous";
 "Search in Anais" = "Recherche par Anaïs";
 
-"All day Event" = "Toute la journée";
+"All day Event" = "Événement sur la journéee";
 "check for conflicts" = "Vérifier les conflits";
 
 "Browse URL" = "Visiter l'URL";
index 49349d8cefd91f4ba89beb4b799dbf0b74bb647b..7d4836e5c743adec3abad4dfb66b9cc3f9018991 100644 (file)
       <tbody>
         <tr class="tableview">
           <!-- localize -->
-          <td class="tbtv_headercell headerName">
-            <var:component className="UIxSortableTableHeader"
-              label:label="Name"
-              const:sortKey="cn"
-              const:href="view"
-              var:queryDictionary="context.request.formValues"
-              />
-          </td>
-          <td class="tbtv_headercell headerEmail">
-            <var:component className="UIxSortableTableHeader"
-              label:label="Email"
-              const:sortKey="mail"
-              const:href="view"
-              var:queryDictionary="context.request.formValues"
-              />
-          </td>
-          <td class="tbtv_headercell">
-            <var:string label:value="Screen Name" />
-          </td>
-          <td class="tbtv_headercell">
-            <var:string label:value="Organization" />
-          </td>
-          <td class="tbtv_headercell">
-            <var:string label:value="Work Phone" />
-          </td>
-        </tr>
+          <td class="tbtv_headercell" id="nameHeader"
+           ><var:string label:value="Name"
+             /></td
+           ><td class="tbtv_headercell" id="mailHeader"
+           ><var:string label:value="Email"/></td
+           ><td class="tbtv_headercell" id="screenNameHeader"
+           ><var:string label:value="Screen Name" /></td
+           ><td class="tbtv_headercell" id="orgHeader"
+           ><var:string label:value="Organization" /></td
+           ><td class="tbtv_headercell" id="phoneHeader"
+           ><var:string label:value="Work Phone" /></td
+           ></tr>
 
         <var:foreach list="contactInfos" item="currentContact">
           <tr class="tableview"
             onclick="return onContactRowClick(event, this);"
             ondblclick="return onContactRowDblClick(event, this);"
             oncontextmenu="return onContactContextMenu(event, this);">
-            <td onmousedown="return false;"><img rsrc:src="abcard.gif"
+            <td><img rsrc:src="abcard.gif"
                /><var:string value="displayName" const:escapeHTML="YES" /></td>
-            <td onmousedown="return false;"><var:string value="currentContact.mail"/></td>
-            <td onmousedown="return false;"><var:string value="currentContact.screenname"/></td>
-            <td onmousedown="return false;"><var:string value="currentContact.o"/></td>
-            <td onmousedown="return false;"><var:string value="currentContact.telephonenumber"/></td>
+            <td><var:string value="currentContact.mail"/></td>
+            <td><var:string value="currentContact.screenname"/></td>
+            <td><var:string value="currentContact.o"/></td>
+            <td><var:string value="currentContact.telephonenumber"/></td>
           </tr>
         </var:foreach>
       </tbody>
index 71e4be5166f00f54240e60e0d510d00b3df1dcfd..5d15e65da560386d550dc1e32c837901862ef994 100644 (file)
@@ -7,27 +7,16 @@
     >
     <div class="menu" id="searchMenu">
       <ul id="searchOptions">
-        <li id="subject"
-          onmousedown="return false;"
-          onmouseup="setSearchCriteria(event);"><var:string label:value="Subject"/></li>
-        <li id="sender"
-          onmousedown="return false;"
-          onmouseup="setSearchCriteria(event);"><var:string label:value="Sender"/></li>
-        <li id="subject_or_sender"
-          onmousedown="return false;"
-          onmouseup="setSearchCriteria(event);"><var:string label:value="Subject or Sender"/></li>
-        <li id="to_or_cc"
-          onmousedown="return false;"
-          onmouseup="setSearchCriteria(event);"><var:string label:value="To or Cc"/></li>
-        <li id="entire_message"
-          onmousedown="return false;"
-          onmouseup="setSearchCriteria(event);"><var:string label:value="Entire Message"/></li>
-        <li id="find_in_message"
-          onmousedown="return false;"
-          onmouseup="setSearchCriteria(event);"><var:string label:value="Find In Message"/></li>
+        <li id="subject"><var:string label:value="Subject"/></li>
+        <li id="sender"><var:string label:value="Sender"/></li>
+        <li id="subject_or_sender"><var:string
+           label:value="Subject or Sender"/></li>
+        <li id="to_or_cc"><var:string label:value="To or Cc"/></li>
+        <li id="entire_message"><var:string
+           label:value="Entire Message"/></li>
       </ul>
     </div>
-    
+
     <div id="filterPanel">
       <var:if condition="hideFrame" const:negate="YES"
         ><span class="searchBox" style="float: right">
            menuid="searchMenu" />
         </span>
 
-        <var:string label:value="View:" />
+<!--        <var:string label:value="View:" />
         <var:popup list="filters" 
           item="filter" string="filterLabel" value="filter"
           selection="selectedFilter"
-          const:name="filterpopup" />
+          const:name="filterpopup" /> -->
       </var:if>
     </div>
   </container>
index 741252ca05bd762cae8d1440918af05639ce3cde..b6514b3a71a7545103055e29b289f4b63da08b78 100644 (file)
 <?xml version='1.0' standalone='yes'?>
-  <table multiselect="yes" id="messageList"
-    xmlns="http://www.w3.org/1999/xhtml"
-    xmlns:var="http://www.skyrix.com/od/binding"
-    xmlns:const="http://www.skyrix.com/od/constant"
-    xmlns:rsrc="OGo:url"
-    xmlns:label="OGo:label">
-    <thead>
-      <tr class="tableview"
-        ><td class="tbtv_headercell messageFlagColumn"
-          ><var:entity const:name="nbsp" /></td
-          ><td class="tbtv_headercell messageFlagColumn">
-          <img rsrc:src="title_attachment_14x14.png" width="14"
-            height="14"
-            /></td
-          ><td class="tbtv_headercell tbtv_subject_headercell"
-          ><var:component className="UIxSortableTableHeader"
-            label:label="Subject"
-            const:sortKey="subject"
-            const:href="view"
-            var:queryDictionary="context.request.formValues"
-            /></td
-          ><td class="tbtv_headercell tbtv_from_headercell"
-          ><var:if condition="showToAddress" const:negate="YES"
-            ><var:component className="UIxSortableTableHeader"
-              label:label="From"
-              const:sortKey="from"
-              const:href="view"
-              var:queryDictionary="context.request.formValues"
-              /></var:if
-            ><var:if condition="showToAddress"
-            ><var:component className="UIxSortableTableHeader"
-              label:label="To"
-              const:sortKey="to"
-              const:href="view"
-              var:queryDictionary="context.request.formValues"
-              /></var:if
-            ></td
-          ><td class="tbtv_headercell messageFlagColumn"
-          ><img rsrc:src="title_read_14x14.png" width="14" height="14"
-            /></td
-          ><td class="tbtv_headercell tbtv_date_headercell"
-          ><var:component className="UIxSortableTableHeader"
-            label:label="Date"
-            const:sortKey="date"
-            const:href="view"
-            var:queryDictionary="context.request.formValues"
-            const:isDefault="YES"
-            /></td
-          ></tr>
-      <tr class="tableview"
-       ><td colspan="6" class="tbtv_navcell"
-         ><var:if condition="hasPrevious">
-           <a href="#"
-             idx="1"><var:string label:value="first"/></a> |
-           <a href="#"
-             var:idx="prevFirstMessageNumber"
-             ><var:string label:value="previous"/></a> |
-         </var:if>
-         <var:string value="firstMessageNumber" />
-         <var:string label:value="msgnumber_to" />
-         <var:string value="lastMessageNumber" />
-         <var:string label:value="msgnumber_of" />
-         <var:string value="sortedUIDs.count" />
-            <var:if condition="hasNext"
-           >| <a href="#"
-             var:idx="nextFirstMessageNumber"
-             ><var:string label:value="next" /></a>
-         </var:if
+<!DOCTYPE table>
+<table multiselect="yes" id="messageList"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:var="http://www.skyrix.com/od/binding"
+  xmlns:const="http://www.skyrix.com/od/constant"
+  xmlns:rsrc="OGo:url"
+  xmlns:label="OGo:label">
+  <thead>
+    <tr class="tableview"
+      ><td class="tbtv_headercell messageFlagColumn"
+       ><var:entity const:name="nbsp" /></td
+       ><td class="tbtv_headercell messageFlagColumn">
+       <img rsrc:src="title_attachment_14x14.png" width="14"
+         height="14"/></td
+       ><td class="tbtv_headercell" id="subjectHeader"
+       ><var:string label:value="Subject"/></td
+       ><td class="tbtv_headercell" id="fromHeader"
+       ><var:if condition="showToAddress" const:negate="YES"
+         ><var:string label:value="From"/></var:if
+         ><var:if condition="showToAddress"
+         ><var:string label:value="To"/></var:if
+         ></td
+       ><td class="tbtv_headercell" id="messageFlagHeader"
+       ><img rsrc:src="title_read_14x14.png"/></td
+       ><td class="tbtv_headercell" id="dateHeader"
+       ><var:string label:value="Date"/></td
+       ></tr>
+    <tr class="tableview"
+      ><td colspan="6" class="tbtv_navcell"
+       ><var:if condition="hasPrevious">
+         <a href="#"
+           idx="1"><var:string label:value="first"/></a> |
+         <a href="#"
+           var:idx="prevFirstMessageNumber"
+           ><var:string label:value="previous"/></a> |
+       </var:if>
+       <var:string value="firstMessageNumber" />
+       <var:string label:value="msgnumber_to" />
+       <var:string value="lastMessageNumber" />
+       <var:string label:value="msgnumber_of" />
+       <var:string value="sortedUIDs.count" />
+       <var:if condition="hasNext"
+         >| <a href="#"
+           var:idx="nextFirstMessageNumber"
+           ><var:string label:value="next" /></a>
+       </var:if
+         ></td
+       ></tr
+      >
+  </thead>
+  <tbody>
+    <var:foreach list="messages" item="message"
+      ><tr var:class="messageRowStyleClass" var:id="msgRowID"
+       ><td class="messageFlagColumn"><var:entity name="nbsp"/></td
+         ><td class="messageFlagColumn"
+         ><var:if condition="hasMessageAttachment"
+           ><img rsrc:src="title_attachment_14x14.png"
+             /></var:if
            ></td
-         ></tr
-          >
-    </thead>
-    <tbody>
-      <var:foreach list="messages" item="message"
-        ><tr var:class="messageRowStyleClass" var:id="msgRowID"
-          ><td class="messageFlagColumn"><var:entity name="nbsp"/></td
-            ><td class="messageFlagColumn"
-           ><var:if condition="hasMessageAttachment"
-              ><img rsrc:src="title_attachment_14x14.png"
-                /></var:if
-              ></td
-            
-            ><td
-            var:class="messageSubjectCellStyleClass"
-            var:id="msgDivID"
-            ><var:string value="message.envelope.subject"
-              formatter="context.mailSubjectFormatter"
-              /></td
+         
+         ><td
+         var:class="messageSubjectCellStyleClass"
+         var:id="msgDivID"
+         ><var:string value="message.envelope.subject"
+           formatter="context.mailSubjectFormatter"
+           /></td
 
-            ><td class="messageAddressColumn"
-            ><var:if condition="showToAddress" const:negate="YES"
-              ><var:string value="message.envelope.from"
-                formatter="context.mailEnvelopeAddressFormatter"
-                /></var:if
-              ><var:if condition="showToAddress"
-              ><var:string value="message.envelope.to"
-                formatter="context.mailEnvelopeAddressFormatter"
-                /></var:if
-              ></td
-            
-            ><td class="messageFlagColumn"
-            ><var:if condition="isMessageRead"
-              ><img rsrc:src="icon_read.gif"
-                class="mailerReadIcon"
-                label:title="Mark Unread"
-                label:title-markread="Mark Read"
-                label:title-markunread="Mark Unread"
-                var:id="msgIconReadImgID"
-                /></var:if
-              ><var:if condition="isMessageRead" const:negate="YES"
-              ><img rsrc:src="icon_unread.gif"
-                class="mailerUnreadIcon"
-                label:title="Mark Read"
-                label:title-markread="Mark Read"
-                label:title-markunread="Mark Unread"
-                var:id="msgIconUnreadImgID"
-                /></var:if
-              ></td
-            
-            ><td class="messageDateColumn"
-            ><span class="mailer_datefield"
-              ><var:string value="messageDate" 
-                /></span
-              ><entity name="nbsp"
-              /></td
-            ></tr>
-      </var:foreach>
-    </tbody>
+         ><td class="messageAddressColumn"
+         ><var:if condition="showToAddress" const:negate="YES"
+           ><var:string value="message.envelope.from"
+             formatter="context.mailEnvelopeAddressFormatter"
+             /></var:if
+           ><var:if condition="showToAddress"
+           ><var:string value="message.envelope.to"
+             formatter="context.mailEnvelopeAddressFormatter"
+             /></var:if
+           ></td
+         
+         ><td class="messageFlagColumn"
+         ><var:if condition="isMessageRead"
+           ><img rsrc:src="icon_read.gif"
+             class="mailerReadIcon"
+             label:title="Mark Unread"
+             label:title-markread="Mark Read"
+             label:title-markunread="Mark Unread"
+             var:id="msgIconReadImgID"
+             /></var:if
+           ><var:if condition="isMessageRead" const:negate="YES"
+           ><img rsrc:src="icon_unread.gif"
+             class="mailerUnreadIcon"
+             label:title="Mark Read"
+             label:title-markread="Mark Read"
+             label:title-markunread="Mark Unread"
+             var:id="msgIconUnreadImgID"
+             /></var:if
+           ></td
+         
+         ><td class="messageDateColumn"
+         ><span class="mailer_datefield"
+           ><var:string value="messageDate" 
+             /></span
+           ><entity name="nbsp"
+           /></td
+         ></tr>
+    </var:foreach>
+  </tbody>
   </table>
index 21bed1e35e398ce7e58cdc3abd91056de7448c0d..343ad30d825dff5cf6da8663bedba39d95c5c3d7 100644 (file)
 
     <div id="rightPanel">
       <var:component className="UIxMailFilterPanel" qualifier="qualifier" />
-      
-        <div id="mailboxContent"><!-- space --></div>
-        <div class="dragHandle" id="rightDragHandle"><!-- space --></div>
-        <div id="messageContent"><!-- space --></div>
+      <div id="mailboxContent"><!-- space --></div>
+      <div class="dragHandle" id="rightDragHandle"><!-- space --></div>
+      <div id="messageContent"><!-- space --></div>
     </div>
 
     <var:string value="errorAlertJavaScript" const:escapeHTML="NO" />
index e96cc3b4ca5f2aebd99a2df8f5e40ffcec56d471..f70ba607ac109938523d24875ca96ed5b528b032 100644 (file)
@@ -179,8 +179,8 @@ TABLE#contactsList TD
 { white-space: nowrap;
   width: 20%; }
 
-TABLE#contactsList TD.headerName,
-TABLE#contactsList TD.headerEmail
+TD#nameHeader,
+TD#mailHeader
 { width: 30%; }
 
 TABLE#contactsList TD IMG
index 0e3b0357fb301d384ffcb171bfbc0cc5680447b4..4cae52a46a65ac89ce5a457c05887dffc97f19b3 100644 (file)
@@ -1,7 +1,7 @@
 /* JavaScript for SOGoContacts */
 
 var cachedContacts = new Array();
-var currentContactFolder = '/personal';
+var currentContactFolder = null;
 
 var usersRightsWindowHeight = 200;
 var usersRightsWindowWidth = 450;
@@ -30,8 +30,22 @@ function validateEditorInput(sender) {
   return true;
 }
 
-function openContactsFolder(contactsFolder, params) {
-  if (contactsFolder != currentContactFolder || params) {
+function openContactsFolder(contactsFolder, reload, idx) {
+  if (contactsFolder != currentContactFolder || reload) {
+     currentContactFolder = contactsFolder;
+     var url = URLForFolderID(currentContactFolder) +
+       "/view?noframe=1";
+
+     var searchValue = search["value"];
+     if (searchValue && searchValue.length > 0)
+       url += ("&search=" + search["criteria"]
+               + "&value=" + searchValue);
+     var sortAttribute = sorting["attribute"];
+     if (sortAttribute && sortAttribute.length > 0)
+       url += ("&sort=" + sorting["attribute"]
+               + "&asc=" + sorting["ascending"]);
+
+     var selection;
      if (contactsFolder == currentContactFolder) {
         var contactsList = $("contactsList");
         if (contactsList)
@@ -40,21 +54,14 @@ function openContactsFolder(contactsFolder, params) {
            window.alert("no contactsList");
      }
      else
-      selection = null;
-
-    currentContactFolder = contactsFolder;
-    var url = URLForFolderID(currentContactFolder) +
-       "/view?noframe=1&sort=cn&desc=0";
-    if (params)
-      url += '&' + params;
-
-    var selection;
-    if (document.contactsListAjaxRequest) {
-      document.contactsListAjaxRequest.aborted = true;
-      document.contactsListAjaxRequest.abort();
-    }
-    document.contactsListAjaxRequest
-      = triggerAjaxRequest(url, contactsListCallback, selection);
+       selection = null;
+
+     if (document.contactsListAjaxRequest) {
+       document.contactsListAjaxRequest.aborted = true;
+       document.contactsListAjaxRequest.abort();
+     }
+     document.contactsListAjaxRequest
+       = triggerAjaxRequest(url, contactsListCallback, selection);
   }
 }
 
@@ -70,6 +77,15 @@ function openContactsFolderAtIndex(element) {
     = triggerAjaxRequest(url, contactsListCallback);
 }
 
+function configureContactsListHeaders(cells) {
+   for (var i = 0; i < cells.length; i++) {
+      var currentCell = $(cells[i]);
+      Event.observe(currentCell, "click",
+                   onHeaderClick.bindAsEventListener(currentCell));
+      Event.observe(currentCell, "mousedown", listRowMouseDownHandler);
+   }
+}
+
 function contactsListCallback(http) {
   var div = $("contactsListContent");
 
@@ -77,12 +93,44 @@ function contactsListCallback(http) {
       && http.status == 200) {
     document.contactsListAjaxRequest = null;
     div.innerHTML = http.responseText;
+
+    var table = $("contactsList");
+    if (table)
+       configureContactsListHeaders(table.tBodies[0].rows[0].cells);
+
+    if (sorting["attribute"] && sorting["attribute"].length > 0) {
+       var sortHeader;
+       if (sorting["attribute"] == "cn")
+         sortHeader = $("nameHeader");
+       else if (sorting["attribute"] == "mail")
+         sortHeader = $("mailHeader");
+       else if (sorting["attribute"] == "screenname")
+         sortHeader = $("screenNameHeader");
+       else if (sorting["attribute"] == "o")
+         sortHeader = $("orgHeader");
+       else if (sorting["attribute"] == "telephonenumber")
+         sortHeader = $("phoneHeader");
+       else
+         sortHeader = null;
+       
+       if (sortHeader) {
+         var sortImage = createElement("img", "messageSortImage", "sortImage");
+         sortHeader.insertBefore(sortImage, sortHeader.firstChild);
+         if (sorting["ascending"])
+            sortImage.src = ResourcesURL + "/title_sortdown_12x12.png";
+         else
+            sortImage.src = ResourcesURL + "/title_sortup_12x12.png";
+       }
+    }
+
     var selected = http.callbackData;
     if (selected) {
-        for (var i = 0; i < selected.length; i++)
-          $(selected[i]).select();
+       for (var i = 0; i < selected.length; i++) {
+         var row = $(selected[i]);
+         if (row)
+            row.select();
+       }
     }
-    configureSortableTableHeaders();
   }
   else
     log ("ajax problem 1");
@@ -332,19 +380,31 @@ function newEmailTo(sender) {
 }
 
 function onHeaderClick(event) {
-  if (document.contactsListAjaxRequest) {
-    document.contactsListAjaxRequest.aborted = true;
-    document.contactsListAjaxRequest.abort();
-  }
-  url = URLForFolderID(currentContactFolder);
-// //   log("url: " + url);
-//   var url = "" + this.href;
-  if (url.indexOf("noframe=", 0) == -1)
-     url += "&noframe=1";
-  document.contactsListAjaxRequest
-     = triggerAjaxRequest(url, contactsListCallback);
+   var headerId = this.getAttribute("id");
+   var newSortAttribute;
+   if (headerId == "nameHeader")
+      newSortAttribute = "cn";
+   else if (headerId == "mailHeader")
+      newSortAttribute = "mail";
+   else if (headerId == "screenNameHeader")
+      newSortAttribute = "screenname";
+   else if (headerId == "orgHeader")
+      newSortAttribute = "o";
+   else if (headerId == "phoneHeader")
+      newSortAttribute = "telephonenumber";
+
+   log("header: " + headerId);
+
+   if (sorting["attribute"] == newSortAttribute)
+      sorting["ascending"] = !sorting["ascending"];
+   else {
+      sorting["attribute"] = newSortAttribute;
+      sorting["ascending"] = true;
+   }
+
+   refreshCurrentFolder();
 
-  event.preventDefault();
+   preventDefault(event);
 }
 
 function registerDraggableMessageNodes() {
@@ -367,17 +427,17 @@ function onFolderSelectionChange() {
       var div = $("contactsListContent");
       div.innerHTML = "";
    }
-   else
-      openContactsFolder(nodes[0].getAttribute("id"), null);
+   else {
+      search = {};
+      sorting = {};
+      $("searchValue").value = "";
+      initCriteria();
+      openContactsFolder(nodes[0].getAttribute("id"));
+   }
 }
 
-function onSearchFormSubmit() {
-  var searchValue = $("searchValue");
-
-  openContactsFolder(currentContactFolder,
-                    "search=" + searchValue.value);
-
-  return false;
+function refreshCurrentFolder() {
+   openContactsFolder(currentContactFolder, true);
 }
 
 function onConfirmContactSelection(event) {
@@ -409,7 +469,7 @@ function onConfirmContactSelection(event) {
        && selectorList.value != initialValues)
       selector.changeNotification("addition");
 
-   event.preventDefault();
+   preventDefault(event);
 }
 
 function onContactMailTo(node) {
@@ -417,11 +477,11 @@ function onContactMailTo(node) {
 }
 
 function refreshContacts(contactId) {
-  openContactsFolder(currentContactFolder, "reload=true");
-  cachedContacts[currentContactFolder + "/" + contactId] = null;
-  loadContact(contactId);
+   refreshCurrentFolder();
+   cachedContacts[currentContactFolder + "/" + contactId] = null;
+   loadContact(contactId);
 
-  return false;
+   return false;
 }
 
 function onAddressBookNew(event) {
@@ -465,7 +525,7 @@ function newUserFolderCallback(folderData) {
 function onAddressBookAdd(event) {
    openUserFolderSelector(newUserFolderCallback, "contact");
 
-   event.preventDefault();
+   preventDefault(event);
 }
 
 function onFolderUnsubscribeCB(folderId) {
@@ -494,7 +554,7 @@ function onAddressBookRemove(event) {
      }
   }
 
-  event.preventDefault();
+  preventDefault(event);
 }
 
 function deletePersonalAddressBook(folderId) {
@@ -594,13 +654,15 @@ function configureContactFolders() {
 
     var personalFolder = $("/personal");
     personalFolder.select();
+    openContactsFolder("/personal");
   }
 }
 
 function setEventsOnContactFolder(node) {
-  Event.observe(node, "mousedown", listRowMouseDownHandler, false);
-  Event.observe(node, "click", onRowClick, false);
-  Event.observe(node, "contextmenu", onContactFoldersContextMenu.bindAsEventListener(node), false);
+   Event.observe(node, "mousedown", listRowMouseDownHandler, false);
+   Event.observe(node, "click", onRowClick, false);
+   Event.observe(node, "contextmenu",
+                onContactFoldersContextMenu.bindAsEventListener(node), false);
 }
 
 function onMenuSharing(event) {
@@ -625,29 +687,19 @@ function getMenus() {
    return menus;
 }
 
-function configureSearchField() {
-   var searchValue = $("searchValue");
-
-   Event.observe(searchValue, "mousedown", onSearchMouseDown.bindAsEventListener(searchValue), false);
-   Event.observe(searchValue, "click", popupSearchMenu.bindAsEventListener(searchValue), false);
-   Event.observe(searchValue, "blur", onSearchBlur.bindAsEventListener(searchValue), false);
-   Event.observe(searchValue, "focus", onSearchFocus.bindAsEventListener(searchValue), false);
-   Event.observe(searchValue, "keydown", onSearchKeyDown.bindAsEventListener(searchValue), false);
-}
-
 function configureSelectionButtons() {
    var container = $("contactSelectionButtons");
    if (container) {
       var buttons = container.childNodesWithTag("input");
       for (var i = 0; i < buttons.length; i++)
-       Event.observe(buttons[i], "click", onConfirmContactSelection.bindAsEventListener(buttons[i]), false);
+       Event.observe(buttons[i], "click",
+                     onConfirmContactSelection.bindAsEventListener(buttons[i]));
    }
 }
 
 function initContacts(event) {
    if (!document.body.hasClassName("popup")) {
      configureAbToolbar();
-     configureSearchField();
    }
    else
      configureSelectionButtons();
index 2010ef5699be9e58bc747e0c3706152701ab2914..98d15c6b374348625028a232767cab3278033640 100644 (file)
@@ -470,7 +470,8 @@ TABLE#addr_table
 }
 
 TABLE#messageList
-{ display: block;
+{ cursor: default;
+  display: block;
   position: absolute;
   background-color: #fff;
   color: #000;
@@ -493,21 +494,25 @@ TABLE#messageList THEAD
 TABLE#messageList TD
 { height: 1.2em; }
 
+TD#messageFlagHeader,
 TABLE#messageList TD.messageFlagColumn
 { width: 1em;
   text-align: center; }
 
+TD#subjectHeader,
 TABLE#messageList TD.tbtv_subject_headercell,
 TABLE#messageList td.mailer_unreadmailsubject,
 TABLE#messageList td.mailer_readmailsubject
 { width: 40%;
   min-width: 40%; }
 
+TD#fromHeader,
 TABLE#messageList TD.tbtv_from_headercell,
 TABLE#messageList TD.messageAddressColumn
 { width: 35%;
   overflow: hidden; }
 
+TD#dateHeader,
 TABLE#messageList TD.tbtv_date_headercell,
 TABLE#messageList TD.messageDateColumn
 { width: 25%;
index a88ec830d01a5c308c3f9e970c55232bcc35568b..6e30e03a6ca64563827bd969cc2a72bfb06befec 100644 (file)
@@ -342,7 +342,8 @@ function moveMessages(rowIds, folder) {
       /* send AJAX request (synchronously) */
          
       var messageId = currentMailbox + "/" + rowIds[i];
-      url = ApplicationBaseURL + messageId + "/move?jsonly=1&tofolder=" + folder;
+      url = (ApplicationBaseURL + messageId
+            + "/move?jsonly=1&tofolder=" + folder);
       http = createHTTPClient();
       http.open("GET", url, false /* not async */);
       http.send("");
@@ -384,6 +385,11 @@ function onMailboxTreeItemClick(event) {
    this.select();
    topNode.selectedEntry = this;
 
+   search = {};
+   sorting = {};
+   $("searchValue").value = "";
+   initCriteria();
+
    var datatype = this.parentNode.getAttribute("datatype");
    if (datatype == "account" || datatype == "additional") {
       currentMailbox = mailbox;
@@ -406,73 +412,60 @@ function onMailboxMenuCopy() {
    window.alert("unimplemented");
 }
 
-function _refreshWindowMailbox() {
-   openMailbox(currentMailbox, true);
-}
-
 function refreshMailbox() {
    var topWindow = getTopWindow();
    if (topWindow)
-      topWindow._refreshWindowMailbox();
+      topWindow.refreshCurrentFolder();
 
    return false;
 }
 
-function openMailbox(mailbox, reload) {
+function openMailbox(mailbox, reload, idx) {
    if (mailbox != currentMailbox || reload) {
       currentMailbox = mailbox;
-      var url = ApplicationBaseURL + mailbox + "/view?noframe=1&desc=1";
-      var mailboxContent = $("mailboxContent");
-      var rightDragHandle = $("rightDragHandle");
+      var url = ApplicationBaseURL + mailbox + "/view?noframe=1";
       var messageContent = $("messageContent");
       messageContent.innerHTML = '';
-      if (mailbox.lastIndexOf("/") == 0) {
-        var url = (ApplicationBaseURL + currentMailbox + "/"
-                   + "/view?noframe=1");
-        if (document.messageAjaxRequest) {
-           document.messageAjaxRequest.aborted = true;
-           document.messageAjaxRequest.abort();
-        }
-        document.messageAjaxRequest
-           = triggerAjaxRequest(url, messageCallback);
-        mailboxContent.innerHTML = '';
-        mailboxContent.style.visibility = "hidden;";
-        rightDragHandle.style.visibility = "hidden;";
-        messageContent.style.top = "0px;";
-      } else {
-        if (document.messageListAjaxRequest) {
-           document.messageListAjaxRequest.aborted = true;
-           document.messageListAjaxRequest.abort();
-        }
-        if (currentMessages[mailbox]) {
-           loadMessage(currentMessages[mailbox]);
-           url += '&pageforuid=' + currentMessages[mailbox];
-        }
-        document.messageListAjaxRequest
-           = triggerAjaxRequest(url, messageListCallback,
-                                currentMessages[mailbox]);
-        if (mailboxContent.getStyle('visibility') == "hidden") {
-           mailboxContent.setStyle({ visibility: "visible" });
-           rightDragHandle.setStyle({ visibility: "visible" });
-           messageContent.setStyle({ top: (rightDragHandle.offsetTop
-                                           + rightDragHandle.offsetHeight
-                                           + 'px') });
-        }
+
+      if (currentMessages[mailbox]) {
+        loadMessage(currentMessages[mailbox]);
+        url += '&pageforuid=' + currentMessages[mailbox];
+      }
+
+      var searchValue = search["value"];
+      if (searchValue && searchValue.length > 0)
+        url += ("&search=" + search["criteria"]
+                + "&value=" + searchValue);
+      var sortAttribute = sorting["attribute"];
+      if (sortAttribute && sortAttribute.length > 0)
+        url += ("&sort=" + sorting["attribute"]
+                + "&asc=" + sorting["ascending"]);
+      if (idx)
+        url += "&idx=" + idx;
+
+      if (document.messageListAjaxRequest) {
+        document.messageListAjaxRequest.aborted = true;
+        document.messageListAjaxRequest.abort();
       }
+
+      var mailboxContent = $("mailboxContent");
+      if (mailboxContent.getStyle('visibility') == "hidden") {
+        mailboxContent.setStyle({ visibility: "visible" });
+        var rightDragHandle = $("rightDragHandle");
+        rightDragHandle.setStyle({ visibility: "visible" });
+        messageContent.setStyle({ top: (rightDragHandle.offsetTop
+                                        + rightDragHandle.offsetHeight
+                                        + 'px') });
+      }
+
+      document.messageListAjaxRequest
+        = triggerAjaxRequest(url, messageListCallback,
+                             currentMessages[mailbox]);
    }
-   //   triggerAjaxRequest(mailbox, 'toolbar', toolbarCallback);
 }
 
 function openMailboxAtIndex(event) {
-   var idx = this.getAttribute("idx");
-   var url = ApplicationBaseURL + currentMailbox + "/view?noframe=1&idx=" + idx;
-
-   if (document.messageListAjaxRequest) {
-      document.messageListAjaxRequest.aborted = true;
-      document.messageListAjaxRequest.abort();
-   }
-   document.messageListAjaxRequest
-      = triggerAjaxRequest(url, messageListCallback);
+   openMailbox(currentMailbox, true, this.getAttribute("idx"));
 
    preventDefault(event);
 }
@@ -486,11 +479,31 @@ function messageListCallback(http) {
       div.innerHTML = http.responseText;
       var selected = http.callbackData;
       if (selected) {
-        var row = $('row_' + selected);
-        row.select();
+        var row = $("row_" + selected);
+        if (row)
+           row.select();
       }
       configureMessageListEvents();
-      configureSortableTableHeaders();
+      if (sorting["attribute"] && sorting["attribute"].length > 0) {
+        var sortHeader;
+        if (sorting["attribute"] == "subject")
+           sortHeader = $("subjectHeader");
+        else if (sorting["attribute"] == "from")
+           sortHeader = $("fromHeader");
+        else if (sorting["attribute"] == "date")
+           sortHeader = $("dateHeader");
+        else
+           sortHeader = null;
+
+        if (sortHeader) {
+           var sortImage = createElement("img", "messageSortImage", "sortImage");
+           sortHeader.insertBefore(sortImage, sortHeader.firstChild);
+           if (sorting["ascending"])
+              sortImage.src = ResourcesURL + "/title_sortdown_12x12.png";
+           else
+              sortImage.src = ResourcesURL + "/title_sortup_12x12.png";
+        }
+      }
    }
    else
       log("messageListCallback: problem during ajax request (readyState = " + http.readyState + ", status = " + http.status + ")");
@@ -834,24 +847,31 @@ function expandUpperTree(node) {
 }
 
 function onHeaderClick(event) {
-   if (document.messageListAjaxRequest) {
-      document.messageListAjaxRequest.aborted = true;
-      document.messageListAjaxRequest.abort();
+   var headerId = this.getAttribute("id");
+   var newSortAttribute;
+   if (headerId == "subjectHeader")
+      newSortAttribute = "subject";
+   else if (headerId == "fromHeader")
+      newSortAttribute = "from";
+   else if (headerId == "dateHeader")
+      newSortAttribute = "date";
+   else
+      newSortAttribute = "arrival";
+
+   if (sorting["attribute"] == newSortAttribute)
+      sorting["ascending"] = !sorting["ascending"];
+   else {
+      sorting["attribute"] = newSortAttribute;
+      sorting["ascending"] = true;
    }
-   var link = this.getAttribute('href');
-   url = ApplicationBaseURL + currentMailbox + "/" + link;
-   if (!link.match(/noframe=/))
-      url += "&noframe=1";
-   document.messageListAjaxRequest
-      = triggerAjaxRequest(url, messageListCallback);
+
+   refreshCurrentFolder();
 
    preventDefault(event);
 }
 
-function onSearchFormSubmit() {
-   log("search not implemented");
-
-   return false;
+function refreshCurrentFolder() {
+   openMailbox(currentMailbox, true);
 }
 
 function pouetpouet(event) {
@@ -934,11 +954,24 @@ var messageListData = function(type) {
    return msgIds;
 }
 
+/* a model for a futur refactoring of the sortable table headers mechanism */
+
+function configureMessageListHeaders(cells) {
+   for (var i = 0; i < cells.length; i++) {
+      var currentCell = $(cells[i]);
+      Event.observe(currentCell, "click",
+                   onHeaderClick.bindAsEventListener(currentCell));
+      Event.observe(currentCell, "mousedown", listRowMouseDownHandler);
+   }
+}
+
 function configureMessageListEvents() {
    var messageList = $("messageList");
    if (messageList) {
       Event.observe(messageList, "mousedown",
                    onMessageSelectionChange.bindAsEventListener(messageList));
+
+      configureMessageListHeaders(messageList.tHead.rows[0].cells);
       var cell = messageList.tHead.rows[1].cells[0];
       if ($(cell).hasClassName("tbtv_navcell")) {
         var anchors = $(cell).childNodesWithTag("a");
@@ -955,7 +988,7 @@ function configureMessageListEvents() {
         rows[i].dndGhost = messageListGhost;
         rows[i].dndDataForType = messageListData;
         document.DNDManager.registerSource(rows[i]);
-        
+
         for (var j = 0; j < rows[i].cells.length; j++) {
            var cell = rows[i].cells[j];
            Event.observe(cell, "mousedown", listRowMouseDownHandler);
@@ -1026,19 +1059,8 @@ function openInbox(node) {
    mailboxTree.o(1);
 }
 
-function configureSearchField() {
-   var searchValue = $("searchValue");
-
-   Event.observe(searchValue, "mousedown", onSearchMouseDown.bindAsEventListener(searchValue));
-   Event.observe(searchValue, "click", popupSearchMenu.bindAsEventListener(searchValue));
-   Event.observe(searchValue, "blur", onSearchBlur.bindAsEventListener(searchValue));
-   Event.observe(searchValue, "focus", onSearchFocus.bindAsEventListener(searchValue));
-   Event.observe(searchValue, "keydown", onSearchKeyDown.bindAsEventListener(searchValue));
-}
-
 function initMailer(event) {
    if (!document.body.hasClassName("popup")) {
-      configureSearchField();
       configureMessageListEvents();
       initDnd();
       currentMailbox = "/" + accounts[0] + "/INBOX";
@@ -1319,6 +1341,9 @@ function getMenus() {
                                   null);
    menus["mark-menu"] = new Array(null, null, null, null, "-", null, "-",
                                  null, null, null);
+   menus["searchMenu"] = new Array(setSearchCriteria, setSearchCriteria,
+                                  setSearchCriteria, setSearchCriteria,
+                                  setSearchCriteria);
 
    return menus;
 }
index 5354d999859c0071515166255900d45976c366ed..8e39832b308694a5fd1aa775a1cd2fd73fbb80d7 100644 (file)
@@ -53,7 +53,7 @@ function saveAcls() {
 function onUserAdd(event) {
    openUserFolderSelector(null, "user");
 
-   event.preventDefault();
+   preventDefault(event);
 }
 
 function removeUserCallback(http) {
@@ -79,7 +79,7 @@ function onUserRemove(event) {
       var userId = nodes[i].getAttribute("id");
       triggerAjaxRequest(baseURL + userId, removeUserCallback, nodes[i]);
    }
-   event.preventDefault();
+   preventDefault(event);
 }
 
 function subscribeToFolder(refreshCallback, refreshCallbackData) {
@@ -109,12 +109,12 @@ function openRightsForUser(button) {
 
 function openRightsForDefaultUser(event) {
    openRightsForUserID(defaultUserID);
-   event.preventDefault();
+   preventDefault(event);
 }
 
 function onOpenUserRights(event) {
    openRightsForUser();
-   event.preventDefault();
+   preventDefault(event);
 }
 
 function onAclLoadHandler() {
index ea67f8e2f2b24a1e1b9d13941729e1f2eff9d6e4..1fe1004b01bbc0f4e1e4894516a78415e0dad71d 100644 (file)
@@ -15,7 +15,7 @@ var attendeesEmails;
 
 function onContactKeydown(event) {
   if (event.keyCode == 9) {
-    event.preventDefault();
+    preventDefault(event);
     if (this.confirmedValue)
       this.value = this.confirmedValue;
     var row = this.parentNode.parentNode.nextSibling;
@@ -333,7 +333,7 @@ function initializeWindowButtons() {
 }
 
 function onEditorOkClick(event) {
-   event.preventDefault();
+   preventDefault(event);
 
    attendeesNames = new Array();
    attendeesEmails = new Array();
@@ -363,7 +363,7 @@ function onEditorOkClick(event) {
 }
 
 function onEditorCancelClick(event) {
-   event.preventDefault();
+   preventDefault(event);
    window.close();
 }
 
index c14f0f1918e9d15a379ce64176089c11eaa62b5b..47a0d619a4a5527c5c50368ff2b4806b0575adae 100644 (file)
@@ -43,7 +43,7 @@ function onPopupUrlWindow(event) {
 function onPopupDocumentWindow(event) {
    var documentUrl = $("url");
 
-   event.preventDefault();
+   preventDefault(event);
    window.open(documentUrl.value, "SOGo_Document");
 
    return false;
index d5b527a16a5dbabd0f0b6d426c414c9117df27f5..2755a613ff5bdb72dbcbb925e2a294ed077b57c8 100644 (file)
@@ -78,7 +78,7 @@ function buildTree(response) {
 }
 
 function onFolderTreeItemClick(event) {
-   event.preventDefault();
+   preventDefault(event);
 
    var topNode = $("d");
    if (topNode.selectedEntry)
index fdf04908d8a763736f0715771ce819b8351dfa59..ed4db4a4b3c5a49894d13a5712a992cc998800e3 100644 (file)
-// written by Dean Edwards, 2005\r
-// with input from Tino Zijdel, Matthias Miller, Diego Perini\r
-// http://dean.edwards.name/weblog/2005/10/add-event/\r
-function addEvent(element, type, handler) {\r
-       // Modification by Tanny O'Haley, http://tanny.ica.com to add the\r
-       // DOMContentLoaded for all browsers.\r
-       if (type == "DOMContentLoaded" || type == "domload") {\r
-               addDOMLoadEvent(handler);\r
-               return;\r
-       }\r
-       \r
-       if (element.addEventListener) {\r
-               element.addEventListener(type, handler, false);\r
-       } else {\r
-               // assign each event handler a unique ID\r
-               if (!handler.$$guid) handler.$$guid = addEvent.guid++;\r
-               // create a hash table of event types for the element\r
-               if (!element.events) element.events = {};\r
-               // create a hash table of event handlers for each element/event pair\r
-               var handlers = element.events[type];\r
-               if (!handlers) {\r
-                       handlers = element.events[type] = {};\r
-                       // store the existing event handler (if there is one)\r
-                       if (element["on" + type]) {\r
-                               handlers[0] = element["on" + type];\r
-                       }\r
-               }\r
-               // store the event handler in the hash table\r
-               handlers[handler.$$guid] = handler;\r
-               // assign a global event handler to do all the work\r
-               element["on" + type] = handleEvent;\r
-       }\r
-};\r
-// a counter used to create unique IDs\r
-addEvent.guid = 1;\r
-\r
-function removeEvent(element, type, handler) {\r
-       if (element.removeEventListener) {\r
-               element.removeEventListener(type, handler, false);\r
-       } else {\r
-               // delete the event handler from the hash table\r
-               if (element.events && element.events[type]) {\r
-                       delete element.events[type][handler.$$guid];\r
-               }\r
-       }\r
-};\r
-\r
-function handleEvent(event) {\r
-       var returnValue = true;\r
-       // grab the event object (IE uses a global event object)\r
-       event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);\r
-       // get a reference to the hash table of event handlers\r
-       var handlers = this.events[event.type];\r
-       // execute each event handler\r
-       for (var i in handlers) {\r
-               this.$$handleEvent = handlers[i];\r
-               if (this.$$handleEvent(event) === false) {\r
-                       returnValue = false;\r
-               }\r
-       }\r
-       return returnValue;\r
-};\r
-\r
-function fixEvent(event) {\r
-       // add W3C standard event methods\r
-       event.preventDefault = fixEvent.preventDefault;\r
-       event.stopPropagation = fixEvent.stopPropagation;\r
-       return event;\r
-};\r
-fixEvent.preventDefault = function() {\r
-       this.returnValue = false;\r
-};\r
-fixEvent.stopPropagation = function() {\r
-       this.cancelBubble = true;\r
-};\r
-\r
-// End Dean Edwards addEvent.\r
-\r
-// Tino Zijdel - crisp@xs4all.nl This little snippet fixes the problem that the onload attribute on \r
-// the body-element will overwrite previous attached events on the window object for the onload event.\r
-if (!window.addEventListener) {\r
-       document.onreadystatechange = function(){\r
-               if (window.onload && window.onload != handleEvent) {\r
-                       addEvent(window, 'load', window.onload);\r
-                       window.onload = handleEvent;\r
-               }\r
-       }\r
-}\r
-\r
-// Here are my functions for adding the DOMContentLoaded event to browsers other\r
-// than Mozilla.\r
-\r
-// Array of DOMContentLoaded event handlers.\r
-window.onDOMLoadEvents = new Array();\r
-window.DOMContentLoadedInitDone = false;\r
-\r
-// Function that adds DOMContentLoaded listeners to the array.\r
-function addDOMLoadEvent(listener) {\r
-       window.onDOMLoadEvents[window.onDOMLoadEvents.length]=listener;\r
-}\r
-\r
-// Function to process the DOMContentLoaded events array.\r
-function DOMContentLoadedInit() {\r
-       // quit if this function has already been called\r
-       if (window.DOMContentLoadedInitDone) return;\r
-\r
-       // flag this function so we don't do the same thing twice\r
-       window.DOMContentLoadedInitDone = true;\r
-\r
-       // iterates through array of registered functions \r
-       for (var i=0; i<window.onDOMLoadEvents.length; i++) {\r
-               var func = window.onDOMLoadEvents[i];\r
-               func();\r
-       }\r
-}\r
-\r
-function DOMContentLoadedScheduler() {\r
-       // quit if the init function has already been called\r
-       if (window.DOMContentLoadedInitDone) return true;\r
-       \r
-       // First, check for Safari or KHTML.\r
-       // Second, check for IE.\r
-       //if DOM methods are supported, and the body element exists\r
-       //(using a double-check including document.body, for the benefit of older moz builds [eg ns7.1] \r
-       //in which getElementsByTagName('body')[0] is undefined, unless this script is in the body section)\r
-       if(/KHTML|WebKit/i.test(navigator.userAgent)) {\r
-               if(/loaded|complete/.test(document.readyState)) {\r
-                       DOMContentLoadedInit();\r
-               } else {\r
-                       // Not ready yet, wait a little more.\r
-                       setTimeout("DOMContentLoadedScheduler()", 250);\r
-               }\r
-       } else if(document.getElementById("__ie_onload")) {\r
-               return true;\r
-       } else if(typeof document.getElementsByTagName != 'undefined' && (document.getElementsByTagName('body')[0] != null || document.body != null)) {\r
-               DOMContentLoadedInit();\r
-       } else {\r
-               // Not ready yet, wait a little more.\r
-               setTimeout("DOMContentLoadedScheduler()", 250);\r
-       }\r
-       \r
-       return true;\r
-}\r
-\r
-// Schedule to run the init function.\r
-setTimeout("DOMContentLoadedScheduler()", 250);\r
-\r
-// Just in case window.onload happens first, add it there too.\r
-addEvent(window, "load", DOMContentLoadedInit);\r
-\r
-// If addEventListener supports the DOMContentLoaded event.\r
-if(document.addEventListener)\r
-       document.addEventListener("DOMContentLoaded", DOMContentLoadedInit, false);\r
-\r
-/* for Internet Explorer */\r
-/*@cc_on @*/\r
-/*@if (@_win32)\r
-       document.write("<script id=__ie_onload defer src=\"//:\"><\/script>");\r
-       var script = document.getElementById("__ie_onload");\r
-       script.onreadystatechange = function() {\r
-               if (this.readyState == "complete") {\r
-                       DOMContentLoadedInit(); // call the onload handler\r
-               }\r
-       };\r
-/*@end @*/\r
+// written by Dean Edwards, 2005
+// with input from Tino Zijdel, Matthias Miller, Diego Perini
+// http://dean.edwards.name/weblog/2005/10/add-event/
+function addEvent(element, type, handler) {
+       // Modification by Tanny O'Haley, http://tanny.ica.com to add the
+       // DOMContentLoaded for all browsers.
+       if (type == "DOMContentLoaded" || type == "domload") {
+               addDOMLoadEvent(handler);
+               return;
+       }
+       
+       if (element.addEventListener) {
+               element.addEventListener(type, handler, false);
+       } else {
+               // assign each event handler a unique ID
+               if (!handler.$$guid) handler.$$guid = addEvent.guid++;
+               // create a hash table of event types for the element
+               if (!element.events) element.events = {};
+               // create a hash table of event handlers for each element/event pair
+               var handlers = element.events[type];
+               if (!handlers) {
+                       handlers = element.events[type] = {};
+                       // store the existing event handler (if there is one)
+                       if (element["on" + type]) {
+                               handlers[0] = element["on" + type];
+                       }
+               }
+               // store the event handler in the hash table
+               handlers[handler.$$guid] = handler;
+               // assign a global event handler to do all the work
+               element["on" + type] = handleEvent;
+       }
+};
+// a counter used to create unique IDs
+addEvent.guid = 1;
+
+function removeEvent(element, type, handler) {
+       if (element.removeEventListener) {
+               element.removeEventListener(type, handler, false);
+       } else {
+               // delete the event handler from the hash table
+               if (element.events && element.events[type]) {
+                       delete element.events[type][handler.$$guid];
+               }
+       }
+};
+
+function handleEvent(event) {
+       var returnValue = true;
+       // grab the event object (IE uses a global event object)
+       event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event);
+       // get a reference to the hash table of event handlers
+       var handlers = this.events[event.type];
+       // execute each event handler
+       for (var i in handlers) {
+               this.$$handleEvent = handlers[i];
+               if (this.$$handleEvent(event) === false) {
+                       returnValue = false;
+               }
+       }
+       return returnValue;
+};
+
+function fixEvent(event) {
+       // add W3C standard event methods
+       event.preventDefault = fixEvent.preventDefault;
+       event.stopPropagation = fixEvent.stopPropagation;
+       return event;
+};
+fixEvent.preventDefault = function() {
+       this.returnValue = false;
+};
+fixEvent.stopPropagation = function() {
+       this.cancelBubble = true;
+};
+
+// End Dean Edwards addEvent.
+
+// Tino Zijdel - crisp@xs4all.nl This little snippet fixes the problem that the onload attribute on 
+// the body-element will overwrite previous attached events on the window object for the onload event.
+if (!window.addEventListener) {
+       document.onreadystatechange = function(){
+               if (window.onload && window.onload != handleEvent) {
+                       addEvent(window, 'load', window.onload);
+                       window.onload = handleEvent;
+               }
+       }
+}
+
+// Here are my functions for adding the DOMContentLoaded event to browsers other
+// than Mozilla.
+
+// Array of DOMContentLoaded event handlers.
+window.onDOMLoadEvents = new Array();
+window.DOMContentLoadedInitDone = false;
+
+// Function that adds DOMContentLoaded listeners to the array.
+function addDOMLoadEvent(listener) {
+       window.onDOMLoadEvents[window.onDOMLoadEvents.length]=listener;
+}
+
+// Function to process the DOMContentLoaded events array.
+function DOMContentLoadedInit() {
+       // quit if this function has already been called
+       if (window.DOMContentLoadedInitDone) return;
+
+       // flag this function so we don't do the same thing twice
+       window.DOMContentLoadedInitDone = true;
+
+       // iterates through array of registered functions 
+       for (var i=0; i<window.onDOMLoadEvents.length; i++) {
+               var func = window.onDOMLoadEvents[i];
+               func();
+       }
+}
+
+function DOMContentLoadedScheduler() {
+       // quit if the init function has already been called
+       if (window.DOMContentLoadedInitDone) return true;
+       
+       // First, check for Safari or KHTML.
+       // Second, check for IE.
+       //if DOM methods are supported, and the body element exists
+       //(using a double-check including document.body, for the benefit of older moz builds [eg ns7.1] 
+       //in which getElementsByTagName('body')[0] is undefined, unless this script is in the body section)
+       if(/KHTML|WebKit/i.test(navigator.userAgent)) {
+               if(/loaded|complete/.test(document.readyState)) {
+                       DOMContentLoadedInit();
+               } else {
+                       // Not ready yet, wait a little more.
+                       setTimeout("DOMContentLoadedScheduler()", 250);
+               }
+       } else if(document.getElementById("__ie_onload")) {
+               return true;
+       } else if(typeof document.getElementsByTagName != 'undefined' && (document.getElementsByTagName('body')[0] != null || document.body != null)) {
+               DOMContentLoadedInit();
+       } else {
+               // Not ready yet, wait a little more.
+               setTimeout("DOMContentLoadedScheduler()", 250);
+       }
+       
+       return true;
+}
+
+// Schedule to run the init function.
+setTimeout("DOMContentLoadedScheduler()", 250);
+
+// Just in case window.onload happens first, add it there too.
+addEvent(window, "load", DOMContentLoadedInit);
+
+// If addEventListener supports the DOMContentLoaded event.
+if(document.addEventListener)
+       document.addEventListener("DOMContentLoaded", DOMContentLoadedInit, false);
+
+/* for Internet Explorer */
+/*@cc_on @*/
+/*@if (@_win32)
+       document.write("<script id=__ie_onload defer src=\"//:\"><\/script>");
+       var script = document.getElementById("__ie_onload");
+       script.onreadystatechange = function() {
+               if (this.readyState == "complete") {
+                       DOMContentLoadedInit(); // call the onload handler
+               }
+       };
+/*@end @*/
index 5ea9c2e1bf132fcb66ee14af1f9d1e65bd84428f..e1a0f2d368f3e64d43d54d11887cff9557f35e3e 100644 (file)
@@ -390,7 +390,8 @@ td.tbtv_actcell
 TD.headerCell,
 TD.tbtv_headercell,
 TD.tbtv_navcell
-{ background-color: #d4d0c8; 
+{ vertical-align: middle;
+  background-color: #d4d0c8; 
   border-top: 1px solid #fff;
   border-left: 1px solid #fff;
   border-right: 2px solid #222;
@@ -400,10 +401,12 @@ TD.tbtv_navcell
 
 TD.headerCell:active,
 TD.tbtv_headercell:active
-{ background-color: #DCDAD5;
-  border: 1px solid #9c9a94;
-  -moz-border-bottom-colors: #9c9a94;
-  -moz-border-right-colors: #9c9a94; }
+{ background-color: #dcdad5;
+  padding-top: 2px;
+  border-top: 1px solid #9c9a94;
+  border-left: 1px solid #9c9a94;
+  border-right: 2px solid #9c9a94;
+  border-bottom: 1px solid #9c9a94; }
 
 TD.headerCell SPAN,
 td.tbtv_headercell SPAN
@@ -425,6 +428,7 @@ td.tbtv_headercell a:hover
   /* background-color: #C4C0B8; */
 }
 
+IMG.sortImage,
 TD.headerCell IMG.tbtv_sortcell,
 td.tbtv_headercell img.tbtv_sortcell
 { float: right;
index 0ff9cfa81c5a7250105891b378b4873a5b463c08..a99e2cb3cb8358759e7a68a90abdffa0d9a965c1 100644 (file)
@@ -29,12 +29,17 @@ var queryParameters;
 
 var activeAjaxRequests = 0;
 var menus = new Array();
+var search = {};
+var sorting = {};
 
 var weekStartIsMonday = true;
 
 // logArea = null;
 var allDocumentElements = null;
 
+var userDefaults = null;
+var userSettings = null;
+
 /* a W3C compliant document.all */
 function getAllScopeElements(scope) {
   var elements = new Array();
@@ -99,6 +104,30 @@ function getElementsByClassName2(_tag, _class, _scope) {
   }
 }
 
+function createElement(tagName, id, classes, attributes, htmlAttributes,
+                      parentNode) {
+   var newElement = $(document.createElement(tagName));
+   if (id)
+      newElement.setAttribute("id", id);
+   if (classes) {
+      if (typeof(classes) == "string")
+        newElement.addClassName(classes);
+      else
+        for (var i = 0; i < classes.length; i++)
+           newElement.addClassName(classes[i]);
+   }
+   if (attributes)
+      for (var i in attributes)
+        newElement[i] = attributes[i];
+   if (htmlAttributes)
+      for (var i in htmlAttributes)
+        newElement.setAttribute(i, attributes[i]);
+   if (parentNode)
+      parentNode.appendChild(newElement);
+
+   return $(newElement);
+}
+
 function ml_stripActionInURL(url) {
   if (url[url.length - 1] != '/') {
     var i;
@@ -206,7 +235,7 @@ function createHTTPClient() {
   // http://developer.apple.com/internet/webcontent/xmlhttpreq.html
   if (typeof XMLHttpRequest != "undefined")
     return new XMLHttpRequest();
-  
+
   try { return new ActiveXObject("Msxml2.XMLHTTP"); } 
   catch (e) { }
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } 
@@ -730,11 +759,9 @@ function checkDropDown(event) {
 
 /* search field */
 function popupSearchMenu(event) {
-  var node = getTarget(event);
-
   var menuId = this.getAttribute("menuid");
-  relX = event.pageX - node.cascadeLeftOffset();
-  relY = event.pageY - node.cascadeTopOffset();
+  relX = event.pageX - $(this).cascadeLeftOffset();
+  relY = event.pageY - $(this).cascadeTopOffset();
 
   if (event.button == 0
       && relX < 24) {
@@ -744,9 +771,9 @@ function popupSearchMenu(event) {
     if (document.currentPopupMenu)
       hideMenu(event, document.currentPopupMenu);
 
-    var popup = document.getElementById(menuId);
-    popup.setStyle({ top: node.offsetHeight + "px",
-                    left: (node.offsetLeft + 3) + "px",
+    var popup = $(menuId);
+    popup.setStyle({ top: this.offsetHeight + "px",
+                    left: (this.offsetLeft + 3) + "px",
                            visibility: "visible" });
   
     document.currentPopupMenu = popup;
@@ -759,7 +786,7 @@ function setSearchCriteria(event) {
   searchCriteria = $("searchCriteria");
 
   searchValue.setAttribute("ghost-phrase", this.innerHTML);
-//   searchCriteria = this.getAttribute('id');
+  searchCriteria.value = this.getAttribute('id');
 }
 
 function checkSearchValue(event) {
@@ -775,6 +802,21 @@ function onSearchChange() {
   log ("onSearchChange()...");
 }
 
+function configureSearchField() {
+   var searchValue = $("searchValue");
+
+   Event.observe(searchValue, "mousedown",
+                onSearchMouseDown.bindAsEventListener(searchValue));
+   Event.observe(searchValue, "click",
+                popupSearchMenu.bindAsEventListener(searchValue));
+   Event.observe(searchValue, "blur",
+                onSearchBlur.bindAsEventListener(searchValue));
+   Event.observe(searchValue, "focus",
+                onSearchFocus.bindAsEventListener(searchValue));
+   Event.observe(searchValue, "keydown",
+                onSearchKeyDown.bindAsEventListener(searchValue));
+}
+
 function onSearchMouseDown(event) {
    var superNode = this.parentNode.parentNode.parentNode;
    relX = (event.pageX - superNode.offsetLeft - this.offsetLeft);
@@ -821,23 +863,27 @@ function onSearchKeyDown(event) {
   this.timer = setTimeout("onSearchFormSubmit()", 1000);
 }
 
+function onSearchFormSubmit(event) {
+   var searchValue = $("searchValue");
+   var searchCriteria = $("searchCriteria");
+
+   search["criteria"] = searchCriteria.value;
+   search["value"] = searchValue.value;
+
+   refreshCurrentFolder();
+}
+
 function initCriteria() {
   var searchCriteria = $("searchCriteria");
   var searchValue = $("searchValue");
-  var firstOption;
  
-  var searchOptions = $("searchOptions");
-  if (searchOptions) {
-    var firstOption;
-    $A(searchOptions.childNodes).each(function (item) {
-      if (item.tagName == 'LI') {
-       firstOption = item;
-      }
-    });
-    searchCriteria.value = firstOption.getAttribute('id');
-    searchValue.setAttribute('ghost-phrase', firstOption.innerHTML);
+  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 = firstOption.innerHTML;
+      searchValue.value = firstChild.innerHTML;
       searchValue.setAttribute("modified", "");
       searchValue.setStyle({ color: "#aaa" });
     }
@@ -946,7 +992,7 @@ function unsubscribeFromFolder(folder, refreshCallback, refreshCallbackData) {
 }
 
 function listRowMouseDownHandler(event) {
-  preventDefault(event);
+   preventDefault(event);
 }
 
 /* tabs */
@@ -1174,36 +1220,53 @@ function indexColor(number) {
   return color;
 }
 
+function loadPreferences() {
+   var url = UserFolderURL + "jsonDefaults";
+   var http = createHTTPClient();
+   http.open("GET", url, false);
+   http.send("");
+   if (http.status == 200)
+      userDefaults = http.responseText.evalJSON(true);
+
+   url = UserFolderURL + "jsonSettings";
+   http.open("GET", url, false);
+   http.send("");
+   if (http.status == 200)
+      userSettings = http.responseText.evalJSON(true);
+}
+
 function onLoadHandler(event) {
-    queryParameters = parseQueryParameters('' + window.location);
-    if (!$(document.body).hasClassName("popup")) {
-       initLogConsole();
-       initCriteria();
-    }
-    initMenus();
-    initTabs();
-    configureDragHandles();
-    configureSortableTableHeaders();
-    configureLinkBanner();
-    var progressImage = $("progressIndicator");
-    if (progressImage)
-       progressImage.parentNode.removeChild(progressImage);
-    Event.observe(document.body, "contextmenu", onBodyClickContextMenu);
+   loadPreferences();
+   queryParameters = parseQueryParameters('' + window.location);
+   if (!$(document.body).hasClassName("popup")) {
+      initLogConsole();
+      initCriteria();
+      configureSearchField();
+   }
+   initMenus();
+   initTabs();
+   configureDragHandles();
+   configureSortableTableHeaders();
+   configureLinkBanner();
+   var progressImage = $("progressIndicator");
+   if (progressImage)
+      progressImage.parentNode.removeChild(progressImage);
+   Event.observe(document.body, "contextmenu", onBodyClickContextMenu);
 }
 
 function onBodyClickContextMenu(event) {
-  preventDefault(event);
+   preventDefault(event);
 }
 
 function configureSortableTableHeaders() {
-  var headers = document.getElementsByClassName("sortableTableHeader");
-  for (var i = 0; i < headers.length; i++) {
-     var header = headers[i];
-     var anchor = $(header).childNodesWithTag("a")[0];
-     if (anchor)
-       Event.observe(anchor, "click",
-                     onHeaderClick.bindAsEventListener(anchor));
-  }
+   var headers = document.getElementsByClassName("sortableTableHeader");
+   for (var i = 0; i < headers.length; i++) {
+      var header = headers[i];
+      var anchor = $(header).childNodesWithTag("a")[0];
+      if (anchor)
+        Event.observe(anchor, "click",
+                      onHeaderClick.bindAsEventListener(anchor));
+   }
 }
 
 function onLinkBannerClick() {
@@ -1218,7 +1281,7 @@ function onPreferencesClick(event) {
    w.opener = window;
    w.focus();
 
-   event.preventDefault();
+   preventDefault(event);
 }
 
 function configureLinkBanner() {
@@ -1238,7 +1301,14 @@ function configureLinkBanner() {
 
 addEvent(window, 'load', onLoadHandler);
 
+function parent$(element) {
+   return this.opener.document.getElementById(element);
+}
+
 /* stubs */
+function refreshCurrentFolder() {
+}
+
 function configureDragHandles() {
 }
 
@@ -1248,7 +1318,3 @@ function getMenus() {
 function onHeaderClick(event) {
    window.alert("generic headerClick");
 }
-
-function parent$(element) {
-   return this.opener.document.getElementById(element);
-}