Commit 220516a4 authored by Jérome Perrin's avatar Jérome Perrin

- don't include (s) in messages, use plural ("If you are not sure whether a

  noun should be singular or plural, use plural" from
  http://www.erp5.org/GuidelinesForNamingConvention )
- use Base_redirect



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29523 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 858aaa7b
...@@ -65,10 +65,12 @@ request=context.REQUEST\n ...@@ -65,10 +65,12 @@ request=context.REQUEST\n
\n \n
if uids != []:\n if uids != []:\n
context.manage_copyObjects(uids=uids, REQUEST=request, RESPONSE=request.RESPONSE)\n context.manage_copyObjects(uids=uids, REQUEST=request, RESPONSE=request.RESPONSE)\n
message = Base_translateString("Item(s) copied.")\n message = Base_translateString("Items copied.")\n
else:\n else:\n
message = Base_translateString("Please select one or more items to copy first.")\n message = Base_translateString("Please select one or more items to copy first.")\n
return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % message)\n \n
return context.Base_redirect(form_id,\n
keep_items=dict(portal_status_message=message))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -79,7 +81,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p ...@@ -79,7 +81,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>form_id, uids=[], listbox_uid=[],selection_name=\'\'</string> </value> <value> <string>form_id, uids=[], listbox_uid=[], selection_name=\'\'</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
...@@ -122,6 +124,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p ...@@ -122,6 +124,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p
<string>selected_uids</string> <string>selected_uids</string>
<string>request</string> <string>request</string>
<string>message</string> <string>message</string>
<string>dict</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -96,10 +96,11 @@ if uids != []:\n ...@@ -96,10 +96,11 @@ if uids != []:\n
qs = \'?portal_status_message=%s\' % message \n qs = \'?portal_status_message=%s\' % message \n
else:\n else:\n
context.manage_cutObjects(uids=uids, REQUEST=request)\n context.manage_cutObjects(uids=uids, REQUEST=request)\n
message = Base_translateString("Item(s) cut.")\n message = Base_translateString("Items cut.")\n
else:\n else:\n
message = Base_translateString("Please select one or more items to cut first.")\n message = Base_translateString("Please select one or more items to cut first.")\n
return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % message)\n \n
return context.Base_redirect(form_id, keep_items=dict(portal_status_message=message))\n
]]></string> </value> ]]></string> </value>
...@@ -112,7 +113,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p ...@@ -112,7 +113,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>form_id,selection_name=\'\',uids=[],listbox_uid=[]</string> </value> <value> <string>form_id, selection_name=\'\', uids=[], listbox_uid=[]</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -159,6 +160,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p ...@@ -159,6 +160,7 @@ return request.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?p
<string>message</string> <string>message</string>
<string>repr</string> <string>repr</string>
<string>qs</string> <string>qs</string>
<string>dict</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -70,21 +70,23 @@ if context.cb_dataValid:\n ...@@ -70,21 +70,23 @@ if context.cb_dataValid:\n
for portal_type in portal_type_list:\n for portal_type in portal_type_list:\n
if portal_type not in allowed_type_list:\n if portal_type not in allowed_type_list:\n
error_message = Base_translateString(\'Sorry, you can not paste these items here.\')\n error_message = Base_translateString(\'Sorry, you can not paste these items here.\')\n
\n
if context.cb_dataValid and error_message==\'\':\n if context.cb_dataValid and error_message==\'\':\n
try:\n try:\n
new_item_list = context.manage_pasteObjects(REQUEST[\'__cp\'])\n new_item_list = context.manage_pasteObjects(REQUEST[\'__cp\'])\n
except KeyError:\n except KeyError:\n
msg = Base_translateString(\'Nothing to paste.\')\n return context.Base_redirect(form_id,\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % msg)\n keep_items=dict(portal_status_message=Base_translateString(\'Nothing to paste.\')))\n
else:\n else:\n
new_id_list = [i[\'new_id\'] for i in new_item_list]\n new_id_list = [i[\'new_id\'] for i in new_item_list]\n
msg = Base_translateString(\'Item(s) paste in progress.\')\n return context.Base_redirect(form_id,\n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % msg)\n keep_items=dict(portal_status_message=Base_translateString(\'Items paste in progress.\')))\n
elif context.cb_dataValid and error_message!=\'\':\n \n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % error_message)\n elif context.cb_dataValid and error_message != \'\':\n
else:\n return context.Base_redirect(form_id, keep_items=dict(portal_status_message=error_message))\n
error_message = Base_translateString(\'Copy or cut one or more items to paste first.\')\n \n
return REQUEST.RESPONSE.redirect(context.absolute_url() + \'/\' + form_id + \'?portal_status_message=%s\' % error_message)\n error_message = Base_translateString(\'Copy or cut one or more items to paste first.\')\n
return context.Base_redirect(form_id, keep_items=dict(portal_status_message=error_message))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -139,7 +141,7 @@ else:\n ...@@ -139,7 +141,7 @@ else:\n
<string>_getitem_</string> <string>_getitem_</string>
<string>new_item_list</string> <string>new_item_list</string>
<string>KeyError</string> <string>KeyError</string>
<string>msg</string> <string>dict</string>
<string>i</string> <string>i</string>
<string>new_id_list</string> <string>new_id_list</string>
</tuple> </tuple>
......
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