commit
dcf77a6d49
|
@ -136,8 +136,8 @@ class mailgate_thread(osv.osv):
|
|||
'partner_id': partner_id,
|
||||
'res_id': case.id,
|
||||
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'message_id': message_id,
|
||||
'description': details or (hasattr(case, 'description') and case.description or False),
|
||||
'message_id': message_id,
|
||||
'description': details or (hasattr(case, 'description') and case.description or False),
|
||||
'attachment_ids': [(6, 0, attachments)]
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ class mailgate_tool(osv.osv_memory):
|
|||
'description': msg.get('body', msg.get('from')),
|
||||
'history': True,
|
||||
'partner_id': partner_id,
|
||||
'res_model': model,
|
||||
'model': model,
|
||||
'email_cc': msg.get('cc'),
|
||||
'email_from': msg.get('from'),
|
||||
'email_to': msg.get('to'),
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
<group colspan="4" col="6">
|
||||
<field name="name" string="Subject" required="1" select="1" widget="char" size="512"/>
|
||||
<field name="date" required="1" select="1"/>
|
||||
<field name="user_id" string="Responsible" select="1"/>
|
||||
<field name="user_id" string="Owner" select="1"/>
|
||||
<field name="partner_id" readonly="1" />
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Email Details" colspan="4"/>
|
||||
<separator string="Email Followers" colspan="4"/>
|
||||
<field name="email_from" />
|
||||
<field name="email_to" widget="char" size="512"/>
|
||||
<field name="email_cc" widget="char" size="512"/>
|
||||
|
@ -50,7 +50,9 @@
|
|||
<field name="date" />
|
||||
<field name="name" string="Subject"/>
|
||||
<field name="email_from" string="From"/>
|
||||
<field name="user_id" string="Responsible"/>
|
||||
<field name="user_id" string="Owner"/>
|
||||
<field name="message_id" string="Message" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -63,13 +65,21 @@
|
|||
<search string="Email Search">
|
||||
<field name="name" string="Subject"/>
|
||||
<field name="date" />
|
||||
<field name="user_id" />
|
||||
<field name="message_id" />
|
||||
<field name="user_id" string="Owner" default="uid"/>
|
||||
<field name="description" />
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." groups="base.group_extended">
|
||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<filter string="Owner" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Thread" icon="terp-mail-" domain="[]" context="{'group_by':'message_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Month" help="Creation Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_mailgate_thread_form">
|
||||
<field name="name">mailgate.thread.form</field>
|
||||
<field name="model">mailgate.thread</field>
|
||||
|
@ -127,8 +137,9 @@
|
|||
<field name="view_type">form</field>
|
||||
<field name="domain">[('history', '=', True)]</field>
|
||||
<field name="view_id" ref="view_mailgate_message_tree"/>
|
||||
<field name="context">{"search_default_user_id":uid}</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_view_mailgate_thread">
|
||||
<field name="name">Mailgateway Threads</field>
|
||||
<field name="res_model">mailgate.thread</field>
|
||||
|
@ -149,7 +160,7 @@
|
|||
<field name="view_id" ref="view_mailgate_thread_form"/>
|
||||
<field name="act_window_id" ref="action_view_mailgate_thread"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Emailsaction-->
|
||||
<record model="ir.actions.act_window" id="action_view_mailgate_message">
|
||||
<field name="name">Emails</field>
|
||||
|
@ -159,7 +170,7 @@
|
|||
<field name="domain">[('history', '=', True)]</field>
|
||||
<field name="view_id" ref="view_mailgate_message_tree"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view1">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
|
@ -173,10 +184,6 @@
|
|||
<field name="act_window_id" ref="action_view_mailgate_thread"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="base.menu_base_config_mail" name="Mail" parent="base.menu_base_config" sequence="4"/>
|
||||
<menuitem id="menu_mailgate_message" name="Emails" action="action_view_mailgate_message"
|
||||
parent="base.menu_base_config_mail" sequence="5" groups="base.group_system"/>
|
||||
|
||||
<act_window domain="[('partner_id', '=', active_id), ('history', '=', True)]"
|
||||
id="act_res_partner_emails" name="Emails"
|
||||
res_model="mailgate.message"
|
||||
|
@ -184,5 +191,16 @@
|
|||
view_id="view_mailgate_message_tree"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<menuitem name="Emails" id="menu_base_config_mail"
|
||||
parent="base.menu_base_partner" sequence="5" />
|
||||
|
||||
<menuitem name="Emails" id="menu_mailgate_message"
|
||||
parent="menu_base_config_mail"
|
||||
action="mail_gateway.action_view_mailgate_message"
|
||||
/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -31,8 +31,7 @@ class outlook_installer(osv.osv_memory):
|
|||
|
||||
def default_get(self, cr, uid, fields, context={}):
|
||||
data = super(outlook_installer, self).default_get(cr, uid, fields, context)
|
||||
doc_file = open(config['addons_path'] + "/outlook/doc/Installation Guide to OpenERP Outlook Plug-in.doc", 'r')
|
||||
data['doc_file'] = base64.encodestring(doc_file.read())
|
||||
data['doc_file'] = 'http://doc.openerp.com/book/2/2_6_Comms/2_6_Comms_outlook.html'
|
||||
file = open(config['addons_path'] + "/outlook/plugin/openerp-outlook-plugin.zip", 'r')
|
||||
data['plugin_file'] = base64.encodestring(file.read())
|
||||
return data
|
||||
|
@ -42,7 +41,7 @@ class outlook_installer(osv.osv_memory):
|
|||
'doc_name':fields.char('File name', size=64),
|
||||
'outlook':fields.boolean('Outlook Plug-in ', help="Allows you to select an object that you’d like to add to your email and its attachments."),
|
||||
'plugin_file':fields.binary('Outlook Plug-in', readonly=True, help="outlook plug-in file. Save as this file and install this plug-in in outlook."),
|
||||
'doc_file':fields.binary('Installation Manual', help="The documentation file :- how to install Outlook Plug-in.", readonly=True),
|
||||
'doc_file':fields.char('Installation Manual',size="264",help="The documentation file :- how to install Outlook Plug-in.", readonly=True),
|
||||
'description':fields.text('Description', readonly=True)
|
||||
}
|
||||
|
||||
|
@ -63,7 +62,7 @@ How to install openerp-outlook plug-in?
|
|||
3. Run “Register-plugin.bat” file.
|
||||
4. Run Outlook and Check addon has been registered.
|
||||
5. Tools->OpenERP Configuration and test your connection.
|
||||
6. See User Guide for more information.
|
||||
6. See User Guide for more information.
|
||||
7. Keep All extratced files in some safe places
|
||||
(e.g. python installation Directory "C:\pythonXX\" or Windows installation Directory "C:\Program Files\" ).
|
||||
"""
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<newline/>
|
||||
<field name="plugin_file" filename="name"/>
|
||||
<newline/>
|
||||
<field name="doc_file" filename="doc_name"/>
|
||||
<field name="doc_file" filename="doc_name" widget="url"/>
|
||||
<newline/>
|
||||
<separator string="Installation and Configuration Steps" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="8"/>
|
||||
|
@ -74,20 +74,15 @@
|
|||
<field name="context">{'menu':True}</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="base.menu_base_config_mail"
|
||||
name="Mail"
|
||||
parent="base.menu_base_config"
|
||||
sequence="10"/>
|
||||
|
||||
<menuitem id="base.menu_base_config_plugins"
|
||||
name="Plugins"
|
||||
parent="base.menu_base_config_mail"
|
||||
<menuitem id="base.menu_base_config_plugins"
|
||||
name="Plugins"
|
||||
parent="base.menu_base_config"
|
||||
sequence="10" />
|
||||
|
||||
<menuitem id="menu_base_config_plugins_outlook"
|
||||
action="action_outlook_wizard"
|
||||
name="Outlook Plug-In"
|
||||
parent="base.menu_base_config_plugins"
|
||||
|
||||
<menuitem id="menu_base_config_plugins_outlook"
|
||||
action="action_outlook_wizard"
|
||||
name="Outlook Plug-In"
|
||||
parent="base.menu_base_config_plugins"
|
||||
sequence="10" />
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -86,7 +86,7 @@ EXSTYLE WS_EX_CONTEXTHELP
|
|||
CAPTION "About"
|
||||
FONT 8, "Tahoma", 400, 0, 0x0
|
||||
BEGIN
|
||||
GROUPBOX "About Plugin",IDC_STATIC,7,3,422,200
|
||||
GROUPBOX "About OpenERP Outlook Plugin",IDC_STATIC,7,3,422,200
|
||||
CONTROL 1062,IDB_OPENERPLOGO,"Static",SS_BITMAP | SS_REALSIZEIMAGE,60,30,20,20
|
||||
LTEXT "",IDC_ABOUT,80,90,250,100
|
||||
END
|
||||
|
|
|
@ -25,6 +25,7 @@ from tools import config
|
|||
|
||||
import base64
|
||||
import addons
|
||||
import difflib
|
||||
|
||||
class thunderbird_installer(osv.osv_memory):
|
||||
_name = 'thunderbird.installer'
|
||||
|
@ -32,8 +33,7 @@ class thunderbird_installer(osv.osv_memory):
|
|||
|
||||
def default_get(self, cr, uid, fields, context={}):
|
||||
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())
|
||||
data['pdf_file'] = 'http://doc.openerp.com/book/2/2_6_Comms/2_6_Comms_thunderbird.html'
|
||||
file = open(addons.get_module_resource('thunderbird','plugin', 'openerp_plugin.xpi'),'rb')
|
||||
data['plugin_file'] = base64.encodestring(file.read())
|
||||
return data
|
||||
|
@ -43,14 +43,13 @@ class thunderbird_installer(osv.osv_memory):
|
|||
'pdf_name':fields.char('File name', size=64),
|
||||
'thunderbird':fields.boolean('Thunderbird Plug-in', help="Allows you to select an object that you’d like to add to your email and its attachments."),
|
||||
'plugin_file':fields.binary('Thunderbird Plug-in', readonly=True, help="Thunderbird plug-in file. Save as this file and install this plug-in in thunderbird."),
|
||||
'pdf_file':fields.binary('Installation Manual', help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True),
|
||||
'pdf_file':fields.char('Installation Manual', size="264", help="The documentation file :- how to install Thunderbird Plug-in.", readonly=True),
|
||||
'description':fields.text('Description', readonly=True)
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'thunderbird' : True,
|
||||
'name' : 'openerp_plugin.xpi',
|
||||
'pdf_name' : 'Installation Guide to OpenERP Thunderbid Plug-in.pdf',
|
||||
'description' : """
|
||||
* Save the Thunderbird plug-in.
|
||||
* Follow these steps to install Thunderbird plug-in.
|
||||
|
|
|
@ -30,7 +30,7 @@ import tools
|
|||
import binascii
|
||||
class email_server_tools(osv.osv_memory):
|
||||
_inherit = "email.server.tools"
|
||||
def history_message(self, cr, uid, model, res_id, message):
|
||||
def history_message(self, cr, uid, model, res_id, message, context=None):
|
||||
#@param message: string of mail which is read from EML File
|
||||
attachment_pool = self.pool.get('ir.attachment')
|
||||
msg = self.parse_message(message)
|
||||
|
@ -49,7 +49,7 @@ class email_server_tools(osv.osv_memory):
|
|||
return self.history(cr, uid, model, res_id, msg, att_ids)
|
||||
|
||||
def parse_message(self, message):
|
||||
#TOCHECK: put this function in mailgateway
|
||||
#TOCHECK: put this function in mailgateway module
|
||||
msg_txt = email.message_from_string(message)
|
||||
message_id = msg_txt.get('message-id', False)
|
||||
msg = {}
|
||||
|
@ -152,67 +152,78 @@ class thunderbird_partner(osv.osv_memory):
|
|||
dictcreate = dict(vals)
|
||||
ref_ids = str(dictcreate.get('ref_ids')).split(';')
|
||||
msg = dictcreate.get('message')
|
||||
msg = self.pool.get('email.server.tools').parse_message(msg)
|
||||
server_tools_pool = self.pool.get('email.server.tools')
|
||||
message_id = msg.get('message-id', False)
|
||||
msg_pool = self.pool.get('mailgate.message')
|
||||
msg_ids = msg_pool.search(cr, uid, [('message_id','=',message_id)])
|
||||
res = {}
|
||||
res_ids = []
|
||||
if msg_ids and len(msg_ids):
|
||||
return 0
|
||||
|
||||
for ref_id in ref_ids:
|
||||
msg_new = dictcreate.get('message')
|
||||
ref = ref_id.split(',')
|
||||
model = ref[0]
|
||||
res_id = int(ref[1])
|
||||
server_tools_pool.history_message(cr, uid, model, res_id, msg)
|
||||
return True
|
||||
model_obj = self.pool.get(model)
|
||||
model_data = model_obj.search(cr, uid,[('name', 'ilike', ref[1])])
|
||||
if model_data:
|
||||
res_id = int(model_data[0])
|
||||
server_tools_pool.history_message(cr, uid, model, res_id, msg_new)
|
||||
res_ids.append(res_id)
|
||||
return len(res_ids)
|
||||
|
||||
def process_email(self,cr,uid,vals):
|
||||
def process_email(self, cr, uid, vals):
|
||||
dictcreate = dict(vals)
|
||||
model = str(dictcreate.get('model'))
|
||||
message = dictcreate.get('message')
|
||||
return self.pool.get('email.server.tools').process_email(cr, uid, model, message, attach=True, context=None)
|
||||
|
||||
def search_contact(self, cr, user, vals):
|
||||
address_obj = self.pool.get('res.partner.address')
|
||||
partner = address_obj.search(cr, user,[('email','=',vals)])
|
||||
def search_contact(self, cr, user, email):
|
||||
address_pool = self.pool.get('res.partner.address')
|
||||
address_ids = address_pool.search(cr, user, [('email','=',email)])
|
||||
res = {}
|
||||
res1 = {}
|
||||
|
||||
if not partner:
|
||||
res1 = {
|
||||
'email': '',
|
||||
}
|
||||
return res1.items()
|
||||
|
||||
if partner:
|
||||
partner=partner[0]
|
||||
data = address_obj.read(cr,user, partner)
|
||||
if not address_ids:
|
||||
res = {
|
||||
'partner_name': data['partner_id'] and data['partner_id'][1] or '',
|
||||
'contactname': data['name'] or '',
|
||||
'street': data['street'] or '',
|
||||
'street2': data['street2'] or '',
|
||||
'zip': data['zip'] or '',
|
||||
'city': data['city'] or '',
|
||||
'country': data['country_id'] and data['country_id'][1] or '',
|
||||
'state': data['state_id'] and data['state_id'][1] or '',
|
||||
'email': data['email'] or '',
|
||||
'phone': data['phone'] or '',
|
||||
'mobile': data['mobile'] or '',
|
||||
'fax': data['fax'] or '',
|
||||
'res_id': str(partner),
|
||||
'email': '',
|
||||
}
|
||||
else:
|
||||
address_id = address_ids[0]
|
||||
address = address_pool.browse(cr, user, address_id)
|
||||
res = {
|
||||
'partner_name': address.partner_id and address.partner_id.name or '',
|
||||
'contactname': address.name,
|
||||
'street': address.street or '',
|
||||
'street2': address.street2 or '',
|
||||
'zip': address.zip or '',
|
||||
'city': address.city or '',
|
||||
'country': address.country_id and address.country_id.name or '',
|
||||
'state': address.state_id and address.state_id.name or '',
|
||||
'email': address.email or '',
|
||||
'phone': address.phone or '',
|
||||
'mobile': address.mobile or '',
|
||||
'fax': address.fax or '',
|
||||
'partner_id': address.partner_id and str(address.partner_id.id) or '',
|
||||
'res_id': str(address.id),
|
||||
}
|
||||
return res.items()
|
||||
|
||||
def update_contact(self,cr,user,vals):
|
||||
def update_contact(self, cr, user, vals):
|
||||
dictcreate = dict(vals)
|
||||
res_id = dictcreate.get('res_id',False)
|
||||
result={}
|
||||
|
||||
if not (dictcreate.get('partner_id')):
|
||||
result = {}
|
||||
address_pool = self.pool.get('res.partner.address')
|
||||
if not (dictcreate.get('partner_id')): # TOCHECK: It should be check res_id or not
|
||||
dictcreate.update({'partner_id': False})
|
||||
create_id = self.pool.get('res.partner.address').create(cr, user, dictcreate)
|
||||
create_id = address_pool.create(cr, user, dictcreate)
|
||||
return create_id
|
||||
|
||||
if res_id:
|
||||
address_obj = self.pool.get('res.partner.address')
|
||||
address_data = address_obj.read(cr, user, int(res_id), [])
|
||||
address_data = address_pool.read(cr, user, int(res_id), [])
|
||||
result = {
|
||||
'partner_id': address_data['partner_id'] and address_data['partner_id'][0] or False,
|
||||
'partner_id': address_data['partner_id'] and address_data['partner_id'][0] or False, #TOFIX: parter_id should take from address_data
|
||||
'country_id': dictcreate['country_id'] and int(dictcreate['country_id'][0]) or False,
|
||||
'state_id': dictcreate['state_id'] and int(dictcreate['state_id'][0]) or False,
|
||||
'name': dictcreate['name'],
|
||||
|
@ -225,7 +236,7 @@ class thunderbird_partner(osv.osv_memory):
|
|||
'mobile': dictcreate['mobile'],
|
||||
'email': dictcreate['email'],
|
||||
}
|
||||
address_obj.write(cr, user,int(res_id),result )
|
||||
address_pool.write(cr, user, int(res_id), result )
|
||||
return True
|
||||
|
||||
def create_partner(self,cr,user,vals):
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -26,7 +26,6 @@
|
|||
<textbox id="txtselectpartner" align="right" width="270" readonly="true"/>
|
||||
<spacer width="5"/>
|
||||
<button label="New Partner" image="&imagecreate.value;" oncommand="CreatePartner.onMenuItemCommand(event);" width="133"/>
|
||||
<button label="Search Partner" image="&imagesearch.value;" oncommand="Select.onMenuItemCommand(event);getPartnerList();" width="128"/>
|
||||
</hbox>
|
||||
<separator class="groove-thin" orient="horizontal" width="94"/>
|
||||
</groupbox>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
</groupbox>
|
||||
<hbox align="right">
|
||||
<button label="Cancel" image="&imagecancel.value;" oncommand="config_close();" />
|
||||
<button label="Close" image="&imagecancel.value;" oncommand="config_close();" />
|
||||
<button label="OK" image="&imageok.value;" oncommand="config_ok()"/>
|
||||
</hbox>
|
||||
|
||||
|
|
|
@ -14,8 +14,9 @@
|
|||
<separator class="groove-thin" orient="horizontal" width="94"/>
|
||||
<hbox>
|
||||
<label align="right" id="partner" value="&selectpartner.value;" width="97" />
|
||||
<textbox id="txtselectpartner" readonly="true" value="" width="270"/>
|
||||
<button label="&bsearch.label;" oncommand="Select.onMenuItemCommand(event);" image="&imagesearch.value;"/>
|
||||
<textbox id="txtselectpartner" readonly="true" value="" width="270"/>
|
||||
<button label="&bsearch.label;" oncommand="Select.onMenuItemCommand(event);" image="&imagesearch.value;"/>
|
||||
<button label="Create Partner" image="&imagecreate.value;" oncommand="CreatePartner.onMenuItemCommand(event);"/>
|
||||
</hbox>
|
||||
<hbox>
|
||||
<label align="right" id="name" value="&name.value;" width="80" />
|
||||
|
|
|
@ -33,6 +33,7 @@ function selectPartner(){
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//function for the intialization procedure //used while loading and unloading of the window
|
||||
var myPrefObserver =
|
||||
{
|
||||
|
|
|
@ -10,9 +10,9 @@ var MBstrBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].
|
|||
var mboximportbundle = MBstrBundleService.createBundle("chrome://mboximport/locale/mboximport.properties");
|
||||
//function to get the required details of the selected email
|
||||
|
||||
function searchmail()
|
||||
{
|
||||
setTimeout("createConnection()",5000)
|
||||
function check()
|
||||
{
|
||||
setTimeout("createConnection()",5000)
|
||||
if (getconnect_server() == "false")
|
||||
{
|
||||
alert("Please Login To The Database First !")
|
||||
|
@ -24,7 +24,20 @@ function searchmail()
|
|||
alert("Please install the thunderbird module on your '" + getDbName() +"' database and try again !");
|
||||
return false
|
||||
}
|
||||
var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
|
||||
if(GetNumSelectedMessages() < 1 || GetNumSelectedMessages() > 1){
|
||||
alert("You must select only one mail to archive");
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
function searchmail()
|
||||
{
|
||||
if (check() == false){
|
||||
return true
|
||||
}
|
||||
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");
|
||||
|
@ -45,11 +58,7 @@ function searchmail()
|
|||
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;
|
||||
|
||||
|
@ -83,10 +92,10 @@ function searchmail()
|
|||
sendername = message.author;
|
||||
}
|
||||
if(message.author.indexOf('<')!=-1){
|
||||
senderemail = message.author.split('<')[1].split('>')[0];
|
||||
senderemail = message.author.split('<')[1].split('>')[0];
|
||||
}
|
||||
else{
|
||||
senderemail = message.author
|
||||
senderemail = message.author
|
||||
}
|
||||
|
||||
//gives the receiver email address
|
||||
|
@ -157,46 +166,106 @@ function searchmail()
|
|||
}
|
||||
//function to read the attachment file contents
|
||||
att =getAttachValue()
|
||||
if (getmodule_install() == "no")
|
||||
{
|
||||
alert("Please install the thunderbird module on your '" + getDbName() +"' database and 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 and try again !");
|
||||
return false
|
||||
}
|
||||
window.open("chrome://openerp_plugin/content/plugin.xul", "", "chrome, resizable=yes");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function open_contact()
|
||||
{
|
||||
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 and try again !");
|
||||
return false
|
||||
}
|
||||
if(GetNumSelectedMessages() < 1 || GetNumSelectedMessages() > 1){
|
||||
alert("You must select only one mail For Open Contact Detail");
|
||||
return false
|
||||
var openPartnerHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
// var sendername = getSenderEmail();
|
||||
var arrIdList = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
||||
var count = arrIdList.Count();
|
||||
for (i = 0; i < count; i++) {
|
||||
var strlResult = arrIdList.QueryElementAt(i, Components.interfaces.nsISupportsArray);
|
||||
var strlSearchResult = strlResult.QueryElementAt(0, Components.interfaces.nsISupportsCString);
|
||||
var strlSearchResultValue = strlResult.QueryElementAt(1, Components.interfaces.nsISupportsCString);
|
||||
if(strlSearchResult=="email" && strlSearchResultValue=='')
|
||||
{
|
||||
alert("Partner is not Available.");
|
||||
return;
|
||||
}
|
||||
if(strlSearchResult=="partner_id"){
|
||||
partner_id = strlSearchResultValue;
|
||||
weburl = getWebServerURL();
|
||||
var branchobj = getPref();
|
||||
db_name = branchobj.getCharPref("serverdbname");
|
||||
if (weburl == false){
|
||||
weburl = 'http://localhost:8080'
|
||||
}
|
||||
if (partner_id > 0){
|
||||
window.open(weburl + "/model=res.partner&id=" + partner_id)
|
||||
}
|
||||
else{
|
||||
alert("Partner is not Available.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function searchPartner(email)
|
||||
{
|
||||
var branchobj = getPref();
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
arrFinalList = [];
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
var strDbName = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strDbName.data = branchobj.getCharPref("serverdbname");
|
||||
var struid = xmlRpcClient.createType(xmlRpcClient.INT,{});
|
||||
struid.data = branchobj.getIntPref('userid');
|
||||
var strpass = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strpass.data = branchobj.getCharPref("password");
|
||||
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strobj.data = 'thunderbird.partner';
|
||||
var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strmethod.data = 'search_contact';
|
||||
var strname = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strname.data = email;
|
||||
xmlRpcClient.asyncCall(openPartnerHandler,null,'execute',[ strDbName,struid,strpass,strobj,strmethod,strname ],6);
|
||||
}
|
||||
function open_partner()
|
||||
{
|
||||
if (check() == false){
|
||||
return true
|
||||
}
|
||||
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];
|
||||
|
||||
|
||||
//gives the selected email uri
|
||||
var messageUri= gDBView.URIForFirstSelectedMessage;
|
||||
|
||||
|
@ -210,39 +279,156 @@ function open_contact()
|
|||
sendername = message.author.split('"')[1].split('"')[0];
|
||||
}
|
||||
else if(message.author.indexOf('<')!=-1){
|
||||
sendername = message.author.split('<')[0];
|
||||
sendername = message.author.split('<')[0];
|
||||
}
|
||||
else{
|
||||
sendername = message.author;
|
||||
sendername = message.author;
|
||||
}
|
||||
if(message.author.indexOf('<')!=-1){
|
||||
senderemail = message.author.split('<')[1].split('>')[0];
|
||||
senderemail = message.author.split('<')[1].split('>')[0];
|
||||
}
|
||||
else{
|
||||
senderemail = message.author
|
||||
senderemail = message.author
|
||||
}
|
||||
searchPartner(senderemail);
|
||||
}
|
||||
var listDocumentHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var res = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
||||
res_id = res.QueryElementAt(1, Components.interfaces.nsISupportsPRInt32);
|
||||
model = res.QueryElementAt(0, Components.interfaces.nsISupportsCString);
|
||||
weburl = getWebServerURL()
|
||||
if (weburl == false){
|
||||
weburl = 'http://localhost:8080'
|
||||
}
|
||||
var branchobj = getPref();
|
||||
db_name = branchobj.getCharPref("serverdbname");
|
||||
window.open(weburl + "/model=" + model +"&id=" + res_id)
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
|
||||
//set the initial information for the selected email
|
||||
setSenderEmail(senderemail);
|
||||
setSenderName(sendername);
|
||||
setPartnerName("");
|
||||
setStreet("");
|
||||
setStreet2("");
|
||||
setZipCode("");
|
||||
setCity("");
|
||||
setOfficenumber("");
|
||||
setFax("");
|
||||
setMobilenumber("");
|
||||
|
||||
if (getmodule_install() == "no")
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
|
||||
}
|
||||
}
|
||||
function open_document()
|
||||
{
|
||||
if (check() == false){
|
||||
return true
|
||||
}
|
||||
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)
|
||||
{
|
||||
alert("Please install the thunderbird module on your '" + getDbName() +"' database and try again !");
|
||||
return false
|
||||
var emlsArray = gFolderDisplay.selectedMessages;
|
||||
}
|
||||
else
|
||||
{
|
||||
var emlsArray = GetSelectedMessages();
|
||||
}
|
||||
|
||||
IETtotal = emlsArray.length;
|
||||
IETexported = 0;
|
||||
var msguri = emlsArray[0];
|
||||
|
||||
|
||||
var branchobj = getPref();
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
var strDbName = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strDbName.data = branchobj.getCharPref("serverdbname");
|
||||
var struids = xmlRpcClient.createType(xmlRpcClient.INT,{});
|
||||
struids.data = branchobj.getIntPref('userid');
|
||||
var strpass = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strpass.data = branchobj.getCharPref("password");
|
||||
var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strmethod.data = 'search_message';
|
||||
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strobj.data = 'thunderbird.partner';
|
||||
var eml_string = parse_eml()
|
||||
var a = ['model', 'message'];
|
||||
var b = [object, eml_string];
|
||||
var arrofarr = dictcontact(a,b);
|
||||
xmlRpcClient.asyncCall(listDocumentHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
|
||||
}
|
||||
function open_contact()
|
||||
{
|
||||
if (check() == false){
|
||||
return true
|
||||
}
|
||||
|
||||
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];
|
||||
|
||||
|
||||
//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
|
||||
}
|
||||
|
||||
//set the initial information for the selected email
|
||||
setSenderEmail(senderemail);
|
||||
setSenderName(sendername);
|
||||
setPartnerName("");
|
||||
setStreet("");
|
||||
setStreet2("");
|
||||
setZipCode("");
|
||||
setCity("");
|
||||
setOfficenumber("");
|
||||
setFax("");
|
||||
setMobilenumber("");
|
||||
searchContact();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//function to open the configuration window
|
||||
var Config = {
|
||||
onLoad: function() {
|
||||
|
@ -279,18 +465,18 @@ var Create = {
|
|||
}
|
||||
};
|
||||
window.addEventListener("load", function(e) { Create.onLoad(e); }, false);
|
||||
|
||||
|
||||
var Address = {
|
||||
onLoad: function(){
|
||||
this.initialized=true;
|
||||
},
|
||||
|
||||
onMenuItemCommand: function(){
|
||||
onMenuItemCommand: function(){
|
||||
open_contact();
|
||||
searchContact();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//function to open the window for selecting the partner for a new contact creation
|
||||
var Select = {
|
||||
|
@ -298,11 +484,12 @@ var Select = {
|
|||
this.initialized=true;
|
||||
},
|
||||
|
||||
onMenuItemCommand: function(){
|
||||
//document.getElementById("txtselectpartner").value="";
|
||||
onMenuItemCommand: function(){
|
||||
// document.getElementById("txtselectpartner").value="";
|
||||
window.open("chrome://openerp_plugin/content/selectpartner.xul", "", "chrome");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var CreatePartner = {
|
||||
onLoad: function(){
|
||||
|
@ -310,7 +497,7 @@ var CreatePartner = {
|
|||
},
|
||||
|
||||
onMenuItemCommand: function(){
|
||||
window.open("chrome://openerp_plugin/content/createpartner.xul", "", "chrome");
|
||||
window.open("chrome://openerp_plugin/content/createpartner.xul", "", "chrome");
|
||||
}
|
||||
};
|
||||
window.addEventListener("load", function(e) { CreatePartner.onLoad(e); }, false);
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
image="&menuicon.value;"
|
||||
class="menuitem-iconic"
|
||||
tooltiptext="&pluginconfig.value;"/>
|
||||
</menupopup>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="taskPopup">
|
||||
<menuitem id="tiny-plugin1" label="&tinypluginconfig;"
|
||||
|
@ -49,13 +49,20 @@
|
|||
label= "Open Contact"
|
||||
oncommand="Address.onMenuItemCommand(event);" />
|
||||
</toolbarpalette>
|
||||
|
||||
<toolbarpalette id="MailToolbarPalette">
|
||||
<toolbarbutton id="GA-button2"
|
||||
class="toolbarbutton-1"
|
||||
image="&partnericon.value;"
|
||||
label= "Open Partner"
|
||||
oncommand="open_partner();"
|
||||
/>
|
||||
</toolbarpalette>
|
||||
<toolbarpalette id="MailToolbarPalette">
|
||||
<toolbarbutton id="GA-button3"
|
||||
class="toolbarbutton-1"
|
||||
image="&imagearchive.value;"
|
||||
label= "Open Document"
|
||||
oncommand="archivemail();" />
|
||||
oncommand="open_document();" />
|
||||
</toolbarpalette>
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<?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()"
|
||||
<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/tiny_xmlrpc.js"></script>
|
||||
<script type="text/javascript" src="chrome://openerp_plugin/content/config.js"></script>
|
||||
|
@ -29,7 +28,7 @@
|
|||
<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()"/>
|
||||
<button label="&select.label;" image="&imageok.value;" oncommand="selectPartner();close();"/>
|
||||
</hbox>
|
||||
|
||||
</window>
|
||||
|
|
|
@ -201,6 +201,10 @@ function setDbName(argDbName){
|
|||
getPref().setCharPref('serverdbname',argDbName);
|
||||
}
|
||||
|
||||
//set webserver url
|
||||
function setWebServerURL(argWebServerURL){
|
||||
getPref().setCharPref('webserverurl',argWebServerURL);
|
||||
}
|
||||
//set preference value of username for login
|
||||
function setUsername(argUsername){
|
||||
getPref().setCharPref('username',argUsername);
|
||||
|
@ -399,6 +403,11 @@ function getDbName(){
|
|||
return getPref().getCharPref('serverdbname');
|
||||
}
|
||||
|
||||
//get webserver url
|
||||
function getWebServerURL(){
|
||||
return getPref().getCharPref('webserverurl');
|
||||
}
|
||||
|
||||
//get username from config settings
|
||||
function getUsername(){
|
||||
return getPref().getCharPref('username');
|
||||
|
@ -459,7 +468,8 @@ function getSenderName(){
|
|||
}
|
||||
}
|
||||
|
||||
//ger partner name
|
||||
|
||||
//get partner name
|
||||
function getPartnerName(){
|
||||
return getPref().getCharPref('partnername');
|
||||
}
|
||||
|
@ -909,31 +919,46 @@ function createMenuItem(aLabel) {
|
|||
}
|
||||
|
||||
|
||||
function listinstallmodule( result ) {
|
||||
if ( rpc.onfault( result ) )
|
||||
{
|
||||
setmodule_install('no')
|
||||
var listinstallmodulehandler = {
|
||||
onResult: function(client, context, result) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var arrIdList = result.QueryInterface(Components.interfaces.nsISupportsArray);
|
||||
var count = arrIdList.Count();
|
||||
if (count > 0)
|
||||
{
|
||||
setmodule_install('yes')
|
||||
}
|
||||
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
setmodule_install('no')
|
||||
},
|
||||
|
||||
onError: function (client, ctxt, status, errorMsg) {
|
||||
setmodule_install('no')
|
||||
}
|
||||
}
|
||||
|
||||
function module_install()
|
||||
{
|
||||
setmodule_install("yes")
|
||||
setmodule_install("no")
|
||||
var branchobj = getPref();
|
||||
setServerService('xmlrpc/object');
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
var xmlRpcClient = getXmlRpc();
|
||||
strDbName = branchobj.getCharPref("serverdbname");
|
||||
struid = branchobj.getIntPref('userid');
|
||||
strpass = branchobj.getCharPref("password");
|
||||
strmethod = 'search';
|
||||
strobj = 'thunderbird.partner'; // TOFIX: Find module 'thunderbird' into 'module.module' model.
|
||||
var temp = new Array()
|
||||
server=getServer()
|
||||
port=getPort()
|
||||
basicList=getBasicList()
|
||||
rpc.addserver('object',basicList[3] , basicList[4],'/xmlrpc/object');
|
||||
srcids=rpc.ask( 'object', 'execute', [basicList[0],basicList[1],basicList[2],strobj,strmethod,[]],listinstallmodule)
|
||||
var strDbName = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strDbName.data = branchobj.getCharPref("serverdbname");
|
||||
var struid = xmlRpcClient.createType(xmlRpcClient.INT,{});
|
||||
struid.data = branchobj.getIntPref('userid');
|
||||
var strpass = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strpass.data = branchobj.getCharPref("password");
|
||||
var strmethod = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strmethod.data = 'name_search';
|
||||
var strobj = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strobj.data = 'ir.model';
|
||||
var strvalue = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strvalue.data = 'thunderbird.partner';
|
||||
xmlRpcClient.asyncCall(listinstallmodulehandler,null,'execute',[ strDbName,struid,strpass,strobj,strmethod, strvalue],6);
|
||||
}
|
||||
|
||||
|
||||
|
@ -951,7 +976,7 @@ var listSearchContactHandler = {
|
|||
setPartnerName(strlSearchResultValue);
|
||||
var t = getPartnerName();}
|
||||
|
||||
if(strlSearchResult=="contactname"){
|
||||
if(strlSearchResult=="contactname"){
|
||||
setSenderName(strlSearchResultValue);
|
||||
var t = getSenderName();}
|
||||
|
||||
|
@ -1048,6 +1073,7 @@ var listSearchContactdetailHandler = {
|
|||
document.getElementById("txtmobile").value =strlSearchResultValue;}
|
||||
|
||||
if(strlSearchResult=="email"&& strlSearchResultValue!=''){
|
||||
alert("Contact is Available.")
|
||||
document.getElementById("txtemail").value =strlSearchResultValue;}
|
||||
|
||||
if(strlSearchResult=="res_id"){
|
||||
|
@ -1194,8 +1220,8 @@ var listSearchCheckboxHandler = {
|
|||
listcell.setAttribute("height",12);
|
||||
listcell.setAttribute("label",arrFinalList[i][j][1]); //stores the name ofthe record
|
||||
listItem.appendChild(listcell);
|
||||
listItem.value = arrFinalList[i][j][0]; //stores the id of the record
|
||||
listItem.label = arr1[i]; // stores the value of the object
|
||||
listItem.value = arrFinalList[i][j][1]; //stores the name of the record
|
||||
listItem.label = arr1[i]; // stores the value of the object
|
||||
cmbSearchList.appendChild(listItem);
|
||||
}
|
||||
}
|
||||
|
@ -1303,7 +1329,9 @@ var listPartnerHandler = {
|
|||
listItem.value = arrPartnerList[i][0];
|
||||
cmdPartnerList.appendChild(listItem);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
|
||||
|
@ -1362,7 +1390,24 @@ function dictcontact(a,b){
|
|||
var listArchiveHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
list_documents = document.getElementById('listSearchBox')
|
||||
var createId = result.QueryInterface(Components.interfaces.nsISupportsPRInt32);
|
||||
createId = parseInt(createId);
|
||||
if(createId==0)
|
||||
{
|
||||
alert("Mail is Already Archived Successfully.");
|
||||
}
|
||||
else if (createId<0)
|
||||
{
|
||||
alert("sorry Mail is not Archived to" +" " + ":" + " "+ list_documents.value);
|
||||
|
||||
}
|
||||
|
||||
else if (createId>=1)
|
||||
{
|
||||
alert("Mail Archived Successfully to" +" " + ":" + " "+ list_documents.value);
|
||||
}
|
||||
window.close();
|
||||
|
||||
},
|
||||
onFault: function (client, ctxt, fault) {
|
||||
|
@ -1402,6 +1447,7 @@ function parse_eml(){
|
|||
var output = sis.read( sis.available() );
|
||||
return output
|
||||
}
|
||||
|
||||
}
|
||||
function upload_archivemail()
|
||||
{
|
||||
|
@ -1438,14 +1484,16 @@ function upload_archivemail()
|
|||
var a = ['ref_ids','message'];
|
||||
var b = [ref_ids, eml_string];
|
||||
var arrofarr = dictcontact(a,b);
|
||||
|
||||
xmlRpcClient.asyncCall(listArchiveHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
|
||||
alert("Mail Archived Successfully.");
|
||||
window.close();
|
||||
// alert("Mail Archived Successfully to" +" " + ":" + " "+ list_documents.value);
|
||||
//window.close();
|
||||
|
||||
}
|
||||
|
||||
function create_archivemail(){
|
||||
var popup = document.getElementById("section").selectedItem; // a <menupopup> element
|
||||
var popup = document.getElementById("section").selectedItem;
|
||||
// a <menupopup> element
|
||||
|
||||
if (String(popup) != "null"){
|
||||
object=popup.value;
|
||||
|
@ -1470,7 +1518,7 @@ function create_archivemail(){
|
|||
var b = [object, eml_string];
|
||||
var arrofarr = dictcontact(a,b);
|
||||
xmlRpcClient.asyncCall(listArchiveHandler,null,'execute',[strDbName,struids,strpass,strobj,strmethod,arrofarr],6);
|
||||
alert("Document Created Successfully.");
|
||||
alert("Document Created Successfully For " +" " + ":" + " "+ popup.label);
|
||||
}
|
||||
window.close();
|
||||
}
|
||||
|
@ -1679,6 +1727,16 @@ function createInstance(name,test){
|
|||
}
|
||||
|
||||
//xmlrpc request handler for handling the login information
|
||||
function check_module_install(count){
|
||||
if (getmodule_install() == "no")
|
||||
{
|
||||
if (count <= 0){ return false; }
|
||||
count = count - 1;
|
||||
return check_module_install(count)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
var listLoginHandler = {
|
||||
onResult: function(client, context, result) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserAccess');
|
||||
|
@ -1686,8 +1744,14 @@ var listLoginHandler = {
|
|||
if(login.type == 12){
|
||||
login = result.QueryInterface(Components.interfaces.nsISupportsPRInt32)
|
||||
setUserId(login.data);
|
||||
alert('Successfully Login To OpenERP.');
|
||||
window.close();
|
||||
module_install();
|
||||
alert('Successfully Login To OpenERP.');
|
||||
if (check_module_install(5) == false){
|
||||
alert("Please install the thunderbird module on your '" + getDbName() +"' database and try again !");
|
||||
}
|
||||
else{
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
else{
|
||||
alert("Login Failed");
|
||||
|
@ -1744,6 +1808,7 @@ function testConnection(){
|
|||
var strpass = xmlRpcClient.createType(xmlRpcClient.STRING,{});
|
||||
strpass.data = getPref().getCharPref('password');
|
||||
xmlRpcClient.asyncCall(listLoginHandler,null,'login',[strDbName,strusername,strpass],3);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1944,7 +2009,7 @@ var listsearchAttachmentHandler = {
|
|||
count += 1
|
||||
var hbox = document.createElement("vbox");
|
||||
var checkbox1 = document.createElement("checkbox");
|
||||
|
||||
|
||||
checkbox1.setAttribute("label",object[i]);
|
||||
checkbox1.setAttribute("id","cbx"+(i+1));
|
||||
checkbox1.setAttribute("width",150)
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<!ENTITY ok.label "Save">
|
||||
<!ENTITY partner.label "Create New Contact :">
|
||||
<!ENTITY create.label "New Contact">
|
||||
<!ENTITY cancel.label "Cancel">
|
||||
<!ENTITY cancel.label "Close">
|
||||
<!ENTITY newpartner.label "New Partner">
|
||||
<!ENTITY bsearch.label "Search Contact">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!ENTITY title.label "OpenERP Configuration">
|
||||
<!ENTITY separate.label "Configuration Login for OpenERP!">
|
||||
<!ENTITY close.label "Cancel">
|
||||
<!ENTITY close.label "Close">
|
||||
<!ENTITY database.label "Database:">
|
||||
<!ENTITY ok.label "OK">
|
||||
<!ENTITY connection.label "Connect">
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
|
||||
<!ENTITY cbxarchive.label "Archive">
|
||||
<!ENTITY ok.label "Save">
|
||||
<!ENTITY cancel.label "Cancel">
|
||||
<!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">
|
||||
|
@ -31,7 +31,7 @@
|
|||
<!ENTITY bsearch.label "Search">
|
||||
<!ENTITY create.label "Create">
|
||||
<!ENTITY select.label "Select">
|
||||
<!ENTITY cancel.label "Cancel">
|
||||
<!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">
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
<!ENTITY name.value "Name:">
|
||||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
|
||||
<!ENTITY ok.label "Save">
|
||||
<!ENTITY cancel.label "Cancel">
|
||||
<!ENTITY cancel.label "Close">
|
||||
<!ENTITY imagecancel.value "chrome://openerp_plugin/skin/Error.gif">
|
||||
<!ENTITY imageok.value "chrome://openerp_plugin/skin/Success.gif">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<!ENTITY tinyarchive "Archive to OpenERP">
|
||||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
|
||||
<!ENTITY menuicon.value "chrome://openerp_plugin/skin/openerp-icon.png">
|
||||
<!ENTITY partnericon.value "chrome://openerp_plugin/skin/Partner.png">
|
||||
<!ENTITY partnericon.value "chrome://openerp_plugin/skin/partner.png">
|
||||
<!ENTITY imagearchive.value "chrome://openerp_plugin/skin/document-new.png">
|
||||
<!ENTITY tooltip.value "Add To Archive">
|
||||
<!ENTITY pluginconfig.value "OpenERP Configuration Settings">
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<!ENTITY create.label "Create">
|
||||
<!ENTITY imageicon.value "chrome://openerp_plugin/skin/NEWT1.png">
|
||||
<!ENTITY select.label "Select">
|
||||
<!ENTITY cancel.label "Cancel">
|
||||
<!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">
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<field name="plugin_file" filename="name"/>
|
||||
<newline/>
|
||||
<field name="pdf_file" filename="pdf_name"/>
|
||||
<field name="pdf_file" filename="pdf_name" widget="url"/>
|
||||
<newline/>
|
||||
<separator string="Installation and Configuration Steps" colspan="4"/>
|
||||
<field name="description" nolabel="1" colspan="8"/>
|
||||
|
@ -76,8 +76,7 @@
|
|||
<field name="context">{'menu':True}</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="base.menu_base_config_mail" name="Mail" parent="base.menu_base_config" sequence="10"/>
|
||||
<menuitem id="base.menu_base_config_plugins" name="Plugins" parent="base.menu_base_config_mail" sequence="10" />
|
||||
<menuitem id="base.menu_base_config_plugins" name="Plugins" parent="base.menu_base_config" sequence="10" />
|
||||
<menuitem id="menu_base_config_plugins_thunderbird" action="action_thunderbird_wizard" name="Thunderbird Plug-In" parent="base.menu_base_config_plugins" sequence="10" />
|
||||
|
||||
</data>
|
||||
|
|
Loading…
Reference in New Issue