From b4f3fe616ac30b5593386f29cfc170dec13c27d5 Mon Sep 17 00:00:00 2001
From: "tfr@openerp.com" <>
Date: Mon, 19 Dec 2011 11:53:43 +0100
Subject: [clean] config
bzr revid: tfr@openerp.com-20111219105343-bs2udshlsza7kvj1
---
.../plugin_thunderbird/plugin/openerp_plugin.xpi | Bin 0 -> 108497 bytes
.../plugin/openerp_plugin/chrome.manifest | 9 +
.../openerp_plugin/chrome/openerp_plugin.jar | Bin 0 -> 47697 bytes
.../chrome/openerp_plugin/content/config.xul | 86 ++
.../openerp_plugin/content/config_change.xul | 42 +
.../chrome/openerp_plugin/content/create.xul | 44 +
.../chrome/openerp_plugin/content/js/config.js | 122 +++
.../chrome/openerp_plugin/content/js/create.js | 126 +++
.../chrome/openerp_plugin/content/js/dialog.js | 4 +
.../chrome/openerp_plugin/content/js/overlay.js | 203 ++++
.../chrome/openerp_plugin/content/js/push.js | 187 ++++
.../openerp_plugin/content/js/tiny_xmlrpc.js | 423 ++++++++
.../chrome/openerp_plugin/content/js/tools.js | 81 ++
.../chrome/openerp_plugin/content/overlay.xul | 73 ++
.../chrome/openerp_plugin/content/push.xul | 66 ++
.../chrome/openerp_plugin/content/push_dialog.xul | 19 +
.../openerp_plugin/content/selectpartner.xul | 31 +
.../chrome/openerp_plugin/content/style.css | 4 +
.../chrome/openerp_plugin/locale/en-US/address.dtd | 26 +
.../chrome/openerp_plugin/locale/en-US/config.dtd | 56 ++
.../openerp_plugin/locale/en-US/config_change.dtd | 6 +
.../chrome/openerp_plugin/locale/en-US/create.dtd | 37 +
.../locale/en-US/mboximport.properties | 31 +
.../chrome/openerp_plugin/locale/en-US/overlay.dtd | 18 +
.../chrome/openerp_plugin/locale/en-US/plugin.dtd | 31 +
.../openerp_plugin/locale/en-US/selectpartner.dtd | 12 +
.../chrome/openerp_plugin/skin/Archive.png | Bin 0 -> 852 bytes
.../chrome/openerp_plugin/skin/Create.png | Bin 0 -> 888 bytes
.../chrome/openerp_plugin/skin/Error.gif | Bin 0 -> 1037 bytes
.../chrome/openerp_plugin/skin/Move.gif | Bin 0 -> 155 bytes
.../chrome/openerp_plugin/skin/MoveDown.png | Bin 0 -> 352 bytes
.../chrome/openerp_plugin/skin/MoveLeft.png | Bin 0 -> 363 bytes
.../chrome/openerp_plugin/skin/Search.gif | Bin 0 -> 582 bytes
.../chrome/openerp_plugin/skin/Success.gif | Bin 0 -> 604 bytes
.../chrome/openerp_plugin/skin/developped_by.png | Bin 0 -> 7192 bytes
.../chrome/openerp_plugin/skin/logo.png | Bin 0 -> 3981 bytes
.../chrome/openerp_plugin/skin/openerp.png | Bin 0 -> 2611 bytes
.../chrome/openerp_plugin/skin/overlay.css | 3 +
.../chrome/openerp_plugin/skin/perform.gif | Bin 0 -> 89 bytes
.../chrome/openerp_plugin/skin/settings.png | Bin 0 -> 2455 bytes
.../chrome/openerp_plugin/skin/tinyerp-icon.ico | Bin 0 -> 1150 bytes
.../openerp_plugin/components/nsXmlRpcClient.js | 1049 ++++++++++++++++++++
.../plugin/openerp_plugin/components/xml-rpc.xpt | Bin 0 -> 1011 bytes
.../openerp_plugin/defaults/preferences/tiny.js | 61 ++
.../plugin/openerp_plugin/install.js | 105 ++
.../plugin/openerp_plugin/install.rdf | 22 +
.../plugin/openerp_plugin/install.sh | 3 +
.../plugin/openerp_plugin/makefile | 11 +
48 files changed, 2991 insertions(+)
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin.xpi
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome.manifest
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.xul
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/create.xul
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/config.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/create.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/dialog.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/overlay.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/push.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/tiny_xmlrpc.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/tools.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push.xul
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push_dialog.xul
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/selectpartner.xul
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/style.css
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/address.dtd
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/create.dtd
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Archive.png
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Create.png
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Error.gif
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Move.gif
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveDown.png
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveLeft.png
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Search.gif
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Success.gif
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/developped_by.png
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/logo.png
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/openerp.png
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/overlay.css
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/perform.gif
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/settings.png
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/components/nsXmlRpcClient.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/components/xml-rpc.xpt
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/install.js
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/install.rdf
create mode 100755 addons/plugin_thunderbird/plugin/openerp_plugin/install.sh
create mode 100644 addons/plugin_thunderbird/plugin/openerp_plugin/makefile
(limited to 'addons/plugin_thunderbird/plugin')
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin.xpi b/addons/plugin_thunderbird/plugin/openerp_plugin.xpi
new file mode 100644
index 00000000000..f0255b00623
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin.xpi differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome.manifest b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome.manifest
new file mode 100644
index 00000000000..a587ab54181
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome.manifest
@@ -0,0 +1,9 @@
+interfaces components/xml-rpc.xpt
+component {4d7d15c0-3747-4f7f-b6b3-792a5ea1a9aa} components/nsXmlRpcClient.js
+contract @mozilla.org/xml-rpc/client;1 {4d7d15c0-3747-4f7f-b6b3-792a5ea1a9aa}
+category profile-after-change @mozilla.org/xml-rpc/client;1
+content openerp_plugin jar:chrome/openerp_plugin.jar!/content/
+overlay chrome://messenger/content/messenger.xul chrome://openerp_plugin/content/overlay.xul
+locale openerp_plugin en-US jar:chrome/openerp_plugin.jar!/locale/en-US/
+skin openerp_plugin classic/1.0 jar:chrome/openerp_plugin.jar!/skin/
+#style chrome://global/content/customizeToolbar.xul chrome://openerp_plugin/skin/overlay.css
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
new file mode 100644
index 00000000000..05a7279eb78
Binary files /dev/null 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/config.xul b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.xul
new file mode 100644
index 00000000000..86e55537054
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.xul
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &openerp.paresent;
+
+
+
+
+ &develop.value;
+
+
+
+ &information.value;
+ &openerp.value;
+
+ &axelor.value;
+ &tinyerp.value;
+
+
+ Copyright © 2006-TODAY OpenERP SA All Rights Reserved.
+ OpenERP is a trademark of the OpenERP SA Company. OpenERP Web is jointly developed by OpenERP SA & Axelor.
+ Licenced under the terms of OpenERP Public License (OEPL) v1.1 (https://tiny.odoo.com/LICENSE.txt)
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul
new file mode 100644
index 00000000000..00a4869b68f
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
new file mode 100644
index 00000000000..6ad5bc6b351
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/create.xul
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/config.js b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/config.js
new file mode 100644
index 00000000000..0f209b89ea3
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/config.js
@@ -0,0 +1,122 @@
+function load_config_data() {
+ getDbList('DBlist');
+ document.getElementById("txturl").value = getServer();
+ document.getElementById("txtusername").value = getUsername();
+ document.getElementById("txtpassword").value = getPassword();
+ document.getElementById("DBlist_text").value = getDbName();
+}
+
+function config_close() {
+ window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
+ window.open("chrome://openerp_plugin/content/config.xul", "", "chrome");
+}
+
+//set the value of the configuration fields
+function config_change_load() {
+ document.getElementById('txtcurl').value = getPreferenceDefault('server_name', 'localhost')
+ document.getElementById('txtcport').value = getPreferenceDefault('serverport', '8069')
+}
+
+
+function config_ok()
+{
+ var protocol = document.getElementById("dbprotocol_list").value
+ if (document.getElementById('txtcurl').value == '' || document.getElementById('txtcport').value == '') {
+ alert("You Must Enter Server Name and a Port!")
+ return false;
+ }
+ setPreference('serverport', document.getElementById('txtcport').value)
+ setPreference('server_name', document.getElementById('txtcurl').value)
+ setServer(document.getElementById("dbprotocol_list").value+document.getElementById('txtcurl').value +":" + document.getElementById('txtcport').value);
+ config_close()
+}
+
+function openConfigChange() {
+ window.close("chrome://openerp_plugin/content/config.xul", "", "chrome");
+ window.open("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
+}
+
+//xmlrpc request handler for getting the list of database
+var listDbHandler = {
+ onResult: function(client, context, result) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var arrMethodList = result.QueryInterface(Components.interfaces.nsISupportsArray);
+ var count = arrMethodList.Count();
+ if (count < 1) {
+ setDBList("false");
+ return
+ }
+
+ setDBList("true");
+ dbname_saved = getPreference("serverdbname")
+
+ var menu1 = document.createElement("menulist");
+ menu1.setAttribute("id","DBlist");
+ menu1.setAttribute("width","300");
+ var menupopup1 = document.createElement("menupopup");
+ menu1.appendChild(menupopup1)
+
+ // Loop through the results, adding items to the list
+ for (i = 0; i < count; i++) {
+ var dbname = arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsCString).data;
+ menupopup1.appendChild(createMenuItem(dbname, dbname));
+ if (dbname == dbname_saved) {
+ index = i
+ }
+ }
+
+ var db_text_field = document.getElementById("DBlist_text");
+ db_text_field.parentNode.replaceChild(menu1, db_text_field);
+
+ menu1.selectedIndex = index
+ },
+
+
+ onFault: function (client, ctxt, fault) {
+ setDBList("false");
+ },
+
+ onError: function (client, ctxt, status, errorMsg) {
+ setDBList("false");
+ }
+};
+//function to get the database list
+function getDbList(argControl) {
+ setDBList("false");
+ setServerService('xmlrpc/db');
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var xmlRpcClient = getXmlRpc();
+ var cmbDbList = document.getElementById(argControl);
+
+ xmlRpcClient.asyncCall(listDbHandler,cmbDbList,'list',[],0);
+ return [];
+}
+
+
+function check_database() {
+ if (getDBList()=="false") {
+ if (document.getElementById('DBlist_text').value =='') {
+ alert("You Must Enter Database Name.");
+ return false;
+ }
+ return document.getElementById('DBlist_text').value;
+ }
+ else {
+ return document.getElementById('DBlist').value;
+ }
+
+}
+
+function connection() {
+ callback = check_connection(login_success)
+ setPreference('serverdbname', check_database())
+ setServer(document.getElementById('txturl').value);
+ setUsername(document.getElementById('txtusername').value);
+ setPassword(document.getElementById('txtpassword').value);
+ login()
+}
+//function to check the login information
+function login_success() {
+ alert("login successfull");
+ window.close("chrome://openerp_plugin/content/config.xul", "", "chrome");
+}
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
new file mode 100644
index 00000000000..21faf9f7949
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/create.js
@@ -0,0 +1,126 @@
+function load_createContact() {
+ log_message("info : " + getPreference('senderemail') + ", " + getPreference('sendername'))
+ document.getElementById("txtname").value = getSenderName();
+ document.getElementById("txtemail").value = getSenderEmail();
+ setPartnerId(0);
+}
+
+//function to create the xmlrpc supported variables for xmlrpc request
+function dictcontact(a,b){
+ var temp = xmlRpcClient.createType(xmlRpcClient.ARRAY,{});
+ for(i=0;i 1) {
+ alert("You must select only one mail to archive");
+ return false
+ }
+ return fun()
+ }
+ if(getPreference('userid', 'INT') == 0 || getmodule_install() == "no") {
+ callback = check_connection(cb)
+ login()
+ return False
+ }
+
+ return cb()
+
+}
+
+function searchmail()
+{
+ var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
+ var dirService = Components.classes["@mozilla.org/file/directory_service;1"].
+ getService(Components.interfaces.nsIProperties).get("Home", Components.interfaces.nsIFile);
+
+
+ //gives the selected email uri
+ var messageUri= gDBView.URIForFirstSelectedMessage;
+
+ var messenger = Components.classes['@mozilla.org/messenger;1'].createInstance(Components.interfaces.nsIMessenger);
+
+ //gives the selected email object
+ var message = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri);
+
+ //gives the received email date
+ var stdate = new Date(message.date / 1000);
+
+ //functionality to split the author name and email
+ if(message.author.charAt(0) == '"'){
+ sendername = message.author.split('"')[1].split('"')[0];
+ }
+ else if(message.author.indexOf('<')!=-1){
+ sendername = message.author.split('<')[0];
+ }
+ else{
+ sendername = message.author;
+ }
+ if(message.author.indexOf('<')!=-1){
+ senderemail = message.author.split('<')[1].split('>')[0];
+ }
+ else{
+ senderemail = message.author
+ }
+
+ //gives the receiver email address
+ receiveremail = message.mime2DecodedRecipients;
+
+ //parsing the received date in the particular format
+ receivedDate = stdate.getFullYear()+'/'+(stdate.getMonth()+1)+'/'+stdate.getDate();
+
+ //gives the selected email subject
+ subject = message.subject;
+ log_message("subject: " + subject)
+ var uri = message.folder.getUriForMsg(message);
+ var messagebody = getMessage(uri);
+ getPref().setCharPref('email_text', messagebody);
+
+
+ //set the initial information for the selected email
+ window.open("chrome://openerp_plugin/content/push.xul", "", "chrome, resizable=yes");
+}
+
+
+var openPartnerHandler = {
+ onResult: function(client, context, result) {
+ log_message('get partner')
+ log_message(1)
+ res = extract_data(result)
+ log_message(2)
+ log_message(res[RES_ID])
+ log_message(3)
+ log_message(res[URL])
+ log_message(4)
+ if(res[RES_ID]==0)
+ {
+ alert("Partner is not Available.");
+ window.open("chrome://openerp_plugin/content/create.xul", "", "chrome, resizable=yes");
+ return;
+ }
+ open_url(res[URL])
+
+
+ },
+ onFault: function (client, ctxt, fault) {
+ log_message(fault);
+ },
+
+ onError: function (client, ctxt, status, errorMsg) {
+ log_message(errorMsg)
+ }
+
+}
+
+function searchPartner(email)
+{
+ setServerService('xmlrpc/object');
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+
+ var xmlRpcClient = getXmlRpc();
+ var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
+ var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
+ var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
+ var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
+ var strmethod = get_rpc_string(xmlRpcClient, 'partner_get');
+ var strname = get_rpc_string(xmlRpcClient, email);
+ xmlRpcClient.asyncCall(openPartnerHandler,null,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6);
+}
+
+
+function open_partner()
+{
+ //gives the selected email uri
+ var messageUri= gDBView.URIForFirstSelectedMessage;
+
+
+ var messenger = Components.classes['@mozilla.org/messenger;1'].createInstance(Components.interfaces.nsIMessenger);
+
+ //gives the selected email object
+ var message = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri);
+ //functionality to split the author name and email
+ if(message.author.charAt(0) == '"'){
+ sendername = message.author.split('"')[1].split('"')[0];
+ }
+ else if(message.author.indexOf('<')!=-1){
+ sendername = message.author.split('<')[0];
+ }
+ else{
+ sendername = message.author;
+ }
+ if(message.author.indexOf('<')!=-1){
+ senderemail = message.author.split('<')[1].split('>')[0];
+ }
+ else{
+ senderemail = message.author;
+ }
+ setPreference('senderemail', senderemail);
+ setPreference('sendername', sendername);
+ searchPartner(senderemail);
+}
+
+
+var listDocumentHandler = {
+ onResult: function(client, context, result) {
+ res = extract_data(result)
+ log_message("open document")
+ 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');
+ }
+ else {
+ open_url(res[URL])
+ }
+
+ },
+ onFault: function (client, ctxt, fault) {
+ log_message(fault);
+ },
+
+ onError: function (client, ctxt, status, errorMsg) {
+ log_message(errorMsg)
+ }
+}
+
+function open_document() {
+ var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
+
+ //gives the selected email uri
+ var messageUri = gDBView.URIForFirstSelectedMessage;
+
+ var branchobj = getPref();
+
+ setServerService('xmlrpc/object');
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+
+ var xmlRpcClient = getXmlRpc();
+ var strDbName = get_rpc_string(xmlRpcClient, branchobj.getCharPref("serverdbname"));
+ var struids = get_rpc_int(xmlRpcClient, branchobj.getIntPref('userid'));
+ var strpass = get_rpc_string(xmlRpcClient, branchobj.getCharPref("password"));
+ var strmethod = get_rpc_string(xmlRpcClient, 'document_get');
+
+ var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
+
+ var eml_string = getMessage(messageUri);
+ 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
new file mode 100644
index 00000000000..86596397c99
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/push.js
@@ -0,0 +1,187 @@
+//xmlrpc request handler for list of search object exist in database or not.
+var DocumentTypeHandler = {
+ onResult: function(client, context, result) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var modelListRPC = result.QueryInterface(Components.interfaces.nsISupportsArray);
+
+ var menu_popup = document.getElementById("model_list");
+ log_message("count : " + modelListRPC.Count())
+ for(i = 0; i < modelListRPC.Count(); i++) {
+ var temp_array = modelListRPC.QueryElementAt(i, Components.interfaces.nsISupportsArray);
+ var model_value = temp_array.QueryElementAt(0, Components.interfaces.nsISupportsCString);
+ var model_name = temp_array.QueryElementAt(1, Components.interfaces.nsISupportsCString);
+ if(i == 0) {
+ var menuitem = document.getElementById("first_model_list");
+ menuitem.setAttribute("label", model_name);
+ menuitem.setAttribute("value", model_value);
+ }
+ else {
+ menu_popup.appendChild(createMenuItem(model_name, model_value));
+ }
+
+ }
+ },
+
+ onFault: function (client, ctxt, fault) {
+ log_message("Fault getDocument : " + fault)
+ },
+
+ onError: function (client, ctxt, status, errorMsg) {
+ log_message("Error getDocument : " + errorMsg)
+ }
+}
+
+//function to create a new attachment record
+function getDocumentType(){
+ setServerService('xmlrpc/object');
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var xmlRpcClient = getXmlRpc();
+ var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
+ var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
+ var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
+ var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
+ var strmethod = get_rpc_string(xmlRpcClient, 'document_type');
+ xmlRpcClient.asyncCall(DocumentTypeHandler,null,'execute',[strDbName,struid,strpass,strobj,strmethod], 5);
+}
+
+/**
+ * Return the current operation :
+ * add or create
+ */
+function getOperation() {
+ var operation = document.getElementById('operation').selectedItem;
+ return operation.value
+}
+
+function changeForm() {
+
+ var hidden = false
+
+ if(getOperation() == "create") {
+ hidden = true
+ }
+ document.getElementById('label_box').hidden = hidden
+ document.getElementById('listSearchBox').hidden = hidden
+ document.getElementById('lblsearch').hidden = hidden
+ document.getElementById('txtvalueobj').hidden = hidden
+ document.getElementById('search_button').hidden = hidden
+}
+
+
+
+/**
+ * Search Handler : Fill the result of list_document_get in the listbox
+ */
+//xmlrpc request handler for getting the search results for the particular selected check box object
+var listSearchCheckboxHandler = {
+ onResult: function(client, context, result) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var arrMethodList = result.QueryInterface(Components.interfaces.nsISupportsArray);
+ // Set the number of results
+ var count = arrMethodList.Count();
+ var close=0;
+ clear_search_box('listSearchBox')
+ if(count == 0){
+ alert("No Records Found");
+ return false;
+ }
+ log_message("count on result : " + count)
+
+ // Loop through the results, adding items to the list
+ var cmbSearchList = document.getElementById('listSearchBox');
+
+ for (i = 0; i < count; i++) {
+ var temp = arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsArray);
+ log_message(temp)
+ id = temp.QueryElementAt(0, Components.interfaces.nsISupportsPRInt32);
+ name = temp.QueryElementAt(1, Components.interfaces.nsISupportsCString);
+ log_message(id + " " + name)
+ var listItem = document.createElement("listitem");
+ cmbSearchList.appendItem(name, id)
+ }
+ },
+
+ onFault: function (client, ctxt, fault) {
+ log_message(fault)
+ },
+
+ onError: function (client, ctxt, status, errorMsg) {
+ log_message(errorMsg)
+ }
+};
+
+//function to search the records of selected checkbox object
+function searchCheckbox()
+{
+ model_name = document.getElementById('menu_model_list').selectedItem.value;
+ name = document.getElementById('txtvalueobj').value
+
+ setServerService('xmlrpc/object');
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var xmlRpcClient = getXmlRpc();
+ var cmbSearchList = document.getElementById('listSearchBox');
+ var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
+ var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
+ var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
+ var strmethod = get_rpc_string(xmlRpcClient, 'list_document_get');
+ var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
+ var strmodel = get_rpc_string(xmlRpcClient, model_name);
+ var strname = get_rpc_string(xmlRpcClient, name);
+
+ xmlRpcClient.asyncCall(listSearchCheckboxHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod, strmodel, strname],7);
+}
+
+
+
+//xmlrpc request handler for creating the record of mail
+var pushHandler = {
+ onResult: function(client, context, result) {
+ log_message("push finished")
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var message = result.QueryInterface(Components.interfaces.nsISupportsCString);
+ log_message(message)
+ alert(message)
+ window.close();
+ },
+
+ onFault: function (client, ctxt, fault) {
+ log_message(fault)
+ },
+
+ onError: function (client, ctxt, status, errorMsg) {
+ log_message(errorMsg)
+ }
+}
+
+
+function push() {
+ var model_name = document.getElementById('menu_model_list').selectedItem.value;
+ var res_id = 0;
+ if(getOperation() == "add") {
+ var item = document.getElementById('listSearchBox').selectedItem
+ if (String(item) == "null") {
+ alert("select at least one Document !")
+ return
+ }
+
+ var res_id = item.value;
+
+ }
+ log_message("model :" + model_name + ", res_id : " + res_id)
+ setServerService('xmlrpc/object');
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var xmlRpcClient = getXmlRpc();
+
+ var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
+ var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
+ var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
+ var strmethod = get_rpc_string(xmlRpcClient, 'push_message');
+ var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
+ var stremail = get_rpc_string(xmlRpcClient, getPreference('email_text'));
+ var strmodel = get_rpc_string(xmlRpcClient, model_name);
+ var strres_id = get_rpc_int(xmlRpcClient, res_id);
+ xmlRpcClient.asyncCall(pushHandler,null,'execute',[strDbName,struid,strpass,strobj,strmethod,strmodel, stremail, strres_id],8);
+}
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/tiny_xmlrpc.js b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/tiny_xmlrpc.js
new file mode 100644
index 00000000000..a553010c624
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/js/tiny_xmlrpc.js
@@ -0,0 +1,423 @@
+/************************************************************
+* OpenERP, Open Source Management Solution
+* Copyright (C) 2004-2010 Tiny SPRL ().
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Affero General Public License as
+* published by the Free Software Foundation, either version 3 of the
+* License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Affero General Public License for more details.
+*
+* You should have received a copy of the GNU Affero General Public License
+* along with this program. If not, see .
+***************************************************************/
+
+var xmlRpcClient;
+
+//Service name on server like /common,/db etc...
+var strServerService;
+
+
+var uri = new Array();
+var name = new Array();
+var rpc= {
+ servers: {},
+ addserver: function(name,ip,port,path) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ this.servers[name]= {
+ ip: ip,
+ port: port,
+ path: path,
+ avaible: true,
+ sock: Components.classes['@mozilla.org/xml-rpc/client;1'].createInstance(Components.interfaces.nsIXmlRpcClient)};
+ },
+ getany: function(rpcval,n) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var t = ['PRUint8','PRUint16','PRInt16','PRInt32','PRBool','Char','CString','Float','Double','PRTime','InputStream','Array','Dictionary'];
+ for (var i=0; i0)
+ for (var i=0; i"+params[0];
+ msg+= "\n3. Your server may not be launched or connected to the network.";
+ }
+ func_out([false,'error '+status,msg]);
+ } };
+ var p = [];
+ for (var i=0; i
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
new file mode 100644
index 00000000000..b9a17df485f
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push.xul
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
new file mode 100644
index 00000000000..a8d7531e470
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/push_dialog.xul
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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
new file mode 100644
index 00000000000..b999bc8c33d
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/selectpartner.xul
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/style.css b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/style.css
new file mode 100644
index 00000000000..8e490b773b5
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/style.css
@@ -0,0 +1,4 @@
+.text-prompt {
+ padding-top: .25em;
+ text-align: right;
+}
\ No newline at end of file
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/address.dtd b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/address.dtd
new file mode 100644
index 00000000000..3dd37445ada
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/address.dtd
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd
new file mode 100644
index 00000000000..711190962a6
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd
new file mode 100644
index 00000000000..19558a9f077
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change.dtd
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/create.dtd b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/create.dtd
new file mode 100644
index 00000000000..bb5f2c34be6
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/create.dtd
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties
new file mode 100644
index 00000000000..33845423f7d
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/mboximport.properties
@@ -0,0 +1,31 @@
+nomboxfile=není mbox souborem
+folderexists=Není možné importovat: složka se stejným názvem již existuje
+fileexists=Není možné importovat: soubor se stejným názvem již existuje
+nowritable=Není možné importovat: nemáte právo zápisu do složky
+exportOK=Export byl úspěšně dokončen
+isNewsgroup=Tato funkce není dostupná: export složky z IMAP účtů nebo diskuzních \nskupin je možný, pouze pokud je nastavené čtení v režimu Offline
+nofolder=Nebyla vybrána žádná cílová složka
+badfolder=Není možné importovat do této složky (typ IMAP nebo diskuzní skupina)
+exportAccount=Export všech složek
+exportFolder=Export složky
+filePickerImport=Výběr souboru k importu
+filePickerExport=Výběr cílové složky
+extensions.{3ed8cc52-86fc-4613-9026-c1ef969da4c3}.description=Umožňuje import a export souborů ve formátu mbox a eml
+virtualfolder=Toto je virtuální složka. Pro export jejich\nzpráv musíte tyto zprávy nejdříve\nzkopírovat do normální složky.
+searchdir=Vyberte složku, ve které budou vyhledány mbox soubory
+confirmimport=Chcete importovat soubor?
+endscan=Konec prohledávání složek
+internalerror=Není možné provést import, protože nastala neznámá chyba
+exportstart=Probíhá export, čekejte prosím...
+exported=Exportovalo se
+msgs=zpráv z
+nosubjectmsg=bez_predmetu
+messsubdir=zprávy
+badfolder2=Není možné importovat do této složky (IMAP nebo diskuzní skupina nebo virtuální složka)
+temp_error=Není možné importovat: nastala chyba při vytváření dočasného souboru
+importEMLstart=Pobíhá import, čekejte prosím...
+numEML=Naimportovány eml soubory:
+CSVseparator=,
+noEML=No eml file found in this directory
+backupWarning=During this operation, the program could be\nunresponsive for some minutes.\nDo you want to go on?\n
+noWaring=Don't show again this warning
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd
new file mode 100644
index 00000000000..e649eb92ced
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd
new file mode 100644
index 00000000000..cd00045c22a
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/plugin.dtd
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd
new file mode 100644
index 00000000000..d568b96a4ca
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/selectpartner.dtd
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Archive.png b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Archive.png
new file mode 100644
index 00000000000..5aa6a958d37
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Archive.png differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Create.png b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Create.png
new file mode 100644
index 00000000000..1ab240c32cb
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Create.png differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Error.gif b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Error.gif
new file mode 100644
index 00000000000..38c3523781b
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Error.gif differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Move.gif b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Move.gif
new file mode 100644
index 00000000000..401bf861213
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Move.gif differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveDown.png b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveDown.png
new file mode 100644
index 00000000000..3761ff1e747
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveDown.png differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveLeft.png b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveLeft.png
new file mode 100644
index 00000000000..031d7532673
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/MoveLeft.png differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Search.gif b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Search.gif
new file mode 100644
index 00000000000..b29c3cf1054
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Search.gif differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Success.gif b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Success.gif
new file mode 100644
index 00000000000..fb3bff729c5
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/Success.gif differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/developped_by.png b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/developped_by.png
new file mode 100644
index 00000000000..e4004e3d178
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/developped_by.png differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/logo.png b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/logo.png
new file mode 100644
index 00000000000..d6dbd9d83d1
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/logo.png differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/openerp.png b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/openerp.png
new file mode 100644
index 00000000000..326798df2ec
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/openerp.png differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/overlay.css b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/overlay.css
new file mode 100644
index 00000000000..1f71b8fdcbe
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/overlay.css
@@ -0,0 +1,3 @@
+menuitem#tiny-plugin {
+ color: red !important;
+}
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/perform.gif b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/perform.gif
new file mode 100644
index 00000000000..16cc3873858
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/perform.gif differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/settings.png b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/settings.png
new file mode 100644
index 00000000000..ad0298af667
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/settings.png differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico
new file mode 100644
index 00000000000..0057dc4c879
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/tinyerp-icon.ico differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/components/nsXmlRpcClient.js b/addons/plugin_thunderbird/plugin/openerp_plugin/components/nsXmlRpcClient.js
new file mode 100644
index 00000000000..cf702b4141f
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/components/nsXmlRpcClient.js
@@ -0,0 +1,1049 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla XML-RPC Client component.
+ *
+ * The Initial Developer of the Original Code is
+ * Digital Creations 2, Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2000
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Martijn Pieters (original author)
+ * Samuel Sieb
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/*
+ * nsXmlRpcClient XPCOM component
+ * Version: $Revision: 1.39 $
+ *
+ * $Id: nsXmlRpcClient.js,v 1.39 2006/10/24 16:02:01 silver%warwickcompsoc.co.uk Exp $
+ */
+
+/*
+ * Constants
+ */
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
+const XMLRPCCLIENT_CONTRACTID = '@mozilla.org/xml-rpc/client;1';
+const XMLRPCCLIENT_CID =
+ Components.ID('{4d7d15c0-3747-4f7f-b6b3-792a5ea1a9aa}');
+const XMLRPCCLIENT_IID = Components.interfaces.nsIXmlRpcClient;
+
+const XMLRPCFAULT_CONTRACTID = '@mozilla.org/xml-rpc/fault;1';
+const XMLRPCFAULT_CID =
+ Components.ID('{691cb864-0a7e-448c-98ee-4a7f359cf145}');
+const XMLRPCFAULT_IID = Components.interfaces.nsIXmlRpcFault;
+
+const XMLHTTPREQUEST_CONTRACTID = '@mozilla.org/xmlextras/xmlhttprequest;1';
+
+const NSICHANNEL = Components.interfaces.nsIChannel;
+
+const DEBUG = false;
+const DEBUGPARSE = false;
+
+const DOMNode = Components.interfaces.nsIDOMNode;
+/*
+ * Class definitions
+ */
+
+/* The nsXmlRpcFault class constructor. */
+function nsXmlRpcFault() {}
+
+/* the nsXmlRpcFault class def */
+nsXmlRpcFault.prototype = {
+ faultCode: 0,
+ faultString: '',
+
+ init: function(faultCode, faultString) {
+ this.faultCode = faultCode;
+ this.faultString = faultString;
+ },
+
+ toString: function() {
+ return '';
+ },
+
+ // nsISupports interface
+ QueryInterface: function(iid) {
+ if (!iid.equals(Components.interfaces.nsISupports) &&
+ !iid.equals(XMLRPCFAULT_IID))
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ return this;
+ }
+};
+
+/* The nsXmlRpcClient class constructor. */
+function nsXmlRpcClient() {}
+
+/* the nsXmlRpcClient class def */
+nsXmlRpcClient.prototype = {
+ _serverUrl: null,
+ _useAuth: false,
+
+ classDescription: "nsXmlRpcClient XPCOM component",
+ classID: Components.ID("{4d7d15c0-3747-4f7f-b6b3-792a5ea1a9aa}"),
+ contractID: "@mozilla.org/xml-rpc/client;1",
+
+ init: function(serverURL) {
+ this._serverUrl = serverURL;
+ this._encoding = "UTF-8";
+ },
+
+ setAuthentication: function(username, password){
+ if ((typeof username == "string") &&
+ (typeof password == "string")){
+ this._useAuth = true;
+ this._username = username;
+ this._password = password;
+ }
+ },
+
+ clearAuthentication: function(){
+ this._useAuth = false;
+ },
+
+ setEncoding: function(encoding){
+ this._encoding = encoding;
+ },
+
+ get serverUrl() { return this._serverUrl; },
+
+ // Internal copy of the status
+ _status: null,
+ _listener: null,
+
+ asyncCall: function(listener, context, methodName, methodArgs, count) {
+ debug('asyncCall');
+ // Check for call in progress.
+ if (this._inProgress)
+ return;
+ //throw Components.Exception('Call in progress!');
+
+ // Check for the server URL;
+ if (!this._serverUrl)
+ throw Components.Exception('Not initialized');
+
+ this._inProgress = true;
+
+ // Clear state.
+ this._foundFault = false;
+ this._passwordTried = false;
+ this._result = null;
+ this._fault = null;
+ this._status = null;
+ this._responseStatus = null;
+ this._responseString = null;
+ this._listener = listener;
+ this._seenStart = false;
+ this._context = context;
+
+ debug('Arguments: ' + methodArgs);
+
+ // Generate request body
+ var xmlWriter = new XMLWriter(this._encoding);
+ this._generateRequestBody(xmlWriter, methodName, methodArgs);
+
+ var requestBody = xmlWriter.data;
+
+ debug('Request: ' + requestBody);
+
+ this.xmlhttp = Components.classes[XMLHTTPREQUEST_CONTRACTID]
+ .createInstance(Components.interfaces.nsIXMLHttpRequest);
+ if (this._useAuth) {
+ this.xmlhttp.open('POST', this._serverUrl, true,
+ this._username, this._password);
+ } else {
+ this.xmlhttp.open('POST', this._serverUrl);
+ }
+ this.xmlhttp.onload = this._onload;
+ this.xmlhttp.onerror = this._onerror;
+ this.xmlhttp.parent = this;
+ this.xmlhttp.setRequestHeader('Content-Type','text/xml');
+ this.xmlhttp.send(requestBody);
+ var chan = this.xmlhttp.channel.QueryInterface(NSICHANNEL);
+ chan.notificationCallbacks = this;
+ },
+
+ _onload: function(e) {
+ var result;
+ var parent = e.target.parent;
+ parent._inProgress = false;
+ parent._responseStatus = e.target.status;
+ parent._responseString = e.target.statusText;
+ if (!e.target.responseXML) {
+ if (e.target.status) {
+ try {
+ parent._listener.onError(parent, parent._context,
+ Components.results.NS_ERROR_FAILURE,
+ 'Server returned status ' + e.target.status);
+ } catch (ex) {
+ debug('Exception in listener.onError: ' + ex);
+ }
+ } else {
+ try {
+ parent._listener.onError(parent, parent._context,
+ Components.results.NS_ERROR_FAILURE,
+ 'Unknown network error');
+ } catch (ex) {
+ debug('Exception in listener.onError: ' + ex);
+ }
+ }
+ return;
+ }
+ try {
+ e.target.responseXML.normalize();
+ result = parent.parse(e.target.responseXML);
+ } catch (ex) {
+ try {
+ parent._listener.onError(parent, parent._context,
+ ex.result, ex.message);
+ } catch (ex) {
+ debug('Exception in listener.onError: ' + ex);
+ }
+ return;
+ }
+ if (parent._foundFault) {
+ parent._fault = result;
+ try {
+ parent._listener.onFault(parent, parent._context, result);
+ } catch(ex) {
+ debug('Exception in listener.onFault: ' + ex);
+ }
+ } else {
+ parent._result = result.value;
+ try {
+ parent._listener.onResult(parent, parent._context,
+ result.value);
+ } catch (ex) {
+ debug('Exception in listener.onResult: ' + ex);
+ }
+ }
+ },
+
+ _onerror: function(e) {
+ var parent = e.target.parent;
+ parent._inProgress = false;
+ try {
+ parent._listener.onError(parent, parent._context,
+ Components.results.NS_ERROR_FAILURE,
+ 'Unknown network error');
+ } catch (ex) {
+ debug('Exception in listener.onError: ' + ex);
+ }
+ },
+
+ _foundFault: false,
+
+ _fault: null,
+ _result: null,
+ _responseStatus: null,
+ _responseString: null,
+
+ get fault() { return this._fault; },
+ get result() { return this._result; },
+ get responseStatus() { return this._responseStatus; },
+ get responseString() { return this._responseString; },
+
+ /* Convenience. Create an appropriate XPCOM object for a given type */
+ INT: 1,
+ BOOLEAN: 2,
+ STRING: 3,
+ DOUBLE: 4,
+ DATETIME: 5,
+ ARRAY: 6,
+ STRUCT: 7,
+ BASE64: 8, // Not part of nsIXmlRpcClient interface, internal use.
+ createType: function(type, uuid) {
+ const SUPPORTSID = '@mozilla.org/supports-';
+ switch(type) {
+ case this.INT:
+ uuid.value = Components.interfaces.nsISupportsPRInt32
+ return createInstance(SUPPORTSID + 'PRInt32;1',
+ 'nsISupportsPRInt32');
+
+ case this.BOOLEAN:
+ uuid.value = Components.interfaces.nsISupportsPRBool
+ return createInstance(SUPPORTSID + 'PRBool;1',
+ 'nsISupportsPRBool');
+
+ case this.STRING:
+ uuid.value = Components.interfaces.nsISupportsCString
+ return createInstance(SUPPORTSID + 'cstring;1',
+ 'nsISupportsCString');
+
+ case this.DOUBLE:
+ uuid.value = Components.interfaces.nsISupportsDouble
+ return createInstance(SUPPORTSID + 'double;1',
+ 'nsISupportsDouble');
+
+ case this.DATETIME:
+ uuid.value = Components.interfaces.nsISupportsPRTime
+ return createInstance(SUPPORTSID + 'PRTime;1',
+ 'nsISupportsPRTime');
+
+ case this.ARRAY:
+ uuid.value = Components.interfaces.nsISupportsArray
+ return createInstance(SUPPORTSID + 'array;1',
+ 'nsISupportsArray');
+
+ case this.STRUCT:
+ uuid.value = Components.interfaces.nsIDictionary
+ return createInstance('@mozilla.org/dictionary;1',
+ 'nsIDictionary');
+
+ default: throw Components.Exception('Unsupported type');
+ }
+ },
+
+ // nsISupports interface
+ QueryInterface: function(iid) {
+ if (!iid.equals(Components.interfaces.nsISupports) &&
+ !iid.equals(XMLRPCCLIENT_IID) &&
+ !iid.equals(Components.interfaces.nsIInterfaceRequestor))
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ return this;
+ },
+
+ // nsIInterfaceRequester interface
+ getInterface: function(iid, result){
+ if (iid.equals(Components.interfaces.nsIAuthPrompt)){
+ return this;
+ }
+ Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
+ return null;
+ },
+
+ // nsIAuthPrompt interface
+ _passwordTried: false,
+ promptUsernameAndPassword: function(dialogTitle, text, passwordRealm,
+ savePassword, user, pwd){
+
+ if (this._useAuth){
+ if (this._passwordTried){
+ return false;
+ }
+ user.value = this._username;
+ pwd.value = this._password;
+ this._passwordTried = true;
+ return true;
+ }
+ return false;
+ },
+
+ /* Generate the XML-RPC request body */
+ _generateRequestBody: function(writer, methodName, methodArgs) {
+ writer.startElement('methodCall');
+
+ writer.startElement('methodName');
+ writer.write(methodName);
+ writer.endElement('methodName');
+
+ writer.startElement('params');
+ for (var i = 0; i < methodArgs.length; i++) {
+ writer.startElement('param');
+ this._generateArgumentBody(writer, methodArgs[i]);
+ writer.endElement('param');
+ }
+ writer.endElement('params');
+
+ writer.endElement('methodCall');
+ },
+
+ /* Write out a XML-RPC parameter value */
+ _generateArgumentBody: function(writer, obj) {
+ writer.startElement('value');
+ var sType = this._typeOf(obj);
+ switch (sType) {
+ case 'PRUint8':
+ case 'PRUint16':
+ case 'PRInt16':
+ case 'PRInt32':
+ obj=obj.QueryInterface(Components.interfaces['nsISupports' +
+ sType]);
+ writer.startElement('i4');
+ writer.write(obj.toString());
+ writer.endElement('i4');
+ break;
+
+ case 'PRBool':
+ obj=obj.QueryInterface(Components.interfaces.nsISupportsPRBool);
+ writer.startElement('boolean');
+ writer.write(obj.data ? '1' : '0');
+ writer.endElement('boolean');
+ break;
+
+ case 'Char':
+ case 'CString':
+ obj=obj.QueryInterface(Components.interfaces['nsISupports' +
+ sType]);
+ writer.startElement('string');
+ writer.write(obj.toString());
+ writer.endElement('string');
+ break;
+
+ case 'Float':
+ case 'Double':
+ obj=obj.QueryInterface(Components.interfaces['nsISupports' +
+ sType]);
+ writer.startElement('double');
+ writer.write(obj.toString());
+ writer.endElement('double');
+ break;
+
+ case 'PRTime':
+ obj = obj.QueryInterface(
+ Components.interfaces.nsISupportsPRTime);
+ var date = new Date(obj.data)
+ writer.startElement('dateTime.iso8601');
+ writer.write(iso8601Format(date));
+ writer.endElement('dateTime.iso8601');
+ break;
+
+ case 'InputStream':
+ obj = obj.QueryInterface(Components.interfaces.nsIInputStream);
+ obj = toScriptableStream(obj);
+ writer.startElement('base64');
+ streamToBase64(obj, writer);
+ writer.endElement('base64');
+ break;
+
+ case 'Array':
+ obj = obj.QueryInterface(
+ Components.interfaces.nsISupportsArray);
+ writer.startElement('array');
+ writer.startElement('data');
+ for (var i = 0; i < obj.Count(); i++)
+ this._generateArgumentBody(writer, obj.GetElementAt(i));
+ writer.endElement('data');
+ writer.endElement('array');
+ break;
+
+ case 'Dictionary':
+ obj = obj.QueryInterface(Components.interfaces.nsIDictionary);
+ writer.startElement('struct');
+ var keys = obj.getKeys({});
+ for (var k = 0; k < keys.length; k++) {
+ writer.startElement('member');
+ writer.startElement('name');
+ writer.write(keys[k]);
+ writer.endElement('name');
+ this._generateArgumentBody(writer, obj.getValue(keys[k]));
+ writer.endElement('member');
+ }
+ writer.endElement('struct');
+ break;
+
+ default:
+ throw Components.Exception('Unsupported argument', null, null,
+ obj);
+ }
+
+ writer.endElement('value');
+ },
+
+ /* Determine type of a nsISupports primitive, array or dictionary. */
+ _typeOf: function(obj) {
+ // XPConnect alows JS to pass in anything, because we are a regular
+ // JS object to it. So we have to test rigorously.
+ if (typeof obj != 'object') return 'Unknown';
+
+ // Anything else not nsISupports is not allowed.
+ if (typeof obj.QueryInterface != 'function') return 'Unknown';
+
+ // Now we will have to eliminate by trying all possebilities.
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsPRUint8);
+ return 'PRUint8';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsPRUint16);
+ return 'PRUint16';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsPRInt16);
+ return 'PRInt16';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsPRInt32);
+ return 'PRInt32';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsPRBool);
+ return 'PRBool';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsChar);
+ return 'Char';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsCString);
+ return 'CString';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsFloat);
+ return 'Float';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsDouble);
+ return 'Double';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsPRTime);
+ return 'PRTime';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsIInputStream);
+ return 'InputStream';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsISupportsArray);
+ return 'Array';
+ } catch(e) {}
+
+ try {
+ obj.QueryInterface(Components.interfaces.nsIDictionary);
+ return 'Dictionary';
+ } catch(e) {}
+
+ // Not a supported type
+ return 'Unknown';
+ },
+
+ // Response parsing state
+ _valueStack: [],
+ _currValue: null,
+ _cdata: null,
+
+ parse: function(doc) {
+ var node = doc.firstChild;
+ var result;
+ if (node.nodeType == DOMNode.TEXT_NODE)
+ node = node.nextSibling;
+ if ((node.nodeType != DOMNode.ELEMENT_NODE) ||
+ (node.nodeName != 'methodResponse')) {
+ throw Components.Exception('Expecting a methodResponse', null, null,
+ doc);
+ }
+ node = node.firstChild;
+ if (node.nodeType == DOMNode.TEXT_NODE)
+ node = node.nextSibling;
+ if (node.nodeType != DOMNode.ELEMENT_NODE)
+ throw Components.Exception('Expecting a params or fault', null,
+ null, doc);
+ if (node.nodeName == 'params') {
+ node = node.firstChild;
+ if (node.nodeType == DOMNode.TEXT_NODE)
+ node = node.nextSibling;
+ if ((node.nodeType != DOMNode.ELEMENT_NODE) ||
+ (node.nodeName != 'param')) {
+ throw Components.Exception('Expecting a param', null, null,
+ doc);
+ }
+ result = this.parseValue(node.firstChild);
+ } else if (node.nodeName == 'fault') {
+ this._foundFault = true;
+ result = this.parseFault(node.firstChild);
+ } else {
+ throw Components.Exception('Expecting a params or fault', null,
+ null, doc);
+ }
+ debug('Parse finished');
+ return result;
+ },
+
+ parseValue: function(node) {
+ var cValue = new Value();
+ if (node && (node.nodeType == DOMNode.TEXT_NODE))
+ node = node.nextSibling;
+ if (!node || (node.nodeType != DOMNode.ELEMENT_NODE) ||
+ (node.nodeName != 'value')) {
+ throw Components.Exception('Expecting a value', null, null, node);
+ }
+ node = node.firstChild;
+ if (!node)
+ return cValue;
+ if (node.nodeType == DOMNode.TEXT_NODE){
+ if (!node.nextSibling) {
+ cValue.value = node.nodeValue;
+ return cValue;
+ } else {
+ node = node.nextSibling;
+ }
+ }
+ if (node.nodeType != DOMNode.ELEMENT_NODE)
+ throw Components.Exception('Expecting a value type', null, null,
+ node);
+ switch (node.nodeName) {
+ case 'string':
+ cValue.value = this.parseString(node.firstChild);
+ break;
+ case 'i4':
+ case 'int':
+ cValue.type = this.INT;
+ cValue.value = this.parseString(node.firstChild);
+ break;
+ case 'boolean':
+ cValue.type = this.BOOLEAN;
+ cValue.value = this.parseString(node.firstChild);
+ break;
+ case 'double':
+ cValue.type = this.DOUBLE;
+ cValue.value = this.parseString(node.firstChild);
+ break;
+ case 'dateTime.iso8601':
+ cValue.type = this.DATETIME;
+ cValue.value = this.parseString(node.firstChild);
+ break;
+ case 'base64':
+ cValue.type = this.BASE64;
+ cValue.value = this.parseString(node.firstChild);
+ break;
+ case 'struct':
+ cValue.type = this.STRUCT;
+ this.parseStruct(cValue, node.firstChild);
+ break;
+ case 'array':
+ cValue.type = this.ARRAY;
+ this.parseArray(cValue, node.firstChild);
+ break;
+ default:
+ throw Components.Exception('Expecting a value type', null, null,
+ node);
+ }
+ return cValue;
+ },
+
+ parseString: function(node) {
+ value = '';
+ while (node) {
+ if (node.nodeType != DOMNode.TEXT_NODE)
+ throw Components.Exception('Expecting a text node', null, null,
+ node);
+ value += node.nodeValue;
+ node = node.nextSibling;
+ }
+ return value;
+ },
+
+ parseStruct: function(struct, node) {
+ while (node) {
+ if (node.nodeType == DOMNode.TEXT_NODE)
+ node = node.nextSibling;
+ if (!node)
+ return;
+ if ((node.nodeType != DOMNode.ELEMENT_NODE) ||
+ (node.nodeName != 'member')) {
+ throw Components.Exception('Expecting a member', null, null,
+ node);
+ }
+ this.parseMember(struct, node.firstChild);
+ node = node.nextSibling;
+ }
+ },
+
+ parseMember: function(struct, node) {
+ var cValue;
+ if (node.nodeType == DOMNode.TEXT_NODE)
+ node = node.nextSibling;
+ if (!node || (node.nodeType != DOMNode.ELEMENT_NODE) ||
+ (node.nodeName != 'name')) {
+ throw Components.Exception('Expecting a name', null, null, node);
+ }
+ struct.name = this.parseString(node.firstChild);
+ cValue = this.parseValue(node.nextSibling);
+ struct.appendValue(cValue.value);
+ },
+
+ parseArray: function(array, node) {
+ if (node.nodeType == DOMNode.TEXT_NODE)
+ node = node.nextSibling;
+ if (!node || (node.nodeType != DOMNode.ELEMENT_NODE) ||
+ (node.nodeName != 'data')) {
+ throw Components.Exception('Expecting array data', null, null, node);
+ }
+ for (node = node.firstChild; node; node = node.nextSibling) {
+ if (node.nodeType == DOMNode.TEXT_NODE)
+ continue;
+ array.appendValue(this.parseValue(node).value);
+ }
+ },
+
+ parseFault: function(node) {
+ var fault = createInstance(XMLRPCFAULT_CONTRACTID, 'nsIXmlRpcFault');
+ var cValue = this.parseValue(node);
+ if ((cValue.type != this.STRUCT) ||
+ (!cValue.value.hasKey('faultCode')) ||
+ (!cValue.value.hasKey('faultString'))) {
+ throw Components.Exception('Invalid fault', null, null, node);
+ }
+ fault.init(cValue.value.getValue('faultCode').data,
+ cValue.value.getValue('faultString').data);
+ return fault;
+ }
+};
+
+if (XPCOMUtils.generateNSGetFactory)
+ var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsXmlRpcClient]);
+else
+ var NSGetModule = XPCOMUtils.generateNSGetModule([nsXmlRpcClient]);
+
+
+/* The XMLWriter class constructor */
+function XMLWriter(encoding) {
+ if (!encoding)
+ encoding = "UTF-8";
+ this.data = '';
+}
+
+/* The XMLWriter class def */
+XMLWriter.prototype = {
+ data: '',
+
+ startElement: function(element) {
+ this.data += '<' + element + '>';
+ },
+
+ endElement: function(element) {
+ this.data += '' + element + '>';
+ },
+
+ write: function(text) {
+ for (var i = 0; i < text.length; i++) {
+ var c = text[i];
+ switch (c) {
+ case '<':
+ this.data += '<';
+ break;
+ case '&':
+ this.data += '&';
+ break;
+ default:
+ this.data += c;
+ }
+ }
+ },
+
+ markup: function(text) { this.data += text }
+};
+
+/* The Value class contructor */
+function Value() { this.type = this.STRING; };
+
+/* The Value class def */
+Value.prototype = {
+ INT: nsXmlRpcClient.prototype.INT,
+ BOOLEAN: nsXmlRpcClient.prototype.BOOLEAN,
+ STRING: nsXmlRpcClient.prototype.STRING,
+ DOUBLE: nsXmlRpcClient.prototype.DOUBLE,
+ DATETIME: nsXmlRpcClient.prototype.DATETIME,
+ ARRAY: nsXmlRpcClient.prototype.ARRAY,
+ STRUCT: nsXmlRpcClient.prototype.STRUCT,
+ BASE64: nsXmlRpcClient.prototype.BASE64,
+
+ _createType: nsXmlRpcClient.prototype.createType,
+
+ name: null,
+
+ _value: null,
+ get value() { return this._value; },
+ set value(val) {
+ // accepts [0-9]+ or x[0-9a-fA-F]+ and returns the character.
+ function entityTrans(substr, code) {
+ return String.fromCharCode("0" + code);
+ }
+
+ switch (this.type) {
+ case this.STRING:
+ val = val.replace(/([0-9]+);/g, entityTrans);
+ val = val.replace(/(x[0-9a-fA-F]+);/g, entityTrans);
+ val = val.replace(/</g, '<');
+ val = val.replace(/>/g, '>');
+ val = val.replace(/&/g, '&');
+ this._value.data = val;
+ break;
+
+ case this.BOOLEAN:
+ this._value.data = (val == 1);
+ break;
+
+ case this.DATETIME:
+ this._value.data = Date.UTC(val.slice(0, 4),
+ val.slice(4, 6) - 1, val.slice(6, 8), val.slice(9, 11),
+ val.slice(12, 14), val.slice(15));
+ break;
+
+ case this.BASE64:
+ this._value.data = base64ToString(val);
+ break;
+
+ default:
+ this._value.data = val;
+ }
+ },
+
+ _type: null,
+ get type() { return this._type; },
+ set type(type) {
+ this._type = type;
+ if (type == this.BASE64)
+ this._value = this._createType(this.STRING, {});
+ else this._value = this._createType(type, {});
+ },
+
+ appendValue: function(val) {
+ switch (this.type) {
+ case this.ARRAY:
+ this.value.AppendElement(val);
+ break;
+
+ case this.STRUCT:
+ this.value.setValue(this.name, val);
+ break;
+ }
+ }
+};
+
+/*
+ * Objects
+ */
+
+/* nsXmlRpcClient Module (for XPCOM registration) */
+var nsXmlRpcClientModule = {
+ registerSelf: function(compMgr, fileSpec, location, type) {
+ compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
+
+ compMgr.registerFactoryLocation(XMLRPCCLIENT_CID,
+ 'XML-RPC Client JS component',
+ XMLRPCCLIENT_CONTRACTID,
+ fileSpec,
+ location,
+ type);
+ compMgr.registerFactoryLocation(XMLRPCFAULT_CID,
+ 'XML-RPC Fault JS component',
+ XMLRPCFAULT_CONTRACTID,
+ fileSpec,
+ location,
+ type);
+ },
+
+ getClassObject: function(compMgr, cid, iid) {
+ if (!cid.equals(XMLRPCCLIENT_CID) && !cid.equals(XMLRPCFAULT_CID))
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+
+ if (!iid.equals(Components.interfaces.nsIFactory))
+ throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
+
+ if (cid.equals(XMLRPCCLIENT_CID))
+ return nsXmlRpcClientFactory
+ else return nsXmlRpcFaultFactory;
+ },
+
+ canUnload: function(compMgr) { return true; }
+};
+
+/* nsXmlRpcClient Class Factory */
+var nsXmlRpcClientFactory = {
+ createInstance: function(outer, iid) {
+ if (outer != null)
+ throw Components.results.NS_ERROR_NO_AGGREGATION;
+
+ if (!iid.equals(XMLRPCCLIENT_IID) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ throw Components.results.NS_ERROR_INVALID_ARG;
+
+ return new nsXmlRpcClient();
+ }
+}
+
+/* nsXmlRpcFault Class Factory */
+var nsXmlRpcFaultFactory = {
+ createInstance: function(outer, iid) {
+ if (outer != null)
+ throw Components.results.NS_ERROR_NO_AGGREGATION;
+
+ if (!iid.equals(XMLRPCFAULT_IID) &&
+ !iid.equals(Components.interfaces.nsISupports))
+ throw Components.results.NS_ERROR_INVALID_ARG;
+
+ return new nsXmlRpcFault();
+ }
+}
+
+/*
+ * Functions
+ */
+/* module initialisation */
+function NSGetModule(comMgr, fileSpec) { return nsXmlRpcClientModule; }
+
+/* Create an instance of the given ContractID, with given interface */
+function createInstance(contractId, intf) {
+ return Components.classes[contractId]
+ .createInstance(Components.interfaces[intf]);
+}
+
+/* Get a pointer to a service indicated by the ContractID, with given interface */
+function getService(contractId, intf) {
+ return Components.classes[contractId]
+ .getService(Components.interfaces[intf]);
+}
+
+/* Convert an inputstream to a scriptable inputstream */
+function toScriptableStream(input) {
+ var SIStream = Components.Constructor(
+ '@mozilla.org/scriptableinputstream;1',
+ 'nsIScriptableInputStream', 'init');
+ return new SIStream(input);
+}
+
+/* format a Date object into a iso8601 datetime string, UTC time */
+function iso8601Format(date) {
+ var datetime = date.getUTCFullYear();
+ var month = String(date.getUTCMonth() + 1);
+ datetime += (month.length == 1 ? '0' + month : month);
+ var day = date.getUTCDate();
+ datetime += (day < 10 ? '0' + day : day);
+
+ datetime += 'T';
+
+ var hour = date.getUTCHours();
+ datetime += (hour < 10 ? '0' + hour : hour) + ':';
+ var minutes = date.getUTCMinutes();
+ datetime += (minutes < 10 ? '0' + minutes : minutes) + ':';
+ var seconds = date.getUTCSeconds();
+ datetime += (seconds < 10 ? '0' + seconds : seconds);
+
+ return datetime;
+}
+
+/* Convert a stream to Base64, writing it away to a string writer */
+const BASE64CHUNK = 255; // Has to be dividable by 3!!
+function streamToBase64(stream, writer) {
+ while (stream.available()) {
+ var data = [];
+ while (data.length < BASE64CHUNK && stream.available()) {
+ var d = stream.read(1).charCodeAt(0);
+ // reading a 0 results in NaN, compensate.
+ data = data.concat(isNaN(d) ? 0 : d);
+ }
+ writer.write(toBase64(data));
+ }
+}
+
+/* Convert data (an array of integers) to a Base64 string. */
+const toBase64Table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' +
+ '0123456789+/';
+const base64Pad = '=';
+function toBase64(data) {
+ var result = '';
+ var length = data.length;
+ var i;
+ // Convert every three bytes to 4 ascii characters.
+ for (i = 0; i < (length - 2); i += 3) {
+ result += toBase64Table[data[i] >> 2];
+ result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)];
+ result += toBase64Table[((data[i+1] & 0x0f) << 2) + (data[i+2] >> 6)];
+ result += toBase64Table[data[i+2] & 0x3f];
+ }
+
+ // Convert the remaining 1 or 2 bytes, pad out to 4 characters.
+ if (length%3) {
+ i = length - (length%3);
+ result += toBase64Table[data[i] >> 2];
+ if ((length%3) == 2) {
+ result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)];
+ result += toBase64Table[(data[i+1] & 0x0f) << 2];
+ result += base64Pad;
+ } else {
+ result += toBase64Table[(data[i] & 0x03) << 4];
+ result += base64Pad + base64Pad;
+ }
+ }
+
+ return result;
+}
+
+/* Convert Base64 data to a string */
+const toBinaryTable = [
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
+ 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
+ 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
+ -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+ 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
+];
+function base64ToString(data) {
+ var result = '';
+ var leftbits = 0; // number of bits decoded, but yet to be appended
+ var leftdata = 0; // bits decoded, but yet to be appended
+
+ // Convert one by one.
+ for (var i = 0; i < data.length; i++) {
+ var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
+ var padding = (data[i] == base64Pad);
+ // Skip illegal characters and whitespace
+ if (c == -1) continue;
+
+ // Collect data into leftdata, update bitcount
+ leftdata = (leftdata << 6) | c;
+ leftbits += 6;
+
+ // If we have 8 or more bits, append 8 bits to the result
+ if (leftbits >= 8) {
+ leftbits -= 8;
+ // Append if not padding.
+ if (!padding)
+ result += String.fromCharCode((leftdata >> leftbits) & 0xff);
+ leftdata &= (1 << leftbits) - 1;
+ }
+ }
+
+ // If there are any bits left, the base64 string was corrupted
+ if (leftbits)
+ throw Components.Exception('Corrupted base64 string');
+
+ return result;
+}
+
+if (DEBUG) debug = function(msg) {
+ dump(' -- XML-RPC client -- : ' + msg + '\n');
+};
+else debug = function() {}
+
+// vim:sw=4:sr:sta:et:sts:
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/components/xml-rpc.xpt b/addons/plugin_thunderbird/plugin/openerp_plugin/components/xml-rpc.xpt
new file mode 100644
index 00000000000..8e59aa20c85
Binary files /dev/null and b/addons/plugin_thunderbird/plugin/openerp_plugin/components/xml-rpc.xpt differ
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js b/addons/plugin_thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js
new file mode 100644
index 00000000000..1e12ff712d8
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js
@@ -0,0 +1,61 @@
+ pref("network.protocol-handler.app.http","/usr/bin/firefox");
+pref("network.protocol-handler.app.https","/usr/bin/firefox");
+pref("extensions.tiny.serverurl", "http://localhost");
+pref("extensions.tiny.serverport", "8069");
+pref("extensions.tiny.webserverurl", "http://localhost:8080");
+pref("extensions.tiny.webserverport", "8080");
+pref("extensions.tiny.serverdbname", "terp");
+pref("extensions.tiny.username","admin");
+pref("extensions.tiny.password","admin");
+pref("extensions.tiny.senderemail","");
+pref("extensions.tiny.sendername","");
+pref("extensions.tiny.receiveremail","");
+pref("extensions.tiny.subject","");
+pref("extensions.tiny.receiveddate","");
+pref("extensions.tiny.partnerid","");
+pref("extensions.tiny.contactid","");
+pref("extensions.tiny.attachvalue","");
+pref("extensions.tiny.cclist","");
+pref("extensions.tiny.messagebody","");
+pref("extensions.tiny.displayName","");
+pref("extensions.tiny.attachmentdata","");
+pref("extensions.tiny.userid",3);
+pref("extensions.tiny.partnername","");
+pref("extensions.tiny.officeno","");
+pref("extensions.tiny.phoneno","");
+pref("extensions.tiny.address","");
+pref("extensions.tiny.listobject","Partner,Account Invoice,Product,Sale Order,Lead and opportunities");
+pref("extensions.tiny.object","res.partner,account.invoice,product.product,sale.order,crm.lead");
+pref("extensions.tiny.imagename","chrome://openerp_plugin/skin/Partner.png,chrome://openerp_plugin/skin/Invoice.png,chrome://openerp_plugin/skin/Product.png,chrome://openerp_plugin/skin/Sale.png,chrome://openerp_plugin/skin/Case.png");
+pref("extensions.tiny.attachmentlength","");
+pref("extensions.tiny.attachment","");
+pref("extensions.tiny.db_list","false");
+pref("extensions.tiny.connect_server","false");
+pref("extensions.tiny.module_install","yes");
+pref("extensions.tiny.serverprotocol", "false");
+
+
+
+pref("mboximport.export.filenames_toascii", false);
+pref("mboximport.export.overwrite", false);
+pref("mboximport.confirm.before_mbox_import", true);
+pref("mboximport.clipboard.always_just_text", false);
+pref("mboximport.export.HTML_as_displayed", false);
+pref("mboximport.exportEML.filename_format", 0);
+pref("mboximport.delay.clean_statusbar", 5000);
+pref("mboximport.subject.max_length", 50);
+pref("mboximport.author.max_length", 50);
+pref("mboximport.recipients.max_length", 50);
+pref("extensions.{3ed8cc52-86fc-4613-9026-c1ef969da4c3}.description", "chrome://mboximport/locale/mboximport.properties");
+pref("mboximport.export.set_filetime", false);
+pref("mboximport.exportEML.use_dir", false);
+pref("mboximport.exportMBOX.use_dir", false);
+pref("mboximport.exportMSG.use_dir", false);
+pref("mboximport.export.filenames_addtime", false);
+pref("mboximport.export_all.warning1", true);
+pref("mboximport.export_all.warning2", true);
+
+pref("mboximport.exportMSG.dir", "/tmp");
+//For debug in console
+pref("browser.dom.window.dump.enabled", true);
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/install.js b/addons/plugin_thunderbird/plugin/openerp_plugin/install.js
new file mode 100644
index 00000000000..50e4b301e32
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/install.js
@@ -0,0 +1,105 @@
+// constants
+const APP_DISPLAY_NAME = "OpenERP Thunderbird Plugins";
+const APP_NAME = "OpenERP";
+const APP_VERSION = "1.0";
+const WARNING = "WARNING: You need administrator privileges to install OpenERP Thunderbird Plugin. It will be installed in the application directory for all users.";
+const VERSION_ERROR = "This extension can only be installed in a version higher than 2.0";
+const NOT_WRITABLE_ERROR = "This extension requires write access to the application directory to install properly."
+const locales = [
+ "en-US",
+ null
+];
+
+// Gecko 1.7 doesn't support custom button labels
+var incompatible = (typeof Install.BUTTON_POS_0 == "undefined");
+if (incompatible)
+ alert(VERSION_ERROR);
+
+if (!incompatible) {
+ // Check whether all directories can be accessed
+ var dirList = [
+ getFolder("Components"),
+ getFolder(getFolder("Program", "defaults"), "pref")
+ ];
+ for (var i = 0; i < dirList.length; i++)
+ if (!File.isWritable(dirList[i]))
+ incompatible = true;
+
+ if (incompatible)
+ alert(NOT_WRITABLE_ERROR);
+}
+
+if (!incompatible && confirm(WARNING, APP_DISPLAY_NAME)) {
+ /* Pre-Install Cleanup (for prior versions) */
+
+ // List of files to be checked
+ var checkFiles = [
+ [getFolder("Components"), "nsXmlRpcClient.js"], // Root component
+ [getFolder("Components"), "xml-rpc.xpt"], // Component interface
+ ];
+
+ // Remove any existing files
+ initInstall("pre-install", "/rename", "0.0"); // open dummy-install
+ for (var i = 0 ; i < checkFiles.length ; i++) {
+ var currentDir = checkFiles[i][0];
+ var name = checkFiles[i][1];
+ var oldFile = getFolder(currentDir, name);
+
+ // Find a name to rename the file into
+ var newName = name + "-uninstalled";
+ for (var n = 1; File.exists(oldFile) && File.exists(getFolder(currentDir, newName)); n++)
+ newName = name + n + "-uninstalled";
+
+ if (File.exists(oldFile))
+ File.rename(oldFile, newName);
+ }
+ performInstall(); // commit renamed files
+
+ /* Main part of the installation */
+
+ var chromeType = DELAYED_CHROME;
+
+ var files = [
+ ["components/nsXmlRpcClient.js", getFolder("Components")],
+ ["components/xml-rpc.xpt", getFolder("Components")],
+ ["defaults/preferences/tiny.js", getFolder(getFolder("Program", "defaults"), "pref")],
+ ];
+
+ // initialize our install
+ initInstall(APP_NAME, APP_PACKAGE, APP_VERSION);
+
+ // Add files
+ for (var i = 0; i < files.length; i++)
+ addFile(APP_NAME, APP_VERSION, files[i][0], files[i][1], null);
+
+ try {
+ var err = registerChrome(CONTENT | chromeType, jar, "content/");
+ if (err != SUCCESS)
+ throw "Chrome registration for content failed (error code " + err + ").";
+
+ err = registerChrome(SKIN | chromeType, jar, "skin/classic/");
+ if (err != SUCCESS)
+ throw "Chrome registration for skin failed (error code " + err + ").";
+
+ for (i = 0; i < locales.length; i++) {
+ if (!locales[i])
+ continue;
+
+ err = registerChrome(LOCALE | chromeType, jar, "locale/" + locales[i] + "/");
+ if (err != SUCCESS)
+ throw "Chrome registration for " + locales[i] + " locale failed (error code " + err + ").";
+ }
+
+ var err = performInstall();
+ if (err != SUCCESS && err != 999)
+ throw "Committing installation failed (error code " + err + ").";
+
+ alert("OpenERP Thunderbird Plugin " + APP_VERSION + " is now installed.\n" +
+ "It will become active after you restart your browser.");
+ }
+ catch (ex) {
+ alert("Installation failed: " + ex + "\n" +
+ "You probably don't have the necessary permissions (log in as system administrator).");
+ cancelInstall(err);
+ }
+}
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/install.rdf b/addons/plugin_thunderbird/plugin/openerp_plugin/install.rdf
new file mode 100644
index 00000000000..c0c35ab16be
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/install.rdf
@@ -0,0 +1,22 @@
+
+
+
+ {d57f315a-9f5d-4366-a530-a769a4a8c949}
+ chrome://openerp_plugin/skin/tinyerp-icon.ico
+ OpenERP Plugin
+ 1.0
+ OpenERP Thunderbird Integration
+ OpenERP SA
+
+ http://openerp.com
+
+
+
+ {3550f703-e582-4d05-9a08-453d09bdfdc6}
+ 2.0
+ 8.0.*
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/install.sh b/addons/plugin_thunderbird/plugin/openerp_plugin/install.sh
new file mode 100755
index 00000000000..e1103b30acf
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/install.sh
@@ -0,0 +1,3 @@
+make clean
+make
+cp ../openerp_plugin.xpi /home/openerp/
diff --git a/addons/plugin_thunderbird/plugin/openerp_plugin/makefile b/addons/plugin_thunderbird/plugin/openerp_plugin/makefile
new file mode 100644
index 00000000000..17ed0319bcc
--- /dev/null
+++ b/addons/plugin_thunderbird/plugin/openerp_plugin/makefile
@@ -0,0 +1,11 @@
+all: xpi
+
+jar:
+ jar cvf chrome/openerp_plugin.jar -C chrome/openerp_plugin/ .
+
+xpi: jar
+ zip -r ../openerp_plugin.xpi *
+
+clean:
+ rm ../openerp_plugin.xpi
+ rm chrome/openerp_plugin.jar
--
cgit v1.2.3