Commit 79ccb7bc authored by Jérome Perrin's avatar Jérome Perrin

We don't use 'optional' actions anylonger


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7282 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0c4902fe
...@@ -1798,8 +1798,8 @@ class ActionTemplateItem(ObjectTemplateItem): ...@@ -1798,8 +1798,8 @@ class ActionTemplateItem(ObjectTemplateItem):
, permission = action.permissions , permission = action.permissions
, category = action.category , category = action.category
, visible = action.visible , visible = action.visible
, icon = getattr(action, 'icon', None) and action.icon.text or '' , icon = getattr(action, 'icon', None)\
, optional = getattr(action, 'optional', 0) and action.icon.text or ''
, priority = action.priority , priority = action.priority
) )
# sort action based on the priority define on it # sort action based on the priority define on it
...@@ -1833,8 +1833,8 @@ class ActionTemplateItem(ObjectTemplateItem): ...@@ -1833,8 +1833,8 @@ class ActionTemplateItem(ObjectTemplateItem):
, permission = action.permissions , permission = action.permissions
, category = action.category , category = action.category
, visible = action.visible , visible = action.visible
, icon = getattr(action, 'icon', None) and action.icon.text or '' , icon = getattr(action, 'icon', None) \
, optional = getattr(action, 'optional', 0) and action.icon.text or ''
) )
new_priority = action.priority new_priority = action.priority
action_list = obj.listActions() action_list = obj.listActions()
......
...@@ -32,7 +32,6 @@ if 1: ...@@ -32,7 +32,6 @@ if 1:
, visible=1 , visible=1
, action='' , action=''
, icon='' , icon=''
, optional=0
): ):
""" Set up an instance. """ Set up an instance.
""" """
...@@ -55,8 +54,6 @@ if 1: ...@@ -55,8 +54,6 @@ if 1:
self.visible = visible self.visible = visible
self.setActionExpression(action) self.setActionExpression(action)
self.setIconExpression(icon) self.setIconExpression(icon)
self.optional = optional
def getAction( self, ec ): def getAction( self, ec ):
...@@ -76,7 +73,6 @@ if 1: ...@@ -76,7 +73,6 @@ if 1:
info['permissions'] = self.getPermissions() info['permissions'] = self.getPermissions()
info['category'] = self.getCategory() info['category'] = self.getCategory()
info['visible'] = self.getVisibility() info['visible'] = self.getVisibility()
info['optional'] = self.getOption()
info['priority'] = self.getPriority() info['priority'] = self.getPriority()
return info return info
...@@ -111,14 +107,6 @@ if 1: ...@@ -111,14 +107,6 @@ if 1:
icon = Expression( icon ) icon = Expression( icon )
self.icon = 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 ): def getPriority( self ):
""" """
Return the priority of the action Return the priority of the action
...@@ -139,7 +127,6 @@ if 1: ...@@ -139,7 +127,6 @@ if 1:
, visible=self.visible , visible=self.visible
, action=self.getActionExpression() , action=self.getActionExpression()
, icon=self.getIconExpression() , icon=self.getIconExpression()
, optional=self.getOption()
) )
def getMapping(self): def getMapping(self):
...@@ -154,7 +141,6 @@ if 1: ...@@ -154,7 +141,6 @@ if 1:
'permissions': self.permissions, 'permissions': self.permissions,
'visible': bool(self.visible), 'visible': bool(self.visible),
'action': self.getActionExpression(), 'action': self.getActionExpression(),
'optional': self.getOption(),
'icon': self.getIconExpression(), 'icon': self.getIconExpression(),
'priority': self.getPriority() } 'priority': self.getPriority() }
...@@ -164,7 +150,6 @@ ActionInformation.getAction = getAction ...@@ -164,7 +150,6 @@ ActionInformation.getAction = getAction
ActionInformation._getIconObject = _getIconObject ActionInformation._getIconObject = _getIconObject
ActionInformation.getIconExpression = getIconExpression ActionInformation.getIconExpression = getIconExpression
ActionInformation.setIconExpression = setIconExpression ActionInformation.setIconExpression = setIconExpression
ActionInformation.getOption = getOption
ActionInformation.getPriority = getPriority ActionInformation.getPriority = getPriority
ActionInformation.clone = clone ActionInformation.clone = clone
ActionInformation.getMapping = getMapping ActionInformation.getMapping = getMapping
......
...@@ -41,8 +41,6 @@ def ActionProviderBase_manage_editActionsForm( self, REQUEST, manage_tabs_messag ...@@ -41,8 +41,6 @@ def ActionProviderBase_manage_editActionsForm( self, REQUEST, manage_tabs_messag
a1['priority'] = a.getPriority() a1['priority'] = a.getPriority()
if hasattr(a, 'getIconExpression') : if hasattr(a, 'getIconExpression') :
a1['icon'] = a.getIconExpression() a1['icon'] = a.getIconExpression()
if hasattr(a, 'getOption') :
a1['optional'] = a.getOption()
actions.append(a1) actions.append(a1)
# possible_permissions is in AccessControl.Role.RoleManager. # possible_permissions is in AccessControl.Role.RoleManager.
...@@ -65,7 +63,6 @@ def ActionProviderBase_addAction( self ...@@ -65,7 +63,6 @@ def ActionProviderBase_addAction( self
, category , category
, icon=None , icon=None
, visible=1 , visible=1
, optional=0
, priority=1.0 , priority=1.0
, REQUEST=None , REQUEST=None
): ):
...@@ -91,7 +88,6 @@ def ActionProviderBase_addAction( self ...@@ -91,7 +88,6 @@ def ActionProviderBase_addAction( self
, permissions=permission , permissions=permission
, category=str(category) , category=str(category)
, visible=int(visible) , visible=int(visible)
, optional=int(optional)
, priority=float(priority) , priority=float(priority)
) )
...@@ -114,7 +110,6 @@ def ActionProviderBase_extractAction( self, properties, index ): ...@@ -114,7 +110,6 @@ def ActionProviderBase_extractAction( self, properties, index ):
condition = str( properties.get( 'condition_%d' % index, '' ) ) condition = str( properties.get( 'condition_%d' % index, '' ) )
category = str( properties.get( 'category_%d' % index, '' )) category = str( properties.get( 'category_%d' % index, '' ))
visible = properties.get( 'visible_%d' % index, 0 ) visible = properties.get( 'visible_%d' % index, 0 )
optional = properties.get( 'optional_%d' % index, 0 )
permissions = properties.get( 'permission_%d' % index, () ) permissions = properties.get( 'permission_%d' % index, () )
priority = float( properties.get( 'priority_%d' % index, 1.0 )) priority = float( properties.get( 'priority_%d' % index, 1.0 ))
...@@ -139,12 +134,6 @@ def ActionProviderBase_extractAction( self, properties, index ): ...@@ -139,12 +134,6 @@ def ActionProviderBase_extractAction( self, properties, index ):
except TypeError: except TypeError:
visible = 0 visible = 0
if type( optional ) is not type( 0 ):
try:
optional = int( optional )
except TypeError:
optional = 0
if type( permissions ) is type( '' ): if type( permissions ) is type( '' ):
permissions = ( permissions, ) permissions = ( permissions, )
...@@ -159,7 +148,6 @@ def ActionProviderBase_extractAction( self, properties, index ): ...@@ -159,7 +148,6 @@ def ActionProviderBase_extractAction( self, properties, index ):
, permissions=permissions , permissions=permissions
, category=category , category=category
, visible=visible , visible=visible
, optional=optional
, priority=priority , priority=priority
) )
......
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