Commit 278236ac authored by Sebastien Robin's avatar Sebastien Robin

adapt action patches to zope 2.12 and newer version

of CMFCore

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38881 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 28b5268a
......@@ -33,7 +33,7 @@
</td>
<td>
<div class="form-element">
<input type="text" name="name_&dtml-index;" value="&dtml-name;" />
<input type="text" name="title_&dtml-index;" value="&dtml-title;" />
</div>
</td>
</tr>
......@@ -118,11 +118,11 @@
<td>
<div class="form-element">
<select name="permission_&dtml-index;">
<dtml-let selected="(not permission) and 'selected' or ' '">
<dtml-let selected="(not permissions) and 'selected' or ' '">
<option value="" &dtml-selected;>(none)</option>
</dtml-let>
<dtml-in possible_permissions sort>
<dtml-let selected="(permission == _['sequence-item'])
<dtml-let selected="(permissions and permissions[0] == _['sequence-item'])
and 'selected' or ' '">
<option value="&dtml-sequence-item;" &dtml-selected;>&dtml-sequence-item;</option>
</dtml-let>
......@@ -216,7 +216,7 @@ Add an action
</td>
<td>
<div class="form-element">
<input type="text" name="name" value="" />
<input type="text" name="title" value="" />
</div>
</td>
</tr>
......
......@@ -60,7 +60,7 @@ def ActionProviderBase_manage_editActionsForm( self, REQUEST, manage_tabs_messag
def ActionProviderBase_addAction( self
, id
, name
, title
, action
, condition
, permission
......@@ -73,8 +73,8 @@ def ActionProviderBase_addAction( self
):
""" Add an action to our list.
"""
if not name:
raise ValueError('A name is required.')
if not title:
raise ValueError('A title is required.')
a_expr = action and Expression(text=str(action)) or ''
i_expr = icon and Expression(text=str(icon)) or ''
......@@ -86,7 +86,7 @@ def ActionProviderBase_addAction( self
new_actions = self._cloneActions()
new_action = ActionInformation( id=str(id)
, title=str(name)
, title=str(title)
, description=str(description)
, action=a_expr
, icon=i_expr
......@@ -110,7 +110,7 @@ def ActionProviderBase_extractAction( self, properties, index ):
""" Extract an ActionInformation from the funky form properties.
"""
id = str( properties.get( 'id_%d' % index, '' ) )
name = str( properties.get( 'name_%d' % index, '' ) )
title = str( properties.get( 'title_%d' % index, '' ) )
description = str( properties.get( 'description_%d' % index, '' ) )
action = str( properties.get( 'action_%d' % index, '' ) )
icon = str( properties.get( 'icon_%d' % index, '' ) )
......@@ -120,8 +120,8 @@ def ActionProviderBase_extractAction( self, properties, index ):
permissions = properties.get( 'permission_%d' % index, () )
priority = float( properties.get( 'priority_%d' % index, 1.0 ))
if not name:
raise ValueError('A name is required.')
if not title:
raise ValueError('A title is required.')
if action is not '':
action = Expression( text=action )
......@@ -148,7 +148,7 @@ def ActionProviderBase_extractAction( self, properties, index ):
priority = float(priority)
return ActionInformation( id=id
, title=name
, title=title
, description=description
, action=action
, icon=icon
......
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