Commit 4c701c70 authored by Jérome Perrin's avatar Jérome Perrin

core: improve support of ERP5 scripts in ZMI

 - fix order of ZMI tabs to make `Edit` the default
 - enable ZMI code editor
 - add an icon
 - fix links to python scripts in BusinessTemplate_getPythonSourceCodeMessageList
parent 8fa6e5b8
......@@ -77,9 +77,10 @@ class PythonScript(XMLObject, ZopePythonScript, ExpressionMixin('expression')):
security.declareObjectProtected(Permissions.AccessContentsInformation)
#View content list, Force /view, Standart option in python scripts
manage_options = ( XMLObject.manage_options[0],
manage_options = ( ZopePythonScript.manage_options[0],
{'icon':'', 'label':'View','action':'view'}) \
+ ZopePythonScript.manage_options
+ ( XMLObject.manage_options[0], ) \
+ ZopePythonScript.manage_options[1:]
# Declarative properties
property_sheets = ( PropertySheet.Base
......
......@@ -27,9 +27,7 @@
</item>
<item>
<key> <string>content_icon</string> </key>
<value>
<none/>
</value>
<value> <string>/misc_/PythonScripts/pyscript.gif</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -65,6 +63,18 @@
<key> <string>type_class</string> </key>
<value> <string>PythonScript</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -8,9 +8,7 @@
<dictionary>
<item>
<key> <string>content_icon</string> </key>
<value>
<none/>
</value>
<value> <string>/misc_/PythonScripts/pyscript.gif</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......
......@@ -61,7 +61,7 @@ def checkPythonScript(script_instance, script_path):
Message(
location="{script_path}:{row}:{column}".format(**annotation),
message=annotation['text'],
edit_url="{script_path}/manage_main?line={row}".format(**annotation),))
edit_url="{script_path}/manage_workspace?line={row}".format(**annotation),))
def checkComponent(component_instance):
"""Check a component, adding messages to global `line_list`
......
......@@ -58,7 +58,7 @@ def manage_page_footer(self):
else:
mode = 'html'
textarea_selector = 'textarea[name="filedata:text"]'
elif document.meta_type in ('Script (Python)', ):
elif document.meta_type in ('Script (Python)', 'ERP5 Python Script', 'ERP5 Workflow Script', ):
mode = 'python'
textarea_selector = 'textarea[name="body:text"]'
# printed is from RestrictedPython.RestrictionMutator the rest comes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment