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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yusei Tahara
erp5
Commits
24017646
Commit
24017646
authored
Mar 12, 2018
by
Tomáš Peterka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_core] Rename useful Script *_getListbox according to API naming conventions
parent
207bf91e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
15 deletions
+19
-15
bt5/erp5_mobile/SkinTemplateItem/portal_skins/erp5_mobile_ui/list_main.zpt
...kinTemplateItem/portal_skins/erp5_mobile_ui/list_main.zpt
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Form_getListbox.py
...kinTemplateItem/portal_skins/erp5_core/Form_getListbox.py
+17
-13
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Form_getListbox.xml
...inTemplateItem/portal_skins/erp5_core/Form_getListbox.xml
+1
-1
No files found.
bt5/erp5_mobile/SkinTemplateItem/portal_skins/erp5_mobile_ui/list_main.zpt
View file @
24017646
...
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
...
@@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<tal:block tal:define="form_action string:Base_doSelect;
<tal:block tal:define="form_action string:Base_doSelect;
form_id form/id;
form_id form/id;
list_mode python: True;
list_mode python: True;
listmode_default_listbox python:
here.ERP5Site_getListbox(form=form
);
listmode_default_listbox python:
form.Form_getListbox(
);
selection_name listmode_default_listbox/selection_name;
selection_name listmode_default_listbox/selection_name;
selection_index request/selection_index | python:0;
selection_index request/selection_index | python:0;
dummy python: selection_name and request.set('selection_name', selection_name);
dummy python: selection_name and request.set('selection_name', selection_name);
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/
ERP5Site
_getListbox.py
→
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/
Form
_getListbox.py
View file @
24017646
...
@@ -2,26 +2,30 @@
...
@@ -2,26 +2,30 @@
# Christophe Dumez <christophe@nexedi.com>
# Christophe Dumez <christophe@nexedi.com>
# This script should be used to detect a listbox without having to name it "listbox"
# This script should be used to detect a listbox without having to name it "listbox"
if
form
is
None
:
form
=
context
if
form
.
meta_type
!=
'ERP5 Form'
:
return
None
# XXX We should not use meta_type properly,
# XXX We need to discuss this problem.(yusei)
def
isListBox
(
field
):
def
isListBox
(
field
):
if
field
.
meta_type
==
'ListBox'
:
if
field
.
meta_type
==
"ListBox"
:
return
True
return
True
elif
field
.
meta_type
==
'ProxyField'
:
elif
field
.
meta_type
==
"ProxyField"
:
template_field
=
field
.
getRecursiveTemplateField
()
template_field
=
field
.
getRecursiveTemplateField
()
if
template_field
.
meta_type
==
'ListBox'
:
if
template_field
.
meta_type
==
"ListBox"
:
return
True
return
True
return
False
return
False
if
form
is
None
:
form
=
context
if
form
.
meta_type
!=
'ERP5 Form'
:
return
None
if
form
.
has_field
(
'listbox'
):
return
form
.
get_field
(
'listbox'
)
# we start with 'bottom' because most of the time
# we start with 'bottom' because most of the time
# the listbox is there.
# the listbox is there.
for
group
in
(
'bottom'
,
'center'
,
'left'
,
'right'
):
for
group
in
(
'bottom'
,
'center'
,
'left'
,
'right'
):
for
field
in
form
.
get_fields_in_group
(
group
):
for
field
in
form
.
get_fields_in_group
(
group
):
if
isListBox
(
field
)
and
not
(
field
[
'hidden'
])
and
field
[
'enabled'
]:
if
(
isListBox
(
field
)
and
return
field
not
field
.
get_value
(
'hidden'
)
and
field
.
get_value
(
'enabled'
)):
return
field
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/
ERP5Site
_getListbox.xml
→
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/
Form
_getListbox.xml
View file @
24017646
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site
_getListbox
</string>
</value>
<value>
<string>
Form
_getListbox
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
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