Commit 13a69cb4 authored by Sebastien Robin's avatar Sebastien Robin

finished my previous update, now one dimension matrix works well


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1968 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 22e6067c
...@@ -79,7 +79,7 @@ class MatrixBoxWidget(Widget.Widget): ...@@ -79,7 +79,7 @@ class MatrixBoxWidget(Widget.Widget):
couple[0] is the variation, and couple[1] is the name displayed to the user. couple[0] is the variation, and couple[1] is the name displayed to the user.
For example (('color/bleu','bleu'),('color/red','red')), Required"""), For example (('color/bleu','bleu'),('color/red','red')), Required"""),
default=[], default=[],
required=1) required=0)
lines = fields.ListTextAreaField('lines', lines = fields.ListTextAreaField('lines',
title="Lines", title="Lines",
...@@ -158,6 +158,8 @@ class MatrixBoxWidget(Widget.Widget): ...@@ -158,6 +158,8 @@ class MatrixBoxWidget(Widget.Widget):
# This is required when we have no tabs # This is required when we have no tabs
if len(tabs) == 0: tabs = [(None,None)] if len(tabs) == 0: tabs = [(None,None)]
# This is required when we have no columns
if len(columns) == 0: columns = [(None,None)]
column_ids = map(lambda x: x[0], columns) column_ids = map(lambda x: x[0], columns)
line_ids = map(lambda x: x[0], lines) line_ids = map(lambda x: x[0], lines)
...@@ -224,12 +226,16 @@ class MatrixBoxWidget(Widget.Widget): ...@@ -224,12 +226,16 @@ class MatrixBoxWidget(Widget.Widget):
list_body = list_body + '<tr><td class=\"%s\">%s</td>' % (td_css, str(l[1])) list_body = list_body + '<tr><td class=\"%s\">%s</td>' % (td_css, str(l[1]))
j = 0 j = 0
line_id = l[0]
for c in columns: for c in columns:
if line_id is None and tab_id is None: #if column_id is None and tab_id is None:
kw = [line_id] # kw = []
if tab_id is None: column_id = c[0]
if type(column_id) is not type(()) and type(column_id) is not type([]) and column_id is not None:
column_id = [column_id]
if column_id is None:
kw = [l[0]]
elif tab_id is None:
kw = [l[0], c[0]] kw = [l[0], c[0]]
else: else:
kw = [l[0], c[0]] + tab_id kw = [l[0], c[0]] + tab_id
......
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