#include <SOGoUI/UIxComponent.h>
+/*
+ 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:
+ <var:component className="AnaisSelector"
+ const:windowId="ParticipantSelection"
+ const:division="CC"
+ const:callback="addParticipant"
+ const:extraAttributes="givenName,initials"
+ />
+ */
+
@interface AnaisSelector : UIxComponent
{
NSString *title;
NSString *windowId;
NSString *division;
NSString *callback;
+ NSString *extraAttributes;
}
- (void)setTitle:(NSString *)_title;
}
- (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];
}
return self->callback;
}
+- (void)setExtraAttributes:(NSString *)_extraAttributes {
+ ASSIGN(self->extraAttributes, _extraAttributes);
+}
+- (NSString *)extraAttributes {
+ return self->extraAttributes;
+}
+
/* JavaScript */
- (NSString *)jsFunctionName {
- (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 */
#include <SOGoUI/UIxComponent.h>
+/*
+ AnaisUidSelector
+
+ Modifiable list of uids used to select multiple calendars for viewing at once.
+*/
+
@interface AnaisUidSelector : UIxComponent
{
NSArray *calendarUIDs;
+2004-09-14 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * 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 <znek@mulle-kybernetik.com>
* v0.9.13
# $Id: Version 165 2004-08-05 17:55:50Z znek $
-SUBMINOR_VERSION:=13
+SUBMINOR_VERSION:=14
2004-09-14 Marcus Mueller <znek@mulle-kybernetik.com>
+ * 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
"delete" = "delete";
"Save" = "Save";
"Cancel" = "Cancel";
+"Copy from Anais" = "Copy from Anaïs";
"delete" = "delete";
"Save" = "Save";
"Cancel" = "Cancel";
+"Add from Anais" = "Add from Anaïs";
[_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 {
}
</style>
+ <script language="JavaScript">
+ <var:string value="jsCopyContactCode" const:escapeHTML="NO" />
+ </script>
+
<form var:href="clientObject.baseURL">
<table cellspacing="0" cellpadding="5" width="100%">
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="0" class="editsec">
<tr>
+ <td align="right" colspan="2">
+ <var:component className="AnaisSelector"
+ const:windowId="UIxContactTemplates"
+ label:title="Copy from Anais"
+ const:callback="copyContact"
+ const:extraAttributes="givenName,telephoneNumber,facsimileTelephoneNumber,postalAddress,homePostalAddress"
+ />
+ </td>
+ </tr><tr>
<td align="left" colspan="2">
<span class="aptview_title">
<var:string label:value="Common" />
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
- <input type="text" name="sn" var:value="snapshot.sn"
- size="60" />
+ <input type="text"
+ name="sn"
+ id="sn"
+ var:value="snapshot.sn"
+ size="60"
+ />
</span>
</td>
</tr>
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
- <input type="text" name="givenName"
- var:value="snapshot.givenName"
- size="60" />
+ <input type="text"
+ name="givenName"
+ id="givenName"
+ var:value="snapshot.givenName"
+ size="60"
+ />
</span>
</td>
</tr>
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
- <input type="text" name="telephoneNumber"
- var:value="snapshot.telephoneNumber"
- size="60" />
+ <input type="text"
+ name="telephoneNumber"
+ id="telephoneNumber"
+ var:value="snapshot.telephoneNumber"
+ size="60"
+ />
</span>
</td>
</tr>
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
- <input type="text" name="facsimileTelephoneNumber"
- var:value="snapshot.facsimileTelephoneNumber"
- size="60" />
+ <input type="text"
+ name="facsimileTelephoneNumber"
+ id="facsimileTelephoneNumber"
+ var:value="snapshot.facsimileTelephoneNumber"
+ size="60"
+ />
</span>
</td>
</tr>
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
- <textarea name="postalAddress" rows="3" cols="60"
+ <textarea name="postalAddress"
+ id="postalAddress"
+ rows="3"
+ cols="60"
wrap="physical"
- var:value="snapshot.postalAddress" />
+ var:value="snapshot.postalAddress"
+ />
</span>
</td>
</tr>
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
- <textarea name="homePostalAddress" rows="3" cols="60"
+ <textarea name="homePostalAddress"
+ rows="3"
+ cols="60"
wrap="physical"
- var:value="snapshot.homePostalAddress" />
+ var:value="snapshot.homePostalAddress"
+ />
</span>
</td>
</tr>
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
- <input type="text" name="mail"
- var:value="snapshot.mail"
- size="60" />
+ <input type="text"
+ name="mail"
+ id="email"
+ var:value="snapshot.mail"
+ size="60"
+ />
</span>
</td>
</tr>
}
- (NSString *)jsOnClickCode {
- static NSString *jsCode = @"javascript:opener.window.%@" \
- @"('', '%@', '', '%@', '', '');";
+ static NSString *jsCode = \
+ @"javascript:opener.window.%@('', '%@', '', '%@', '', '');";
NSString *cn;
cn = [NSString stringWithFormat:@"%@ %@",
# $Id$
-SUBMINOR_VERSION:=11
+SUBMINOR_VERSION:=12