Commit a117ffc8 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Take into account installation state. This is a quick and dirty fix. It would...

Take into account installation state. This is a quick and dirty fix. It would be better to allow users for example to select the latest bt5 in a given state.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27088 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 81e3ffa9
...@@ -56,9 +56,16 @@ class ERP5SiteDocumentationHelper(DocumentationHelper): ...@@ -56,9 +56,16 @@ class ERP5SiteDocumentationHelper(DocumentationHelper):
return "ERP5 Site" return "ERP5 Site"
def getBusinessTemplateValueList(self): def getBusinessTemplateValueList(self):
bt_list = getattr(self, 'REQUEST', {}).get("business_template_list") documented_bt_list = getattr(self, 'REQUEST', {}).get("business_template_list")
return (bt for bt in self.getPortalObject().portal_templates.objectValues() # return (bt for bt in self.getPortalObject().portal_templates.objectValues()
if bt_list is None or bt.getTitle() in bt_list) # if bt_list is None or (bt.getTitle() in bt_list and bt.getInstallationSate()=='installed'))
bt_list = []
for bt in self.getDocumentedObject().portal_templates.objectValues():
if bt.getInstallationState() == 'installed' and (documented_bt_list is None or bt.getTitle() in documented_bt_list):
bt_list.append(bt)
return bt_list
security.declareProtected(Permissions.AccessContentsInformation, 'getBusinessTemplateItemList') security.declareProtected(Permissions.AccessContentsInformation, 'getBusinessTemplateItemList')
def getBusinessTemplateItemList(self): def getBusinessTemplateItemList(self):
......
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