Commit e641f64d authored by Romain Courteaud's avatar Romain Courteaud

Bug fix: add possibility to validate all fields in a form by clicking on the wheel button.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2484 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7e99c5ff
...@@ -229,8 +229,7 @@ class MultiRelationEditor: ...@@ -229,8 +229,7 @@ class MultiRelationEditor:
REQUEST.set(relation_item_id, ((display_text, uid),)) REQUEST.set(relation_item_id, ((display_text, uid),))
REQUEST.set(relation_field_id, uid) REQUEST.set(relation_field_id, uid)
#REQUEST.set(self.field_id[len('field_'):], value_list) # XXX Dirty
REQUEST.set(self.field_id, value_list) # XXX Dirty REQUEST.set(self.field_id, value_list) # XXX Dirty
else: else:
# Make sure no default value appears # Make sure no default value appears
...@@ -345,7 +344,8 @@ class MultiRelationStringFieldValidator(Validator.LinesValidator, RelationField ...@@ -345,7 +344,8 @@ class MultiRelationStringFieldValidator(Validator.LinesValidator, RelationField
relation_field_id = 'relation_%s' % ( key ) relation_field_id = 'relation_%s' % ( key )
# we must know if user validate the form or click on the wheel button # we must know if user validate the form or click on the wheel button
relation_uid_list = REQUEST.get(relation_field_id, None) relation_uid_list = REQUEST.get(relation_field_id, None)
if checkSameKeys( value_list, current_value_list ) and (relation_uid_list is None): relation_field_sub_id = 'relation_%s_0' % ( key )
if checkSameKeys( value_list, current_value_list ) and (relation_uid_list is None) and (not REQUEST.has_key( relation_field_sub_id )):
# XXX Will be interpreted by Base_edit as "do nothing" # XXX Will be interpreted by Base_edit as "do nothing"
#return MultiRelationEditor(field.id, base_category, portal_type, portal_type_item, catalog_index, relation_setter_id, None) #return MultiRelationEditor(field.id, base_category, portal_type, portal_type_item, catalog_index, relation_setter_id, None)
return None return None
...@@ -355,7 +355,7 @@ class MultiRelationStringFieldValidator(Validator.LinesValidator, RelationField ...@@ -355,7 +355,7 @@ class MultiRelationStringFieldValidator(Validator.LinesValidator, RelationField
relation_field_id = 'relation_%s' % ( key ) relation_field_id = 'relation_%s' % ( key )
# We must be able to erase the relation # We must be able to erase the relation
if value_list == ['']: if (value_list == ['']) and (not REQUEST.has_key( relation_field_id )):
display_text = 'Delete the relation' display_text = 'Delete the relation'
return MultiRelationEditor(field.id, base_category, portal_type, portal_type_item, catalog_index, relation_setter_id, []) return MultiRelationEditor(field.id, base_category, portal_type, portal_type_item, catalog_index, relation_setter_id, [])
# return RelationEditor(key, base_category, portal_type, None, # return RelationEditor(key, base_category, portal_type, None,
...@@ -379,7 +379,8 @@ class MultiRelationStringFieldValidator(Validator.LinesValidator, RelationField ...@@ -379,7 +379,8 @@ class MultiRelationStringFieldValidator(Validator.LinesValidator, RelationField
display_text = 'Object has been deleted' display_text = 'Object has been deleted'
# Check # Check
REQUEST.set(relation_item_id, ( (display_text, relation_uid), )) REQUEST.set(relation_item_id, ( (display_text, relation_uid), ))
relation_editor_list.append( (i, '', str(relation_uid), display_text) ) # Storing display_text as value is needded in this case
relation_editor_list.append( (i, display_text, str(relation_uid), display_text) )
return MultiRelationEditor(field.id, base_category, portal_type, portal_type_item, catalog_index, relation_setter_id, relation_editor_list) return MultiRelationEditor(field.id, base_category, portal_type, portal_type_item, catalog_index, relation_setter_id, relation_editor_list)
......
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