[MERGE] plugin thunderbird v6.1 compatible with tb 9
bzr revid: tfr@openerp.com-20111226172319-cghnfjtje9b71d69
@@ -0,0 +1,9 @@
|
||||
interfaces components/xml-rpc.xpt
|
||||
component {4d7d15c0-3747-4f7f-b6b3-792a5ea1a9aa} components/nsXmlRpcClient.js
|
||||
contract @mozilla.org/xml-rpc/client;1 {4d7d15c0-3747-4f7f-b6b3-792a5ea1a9aa}
|
||||
category profile-after-change @mozilla.org/xml-rpc/client;1
|
||||
content openerp_plugin jar:chrome/openerp_plugin.jar!/content/
|
||||
overlay chrome://messenger/content/messenger.xul chrome://openerp_plugin/content/overlay.xul
|
||||
locale openerp_plugin en-US jar:chrome/openerp_plugin.jar!/locale/en-US/
|
||||
skin openerp_plugin classic/1.0 jar:chrome/openerp_plugin.jar!/skin/
|
||||
#style chrome://global/content/customizeToolbar.xul chrome://openerp_plugin/skin/overlay.css
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="style.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/config.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="load_config_data();" height="500" width="580">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/config.js"></script>
|
||||
<tabbox>
|
||||
<tabs>
|
||||
<tab label="Configuration Settings"/>
|
||||
<tab label="About"/>
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<tabpanel id="configtab">
|
||||
<vbox>
|
||||
<groupbox id="gpConnection" align ="center" width="530">
|
||||
<grid flex="1">
|
||||
<columns>
|
||||
<column />
|
||||
<column />
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label align="right" id="url" value="&txturl.label;" width="80" class="text-prompt"/>
|
||||
<textbox id="txturl" width="300" readonly="true" />
|
||||
<button label="&getdblist.label;" oncommand="openConfigChange();" image="&imagesearch.value;" width="90"/>
|
||||
</row>
|
||||
<row>
|
||||
<label align="right" id="lbldb_list1" control="DBlist" value="&database.label;" width="80" class="text-prompt"/>
|
||||
<textbox id="DBlist_text" width="300"/>
|
||||
</row>
|
||||
<row>
|
||||
<label align="right" control="txtusername" value="&username.label;" width="80" class="text-prompt"/>
|
||||
<textbox id="txtusername" width="300"/>
|
||||
</row>
|
||||
<row>
|
||||
<label align="right" control="txtpassword" value="&password.label;" width="80" class="text-prompt"/>
|
||||
<textbox id="txtpassword" type="password" width="300"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<separator class="groove-thin" orient="horizontal" width="94"/>
|
||||
</groupbox>
|
||||
<hbox align="right" >
|
||||
<button id="btconnection" label="&connection.label;" oncommand="connection();" image="&imageok.value;" width="100"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<separator class="groove-thin" orient="horizontal" width="10"/>
|
||||
</tabpanel>
|
||||
|
||||
<tabpanel id="abouttab">
|
||||
<groupbox id="gpAbout" width="570" align="center">
|
||||
<caption label="&gpAbout.label;" align="center"/>
|
||||
|
||||
<vbox style="border:1px solid black" width="560"/>
|
||||
<description>&openerp.paresent;</description>
|
||||
<image src="chrome://openerp_plugin/skin/logo.png" sizemode="stretch" align="center"/>
|
||||
|
||||
<description> </description>
|
||||
<description> </description>
|
||||
<description>&develop.value;</description>
|
||||
<image src="chrome://openerp_plugin/skin/developped_by.png" sizemode="stretch" align="center"/>
|
||||
<description> </description>
|
||||
<description> </description>
|
||||
<description>&information.value;</description>
|
||||
<description><html:a href="&openerp.value;">&openerp.value;</html:a></description>
|
||||
|
||||
<description><html:a href="&axelor.value;">&axelor.value;</html:a></description>
|
||||
<description><html:a href="&tinyerp.value;">&tinyerp.value;</html:a></description>
|
||||
<description> </description>
|
||||
<description> </description>
|
||||
<description>Copyright © 2006-TODAY OpenERP SA All Rights Reserved.</description>
|
||||
<description>OpenERP is a trademark of the OpenERP SA Company. OpenERP Web is jointly developed by OpenERP SA & Axelor.</description>
|
||||
<description>Licenced under the terms of <html:a href="https://tiny.odoo.com/LICENSE.txt"> OpenERP Public License (OEPL) v1.1 (https://tiny.odoo.com/LICENSE.txt)</html:a> </description>
|
||||
</groupbox>
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</window>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="style.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();"
|
||||
title="Openerp Connection" height="190" width="330">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/config.js"></script>
|
||||
<separator class="groove-thin" orient="horizontal" width="10"/>
|
||||
<grid flex="1">
|
||||
<columns>
|
||||
<column />
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label id="lblurl" control="txtcurl" value="&lblurl.label;" class="text-prompt"/>
|
||||
<textbox id="txtcurl" width="170" />
|
||||
</row>
|
||||
<row>
|
||||
<label id="lblport" control="txtcport" value="&lblport.label;" class="text-prompt"/>
|
||||
<textbox id="txtcport" width="170" />
|
||||
</row>
|
||||
<row>
|
||||
<label id="dbprotocol" value="&lblprotocol.label;" class="text-prompt" />
|
||||
<menulist id="dbprotocol_list" width="140">
|
||||
<menupopup>
|
||||
<menuitem label="XML-RPC" value="http://"/>
|
||||
<menuitem label="XML-RPCS" value="https://"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<hbox align="right">
|
||||
<button label="Close" image="&imagecancel.value;" oncommand="config_close();" />
|
||||
<button label="OK" image="&imageok.value;" oncommand="config_ok()"/>
|
||||
</hbox>
|
||||
<separator class="groove-thin" orient="horizontal" width="10"/>
|
||||
</window>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="style.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/create.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="load_createContact();" id="create_partner_window">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/create.js"></script>
|
||||
<groupbox id="contact" >
|
||||
<hbox>
|
||||
<textbox class="plain" style="background-color: transparent;" flex="1"
|
||||
multiline="true" readonly="true"
|
||||
onoverflow="this.height = this.inputField.scrollHeight;"
|
||||
value="No existing contact found, you can create a new partner with this contact or link to a existing partner" />
|
||||
</hbox>
|
||||
<hbox>
|
||||
<label align="right" id="partner" value="&selectpartner.value;" width="90" class="text-prompt"/>
|
||||
<textbox id="txtselectpartner" readonly="true" value="" width="170"/>
|
||||
<button label="Link to partner" oncommand="open_window('chrome://openerp_plugin/content/selectpartner.xul', 400, 400);" image="&imagesearch.value;"/>
|
||||
<button label="Clear" oncommand="clear();"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<groupbox id="information" >
|
||||
<caption label="Address Detail" />
|
||||
<grid flex="1">
|
||||
<columns>
|
||||
<column />
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label align="right" id="name" value="&name.value;" width="90" class="text-prompt"/>
|
||||
<textbox id="txtname" align="right" />
|
||||
</row>
|
||||
<row>
|
||||
<label align="right" id="emailid" value="&email.value;" width="90" class="text-prompt"/>
|
||||
<textbox id="txtemail" align="right"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<separator class="groove-thin" orient="horizontal" width="90"/>
|
||||
</groupbox>
|
||||
<hbox align="right">
|
||||
<button label="cancel" image="&imagecancel.value;" oncommand="close();" />
|
||||
<button label="create partner" image="&imageok.value;" oncommand="createContact();"/>
|
||||
</hbox>
|
||||
</window>
|
||||
@@ -0,0 +1,122 @@
|
||||
function load_config_data() {
|
||||
getDbList('DBlist');
|
||||
document.getElementById("txturl").value = getServer();
|
||||
document.getElementById("txtusername").value = getUsername();
|
||||
document.getElementById("txtpassword").value = getPassword();
|
||||
document.getElementById("DBlist_text").value = getDbName();
|
||||
}
|
||||
|
||||
function config_close() {
|
||||
window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
|
||||
open_window('chrome://openerp_plugin/content/config.xul', 580,500);
|
||||
}
|
||||
|
||||
//set the value of the configuration fields
|
||||
function config_change_load() {
|
||||
document.getElementById('txtcurl').value = getPreferenceDefault('server_name', 'localhost')
|
||||
document.getElementById('txtcport').value = getPreferenceDefault('serverport', '8069')
|
||||
}
|
||||
|
||||
|
||||
function config_ok()
|
||||
{
|
||||
var protocol = document.getElementById("dbprotocol_list").value
|
||||
if (document.getElementById('txtcurl').value == '' || document.getElementById('txtcport').value == '') {
|
||||
alert("You Must Enter Server Name and a Port!")
|
||||
return false;
|
||||
}
|
||||
setPreference('serverport', document.getElementById('txtcport').value)
|
||||
setPreference('server_name', document.getElementById('txtcurl').value)
|
||||
setServer(document.getElementById("dbprotocol_list").value+document.getElementById('txtcurl').value +":" + document.getElementById('txtcport').value);
|
||||
config_close()
|
||||
}
|
||||
|
||||
function openConfigChange() {
|
||||
window.close("chrome://openerp_plugin/content/config.xul", "", "chrome");
|
||||
open_window("chrome://openerp_plugin/content/config_change.xul", 350,200);
|
||||
}
|
||||
|
||||
//xmlrpc request handler for getting the list of database
|
||||
var listDbHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var arrMethodList = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
||||
var count = arrMethodList.Count();
|
||||
if (count < 1) {
|
||||
setDBList("false");
|
||||
return
|
||||
}
|
||||
|
||||
setDBList("true");
|
||||
dbname_saved = getPreference("serverdbname")
|
||||
|
||||
var menu1 = document.createElement("menulist");
|
||||
menu1.setAttribute("id","DBlist");
|
||||
menu1.setAttribute("width","300");
|
||||
var menupopup1 = document.createElement("menupopup");
|
||||
menu1.appendChild(menupopup1)
|
||||
|
||||
// Loop through the results, adding items to the list
|
||||
for (i = 0; i < count; i++) {
|
||||
var dbname = arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsCString).data;
|
||||
menupopup1.appendChild(createMenuItem(dbname, dbname));
|
||||
if (dbname == dbname_saved) {
|
||||
index = i
|
||||
}
|
||||
}
|
||||
|
||||
var db_text_field = document.getElementById("DBlist_text");
|
||||
db_text_field.parentNode.replaceChild(menu1, db_text_field);
|
||||
|
||||
menu1.selectedIndex = index
|
||||
},
|
||||
|
||||
|
||||
onFault: function (client, ctxt, fault) {
|
||||
setDBList("false");
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
setDBList("false");
|
||||
}
|
||||
};
|
||||
//function to get the database list
|
||||
function getDbList(argControl) {
|
||||
setDBList("false");
|
||||
setServerService('xmlrpc/db');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
var cmbDbList = document.getElementById(argControl);
|
||||
|
||||
xmlRpcClient.asyncCall(listDbHandler,cmbDbList,'list',[],0);
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
function check_database() {
|
||||
if (getDBList()=="false") {
|
||||
if (document.getElementById('DBlist_text').value =='') {
|
||||
alert("You Must Enter Database Name.");
|
||||
return false;
|
||||
}
|
||||
return document.getElementById('DBlist_text').value;
|
||||
}
|
||||
else {
|
||||
return document.getElementById('DBlist').value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function connection() {
|
||||
callback = check_connection(login_success)
|
||||
setPreference('serverdbname', check_database())
|
||||
setServer(document.getElementById('txturl').value);
|
||||
setUsername(document.getElementById('txtusername').value);
|
||||
setPassword(document.getElementById('txtpassword').value);
|
||||
login()
|
||||
}
|
||||
//function to check the login information
|
||||
function login_success() {
|
||||
alert("login successfull");
|
||||
window.close("chrome://openerp_plugin/content/config.xul", "", "chrome");
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
function load_createContact() {
|
||||
document.getElementById("txtname").value = getSenderName();
|
||||
document.getElementById("txtemail").value = getSenderEmail();
|
||||
setPartnerId(0);
|
||||
}
|
||||
|
||||
//function to create the xmlrpc supported variables for xmlrpc request
|
||||
function dictcontact(a,b){
|
||||
var temp = xmlRpcClient.createType(xmlRpcClient.ARRAY,{});
|
||||
for(i=0;i<a.length;i++){
|
||||
var strkey = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strkey.data = a[i]
|
||||
var strvalue = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strvalue.data = b[i]
|
||||
var test = xmlRpcClient.createType(xmlRpcClient.ARRAY,{});
|
||||
test.AppendElement(strkey);
|
||||
test.AppendElement(strvalue);
|
||||
temp.AppendElement(test);
|
||||
}
|
||||
return temp;
|
||||
}
|
||||
|
||||
function selectPartner(){
|
||||
var item = document.getElementById('listPartnerBox').selectedItem
|
||||
if(item) {
|
||||
var label = item.label;
|
||||
setPartnerId(item.value);
|
||||
document.getElementById('txtselectpartner').setAttribute('value', label);
|
||||
window.opener.document.getElementById('txtselectpartner').setAttribute('value', label);
|
||||
}
|
||||
}
|
||||
|
||||
function clear() {
|
||||
setPartnerId(0);
|
||||
document.getElementById('txtselectpartner').setAttribute('value', '');
|
||||
}
|
||||
|
||||
|
||||
//xmlrpc request handler for getting the list of partners
|
||||
var listPartnerHandler = {
|
||||
|
||||
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;
|
||||
clear_search_box('listPartnerBox')
|
||||
// Loop through the results, adding items to the list
|
||||
var cmbSearchList = document.getElementById('listPartnerBox');
|
||||
for (i = 0; i < count; i++) {
|
||||
var temp = arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsArray);
|
||||
id = temp.QueryElementAt(0, Components.interfaces.nsISupportsPRInt32);
|
||||
name = temp.QueryElementAt(1, Components.interfaces.nsISupportsCString);
|
||||
var listItem = document.createElement("listitem");
|
||||
cmbSearchList.appendItem(name, id)
|
||||
}
|
||||
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
log_message(fault)
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
log_message(errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
//function to get the list of partners
|
||||
function getPartnerList(){
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
|
||||
var cmdPartnerList = document.getElementById('listPartnerBox');
|
||||
|
||||
var name = document.getElementById('txtselectpartner').value;
|
||||
var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
|
||||
var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
|
||||
var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
|
||||
var strmethod = get_rpc_string(xmlRpcClient, 'list_document_get');
|
||||
var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
|
||||
var strmodel = get_rpc_string(xmlRpcClient, 'res.partner');
|
||||
var strname = get_rpc_string(xmlRpcClient, name);
|
||||
xmlRpcClient.asyncCall(listPartnerHandler,cmdPartnerList,'execute',[ strDbName,struid,strpass,strobj,strmethod,strmodel, strname ],7);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//xmlrpc request handler for creating a new contact
|
||||
var listCreateContactHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
res = extract_data(result)
|
||||
open_url(res[URL])
|
||||
window.close();
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
log_message(fault)
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
log_message(errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//function to create a new contact
|
||||
function createContact(){
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
|
||||
var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
|
||||
var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
|
||||
var strmethod = get_rpc_string(xmlRpcClient, 'list_document_get');
|
||||
var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
|
||||
var strmethod = get_rpc_string(xmlRpcClient, 'contact_create');
|
||||
var strpartnerid = get_rpc_int(xmlRpcClient, getPartnerId());
|
||||
var a = ['name','email'];
|
||||
var b = [document.getElementById("txtname").value, document.getElementById("txtemail").value];
|
||||
var arrofarr = dictcontact(a,b);
|
||||
xmlRpcClient.asyncCall(listCreateContactHandler,null,'execute',[strDbName,struid,strpass,strobj,strmethod,arrofarr, strpartnerid], 7);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
function load_contact_dialog() {
|
||||
log_message("load contact dialog")
|
||||
if (getPreference('statutdoc')=='open') {
|
||||
document.getElementById('open_document').hidden=false;
|
||||
document.getElementById('new').hidden=false;
|
||||
document.getElementById('message_label').value="Document found"
|
||||
}
|
||||
else {
|
||||
document.getElementById('open_document').hidden=true;
|
||||
document.getElementById('new').hidden=false;
|
||||
document.getElementById('message_label').value="Document not found"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
//global array creation and declaration
|
||||
|
||||
var MBstrBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].
|
||||
getService(Components.interfaces.nsIStringBundleService);
|
||||
var mboximportbundle = MBstrBundleService.createBundle("chrome://mboximport/locale/mboximport.properties");
|
||||
//function to get the required details of the selected email
|
||||
|
||||
function check(fun) {
|
||||
cb = function() {
|
||||
if(GetNumSelectedMessages() < 1 || GetNumSelectedMessages() > 1) {
|
||||
alert("You must select only one mail to archive");
|
||||
return false
|
||||
}
|
||||
return fun()
|
||||
}
|
||||
if(getPreference('userid', 'INT') == 0 || getmodule_install() == "no") {
|
||||
callback = check_connection(cb)
|
||||
login()
|
||||
return False
|
||||
}
|
||||
|
||||
return cb()
|
||||
|
||||
}
|
||||
|
||||
var openPartnerHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
res = extract_data(result)
|
||||
if(res[RES_ID]==0) {
|
||||
open_window("chrome://openerp_plugin/content/create.xul", 550, 250);
|
||||
return;
|
||||
}
|
||||
open_url(res[URL])
|
||||
|
||||
|
||||
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
log_message(fault);
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
log_message(errorMsg)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function searchPartner(email)
|
||||
{
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
|
||||
var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
|
||||
var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
|
||||
var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
|
||||
var strmethod = get_rpc_string(xmlRpcClient, 'partner_get');
|
||||
var strname = get_rpc_string(xmlRpcClient, email);
|
||||
xmlRpcClient.asyncCall(openPartnerHandler,null,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6);
|
||||
}
|
||||
|
||||
|
||||
function open_partner()
|
||||
{
|
||||
//gives the selected email uri
|
||||
var messageUri= gDBView.URIForFirstSelectedMessage;
|
||||
|
||||
|
||||
var messenger = Components.classes['@mozilla.org/messenger;1'].createInstance(Components.interfaces.nsIMessenger);
|
||||
|
||||
//gives the selected email object
|
||||
var message = messenger.messageServiceFromURI(messageUri).messageURIToMsgHdr(messageUri);
|
||||
//functionality to split the author name and email
|
||||
if(message.author.charAt(0) == '"'){
|
||||
sendername = message.author.split('"')[1].split('"')[0];
|
||||
}
|
||||
else if(message.author.indexOf('<')!=-1){
|
||||
sendername = message.author.split('<')[0];
|
||||
}
|
||||
else{
|
||||
sendername = message.author;
|
||||
}
|
||||
if(message.author.indexOf('<')!=-1){
|
||||
senderemail = message.author.split('<')[1].split('>')[0];
|
||||
}
|
||||
else{
|
||||
senderemail = message.author;
|
||||
}
|
||||
setPreference('senderemail', senderemail);
|
||||
setPreference('sendername', sendername);
|
||||
searchPartner(senderemail);
|
||||
}
|
||||
|
||||
|
||||
var listDocumentHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
res = extract_data(result)
|
||||
|
||||
if(res[RES_ID]==0) {
|
||||
setPreference('statutdoc','create');
|
||||
}
|
||||
else {
|
||||
setPreference('statutdoc', 'open');
|
||||
setPreference('urldoc', res[URL]);
|
||||
}
|
||||
open_window("chrome://openerp_plugin/content/push_dialog.xul", 480, 110);
|
||||
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
log_message(fault);
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
log_message(errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
function open_document() {
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||
|
||||
//gives the selected email uri
|
||||
var messageUri = gDBView.URIForFirstSelectedMessage;
|
||||
|
||||
var branchobj = getPref();
|
||||
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
var strDbName = get_rpc_string(xmlRpcClient, branchobj.getCharPref("serverdbname"));
|
||||
var struids = get_rpc_int(xmlRpcClient, branchobj.getIntPref('userid'));
|
||||
var strpass = get_rpc_string(xmlRpcClient, branchobj.getCharPref("password"));
|
||||
var strmethod = get_rpc_string(xmlRpcClient, 'document_get');
|
||||
|
||||
var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
|
||||
|
||||
var eml_string = getMessage(messageUri);
|
||||
setPreference('email_text', eml_string);
|
||||
var email = get_rpc_string(xmlRpcClient, eml_string);
|
||||
xmlRpcClient.asyncCall(listDocumentHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod, email],6);
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
//xmlrpc request handler for list of search object exist in database or not.
|
||||
var DocumentTypeHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var modelListRPC = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
||||
|
||||
var menu_popup = document.getElementById("model_list");
|
||||
for(i = 0; i < modelListRPC.Count(); i++) {
|
||||
var temp_array = modelListRPC.QueryElementAt(i, Components.interfaces.nsISupportsArray);
|
||||
var model_value = temp_array.QueryElementAt(0, Components.interfaces.nsISupportsCString);
|
||||
var model_name = temp_array.QueryElementAt(1, Components.interfaces.nsISupportsCString);
|
||||
if(i == 0) {
|
||||
var menuitem = document.getElementById("first_model_list");
|
||||
menuitem.setAttribute("label", model_name);
|
||||
menuitem.setAttribute("value", model_value);
|
||||
}
|
||||
else {
|
||||
menu_popup.appendChild(createMenuItem(model_name, model_value));
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
onFault: function (client, ctxt, fault) {
|
||||
log_message("Fault getDocument : " + fault)
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
log_message("Error getDocument : " + errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
//function to create a new attachment record
|
||||
function getDocumentType(){
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
|
||||
var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
|
||||
var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
|
||||
var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
|
||||
var strmethod = get_rpc_string(xmlRpcClient, 'document_type');
|
||||
xmlRpcClient.asyncCall(DocumentTypeHandler,null,'execute',[strDbName,struid,strpass,strobj,strmethod], 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Search Handler : Fill the result of list_document_get in the listbox
|
||||
*/
|
||||
//xmlrpc request handler for getting the search results for the particular selected check box object
|
||||
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;
|
||||
clear_search_box('listSearchBox')
|
||||
if(count == 0){
|
||||
alert("No Records Found");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Loop through the results, adding items to the list
|
||||
var cmbSearchList = document.getElementById('listSearchBox');
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
var temp = arrMethodList.QueryElementAt(i, Components.interfaces.nsISupportsArray);
|
||||
id = temp.QueryElementAt(0, Components.interfaces.nsISupportsPRInt32);
|
||||
name = temp.QueryElementAt(1, Components.interfaces.nsISupportsCString);
|
||||
var listItem = document.createElement("listitem");
|
||||
cmbSearchList.appendItem(name, id)
|
||||
}
|
||||
},
|
||||
|
||||
onFault: function (client, ctxt, fault) {
|
||||
log_message(fault)
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
log_message(errorMsg)
|
||||
}
|
||||
};
|
||||
|
||||
//function to search the records of selected checkbox object
|
||||
function searchCheckbox()
|
||||
{
|
||||
model_name = document.getElementById('menu_model_list').selectedItem.value;
|
||||
name = document.getElementById('txtvalueobj').value
|
||||
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
var cmbSearchList = document.getElementById('listSearchBox');
|
||||
var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
|
||||
var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
|
||||
var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
|
||||
var strmethod = get_rpc_string(xmlRpcClient, 'list_document_get');
|
||||
var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
|
||||
var strmodel = get_rpc_string(xmlRpcClient, model_name);
|
||||
var strname = get_rpc_string(xmlRpcClient, name);
|
||||
|
||||
xmlRpcClient.asyncCall(listSearchCheckboxHandler,cmbSearchList,'execute',[ strDbName,struid,strpass,strobj,strmethod, strmodel, strname],7);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//xmlrpc request handler for creating the record of mail
|
||||
var pushHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
res = extract_data(result)
|
||||
alert(res[ADDITIONAL_INFORMATION])
|
||||
open_url(res[URL]);
|
||||
window.close();
|
||||
},
|
||||
|
||||
onFault: function (client, ctxt, fault) {
|
||||
log_message(fault)
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
log_message(errorMsg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function push(op) {
|
||||
var model_name = document.getElementById('menu_model_list').selectedItem.value;
|
||||
var res_id = 0;
|
||||
if(op == "add") {
|
||||
var item = document.getElementById('listSearchBox').selectedItem
|
||||
if (String(item) == "null") {
|
||||
alert("select at least one Document !")
|
||||
return
|
||||
}
|
||||
|
||||
var res_id = item.value;
|
||||
|
||||
}
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
|
||||
var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
|
||||
var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
|
||||
var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
|
||||
var strmethod = get_rpc_string(xmlRpcClient, 'push_message');
|
||||
var strobj = get_rpc_string(xmlRpcClient, 'plugin.handler');
|
||||
var stremail = get_rpc_string(xmlRpcClient, getPreference('email_text'));
|
||||
var strmodel = get_rpc_string(xmlRpcClient, model_name);
|
||||
var strres_id = get_rpc_int(xmlRpcClient, res_id);
|
||||
xmlRpcClient.asyncCall(pushHandler,null,'execute',[strDbName,struid,strpass,strobj,strmethod,strmodel, stremail, strres_id],8);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,421 @@
|
||||
/************************************************************
|
||||
* OpenERP, Open Source Management Solution
|
||||
* Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
***************************************************************/
|
||||
|
||||
var xmlRpcClient;
|
||||
|
||||
//Service name on server like /common,/db etc...
|
||||
var strServerService;
|
||||
|
||||
|
||||
var uri = new Array();
|
||||
var name = new Array();
|
||||
var rpc= {
|
||||
servers: {},
|
||||
addserver: function(name,ip,port,path) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
this.servers[name]= {
|
||||
ip: ip,
|
||||
port: port,
|
||||
path: path,
|
||||
avaible: true,
|
||||
sock: Components.classes['@mozilla.org/xml-rpc/client;1'].createInstance(Components.interfaces.nsIXmlRpcClient)};
|
||||
},
|
||||
getany: function(rpcval,n) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var t = ['PRUint8','PRUint16','PRInt16','PRInt32','PRBool','Char','CString','Float','Double','PRTime','InputStream','Array','Dictionary'];
|
||||
for (var i=0; i<t.length; i++)
|
||||
try { return [t[i],this.Iget(rpcval,Components.interfaces[((i==10 || i==12)? 'nsI': 'nsISupports')+t[i]],n)]; } catch(e) {}
|
||||
return [false,'error getany','Undefined type'];
|
||||
},
|
||||
onfault: function(t) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
return (t.constructor==Array && t.length==3 && !t[0] && (t[1].substr(0,5)=='error' || t[1].substr(0,5)=='fault'))?
|
||||
true : false;
|
||||
},
|
||||
getall: function(rpcval,n) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var t = this.getany(rpcval,n);
|
||||
if (this.onfault(t)) return t;
|
||||
if (t[0]=='PRBool') return (t[1]=='true');
|
||||
if (t[0]=='PRInt32') return parseInt(t[1]+'');
|
||||
if (t[0]=='PRTime') {
|
||||
dte= new Date("January 1, 1970, 00:00:00");
|
||||
dte.setUTCMilliseconds(t[1]+'');
|
||||
return dte; }
|
||||
if (t[0]=='Double' || t[0]=='Float') return parseFloat(t[1]+'');
|
||||
if (t[0]=='Char' || t[0]=='CString') return (t[1]+'').replace(/¬/g,'€');
|
||||
if (t[0]=='Array') {
|
||||
var a=[];
|
||||
for (var i=0; i<t[1].Count(); i++) a[i]= this.getall(t[1],i);
|
||||
} else if (t[0]=='Dictionary') {
|
||||
var a={};
|
||||
var keys = t[1].getKeys({});
|
||||
for (var k = 0; k < keys.length; k++)
|
||||
a[keys[k]]= this.getall(t[1],keys[k]);
|
||||
} else return t[1];
|
||||
return a;
|
||||
},
|
||||
Iget: function(rpcval,itype,n) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
if (n == undefined) return rpcval.QueryInterface(itype);
|
||||
else if (n==parseInt(n)) return rpcval.QueryElementAt(n,itype);
|
||||
else return rpcval.getValue(n).QueryInterface(itype);
|
||||
},
|
||||
checktype: function(val) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
if (val != undefined) {
|
||||
switch (val.constructor) {
|
||||
case Number: return (val==parseInt(val))? 1:4;
|
||||
case Boolean: return 2;
|
||||
case String: return 3;
|
||||
case Date: return 5;
|
||||
case Object: return 7;
|
||||
case Array: return 6;
|
||||
|
||||
}
|
||||
}
|
||||
return 7;
|
||||
|
||||
},
|
||||
set: function(rpcobj,param) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
if (param==undefined) return [false,'error set','Undefined parameter'];
|
||||
var itype= this.checktype(param);
|
||||
if (this.onfault(itype)) return itype;
|
||||
var p = this.servers[rpcobj].sock.createType(itype,{});
|
||||
if (itype==6) {
|
||||
if (param.length>0)
|
||||
for (var i=0; i<param.length; i++) p.AppendElement( this.set(rpcobj,param[i]) );
|
||||
} else if (itype==7) {
|
||||
for (var i in param) p.setValue( i, this.set(rpcobj,param[i]) );
|
||||
} else if (itype==4) {
|
||||
p.data=(''+param).replace(',','.');
|
||||
} else p.data=param;
|
||||
return p;
|
||||
},
|
||||
ask: function(rpcobj,method,params,func_out) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var a=this.disableNset(rpcobj) ;
|
||||
if (this.onfault(a)) return a;
|
||||
var handler = {
|
||||
onResult: function(client, async, result) {
|
||||
rpc.servers[rpcobj].avaible= true;
|
||||
func_out(rpc.getall(result)); },
|
||||
onFault: function (client, async, faute) {alert("in ask infault"+result)
|
||||
rpc.servers[rpcobj].avaible= true; func_out([false,'fault',faute]); },
|
||||
onError: function (client, async, status, msg) {
|
||||
rpc.servers[rpcobj].avaible= true;
|
||||
if (status=='2147500037') {
|
||||
status= "no network or no server";
|
||||
msg= "1. Check your network connection.";
|
||||
msg+= "\n2. Check your server connection parameters:";
|
||||
msg+= "\n\t"+rpc.servers[rpcobj].ip+":"+rpc.servers[rpcobj].port+"=>"+params[0];
|
||||
msg+= "\n3. Your server may not be launched or connected to the network.";
|
||||
}
|
||||
func_out([false,'error '+status,msg]);
|
||||
} };
|
||||
var p = [];
|
||||
for (var i=0; i<params.length; i++)
|
||||
p[i]= this.set(rpcobj,params[i]);
|
||||
try { this.servers[rpcobj].sock.asyncCall(handler, null, method, p, p.length);
|
||||
} catch(e) {
|
||||
this.servers[rpcobj].avaible= true;
|
||||
this.servers[rpcobj].sock= Components.classes['@mozilla.org/xml-rpc/client;1'].createInstance(Components.interfaces.nsIXmlRpcClient) ;
|
||||
func_out([false,'error catch',e]); }
|
||||
return true;
|
||||
},
|
||||
disableNset: function(rpcobj) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
if (this.servers[rpcobj]) {
|
||||
this.servers[rpcobj].avaible= false;//alert('http://'+this.servers[rpcobj].ip+':'+this.servers[rpcobj].port+this.servers[rpcobj].path);
|
||||
server_path=this.servers[rpcobj].ip+':'+this.servers[rpcobj].port+this.servers[rpcobj].path
|
||||
this.servers[rpcobj].sock.init(server_path);
|
||||
|
||||
return true; }
|
||||
return [false,'error disableNset','Server vars not set'];
|
||||
}
|
||||
}
|
||||
|
||||
var callback = null;
|
||||
|
||||
//Sets the preference service
|
||||
function getPref(){
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||
var branchobj = prefService.getBranch("extensions.tiny.");
|
||||
branchobj.QueryInterface(Components.interfaces.nsIPrefBranch2);
|
||||
return branchobj
|
||||
}
|
||||
|
||||
function getPreference(key, type) {
|
||||
if (!type || type == 'STRING') {
|
||||
return getPref().getCharPref(key);
|
||||
}
|
||||
if (type == 'INT') {
|
||||
return getPref().getIntPref(key);
|
||||
}
|
||||
}
|
||||
|
||||
function getPreferenceDefault(key, default_value, type) {
|
||||
res = getPreference(key, type)
|
||||
if (!res || res == "")
|
||||
return default_value
|
||||
return res
|
||||
}
|
||||
|
||||
function setPreference(key, value, type) {
|
||||
|
||||
if (!type || type == 'STRING') {
|
||||
getPref().setCharPref(key, value);
|
||||
}
|
||||
if (type == 'INT') {
|
||||
getPref().setIntPref(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setServerName(server) {
|
||||
setPreference('server_name', server)
|
||||
}
|
||||
|
||||
function getServerName(server) {
|
||||
getPreference('server_name')
|
||||
}
|
||||
|
||||
//set preference value for server port
|
||||
function setPort(argPort){
|
||||
getPref().setCharPref('serverport',argPort)
|
||||
}
|
||||
|
||||
//get server port
|
||||
function getPort(){
|
||||
return getPref().getCharPref('serverport');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//set preference value for server url
|
||||
function setServer(argServer){
|
||||
getPref().setCharPref('serverurl',argServer);
|
||||
}
|
||||
|
||||
//set preference value of username for login
|
||||
function setUsername(argUsername){
|
||||
getPref().setCharPref('username',argUsername);
|
||||
}
|
||||
|
||||
//set preference value of password for login
|
||||
function setPassword(argPassword){
|
||||
getPref().setCharPref('password',argPassword);
|
||||
}
|
||||
|
||||
|
||||
//set server service
|
||||
function setServerService(argServerService){
|
||||
strServerService = argServerService;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//set preference value for storing partner id
|
||||
function setPartnerId(argPartnerId){
|
||||
getPref().setCharPref('partnerid',argPartnerId)
|
||||
}
|
||||
|
||||
|
||||
//set preference value for storing user id
|
||||
function setUserId(argUserId){
|
||||
getPref().setIntPref('userid',argUserId);
|
||||
}
|
||||
|
||||
//set database list is displaye or not
|
||||
function setDBList(argDBList){
|
||||
getPref().setCharPref('db_list',argDBList)
|
||||
}
|
||||
|
||||
//set module install or not
|
||||
function setmodule_install(argconnect_module){
|
||||
getPref().setCharPref('module_install',argconnect_module)
|
||||
}
|
||||
|
||||
//get module install or not
|
||||
function getmodule_install(){
|
||||
return getPref().getCharPref('module_install');
|
||||
}
|
||||
|
||||
|
||||
//get partner id
|
||||
function getPartnerId(){
|
||||
return getPref().getCharPref('partnerid');
|
||||
}
|
||||
//get database list is displaye or not
|
||||
function getDBList(){
|
||||
return getPref().getCharPref('db_list');
|
||||
}
|
||||
|
||||
//get serverurl
|
||||
function getServer(){
|
||||
return getPref().getCharPref('serverurl');
|
||||
}
|
||||
|
||||
|
||||
//get database name
|
||||
function getDbName(){
|
||||
return getPref().getCharPref('serverdbname');
|
||||
}
|
||||
|
||||
//get username from config settings
|
||||
function getUsername(){
|
||||
return getPref().getCharPref('username');
|
||||
}
|
||||
|
||||
//get password from config settings
|
||||
function getPassword(){
|
||||
return getPref().getCharPref('password');
|
||||
}
|
||||
|
||||
//get serverservice
|
||||
function getServerService(){
|
||||
return strServerService;
|
||||
|
||||
}
|
||||
|
||||
//get sender email //TO REMOVE
|
||||
function getSenderEmail(){
|
||||
return getPref().getCharPref('senderemail');
|
||||
}
|
||||
|
||||
//get sender name //TO REMOVE
|
||||
function getSenderName() {
|
||||
return getPref().getCharPref('sendername');
|
||||
}
|
||||
|
||||
//get the whole server path
|
||||
function getServerUrl(){
|
||||
return getServer()+"/"+getServerService();
|
||||
}
|
||||
|
||||
|
||||
//Creates and returns and instance of the XML-RPC client
|
||||
function getClient() {
|
||||
// Enable correct security
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
return Components.classes['@mozilla.org/xml-rpc/client;1'].createInstance(Components.interfaces.nsIXmlRpcClient);
|
||||
}
|
||||
|
||||
//returns the xmlrpc client instance
|
||||
function getXmlRpc() {
|
||||
if (!xmlRpcClient) {
|
||||
xmlRpcClient = getClient();
|
||||
}
|
||||
// Initialize the client with the URL
|
||||
xmlRpcClient.init(getServerUrl());
|
||||
return xmlRpcClient;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* module_install handler
|
||||
*/
|
||||
var listinstallmodulehandler = {
|
||||
onResult: function(client, context, result) {
|
||||
setmodule_install('yes')
|
||||
callback()
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
setmodule_install('no')
|
||||
callback()
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
setmodule_install('no')
|
||||
callback()
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Check is the plugin module is installed
|
||||
*/
|
||||
function module_install()
|
||||
{
|
||||
setmodule_install("no")
|
||||
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
|
||||
var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
|
||||
var struid = get_rpc_int(xmlRpcClient, getPreference('userid', 'INT'));
|
||||
var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
|
||||
var strmethod = get_rpc_string(xmlRpcClient, "is_installed");
|
||||
var strobj = get_rpc_string(xmlRpcClient, "plugin.handler");
|
||||
xmlRpcClient.asyncCall(listinstallmodulehandler,null,'execute',[ strDbName,struid,strpass,strobj,strmethod], 5);
|
||||
}
|
||||
|
||||
|
||||
//xmlrpc request handler for handling the login information
|
||||
var listcreateLoginHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var login = result.QueryInterface(Components.interfaces.nsISupportsPrimitive)
|
||||
if(login.type == 12){
|
||||
login = result.QueryInterface(Components.interfaces.nsISupportsPRInt32)
|
||||
setUserId(login.data);
|
||||
module_install()
|
||||
}
|
||||
else{
|
||||
setUserId(0);
|
||||
callback();
|
||||
}
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
setUserId(0);
|
||||
callback();
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
setUserId(0);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function login(){
|
||||
setServerService('xmlrpc/common');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
var strDbName = get_rpc_string(xmlRpcClient, getPreference("serverdbname"));
|
||||
var strusername = get_rpc_string(xmlRpcClient, getPreference('username'));
|
||||
var strpass = get_rpc_string(xmlRpcClient, getPreference("password"));
|
||||
xmlRpcClient.asyncCall(listcreateLoginHandler,null,'login',[strDbName,strusername,strpass],3);
|
||||
}
|
||||
|
||||
function get_rpc_string(rpc_client, val) {
|
||||
var str = rpc_client.createType(rpc_client.STRING,{});
|
||||
str.data = val;
|
||||
return str;
|
||||
}
|
||||
|
||||
function get_rpc_int(rpc_client, val) {
|
||||
var integer = rpc_client.createType(rpc_client.INT,{});
|
||||
integer.data = val;
|
||||
return integer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
function log_message(message) {
|
||||
window.dump("[OPENERP-PLUGIN LOG]: " + message + "\n")
|
||||
}
|
||||
|
||||
function getMessage(uri) {
|
||||
var content;
|
||||
var MsgService = messenger.messageServiceFromURI(uri);
|
||||
var MsgStream = Components.classes["@mozilla.org/network/sync-stream-listener;1"].createInstance();
|
||||
var MsgStrem_Inputstream = MsgStream.QueryInterface(Components.interfaces.nsIInputStream);
|
||||
var ScriptInput = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance();
|
||||
var ScriptInputStream = ScriptInput.QueryInterface(Components.interfaces.nsIScriptableInputStream);
|
||||
ScriptInputStream.init(MsgStream);
|
||||
try {
|
||||
MsgService.streamMessage(uri,MsgStream, msgWindow, null, false, null);
|
||||
} catch (ex) {
|
||||
return;
|
||||
}
|
||||
ScriptInputStream .available();
|
||||
while (ScriptInputStream .available()) {
|
||||
content = content + ScriptInputStream.read(512);
|
||||
}
|
||||
return content
|
||||
|
||||
}
|
||||
|
||||
function createMenuItem(aLabel, aValue) {
|
||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
var item = document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
|
||||
item.setAttribute("label", aLabel);
|
||||
item.setAttribute("value", aValue);
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
function clear_search_box(element) {
|
||||
var cmbSearchList = document.getElementById(element);
|
||||
count = cmbSearchList.itemCount
|
||||
for(i = 1; i <= count; i++) {
|
||||
cmbSearchList.removeItemAt(count - i)
|
||||
}
|
||||
}
|
||||
|
||||
function open_url(url) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var messenger = Components.classes['@mozilla.org/messenger;1'].createInstance(Components.interfaces.nsIMessenger);
|
||||
messenger.launchExternalURL(url);
|
||||
}
|
||||
|
||||
function extract_data(result) {
|
||||
var returnArray = new Array();
|
||||
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var res = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
||||
returnArray[0] = res.QueryElementAt(0, Components.interfaces.nsISupportsCString);
|
||||
returnArray[1] = res.QueryElementAt(1, Components.interfaces.nsISupportsPRInt32);
|
||||
|
||||
for(i = 2; i < res.Count(); i++) {
|
||||
returnArray[i] = res.QueryElementAt(i, Components.interfaces.nsISupportsCString);
|
||||
}
|
||||
return returnArray
|
||||
}
|
||||
|
||||
|
||||
var MODEL = 0;
|
||||
var RES_ID = 1;
|
||||
var URL = 2;
|
||||
var ADDITIONAL_INFORMATION = 3
|
||||
|
||||
function check_connection(callback) {
|
||||
return function () {
|
||||
if(getPreference('userid', 'INT') == 0) {
|
||||
alert("Server unreachable or login Failed, please check your connection settings")
|
||||
return
|
||||
}
|
||||
else if (getmodule_install() == "no") {
|
||||
alert("Please install the thunderbird module on your '" + getDbName() +"' database and try again !");
|
||||
return
|
||||
}
|
||||
return callback()
|
||||
}
|
||||
}
|
||||
|
||||
function open_window(url,width,height) {
|
||||
var win = window.open(url, '', 'chrome,width='+width+',height='+height+',resizable=yes');
|
||||
var w = ((window.screen.availWidth/2)-(width/2));
|
||||
var h=((window.screen.availHeight/2)-(height/2));
|
||||
win.moveTo(w,h);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://openerp_plugin/skin/overlay.css" type="text/css"?>
|
||||
<!DOCTYPE overlay SYSTEM "chrome://openerp_plugin/locale/overlay.dtd">
|
||||
<overlay id="tiny-overlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/overlay.js"></script>
|
||||
|
||||
|
||||
<menubar id="mail-menubar" >
|
||||
<menu insertafter="messageMenu" id="menu_openerp" label="&openerpMenu.label;" accesskey="&openerpMenu.accesskey;">
|
||||
<menupopup id="taskPopup">
|
||||
<menuitem id="tiny-openpartner" label="Contact"
|
||||
oncommand="check(open_partner);"
|
||||
image="&menuicon.value;"
|
||||
class="menuitem-iconic"
|
||||
tooltiptext="&openpartnertooltip.value;"
|
||||
/>
|
||||
|
||||
<menuitem id="tiny-opendocument" label="Documents"
|
||||
oncommand="check(open_document);"
|
||||
image="&menuicon.value;"
|
||||
class="menuitem-iconic"
|
||||
tooltiptext="&opendocumenttooltip.value;"
|
||||
/>
|
||||
<menuitem id="tiny-plugin3" label="Configuration"
|
||||
oncommand="open_window('chrome://openerp_plugin/content/config.xul', 580,500);"
|
||||
image="&menuicon.settings;"
|
||||
class="menuitem-iconic"
|
||||
tooltiptext="&pluginconfig.value;"
|
||||
/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
|
||||
<toolbarpalette id="MailToolbarPalette">
|
||||
<toolbarbutton id="GA-button2"
|
||||
class="toolbarbutton-1"
|
||||
image="&partnericon.value;"
|
||||
label= "Contact"
|
||||
oncommand="check(open_partner);"
|
||||
/>
|
||||
</toolbarpalette>
|
||||
<toolbarpalette id="MailToolbarPalette">
|
||||
<toolbarbutton id="GA-button3"
|
||||
class="toolbarbutton-1"
|
||||
image="&imagearchive.value;"
|
||||
label= "Documents"
|
||||
oncommand="check(open_document);" />
|
||||
</toolbarpalette>
|
||||
|
||||
</overlay>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="style.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/plugin.dtd">
|
||||
<window id="pluginwindows" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
title="&title.label;" onload="getDocumentType()" >
|
||||
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/push.js"></script>
|
||||
<description></description>
|
||||
<vbox>
|
||||
<separator class="groove-thin" orient="horizontal"/>
|
||||
<grid flex="1">
|
||||
<columns>
|
||||
<column />
|
||||
<column />
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label id="lblex3" align="right" control="section" value="&object.label;" class="text-prompt" />
|
||||
<menulist id="menu_model_list" >
|
||||
<menupopup id="model_list">
|
||||
<menuitem id="first_model_list" value="" label=""/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
<row>
|
||||
<label id="lblsearch" control="txtvalueobj" value="&search.label;" class="text-prompt"/>
|
||||
<textbox id="txtvalueobj" />
|
||||
<button label="&bsearch.label;" oncommand="searchCheckbox()" image="&imagesearch.value;" accesskey="s" id="search_button"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<hbox >
|
||||
<caption label="&document.label;" id="label_box"/>
|
||||
</hbox>
|
||||
<vbox >
|
||||
<listbox height="200" id="listSearchBox" style="border:1px solid red" seltype="multiple">
|
||||
<listhead>
|
||||
<listheader label="&listSearchBox.header;"/>
|
||||
</listhead>
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
</listbox>
|
||||
</vbox>
|
||||
<hbox align="right" >
|
||||
<button label="&attach.label;" accesskey="u" image="&imagearchive.value;" oncommand="push('add');"/>
|
||||
</hbox>
|
||||
<separator class="groove-thin" orient="horizontal"/>
|
||||
</vbox>
|
||||
|
||||
</window>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="style.css" type="text/css"?>
|
||||
<!-- Extremely recommended to keep this css include!! -->
|
||||
<window id="rootWnd" title="push box" onload="load_contact_dialog();"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/dialog.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/overlay.js"></script>
|
||||
<vbox>
|
||||
<hbox height="50">
|
||||
<label value="Message" id="message_label" class="text-border"/>
|
||||
</hbox>
|
||||
<hbox align="right">
|
||||
<button label="Cancel" accesskey="c" oncommand="window.close();"/>
|
||||
<button id="push" label="Push Email" accesskey="a" oncommand="window.close();open_window('chrome://openerp_plugin/content/push.xul', 500,360);"/>
|
||||
<button id="new" label="Create Document" accesskey="c" oncommand="window.close();open_window('chrome://openerp_plugin/content/push_new.xul', 320,100);"/>
|
||||
<button id="open_document" label="Open Document" accesskey="d" oncommand="open_url(getPreference('urldoc'));window.close();"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</window>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="style.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/plugin.dtd">
|
||||
<window id="pluginwindows" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
title="&title.label;" onload="getDocumentType()" >
|
||||
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/push.js"></script>
|
||||
<description></description>
|
||||
<vbox>
|
||||
<separator class="groove-thin" orient="horizontal" width="400"/>
|
||||
<grid flex="1">
|
||||
<columns>
|
||||
<column />
|
||||
<column />
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label id="lblex3" align="right" width="135" control="section" value="&object.label;" class="text-prompt" />
|
||||
<menulist id="menu_model_list" width="150">
|
||||
<menupopup id="model_list">
|
||||
<menuitem id="first_model_list" value="" label=""/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<hbox align="right" >
|
||||
<button label="&attach.label;" accesskey="u" image="&imagearchive.value;" oncommand="push();"/>
|
||||
</hbox>
|
||||
<separator class="groove-thin" orient="horizontal" width="480"/>
|
||||
</vbox>
|
||||
</window>
|
||||
@@ -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/selectpartner.dtd">
|
||||
<window id="partnerwindowsid" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" onload="getPartnerList()"
|
||||
title="&title.label;" height="500" width="375">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/tools.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/js/create.js"></script>
|
||||
<groupbox id="gpPartner">
|
||||
<hbox>
|
||||
<textbox id="txtselectpartner" class="text-prompt"/>
|
||||
<spacer width="25"/>
|
||||
<button label="&bsearch.label;" image="&imagesearch.value;" oncommand="getPartnerList();"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<listbox id="listPartnerBox" flex="1" rows="5">
|
||||
<listhead>
|
||||
<listheader label="&listPartnerName.header;"/>
|
||||
</listhead>
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
</listbox>
|
||||
<description></description>
|
||||
<hbox>
|
||||
<spacer width="45"/>
|
||||
<button label="cancel" image="&imagecancel.value;" oncommand="close();" />
|
||||
<button label="link" image="&imageok.value;" oncommand="selectPartner();window.close();"/>
|
||||
</hbox>
|
||||
|
||||
</window>
|
||||
@@ -0,0 +1,10 @@
|
||||
.text-prompt {
|
||||
padding-top: .25em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.text-border {
|
||||
padding: 1em;
|
||||
font-size : 1.2em;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<!ENTITY title.label "Open Contact">
|
||||
<!ENTITY name.value "Partner Name:">
|
||||
<!ENTITY contactname.value "Contact Name:">
|
||||
<!ENTITY street.value "Street:">
|
||||
<!ENTITY street2.value "Street2:">
|
||||
<!ENTITY zip.value "Zip:">
|
||||
<!ENTITY city.value "City:">
|
||||
<!ENTITY country.value "Country:">
|
||||
<!ENTITY state.value "State:">
|
||||
<!ENTITY office.value "Office:">
|
||||
<!ENTITY fax.value "Fax:">
|
||||
<!ENTITY mobile.value "Mobile:">
|
||||
<!ENTITY email.value "Email:">
|
||||
<!ENTITY emailid.value "Email ID:">
|
||||
<!ENTITY communication.value "Communication:">
|
||||
<!ENTITY postaladdress.value "Postal Address:">
|
||||
<!ENTITY ok.label "Save">
|
||||
<!ENTITY partner.label "Create New Contact :">
|
||||
<!ENTITY create.label "New Contact">
|
||||
<!ENTITY cancel.label "Close">
|
||||
<!ENTITY newpartner.label "New Partner">
|
||||
<!ENTITY bsearch.label "Search Contact">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.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">
|
||||
@@ -0,0 +1,56 @@
|
||||
<!ENTITY title.label "OpenERP Configuration">
|
||||
<!ENTITY separate.label "Configuration Login for OpenERP!">
|
||||
<!ENTITY close.label "Close">
|
||||
<!ENTITY database.label "Database:">
|
||||
<!ENTITY ok.label "OK">
|
||||
<!ENTITY connection.label "Connect">
|
||||
<!ENTITY setconnection.label "Change">
|
||||
<!ENTITY openconnection.label "Open">
|
||||
<!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 >">
|
||||
<!ENTITY getdblist.label "Change">
|
||||
<!ENTITY gpConnection.label "Connection Parameters">
|
||||
<!ENTITY webConnection.label "Webserver Parameters">
|
||||
<!ENTITY listDBListBox.header "Available DBs">
|
||||
<!ENTITY listDocument.header "Document">
|
||||
<!ENTITY listDocumentListBox.header "Document Name">
|
||||
<!ENTITY document.label "Document Name : ">
|
||||
<!ENTITY documentcreate.label "Add">
|
||||
<!--<!ENTITY objectdelete.label "Delete Selected Object From The List"> -->
|
||||
<!ENTITY documentdelete.label "Delete">
|
||||
<!ENTITY gpArchive.label "Archived Email Attachment Options">
|
||||
<!ENTITY rdAlwaysAttached.label "Always Send Email Attachments to OpenERP">
|
||||
<!ENTITY rdPromptAttached.label "Prompt Before Sending Email Attachments">
|
||||
<!ENTITY rdNeverAttached.label "Never Send Email attachments to OpenERP">
|
||||
<!ENTITY reserve.value "Copyright © 2006-TODAY OpenERP SA All Rights Reserved.
|
||||
OpenERP is a trademark of the OpenERP SA Company. OpenERP Web is jointly developed by OpenERP SA and Axelor.\n
|
||||
Licenced under the terms of OpenERP Public License (OEPL) v1.1 ">
|
||||
<!ENTITY openerp.value "http://www.openerp.com/">
|
||||
<!ENTITY axelor.value "http://www.axelor.com">
|
||||
<!ENTITY tinyerp.value "http://tiny.be/">
|
||||
|
||||
<!ENTITY openerp.paresent "This Thunderbird Plugin for OpenERP presently (2010-today) developed by OpenERP SA.">
|
||||
|
||||
<!ENTITY openerp_s.value "OpenERP">
|
||||
<!ENTITY axelor_s.value "The Axelor Company">
|
||||
<!ENTITY tinyerp_s.value "The Tiny Company">
|
||||
|
||||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
|
||||
<!ENTITY gpAbout.label "OpenERP Thunderbird Plugin :">
|
||||
<!ENTITY develop.value "Based on original work, copyright 2003-2009, by Tiny & Axelor ">
|
||||
<!ENTITY information.value "For more information, please visit our website">
|
||||
<!ENTITY contact.label "Contact Us">
|
||||
<!ENTITY contact.value "info@axelor.com">
|
||||
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
|
||||
<!ENTITY imagesearch.value "chrome://openerp_plugin/skin/Search.gif">
|
||||
<!ENTITY imagemove.value "chrome://openerp_plugin/skin/Move.gif">
|
||||
<!ENTITY imagemoveleft.value "chrome://openerp_plugin/skin/MoveLeft.png">
|
||||
<!ENTITY imagemovedown.value "chrome://openerp_plugin/skin/MoveDown.png">
|
||||
<!ENTITY addfile.label "Load Image">
|
||||
@@ -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">
|
||||
<!ENTITY lblprotocol.label "Protocol Connection: ">
|
||||
@@ -0,0 +1,37 @@
|
||||
<!ENTITY title.label "Create a new Contact">
|
||||
<!ENTITY name.value "Contact Name:">
|
||||
<!ENTITY street.value "Street:">
|
||||
<!ENTITY street2.value "Street2:">
|
||||
<!ENTITY zip.value "Zip:">
|
||||
<!ENTITY city.value "City:">
|
||||
<!ENTITY country.value "Country:">
|
||||
<!ENTITY state.value "State:">
|
||||
<!ENTITY office.value "Office:">
|
||||
<!ENTITY fax.value "Fax:">
|
||||
<!ENTITY mobile.value "Mobile:">
|
||||
<!ENTITY email.value "Email:">
|
||||
<!ENTITY communication.value "Communication:">
|
||||
<!ENTITY postaladdress.value "Postal Address:">
|
||||
|
||||
|
||||
<!ENTITY selectpartner.value "Partner:">
|
||||
<!ENTITY listEmail.header "Email">
|
||||
<!ENTITY listName.header "Name">
|
||||
<!ENTITY bsearch.label "Search">
|
||||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
|
||||
<!ENTITY cbxarchive.label "Archive">
|
||||
<!ENTITY ok.label "Save">
|
||||
<!ENTITY cancel.label "Close">
|
||||
<!ENTITY imagesearch.value "chrome://openerp_plugin/skin/Search.gif">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
|
||||
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
|
||||
|
||||
<!ENTITY title.label "Select Partner">
|
||||
<!ENTITY listPartnerName.header "Partner Name">
|
||||
<!ENTITY bsearch.label "Search">
|
||||
<!ENTITY create.label "Create">
|
||||
<!ENTITY select.label "Select">
|
||||
<!ENTITY cancel.label "Close">
|
||||
<!ENTITY reload.label "Reload">
|
||||
<!ENTITY imagecreate.value "chrome://openerp_plugin/skin/Create.png">
|
||||
<!ENTITY imagereload.value "chrome://openerp_plugin/skin/Archive.png">
|
||||
@@ -0,0 +1,31 @@
|
||||
nomboxfile=není mbox souborem
|
||||
folderexists=Není možné importovat: složka se stejným názvem již existuje
|
||||
fileexists=Není možné importovat: soubor se stejným názvem již existuje
|
||||
nowritable=Není možné importovat: nemáte právo zápisu do složky
|
||||
exportOK=Export byl úspěšně dokončen
|
||||
isNewsgroup=Tato funkce není dostupná: export složky z IMAP účtů nebo diskuzních \nskupin je možný, pouze pokud je nastavené čtení v režimu Offline
|
||||
nofolder=Nebyla vybrána žádná cílová složka
|
||||
badfolder=Není možné importovat do této složky (typ IMAP nebo diskuzní skupina)
|
||||
exportAccount=Export všech složek
|
||||
exportFolder=Export složky
|
||||
filePickerImport=Výběr souboru k importu
|
||||
filePickerExport=Výběr cílové složky
|
||||
extensions.{3ed8cc52-86fc-4613-9026-c1ef969da4c3}.description=Umožňuje import a export souborů ve formátu mbox a eml
|
||||
virtualfolder=Toto je virtuální složka. Pro export jejich\nzpráv musíte tyto zprávy nejdříve\nzkopírovat do normální složky.
|
||||
searchdir=Vyberte složku, ve které budou vyhledány mbox soubory
|
||||
confirmimport=Chcete importovat soubor?
|
||||
endscan=Konec prohledávání složek
|
||||
internalerror=Není možné provést import, protože nastala neznámá chyba
|
||||
exportstart=Probíhá export, čekejte prosím...
|
||||
exported=Exportovalo se
|
||||
msgs=zpráv z
|
||||
nosubjectmsg=bez_predmetu
|
||||
messsubdir=zprávy
|
||||
badfolder2=Není možné importovat do této složky (IMAP nebo diskuzní skupina nebo virtuální složka)
|
||||
temp_error=Není možné importovat: nastala chyba při vytváření dočasného souboru
|
||||
importEMLstart=Pobíhá import, čekejte prosím...
|
||||
numEML=Naimportovány eml soubory:
|
||||
CSVseparator=,
|
||||
noEML=No eml file found in this directory
|
||||
backupWarning=During this operation, the program could be\nunresponsive for some minutes.\nDo you want to go on?\n
|
||||
noWaring=Don't show again this warning
|
||||
@@ -0,0 +1,18 @@
|
||||
<!ENTITY tinyplugin "Configuration">
|
||||
<!ENTITY tinypluginconfig "Push">
|
||||
<!ENTITY tinyarchive "Push to OpenERP">
|
||||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/openerp.png">
|
||||
<!ENTITY menuicon.settings "chrome://openerp_plugin/skin/settings.png">
|
||||
<!ENTITY menuicon.value "chrome://openerp_plugin/skin/openerp.png">
|
||||
<!ENTITY partnericon.value "chrome://openerp_plugin/skin/openerp.png">
|
||||
<!ENTITY imagearchive.value "chrome://openerp_plugin/skin/openerp.png">
|
||||
<!ENTITY tooltip.value "Add To Archive">
|
||||
<!ENTITY pluginconfig.value "OpenERP Configuration Settings">
|
||||
<!ENTITY pluginconfigvalue.value "Archieve To OpenERP Settings">
|
||||
<!ENTITY openerpMenu.label "OpenERP">
|
||||
<!ENTITY openerpMenu.accesskey "OE">
|
||||
<!ENTITY openpartner.value "Partner">
|
||||
<!ENTITY openpartnertooltip.value "Click to Open Partner Realted to Sender Eamil address.">
|
||||
<!ENTITY opendocument.value "Document">
|
||||
<!ENTITY opendocumenttooltip.value "Click to See the Mail if it is archived to OpenERP.">
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<!ENTITY title.label "Push To OpenERP">
|
||||
<!ENTITY gptinyobj.label "Link to an Existing Document">
|
||||
<!ENTITY newobject.label "Create a New Documents">
|
||||
<!ENTITY document.label "Documents">
|
||||
<!ENTITY bsearch.label "Search">
|
||||
<!ENTITY close.label "Close">
|
||||
<!ENTITY attach.label "Push">
|
||||
<!ENTITY create.label "New Contact">
|
||||
<!ENTITY archive.label "Create">
|
||||
<!ENTITY attach.label "Attach">
|
||||
<!ENTITY cbxcontact.label "Contact">
|
||||
<!ENTITY cbxinvoice.label "Invoice">
|
||||
<!ENTITY cbxproject.label "Project">
|
||||
<!ENTITY cbxpartner.label "Partner">
|
||||
<!ENTITY cbxproduct.label "Product">
|
||||
<!ENTITY cbxaccount.label "Account">
|
||||
<!ENTITY cbxsale.label "Sale">
|
||||
<!ENTITY cbxcase.label "Case">
|
||||
<!ENTITY cbxtask.label "Task">
|
||||
<!ENTITY cbxselectall.label "Select All">
|
||||
<!ENTITY object.label "Type of Document :">
|
||||
<!ENTITY partner.label "Create New Contact :">
|
||||
<!ENTITY search.label "Search :">
|
||||
<!ENTITY listSearchBox.header "Name">
|
||||
<!ENTITY imagesearch.value "chrome://openerp_plugin/skin/Search.gif">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
|
||||
<!ENTITY imagearchive.value "chrome://openerp_plugin/skin/Archive.png">
|
||||
<!ENTITY imagecreate.value "chrome://openerp_plugin/skin/Create.png">
|
||||
<!ENTITY gptinyobjexe.label "Documents">
|
||||
<!ENTITY newcontact.label "Create a New Contact">
|
||||
<!ENTITY listSearchBox.header2 "Document Type">
|
||||
@@ -0,0 +1,12 @@
|
||||
<!ENTITY title.label "Select Partner">
|
||||
<!ENTITY selectpartner.value "Partner">
|
||||
<!ENTITY listPartnerName.header "Partner Name">
|
||||
<!ENTITY bsearch.label "Search">
|
||||
<!ENTITY create.label "Create">
|
||||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
|
||||
<!ENTITY select.label "Select">
|
||||
<!ENTITY cancel.label "Close">
|
||||
<!ENTITY imagesearch.value "chrome://openerp_plugin/skin/Search.gif">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
|
||||
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
|
||||
<!ENTITY imagecreate.value "chrome://openerp_plugin/skin/Create.png">
|
||||
|
After Width: | Height: | Size: 852 B |
|
After Width: | Height: | Size: 888 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 155 B |
|
After Width: | Height: | Size: 352 B |
|
After Width: | Height: | Size: 363 B |
|
After Width: | Height: | Size: 582 B |
|
After Width: | Height: | Size: 604 B |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,3 @@
|
||||
menuitem#tiny-plugin {
|
||||
color: red !important;
|
||||
}
|
||||
|
After Width: | Height: | Size: 89 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,63 @@
|
||||
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:8080");
|
||||
pref("extensions.tiny.webserverport", "8080");
|
||||
pref("extensions.tiny.serverdbname", "terp");
|
||||
pref("extensions.tiny.username","admin");
|
||||
pref("extensions.tiny.password","admin");
|
||||
pref("extensions.tiny.senderemail","");
|
||||
pref("extensions.tiny.sendername","");
|
||||
pref("extensions.tiny.statutdoc","");// add to have a statut to hidde or not the button
|
||||
pref("extensions.tiny.message_label","");// add to message in push dialog
|
||||
pref("extensions.tiny.receiveremail","");
|
||||
pref("extensions.tiny.subject","");
|
||||
pref("extensions.tiny.receiveddate","");
|
||||
pref("extensions.tiny.partnerid","");
|
||||
pref("extensions.tiny.contactid","");
|
||||
pref("extensions.tiny.attachvalue","");
|
||||
pref("extensions.tiny.cclist","");
|
||||
pref("extensions.tiny.messagebody","");
|
||||
pref("extensions.tiny.displayName","");
|
||||
pref("extensions.tiny.attachmentdata","");
|
||||
pref("extensions.tiny.userid",3);
|
||||
pref("extensions.tiny.partnername","");
|
||||
pref("extensions.tiny.officeno","");
|
||||
pref("extensions.tiny.phoneno","");
|
||||
pref("extensions.tiny.address","");
|
||||
pref("extensions.tiny.listobject","Partner,Account Invoice,Product,Sale Order,Lead and opportunities");
|
||||
pref("extensions.tiny.object","res.partner,account.invoice,product.product,sale.order,crm.lead");
|
||||
pref("extensions.tiny.imagename","chrome://openerp_plugin/skin/Partner.png,chrome://openerp_plugin/skin/Invoice.png,chrome://openerp_plugin/skin/Product.png,chrome://openerp_plugin/skin/Sale.png,chrome://openerp_plugin/skin/Case.png");
|
||||
pref("extensions.tiny.attachmentlength","");
|
||||
pref("extensions.tiny.attachment","");
|
||||
pref("extensions.tiny.db_list","false");
|
||||
pref("extensions.tiny.connect_server","false");
|
||||
pref("extensions.tiny.module_install","yes");
|
||||
pref("extensions.tiny.serverprotocol", "false");
|
||||
|
||||
|
||||
|
||||
pref("mboximport.export.filenames_toascii", false);
|
||||
pref("mboximport.export.overwrite", false);
|
||||
pref("mboximport.confirm.before_mbox_import", true);
|
||||
pref("mboximport.clipboard.always_just_text", false);
|
||||
pref("mboximport.export.HTML_as_displayed", false);
|
||||
pref("mboximport.exportEML.filename_format", 0);
|
||||
pref("mboximport.delay.clean_statusbar", 5000);
|
||||
pref("mboximport.subject.max_length", 50);
|
||||
pref("mboximport.author.max_length", 50);
|
||||
pref("mboximport.recipients.max_length", 50);
|
||||
pref("extensions.{3ed8cc52-86fc-4613-9026-c1ef969da4c3}.description", "chrome://mboximport/locale/mboximport.properties");
|
||||
pref("mboximport.export.set_filetime", false);
|
||||
pref("mboximport.exportEML.use_dir", false);
|
||||
pref("mboximport.exportMBOX.use_dir", false);
|
||||
pref("mboximport.exportMSG.use_dir", false);
|
||||
pref("mboximport.export.filenames_addtime", false);
|
||||
pref("mboximport.export_all.warning1", true);
|
||||
pref("mboximport.export_all.warning2", true);
|
||||
|
||||
pref("mboximport.exportMSG.dir", "/tmp");
|
||||
//For debug in console
|
||||
pref("browser.dom.window.dump.enabled", true);
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
// constants
|
||||
const APP_DISPLAY_NAME = "OpenERP Thunderbird Plugins";
|
||||
const APP_NAME = "OpenERP";
|
||||
const APP_VERSION = "1.0";
|
||||
const WARNING = "WARNING: You need administrator privileges to install OpenERP Thunderbird Plugin. It will be installed in the application directory for all users.";
|
||||
const VERSION_ERROR = "This extension can only be installed in a version higher than 2.0";
|
||||
const NOT_WRITABLE_ERROR = "This extension requires write access to the application directory to install properly."
|
||||
const locales = [
|
||||
"en-US",
|
||||
null
|
||||
];
|
||||
|
||||
// Gecko 1.7 doesn't support custom button labels
|
||||
var incompatible = (typeof Install.BUTTON_POS_0 == "undefined");
|
||||
if (incompatible)
|
||||
alert(VERSION_ERROR);
|
||||
|
||||
if (!incompatible) {
|
||||
// Check whether all directories can be accessed
|
||||
var dirList = [
|
||||
getFolder("Components"),
|
||||
getFolder(getFolder("Program", "defaults"), "pref")
|
||||
];
|
||||
for (var i = 0; i < dirList.length; i++)
|
||||
if (!File.isWritable(dirList[i]))
|
||||
incompatible = true;
|
||||
|
||||
if (incompatible)
|
||||
alert(NOT_WRITABLE_ERROR);
|
||||
}
|
||||
|
||||
if (!incompatible && confirm(WARNING, APP_DISPLAY_NAME)) {
|
||||
/* Pre-Install Cleanup (for prior versions) */
|
||||
|
||||
// List of files to be checked
|
||||
var checkFiles = [
|
||||
[getFolder("Components"), "nsXmlRpcClient.js"], // Root component
|
||||
[getFolder("Components"), "xml-rpc.xpt"], // Component interface
|
||||
];
|
||||
|
||||
// Remove any existing files
|
||||
initInstall("pre-install", "/rename", "0.0"); // open dummy-install
|
||||
for (var i = 0 ; i < checkFiles.length ; i++) {
|
||||
var currentDir = checkFiles[i][0];
|
||||
var name = checkFiles[i][1];
|
||||
var oldFile = getFolder(currentDir, name);
|
||||
|
||||
// Find a name to rename the file into
|
||||
var newName = name + "-uninstalled";
|
||||
for (var n = 1; File.exists(oldFile) && File.exists(getFolder(currentDir, newName)); n++)
|
||||
newName = name + n + "-uninstalled";
|
||||
|
||||
if (File.exists(oldFile))
|
||||
File.rename(oldFile, newName);
|
||||
}
|
||||
performInstall(); // commit renamed files
|
||||
|
||||
/* Main part of the installation */
|
||||
|
||||
var chromeType = DELAYED_CHROME;
|
||||
|
||||
var files = [
|
||||
["components/nsXmlRpcClient.js", getFolder("Components")],
|
||||
["components/xml-rpc.xpt", getFolder("Components")],
|
||||
["defaults/preferences/tiny.js", getFolder(getFolder("Program", "defaults"), "pref")],
|
||||
];
|
||||
|
||||
// initialize our install
|
||||
initInstall(APP_NAME, APP_PACKAGE, APP_VERSION);
|
||||
|
||||
// Add files
|
||||
for (var i = 0; i < files.length; i++)
|
||||
addFile(APP_NAME, APP_VERSION, files[i][0], files[i][1], null);
|
||||
|
||||
try {
|
||||
var err = registerChrome(CONTENT | chromeType, jar, "content/");
|
||||
if (err != SUCCESS)
|
||||
throw "Chrome registration for content failed (error code " + err + ").";
|
||||
|
||||
err = registerChrome(SKIN | chromeType, jar, "skin/classic/");
|
||||
if (err != SUCCESS)
|
||||
throw "Chrome registration for skin failed (error code " + err + ").";
|
||||
|
||||
for (i = 0; i < locales.length; i++) {
|
||||
if (!locales[i])
|
||||
continue;
|
||||
|
||||
err = registerChrome(LOCALE | chromeType, jar, "locale/" + locales[i] + "/");
|
||||
if (err != SUCCESS)
|
||||
throw "Chrome registration for " + locales[i] + " locale failed (error code " + err + ").";
|
||||
}
|
||||
|
||||
var err = performInstall();
|
||||
if (err != SUCCESS && err != 999)
|
||||
throw "Committing installation failed (error code " + err + ").";
|
||||
|
||||
alert("OpenERP Thunderbird Plugin " + APP_VERSION + " is now installed.\n" +
|
||||
"It will become active after you restart your browser.");
|
||||
}
|
||||
catch (ex) {
|
||||
alert("Installation failed: " + ex + "\n" +
|
||||
"You probably don't have the necessary permissions (log in as system administrator).");
|
||||
cancelInstall(err);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||
<Description about="urn:mozilla:install-manifest">
|
||||
<em:id>thunderbird@openerp.com</em:id>
|
||||
<em:iconURL>chrome://openerp_plugin/skin/tinyerp-icon.ico</em:iconURL>
|
||||
<em:name>OpenERP Plugin</em:name>
|
||||
<em:version>1.0</em:version>
|
||||
<em:description>OpenERP Thunderbird Integration</em:description>
|
||||
<em:creator>OpenERP SA</em:creator>
|
||||
<!-- optional items -->
|
||||
<em:homepageURL>http://openerp.com</em:homepageURL>
|
||||
<!-- Thunderbird -->
|
||||
<em:targetApplication>
|
||||
<Description>
|
||||
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
|
||||
<em:minVersion>2.0</em:minVersion>
|
||||
<em:maxVersion>9.*</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
</Description>
|
||||
</RDF>
|
||||
@@ -0,0 +1,3 @@
|
||||
make clean
|
||||
make
|
||||
cp ../openerp_plugin.xpi /home/openerp/
|
||||
@@ -0,0 +1,11 @@
|
||||
all: xpi
|
||||
|
||||
jar:
|
||||
jar cvf chrome/openerp_plugin.jar -C chrome/openerp_plugin/ .
|
||||
|
||||
xpi: jar
|
||||
zip -r ../openerp_plugin.xpi *
|
||||
|
||||
clean:
|
||||
rm ../openerp_plugin.xpi
|
||||
rm chrome/openerp_plugin.jar
|
||||