From fd2122448ffad64579600cd884de002671adb606 Mon Sep 17 00:00:00 2001 From: Yoshinori Okuji <yo@nexedi.com> Date: Thu, 10 Jun 2004 12:12:55 +0000 Subject: [PATCH] Add the property sheet SimpleItem. Add many getter methods to sort lists. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@989 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/Document/BusinessTemplate.py | 70 +++++++++++++++++++---- 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py index f21dbe0128..f15dc3ca8e 100755 --- a/product/ERP5/Document/BusinessTemplate.py +++ b/product/ERP5/Document/BusinessTemplate.py @@ -308,6 +308,7 @@ class BusinessTemplate(XMLObject): # Declarative properties property_sheets = ( PropertySheet.Base , PropertySheet.XMLObject + , PropertySheet.SimpleItem , PropertySheet.CategoryCore , PropertySheet.BusinessTemplate ) @@ -335,10 +336,10 @@ Une ligne tarifaire.""" , 'permissions' : ( Permissions.View, ) } - , { 'id' : 'list' - , 'name' : 'Object Contents' - , 'category' : 'object_action' - , 'action' : 'folder_contents' + , { 'id' : 'history' + , 'name' : 'History' + , 'category' : 'object_view' + , 'action' : 'history_view' , 'permissions' : ( Permissions.View, ) } @@ -354,11 +355,11 @@ Une ligne tarifaire.""" , 'category' : 'object_view' , 'action' : 'metadata_view' , 'permissions' : ( - Permissions.View, ) + Permissions.ManageProperties, ) } , { 'id' : 'translate' , 'name' : 'Translate' - , 'category' : 'object_action' + , 'category' : 'object_exchange' , 'action' : 'translation_template_view' , 'permissions' : ( Permissions.TranslateContent, ) @@ -366,12 +367,13 @@ Une ligne tarifaire.""" ) } - def getTemplateCatalogMethodIdList(self): + def _getOrderedList(self, id): """ - We have to set this method because we want an - ordered list + We have to set this method because we want an + ordered list """ - result = getattr(self,'template_catalog_method_id',()) + #LOG('BuisinessTemplate _getOrderedList', 0, 'id = %s' % repr(id)) + result = getattr(self,id,()) if result is None: result = () if result != (): result = list(result) @@ -379,6 +381,54 @@ Une ligne tarifaire.""" result = tuple(result) return result + def getTemplateCatalogMethodIdList(self): + """ + We have to set this method because we want an + ordered list + """ + return self._getOrderedList('template_catalog_method_id') + + def getTemplateBaseCategoryList(self): + """ + We have to set this method because we want an + ordered list + """ + return self._getOrderedList('template_base_category') + + def getTemplateWorkflowIdList(self): + """ + We have to set this method because we want an + ordered list + """ + return self._getOrderedList('template_workflow_id') + + def getTemplatePortalTypeIdList(self): + """ + We have to set this method because we want an + ordered list + """ + return self._getOrderedList('template_portal_type_id') + + def getTemplateActionPathList(self): + """ + We have to set this method because we want an + ordered list + """ + return self._getOrderedList('template_action_path') + + def getTemplateSkinIdList(self): + """ + We have to set this method because we want an + ordered list + """ + return self._getOrderedList('template_skin_id') + + def getTemplateModuleIdList(self): + """ + We have to set this method because we want an + ordered list + """ + return self._getOrderedList('template_module_id') def initInstance(self): self._object_archive = PersistentMapping() -- 2.30.9