Commit 26943a88 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Improved coverage matrix report with comments and better tables

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28557 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 33ed1a8c
......@@ -56,20 +56,30 @@
<value> <string>result = []\n
\n
for r in context.contentValues(portal_type= "Requirement", sort_on = ((\'int_index\',\'ascending\', \'int\'),), checked_permission=\'View\'):\n
if not r.getRequirementRelatedValueList():\n
requirement_related_list = r.getRequirementRelatedValueList()\n
requirement_related_count = len(requirement_related_list)\n
if not requirement_related_list:\n
if not r.contentValues(portal_type= "Requirement", sort_on = ((\'int_index\',\'ascending\', \'int\'),), checked_permission=\'View\'):\n
result.append({\'requirement_reference\': r.Requirement_getDefaultReference(),\n
\'requirement_title\': r.getTitle(),\n
\'requirement_comment\': r.getComment(),\n
\'repeat_index\' : 0,\n
\'repeat_count\' : 1,\n
\'project_reference\': \'Not covered\',\n
\'project_title\': \'\',\n
\'stop_date\': None})\n
else:\n
for p in r.getRequirementRelatedValueList():\n
i = 0\n
for p in requirement_related_list:\n
result.append({\'requirement_reference\': r.Requirement_getDefaultReference(),\n
\'requirement_title\': r.getTitle(),\n
\'requirement_comment\': r.getComment(),\n
\'repeat_index\' : i,\n
\'repeat_count\' : requirement_related_count,\n
\'project_reference\': p.Project_getDefaultReference(),\n
\'project_title\': p.getTitle(),\n
\'stop_date\': p.getStopDate()})\n
i += 1\n
result.extend(r.RequirementDocument_getProjectCoverageList())\n
\n
return result\n
......@@ -114,8 +124,13 @@ return result\n
<string>_getattr_</string>
<string>context</string>
<string>r</string>
<string>requirement_related_list</string>
<string>len</string>
<string>requirement_related_count</string>
<string>None</string>
<string>i</string>
<string>p</string>
<string>_inplacevar_</string>
</tuple>
</value>
</item>
......
......@@ -51,11 +51,11 @@ AAA=</string> </value>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
\n
<office:document-content xmlns:draw=\'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\' xmlns:office=\'urn:oasis:names:tc:opendocument:xmlns:office:1.0\' xmlns:text=\'urn:oasis:names:tc:opendocument:xmlns:text:1.0\' xmlns:ooo=\'http://openoffice.org/2004/office\' xmlns:number=\'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\' xmlns:dc=\'http://purl.org/dc/elements/1.1/\' xmlns:meta=\'urn:oasis:names:tc:opendocument:xmlns:meta:1.0\' xmlns:table=\'urn:oasis:names:tc:opendocument:xmlns:table:1.0\' xmlns:dr3d=\'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\' xmlns:fo=\'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\' xmlns:style=\'urn:oasis:names:tc:opendocument:xmlns:style:1.0\' xmlns:xforms=\'http://www.w3.org/2002/xforms\' xmlns:form=\'urn:oasis:names:tc:opendocument:xmlns:form:1.0\' xmlns:script=\'urn:oasis:names:tc:opendocument:xmlns:script:1.0\' xmlns:ooow=\'http://openoffice.org/2004/writer\' xmlns:svg=\'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\' xmlns:chart=\'urn:oasis:names:tc:opendocument:xmlns:chart:1.0\' xmlns:dom=\'http://www.w3.org/2001/xml-events\' xmlns:xlink=\'http://www.w3.org/1999/xlink\' xmlns:xsd=\'http://www.w3.org/2001/XMLSchema\' xmlns:xsi=\'http://www.w3.org/2001/XMLSchema-instance\' xmlns:oooc=\'http://openoffice.org/2004/calc\' xmlns:math=\'http://www.w3.org/1998/Math/MathML\' xmlns:tal=\'http://xml.zope.org/namespaces/tal\'\n
xmlns:i18n=\'http://xml.zope.org/namespaces/i18n\'\n
xmlns:metal=\'http://xml.zope.org/namespaces/metal\'\n
tal:attributes=\'dummy python:request.RESPONSE.setHeader("Content-Type", "text/html;; charset=utf-8")\'\n
tal:define="show_comment python:(request.get(\'show_comment\') and 1) or 0"\n
office:version=\'1.0\'>\n
<office:scripts/>\n
<office:font-face-decls>\n
......@@ -104,6 +104,9 @@ AAA=</string> </value>
<style:style style:parent-style-name=\'Table_20_Contents\' style:family=\'paragraph\' style:name=\'P2\'>\n
<style:text-properties style:font-size-asian=\'9pt\' style:font-size-complex=\'9pt\' fo:font-size=\'9pt\'/>\n
</style:style>\n
<style:style style:parent-style-name=\'Table_20_Contents\' style:family=\'paragraph\' style:name=\'MatrixComment\'>\n
<style:text-properties style:font-size-asian=\'9pt\' style:font-size-complex=\'9pt\' fo:font-size=\'9pt\'/>\n
</style:style>\n
</office:automatic-styles>\n
<office:body>\n
<office:text>\n
......@@ -114,8 +117,8 @@ AAA=</string> </value>
<text:sequence-decl text:display-outline-level=\'0\' text:name=\'Text\'/>\n
<text:sequence-decl text:display-outline-level=\'0\' text:name=\'Drawing\'/>\n
</text:sequence-decls>\n
\t <text:h text:outline-level=\'1\' text:style-name=\'Heading_20_1\'><tal:trans i18n:domain="erp5_ui" i18n:translate="Project Line" /></text:h>\n
\t <text:p text:style-name=\'Text_20_body\'><tal:trans i18n:domain="erp5_ui" i18n:translate="Description of project line." /></text:p>\n
<text:h text:outline-level=\'1\' text:style-name=\'Heading_20_1\'><tal:trans i18n:domain="erp5_ui" i18n:translate="Project Line" /></text:h>\n
<text:p text:style-name=\'Text_20_body\'><tal:trans i18n:domain="erp5_ui" i18n:translate="Description of project line." /></text:p>\n
<table:table table:style-name=\'RequirementList\' table:name=\'RequirementList\'>\n
<table:table-column table:style-name=\'RequirementList.A\'/>\n
<table:table-column table:style-name=\'RequirementList.B\'/>\n
......@@ -125,30 +128,38 @@ AAA=</string> </value>
<table:table-header-rows>\n
<table:table-row>\n
<table:table-cell table:style-name=\'RequirementList.A1\' office:value-type=\'string\'>\n
\t\t\t\t<text:p text:style-name=\'P1\' ><tal:trans i18n:domain="erp5_ui" i18n:translate="Req. ID" /></text:p>\n
<text:p text:style-name=\'P1\' ><tal:trans i18n:domain="erp5_ui" i18n:translate="Req. ID" /></text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name=\'RequirementList.A1\' office:value-type=\'string\'>\n
\t\t\t\t<text:p text:style-name=\'P1\' i18n:domain="erp5_ui" i18n:translate="Requirement"></text:p>\n
<text:p text:style-name=\'P1\' i18n:domain="erp5_ui" i18n:translate="Requirement"></text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name=\'RequirementList.A1\' office:value-type=\'string\'>\n
\t\t\t\t<text:p text:style-name=\'P1\' ><tal:trans i18n:domain="erp5_ui" i18n:translate="Project ID" /></text:p>\n
<text:p text:style-name=\'P1\' ><tal:trans i18n:domain="erp5_ui" i18n:translate="Project ID" /></text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name=\'RequirementList.A1\' office:value-type=\'string\'>\n
\t\t\t\t<text:p text:style-name=\'P1\' ><tal:trans i18n:domain="erp5_ui" i18n:translate="Project Title" /></text:p>\n
<text:p text:style-name=\'P1\' ><tal:trans i18n:domain="erp5_ui" i18n:translate="Project Title" /></text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name=\'RequirementList.E1\' office:value-type=\'string\'>\n
\t\t\t\t<text:p text:style-name=\'P1\' ><tal:trans i18n:domain="erp5_ui" i18n:translate="Stop Date" /></text:p>\n
<text:p text:style-name=\'P1\' ><tal:trans i18n:domain="erp5_ui" i18n:translate="Stop Date" /></text:p>\n
</table:table-cell>\n
</table:table-row>\n
</table:table-header-rows>\n
<tal:block tal:repeat="mapping_item here/RequirementDocument_getProjectCoverageList">\n
<table:table-row>\n
<table:table-cell table:style-name=\'RequirementList.A2\' office:value-type=\'string\'>\n
<table:table-cell table:style-name=\'RequirementList.A2\' office:value-type=\'string\'\n
table:number-rows-spanned="2" \n
tal:attributes="table:number-rows-spanned python:mapping_item[\'repeat_count\'] + show_comment"\n
tal:condition="python:mapping_item[\'repeat_index\'] == 0">\n
<text:p text:style-name=\'P2\' tal:content="mapping_item/requirement_reference">Reference here</text:p>\n
</table:table-cell>\n
<table:table-cell table:style-name=\'RequirementList.A2\' office:value-type=\'string\'>\n
<table:covered-table-cell tal:condition="python:mapping_item[\'repeat_index\'] >= 1"/> \n
<table:table-cell table:style-name=\'RequirementList.A2\' office:value-type=\'string\'\n
table:number-rows-spanned="2" \n
tal:attributes="table:number-rows-spanned python:mapping_item[\'repeat_count\']"\n
tal:condition="python:mapping_item[\'repeat_index\'] == 0">\n
<text:p text:style-name=\'P2\' tal:content="mapping_item/requirement_title">Title here</text:p>\n
</table:table-cell>\n
<table:covered-table-cell tal:condition="python:mapping_item[\'repeat_index\'] >= 1"/> \n
<table:table-cell table:style-name=\'RequirementList.A2\' office:value-type=\'string\'>\n
<text:p text:style-name=\'P2\' tal:content="mapping_item/project_reference">Description here</text:p>\n
</table:table-cell>\n
......@@ -159,6 +170,15 @@ AAA=</string> </value>
<text:p text:style-name=\'P2\' tal:content="mapping_item/stop_date | string:"/>\n
</table:table-cell>\n
</table:table-row>\n
<tal:block tal:condition="python:mapping_item[\'repeat_index\'] == mapping_item[\'repeat_count\'] - 1">\n
<table:table-row tal:condition="show_comment">\n
<table:covered-table-cell/> \n
<table:table-cell table:style-name=\'RequirementList.E2\' office:value-type=\'string\'\n
table:number-columns-spanned="4" >\n
<text:p text:style-name=\'MatrixComment\' tal:content="mapping_item/requirement_comment">Comment here</text:p>\n
</table:table-cell>\n
</table:table-row>\n
</tal:block>\n
</tal:block>\n
</table:table>\n
</office:text>\n
......
......@@ -52,7 +52,7 @@
<key> <string>group_list</string> </key>
<value>
<list>
<string>Default</string>
<string>left</string>
</list>
</value>
</item>
......@@ -61,9 +61,11 @@
<value>
<dictionary>
<item>
<key> <string>Default</string> </key>
<key> <string>left</string> </key>
<value>
<list/>
<list>
<string>your_show_comment</string>
</list>
</value>
</item>
</dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_show_comment</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Show Comments</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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