[IMP] mail: tried to have alwsays read/unread buttons; some code cleaning; added demo data.
bzr revid: tde@openerp.com-20121102135426-5np5wtupzdhx0dz4
This commit is contained in:
parent
db19771e06
commit
fb222404e5
|
@ -1,7 +1,9 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data noupdate="1">
|
<!-- <data noupdate="1"> -->
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<!-- Pushed to all employees -->
|
||||||
<record id="message_blogpost0" model="mail.message">
|
<record id="message_blogpost0" model="mail.message">
|
||||||
<field name="model">mail.group</field>
|
<field name="model">mail.group</field>
|
||||||
<field name="res_id" ref="mail.group_all_employees"/>
|
<field name="res_id" ref="mail.group_all_employees"/>
|
||||||
|
@ -47,5 +49,30 @@ This month you also get 250 EUR of eco-vouchers if you have been in the company
|
||||||
<field name="subtype_id" ref="mt_comment"/>
|
<field name="subtype_id" ref="mt_comment"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- Demo user and admin conversation -->
|
||||||
|
<record id="message_discussion" model="mail.message">
|
||||||
|
<field name="body">Hello Demo User! How are you ?</field>
|
||||||
|
<field name="type">comment</field>
|
||||||
|
<field name="subtype_id" ref="mt_comment"/>
|
||||||
|
<field name="author_id" ref="base.partner_root"/>
|
||||||
|
<field name="partner_ids" eval="[(6, 0, [ref('base.partner_demo')])]"/>
|
||||||
|
</record>
|
||||||
|
<record id="message_discussion_answer1" model="mail.message">
|
||||||
|
<field name="body">Fine, thanks, and you ?</field>
|
||||||
|
<field name="parent_id" ref="message_discussion"/>
|
||||||
|
<field name="type">comment</field>
|
||||||
|
<field name="subtype_id" ref="mt_comment"/>
|
||||||
|
<field name="author_id" ref="base.partner_demo"/>
|
||||||
|
<field name="partner_ids" eval="[(6, 0, [ref('base.partner_root')])]"/>
|
||||||
|
</record>
|
||||||
|
<record id="message_discussion_answer2" model="mail.message">
|
||||||
|
<field name="body">Fine too.</field>
|
||||||
|
<field name="parent_id" ref="message_discussion"/>
|
||||||
|
<field name="type">comment</field>
|
||||||
|
<field name="subtype_id" ref="mt_comment"/>
|
||||||
|
<field name="author_id" ref="base.partner_root"/>
|
||||||
|
<field name="partner_ids" eval="[(6, 0, [ref('base.partner_demo')])]"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -5,8 +5,14 @@
|
||||||
<field name="name">Inbox</field>
|
<field name="name">Inbox</field>
|
||||||
<field name="tag">mail.wall</field>
|
<field name="tag">mail.wall</field>
|
||||||
<field name="params" eval=""{
|
<field name="params" eval=""{
|
||||||
'domain': [('notification_ids.partner_id.user_ids', 'in', [uid]), ('to_read', '=', True), ('favorite_user_ids.user_ids', 'not in', [uid])],
|
'domain': [
|
||||||
'context': {'default_model': 'res.users', 'default_res_id': uid, 'view_mailbox': True} }""/>
|
('notification_ids.partner_id.user_ids', 'in', [uid]),
|
||||||
|
('to_read', '=', True),
|
||||||
|
('favorite_user_ids.user_ids', 'not in', [uid])
|
||||||
|
],
|
||||||
|
'context': {'default_model': 'res.users', 'default_res_id': uid},
|
||||||
|
'view_mailbox': True,
|
||||||
|
'read_action': 'read', }""/>
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="oe_view_nocontent_create">
|
<p class="oe_view_nocontent_create">
|
||||||
Click to define a new sales tag.
|
Click to define a new sales tag.
|
||||||
|
@ -22,29 +28,42 @@
|
||||||
<record id="action_mail_to_me_feeds" model="ir.actions.client">
|
<record id="action_mail_to_me_feeds" model="ir.actions.client">
|
||||||
<field name="name">To: me</field>
|
<field name="name">To: me</field>
|
||||||
<field name="tag">mail.wall</field>
|
<field name="tag">mail.wall</field>
|
||||||
<field name="params" eval=""{'domain': [('partner_ids.user_ids', 'in', [uid])],
|
<field name="params" eval=""{
|
||||||
'context': {'search_default_message_unread': True, 'default_model': 'res.users', 'default_res_id': uid, 'view_mailbox': True} }""/>
|
'domain': [('partner_ids.user_ids', 'in', [uid])],
|
||||||
|
'context': {'default_model': 'res.users', 'default_res_id': uid, 'search_default_message_unread': True},
|
||||||
|
'view_mailbox': True,
|
||||||
|
'read_action': 'read', }""/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_mail_star_feeds" model="ir.actions.client">
|
<record id="action_mail_star_feeds" model="ir.actions.client">
|
||||||
<field name="name">Todo</field>
|
<field name="name">Todo</field>
|
||||||
<field name="tag">mail.wall</field>
|
<field name="tag">mail.wall</field>
|
||||||
<field name="params" eval=""{'domain': [('favorite_user_ids.user_ids', 'in', [uid])],
|
<field name="params" eval=""{
|
||||||
'context': {'search_default_message_unread': True, 'default_model': 'res.users', 'default_res_id': uid, 'view_mailbox': True} }""/>
|
'domain': [('favorite_user_ids.user_ids', 'in', [uid])],
|
||||||
|
'context': {'default_model': 'res.users', 'default_res_id': uid, 'search_default_message_unread': True},
|
||||||
|
'view_mailbox': True,
|
||||||
|
'read_action': 'read', }""/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_mail_archives_feeds" model="ir.actions.client">
|
<record id="action_mail_archives_feeds" model="ir.actions.client">
|
||||||
<field name="name">Done</field>
|
<field name="name">Done</field>
|
||||||
<field name="tag">mail.wall</field>
|
<field name="tag">mail.wall</field>
|
||||||
<field name="params" eval=""{'domain': [('notification_ids.partner_id.user_ids', 'in', [uid]), ('to_read', '=', False)],
|
<field name="params" eval=""{
|
||||||
'context': {'default_model': 'res.users', 'default_res_id': uid, 'view_mailbox': True} }""/>
|
'domain': [
|
||||||
|
('notification_ids.partner_id.user_ids', 'in', [uid]),
|
||||||
|
('to_read', '=', False)],
|
||||||
|
'context': {'default_model': 'res.users', 'default_res_id': uid},
|
||||||
|
'view_mailbox': True,
|
||||||
|
'read_action': 'unread', }""/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="action_mail_sent_feeds" model="ir.actions.client">
|
<record id="action_mail_sent_feeds" model="ir.actions.client">
|
||||||
<field name="name">Sent</field>
|
<field name="name">Sent</field>
|
||||||
<field name="tag">mail.wall</field>
|
<field name="tag">mail.wall</field>
|
||||||
<field name="params" eval=""{'domain': [('author_id.user_ids', 'in', [uid])],
|
<field name="params" eval=""{
|
||||||
'context': {'default_model': 'res.users', 'default_res_id': uid, 'view_mailbox': True} }""/>
|
'domain': [('author_id.user_ids', 'in', [uid])],
|
||||||
|
'context': {'default_model': 'res.users', 'default_res_id': uid},
|
||||||
|
'view_mailbox': True, }""/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- MENU -->
|
<!-- MENU -->
|
||||||
|
|
|
@ -132,12 +132,6 @@
|
||||||
|
|
||||||
/* c) Message action icons */
|
/* c) Message action icons */
|
||||||
|
|
||||||
.openerp .oe_mail .oe_msg.oe_msg_unread .oe_unread{
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
.openerp .oe_mail .oe_msg.oe_msg_read .oe_read{
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
.openerp .oe_mail .oe_msg .oe_msg_icons{
|
.openerp .oe_mail .oe_msg .oe_msg_icons{
|
||||||
float: right;
|
float: right;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
|
|
|
@ -133,7 +133,7 @@ openerp.mail = function (session) {
|
||||||
// record domain and context
|
// record domain and context
|
||||||
this.domain = datasets.domain || options.domain || [];
|
this.domain = datasets.domain || options.domain || [];
|
||||||
this.context = _.extend({
|
this.context = _.extend({
|
||||||
default_model: 'mail.thread',
|
default_model: false,
|
||||||
default_res_id: 0,
|
default_res_id: 0,
|
||||||
default_parent_id: false }, options.context || {});
|
default_parent_id: false }, options.context || {});
|
||||||
|
|
||||||
|
@ -141,7 +141,6 @@ openerp.mail = function (session) {
|
||||||
this.id = datasets.id || false,
|
this.id = datasets.id || false,
|
||||||
this.last_id = this.id,
|
this.last_id = this.id,
|
||||||
this.model = datasets.model || false,
|
this.model = datasets.model || false,
|
||||||
this.res_model = datasets.res_model || false;
|
|
||||||
this.parent_id = datasets.parent_id || false,
|
this.parent_id = datasets.parent_id || false,
|
||||||
this.res_id = datasets.res_id || false,
|
this.res_id = datasets.res_id || false,
|
||||||
this.type = datasets.type || false,
|
this.type = datasets.type || false,
|
||||||
|
@ -162,16 +161,26 @@ openerp.mail = function (session) {
|
||||||
this.nb_messages = datasets.nb_messages;
|
this.nb_messages = datasets.nb_messages;
|
||||||
this._date = datasets.date;
|
this._date = datasets.date;
|
||||||
|
|
||||||
this.formating_data();
|
this.format_data();
|
||||||
|
|
||||||
// record options and data
|
// record options and data
|
||||||
this.show_record_name = this.record_name && !this.thread_level && this.model!='res.partner';
|
this.show_record_name = this.record_name && !this.thread_level && this.model != 'res.partner';
|
||||||
this.parent_thread= parent.messages!= undefined ? parent : this.options.root_thread;
|
this.options.show_read = false;
|
||||||
|
this.options.show_unread = false;
|
||||||
|
if (this.options.show_read_unread_button) {
|
||||||
|
if (this.options.read_action == 'read') this.options.show_read = true;
|
||||||
|
else if (this.options.read_action == 'unread') this.options.show_unread = true;
|
||||||
|
else {
|
||||||
|
this.options.show_read = this.to_read;
|
||||||
|
this.options.show_unread = !this.to_read;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.parent_thread = parent.messages != undefined ? parent : this.options.root_thread;
|
||||||
this.thread = false;
|
this.thread = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Convert date, timerelative and avatar in displayable data. */
|
/* Convert date, timerelative and avatar in displayable data. */
|
||||||
formating_data: function () {
|
format_data: function () {
|
||||||
|
|
||||||
//formating and add some fields for render
|
//formating and add some fields for render
|
||||||
if (this._date) {
|
if (this._date) {
|
||||||
|
@ -641,9 +650,9 @@ openerp.mail = function (session) {
|
||||||
self.resize_img();
|
self.resize_img();
|
||||||
});
|
});
|
||||||
// event: click on icone 'Read' in header
|
// event: click on icone 'Read' in header
|
||||||
this.$el.on('click', '.oe_read', this.on_message_read_unread);
|
this.$el.on('click', '.oe_read', this.on_message_read);
|
||||||
// event: click on icone 'UnRead' in header
|
// event: click on icone 'UnRead' in header
|
||||||
this.$el.on('click', '.oe_unread', this.on_message_read_unread);
|
this.$el.on('click', '.oe_unread', this.on_message_unread);
|
||||||
// event: click on 'Delete' in msg side menu
|
// event: click on 'Delete' in msg side menu
|
||||||
this.$el.on('click', '.oe_msg_delete', this.on_message_delete);
|
this.$el.on('click', '.oe_msg_delete', this.on_message_delete);
|
||||||
|
|
||||||
|
@ -735,18 +744,28 @@ openerp.mail = function (session) {
|
||||||
.then( _.bind(function (record) { if (!record || !record.length) this.animated_destroy(150); }, this) );
|
.then( _.bind(function (record) { if (!record || !record.length) this.animated_destroy(150); }, this) );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
on_message_read: function (event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
this.on_message_read_unread(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
on_message_unread: function (event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
this.on_message_read_unread(false);
|
||||||
|
},
|
||||||
|
|
||||||
/*The selected thread and all childs (messages/thread) became read
|
/*The selected thread and all childs (messages/thread) became read
|
||||||
* @param {object} mouse envent
|
* @param {object} mouse envent
|
||||||
*/
|
*/
|
||||||
on_message_read_unread: function (event) {
|
on_message_read_unread: function (read_value) {
|
||||||
event.stopPropagation();
|
var self = this;
|
||||||
var self=this;
|
// TDE note: this does not seem to work, try on demo data
|
||||||
|
var message_ids = [this.id].concat(this.get_child_ids());
|
||||||
// if this message is read, all childs message display is read
|
this.ds_notification.call('set_message_read', [message_ids, read_value, this.context])
|
||||||
this.ds_notification.call('set_message_read', [ [this.id].concat( this.get_child_ids() ) , this.to_read, this.context])
|
|
||||||
.then(function () {
|
.then(function () {
|
||||||
self.$el.removeClass(self.to_read ? 'oe_msg_unread':'oe_msg_read').addClass(self.to_read ? 'oe_msg_read':'oe_msg_unread');
|
/* TDE note: not very understandable -> just toggle the buttons if necessary */
|
||||||
self.to_read = !self.to_read;
|
// self.$el.removeClass(self.to_read ? 'oe_msg_unread':'oe_msg_read').addClass(self.to_read ? 'oe_msg_read':'oe_msg_unread');
|
||||||
|
self.to_read = read_value;
|
||||||
// check if the message must be display
|
// check if the message must be display
|
||||||
self.check_for_destroy();
|
self.check_for_destroy();
|
||||||
});
|
});
|
||||||
|
@ -845,7 +864,7 @@ openerp.mail = function (session) {
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
* Thread Widget
|
* Thread Widget
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
*
|
*
|
||||||
|
@ -1291,7 +1310,7 @@ openerp.mail = function (session) {
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
* mail : root Widget
|
* mail : root Widget
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
*
|
*
|
||||||
|
@ -1301,7 +1320,7 @@ openerp.mail = function (session) {
|
||||||
*/
|
*/
|
||||||
session.web.client_actions.add('mail.Widget', 'session.mail.Widget');
|
session.web.client_actions.add('mail.Widget', 'session.mail.Widget');
|
||||||
mail.Widget = session.web.Widget.extend({
|
mail.Widget = session.web.Widget.extend({
|
||||||
template: 'mail.Widget',
|
template: 'mail.Root',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Object} parent parent
|
* @param {Object} parent parent
|
||||||
|
@ -1329,7 +1348,6 @@ openerp.mail = function (session) {
|
||||||
this._super(parent);
|
this._super(parent);
|
||||||
this.domain = options.domain || [];
|
this.domain = options.domain || [];
|
||||||
this.context = options.context || {};
|
this.context = options.context || {};
|
||||||
this.search_results = {'domain': [], 'context': {}, 'groupby': {}};
|
|
||||||
|
|
||||||
this.options = _.extend({
|
this.options = _.extend({
|
||||||
'display_indented_thread' : -1,
|
'display_indented_thread' : -1,
|
||||||
|
@ -1342,11 +1360,6 @@ openerp.mail = function (session) {
|
||||||
'message_ids': undefined,
|
'message_ids': undefined,
|
||||||
'no_message': false
|
'no_message': false
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
if (this.display_indented_thread === false) {
|
|
||||||
this.display_indented_thread = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
start: function (options) {
|
start: function (options) {
|
||||||
|
@ -1354,7 +1367,6 @@ openerp.mail = function (session) {
|
||||||
this.message_render();
|
this.message_render();
|
||||||
this.bind_events();
|
this.bind_events();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Create the root thread and display this object in the DOM.
|
*Create the root thread and display this object in the DOM.
|
||||||
|
@ -1393,7 +1405,7 @@ openerp.mail = function (session) {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
* mail_thread Widget
|
* mail_thread Widget
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
*
|
*
|
||||||
|
@ -1433,13 +1445,12 @@ openerp.mail = function (session) {
|
||||||
'domain' : (this.domain || []).concat([['model', '=', this.view.model], ['res_id', '=', this.view.datarecord.id]]),
|
'domain' : (this.domain || []).concat([['model', '=', this.view.model], ['res_id', '=', this.view.datarecord.id]]),
|
||||||
'context' : {
|
'context' : {
|
||||||
'default_res_id': this.view.datarecord.id || false,
|
'default_res_id': this.view.datarecord.id || false,
|
||||||
'default_model': this.view.model || 'mail.thread',
|
'default_model': this.view.model || false,
|
||||||
'default_is_private': false
|
|
||||||
},
|
},
|
||||||
'display_indented_thread': -1,
|
'display_indented_thread': -1,
|
||||||
'show_reply_button': false,
|
'show_reply_button': false,
|
||||||
'show_read_unread_button': false,
|
'show_read_unread_button': false,
|
||||||
'show_compose_message': this.view.is_action_enabled('edit') || (this.getParent().fields.message_is_follower && this.getParent().fields.message_is_follower.get_value()),
|
'show_compose_message': this.view.is_action_enabled('edit'),
|
||||||
'message_ids': this.getParent().fields.message_ids ? this.getParent().fields.message_ids.get_value() : undefined,
|
'message_ids': this.getParent().fields.message_ids ? this.getParent().fields.message_ids.get_value() : undefined,
|
||||||
'show_compact_message': 1,
|
'show_compact_message': 1,
|
||||||
'no_message': this.node.attrs.help
|
'no_message': this.node.attrs.help
|
||||||
|
@ -1452,7 +1463,7 @@ openerp.mail = function (session) {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
* Wall Widget
|
* Wall Widget
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
*
|
*
|
||||||
|
@ -1460,6 +1471,7 @@ openerp.mail = function (session) {
|
||||||
* use is to receive a context and a domain, and to delegate the message
|
* use is to receive a context and a domain, and to delegate the message
|
||||||
* fetching and displaying to the Thread widget.
|
* fetching and displaying to the Thread widget.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
session.web.client_actions.add('mail.wall', 'session.mail.Wall');
|
session.web.client_actions.add('mail.wall', 'session.mail.Wall');
|
||||||
mail.Wall = session.web.Widget.extend({
|
mail.Wall = session.web.Widget.extend({
|
||||||
template: 'mail.wall',
|
template: 'mail.wall',
|
||||||
|
@ -1473,12 +1485,12 @@ openerp.mail = function (session) {
|
||||||
*/
|
*/
|
||||||
init: function (parent, options) {
|
init: function (parent, options) {
|
||||||
this._super(parent);
|
this._super(parent);
|
||||||
|
this.options = options || {};
|
||||||
this.domain = options.domain || [];
|
this.domain = options.domain || [];
|
||||||
this.context = options.context || {};
|
this.context = options.context || {};
|
||||||
|
|
||||||
this.defaults = {};
|
this.defaults = {};
|
||||||
for (var key in options.context) {
|
for (var key in options.context) {
|
||||||
if(key.match(/^search_default_/)) {
|
if (key.match(/^search_default_/)) {
|
||||||
this.defaults[key.replace(/^search_default_/, '')] = options.context[key];
|
this.defaults[key.replace(/^search_default_/, '')] = options.context[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1486,30 +1498,28 @@ openerp.mail = function (session) {
|
||||||
|
|
||||||
start: function () {
|
start: function () {
|
||||||
this._super.apply(this);
|
this._super.apply(this);
|
||||||
this.load_searchview(this.defaults, false);
|
|
||||||
|
|
||||||
this.bind_events();
|
this.bind_events();
|
||||||
|
var searchview_loaded = this.load_searchview(this.defaults);
|
||||||
if (!this.searchview.has_defaults) {
|
if (! this.searchview.has_defaults) {
|
||||||
this.message_render();
|
this.message_render();
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the mail.message search view
|
* Load the mail.message search view
|
||||||
* @param {Object} defaults ??
|
* @param {Object} defaults ??
|
||||||
* @param {Boolean} hidden some kind of trick we do not care here
|
|
||||||
*/
|
*/
|
||||||
load_searchview: function (defaults, hidden) {
|
load_searchview: function (defaults) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var ds_msg = new session.web.DataSetSearch(self, 'mail.message');
|
var ds_msg = new session.web.DataSetSearch(this, 'mail.message');
|
||||||
self.searchview = new session.web.SearchView(self, ds_msg, false, defaults || {}, hidden || false);
|
this.searchview = new session.web.SearchView(this, ds_msg, false, defaults || {}, false);
|
||||||
self.searchview.appendTo(self.$('.oe_view_manager_view_search'))
|
this.searchview.appendTo(this.$('.oe_view_manager_view_search'))
|
||||||
.then(function () { self.searchview.on('search_data', self, self.do_searchview_search); });
|
.then(function () { self.searchview.on('search_data', self, self.do_searchview_search); });
|
||||||
if (this.searchview.has_defaults) {
|
if (this.searchview.has_defaults) {
|
||||||
this.searchview.ready.then(this.searchview.do_search);
|
this.searchview.ready.then(this.searchview.do_search);
|
||||||
}
|
}
|
||||||
return self.searchview
|
return this.searchview
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1534,14 +1544,13 @@ openerp.mail = function (session) {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*Create the root thread widget and display this object in the DOM
|
* Create the root thread widget and display this object in the DOM
|
||||||
*/
|
*/
|
||||||
message_render: function ( search ) {
|
message_render: function (search) {
|
||||||
var domain = this.domain.concat(search && search['domain'] ? search['domain'] : []);
|
var domain = this.domain.concat(search && search['domain'] ? search['domain'] : []);
|
||||||
var context = _.extend(this.context, search && search['context'] ? search['context'] : {});
|
var context = _.extend(this.context, search && search['context'] ? search['context'] : {});
|
||||||
this.root = new mail.Widget(this, {
|
this.root = new mail.Widget(this, _.extend(this.options, {
|
||||||
'domain' : domain,
|
'domain' : domain,
|
||||||
'context' : context,
|
'context' : context,
|
||||||
'display_indented_thread': 1,
|
'display_indented_thread': 1,
|
||||||
|
@ -1549,22 +1558,21 @@ openerp.mail = function (session) {
|
||||||
'show_read_unread_button': true,
|
'show_read_unread_button': true,
|
||||||
'show_compose_message': true,
|
'show_compose_message': true,
|
||||||
'show_compact_message': this.context.view_mailbox ? false : 1,
|
'show_compact_message': this.context.view_mailbox ? false : 1,
|
||||||
}
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
return this.root.replace(this.$('.oe_mail-placeholder'));
|
return this.root.replace(this.$('.oe_mail-placeholder'));
|
||||||
},
|
},
|
||||||
|
|
||||||
bind_events: function () {
|
bind_events: function () {
|
||||||
var self=this;
|
var self=this;
|
||||||
this.$(".oe_write_full").click(function(){ self.root.thread.compose_message.on_compose_fullmail(); });
|
this.$(".oe_write_full").click( function() { self.root.thread.compose_message.on_compose_fullmail(); });
|
||||||
this.$(".oe_write_onwall").click(function(){ self.root.thread.on_compose_message(); });
|
this.$(".oe_write_onwall").click( function() { self.root.thread.on_compose_message(); });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
* UserMenu
|
* UserMenu
|
||||||
* ------------------------------------------------------------
|
* ------------------------------------------------------------
|
||||||
*
|
*
|
||||||
|
@ -1603,5 +1611,4 @@ openerp.mail = function (session) {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<!-- this template contains the mail widget and is used to namespace the css -->
|
<!--
|
||||||
<t t-name="mail.Widget">
|
mail.Widget template used to namespace the css -->
|
||||||
|
<t t-name="mail.Root">
|
||||||
<div class="oe_mail">
|
<div class="oe_mail">
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
|
@ -185,7 +186,7 @@
|
||||||
|
|
||||||
<!-- default layout -->
|
<!-- default layout -->
|
||||||
<t t-name="mail.thread.message">
|
<t t-name="mail.thread.message">
|
||||||
<div t-attf-class="oe_msg #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} oe_msg_#{widget.type} oe_msg_#{widget.to_read?'unread':'read'}">
|
<div t-attf-class="oe_msg #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} oe_msg_#{widget.type}">
|
||||||
|
|
||||||
<div class='oe_msg_left'>
|
<div class='oe_msg_left'>
|
||||||
<a t-attf-href="#model=res.partner&id=#{widget.author_id[0]}" t-att-title="widget.author_id[1]">
|
<a t-attf-href="#model=res.partner&id=#{widget.author_id[0]}" t-att-title="widget.author_id[1]">
|
||||||
|
@ -195,8 +196,8 @@
|
||||||
|
|
||||||
<div class="oe_msg_center">
|
<div class="oe_msg_center">
|
||||||
<div class='oe_msg_icons'>
|
<div class='oe_msg_icons'>
|
||||||
<span class='oe_read' t-if="widget.options.show_read_unread_button"><a title="Read" class="oe_e">X</a></span>
|
<span class='oe_read' t-if="widget.options.show_read"><a title="Read" class="oe_e">X</a></span>
|
||||||
<span class='oe_unread' t-if="widget.options.show_read_unread_button"><a title="Set back to unread" class="oe_e">v</a></span>
|
<span class='oe_unread' t-if="widget.options.show_unread"><a title="Set back to unread" class="oe_e">v</a></span>
|
||||||
<span class='oe_reply' t-if="widget.options.show_reply_button"><a title="Reply" class="oe_e">(</a></span>
|
<span class='oe_reply' t-if="widget.options.show_reply_button"><a title="Reply" class="oe_e">(</a></span>
|
||||||
<span t-attf-class="oe_star #{widget.is_favorite?'oe_starred':''}"><a title="Add To Favorites" class="oe_e">7</a></span>
|
<span t-attf-class="oe_star #{widget.is_favorite?'oe_starred':''}"><a title="Add To Favorites" class="oe_e">7</a></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -232,7 +233,7 @@
|
||||||
|
|
||||||
<!-- expandable message layout -->
|
<!-- expandable message layout -->
|
||||||
<t t-name="mail.thread.expandable">
|
<t t-name="mail.thread.expandable">
|
||||||
<div t-attf-class="oe_msg oe_msg_#{widget.type} #{widget.max_limit ? 'oe_max_limit' : ''} #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''} oe_msg_unread">
|
<div t-attf-class="oe_msg oe_msg_#{widget.type} #{widget.max_limit ? 'oe_max_limit' : ''} #{widget.thread_level and widget.options.display_indented_thread > -1 ? 'oe_msg_indented' : ''}">
|
||||||
<div class="oe_msg_content oe_msg_more_message">
|
<div class="oe_msg_content oe_msg_more_message">
|
||||||
<div class='oe_separator'></div>
|
<div class='oe_separator'></div>
|
||||||
<a t-if="widget.nb_messages <= 0" class="oe_msg_fetch_more">show more message</a>
|
<a t-if="widget.nb_messages <= 0" class="oe_msg_fetch_more">show more message</a>
|
||||||
|
|
Loading…
Reference in New Issue