From 9445b26164dff6a5071e2765434b9a74ced268b6 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Mon, 6 Aug 2007 17:58:13 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1133 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 10 + GNUmakefile | 2 +- SoObjects/Mailer/SOGoMailFolder.m | 10 - SoObjects/Mailer/SOGoMailFolderDataSource.h | 59 ----- SoObjects/Mailer/SOGoMailFolderDataSource.m | 227 ------------------ SoObjects/Mailer/SOGoMailObject.m | 2 +- UI/Common/common.h | 22 +- UI/Contacts/ContactsUIProduct.m | 5 - UI/Contacts/UIxContactFoldersView.m | 11 +- UI/Contacts/UIxContactView.m | 7 +- UI/Contacts/UIxContactsFilterPanel.m | 15 +- UI/Contacts/common.h | 36 --- UI/MainUI/SOGoGroupPage.m | 4 +- UI/MainUI/SOGoGroupsPage.m | 4 +- UI/MainUI/SOGoRootPage.m | 17 +- UI/MainUI/common.h | 36 --- UI/SOGoUI/common.h | 28 --- .../SchedulerUI/UIxAttendeesEditor.wox | 1 + UI/WebServerResources/HTMLElement.js | 31 ++- UI/WebServerResources/UIxAttendeesEditor.css | 3 +- UI/WebServerResources/UIxAttendeesEditor.js | 66 ++--- .../UIxContactsUserFolders.js | 2 +- 22 files changed, 119 insertions(+), 479 deletions(-) delete mode 100644 SoObjects/Mailer/SOGoMailFolderDataSource.h delete mode 100644 SoObjects/Mailer/SOGoMailFolderDataSource.m delete mode 100644 UI/Contacts/common.h delete mode 100644 UI/MainUI/common.h delete mode 100644 UI/SOGoUI/common.h diff --git a/ChangeLog b/ChangeLog index bad50c6c..0a756aff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-08-06 Wolfgang Sourdeau + + * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject + -bodyStructure]): fetch the "bodystructure" key instead of "body". + +2007-08-02 Francis Lachapelle + + * UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView _responseForResults:]): + has to return only one element. + 2007-08-01 Wolfgang Sourdeau * UI/MailPartViewers/UIxMailPartViewer.m ([UIxMailPartViewer diff --git a/GNUmakefile b/GNUmakefile index 75961d30..fa15ad0d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,6 +9,6 @@ SUBPROJECTS = \ SoObjects \ Main \ UI \ - Protocols \ +# Protocols \ include $(GNUSTEP_MAKEFILES)/aggregate.make diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 5198482c..7a265714 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -37,7 +37,6 @@ #import "SOGoMailObject.h" #import "SOGoMailAccount.h" #import "SOGoMailManager.h" -#import "SOGoMailFolderDataSource.h" #import "SOGoMailFolder.h" static NSString *defaultUserID = @"anyone"; @@ -174,15 +173,6 @@ static BOOL useAltNamespace = NO; return filenames; } -- (EODataSource *) contentDataSourceInContext: (id) _ctx -{ - SOGoMailFolderDataSource *ds; - - ds = [[SOGoMailFolderDataSource alloc] initWithImap4URL:[self imap4URL] - imap4Password:[self imap4Password]]; - return [ds autorelease]; -} - /* messages */ - (NSArray *) fetchUIDsMatchingQualifier: (id) _q diff --git a/SoObjects/Mailer/SOGoMailFolderDataSource.h b/SoObjects/Mailer/SOGoMailFolderDataSource.h deleted file mode 100644 index 8f6a8856..00000000 --- a/SoObjects/Mailer/SOGoMailFolderDataSource.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 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. -*/ - -#ifndef __Mailer_SOGoMailFolderDataSource_H__ -#define __Mailer_SOGoMailFolderDataSource_H__ - -#include - -/* - SOGoMailFolderDataSource - - This is used as the contentDataSource in the SOGoMailFolder, that is, as the - object to retrieve WebDAV listings of an IMAP4 folder. -*/ - -@class NSString, NSURL, NSArray; -@class EOFetchSpecification; - -@interface SOGoMailFolderDataSource : EODataSource -{ - EOFetchSpecification *fetchSpecification; - NSURL *imap4URL; - NSString *imap4Password; -} - -- (id)initWithImap4URL:(NSURL *)_imap4URL imap4Password:(NSString *)_pwd; - -/* accessors */ - -- (void)setFetchSpecification:(EOFetchSpecification *)_fetchSpec; -- (EOFetchSpecification *)fetchSpecification; - -- (NSURL *)imap4URL; - -/* operations */ - -- (NSArray *)fetchObjects; - -@end - -#endif /* SOGoMailFolderDataSource */ diff --git a/SoObjects/Mailer/SOGoMailFolderDataSource.m b/SoObjects/Mailer/SOGoMailFolderDataSource.m deleted file mode 100644 index 2dbc71ee..00000000 --- a/SoObjects/Mailer/SOGoMailFolderDataSource.m +++ /dev/null @@ -1,227 +0,0 @@ -/* - Copyright (C) 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. -*/ - -#import -#import -#import -#import - -#import -#import -#import -#import -#import -#import - -#import "SOGoMailManager.h" - -#import "SOGoMailFolderDataSource.h" - -@implementation SOGoMailFolderDataSource - -static BOOL debugOn = NO; - -- (id)initWithImap4URL:(NSURL *)_imap4URL imap4Password:(NSString *)_pwd { - if (_imap4URL == nil) { - [self release]; - return nil; - } - - if ((self = [super init])) { - self->imap4URL = [_imap4URL copy]; - self->imap4Password = [_pwd copy]; - } - return self; -} -- (id)init { - return [self initWithImap4URL:nil imap4Password:nil]; -} - -- (void)dealloc { - [self->imap4Password release]; - [self->imap4URL release]; - [self->fetchSpecification release]; - [super dealloc]; -} - -/* accessors */ - -- (void)setFetchSpecification:(EOFetchSpecification *)_fetchSpec { - if ([_fetchSpec isEqual:self->fetchSpecification]) return; - - ASSIGN(self->fetchSpecification, _fetchSpec); - [self postDataSourceChangedNotification]; -} -- (EOFetchSpecification *)fetchSpecification { - return self->fetchSpecification; -} - -- (NSURL *)imap4URL { - return self->imap4URL; -} - -- (NGImap4ConnectionManager *)mailManager { - static NGImap4ConnectionManager *mm = nil; - if (mm == nil) - mm = [[NGImap4ConnectionManager defaultConnectionManager] retain]; - return mm; -} - -/* fetches */ - -- (NSArray *)partsForWebDAVPropertyNames:(NSArray *)_names { - // TODO: implement - static NSArray *parts = nil; - - // [self logWithFormat:@"props: %@", _names]; - - if (parts == nil) { - parts = [[NSArray alloc] initWithObjects: - @"FLAGS", @"ENVELOPE", @"RFC822.SIZE", nil]; - } - return parts; -} - -- (void)addRecordsForFolderNames:(NSArray *)_n toArray:(NSMutableArray *)_r { - unsigned i, count; - - for (i = 0, count = [_n count]; i < count; i++) { - NSDictionary *rec; - NSString *keys[2], *values[2]; - - keys[0] = @"{DAV:}href"; values[0] = [_n objectAtIndex:i]; - keys[1] = @"davResourceType"; values[1] = @"collection"; - rec = [[NSDictionary alloc] initWithObjects:values forKeys:keys count:2]; - [_r addObject:rec]; - [rec release]; - } -} - -- (void)addRecordsForUIDs:(NSArray *)_uids toArray:(NSMutableArray *)_r { - NSAutoreleasePool *pool; - NSArray *partNames, *results; - unsigned i, count; - - if ([_uids count] == 0) - return; - - pool = [[NSAutoreleasePool alloc] init]; - - partNames = [self partsForWebDAVPropertyNames: - [[self fetchSpecification] selectedWebDAVPropertyNames]]; - - results = [[self mailManager] fetchUIDs:_uids inURL:self->imap4URL - parts:partNames password:self->imap4Password]; - results = [results valueForKey:@"fetch"]; - - for (i = 0, count = [results count]; i < count; i++) { - NGImap4Envelope *envelope; - NSDictionary *result; - NSDictionary *rec; - NSString *keys[6]; - id values[6]; - - result = [results objectAtIndex:i]; - envelope = [result valueForKey:@"envelope"]; - // NSLog(@"RES: %@", result); - - keys[0] = @"{DAV:}href"; - values[0] = [[[result objectForKey:@"uid"] stringValue] - stringByAppendingString:@".mail"]; - keys[1] = @"davResourceType"; - values[1] = @""; - keys[2] = @"davContentLength"; - values[2] = [result objectForKey:@"size"]; - keys[3] = @"davDisplayName"; - values[3] = [envelope subject]; - keys[4] = @"davLastModified"; - values[4] = [envelope date]; - - rec = [[NSDictionary alloc] initWithObjects:values forKeys:keys count:5]; - [_r addObject:rec]; - [rec release]; - } - - [pool release]; -} - -/* operations */ - -- (NSArray *)fetchObjects { - NSMutableArray *results; - EOQualifier *qualifier; - NSArray *sortOrderings; - NSArray *uids, *folderNames; - unsigned total; - - // TODO: support [fs davBulkTargetKeys] - if ([[self fetchSpecification] davBulkTargetKeys] != nil) { - [self logWithFormat:@"unsupported fetch specification"]; - return nil; - } - - /* fetch message uids */ - - // TODO: translate WebDAV qualifier and sort-ordering into IMAP4 one - uids = [[self mailManager] fetchUIDsInURL:self->imap4URL - qualifier:nil sortOrdering:@"DATE" - password:self->imap4Password]; - - /* fetch folders */ - - folderNames = [[self mailManager] subfoldersForURL:self->imap4URL - password:self->imap4Password]; - - /* builds results */ - - if ((total = ([uids count] + [folderNames count])) == 0) - return [NSArray array]; - - results = [NSMutableArray arrayWithCapacity:total]; - - [self addRecordsForFolderNames:folderNames toArray:results]; - [self addRecordsForUIDs:uids toArray:results]; - - /* filter and sort results */ - - if ((qualifier = [[self fetchSpecification] qualifier]) != nil) - results = (id)[results filteredArrayUsingQualifier:qualifier]; - - if ((sortOrderings = [[self fetchSpecification] sortOrderings]) != nil) { - if (qualifier != nil) - results = (id)[results sortedArrayUsingKeyOrderArray:sortOrderings]; - else - [results sortUsingKeyOrderArray:sortOrderings]; - } - - return results; -} - -/* logging */ - -- (NSString *)loggingPrefix { - return @"[mailfolder-ds]"; -} -- (BOOL)isDebuggingEnabled { - return debugOn; -} - -@end /* SOGoMailFolderDataSource */ diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 75306461..45e8bdcf 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -250,7 +250,7 @@ static BOOL debugSoParts = NO; - (id)bodyStructure { id body; - body = [[self fetchCoreInfos] valueForKey:@"body"]; + body = [[self fetchCoreInfos] valueForKey:@"bodystructure"]; if (debugBodyStructure) [self logWithFormat:@"BODY: %@", body]; return body; diff --git a/UI/Common/common.h b/UI/Common/common.h index 803270d7..9c254948 100644 --- a/UI/Common/common.h +++ b/UI/Common/common.h @@ -18,22 +18,14 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id: common.h,v 1.1 2003/11/24 01:24:40 helge Exp $ -#import - -#warning importing common.h is baaad - -#if LIB_FOUNDATION_LIBRARY -# include -#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY -# include -# include -#endif - -#include -#include -#include +#import +#import +#import +#import +#import +#import +#import @interface WOContext(WOExtensionsPrivate) - (void)addActiveFormElement:(WOElement *)_element; diff --git a/UI/Contacts/ContactsUIProduct.m b/UI/Contacts/ContactsUIProduct.m index 80138260..e57ee717 100644 --- a/UI/Contacts/ContactsUIProduct.m +++ b/UI/Contacts/ContactsUIProduct.m @@ -23,12 +23,7 @@ #import @interface ContactsUIProduct : NSObject -{ -} - @end -#include "common.h" - @implementation ContactsUIProduct @end /* ContactsUIProduct */ diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index a2af399e..385a4955 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -24,13 +24,16 @@ #import #import -#import +#import #import +#import +#import #import #import #import +#import #import #import #import @@ -38,8 +41,6 @@ #import #import -#import "common.h" - #import "UIxContactFoldersView.h" @implementation UIxContactFoldersView @@ -147,7 +148,7 @@ { contacts = [results objectEnumerator]; contact = [contacts nextObject]; - while (contact) + if (contact) { responseString = [NSString stringWithFormat: @"%@:%@:%@", [contact objectForKey: @"c_uid"], @@ -157,7 +158,7 @@ // [response setHeader: @"text/plain; charset=iso-8859-1" // forKey: @"Content-Type"]; [response appendContentString: responseString]; - contact = [contacts nextObject]; +// contact = [contacts nextObject]; } } else diff --git a/UI/Contacts/UIxContactView.m b/UI/Contacts/UIxContactView.m index b80dc597..01a07de9 100644 --- a/UI/Contacts/UIxContactView.m +++ b/UI/Contacts/UIxContactView.m @@ -18,16 +18,15 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ - -#import +#import +#import #import #import #import #import -#import "common.h" +#import #import "UIxContactView.h" diff --git a/UI/Contacts/UIxContactsFilterPanel.m b/UI/Contacts/UIxContactsFilterPanel.m index f08c6abc..c78796b8 100644 --- a/UI/Contacts/UIxContactsFilterPanel.m +++ b/UI/Contacts/UIxContactsFilterPanel.m @@ -19,7 +19,7 @@ 02111-1307, USA. */ -#include +#import @interface UIxContactsFilterPanel : UIxComponent { @@ -29,9 +29,6 @@ @end -#include -#include "common.h" - @implementation UIxContactsFilterPanel static NSArray *filters = nil; @@ -62,8 +59,8 @@ static NSArray *filters = nil; - (void) dealloc { - [self->searchCriteria release]; - [self->searchText release]; + [searchCriteria release]; + [searchText release]; [super dealloc]; } @@ -71,12 +68,12 @@ static NSArray *filters = nil; - (void) setSearchText: (NSString *)_txt { - ASSIGNCOPY(self->searchText, _txt); + ASSIGNCOPY(searchText, _txt); } - (void) setSearchCriteria: (NSString *)_txt { - ASSIGNCOPY(self->searchText, _txt); + ASSIGNCOPY(searchText, _txt); } - (NSString *) searchText @@ -107,7 +104,7 @@ static NSArray *filters = nil; - (NSString *) filterLabel { #if 1 - return [[[self context] page] labelForKey: [self valueForKey:@"filter"]]; + return [[[self context] page] labelForKey: @"filter"]; #else return [self valueForKey: @"filter"]; #endif diff --git a/UI/Contacts/common.h b/UI/Contacts/common.h deleted file mode 100644 index 6443479d..00000000 --- a/UI/Contacts/common.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2004 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. -*/ -// $Id$ - -#import - -#if LIB_FOUNDATION_LIBRARY -# include -#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY -# include -# include -#endif - -#include -#include -#include - -#warning importing common.h is baaad diff --git a/UI/MainUI/SOGoGroupPage.m b/UI/MainUI/SOGoGroupPage.m index f157417e..e59e1b77 100644 --- a/UI/MainUI/SOGoGroupPage.m +++ b/UI/MainUI/SOGoGroupPage.m @@ -19,13 +19,11 @@ 02111-1307, USA. */ -#include +#import @interface SOGoGroupPage : SoComponent @end -#include "common.h" - @implementation SOGoGroupPage @end /* SOGoGroupPage */ diff --git a/UI/MainUI/SOGoGroupsPage.m b/UI/MainUI/SOGoGroupsPage.m index fe6e10eb..87cf60de 100644 --- a/UI/MainUI/SOGoGroupsPage.m +++ b/UI/MainUI/SOGoGroupsPage.m @@ -20,7 +20,7 @@ */ // $Id: SOGoGroupsPage.m 106 2004-06-30 09:44:35Z helge $ -#include +#import @interface SOGoGroupsPage : SoComponent { @@ -28,8 +28,6 @@ @end -#include "common.h" - @implementation SOGoGroupsPage @end /* SOGoGroupsPage */ diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index a10a6f7d..912def21 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -19,7 +19,19 @@ 02111-1307, USA. */ -#include +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import @interface SOGoRootPage : SoComponent { @@ -28,9 +40,6 @@ @end -#include -#include "common.h" - @implementation SOGoRootPage static BOOL doNotRedirect = NO; diff --git a/UI/MainUI/common.h b/UI/MainUI/common.h deleted file mode 100644 index 24b5c03e..00000000 --- a/UI/MainUI/common.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2002-2004 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. -*/ -// $Id$ - -#import - -#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY -# include -# include -#endif - -#include -#include -#include - -#include - -#warning importing common.h is baaad diff --git a/UI/SOGoUI/common.h b/UI/SOGoUI/common.h deleted file mode 100644 index 56a455ce..00000000 --- a/UI/SOGoUI/common.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2004 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. -*/ - -#import -#include - -#include -#include - -#warning importing common.h is baaad diff --git a/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox b/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox index 1a37f96c..a2e393f3 100644 --- a/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox +++ b/UI/Templates/SchedulerUI/UIxAttendeesEditor.wox @@ -26,6 +26,7 @@ string="itemZoomText" selection="zoom"/> +
47) { running = true; requestField = this; @@ -41,8 +45,8 @@ function onContactKeydown(event) { setTimeout("triggerRequest()", delay); } else if (this.confirmedValue) { - if (event.keyCode == 13) { - this.setSelectionRange(this.value.length, this.value.length); + if (event.keyCode == 13) { // Enter + $(this).setCaretTo(this.value.length); } } } @@ -54,7 +58,8 @@ function triggerRequest() { document.contactLookupAjaxRequest.abort(); } var urlstr = ( UserFolderURL + "Contacts/contactSearch?search=" - + requestField.value ); + + escape(requestField.value) ); + //log (urlstr); document.contactLookupAjaxRequest = triggerAjaxRequest(urlstr, updateResults, requestField); @@ -81,7 +86,7 @@ function updateResults(http) { searchField.confirmedValue = completeEmail; if (searchField.focussed) { var end = searchField.value.length; - searchField.setSelectionRange(start, end); + $(searchField).selectText(start, end); } else searchField.value = text[1]; @@ -182,24 +187,25 @@ function redisplayFreeBusyZone() { } function newAttendee(event) { - var table = $("freeBusy"); - var tbody = table.tBodies[0]; - var model = tbody.rows[tbody.rows.length - 1]; - var newAttendeeRow = tbody.rows[tbody.rows.length - 2]; - var newRow = model.cloneNode(true); - newRow.setAttribute("class", ""); - tbody.insertBefore(newRow, newAttendeeRow); - //table.tBodies[0].appendChild(newRow); - var input = $(newRow.cells[0]).childNodesWithTag("input")[0]; - input.setAttribute("autocomplete", "off"); - input.serial = "pouet"; - Event.observe(input, "blur", checkAttendee.bindAsEventListener(input)); - Event.observe(input, "keydown", onContactKeydown.bindAsEventListener(input)); - input.focus(); - input.focussed = true; + var table = $("freeBusy"); + var tbody = table.tBodies[0]; + var model = tbody.rows[tbody.rows.length - 1]; + var newAttendeeRow = tbody.rows[tbody.rows.length - 2]; + var newRow = model.cloneNode(true); + tbody.insertBefore(newRow, newAttendeeRow); + + $(newRow).className = ""; + + var input = $(newRow.cells[0]).childNodesWithTag("input")[0]; + input.setAttribute("autocomplete", "off"); + Event.observe(input, "blur", checkAttendee.bindAsEventListener(input)); + Event.observe(input, "keydown", onContactKeydown.bindAsEventListener(input)); + + input.focussed = true; + input.activate(); } -function checkAttendee() { +function checkAttendee() { log ("checkAttendee (loosing focus)"); this.focussed = false; var th = this.parentNode.parentNode; var tbody = th.parentNode; @@ -221,7 +227,7 @@ function displayFreeBusyForNode(node) { var nodes = node.parentNode.parentNode.cells; if (node.uid) { for (var i = 1; i < nodes.length; i++) { - nodes[i].removeClassName("noFreeBusy"); + $(nodes[i]).removeClassName("noFreeBusy"); nodes[i].innerHTML = ('' + '' + '' @@ -242,7 +248,7 @@ function displayFreeBusyForNode(node) { node); } else { for (var i = 1; i < nodes.length; i++) { - nodes[i].addClassName("noFreeBusy"); + $(nodes[i]).addClassName("noFreeBusy"); nodes[i].innerHTML = ''; } } @@ -296,11 +302,11 @@ function resetAttendeesValue() { currentInput.setAttribute("uid", null); } currentInput.setAttribute("autocomplete", "off"); - Event.observe(currentInput, "keydown", onContactKeydown.bindAsEventListener(currentInput), false); - Event.observe(currentInput, "blur", checkAttendee.bindAsEventListener(currentInput), false); + //Event.observe(currentInput, "keydown", onContactKeydown.bindAsEventListener(currentInput)); + //Event.observe(currentInput, "blur", checkAttendee.bindAsEventListener(currentInput)); } inputs[inputs.length - 2].setAttribute("autocomplete", "off"); - Event.observe(inputs[inputs.length - 2], "click", newAttendee, false); + Event.observe(inputs[inputs.length - 2], "click", newAttendee); } function resetAllFreeBusys() { diff --git a/UI/WebServerResources/UIxContactsUserFolders.js b/UI/WebServerResources/UIxContactsUserFolders.js index c4c6b2a3..d87369e2 100644 --- a/UI/WebServerResources/UIxContactsUserFolders.js +++ b/UI/WebServerResources/UIxContactsUserFolders.js @@ -2,7 +2,7 @@ function onSearchFormSubmit() { var searchValue = $("searchValue"); var url = (ApplicationBaseURL - + "/foldersSearch?ldap-only=YES&search=" + searchValue.value + + "/foldersSearch?ldap-only=YES&search=" + escape(searchValue.value) + "&type=" + window.opener.userFolderType); if (document.userFoldersRequest) { document.userFoldersRequest.aborted = true; -- 2.39.5