Browse Source
Merge pull request #369 from yvaucher/9.0-port-web_send_message_popup
Merge pull request #369 from yvaucher/9.0-port-web_send_message_popup
[9.0] [PORT] web_send_message_popuppull/290/head
Guewen Baconnier
9 years ago
5 changed files with 103 additions and 50 deletions
-
59web_send_message_popup/README.rst
-
46web_send_message_popup/__openerp__.py
-
29web_send_message_popup/static/src/js/chatter.js
-
11web_send_message_popup/static/src/xml/mail.xml
-
8web_send_message_popup/views/web_send_message_popup.xml
@ -0,0 +1,59 @@ |
|||||
|
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
||||
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
========================= |
||||
|
Web Send Message as Popup |
||||
|
========================= |
||||
|
|
||||
|
In the email/notes threads below the form views, the link 'Send a |
||||
|
message' unfold a text field. From there, a button allows to open the |
||||
|
text field in a full featured email popup with the subject, templates, |
||||
|
attachments and followers. |
||||
|
|
||||
|
This module changes the link 'Send a message' so it opens directly the |
||||
|
full featured popup instead of the text field, avoiding an extra click |
||||
|
if the popup is always wanted. |
||||
|
|
||||
|
|
||||
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas |
||||
|
:alt: Try me on Runbot |
||||
|
:target: https://runbot.odoo-community.org/runbot/162/9.0 |
||||
|
|
||||
|
|
||||
|
Bug Tracker |
||||
|
=========== |
||||
|
|
||||
|
Bugs are tracked on `GitHub Issues |
||||
|
<https://github.com/OCA/web/issues>`_. In case of trouble, please |
||||
|
check there if your issue has already been reported. If you spotted it first, |
||||
|
help us smashing it by providing a detailed and welcomed feedback. |
||||
|
|
||||
|
Credits |
||||
|
======= |
||||
|
|
||||
|
Images |
||||
|
------ |
||||
|
|
||||
|
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. |
||||
|
|
||||
|
Contributors |
||||
|
------------ |
||||
|
|
||||
|
* Guewen Baconnier <guewen.baconnier@camptocamp.com> |
||||
|
* Yannick Vaucher <yannick.vaucher@camptocamp.com> |
||||
|
|
||||
|
Maintainer |
||||
|
---------- |
||||
|
|
||||
|
.. image:: https://odoo-community.org/logo.png |
||||
|
:alt: Odoo Community Association |
||||
|
:target: https://odoo-community.org |
||||
|
|
||||
|
This module is maintained by the OCA. |
||||
|
|
||||
|
OCA, or the Odoo Community Association, is a nonprofit organization whose |
||||
|
mission is to support the collaborative development of Odoo features and |
||||
|
promote its widespread use. |
||||
|
|
||||
|
To contribute to this module, please visit https://odoo-community.org. |
@ -1,49 +1,17 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
############################################################################## |
|
||||
# |
|
||||
# Author: Guewen Baconnier |
|
||||
# Copyright 2014 Camptocamp SA |
|
||||
# |
|
||||
# This program is free software: you can redistribute it and/or modify |
|
||||
# it under the terms of the GNU Affero General Public License as |
|
||||
# published by the Free Software Foundation, either version 3 of the |
|
||||
# License, or (at your option) any later version. |
|
||||
# |
|
||||
# This program is distributed in the hope that it will be useful, |
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
# GNU Affero General Public License for more details. |
|
||||
# |
|
||||
# You should have received a copy of the GNU Affero General Public License |
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
|
||||
|
# © 2014-2016 Camptocamp SA |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
{'name': 'Web Send Message as Popup', |
{'name': 'Web Send Message as Popup', |
||||
'version': '1.0', |
|
||||
'author': "Camptocamp,Odoo Community Association (OCA)", |
|
||||
|
'version': '9.0.1.0.0', |
||||
|
'author': "Camptocamp, Odoo Community Association (OCA)", |
||||
'maintainer': 'Camptocamp', |
'maintainer': 'Camptocamp', |
||||
'license': 'AGPL-3', |
'license': 'AGPL-3', |
||||
'category': 'Hidden', |
'category': 'Hidden', |
||||
'depends': ['web', |
'depends': ['web', |
||||
], |
], |
||||
'description': """ |
|
||||
Web Send Message as Popup |
|
||||
========================= |
|
||||
|
|
||||
In the email/notes threads below the form views, the link 'Send a |
|
||||
message' unfold a text field. From there, a button allows to open the |
|
||||
text field in a full featured email popup with the subject, templates, |
|
||||
attachments and followers. |
|
||||
|
|
||||
This module changes the link 'Send a message' so it opens directly the |
|
||||
full featured popup instead of the text field, avoiding an extra click |
|
||||
if the popup is always wanted. |
|
||||
|
|
||||
""", |
|
||||
'website': 'http://www.camptocamp.com', |
'website': 'http://www.camptocamp.com', |
||||
'qweb': ['static/src/xml/mail.xml', |
|
||||
|
'data': ['views/web_send_message_popup.xml' |
||||
], |
], |
||||
'installable': False, |
|
||||
|
'installable': True, |
||||
'auto_install': False, |
'auto_install': False, |
||||
} |
|
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
/* © 2016 Camptocamp SA |
||||
|
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
||||
|
odoo.define('web_send_message_popup.Chatter', function (require) { |
||||
|
"use strict"; |
||||
|
|
||||
|
var core = require('web.core'); |
||||
|
var composer = require('mail.composer'); |
||||
|
var Chatter = core.form_widget_registry.get('mail_thread'); |
||||
|
|
||||
|
Chatter.include({ |
||||
|
on_open_composer_new_message: function () { |
||||
|
var self = this; |
||||
|
this.open_composer(); |
||||
|
// wait for composer input to be initialized
|
||||
|
// taken from http://stackoverflow.com/questions/7307983/while-variable-is-not-defined-wait
|
||||
|
function checkVariable() { |
||||
|
if (typeof self.composer !== 'undefined' && typeof self.composer.$input !== 'undefined') { |
||||
|
self.composer.on_open_full_composer(); |
||||
|
} |
||||
|
else { |
||||
|
setTimeout(function() { |
||||
|
checkVariable(); |
||||
|
}, 50); |
||||
|
} |
||||
|
} |
||||
|
checkVariable(); |
||||
|
} |
||||
|
}); |
||||
|
}); |
@ -1,11 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<template> |
|
||||
<t t-extend="mail.compose_message"> |
|
||||
<t t-jquery="a.oe_compose_post:eq(0)" t-operation="replace"> |
|
||||
<a class="oe_compose_post oe_full" t-if="widget.options.compose_placeholder"><t t-raw="widget.options.compose_placeholder"/></a> |
|
||||
</t> |
|
||||
<t t-jquery="a.oe_compose_post:eq(1)" t-operation="replace"> |
|
||||
<a class="oe_compose_post oe_full" t-if="!widget.options.compose_placeholder and !widget.options.view_mailbox">Send a message</a> |
|
||||
</t> |
|
||||
</t> |
|
||||
</template> |
|
@ -0,0 +1,8 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<odoo> |
||||
|
<template id="assets_backend" name="web_send_message_popup assets" inherit_id="web.assets_backend"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<script type="text/javascript" src="/web_send_message_popup/static/src/js/chatter.js"></script> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue