Changeset 337 for WAeUP_SRP/trunk/skins/waeup_custom
- Timestamp:
- 18 Jul 2006, 13:49:01 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_custom/folder_delete.py
r333 r337 1 1 ## Script (Python) "folder_delete" 2 ##title=Delete objects from a folder 3 ##parameters= 4 REQUEST=context.REQUEST 5 ret_url = context.absolute_url() + '/academics_contents' 2 ##bind container=container 3 ##bind context=context 4 ##bind namespace= 5 ##bind script=script 6 ##bind subpath=traverse_subpath 7 ##parameters=ids=[], REQUEST=None 8 ##title= 9 ## 10 # $Id: folder_delete.py 30246 2005-12-02 20:10:18Z fguillaume $ 11 """ 12 FIXME: add docstring. 13 """ 6 14 7 if REQUEST.has_key( 'ids' ): 8 context.manage_delObjects( REQUEST['ids'] ) 9 qs = '?portal_status_message=Deleted.' 15 from Products.CMFCore.utils import getToolByName 10 16 17 ti = getToolByName(context, 'portal_types').getTypeInfo(context.portal_type) 18 meth_id = ti.queryMethodID('view', 'folder_contents') 19 ret_url = context.absolute_url() + '/' + meth_id 20 21 if ids: 22 for id in ids: 23 # XXX has to be called from here since the workflow doesn't handle the 24 # deletion yet 25 ob = getattr(context, id) 26 from Products.CPSCore.EventServiceTool import getPublicEventService 27 evtool = getPublicEventService(context) 28 evtool.notifyEvent('workflow_delete', ob, {}) 29 context.manage_delObjects(ids) 30 message = 'portal_status_message=psm_item(s)_deleted' 11 31 else: 12 qs = '?portal_status_message=Please+select+one+or+more+items+first.'32 message = 'portal_status_message=psm_select_at_least_one_document' 13 33 14 15 return REQUEST.RESPONSE.redirect( ret_url + qs)34 if REQUEST is not None: 35 return REQUEST.RESPONSE.redirect(ret_url + '?' + message)
Note: See TracChangeset for help on using the changeset viewer.