From 8a69b86e126b34cc286778d97abb3de10e4b9908 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 9 Jul 2008 02:01:32 +0000 Subject: [PATCH] Monotone-Parent: 96be8fb544ada3cb6a58b0caa0bfb99522dac8db Monotone-Revision: bded46ecbec55dcfe4c434982eb0a1d07a5ce436 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-07-09T02:01:32 Monotone-Branch: ca.inverse.sogo --- SoObjects/SOGo/SOGoContentObject.h | 2 ++ SoObjects/SOGo/SOGoContentObject.m | 15 +++++++++ UI/Contacts/GNUmakefile | 1 + UI/Contacts/UIxContactFoldersView.m | 30 +++++++++++++----- UI/Contacts/product.plist | 20 ++++++++++++ .../UIxContactsListViewContainer.wox | 3 ++ UI/WebServerResources/UIxAttendeesEditor.js | 10 ++++-- UI/WebServerResources/UIxMailEditor.js | 3 +- UI/WebServerResources/addrbook.png | Bin 0 -> 647 bytes UI/WebServerResources/generic.css | 6 ++-- UI/WebServerResources/remote-addrbook.png | Bin 0 -> 902 bytes 11 files changed, 76 insertions(+), 14 deletions(-) create mode 100644 UI/WebServerResources/addrbook.png create mode 100644 UI/WebServerResources/remote-addrbook.png 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 0000000000000000000000000000000000000000..ece8fb0042dbe49aba0b681701f57fe64004d6ff GIT binary patch literal 647 zcmV;20(kw2P)}_u%rSwt|dXUna z=)t>xK@ZZ;nD~JZTO$R@#~QMknceX>YtouFsrcK=?EZf5&3kWl7@D=QJRb_hbzO3( zh@o3)t$lDle|zEint8WdjWE<~ax%>i4}YSeEjXiT*n=ZrjJFY}AQ&ue?k>@?ogj)L zBvUC&Pn}1l9-#Q8fZC@YICteH(pP7|ogP%mWgKk2Gdc!ZxFZ6kBKXxBq}E7|4&l<= zb<`#B?fnk2Z$D#f<}Q?!r!4Vf3lT!4poBzF_R%O5;nr)&%w9w3YYsw)Smnt&&VZUq zC|I@xw=A%xtwho#;t-nFnx5_iq(C(U1x%s{Z2$(CAX}yvku~~wHh~C4^QZ`*qSy}n zCV`RvPXbDx(1=VPG6c6Rgw_8dXwZ!Q6DB2YQ5N++H_k`L7S71P?Aq(N5M~p_;<(JF zQs_1X^dnJ+RXdylNoO|3hKKQsj!Y6DvN%G^JtC;&w{#`DQzj)(PZLOa>*K-x%8>6* zXD(*qKd)*su@f;tE|=5W+xZ30TYUDn1*^4qv$0pW+&8kC9B@ke#qT$4$92cYCt&yV zBA?Id4}SQ>^Sq^#8FajM>yPiGLuN1b_owb(n3!U_dt2hci&t)^+3xq2>gA(*vzlX> h#!3%YU(a=#`3*K;JXyfn3LF3c002ovPDHLkV1lB)AsGMw literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..56750b7225a8bbae48f9fc025283cf632073e7fb GIT binary patch literal 902 zcmV;119|+3P)&Wxgdm4en`G?;lLljjYu50 z@;4wgfKzco2vi|ODp66PbqZ8XQv#`)&^rFH>;2{N?(7f7Mn%n;C(URyGw<`}ecu}i zPuTj_7Cl9#)^e45H7_VE934MZ;*6V85Zow|WaD%+_tnaZ6g}x9Jzji%_10{MD0Mfh z&&fF#Z%%)MJI&{?d;dI~wgcaCP(ZjdrAn(G)n5DK1Yqc#KhxOG7kyo&8Z7=gX4LE8 ziH+^USMlIbM(2pZ?e>rj{nkurZ1Lmw|AnO1*SBZ~t-4Zb={Xu;QtsoG{0^$LfFhN# zIDHk*pZ*!?tPCorVR(GvplQ^XH#f-;Kuhz*wf(j_XWc79s}%88r4MA9kVydq2KLM< zxYR_7GDxYE7!n?K-HR78+N$vXfkd$q} zo?jTHFz|y?N;SbO3UMFzqZrMx3?zwQ(C@=DJh)=`9s?ivh$%;yNL-G zuj?u~2YrIzVE;YXLcn2pxF2F*Gca2K+&oGtei$fbl)BUI!lA zh0`%d&C@q+q5NHFnKI6nX8~iTVf>bC{?~~ge){cfEC1b(z4Yygz%7F0x}x48;?8-f z%{Nd`WmGE)DlgszaZVloel5Rv>9cqCPyB@sKDlx((i-)+@YlsKVMxT@m_3h5d;wY^ zi_*A?M~2b3bDOO`c0K_Z+Vb)y(O$w@ezI4~sL4V$E^7*}8azyH930vk=AKu-e0k-> cZ~Wi(52zb*xRO~ZD*ylh07*qoM6N<$f*|IfF8}}l literal 0 HcmV?d00001