Commit 546c744e authored by Romain Courteaud's avatar Romain Courteaud

Modify display.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2363 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 723647e4
...@@ -158,7 +158,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, RelationField.R ...@@ -158,7 +158,7 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget, RelationField.R
else: else:
# no modification made, we can display only a lines text area widget # no modification made, we can display only a lines text area widget
html_string += Widget.LinesTextAreaWidget.render(self, field, key, value_list, REQUEST) html_string += Widget.LinesTextAreaWidget.render(self, field, key, value_list, REQUEST)
if value_list not in ((), [], None) and value_list == field.get_value('default'): if value_list not in ((), [], None, ['']) and value_list == field.get_value('default'):
if REQUEST.get('selection_name') is not None: if REQUEST.get('selection_name') is not None:
html_string += '&nbsp;&nbsp;<a href="%s?field_id=%s&form_id=%s&selection_name=%s&selection_index=%s"><img src="%s/images/jump.png"></a>' \ html_string += '&nbsp;&nbsp;<a href="%s?field_id=%s&form_id=%s&selection_name=%s&selection_index=%s"><img src="%s/images/jump.png"></a>' \
% (field.get_value('jump_method'), field.id, field.aq_parent.id, REQUEST.get('selection_name'), REQUEST.get('selection_index'),portal_url_string) % (field.get_value('jump_method'), field.id, field.aq_parent.id, REQUEST.get('selection_name'), REQUEST.get('selection_index'),portal_url_string)
......
...@@ -37,7 +37,7 @@ from Products.PythonScripts.Utility import allow_class ...@@ -37,7 +37,7 @@ from Products.PythonScripts.Utility import allow_class
import string import string
from zLOG import LOG from zLOG import LOG
MAX_SELECT = 50 # Max. number of catalog result MAX_SELECT = 30 # Max. number of catalog result
new_content_prefix = '_newContent_' new_content_prefix = '_newContent_'
...@@ -132,6 +132,7 @@ class RelationStringFieldWidget(Widget.TextWidget, Widget.ListWidget): ...@@ -132,6 +132,7 @@ class RelationStringFieldWidget(Widget.TextWidget, Widget.ListWidget):
portal_url_string = portal_url() portal_url_string = portal_url()
portal_object = portal_url.getPortalObject() portal_object = portal_url.getPortalObject()
html_string = Widget.TextWidget.render(self, field, key, value, REQUEST) html_string = Widget.TextWidget.render(self, field, key, value, REQUEST)
if REQUEST.has_key(relation_item_id): if REQUEST.has_key(relation_item_id):
# Define default tales on the fly # Define default tales on the fly
tales_expr = field.tales.get('items', None) tales_expr = field.tales.get('items', None)
...@@ -148,13 +149,14 @@ class RelationStringFieldWidget(Widget.TextWidget, Widget.ListWidget): ...@@ -148,13 +149,14 @@ class RelationStringFieldWidget(Widget.TextWidget, Widget.ListWidget):
# now we do it in another way # now we do it in another way
# we compare what has been changed in the relation update script # we compare what has been changed in the relation update script
elif value != field.get_value('default'): #elif value != field.get_value('default'):
else:
html_string += '&nbsp;<input type="image" src="%s/images/exec16.png" value="update..." name="%s/portal_selections/viewSearchRelatedDocumentDialog%s:method">' \ html_string += '&nbsp;<input type="image" src="%s/images/exec16.png" value="update..." name="%s/portal_selections/viewSearchRelatedDocumentDialog%s:method">' \
% (portal_url_string, portal_object.getPath(), field.aq_parent._v_relation_field_index) % (portal_url_string, portal_object.getPath(), field.aq_parent._v_relation_field_index)
field.aq_parent._v_relation_field_index += 1 # Increase index field.aq_parent._v_relation_field_index += 1 # Increase index
if value not in ( None, ) and not REQUEST.has_key(relation_item_id) and value == field.get_value('default'): if value not in ( None, '' ) and not REQUEST.has_key(relation_item_id) and value == field.get_value('default'):
if REQUEST.get('selection_name') is not None: if REQUEST.get('selection_name') is not None:
html_string += '&nbsp;&nbsp;<a href="%s/%s?field_id=%s&form_id=%s&selection_name=%s&selection_index=%s"><img src="%s/images/jump.png"></a>' \ html_string += '&nbsp;&nbsp;<a href="%s/%s?field_id=%s&form_id=%s&selection_name=%s&selection_index=%s"><img src="%s/images/jump.png"></a>' \
% (here.absolute_url(), field.get_value('jump_method'), field.id, field.aq_parent.id, REQUEST.get('selection_name'), REQUEST.get('selection_index'),portal_url_string) % (here.absolute_url(), field.get_value('jump_method'), field.id, field.aq_parent.id, REQUEST.get('selection_name'), REQUEST.get('selection_index'),portal_url_string)
......
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