diff --git a/SoObjects/SOGo/SOGoContentObject.h b/SoObjects/SOGo/SOGoContentObject.h index 0961ae2a4..9c7df530c 100644 --- a/SoObjects/SOGo/SOGoContentObject.h +++ b/SoObjects/SOGo/SOGoContentObject.h @@ -58,6 +58,8 @@ baseVersion: (unsigned int) _baseVersion; - (NSException *) saveContentString: (NSString *)_str; - (NSException *) delete; +- (NSException *) copyTo: (SOGoGCSFolder *) destinationFolder; +- (NSException *) moveTo: (SOGoGCSFolder *) destinationFolder; /* etag support */ diff --git a/SoObjects/SOGo/SOGoContentObject.m b/SoObjects/SOGo/SOGoContentObject.m index e3e36605c..111ad42b8 100644 --- a/SoObjects/SOGo/SOGoContentObject.m +++ b/SoObjects/SOGo/SOGoContentObject.m @@ -213,6 +213,21 @@ return nil; } +- (NSException *) copyTo: (SOGoGCSFolder *) destinationFolder +{ + SOGoContentObject *newObject; + + newObject = [SOGoContentObject objectWithName: [SOGoObject globallyUniqueObjectId] + inContainer: destinationFolder]; + + return [newObject saveContentString: content]; +} + +- (NSException *) moveTo: (SOGoGCSFolder *) destinationFolder +{ + return nil; +} + /* actions */ // - (id) lookupName: diff --git a/UI/Contacts/GNUmakefile b/UI/Contacts/GNUmakefile index 462aa340e..fee01c1cc 100644 --- a/UI/Contacts/GNUmakefile +++ b/UI/Contacts/GNUmakefile @@ -22,6 +22,7 @@ ContactsUI_OBJC_FILES = \ UIxContactsListView.m \ UIxContactsListViewContainer.m \ UIxContactFoldersView.m \ + UIxContactFolderActions.m \ ContactsUI_RESOURCE_FILES += \ Version \ diff --git a/UI/Contacts/UIxContactFoldersView.m b/UI/Contacts/UIxContactFoldersView.m index 92b60fbc0..6f4165969 100644 --- a/UI/Contacts/UIxContactFoldersView.m +++ b/UI/Contacts/UIxContactFoldersView.m @@ -20,6 +20,7 @@ * Boston, MA 02111-1307, USA. */ +#import #import #import #import @@ -184,35 +185,48 @@ withSearchOn: (NSString *) contact id result; id folder; NSString *searchText; + NSDictionary *contact; NSArray *folders, *contacts, *descriptors, *sortedContacts; - NSMutableArray *allContacts; - unsigned int i; + NSMutableDictionary *uniqueContacts; +// NSMutableArray *allContacts; + unsigned int i, j; NSSortDescriptor *displayNameDescriptor; searchText = [self queryParameterForKey: @"search"]; if ([searchText length] > 0) { + NSLog(@"Search all contacts: %@", searchText); folders = [[self clientObject] subFolders]; - allContacts = [NSMutableArray new]; + //allContacts = [NSMutableArray new]; + uniqueContacts = [NSMutableDictionary dictionary]; for (i = 0; i < [folders count]; i++) { folder = [folders objectAtIndex: i]; - //NSLog(@"Address book: %@ (%@)", [folder displayName], [folder class]); + NSLog(@" Address book: %@ (%@)", [folder displayName], [folder class]); contacts = [folder lookupContactsWithFilter: searchText sortBy: @"displayName" ordering: NSOrderedAscending]; - if ([contacts count] > 0) - [allContacts addObjectsFromArray: contacts]; + for (j = 0; j < [contacts count]; j++) + { + contact = [contacts objectAtIndex: j]; + NSLog(@" found %@ (%@)", [contact objectForKey: @"displayName"], [contact objectForKey: @"mail"]); + if ([uniqueContacts objectForKey: [contact objectForKey: @"displayName"]] == nil) + [uniqueContacts setObject: contact forKey: [contact objectForKey: @"displayName"]]; + } +// if ([contacts count] > 0) +// [allContacts addObjectsFromArray: contacts]; } result = [context response]; - if ([allContacts count] > 0) +// if ([allContacts count] > 0) + if ([uniqueContacts count] > 0) { // Sort the contacts by display name displayNameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"displayName" ascending:YES] autorelease]; descriptors = [NSArray arrayWithObjects: displayNameDescriptor, nil]; - sortedContacts = [allContacts sortedArrayUsingDescriptors:descriptors]; +// sortedContacts = [allContacts sortedArrayUsingDescriptors:descriptors]; + sortedContacts = [[uniqueContacts allValues] sortedArrayUsingDescriptors: descriptors]; [(WOResponse*)result appendContentString: [sortedContacts jsonRepresentation]]; } diff --git a/UI/Contacts/product.plist b/UI/Contacts/product.plist index af5fa3799..5c04b6ff3 100644 --- a/UI/Contacts/product.plist +++ b/UI/Contacts/product.plist @@ -96,6 +96,16 @@ pageName = "UIxContactsUserRightsEditor"; actionName = "saveUserRights"; }; + copy = { + protectedBy = "View"; + actionClass = "UIxContactFolderActions"; + actionName = "copy"; + }; + move = { + protectedBy = "View"; + actionClass = "UIxContactFolderActions"; + actionName = "move"; + }; }; }; @@ -126,6 +136,16 @@ actionClass = "UIxFolderActions"; actionName = "canAccessContent"; }; + copy = { + protectedBy = ""; + actionClass = "UIxContactFolderActions"; + actionName = "copy"; + }; + move = { + protectedBy = ""; + actionClass = "UIxContactFolderActions"; + actionName = "move"; + }; }; }; diff --git a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox index 702718965..5152de083 100644 --- a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox +++ b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox @@ -48,6 +48,9 @@
  • +
  • +
  • +
  • diff --git a/UI/WebServerResources/UIxAttendeesEditor.js b/UI/WebServerResources/UIxAttendeesEditor.js index 97ca9163f..8817ffdda 100644 --- a/UI/WebServerResources/UIxAttendeesEditor.js +++ b/UI/WebServerResources/UIxAttendeesEditor.js @@ -143,9 +143,13 @@ function performSearchCallback(http) { var offset = Element.cumulativeOffset(attendeesEditor.currentField); var top = offset[1] - offsetScroll[1] + node.offsetHeight + 3; var height = 'auto'; - if (data.length > 5) { - height = 5 * node.getHeight() + 'px'; - } + var heightDiff = window.height() - offset[1]; + var nodeHeight = node.getHeight(); + + if ((data.length * nodeHeight) > heightDiff) + // Limit the size of the popup to the window height, minus 12 pixels + height = parseInt(heightDiff/nodeHeight) * nodeHeight - 12 + 'px'; + menu.setStyle({ top: top + "px", left: offset[0] + "px", height: height, diff --git a/UI/WebServerResources/UIxMailEditor.js b/UI/WebServerResources/UIxMailEditor.js index 8458000a9..b63ca9f2e 100644 --- a/UI/WebServerResources/UIxMailEditor.js +++ b/UI/WebServerResources/UIxMailEditor.js @@ -359,7 +359,8 @@ function performSearch() { } if (MailEditor.currentField.value.trim().length > 0) { var urlstr = ( UserFolderURL + "Contacts/allContactSearch?search=" - + escape(MailEditor.currentField.value) ); + + MailEditor.currentField.value ); log (urlstr); +// + escape(MailEditor.currentField.value) ); log (urlstr); document.contactLookupAjaxRequest = triggerAjaxRequest(urlstr, performSearchCallback, MailEditor.currentField); } diff --git a/UI/WebServerResources/addrbook.png b/UI/WebServerResources/addrbook.png new file mode 100644 index 000000000..ece8fb004 Binary files /dev/null and b/UI/WebServerResources/addrbook.png differ diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index 2ac514a49..9e326ac5c 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -294,7 +294,7 @@ SPAN.toolbarButton:active .toolbarButton .buttonLabel { margin: auto; } -/* popups */ +/* contextual menus & popups */ .menu, .popupMenu @@ -309,7 +309,9 @@ SPAN.toolbarButton:active border-top: 1px solid #d6cfc6; border-left: 1px solid #d6cfc6; border-right: 1px solid #424142; - border-bottom: 1px solid #424142; } + border-bottom: 1px solid #424142; + overflow: auto; + overflow-x: hidden; } .popupMenu { background-color: #fff; } diff --git a/UI/WebServerResources/remote-addrbook.png b/UI/WebServerResources/remote-addrbook.png new file mode 100644 index 000000000..56750b722 Binary files /dev/null and b/UI/WebServerResources/remote-addrbook.png differ