mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-11 00:08:51 +00:00
Monotone-Parent: 96be8fb544ada3cb6a58b0caa0bfb99522dac8db
Monotone-Revision: bded46ecbec55dcfe4c434982eb0a1d07a5ce436 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-07-09T02:01:32 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -58,6 +58,8 @@
|
||||
baseVersion: (unsigned int) _baseVersion;
|
||||
- (NSException *) saveContentString: (NSString *)_str;
|
||||
- (NSException *) delete;
|
||||
- (NSException *) copyTo: (SOGoGCSFolder *) destinationFolder;
|
||||
- (NSException *) moveTo: (SOGoGCSFolder *) destinationFolder;
|
||||
|
||||
/* etag support */
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -22,6 +22,7 @@ ContactsUI_OBJC_FILES = \
|
||||
UIxContactsListView.m \
|
||||
UIxContactsListViewContainer.m \
|
||||
UIxContactFoldersView.m \
|
||||
UIxContactFolderActions.m \
|
||||
|
||||
ContactsUI_RESOURCE_FILES += \
|
||||
Version \
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSString.h>
|
||||
@@ -184,35 +185,48 @@ withSearchOn: (NSString *) contact
|
||||
id <WOActionResults> result;
|
||||
id <SOGoContactFolder> 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]];
|
||||
}
|
||||
|
||||
@@ -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 = "<public>";
|
||||
actionClass = "UIxContactFolderActions";
|
||||
actionName = "copy";
|
||||
};
|
||||
move = {
|
||||
protectedBy = "<public>";
|
||||
actionClass = "UIxContactFolderActions";
|
||||
actionName = "move";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
<li><var:string label:value="Instant Message" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Delete" /></li>
|
||||
<li><!-- separator --></li>
|
||||
<li><var:string label:value="Move To" /></li>
|
||||
<li><var:string label:value="Copy To" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
BIN
UI/WebServerResources/addrbook.png
Normal file
BIN
UI/WebServerResources/addrbook.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 647 B |
@@ -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; }
|
||||
|
||||
BIN
UI/WebServerResources/remote-addrbook.png
Normal file
BIN
UI/WebServerResources/remote-addrbook.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 902 B |
Reference in New Issue
Block a user