Commit bbc9659c authored by Nicolas Delaby's avatar Nicolas Delaby

Authorised report rendering with ERP5Form for deferred_style

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29175 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 806cedba
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>erp5_deferred_style</skin_folder>
<skin_selection>Deferred</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
......@@ -12,18 +12,7 @@
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_registered_skin_selections</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>tokens</string> </value>
</item>
</dictionary>
</tuple>
<tuple/>
</value>
</item>
<item>
......@@ -32,14 +21,6 @@
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_registered_skin_selections</string> </key>
<value>
<tuple>
<string>Deferred</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_deferred_style</string> </value>
......
......@@ -39,7 +39,7 @@
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
<tal:block tal:attributes="dummy python:here.Base_activateReport(report_method=report_method, form=form)"/>
<tal:block tal:attributes="dummy python:here.Base_activateReport(form=form)"/>
]]></string> </value>
</item>
......
......@@ -80,7 +80,15 @@ tag = \'active-report-%s\' % random.randint(0, 1000)\n
priority = 3\n
\n
# compute list of report section to render\n
report_section_list = report_method()\n
if form.meta_type == \'ERP5 Report\':\n
report_section_list = getattr(context, form.report_method)()\n
elif form.meta_type == \'ERP5 Form\':\n
report_section_list = []\n
for field in form.get_fields():\n
if field.getRecursiveTemplateField().meta_type == \'ReportBox\':\n
report_section_list.extend(field.render())\n
else:\n
raise ValueError, \'form meta_type unknown\'\n
\n
# save request parameters (after calling the report_method which may tweak the\n
# request). XXX we exclude some reserved names in a very ad hoc way\n
......@@ -143,7 +151,7 @@ return context.Base_redirect(\'view\', keep_items=dict(\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>report_method, form, **kw</string> </value>
<value> <string>form, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......@@ -171,13 +179,12 @@ return context.Base_redirect(\'view\', keep_items=dict(\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>report_method</string>
<string>form</string>
<string>kw</string>
<string>_getattr_</string>
......@@ -197,9 +204,12 @@ return context.Base_redirect(\'view\', keep_items=dict(\n
<string>random</string>
<string>tag</string>
<string>priority</string>
<string>getattr</string>
<string>report_section_list</string>
<string>request_other</string>
<string>_getiter_</string>
<string>field</string>
<string>ValueError</string>
<string>request_other</string>
<string>k</string>
<string>v</string>
<string>_write_</string>
......
55
\ No newline at end of file
59
\ No newline at end of file
erp5_deferred_style | Deferred
\ No newline at end of file
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