[Erp5-report] r7282 - in /erp5/trunk/products: ERP5/Document/ ERP5Type/patches/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 16 00:55:19 CEST 2006


Author: jerome
Date: Tue May 16 00:55:12 2006
New Revision: 7282

URL: http://svn.erp5.org?rev=7282&view=rev
Log:
We don't use 'optional' actions anylonger

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py
    erp5/trunk/products/ERP5Type/patches/ActionInformation.py
    erp5/trunk/products/ERP5Type/patches/ActionProviderBase.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=7282&r1=7281&r2=7282&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Tue May 16 00:55:12 2006
@@ -1798,8 +1798,8 @@
                       , permission = action.permissions
                       , category = action.category
                       , visible = action.visible
-                      , icon = getattr(action, 'icon', None) and action.icon.text or ''
-                      , optional = getattr(action, 'optional', 0)
+                      , icon = getattr(action, 'icon', None)\
+                                and action.icon.text or ''
                       , priority = action.priority
                     )
           # sort action based on the priority define on it
@@ -1833,8 +1833,8 @@
                     , permission = action.permissions
                     , category = action.category
                     , visible = action.visible
-                    , icon = getattr(action, 'icon', None) and action.icon.text or ''
-                    , optional = getattr(action, 'optional', 0)
+                    , icon = getattr(action, 'icon', None) \
+                                      and action.icon.text or ''
                     )
         new_priority = action.priority
         action_list = obj.listActions()

Modified: erp5/trunk/products/ERP5Type/patches/ActionInformation.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/ActionInformation.py?rev=7282&r1=7281&r2=7282&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/ActionInformation.py (original)
+++ erp5/trunk/products/ERP5Type/patches/ActionInformation.py Tue May 16 00:55:12 2006
@@ -32,7 +32,6 @@
                 , visible=1
                 , action=''
                 , icon=''
-                , optional=0
                 ):
         """ Set up an instance.
         """
@@ -55,8 +54,6 @@
         self.visible = visible
         self.setActionExpression(action)
         self.setIconExpression(icon)
-        self.optional = optional
-
 
     def getAction( self, ec ):
 
@@ -76,7 +73,6 @@
         info['permissions'] = self.getPermissions()
         info['category'] = self.getCategory()
         info['visible'] = self.getVisibility()
-        info['optional'] = self.getOption()
         info['priority'] = self.getPriority()
         return info
 
@@ -111,19 +107,11 @@
                 icon = Expression( icon )
         self.icon = icon
 
-
-    security.declarePublic( 'getOption' )
-    def getOption( self ):
-
-        """ Return whether the action should be optional in the Business Template.
-        """
-        return getattr( self, 'optional', 0 )
-
     def getPriority( self ):
         """
         Return the priority of the action
         """
-        return getattr(self, 'priority', 1.0)    
+        return getattr(self, 'priority', 1.0)
 
     def clone( self ):
 
@@ -139,7 +127,6 @@
                              , visible=self.visible
                              , action=self.getActionExpression()
                              , icon=self.getIconExpression()
-                             , optional=self.getOption()
                              )
 
     def getMapping(self):
@@ -154,7 +141,6 @@
                  'permissions': self.permissions,
                  'visible': bool(self.visible),
                  'action': self.getActionExpression(),
-                 'optional': self.getOption(),
                  'icon': self.getIconExpression(),
                  'priority': self.getPriority() }
 
@@ -164,7 +150,6 @@
 ActionInformation._getIconObject = _getIconObject
 ActionInformation.getIconExpression = getIconExpression
 ActionInformation.setIconExpression = setIconExpression
-ActionInformation.getOption = getOption
 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=7282&r1=7281&r2=7282&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/ActionProviderBase.py (original)
+++ erp5/trunk/products/ERP5Type/patches/ActionProviderBase.py Tue May 16 00:55:12 2006
@@ -41,8 +41,6 @@
           a1['priority'] = a.getPriority()
         if hasattr(a, 'getIconExpression') :
           a1['icon'] = a.getIconExpression()
-        if hasattr(a, 'getOption') :
-          a1['optional'] = a.getOption()
         actions.append(a1)
 
     # possible_permissions is in AccessControl.Role.RoleManager.
@@ -65,7 +63,6 @@
               , category
               , icon=None
               , visible=1
-              , optional=0
               , priority=1.0
               , REQUEST=None
               ):
@@ -91,7 +88,6 @@
                                   , permissions=permission
                                   , category=str(category)
                                   , visible=int(visible)
-                                  , optional=int(optional)
                                   , priority=float(priority)
                                   )
 
@@ -114,7 +110,6 @@
     condition   = str( properties.get( 'condition_%d'   % index, '' ) )
     category    = str( properties.get( 'category_%d'    % index, '' ))
     visible     =      properties.get( 'visible_%d'     % index, 0  )
-    optional    =      properties.get( 'optional_%d'    % index, 0  )
     permissions =      properties.get( 'permission_%d'  % index, () )
     priority    = float( properties.get( 'priority_%d'    % index, 1.0 ))
 
@@ -139,12 +134,6 @@
         except TypeError:
             visible = 0
 
-    if type( optional ) is not type( 0 ):
-        try:
-            optional = int( optional )
-        except TypeError:
-            optional = 0
-
     if type( permissions ) is type( '' ):
         permissions = ( permissions, )
 
@@ -159,7 +148,6 @@
                             , permissions=permissions
                             , category=category
                             , visible=visible
-                            , optional=optional
                             , priority=priority
                             )
 




More information about the Erp5-report mailing list