Last change
on this file since 1505 was
822,
checked in by koval, 17 years ago
|
little change in member properties extraction
|
File size:
908 bytes
|
Line | |
---|
1 | ## Script (Python) "prefs_recent_comments_publish" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters= |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | from Products.CMFCore.utils import getToolByName |
---|
11 | from quintagroup.plonecomments.utils import publishDiscussion, manage_mails, setStatusMsg |
---|
12 | from Products.CMFPlone import MessageFactory |
---|
13 | _ = MessageFactory('quintagroup.plonecomments') |
---|
14 | |
---|
15 | request = context.REQUEST |
---|
16 | |
---|
17 | comment_ids = request.get('ids', []) |
---|
18 | portal_catalog = getToolByName(context, "portal_catalog") |
---|
19 | |
---|
20 | for comment_id in comment_ids: |
---|
21 | comment = portal_catalog(id=comment_id,portal_type='Discussion Item')[0].getObject() |
---|
22 | publishDiscussion(comment) |
---|
23 | manage_mails(comment, container, action='publishing') |
---|
24 | |
---|
25 | msg = comment_ids and _(u'Comment(s) published.') or _(u'Please select items to be processed.') |
---|
26 | setStatusMsg(state, context, msg) |
---|
27 | |
---|
28 | return state |
---|
Note: See
TracBrowser
for help on using the repository browser.