Last change
on this file since 872 was
586,
checked in by joachim, 18 years ago
|
fixed 'zwei kleine Sachen'
|
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Rev | Line | |
---|
[333] | 1 | ## Script (Python) "folder_delete"
|
---|
[337] | 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 | ##
|
---|
[486] | 10 | # $Id: folder_delete.py 586 2006-09-28 22:10:21Z joachim $
|
---|
[337] | 11 | """
|
---|
| 12 | FIXME: add docstring.
|
---|
| 13 | """
|
---|
[333] | 14 |
|
---|
[337] | 15 | from Products.CMFCore.utils import getToolByName
|
---|
[586] | 16 | here = context
|
---|
| 17 | if context.portal_type == "University":
|
---|
| 18 | here = context.academics
|
---|
[333] | 19 |
|
---|
[586] | 20 | ti = getToolByName(here, 'portal_types').getTypeInfo(here.portal_type)
|
---|
[337] | 21 | meth_id = ti.queryMethodID('view', 'folder_contents')
|
---|
[586] | 22 | ret_url = here.absolute_url() + '/' + meth_id
|
---|
[337] | 23 |
|
---|
[586] | 24 |
|
---|
[337] | 25 | if ids:
|
---|
| 26 | for id in ids:
|
---|
| 27 | # XXX has to be called from here since the workflow doesn't handle the
|
---|
| 28 | # deletion yet
|
---|
[586] | 29 | ob = getattr(here, id)
|
---|
[337] | 30 | from Products.CPSCore.EventServiceTool import getPublicEventService
|
---|
[586] | 31 | evtool = getPublicEventService(here)
|
---|
[337] | 32 | evtool.notifyEvent('workflow_delete', ob, {})
|
---|
[586] | 33 | here.manage_delObjects(ids)
|
---|
[337] | 34 | message = 'portal_status_message=psm_item(s)_deleted'
|
---|
[333] | 35 | else:
|
---|
[337] | 36 | message = 'portal_status_message=psm_select_at_least_one_document'
|
---|
[333] | 37 |
|
---|
[337] | 38 | if REQUEST is not None:
|
---|
| 39 | return REQUEST.RESPONSE.redirect(ret_url + '?' + message)
|
---|
Note: See
TracBrowser for help on using the repository browser.