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 @@ ...@@ -4,8 +4,6 @@
request=context.REQUEST request=context.REQUEST
#return uids
selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids) selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name) uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)
...@@ -14,5 +12,4 @@ kw = {'uid': uids} ...@@ -14,5 +12,4 @@ kw = {'uid': uids}
request.set('object_uid', context.getUid()) request.set('object_uid', context.getUid())
request.set('uids', uids) request.set('uids', uids)
context.portal_selections.setSelectionParamsFor('folder_delete_selection', kw) 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) return context.folder_delete_view(uids=uids, REQUEST=request)
...@@ -46,6 +46,7 @@ if dialog_method == 'folder_delete': ...@@ -46,6 +46,7 @@ if dialog_method == 'folder_delete':
selection_index=request.get('selection_index'), selection_index=request.get('selection_index'),
object_uid=request.get('object_uid'), object_uid=request.get('object_uid'),
uids=request.get('listbox_uid'), uids=request.get('listbox_uid'),
md5_object_uid_list=request.get('md5_object_uid_list'),
cancel_url=request.get('cancel_url')) cancel_url=request.get('cancel_url'))
......
## Script (Python) "folder_delete" ## Script (Python) "folder_delete"
##title=Delete objects from a folder ##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) selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)
uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name) uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)
error = context.portal_selections.selectionHasChanged(md5_object_uid_list,uids)
#return uids
REQUEST=context.REQUEST REQUEST=context.REQUEST
REQUEST.set('uids',uids) #REQUEST.set('uids',uids)
qs = '' qs = ''
ret_url = '' ret_url = ''
if REQUEST.has_key('uids') and (len(REQUEST['uids'])>0): ret_url = context.absolute_url() + '/' + form_id
ret_url = context.absolute_url() + '/' + form_id if error:
context.manage_delObjects(uids=REQUEST['uids'], REQUEST=REQUEST) qs = '?portal_status_message=Sorry+your+selection+has+changed'
qs = '?portal_status_message=Deleted.'
# This is the case when we used the folder_delete_view page
elif uids is not None: elif uids is not None:
ret_url=cancel_url
context.manage_delObjects(uids=uids, REQUEST=REQUEST) context.manage_delObjects(uids=uids, REQUEST=REQUEST)
qs = '?portal_status_message=Deleted.' qs = '?portal_status_message=Deleted.'
else: 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