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>
<main class="container-fluid">
<dtml-var "manage_form_title(this(), _,
form_title='Add ERP5 Python Script',
)">
...
...
@@ -10,43 +11,24 @@ some erp5 properties
</p>
<form action="addPythonScriptThroughZMI" method="POST">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
<div class="form-label">
Id
<div class="form-group row">
<label for="id" class="form-label col-sm-3 col-md-2">Id</label>
<div class="col-sm-9 col-md-10">
<input id="id" class="form-control code" type="text" name="id" />
</div>
</td>
<td align="left" valign="top">
<input type="text" name="id" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Title
</div>
<div class="form-group row">
<label for="title" class="form-label col-sm-3 col-md-2">Title</label>
<div class="col-sm-9 col-md-10">
<input id="title" class="form-control" type="text" name="title" />
</div>
</td>
<td align="left" valign="top">
<input type="text" name="title" size="40" />
</td>
</tr>
<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>
</div>
<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
<input class="btn btn-primary" type="submit" name="submit_add_and_edit" value="Add and Edit" />
</div>
</form>
</main>
<dtml-var manage_page_footer>
product/ERP5Form/EditorField.py
View file @
4b53ac2a
...
...
@@ -66,6 +66,7 @@ class EditorWidget(Widget.TextAreaWidget):
description
=
(
"The text editor widget to use."
""
),
css_class
=
"form-control"
,
default
=
"text_area"
,
required
=
1
,
size
=
1
,
...
...
product/ERP5Form/Form.py
View file @
4b53ac2a
...
...
@@ -456,6 +456,7 @@ def initializeForm(field_registry, form_class=None):
# set up individual add dictionaries for meta_types
dict
=
{
'name'
:
field
.
meta_type
,
'permission'
:
'Add Formulator Fields'
,
'zmi_show_add_dialog'
:
'modal'
,
'action'
:
'manage_addProduct/Formulator/manage_add%sForm'
%
meta_type
}
meta_types
.
append
(
dict
)
...
...
@@ -480,38 +481,48 @@ def create_settings_form():
title
=
fields
.
StringField
(
'title'
,
title
=
"Title"
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
description
=
fields
.
TextAreaField
(
'description'
,
title
=
"Description"
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
row_length
=
fields
.
IntegerField
(
'row_length'
,
input_type
=
'number'
,
title
=
'Number of groups in row (in order tab)'
,
required
=
1
,
css_class
=
"form-control"
,
default
=
4
)
name
=
fields
.
StringField
(
'name'
,
title
=
"Form name"
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
pt
=
fields
.
StringField
(
'pt'
,
title
=
"Page Template"
,
required
=
0
,
css_class
=
"form-control code"
,
default
=
""
)
action
=
fields
.
StringField
(
'action'
,
title
=
'Form action'
,
required
=
0
,
css_class
=
"form-control code"
,
default
=
""
)
action_title
=
fields
.
StringField
(
'action_title'
,
title
=
"Action Title"
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
update_action
=
fields
.
StringField
(
'update_action'
,
title
=
'Form update action'
,
required
=
0
,
css_class
=
"form-control code"
,
default
=
""
)
update_action_title
=
fields
.
StringField
(
'update_action_title'
,
title
=
"Update Action Title"
,
required
=
0
,
css_class
=
"form-control"
,
default
=
""
)
method
=
fields
.
ListField
(
'method'
,
title
=
'Form method'
,
...
...
@@ -519,6 +530,7 @@ def create_settings_form():
(
'GET'
,
'GET'
)],
required
=
1
,
size
=
1
,
css_class
=
"form-control"
,
default
=
'POST'
)
enctype
=
fields
.
ListField
(
'enctype'
,
title
=
'Form enctype'
,
...
...
@@ -529,22 +541,27 @@ def create_settings_form():
'multipart/form-data'
)],
required
=
0
,
size
=
1
,
css_class
=
"form-control"
,
default
=
None
)
encoding
=
fields
.
StringField
(
'encoding'
,
title
=
'Encoding of pages the form is in'
,
default
=
"UTF-8"
,
css_class
=
"form-control"
,
required
=
1
)
stored_encoding
=
fields
.
StringField
(
'stored_encoding'
,
title
=
'Encoding of form properties'
,
default
=
'UTF-8'
,
css_class
=
"form-control"
,
required
=
1
)
unicode_mode
=
fields
.
CheckBoxField
(
'unicode_mode'
,
title
=
'Form properties are unicode'
,
default
=
0
,
css_class
=
"form-control"
,
required
=
0
)
edit_order
=
fields
.
LinesField
(
'edit_order'
,
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
,
method
,
enctype
,
encoding
,
stored_encoding
,
unicode_mode
,
edit_order
])
...
...
product/ERP5Form/ParallelListField.py
View file @
4b53ac2a
...
...
@@ -79,6 +79,7 @@ class ParallelListWidget(Widget.MultiListWidget,
title
=
'Hash script'
,
description
=
(
"The method to call to hash items list."
),
css_class
=
"form-control code"
,
required
=
0
)
def
__init__
(
self
):
...
...
product/ERP5Form/Report.py
View file @
4b53ac2a
...
...
@@ -50,6 +50,7 @@ def create_settings_form():
title
=
'Report Method'
,
description
=
(
'The method to get a list of items (object, form,'
' parameters) to aggregate in a single Report'
),
css_class
=
"form-control code"
,
default
=
''
,
required
=
0
)
...
...
product/ERP5Form/ReportBox.py
View file @
4b53ac2a
...
...
@@ -41,12 +41,14 @@ class ReportBoxWidget(Widget.Widget):
default
=
fields
.
StringField
(
'default'
,
title
=
'Default'
,
description
=
""
,
css_class
=
"form-control"
,
default
=
""
,
required
=
0
)
report_method
=
fields
.
StringField
(
'report_method'
,
title
=
'Report Method'
,
description
=
""
,
css_class
=
"form-control"
,
default
=
""
,
required
=
0
)
...
...
product/ERP5Form/dtml/fieldAdd.dtml
View file @
4b53ac2a
<dtml-var manage_page_header>
<main class="container-fluid">
<dtml-var "manage_form_title(this(), _,
form_title='Add %s' % fieldname,
)">
...
...
@@ -10,43 +12,29 @@ Add a <dtml-var fieldname> to the form.
<form action="manage_addField" method="POST">
<table cellspacing="0" cellpadding="2" border="0
">
<tr
>
<td align="left" valign="top
">
<div class="form-label"
>
Id
<div class="form-group row
">
<label for="id" class="form-label col-sm-3 col-md-2">Id</label
>
<div class="col-sm-9 col-md-10
">
<input id="id" class="form-control code" type="text" name="id" /
>
</div>
</div>
</td>
<td align="left" valign="top">
<input type="text" name="id" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Title
<div class="form-group row">
<label for="title" class="form-label col-sm-3 col-md-2">Title</label>
<div class="col-sm-9 col-md-10">
<input id="title" class="form-control" type="text" name="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;">
<tr>
<td align="left" valign="top">
</td>
<td align="left" valign="top">
<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 class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value="Add" />
<input class="btn btn-primary" type="submit" name="submit_add_and_edit" value="Add and Edit" />
</div>
</td>
</tr>
</table>
</form>
</main>
<dtml-var manage_page_footer>
product/Formulator/Form.py
View file @
4b53ac2a
...
...
@@ -578,18 +578,22 @@ def create_settings_form():
title
=
fields
.
StringField
(
'title'
,
title
=
"Title"
,
required
=
False
,
css_class
=
"form-control"
,
default
=
""
)
row_length
=
fields
.
IntegerField
(
'row_length'
,
title
=
'Number of groups in row (in order tab)'
,
required
=
True
,
css_class
=
"form-control"
,
default
=
4
)
name
=
fields
.
StringField
(
'name'
,
title
=
"Form name"
,
required
=
False
,
css_class
=
"form-control"
,
default
=
""
)
action
=
fields
.
StringField
(
'action'
,
title
=
'Form action'
,
required
=
False
,
css_class
=
"form-control"
,
default
=
""
)
method
=
fields
.
ListField
(
'method'
,
title
=
'Form method'
,
...
...
@@ -597,6 +601,7 @@ def create_settings_form():
(
'GET'
,
'GET'
)],
required
=
True
,
size
=
1
,
css_class
=
"form-control"
,
default
=
'POST'
)
enctype
=
fields
.
ListField
(
'enctype'
,
title
=
'Form enctype'
,
...
...
@@ -607,20 +612,24 @@ def create_settings_form():
'multipart/form-data'
)],
required
=
False
,
size
=
1
,
css_class
=
"form-control"
,
default
=
None
)
encoding
=
fields
.
StringField
(
'encoding'
,
title
=
'Encoding of pages the form is in'
,
default
=
"UTF-8"
,
css_class
=
"form-control"
,
required
=
True
)
stored_encoding
=
fields
.
StringField
(
'stored_encoding'
,
title
=
'Encoding of form properties'
,
default
=
'ISO-8859-1'
,
css_class
=
"form-control"
,
required
=
True
)
unicode_mode
=
fields
.
CheckBoxField
(
'unicode_mode'
,
title
=
'Form properties are unicode'
,
default
=
False
,
css_class
=
"form-control"
,
required
=
True
)
form
.
add_fields
([
title
,
row_length
,
name
,
action
,
method
,
...
...
@@ -820,14 +829,6 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
return
self
.
formSettings
(
self
,
REQUEST
,
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'
)
def
_get_field_ids
(
self
,
group
,
REQUEST
):
"""Get the checked field_ids that we're operating on
...
...
@@ -1052,6 +1053,7 @@ def initializeForm(field_registry):
# set up individual add dictionaries for meta_types
dict
=
{
'name'
:
field
.
meta_type
,
'zmi_show_add_dialog'
:
'modal'
,
'action'
:
'manage_addProduct/Formulator/manage_add%sForm'
%
meta_type
}
meta_types
.
append
(
dict
)
...
...
product/Formulator/dtml/formSettings.dtml
View file @
4b53ac2a
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<main class="container-fluid">
<p class="form-help">
Settings for this form.
</p>
...
...
@@ -9,7 +10,7 @@ Settings for this form.
<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>
<tr>
<td class="form-label"><dtml-var "field.get_value('title')"></td>
...
...
@@ -17,18 +18,14 @@ Settings for this form.
</tr>
</dtml-let></dtml-in>
<tr>
<td><input type="submit" value="Change"></td>
</tr>
</table>
<div class="zmi-controls">
<input class="btn btn-primary" type="submit" name="submit" value="Change" />
</div>
<dtml-var "settings_form.footer()">
</dtml-let>
<p>Upgrade</p>
<form action="manage_refresh" method="POST">
<p><input type="submit" value="Upgrade"></p>
</form>
</main>
<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