From 342662549e7b2f05e28af86423aac89b208f538e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 20 Aug 2008 03:21:33 +0000 Subject: [PATCH] Monotone-Parent: 006ff807d8307c52defea735313008dfe94862db Monotone-Revision: da8c27f53557345f2f6856fdca0d8fabd1d3bdef Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-20T03:21:33 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 + UI/Common/English.lproj/Localizable.strings | 5 - UI/Common/French.lproj/Localizable.strings | 5 - UI/Common/GNUmakefile | 1 - UI/Common/Italian.lproj/Localizable.strings | 4 - UI/Common/Spanish.lproj/Localizable.strings | 5 - UI/Common/UIxElemBuilder.m | 86 ----------- UI/Common/UIxPageFrame.h | 2 - UI/Common/UIxPageFrame.m | 31 +--- UI/Common/common.h | 153 -------------------- UI/MainUI/English.lproj/Localizable.strings | 7 +- UI/MainUI/French.lproj/Localizable.strings | 7 +- UI/MainUI/GNUmakefile | 3 +- UI/MainUI/Italian.lproj/Localizable.strings | 5 + UI/MainUI/SOGoBrowsersPanel.h | 30 ++++ UI/MainUI/SOGoBrowsersPanel.m | 51 +++++++ UI/MainUI/Spanish.lproj/Localizable.strings | 5 + UI/Templates/MainUI/SOGoBrowsersPanel.wox | 24 +++ UI/Templates/UIxPageFrame.wox | 19 +-- UI/WebServerResources/SOGoRootPage.css | 3 +- 20 files changed, 142 insertions(+), 308 deletions(-) delete mode 100644 UI/Common/UIxElemBuilder.m delete mode 100644 UI/Common/common.h create mode 100644 UI/MainUI/SOGoBrowsersPanel.h create mode 100644 UI/MainUI/SOGoBrowsersPanel.m create mode 100644 UI/Templates/MainUI/SOGoBrowsersPanel.wox diff --git a/ChangeLog b/ChangeLog index 820413b16..d8113abec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-08-19 Wolfgang Sourdeau + * UI/MainUI/SOGoBrowsersPanel.[hm]: new template class that helps + displaying a choice of browsers compatible with SOGo. The code was + extracted from UIxPageFrame. + * UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor -viewAction]): apply the user's timezone to the startdate before formatting it. diff --git a/UI/Common/English.lproj/Localizable.strings b/UI/Common/English.lproj/Localizable.strings index d7c1eb9b7..3231c2232 100644 --- a/UI/Common/English.lproj/Localizable.strings +++ b/UI/Common/English.lproj/Localizable.strings @@ -27,11 +27,6 @@ "Sorry, the user rights can not be configured for that object." = "Sorry, the user rights can not be configured for that object."; -"browserNotCompatible" = "We've detected that your browser version is currently not supported on this site. Our recommendation is to use Firefox. Click on the link bellow to download the most current version of this browser."; -"alternativeBrowsers" = "Alternatively, you can also use the following compatible browsers"; -"alternativeBrowserSafari" = "Alternatively, you can also use Safari."; -"Download" = "Download"; - /* generic.js */ "Unable to subscribe to that folder!" = "Unable to subscribe to that folder!"; diff --git a/UI/Common/French.lproj/Localizable.strings b/UI/Common/French.lproj/Localizable.strings index 257db60d7..86a4d8230 100644 --- a/UI/Common/French.lproj/Localizable.strings +++ b/UI/Common/French.lproj/Localizable.strings @@ -28,11 +28,6 @@ "Sorry, the user rights can not be configured for that object." = "Sorry, the user rights can not be configured for that object."; -"browserNotCompatible" = "La version de votre navigateur Web n'est présentement pas supportée par ce site. Nous recommandons d'utiliser Firefox. Vous trouverez un lien vers la plus récente version de ce navigateur ci-dessous:"; -"alternativeBrowsers" = "Comme alternative, vous pouvez aussi utiliser les navigateurs suivants:"; -"alternativeBrowserSafari" = "Comme alternative, vous pouvez aussi utiliser Safari."; -"Download" = "Télécharger"; - /* generic.js */ "Unable to subscribe to that folder!" = "Impossible de s'abonner à ce dossier."; "You cannot subscribe to a folder that you own!" = "Impossible de vous abonner à un dossier qui vous appartient."; diff --git a/UI/Common/GNUmakefile b/UI/Common/GNUmakefile index e6952c123..ba34fa205 100644 --- a/UI/Common/GNUmakefile +++ b/UI/Common/GNUmakefile @@ -16,7 +16,6 @@ CommonUI_OBJC_FILES += \ UIxObjectActions.m \ UIxFolderActions.m \ UIxParentFolderActions.m \ - UIxElemBuilder.m \ UIxUserRightsEditor.m \ \ UIxToolbar.m \ diff --git a/UI/Common/Italian.lproj/Localizable.strings b/UI/Common/Italian.lproj/Localizable.strings index 0cf9869c5..67d74e0ce 100644 --- a/UI/Common/Italian.lproj/Localizable.strings +++ b/UI/Common/Italian.lproj/Localizable.strings @@ -26,10 +26,6 @@ "Publish the Free/Busy information" = "Pubblica le informazioni sullo stato (libero/impegnato)"; "Default Roles" = "Permessi predefiniti"; "Sorry, the user rights can not be configured for that object." = "Non è possibile configurare i permessi per questo oggetto."; -"browserNotCompatible" = "La versione del browser utilizzato non è supportata. Raccomandiamo l'utilizzo di Firefox. Clicca sul link per scaricarne l'ultima versione disponibile."; -"alternativeBrowsers" = "Alternativamente, puoi utilizzare questi browser compatibili"; -"alternativeBrowserSafari" = "Alternativamente, puoi utilizzare Safari."; -"Download" = "Scarica"; /* generic.js */ "Unable to subscribe to that folder!" = "Impossibile sottoscrivere la cartella!"; diff --git a/UI/Common/Spanish.lproj/Localizable.strings b/UI/Common/Spanish.lproj/Localizable.strings index 068143e62..48d10888d 100644 --- a/UI/Common/Spanish.lproj/Localizable.strings +++ b/UI/Common/Spanish.lproj/Localizable.strings @@ -30,11 +30,6 @@ "Sorry, the user rights can not be configured for that object." = "Sorry, the user rights can not be configured for that object."; -"browserNotCompatible" = "Hemos detectado que este sistema no soporta su versión del navegador. Recomendamos usar Firefox. Haga clic en el siguiente enlace para descargar la versión más reciente de este navegador."; -"alternativeBrowsers" = "Alternativamente, también puede usar uno se los siguientes navegadores compatibles: "; -"alternativeBrowserSafari" = "Alternativamente, puede usar Safari."; -"Download" = "Descarga"; - /* generic.js */ "Unable to subscribe to that folder!" = "No es posible suscribirse a esta carpeta."; diff --git a/UI/Common/UIxElemBuilder.m b/UI/Common/UIxElemBuilder.m deleted file mode 100644 index ba7dcfa62..000000000 --- a/UI/Common/UIxElemBuilder.m +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2000-2004 SKYRIX Software AG - - This file is part of OpenGroupware.org. - - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. -*/ -// $Id: UIxElemBuilder.m 30 2004-06-11 12:07:09Z znek $ - -#include - -/* - This builder builds various elements from the UI-X product. - - All tags are mapped into the namespace (XMLNS_OD_BIND). - - maps to UIxTabView - maps to UIxTabItem -*/ - -@interface UIxElemBuilder : WOxTagClassElemBuilder -{ -} - -@end - -#include -#include "common.h" - -#define XMLNS_UIX @"OGo:uix" - - -@implementation UIxElemBuilder - -- (Class)classForElement:(id)_element { - NSString *tagName; - unsigned tl; - unichar c1; - - if (![[_element namespaceURI] isEqualToString:XMLNS_UIX]) - return Nil; - - tagName = [_element tagName]; - if ((tl = [tagName length]) < 2) - return Nil; - - c1 = [tagName characterAtIndex:0]; - - switch (c1) { - case 't': { /* starting with 't' */ - unichar c2; - - c2 = [tagName characterAtIndex:1]; - - if (tl == 3 && c2 == 'a') { - if ([tagName characterAtIndex:2] == 'b') - return NSClassFromString(@"UIxTabItem"); - } - - if (tl > 5) { - if (c2 == 'a') { - if ([tagName isEqualToString:@"tabview"]) - return NSClassFromString(@"UIxTabView"); - } - } - break; - } - } - - return Nil; -} - -@end /* UIxElemBuilder */ diff --git a/UI/Common/UIxPageFrame.h b/UI/Common/UIxPageFrame.h index aeb378d1d..8545712c3 100644 --- a/UI/Common/UIxPageFrame.h +++ b/UI/Common/UIxPageFrame.h @@ -68,8 +68,6 @@ - (BOOL) isSuperUser; - (BOOL) isCompatibleBrowser; -- (BOOL) isIE7Compatible; -- (BOOL) isMac; @end diff --git a/UI/Common/UIxPageFrame.m b/UI/Common/UIxPageFrame.m index 723975420..bdf1a5f7c 100644 --- a/UI/Common/UIxPageFrame.m +++ b/UI/Common/UIxPageFrame.m @@ -19,15 +19,14 @@ 02111-1307, USA. */ -#import "common.h" -#import -#import +#import +#import + +#import #import #import -#import - #import
#import "UIxPageFrame.h" @@ -396,7 +395,7 @@ cc = [[context request] clientCapabilities]; //NSLog(@"Browser = %@", [cc description]); - NSLog(@"User agent = %@", [cc userAgent]); +// NSLog(@"User agent = %@", [cc userAgent]); //NSLog(@"Browser major version = %i", [cc majorVersion]); return (([[cc userAgentType] isEqualToString: @"IE"] @@ -409,24 +408,4 @@ ); } -- (BOOL) isIE7Compatible -{ - WEClientCapabilities *cc; - - cc = [[context request] clientCapabilities]; - - return ([cc isWindowsBrowser] && - ([[cc userAgent] rangeOfString: @"NT 5.1"].location != NSNotFound || - [[cc userAgent] rangeOfString: @"NT 6"].location != NSNotFound)); -} - -- (BOOL) isMac -{ - WEClientCapabilities *cc; - - cc = [[context request] clientCapabilities]; - - return [cc isMacBrowser]; -} - @end /* UIxPageFrame */ diff --git a/UI/Common/common.h b/UI/Common/common.h deleted file mode 100644 index 84e6333dc..000000000 --- a/UI/Common/common.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - Copyright (C) 2004 SKYRIX Software AG - - This file is part of OpenGroupware.org. - - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. -*/ - -#import -#import - -#import -#import -#import -#import -#import -#import -#import -#import - -@interface WOContext(WOExtensionsPrivate) -- (void)addActiveFormElement:(WOElement *)_element; -@end - -static inline id WOExtGetProperty(NSDictionary *_set, NSString *_name) { - id propValue = [_set objectForKey:_name]; - - if (propValue) { - propValue = [propValue retain]; - [(NSMutableDictionary *)_set removeObjectForKey:_name]; - } - return propValue; -} - -static inline NSString *WEUriOfResource(NSString *_name, WOContext *_ctx) { - NSArray *languages; - WOResourceManager *resourceManager; - NSString *uri; - - if (_name == nil) - return nil; - - languages = [_ctx hasSession] - ? [[_ctx session] languages] - : [[_ctx request] browserLanguages]; - - resourceManager = [[_ctx application] resourceManager]; - - uri = [resourceManager urlForResourceNamed:_name - inFramework:nil - languages:languages - request:[_ctx request]]; - if ([uri rangeOfString:@"/missingresource?"].length > 0) - uri = nil; - - return uri; -} - -static inline void WEAppendFont(WOResponse *_resp, - NSString *_color, - NSString *_face, - NSString *_size) -{ - [_resp appendContentString:@"']; -} - -static inline void WEAppendTD(WOResponse *_resp, - NSString *_align, - NSString *_valign, - NSString *_bgColor) -{ - [_resp appendContentString:@"']; -} - -static inline WOElement *WECreateElement(NSString *_className, - NSString *_name, - NSDictionary *_config, - WOElement *_template) -{ - Class c; - WOElement *result = nil; - NSMutableDictionary *config = nil; - - if ((c = NSClassFromString(_className)) == Nil) { - NSLog(@"%s: missing '%@' class", __PRETTY_FUNCTION__, _className); - return nil; - } - config = [NSMutableDictionary dictionaryWithCapacity:4]; - { - NSEnumerator *keyEnum; - id key; - - keyEnum = [_config keyEnumerator]; - - while ((key = [keyEnum nextObject])) { - WOAssociation *a; - - a = [WOAssociation associationWithValue:[_config objectForKey:key]]; - [config setObject:a forKey:key]; - } - } - result = [[c alloc] initWithName:_name - associations:config - template:_template]; - return [result autorelease]; -} - -#define OWGetProperty WOExtGetProperty diff --git a/UI/MainUI/English.lproj/Localizable.strings b/UI/MainUI/English.lproj/Localizable.strings index 534d91a00..a23fb2ba0 100644 --- a/UI/MainUI/English.lproj/Localizable.strings +++ b/UI/MainUI/English.lproj/Localizable.strings @@ -7,4 +7,9 @@ "Connect" = "Connect"; -"Wrong username or password." = "Wrong username or password."; \ No newline at end of file +"Wrong username or password." = "Wrong username or password."; + +"browserNotCompatible" = "We've detected that your browser version is currently not supported on this site. Our recommendation is to use Firefox. Click on the link bellow to download the most current version of this browser."; +"alternativeBrowsers" = "Alternatively, you can also use the following compatible browsers"; +"alternativeBrowserSafari" = "Alternatively, you can also use Safari."; +"Download" = "Download"; diff --git a/UI/MainUI/French.lproj/Localizable.strings b/UI/MainUI/French.lproj/Localizable.strings index b22b0c9e3..1af6e3eb1 100644 --- a/UI/MainUI/French.lproj/Localizable.strings +++ b/UI/MainUI/French.lproj/Localizable.strings @@ -7,4 +7,9 @@ "Connect" = "Connexion"; -"Wrong username or password." = "Mauvais nom d'utilisateur ou mot de passe."; \ No newline at end of file +"Wrong username or password." = "Mauvais nom d'utilisateur ou mot de passe."; + +"browserNotCompatible" = "La version de votre navigateur Web n'est présentement pas supportée par ce site. Nous recommandons d'utiliser Firefox. Vous trouverez un lien vers la plus récente version de ce navigateur ci-dessous:"; +"alternativeBrowsers" = "Comme alternative, vous pouvez aussi utiliser les navigateurs suivants:"; +"alternativeBrowserSafari" = "Comme alternative, vous pouvez aussi utiliser Safari."; +"Download" = "Télécharger"; diff --git a/UI/MainUI/GNUmakefile b/UI/MainUI/GNUmakefile index 2a0a01af7..fb750ee1a 100644 --- a/UI/MainUI/GNUmakefile +++ b/UI/MainUI/GNUmakefile @@ -11,7 +11,8 @@ MainUI_LANGUAGES = Dutch English French German Italian Spanish MainUI_OBJC_FILES += \ MainUIProduct.m \ SOGoRootPage.m \ - SOGoUserHomePage.m + SOGoUserHomePage.m \ + SOGoBrowsersPanel.m \ # SOGoGroupPage.m \ # SOGoGroupsPage.m \ diff --git a/UI/MainUI/Italian.lproj/Localizable.strings b/UI/MainUI/Italian.lproj/Localizable.strings index 0fbd90cf2..a4f717445 100644 --- a/UI/MainUI/Italian.lproj/Localizable.strings +++ b/UI/MainUI/Italian.lproj/Localizable.strings @@ -8,3 +8,8 @@ "Connect" = "Entra"; "Wrong username or password." = "Username o password non corretti."; + +"browserNotCompatible" = "La versione del browser utilizzato non è supportata. Raccomandiamo l'utilizzo di Firefox. Clicca sul link per scaricarne l'ultima versione disponibile."; +"alternativeBrowsers" = "Alternativamente, puoi utilizzare questi browser compatibili"; +"alternativeBrowserSafari" = "Alternativamente, puoi utilizzare Safari."; +"Download" = "Scarica"; diff --git a/UI/MainUI/SOGoBrowsersPanel.h b/UI/MainUI/SOGoBrowsersPanel.h new file mode 100644 index 000000000..47e71c2f7 --- /dev/null +++ b/UI/MainUI/SOGoBrowsersPanel.h @@ -0,0 +1,30 @@ +/* SOGoBrowsersPanel.h - this file is part of SOGo + * + * Copyright (C) 2008 Inverse + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +@interface SOGoBrowsersPanel : UIxComponent + +- (BOOL) isIE7Compatible; +- (BOOL) isMac; + +@end diff --git a/UI/MainUI/SOGoBrowsersPanel.m b/UI/MainUI/SOGoBrowsersPanel.m new file mode 100644 index 000000000..a5285a6fd --- /dev/null +++ b/UI/MainUI/SOGoBrowsersPanel.m @@ -0,0 +1,51 @@ +/* SOGoBrowsersPanel.m - this file is part of SOGo + * + * Copyright (C) 2008 Inverse + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import +#import +#import + +#import "SOGoBrowsersPanel.h" + +@implementation SOGoBrowsersPanel + +- (BOOL) isIE7Compatible +{ + WEClientCapabilities *cc; + + cc = [[context request] clientCapabilities]; + + return ([cc isWindowsBrowser] && + ([[cc userAgent] rangeOfString: @"NT 5.1"].location != NSNotFound || + [[cc userAgent] rangeOfString: @"NT 6"].location != NSNotFound)); +} + +- (BOOL) isMac +{ + WEClientCapabilities *cc; + + cc = [[context request] clientCapabilities]; + + return [cc isMacBrowser]; +} + +@end diff --git a/UI/MainUI/Spanish.lproj/Localizable.strings b/UI/MainUI/Spanish.lproj/Localizable.strings index 88a4e47e5..5d37a3d5c 100644 --- a/UI/MainUI/Spanish.lproj/Localizable.strings +++ b/UI/MainUI/Spanish.lproj/Localizable.strings @@ -11,3 +11,8 @@ "Connect" = "Conectar"; "Wrong username or password." = "Nombre de usuario o contraseña incorrectos."; + +"browserNotCompatible" = "Hemos detectado que este sistema no soporta su versión del navegador. Recomendamos usar Firefox. Haga clic en el siguiente enlace para descargar la versión más reciente de este navegador."; +"alternativeBrowsers" = "Alternativamente, también puede usar uno se los siguientes navegadores compatibles: "; +"alternativeBrowserSafari" = "Alternativamente, puede usar Safari."; +"Download" = "Descarga"; diff --git a/UI/Templates/MainUI/SOGoBrowsersPanel.wox b/UI/Templates/MainUI/SOGoBrowsersPanel.wox new file mode 100644 index 000000000..49d7a3f67 --- /dev/null +++ b/UI/Templates/MainUI/SOGoBrowsersPanel.wox @@ -0,0 +1,24 @@ + + + + + diff --git a/UI/Templates/UIxPageFrame.wox b/UI/Templates/UIxPageFrame.wox index 073110b73..345176b90 100644 --- a/UI/Templates/UIxPageFrame.wox +++ b/UI/Templates/UIxPageFrame.wox @@ -141,22 +141,9 @@ - - - +