9 |
9 |
10 from logilab.mtconverter import html_escape |
10 from logilab.mtconverter import html_escape |
11 |
11 |
12 from cubicweb.interfaces import IEmailable |
12 from cubicweb.interfaces import IEmailable |
13 from cubicweb.common.view import EntityView |
13 from cubicweb.common.view import EntityView |
14 from cubicweb.common.selectors import interface_selector, in_group_selector |
14 from cubicweb.common.selectors import implement_interface, match_user_group |
15 from cubicweb.web.action import EntityAction |
15 from cubicweb.web.action import EntityAction |
16 from cubicweb.web import stdmsgs |
16 from cubicweb.web import stdmsgs |
17 |
17 |
18 |
18 |
19 class SendEmailAction(EntityAction): |
19 class SendEmailAction(EntityAction): |
20 category = 'mainactions' |
20 category = 'mainactions' |
21 __selectors__ = (interface_selector, in_group_selector) |
21 __selectors__ = (implement_interface, match_user_group) |
22 accepts_interfaces = (IEmailable,) # XXX should check email is set as well |
22 accepts_interfaces = (IEmailable,) # XXX should check email is set as well |
23 require_groups = ('managers', 'users') |
23 require_groups = ('managers', 'users') |
24 |
24 |
25 id = 'sendemail' |
25 id = 'sendemail' |
26 title = _('send email') |
26 title = _('send email') |
33 **params) |
33 **params) |
34 |
34 |
35 |
35 |
36 class MassMailingForm(EntityView): |
36 class MassMailingForm(EntityView): |
37 id = 'massmailing' |
37 id = 'massmailing' |
38 __selectors__ = (interface_selector, in_group_selector) |
38 __selectors__ = (implement_interface, match_user_group) |
39 accepts_interfaces = (IEmailable,) |
39 accepts_interfaces = (IEmailable,) |
40 require_groups = ('managers', 'users') |
40 require_groups = ('managers', 'users') |
41 |
41 |
42 |
42 |
43 form_template = u""" |
43 form_template = u""" |