From 61b9f8d940f53dbca3bd7eafddaeb364b70e32e6 Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Mon, 1 Feb 2010 13:52:02 +0000
Subject: [PATCH] Add use_list and clean the script : - use default values []
 for preferences. - use only one edit, and no if

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32141 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_pdm/Resource_init.xml   | 19 +++++++++----------
 bt5/erp5_pdm/bt/revision                      |  2 +-
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_init.xml b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_init.xml
index 1c82a4549c..86eb138e31 100644
--- a/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_init.xml
+++ b/bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Resource_init.xml
@@ -55,17 +55,15 @@
             <key> <string>_body</string> </key>
             <value> <string>portal_type = context.getPortalType().lower().replace(\' \', \'_\')\n
 \n
-base = context.portal_preferences.getPreference(\'preferred_%s_variation_base_category_list\' % portal_type)\n
-optional = context.portal_preferences.getPreference(\'preferred_%s_optional_variation_base_category_list\' % portal_type)\n
-individual = context.portal_preferences.getPreference(\'preferred_%s_individual_variation_base_category_list\' % portal_type)\n
+base = context.portal_preferences.getPreference(\'preferred_%s_variation_base_category_list\' % portal_type, [])\n
+optional = context.portal_preferences.getPreference(\'preferred_%s_optional_variation_base_category_list\' % portal_type, [])\n
+individual = context.portal_preferences.getPreference(\'preferred_%s_individual_variation_base_category_list\' % portal_type, [])\n
+use_list = context.portal_preferences.getPreference(\'preferred_%s_use_list\' % portal_type, [])\n
 \n
-if individual:\n
-  context.edit(variation_base_category_list=base,\n
-      optional_variation_base_category_list=optional,\n
-      individual_variation_base_category_list=individual)\n
-else:\n
-  context.edit(variation_base_category_list=base,\n
-      optional_variation_base_category_list=optional)\n
+context.edit(variation_base_category_list=base,\n
+    optional_variation_base_category_list=optional,\n
+    individual_variation_base_category_list=individual,\n
+    use_list=use_list)\n
 </string> </value>
         </item>
         <item>
@@ -110,6 +108,7 @@ else:\n
                             <string>base</string>
                             <string>optional</string>
                             <string>individual</string>
+                            <string>use_list</string>
                           </tuple>
                         </value>
                     </item>
diff --git a/bt5/erp5_pdm/bt/revision b/bt5/erp5_pdm/bt/revision
index af40ff6b88..662d98cc92 100644
--- a/bt5/erp5_pdm/bt/revision
+++ b/bt5/erp5_pdm/bt/revision
@@ -1 +1 @@
-433
\ No newline at end of file
+436
\ No newline at end of file
-- 
2.30.9