mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-09 02:15:08 +00:00
Monotone-Parent: 5a9d1a37ff5b7e57b7c92db2cc2c56d3af92d80c
Monotone-Revision: 1c7442ef9f84ce58c394c1539163f94d731b3545 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-07-08T11:32:43 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
(
|
||||
{ link = "delete";
|
||||
label="Delete";
|
||||
onclick = "return uixDeleteSelectedContacts(this);";
|
||||
onclick = "return onToolbarDeleteSelectedContacts(this);";
|
||||
image="tb-mail-delete-flat-24x24.png";
|
||||
tooltip = "Delete selected card or address book"; }
|
||||
)
|
||||
|
||||
@@ -99,8 +99,8 @@
|
||||
}
|
||||
|
||||
- (void) _fillResults: (NSMutableDictionary *) results
|
||||
inFolder: (id <SOGoContactFolder>) folder
|
||||
withSearchOn: (NSString *) contact
|
||||
inFolder: (id <SOGoContactFolder>) folder
|
||||
withSearchOn: (NSString *) contact
|
||||
{
|
||||
NSEnumerator *folderResults;
|
||||
NSDictionary *currentContact;
|
||||
@@ -188,40 +188,41 @@
|
||||
NSMutableArray *allContacts;
|
||||
unsigned int i;
|
||||
NSSortDescriptor *displayNameDescriptor;
|
||||
|
||||
|
||||
searchText = [self queryParameterForKey: @"search"];
|
||||
if ([searchText length] > 0)
|
||||
{
|
||||
folders = [[self clientObject] subFolders];
|
||||
allContacts = [NSMutableArray new];
|
||||
for (i = 0; i < [folders count]; i++) {
|
||||
folder = [folders objectAtIndex: i];
|
||||
//NSLog(@"Address book: %@ (%@)", [folder displayName], [folder class]);
|
||||
contacts = [folder lookupContactsWithFilter: searchText
|
||||
sortBy: @"displayName"
|
||||
ordering: NSOrderedAscending];
|
||||
if ([contacts count] > 0) {
|
||||
[allContacts addObjectsFromArray: contacts];
|
||||
for (i = 0; i < [folders count]; i++)
|
||||
{
|
||||
folder = [folders objectAtIndex: i];
|
||||
//NSLog(@"Address book: %@ (%@)", [folder displayName], [folder class]);
|
||||
contacts = [folder lookupContactsWithFilter: searchText
|
||||
sortBy: @"displayName"
|
||||
ordering: NSOrderedAscending];
|
||||
if ([contacts count] > 0)
|
||||
[allContacts addObjectsFromArray: contacts];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
result = [context response];
|
||||
if ([allContacts 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];
|
||||
|
||||
[(WOResponse*)result appendContentString: [sortedContacts jsonRepresentation]];
|
||||
}
|
||||
if ([allContacts 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];
|
||||
|
||||
[(WOResponse*)result appendContentString: [sortedContacts jsonRepresentation]];
|
||||
}
|
||||
else
|
||||
[(WOResponse*)result setStatus: 404];
|
||||
}
|
||||
else
|
||||
result = [NSException exceptionWithHTTPStatus: 400
|
||||
reason: @"missing 'search' parameter"];
|
||||
|
||||
reason: @"missing 'search' parameter"];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -240,7 +241,7 @@
|
||||
}
|
||||
else
|
||||
result = [NSException exceptionWithHTTPStatus: 400
|
||||
reason: @"missing 'search' parameter"];
|
||||
reason: @"missing 'search' parameter"];
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -256,9 +257,9 @@
|
||||
|
||||
securityManager = [SoSecurityManager sharedSecurityManager];
|
||||
|
||||
// return (([securityManager validatePermission: SoPerm_AccessContentsInformation
|
||||
// onObject: contactFolder
|
||||
// inContext: context] == nil)
|
||||
// return (([securityManager validatePermission: SoPerm_AccessContentsInformation
|
||||
// onObject: contactFolder
|
||||
// inContext: context] == nil)
|
||||
|
||||
folders = [NSMutableArray new];
|
||||
[folders autorelease];
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
else
|
||||
result = (([[card childrenWithTag: @"url"
|
||||
andAttribute: @"type"
|
||||
havingValue: @"work"] count] > 0)
|
||||
havingValue: @"work"] count] > 0)
|
||||
|| [[card childrenWithTag: @"org"] count] > 0);
|
||||
|
||||
return result;
|
||||
@@ -524,26 +524,24 @@
|
||||
- (id) deleteAction
|
||||
{
|
||||
NSException *ex;
|
||||
id url;
|
||||
|
||||
if (![self isDeletableClientObject])
|
||||
/* return 400 == Bad Request */
|
||||
return [NSException exceptionWithHTTPStatus:400
|
||||
reason:@"method cannot be invoked on "
|
||||
@"the specified object"];
|
||||
|
||||
return [NSException exceptionWithHTTPStatus: 400
|
||||
reason:@"method cannot be invoked on "
|
||||
@"the specified object"];
|
||||
|
||||
ex = [[self clientObject] delete];
|
||||
if (ex)
|
||||
{
|
||||
// TODO: improve error handling
|
||||
[self debugWithFormat:@"failed to delete: %@", ex];
|
||||
|
||||
// TODO: improve error handling
|
||||
[self debugWithFormat: @"failed to delete: %@", ex];
|
||||
|
||||
return ex;
|
||||
}
|
||||
|
||||
url = [[[self clientObject] container] baseURLInContext:[self context]];
|
||||
|
||||
return [self redirectToLocation:url];
|
||||
|
||||
return [self responseWithStatus: 200
|
||||
andString: [[self clientObject] nameInContainer]];
|
||||
}
|
||||
|
||||
@end /* UIxContactView */
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
SOGoContactLDAPFolder = {
|
||||
slots = {
|
||||
toolbar = {
|
||||
@@ -108,24 +108,24 @@
|
||||
};
|
||||
methods = {
|
||||
view = {
|
||||
protectedBy = "<public>";
|
||||
protectedBy = "<public>";
|
||||
pageName = "UIxContactsListView";
|
||||
};
|
||||
new = {
|
||||
protectedBy = "<public>";
|
||||
protectedBy = "<public>";
|
||||
pageName = "UIxContactEditor";
|
||||
actionName = "new";
|
||||
};
|
||||
mailer-contacts = {
|
||||
protectedBy = "<public>";
|
||||
protectedBy = "<public>";
|
||||
pageName = "UIxContactsListView";
|
||||
actionName = "mailerContacts";
|
||||
};
|
||||
canAccessContent = {
|
||||
protectedBy = "<public>";
|
||||
actionClass = "UIxFolderActions";
|
||||
actionName = "canAccessContent";
|
||||
};
|
||||
canAccessContent = {
|
||||
protectedBy = "<public>";
|
||||
actionClass = "UIxFolderActions";
|
||||
actionName = "canAccessContent";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user