From: wolfgang Date: Tue, 20 Nov 2007 22:31:18 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1273 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ce3f1e5f2bd6d23283ddc6b297b24120085ca06;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1273 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index 1a4b1c0a..2f24b0ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2007-11-20 Wolfgang Sourdeau + * UI/MailPartViewers/UIxMailPartHTMLViewer.m + ([_UIxHTMLMailContentHandler + -setContentEncoding:newContentEncoding]): new method that + specifies an xml charset to return to the parser. + ([UIxMailPartHTMLViewer -flatContentAsString]): specifies the + charset to the content handler before parsing. + * SoObjects/Appointments/SOGoAppointmentObject.m: don't take an empty c_name as a valid response when looking up an event. Create one in that case instead. diff --git a/SOPE/sope-patchset-r1546.diff b/SOPE/sope-patchset-r1548.diff similarity index 84% rename from SOPE/sope-patchset-r1546.diff rename to SOPE/sope-patchset-r1548.diff index 216e640f..84d6abab 100644 --- a/SOPE/sope-patchset-r1546.diff +++ b/SOPE/sope-patchset-r1548.diff @@ -1,204 +1,6 @@ -Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m -=================================================================== ---- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1546) -+++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail) -@@ -713,6 +713,39 @@ - return ms; - } - -+/* GCSEOAdaptorChannel protocol */ -+static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ -+ @" c_name VARCHAR (256) NOT NULL,\n" -+ @" c_content VARCHAR (100000) NOT NULL,\n" -+ @" c_creationdate INT4 NOT NULL,\n" -+ @" c_lastmodified INT4 NOT NULL,\n" -+ @" c_version INT4 NOT NULL,\n" -+ @" c_deleted INT4 NULL\n" -+ @")"); -+static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \ -+ @" c_uid VARCHAR (256) NOT NULL,\n" -+ @" c_object VARCHAR (256) NOT NULL,\n" -+ @" c_role VARCHAR (80) NOT NULL\n" -+ @")"); -+ -+- (NSException *) createGCSFolderTableWithName: (NSString *) tableName -+{ -+ NSString *sql; -+ -+ sql = [NSString stringWithFormat: sqlFolderFormat, tableName]; -+ -+ return [self evaluateExpressionX: sql]; -+} -+ -+- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName -+{ -+ NSString *sql; -+ -+ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName]; -+ -+ return [self evaluateExpressionX: sql]; -+} -+ - @end /* PostgreSQL72Channel */ - - @implementation PostgreSQL72Channel(PrimaryKeyGeneration) -Index: sope-gdl1/Oracle8/GNUmakefile -=================================================================== ---- sope-gdl1/Oracle8/GNUmakefile (révision 1546) -+++ sope-gdl1/Oracle8/GNUmakefile (copie de travail) -@@ -28,15 +28,23 @@ - SOPE_ROOT=../.. - ORACLE_VERSION=10.2.0.3 - #ORACLE_VERSION=11.1.0.1 --ADDITIONAL_INCLUDE_DIRS += -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client -+ADDITIONAL_INCLUDE_DIRS += -I../../sope-core -I../../sope-core/NGExtensions -I../GDLAccess -I.. -I/usr/include/oracle/$(ORACLE_VERSION)/client - -+local_arch = $(subst 64,,$(shell uname -m)) -+ -+ifeq ($(local_arch),ppc) -+PPC_LDFLAGS=-L/opt/ibmcmp/lib -libmc++ -+else -+PPC_LDFLAGS= -+endif -+ - ifneq ($(frameworks),yes) --Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl --otest_TOOL_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -lGDLAccess -lEOControl -+common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -L../GDLAccess/obj -lGDLAccess -L../../sope-core/EOControl/obj -lEOControl $(PPC_LDFLAGS) - else --Oracle8_BUNDLE_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl --otest_TOOL_LIBS += -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl -+common_LIBS = -L/usr/lib/oracle/$(ORACLE_VERSION)/client/lib/ -locci -lociei -lclntsh -lnnz10 -framework GDLAccess -framework EOControl $(PPC_LDFLAGS) - endif -+Oracle8_BUNDLE_LIBS += $(common_LIBS) -+otest_TOOL_LIBS += $(common_LIBS) - - # Bundle - BUNDLE_NAME = Oracle8 -Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m -=================================================================== ---- sope-gdl1/Oracle8/OracleAdaptorChannel.m (révision 1546) -+++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail) -@@ -53,14 +53,17 @@ - while (c--) - { - info = [[_row_buffer objectAtIndex: c] pointerValue]; -- [_row_buffer removeObjectAtIndex: c]; - - // We free our LOB object. If it fails, it likely mean it isn't a LOB - // so we just free the value instead. -- if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS) -- { -- free(info->value); -- } -+ if (info->value) -+ { -+ if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS) -+ free(info->value); -+ info->value = NULL; -+ } -+ free(info); -+ [_row_buffer removeObjectAtIndex: c]; - } - - OCIHandleFree(_current_stm, OCI_HTYPE_STMT); -@@ -75,6 +78,30 @@ - // - @implementation OracleAdaptorChannel - -+static void -+DBTerminate() -+{ -+ if (OCITerminate(OCI_DEFAULT)) -+ NSLog(@"FAILED: OCITerminate()"); -+ else -+ NSLog(@"Oracle8: environment shut down"); -+} -+ -++ (void) initialize -+{ -+ // We Initialize the OCI process environment. -+ if (OCIInitialize((ub4)OCI_DEFAULT, (dvoid *)0, -+ (dvoid * (*)(dvoid *, size_t)) 0, -+ (dvoid * (*)(dvoid *, dvoid *, size_t))0, -+ (void (*)(dvoid *, dvoid *)) 0 )) -+ NSLog(@"FAILED: OCIInitialize()"); -+ else -+ { -+ NSLog(@"Oracle8: environment initialized"); -+ atexit(DBTerminate); -+ } -+} -+ - - (id) initWithAdaptorContext: (EOAdaptorContext *) theAdaptorContext - { - if ((self = [super initWithAdaptorContext: theAdaptorContext])) -@@ -134,10 +161,14 @@ - NSLog(@"FAILED: OCILogoff()"); - } - -- if (OCITerminate(OCI_DEFAULT)) -- { -- NSLog(@"FAILED: OCITerminate()"); -- } -+ -+ OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX); -+ OCIHandleFree(_oci_err, OCI_HTYPE_ERROR); -+ // OCIHandleFree(_oci_env, OCI_HTYPE_ENV); -+ -+ _oci_ctx = (OCISvcCtx *)0; -+ _oci_err = (OCIError *)0; -+ _oci_env = (OCIEnv *)0; - } - } - -@@ -151,11 +182,6 @@ - [self _cleanup]; - - RELEASE(_resultSetProperties); -- -- OCIHandleFree(_oci_ctx, OCI_HTYPE_SVCCTX); -- OCIHandleFree(_oci_err, OCI_HTYPE_ERROR); -- OCIHandleFree(_oci_env, OCI_HTYPE_ENV); -- - RELEASE(delegate); - - [super dealloc]; -@@ -368,16 +394,7 @@ - return NO; - } - -- // We Initialize the OCI process environment. -- if (OCIInitialize((ub4)OCI_DEFAULT, (dvoid *)0, -- (dvoid * (*)(dvoid *, size_t)) 0, -- (dvoid * (*)(dvoid *, dvoid *, size_t))0, -- (void (*)(dvoid *, dvoid *)) 0 )) -- { -- NSLog(@"FAILED: OCIInitialize()"); -- return NO; -- } -- -+ - if (OCIEnvInit((OCIEnv **)&_oci_env, (ub4)OCI_DEFAULT, (size_t)0, (dvoid **)0)) - { - NSLog(@"FAILED: OCIEnvInit()"); -Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m -=================================================================== ---- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (révision 1546) -+++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail) -@@ -155,7 +155,9 @@ - OCILobFreeTemporary([theChannel serviceContext], [theChannel errorHandle], info->value); - OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB); - } -+ free(info); - } -+ [theColumns release]; - - OCIHandleFree(theStatement, OCI_HTYPE_STMT); - } Index: sope-mime/NGImap4/NGImap4Connection.m =================================================================== ---- sope-mime/NGImap4/NGImap4Connection.m (révision 1546) +--- sope-mime/NGImap4/NGImap4Connection.m (révision 1548) +++ sope-mime/NGImap4/NGImap4Connection.m (copie de travail) @@ -381,7 +381,7 @@ @@ -211,7 +13,7 @@ Index: sope-mime/NGImap4/NGImap4Connection.m [self errorWithFormat:@"Could not list mailbox hierarchy!"]; Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m =================================================================== ---- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1546) +--- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1548) +++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m (copie de travail) @@ -648,14 +648,13 @@ enumerator = [_flags objectEnumerator]; @@ -237,7 +39,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m if (objs) free(objs); Index: sope-mime/NGImap4/NGImap4ResponseParser.m =================================================================== ---- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1546) +--- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1548) +++ sope-mime/NGImap4/NGImap4ResponseParser.m (copie de travail) @@ -84,6 +84,8 @@ static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self, @@ -428,7 +230,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m { Index: sope-mime/NGMail/NGSmtpClient.m =================================================================== ---- sope-mime/NGMail/NGSmtpClient.m (révision 1546) +--- sope-mime/NGMail/NGSmtpClient.m (révision 1548) +++ sope-mime/NGMail/NGSmtpClient.m (copie de travail) @@ -442,10 +442,10 @@ [self->text flush]; @@ -445,7 +247,7 @@ Index: sope-mime/NGMail/NGSmtpClient.m reply = [self receiveReply]; Index: sope-mime/NGMail/NGMimeMessageGenerator.m =================================================================== ---- sope-mime/NGMail/NGMimeMessageGenerator.m (révision 1546) +--- sope-mime/NGMail/NGMimeMessageGenerator.m (révision 1548) +++ sope-mime/NGMail/NGMimeMessageGenerator.m (copie de travail) @@ -86,37 +86,40 @@ char *des = NULL; @@ -511,7 +313,7 @@ Index: sope-mime/NGMail/NGMimeMessageGenerator.m unsigned isoEndLen = 2; Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m =================================================================== ---- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1546) +--- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1548) +++ sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (copie de travail) @@ -285,24 +285,16 @@ - (id)parseValue:(id)_data ofHeaderField:(NSString *)_field { @@ -545,7 +347,7 @@ Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m bytes++; Index: sope-mime/NGMime/NGMimeBodyPart.m =================================================================== ---- sope-mime/NGMime/NGMimeBodyPart.m (révision 1546) +--- sope-mime/NGMime/NGMimeBodyPart.m (révision 1548) +++ sope-mime/NGMime/NGMimeBodyPart.m (copie de travail) @@ -31,18 +31,6 @@ return 2; @@ -583,7 +385,7 @@ Index: sope-mime/NGMime/NGMimeBodyPart.m - (NSString *)contentId { Index: sope-mime/NGMime/NGMimeBodyParser.m =================================================================== ---- sope-mime/NGMime/NGMimeBodyParser.m (révision 1546) +--- sope-mime/NGMime/NGMimeBodyParser.m (révision 1548) +++ sope-mime/NGMime/NGMimeBodyParser.m (copie de travail) @@ -67,7 +67,10 @@ if (_data == nil) return nil; @@ -599,7 +401,7 @@ Index: sope-mime/NGMime/NGMimeBodyParser.m Index: sope-mime/NGMime/NGMimePartParser.h =================================================================== ---- sope-mime/NGMime/NGMimePartParser.h (révision 1546) +--- sope-mime/NGMime/NGMimePartParser.h (révision 1548) +++ sope-mime/NGMime/NGMimePartParser.h (copie de travail) @@ -117,6 +117,7 @@ BOOL parserParseRawBodyDataOfPart:1; @@ -621,7 +423,7 @@ Index: sope-mime/NGMime/NGMimePartParser.h @interface NSObject(NGMimePartParser) Index: sope-mime/NGMime/NGMimePartParser.m =================================================================== ---- sope-mime/NGMime/NGMimePartParser.m (révision 1546) +--- sope-mime/NGMime/NGMimePartParser.m (révision 1548) +++ sope-mime/NGMime/NGMimePartParser.m (copie de travail) @@ -227,7 +227,7 @@ } @@ -646,7 +448,7 @@ Index: sope-mime/NGMime/NGMimePartParser.m : [NGMimeType mimeType:[ctype stringValue]]; Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m =================================================================== ---- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (révision 1546) +--- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (révision 1548) +++ sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (copie de travail) @@ -49,80 +49,70 @@ @@ -780,9 +582,53 @@ Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m } return data; } +Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m +=================================================================== +--- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1548) ++++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail) +@@ -713,6 +713,39 @@ + return ms; + } + ++/* GCSEOAdaptorChannel protocol */ ++static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ ++ @" c_name VARCHAR (256) NOT NULL,\n" ++ @" c_content VARCHAR (100000) NOT NULL,\n" ++ @" c_creationdate INT4 NOT NULL,\n" ++ @" c_lastmodified INT4 NOT NULL,\n" ++ @" c_version INT4 NOT NULL,\n" ++ @" c_deleted INT4 NULL\n" ++ @")"); ++static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \ ++ @" c_uid VARCHAR (256) NOT NULL,\n" ++ @" c_object VARCHAR (256) NOT NULL,\n" ++ @" c_role VARCHAR (80) NOT NULL\n" ++ @")"); ++ ++- (NSException *) createGCSFolderTableWithName: (NSString *) tableName ++{ ++ NSString *sql; ++ ++ sql = [NSString stringWithFormat: sqlFolderFormat, tableName]; ++ ++ return [self evaluateExpressionX: sql]; ++} ++ ++- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName ++{ ++ NSString *sql; ++ ++ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName]; ++ ++ return [self evaluateExpressionX: sql]; ++} ++ + @end /* PostgreSQL72Channel */ + + @implementation PostgreSQL72Channel(PrimaryKeyGeneration) Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m =================================================================== ---- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (révision 1546) +--- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (révision 1548) +++ sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (copie de travail) @@ -140,8 +140,12 @@ @@ -823,9 +669,69 @@ Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m } static char *iconv_wrapper(id self, char *_src, unsigned _srcLen, +Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h +=================================================================== +--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (révision 1548) ++++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (copie de travail) +@@ -19,6 +19,8 @@ + 02111-1307, USA. + */ + ++#include ++ + #include + #include + #include +Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m +=================================================================== +--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (révision 1548) ++++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (copie de travail) +@@ -30,6 +30,12 @@ + #include + #include + ++@interface NSObject (contentHandlerExtensions) ++ ++- (xmlCharEncoding) contentEncoding; ++ ++@end ++ + @interface libxmlHTMLSAXDriver(PrivateMethods) + + - (void)tearDownParser; +@@ -205,6 +211,7 @@ + + - (void)setupParserWithDocumentPath:(NSString *)_path { + xmlSAXHandler sax; ++ xmlCharEncoding charEncoding; + + if (self->ctxt != NULL) { + NSLog(@"WARNING(%s): HTML parser context already setup !", +@@ -223,14 +230,18 @@ + __PRETTY_FUNCTION__, self, activeDriver); + } + activeDriver = self; +- ++ ++ if ([self->contentHandler respondsToSelector: @selector (contentEncoding)]) ++ charEncoding = [self->contentHandler contentEncoding]; ++ else ++ charEncoding = XML_CHAR_ENCODING_8859_1; ++ + self->ctxt = htmlCreatePushParserCtxt(&sax /* sax */, + NULL /*self*/ /* userdata */, + NULL /* chunk */, + 0 /* chunklen */, + [_path cString] /* filename */, +- XML_CHAR_ENCODING_8859_1 +- /* encoding */); ++ charEncoding /* encoding */); + self->doc = NULL; + } + - (void)tearDownParser { Index: sope-appserver/NGObjWeb/GNUmakefile.postamble =================================================================== ---- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1546) +--- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1548) +++ sope-appserver/NGObjWeb/GNUmakefile.postamble (copie de travail) @@ -23,14 +23,20 @@ @@ -854,7 +760,7 @@ Index: sope-appserver/NGObjWeb/GNUmakefile.postamble -endif Index: sope-appserver/NGObjWeb/WOContext.m =================================================================== ---- sope-appserver/NGObjWeb/WOContext.m (révision 1546) +--- sope-appserver/NGObjWeb/WOContext.m (révision 1548) +++ sope-appserver/NGObjWeb/WOContext.m (copie de travail) @@ -64,11 +64,13 @@ static BOOL testNSURLs = NO; @@ -894,7 +800,7 @@ Index: sope-appserver/NGObjWeb/WOContext.m serverURL = [@"http://" stringByAppendingString:host]; Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1546) +--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1548) +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (copie de travail) @@ -216,6 +216,12 @@ assocCount++; @@ -911,7 +817,7 @@ Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1546) +--- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1548) +++ sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (copie de travail) @@ -40,6 +40,7 @@ WOAssociation *string; @@ -941,7 +847,7 @@ Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m return YES; Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1546) +--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1548) +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (copie de travail) @@ -41,7 +41,8 @@ WOAssociation *pageName; @@ -955,7 +861,7 @@ Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h /* 'ivar' associations */ Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m =================================================================== ---- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1546) +--- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1548) +++ sope-appserver/NGObjWeb/SoObjects/SoObject.m (copie de travail) @@ -39,22 +39,34 @@ static int debugLookup = -1; @@ -1106,7 +1012,7 @@ Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m =================================================================== ---- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1546) +--- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1548) +++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (copie de travail) @@ -31,6 +31,7 @@ #include diff --git a/SoObjects/SOGo/SOGoFolder.m b/SoObjects/SOGo/SOGoFolder.m index aae0a632..0f481510 100644 --- a/SoObjects/SOGo/SOGoFolder.m +++ b/SoObjects/SOGo/SOGoFolder.m @@ -224,6 +224,14 @@ /* folder type */ +- (BOOL) isEqual: (id) otherFolder +{ + return ([otherFolder class] == [self class] + && [container isEqual: [otherFolder container]] + && [nameInContainer + isEqualToString: [otherFolder nameInContainer]]); +} + - (NSString *) outlookFolderClass { [self subclassResponsibility: _cmd]; diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 9322f247..728d3c30 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -48,6 +48,7 @@ #import "NSString+Utilities.h" #import "SOGoContentObject.h" +#import "SOGoParentFolder.h" #import "SOGoPermissions.h" #import "SOGoUser.h" @@ -109,11 +110,16 @@ static NSString *defaultUserID = @""; - (void) _setDisplayNameFromRow: (NSDictionary *) row { - NSString *currentLogin, *ownerLogin; + NSString *currentLogin, *ownerLogin, *primaryDN; NSDictionary *ownerIdentity; - displayName - = [NSMutableString stringWithString: [row objectForKey: @"c_foldername"]]; + primaryDN = [row objectForKey: @"c_foldername"]; + displayName = [NSMutableString string]; + if ([primaryDN isEqualToString: [container defaultFolderName]]) + [displayName appendString: [self labelForKey: primaryDN]]; + else + [displayName appendString: primaryDN]; + currentLogin = [[context activeUser] login]; ownerLogin = [self ownerInContext: context]; if (![currentLogin isEqualToString: ownerLogin]) diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index bc62ee22..3b8f9ca2 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -995,11 +995,13 @@ static BOOL kontactGroupDAV = YES; userLanguage = [[context activeUser] language]; paths = [bundle pathsForResourcesOfType: @"strings" - inDirectory: [NSString stringWithFormat: @"%@.lproj", userLanguage] + inDirectory: [NSString stringWithFormat: @"%@.lproj", + userLanguage] forLocalization: userLanguage]; if ([paths count] > 0) { - strings = [NSDictionary dictionaryFromStringsFile: [paths objectAtIndex: 0]]; + strings = [NSDictionary + dictionaryFromStringsFile: [paths objectAtIndex: 0]]; label = [strings objectForKey: key]; if (!label) label = key; diff --git a/UI/MailPartViewers/GNUmakefile b/UI/MailPartViewers/GNUmakefile index a86ea456..8bbcc1c8 100644 --- a/UI/MailPartViewers/GNUmakefile +++ b/UI/MailPartViewers/GNUmakefile @@ -40,7 +40,7 @@ MailPartViewers_LOCALIZED_RESOURCE_FILES += \ # make -ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/ +ADDITIONAL_INCLUDE_DIRS += $(shell xml2-config --cflags) ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/ -include GNUmakefile.preamble diff --git a/UI/MailPartViewers/UIxMailPartHTMLViewer.m b/UI/MailPartViewers/UIxMailPartHTMLViewer.m index 6be09e6d..c93c83b2 100644 --- a/UI/MailPartViewers/UIxMailPartHTMLViewer.m +++ b/UI/MailPartViewers/UIxMailPartHTMLViewer.m @@ -22,6 +22,9 @@ #import #import +#import +#import + #import #import #import @@ -30,6 +33,8 @@ #import #import +#include + #import "UIxMailPartHTMLViewer.h" #if 0 @@ -49,6 +54,7 @@ BOOL inCSSDeclaration; BOOL hasEmbeddedCSS; NSMutableArray *crumb; + xmlCharEncoding contentEncoding; } - (NSString *) result; @@ -65,6 +71,7 @@ css = nil; result = nil; attachmentIds = nil; + contentEncoding = XML_CHAR_ENCODING_UTF8; } return self; @@ -78,6 +85,16 @@ [super dealloc]; } +- (void) setContentEncoding: (xmlCharEncoding) newContentEncoding +{ + contentEncoding = newContentEncoding; +} + +- (xmlCharEncoding) contentEncoding +{ + return contentEncoding; +} + - (void) setAttachmentIds: (NSDictionary *) newAttachmentIds { attachmentIds = newAttachmentIds; @@ -463,17 +480,79 @@ return attachmentIds; } +- (xmlCharEncoding) _xmlCharsetForCharset: (NSString *) charset +{ + struct { NSString *name; xmlCharEncoding encoding; } xmlEncodings[] = { + { @"us-ascii", XML_CHAR_ENCODING_NONE}, + { @"utf-8", XML_CHAR_ENCODING_UTF8}, + { @"utf-16le", XML_CHAR_ENCODING_UTF16LE}, + { @"utf-16be", XML_CHAR_ENCODING_UTF16BE}, + { @"ucs-4le", XML_CHAR_ENCODING_UCS4LE}, + { @"ucs-4be", XML_CHAR_ENCODING_UCS4BE}, + { @"ebcdic", XML_CHAR_ENCODING_EBCDIC}, +// { @"iso-10646" , XML_CHAR_ENCODING_UCS4_2143}, +// { , XML_CHAR_ENCODING_UCS4_3412}, +// { @"ucs-2", XML_CHAR_ENCODING_UCS2}, + { @"iso8859_1", XML_CHAR_ENCODING_8859_1}, + { @"iso-8859-1", XML_CHAR_ENCODING_8859_1}, + { @"iso-8859-2", XML_CHAR_ENCODING_8859_2}, + { @"iso-8859-3", XML_CHAR_ENCODING_8859_3}, + { @"iso-8859-4", XML_CHAR_ENCODING_8859_4}, + { @"iso-8859-5", XML_CHAR_ENCODING_8859_5}, + { @"iso-8859-6", XML_CHAR_ENCODING_8859_6}, + { @"iso-8859-7", XML_CHAR_ENCODING_8859_7}, + { @"iso-8859-8", XML_CHAR_ENCODING_8859_8}, + { @"iso-8859-9", XML_CHAR_ENCODING_8859_9}, + { @"iso-2022-jp", XML_CHAR_ENCODING_2022_JP}, +// { @"iso-2022-jp", XML_CHAR_ENCODING_SHIFT_JIS}, + { @"euc-jp", XML_CHAR_ENCODING_EUC_JP}, + { @"us-ascii", XML_CHAR_ENCODING_ASCII}}; + unsigned count; + xmlCharEncoding encoding; + + encoding = XML_CHAR_ENCODING_NONE; + count = 0; + + while (encoding == XML_CHAR_ENCODING_NONE + && count < (sizeof (xmlEncodings) / sizeof (xmlEncodings[0]))) + if ([charset isEqualToString: xmlEncodings[count].name]) + encoding = xmlEncodings[count].encoding; + else + count++; + + if (encoding == XML_CHAR_ENCODING_NONE) + encoding = XML_CHAR_ENCODING_8859_1; + + return encoding; +} + +- (xmlCharEncoding) _xmlCharEncoding +{ + + NSString *charset; + + charset = [[bodyInfo objectForKey:@"parameterList"] + objectForKey: @"charset"]; + if (![charset length]) + charset = @"us-ascii"; + + return [self _xmlCharsetForCharset: [charset lowercaseString]]; +} + - (void) _parseContent { - id parser; + NSObject *parser; NSData *preparsedContent; preparsedContent = [super decodedFlatContent]; parser = [[SaxXMLReaderFactory standardXMLReaderFactory] createXMLReaderForMimeType: @"text/html"]; + [parser setValue: [NSNumber numberWithBool: NO] + forKey: @"encodeEntities"]; handler = [_UIxHTMLMailContentHandler new]; [handler setAttachmentIds: [self _attachmentIds]]; + [handler setContentEncoding: [self _xmlCharEncoding]]; [parser setContentHandler: handler]; [parser parseFromSource: preparsedContent]; } diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 28afec22..49083d4e 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -478,6 +478,21 @@ return calendarList; } +- (NSString *) calendarDisplayName +{ + NSString *fDisplayName; + SOGoAppointmentFolder *folder; + SOGoAppointmentFolders *parentFolder; + + fDisplayName = [item displayName]; + folder = [[self clientObject] container]; + parentFolder = [folder container]; + if ([fDisplayName isEqualToString: [parentFolder defaultFolderName]]) + fDisplayName = [self labelForKey: fDisplayName]; + + return fDisplayName; +} + - (NSString *) calendarsFoldersList { NSArray *calendars; diff --git a/UI/Templates/SchedulerUI/UIxComponentEditor.wox b/UI/Templates/SchedulerUI/UIxComponentEditor.wox index d5c1e976..2c01d63e 100644 --- a/UI/Templates/SchedulerUI/UIxComponentEditor.wox +++ b/UI/Templates/SchedulerUI/UIxComponentEditor.wox @@ -47,7 +47,7 @@ /> diff --git a/UI/WebServerResources/UIxAclEditor.css b/UI/WebServerResources/UIxAclEditor.css index 2161352d..cd39d054 100644 --- a/UI/WebServerResources/UIxAclEditor.css +++ b/UI/WebServerResources/UIxAclEditor.css @@ -21,15 +21,14 @@ DIV#userSelector SPAN { display: block; } INPUT#defaultRolesBtn -{ no_position: absolute; - margin-left: 1em; +{ margin-left: 1em; margin-top: 1em; left: 1em; } DIV#userRoles { position: absolute; left: 1em; - top: 8em; + top: 7.6em; right: 1em; bottom: 0px; } diff --git a/UI/WebServerResources/UIxAclEditor.js b/UI/WebServerResources/UIxAclEditor.js index 5350931e..9617809b 100644 --- a/UI/WebServerResources/UIxAclEditor.js +++ b/UI/WebServerResources/UIxAclEditor.js @@ -2,8 +2,10 @@ var contactSelectorAction = 'acls-contacts'; var defaultUserID = ''; -var userRightsHeight; -var userRightsWidth; +var AclEditor = { + userRightsHeight: null, + userRightsWidth: null +}; function addUser(userName, userID) { if (!$(userID)) { @@ -100,8 +102,8 @@ function openRightsForUserID(userID) { elements[elements.length-1] = "userRights?uid=" + userID; window.open(elements.join("/"), "", - "width=" + userRightsWidth - + ",height=" + userRightsHeight + "width=" + AclEditor.userRightsWidth + + ",height=" + AclEditor.userRightsHeight + ",resizable=0,scrollbars=0,toolbar=0," + "location=0,directories=0,status=0,menubar=0,copyhistory=0"); } @@ -141,8 +143,8 @@ function onAclLoadHandler() { Event.observe(buttons[1], "click", onUserRemove); } - userRightsHeight = window.opener.getUsersRightsWindowHeight(); - userRightsWidth = window.opener.getUsersRightsWindowWidth(); + AclEditor['userRightsHeight'] = window.opener.getUsersRightsWindowHeight(); + AclEditor['userRightsWidth'] = window.opener.getUsersRightsWindowWidth(); } FastInit.addOnLoad(onAclLoadHandler); diff --git a/UI/WebServerResources/UIxMailEditor.css b/UI/WebServerResources/UIxMailEditor.css index 87a7c490..cd3ead51 100644 --- a/UI/WebServerResources/UIxMailEditor.css +++ b/UI/WebServerResources/UIxMailEditor.css @@ -64,13 +64,13 @@ SPAN.headerField TABLE#addressList TR#lastRow SELECT { visibility: hidden; } -DIV#subjectRow INPUT -{ background-image: none; - width: 60%; } - DIV#subjectRow SPAN.headerField { float: left; } +DIV#subjectRow INPUT +{ background-image: none; + padding: 0px 2px 0px 4px; } + div#compose_internetmarker { padding: 8px; text-align: center; diff --git a/UI/WebServerResources/UIxMailEditor.js b/UI/WebServerResources/UIxMailEditor.js index 686d5bdc..80faf8cd 100644 --- a/UI/WebServerResources/UIxMailEditor.js +++ b/UI/WebServerResources/UIxMailEditor.js @@ -1,19 +1,26 @@ var contactSelectorAction = 'mailer-contacts'; var signatureLength = 0; +var MailEditor = { + addressBook: null +}; function onContactAdd() { var selector = null; var selectorURL = '?popup=YES&selectorId=mailer-contacts'; - urlstr = ApplicationBaseURL - + "../Contacts/" - + contactSelectorAction + selectorURL; - var w = window.open(urlstr, "Addressbook", - "width=640,height=400,resizable=1,scrollbars=0"); - w.selector = selector; - w.opener = this; - w.focus(); - + if (MailEditor.addressBook) + MailEditor.addressBook.focus(); + else { + urlstr = ApplicationBaseURL + + "../Contacts/" + + contactSelectorAction + selectorURL; + MailEditor.addressBook = window.open(urlstr, "_blank", + "width=640,height=400,resizable=1,scrollbars=0"); + MailEditor.addressBook.selector = selector; + MailEditor.addressBook.opener = this; + MailEditor.addressBook.focus(); + } + return false; } @@ -150,7 +157,7 @@ function clickedEditorSend(sender) { var toolbar = document.getElementById("toolbar"); if (!document.busyAnim) document.busyAnim = startAnimation(toolbar); - + window.shouldPreserve = true; document.pageform.action = "send"; document.pageform.submit(); @@ -242,8 +249,11 @@ function clickedEditorSave(sender) { } function onTextFocus() { - this.insertBefore(document.createTextNode("\r\n"), - this.lastChild); + var content = this.getValue(); + if (content.lastIndexOf("--") == 0) { + this.insertBefore(document.createTextNode("\r\n"), + this.lastChild); + } if (signatureLength > 0) { var length = this.getValue().length - signatureLength - 1; this.setSelectionRange(length, length); @@ -272,8 +282,8 @@ function initMailEditor() { var sigLimit = textContent.lastIndexOf("--"); if (sigLimit > -1) signatureLength = (textContent.length - sigLimit); - Event.observe(textarea, "focus", - onTextFocus.bindAsEventListener(textarea)); + textarea.observe("focus", onTextFocus); + textarea.scrollTop = textarea.offsetHeight; onWindowResize(null); Event.observe(window, "resize", onWindowResize); @@ -345,16 +355,16 @@ function onWindowResize(event) { // headerarea)[0]; // $("attachments").setStyle({ height: (headerarea.getHeight() - fromfield.getHeight() - 10) + 'px' }); } -// var subjectfield = $(document).getElementsByClassName('headerField', -// $('subjectRow'))[0]; -// var subjectinput = $(document).getElementsByClassName('textField', -// $('subjectRow'))[0]; -// + var subjectfield = $(document).getElementsByClassName('headerField', + $('subjectRow'))[0]; + var subjectinput = $(document).getElementsByClassName('textField', + $('subjectRow'))[0]; + // Resize subject field -// subjectinput.setStyle({ width: (window.width() -// - $(subjectfield).getWidth() -// - attachmentswidth -// - 4 - 30) + 'px' }); + subjectinput.setStyle({ width: (window.width() + - $(subjectfield).getWidth() + - attachmentswidth + - 16) + 'px' }); // Resize address fields var addresslist = $('addressList'); @@ -382,6 +392,9 @@ function onMailEditorClose(event) { } } + if (MailEditor.addressBook) + MailEditor.addressBook.close(); + Event.stopObserving(window, "beforeunload", onMailEditorClose); } diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index 38fd841b..ba274a4e 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -595,6 +595,9 @@ A[class~="_disabled"].button:active text-decoration: none; color: inherit; } +A.button +{ padding: 4px; } + A.button IMG { vertical-align: middle; } diff --git a/UI/WebServerResources/iefixes.css b/UI/WebServerResources/iefixes.css index 3ee82493..2faaf0ee 100644 --- a/UI/WebServerResources/iefixes.css +++ b/UI/WebServerResources/iefixes.css @@ -23,6 +23,25 @@ TD.tbtv_navcell border-right: 1px solid #666; border-bottom: 1px solid #666; } +A.button, +INPUT.button +{ border: 1px solid #fff; + border-right: 1px solid #666; + border-bottom: 1px solid #666; + margin: 0px; + padding: 0px; } + +A.button IMG +{ margin: 1px; } + +/* UIxAclEditor */ + +DIV#userRoles +{ } + +UL#userList +{ top: 3em; } + /* MailerUI */ IMG.dragMessage { filter: alpha(opacity=70); }