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
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
4b53ac2a
Commit
4b53ac2a
authored
Dec 17, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into zope4py3
parents
024c42aa
40b116a0
Pipeline
#38597
failed with stage
in 0 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
76 additions
and
85 deletions
+76
-85
product/ERP5/dtml/addPythonScriptThroughZMIForm.dtml
product/ERP5/dtml/addPythonScriptThroughZMIForm.dtml
+17
-35
product/ERP5Form/EditorField.py
product/ERP5Form/EditorField.py
+1
-0
product/ERP5Form/Form.py
product/ERP5Form/Form.py
+18
-1
product/ERP5Form/ParallelListField.py
product/ERP5Form/ParallelListField.py
+1
-0
product/ERP5Form/Report.py
product/ERP5Form/Report.py
+1
-0
product/ERP5Form/ReportBox.py
product/ERP5Form/ReportBox.py
+2
-0
product/ERP5Form/dtml/fieldAdd.dtml
product/ERP5Form/dtml/fieldAdd.dtml
+20
-32
product/Formulator/Form.py
product/Formulator/Form.py
+10
-8
product/Formulator/dtml/formSettings.dtml
product/Formulator/dtml/formSettings.dtml
+6
-9
No files found.
product/ERP5/dtml/addPythonScriptThroughZMIForm.dtml
View file @
4b53ac2a
<dtml-var manage_page_header>
<dtml-var manage_page_header>
<main class="container-fluid">
<dtml-var "manage_form_title(this(), _,
<dtml-var "manage_form_title(this(), _,
form_title='Add ERP5 Python Script',
form_title='Add ERP5 Python Script',
)">
)">
...
@@ -10,43 +11,24 @@ some erp5 properties
...
@@ -10,43 +11,24 @@ some erp5 properties
</p>
</p>
<form action="addPythonScriptThroughZMI" method="POST">
<form action="addPythonScriptThroughZMI" method="POST">
<div class="form-group row">
<table cellspacing="0" cellpadding="2" border="0">
<label for="id" class="form-label col-sm-3 col-md-2">Id</label>
<tr>
<div class="col-sm-9 col-md-10">
<td align="left" valign="top">
<input id="id" class="form-control code" type="text" name="id" />
<div class="form-label">
Id
</div>
</div>
</td>
</div>
<td align="left" valign="top">
<div class="form-group row">
<input type="text" name="id" size="40" />
<label for="title" class="form-label col-sm-3 col-md-2">Title</label>
</td>
<div class="col-sm-9 col-md-10">
</tr>
<input id="title" class="form-control" type="text" name="title" />
<tr>
<td align="left" valign="top">
<div class="form-label">
Title
</div>
</div>
</td>
</div>
<td align="left" valign="top">
<div class="zmi-controls">
<input type="text" name="title" size="40" />
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
</td>
<input class="btn btn-primary" type="submit" name="submit_add_and_edit" value="Add and Edit" />
</tr>
</div>
<tr>
<td align="left" valign="top">
</td>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="submit"
value=" Add " />
<input class="form-element" type="submit" name="submit"
value=" Add and Edit " />
</div>
</td>
</tr>
</table>
</form>
</form>
</main>
<dtml-var manage_page_footer>
<dtml-var manage_page_footer>
product/ERP5Form/EditorField.py
View file @
4b53ac2a
...
@@ -66,6 +66,7 @@ class EditorWidget(Widget.TextAreaWidget):
...
@@ -66,6 +66,7 @@ class EditorWidget(Widget.TextAreaWidget):
description
=
(
description
=
(
"The text editor widget to use."
"The text editor widget to use."
""
),
""
),
css_class
=
"form-control"
,
default
=
"text_area"
,
default
=
"text_area"
,
required
=
1
,
required
=
1
,
size
=
1
,
size
=
1
,
...
...
product/ERP5Form/Form.py
View file @
4b53ac2a
...
@@ -456,6 +456,7 @@ def initializeForm(field_registry, form_class=None):
...
@@ -456,6 +456,7 @@ def initializeForm(field_registry, form_class=None):
# set up individual add dictionaries for meta_types
# set up individual add dictionaries for meta_types
dict
=
{
'name'
:
field
.
meta_type
,
dict
=
{
'name'
:
field
.
meta_type
,
'permission'
:
'Add Formulator Fields'
,
'permission'
:
'Add Formulator Fields'
,
'zmi_show_add_dialog'
:
'modal'
,
'action'
:
'action'
:
'manage_addProduct/Formulator/manage_add%sForm'
%
meta_type
}
'manage_addProduct/Formulator/manage_add%sForm'
%
meta_type
}
meta_types
.
append
(
dict
)
meta_types
.
append
(
dict
)
...
@@ -480,38 +481,48 @@ def create_settings_form():
...
@@ -480,38 +481,48 @@ def create_settings_form():
title
=
fields
.
StringField
(
'title'
,
title
=
fields
.
StringField
(
'title'
,
title
=
"Title"
,
title
=
"Title"
,
required
=
0
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
default
=
""
)
description
=
fields
.
TextAreaField
(
'description'
,
description
=
fields
.
TextAreaField
(
'description'
,
title
=
"Description"
,
title
=
"Description"
,
required
=
0
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
default
=
""
)
row_length
=
fields
.
IntegerField
(
'row_length'
,
row_length
=
fields
.
IntegerField
(
'row_length'
,
input_type
=
'number'
,
title
=
'Number of groups in row (in order tab)'
,
title
=
'Number of groups in row (in order tab)'
,
required
=
1
,
required
=
1
,
css_class
=
"form-control"
,
default
=
4
)
default
=
4
)
name
=
fields
.
StringField
(
'name'
,
name
=
fields
.
StringField
(
'name'
,
title
=
"Form name"
,
title
=
"Form name"
,
required
=
0
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
default
=
""
)
pt
=
fields
.
StringField
(
'pt'
,
pt
=
fields
.
StringField
(
'pt'
,
title
=
"Page Template"
,
title
=
"Page Template"
,
required
=
0
,
required
=
0
,
css_class
=
"form-control code"
,
default
=
""
)
default
=
""
)
action
=
fields
.
StringField
(
'action'
,
action
=
fields
.
StringField
(
'action'
,
title
=
'Form action'
,
title
=
'Form action'
,
required
=
0
,
required
=
0
,
css_class
=
"form-control code"
,
default
=
""
)
default
=
""
)
action_title
=
fields
.
StringField
(
'action_title'
,
action_title
=
fields
.
StringField
(
'action_title'
,
title
=
"Action Title"
,
title
=
"Action Title"
,
required
=
0
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
default
=
""
)
update_action
=
fields
.
StringField
(
'update_action'
,
update_action
=
fields
.
StringField
(
'update_action'
,
title
=
'Form update action'
,
title
=
'Form update action'
,
required
=
0
,
required
=
0
,
css_class
=
"form-control code"
,
default
=
""
)
default
=
""
)
update_action_title
=
fields
.
StringField
(
'update_action_title'
,
update_action_title
=
fields
.
StringField
(
'update_action_title'
,
title
=
"Update Action Title"
,
title
=
"Update Action Title"
,
required
=
0
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
default
=
""
)
method
=
fields
.
ListField
(
'method'
,
method
=
fields
.
ListField
(
'method'
,
title
=
'Form method'
,
title
=
'Form method'
,
...
@@ -519,6 +530,7 @@ def create_settings_form():
...
@@ -519,6 +530,7 @@ def create_settings_form():
(
'GET'
,
'GET'
)],
(
'GET'
,
'GET'
)],
required
=
1
,
required
=
1
,
size
=
1
,
size
=
1
,
css_class
=
"form-control"
,
default
=
'POST'
)
default
=
'POST'
)
enctype
=
fields
.
ListField
(
'enctype'
,
enctype
=
fields
.
ListField
(
'enctype'
,
title
=
'Form enctype'
,
title
=
'Form enctype'
,
...
@@ -529,22 +541,27 @@ def create_settings_form():
...
@@ -529,22 +541,27 @@ def create_settings_form():
'multipart/form-data'
)],
'multipart/form-data'
)],
required
=
0
,
required
=
0
,
size
=
1
,
size
=
1
,
css_class
=
"form-control"
,
default
=
None
)
default
=
None
)
encoding
=
fields
.
StringField
(
'encoding'
,
encoding
=
fields
.
StringField
(
'encoding'
,
title
=
'Encoding of pages the form is in'
,
title
=
'Encoding of pages the form is in'
,
default
=
"UTF-8"
,
default
=
"UTF-8"
,
css_class
=
"form-control"
,
required
=
1
)
required
=
1
)
stored_encoding
=
fields
.
StringField
(
'stored_encoding'
,
stored_encoding
=
fields
.
StringField
(
'stored_encoding'
,
title
=
'Encoding of form properties'
,
title
=
'Encoding of form properties'
,
default
=
'UTF-8'
,
default
=
'UTF-8'
,
css_class
=
"form-control"
,
required
=
1
)
required
=
1
)
unicode_mode
=
fields
.
CheckBoxField
(
'unicode_mode'
,
unicode_mode
=
fields
.
CheckBoxField
(
'unicode_mode'
,
title
=
'Form properties are unicode'
,
title
=
'Form properties are unicode'
,
default
=
0
,
default
=
0
,
css_class
=
"form-control"
,
required
=
0
)
required
=
0
)
edit_order
=
fields
.
LinesField
(
'edit_order'
,
edit_order
=
fields
.
LinesField
(
'edit_order'
,
title
=
'Setters for these properties should be'
title
=
'Setters for these properties should be'
'<br /> called by edit() in the defined order'
)
'<br /> called by edit() in the defined order'
,
css_class
=
"form-control code"
)
form
.
add_fields
([
title
,
description
,
row_length
,
name
,
pt
,
action
,
action_title
,
update_action
,
update_action_title
,
form
.
add_fields
([
title
,
description
,
row_length
,
name
,
pt
,
action
,
action_title
,
update_action
,
update_action_title
,
method
,
enctype
,
encoding
,
stored_encoding
,
unicode_mode
,
edit_order
])
method
,
enctype
,
encoding
,
stored_encoding
,
unicode_mode
,
edit_order
])
...
...
product/ERP5Form/ParallelListField.py
View file @
4b53ac2a
...
@@ -79,6 +79,7 @@ class ParallelListWidget(Widget.MultiListWidget,
...
@@ -79,6 +79,7 @@ class ParallelListWidget(Widget.MultiListWidget,
title
=
'Hash script'
,
title
=
'Hash script'
,
description
=
(
description
=
(
"The method to call to hash items list."
),
"The method to call to hash items list."
),
css_class
=
"form-control code"
,
required
=
0
)
required
=
0
)
def
__init__
(
self
):
def
__init__
(
self
):
...
...
product/ERP5Form/Report.py
View file @
4b53ac2a
...
@@ -50,6 +50,7 @@ def create_settings_form():
...
@@ -50,6 +50,7 @@ def create_settings_form():
title
=
'Report Method'
,
title
=
'Report Method'
,
description
=
(
'The method to get a list of items (object, form,'
description
=
(
'The method to get a list of items (object, form,'
' parameters) to aggregate in a single Report'
),
' parameters) to aggregate in a single Report'
),
css_class
=
"form-control code"
,
default
=
''
,
default
=
''
,
required
=
0
)
required
=
0
)
...
...
product/ERP5Form/ReportBox.py
View file @
4b53ac2a
...
@@ -41,12 +41,14 @@ class ReportBoxWidget(Widget.Widget):
...
@@ -41,12 +41,14 @@ class ReportBoxWidget(Widget.Widget):
default
=
fields
.
StringField
(
'default'
,
default
=
fields
.
StringField
(
'default'
,
title
=
'Default'
,
title
=
'Default'
,
description
=
""
,
description
=
""
,
css_class
=
"form-control"
,
default
=
""
,
default
=
""
,
required
=
0
)
required
=
0
)
report_method
=
fields
.
StringField
(
'report_method'
,
report_method
=
fields
.
StringField
(
'report_method'
,
title
=
'Report Method'
,
title
=
'Report Method'
,
description
=
""
,
description
=
""
,
css_class
=
"form-control"
,
default
=
""
,
default
=
""
,
required
=
0
)
required
=
0
)
...
...
product/ERP5Form/dtml/fieldAdd.dtml
View file @
4b53ac2a
<dtml-var manage_page_header>
<dtml-var manage_page_header>
<main class="container-fluid">
<dtml-var "manage_form_title(this(), _,
<dtml-var "manage_form_title(this(), _,
form_title='Add %s' % fieldname,
form_title='Add %s' % fieldname,
)">
)">
...
@@ -10,43 +12,29 @@ Add a <dtml-var fieldname> to the form.
...
@@ -10,43 +12,29 @@ Add a <dtml-var fieldname> to the form.
<form action="manage_addField" method="POST">
<form action="manage_addField" method="POST">
<table cellspacing="0" cellpadding="2" border="0
">
<div class="form-group row
">
<tr
>
<label for="id" class="form-label col-sm-3 col-md-2">Id</label
>
<td align="left" valign="top
">
<div class="col-sm-9 col-md-10
">
<div class="form-label"
>
<input id="id" class="form-control code" type="text" name="id" /
>
Id
</div>
</div>
</div>
</td>
<td align="left" valign="top">
<div class="form-group row">
<input type="text" name="id" size="40" />
<label for="title" class="form-label col-sm-3 col-md-2">Title</label>
</td>
<div class="col-sm-9 col-md-10">
</tr>
<input id="title" class="form-control" type="text" name="title" />
</div>
<tr>
<td align="left" valign="top">
<div class="form-label">
Title
</div>
</div>
</td>
<td align="left" valign="top">
<input type="text" name="title" size="40" />
</td>
</tr>
<input type="hidden" name="fieldname" value="&dtml-fieldname;">
<input type="hidden" name="fieldname" value="&dtml-fieldname;">
<tr>
<td align="left" valign="top">
<div class="zmi-controls">
</td>
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
<td align="left" valign="top">
<input class="btn btn-primary" type="submit" name="submit_add_and_edit" value="Add and Edit" />
<div class="form-element">
<input class="form-element" type="submit" name="submit_add"
value=" Add " />
<input class="form-element" type="submit" name="submit_add_and_edit"
value=" Add and Edit " />
</div>
</div>
</td>
</tr>
</table>
</form>
</form>
</main>
<dtml-var manage_page_footer>
<dtml-var manage_page_footer>
product/Formulator/Form.py
View file @
4b53ac2a
...
@@ -578,18 +578,22 @@ def create_settings_form():
...
@@ -578,18 +578,22 @@ def create_settings_form():
title
=
fields
.
StringField
(
'title'
,
title
=
fields
.
StringField
(
'title'
,
title
=
"Title"
,
title
=
"Title"
,
required
=
False
,
required
=
False
,
css_class
=
"form-control"
,
default
=
""
)
default
=
""
)
row_length
=
fields
.
IntegerField
(
'row_length'
,
row_length
=
fields
.
IntegerField
(
'row_length'
,
title
=
'Number of groups in row (in order tab)'
,
title
=
'Number of groups in row (in order tab)'
,
required
=
True
,
required
=
True
,
css_class
=
"form-control"
,
default
=
4
)
default
=
4
)
name
=
fields
.
StringField
(
'name'
,
name
=
fields
.
StringField
(
'name'
,
title
=
"Form name"
,
title
=
"Form name"
,
required
=
False
,
required
=
False
,
css_class
=
"form-control"
,
default
=
""
)
default
=
""
)
action
=
fields
.
StringField
(
'action'
,
action
=
fields
.
StringField
(
'action'
,
title
=
'Form action'
,
title
=
'Form action'
,
required
=
False
,
required
=
False
,
css_class
=
"form-control"
,
default
=
""
)
default
=
""
)
method
=
fields
.
ListField
(
'method'
,
method
=
fields
.
ListField
(
'method'
,
title
=
'Form method'
,
title
=
'Form method'
,
...
@@ -597,6 +601,7 @@ def create_settings_form():
...
@@ -597,6 +601,7 @@ def create_settings_form():
(
'GET'
,
'GET'
)],
(
'GET'
,
'GET'
)],
required
=
True
,
required
=
True
,
size
=
1
,
size
=
1
,
css_class
=
"form-control"
,
default
=
'POST'
)
default
=
'POST'
)
enctype
=
fields
.
ListField
(
'enctype'
,
enctype
=
fields
.
ListField
(
'enctype'
,
title
=
'Form enctype'
,
title
=
'Form enctype'
,
...
@@ -607,20 +612,24 @@ def create_settings_form():
...
@@ -607,20 +612,24 @@ def create_settings_form():
'multipart/form-data'
)],
'multipart/form-data'
)],
required
=
False
,
required
=
False
,
size
=
1
,
size
=
1
,
css_class
=
"form-control"
,
default
=
None
)
default
=
None
)
encoding
=
fields
.
StringField
(
'encoding'
,
encoding
=
fields
.
StringField
(
'encoding'
,
title
=
'Encoding of pages the form is in'
,
title
=
'Encoding of pages the form is in'
,
default
=
"UTF-8"
,
default
=
"UTF-8"
,
css_class
=
"form-control"
,
required
=
True
)
required
=
True
)
stored_encoding
=
fields
.
StringField
(
'stored_encoding'
,
stored_encoding
=
fields
.
StringField
(
'stored_encoding'
,
title
=
'Encoding of form properties'
,
title
=
'Encoding of form properties'
,
default
=
'ISO-8859-1'
,
default
=
'ISO-8859-1'
,
css_class
=
"form-control"
,
required
=
True
)
required
=
True
)
unicode_mode
=
fields
.
CheckBoxField
(
'unicode_mode'
,
unicode_mode
=
fields
.
CheckBoxField
(
'unicode_mode'
,
title
=
'Form properties are unicode'
,
title
=
'Form properties are unicode'
,
default
=
False
,
default
=
False
,
css_class
=
"form-control"
,
required
=
True
)
required
=
True
)
form
.
add_fields
([
title
,
row_length
,
name
,
action
,
method
,
form
.
add_fields
([
title
,
row_length
,
name
,
action
,
method
,
...
@@ -820,14 +829,6 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
...
@@ -820,14 +829,6 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
return
self
.
formSettings
(
self
,
REQUEST
,
return
self
.
formSettings
(
self
,
REQUEST
,
manage_tabs_message
=
message
)
manage_tabs_message
=
message
)
security
.
declareProtected
(
'Change Formulator Forms'
,
'manage_refresh'
)
def
manage_refresh
(
self
,
REQUEST
):
"""Refresh internal data structures of this form.
FIXME: this doesn't work right now
"""
# self.update_groups()
REQUEST
.
RESPONSE
.
redirect
(
'manage_main'
)
security
.
declarePrivate
(
'_get_field_ids'
)
security
.
declarePrivate
(
'_get_field_ids'
)
def
_get_field_ids
(
self
,
group
,
REQUEST
):
def
_get_field_ids
(
self
,
group
,
REQUEST
):
"""Get the checked field_ids that we're operating on
"""Get the checked field_ids that we're operating on
...
@@ -1052,6 +1053,7 @@ def initializeForm(field_registry):
...
@@ -1052,6 +1053,7 @@ def initializeForm(field_registry):
# set up individual add dictionaries for meta_types
# set up individual add dictionaries for meta_types
dict
=
{
'name'
:
field
.
meta_type
,
dict
=
{
'name'
:
field
.
meta_type
,
'zmi_show_add_dialog'
:
'modal'
,
'action'
:
'action'
:
'manage_addProduct/Formulator/manage_add%sForm'
%
meta_type
}
'manage_addProduct/Formulator/manage_add%sForm'
%
meta_type
}
meta_types
.
append
(
dict
)
meta_types
.
append
(
dict
)
...
...
product/Formulator/dtml/formSettings.dtml
View file @
4b53ac2a
<dtml-var manage_page_header>
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<dtml-var manage_tabs>
<main class="container-fluid">
<p class="form-help">
<p class="form-help">
Settings for this form.
Settings for this form.
</p>
</p>
...
@@ -9,7 +10,7 @@ Settings for this form.
...
@@ -9,7 +10,7 @@ Settings for this form.
<dtml-var "settings_form.header()">
<dtml-var "settings_form.header()">
<table
border="0
">
<table
class="table table-striped table-hover table-sm
">
<dtml-in "settings_form.get_fields()"><dtml-let field=sequence-item>
<dtml-in "settings_form.get_fields()"><dtml-let field=sequence-item>
<tr>
<tr>
<td class="form-label"><dtml-var "field.get_value('title')"></td>
<td class="form-label"><dtml-var "field.get_value('title')"></td>
...
@@ -17,18 +18,14 @@ Settings for this form.
...
@@ -17,18 +18,14 @@ Settings for this form.
</tr>
</tr>
</dtml-let></dtml-in>
</dtml-let></dtml-in>
<tr>
<td><input type="submit" value="Change"></td>
</tr>
</table>
</table>
<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value="Change" />
</div>
<dtml-var "settings_form.footer()">
<dtml-var "settings_form.footer()">
</dtml-let>
</dtml-let>
<p>Upgrade</p>
</main>
<form action="manage_refresh" method="POST">
<p><input type="submit" value="Upgrade"></p>
</form>
<dtml-var manage_page_footer>
<dtml-var manage_page_footer>
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