Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
4ded2a2b
Commit
4ded2a2b
authored
Jan 18, 2013
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New Base_redirect parameter to 'raise Redirect' and deprecate ERP5Site_redirect
parent
3b7aa99e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
35 deletions
+18
-35
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_redirect.xml
...plateItem/portal_skins/erp5_xhtml_style/Base_redirect.xml
+14
-8
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ERP5Site_redirect.xml
...eItem/portal_skins/erp5_xhtml_style/ERP5Site_redirect.xml
+3
-26
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+1
-1
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Base_redirect.xml
View file @
4ded2a2b
...
@@ -60,17 +60,20 @@
...
@@ -60,17 +60,20 @@
TODO: improve API and extensively document. ERP5Site_redirect may \n
TODO: improve API and extensively document. ERP5Site_redirect may \n
be redundant.\n
be redundant.\n
"""\n
"""\n
# BBB: originally, form_id was the first positional argument\n
if not redirect_url or \'/\' not in redirect_url:\n
form_id = redirect_url or kw.pop(\'form_id\', None)\n
redirect_url = context.absolute_url()\n
if form_id:\n
redirect_url += \'/\' + form_id\n
\n
from ZTUtils import make_query\n
from ZTUtils import make_query\n
request_form = context.REQUEST.form\n
request = context.getPortalObject().REQUEST\n
request_form = request.form\n
request_form.update(kw)\n
request_form.update(kw)\n
request_form = context.ERP5Site_filterParameterList(request_form)\n
request_form = context.ERP5Site_filterParameterList(request_form)\n
request_form.update(keep_items)\n
request_form.update(keep_items)\n
\n
\n
if form_id == \'view\':\n
redirect_url = context.absolute_url()\n
else:\n
redirect_url = \'%s/%s\' % (context.absolute_url(), form_id)\n
\n
parameters = make_query(dict([(k, v) for k, v in request_form.items() if k and v is not None]))\n
parameters = make_query(dict([(k, v) for k, v in request_form.items() if k and v is not None]))\n
if len(parameters):\n
if len(parameters):\n
if \'?\' in redirect_url:\n
if \'?\' in redirect_url:\n
...
@@ -79,14 +82,17 @@ if len(parameters):\n
...
@@ -79,14 +82,17 @@ if len(parameters):\n
separator = \'?\'\n
separator = \'?\'\n
redirect_url = \'%s%s%s\' % (redirect_url, separator, parameters)\n
redirect_url = \'%s%s%s\' % (redirect_url, separator, parameters)\n
\n
\n
return context.REQUEST.RESPONSE.redirect( redirect_url )\n
if abort_transaction:\n
from zExceptions import Redirect\n
raise Redirect(redirect_url)\n
return request.RESPONSE.redirect(redirect_url)\n
]]>
</string>
</value>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
form_id=\'view\', keep_items={}
, **kw
</string>
</value>
<value>
<string>
redirect_url=None, keep_items=(), abort_transaction=False
, **kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ERP5Site_redirect.xml
View file @
4ded2a2b
...
@@ -50,35 +50,12 @@
...
@@ -50,35 +50,12 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string>
return context.getPortalObject().Base_redirect(redirect_url, keep_items, **kw)\n
</string>
</value>
from ZTUtils import make_query\n
request_form = context.REQUEST.form\n
request_form.update(kw)\n
request_form = context.ERP5Site_filterParameterList(request_form)\n
request_form.update(keep_items)\n
\n
# JPS-XXX Why ERP5Site ? not Base ? \n
\n
if redirect_url is None:\n
redirect_url = context.getPortalObject().absolute_url()\n
\n
parameters = make_query(dict([(k, v) for k, v in request_form.items() if k and v is not None]))\n
if len(parameters):\n
if \'?\' in redirect_url:\n
separator = \'&\'\n
else:\n
separator = \'?\'\n
redirect_url = \'%s%s%s\' % (redirect_url, separator, parameters)\n
\n
return context.REQUEST.RESPONSE.redirect( redirect_url )\n
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
redirect_url=None, keep_items=
{}
, **kw
</string>
</value>
<value>
<string>
redirect_url=None, keep_items=
()
, **kw
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
View file @
4ded2a2b
1092
1093
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment