From: wolfgang Date: Mon, 20 Aug 2007 21:55:51 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1151 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=f43f49316ee04df928702a8496d6af7d46c5452b;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1151 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index 385a4d19..da37d536 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,26 @@ 2007-08-20 Wolfgang Sourdeau + * SoObjects/Contacts/SOGoContactGCSFolder.m ([SOGoContactGCSFolder + -_flattenedRecords:records]): when the c_cn field is empty, + returns set a formatted string with the concatenation of + c_givenname and c_sn as the displayName. + + * SoObjects/Mailer/SOGoMailAccounts.m ([SOGoMailAccounts + -isValidMailAccountName:_key]): prevent unknown accounts from + being accessed. + + * UI/MailPartViewers/UIxMailPartViewer.m ([UIxMailPartViewer + -pathToAttachmentObject]): we no longer need the filename + extension for SoLookup... + + * SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart + -lookupName:_keyinContext:_ctxacquire:_flag]): do not require the + filename to have an extension, and thus accept any filename. + + * UI/Contacts/UIxContactsListView.m ([UIxContactsListView + -currentCName]): new method that returns the c_name of the + contact, correctly escaped to be passed by url afterwards. + * UI/MailPartViewers/UIxMailPartHTMLViewer.m ([UIxMailPartHTMLViewer -flatContentAsString]): pass the NSData instance of [self decodedFlatContent] instead of the buggy diff --git a/NEWS b/NEWS index e3542840..db619da5 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ of sendmail; - rewrote the handling of draft objects to comply better with the behaviour of Thunderbird; +- added a German translation based on Thunderbird; 0.9.0-20070713 -------------- diff --git a/SoObjects/Contacts/SOGoContactGCSFolder.m b/SoObjects/Contacts/SOGoContactGCSFolder.m index 7228ac62..47eb5f13 100644 --- a/SoObjects/Contacts/SOGoContactGCSFolder.m +++ b/SoObjects/Contacts/SOGoContactGCSFolder.m @@ -30,11 +30,12 @@ #import #import +#import #import "SOGoContactGCSEntry.h" #import "SOGoContactGCSFolder.h" #define folderListingFields [NSArray arrayWithObjects: @"c_name", @"c_cn", \ - @"c_givenname", @"c_screenname", \ + @"c_givenname", @"c_sn", @"c_screenname", \ @"c_o", @"c_mail", @"c_telephonenumber", \ nil] @@ -177,8 +178,8 @@ forKey: @"c_name"]; data = [oldRecord objectForKey: @"c_cn"]; - if (!data) - data = @""; + if (![data length]) + data = [oldRecord keysWithFormat: @"%{c_givenname} %{c_sn}"]; [newRecord setObject: data forKey: @"displayName"]; diff --git a/SoObjects/Mailer/SOGoMailAccounts.m b/SoObjects/Mailer/SOGoMailAccounts.m index 09a8cfd6..66e2948b 100644 --- a/SoObjects/Mailer/SOGoMailAccounts.m +++ b/SoObjects/Mailer/SOGoMailAccounts.m @@ -55,7 +55,11 @@ static NSString *AgenorShareLoginMarker = @".-."; - (BOOL) isValidMailAccountName: (NSString *) _key { - return ([_key length] > 0); + NSArray *accounts; + + accounts = [[context activeUser] mailAccounts]; + + return [[accounts objectsForKey: @"name"] containsObject: _key]; } - (id) mailAccountWithName: (NSString *) _key diff --git a/SoObjects/Mailer/SOGoMailBodyPart.m b/SoObjects/Mailer/SOGoMailBodyPart.m index 15bc9dd5..fb11b019 100644 --- a/SoObjects/Mailer/SOGoMailBodyPart.m +++ b/SoObjects/Mailer/SOGoMailBodyPart.m @@ -131,39 +131,36 @@ static BOOL debugOn = NO; /* name lookup */ -- (id)lookupImap4BodyPartKey:(NSString *)_key inContext:(id)_ctx { +- (id) lookupImap4BodyPartKey: (NSString *) _key + inContext: (id) _ctx +{ // TODO: we might want to check for existence prior controller creation Class clazz; clazz = [SOGoMailBodyPart bodyPartClassForKey:_key inContext:_ctx]; - return [[[clazz alloc] initWithName:_key inContainer:self] autorelease]; + + return [clazz objectWithName: _key inContainer: self]; } -- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag { +- (id) lookupName: (NSString *) _key + inContext: (id) _ctx + acquire: (BOOL) _flag +{ id obj; /* first check attributes directly bound to the application */ - if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]) != nil) - return obj; - - /* lookup body part */ - - if ([self isBodyPartKey:_key inContext:_ctx]) { - if ((obj = [self lookupImap4BodyPartKey:_key inContext:_ctx]) != nil) - return obj; - } - - /* - Treat other keys which have a path-extension as 'virtual' noops to allow - addition of path names to the attachment path, eg: - http://.../login@server/INBOX/1/2/3/MyDocument.pdf - */ - if ([[_key pathExtension] length] > 0) - return self; - - /* return 404 to stop acquisition */ - return [NSException exceptionWithHTTPStatus:404 /* Not Found */ - reason:@"Did not find a subpart for the given name!"]; + obj = [super lookupName:_key inContext:_ctx acquire:NO]; + if (!obj) + { + /* lookup body part */ + if ([self isBodyPartKey:_key inContext:_ctx]) + obj = [self lookupImap4BodyPartKey:_key inContext:_ctx]; + /* should check whether such a filename exist in the attached names */ + if (!obj) + obj = self; + } + + return obj; } /* fetch */ diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 5921f289..c99b1b0b 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -224,7 +224,7 @@ static BOOL debugSoParts = NO; if (!coreInfos) { - msgs = [self fetchParts:coreInfoKeys]; // returns dict + msgs = [self fetchParts: coreInfoKeys]; // returns dict if (heavyDebug) [self logWithFormat: @"M: %@", msgs]; msgs = [msgs valueForKey: @"fetch"]; diff --git a/UI/Common/GNUmakefile b/UI/Common/GNUmakefile index 455202c2..ebdc4fea 100644 --- a/UI/Common/GNUmakefile +++ b/UI/Common/GNUmakefile @@ -6,7 +6,7 @@ BUNDLE_NAME = CommonUI CommonUI_PRINCIPAL_CLASS = CommonUIProduct -CommonUI_LANGUAGES = English French +CommonUI_LANGUAGES = English French German CommonUI_OBJC_FILES += \ CommonUIProduct.m \ diff --git a/UI/Contacts/GNUmakefile b/UI/Contacts/GNUmakefile index 6f7ae7e8..34a2f8fc 100644 --- a/UI/Contacts/GNUmakefile +++ b/UI/Contacts/GNUmakefile @@ -6,7 +6,7 @@ BUNDLE_NAME = ContactsUI ContactsUI_PRINCIPAL_CLASS = ContactsUIProduct -ContactsUI_LANGUAGES = English French +ContactsUI_LANGUAGES = English French German ContactsUI_OBJC_FILES = \ UIxContactsUserFolders.m \ diff --git a/UI/Contacts/UIxContactsListView.m b/UI/Contacts/UIxContactsListView.m index 940cbaa5..45dadfa6 100644 --- a/UI/Contacts/UIxContactsListView.m +++ b/UI/Contacts/UIxContactsListView.m @@ -21,6 +21,7 @@ #import #import +#import #import #import @@ -59,6 +60,15 @@ return currentContact; } +- (NSString *) currentCName +{ + NSString *cName; + + cName = [currentContact objectForKey: @"c_name"]; + + return [cName stringByEscapingURL]; +} + - (id ) mailerContactsAction { selectorComponentClass = @"UIxContactsMailerSelection"; diff --git a/UI/MailPartViewers/GNUmakefile b/UI/MailPartViewers/GNUmakefile index 1850ca57..ae6a49d2 100644 --- a/UI/MailPartViewers/GNUmakefile +++ b/UI/MailPartViewers/GNUmakefile @@ -6,9 +6,7 @@ BUNDLE_NAME = MailPartViewers MailPartViewers_PRINCIPAL_CLASS = MailPartViewersProduct -MailPartViewers_LANGUAGES = English French - -MailPartViewers_LANGUAGES = English French +MailPartViewers_LANGUAGES = English French German MailPartViewers_OBJC_FILES += \ MailPartViewersProduct.m \ diff --git a/UI/MailPartViewers/UIxMailPartViewer.m b/UI/MailPartViewers/UIxMailPartViewer.m index e44980ea..36c2a1ad 100644 --- a/UI/MailPartViewers/UIxMailPartViewer.m +++ b/UI/MailPartViewers/UIxMailPartViewer.m @@ -316,52 +316,35 @@ if ([(n = [partPath componentsJoinedByString:@"/"]) isNotNull]) url = [url stringByAppendingString:n]; - /* we currently NEED the extension for SoObject lookup (should be fixed) */ - - pext = [self preferredPathExtension]; - if ([pext isNotNull] && [pext length] > 0) - { - /* attach extension */ - if ([url hasSuffix:@"/"]) { - /* this happens if the part is the root-content of the mail */ - url = [url substringToIndex:([url length] - 1)]; - } - url = [url stringByAppendingString:@"."]; - url = [url stringByAppendingString:pext]; - } - return url; } - (NSString *) pathToAttachment { /* this generates a more beautiful 'download' URL for a part */ - NSString *url, *fn; - - fn = [self filename]; - - if (![fn isNotNull] || ([fn length] == 0)) - fn = nil; - - /* get basic URL */ + NSString *fn; + NSMutableString *url; - url = [self pathToAttachmentObject]; + fn = [self filename]; + if ([fn length] > 0) + { + /* get basic URL */ + url = [NSMutableString stringWithString: [self pathToAttachmentObject]]; - /* - If we have an attachment name, we attach it, this is properly handled by - SOGoMailBodyPart. - */ + /* + If we have an attachment name, we attach it, this is properly handled by + SOGoMailBodyPart. + */ - if (fn) - { if (![url hasSuffix: @"/"]) - url = [url stringByAppendingString: @"/"]; - if (isdigit([fn characterAtIndex:0])) - url = [url stringByAppendingString: @"fn-"]; - url = [url stringByAppendingString: [fn stringByEscapingURL]]; - - // TODO: should we check for a proper extension? + [url appendString: @"/"]; + if (isdigit([url characterAtIndex: 0])) + [url appendString: @"fn-"]; + [url appendString: [fn stringByEscapingURL]]; + // TODO: should we check for a proper extension? } + else + url = nil; return url; } diff --git a/UI/MailerUI/GNUmakefile b/UI/MailerUI/GNUmakefile index cc8411a8..7a7c36b4 100644 --- a/UI/MailerUI/GNUmakefile +++ b/UI/MailerUI/GNUmakefile @@ -6,7 +6,7 @@ BUNDLE_NAME = MailerUI MailerUI_PRINCIPAL_CLASS = MailerUIProduct -MailerUI_LANGUAGES = English French +MailerUI_LANGUAGES = English French German MailerUI_OBJC_FILES += \ MailerUIProduct.m \ diff --git a/UI/MainUI/GNUmakefile b/UI/MainUI/GNUmakefile index 7d053e5b..83e84c18 100644 --- a/UI/MainUI/GNUmakefile +++ b/UI/MainUI/GNUmakefile @@ -6,7 +6,7 @@ BUNDLE_NAME = MainUI MainUI_PRINCIPAL_CLASS = MainUIProduct -MainUI_LANGUAGES = English French +MainUI_LANGUAGES = English French German MainUI_OBJC_FILES += \ MainUIProduct.m \ diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 28a5e753..bbf71463 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -61,8 +61,8 @@ "reminderTime_0030" = "30 minutes"; "reminderTime_0100" = "1 hour"; "reminderTime_0200" = "2 hours"; -"reminderTime_0400" = "2 hours"; -"reminderTime_0800" = "2 hours"; +"reminderTime_0400" = "4 hours"; +"reminderTime_0800" = "8 hours"; "reminderTime_1200" = "1/2 day"; "reminderTime_2400" = "1 day"; "reminderTime_4800" = "2 days"; diff --git a/UI/PreferencesUI/French.lproj/Localizable.strings b/UI/PreferencesUI/French.lproj/Localizable.strings index 74b46dd5..f61bb331 100644 --- a/UI/PreferencesUI/French.lproj/Localizable.strings +++ b/UI/PreferencesUI/French.lproj/Localizable.strings @@ -58,8 +58,8 @@ "reminderTime_0030" = "30 minutes"; "reminderTime_0100" = "1 heure"; "reminderTime_0200" = "2 heures"; -"reminderTime_0400" = "2 heures"; -"reminderTime_0800" = "2 heures"; +"reminderTime_0400" = "4 heures"; +"reminderTime_0800" = "8 heures"; "reminderTime_1200" = "1/2 journée"; "reminderTime_2400" = "1 journée"; "reminderTime_4800" = "2 journées"; diff --git a/UI/PreferencesUI/GNUmakefile b/UI/PreferencesUI/GNUmakefile index 86fe2827..2f8eaba0 100644 --- a/UI/PreferencesUI/GNUmakefile +++ b/UI/PreferencesUI/GNUmakefile @@ -6,7 +6,7 @@ BUNDLE_NAME = PreferencesUI PreferencesUI_PRINCIPAL_CLASS = PreferencesUIProduct -PreferencesUI_LANGUAGES = English French +PreferencesUI_LANGUAGES = English French German PreferencesUI_OBJC_FILES = \ PreferencesUIProduct.m \ diff --git a/UI/Templates/ContactsUI/UIxContactsListView.wox b/UI/Templates/ContactsUI/UIxContactsListView.wox index bbaa1661..cd535d8d 100644 --- a/UI/Templates/ContactsUI/UIxContactsListView.wox +++ b/UI/Templates/ContactsUI/UIxContactsListView.wox @@ -28,7 +28,7 @@ +
+ xmlns:var="http://www.skyrix.com/od/binding" + xmlns:const="http://www.skyrix.com/od/constant" + xmlns:label="OGo:label" + class="linked_attachment_frame" + >
+ var:title="filenameForDisplay" + const:absolute="YES" + >
: / @@ -17,13 +20,13 @@
- + -->
diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 7eb2d2dc..9eae7349 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -313,8 +313,8 @@ function eventsListCallback(http) { var row = document.createElement("tr"); table.appendChild(row); $(row).addClassName("eventRow"); - row.setAttribute("id", data[i][0]); - row.cname = data[i][0]; + row.setAttribute("id", escape(data[i][0])); + row.cname = escape(data[i][0]); row.owner = data[i][1]; var startDate = new Date();