From a9b02462d6fb933a4ae8f78e0f4f111bd56b2eb7 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Tue, 3 Nov 2009 16:15:00 +0000
Subject: [PATCH] BaseType_view: replace string field by a list of available
 permissions

Also fix typo in 'Add Permission' setting of 'System Preference'.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30260 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_types/System%20Preference.xml      |  6 ++--
 .../BaseType_view/my_type_add_permission.xml  | 35 ++++++++++++++++++-
 product/ERP5/bootstrap/erp5_core/bt/revision  |  2 +-
 3 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/System%20Preference.xml b/product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/System%20Preference.xml
index 3a3286f48d..707819e082 100644
--- a/product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/System%20Preference.xml
+++ b/product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/System%20Preference.xml
@@ -45,11 +45,13 @@
         </item>
         <item>
             <key> <string>init_script</string> </key>
-            <value> <string></string> </value>
+            <value>
+              <none/>
+            </value>
         </item>
         <item>
             <key> <string>permission</string> </key>
-            <value> <string>Manage Portal</string> </value>
+            <value> <string>Manage portal</string> </value>
         </item>
         <item>
             <key> <string>title</string> </key>
diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BaseType_view/my_type_add_permission.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BaseType_view/my_type_add_permission.xml
index 64eb6b8095..7e3fe5c676 100644
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BaseType_view/my_type_add_permission.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BaseType_view/my_type_add_permission.xml
@@ -13,6 +13,7 @@
             <key> <string>delegated_list</string> </key>
             <value>
               <list>
+                <string>items</string>
                 <string>title</string>
               </list>
             </value>
@@ -63,10 +64,20 @@
                     <key> <string>form_id</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
+                </item>
                 <item>
                     <key> <string>target</string> </key>
                     <value> <string></string> </value>
                 </item>
+                <item>
+                    <key> <string>title</string> </key>
+                    <value> <string></string> </value>
+                </item>
               </dictionary>
             </value>
         </item>
@@ -76,12 +87,18 @@
               <dictionary>
                 <item>
                     <key> <string>field_id</string> </key>
-                    <value> <string>my_string_field</string> </value>
+                    <value> <string>my_list_field</string> </value>
                 </item>
                 <item>
                     <key> <string>form_id</string> </key>
                     <value> <string>Base_viewFieldLibrary</string> </value>
                 </item>
+                <item>
+                    <key> <string>items</string> </key>
+                    <value>
+                      <list/>
+                    </value>
+                </item>
                 <item>
                     <key> <string>target</string> </key>
                     <value> <string>Click to edit the target</string> </value>
@@ -96,4 +113,20 @@
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>python: [(\'\', \'\')] + [(x,  x) for x in here.possible_permissions()]</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision
index a78b2873fd..426c816d4f 100644
--- a/product/ERP5/bootstrap/erp5_core/bt/revision
+++ b/product/ERP5/bootstrap/erp5_core/bt/revision
@@ -1 +1 @@
-1360
\ No newline at end of file
+1361
\ No newline at end of file
-- 
2.30.9