From 40679cd9ddca8877af5f476d23e9b8b074a4492b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 9 Jun 2006 14:56:43 +0000
Subject: [PATCH] add an entry in workflow history when sub objects are deleted

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7667 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_core/Folder_delete.xml        | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml
index 9cb441e57b..d2fa6afcf9 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_delete.xml
@@ -118,7 +118,15 @@ elif uids is not None:\n
         qs = \'?portal_status_message=%s\' % message  \n
   else:\n
     try : \n
+      object_ids = \', \'.join([ x.getObject().getId() for x in context.portal_catalog(uid=uids)])\n
       context.manage_delObjects(uids=uids, REQUEST=REQUEST)\n
+      comment = N_(\'Deleted objects: ${object_ids}\',\n
+                   mapping={\'object_ids\': object_ids})\n
+      # record object deletion in workflow history\n
+      context.getPortalObject().portal_workflow.doActionFor(\n
+                      context,\n
+                      \'edit_action\',\n
+                      comment=comment)\n
       message = N_("Deleted.")\n
       qs = \'?portal_status_message=%s\' % message\n
     except ConflictError : raise\n
@@ -200,6 +208,11 @@ return REQUEST.RESPONSE.redirect( ret_url + qs )\n
                             <string>_getitem_</string>
                             <string>object</string>
                             <string>repr</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>x</string>
+                            <string>object_ids</string>
+                            <string>comment</string>
                             <string>Exception</string>
                           </tuple>
                         </value>
-- 
2.30.9