[IMP]: Improvement in thunderbird for usability

bzr revid: ksa@tinyerp.co.in-20100809140136-3fp05adq4tnku2ps
This commit is contained in:
ksa (Open ERP) 2010-08-09 19:31:36 +05:30
parent 886348da21
commit 0e63ce1c6e
10 changed files with 152 additions and 57 deletions

View File

@ -3,7 +3,8 @@
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/address.dtd"> <!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/address.dtd">
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"
title="&title.label;" onload="myPrefObserver.createContactAddress()" height="350" width="800"> title="&title.label;" onload="myPrefObserver.createContactAddress()" height="380" width="800">
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script> <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/config.js"></script>
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script> <script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
@ -11,16 +12,21 @@
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script> <script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
<groupbox id="gpData"> <groupbox id="gpData">
<hbox>
<description>&emailid.value;</description>
<spacer width="55"/>
<textbox id="txtemail" width="260" />
<spacer width="5"/>
<button label="&bsearch.label;" oncommand="searchContactdetail();" image="&imagesearch.value;"/>
</hbox>
<hbox> <hbox>
<description>&name.value;</description> <description>&name.value;</description>
<spacer width="12"/> <spacer width="16"/>
<textbox id="txtname" align="right" width="270" readonly="true"/> <textbox id="txtname" align="right" width="270" readonly="true"/>
<spacer width="5"/>
<button label="New Partner" image="&imagecreate.value;" oncommand="CreatePartner.onMenuItemCommand(event);"/>
</hbox> </hbox>
<hbox>
<description>&contactname.value;</description>
<spacer width="9"/>
<textbox id="txtcontactname" align="right" width="270" />
</hbox>
<hbox> <hbox>
<caption label="&postaladdress.value;" /> <caption label="&postaladdress.value;" />
<spacer width="300"/> <spacer width="300"/>
@ -30,64 +36,63 @@
</hbox> </hbox>
<hbox> <hbox>
<description>&street.value;</description> <description>&contactname.value;</description>
<spacer width="63"/> <spacer width="15"/>
<textbox id="txtstreet" width="270"/> <textbox id="txtcontactname" align="right" width="270" />
<spacer width="33"/> <spacer width="33"/>
<vbox> <vbox>
<description>&office.value;</description> <description>&office.value;</description>
<spacer width="70"/>
</vbox> </vbox>
<vbox> <vbox>
<spacer width="68"/>
<textbox id="txtoffice" /> <textbox id="txtoffice" />
</vbox> </vbox>
</hbox> </hbox>
<hbox> <hbox>
<description>&street2.value;</description> <description>&street.value;</description>
<spacer width="54"/> <spacer width="68"/>
<textbox id="txtstreet2" width="270"/> <textbox id="txtstreet" width="270"/>
<spacer width="33"/> <spacer width="33"/>
<vbox> <vbox>
<description>&fax.value;</description> <description>&mobile.value;</description>
<spacer width="53"/> <spacer width="70"/>
</vbox>
<vbox>
<textbox id="txtmobile"/>
</vbox>
</hbox>
<hbox>
<description>&street2.value;</description>
<spacer width="60"/>
<textbox id="txtstreet2" width="270"/>
<spacer width="35"/>
<vbox>
<description>&fax.value;</description>
<spacer width="68"/>
</vbox> </vbox>
<vbox> <vbox>
<textbox id="txtfax" /> <textbox id="txtfax" />
</vbox> </vbox>
</hbox> </hbox>
<hbox>
<description>&zip.value;</description>
<spacer width="82"/>
<textbox id="txtzip" />
<spacer width="110"/>
<vbox>
<description>&mobile.value;</description>
<spacer width="53"/>
</vbox>
<vbox>
<textbox id="txtmobile" />
</vbox>
</hbox>
<hbox> <hbox>
<description>&city.value;</description> <description>&zip.value;</description>
<spacer width="79"/> <spacer width="87"/>
<textbox id="txtcity" /> <textbox id="txtzip" />
<spacer width="110"/> <spacer width="115"/>
<vbox>
<description>&email.value;</description>
<spacer width="58"/>
</vbox>
<vbox>
<textbox id="txtemail" width="260" />
</vbox>
</hbox> </hbox>
<hbox>
<description>&city.value;</description>
<spacer width="85"/>
<textbox id="txtcity" />
</hbox>
<hbox> <hbox>
<label id="lblex3" value="&country.value;"/> <label id="lblex3" value="&country.value;"/>
<spacer width="54"/> <spacer width="60"/>
<menulist id="country" width="190"> <menulist id="country" width="190">
<menupopup> <menupopup>
<menuitem label="" value=""/> <menuitem label="" value=""/>
@ -97,7 +102,7 @@
<hbox> <hbox>
<label id="lblex4" value="&state.value;"/> <label id="lblex4" value="&state.value;"/>
<spacer width="68"/> <spacer width="73"/>
<menulist id="state" width="190"> <menulist id="state" width="190">
<menupopup> <menupopup>
<menuitem label="" value=""/> <menuitem label="" value=""/>
@ -105,11 +110,16 @@
</menulist> </menulist>
</hbox> </hbox>
</groupbox> </groupbox>
<description></description> <description></description>
<hbox> <hbox>
<spacer width="600"/> <spacer width="450"/>
<button label="&create.label;" accesskey="r" image="&imagecreate.value;" oncommand="Create.onMenuItemCommand(event);"/>
<button label="&ok.label;" image="&imageok.value;" oncommand="createContact();"/>
<button label="&cancel.label;" image="&imagecancel.value;" oncommand="close();" /> <button label="&cancel.label;" image="&imagecancel.value;" oncommand="close();" />
<button label="&ok.label;" image="&imageok.value;" oncommand="UpdateContact();close()"/>
</hbox> </hbox>
</window> </window>

View File

@ -41,8 +41,8 @@
<textbox id="txtpassword" type="password" width="300"/> <textbox id="txtpassword" type="password" width="300"/>
</hbox> </hbox>
<hbox > <hbox >
<spacer width="250"/> <spacer width="290"/>
<button align="center" id="btconnection" label="&connection.label;" oncommand="testConnection();" image="&imageok.value;" width="150"/> <button align="center" id="btconnection" label="&connection.label;" oncommand="testConnection();" image="&imageok.value;" width="100"/>
</hbox> </hbox>
</groupbox> </groupbox>
</vbox> </vbox>
@ -107,8 +107,7 @@
</tabpanels> </tabpanels>
</tabbox> </tabbox>
<hbox align="center"> <hbox align="center">
<spacer width="685"/> <spacer width="800"/>
<button label="&close.label;" oncommand="close();" image="&imagecancel.value;"/> <button label="&close.label;" oncommand="close();" image="&imagecancel.value;"/>
<button label="&ok.label;" oncommand="okClick();" image="&imageok.value;"/>
</hbox> </hbox>
</window> </window>

View File

@ -285,7 +285,7 @@ var Address = {
}, },
onMenuItemCommand: function(){ onMenuItemCommand: function(){
open_contact(); open_contact();
searchContact(); searchContact();
} }
}; };

View File

@ -20,7 +20,7 @@
<hbox> <hbox>
<label id="lblsearch" control="txtvalueobj" value="&search.label;"/> <label id="lblsearch" control="txtvalueobj" value="&search.label;"/>
<textbox id="txtvalueobj" size="30"/> <textbox id="txtvalueobj" size="30"/>
<!-- <button label="&bsearch.label;" oncommand="searchCheckbox()" image="&imagesearch.value;" accesskey="s"/> --> <button label="&bsearch.label;" oncommand="searchCheckbox()" image="&imagesearch.value;" accesskey="s"/>
</hbox> </hbox>
<vbox align="left" id="checkbox-dynamic"> <vbox align="left" id="checkbox-dynamic">
</vbox> </vbox>
@ -28,9 +28,12 @@
<image src='chrome://tiny_plugin/skin/perform.gif'/> <image src='chrome://tiny_plugin/skin/perform.gif'/>
<checkbox id="cbxselectall" oncommand="selectAllCheckbox();" label="&cbxselectall.label;" checked="false"/> <checkbox id="cbxselectall" oncommand="selectAllCheckbox();" label="&cbxselectall.label;" checked="false"/>
<spacer width="10"/> <spacer width="10"/>
<button label="&bsearch.label;" oncommand="searchCheckbox()" image="&imagesearch.value;" accesskey="s"/>
</hbox> </hbox>
<label id="lblex" value=" "/>
<hbox>
<description>Documents</description>
</hbox>
<listbox height="250" id="listSearchBox" > <listbox height="250" id="listSearchBox" >
<listhead > <listhead >
<listheader label="&listSearchBox.header;"/> <listheader label="&listSearchBox.header;"/>
@ -41,7 +44,7 @@
</listbox> </listbox>
<hbox> <hbox>
<spacer width="360"/> <spacer width="360"/>
<button label="&attach.label;" accesskey="u" image="&imagearchive.value;" oncommand="attachmentWidnowOpen('upload');"/> <button label="&attach.label;" image="&imagearchive.value;" oncommand="attachmentWidnowOpen('upload');"/>
</hbox> </hbox>
</groupbox> </groupbox>

View File

@ -986,6 +986,81 @@ var listSearchContactHandler = {
} }
} }
var listSearchContactdetailHandler = {
onResult: function(client, context, result) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
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=="partner_name"){
document.getElementById("txtname").value =strlSearchResultValue;}
if(strlSearchResult=="contactname"){
document.getElementById("txtcontactname").value =strlSearchResultValue;}
if(strlSearchResult=="street"){
document.getElementById("txtstreet").value =strlSearchResultValue;}
if(strlSearchResult=="street2"){
document.getElementById("txtstreet2").value =strlSearchResultValue;}
if(strlSearchResult=="zip"){
document.getElementById("txtzip").value =strlSearchResultValue;}
if(strlSearchResult=="city"){
document.getElementById("txtcity").value =strlSearchResultValue;}
if(strlSearchResult=="phone"){
document.getElementById("txtoffice").value =strlSearchResultValue;}
if(strlSearchResult=="fax"){
document.getElementById("txtfax").value =strlSearchResultValue;}
if(strlSearchResult=="mobile"){
document.getElementById("txtmobile").value =strlSearchResultValue;}
if(strlSearchResult=="email"){
document.getElementById("txtemail").value =strlSearchResultValue;}
if(strlSearchResult=="email"){
document.getElementById("txtemailid").value =strlSearchResultValue;}
}
},
onFault: function (client, ctxt, fault) {
},
onError: function (client, ctxt, status, errorMsg) {
}
}
function searchContactdetail()
{
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,{});
var t = document.getElementById("txtemail").value
strname.data =document.getElementById("txtemail").value;
xmlRpcClient.asyncCall(listSearchContactdetailHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6);
}
//xmlrpc request handler for getting the search results for the particular selected check box object //xmlrpc request handler for getting the search results for the particular selected check box object
var listSearchCheckboxHandler = { var listSearchCheckboxHandler = {
onResult: function(client, context, result) { onResult: function(client, context, result) {
@ -1582,6 +1657,7 @@ var listLoginHandler = {
login = result.QueryInterface(Components.interfaces.nsISupportsPRInt32) login = result.QueryInterface(Components.interfaces.nsISupportsPRInt32)
setUserId(login.data); setUserId(login.data);
alert('Successful Login To OpenERP'); alert('Successful Login To OpenERP');
window.close();
} }
else{ else{
alert("Login Failed"); alert("Login Failed");
@ -1600,7 +1676,7 @@ var listLoginHandler = {
function testConnection(){ function testConnection(){
if (getconnect_server() == "false") if (getconnect_server() == "false")
{ {
alert("Please Login To The Database First !") alert("No Server Running..."+" "+getServer())
return false; return false;
} }
if (getDBList()=="false") if (getDBList()=="false")

View File

@ -11,9 +11,16 @@
<!ENTITY fax.value "Fax:"> <!ENTITY fax.value "Fax:">
<!ENTITY mobile.value "Mobile:"> <!ENTITY mobile.value "Mobile:">
<!ENTITY email.value "Email:"> <!ENTITY email.value "Email:">
<!ENTITY emailid.value "Email ID:">
<!ENTITY communication.value "Communication:"> <!ENTITY communication.value "Communication:">
<!ENTITY postaladdress.value "Postal Address:"> <!ENTITY postaladdress.value "Postal Address:">
<!ENTITY ok.label "Save"> <!ENTITY ok.label "Save">
<!ENTITY partner.label "Create New Contact :">
<!ENTITY create.label "New Contact">
<!ENTITY cancel.label "Cancel"> <!ENTITY cancel.label "Cancel">
<!ENTITY newpartner.label "New Partner">
<!ENTITY bsearch.label "Search Contact">
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif"> <!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif"> <!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
<!ENTITY imagecreate.value "chrome://openerp_plugin/skin/Create.png">
<!ENTITY imagesearch.value "chrome://openerp_plugin/skin/Search.gif">

View File

@ -3,7 +3,7 @@
<!ENTITY close.label "Cancel"> <!ENTITY close.label "Cancel">
<!ENTITY database.label "Database: "> <!ENTITY database.label "Database: ">
<!ENTITY ok.label "OK"> <!ENTITY ok.label "OK">
<!ENTITY connection.label "Test Connection"> <!ENTITY connection.label "Connect">
<!ENTITY txturl.label "Server: "> <!ENTITY txturl.label "Server: ">
<!ENTITY image.label "Image : "> <!ENTITY image.label "Image : ">
<!ENTITY obj.label "Document : "> <!ENTITY obj.label "Document : ">

View File

@ -3,7 +3,7 @@
<!ENTITY newobject.label "New Documents"> <!ENTITY newobject.label "New Documents">
<!ENTITY bsearch.label "Search"> <!ENTITY bsearch.label "Search">
<!ENTITY close.label "Close"> <!ENTITY close.label "Close">
<!ENTITY attach.label "Upload to OpenERP"> <!ENTITY attach.label "Archive to OpenERP">
<!ENTITY create.label "New Contact"> <!ENTITY create.label "New Contact">
<!ENTITY archive.label "Create"> <!ENTITY archive.label "Create">
<!ENTITY attach.label "Attach"> <!ENTITY attach.label "Attach">