diff options
| author | Thibault Francois <tfr@openerp.com> | 2011-01-31 15:31:40 +0100 |
|---|---|---|
| committer | Thibault Francois <tfr@openerp.com> | 2011-01-31 15:31:40 +0100 |
| commit | e37edf0e3173292caaa54dc96e6dcc4aafc25f28 (patch) | |
| tree | 064afff641f6644d0b8007498698dc70bdbc80c4 | |
| parent | a3d64bb1e6537bc42ef672eea677a12649ef7e16 (diff) | |
[FIX] plugin thunderbird : opendocument with https
bzr revid: tfr@openerp.com-20110131143140-o8zl8l5quugernse
| -rw-r--r-- | addons/thunderbird/plugin/openerp_plugin.xpi | bin | 183408 -> 183832 bytes | |||
| -rw-r--r-- | addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin.jar | bin | 86513 -> 86649 bytes | |||
| -rw-r--r-- | addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js | 330 | ||||
| -rw-r--r-- | addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config_change_web.xul | 28 | ||||
| -rw-r--r-- | addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/locale/en-US/config_change_web.dtd | 4 |
5 files changed, 188 insertions, 174 deletions
diff --git a/addons/thunderbird/plugin/openerp_plugin.xpi b/addons/thunderbird/plugin/openerp_plugin.xpi Binary files differindex a506e8df561..a0734681fd9 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 4b6bacaabf4..f046e937a92 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 e06504baa09..064f8453d28 100644 --- a/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js +++ b/addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js @@ -2,126 +2,134 @@ function config_close() { window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome"); - window.open("chrome://openerp_plugin/content/config.xul", "", "chrome"); + window.open("chrome://openerp_plugin/content/config.xul", "", "chrome"); } //set the value of the configuration fields function config_change_load() { - var s = getServer(); - var a =s.split(':'); - if (String(a)=="" || String(a)=="undefined"){ - document.getElementById('txtcurl').value = "localhost" - document.getElementById('txtcport').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('txtcurl').value = "localhost" - } - else - { - document.getElementById('txtcurl').value = url - } - - if (String(a[2]) == "" || String(a[2]) == "undefined"){ - document.getElementById('txtcport').value = "8069" - setPort("8069"); - } - else - { - document.getElementById('txtcport').value = a[2] - setPort(a[2]); - } - - } + var s = getServer(); + var a =s.split(':'); + if (String(a)=="" || String(a)=="undefined"){ + document.getElementById('txtcurl').value = "localhost" + document.getElementById('txtcport').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('txtcurl').value = "localhost" + } + else + { + document.getElementById('txtcurl').value = url + } + + if (String(a[2]) == "" || String(a[2]) == "undefined"){ + document.getElementById('txtcport').value = "8069" + setPort("8069"); + } + else + { + document.getElementById('txtcport').value = a[2] + setPort(a[2]); + } + + } } function config_change_load_web() { - //var s = getServer(); + //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]); - } - - } + 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 == '') - { + if (document.getElementById('txtcurl').value == '') + { alert("You Must Enter Server Name!") - return false; + return false; - } - if (document.getElementById('txtcport').value == '') - { - alert("You Must Enter Port!") - return false; - } - setServer("http://"+document.getElementById('txtcurl').value +":" + document.getElementById('txtcport').value); - window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome"); + } + if (document.getElementById('txtcport').value == '') + { + alert("You Must Enter Port!") + return false; + } + setServer("http://"+document.getElementById('txtcurl').value +":" + document.getElementById('txtcport').value); + 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 == '') - { + if (document.getElementById('txtcweburl').value == '') + { alert("You Must Enter Server Name!") - return false; + 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"); + } + if (document.getElementById('txtcwebport').value == '' && !document.getElementById('lblssl').checked) + { + alert("You Must Enter Port!") + return false; + } + var protocol = "http://"; + var port = document.getElementById('txtcwebport').value + if(document.getElementById('lblssl').checked) { + protocol = "https://"; + if(port == '') { + port = 443 + } + } + setWebServerURL(protocol + document.getElementById('txtcweburl').value +":" + port); + window.close("chrome://openerp_plugin/content/config_change_web.xul", "", "chrome"); window.open("chrome://openerp_plugin/content/config.xul", "", "chrome"); } @@ -139,89 +147,89 @@ function openConfigChangeweb() function appendDbList() { - setServerService('xmlrpc/db'); - getDbList('DBlist'); + setServerService('xmlrpc/db'); + getDbList('DBlist'); } //set the database list in the listbox in configuration window function setDb() { - var cmbDbList = document.getElementById('listDBListBox'); - document.getElementById('DBlist').value = cmbDbList.getItemAtIndex(cmbDbList.selectedIndex).value; + var cmbDbList = document.getElementById('listDBListBox'); + document.getElementById('DBlist').value = cmbDbList.getItemAtIndex(cmbDbList.selectedIndex).value; } //stores the value of configuration fields in preferences function okClick() { - if (getDBList()=="false") - { - if (document.getElementById('DBlist_text').value =='') - { - alert("You Must Enter Database Name"); - return false; - } - setDbName(document.getElementById('DBlist_text').value); - } - else if(document.getElementById('DBlist') != null) - { - setDbName(document.getElementById('DBlist').value); - } - setServer(document.getElementById('txturl').value); - var s = document.getElementById('txturl').value; - var a =s.split(':'); - setPort(a[a.length-1]); - setUsername(document.getElementById('txtusername').value); - setPassword(document.getElementById('txtpassword').value); - window.close(); + if (getDBList()=="false") + { + if (document.getElementById('DBlist_text').value =='') + { + alert("You Must Enter Database Name"); + return false; + } + setDbName(document.getElementById('DBlist_text').value); + } + else if(document.getElementById('DBlist') != null) + { + setDbName(document.getElementById('DBlist').value); + } + setServer(document.getElementById('txturl').value); + var s = document.getElementById('txturl').value; + var a =s.split(':'); + setPort(a[a.length-1]); + setUsername(document.getElementById('txtusername').value); + setPassword(document.getElementById('txtpassword').value); + window.close(); } //deletes the value of the selected value in the listbox in configuraton menu function deleteDocument(){ - if(document.getElementById("listObjectListBox").selectedItem){ - var objectlist = getPref().getCharPref("object").split(','); - var imagelist = getPref().getCharPref("imagename").split(','); - var objlist = getPref().getCharPref("listobject").split(','); - if(objectlist.length>0){ - var objectcharpref = ''; - var imagecharpref = ''; - var objcharpref = ''; - var nodelist = document.getElementById("listObjectListBox").selectedItem.childNodes - var childnode = document.getElementById("listObjectListBox").childNodes - for(i=2;i<childnode.length;i++){ - if(childnode[i].hasChildNodes){ - var secondchild = childnode[i].childNodes; - if (secondchild[1].getAttribute("label") != nodelist[1].getAttribute("label")){ - objcharpref += secondchild[0].getAttribute("label")+','; - objectcharpref += secondchild[1].getAttribute("label")+','; - imagecharpref += secondchild[2].getAttribute("image")+','; - } - } - } - var demo3 = objectcharpref.substring(0,objectcharpref.length-1); - var demo4 = imagecharpref.substring(0,imagecharpref.length-1); - var demo5 = objcharpref.substring(0,objcharpref.length-1); - - getPref().setCharPref("listobject",demo5); - getPref().setCharPref("object",demo3); - getPref().setCharPref("imagename",demo4); - } - document.getElementById("listObjectListBox").removeItemAt(document.getElementById("listObjectListBox").selectedIndex) - } - else{ - alert("Please Select Any One Document "); - } + if(document.getElementById("listObjectListBox").selectedItem){ + var objectlist = getPref().getCharPref("object").split(','); + var imagelist = getPref().getCharPref("imagename").split(','); + var objlist = getPref().getCharPref("listobject").split(','); + if(objectlist.length>0){ + var objectcharpref = ''; + var imagecharpref = ''; + var objcharpref = ''; + var nodelist = document.getElementById("listObjectListBox").selectedItem.childNodes + var childnode = document.getElementById("listObjectListBox").childNodes + for(i=2;i<childnode.length;i++){ + if(childnode[i].hasChildNodes){ + var secondchild = childnode[i].childNodes; + if (secondchild[1].getAttribute("label") != nodelist[1].getAttribute("label")){ + objcharpref += secondchild[0].getAttribute("label")+','; + objectcharpref += secondchild[1].getAttribute("label")+','; + imagecharpref += secondchild[2].getAttribute("image")+','; + } + } + } + var demo3 = objectcharpref.substring(0,objectcharpref.length-1); + var demo4 = imagecharpref.substring(0,imagecharpref.length-1); + var demo5 = objcharpref.substring(0,objcharpref.length-1); + + getPref().setCharPref("listobject",demo5); + getPref().setCharPref("object",demo3); + getPref().setCharPref("imagename",demo4); + } + document.getElementById("listObjectListBox").removeItemAt(document.getElementById("listObjectListBox").selectedIndex) + } + else{ + alert("Please Select Any One Document "); + } } //function to add the image file for the checkbox function addFile(){ - var nsIFilePicker = Components.interfaces.nsIFilePicker; - var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); - fp.init(this, "Select a File", nsIFilePicker.modeOpen); - fp.appendFilters(nsIFilePicker.filterImages); - var res = fp.show(); - if (res == nsIFilePicker.returnOK){ - var thefile = fp.file; - document.getElementById("txtimagename").value = thefile.path - } + var nsIFilePicker = Components.interfaces.nsIFilePicker; + var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); + fp.init(this, "Select a File", nsIFilePicker.modeOpen); + fp.appendFilters(nsIFilePicker.filterImages); + var res = fp.show(); + if (res == nsIFilePicker.returnOK){ + var thefile = fp.file; + document.getElementById("txtimagename").value = thefile.path + } } 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 index 9a46642d18b..fa23a9a0c40 100644 --- 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 @@ -2,25 +2,29 @@ <?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"> + 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> + <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> + <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> + <hbox> + + <checkbox id="lblssl" label="SSL (https)" checked="false"/> + </hbox> </groupbox> <hbox align="right"> 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 index 5ec72d0b250..f241c1893cc 100644 --- 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 @@ -1,5 +1,7 @@ <!ENTITY lblurl.label "Server: ">
-<!ENTITY lblport.label "Port: "> +<!ENTITY lblport.label "Port: ">
+<!ENTITY lblssl.label "Use SLL ? ">
+ <!ENTITY lblheading.label "Openerp Connection">
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
|
