0008006: token mode removes contact image
authorCornelius Weiß <mail@corneliusweiss.de>
Thu, 28 Mar 2013 10:14:09 +0000 (11:14 +0100)
committerCornelius Weiss <c.weiss@metaways.de>
Thu, 28 Mar 2013 10:43:02 +0000 (11:43 +0100)
also solves
0007890: can not add contact of type user

@2012.03

Change-Id: Ic1147bf239179a41c64de828b420e9c6d45179b7
Reviewed-on: http://gerrit.tine20.com/customers/65
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
tine20/Addressbook/Frontend/Json.php
tine20/Addressbook/js/ContactEditDialog.js

index b5798f2..a404583 100755 (executable)
@@ -159,9 +159,13 @@ class Addressbook_Frontend_Json extends Tinebase_Frontend_Json_Abstract
     public function parseAddressData($address)
     {
         $result = Addressbook_Controller_Contact::getInstance()->parseAddressData($address);
+        $contactData = $this->_recordToJson($result['contact']);
+        
+        unset($contactData['jpegphoto']);
+        unset($contactData['salutation']);
         
         return array(
-            'contact'             => $this->_recordToJson($result['contact']),
+            'contact'             => $contactData,
             'unrecognizedTokens'  => $result['unrecognizedTokens'],
         );
     }
index 6c0beae..e4b19c4 100644 (file)
@@ -508,7 +508,9 @@ Tine.Addressbook.ContactEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog,
             
             // only set the fields that could be detected
             Ext.iterate(result.contact, function(key, value) {
-                this.record.set(key, value);
+                if (value && ! this.record.get(key)) {
+                    this.record.set(key, value);
+                }
             }, this);
             
             var oldNote = (this.record.get('note')) ? this.record.get('note') : '';