From 52a84e8947ae04bc3b8e061f50e739d6921edcd3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Fri, 22 Aug 2008 16:13:04 +0000
Subject: [PATCH] simplify a bit TemplateTool_installBusinessTemplateListAction
 and redirect to /view

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23124 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../TemplateTool_installBusinessTemplateListAction.xml   | 9 +++------
 product/ERP5/bootstrap/erp5_core/bt/revision             | 2 +-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/TemplateTool_installBusinessTemplateListAction.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/TemplateTool_installBusinessTemplateListAction.xml
index 8b6be9d19a..fae7c9aa1b 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/TemplateTool_installBusinessTemplateListAction.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/TemplateTool_installBusinessTemplateListAction.xml
@@ -74,11 +74,7 @@ bt_dict = {}\n
 object_to_update = {}\n
 for item in listbox:\n
   bt_id, object_id = item[\'listbox_key\'].split(\'|\')\n
-  if bt_dict.has_key(bt_id):\n
-    bt_dict[bt_id][object_id] = item[\'choice\'][0]\n
-  else:\n
-    bt_dict[bt_id] = {}\n
-    bt_dict[bt_id][object_id] = item[\'choice\'][0]\n
+  bt_dict.setdefault(bt_id, dict())[object_id] = item[\'choice\'][0]\n
 \n
 bt_title_list = []\n
 for bt_id in bt_id_list:\n
@@ -94,7 +90,7 @@ for bt_id in bt_id_list:\n
 REQUEST = container.REQUEST\n
 RESPONSE = REQUEST.RESPONSE\n
 \n
-return RESPONSE.redirect("%s?portal_status_message=Business+Template+%s+installed" % \\\n
+return RESPONSE.redirect("%s/view?portal_status_message=Business+Template+%s+installed" % \\\n
                          (context.absolute_url(), \',+\'.join(bt_title_list)))\n
 </string> </value>
         </item>
@@ -160,6 +156,7 @@ return RESPONSE.redirect("%s?portal_status_message=Business+Template+%s+installe
                             <string>bt_id</string>
                             <string>object_id</string>
                             <string>_write_</string>
+                            <string>dict</string>
                             <string>bt_title_list</string>
                             <string>object_list</string>
                             <string>bt</string>
diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision
index 6d10be7cc3..61721cab2a 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/revision
+++ b/product/ERP5/bootstrap/erp5_core/bt/revision
@@ -1 +1 @@
-937
\ No newline at end of file
+938
\ No newline at end of file
-- 
2.30.9