Back to index

plone3  3.1.7
rejectItems.py
Go to the documentation of this file.
00001 ## Script (Python) "rejectItems"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=items, comment=''
00008 ##title=
00009 ##
00010 from Products.CMFCore.utils import getToolByName
00011 
00012 wtool = getToolByName(script, 'portal_workflow')
00013 for path in items:
00014     object = context.restrictedTraverse( path )
00015     wtool.doActionFor( object, 'reject', comment=comment )
00016 
00017 context.REQUEST[ 'RESPONSE' ].redirect( '%s/review?%s'
00018                    % ( context.portal_url()
00019                      , 'portal_status_message=Items+rejected.'
00020                      ) )