source: WAeUP_SRP/trunk/skins/waeup_custom/folder_delete.py @ 1620

Last change on this file since 1620 was 1366, checked in by joachim, 18 years ago

M profiles/default/schemas/certificate_course.xml
make level searchable
M profiles/default/layouts/course.xml
add code to course layout to allow creation
M skins/waeup_default/waeup_edit.py
M skins/waeup_default/waeup_document_create_do.py
M skins/waeup_custom/folder_delete.py
fix that courses_catalog also get updated
M skins/waeup_academics/courses_view.pt
M skins/waeup_academics/getCoursesInfo.py
use courses catalog.

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1## Script (Python) "folder_delete"
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 1366 2007-01-27 15:40:19Z joachim $
11"""
12FIXME: add docstring.
13"""
14
15from Products.CMFCore.utils import getToolByName
16here = context
17if context.portal_type == "University":
18    here = context.academics
19
20ti = getToolByName(here, 'portal_types').getTypeInfo(here.portal_type)
21meth_id = ti.queryMethodID('view', 'folder_contents')
22ret_url = here.absolute_url() + '/' + meth_id
23
24
25if ids:
26    for id in ids:
27        # XXX has to be called from here since the workflow doesn't handle the
28        # deletion yet
29        if context.portal_type == "CoursesFolder":
30            context.courses_catalog.deleteRecord(id)
31        ob = getattr(here, id)
32        from Products.CPSCore.EventServiceTool import getPublicEventService
33        evtool = getPublicEventService(here)
34        evtool.notifyEvent('workflow_delete', ob, {})
35    here.manage_delObjects(ids)
36    message = 'portal_status_message=psm_item(s)_deleted'
37else:
38    message = 'portal_status_message=psm_select_at_least_one_document'
39
40if REQUEST is not None:
41    return REQUEST.RESPONSE.redirect(ret_url + '?' + message)
Note: See TracBrowser for help on using the repository browser.