Commit 51ce917c authored by Julien Muchembled's avatar Julien Muchembled

ERP5Form: remove fake 'target' property on proxy fields

parent e4c5f315
...@@ -92,7 +92,6 @@ class ProxyWidget(Widget.Widget): ...@@ -92,7 +92,6 @@ class ProxyWidget(Widget.Widget):
property_names = [ property_names = [
'form_id', 'form_id',
'field_id', 'field_id',
'target',
] ]
form_id = fields.StringField( form_id = fields.StringField(
...@@ -113,14 +112,6 @@ class ProxyWidget(Widget.Widget): ...@@ -113,14 +112,6 @@ class ProxyWidget(Widget.Widget):
display_width=40, display_width=40,
required=1) required=1)
target = fields.HyperLinkField(
'target',
title='Proxy Target',
description="Link to the master field edit form.",
default='Click to edit the target',
href='manage_edit_target',
required=0)
# Field API Methods, delegated to the template field widget # Field API Methods, delegated to the template field widget
render = WidgetDelegatedMethod('render', default='') render = WidgetDelegatedMethod('render', default='')
render_htmlgrid = WidgetDelegatedMethod('render_htmlgrid', default='') render_htmlgrid = WidgetDelegatedMethod('render_htmlgrid', default='')
...@@ -570,14 +561,26 @@ class ProxyField(ZMIField): ...@@ -570,14 +561,26 @@ class ProxyField(ZMIField):
return self.overrides.get(id, "") return self.overrides.get(id, "")
security.declareProtected('Edit target', 'manage_edit_target') security.declareProtected('Edit target', 'manage_edit_target')
def manage_edit_target(self, REQUEST): def manage_edit_target(self, RESPONSE):
"""
Edit target field of this proxy
"""
proxy_field = self.getTemplateField()
if proxy_field:
RESPONSE.redirect(proxy_field.absolute_url() + "/manage_main")
else:
# FIXME: should show some error message
# ("form_id and field_id don't define a valid template")
pass
security.declareProtected('Edit target', 'manage_tales_target')
def manage_tales_target(self, RESPONSE):
""" """
Edit target field of this proxy Edit target field of this proxy
""" """
proxy_field = self.getTemplateField() proxy_field = self.getTemplateField()
if proxy_field: if proxy_field:
url = "%s/manage_main" % proxy_field.absolute_url() RESPONSE.redirect(proxy_field.absolute_url() + "/manage_talesForm")
REQUEST.RESPONSE.redirect(url)
else: else:
# FIXME: should show some error message # FIXME: should show some error message
# ("form_id and field_id don't define a valid template") # ("form_id and field_id don't define a valid template")
......
...@@ -54,6 +54,16 @@ Surcharge <dtml-var meta_type> properties here. ...@@ -54,6 +54,16 @@ Surcharge <dtml-var meta_type> properties here.
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
<tr>
<td align="left" valign="top">
<div class="form-label">Proxy Target</div>
</td>
<td align="left" valign="top">
<a href="manage_edit_target">Click to edit the target</a>
</td>
<td></td><td></td>
</tr>
</table> </table>
<table cellspacing="0" cellpadding="2" border="0"> <table cellspacing="0" cellpadding="2" border="0">
<!-- Then, display Template Field properties --> <!-- Then, display Template Field properties -->
......
...@@ -53,6 +53,16 @@ This tab can therefore not be used. ...@@ -53,6 +53,16 @@ This tab can therefore not be used.
</dtml-let> </dtml-let>
</dtml-in> </dtml-in>
<tr>
<td align="left" valign="top">
<div class="form-label">Proxy Target</div>
</td>
<td align="left" valign="top">
<a href="manage_tales_target">Click to edit the target</a>
</td>
<td></td>
</tr>
</table> </table>
<table cellspacing="0" cellpadding="2" border="0"> <table cellspacing="0" cellpadding="2" border="0">
......
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