From fb306bd2bb9fe99dd1f1b7d30af1e6fc22e94a61 Mon Sep 17 00:00:00 2001 From: MVA Date: Thu, 22 Dec 2011 16:17:53 +0100 Subject: [CLEAN] Button open and create in push dialog bzr revid: mva@openerp.com-20111222151753-2qwkoywvvdh8wvtc --- .../plugin/openerp_plugin/chrome/openerp_plugin.jar | Bin 48520 -> 48725 bytes .../chrome/openerp_plugin/content/js/dialog.js | 16 ++++++++++++++++ .../chrome/openerp_plugin/content/js/overlay.js | 13 ++++++++----- .../chrome/openerp_plugin/content/overlay.xul | 2 +- .../chrome/openerp_plugin/content/push_dialog.xul | 5 +++-- .../openerp_plugin/defaults/preferences/tiny.js | 1 + 6 files changed, 29 insertions(+), 8 deletions(-) (limited to 'addons/plugin_thunderbird/plugin/openerp_plugin') 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 6d6489c9abb..d41bad4bf79 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/js/dialog.js b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/dialog.js index 6a57a82a85d..09f5fa01e16 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(){ + log_message("ceci est un test"); + log_message(getPreference('statutdoc')); + log_message("fin de test"); + 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; + } + +} 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 819f1491d6a..0d21af8f1aa 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 @@ -160,14 +160,17 @@ 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'); + //alert("Document is not available."); + //document.getElementById('message_label').setAttribute('value', 'No document was found'); + setPreference('statutdoc','create'); + } else { - open_url(res[URL]) - } + setPreference('statutdoc', 'open'); + //open_url(res[URL]); + } }, onFault: function (client, ctxt, fault) { 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 47c7e3aed5d..b87ade0946b 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 @@ -20,7 +20,7 @@ /> - +