Commit 889f5002 authored by Nicolas Delaby's avatar Nicolas Delaby

redirect with same context

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20169 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8e650d71
...@@ -358,7 +358,6 @@ class OOoChartWidget(Widget.Widget): ...@@ -358,7 +358,6 @@ class OOoChartWidget(Widget.Widget):
# Find the applicable context # Find the applicable context
form = field.aq_parent form = field.aq_parent
here = getattr(form, 'aq_parent', REQUEST) here = getattr(form, 'aq_parent', REQUEST)
# Update the render format based on REQUEST parameters # Update the render format based on REQUEST parameters
render_format = getattr(REQUEST, 'render_format', render_format) render_format = getattr(REQUEST, 'render_format', render_format)
...@@ -373,25 +372,36 @@ class OOoChartWidget(Widget.Widget): ...@@ -373,25 +372,36 @@ class OOoChartWidget(Widget.Widget):
display = field.get_value('image_display') display = field.get_value('image_display')
if format in STANDARD_IMAGE_FORMAT_LIST: if format in STANDARD_IMAGE_FORMAT_LIST:
main_content = '''<div class="OOoChartContent"> main_content = '''<div class="OOoChartContent">
<img class="%s" src="%s?render_format=%s&display=%s" title="%s" alt="%s"/"> <img class="%s" src="%s/%s/%s?render_format=%s&display=%s" title="%s" alt="%s"/">
</div>''' % (css_class, field.absolute_url(), format, display, title, alternate_name) </div>''' % (css_class,
here.absolute_url(),
form.getId(),
field.getId(),
format,
display,
title,
alternate_name)
return main_content return main_content
if format == 'raw': if format == 'raw':
main_content = '''<div class="OOoChartContent"> main_content = '''<div class="OOoChartContent">
<a href="%s?render_format=&display=%s"><img src="%s" alt="OOo"/></a></div> <a href="%s/%s/%s?render_format=&display=%s"><img src="%s" alt="OOo"/></a></div>
''' % (field.absolute_url(), display, UrlIconOOo) ''' % (here.absolute_url(),
form.getId(),
field.getId(),
display,
UrlIconOOo)
return main_content return main_content
if format == 'pdf': if format == 'pdf':
main_content = '''<div class="OOoChartContent"> main_content = '''<div class="OOoChartContent">
<a href="%s?render_format=pdf&display=%s"><img src="%s" alt="PDF" /></a> <a href="%s/%s/%s?render_format=pdf&display=%s"><img src="%s" alt="PDF" /></a>
</div>''' % (field.absolute_url(), display, UrlIconPdf) </div>''' % (here.absolute_url(),
form.getId(),
field.getId(),
display,
UrlIconPdf)
return main_content return main_content
# Find the applicable context
form = field.aq_parent
here = getattr(form, 'aq_parent', REQUEST)
def stringBoolean(value): def stringBoolean(value):
return str(bool(value)).lower() return str(bool(value)).lower()
...@@ -432,7 +442,6 @@ class OOoChartWidget(Widget.Widget): ...@@ -432,7 +442,6 @@ class OOoChartWidget(Widget.Widget):
method_id = field.get_value('ooo_template') method_id = field.get_value('ooo_template')
# Find the page template # Find the page template
ooo_template = getattr(here, method_id) ooo_template = getattr(here, method_id)
# Render the chart # Render the chart
return ooo_template(format=render_format) return ooo_template(format=render_format)
......
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