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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
erp5
Commits
f36260d2
Commit
f36260d2
authored
Oct 10, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code clean up in ListBox & EditorField
parent
4d1b9357
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
100 deletions
+67
-100
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Workflow_statusModify.xml
...m/portal_skins/erp5_xhtml_style/Workflow_statusModify.xml
+4
-9
product/ERP5Form/EditorField.py
product/ERP5Form/EditorField.py
+13
-19
product/ERP5Form/ListBox.py
product/ERP5Form/ListBox.py
+50
-72
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/Workflow_statusModify.xml
View file @
f36260d2
...
@@ -94,15 +94,10 @@ for f in form.get_fields():\n
...
@@ -94,15 +94,10 @@ for f in form.get_fields():\n
listbox = request.get(\'listbox\') # XXX: hardcoded field name\n
listbox = request.get(\'listbox\') # XXX: hardcoded field name\n
if listbox is not None:\n
if listbox is not None:\n
listbox_line_list = []\n
listbox_line_list = []\n
listbox = getattr(request,\'listbox\',None) # XXX: hardcoded field name\n
for key, value in sorted(listbox.iteritems()):\n
listbox_keys = listbox.keys()\n
value[\'listbox_key\'] = key\n
listbox_keys.sort()\n
listbox_line_list.append(value)\n
for key in listbox_keys:\n
doaction_param_list[\'listbox\'] = tuple(listbox_line_list)\n
listbox_line = listbox[key]\n
listbox_line[\'listbox_key\'] = key\n
listbox_line_list.append(listbox[key])\n
listbox_line_list = tuple(listbox_line_list)\n
doaction_param_list[\'listbox\'] = listbox_line_list # XXX: hardcoded field name\n
\n
\n
try:\n
try:\n
context.portal_workflow.doActionFor(\n
context.portal_workflow.doActionFor(\n
...
...
product/ERP5Form/EditorField.py
View file @
f36260d2
...
@@ -83,16 +83,13 @@ class EditorWidget(Widget.TextAreaWidget):
...
@@ -83,16 +83,13 @@ class EditorWidget(Widget.TextAreaWidget):
"""
"""
here
=
REQUEST
[
'here'
]
here
=
REQUEST
[
'here'
]
text_editor
=
field
.
get_value
(
'text_editor'
)
text_editor
=
field
.
get_value
(
'text_editor'
)
if
text_editor
==
'text_area'
:
if
text_editor
==
'bespin'
:
return
Widget
.
TextAreaWidget
.
render
(
self
,
field
,
key
,
value
,
REQUEST
)
elif
text_editor
==
'bespin'
:
# XXX The usage of bespin editor depends of erp5_bespin bt5
# XXX The usage of bespin editor depends of erp5_bespin bt5
# installed and still experimental. If erp5_bespin is not installed, it
# installed and still experimental. If erp5_bespin is not installed, it
# render standard an standard editor field.
# render standard an standard editor field.
bespin_support
=
getattr
(
here
,
'bespin_support'
,
None
)
bespin_support
=
getattr
(
here
,
'bespin_support'
,
None
)
if
bespin_support
is
None
:
if
bespin_support
is
not
None
:
return
Widget
.
TextAreaWidget
.
render
(
self
,
field
,
key
,
value
,
REQUEST
)
return
bespin_support
.
pt_render
(
return
bespin_support
.
pt_render
(
extra_context
=
{
extra_context
=
{
'field'
:
field
,
'field'
:
field
,
'inputvalue'
:
value
,
'inputvalue'
:
value
,
...
@@ -100,9 +97,8 @@ class EditorWidget(Widget.TextAreaWidget):
...
@@ -100,9 +97,8 @@ class EditorWidget(Widget.TextAreaWidget):
})
})
elif
text_editor
==
"xinha"
:
elif
text_editor
==
"xinha"
:
xinha_support
=
getattr
(
here
,
'xinha_support'
,
None
)
xinha_support
=
getattr
(
here
,
'xinha_support'
,
None
)
if
xinha_support
is
None
:
if
xinha_support
is
not
None
:
return
Widget
.
TextAreaWidget
.
render
(
self
,
field
,
key
,
value
,
REQUEST
)
return
xinha_support
.
pt_render
(
return
xinha_support
.
pt_render
(
extra_context
=
{
extra_context
=
{
'field'
:
field
,
'field'
:
field
,
'field_value'
:
value
,
'field_value'
:
value
,
...
@@ -110,27 +106,25 @@ class EditorWidget(Widget.TextAreaWidget):
...
@@ -110,27 +106,25 @@ class EditorWidget(Widget.TextAreaWidget):
})
})
elif
text_editor
==
"svg_editor"
:
elif
text_editor
==
"svg_editor"
:
svg_editor_support
=
getattr
(
here
,
'svg_editor_support'
,
None
)
svg_editor_support
=
getattr
(
here
,
'svg_editor_support'
,
None
)
if
svg_editor_support
is
None
:
if
svg_editor_support
is
not
None
:
return
Widget
.
TextAreaWidget
.
render
(
self
,
field
,
key
,
value
,
REQUEST
)
return
svg_editor_support
.
pt_render
()
return
svg_editor_support
.
pt_render
()
elif
text_editor
==
"spreadsheet_editor"
:
elif
text_editor
==
"spreadsheet_editor"
:
sheet_editor_support
=
getattr
(
here
,
'sheet_editor_support'
,
None
)
sheet_editor_support
=
getattr
(
here
,
'sheet_editor_support'
,
None
)
if
sheet_editor_support
is
None
:
if
sheet_editor_support
is
not
None
:
return
Widget
.
TextAreaWidget
.
render
(
self
,
field
,
key
,
value
,
REQUEST
)
return
sheet_editor_support
.
pt_render
()
return
sheet_editor_support
.
pt_render
()
elif
text_editor
==
'ace'
:
elif
text_editor
==
'ace'
:
ace_editor_support
=
getattr
(
here
,
'ace_editor_support'
,
None
)
ace_editor_support
=
getattr
(
here
,
'ace_editor_support'
,
None
)
if
ace_editor_support
is
None
:
if
ace_editor_support
is
not
None
:
return
Widget
.
TextAreaWidth
.
render
(
self
,
field
,
key
,
value
,
REQUEST
)
return
ace_editor_support
.
pt_render
(
extra_context
=
{
'field'
:
field
,
return
ace_editor_support
.
pt_render
(
extra_context
=
{
'field'
:
field
,
'content'
:
value
,
'content'
:
value
,
'id'
:
key
})
'id'
:
key
})
el
se
:
el
if
text_editor
!=
'text_area'
:
return
here
.
fckeditor_wysiwyg_support
.
pt_render
(
return
here
.
fckeditor_wysiwyg_support
.
pt_render
(
extra_context
=
{
extra_context
=
{
'inputvalue'
:
value
,
'inputvalue'
:
value
,
'inputname'
:
key
'inputname'
:
key
})
})
return
Widget
.
TextAreaWidget
.
render
(
self
,
field
,
key
,
value
,
REQUEST
)
def
render_view
(
self
,
field
,
value
,
REQUEST
=
None
,
render_prefix
=
None
):
def
render_view
(
self
,
field
,
value
,
REQUEST
=
None
,
render_prefix
=
None
):
"""
"""
...
...
product/ERP5Form/ListBox.py
View file @
f36260d2
This diff is collapsed.
Click to expand it.
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