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
Sven Franck
erp5
Commits
2b7ac6c9
Commit
2b7ac6c9
authored
May 28, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ERP5Form] Formbox: allow to configure the validation field prefix
Support dialog form box (with your_ fields)
parent
c88c2e42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
product/ERP5Form/FormBox.py
product/ERP5Form/FormBox.py
+13
-2
No files found.
product/ERP5Form/FormBox.py
View file @
2b7ac6c9
...
...
@@ -175,7 +175,17 @@ class FormBoxValidator(Validator.Validator):
Validate all fields of the form and return
the result as a single variable.
"""
property_names
=
Validator
.
Validator
.
property_names
validator_form_field_prefix
=
fields
.
StringField
(
'validator_form_field_prefix'
,
title
=
'Validator Form Field Prefix'
,
description
=
"Field prefix value used when validating fields"
,
default
=
"my_"
,
display_width
=
40
,
required
=
1
)
property_names
=
Validator
.
Validator
.
property_names
+
\
[
'validator_form_field_prefix'
]
message_names
=
Validator
.
Validator
.
message_names
+
\
[
'form_invalidated'
,
'required_not_found'
]
...
...
@@ -193,7 +203,8 @@ class FormBoxValidator(Validator.Validator):
with
getFormBoxContext
(
field
,
REQUEST
)
as
here
:
# XXX Hardcode script name
result
,
result_type
=
here
.
Base_edit
(
formbox_target_id
,
silent_mode
=
1
,
key_prefix
=
key
)
result
,
result_type
=
here
.
Base_edit
(
formbox_target_id
,
silent_mode
=
1
,
key_prefix
=
key
,
field_prefix
=
field
.
get_value
(
'validator_form_field_prefix'
))
if
result_type
==
'edit'
:
return
FormBoxEditor
(
result
,
here
)
elif
result_type
==
'form'
:
...
...
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