summaryrefslogtreecommitdiff
path: root/addons/thunderbird/plugin/openerp_plugin
diff options
context:
space:
mode:
authoraag (OpenERP) <aag@tinyerp.co.in>2010-10-14 13:31:03 +0530
committeraag (OpenERP) <aag@tinyerp.co.in>2010-10-14 13:31:03 +0530
commitfabe3674a7a2d0da9dac1dadf4e7370abc2bbb20 (patch)
tree3ea9201015595747a47cea94a151ff778ed50a24 /addons/thunderbird/plugin/openerp_plugin
parent7b2e3875b1590d4efbb60b15e78503b6922bc543 (diff)
parentb7a6164e75f4c08c317ec5a64af2b8cecde62b6e (diff)
trunk merge
bzr revid: aag@tinyerp.co.in-20101014080103-58ysx9lo20h9kogo
Diffstat (limited to 'addons/thunderbird/plugin/openerp_plugin')
-rw-r--r--addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jarbin70768 -> 71542 bytes
-rw-r--r--addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/address.xul1
-rwxr-xr-xaddons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.js127
-rwxr-xr-xaddons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul11
-rwxr-xr-xaddons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/tiny_xmlrpc.js77
-rwxr-xr-xaddons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd2
-rw-r--r--addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/partner_icon.pngbin0 -> 1429 bytes
-rwxr-xr-xaddons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js5
8 files changed, 172 insertions, 51 deletions
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
index 2ee7837623f..b81a298f20a 100644
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar
Binary files 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 cacd522718e..9d39e4c5cfc 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
@@ -25,7 +25,6 @@
<label align="right" id="name" value="&name.value;" width="80" />
<textbox id="txtselectpartner" align="right" width="270" readonly="true"/>
<spacer width="5"/>
- <button label="New Partner" image="&imagecreate.value;" oncommand="CreatePartner.onMenuItemCommand(event);" width="133"/>
</hbox>
<separator class="groove-thin" orient="horizontal" width="94"/>
</groupbox>
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 96f4a43b578..637d412d51b 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
@@ -175,6 +175,8 @@ function searchmail()
window.open("chrome://openerp_plugin/content/plugin.xul", "", "chrome, resizable=yes");
}
}
+
+
var openPartnerHandler = {
onResult: function(client, context, result) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
@@ -190,16 +192,17 @@ var openPartnerHandler = {
alert("Partner is not Available.");
return;
}
- if(strlSearchResult=="partner_id"){
- partner_id = strlSearchResultValue;
- weburl = getWebServerURL();
- var branchobj = getPref();
- db_name = branchobj.getCharPref("serverdbname");
- if (weburl == false){
- weburl = 'http://localhost:8080'
- }
- if (partner_id > 0){
- window.open(weburl + "/model=res.partner&id=" + partner_id)
+ if(strlSearchResult=="partner_id"){
+ partner_id = strlSearchResultValue;
+ weburl = getWebServerURL();
+ webport = getwebPort();
+ var urlport = weburl+':'+webport
+
+ if (parseInt(partner_id) > 0){
+ var t = urlport + "/openerp/form/view?model=res.partner&id="+partner_id;
+ alert(t + ":" + " " + "\n\n" + "If you can not open this link directly in web browser then you can copy the link and paste in web browser.");
+ window.open(t);
+
}
else{
alert("Partner is not Available.");
@@ -292,19 +295,21 @@ function open_partner()
}
searchPartner(senderemail);
}
+
var listDocumentHandler = {
- onResult: function(client, context, result) {
- netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
- var res = result.QueryInterface(Components.interfaces.nsISupportsArray);
- res_id = res.QueryElementAt(1, Components.interfaces.nsISupportsPRInt32);
- model = res.QueryElementAt(0, Components.interfaces.nsISupportsCString);
- weburl = getWebServerURL()
- if (weburl == false){
- weburl = 'http://localhost:8080'
- }
- var branchobj = getPref();
- db_name = branchobj.getCharPref("serverdbname");
- window.open(weburl + "/model=" + model +"&id=" + res_id)
+ onResult: function(client, context, result) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var res = result.QueryInterface(Components.interfaces.nsISupportsArray);
+ res_id = res.QueryElementAt(1, Components.interfaces.nsISupportsPRInt32);
+ model = res.QueryElementAt(0, Components.interfaces.nsISupportsCString);
+ weburl = getWebServerURL();
+ webport = getwebPort();
+
+ var urlport = weburl+':'+webport;
+ var t = urlport + "/openerp/form/view?model=" + model +"&id=" + res_id;
+ alert(t + ":" + " " + "\n\n" + "If you can not open this link directly in web browser then you can copy the link and paste in web browser.");
+ window.open(t);
+
},
onFault: function (client, ctxt, fault) {
@@ -313,12 +318,14 @@ var listDocumentHandler = {
onError: function (client, ctxt, status, errorMsg) {
}
-}
+}
+
+
function open_document()
-{
+{
if (check() == false){
return true
- }
+ }
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
var version_obj = prefService.getBranch("extensions.");
version_obj.QueryInterface(Components.interfaces.nsIPrefBranch2);
@@ -355,12 +362,14 @@ function open_document()
strmethod.data = 'search_message';
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
strobj.data = 'thunderbird.partner';
- var eml_string = parse_eml()
- var a = ['model', 'message'];
- var b = [object, eml_string];
- var arrofarr = dictcontact(a,b);
+ var eml_string = parse_eml()
+ var a = ['message'];
+ var b = [eml_string];
+ var arrofarr = dictcontact(a,b);
xmlRpcClient.asyncCall(listDocumentHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
-}
+}
+
+
function open_contact()
{
if (check() == false){
@@ -428,6 +437,64 @@ function open_contact()
searchContact();
}
+function search_document()
+{
+ if (check() == false){
+ return true
+ }
+
+ var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
+ var version_obj = prefService.getBranch("extensions.");
+ version_obj.QueryInterface(Components.interfaces.nsIPrefBranch2);
+ version = version_obj.getCharPref("lastAppVersion");
+ version = parseInt(version[0])
+
+ file = getPredefinedFolder(2);
+
+ if (version > 2)
+ {
+ var emlsArray = gFolderDisplay.selectedMessages;
+ }
+ else
+ {
+ var emlsArray = GetSelectedMessages();
+ }
+
+ IETtotal = emlsArray.length;
+ IETexported = 0;
+ var msguri = emlsArray[0];
+
+
+ //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
+ }
+
+ //set the initial information for the selected email
+ setSenderEmail(senderemail);
+ setSenderName(sendername);
+ searchdocument();
+}
//function to open the configuration window
var Config = {
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul
index 6e2af251052..230ab391ff1 100755
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/overlay.xul
@@ -43,17 +43,10 @@
</toolbarpalette>
<toolbarpalette id="MailToolbarPalette">
- <toolbarbutton id="GA-button1"
- class="toolbarbutton-1"
- image="&partnericon.value;"
- label= "Open Contact"
- oncommand="Address.onMenuItemCommand(event);" />
-</toolbarpalette>
-<toolbarpalette id="MailToolbarPalette">
<toolbarbutton id="GA-button2"
class="toolbarbutton-1"
image="&partnericon.value;"
- label= "Open Partner"
+ label= "Open Partner"
oncommand="open_partner();"
/>
</toolbarpalette>
@@ -62,7 +55,7 @@
class="toolbarbutton-1"
image="&imagearchive.value;"
label= "Open Document"
- oncommand="open_document();" />
+ oncommand="search_document();" />
</toolbarpalette>
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 0736e39b3ed..34b68ee9bc3 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
@@ -408,6 +408,11 @@ function getWebServerURL(){
return getPref().getCharPref('webserverurl');
}
+//get webserver port
+function getwebPort(){
+ return getPref().getCharPref('webserverport');
+}
+
//get username from config settings
function getUsername(){
return getPref().getCharPref('username');
@@ -961,6 +966,41 @@ function module_install()
xmlRpcClient.asyncCall(listinstallmodulehandler,null,'execute',[ strDbName,struid,strpass,strobj,strmethod, strvalue],6);
}
+var listSearchwebdocumentHandler = {
+ onResult: function(client, context, result) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ var sendername = getSenderEmail();
+ var arrIdList = result.QueryInterface(Components.interfaces.nsISupportsArray);
+ var count = arrIdList.Count();
+ for (i = 0; i < count; i++) {
+ var strlResult = arrIdList.QueryElementAt(i, Components.interfaces.nsISupportsArray);
+ var strlSearchResult = strlResult.QueryElementAt(0, Components.interfaces.nsISupportsCString);
+ var strlSearchResultValue = strlResult.QueryElementAt(1, Components.interfaces.nsISupportsCString);
+ }
+ if(strlSearchResult=="email" && strlSearchResultValue!=''){
+ setSenderEmail(strlSearchResultValue);
+ var t = getSenderEmail();
+ open_document();}
+
+ if(strlSearchResult=="email" && strlSearchResultValue==''){
+ alert("Contact is not available.so not open any document.");
+ }
+
+ if(strlSearchResult=="res_id"){
+ setResourceId(strlSearchResultValue);
+ var t = getResourceId();}
+ },
+ onFault: function (client, ctxt, fault) {
+
+ },
+
+ onError: function (client, ctxt, status, errorMsg) {
+
+ }
+
+}
+
+
var listSearchContactHandler = {
onResult: function(client, context, result) {
@@ -1031,6 +1071,7 @@ var listSearchContactHandler = {
}
}
+
var listSearchContactdetailHandler = {
onResult: function(client, context, result) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
@@ -1271,6 +1312,31 @@ function searchCheckbox()
xmlRpcClient.asyncCall(listSearchCheckboxHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod,arrofarr ],6);
}
+function searchdocument()
+{
+ var branchobj = getPref();
+ setServerService('xmlrpc/object');
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
+ arrFinalList = [];
+ var xmlRpcClient = getXmlRpc();
+ var cmbSearchList = document.getElementById('listSearchBox');
+ var strDbName = xmlRpcClient.createType(xmlRpcClient.STRING,{});
+ strDbName.data = branchobj.getCharPref("serverdbname");
+ var struid = xmlRpcClient.createType(xmlRpcClient.INT,{});
+ struid.data = branchobj.getIntPref('userid');
+ var strpass = xmlRpcClient.createType(xmlRpcClient.STRING,{});
+ strpass.data = branchobj.getCharPref("password");
+ var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
+ strobj.data = 'thunderbird.partner';
+ var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{});
+ strmethod.data = 'search_contact';
+ var strname = xmlRpcClient.createType(xmlRpcClient.STRING,{});
+ strname.data = getSenderEmail();
+
+ xmlRpcClient.asyncCall(listSearchwebdocumentHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6);
+}
+
+
function searchContact()
{
var branchobj = getPref();
@@ -1484,9 +1550,7 @@ function upload_archivemail()
var arrofarr = dictcontact(a,b);
xmlRpcClient.asyncCall(listArchiveHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
- // alert("Mail Archived Successfully to" +" " + ":" + " "+ list_documents.value);
- //window.close();
-
+
}
var listArchiveDocumentHandler = {
@@ -1762,12 +1826,7 @@ var listLoginHandler = {
setUserId(login.data);
module_install();
alert('Successfully Login To OpenERP.');
- if (check_module_install(5) == false){
- alert("Please install the thunderbird module on your '" + getDbName() +"' database and try again !");
- }
- else{
- window.close();
- }
+ window.close();
}
else{
alert("Login Failed");
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd
index 48bec840d1a..fb257d70c95 100755
--- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/overlay.dtd
@@ -3,7 +3,7 @@
<!ENTITY tinyarchive "Push to OpenERP">
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
<!ENTITY menuicon.value "chrome://openerp_plugin/skin/openerp-icon.png">
-<!ENTITY partnericon.value "chrome://openerp_plugin/skin/partner.png">
+<!ENTITY partnericon.value "chrome://openerp_plugin/skin/partner_icon.png">
<!ENTITY imagearchive.value "chrome://openerp_plugin/skin/document-new.png">
<!ENTITY tooltip.value "Add To Archive">
<!ENTITY pluginconfig.value "OpenERP Configuration Settings">
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/partner_icon.png b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/partner_icon.png
new file mode 100644
index 00000000000..b8f4a0f380b
--- /dev/null
+++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/skin/partner_icon.png
Binary files differ
diff --git a/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js b/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js
index ca8332c868e..1383eb28ea7 100755
--- a/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js
+++ b/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js
@@ -1,6 +1,9 @@
-
+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");
+pref("extensions.tiny.webserverport", "8080");
pref("extensions.tiny.serverdbname", "terp");
pref("extensions.tiny.username","admin");
pref("extensions.tiny.password","admin");