diff --git a/product/ERP5Form/RelationField.py b/product/ERP5Form/RelationField.py index f6ed9fcb7da267e9dbf2cac39c16aa5a2401da7a..5a7827caf08d9622308819c7f0dcbab596149305 100755 --- a/product/ERP5Form/RelationField.py +++ b/product/ERP5Form/RelationField.py @@ -31,6 +31,8 @@ from Products.Formulator.Field import ZMIField from Products.Formulator.DummyField import fields from Products.ERP5Type.Utils import convertToUpperCase +from zLOG import LOG + class RelationStringFieldWidget(Widget.TextWidget): """ RelationStringField widget @@ -91,6 +93,7 @@ class RelationStringFieldWidget(Widget.TextWidget): def render(self, field, key, value, REQUEST): """Render text input field. """ + here = REQUEST['here'] html_string = Widget.TextWidget.render(self, field, key, value, REQUEST) # We used to add a button which has a path reference to a base category... # but it really created too many problems @@ -100,11 +103,11 @@ class RelationStringFieldWidget(Widget.TextWidget): % field.get_value('update_method') if value not in ('', None): if REQUEST.get('selection_name') is not None: - html_string += ' <a href="%s?field_id=%s&form_id=%s&selection_name=%s&selection_index=%s"><img src="/images/pro/images/jump.png"></a>' \ - % (field.get_value('jump_method'), field.id, field.aq_parent.id, REQUEST.get('selection_name'), REQUEST.get('selection_index')) + html_string += ' <a href="%s/%s?field_id=%s&form_id=%s&selection_name=%s&selection_index=%s"><img src="/images/pro/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')) else: - html_string += ' <a href="%s?field_id=%s&form_id=%s"><img src="/images/pro/images/jump.png"></a>' \ - % (field.get_value('jump_method'), field.id, field.aq_parent.id) + html_string += ' <a href="%s/%s?field_id=%s&form_id=%s"><img src="/images/pro/images/jump.png"></a>' \ + % (here.absolute_url(), field.get_value('jump_method'), field.id, field.aq_parent.id) return html_string def render_view(self, field, value): @@ -112,8 +115,8 @@ class RelationStringFieldWidget(Widget.TextWidget): """ html_string = Widget.TextWidget.render_view(self, field, value) if value not in ('', None): - html_string += ' <a href="%s?field_id=%s&form_id=%s"><img src="/images/pro/images/jump.png"></a>' \ - % (field.get_value('jump_method'), field.id, field.aq_parent.id) + html_string += ' <a href="%s/%s?field_id=%s&form_id=%s"><img src="/images/pro/images/jump.png"></a>' \ + % (here.absolute_url(), field.get_value('jump_method'), field.id, field.aq_parent.id) return html_string RelationStringFieldWidgetInstance = RelationStringFieldWidget()