merge of 'be11ede9b39c76d3a71c05143a448ab27a83a818'

and 'f0542255e31c3d8ac8c2d9b48083294de7e0308c'

Monotone-Parent: be11ede9b39c76d3a71c05143a448ab27a83a818
Monotone-Parent: f0542255e31c3d8ac8c2d9b48083294de7e0308c
Monotone-Revision: 4716c9e3a88b72ca631ad4d08c69388764bf28d5

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-02-07T00:20:02
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2009-02-07 00:20:02 +00:00
commit 9d9e5c0e55
16 changed files with 131 additions and 83 deletions

View File

@ -4,6 +4,52 @@
add CardDAV stuff. Currently only implements the
addressbook-home-set report from the principal URL.
2009-02-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentFolder.m
([SOGoAppointmentFolder
-fetchFields:_fieldsfrom:_startDateto:_endDatetitle:titlecomponent:_componentadditionalFilters:filtersincludeProtectedInformation:_includeProtectedInformation]):
added the "c_cycleinfo" and "c_cycleenddate" fields to the list of
fields that should not be stripped when removing protected informations.
* UI/Scheduler/UIxTaskEditor.m ([UIxTaskEditor -dealloc])
([UIxTaskEditor -todo]): same as below (apts).
* UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor
-event]): retain the event parent calendar object instead of the
event itself.
([UIxAppointmentEditor -dealloc]): release the above calendar.
* UI/MailPartViewers/UIxMailPartICalViewer.m
([UIxMailPartICalViewer -dealloc]): no longer release "inEvent"
since it does not need to be retained.
* Main/SOGo.m ([SOGo +initialize]): added handling of the
"SOGoDebugLeaks" configuration variable.
([SOGo -dispatchRequest:_request]): log the classes of instances
that were leaked between the handling of the request, if
SOGoDebugLeaks is set.
* SoObjects/SOGo/SOGoGCSFolder.m ([SOGoGCSFolder
-aclsForUser:uidforObjectAtPath:objectPathArray]): cache an empty
array if not acl have been returned for the specified user.
* SoObjects/Contacts/SOGoContactGCSFolder.m ([SOGoContactGCSFolder
-lookupContactsWithFilter:filtersortBy:sortKeyordering:sortOrdering]):
same as below.
([SOGoContactGCSFolder -fixupContactRecord:contactRecord]): new
method that initializes c_mail, c_screenname, c_o,
c_telephonenumber to empty strings if not found.
* SoObjects/Contacts/SOGoContactLDAPFolder.m
([SOGoContactLDAPFolder
-lookupContactsWithFilter:filtersortBy:sortKeyordering:sortOrdering]):
no longer make use of the displayName, mail, screenName, phone and
org intermediary keys.
* UI/Contacts/UIxContactsListView.m ([-currentCName]): removed
useless method.
2009-02-05 Francis Lachapelle <flachapelle@inverse.ca>
* UI/SOGoUI/UIxComponent.m ([UIxComponent -responseWithStatus:):

View File

@ -19,6 +19,7 @@
02111-1307, USA.
*/
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSDebug.h>
#import <Foundation/NSData.h>
#import <Foundation/NSDate.h>
@ -64,6 +65,7 @@ static unsigned int vMemSizeLimit = 0;
static BOOL doCrashOnSessionCreate = NO;
static BOOL hasCheckedTables = NO;
static BOOL debugRequests = NO;
static BOOL debugLeaks = NO;
#ifdef GNUSTEP_BASE_LIBRARY
static BOOL debugObjectAllocation = NO;
@ -91,6 +93,7 @@ static BOOL debugObjectAllocation = NO;
}
#endif
debugRequests = [ud boolForKey: @"SOGoDebugRequests"];
debugLeaks = [ud boolForKey: @"SOGoDebugLeaks"];
/* vMem size check - default is 200MB */
tmp = [ud objectForKey: @"SxVMemLimit"];
@ -394,6 +397,7 @@ static BOOL debugObjectAllocation = NO;
static NSArray *runLoopModes = nil;
WOResponse *resp;
NSDate *startDate, *endDate;
NSAutoreleasePool *pool;
if (debugRequests)
{
@ -403,6 +407,13 @@ static BOOL debugObjectAllocation = NO;
}
cache = [SOGoCache sharedCache];
if (debugLeaks)
{
GSDebugAllocationActive (YES);
GSDebugAllocationList (NO);
pool = [NSAutoreleasePool new];
}
resp = [super dispatchRequest: _request];
[SOGoCache killCache];
@ -413,6 +424,15 @@ static BOOL debugObjectAllocation = NO;
[endDate timeIntervalSinceDate: startDate]];
}
if (debugLeaks)
{
[resp retain];
[pool release];
[resp autorelease];
NSLog (@"allocated classes:\n%s", GSDebugAllocationList (YES));
GSDebugAllocationActive (NO);
}
if (![self isTerminating])
{
if (!runLoopModes)

View File

@ -105,7 +105,6 @@
- (void) dealloc
{
[parent release];
[tag release];
[group release];
[attributes release];
@ -115,8 +114,7 @@
- (void) setParent: (CardGroup *) aParent
{
#warning THIS CAUSES A LEAK. We need this for the moment because of a design error.
ASSIGN (parent, aParent);
parent = aParent;
}
- (id) parent

View File

@ -1,4 +1,4 @@
2008-12-15 Wolfgang Sourdeau <wsourdeau@inverse.ca>
2009-02-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* CardElement.m ([CardElement -setParent:aParent]): no longer
retain the parent passed as parameter.

View File

@ -880,6 +880,8 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
@"c_uid", @"c_startdate",
@"c_enddate", @"c_isallday",
@"c_iscycle", @"c_isopaque",
@"c_cycleinfo",
@"c_cycleenddate",
@"c_classification",
@"c_component", nil]];
}

View File

@ -32,6 +32,8 @@
@interface SOGoContactGCSFolder : SOGoGCSFolder <SOGoContactFolder>
- (void) fixupContactRecord: (NSMutableDictionary *) contactRecord;
@end
#endif /* __Contacts_SOGoContactGCSFolder_H__ */

View File

@ -232,13 +232,33 @@
return qualifier;
}
- (void) fixupContactRecord: (NSMutableDictionary *) contactRecord
{
NSString *data;
data = [contactRecord objectForKey: @"c_cn"];
if (![data length])
{
data = [contactRecord keysWithFormat: @"%{c_givenname} %{c_sn}"];
[contactRecord setObject: data forKey: @"c_cn"];
}
if (![contactRecord objectForKey: @"c_mail"])
[contactRecord setObject: @"" forKey: @"c_mail"];
if (![contactRecord objectForKey: @"c_screenname"])
[contactRecord setObject: @"" forKey: @"c_screenname"];
if (![contactRecord objectForKey: @"c_o"])
[contactRecord setObject: @"" forKey: @"c_o"];
if (![contactRecord objectForKey: @"c_telephonenumber"])
[contactRecord setObject: @"" forKey: @"c_telephonenumber"];
}
- (NSArray *) _flattenedRecords: (NSArray *) records
{
NSMutableArray *newRecords;
NSEnumerator *oldRecords;
NSDictionary *oldRecord;
NSMutableDictionary *newRecord;
NSString *data;
newRecords = [NSMutableArray arrayWithCapacity: [records count]];
@ -246,40 +266,8 @@
oldRecord = [oldRecords nextObject];
while (oldRecord)
{
newRecord = [NSMutableDictionary new];
[newRecord autorelease];
[newRecord setObject: [oldRecord objectForKey: @"c_name"]
forKey: @"c_uid"];
[newRecord setObject: [oldRecord objectForKey: @"c_name"]
forKey: @"c_name"];
data = [oldRecord objectForKey: @"c_cn"];
if (![data length])
data = [oldRecord keysWithFormat: @"%{c_givenname} %{c_sn}"];
[newRecord setObject: data
forKey: @"displayName"];
data = [oldRecord objectForKey: @"c_mail"];
if (!data)
data = @"";
[newRecord setObject: data forKey: @"mail"];
data = [oldRecord objectForKey: @"c_screenname"];
if (!data)
data = @"";
[newRecord setObject: data forKey: @"screenName"];
data = [oldRecord objectForKey: @"c_o"];
if (!data)
data = @"";
[newRecord setObject: data forKey: @"org"];
data = [oldRecord objectForKey: @"c_telephonenumber"];
if (![data length])
data = @"";
[newRecord setObject: data forKey: @"phone"];
newRecord = [NSMutableDictionary dictionaryWithDictionary: oldRecord];
[self fixupContactRecord: newRecord];
[newRecords addObject: newRecord];
oldRecord = [oldRecords nextObject];
}

View File

@ -167,11 +167,12 @@
if (!obj)
{
ldifEntry = [ldapSource lookupContactEntryWithUIDorEmail: objectName];
obj = ((ldifEntry)
? [SOGoContactLDIFEntry contactEntryWithName: objectName
withLDIFEntry: ldifEntry
inContainer: self]
: [NSException exceptionWithHTTPStatus: 404]);
if (ldifEntry)
obj = [SOGoContactLDIFEntry contactEntryWithName: objectName
withLDIFEntry: ldifEntry
inContainer: self];
else
obj = [NSException exceptionWithHTTPStatus: 404];
}
return obj;
@ -212,24 +213,24 @@
data = [oldRecord objectForKey: @"c_cn"];
if (!data)
data = @"";
[newRecord setObject: data forKey: @"displayName"];
[newRecord setObject: data forKey: @"c_cn"];
data = [oldRecord objectForKey: @"mail"];
if (!data)
data = @"";
[newRecord setObject: data forKey: @"mail"];
[newRecord setObject: data forKey: @"c_mail"];
data = [oldRecord objectForKey: @"nsAIMid"];
if (![data length])
data = [oldRecord objectForKey: @"nscpaimscreenname"];
if (![data length])
data = @"";
[newRecord setObject: data forKey: @"screenName"];
[newRecord setObject: data forKey: @"c_screenname"];
data = [oldRecord objectForKey: @"o"];
if (!data)
data = @"";
[newRecord setObject: data forKey: @"org"];
[newRecord setObject: data forKey: @"c_o"];
data = [oldRecord objectForKey: @"telephoneNumber"];
if (![data length])
@ -238,7 +239,7 @@
data = [oldRecord objectForKey: @"homePhone"];
if (![data length])
data = @"";
[newRecord setObject: data forKey: @"phone"];
[newRecord setObject: data forKey: @"c_telephonenumber"];
contactInfo = [ud stringForKey: @"SOGoLDAPContactInfoAttribute"];
if ([contactInfo length] > 0) {

View File

@ -817,6 +817,8 @@ static NSArray *childRecordFields = nil;
if (!acls)
{
acls = [self _fetchAclsForUser: uid forObjectAtPath: objectPath];
if (!acls)
acls = [NSArray array];
[self _cacheRoles: acls forUser: uid forObjectAtPath: objectPath];
}

View File

@ -60,15 +60,6 @@
return currentContact;
}
- (NSString *) currentCName
{
NSString *cName;
cName = [currentContact objectForKey: @"c_name"];
return [cName stringByEscapingURL];
}
- (id <WOActionResults>) mailerContactsAction
{
selectorComponentClass = @"UIxContactsMailerSelection";

View File

@ -57,7 +57,6 @@
[attendee release];
[item release];
[inCalendar release];
[inEvent release];
[dateFormatter release];
[super dealloc];
}
@ -67,7 +66,7 @@
- (void) resetPathCaches
{
[super resetPathCaches];
[inEvent release]; inEvent = nil;
inEvent = nil;
[inCalendar release]; inCalendar = nil;
[storedEventObject release]; storedEventObject = nil;
[storedEvent release]; storedEvent = nil;
@ -104,7 +103,7 @@
{
events = [[self inCalendar] events];
if ([events count] > 0)
inEvent = [[events objectAtIndex: 0] retain];
inEvent = [events objectAtIndex: 0];
}
return inEvent;

View File

@ -74,7 +74,7 @@
- (void) dealloc
{
[item release];
[event release];
[[event parent] release];
[aptStartDate release];
[aptEndDate release];
[componentCalendar release];
@ -87,7 +87,7 @@
if (!event)
{
event = (iCalEvent *) [[self clientObject] occurence];
[event retain];
[[event parent] retain];
}
return event;

View File

@ -67,7 +67,7 @@
[statusDate release];
[status release];
[statusPercent release];
[todo release];
[[todo parent] release];
[super dealloc];
}
@ -77,7 +77,7 @@
if (!todo)
{
todo = (iCalToDo *) [[self clientObject] component: YES secure: YES];
[todo retain];
[[todo parent] retain];
}
return todo;

View File

@ -29,14 +29,13 @@
<tbody>
<var:foreach list="contactInfos" item="currentContact">
<tr class="tableview"
var:id="currentCName"
var:contactname="currentContact.displayName"
var:contactid="currentContact.c_uid">
<td class="displayName"><var:string value="currentContact.displayName" const:escapeHTML="YES" /></td>
<td><var:string value="currentContact.mail"/></td>
<td><var:string value="currentContact.screenName"/></td>
<td><var:string value="currentContact.org"/></td>
<td><var:string value="currentContact.phone"/></td>
var:id="currentContact.c_name"
var:contactname="currentContact.c_cn">
<td class="displayName"><var:string value="currentContact.c_cn" const:escapeHTML="YES" /></td>
<td><var:string value="currentContact.c_mail"/></td>
<td><var:string value="currentContact.c_screenname"/></td>
<td><var:string value="currentContact.c_o"/></td>
<td><var:string value="currentContact.c_telephonenumber"/></td>
</tr>
</var:foreach>
</tbody>

View File

@ -351,10 +351,10 @@ function moveTo(uri) {
/* contact menu entries */
function onContactRowDblClick(event) {
var contactId = this.getAttribute('contactid');
var cname = this.getAttribute('id');
openContactWindow(URLForFolderID(Contact.currentAddressBook)
+ "/" + contactId + "/edit", contactId);
+ "/" + cname + "/edit", cname);
return false;
}
@ -364,7 +364,7 @@ function onContactSelectionChange(event) {
if (rows.length == 1) {
var node = $(rows[0]);
loadContact(node.getAttribute('contactid'));
loadContact(node.getAttribute('id'));
}
else if (rows.length > 1) {
$('contactView').update();
@ -551,7 +551,7 @@ function onConfirmContactSelection(event) {
var contactsList = $("contactsList");
var rows = contactsList.getSelectedRows();
for (i = 0; i < rows.length; i++) {
var cid = rows[i].getAttribute("contactid");
var cid = rows[i].getAttribute("id");
var cname = '' + rows[i].getAttribute("contactname");
var email = '' + rows[i].cells[1].innerHTML;
@ -562,10 +562,10 @@ function onConfirmContactSelection(event) {
preventDefault(event);
}
function refreshContacts(contactId) {
openContactsFolder(Contact.currentAddressBook, true, contactId);
delete cachedContacts[Contact.currentAddressBook + "/" + contactId];
loadContact(contactId);
function refreshContacts(cname) {
openContactsFolder(Contact.currentAddressBook, true, cname);
delete cachedContacts[Contact.currentAddressBook + "/" + cname];
loadContact(cname);
return false;
}

View File

@ -207,7 +207,7 @@ function openUserFolderSelector(callback, type) {
}
function openContactWindow(url, wId) {
if (typeof wId == "undefined")
if (!wId)
wId = "_blank";
else {
wId = sanitizeWindowName(wId);
@ -223,7 +223,7 @@ function openContactWindow(url, wId) {
function openMailComposeWindow(url, wId) {
var parentWindow = this;
if (typeof wId == "undefined")
if (!wId)
wId = "_blank";
else {
wId = sanitizeWindowName(wId);