Commit b80d12d3 authored by Sebastien Robin's avatar Sebastien Robin

submit pickle into html instead of cookie

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@866 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cec1ac58
No related merge requests found
##parameters=form_id,cancel_url,dialog_method,selection_name,dialog_id,enable_cookie=0,**kw
##parameters=form_id,cancel_url,dialog_method,selection_name,dialog_id,enable_pickle=0,**kw
# Updates attributes of an Zope document
# which is in a class inheriting from ERP5 Base
......@@ -24,7 +24,11 @@ if dialog_method == 'base_sort_on':
try:
# Validate the form
kw = context.portal_selections.getCookieInfo(request,dialog_id)
kw = {}
if request.has_key('pickle_string'):
pickle_string = request.get('pickle_string')
kw = context.portal_selections.getObjectFromPickle(pickle_string)
#kw = context.portal_selections.getCookieInfo(request,dialog_id)
if kw != {}:
form = getattr(context.asContext(context=None,portal_type=context.getPortalType(),**kw),dialog_id)
else:
......@@ -59,8 +63,9 @@ try:
listbox_line_list.append(listbox[key])
listbox_line_list = tuple(listbox_line_list)
kw['listbox'] = listbox_line_list
if enable_cookie:
context.portal_selections.setCookieInfo(request,dialog_id,**kw)
if enable_pickle:
pickle_string = context.portal_selections.getPickle(**kw)
request.set('pickle_string', pickle_string)
# Redirect if possible, or call directly else
if kw.has_key('import_file'):
# We can not redirect if we do an import
......
......@@ -4,4 +4,4 @@
# dialog pages wich is only used for udpates
dialog_method = update_method
return context.base_dialog(form_id,cancel_url,dialog_method,selection_name,dialog_id,enable_cookie=1)
return context.base_dialog(form_id,cancel_url,dialog_method,selection_name,dialog_id,enable_pickle=1)
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