diff options
Diffstat (limited to 'addons/plugin_thunderbird/plugin')
7 files changed, 29 insertions, 8 deletions
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin.xpi b/addons/plugin_thunderbird/plugin/openerp_plugin.xpi Binary files differindex 0d1fd8f8e40..5bdf53edd8b 100644 --- a/addons/plugin_thunderbird/plugin/openerp_plugin.xpi +++ b/addons/plugin_thunderbird/plugin/openerp_plugin.xpi diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar Binary files differindex 6d6489c9abb..d41bad4bf79 100644 --- a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar +++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar 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 @@ />
<menuitem id="tiny-opendocument" label="document"
- oncommand="window.open('chrome://openerp_plugin/content/push_dialog.xul', '', 'chrome', 'resizable=yes');"
+ oncommand="check(open_document);"
image="&menuicon.value;"
class="menuitem-iconic"
tooltiptext="&opendocumenttooltip.value;"
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 147b8f08dfd..af54a55ae12 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,11 +1,12 @@ <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <!-- Extremely recommended to keep this css include!! --> -<window id="rootWnd" title="push box" onload="load_contact_dialog();" +<window id="rootWnd" title="push box" onload="load_contact_dialog();load_document();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script> <script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script> <script type="text/javascript" src="chrome://openerp_plugin/content/js/dialog.js"></script> + <script type="text/javascript" src="chrome://openerp_plugin/content/js/overlay.js"></script> <vbox> <hbox> <label value="Message" id="message_label"/> @@ -14,7 +15,7 @@ <button label="Cancel" accesskey="c" oncommand="window.close();"/> <button id="push_new" label="Push Email" accesskey="a" oncommand=" window.close();window.open('chrome://openerp_plugin/content/push.xul', '', 'chrome', resizable='yes');"/> <button id="open" label="Create Document" accesskey="c" oncommand="window.close();window.open('chrome://openerp_plugin/content/create_new.xul', '', 'chrome', resizable='yes');"/> - <button id="opendocument" label="Open Document" accesskey="d" oncommand="check(open_document);"/> + <button id="open_document" label="Open Document" accesskey="d" oncommand="check_document();"/> <!-- link open document and show create or open but not both--> </hbox> </vbox> 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..6722887f48a 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,7 @@ 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.receiveremail",""); pref("extensions.tiny.subject",""); pref("extensions.tiny.receiveddate",""); |
