Commit ee754ce6 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Remove disable_link. Instead, extend url_columns.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4353 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3ed89570
...@@ -274,7 +274,7 @@ class ListBoxWidget(Widget.Widget): ...@@ -274,7 +274,7 @@ class ListBoxWidget(Widget.Widget):
property_names = Widget.Widget.property_names +\ property_names = Widget.Widget.property_names +\
['lines', 'columns', 'all_columns', 'search_columns', 'sort_columns', 'sort', ['lines', 'columns', 'all_columns', 'search_columns', 'sort_columns', 'sort',
'editable_columns', 'all_editable_columns', 'editable_columns', 'all_editable_columns',
'stat_columns', 'disable_link', 'url_columns', 'global_attributes', 'stat_columns', 'url_columns', 'global_attributes',
'list_method', 'count_method', 'stat_method', 'selection_name', 'list_method', 'count_method', 'stat_method', 'selection_name',
'meta_types', 'portal_types', 'default_params', 'meta_types', 'portal_types', 'default_params',
'search', 'select', 'search', 'select',
...@@ -413,12 +413,6 @@ class ListBoxWidget(Widget.Widget): ...@@ -413,12 +413,6 @@ class ListBoxWidget(Widget.Widget):
default=[], default=[],
required=0) required=0)
disable_link = fields.CheckBoxField('disable_link',
title='Disable Link',
description=('Disable URL'),
default='',
required=0)
url_columns = fields.ListTextAreaField('url_columns', url_columns = fields.ListTextAreaField('url_columns',
title="URL Columns", title="URL Columns",
description=( description=(
...@@ -521,7 +515,6 @@ class ListBoxWidget(Widget.Widget): ...@@ -521,7 +515,6 @@ class ListBoxWidget(Widget.Widget):
editable_columns = field.get_value('editable_columns') editable_columns = field.get_value('editable_columns')
all_editable_columns = field.get_value('all_editable_columns') all_editable_columns = field.get_value('all_editable_columns')
stat_columns = field.get_value('stat_columns') stat_columns = field.get_value('stat_columns')
disable_link = field.get_value('disable_link')
url_columns = field.get_value('url_columns') url_columns = field.get_value('url_columns')
search_columns = field.get_value('search_columns') search_columns = field.get_value('search_columns')
sort_columns = field.get_value('sort_columns') sort_columns = field.get_value('sort_columns')
...@@ -1767,7 +1760,6 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')"> ...@@ -1767,7 +1760,6 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')">
######################################################################### #########################################################################
object_url = None object_url = None
# Try to get a link # Try to get a link
if not disable_link:
# Check if url_columns defines a method # Check if url_columns defines a method
# to retrieve the URL. # to retrieve the URL.
url_method = None url_method = None
...@@ -1775,7 +1767,7 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')"> ...@@ -1775,7 +1767,7 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')">
if sql == column[0]: if sql == column[0]:
url_method = getattr(o, column[1], '') url_method = getattr(o, column[1], '')
break break
if url_method is not None: if url_method:
# Call the requested method # Call the requested method
try: try:
object_url = url_method(brain=o, selection=selection) object_url = url_method(brain=o, selection=selection)
...@@ -1787,7 +1779,7 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')"> ...@@ -1787,7 +1779,7 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')">
'Could not evaluate url_method %s' % \ 'Could not evaluate url_method %s' % \
column[1], error=sys.exc_info()) column[1], error=sys.exc_info())
pass pass
else: elif url_method is None:
# Check if this object provides a specific URL method # Check if this object provides a specific URL method
url_method = getattr(o, 'getListItemUrl', None) url_method = getattr(o, 'getListItemUrl', None)
if url_method is None: if url_method is None:
...@@ -1925,7 +1917,7 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')"> ...@@ -1925,7 +1917,7 @@ onChange="submitAction(this.form,'%s/portal_selections/setReportRoot')">
if render_format == 'list': if render_format == 'list':
#listboxline_list.append(current_listboxline) #listboxline_list.append(current_listboxline)
LOG('ListBox', 0, 'listboxline_list: %s' % str(listboxline_list) ) #LOG('ListBox', 0, 'listboxline_list: %s' % str(listboxline_list) )
return listboxline_list return listboxline_list
......
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