// @"function %@(type, cn, dn, email, uid, sn) {\n"
// @" addToTable('%@', type, cn, dn, email, uid, sn);\n"
// @"}\n";
- @"function %@() {\n"
- @" var type=arguments[0];\n"
- @" var email=arguments[1];\n"
- @" var uid=arguments[2];\n"
- @" var sn=arguments[3];\n"
- @" var cn=arguments[4];\n"
- @" var dn=arguments[5];\n"
+ @"function %@(type, email, uid, sn, cn, dn) {\n"
@" addToTable('%@', type, cn, dn, email, uid, sn);\n"
@"}\n";
- (NSString *)jsCode {
static NSString *codeFmt = \
@"function %@() {\n"
- @" var url = '/anais/Admin/Autres/aideFonc.php?m_fonc=%@&m_data=data1&m_type=Pour&m_nom=Titre,Bandeau%@&m_champ=mail,uid,sn%@&m_nature=BALI&m_agenda0#mon_etiquette';\n"
+ @" var url = '/anais/Admin/Autres/aideFonc.php?m_fonc=%@&m_data=data1&m_type=Pour&m_nom=,%@&m_champ=mail,uid,sn%@&m_nature=BALI&m_agenda0#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"
@"}";
- (void)dealloc {
[self->snapshot release];
+ [self->anaisCN release];
[self->errorText release];
[self->contentString release];
[super dealloc];
- (NSString *)errorText {
return self->errorText;
}
+
- (BOOL)hasErrorText {
return [self->errorText length] > 0 ? YES : NO;
}
+
+- (void)setAnaisCN:(NSString *)_txt {
+ ASSIGNCOPY(self->anaisCN, _txt);
+}
+- (NSString *)anaisCN {
+ return self->anaisCN;
+}
+
+
/* load/store content format */
- (void)loadValuesFromContentString:(NSString *)_s {
}
[self->snapshot setObject:sn forKey:@"sn"];
}
-
- if (sn == nil && gn == nil)
+ if ([self->anaisCN length] > 0 )
+ cn = self->anaisCN;
+ else if (sn == nil && gn == nil)
cn = @"[noname]";
else if (sn == nil)
cn = gn;
@" return s;\n"
@"}\n"
@"\n"
- @"function copyContact()"
+ @"function copyContact(type, email, uid, sn,"
+ @"cn, givenName, telephoneNumber, facsimileTelephoneNumber, mobile, postalAddress, homePostalAddress, departmentNumber, l)"
@"{\n"
- @" var type = arguments[0]; \n"
- @" var email = arguments[1]; \n"
- @" var uid = arguments[2]; \n"
- @" var sn = arguments[3]; \n"
- @" var givenName = arguments[4]; \n"
- @" var telephoneNumber = arguments[5]; \n"
- @" var facsimileTelephoneNumber = arguments[6]; \n"
- @" var mobile = arguments[7]; \n"
- @" var postalAddress = arguments[8]; \n"
- @" var homePostalAddress = arguments[9]; \n"
- @" var departmentNumber = arguments[10]; \n"
- @" var l = arguments[11]; \n"
+ // @" var type = arguments[0]; \n"
+ // @" var email = arguments[1]; \n"
+ // @" var uid = arguments[2]; \n"
+ // @" var sn = arguments[3]; \n"
+ // @" var givenName = arguments[4]; \n"
+ // @" var telephoneNumber = arguments[5]; \n"
+ // @" var facsimileTelephoneNumber = arguments[6]; \n"
+ // @" var mobile = arguments[7]; \n"
+ // @" var postalAddress = arguments[8]; \n"
+ // @" var homePostalAddress = arguments[9]; \n"
+ // @" var departmentNumber = arguments[10]; \n"
+ // @" var l = arguments[11]; \n"
@" var e;\n"
+ @" e = document.getElementById('cn');\n"
+ @" e.setAttribute('value', unescapeCallbackParameter(cn));\n"
@" e = document.getElementById('email');\n"
@" e.setAttribute('value', email);\n"
@" e = document.getElementById('sn');\n"
const:windowId="UIxContactTemplates"
label:title="Copy from Anais"
const:callback="copyContact"
- const:extraAttributes="givenName,telephoneNumber,facsimileTelephoneNumber,mobile,postalAddress,homePostalAddress,departmentNumber,l"
+ const:extraAttributes="cn, givenName,telephoneNumber,facsimileTelephoneNumber,mobile,postalAddress,homePostalAddress,departmentNumber,l"
/>
</td>
</tr><tr>
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
+ <input type="hidden"
+ name="cn"
+ id="cn"
+ var:value="anaisCN"
+ />
<input type="text"
name="givenName"
id="givenName"