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