0013308: Added contacts not preserved in a new CRM lead
authorCornelius Weiß <c.weiss@metaways.de>
Fri, 7 Jul 2017 09:21:48 +0000 (11:21 +0200)
committerCornelius Weiss <c.weiss@metaways.de>
Fri, 7 Jul 2017 09:19:16 +0000 (11:19 +0200)
Change-Id: Ia94fbc5566a69395a251d74d74757aa78194b574
Reviewed-on: http://gerrit.tine20.com/customers/5056
Reviewed-by: Cornelius Weiss <c.weiss@metaways.de>
Tested-by: Cornelius Weiss <c.weiss@metaways.de>
tine20/Crm/js/LeadEditDialog.js

index d386ac8..cd58bdd 100644 (file)
@@ -62,7 +62,12 @@ Tine.Crm.LeadEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
      * @type {Array}
      */
     ignoreRelatedModels: ['Sales_Model_Product', 'Addressbook_Model_Contact', 'Tasks_Model_Task'],
      * @type {Array}
      */
     ignoreRelatedModels: ['Sales_Model_Product', 'Addressbook_Model_Contact', 'Tasks_Model_Task'],
-    
+
+    initComponent: function() {
+        Tine.Crm.LeadEditDialog.superclass.initComponent.call(this);
+        this.on('recordUpdate', this.onAfterRecordUpdate, this);
+    },
+
     /**
      * executed after record got updated from proxy
      * 
     /**
      * executed after record got updated from proxy
      * 
@@ -88,18 +93,12 @@ Tine.Crm.LeadEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
             }
         }
     },
             }
         }
     },
-
-    /**
-     * is called from onApplyChanges
-     * @param {Boolean} closeWindow
-     */
-    doApplyChanges: function(closeWindow) {
+    
+    onAfterRecordUpdate: function(closeWindow) {
         this.getAdditionalData();
         
         var relations = [].concat(this.record.get('relations'));
         this.record.data.relations = relations;
         this.getAdditionalData();
         
         var relations = [].concat(this.record.get('relations'));
         this.record.data.relations = relations;
-        
-        Tine.Crm.LeadEditDialog.superclass.doApplyChanges.call(this, closeWindow);
     },
     
     /**
     },
     
     /**