diff options
| author | ksa (Open ERP) <ksa@tinyerp.co.in> | 2010-10-04 17:53:45 +0530 |
|---|---|---|
| committer | ksa (Open ERP) <ksa@tinyerp.co.in> | 2010-10-04 17:53:45 +0530 |
| commit | f0c1a50d3cb7b90a2ae6c65c72603e7fbce5ee4d (patch) | |
| tree | 80876e7487d83488a15d2b08ad71bb6ba5d0ccbe /addons/thunderbird/plugin | |
| parent | 2195f5d9ca68c50d5fe0818a8509d93599489460 (diff) | |
[ADD]: Add webserver parameter in thunderbird
bzr revid: ksa@tinyerp.co.in-20101004122345-lc3wetekshocnuan
Diffstat (limited to 'addons/thunderbird/plugin')
11 files changed, 191 insertions, 19 deletions
diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi Binary files differindex 3a937d61daa..233845490c8 100644 --- a/addons/thunderbird/plugin/openerp_plugin.xpi +++ b/addons/thunderbird/plugin/openerp_plugin.xpi diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar Binary files differindex 3b570ec81f6..58fa1b1be82 100644 --- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar 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 a9afa70e10c..e06504baa09 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 @@ -45,6 +45,50 @@ function config_change_load() } } + +function config_change_load_web() +{ + //var s = getServer(); + weburl = getWebServerURL(); + webport = getwebPort(); + var urlport = weburl+':'+webport; + var a =urlport.split(':'); + if (String(a)=="" || String(a)=="undefined"){ + document.getElementById('txtcweburl').value = "localhost" + document.getElementById('txtcwebport').value = "8069" + } + else + { + len = a[1]; + var url = ""; + for (i=0;i<len.length;i++) + { if (len[i] == "/") + { + continue + } + url += len[i] + } + if (String(url) == "" || String(url) == "undefined"){ + document.getElementById('txtcweburl').value = "localhost" + } + else + { + document.getElementById('txtcweburl').value = url + } + + if (String(a[2]) == "" || String(a[2]) == "undefined"){ + document.getElementById('txtcwebport').value = "8069" + setwebPort("8069"); + } + else + { + document.getElementById('txtcwebport').value = a[2] + setwebPort(a[2]); + } + + } +} + function config_ok() { if (document.getElementById('txtcurl').value == '') @@ -62,12 +106,37 @@ function config_ok() window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome"); window.open("chrome://openerp_plugin/content/config.xul", "", "chrome"); } + +function config_ok_web() +{ + if (document.getElementById('txtcweburl').value == '') + { + alert("You Must Enter Server Name!") + return false; + + } + if (document.getElementById('txtcwebport').value == '') + { + alert("You Must Enter Port!") + return false; + } + setWebServerURL("http://"+document.getElementById('txtcweburl').value +":" + document.getElementById('txtcwebport').value); + window.close("chrome://openerp_plugin/content/config_change_web.xul", "", "chrome"); + window.open("chrome://openerp_plugin/content/config.xul", "", "chrome"); +} + function openConfigChange() { window.close("chrome://openerp_plugin/content/config.xul", "", "chrome"); window.open("chrome://openerp_plugin/content/config_change.xul", "", "chrome"); } +function openConfigChangeweb() +{ + window.close("chrome://openerp_plugin/content/config.xul", "", "chrome"); + window.open("chrome://openerp_plugin/content/config_change_web.xul", "", "chrome"); +} + function appendDbList() { setServerService('xmlrpc/db'); diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.xul index 348ef92309a..3774f74b170 100755 --- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.xul +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.xul @@ -4,7 +4,7 @@ <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
- title="&title.label;" onload="myPrefObserver.register();" unload="myPrefObserver.unregister()" height="410" width="900">
+ title="&title.label;" onload="myPrefObserver.register();myPrefObserver.webregister();" unload="myPrefObserver.unregister()" height="410" width="770">
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
@@ -16,15 +16,16 @@ <tab label="About"/>
</tabs>
<tabpanels>
- <tabpanel id="configtab">
- <vbox >
- <groupbox id="gpConnection" width="770" height="300" align ="center" >
- <caption label="&gpConnection.label;"/>
+ <tabpanel id="configtab"> + <vbox style="border:1px solid black"> + <groupbox id="gpConnection" align ="center" > + <separator class="groove-thin" orient="horizontal" width="94"/> + <caption label="&gpConnection.label;"/> <hbox>
<label align="right" id="url" value="&txturl.label;" width="80" />
<textbox id="txturl" width="200" readonly="true" />
<button label="&getdblist.label;" oncommand="openConfigChange();" image="&imagesearch.value;" width="90"/>
- </hbox>
+ </hbox> <hbox align="center" id="database_option">
</hbox>
<hbox id="first">
@@ -42,11 +43,32 @@ </hbox>
<hbox >
<spacer width="290"/>
- <button align="center" id="btconnection" label="&connection.label;" oncommand="testConnection();" image="&imageok.value;" width="100"/>
- </hbox>
- </groupbox>
- </vbox>
- </tabpanel>
+ <button align="center" id="btconnection" label="&connection.label;" oncommand="testConnection();" image="&imageok.value;" width="100"/> + </hbox> + <separator class="groove-thin" orient="horizontal" width="94"/>
+ </groupbox> + </vbox> + + <separator class="groove-thin" orient="horizontal" width="10"/> + <vbox style="border:1px solid black"> + <groupbox id="webgroup" > + <vbox> + <caption label="&webConnection.label;"/> + </vbox> + <hbox> + <label align="right" id="url" value="&txtweburl.label;" width="80" />
+ <textbox id="txtweburl" width="200"/> + </hbox> + + <hbox >
+ <spacer width="113"/>
+ <button align="center" id="websetconnection" label="&setconnection.label;" oncommand="openConfigChangeweb();" image="&imagesearch.value;"/> + <button align="center" id="webopenconnection" label="&openconnection.label;" oncommand="testConnection_web();" image="&imageok.value;"/> + </hbox> +</groupbox> + </vbox> + </tabpanel> + <tabpanel id="objecttab">
<groupbox id="gpObject" width="700" >
<caption label="&listDocument.header;"/>
@@ -106,8 +128,8 @@ </tabpanel>
</tabpanels>
</tabbox>
-<hbox align="center">
- <spacer width="800"/>
+<hbox>
+ <spacer width="677"/>
<button label="&close.label;" oncommand="close();" image="&imagecancel.value;"/>
</hbox>
</window>
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 86f777ccb75..dece3457710 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 @@ -2,7 +2,7 @@ <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/config_change.dtd"> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - xmlns:html="http://www.w3.org/1999/xhtml" onload="config_change_load()" + xmlns:html="http://www.w3.org/1999/xhtml" onload="config_change_load();" title="Openerp Connection" height="140" width="240"> <script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script> <script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script> diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change_web.xul b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change_web.xul new file mode 100644 index 00000000000..9a46642d18b --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change_web.xul @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> +<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/config_change.dtd"> +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:html="http://www.w3.org/1999/xhtml" onload="config_change_load_web()" + title="Openerp Connection" height="140" width="240"> +<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script> +<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script> +<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script> +<script type="text/javascript" src="chrome://openerp_plugin/content/static.js"></script> +<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script> + <hbox> + <label align="center" id="heading" value="&lblheading.label;" style="padding-left:38px" /> + </hbox> +<groupbox id="gpData" width="200"> + <hbox > + <label id="lblurl" control="txtcurl" value="&lblurl.label;" width="50"/> + <textbox id="txtcweburl" width="140" /> + </hbox> + <hbox> + <label id="lblport" control="txtcport" value="&lblport.label;" width="50"/> + <textbox id="txtcwebport" width="140" /> + </hbox> + +</groupbox> +<hbox align="right"> + <button label="Close" image="&imagecancel.value;" oncommand="config_close();" /> + <button label="OK" image="&imageok.value;" oncommand="config_ok_web()"/> +</hbox> + +</window> 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 0bee6e705a6..961f855d944 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 @@ -91,6 +91,17 @@ var myPrefObserver = } }, + webregister: function() + { + preferenceBranch.addObserver("", myPrefObserver, false); + weburl = getWebServerURL(); + document.getElementById("txtweburl").value = weburl; + var s = document.getElementById('txtweburl').value; + + }, + + + createContactAddress: function() { document.getElementById("txtselectpartner").value = getPartnerName(); 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 6e9826dc600..d65866782c0 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 @@ -1278,7 +1278,6 @@ function searchCheckbox() xmlRpcClient.asyncCall(listSearchCheckboxHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod,arrofarr ],6); } - function searchContact() { var branchobj = getPref(); @@ -1783,6 +1782,25 @@ var listLoginHandler = { } } + +var listLoginwebHandler = { + onResult: function(client, context, result) { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess'); + weburl = getWebServerURL(); + + var urlport = weburl + alert(urlport + ":" + " " + "\n\n" + "You can copy this URL into your WebBrowser if URL is not redirected automatic."); + window.open(t); + }, + onFault: function (client, ctxt, fault) { + + }, + + onError: function (client, ctxt, status, errorMsg) { + alert("Database does not Exist!\n\n Please specify proper database name."); + } +} + //function to check the login information function testConnection(){ if (getconnect_server() == "false") @@ -1828,6 +1846,16 @@ function testConnection(){ } +function testConnection_web(){ + var branchobj = getPref(); + weburl = getWebServerURL(); + var urlport = weburl + alert(urlport + " " + "\n\n" + "You can copy this URL into your WebBrowser if URL is not redirected automatic."); + window.close(); + window.open(urlport); + xmlRpcClient.asyncCall(listLoginwebHandler,null,'login',[strwebName],1); + +} //xmlrpc request handler for handling the login information var listcreateLoginHandler = { 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 26495872037..d7c602d9b11 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 @@ -3,15 +3,20 @@ <!ENTITY close.label "Close">
<!ENTITY database.label "Database:"> <!ENTITY ok.label "OK">
-<!ENTITY connection.label "Connect">
-<!ENTITY txturl.label "Server: ">
+<!ENTITY connection.label "Connect"> +<!ENTITY setconnection.label "Change"> +<!ENTITY openconnection.label "Connect">
+<!ENTITY txturl.label "Server: "> +<!ENTITY txtweburl.label "Server: "> +<!ENTITY txtwebport.label "Port: ">
<!ENTITY image.label "Image : ">
<!ENTITY obj.label "Document : ">
<!ENTITY username.label "Username: ">
<!ENTITY password.label "Password: ">
<!ENTITY setdb.label "Move >">
<!ENTITY getdblist.label "Change">
-<!ENTITY gpConnection.label "Connection Parameters">
+<!ENTITY gpConnection.label "Connection Parameters"> +<!ENTITY webConnection.label "Webserver Parameters">
<!ENTITY listDBListBox.header "Available DBs">
<!ENTITY listDocument.header "Document">
<!ENTITY listDocumentListBox.header "Document Name">
diff --git a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change_web.dtd b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change_web.dtd new file mode 100644 index 00000000000..5ec72d0b250 --- /dev/null +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change_web.dtd @@ -0,0 +1,6 @@ +<!ENTITY lblurl.label "Server: ">
+<!ENTITY lblport.label "Port: "> +<!ENTITY lblheading.label "Openerp Connection">
+<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
+<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
+
diff --git a/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js b/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js index 1383eb28ea7..950f5c0139e 100755 --- a/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js +++ b/addons/thunderbird/plugin/openerp_plugin/defaults/preferences/tiny.js @@ -2,7 +2,7 @@ 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.webserverurl", "http://localhost:8080"); pref("extensions.tiny.webserverport", "8080"); pref("extensions.tiny.serverdbname", "terp"); pref("extensions.tiny.username","admin"); |
