diff --git a/addons/thunderbird/partner/partner.py b/addons/thunderbird/partner/partner.py
index 2269d0fa351..df0beb16258 100644
--- a/addons/thunderbird/partner/partner.py
+++ b/addons/thunderbird/partner/partner.py
@@ -85,21 +85,20 @@ class thunderbird_partner(osv.osv_memory):
if res_id:
address_obj = self.pool.get('res.partner.address')
address_data = address_obj.read(cr, user, int(res_id), [])
- result={
- 'partner_id': address_data['partner_id'] and address_data['partner_id'][0] or False,
- 'country_id': dictcreate['country_id'] and int(dictcreate['country_id'][0]) or False,
- 'state_id': dictcreate['state_id'] and int(dictcreate['state_id'][0]) or False,
- 'name': dictcreate['name'],
- 'street': dictcreate['street'],
- 'street2': dictcreate['street2'],
- 'zip': dictcreate['zip'],
- 'city': dictcreate['city'],
- 'phone': dictcreate['phone'],
- 'fax': dictcreate['fax'],
- 'mobile': dictcreate['mobile'],
- 'email': dictcreate['email'],
- }
- address_obj.write(cr, user,int(res_id),result )
+ result={ 'partner_id': address_data['partner_id'] and address_data['partner_id'][0] or False,
+ 'country_id': dictcreate['country_id'] and int(dictcreate['country_id'][0]) or False,
+ 'state_id': dictcreate['state_id'] and int(dictcreate['state_id'][0]) or False,
+ 'name': dictcreate['name'],
+ 'street': dictcreate['street'],
+ 'street2': dictcreate['street2'],
+ 'zip': dictcreate['zip'],
+ 'city': dictcreate['city'],
+ 'phone': dictcreate['phone'],
+ 'fax': dictcreate['fax'],
+ 'mobile': dictcreate['mobile'],
+ 'email': dictcreate['email'],
+ }
+ address_obj.write(cr, user,int(res_id),result )
return True
def create_partner(self,cr,user,vals):
diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi
index ca3f40a7023..ea196bb057a 100644
Binary files a/addons/thunderbird/plugin/openerp_plugin.xpi and b/addons/thunderbird/plugin/openerp_plugin.xpi differ
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
index 51ba3578f9a..257d57173fc 100644
Binary files a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar and b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar differ
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul
index 370683b0c4b..02700277d26 100644
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul
@@ -90,7 +90,7 @@
-
+
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js
index 458a0a5503a..a98cb3e18fb 100755
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js
@@ -1,6 +1,8 @@
function config_close()
{
+ //window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
+ //ksa
window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
window.open("chrome://openerp_plugin/content/config.xul", "", "chrome");
}
@@ -60,10 +62,13 @@ function config_ok()
}
setServer("http://"+document.getElementById('txtcurl').value +":" + document.getElementById('txtcport').value);
window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
+ //ksa
window.open("chrome://openerp_plugin/content/config.xul", "", "chrome");
}
function openConfigChange()
{
+ //window.open("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
+ //ksa
window.close("chrome://openerp_plugin/content/config.xul", "", "chrome");
window.open("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
}
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul
index 9f6243d4c76..79af8564da5 100644
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change.xul
@@ -3,16 +3,13 @@
+ title="Server" height="140" width="240">
-
-
- Openerp Connection
-
+ Connect To OpenERP Server
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/loaddata.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/loaddata.js
index 4a43dcd1d42..80a24b4a179 100755
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/loaddata.js
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/loaddata.js
@@ -45,6 +45,7 @@ var myPrefObserver =
//set the initial value of name and email field of create contact window
createContact: function()
{
+ //document.getElementById("txtselectpartner").value= getPartnerID();
document.getElementById("txtname").value= getSenderName();
document.getElementById("txtemail").value= getSenderEmail();
document.getElementById("country").value=getAllCountry();
@@ -104,7 +105,6 @@ var myPrefObserver =
document.getElementById("txtemail").value= getSenderEmail();
document.getElementById("country").value=getAllCountry();
document.getElementById("state").value=getAllState();
-
},
//unregistering the window observer
@@ -121,10 +121,13 @@ var myPrefObserver =
// aData is the name of the pref that's been changed (relative to aSubject)
switch (aData) {
case "serverport":
+ // extensions.myextension.pref1 was changed
break;
case "serverurl":
+ // extensions.myextension.pref2 was changed
break;
case "serverdbname":
+ // extensions.myextension.pref2 was changed
break;
}
},
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js
index 998e5357737..28a419a59ce 100755
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js
@@ -242,10 +242,10 @@ function open_contact()
}
-
//function to open the configuration window
var Config = {
onLoad: function() {
+ // initialization code
this.initialized = true;
},
@@ -278,7 +278,7 @@ var Create = {
}
};
window.addEventListener("load", function(e) { Create.onLoad(e); }, false);
-
+
var Address = {
onLoad: function(){
this.initialized=true;
@@ -289,6 +289,21 @@ var Address = {
searchContact();
}
};
+
+/*var Address = {
+ onLoad: function(){
+ this.initialized=true;
+ },
+
+ onMenuItemCommand: function(){
+ // if(GetNumSelectedMessages() < 1 || GetNumSelectedMessages() > 1){
+ // alert("You must select only one mail to archive");
+ //return false
+ //}
+ searchContact();
+ window.open("chrome://openerp_plugin/content/address.xul", "", "chrome");
+ }
+};*/
//function to open the window for selecting the partner for a new contact creation
var Select = {
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/plugin.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/plugin.xul
index 87f8386b1cd..2847638f756 100644
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/plugin.xul
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/plugin.xul
@@ -31,7 +31,7 @@
-
+
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js
index 240ab6afb04..0d662af9cf5 100755
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js
@@ -24,7 +24,7 @@ var attach_eml ="no";
var popup_display = "yes"
var rpc= {
servers: {},
- addserver: function(name,ip,port,path) {
+ addserver: function(name,ip,port,path) {//alert(name+','+ip+','+port+','+path);
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
this.servers[name]= {
ip: ip,
@@ -84,9 +84,11 @@ var rpc= {
case Date: return 5;
case Object: return 7;
case Array: return 6;
+ // base64
}
}
return 7;
+ //return [false,'error checktype','Unknown type'];
},
set: function(rpcobj,param) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
@@ -301,7 +303,7 @@ function setCity(argCity){
//set preference value for country
function setCountry(argCountry){
- getPref().setCharPref('country',argCountry)
+ getPref().setCharPref('country',argCountry)
}
//set preference value for state
@@ -396,6 +398,7 @@ function getPassword(){
//get serverservice
function getServerService(){
return strServerService;
+ // return getPref().getCharPref('strServerService');
}
//get sender email
@@ -423,6 +426,8 @@ function getSenderName(){
}
else
{
+ //string = str.replace(/[\+\/\=\?\_\-]/g, "");
+// string = str.replace(/[\'ë']/g,'e');
string = str.replace(/[\'Š',\'Ž',\'š',\'ž',\'Ÿ',\'À',\'Á',\'Â',\'Ã',\'Ä',\'Å',\'Ç',\'È',\'É',\'Ê',\'Ë',\'Ì',\'Í',\'Î',\'Ï',\'Ñ',\'Ò',\'Ó',\'Ô',\'Õ',\'Ö',\'Ø',\'Ù',\'Ú',\'Û',\'Ü',\'Ý',\'à',\'á',\'â',\'ã',\'ä',\'å',\'ç',\'è',\'é',\'ê',\'ë',\'ì',\'í',\'î',\'ï',\'ñ',\'ò',\'ó',\'ô',\'õ',\'ö',\'ø',\'ù',\'ú',\'û',\'ü',\'ý',\'ÿ',\'Þ',\'þ',\'Ð',\'ð',\'ß',\'Œ',\'œ',\'Æ',\'æ',\'µ']/g,'"',"'",'“','”',"\n","\r",'_/',"'S','Z','s','z','Y','A','A','A','A','A','A','C','E','E','E','E','I','I','I','I','N','O','O','O','O','O','O','U','U','U','U','Y','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','o','u','u','u','u','y','y','TH','th','DH','dh','ss','OE','oe','AE','ae','u','','','','','','','-'");
var utftext = "";
@@ -435,6 +440,8 @@ function getSenderName(){
utftext += String.fromCharCode(c);
}
}
+ // encoded_string = encodeURIComponent(utftext);
+ // decoded_string = decodeURIComponent(encoded_string);
encoded_string = encode64(utftext);
return encoded_string;
}
@@ -582,6 +589,7 @@ var listDbHandler = {
setconnect_server("true")
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
var arrMethodList = result.QueryInterface(Components.interfaces.nsISupportsArray);
+ // Set the number of results
var count = arrMethodList.Count();
// Loop through the results, adding items to the list
for (i = 0; i < count; i++) {
@@ -630,7 +638,7 @@ var listDbHandler = {
if (count)
{
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- var popup = document.getElementById("DBlist");
+ var popup = document.getElementById("DBlist"); // a element
var arrsec=new Array()
for (var i=0;i element
for (i=0;i element
for (i=0;i element
for (i=0;i element
if(getPref().getCharPref('attachmentlength')>0){
if (getAttachValue() == '1'){
//calling the method to create the attachments
@@ -1257,26 +1283,30 @@ var listArchiveHandler = {
attachment = "yes"
}
else{
+// alert("Mail Archived Successfully");
attachment = "no"
}
}
else{
+// alert("Mail Archived Successfully");
attachment = "no"
}
createAttachmentEML_CRM(popup, createId, attachment)
},
onFault: function (client, ctxt, fault) {
+ //alert('XML-RPC Fault: '+fault);
},
onError: function (client, ctxt, status, errorMsg) {
+ //alert("You must select object !")
}
}
//function to archive the mail content through xmlrpc request
function archivemail(){
- var popup = document.getElementById("section").selectedItem;
+ var popup = document.getElementById("section").selectedItem; // a element
if (String(popup) != "null"){
object=popup.value;
@@ -1341,23 +1371,28 @@ var listCreateContactHandler = {
window.close();
},
onFault: function (client, ctxt, fault) {
+ alert('XML-RPC Fault: '+fault);
},
onError: function (client, ctxt, status, errorMsg) {
+ alert('Error: '+errorMsg);
}
}
var listUpdateContactHandler = {
onResult: function(client, context, result) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
- var ResourceId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32);
- setResourceId(ResourceId);
+ var partnerId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32);
+ setResourceId(partnerId);
+ //alert("Contact Created Successfully.");
window.close();
},
onFault: function (client, ctxt, fault) {
+ //alert('XML-RPC Fault: '+fault);
},
onError: function (client, ctxt, status, errorMsg) {
+ //alert('Error: '+errorMsg);
}
}
@@ -1382,7 +1417,7 @@ function createContact(){
var arrofarr = dictcontact(a,b);
xmlRpcClient.asyncCall(listCreateContactHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
}
-
+//ksa
function UpdateContact(){
var branchobj = getPref();
setServerService('xmlrpc/object');
@@ -1398,8 +1433,8 @@ function UpdateContact(){
strmethod.data = 'update_contact';
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
strobj.data = 'thunderbird.partner';
- var a = ['res_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email'];
- var b = [getResourceId(),getSenderName(),document.getElementById("txtstreet").value,document.getElementById("txtstreet2").value,document.getElementById("txtzip").value, document.getElementById("txtcity").value,document.getElementById("country").value,document.getElementById("state").value,document.getElementById("txtoffice").value,document.getElementById("txtfax").value,document.getElementById("txtmobile").value,getSenderEmail()];
+ var a = ['res_id','partner_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email'];
+ var b = [getResourceId(),getPartnerName(),getSenderName(),document.getElementById("txtstreet").value,document.getElementById("txtstreet2").value,document.getElementById("txtzip").value, document.getElementById("txtcity").value,document.getElementById("country").value,document.getElementById("state").value,document.getElementById("txtoffice").value,document.getElementById("txtfax").value,document.getElementById("txtmobile").value,getSenderEmail()];
var arrofarr = dictcontact(a,b);
xmlRpcClient.asyncCall(listUpdateContactHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
}
@@ -1409,12 +1444,26 @@ var listAttachHandler = {
onResult: function(client, context, result) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
var createId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32);
-
+ /*if(createId){
+ attach = getAttachment()
+ if (attach_eml=="yes")
+ {
+ //alert("Mail Archived Successfully");
+ }
+ else if (attach_eml =="no" && attach =="yes")
+ {
+ alert("Mail Archived Successfully With Attachments");
+ }
+ //getPref().setCharPref("attachmentdata","")
+ attach_eml="no"
+ }*/
},
onFault: function (client, ctxt, fault) {
+// alert('XML-RPC Fault: '+fault);
},
onError: function (client, ctxt, status, errorMsg) {
+// alert('Error: '+client + ctxt + status + errorMsg);
}
}
@@ -1435,6 +1484,7 @@ function createAttachment(popup,res_id){
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
strobj.data = 'thunderbird.partner';
var resobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
+// var popup = document.getElementById("section").selectedItem; // a element
object=popup;
resobj.data = object;
var a = ['name','datas','res_model','res_id','description','datas_fname'];
@@ -1518,7 +1568,10 @@ return output;
function createInstance(name,test){
var encoded_string = '';
var file_name = ''
+ //alert("Downloading Attachment Data");
for(i=0;i element
object=popup.value;
resobj.data = object;
var a = ['object'];
var b = [getPref().getCharPref("object")];
var arrofarr = dictcontact(a,b);
+ //alert("FIRST::::::" + strDbName + struids + strpass + strobj + strmethod + arrofarr)
xmlRpcClient.asyncCall(listsearchAttachmentHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
}
@@ -1932,6 +2000,7 @@ function createAttachmentEML()
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
strobj.data = 'thunderbird.partner';
var resobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
+ var popup = document.getElementById("section").selectedItem; // a element
object=popup.value;
resobj.data = object;
filename = getFileName()
@@ -1995,6 +2064,8 @@ function createAttachmentEML_CRM(model, id, attachment)
alert("Mail Archived Successfully");
window.close();
}
+ //getPref().setCharPref("attachmentdata","")
+// file.remove(true);
attach_eml="yes";
var branchobj = getPref();
setServerService('xmlrpc/object');
@@ -2059,7 +2130,7 @@ function attachmentWidnowOpen(msg)
{
if (msg=="create"){
- var popup = document.getElementById("section").selectedItem;
+ var popup = document.getElementById("section").selectedItem; // a element
if (String(popup) != "null"){
object=popup.value;
@@ -2097,7 +2168,7 @@ function attachmentWidnowOpen(msg)
{
if (msg=="create")
{
- var popup = document.getElementById("section").selectedItem;
+ var popup = document.getElementById("section").selectedItem; // a element
if (String(popup) != "null"){
object=popup.value;
if (object=="" || object == undefined) { alert("select at least one document !")}
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd
index 037e0b9219d..560b414567a 100755
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config.dtd
@@ -1,4 +1,4 @@
-
+