Commit 0ca82849 authored by Mayoro Diagne's avatar Mayoro Diagne

- restriction in the list of business templates returned to those selected by...

- restriction in the list of business templates returned to those selected by the user in documentation
- changing the source mime-type from python script to text/plain for z_sql_methods and catalog_methods


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23511 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 86ac56da
......@@ -80,7 +80,7 @@ class CatalogMethodDocumentationHelper(DocumentationHelper):
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
return source_code
src_mimetype='text/x-python'
src_mimetype='text/plain'
mime_type = 'text/html'
source_html = portal_transforms.convertTo(mime_type, source_code, mimetype = src_mimetype)
return source_html.getData()
......
......@@ -84,13 +84,17 @@ class ERP5SiteDocumentationHelper(DocumentationHelper):
def getBusinessTemplateItemList(self):
"""
"""
REQUEST = getattr(self, 'REQUEST', None)
business_template_list = [bt.getTitle() for bt in self.getDocumentedObject().portal_templates.objectValues()]
if REQUEST is not None:
business_template_list = REQUEST.get("business_template_list", [])
return [(bt.getId(),
getattr(bt, "title", ''),
getattr(bt, "description", ''),
getattr(bt, "version", ''),
getattr(bt, "revision", ''))
for bt in self.getDocumentedObject().portal_templates.objectValues()
if bt.getInstallationState() == 'installed']
if bt.getInstallationState() == 'installed' and bt.getTitle() in business_template_list]
security.declareProtected( Permissions.AccessContentsInformation, 'getBusinessTemplateURIList' )
def getBusinessTemplateURIList(self):
......
......@@ -80,7 +80,7 @@ class ZSQLMethodDocumentationHelper(DocumentationHelper):
LOG('DCWorkflowScriptDocumentationHelper', INFO,
'Transformation Tool is not installed. No convertion of python script to html')
return source_code
src_mimetype='text/x-python'
src_mimetype='text/plain'
mime_type = 'text/html'
source_html = portal_transforms.convertTo(mime_type, source_code, mimetype = src_mimetype)
return source_html.getData()
......
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