## Script (Python) "folder_delete"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=ids=[], REQUEST=None
##title=
##
# $Id: approve_checked.py 573 2006-09-27 21:45:50Z joachim $
"""
FIXME: add docstring.
"""

ret_url = context.absolute_url() + '/academics_index'

if ids:
    for id in ids:
        ob = getattr(context, id)
        if context.portal_workflow.getInfoFor(ob,'review_state',None) == "unchecked":
            ob.content_status_modify(workflow_action="approve")
    message = 'portal_status_message=workflow status changed'
else:
    message = 'portal_status_message=psm_select_at_least_one_document'

if REQUEST is not None:
    return REQUEST.RESPONSE.redirect(ret_url + '?' + message)
