Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tomáš Peterka
erp5
Commits
51ce917c
Commit
51ce917c
authored
May 31, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Form: remove fake 'target' property on proxy fields
parent
e4c5f315
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
12 deletions
+35
-12
product/ERP5Form/ProxyField.py
product/ERP5Form/ProxyField.py
+15
-12
product/ERP5Form/dtml/proxyFieldEdit.dtml
product/ERP5Form/dtml/proxyFieldEdit.dtml
+10
-0
product/ERP5Form/dtml/proxyFieldTales.dtml
product/ERP5Form/dtml/proxyFieldTales.dtml
+10
-0
No files found.
product/ERP5Form/ProxyField.py
View file @
51ce917c
...
...
@@ -92,7 +92,6 @@ class ProxyWidget(Widget.Widget):
property_names
=
[
'form_id'
,
'field_id'
,
'target'
,
]
form_id
=
fields
.
StringField
(
...
...
@@ -113,14 +112,6 @@ class ProxyWidget(Widget.Widget):
display_width
=
40
,
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
render
=
WidgetDelegatedMethod
(
'render'
,
default
=
''
)
render_htmlgrid
=
WidgetDelegatedMethod
(
'render_htmlgrid'
,
default
=
''
)
...
...
@@ -570,14 +561,26 @@ class ProxyField(ZMIField):
return
self
.
overrides
.
get
(
id
,
""
)
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
"""
proxy_field
=
self
.
getTemplateField
()
if
proxy_field
:
url
=
"%s/manage_main"
%
proxy_field
.
absolute_url
()
REQUEST
.
RESPONSE
.
redirect
(
url
)
RESPONSE
.
redirect
(
proxy_field
.
absolute_url
()
+
"/manage_talesForm"
)
else
:
# FIXME: should show some error message
# ("form_id and field_id don't define a valid template")
...
...
product/ERP5Form/dtml/proxyFieldEdit.dtml
View file @
51ce917c
...
...
@@ -54,6 +54,16 @@ Surcharge <dtml-var meta_type> properties here.
</dtml-let>
</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 cellspacing="0" cellpadding="2" border="0">
<!-- Then, display Template Field properties -->
...
...
product/ERP5Form/dtml/proxyFieldTales.dtml
View file @
51ce917c
...
...
@@ -53,6 +53,16 @@ This tab can therefore not be used.
</dtml-let>
</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 cellspacing="0" cellpadding="2" border="0">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment