Merge branch '2014.11' into 2014.11-develop
[tine20] / tine20 / Addressbook / js / ContactGrid.js
index d7b6585..7442f82 100644 (file)
@@ -228,6 +228,15 @@ Tine.Addressbook.ContactGridPanel = Ext.extend(Tine.widgets.grid.GridPanel, {
         
         Tine.Addressbook.ContactGridPanel.superclass.initActions.call(this);
     },
+
+    /**
+     * get default / selected addressbook container
+     *
+     * @returns {Object|Tine.Tinebase.Model.Container}
+     */
+    getDefaultContainer: function() {
+        return this.app.getMainScreen().getWestPanel().getContainerTreePanel().getDefaultContainer('defaultAddressbook');
+    },
     
     /**
      * add custom items to action toolbar
@@ -264,34 +273,6 @@ Tine.Addressbook.ContactGridPanel = Ext.extend(Tine.widgets.grid.GridPanel, {
     },
     
     /**
-     * import contacts
-     * 
-     * @param {Button} btn 
-     * 
-     * TODO generalize this & the import button
-     */
-    onImport: function(btn) {
-        var popupWindow = Tine.widgets.dialog.ImportDialog.openWindow({
-            appName: 'Addressbook',
-            modelName: 'Contact',
-            defaultImportContainer: this.app.getMainScreen().getWestPanel().getContainerTreePanel().getDefaultContainer('defaultAddressbook'),
-            
-            // update grid after import
-            listeners: {
-                scope: this,
-                'finish': function() {
-                    this.loadGridData({
-                        preserveCursor:     false, 
-                        preserveSelection:  false, 
-                        preserveScroller:   false,
-                        removeStrategy:     'default'
-                    });
-                }
-            }
-        });
-    },
-        
-    /**
      * tid renderer
      * 
      * @private