Commit fbae6898 authored by Jean-Paul Smets's avatar Jean-Paul Smets

first implementation of multi page checkd uids


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@363 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e9f712d8
##parameters=selection_name, uids ##parameters=selection_name, uids=[], listbox_uid=[]
request = context.REQUEST request = context.REQUEST
context.portal_selections.setSelectionToIds(selection_name, uids, REQUEST=request)
# Set selection to currently checked items, taking into consideration changes in uids
selection_uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name, REQUEST=request)
filtered_uid_dict = {}
listbox_uid = map(lambda x:int(x), listbox_uid)
uids = map (lambda x:int(x), uids)
for uid in uids:
filtered_uid_dict[uid] = 1
for uid in selection_uids:
if uid in listbox_uid:
if uid in uids:
filtered_uid_dict[uid] = 1
else:
filtered_uid_dict[uid] = 1
context.portal_selections.checkAll(selection_name, uids, REQUEST=None)
context.portal_selections.setSelectionToIds(selection_name, filtered_uid_dict.keys(), REQUEST=request)
url = context.portal_selections.getSelectionListUrlFor(selection_name, REQUEST=request) url = context.portal_selections.getSelectionListUrlFor(selection_name, REQUEST=request)
request.RESPONSE.redirect(url) request.RESPONSE.redirect(url)
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