From 5bf5794ef275983b8cffae71cf2d5acc7e5b78fc Mon Sep 17 00:00:00 2001 From: znek Date: Wed, 13 Oct 2004 01:33:00 +0000 Subject: [PATCH] Anais/Addressbook integration git-svn-id: http://svn.opengroupware.org/SOGo/trunk@391 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/Mailer/ChangeLog | 12 ++++ SOGo/UI/Mailer/English.lproj/default.strings | 3 + SOGo/UI/Mailer/GNUmakefile | 2 + SOGo/UI/Mailer/UIxMailAddressbook.m | 64 ++++++++++++++++++++ SOGo/UI/Mailer/UIxMailAddressbook.wox | 15 +++++ SOGo/UI/Mailer/UIxMailToSelection.m | 11 ---- SOGo/UI/Mailer/mailer.js | 24 ++++++++ SOGo/UI/Mailer/product.plist | 54 ++++++++++------- 8 files changed, 151 insertions(+), 34 deletions(-) create mode 100644 SOGo/UI/Mailer/UIxMailAddressbook.m create mode 100644 SOGo/UI/Mailer/UIxMailAddressbook.wox diff --git a/SOGo/UI/Mailer/ChangeLog b/SOGo/UI/Mailer/ChangeLog index c0ef4db5..6cba983a 100644 --- a/SOGo/UI/Mailer/ChangeLog +++ b/SOGo/UI/Mailer/ChangeLog @@ -1,3 +1,15 @@ +2004-10-13 Marcus Mueller + + * v0.9.38 + + * UIxMailToSelection.[wox|m]: removed superfluous debug messages + + * UIxMailAdressbook.[wox|m]: redirect cover for Addressbook and Anais + + * mailer.js: new JavaScript to open Addressbook and Anais windows + + * product.plist: added Addressbook/Anais entries + 2004-10-12 Marcus Mueller * v0.9.37 diff --git a/SOGo/UI/Mailer/English.lproj/default.strings b/SOGo/UI/Mailer/English.lproj/default.strings index 953dd592..d3ed4dc3 100644 --- a/SOGo/UI/Mailer/English.lproj/default.strings +++ b/SOGo/UI/Mailer/English.lproj/default.strings @@ -7,3 +7,6 @@ "to" = "To"; "cc" = "Cc"; "bcc" = "Bcc"; + +"Addressbook" = "Addressbook"; +"Anais" = "Anais"; diff --git a/SOGo/UI/Mailer/GNUmakefile b/SOGo/UI/Mailer/GNUmakefile index bc230ba3..e41a60da 100644 --- a/SOGo/UI/Mailer/GNUmakefile +++ b/SOGo/UI/Mailer/GNUmakefile @@ -29,6 +29,7 @@ MailerUI_OBJC_FILES += \ UIxMailEditor.m \ UIxMailEditorAction.m \ UIxMailToSelection.m \ + UIxMailAddressbook.m \ \ UIxMailPartViewer.m \ UIxMailPartTextViewer.m \ @@ -52,6 +53,7 @@ MailerUI_RESOURCE_FILES += \ \ UIxMailEditor.wox \ UIxMailToSelection.wox \ + UIxMailAddressbook.wox \ \ UIxMailPartTextViewer.wox \ UIxMailPartMixedViewer.wox \ diff --git a/SOGo/UI/Mailer/UIxMailAddressbook.m b/SOGo/UI/Mailer/UIxMailAddressbook.m new file mode 100644 index 00000000..0783e320 --- /dev/null +++ b/SOGo/UI/Mailer/UIxMailAddressbook.m @@ -0,0 +1,64 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + 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$ + + +#include + + +@interface UIxMailAddressbook : UIxComponent +{ + +} + +- (NSString *)contactsPath; +- (NSString *)anaisPath; + +@end + +#include "common.h" + +@implementation UIxMailAddressbook + +- (NSString *)contactsPath { + return [[self userFolderPath] + stringByAppendingPathComponent:@"Contacts/select"]; +} + +- (NSString *)anaisPath { + return @"/anais/aideAnais.php"; +} + +- (id)defaultAction { + NSString *path = [self contactsPath]; + path = [path stringByAppendingString:@"?callback=addAddress"]; + return [self redirectToLocation:path]; +} + +- (id)anaisAction { + NSString *path, *param; + + param = @"?m_fonc=addAddress&m_champ=mail,uid,sn#mon_etiquette"; + path = [[self anaisPath] stringByAppendingString:param]; + return [self redirectToLocation:path]; +} + +@end diff --git a/SOGo/UI/Mailer/UIxMailAddressbook.wox b/SOGo/UI/Mailer/UIxMailAddressbook.wox new file mode 100644 index 00000000..48ca0086 --- /dev/null +++ b/SOGo/UI/Mailer/UIxMailAddressbook.wox @@ -0,0 +1,15 @@ + + + + + <var:string value="name"/> + + + + The template of Web Component has not been edited, yet. + + \ No newline at end of file diff --git a/SOGo/UI/Mailer/UIxMailToSelection.m b/SOGo/UI/Mailer/UIxMailToSelection.m index 41df6cd8..046887c0 100644 --- a/SOGo/UI/Mailer/UIxMailToSelection.m +++ b/SOGo/UI/Mailer/UIxMailToSelection.m @@ -103,17 +103,6 @@ static NSArray *headers = nil; [super dealloc]; } -/* notifications */ - -- (void)awake { - [super awake]; - NSLog(@"%s", __PRETTY_FUNCTION__); -} - -- (void)sleep { - [super sleep]; -} - /* accessors */ - (void)setTo:(NSArray *)_to { diff --git a/SOGo/UI/Mailer/mailer.js b/SOGo/UI/Mailer/mailer.js index 52a5807c..4b2fc1d1 100644 --- a/SOGo/UI/Mailer/mailer.js +++ b/SOGo/UI/Mailer/mailer.js @@ -79,3 +79,27 @@ function clickedEditorSave(sender) { document.pageform.submit(); return true; } + +/* addressbook helpers */ + +function openAnais(sender) { + var urlstr; + + urlstr = "anais"; + var w = window.open(urlstr, "Anais", + "width=350,height=600,left=10,top=10,toolbar=no," + + "dependent=yes,menubar=no,location=no,resizable=yes," + + "scrollbars=yes,directories=no,status=no"); + w.focus(); +} + +function openAddressbook(sender) { + var urlstr; + + urlstr = "addressbook"; + var w = window.open(urlstr, "Addressbook", + "width=600,height=400,left=10,top=10,toolbar=no," + + "dependent=yes,menubar=no,location=no,resizable=yes," + + "scrollbars=yes,directories=no,status=no"); + w.focus(); +} diff --git a/SOGo/UI/Mailer/product.plist b/SOGo/UI/Mailer/product.plist index 3bba8b1e..69950b48 100644 --- a/SOGo/UI/Mailer/product.plist +++ b/SOGo/UI/Mailer/product.plist @@ -81,10 +81,6 @@ onclick = "clickedCompose(this);return false;"; cssClass = "tbicon_compose"; label = "Write"; }, - { - link = "addressbook"; target = "addressbook"; - cssClass = "tbicon_addressbook"; label = "Addressbook"; - } ), ( /* second group */ { link = "#"; @@ -135,7 +131,7 @@ compose = { protectedBy = "View"; actionClass = "UIxMailEditorAction"; - actionName = "compose"; + actionName = "compose"; }; }; }; @@ -150,8 +146,6 @@ cssClass = "tbicon_getmail"; label = "Get Mail"; }, { link = "compose"; target = "_blank"; cssClass = "tbicon_compose"; label = "Write"; }, - { link = "addressbook"; target = "addressbook"; - cssClass = "tbicon_addressbook"; label = "Addressbook"; } ), ( /* second group */ { link = "reply"; @@ -200,26 +194,25 @@ protectedBy = "View"; pageName = "UIxMailEditor"; }; - compose = { protectedBy = "View"; actionClass = "UIxMailEditorAction"; - actionName = "compose"; + actionName = "compose"; }; reply = { protectedBy = "View"; actionClass = "UIxMailEditorAction"; - actionName = "reply"; + actionName = "reply"; }; replyall = { protectedBy = "View"; actionClass = "UIxMailEditorAction"; - actionName = "replyall"; + actionName = "replyall"; }; forward = { protectedBy = "View"; actionClass = "UIxMailEditorAction"; - actionName = "forward"; + actionName = "forward"; }; }; }; @@ -232,8 +225,6 @@ ( /* first group */ { link = "getMail"; cssClass = "tbicon_getmail"; label = "Get Mail"; }, - { link = "addressbook"; target = "addressbook"; - cssClass = "tbicon_addressbook"; label = "Addressbook"; } ) ); }; @@ -254,8 +245,6 @@ ( /* first group */ { link = "getMail"; cssClass = "tbicon_getmail"; label = "Get Mail"; }, - { link = "addressbook"; target = "addressbook"; - cssClass = "tbicon_addressbook"; label = "Addressbook"; } ) ); }; @@ -265,6 +254,15 @@ protectedBy = "View"; pageName = "UIxMailAccountView"; }; + addressbook = { + protectedBy = "View"; + pageName = "UIxMailAddressbook"; + }; + anais = { + protectedBy = "View"; + pageName = "UIxMailAddressbook"; + actionName = "anais"; + }; }; }; @@ -279,10 +277,7 @@ { link = "#"; // "compose"; // target = "_blank"; onclick = "clickedCompose(this);return false;"; - cssClass = "tbicon_compose"; label = "Write"; - }, - { link = "addressbook"; target = "addressbook"; - cssClass = "tbicon_addressbook"; label = "Addressbook"; }, + cssClass = "tbicon_compose"; label = "Write"; }, ) ); }; @@ -295,7 +290,7 @@ compose = { protectedBy = "View"; actionClass = "UIxMailEditorAction"; - actionName = "compose"; + actionName = "compose"; }; }; }; @@ -309,8 +304,12 @@ { link = "#"; onclick = "clickedEditorSend(this);return false;"; cssClass = "tbicon_send"; label = "Send"; }, - { link = "contacts"; target = "addressbook"; - cssClass = "tbicon_addressbook"; label = "Contacts"; }, + { link = "#"; target = "addressbook"; + onclick = "openAddressbook(this);return false;"; + cssClass = "tbicon_addressbook"; label = "Addressbook"; }, + { link = "#"; target = "anais"; + onclick = "openAnais(this);return false;"; + cssClass = "tbicon_addressbook"; label = "Anais"; }, { link = "#"; onclick = "clickedEditorAttach(this);return false;"; cssClass = "tbicon_attach"; label = "Attach"; }, @@ -330,6 +329,15 @@ protectedBy = "View"; pageName = "UIxMailEditor"; }; + addressbook = { + protectedBy = "View"; + pageName = "UIxMailAddressbook"; + }; + anais = { + protectedBy = "View"; + pageName = "UIxMailAddressbook"; + actionName = "anais"; + }; }; }; }; -- 2.39.5