From: znek Date: Tue, 14 Sep 2004 15:12:10 +0000 (+0000) Subject: "Copy from Anais" functionality X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adf95ddd7ab0000eab68b2b5dfe785d8f109c018;p=scalable-opengroupware.org "Copy from Anais" functionality git-svn-id: http://svn.opengroupware.org/SOGo/trunk@306 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/Anais/AnaisSelector.m b/SOGo/UI/Anais/AnaisSelector.m index 8b1b34e5..f8ce7d0f 100644 --- a/SOGo/UI/Anais/AnaisSelector.m +++ b/SOGo/UI/Anais/AnaisSelector.m @@ -22,12 +22,35 @@ #include +/* + AnaisSelector + + Open a satellite window providing access to Anais. + + Bindings: + title - button title to display to user + windowId - string to be used for uniquing this window to a particular + purpose (i.e. for adding participants) + division - Anais division + callback - name of JavaScript callback function to use in caller's page + extraAttributes - extra attributes to add as paramaters to the callback + + Sample: + + */ + @interface AnaisSelector : UIxComponent { NSString *title; NSString *windowId; NSString *division; NSString *callback; + NSString *extraAttributes; } - (void)setTitle:(NSString *)_title; @@ -58,10 +81,11 @@ } - (void)dealloc { - [self->title release]; - [self->windowId release]; - [self->division release]; - [self->callback release]; + [self->title release]; + [self->windowId release]; + [self->division release]; + [self->callback release]; + [self->extraAttributes release]; [super dealloc]; } @@ -95,6 +119,13 @@ return self->callback; } +- (void)setExtraAttributes:(NSString *)_extraAttributes { + ASSIGN(self->extraAttributes, _extraAttributes); +} +- (NSString *)extraAttributes { + return self->extraAttributes; +} + /* JavaScript */ - (NSString *)jsFunctionName { @@ -110,23 +141,29 @@ - (NSString *)jsCode { static NSString *codeFmt = \ @"function %@() {\n" - @" var url = '/anais/aideAnais.php?m_fonc=%@%@&m_champ=mail,uid,sn#mon_etiquette';\n" + @" var url = '/anais/aideAnais.php?m_fonc=%@%@&m_champ=mail,uid,sn%@#mon_etiquette';\n" @" var anaisWindow = window.open(url, '%@', 'width=350, height=600, left=10, top=10, toolbar=no, dependent=yes, menubar=no, location=no, resizable=yes, scrollbars=yes, directories=no, status=no');\n" @" anaisWindow.focus();\n" @"}"; - static NSString *divFmt = @"&m_type=%@"; - NSString *fmt; - - if([self division]) - fmt = [NSString stringWithFormat:divFmt, [self division]]; - else - fmt = @""; + static NSString *divFmt = @"&m_type=%@"; + NSString *fmt, *exAttrFmt; + + if([self division]) + fmt = [NSString stringWithFormat:divFmt, [self division]]; + else + fmt = @""; + + if([self extraAttributes]) + exAttrFmt = [NSString stringWithFormat:@",%@", [self extraAttributes]]; + else + exAttrFmt = @""; return [NSString stringWithFormat:codeFmt, - [self jsFunctionName], - [self callback], - fmt, - [self windowId]]; + [self jsFunctionName], + [self callback], + fmt, + exAttrFmt, + [self windowId]]; } @end /* AnaisSelector */ diff --git a/SOGo/UI/Anais/AnaisUidSelector.m b/SOGo/UI/Anais/AnaisUidSelector.m index 9515b59d..3d500a0c 100644 --- a/SOGo/UI/Anais/AnaisUidSelector.m +++ b/SOGo/UI/Anais/AnaisUidSelector.m @@ -23,6 +23,12 @@ #include +/* + AnaisUidSelector + + Modifiable list of uids used to select multiple calendars for viewing at once. +*/ + @interface AnaisUidSelector : UIxComponent { NSArray *calendarUIDs; diff --git a/SOGo/UI/Anais/ChangeLog b/SOGo/UI/Anais/ChangeLog index b27155ae..e76280bc 100644 --- a/SOGo/UI/Anais/ChangeLog +++ b/SOGo/UI/Anais/ChangeLog @@ -1,3 +1,13 @@ +2004-09-14 Marcus Mueller + + * v0.9.14 + + * AnaisUidSelector.m: added tiny bit of documentation + + * AnaisSelector.m: provide API documentation and added code to set + extra arguments for Anais, so that callback can receive arbitrary + values + 2004-09-13 Marcus Mueller * v0.9.13 diff --git a/SOGo/UI/Anais/Version b/SOGo/UI/Anais/Version index 3228956b..84882450 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:=13 +SUBMINOR_VERSION:=14 diff --git a/SOGo/UI/Contacts/ChangeLog b/SOGo/UI/Contacts/ChangeLog index c2f66d90..79957892 100644 --- a/SOGo/UI/Contacts/ChangeLog +++ b/SOGo/UI/Contacts/ChangeLog @@ -1,5 +1,13 @@ 2004-09-14 Marcus Mueller + * v0.9.12 + + * UIxContactEditor.[wox|m]: Copy from Anais functionality + + * UIxContactsSelectionView.m: minor cleanup + + * {English.lproj,French.lproj}/defaults.plist: new localizable string + * v0.9.11 * UIxContactSelector.m: changed width of satellite window to 800px diff --git a/SOGo/UI/Contacts/English.lproj/default.strings b/SOGo/UI/Contacts/English.lproj/default.strings index a7ef693e..3ff39b6c 100644 --- a/SOGo/UI/Contacts/English.lproj/default.strings +++ b/SOGo/UI/Contacts/English.lproj/default.strings @@ -28,3 +28,4 @@ "delete" = "delete"; "Save" = "Save"; "Cancel" = "Cancel"; +"Copy from Anais" = "Copy from Anaïs"; diff --git a/SOGo/UI/Contacts/French.lproj/default.strings b/SOGo/UI/Contacts/French.lproj/default.strings index a7ef693e..7f982ba0 100644 --- a/SOGo/UI/Contacts/French.lproj/default.strings +++ b/SOGo/UI/Contacts/French.lproj/default.strings @@ -28,3 +28,4 @@ "delete" = "delete"; "Save" = "Save"; "Cancel" = "Cancel"; +"Add from Anais" = "Add from Anaïs"; diff --git a/SOGo/UI/Contacts/UIxContactEditor.m b/SOGo/UI/Contacts/UIxContactEditor.m index d065a590..9c3f724c 100644 --- a/SOGo/UI/Contacts/UIxContactEditor.m +++ b/SOGo/UI/Contacts/UIxContactEditor.m @@ -139,6 +139,33 @@ [_record addEntriesFromDictionary:[self snapshot]]; } +/* JavaScript */ + +- (NSString *)jsCopyContactCode { + static NSString *jsCode = \ + @"function copyContact(type, cn, dn, email, uid, sn, " + @"givenName, telephoneNumber, facsimileTelephoneNumber, " + @"postalAddress, homePostalAddress" + @") {\n" + @" var e;\n" + @" e = document.getElementById('email');\n" + @" e.setAttribute('value', email);\n" + @" e = document.getElementById('sn');\n" + @" e.setAttribute('value', sn);\n" + @" e = document.getElementById('givenName');\n" + @" e.setAttribute('value', givenName);\n" + @" e = document.getElementById('telephoneNumber');\n" + @" e.setAttribute('value', telephoneNumber);\n" + @" e = document.getElementById('facsimileTelephoneNumber');\n" + @" e.setAttribute('value', facsimileTelephoneNumber);\n" + @" e = document.getElementById('postalAddress');\n" + @" e.setAttribute('value', postalAddress);\n" + @" e = document.getElementById('homePostalAddress');\n" + @" e.setAttribute('value', homePostalAddress);\n" + @"}\n"; + return jsCode; +} + /* helper */ - (NSString *)_completeURIForMethod:(NSString *)_method { diff --git a/SOGo/UI/Contacts/UIxContactEditor.wox b/SOGo/UI/Contacts/UIxContactEditor.wox index f4a795bd..1b0cc996 100644 --- a/SOGo/UI/Contacts/UIxContactEditor.wox +++ b/SOGo/UI/Contacts/UIxContactEditor.wox @@ -14,6 +14,10 @@ } + +
@@ -44,6 +48,15 @@
+ + @@ -71,9 +88,12 @@ @@ -96,9 +116,12 @@ @@ -110,9 +133,12 @@ @@ -135,9 +161,13 @@
+ +
@@ -58,8 +71,12 @@ - +
- +
- +
- +
-