source: products/qPloneComments/trunk/skins/qplonecomments/prefs_recent_comments_publish.cpy @ 613

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##
10from Products.CMFCore.utils import getToolByName
11from Products.qPloneComments.utils import publishDiscussion, manage_mails
12from Products.qPloneComments.utils import setStatusMsg
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    manage_mails(comment, container, action='publishing')
23
24msg = comment_ids and u'Comment(s) published.' or u'Please select items to be processed.'
25setStatusMsg(state, context, msg)
26
27return state
Note: See TracBrowser for help on using the repository browser.