source: products/qPloneComments/tags/2.0/skins/qplonecomments/prefs_recent_comments_publish.cpy

Last change on this file was 1, checked in by myroslav, 19 years ago

Building directory structure

File size: 783 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
11from Products.CMFCore.utils import getToolByName
12from Products.qPloneComments.utils import publishDiscussion, send_email
13
14request = context.REQUEST
15
16comment_ids = request.get('ids')
17portal_catalog = getToolByName(context, "portal_catalog")
18
19for comment_id in comment_ids:
20    comment = portal_catalog(id=comment_id,portal_type='Discussion Item')[0].getObject()   
21    publishDiscussion(comment)
22    send_notification_message = send_email(comment, container, state="published")
23
24return state.set(portal_status_message='Comments was successfully published.')
25
Note: See TracBrowser for help on using the repository browser.