|
|
|
@ -24,7 +24,7 @@ var attach_eml ="no";
|
|
|
|
|
var popup_display = "yes"
|
|
|
|
|
var rpc= {
|
|
|
|
|
servers: {},
|
|
|
|
|
addserver: function(name,ip,port,path) {
|
|
|
|
|
addserver: function(name,ip,port,path) {//alert(name+','+ip+','+port+','+path);
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
this.servers[name]= {
|
|
|
|
|
ip: ip,
|
|
|
|
@ -84,9 +84,11 @@ var rpc= {
|
|
|
|
|
case Date: return 5;
|
|
|
|
|
case Object: return 7;
|
|
|
|
|
case Array: return 6;
|
|
|
|
|
// base64
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 7;
|
|
|
|
|
//return [false,'error checktype','Unknown type'];
|
|
|
|
|
},
|
|
|
|
|
set: function(rpcobj,param) {
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
@ -301,7 +303,7 @@ function setCity(argCity){
|
|
|
|
|
|
|
|
|
|
//set preference value for country
|
|
|
|
|
function setCountry(argCountry){
|
|
|
|
|
getPref().setCharPref('country',argCountry)
|
|
|
|
|
getPref().setCharPref('country',argCountry)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//set preference value for state
|
|
|
|
@ -396,6 +398,7 @@ function getPassword(){
|
|
|
|
|
//get serverservice
|
|
|
|
|
function getServerService(){
|
|
|
|
|
return strServerService;
|
|
|
|
|
// return getPref().getCharPref('strServerService');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//get sender email
|
|
|
|
@ -423,6 +426,8 @@ function getSenderName(){
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//string = str.replace(/[\+\/\=\?\_\-]/g, "");
|
|
|
|
|
// string = str.replace(/[\'ë']/g,'e');
|
|
|
|
|
string = str.replace(/[\'Š',\'Ž',\'š',\'ž',\'Ÿ',\'À',\'Á',\'Â',\'Ã',\'Ä',\'Å',\'Ç',\'È',\'É',\'Ê',\'Ë',\'Ì',\'Í',\'Î',\'Ï',\'Ñ',\'Ò',\'Ó',\'Ô',\'Õ',\'Ö',\'Ø',\'Ù',\'Ú',\'Û',\'Ü',\'Ý',\'à',\'á',\'â',\'ã',\'ä',\'å',\'ç',\'è',\'é',\'ê',\'ë',\'ì',\'í',\'î',\'ï',\'ñ',\'ò',\'ó',\'ô',\'õ',\'ö',\'ø',\'ù',\'ú',\'û',\'ü',\'ý',\'ÿ',\'Þ',\'þ',\'Ð',\'ð',\'ß',\'Œ',\'œ',\'Æ',\'æ',\'µ']/g,'"',"'",'“','”',"\n","\r",'_/',"'S','Z','s','z','Y','A','A','A','A','A','A','C','E','E','E','E','I','I','I','I','N','O','O','O','O','O','O','U','U','U','U','Y','a','a','a','a','a','a','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','o','u','u','u','u','y','y','TH','th','DH','dh','ss','OE','oe','AE','ae','u','','','','','','','-'");
|
|
|
|
|
|
|
|
|
|
var utftext = "";
|
|
|
|
@ -435,6 +440,8 @@ function getSenderName(){
|
|
|
|
|
utftext += String.fromCharCode(c);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// encoded_string = encodeURIComponent(utftext);
|
|
|
|
|
// decoded_string = decodeURIComponent(encoded_string);
|
|
|
|
|
encoded_string = encode64(utftext);
|
|
|
|
|
return encoded_string;
|
|
|
|
|
}
|
|
|
|
@ -582,6 +589,7 @@ var listDbHandler = {
|
|
|
|
|
setconnect_server("true")
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
var arrMethodList = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
|
|
|
|
// Set the number of results
|
|
|
|
|
var count = arrMethodList.Count();
|
|
|
|
|
// Loop through the results, adding items to the list
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
@ -630,7 +638,7 @@ var listDbHandler = {
|
|
|
|
|
if (count)
|
|
|
|
|
{
|
|
|
|
|
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
|
|
|
|
var popup = document.getElementById("DBlist");
|
|
|
|
|
var popup = document.getElementById("DBlist"); // a <menupopup> element
|
|
|
|
|
var arrsec=new Array()
|
|
|
|
|
for (var i=0;i<popup.menupopup.childNodes.length;i++) {
|
|
|
|
|
arrsec.push(popup.menupopup.childNodes[i].label)
|
|
|
|
@ -660,18 +668,20 @@ function getDbList(argControl)
|
|
|
|
|
{
|
|
|
|
|
setDBList("false")
|
|
|
|
|
setconnect_server("false")
|
|
|
|
|
// Enable correct security
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
// Get the instance of the XML-RPC client
|
|
|
|
|
var xmlRpcClient = getXmlRpc();
|
|
|
|
|
arrDbList = [];
|
|
|
|
|
var cmbDbList = document.getElementById(argControl);
|
|
|
|
|
//setDBList("false")
|
|
|
|
|
xmlRpcClient.asyncCall(listDbHandler,cmbDbList,'list',[],0);
|
|
|
|
|
return arrDbList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function createMenuItem_partner(aLabel, aValue) {
|
|
|
|
|
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
|
|
|
|
var item = document.createElementNS(XUL_NS, "menuitem");
|
|
|
|
|
var item = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
|
|
|
|
|
item.setAttribute("label", aLabel);
|
|
|
|
|
item.setAttribute("value", aValue);
|
|
|
|
|
return item;
|
|
|
|
@ -683,7 +693,10 @@ var listAllDocumentHandler = {
|
|
|
|
|
onResult: function(client, context, result) {
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
var arrIdList = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
|
|
|
|
// Set the number of results
|
|
|
|
|
//alert(arrIdList)
|
|
|
|
|
var count = arrIdList.Count();
|
|
|
|
|
// alert("START::")
|
|
|
|
|
// Loop through the results, adding items to the list
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
var strlResult = arrIdList.QueryElementAt(i, Components.interfaces.nsISupportsArray);
|
|
|
|
@ -696,7 +709,7 @@ var listAllDocumentHandler = {
|
|
|
|
|
if (context)
|
|
|
|
|
{
|
|
|
|
|
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
|
|
|
|
var popup = document.getElementById("section");
|
|
|
|
|
var popup = document.getElementById("section"); // a <menupopup> element
|
|
|
|
|
for (i=0;i<arrPartnerList.length;i++){
|
|
|
|
|
popup.menupopup.appendChild(createMenuItem_partner(arrPartnerList[i][1],arrPartnerList[i][0]));
|
|
|
|
|
}
|
|
|
|
@ -705,9 +718,11 @@ var listAllDocumentHandler = {
|
|
|
|
|
searchCheckbox()
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
//alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert('Error: '+errorMsg );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -730,7 +745,7 @@ var listAllCountryHandler = {
|
|
|
|
|
if (!context)
|
|
|
|
|
{
|
|
|
|
|
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
|
|
|
|
var popup = document.getElementById("country");
|
|
|
|
|
var popup = document.getElementById("country"); // a <menupopup> element
|
|
|
|
|
for (i=0;i<arrPartnerList.length;i++){
|
|
|
|
|
popup.menupopup.appendChild(createMenuItem_partner(arrPartnerList[i][1],arrPartnerList[i][0]));
|
|
|
|
|
|
|
|
|
@ -739,9 +754,11 @@ var listAllCountryHandler = {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
//alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert('Error: '+errorMsg );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -750,7 +767,9 @@ var listAllStateHandler = {
|
|
|
|
|
onResult: function(client, context, result) {
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
var arrIdList = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
|
|
|
|
// Set the number of results
|
|
|
|
|
var count = arrIdList.Count();
|
|
|
|
|
// alert("START::")
|
|
|
|
|
// Loop through the results, adding items to the list
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
var strlResult = arrIdList.QueryElementAt(i, Components.interfaces.nsISupportsArray);
|
|
|
|
@ -764,6 +783,7 @@ var listAllStateHandler = {
|
|
|
|
|
{
|
|
|
|
|
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
|
|
|
|
var popup = document.getElementById("state");
|
|
|
|
|
// a <menupopup> element
|
|
|
|
|
for (i=0;i<arrPartnerList1.length;i++){
|
|
|
|
|
popup.menupopup.appendChild(createMenuItem_partner(arrPartnerList1[i][1],arrPartnerList1[i][0]));
|
|
|
|
|
|
|
|
|
@ -772,9 +792,11 @@ var listAllStateHandler = {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
//alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert('Error: '+errorMsg );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -782,6 +804,7 @@ var listAllStateHandler = {
|
|
|
|
|
//function to get the list of All object
|
|
|
|
|
function getAllDocument(){
|
|
|
|
|
var branchobj = getPref();
|
|
|
|
|
//window.opener.document.getElementById('txtselectpartner').setAttribute('value','');
|
|
|
|
|
setServerService('xmlrpc/object');
|
|
|
|
|
var xmlRpcClient = getXmlRpc();
|
|
|
|
|
arrPartnerList = [];
|
|
|
|
@ -802,7 +825,8 @@ function getAllDocument(){
|
|
|
|
|
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
|
|
|
|
strobj.data = 'thunderbird.partner';
|
|
|
|
|
var strvalue = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
|
|
|
|
strvalue.data = ""
|
|
|
|
|
strvalue.data = ""//document.getElementById('txtselectpartner').value;
|
|
|
|
|
//alert("AAAAAAAAAAAAA")
|
|
|
|
|
xmlRpcClient.asyncCall(listAllDocumentHandler,cmdObjectList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strvalue ],6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -828,6 +852,7 @@ function getAllCountry(){
|
|
|
|
|
|
|
|
|
|
function getAllState(){
|
|
|
|
|
var branchobj = getPref();
|
|
|
|
|
//window.opener.document.getElementById('txtselectpartner').setAttribute('value','');
|
|
|
|
|
setServerService('xmlrpc/object');
|
|
|
|
|
var xmlRpcClient = getXmlRpc();
|
|
|
|
|
arrPartnerList1 = [];
|
|
|
|
@ -870,7 +895,7 @@ function dictcreation(value,checkboxobj){
|
|
|
|
|
//function to search and fillup section selection box
|
|
|
|
|
function createMenuItem(aLabel) {
|
|
|
|
|
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
|
|
|
|
var item = document.createElementNS(XUL_NS, "menuitem");
|
|
|
|
|
var item = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
|
|
|
|
|
item.setAttribute("label", aLabel[1]);
|
|
|
|
|
item.setAttribute("value", aLabel[0]);
|
|
|
|
|
return item;
|
|
|
|
@ -881,6 +906,7 @@ function listinstallmodule( result ) {
|
|
|
|
|
if ( rpc.onfault( result ) )
|
|
|
|
|
{
|
|
|
|
|
setmodule_install('no')
|
|
|
|
|
//window.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -914,7 +940,6 @@ var listSearchContactHandler = {
|
|
|
|
|
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"){
|
|
|
|
|
setPartnerName(strlSearchResultValue);
|
|
|
|
|
var t = getPartnerName();}
|
|
|
|
@ -958,12 +983,6 @@ var listSearchContactHandler = {
|
|
|
|
|
if(strlSearchResult=="res_id"){
|
|
|
|
|
setResourceId(strlSearchResultValue);
|
|
|
|
|
var t = getResourceId();}
|
|
|
|
|
|
|
|
|
|
if(strlSearchResult=="country"){
|
|
|
|
|
var t = getAllCountry();}
|
|
|
|
|
|
|
|
|
|
if(strlSearchResult=="state"){
|
|
|
|
|
var t = getAllState();}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
@ -980,6 +999,7 @@ var listSearchCheckboxHandler = {
|
|
|
|
|
onResult: function(client, context, result) {
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
var arrMethodList = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
|
|
|
|
// Set the number of results
|
|
|
|
|
var count = arrMethodList.Count();
|
|
|
|
|
var close=0;
|
|
|
|
|
if(count == 0 && popup_display != "no"){
|
|
|
|
@ -1088,9 +1108,11 @@ var listSearchCheckboxHandler = {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
// alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert('Error: ThunderBird Module Not Install');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -1158,6 +1180,7 @@ var listPartnerHandler = {
|
|
|
|
|
onResult: function(client, context, result) {
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
var arrIdList = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
|
|
|
|
// Set the number of results
|
|
|
|
|
var count = arrIdList.Count();
|
|
|
|
|
// Loop through the results, adding items to the list
|
|
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
@ -1188,9 +1211,11 @@ var listPartnerHandler = {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
//alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert('Error: '+errorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//function to get the list of partners
|
|
|
|
@ -1240,10 +1265,11 @@ var listArchiveHandler = {
|
|
|
|
|
onResult: function(client, context, result) {
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
var createId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32);
|
|
|
|
|
//getPref().setCharPref("messagebody","");
|
|
|
|
|
//condition to handle the automatic attachment creation
|
|
|
|
|
attach = getAttachment()
|
|
|
|
|
attachment = "no"
|
|
|
|
|
var popup = document.getElementById("section").selectedItem.value;
|
|
|
|
|
var popup = document.getElementById("section").selectedItem.value; // a <menupopup> element
|
|
|
|
|
if(getPref().getCharPref('attachmentlength')>0){
|
|
|
|
|
if (getAttachValue() == '1'){
|
|
|
|
|
//calling the method to create the attachments
|
|
|
|
@ -1257,26 +1283,30 @@ var listArchiveHandler = {
|
|
|
|
|
attachment = "yes"
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
// alert("Mail Archived Successfully");
|
|
|
|
|
attachment = "no"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
|
|
// alert("Mail Archived Successfully");
|
|
|
|
|
attachment = "no"
|
|
|
|
|
}
|
|
|
|
|
createAttachmentEML_CRM(popup, createId, attachment)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
//alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert("You must select object !")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//function to archive the mail content through xmlrpc request
|
|
|
|
|
function archivemail(){
|
|
|
|
|
var popup = document.getElementById("section").selectedItem;
|
|
|
|
|
var popup = document.getElementById("section").selectedItem; // a <menupopup> element
|
|
|
|
|
|
|
|
|
|
if (String(popup) != "null"){
|
|
|
|
|
object=popup.value;
|
|
|
|
@ -1341,23 +1371,28 @@ var listCreateContactHandler = {
|
|
|
|
|
window.close();
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
alert('Error: '+errorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var listUpdateContactHandler = {
|
|
|
|
|
onResult: function(client, context, result) {
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
var ResourceId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32);
|
|
|
|
|
setResourceId(ResourceId);
|
|
|
|
|
var partnerId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32);
|
|
|
|
|
setResourceId(partnerId);
|
|
|
|
|
//alert("Contact Created Successfully.");
|
|
|
|
|
window.close();
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
//alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert('Error: '+errorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1382,7 +1417,7 @@ function createContact(){
|
|
|
|
|
var arrofarr = dictcontact(a,b);
|
|
|
|
|
xmlRpcClient.asyncCall(listCreateContactHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ksa
|
|
|
|
|
function UpdateContact(){
|
|
|
|
|
var branchobj = getPref();
|
|
|
|
|
setServerService('xmlrpc/object');
|
|
|
|
@ -1398,8 +1433,8 @@ function UpdateContact(){
|
|
|
|
|
strmethod.data = 'update_contact';
|
|
|
|
|
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
|
|
|
|
strobj.data = 'thunderbird.partner';
|
|
|
|
|
var a = ['res_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email'];
|
|
|
|
|
var b = [getResourceId(),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,getSenderEmail()];
|
|
|
|
|
var a = ['res_id','partner_id','name','street','street2','zip','city','country_id','state_id','phone','fax','mobile','email'];
|
|
|
|
|
var b = [getResourceId(),getPartnerName(),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,getSenderEmail()];
|
|
|
|
|
var arrofarr = dictcontact(a,b);
|
|
|
|
|
xmlRpcClient.asyncCall(listUpdateContactHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
|
|
|
|
|
}
|
|
|
|
@ -1409,12 +1444,26 @@ var listAttachHandler = {
|
|
|
|
|
onResult: function(client, context, result) {
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
|
var createId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32);
|
|
|
|
|
|
|
|
|
|
/*if(createId){
|
|
|
|
|
attach = getAttachment()
|
|
|
|
|
if (attach_eml=="yes")
|
|
|
|
|
{
|
|
|
|
|
//alert("Mail Archived Successfully");
|
|
|
|
|
}
|
|
|
|
|
else if (attach_eml =="no" && attach =="yes")
|
|
|
|
|
{
|
|
|
|
|
alert("Mail Archived Successfully With Attachments");
|
|
|
|
|
}
|
|
|
|
|
//getPref().setCharPref("attachmentdata","")
|
|
|
|
|
attach_eml="no"
|
|
|
|
|
}*/
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
// alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
// alert('Error: '+client + ctxt + status + errorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1435,6 +1484,7 @@ function createAttachment(popup,res_id){
|
|
|
|
|
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
|
|
|
|
strobj.data = 'thunderbird.partner';
|
|
|
|
|
var resobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
|
|
|
|
// var popup = document.getElementById("section").selectedItem; // a <menupopup> element
|
|
|
|
|
object=popup;
|
|
|
|
|
resobj.data = object;
|
|
|
|
|
var a = ['name','datas','res_model','res_id','description','datas_fname'];
|
|
|
|
@ -1518,7 +1568,10 @@ return output;
|
|
|
|
|
function createInstance(name,test){
|
|
|
|
|
var encoded_string = '';
|
|
|
|
|
var file_name = ''
|
|
|
|
|
//alert("Downloading Attachment Data");
|
|
|
|
|
for(i=0;i<test.length;i++){
|
|
|
|
|
//while(!test[i].exists()){
|
|
|
|
|
//}
|
|
|
|
|
var stream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
|
|
|
|
|
stream.init(test[i], 0x01, 00004, 0);
|
|
|
|
|
var bstream = Components.classes["@mozilla.org/binaryinputstream;1"].createInstance(Components.interfaces.nsIBinaryInputStream);
|
|
|
|
@ -1626,9 +1679,12 @@ var listcreateLoginHandler = {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
setconnect_server("false")
|
|
|
|
|
//alert("Database does not Exist!\n\n Please specify proper database name.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1654,6 +1710,7 @@ var listCreatePartnerHandler = {
|
|
|
|
|
var createId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32);
|
|
|
|
|
|
|
|
|
|
if(typeof(createId.data) == 'number' && createId!=0){
|
|
|
|
|
// alert("Partner Created Successfully");
|
|
|
|
|
window.close();
|
|
|
|
|
}
|
|
|
|
|
if(createId == 0){
|
|
|
|
@ -1661,9 +1718,11 @@ var listCreatePartnerHandler = {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
//alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert('Error: '+errorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//function to create the tiny partner object
|
|
|
|
@ -1740,9 +1799,11 @@ var listSearchDocumentHandler = {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
//alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert('Error: '+errorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1796,12 +1857,14 @@ var listsearchAttachmentHandler = {
|
|
|
|
|
{
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
//alert(obj[i])
|
|
|
|
|
if(count%3==0){
|
|
|
|
|
var vbox = document.createElement("hbox");
|
|
|
|
|
}
|
|
|
|
|
count += 1
|
|
|
|
|
var hbox = document.createElement("vbox");
|
|
|
|
|
var checkbox1 = document.createElement("checkbox");
|
|
|
|
|
//checkBoxCreate()
|
|
|
|
|
checkbox1.setAttribute("label",object[i]);
|
|
|
|
|
checkbox1.setAttribute("id","cbx"+(i+1));
|
|
|
|
|
checkbox1.setAttribute("width",150)
|
|
|
|
@ -1830,17 +1893,21 @@ var listsearchAttachmentHandler = {
|
|
|
|
|
|
|
|
|
|
new_grp.height = parseInt(parseInt(new_grp.height) + parseInt((count /3) * 23.5))
|
|
|
|
|
win = document.getElementById("pluginwindows").setAttribute("height",1000)
|
|
|
|
|
//win.height = 1000 //parseInt(parseInt((count /3) * 32) + parseInt(win.height))
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onFault: function (client, ctxt, fault) {
|
|
|
|
|
//alert('XML-RPC Fault: '+fault);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onError: function (client, ctxt, status, errorMsg) {
|
|
|
|
|
//alert('ERROR:::::::: '+errorMsg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//function to create a new attachment record
|
|
|
|
|
function listSearchDocumentAttachment(){
|
|
|
|
|
//alert("AA:")
|
|
|
|
|
var branchobj = getPref();
|
|
|
|
|
setServerService('xmlrpc/object');
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
|
|
|
@ -1856,12 +1923,13 @@ function listSearchDocumentAttachment(){
|
|
|
|
|
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
|
|
|
|
strobj.data = 'thunderbird.partner';
|
|
|
|
|
var resobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
|
|
|
|
var popup = document.getElementById("section").selectedItem;
|
|
|
|
|
var popup = document.getElementById("section").selectedItem; // a <menupopup> element
|
|
|
|
|
object=popup.value;
|
|
|
|
|
resobj.data = object;
|
|
|
|
|
var a = ['object'];
|
|
|
|
|
var b = [getPref().getCharPref("object")];
|
|
|
|
|
var arrofarr = dictcontact(a,b);
|
|
|
|
|
//alert("FIRST::::::" + strDbName + struids + strpass + strobj + strmethod + arrofarr)
|
|
|
|
|
xmlRpcClient.asyncCall(listsearchAttachmentHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1932,6 +2000,7 @@ function createAttachmentEML()
|
|
|
|
|
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
|
|
|
|
strobj.data = 'thunderbird.partner';
|
|
|
|
|
var resobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
|
|
|
|
var popup = document.getElementById("section").selectedItem; // a <menupopup> element
|
|
|
|
|
object=popup.value;
|
|
|
|
|
resobj.data = object;
|
|
|
|
|
filename = getFileName()
|
|
|
|
@ -1995,6 +2064,8 @@ function createAttachmentEML_CRM(model, id, attachment)
|
|
|
|
|
alert("Mail Archived Successfully");
|
|
|
|
|
window.close();
|
|
|
|
|
}
|
|
|
|
|
//getPref().setCharPref("attachmentdata","")
|
|
|
|
|
// file.remove(true);
|
|
|
|
|
attach_eml="yes";
|
|
|
|
|
var branchobj = getPref();
|
|
|
|
|
setServerService('xmlrpc/object');
|
|
|
|
@ -2059,7 +2130,7 @@ function attachmentWidnowOpen(msg)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (msg=="create"){
|
|
|
|
|
var popup = document.getElementById("section").selectedItem;
|
|
|
|
|
var popup = document.getElementById("section").selectedItem; // a <menupopup> element
|
|
|
|
|
|
|
|
|
|
if (String(popup) != "null"){
|
|
|
|
|
object=popup.value;
|
|
|
|
@ -2097,7 +2168,7 @@ function attachmentWidnowOpen(msg)
|
|
|
|
|
{
|
|
|
|
|
if (msg=="create")
|
|
|
|
|
{
|
|
|
|
|
var popup = document.getElementById("section").selectedItem;
|
|
|
|
|
var popup = document.getElementById("section").selectedItem; // a <menupopup> element
|
|
|
|
|
if (String(popup) != "null"){
|
|
|
|
|
object=popup.value;
|
|
|
|
|
if (object=="" || object == undefined) { alert("select at least one document !")}
|
|
|
|
|