Commit b94393f9 authored by Sebastien Robin's avatar Sebastien Robin

added md5 checking to folder_delete


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@722 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 98591510
......@@ -4,8 +4,6 @@
request=context.REQUEST
#return uids
selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)
......@@ -14,5 +12,4 @@ kw = {'uid': uids}
request.set('object_uid', context.getUid())
request.set('uids', uids)
context.portal_selections.setSelectionParamsFor('folder_delete_selection', kw)
#return context.folder_delete_view(REQUEST=request, uid=uids)
return context.folder_delete_view(uids=uids, REQUEST=request)
......@@ -46,6 +46,7 @@ if dialog_method == 'folder_delete':
selection_index=request.get('selection_index'),
object_uid=request.get('object_uid'),
uids=request.get('listbox_uid'),
md5_object_uid_list=request.get('md5_object_uid_list'),
cancel_url=request.get('cancel_url'))
......
## Script (Python) "folder_delete"
##title=Delete objects from a folder
##parameters=form_id='',selection_index=None,object_uid=None,selection_name=None,field_id=None,uids=None,cancel_url='',listbox_uid=[]
##parameters=form_id='',selection_index=None,object_uid=None,selection_name=None,field_id=None,uids=None,cancel_url='',listbox_uid=[],md5_object_uid_list=''
selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)
error = context.portal_selections.selectionHasChanged(md5_object_uid_list,uids)
#return uids
REQUEST=context.REQUEST
REQUEST.set('uids',uids)
#REQUEST.set('uids',uids)
qs = ''
ret_url = ''
if REQUEST.has_key('uids') and (len(REQUEST['uids'])>0):
ret_url = context.absolute_url() + '/' + form_id
context.manage_delObjects(uids=REQUEST['uids'], REQUEST=REQUEST)
qs = '?portal_status_message=Deleted.'
# This is the case when we used the folder_delete_view page
ret_url = context.absolute_url() + '/' + form_id
if error:
qs = '?portal_status_message=Sorry+your+selection+has+changed'
elif uids is not None:
ret_url=cancel_url
context.manage_delObjects(uids=uids, REQUEST=REQUEST)
qs = '?portal_status_message=Deleted.'
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment