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