[IMP] : Improvement usability

bzr revid: ksa@tinyerp.co.in-20100820101435-hm7evsqu3uoqsszq
This commit is contained in:
ksa (Open ERP) 2010-08-20 15:44:35 +05:30
parent 52daa37266
commit b6823b2560
6 changed files with 22 additions and 13 deletions

View File

@ -3,7 +3,7 @@
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/address.dtd">
<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.createContactAddress()" height="480" width="764">
title="&title.label;" onload="myPrefObserver.createContactAddress();" height="480" width="764">
<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>
@ -23,9 +23,10 @@
</hbox>
<hbox>
<label align="right" id="name" value="&name.value;" width="80" />
<textbox id="txtname" align="right" width="270" readonly="true"/>
<textbox id="txtselectpartner" align="right" width="270" readonly="true"/>
<spacer width="5"/>
<button label="New Partner" image="&imagecreate.value;" oncommand="CreatePartner.onMenuItemCommand(event);" width="133"/>
<button label="Search Partner" image="&imagesearch.value;" oncommand="Select.onMenuItemCommand(event);getPartnerList();" width="128"/>
</hbox>
<separator class="groove-thin" orient="horizontal" width="94"/>
</groupbox>

View File

@ -92,7 +92,7 @@ var myPrefObserver =
createContactAddress: function()
{
document.getElementById("txtname").value = getPartnerName();
document.getElementById("txtselectpartner").value = getPartnerName();
document.getElementById("txtcontactname").value = getSenderName();
document.getElementById("txtstreet").value = getStreet();
document.getElementById("txtstreet2").value = getStreet2();

View File

@ -177,6 +177,7 @@ function searchmail()
}
}
function open_contact()
{
setTimeout("createConnection()",5000)
@ -222,8 +223,8 @@ function open_contact()
}
//set the initial information for the selected email
setSenderEmail(senderemail);
setSenderName(sendername);
setSenderEmail(senderemail);
setSenderName(sendername);
setPartnerName("");
setStreet("");
setStreet2("");
@ -238,7 +239,6 @@ function open_contact()
alert("Please install the thunderbird module on your '" + getDbName() +"' database and try again !");
return false
}
window.open("chrome://openerp_plugin/content/address.xul", "", "chrome, resizable=yes");
}
@ -286,7 +286,7 @@ var Address = {
onMenuItemCommand: function(){
open_contact();
searchContact();
searchContact();
}
};
@ -298,7 +298,7 @@ var Select = {
},
onMenuItemCommand: function(){
window.open("chrome://openerp_plugin/content/selectpartner.xul", "", "chrome");
window.open("chrome://openerp_plugin/content/selectpartner.xul", "", "chrome");
}
};

View File

@ -985,8 +985,13 @@ var listSearchContactHandler = {
if(strlSearchResult=="email" && strlSearchResultValue!=''){
setSenderEmail(strlSearchResultValue);
var t = getSenderEmail();}
var t = getSenderEmail();
window.open("chrome://openerp_plugin/content/address.xul", "", "chrome, resizable=yes");}
if(strlSearchResult=="email" && strlSearchResultValue==''){
alert("Contact is not available.");
}
if(strlSearchResult=="res_id"){
setResourceId(strlSearchResultValue);
var t = getResourceId();}
@ -1014,11 +1019,11 @@ var listSearchContactdetailHandler = {
var strlSearchResultValue = strlResult.QueryElementAt(1, Components.interfaces.nsISupportsCString);
if(strlSearchResult=="email" && strlSearchResultValue=='')
{
alert("Contact is not Available")
alert("Contact is not Available.")
document.getElementById("txtemail").value = sendername;
}
if(strlSearchResult=="partner_name"){
document.getElementById("txtname").value =strlSearchResultValue;}
document.getElementById("txtselectpartner").value =strlSearchResultValue;}
if(strlSearchResult=="contactname"){
document.getElementById("txtcontactname").value =strlSearchResultValue;}
@ -1043,6 +1048,7 @@ var listSearchContactdetailHandler = {
document.getElementById("txtmobile").value =strlSearchResultValue;}
if(strlSearchResult=="email"&& strlSearchResultValue!=''){
alert("Contact is available.");
document.getElementById("txtemail").value =strlSearchResultValue;}
if(strlSearchResult=="res_id"){
@ -1080,7 +1086,7 @@ function searchContactdetail()
var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{});
strmethod.data = 'search_contact';
var strname = xmlRpcClient.createType(xmlRpcClient.STRING,{});
strname.data =document.getElementById("txtemail").value;
strname.data = document.getElementById("txtemail").value;
xmlRpcClient.asyncCall(listSearchContactdetailHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6);
}
@ -1335,6 +1341,8 @@ function getPartnerList(){
strvalue.data = document.getElementById('txtselectpartner').value;
xmlRpcClient.asyncCall(listPartnerHandler,cmdPartnerList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strvalue ],6);
}
//function to create the xmlrpc supported variables for xmlrpc request
function dictcontact(a,b){
var temp = xmlRpcClient.createType(xmlRpcClient.ARRAY,{});
@ -1548,7 +1556,7 @@ function UpdateContact(){
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
strobj.data = 'thunderbird.partner';
var a = ['res_id','partner_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email'];
var b = [getResourceId(),getPartnerName(),document.getElementById("txtcontactname").value,document.getElementById("txtstreet").value,document.getElementById("txtstreet2").value,document.getElementById("txtzip").value, document.getElementById("txtcity").value,document.getElementById("country").value,document.getElementById("state").value,document.getElementById("txtoffice").value,document.getElementById("txtfax").value,document.getElementById("txtmobile").value,document.getElementById("txtemail").value];
var b = [getResourceId(),document.getElementById("txtselectpartner").value,document.getElementById("txtcontactname").value,document.getElementById("txtstreet").value,document.getElementById("txtstreet2").value,document.getElementById("txtzip").value, document.getElementById("txtcity").value,document.getElementById("country").value,document.getElementById("state").value,document.getElementById("txtoffice").value,document.getElementById("txtfax").value,document.getElementById("txtmobile").value,document.getElementById("txtemail").value];
var arrofarr = dictcontact(a,b);
xmlRpcClient.asyncCall(listUpdateContactHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
}