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):
, 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 @@ class ActionTemplateItem(ObjectTemplateItem):
, 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()
......
......@@ -32,7 +32,6 @@ if 1:
, visible=1
, action=''
, icon=''
, optional=0
):
""" Set up an instance.
"""
......@@ -55,8 +54,6 @@ if 1:
self.visible = visible
self.setActionExpression(action)
self.setIconExpression(icon)
self.optional = optional
def getAction( self, ec ):
......@@ -76,7 +73,6 @@ if 1:
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 @@ if 1:
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 @@ if 1:
, visible=self.visible
, action=self.getActionExpression()
, icon=self.getIconExpression()
, optional=self.getOption()
)
def getMapping(self):
......@@ -154,7 +141,6 @@ if 1:
'permissions': self.permissions,
'visible': bool(self.visible),
'action': self.getActionExpression(),
'optional': self.getOption(),
'icon': self.getIconExpression(),
'priority': self.getPriority() }
......@@ -164,7 +150,6 @@ ActionInformation.getAction = getAction
ActionInformation._getIconObject = _getIconObject
ActionInformation.getIconExpression = getIconExpression
ActionInformation.setIconExpression = setIconExpression
ActionInformation.getOption = getOption
ActionInformation.getPriority = getPriority
ActionInformation.clone = clone
ActionInformation.getMapping = getMapping
......
......@@ -41,8 +41,6 @@ def ActionProviderBase_manage_editActionsForm( self, REQUEST, manage_tabs_messag
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 @@ def ActionProviderBase_addAction( self
, category
, icon=None
, visible=1
, optional=0
, priority=1.0
, REQUEST=None
):
......@@ -91,7 +88,6 @@ def ActionProviderBase_addAction( self
, permissions=permission
, category=str(category)
, visible=int(visible)
, optional=int(optional)
, priority=float(priority)
)
......@@ -114,7 +110,6 @@ def ActionProviderBase_extractAction( self, properties, index ):
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 @@ def ActionProviderBase_extractAction( self, properties, index ):
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 @@ def ActionProviderBase_extractAction( self, properties, index ):
, permissions=permissions
, category=category
, visible=visible
, optional=optional
, 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