Last change
on this file since 613 was
1,
checked in by myroslav, 18 years ago
|
Building directory structure
|
-
Property svn:eol-style set to
native
|
File size:
848 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 Products.qPloneComments.utils import publishDiscussion, manage_mails |
---|
12 | from Products.qPloneComments.utils import setStatusMsg |
---|
13 | |
---|
14 | request = context.REQUEST |
---|
15 | |
---|
16 | comment_ids = request.get('ids', []) |
---|
17 | portal_catalog = getToolByName(context, "portal_catalog") |
---|
18 | |
---|
19 | for comment_id in comment_ids: |
---|
20 | comment = portal_catalog(id=comment_id,portal_type='Discussion Item')[0].getObject() |
---|
21 | publishDiscussion(comment) |
---|
22 | manage_mails(comment, container, action='publishing') |
---|
23 | |
---|
24 | msg = comment_ids and u'Comment(s) published.' or u'Please select items to be processed.' |
---|
25 | setStatusMsg(state, context, msg) |
---|
26 | |
---|
27 | return state |
---|
Note: See
TracBrowser
for help on using the repository browser.