commit
e093b1ee5e
Binary file not shown.
Binary file not shown.
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,10 +239,10 @@ 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");
|
||||
|
||||
}
|
||||
|
||||
|
||||
//function to open the configuration window
|
||||
var Config = {
|
||||
onLoad: function() {
|
||||
|
@ -286,7 +287,7 @@ var Address = {
|
|||
|
||||
onMenuItemCommand: function(){
|
||||
open_contact();
|
||||
searchContact();
|
||||
searchContact();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -297,9 +298,10 @@ var Select = {
|
|||
this.initialized=true;
|
||||
},
|
||||
|
||||
onMenuItemCommand: function(){
|
||||
window.open("chrome://openerp_plugin/content/selectpartner.xul", "", "chrome");
|
||||
}
|
||||
onMenuItemCommand: function(){
|
||||
//document.getElementById("txtselectpartner").value="";
|
||||
window.open("chrome://openerp_plugin/content/selectpartner.xul", "", "chrome");
|
||||
}
|
||||
};
|
||||
|
||||
var CreatePartner = {
|
||||
|
|
|
@ -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,7 +1048,7 @@ var listSearchContactdetailHandler = {
|
|||
document.getElementById("txtmobile").value =strlSearchResultValue;}
|
||||
|
||||
if(strlSearchResult=="email"&& strlSearchResultValue!=''){
|
||||
document.getElementById("txtemail").value =strlSearchResultValue;}
|
||||
document.getElementById("txtemail").value =strlSearchResultValue;}
|
||||
|
||||
if(strlSearchResult=="res_id"){
|
||||
setResourceId(strlSearchResultValue);
|
||||
|
@ -1080,7 +1085,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);
|
||||
}
|
||||
|
||||
|
@ -1259,7 +1264,7 @@ function searchContact()
|
|||
var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strmethod.data = 'search_contact';
|
||||
var strname = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strname.data =getSenderEmail();
|
||||
strname.data = getSenderEmail();
|
||||
|
||||
xmlRpcClient.asyncCall(listSearchContactHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6);
|
||||
}
|
||||
|
@ -1335,6 +1340,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,{});
|
||||
|
@ -1527,7 +1534,7 @@ function createContact(){
|
|||
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strobj.data = 'thunderbird.partner';
|
||||
var a = ['partner_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email'];
|
||||
var b = [getPartnerId(),getSenderName(),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 = [getPartnerId(),document.getElementById("txtname").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(listCreateContactHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
|
||||
}
|
||||
|
@ -1548,7 +1555,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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue