diff --git a/product/ERP5/skins/erp5_core/base_folder_delete.py b/product/ERP5/skins/erp5_core/base_folder_delete.py index c553dcd70c98f208ffe6019a6f98e28def0e99ef..4300501b867ce24f2df75fa6578a5f09dd30c685 100755 --- a/product/ERP5/skins/erp5_core/base_folder_delete.py +++ b/product/ERP5/skins/erp5_core/base_folder_delete.py @@ -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) diff --git a/product/ERP5/skins/erp5_core/base_list_dialog.py b/product/ERP5/skins/erp5_core/base_list_dialog.py index bf6d89bdeb8827dc80270c91d58c9257928e2bad..fe2765b1b0b4a4025961f106d52e7d4e91bbefa5 100755 --- a/product/ERP5/skins/erp5_core/base_list_dialog.py +++ b/product/ERP5/skins/erp5_core/base_list_dialog.py @@ -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')) diff --git a/product/ERP5/skins/erp5_core/folder_delete.py b/product/ERP5/skins/erp5_core/folder_delete.py index e32a89fc3d4690f2b0d13082fecba63789ca3cd5..2908531f745e9b5a7160574a9dbb45add48da210 100755 --- a/product/ERP5/skins/erp5_core/folder_delete.py +++ b/product/ERP5/skins/erp5_core/folder_delete.py @@ -1,23 +1,23 @@ ## 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: