[ADD]: Add webserver parameter in thunderbird

bzr revid: ksa@tinyerp.co.in-20101004122345-lc3wetekshocnuan
This commit is contained in:
ksa (Open ERP) 2010-10-04 17:53:45 +05:30
parent 2195f5d9ca
commit f0c1a50d3c
11 changed files with 191 additions and 19 deletions

View File

@ -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');

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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();

View File

@ -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 = {

View File

@ -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 &gt;">
<!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">

View File

@ -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">

View File

@ -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");