]> err.no Git - scalable-opengroupware.org/commitdiff
Contacts imported from Anais now got CN set from LDAP
authormaxime <maxime@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 13 Jul 2005 14:25:16 +0000 (14:25 +0000)
committermaxime <maxime@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 13 Jul 2005 14:25:16 +0000 (14:25 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@738 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/Anais/AnaisAttendeeSelector.m
SOGo/UI/Anais/AnaisSelector.m
SOGo/UI/Contacts/UIxContactEditorBase.h
SOGo/UI/Contacts/UIxContactEditorBase.m
SOGo/UI/Templates/ContactsUI/UIxContactEditor.wox

index be53632aa228b639c97169e9a9362c2de8658291..1377ab8e7a8cc54dbeb49478b19f44af1bae3d69 100644 (file)
@@ -340,13 +340,7 @@ static BOOL debugOn = NO;
     //    @"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";
 
index fe8f003eee7d036b0c250da6348490baa296ad1e..07cea046c0da9ad36b65e82ccc98d69eab1c98ac 100644 (file)
 - (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"
     @"}";
index b9a26c55fdc80f3d3871550fe960f2c1a29b7b1e..af041c69bff7eb83d8d5973cb0480b59f3fa560d 100644 (file)
@@ -30,6 +30,7 @@
 {
   NSString *contentString;
   NSString *errorText;
+  NSString *anaisCN;
   NSMutableDictionary *snapshot; /* contains the values for editing */
 }
 
index 6e67a38a6a243f53ea8b3a1fc67a991fd8dcd38b..f1b3ad64fb0224f516547409e83ec1141f698495 100644 (file)
@@ -35,6 +35,7 @@
 
 - (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"
index f6fca7699dfc26cb7ea029037baa0a8dcc41b28b..fb20ce623accc702007e98f974a8a1c690318253 100644 (file)
@@ -53,7 +53,7 @@
                                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"