Commit 97590001 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add dialog_category only if this is an object action.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@666 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 534d2e23
##parameters=action_select, form_id='', selection_index='', selection_name='', uids=None, listbox_uid=None ##parameters=action_select, form_id='', selection_index='', selection_name='', uids=None, listbox_uid=None
import string
doAction = action_select.split() doAction = action_select.split()
doAction0 = doAction[0] doAction0 = doAction[0]
request = context.REQUEST request = context.REQUEST
...@@ -9,16 +7,21 @@ request = context.REQUEST ...@@ -9,16 +7,21 @@ request = context.REQUEST
# First, update checked uids if uids is not None. # First, update checked uids if uids is not None.
context.portal_selections.updateSelectionCheckedUidList(selection_name, uids=uids, listbox_uid=listbox_uid, REQUEST=request) context.portal_selections.updateSelectionCheckedUidList(selection_name, uids=uids, listbox_uid=listbox_uid, REQUEST=request)
# If single word, then jump to that view # If this is an object, a workflow or a folder, then jump to that view
if len(doAction) == 1: if doAction0 in ('object', 'workflow', 'folder'):
if doAction0.find('?') >= 0: uri = ' '.join(doAction[1:])
return request.RESPONSE.redirect('%s&form_id=%s&selection_index=%s&selection_name=%s' % (doAction0, form_id, selection_index, selection_name)) if uri.find('?') >= 0:
uri += '&'
else: else:
return request.RESPONSE.redirect('%s?form_id=%s&selection_index=%s&selection_name=%s' % (doAction0, form_id, selection_index, selection_name)) uri += '?'
uri += 'form_id=%s&selection_index=%s&selection_name=%s' % (form_id, selection_index, selection_name)
if doAction0 == 'object':
uri += '&dialog_category=object_action'
return request.RESPONSE.redirect(uri)
# Otherwise, check if this is an automatic menu (add) # Otherwise, check if this is an automatic menu (add)
elif doAction0 == 'add': elif doAction0 == 'add':
new_id = context.generateNewId() new_id = context.generateNewId()
context.portal_types.constructContent(type_name=string.join(doAction[1:],' '), context.portal_types.constructContent(type_name=' '.join(doAction[1:]),
container=context, container=context,
id=str(new_id), id=str(new_id),
RESPONSE=request.RESPONSE) RESPONSE=request.RESPONSE)
......
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