diff --git a/product/ERP5Type/DocumentationHelper/PortalTypeActionDocumentationHelper.py b/product/ERP5Type/DocumentationHelper/PortalTypeActionDocumentationHelper.py index 9cca2efd77a6210036e83f3a3471812cbaa0a04d..c2ff9f7bad2a292711d33bf5a6c037f3dcfff19f 100644 --- a/product/ERP5Type/DocumentationHelper/PortalTypeActionDocumentationHelper.py +++ b/product/ERP5Type/DocumentationHelper/PortalTypeActionDocumentationHelper.py @@ -42,10 +42,6 @@ class PortalTypeActionDocumentationHelper(DocumentationHelper): def __init__(self, uri): self.uri = uri - security.declareProtected(Permissions.AccessContentsInformation, 'getDescription') - def getDescription(self): - return getattr(self.getDocumentedObject(), "description", '') - security.declareProtected(Permissions.AccessContentsInformation, 'getType' ) def getType(self): """ @@ -74,6 +70,13 @@ class PortalTypeActionDocumentationHelper(DocumentationHelper): """ return getattr(self.getDocumentedObject(), "title", '') + security.declareProtected(Permissions.AccessContentsInformation, 'getTitle' ) + def getDescription(self): + """ + Returns the title of the documentation helper + """ + return getattr(self.getDocumentedObject(), "description", '') + security.declareProtected(Permissions.AccessContentsInformation, 'getPermissions' ) def getPermissions(self): """ diff --git a/product/ERP5Type/dtml/editToolsActions.dtml b/product/ERP5Type/dtml/editToolsActions.dtml index b35b6bfa3b19f66e82ed1cead2c14123f1045a83..c0a2a49cd3323e379edb24082144cde32380f728 100644 --- a/product/ERP5Type/dtml/editToolsActions.dtml +++ b/product/ERP5Type/dtml/editToolsActions.dtml @@ -52,6 +52,20 @@ </td> </tr> +<tr> +<td></td> +<td> + <div class="form-label"> + Description + </div> +</td> +<td> + <div class="form-element"> + <input type="text" name="description_&dtml-index;" value="&dtml-description;" size="80"/> + </div> +</td> +</tr> + <tr> <td></td> <td> @@ -221,6 +235,20 @@ Add an action </td> </tr> +<tr> +<td></td> +<td> + <div class="form-label"> + Description + </div> +</td> +<td> + <div class="form-element"> + <input type="text" name="description" value="" size="80"/> + </div> +</td> +</tr> + <tr> <td></td> <td> diff --git a/product/ERP5Type/patches/ActionInformation.py b/product/ERP5Type/patches/ActionInformation.py index b1bf68b70f964e116ba9099b30728012f9c8724f..039d3e79841f76db519b7ecce8625c13f28255b4 100644 --- a/product/ERP5Type/patches/ActionInformation.py +++ b/product/ERP5Type/patches/ActionInformation.py @@ -63,6 +63,7 @@ if 1: info = {} info['id'] = self.id info['name'] = self.Title() + info['description'] = self.getDescription() expr = self.getActionExpression() __traceback_info__ = (info['id'], info['name'], expr) action_obj = self._getActionObject() @@ -113,6 +114,12 @@ if 1: """ return getattr(self, 'priority', 1.0) + def getDescription( self ): + """ + Return the priority of the action + """ + return getattr(self, 'description', '') + def clone( self ): """ Return a newly-created AI just like us. @@ -150,6 +157,7 @@ ActionInformation.getAction = getAction ActionInformation._getIconObject = _getIconObject ActionInformation.getIconExpression = getIconExpression ActionInformation.setIconExpression = setIconExpression +ActionInformation.getDescription = getDescription ActionInformation.getPriority = getPriority ActionInformation.clone = clone ActionInformation.getMapping = getMapping diff --git a/product/ERP5Type/patches/ActionProviderBase.py b/product/ERP5Type/patches/ActionProviderBase.py index 5117b2f475aba8a6cb1851f637138a7a58a86d23..ffe768869920df5f429af5f7efe98c69cf79ba04 100644 --- a/product/ERP5Type/patches/ActionProviderBase.py +++ b/product/ERP5Type/patches/ActionProviderBase.py @@ -29,6 +29,8 @@ def ActionProviderBase_manage_editActionsForm( self, REQUEST, manage_tabs_messag a1 = {} a1['id'] = a.getId() a1['title'] = a1['name'] = a.Title() + if hasattr(a, 'getDescription'): + a1['description'] = a.getDescription() p = a.getPermissions() a1['permissions'] = p if p: @@ -59,6 +61,7 @@ def ActionProviderBase_manage_editActionsForm( self, REQUEST, manage_tabs_messag def ActionProviderBase_addAction( self , id , name + , description , action , condition , permission @@ -84,6 +87,7 @@ def ActionProviderBase_addAction( self new_action = ActionInformation( id=str(id) , title=str(name) + , description=str(description) , action=a_expr , icon=i_expr , condition=c_expr @@ -107,6 +111,7 @@ def ActionProviderBase_extractAction( self, properties, index ): """ id = str( properties.get( 'id_%d' % index, '' ) ) name = str( properties.get( 'name_%d' % index, '' ) ) + description = str( properties.get( 'description_%d' % index, '' ) ) action = str( properties.get( 'action_%d' % index, '' ) ) icon = str( properties.get( 'icon_%d' % index, '' ) ) condition = str( properties.get( 'condition_%d' % index, '' ) ) @@ -144,6 +149,7 @@ def ActionProviderBase_extractAction( self, properties, index ): return ActionInformation( id=id , title=name + , description=description , action=action , icon=icon , condition=condition