Commit 0c49ba1c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

make the URL shorter.

* omit '/view'.
* omit ignore_layout:int=0.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40428 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cf17c961
......@@ -644,7 +644,11 @@ class SelectionTool( BaseTool, SimpleItem ):
else:
url = REQUEST.getURL()
ignore_layout = int(REQUEST.get('ignore_layout', 0))
url = '%s/%s?selection_index=%s&selection_name=%s&ignore_layout:int=%s' % (url, form_id, 0, selection_name, ignore_layout)
if form_id != 'view':
url += '/%s' % form_id
url += '?selection_index=%s&selection_name=%s' % (0, selection_name)
if ignore_layout:
url += '&ignore_layout:int=1'
REQUEST.RESPONSE.redirect(url)
security.declareProtected(ERP5Permissions.View, 'viewLast')
......@@ -667,7 +671,11 @@ class SelectionTool( BaseTool, SimpleItem ):
else:
url = REQUEST.getURL()
ignore_layout = int(REQUEST.get('ignore_layout', 0))
url = '%s/%s?selection_index=%s&selection_name=%s&ignore_layout:int=%s' % (url, form_id, -1, selection_name, ignore_layout)
if form_id != 'view':
url += '/%s' % form_id
url += '?selection_index=%s&selection_name=%s' % (-1, selection_name)
if ignore_layout:
url += '&ignore_layout:int=1'
REQUEST.RESPONSE.redirect(url)
security.declareProtected(ERP5Permissions.View, 'viewNext')
......@@ -690,7 +698,12 @@ class SelectionTool( BaseTool, SimpleItem ):
else:
url = REQUEST.getURL()
ignore_layout = int(REQUEST.get('ignore_layout', 0))
url = '%s/%s?selection_index=%s&selection_name=%s&ignore_layout:int=%s' % (url, form_id, int(selection_index) + 1, selection_name, ignore_layout)
if form_id != 'view':
url += '/%s' % form_id
url += '?selection_index=%s&selection_name=%s' % (int(selection_index)+1,
selection_name)
if ignore_layout:
url += '&ignore_layout:int=1'
REQUEST.RESPONSE.redirect(url)
security.declareProtected(ERP5Permissions.View, 'viewPrevious')
......@@ -713,7 +726,12 @@ class SelectionTool( BaseTool, SimpleItem ):
else:
url = REQUEST.getURL()
ignore_layout = int(REQUEST.get('ignore_layout', 0))
url = '%s/%s?selection_index=%s&selection_name=%s&ignore_layout:int=%s' % (url, form_id, int(selection_index) - 1, selection_name, ignore_layout)
if form_id != 'view':
url += '/%s' % form_id
url += '?selection_index=%s&selection_name=%s' % (int(selection_index)-1,
selection_name)
if ignore_layout:
url += '&ignore_layout:int=1'
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