[FIX] Backport bug solve in trunk + ssl implementation

bzr revid: tfr@openerp.com-20110207123644-5315u97ogvcflbr3
This commit is contained in:
jam 2011-02-07 13:36:44 +01:00 committed by Thibault Francois
parent adff989502
commit d6247fed5d
5 changed files with 36 additions and 9 deletions

View File

@ -5,11 +5,22 @@ function config_close()
window.open("chrome://openerp_plugin/content/config.xul", "", "chrome");
}
function createMenuItem(aLabel, aValue) {
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var item = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
item.setAttribute("label", aLabel);
item.setAttribute("value", aValue);
return item;
}
//set the value of the configuration fields
function config_change_load()
{
var s = getServer();
var a =s.split(':');
var popup = document.getElementById("dbprotocol_list");
popup.menupopup.appendChild(createMenuItem('XML-RPC','http://'));
popup.menupopup.appendChild(createMenuItem('XML-RPCS','https://'));
if (String(a)=="" || String(a)=="undefined"){
document.getElementById('txtcurl').value = "localhost"
document.getElementById('txtcport').value = "8069"
@ -91,6 +102,7 @@ function config_change_load_web()
function config_ok()
{
var protocol = document.getElementById("dbprotocol_list").value
if (document.getElementById('txtcurl').value == '')
{
alert("You Must Enter Server Name!")
@ -102,7 +114,12 @@ function config_ok()
alert("You Must Enter Port!")
return false;
}
setServer("http://"+document.getElementById('txtcurl').value +":" + document.getElementById('txtcport').value);
if (protocol == '')
{
alert("Invalid Porotocol!\nPlease Select protocol from Connection protocol list.")
return false;
}
setServer(document.getElementById("dbprotocol_list").value+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");
}

View File

@ -3,23 +3,33 @@
<!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();"
title="Openerp Connection" height="140" width="240">
title="Openerp Connection" height="180" width="320">
<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" />
<label align="left" id="heading" value="&lblheading.label;" style="padding-left:38px" />
</hbox>
<groupbox id="gpData" width="200">
<vbox style="border:0.5px solid gray" width="190"/>
<groupbox id="gpData" width="200">
<hbox >
<label id="lblurl" control="txtcurl" value="&lblurl.label;" width="50"/>
<textbox id="txtcurl" width="140" />
<textbox id="txtcurl" width="170" />
</hbox>
<hbox>
<label id="lblport" control="txtcport" value="&lblport.label;" width="50"/>
<textbox id="txtcport" width="140" />
<textbox id="txtcport" width="170" />
</hbox>
<hbox>
<label id="dbprotocol" value="&lblprotocol.label;" width="97" />
<menulist id="dbprotocol_list" width="140">
<menupopup>
<menuitem label="" value=""/>
</menupopup>
</menulist>
</hbox>
</groupbox>

View File

@ -1,6 +1,6 @@
<!ENTITY lblurl.label "Server: ">
<!ENTITY lblport.label "Port: ">
<!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">
<!ENTITY lblprotocol.label "Protocol Connection: ">