From e94cbe1e0e04f6c319c35653fd409dbb2521073a Mon Sep 17 00:00:00 2001 From: znek Date: Mon, 13 Sep 2004 17:42:03 +0000 Subject: [PATCH] private address book selection analoguous to Anais git-svn-id: http://svn.opengroupware.org/SOGo/trunk@304 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SOGo.xcode/project.pbxproj | 48 +++++ SOGo/UI/Anais/AnaisAttendeeSelector.m | 25 ++- SOGo/UI/Anais/AnaisAttendeeSelector.wox | 6 + SOGo/UI/Anais/ChangeLog | 10 ++ SOGo/UI/Anais/English.lproj/default.strings | 2 + SOGo/UI/Anais/French.lproj/default.strings | 2 + SOGo/UI/Anais/Version | 2 +- SOGo/UI/Contacts/ChangeLog | 15 ++ SOGo/UI/Contacts/GNUmakefile | 4 + SOGo/UI/Contacts/UIxContactSelector.m | 113 ++++++++++++ SOGo/UI/Contacts/UIxContactSelector.wox | 14 ++ SOGo/UI/Contacts/UIxContactsListView.h | 34 ++++ SOGo/UI/Contacts/UIxContactsListView.m | 13 +- SOGo/UI/Contacts/UIxContactsSelectionView.m | 65 +++++++ SOGo/UI/Contacts/UIxContactsSelectionView.wox | 164 ++++++++++++++++++ SOGo/UI/Contacts/Version | 2 +- SOGo/UI/Contacts/product.plist | 4 + SOGo/UI/Scheduler/ChangeLog | 4 + .../Scheduler/English.lproj/default.strings | 2 +- SOGo/UI/Scheduler/UIxAppointmentEditor.wox | 23 +-- SOGo/UI/Scheduler/Version | 2 +- 21 files changed, 519 insertions(+), 35 deletions(-) create mode 100644 SOGo/UI/Contacts/UIxContactSelector.m create mode 100644 SOGo/UI/Contacts/UIxContactSelector.wox create mode 100644 SOGo/UI/Contacts/UIxContactsListView.h create mode 100644 SOGo/UI/Contacts/UIxContactsSelectionView.m create mode 100644 SOGo/UI/Contacts/UIxContactsSelectionView.wox diff --git a/SOGo/SOGo.xcode/project.pbxproj b/SOGo/SOGo.xcode/project.pbxproj index 23163eb4..7607695a 100644 --- a/SOGo/SOGo.xcode/project.pbxproj +++ b/SOGo/SOGo.xcode/project.pbxproj @@ -614,6 +614,49 @@ tabWidth = 8; usesTabs = 1; }; + AD494C6106F5EA6600E51EC9 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text.xml; + path = UIxContactSelector.wox; + refType = 4; + sourceTree = ""; + }; + AD494C6206F5EA6600E51EC9 = { + fileEncoding = 4; + indentWidth = 2; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = UIxContactSelector.m; + refType = 4; + sourceTree = ""; + }; + AD494C8D06F606F900E51EC9 = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text.xml; + path = UIxContactsSelectionView.wox; + refType = 4; + sourceTree = ""; + }; + AD494C8E06F606F900E51EC9 = { + fileEncoding = 4; + indentWidth = 2; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = UIxContactsSelectionView.m; + refType = 4; + sourceTree = ""; + }; + AD494C9006F6072C00E51EC9 = { + fileEncoding = 4; + indentWidth = 2; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = UIxContactsListView.h; + refType = 4; + sourceTree = ""; + }; AD5ED0AF06B1385700E3EC4B = { fileEncoding = 4; isa = PBXFileReference; @@ -1233,12 +1276,17 @@ }; ADDF4B6D06DCEBB400C4E7F8 = { children = ( + AD494C9006F6072C00E51EC9, ADDF4B7006DCEC4300C4E7F8, ADDF4B6F06DCEC4300C4E7F8, + AD494C8E06F606F900E51EC9, + AD494C8D06F606F900E51EC9, ADDF4B7306DCEC5200C4E7F8, ADDF4B7206DCEC5200C4E7F8, ADDF4B7606DCEC5F00C4E7F8, ADDF4B7506DCEC5F00C4E7F8, + AD494C6206F5EA6600E51EC9, + AD494C6106F5EA6600E51EC9, ); isa = PBXGroup; name = Components; diff --git a/SOGo/UI/Anais/AnaisAttendeeSelector.m b/SOGo/UI/Anais/AnaisAttendeeSelector.m index dc7e2bcd..aa3d08a9 100644 --- a/SOGo/UI/Anais/AnaisAttendeeSelector.m +++ b/SOGo/UI/Anais/AnaisAttendeeSelector.m @@ -28,13 +28,14 @@ Select a set of attendees using Anais. Bindings: - attendees - array of iCalPerson objects - selectorID - string to be used as the identifier for form/JS elements - withCN - show CN of person (eg disabled for resources) - division - Anais division - emailForUser - default EMail - cnForUser - default CN - role - role for submitted attendees + attendees - array of iCalPerson objects + selectorID - string to be used as the identifier for form/JS elements + withCN - show CN of person (eg disabled for resources) + withAddressBook - allow selection from private address book (default:NO) + division - Anais division + emailForUser - default EMail + cnForUser - default CN + role - role for submitted attendees Sample: flags.withCN ? YES : NO; } +- (void)setWithAddressBook:(BOOL)_flag { + self->flags.withAddressBook = _flag ? 1 : 0; +} +- (BOOL)withAddressBook { + return self->flags.withAddressBook ? YES : NO; +} + - (void)setAttendee:(iCalPerson *)_attendee { ASSIGN(self->attendee, _attendee); } diff --git a/SOGo/UI/Anais/AnaisAttendeeSelector.wox b/SOGo/UI/Anais/AnaisAttendeeSelector.wox index 37e73dae..893390ee 100644 --- a/SOGo/UI/Anais/AnaisAttendeeSelector.wox +++ b/SOGo/UI/Anais/AnaisAttendeeSelector.wox @@ -15,6 +15,12 @@ var:windowId="windowId" var:division="division" var:callback="callbackName" /> + + +
diff --git a/SOGo/UI/Anais/ChangeLog b/SOGo/UI/Anais/ChangeLog index 38840aa5..b27155ae 100644 --- a/SOGo/UI/Anais/ChangeLog +++ b/SOGo/UI/Anais/ChangeLog @@ -1,3 +1,13 @@ +2004-09-13 Marcus Mueller + + * v0.9.13 + + * AnaisAttendeeSelector.[m|wox]: new binding "withAddressBook", if + YES will add a button to open the private addressbook. Default is + NO. + + * {English|French}.lproj/default.strings: new localizable string + 2004-09-10 Marcus Mueller * AnaisSelector.wox, AnaisUidSelector.wox: use the new button_submit diff --git a/SOGo/UI/Anais/English.lproj/default.strings b/SOGo/UI/Anais/English.lproj/default.strings index 72e0c763..8d0755ee 100644 --- a/SOGo/UI/Anais/English.lproj/default.strings +++ b/SOGo/UI/Anais/English.lproj/default.strings @@ -4,6 +4,8 @@ // open Anais dialog "Search in Anais" = "Search in Anaïs"; +// open private Addressbook +"Search in Addressbook" = "Search in Addressbook"; // add myself to the list of uids to display "me too" = "me too"; // clear the list of uids diff --git a/SOGo/UI/Anais/French.lproj/default.strings b/SOGo/UI/Anais/French.lproj/default.strings index 72e0c763..8d0755ee 100644 --- a/SOGo/UI/Anais/French.lproj/default.strings +++ b/SOGo/UI/Anais/French.lproj/default.strings @@ -4,6 +4,8 @@ // open Anais dialog "Search in Anais" = "Search in Anaïs"; +// open private Addressbook +"Search in Addressbook" = "Search in Addressbook"; // add myself to the list of uids to display "me too" = "me too"; // clear the list of uids diff --git a/SOGo/UI/Anais/Version b/SOGo/UI/Anais/Version index f7b76545..3228956b 100644 --- a/SOGo/UI/Anais/Version +++ b/SOGo/UI/Anais/Version @@ -1,3 +1,3 @@ # $Id: Version 165 2004-08-05 17:55:50Z znek $ -SUBMINOR_VERSION:=12 +SUBMINOR_VERSION:=13 diff --git a/SOGo/UI/Contacts/ChangeLog b/SOGo/UI/Contacts/ChangeLog index 4efe63f0..cac29e12 100644 --- a/SOGo/UI/Contacts/ChangeLog +++ b/SOGo/UI/Contacts/ChangeLog @@ -1,3 +1,18 @@ +2004-09-13 Marcus Mueller + + * v0.9.10 + + * UIxContactsListView.h: new header for subclassers + + * UIxContactsSelectionView.[m|wox]: new subclass of UIxContactsListView + which is basically the same only in its own window frame to mimic + the appearance of Anais. + + * UIxContactSelector.[m|wox]: component for opening + UIxContactsSelectionView in a separate window + + * product.plist: new method "select" + 2004-09-03 Marcus Mueller * UIxContactView.wox: added some more properties for display (v0.9.9) diff --git a/SOGo/UI/Contacts/GNUmakefile b/SOGo/UI/Contacts/GNUmakefile index 106cbdb5..b405c824 100644 --- a/SOGo/UI/Contacts/GNUmakefile +++ b/SOGo/UI/Contacts/GNUmakefile @@ -14,8 +14,10 @@ ContactsUI_OBJC_FILES = \ ContactsUIProduct.m \ \ UIxContactsListView.m \ + UIxContactsSelectionView.m \ UIxContactView.m \ UIxContactEditor.m \ + UIxContactSelector.m \ ContactsUI_RESOURCE_FILES += \ Version \ @@ -23,8 +25,10 @@ ContactsUI_RESOURCE_FILES += \ ContactsUI_RESOURCE_FILES += \ UIxContactsListView.wox \ + UIxContactsSelectionView.wox \ UIxContactView.wox \ UIxContactEditor.wox \ + UIxContactSelector.wox \ ContactsUI_LOCALIZED_RESOURCE_FILES += \ default.strings \ diff --git a/SOGo/UI/Contacts/UIxContactSelector.m b/SOGo/UI/Contacts/UIxContactSelector.m new file mode 100644 index 00000000..32434cbb --- /dev/null +++ b/SOGo/UI/Contacts/UIxContactSelector.m @@ -0,0 +1,113 @@ +/* + 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 UIxContactSelector : UIxComponent +{ + NSString *title; + NSString *windowId; + NSString *callback; +} + +- (void)setTitle:(NSString *)_title; +- (NSString *)title; +- (void)setWindowId:(NSString *)_winId; +- (NSString *)windowId; +- (void)setCallback:(NSString *)_callback; +- (NSString *)callback; + +- (NSString *)jsFunctionName; +- (NSString *)jsFunctionHref; +- (NSString *)jsCode; +@end + +#include "common.h" + +@implementation UIxContactSelector + +- (id)init { + if ((self = [super init])) { + [self setTitle:@"UIxContacts"]; + [self setWindowId:@"UIxContacts"]; + [self setCallback:@"undefined"]; + } + return self; +} + +- (void)dealloc { + [self->title release]; + [self->windowId release]; + [self->callback release]; + [super dealloc]; +} + +/* accessors */ + +- (void)setTitle:(NSString *)_title { + ASSIGNCOPY(self->title, _title); +} +- (NSString *)title { + return self->title; +} + +- (void)setWindowId:(NSString *)_winId { + ASSIGNCOPY(self->windowId, _winId); +} +- (NSString *)windowId { + return self->windowId; +} + +- (void)setCallback:(NSString *)_callback { + ASSIGNCOPY(self->callback, _callback); +} +- (NSString *)callback { + return self->callback; +} + +/* JavaScript */ + +- (NSString *)jsFunctionName { + return [NSString stringWithFormat:@"openUIxContactsListViewWindowWithId%@", + [self windowId]]; +} + +- (NSString *)jsFunctionHref { + return [NSString stringWithFormat:@"javascript:%@()", + [self jsFunctionName]]; +} + +- (NSString *)jsCode { + static NSString *codeFmt = \ + @"function %@() {\n" + @" var url = '../../Contacts/select?callback=%@';\n" + @" var contactsWindow = window.open(url, '%@', 'width=420, height=400, left=10, top=10, toolbar=no, dependent=yes, menubar=no, location=no, resizable=yes, scrollbars=yes, directories=no, status=no');\n" + @" contactsWindow.focus();\n" + @"}"; + return [NSString stringWithFormat:codeFmt, + [self jsFunctionName], + [self callback], + [self windowId]]; +} + +@end /* UIxContactSelector */ diff --git a/SOGo/UI/Contacts/UIxContactSelector.wox b/SOGo/UI/Contacts/UIxContactSelector.wox new file mode 100644 index 00000000..eff319ad --- /dev/null +++ b/SOGo/UI/Contacts/UIxContactSelector.wox @@ -0,0 +1,14 @@ + + + + + diff --git a/SOGo/UI/Contacts/UIxContactsListView.h b/SOGo/UI/Contacts/UIxContactsListView.h new file mode 100644 index 00000000..e848363b --- /dev/null +++ b/SOGo/UI/Contacts/UIxContactsListView.h @@ -0,0 +1,34 @@ +/* + 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. + */ +// $Id$ + + +#include + +@interface UIxContactsListView : UIxComponent +{ + NSArray *allRecords; + NSArray *filteredRecords; + NSString *searchText; + id contact; +} + +@end diff --git a/SOGo/UI/Contacts/UIxContactsListView.m b/SOGo/UI/Contacts/UIxContactsListView.m index 73195e53..1fdccbf2 100644 --- a/SOGo/UI/Contacts/UIxContactsListView.m +++ b/SOGo/UI/Contacts/UIxContactsListView.m @@ -21,18 +21,7 @@ // $Id$ -#include - -@interface UIxContactsListView : UIxComponent -{ - NSArray *allRecords; - NSArray *filteredRecords; - NSString *searchText; - id contact; -} - -@end - +#include "UIxContactsListView.h" #include #include "common.h" diff --git a/SOGo/UI/Contacts/UIxContactsSelectionView.m b/SOGo/UI/Contacts/UIxContactsSelectionView.m new file mode 100644 index 00000000..6525bf41 --- /dev/null +++ b/SOGo/UI/Contacts/UIxContactsSelectionView.m @@ -0,0 +1,65 @@ +/* + 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 "UIxContactsListView.h" + + +@interface UIxContactsSelectionView : UIxContactsListView +{ + NSString *callback; +} +@end + +#include "common.h" + +@implementation UIxContactsSelectionView + +- (void)dealloc { + [self->callback release]; + [super dealloc]; +} + +- (NSString *)callback { + if(!self->callback) { + WORequest *r = [[self context] request]; + self->callback = [[r formValueForKey:@"callback"] retain]; + } + return self->callback; +} + +- (NSString *)jsOnClickCode { + static NSString *jsCode = @"javascript:opener.window.%@" \ + @"('', '%@', '', '%@', '', '');"; + NSString *cn; + + cn = [NSString stringWithFormat:@"%@ %@", + [self->contact valueForKey:@"sn"], + [self->contact valueForKey:@"givenname"]]; + + return [NSString stringWithFormat:jsCode, + [self callback], + cn, + [self->contact valueForKey:@"mail"]]; +} + +@end /* UIxContactsInlineListView */ diff --git a/SOGo/UI/Contacts/UIxContactsSelectionView.wox b/SOGo/UI/Contacts/UIxContactsSelectionView.wox new file mode 100644 index 00000000..b33b194d --- /dev/null +++ b/SOGo/UI/Contacts/UIxContactsSelectionView.wox @@ -0,0 +1,164 @@ + + + + + <var:string label:value="Addressbook"/> + + + + + + + + + + +
+ + + + + + +
+ + + + + +
+ + + + + +
+
+
+ + + + + + + + + + + + +
+ + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+ + +
+
+
+
+ +
+ clientObject: +
+ + \ No newline at end of file diff --git a/SOGo/UI/Contacts/Version b/SOGo/UI/Contacts/Version index 81be7eb6..317960a7 100644 --- a/SOGo/UI/Contacts/Version +++ b/SOGo/UI/Contacts/Version @@ -1,3 +1,3 @@ # $Id$ -SUBMINOR_VERSION:=9 +SUBMINOR_VERSION:=10 diff --git a/SOGo/UI/Contacts/product.plist b/SOGo/UI/Contacts/product.plist index bc87e563..6da687a4 100644 --- a/SOGo/UI/Contacts/product.plist +++ b/SOGo/UI/Contacts/product.plist @@ -19,6 +19,10 @@ pageName = "UIxContactEditor"; actionName = "new"; }; + select = { + protectedBy = "View"; + pageName = "UIxContactsSelectionView"; + }; }; }; diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index ac56c301..cfb9831d 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,7 @@ +2004-09-13 Marcus Mueller + + * English.lproj/default.strings: fixed a missing ';' (v0.9.82) + 2004-09-10 Marcus Mueller * v0.9.81 diff --git a/SOGo/UI/Scheduler/English.lproj/default.strings b/SOGo/UI/Scheduler/English.lproj/default.strings index b2a4d87d..3645ee90 100644 --- a/SOGo/UI/Scheduler/English.lproj/default.strings +++ b/SOGo/UI/Scheduler/English.lproj/default.strings @@ -67,7 +67,7 @@ /* Misc */ -"OpenGroupware.org" = "OpenGroupware.org" +"OpenGroupware.org" = "OpenGroupware.org"; /* Button titles */ diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox index 5dbfe13f..1a86a1bc 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox @@ -123,13 +123,14 @@ @@ -158,10 +159,10 @@ diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index afc51fb5..2fbc143c 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,6 +1,6 @@ # $Id$ -SUBMINOR_VERSION:=81 +SUBMINOR_VERSION:=82 # v0.9.70 requires libNGExtensions v4.3.107 # v0.9.67 requires SOPE 4.3 -- 2.39.2