[IMP] thunderbird
bzr revid: hmo@tinyerp.com-20100803111214-vqbcslbrj7o0w9de
|
@ -2,7 +2,7 @@
|
|||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
# 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
|
||||
|
@ -34,7 +34,7 @@ class thunderbird_installer(osv.osv_memory):
|
|||
data = super(thunderbird_installer, self).default_get(cr, uid, fields, context)
|
||||
pdf_file = open(addons.get_module_resource('thunderbird','doc', 'Installation Guide to OpenERP Thunderbid Plug-in.pdf'),'rb')
|
||||
data['pdf_file'] = base64.encodestring(pdf_file.read())
|
||||
file = open(addons.get_module_resource('thunderbird','plugin', 'Openerp_plugin.xpi'),'rb')
|
||||
file = open(addons.get_module_resource('thunderbird','plugin', 'openerp_plugin.xpi'),'rb')
|
||||
data['plugin_file'] = base64.encodestring(file.read())
|
||||
return data
|
||||
|
||||
|
@ -49,9 +49,16 @@ class thunderbird_installer(osv.osv_memory):
|
|||
|
||||
_defaults = {
|
||||
'thunderbird' : True,
|
||||
'name' : 'Openerp_plugin.xpi',
|
||||
'name' : 'openerp_plugin.xpi',
|
||||
'pdf_name' : 'Installation Guide to OpenERP Thunderbid Plug-in.pdf',
|
||||
'description' : """ * Save the Thunderbird plugin. \n * Follows the following step to install Thunderbird plugin. \n -> 1.From Menu Bar of Thunderbird, open Tools > Add ons. \n -> 2. Click on install button and a browser window appears. \n -> 3. Select the plug-in(.xpi file) and click Ok. \n -> 4. Software installation window appears and within a short time “Install Now” button will be enabled -> 5. Click "Install Now". \n -> 6. Restart Thunderbird."""
|
||||
}
|
||||
'description' : """* Save the Thunderbird plugin.
|
||||
* Follows the following step to install Thunderbird plugin.
|
||||
1. From Menu Bar of Thunderbird, open Tools > Add ons.
|
||||
2. Click on install button and a browser window appears.
|
||||
3. Select the plug-in(.xpi file) and click Ok.
|
||||
4. Software installation window appears and within a short time “Install Now” button will be enabled.
|
||||
5. Click "Install Now".
|
||||
6. Restart Thunderbird."""
|
||||
}
|
||||
|
||||
thunderbird_installer()
|
||||
|
|
|
@ -26,47 +26,24 @@ import base64
|
|||
import netsvc
|
||||
from tools.translate import _
|
||||
|
||||
class tinythunderbird_partner(osv.osv):
|
||||
|
||||
def _links_get(self, cr, uid, context={}):
|
||||
obj = self.pool.get('res.request.link')
|
||||
ids = obj.search(cr, uid, [])
|
||||
res = obj.read(cr, uid, ids, ['object', 'name'], context)
|
||||
|
||||
return [(r['object'], r['name']) for r in res]
|
||||
|
||||
_name = "tinythunderbird.partner"
|
||||
class thunderbird_partner(osv.osv_memory):
|
||||
_name = "thunderbird.partner"
|
||||
_description="Thunderbid mails"
|
||||
_rec_name="sender"
|
||||
_columns = {
|
||||
'sender':fields.char("Sender",size=128,required=True,select=True),
|
||||
'receiver':fields.text("Receiver"),
|
||||
"copy_to":fields.text("Copy To"),
|
||||
"date":fields.date("Date",select=True),
|
||||
"title":fields.char("Subject",size=128,select=True),
|
||||
"description":fields.text("Description"),
|
||||
"reference":fields.reference("Reference", selection=_links_get, size=128),
|
||||
"res_user_id":fields.many2one("res.users","User"),
|
||||
"attachments":fields.text("Attached Files",readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'res_user_id':lambda obj,cr,uid,context: uid,
|
||||
'date': lambda *a: time.strftime('%Y-%m-%d')
|
||||
}
|
||||
|
||||
|
||||
def mailcreate(self,cr,user,vals):
|
||||
dictcreate = dict(vals)
|
||||
import email
|
||||
header_name = email.Header.decode_header(dictcreate['name'])
|
||||
dictcreate['name'] = header_name and header_name[0] and header_name[0][0]
|
||||
address_obj=self.pool.get('res.partner.address')
|
||||
case_pool=self.pool.get(dictcreate.get('object','crm.lead'))
|
||||
partner_ids=address_obj.search(cr,user,[('email','=',dictcreate['email_from'])])
|
||||
partner=address_obj.read(cr,user,partner_ids,['partner_id','name'])
|
||||
address_obj = self.pool.get('res.partner.address')
|
||||
case_pool = self.pool.get(dictcreate.get('object','crm.lead'))
|
||||
partner_ids = address_obj.search(cr,user,[('email','=',dictcreate['email_from'])])
|
||||
partner = address_obj.read(cr,user,partner_ids,['partner_id','name'])
|
||||
if partner and partner[0] and partner[0]['partner_id']:
|
||||
dictcreate.update({'partner_id':partner[0]['partner_id'][0],'partner_name':partner[0]['name']})
|
||||
create_id = case_pool.create(cr, user, dictcreate)
|
||||
cases=case_pool.browse(cr,user,[create_id])
|
||||
cases = case_pool.browse(cr,user,[create_id])
|
||||
case_pool._history(cr, user, cases, _('Archive'), history=True, email=False)
|
||||
return create_id
|
||||
|
||||
|
@ -248,4 +225,4 @@ class tinythunderbird_partner(osv.osv):
|
|||
object += "null,"
|
||||
return object
|
||||
|
||||
tinythunderbird_partner()
|
||||
thunderbird_partner()
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
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,115 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/address.dtd">
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
title="&title.label;" onload="myPrefObserver.createContactAddress()" height="350" width="800">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/static.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
|
||||
|
||||
<groupbox id="gpData">
|
||||
<hbox>
|
||||
<description>&name.value;</description>
|
||||
<spacer width="12"/>
|
||||
<textbox id="txtname" align="right" width="270" readonly="true"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<description>&contactname.value;</description>
|
||||
<spacer width="9"/>
|
||||
<textbox id="txtcontactname" align="right" width="270" />
|
||||
</hbox>
|
||||
<hbox>
|
||||
<caption label="&postaladdress.value;" />
|
||||
<spacer width="300"/>
|
||||
<vbox>
|
||||
<caption label="&communication.value;" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<description>&street.value;</description>
|
||||
<spacer width="63"/>
|
||||
<textbox id="txtstreet" width="270"/>
|
||||
<spacer width="33"/>
|
||||
<vbox>
|
||||
<description>&office.value;</description>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<spacer width="68"/>
|
||||
<textbox id="txtoffice" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<description>&street2.value;</description>
|
||||
<spacer width="54"/>
|
||||
<textbox id="txtstreet2" width="270"/>
|
||||
<spacer width="33"/>
|
||||
<vbox>
|
||||
<description>&fax.value;</description>
|
||||
<spacer width="53"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<textbox id="txtfax" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<description>&zip.value;</description>
|
||||
<spacer width="82"/>
|
||||
<textbox id="txtzip" />
|
||||
<spacer width="110"/>
|
||||
<vbox>
|
||||
<description>&mobile.value;</description>
|
||||
<spacer width="53"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<textbox id="txtmobile" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<description>&city.value;</description>
|
||||
<spacer width="79"/>
|
||||
<textbox id="txtcity" />
|
||||
<spacer width="110"/>
|
||||
<vbox>
|
||||
<description>&email.value;</description>
|
||||
<spacer width="58"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<textbox id="txtemail" width="260" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<label id="lblex3" value="&country.value;"/>
|
||||
<spacer width="54"/>
|
||||
<menulist id="country" width="190">
|
||||
<menupopup>
|
||||
<menuitem label="" value=""/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<label id="lblex4" value="&state.value;"/>
|
||||
<spacer width="68"/>
|
||||
<menulist id="state" width="190">
|
||||
<menupopup>
|
||||
<menuitem label="" value=""/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<description></description>
|
||||
<hbox>
|
||||
<spacer width="600"/>
|
||||
<button label="&cancel.label;" image="&imagecancel.value;" oncommand="close();" />
|
||||
<button label="&ok.label;" image="&imageok.value;" oncommand="UpdateContact();close()"/>
|
||||
</hbox>
|
||||
|
||||
</window>
|
161
addons/thunderbird/plugin/openerp_plugin/chrome/openerp_plugin/content/config.js
Executable file
|
@ -0,0 +1,161 @@
|
|||
|
||||
function config_close()
|
||||
{
|
||||
window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
|
||||
}
|
||||
//set the value of the configuration fields
|
||||
function config_change_load()
|
||||
{
|
||||
var s = getServer();
|
||||
var a =s.split(':');
|
||||
if (String(a)=="" || String(a)=="undefined"){
|
||||
document.getElementById('txtcurl').value = "localhost"
|
||||
document.getElementById('txtcport').value = "8069"
|
||||
}
|
||||
else
|
||||
{
|
||||
len = a[1];
|
||||
var url = "";
|
||||
for (i=0;i<len.length;i++)
|
||||
{ if (len[i] == "/")
|
||||
{
|
||||
continue
|
||||
}
|
||||
url += len[i]
|
||||
}
|
||||
if (String(url) == "" || String(url) == "undefined"){
|
||||
document.getElementById('txtcurl').value = "localhost"
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById('txtcurl').value = url
|
||||
}
|
||||
|
||||
if (String(a[2]) == "" || String(a[2]) == "undefined"){
|
||||
document.getElementById('txtcport').value = "8069"
|
||||
setPort("8069");
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById('txtcport').value = a[2]
|
||||
setPort(a[2]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
function config_ok()
|
||||
{
|
||||
if (document.getElementById('txtcurl').value == '')
|
||||
{
|
||||
alert("You Must Enter Server Name!")
|
||||
return false;
|
||||
|
||||
}
|
||||
if (document.getElementById('txtcport').value == '')
|
||||
{
|
||||
alert("You Must Enter Port!")
|
||||
return false;
|
||||
}
|
||||
setServer("http://"+document.getElementById('txtcurl').value +":" + document.getElementById('txtcport').value);
|
||||
window.close("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
|
||||
}
|
||||
function openConfigChange()
|
||||
{
|
||||
window.open("chrome://openerp_plugin/content/config_change.xul", "", "chrome");
|
||||
}
|
||||
|
||||
function appendDbList()
|
||||
{
|
||||
/*var s = document.getElementById('txturl').value;
|
||||
var a =s.split(':');
|
||||
setPort(a[a.length-1]);
|
||||
setServer(document.getElementById('txturl').value);
|
||||
setUsername(document.getElementById('txtusername').value);
|
||||
setPassword(document.getElementById('txtpassword').value);*/
|
||||
setServerService('xmlrpc/db');
|
||||
getDbList('DBlist');
|
||||
}
|
||||
|
||||
//set the database list in the listbox in configuration window
|
||||
function setDb()
|
||||
{
|
||||
var cmbDbList = document.getElementById('listDBListBox');
|
||||
document.getElementById('DBlist').value = cmbDbList.getItemAtIndex(cmbDbList.selectedIndex).value;
|
||||
}
|
||||
|
||||
//stores the value of configuration fields in preferences
|
||||
function okClick()
|
||||
{
|
||||
if (getDBList()=="false")
|
||||
{
|
||||
if (document.getElementById('DBlist_text').value =='')
|
||||
{
|
||||
alert("You Must Enter Database Name");
|
||||
return false;
|
||||
}
|
||||
setDbName(document.getElementById('DBlist_text').value);
|
||||
}
|
||||
else if(document.getElementById('DBlist') != null)
|
||||
{
|
||||
setDbName(document.getElementById('DBlist').value);
|
||||
}
|
||||
setServer(document.getElementById('txturl').value);
|
||||
var s = document.getElementById('txturl').value;
|
||||
var a =s.split(':');
|
||||
setPort(a[a.length-1]);
|
||||
setUsername(document.getElementById('txtusername').value);
|
||||
setPassword(document.getElementById('txtpassword').value);
|
||||
window.close();
|
||||
}
|
||||
|
||||
//deletes the value of the selected value in the listbox in configuraton menu
|
||||
function deleteDocument(){
|
||||
if(document.getElementById("listObjectListBox").selectedItem){
|
||||
var objectlist = getPref().getCharPref("object").split(',');
|
||||
var imagelist = getPref().getCharPref("imagename").split(',');
|
||||
var objlist = getPref().getCharPref("listobject").split(',');
|
||||
if(objectlist.length>0){
|
||||
var objectcharpref = '';
|
||||
var imagecharpref = '';
|
||||
var objcharpref = '';
|
||||
var nodelist = document.getElementById("listObjectListBox").selectedItem.childNodes
|
||||
var childnode = document.getElementById("listObjectListBox").childNodes
|
||||
for(i=2;i<childnode.length;i++){
|
||||
if(childnode[i].hasChildNodes){
|
||||
var secondchild = childnode[i].childNodes;
|
||||
if (secondchild[1].getAttribute("label") != nodelist[1].getAttribute("label")){
|
||||
objcharpref += secondchild[0].getAttribute("label")+',';
|
||||
objectcharpref += secondchild[1].getAttribute("label")+',';
|
||||
imagecharpref += secondchild[2].getAttribute("image")+',';
|
||||
}
|
||||
}
|
||||
}
|
||||
var demo3 = objectcharpref.substring(0,objectcharpref.length-1);
|
||||
var demo4 = imagecharpref.substring(0,imagecharpref.length-1);
|
||||
var demo5 = objcharpref.substring(0,objcharpref.length-1);
|
||||
|
||||
getPref().setCharPref("listobject",demo5);
|
||||
getPref().setCharPref("object",demo3);
|
||||
getPref().setCharPref("imagename",demo4);
|
||||
}
|
||||
document.getElementById("listObjectListBox").removeItemAt(document.getElementById("listObjectListBox").selectedIndex)
|
||||
}
|
||||
else{
|
||||
alert("No Object Selected");
|
||||
}
|
||||
}
|
||||
|
||||
//function to add the image file for the checkbox
|
||||
function addFile(){
|
||||
var nsIFilePicker = Components.interfaces.nsIFilePicker;
|
||||
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
|
||||
fp.init(this, "Select a File", nsIFilePicker.modeOpen);
|
||||
fp.appendFilters(nsIFilePicker.filterImages);
|
||||
//fp.appendFilter("Image Files","*.png");
|
||||
var res = fp.show();
|
||||
if (res == nsIFilePicker.returnOK){
|
||||
var thefile = fp.file;
|
||||
document.getElementById("txtimagename").value = thefile.path
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.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="myPrefObserver.register();" unload="myPrefObserver.unregister()" height="410" width="900">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
|
||||
<tabbox>
|
||||
<tabs>
|
||||
<tab label="Configuration Settings"/>
|
||||
<tab label="Document Settings"/>
|
||||
<tab label="About"/>
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<tabpanel id="configtab">
|
||||
<vbox >
|
||||
<groupbox id="gpConnection" width="770" height="300" align ="center" >
|
||||
<caption label="&gpConnection.label;"/>
|
||||
<hbox>
|
||||
<label align="right" id="url" value="&txturl.label;" width="80" />
|
||||
<textbox id="txturl" width="200" readonly="true" />
|
||||
<button label="&getdblist.label;" oncommand="openConfigChange();" image="&imagesearch.value;" width="90"/>
|
||||
</hbox>
|
||||
<hbox align="center" id="database_option">
|
||||
</hbox>
|
||||
<hbox id="first">
|
||||
<label align="right" id="lbldb_list1" control="DBlist" value="&database.label;" width="80"/>
|
||||
<textbox id="DBlist_text" width="300"/>
|
||||
</hbox>
|
||||
|
||||
<hbox >
|
||||
<label align="right" control="txtusername" value="&username.label;" width="80"/>
|
||||
<textbox id="txtusername" width="300"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<label align="right" control="txtpassword" value="&password.label;" width="80"/>
|
||||
<textbox id="txtpassword" type="password" width="300"/>
|
||||
</hbox>
|
||||
<hbox >
|
||||
<spacer width="250"/>
|
||||
<button align="center" id="btconnection" label="&connection.label;" oncommand="testConnection();" image="&imageok.value;" width="150"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</vbox>
|
||||
</tabpanel>
|
||||
<tabpanel id="objecttab">
|
||||
<groupbox id="gpObject" width="700" >
|
||||
<caption label="&listDocument.header;"/>
|
||||
<hbox>
|
||||
<vbox>
|
||||
<hbox>
|
||||
<label control="txtobject" value="Title : " />
|
||||
<textbox id="txtobj" width="100"/>
|
||||
<label control="txtobject" value="&document.label;"/>
|
||||
<textbox id="txtobject" width="100"/>
|
||||
<label control="txtimagename" value="&image.label;"/>
|
||||
<textbox id="txtimagename" width="100" readonly="true" />
|
||||
<button id="btaddfile" label="&addfile.label;" oncommand="addFile();" image="&imagemoveleft.value;"/>
|
||||
|
||||
<button id="btobjectcreate" label="&documentcreate.label;" oncommand="searchDocument();" image="&imagemovedown.value;"/>
|
||||
<button id="btobjectdelete" label="&documentdelete.label;" oncommand="deleteDocument();" image="&imagecancel.value;"/>
|
||||
</hbox>
|
||||
|
||||
<listbox id="listObjectListBox" flex="1" rows="10">
|
||||
<listhead>
|
||||
<listheader label="Title"/>
|
||||
<listheader label="&listDocumentListBox.header;"/>
|
||||
<listheader label="Image"/>
|
||||
</listhead>
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
<listcol flex="2"/>
|
||||
<listcol flex="3"/>
|
||||
</listcols>
|
||||
</listbox>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<description> </description>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
</tabpanel>
|
||||
<tabpanel id="abouttab">
|
||||
<groupbox id="gpAbout" width="770" align="center">
|
||||
<caption label="&gpAbout.label;"/>
|
||||
<image src="chrome://openerp_plugin/skin/developped_by.png" sizemode="stretch" align="center"/>
|
||||
<description> </description>
|
||||
<description> </description>
|
||||
<description>&develop.value;</description>
|
||||
<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 and 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>
|
||||
<hbox align="center">
|
||||
<spacer width="685"/>
|
||||
<button label="&close.label;" oncommand="close();" image="&imagecancel.value;"/>
|
||||
<button label="&ok.label;" oncommand="okClick();" image="&imageok.value;"/>
|
||||
</hbox>
|
||||
</window>
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.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="Server" height="160" width="320">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/static.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
|
||||
<description>Connect To OpenERP Server</description>
|
||||
<groupbox id="gpData" width="200">
|
||||
<hbox >
|
||||
<label id="lblurl" control="txtcurl" value="&lblurl.label;" width="80"/>
|
||||
<textbox id="txtcurl" width="100" />
|
||||
</hbox>
|
||||
<hbox>
|
||||
<label id="lblport" control="txtcport" value="&lblport.label;" width="80"/>
|
||||
<textbox id="txtcport" width="100" />
|
||||
</hbox>
|
||||
<hbox id="test">
|
||||
<label id="lblprotocol" control="txtcprotocol" value="&lblservices.label;" width="80"/>
|
||||
<textbox id="txtcprotocol" width="150" />
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<hbox align="rightr">
|
||||
<spacer width="50"/>
|
||||
<button label="Cancel" image="&imagecancel.value;" oncommand="config_close();" />
|
||||
<button label="OK" image="&imageok.value;" oncommand="config_ok()"/>
|
||||
</hbox>
|
||||
|
||||
</window>
|
|
@ -0,0 +1,116 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.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="myPrefObserver.createContact()" height="350" width="780">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/static.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
|
||||
<groupbox id="gpData">
|
||||
<hbox>
|
||||
<description>&selectpartner.value;</description>
|
||||
<spacer width="60"/>
|
||||
<textbox id="txtselectpartner" readonly="true" value=""/>
|
||||
<button label="&bsearch.label;" oncommand="Select.onMenuItemCommand(event);" image="&imagesearch.value;"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<description>&name.value;</description>
|
||||
<spacer width="12"/>
|
||||
<textbox id="txtname" align="right" width="270"/>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<caption label="&postaladdress.value;" />
|
||||
<spacer width="300"/>
|
||||
<vbox>
|
||||
<caption label="&communication.value;" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<description>&street.value;</description>
|
||||
<spacer width="63"/>
|
||||
<textbox id="txtstreet" width="270"/>
|
||||
<spacer width="33"/>
|
||||
<vbox>
|
||||
<description>&office.value;</description>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<spacer width="68"/>
|
||||
<textbox id="txtoffice" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<description>&street2.value;</description>
|
||||
<spacer width="54"/>
|
||||
<textbox id="txtstreet2" width="270"/>
|
||||
<spacer width="33"/>
|
||||
<vbox>
|
||||
<description>&fax.value;</description>
|
||||
<spacer width="53"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<textbox id="txtfax" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<description>&zip.value;</description>
|
||||
<spacer width="82"/>
|
||||
<textbox id="txtzip" />
|
||||
<spacer width="110"/>
|
||||
<vbox>
|
||||
<description>&mobile.value;</description>
|
||||
<spacer width="53"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<textbox id="txtmobile" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<description>&city.value;</description>
|
||||
<spacer width="79"/>
|
||||
<textbox id="txtcity" />
|
||||
<spacer width="110"/>
|
||||
<vbox>
|
||||
<description>&email.value;</description>
|
||||
<spacer width="58"/>
|
||||
</vbox>
|
||||
<vbox>
|
||||
<textbox id="txtemail" width="260" />
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<label id="lblex3" value="&country.value;"/>
|
||||
<spacer width="54"/>
|
||||
<menulist id="country" width="190">
|
||||
<menupopup>
|
||||
<menuitem label="" value=""/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<label id="lblex4" value="&state.value;"/>
|
||||
<spacer width="68"/>
|
||||
<menulist id="state" width="190">
|
||||
<menupopup>
|
||||
<menuitem label="" value=""/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<description></description>
|
||||
<hbox>
|
||||
<spacer width="580"/>
|
||||
<button label="&cancel.label;" image="&imagecancel.value;" oncommand="close();" />
|
||||
<button label="&ok.label;" image="&imageok.value;" oncommand="createContact();"/>
|
||||
</hbox>
|
||||
|
||||
</window>
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<!DOCTYPE window SYSTEM "chrome://openerp_plugin/locale/createpartner.dtd">
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
title="&title.label;" height="100" width="325">
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/static.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
|
||||
<groupbox id="gpData">
|
||||
<hbox>
|
||||
<description>&name.value;</description>
|
||||
<spacer width="50"/>
|
||||
<textbox id="txtname" align="right" />
|
||||
</hbox>
|
||||
</groupbox>
|
||||
<description></description>
|
||||
<hbox>
|
||||
<spacer width="140"/>
|
||||
<button label="&cancel.label;" image="&imagecancel.value;" oncommand="close();" />
|
||||
<button label="&ok.label;" image="&imageok.value;" oncommand="createPartner();"/>
|
||||
</hbox>
|
||||
|
||||
</window>
|
|
@ -0,0 +1,249 @@
|
|||
|
||||
var MBstrBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].
|
||||
getService(Components.interfaces.nsIStringBundleService);
|
||||
var mboximportbundle = MBstrBundleService.createBundle("chrome://openerp_plugin/locale/mboximport.properties");
|
||||
|
||||
|
||||
function saveMsgAsEML(msguri,file,append,uriArray,hdrArray,fileArray) {
|
||||
|
||||
var myEMLlistner = {
|
||||
|
||||
scriptStream : null,
|
||||
emailtext : "",
|
||||
|
||||
QueryInterface : function(iid) {
|
||||
if (iid.equals(Components.interfaces.nsIStreamListener) ||
|
||||
iid.equals(Components.interfaces.nsIMsgHeaderSink) ||
|
||||
iid.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
return 0;
|
||||
},
|
||||
|
||||
onStartRequest : function (aRequest, aContext) {
|
||||
this.scriptStream = Components.classes['@mozilla.org/binaryinputstream;1'].createInstance(Components.interfaces.nsIBinaryInputStream);
|
||||
},
|
||||
|
||||
onStopRequest : function (aRequest, aContext, aStatusCode) {
|
||||
this.scriptStream = null;
|
||||
|
||||
if (append) {
|
||||
if (this.emailtext != "") {
|
||||
var data = this.emailtext + "\n";
|
||||
// Some Imap servers don't add to the message the "From" prologue
|
||||
if (data && ! data.match(/^From/)) {
|
||||
var now = new Date;
|
||||
var prologue = "From - " + now.toString() + "\n";
|
||||
data = prologue+data;
|
||||
}
|
||||
data = IETescapeBeginningFrom(data);
|
||||
}
|
||||
var fileClone = file.clone();
|
||||
IETwriteDataOnDisk(fileClone,data,true,this.sub,null);
|
||||
}
|
||||
else {
|
||||
if (! hdrArray)
|
||||
var sub = getSubjectForHdr(hdr);
|
||||
else {
|
||||
var parts = hdrArray[IETexported].split("§][§^^§");
|
||||
var sub = parts[4];
|
||||
}
|
||||
|
||||
var data = this.emailtext.replace(/^From.+\r?\n]/, "");
|
||||
data = IETescapeBeginningFrom(data);
|
||||
var clone = file.clone();
|
||||
// The name is taken from the subject "corrected"
|
||||
clone.append(sub+".eml");
|
||||
clone.createUnique(0,0644);
|
||||
var time = (hdr.dateInSeconds)*1000;
|
||||
IETwriteDataOnDisk(clone,data,false,null,time);
|
||||
}
|
||||
IETexported = IETexported + 1;
|
||||
IETwritestatus(mboximportbundle.GetStringFromName("exported")+" "+IETexported+" "+mboximportbundle.GetStringFromName("msgs")+" "+IETtotal);
|
||||
|
||||
if (IETexported < IETtotal) {
|
||||
if (fileArray) {
|
||||
var nextUri = uriArray[IETexported];
|
||||
var nextFile = fileArray[IETexported];
|
||||
}
|
||||
else if (! hdrArray) {
|
||||
var nextUri = uriArray[IETexported];
|
||||
var nextFile = file;
|
||||
}
|
||||
else {
|
||||
parts = hdrArray[IETexported].split("§][§^^§");
|
||||
var nextUri = parts[5];
|
||||
var nextFile = file;
|
||||
}
|
||||
saveMsgAsEML(nextUri,nextFile,append,uriArray,hdrArray,fileArray);
|
||||
}
|
||||
else {
|
||||
IETexported = 0;
|
||||
IETtotal = 0;
|
||||
}
|
||||
},
|
||||
|
||||
onDataAvailable : function (aRequest, aContext, aInputStream, aOffset, aCount) {
|
||||
this.scriptStream.setInputStream(aInputStream);
|
||||
var chunk = this.scriptStream.readBytes(aCount);
|
||||
this.emailtext += chunk;
|
||||
}
|
||||
};
|
||||
var mms = messenger.messageServiceFromURI(msguri).QueryInterface(Components.interfaces.nsIMsgMessageService);
|
||||
var hdr = mms.messageURIToMsgHdr(msguri);
|
||||
mms.streamMessage(msguri, myEMLlistner, msgWindow, null, false, null);
|
||||
}
|
||||
|
||||
|
||||
function nametoascii(str) {
|
||||
if (! gPrefBranch.getBoolPref("mboximport.export.filenames_toascii")) {
|
||||
str = str.replace(/[\x00-\x19]/g,"_");
|
||||
return str.replace(/[\/\\:,<>*\?\"\|]/g,"_");
|
||||
}
|
||||
if (str)
|
||||
str = str.replace(/[^a-zA-Z0-9]/g,"_");
|
||||
else
|
||||
str = "Undefinied_or_empty";
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
function IETwriteDataOnDisk(file,data,append,name,time) {
|
||||
var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
|
||||
.createInstance(Components.interfaces.nsIFileOutputStream);
|
||||
if (append) {
|
||||
file.append(name);
|
||||
foStream.init(file, 0x02 | 0x08 | 0x10, 0664, 0); // write, create, append
|
||||
}
|
||||
else
|
||||
foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0); // write, create, truncate
|
||||
if (data)
|
||||
foStream.write(data,data.length);
|
||||
foStream.close();
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
if (time && prefs.getBoolPref("mboximport.export.set_filetime"))
|
||||
file.lastModifiedTime = time;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function IETescapeBeginningFrom(data) {
|
||||
// Workaround to fix the "From " in beginning line problem in body messages
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=119441 and
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=194382
|
||||
// TB2 has uncorrect beahviour with html messages
|
||||
// This is not very fine, but I didnt' find anything better...
|
||||
var datacorrected = data.replace(/\nFrom /g, "\n From ");
|
||||
return datacorrected;
|
||||
}
|
||||
|
||||
|
||||
function getPredefinedFolder(type) {
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch);
|
||||
// type 0 = folder
|
||||
// type 1 = all messages
|
||||
// type 2 = selected messages
|
||||
|
||||
var use_dir = "mboximport.exportMSG.use_dir";
|
||||
|
||||
//var dir_path = "mboximport.exportMSG.dir";
|
||||
var dir_path="";
|
||||
if(navigator.userAgent.indexOf('Linux')!= -1){
|
||||
dir_path ="/tmp"
|
||||
}
|
||||
else if(navigator.userAgent.indexOf('Win')!= -1){
|
||||
dir_path ="C:\\"
|
||||
}
|
||||
else if(navigator.userAgent.indexOf('Mac OS X')!= -1){
|
||||
dir_path ="/tmp"
|
||||
}
|
||||
try {
|
||||
var localFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
localFile.initWithPath(dir_path);
|
||||
return localFile;
|
||||
|
||||
}
|
||||
catch(e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function getSubjectForHdr(hdr) {
|
||||
var emlNameType = gPrefBranch.getIntPref("mboximport.exportEML.filename_format");
|
||||
var mustcorrectname = gPrefBranch.getBoolPref("mboximport.export.filenames_toascii");
|
||||
var subMaxLen = gPrefBranch.getIntPref("mboximport.subject.max_length")-1;
|
||||
if (hdr.mime2DecodedSubject)
|
||||
|
||||
var subj = hdr.mime2DecodedSubject.substring(0, subMaxLen);
|
||||
else
|
||||
var subj =IETnosub;
|
||||
subj = nametoascii(subj);
|
||||
var dateInSec = hdr.dateInSeconds;
|
||||
var msgDate8601string = dateInSecondsTo8601(dateInSec);
|
||||
var key = hdr.messageKey;
|
||||
if (emlNameType == 2) {
|
||||
var pattern = gPrefBranch.getCharPref("mboximport.export.filename_pattern");
|
||||
pattern = pattern.replace("%s",subj);
|
||||
pattern = pattern.replace("%k",key);
|
||||
pattern = pattern.replace("%d", msgDate8601string);
|
||||
pattern = pattern.replace(/-%e/g, "");
|
||||
pattern = pattern.replace(/[\x00-\x19]/g,"_");
|
||||
var fname = pattern;
|
||||
}
|
||||
else {
|
||||
|
||||
var fname = msgDate8601string+"-"+subj+"-"+hdr.messageKey;
|
||||
}
|
||||
setFileName(fname)
|
||||
fname = fname.replace(/[\x00-\x19]/g,"_");
|
||||
if (mustcorrectname)
|
||||
fname = nametoascii(fname);
|
||||
else
|
||||
fname = fname.replace(/[\/\\:,<>*\?\"\|]/g,"_");
|
||||
return fname;
|
||||
}
|
||||
|
||||
function dateInSecondsTo8601(secs) {
|
||||
var addTime = gPrefBranch.getBoolPref("mboximport.export.filenames_addtime");
|
||||
var msgDate = new Date(secs*1000);
|
||||
var msgDate8601 = msgDate.getFullYear();
|
||||
if (msgDate.getMonth() < 9)
|
||||
var month = "0"+(msgDate.getMonth()+1);
|
||||
else
|
||||
var month = msgDate.getMonth()+1;
|
||||
if (msgDate.getDate() < 10)
|
||||
var day = "0"+ msgDate.getDate();
|
||||
else
|
||||
var day = msgDate.getDate();
|
||||
var msgDate8601string = msgDate8601.toString()+month.toString()+day.toString();
|
||||
if (addTime && gPrefBranch.getIntPref("mboximport.exportEML.filename_format") == 2) {
|
||||
if (msgDate.getHours() < 10)
|
||||
var hours = "0"+msgDate.getHours();
|
||||
else
|
||||
var hours = msgDate.getHours();
|
||||
if (msgDate.getMinutes() < 10)
|
||||
var min = "0"+msgDate.getMinutes();
|
||||
else
|
||||
var min = msgDate.getMinutes();
|
||||
msgDate8601string += "-"+ hours.toString() + min.toString();
|
||||
}
|
||||
return msgDate8601string;
|
||||
}
|
||||
|
||||
function IETwritestatus(text) {
|
||||
document.getElementById("statusText").setAttribute("label", text);
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
|
||||
var delay = prefs.getIntPref("mboximport.delay.clean_statusbar");
|
||||
if (delay > 0)
|
||||
window.setTimeout(function(){IETdeletestatus(text);}, delay);
|
||||
}
|
||||
|
||||
function IETdeletestatus(text) {
|
||||
if (document.getElementById("statusText").getAttribute("label") == text)
|
||||
document.getElementById("statusText").setAttribute("label", "");
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
//gives the preference branch instance
|
||||
var preferenceBranch = getPref();
|
||||
|
||||
//returns the selected checkbox for searching
|
||||
function getnamesearch()
|
||||
{
|
||||
var checkboxlist = [];
|
||||
var j=0;
|
||||
var objectlist = preferenceBranch.getCharPref("object").split(',');
|
||||
if (objectlist[0]!=''){
|
||||
for (var i=1;i<=objectlist.length;i++)
|
||||
{
|
||||
if(document.getElementById('cbx'+i) && document.getElementById('cbx'+i).checked == true)
|
||||
{
|
||||
checkboxlist[j] = objectlist[i-1] //document.getElementById('cbx'+i).label;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return checkboxlist;
|
||||
}
|
||||
//function to set the text value for the selected partner for contact creation
|
||||
function selectPartner(){
|
||||
if(document.getElementById('listPartnerBox').selectedItem){
|
||||
var listselectedItem = document.getElementById('listPartnerBox').selectedItem;
|
||||
var value = listselectedItem.firstChild.getAttribute('label');
|
||||
setPartnerId(listselectedItem.value);
|
||||
document.getElementById('txtselectpartner').setAttribute('value',value);
|
||||
window.opener.document.getElementById('txtselectpartner').setAttribute('value',value);
|
||||
}
|
||||
else{
|
||||
window.opener.document.getElementById('txtselectpartner').setAttribute('value','');
|
||||
}
|
||||
}
|
||||
|
||||
//function for the intialization procedure //used while loading and unloading of the window
|
||||
var myPrefObserver =
|
||||
{
|
||||
//set the intial value of the email for the text field in plugin window and also loads the listbox of objects with image
|
||||
loaddata: function()
|
||||
{
|
||||
setTimeout("listSearchDocumentAttachment()", 0)
|
||||
},
|
||||
|
||||
//set the initial value of name and email field of create contact window
|
||||
createContact: function()
|
||||
{
|
||||
//document.getElementById("txtselectpartner").value= getPartnerName();
|
||||
document.getElementById("txtname").value= getSenderName();
|
||||
document.getElementById("txtemail").value= getSenderEmail();
|
||||
document.getElementById("country").value=getAllCountry();
|
||||
document.getElementById("state").value=getAllState();
|
||||
},
|
||||
|
||||
//sets the value of email information in preferences and adds observer for the window
|
||||
register: function()
|
||||
{
|
||||
appendDbList()
|
||||
preferenceBranch.addObserver("", myPrefObserver, false);
|
||||
document.getElementById("txturl").value = getServer();
|
||||
var s = document.getElementById('txturl').value;
|
||||
var a =s.split(':');
|
||||
setPort(a[a.length-1]);
|
||||
document.getElementById("txtusername").value = getUsername();
|
||||
document.getElementById("txtpassword").value = getPassword();
|
||||
document.getElementById("DBlist_text").value = getDbName();
|
||||
if(getPref().getCharPref("object") != ''){
|
||||
var objectlist = getPref().getCharPref("object").split(',');
|
||||
var imagelist = getPref().getCharPref("imagename").split(',');
|
||||
var obj = getPref().getCharPref("listobject").split(',');
|
||||
if(objectlist.length>0){
|
||||
for(i=0;i<objectlist.length;i++){
|
||||
var listItem = document.createElement("listitem");
|
||||
var listcell1 = document.createElement("listcell");
|
||||
var listcell2 = document.createElement("listcell");
|
||||
var listcell3 = document.createElement("listcell");
|
||||
listcell1.setAttribute("label",obj[i]);
|
||||
listcell2.setAttribute("label",objectlist[i]);
|
||||
listcell3.setAttribute("image",imagelist[i]);
|
||||
listcell3.setAttribute("class","listcell-iconic")
|
||||
listcell3.setAttribute("width",16)
|
||||
listcell3.setAttribute("height",16)
|
||||
listItem.appendChild(listcell1);
|
||||
listItem.appendChild(listcell2);
|
||||
listItem.appendChild(listcell3);
|
||||
document.getElementById("listObjectListBox").appendChild(listItem);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
createContactAddress: function()
|
||||
{
|
||||
document.getElementById("txtname").value= getPartnerName();
|
||||
document.getElementById("txtcontactname").value= getSenderName();
|
||||
document.getElementById("txtstreet").value= getStreet();
|
||||
document.getElementById("txtstreet2").value= getStreet2();
|
||||
document.getElementById("txtzip").value= getZipCode();
|
||||
document.getElementById("txtcity").value= getCity();
|
||||
// document.getElementById("txtcountry").value= getCountry();
|
||||
// document.getElementById("txtstate").value= getState();
|
||||
document.getElementById("txtoffice").value= getOfficenumber();
|
||||
document.getElementById("txtfax").value= getFax();
|
||||
document.getElementById("txtmobile").value= getMobilenumber();
|
||||
document.getElementById("txtemail").value= getSenderEmail();
|
||||
document.getElementById("country").value=getAllCountry();
|
||||
document.getElementById("state").value=getAllState();
|
||||
},
|
||||
|
||||
//unregistering the window observer
|
||||
unregister: function()
|
||||
{
|
||||
if(!preferenceBranch) return;
|
||||
preferenceBranch.removeObserver("", myPrefObserver);
|
||||
},
|
||||
|
||||
observe: function(aSubject, aTopic, aData)
|
||||
{
|
||||
if(aTopic != "nsPref:changed") return;
|
||||
// aSubject is the nsIPrefBranch we're observing (after appropriate QI)
|
||||
// aData is the name of the pref that's been changed (relative to aSubject)
|
||||
switch (aData) {
|
||||
case "serverport":
|
||||
// extensions.myextension.pref1 was changed
|
||||
break;
|
||||
case "serverurl":
|
||||
// extensions.myextension.pref2 was changed
|
||||
break;
|
||||
case "serverdbname":
|
||||
// extensions.myextension.pref2 was changed
|
||||
break;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
function runMoreCode()
|
||||
{
|
||||
}
|
|
@ -0,0 +1,253 @@
|
|||
//global array creation and declaration
|
||||
var contentType = new Array();
|
||||
var uri = new Array();
|
||||
var url = new Array();
|
||||
var name = new Array();
|
||||
var test = new Array();
|
||||
|
||||
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 searchmail()
|
||||
{
|
||||
setTimeout("createConnection()",5000)
|
||||
if (getconnect_server() == "false")
|
||||
{
|
||||
alert("Please Login To The Database First !")
|
||||
return false;
|
||||
}
|
||||
setTimeout("module_install()", 10000)
|
||||
if (getmodule_install() == "no")
|
||||
{
|
||||
alert("Please install the thunderbird module on your '" + getDbName() +"' database Or try again !");
|
||||
return false
|
||||
}
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||
var version_obj = prefService.getBranch("extensions.");
|
||||
version_obj.QueryInterface(Components.interfaces.nsIPrefBranch2);
|
||||
version = version_obj.getCharPref("lastAppVersion");
|
||||
version = parseInt(version[0])
|
||||
|
||||
file = getPredefinedFolder(2);
|
||||
|
||||
if (version > 2)
|
||||
{
|
||||
var emlsArray = gFolderDisplay.selectedMessages;
|
||||
}
|
||||
else
|
||||
{
|
||||
var emlsArray = GetSelectedMessages();
|
||||
}
|
||||
|
||||
IETtotal = emlsArray.length;
|
||||
IETexported = 0;
|
||||
var msguri = emlsArray[0];
|
||||
|
||||
if(GetNumSelectedMessages() < 1 || GetNumSelectedMessages() > 1){
|
||||
alert("You must select only one mail to archive");
|
||||
return false
|
||||
}
|
||||
|
||||
//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);
|
||||
|
||||
|
||||
if (version > 2)
|
||||
{
|
||||
m_uri = message.folder.getUriForMsg(message);
|
||||
saveMsgAsEML(m_uri,file,false,emlsArray,null);
|
||||
}
|
||||
else
|
||||
{
|
||||
saveMsgAsEML(msguri,file,false,emlsArray,null);
|
||||
}
|
||||
|
||||
//gives the received email date
|
||||
var stdate = new Date(message.date / 1000);
|
||||
|
||||
//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
|
||||
}
|
||||
|
||||
//gives the receiver email address
|
||||
receiveremail = message.mime2DecodedRecipients;
|
||||
|
||||
//parsing the received date in the particular format
|
||||
receivedDate = stdate.getFullYear()+'/'+(stdate.getMonth()+1)+'/'+stdate.getDate();
|
||||
|
||||
//gives the selected email subject
|
||||
subject = message.subject;
|
||||
|
||||
//gives the selected email cclist
|
||||
cclist = message.ccList;
|
||||
|
||||
//gives the selected email message body in text format
|
||||
if (version > 2)
|
||||
{
|
||||
var listener = Components.classes["@mozilla.org/network/sync-stream-listener;1"].createInstance(Components.interfaces.nsISyncStreamListener);
|
||||
var uri = message.folder.getUriForMsg(message);
|
||||
messenger.messageServiceFromURI(uri)
|
||||
.streamMessage(uri, listener, null, null, false, "");
|
||||
var folder = message.folder;
|
||||
messagebody = folder.getMsgTextFromStream(listener.inputStream,message.Charset,65536,32768,false,true,{})
|
||||
}
|
||||
else
|
||||
{
|
||||
messagebody = getMessageBrowser().docShell.contentViewer.DOMDocument.body.textContent;
|
||||
}
|
||||
//gives the selected email message body in html format
|
||||
msghtmlbody = ""// getMessageBrowser().docShell.contentViewer.DOMDocument.body.innerHTML;
|
||||
|
||||
//set the initial information for the selected email
|
||||
setSenderEmail(senderemail);
|
||||
setSenderName(sendername);
|
||||
setReceiverEmail(receiveremail);
|
||||
setSubject(subject);
|
||||
setReceivedDate(receivedDate);
|
||||
setCCList(cclist);
|
||||
setMessageBody(messagebody);
|
||||
getPref().setCharPref('displayName','');
|
||||
getPref().setCharPref('attachmentdata','');
|
||||
name = [];
|
||||
test = [];
|
||||
getPref().setCharPref('attachmentlength',currentAttachments.length);
|
||||
//retrieving the information for the selected email's attachment
|
||||
if(currentAttachments.length > 0){
|
||||
for(i=0;i<currentAttachments.length;i++){
|
||||
contentType[i] = currentAttachments[i].contentType;
|
||||
uri = currentAttachments[i].uri;
|
||||
url[i] = currentAttachments[i].url;
|
||||
name[i] = currentAttachments[i].displayName;
|
||||
var obj = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
|
||||
if(navigator.userAgent.indexOf('Linux')!= -1){
|
||||
obj.initWithPath("/tmp/");
|
||||
}
|
||||
else if(navigator.userAgent.indexOf('Win')!= -1){
|
||||
obj.initWithPath("c:\\");
|
||||
}
|
||||
else if(navigator.userAgent.indexOf('Mac OS X')!= -1){
|
||||
obj.initWithPath("/tmp/");
|
||||
}
|
||||
else{
|
||||
alert("Not Compatible for this Operating System");
|
||||
false();
|
||||
}
|
||||
//saving the attachment files in system's temp folder
|
||||
test[i] = messenger.saveAttachmentToFolder(contentType[i],url[i],name[i],uri,obj);
|
||||
}
|
||||
//function to read the attachment file contents
|
||||
att =getAttachValue()
|
||||
if (getmodule_install() == "no")
|
||||
{
|
||||
alert("Please install the thunderbird module on your '" + getDbName() +"' database Or try again !");
|
||||
return false
|
||||
}
|
||||
window.open("chrome://openerp_plugin/content/plugin.xul", "", "chrome, resizable=yes");
|
||||
createInstance(name,test)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getmodule_install() == "no")
|
||||
{
|
||||
alert("Please install the thunderbird module on your '" + getDbName() +"' database Or try again !");
|
||||
return false
|
||||
}
|
||||
window.open("chrome://openerp_plugin/content/plugin.xul", "", "chrome, resizable=yes");
|
||||
}
|
||||
}
|
||||
|
||||
//function to open the configuration window
|
||||
var Config = {
|
||||
onLoad: function() {
|
||||
// initialization code
|
||||
this.initialized = true;
|
||||
},
|
||||
|
||||
onMenuItemCommand: function() {
|
||||
window.open("chrome://openerp_plugin/content/config.xul", "", "chrome");
|
||||
}
|
||||
};
|
||||
window.addEventListener("load", function(e) { Config.onLoad(e); }, false);
|
||||
|
||||
//function to open the plugin window for searching the records for a particular object
|
||||
var Plugin = {
|
||||
onLoad: function() {
|
||||
this.initialized = true;
|
||||
},
|
||||
|
||||
onMenuItemCommand: function() {
|
||||
window.open("chrome://openerp_plugin/content/plugin.xul", "", "chrome, resizable=yes");
|
||||
}
|
||||
};
|
||||
window.addEventListener("load", function(e) { Plugin.onLoad(e); }, false);
|
||||
|
||||
//function to open the window for creating a new partner contact
|
||||
var Create = {
|
||||
onLoad: function(){
|
||||
this.initialized=true;
|
||||
},
|
||||
|
||||
onMenuItemCommand: function(){
|
||||
window.open("chrome://openerp_plugin/content/create.xul", "", "chrome");
|
||||
}
|
||||
};
|
||||
window.addEventListener("load", function(e) { Create.onLoad(e); }, false);
|
||||
|
||||
var Address = {
|
||||
onLoad: function(){
|
||||
this.initialized=true;
|
||||
},
|
||||
|
||||
onMenuItemCommand: function(){
|
||||
// if(GetNumSelectedMessages() < 1 || GetNumSelectedMessages() > 1){
|
||||
// alert("You must select only one mail to archive");
|
||||
//return false
|
||||
//}
|
||||
searchContact();
|
||||
window.open("chrome://openerp_plugin/content/address.xul", "", "chrome");
|
||||
}
|
||||
};
|
||||
|
||||
//function to open the window for selecting the partner for a new contact creation
|
||||
var Select = {
|
||||
onLoad: function(){
|
||||
this.initialized=true;
|
||||
},
|
||||
|
||||
onMenuItemCommand: function(){
|
||||
window.open("chrome://openerp_plugin/content/selectpartner.xul", "", "chrome");
|
||||
}
|
||||
};
|
||||
|
||||
var CreatePartner = {
|
||||
onLoad: function(){
|
||||
this.initialized=true;
|
||||
},
|
||||
|
||||
onMenuItemCommand: function(){
|
||||
window.open("chrome://openerp_plugin/content/createpartner.xul", "", "chrome");
|
||||
}
|
||||
};
|
||||
window.addEventListener("load", function(e) { CreatePartner.onLoad(e); }, false);
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<?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/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/exportTools.js"></script>
|
||||
|
||||
<menupopup id="taskPopup">
|
||||
<menuitem id="tiny-plugin" label="&tinyplugin;"
|
||||
oncommand="Config.onMenuItemCommand(event);"
|
||||
image="&menuicon.value;"
|
||||
class="menuitem-iconic"
|
||||
tooltiptext="&pluginconfig.value;"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="taskPopup">
|
||||
<menuitem id="tiny-plugin1" label="&tinypluginconfig;"
|
||||
oncommand="searchmail();"
|
||||
image="&menuicon.value;"
|
||||
class="menuitem-iconic"
|
||||
tooltiptext="&pluginconfigvalue.value;"/>
|
||||
</menupopup>
|
||||
|
||||
<popup id="threadPaneContext">
|
||||
<menuitem id="threadPaneContext-saveAsMultiple"
|
||||
insertbefore="threadPaneContext-print"
|
||||
class="menuitem-iconic"
|
||||
image="&menuicon.value;"
|
||||
label="Archive To OpenERP"
|
||||
accesskey="T"
|
||||
oncommand="searchmail();"/>
|
||||
</popup>
|
||||
|
||||
<toolbarpalette id="MailToolbarPalette">
|
||||
<toolbarbutton id="GA-button"
|
||||
class="toolbarbutton-1"
|
||||
image="&menuicon.value;"
|
||||
label= "Archive To OpenERP"
|
||||
oncommand="searchmail();" />
|
||||
</toolbarpalette>
|
||||
|
||||
<toolbarpalette id="MailToolbarPalette">
|
||||
<toolbarbutton id="GA-button1"
|
||||
class="toolbarbutton-1"
|
||||
image="&partnericon.value;"
|
||||
label= "Open Contact"
|
||||
oncommand="Address.onMenuItemCommand(event);" />
|
||||
</toolbarpalette>
|
||||
|
||||
<toolbarpalette id="MailToolbarPalette">
|
||||
<toolbarbutton id="GA-button2"
|
||||
class="toolbarbutton-1"
|
||||
image="&imagearchive.value;"
|
||||
label= "Open Document"
|
||||
oncommand="archivemail();" />
|
||||
</toolbarpalette>
|
||||
|
||||
|
||||
</overlay>
|
|
@ -0,0 +1,90 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://openerp_plugin/skin/line.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="myPrefObserver.loaddata()" height="480" width="1000">
|
||||
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/static.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/exportTools.js"></script>
|
||||
<description></description>
|
||||
<hbox id="root">
|
||||
<vbox width="400">
|
||||
<groupbox height="30" id="existsobjectgroup" width="400">
|
||||
<caption label="&gptinydoc.label;" />
|
||||
<hbox>
|
||||
<label id="lblsearch" control="txtvalueobj" value="&search.label;"/>
|
||||
<textbox id="txtvalueobj" size="30"/>
|
||||
<!-- <button label="&bsearch.label;" oncommand="searchCheckbox()" image="&imagesearch.value;" accesskey="s"/> -->
|
||||
</hbox>
|
||||
<vbox align="left" id="checkbox-dynamic">
|
||||
</vbox>
|
||||
<hbox align="center">
|
||||
<image src='chrome://openerp_plugin/skin/perform.gif'/>
|
||||
<checkbox id="cbxselectall" oncommand="selectAllCheckbox();" label="&cbxselectall.label;" checked="false"/>
|
||||
<spacer width="10"/>
|
||||
<button label="&bsearch.label;" oncommand="searchCheckbox()" image="&imagesearch.value;" accesskey="s"/>
|
||||
</hbox>
|
||||
|
||||
<listbox height="250" id="listSearchBox" >
|
||||
<listhead >
|
||||
<listheader label="&listSearchBox.header;"/>
|
||||
</listhead>
|
||||
<listcols>
|
||||
<listcol flex="1"/>
|
||||
</listcols>
|
||||
</listbox>
|
||||
<hbox>
|
||||
<spacer width="360"/>
|
||||
<button label="&attach.label;" accesskey="u" image="&imagearchive.value;" oncommand="attachmentWidnowOpen('upload');"/>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
</vbox>
|
||||
<vbox>
|
||||
<groupbox id="newobjectgroup" align="center" width="170" height="375">
|
||||
<caption label="&newdocument.label;" />
|
||||
<hbox>
|
||||
<label id="lblex" value=" "/>
|
||||
<label id="lblex3" control="section" value="&document.label;"/>
|
||||
<menulist id="section" width="150">
|
||||
<menupopup>
|
||||
<menuitem label="" value=""/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<vbox>
|
||||
<button width="50" label="&archive.label;" accesskey="c" image="&imagearchive.value;" oncommand="attachmentWidnowOpen('create');"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
<label id="lblsection" value=" "/>
|
||||
<separator class="groove-thin" orient="horizontal" width="180"/>
|
||||
|
||||
<tabpanels>
|
||||
<tabpanel id="contact">
|
||||
<hbox>
|
||||
<label id="lblsection" control="section" value="&partner.label;"/>
|
||||
<vbox>
|
||||
<button label="&create.label;" accesskey="r" image="&imagecreate.value;" oncommand="Create.onMenuItemCommand(event);"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
|
||||
</groupbox>
|
||||
<hbox align="center">
|
||||
<spacer flex="1"/>
|
||||
<button label="&close.label;" accesskey="l" image="&imagecancel.value;" oncommand="win_close();"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<vbox width="220">
|
||||
|
||||
</vbox>
|
||||
|
||||
</window>
|
|
@ -0,0 +1,35 @@
|
|||
<?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 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/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/loaddata.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/static.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/overlay.js"></script>
|
||||
<groupbox id="gpPartner">
|
||||
<hbox>
|
||||
<textbox id="txtselectpartner"/>
|
||||
<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>
|
||||
<button label="Create Partner" image="&imagecreate.value;" oncommand="CreatePartner.onMenuItemCommand(event);"/>
|
||||
<spacer width="45"/>
|
||||
<button label="&cancel.label;" image="&imagecancel.value;" oncommand="close();" />
|
||||
<button label="&select.label;" image="&imageok.value;" oncommand="selectPartner();close()"/>
|
||||
</hbox>
|
||||
|
||||
</window>
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
//function to check all the checkbox
|
||||
function selectAllCheckbox()
|
||||
{
|
||||
var objectlist = preferenceBranch.getCharPref("object").split(',');
|
||||
if(objectlist.length == 1 && objectlist[0]==''){
|
||||
return false;
|
||||
}
|
||||
for (var i=1;i<=objectlist.length;i++)
|
||||
{
|
||||
var checkboxobj = document.getElementById('cbx'+i);
|
||||
if (!checkboxobj)
|
||||
continue
|
||||
if(document.getElementById('cbxselectall').checked == true)
|
||||
checkboxobj.checked = true;
|
||||
else
|
||||
checkboxobj.checked = false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<!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 communication.value "Communication:">
|
||||
<!ENTITY postaladdress.value "Postal Address:">
|
||||
<!ENTITY ok.label "Save">
|
||||
<!ENTITY cancel.label "Cancel">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
|
||||
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
|
|
@ -0,0 +1,49 @@
|
|||
<!ENTITY title.label "OpenERP & Thunderbird Integration!">
|
||||
<!ENTITY separate.label "Configuration Login for OpenERP!">
|
||||
<!ENTITY close.label "Cancel">
|
||||
<!ENTITY database.label "Database: ">
|
||||
<!ENTITY ok.label "OK">
|
||||
<!ENTITY connection.label "Test Connection">
|
||||
<!ENTITY txturl.label "Server: ">
|
||||
<!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 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_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 "About Plugin">
|
||||
<!ENTITY develop.value "This Thunderbird Plug-in for OpenERP has been developed by OpenERP SA & 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 lblservices.label "Protocol Connection: ">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
|
||||
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
|
||||
|
|
@ -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 "Cancel">
|
||||
<!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 "Cancel">
|
||||
<!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,7 @@
|
|||
<!ENTITY title.label "Create a new Partner">
|
||||
<!ENTITY name.value "Name:">
|
||||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
|
||||
<!ENTITY ok.label "Save">
|
||||
<!ENTITY cancel.label "Cancel">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
|
||||
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
|
|
@ -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,11 @@
|
|||
<!ENTITY tinyplugin "OpenERP Configuration">
|
||||
<!ENTITY tinypluginconfig "Archieve To OpenERP">
|
||||
<!ENTITY tinyarchive "Archive to OpenERP">
|
||||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
|
||||
<!ENTITY menuicon.value "chrome://openerp_plugin/skin/NEWT.png">
|
||||
<!ENTITY partnericon.value "chrome://openerp_plugin/skin/Partner.png">
|
||||
<!ENTITY imagearchive.value "chrome://openerp_plugin/skin/Archive.png">
|
||||
<!ENTITY tooltip.value "Add To Archive">
|
||||
<!ENTITY pluginconfig.value "OpenERP Configuration Settings">
|
||||
<!ENTITY pluginconfigvalue.value "Archieve To OpenERP Settings">
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
<!ENTITY title.label "Archieve To OpenERP">
|
||||
<!ENTITY gptinydoc.label "Link to an Existing Document">
|
||||
<!ENTITY newdocument.label "New Documents">
|
||||
<!ENTITY bsearch.label "Search">
|
||||
<!ENTITY close.label "Close">
|
||||
<!ENTITY attach.label "Upload to OpenERP">
|
||||
<!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 document.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">
|
|
@ -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 "Cancel">
|
||||
<!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: 897 B |
After Width: | Height: | Size: 852 B |
After Width: | Height: | Size: 816 B |
After Width: | Height: | Size: 703 B |
After Width: | Height: | Size: 888 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 852 B |
After Width: | Height: | Size: 155 B |
After Width: | Height: | Size: 352 B |
After Width: | Height: | Size: 363 B |
After Width: | Height: | Size: 789 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 790 B |
After Width: | Height: | Size: 796 B |
After Width: | Height: | Size: 823 B |
After Width: | Height: | Size: 802 B |
After Width: | Height: | Size: 582 B |
After Width: | Height: | Size: 604 B |
After Width: | Height: | Size: 867 B |
After Width: | Height: | Size: 11 KiB |
|
@ -0,0 +1,3 @@
|
|||
menuitem#tiny-plugin {
|
||||
color: red !important;
|
||||
}
|
After Width: | Height: | Size: 89 B |
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,56 @@
|
|||
|
||||
pref("extensions.tiny.serverurl", "http://localhost");
|
||||
pref("extensions.tiny.serverport", "8069");
|
||||
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.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,Partner Address,Accout Invoice,Project,Product,Account,Sale Order,Project Task");
|
||||
pref("extensions.tiny.object","res.partner,res.partner.address,account.invoice,project.project,product.product,account.account,sale.order,project.task");
|
||||
pref("extensions.tiny.imagename","chrome://openerp_plugin/skin/Partner.png,chrome://openerp_plugin/skin/Contact.png,chrome://openerp_plugin/skin/Invoice.png,chrome://openerp_plugin/skin/Project.png,chrome://openerp_plugin/skin/Product.png,chrome://openerp_plugin/skin/Account.png,chrome://openerp_plugin/skin/Sale.png,chrome://openerp_plugin/skin/Case.png,chrome://openerp_plugin/skin/Task.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");
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
// constants
|
||||
const APP_DISPLAY_NAME = "OpenERP Plugins";
|
||||
const APP_NAME = "OpenERP";
|
||||
const APP_VERSION = "1.0";
|
||||
const WARNING = "WARNING: You need administrator privileges to install OpenERP 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 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>{d57f315a-9f5d-4366-a530-a769a4a8c949}</em:id>
|
||||
<em:iconURL>chrome://openerp_plugin/skin/tinyerp-icon.ico</em:iconURL>
|
||||
<em:name>OpenERP Plugin for Thunderbird 2.0</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>3.0.*</em:maxVersion>
|
||||
</Description>
|
||||
</em:targetApplication>
|
||||
</Description>
|
||||
</RDF>
|
|
@ -1,2 +1,2 @@
|
|||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_tinythunderbird_partner","tinythunderbird.partner","model_tinythunderbird_partner",,1,1,1,1
|
||||
|
||||
|
|
|