diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin.xpi b/addons/plugin_thunderbird/plugin/openerp_plugin.xpi
index f0255b00623..c52d0dc361f 100644
Binary files a/addons/plugin_thunderbird/plugin/openerp_plugin.xpi and b/addons/plugin_thunderbird/plugin/openerp_plugin.xpi differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
index 05a7279eb78..a28430396e6 100644
Binary files a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/create.xul b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/create.xul
index 6ad5bc6b351..843f3c5b6d3 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/create.xul
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/create.xul
@@ -4,21 +4,12 @@
+ title="&title.label;" onload="load_createContact();" >
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -38,7 +29,8 @@
-
-
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/create.js b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/create.js
index 21faf9f7949..6670002c9af 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/create.js
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/create.js
@@ -109,6 +109,7 @@ var listCreateContactHandler = {
//function to create a new contact
function createContact(){
+ window.close();
setServerService('xmlrpc/object');
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
var xmlRpcClient = getXmlRpc();
@@ -123,4 +124,4 @@ function createContact(){
var b = [document.getElementById("txtname").value, document.getElementById("txtemail").value];
var arrofarr = dictcontact(a,b);
xmlRpcClient.asyncCall(listCreateContactHandler,null,'execute',[strDbName,struid,strpass,strobj,strmethod,arrofarr, strpartnerid], 7);
-}
\ No newline at end of file
+}
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/dialog.js b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/dialog.js
index 6a57a82a85d..2995a48fa84 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/dialog.js
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/dialog.js
@@ -2,3 +2,19 @@ function load_contact_dialog() {
log_message("load contact dialog")
}
+function load_document(){
+ if (getPreference('statutdoc')=='open'){
+ document.getElementById('open_document').hidden=false;
+ document.getElementById('open').hidden=true;
+ }
+ else{
+ document.getElementById('open_document').hidden=true;
+ document.getElementById('open').hidden=false;
+ }
+
+}
+
+function message_setlabel(){
+ log_message(getPreference('subject'));
+ document.getElementById('message_label').value=getPreference('subject');
+ }
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/overlay.js b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/overlay.js
index 2607614e7c8..c85e735374e 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/overlay.js
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/overlay.js
@@ -96,6 +96,7 @@ var openPartnerHandler = {
open_url(res[URL])
+
},
onFault: function (client, ctxt, fault) {
log_message(fault);
@@ -159,14 +160,15 @@ var listDocumentHandler = {
onResult: function(client, context, result) {
res = extract_data(result)
log_message("open document")
+ window.open('chrome://openerp_plugin/content/push_dialog.xul', '', 'chrome', resizable='yes');
if(res[RES_ID]==0) {
- alert("Document is not available.");
- window.open('chrome://openerp_plugin/content/push_dialog.xul', '', 'chrome', resizable='yes');
- document.getElementById('message_label').setAttribute('value', 'No document was found');
+ setPreference('statutdoc','create');
}
else {
- open_url(res[URL])
- }
+ setPreference('statutdoc', 'open');
+ setPreference('urldoc', res[URL]);
+ }
+ setPreference('message_label',setPreference('subject'));// to have the subject to print on the push dialog
},
onFault: function (client, ctxt, fault) {
@@ -198,6 +200,7 @@ function open_document() {
var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
var eml_string = getMessage(messageUri);
+ setPreference('email_text', eml_string);
var email = get_rpc_string(xmlRpcClient, eml_string);
xmlRpcClient.asyncCall(listDocumentHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod, email],6);
-}
\ No newline at end of file
+}
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/push.js b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/push.js
index 86596397c99..a20ea17e8a1 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/push.js
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/push.js
@@ -155,6 +155,7 @@ var pushHandler = {
function push() {
+ window.close();
var model_name = document.getElementById('menu_model_list').selectedItem.value;
var res_id = 0;
if(getOperation() == "add") {
@@ -184,4 +185,3 @@ function push() {
}
-
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/tools.js b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/tools.js
index 44b984ac383..c0dad694450 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/tools.js
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/tools.js
@@ -31,6 +31,7 @@ function createMenuItem(aLabel, aValue) {
return item;
}
+
function clear_search_box(element) {
var cmbSearchList = document.getElementById(element);
count = cmbSearchList.itemCount
@@ -39,7 +40,6 @@ function clear_search_box(element) {
}
}
-
function open_url(url) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger);
@@ -78,4 +78,4 @@ function check_connection(callback) {
}
return callback()
}
-}
\ No newline at end of file
+}
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul
index 0df20fc039b..6e2f1ee875a 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul
@@ -12,53 +12,35 @@
-
-
-
-
-
@@ -66,7 +48,7 @@
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push.xul b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push.xul
index b9a17df485f..e3d2150899e 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push.xul
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push.xul
@@ -28,12 +28,9 @@
-
-
+
-
-
-
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push_dialog.xul b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push_dialog.xul
index a8d7531e470..dcbcc84be2b 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push_dialog.xul
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push_dialog.xul
@@ -1,19 +1,22 @@
-
+
-
+
+
-
+
-
-
+
+
+
-
\ No newline at end of file
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/selectpartner.xul b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/selectpartner.xul
index b999bc8c33d..97d636ee6fe 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/selectpartner.xul
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/selectpartner.xul
@@ -24,8 +24,8 @@
-
-
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js b/addons/plugin_thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js
index 1e12ff712d8..9a21e9a6f6c 100644
--- a/addons/plugin_thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js
@@ -9,6 +9,8 @@ pref("extensions.tiny.username","admin");
pref("extensions.tiny.password","admin");
pref("extensions.tiny.senderemail","");
pref("extensions.tiny.sendername","");
+pref("extensions.tiny.statutdoc","");// add to have a statut to hidde or not the button
+pref("extensions.tiny.message_label","");// add to message in push dialog
pref("extensions.tiny.receiveremail","");
pref("extensions.tiny.subject","");
pref("extensions.tiny.receiveddate","");