From d4a2c0cf5c16525753f2ac2f91fdac0d3bcb3d2c Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Tue, 26 Jan 2010 13:09:25 -0500
Subject: [PATCH] Import contacts into the selected address book + set button states accordingly

---
 program/js/app.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index a02df78..fc24a77 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -305,7 +305,7 @@
         this.set_page_buttons();
         
         if (this.env.address_sources && this.env.address_sources[this.env.source] && !this.env.address_sources[this.env.source].readonly)
-          this.enable_command('add', true);
+          this.enable_command('add', 'import', true);
         
         if (this.env.cid)
           this.enable_command('show', 'edit', true);
@@ -313,7 +313,7 @@
         if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform)
           this.enable_command('save', true);
         else
-          this.enable_command('search', 'reset-search', 'moveto', 'import', true);
+          this.enable_command('search', 'reset-search', 'moveto', true);
           
         if (this.contact_list && this.contact_list.rowcount > 0)
           this.enable_command('export', true);
@@ -608,7 +608,7 @@
             this.reset_qsearch();
 
           this.list_contacts(props);
-          this.enable_command('add', (this.env.address_sources && !this.env.address_sources[props].readonly));
+          this.enable_command('add', 'import', (this.env.address_sources && !this.env.address_sources[props].readonly));
           }
         break;
 
@@ -1075,7 +1075,7 @@
           this.lock_form(this.gui_objects.importform, true);
         }
         else
-          this.goto_url('import');
+          this.goto_url('import', (this.env.source ? '_target='+urlencode(this.env.source)+'&' : ''));
         break;
         
       case 'export':

--
Gitblit v1.9.1