source: products/qPloneComments/branches/plone3_extend/skins/qplonecomments/prefs_recent_comments_publish.cpy @ 864

Last change on this file since 864 was 800, checked in by crchemist, 17 years ago

Deleted mistakable folder.

  • Property svn:eol-style set to native
File size: 935 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
13from Products.CMFPlone import MessageFactory
14_ = MessageFactory('plonecomments')
15
16request = context.REQUEST
17
18comment_ids = request.get('ids', [])
19portal_catalog = getToolByName(context, "portal_catalog")
20
21for comment_id in comment_ids:
22    comment = portal_catalog(id=comment_id,portal_type='Discussion Item')[0].getObject()
23    publishDiscussion(comment)
24    manage_mails(comment, container, action='publishing')
25
26msg = comment_ids and _(u'Comment(s) published.') or _(u'Please select items to be processed.')
27setStatusMsg(state, context, msg)
28
29return state
Note: See TracBrowser for help on using the repository browser.