[IMP] mail: Wall: composition form is now a mail.compose.message form view, as for Chatter.

bzr revid: tde@openerp.com-20120711131430-1j6zb6vnp0z8jkz8
This commit is contained in:
Thibault Delavallée 2012-07-11 15:14:30 +02:00
parent 11b452ed00
commit 087f19220f
1 changed files with 17 additions and 2 deletions

View File

@ -876,15 +876,30 @@ openerp.mail = function(session) {
this.add_event_handlers();
// load mail.message search view
var search_view_ready = this.load_search_view(this.params.search_view_id, {}, false);
// load composition form
var compose_done = this.instantiate_composition_form();
// fetch first threads
var comments_ready = this.init_and_fetch_comments(this.params.limit, 0);
return (search_view_ready && comments_ready);
return (search_view_ready && comments_ready && compose_done);
},
stop: function () {
this._super.apply(this, arguments);
},
instantiate_composition_form: function(mode, msg_id) {
if (this.compose_message_widget) {
this.compose_message_widget.destroy();
}
this.compose_message_widget = new mail.ComposeMessage(this, {
'extended_mode': false, 'uid': this.session.uid, 'res_model': 'res.users',
'res_id': this.session.uid, 'mode': mode || 'comment', 'msg_id': msg_id });
var composition_node = this.$element.find('div.oe_mail_wall_action');
composition_node.empty();
var compose_done = this.compose_message_widget.appendTo(composition_node);
return compose_done;
},
/** Add events */
add_event_handlers: function () {
var self = this;