[Erp5-report] r24441 - in /erp5/trunk/products/ERP5Type: DocumentationHelper/ dtml/ patches/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 31 16:45:53 CET 2008


Author: seb
Date: Fri Oct 31 16:45:50 2008
New Revision: 24441

URL: http://svn.erp5.org?rev=24441&view=rev
Log:
- Add support of description for portal types actions
- Display this description into the documentation

Modified:
    erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeActionDocumentationHelper.py
    erp5/trunk/products/ERP5Type/dtml/editToolsActions.dtml
    erp5/trunk/products/ERP5Type/patches/ActionInformation.py
    erp5/trunk/products/ERP5Type/patches/ActionProviderBase.py

Modified: erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeActionDocumentationHelper.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeActionDocumentationHelper.py?rev=24441&r1=24440&r2=24441&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeActionDocumentationHelper.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/DocumentationHelper/PortalTypeActionDocumentationHelper.py [utf8] Fri Oct 31 16:45:50 2008
@@ -42,10 +42,6 @@
   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 @@
     """
     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):
     """

Modified: erp5/trunk/products/ERP5Type/dtml/editToolsActions.dtml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/dtml/editToolsActions.dtml?rev=24441&r1=24440&r2=24441&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/dtml/editToolsActions.dtml [utf8] (original)
+++ erp5/trunk/products/ERP5Type/dtml/editToolsActions.dtml [utf8] Fri Oct 31 16:45:50 2008
@@ -56,6 +56,20 @@
 <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>
+  <div class="form-label">
   Action
   </div>
 </td>
@@ -225,6 +239,20 @@
 <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>
+  <div class="form-label">
   Action
   </div>
 </td>

Modified: erp5/trunk/products/ERP5Type/patches/ActionInformation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/ActionInformation.py?rev=24441&r1=24440&r2=24441&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/ActionInformation.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/ActionInformation.py [utf8] Fri Oct 31 16:45:50 2008
@@ -63,6 +63,7 @@
         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 @@
         """
         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._getIconObject = _getIconObject
 ActionInformation.getIconExpression = getIconExpression
 ActionInformation.setIconExpression = setIconExpression
+ActionInformation.getDescription = getDescription
 ActionInformation.getPriority = getPriority
 ActionInformation.clone = clone
 ActionInformation.getMapping = getMapping

Modified: erp5/trunk/products/ERP5Type/patches/ActionProviderBase.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/ActionProviderBase.py?rev=24441&r1=24440&r2=24441&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/ActionProviderBase.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/patches/ActionProviderBase.py [utf8] Fri Oct 31 16:45:50 2008
@@ -29,6 +29,8 @@
         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_addAction( self
               , id
               , name
+              , description
               , action
               , condition
               , permission
@@ -84,6 +87,7 @@
 
     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 @@
     """
     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 @@
 
     return ActionInformation( id=id
                             , title=name
+                            , description=description
                             , action=action
                             , icon=icon
                             , condition=condition




More information about the Erp5-report mailing list