From 5c48154569d2b67816f75fc9717fb146213371df Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Thu, 27 Apr 2006 11:57:56 +0000
Subject: [PATCH] 2006-04-25 yo * Folder_deleteObjectList must redirect to the
 original form with an error message when nothing is selected.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6962 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_core/Folder_deleteObjectList.xml            | 12 +++++++++++-
 product/ERP5/bootstrap/erp5_core/bt/change_log       |  6 ++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_deleteObjectList.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_deleteObjectList.xml
index d534ebf957..fed627113c 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_deleteObjectList.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_deleteObjectList.xml
@@ -67,10 +67,16 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>request=context.REQUEST\n
+portal = context.getPortalObject()\n
+N_ = portal.Base_translateString\n
 \n
 selected_uids = context.portal_selections.updateSelectionCheckedUidList(selection_name,listbox_uid,uids)\n
 uids = context.portal_selections.getSelectionCheckedUidsFor(selection_name)\n
 \n
+if uids == []:\n
+  message = N_("Please+select+one+or+more+items+to+delete+first.")\n
+  qs = \'?portal_status_message=%s\' % message\n
+  return context.REQUEST.RESPONSE.redirect( context.absolute_url() + \'/\' + form_id + qs )\n
 \n
 kw = {\'uid\': uids}\n
 request.set(\'object_uid\', context.getUid())\n
@@ -123,9 +129,13 @@ return context.Folder_viewDeleteDialog(uids=uids, REQUEST=request)\n
                             <string>listbox_uid</string>
                             <string>selection_name</string>
                             <string>_getattr_</string>
-<string>context</string>
+                            <string>context</string>
                             <string>request</string>
+                            <string>portal</string>
+                            <string>N_</string>
                             <string>selected_uids</string>
+                            <string>message</string>
+                            <string>qs</string>
                             <string>kw</string>
                           </tuple>
                         </value>
diff --git a/product/ERP5/bootstrap/erp5_core/bt/change_log b/product/ERP5/bootstrap/erp5_core/bt/change_log
index c447cd70d4..ecbcb2e0d4 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/change_log
+++ b/product/ERP5/bootstrap/erp5_core/bt/change_log
@@ -1,3 +1,9 @@
+2006-04-27 yo
+* Embed the query string in a request int the resulting HTML in form_html, list_dialog_master, list_master and view_master.
+
+2006-04-25 yo
+* Folder_deleteObjectList must redirect to the original form with an error message when nothing is selected.
+
 2006-04-25 yo
 * Folder_cut must redirect to the original form even when it fails.
 * Reduce the duplicated code in Folder_copy.
-- 
2.30.9