From 8cd0338e189bab67b8cd936ad0f3f02f2d9b01cb Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Fri, 1 Feb 2008 17:06:35 +0000
Subject: [PATCH] Use script instead of expressions.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18989 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 ...ossaryModule_findTermFromPropertySheet.xml | 69 +------------------
 ...odule_getTermDictListFromPropertySheet.xml |  2 +
 ...e_viewFindTermsFromPropertySheetDialog.xml | 22 +++---
 3 files changed, 13 insertions(+), 80 deletions(-)

diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.xml
index c47fa7d7e3..091eccdae9 100644
--- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.xml
+++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.xml
@@ -65,52 +65,7 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>ignore = (\'custom\',)\n
-all_field_list = []\n
-def iterate(obj):\n
-  for i in obj.objectValues():\n
-    if i.getId() in ignore:\n
-      continue\n
-    if i.meta_type==\'ERP5 Form\':\n
-      all_field_list.extend(i.objectValues())\n
-    elif i.isPrincipiaFolderish:\n
-      iterate(i)\n
-\n
-iterate(context.portal_skins)\n
-\n
-properties = []\n
-for i in property_sheet_list:\n
-  properties.extend(context.GlossaryModule_getPropertySheetAttributeList(i))\n
-\n
-dic = {}\n
-for i in all_field_list:\n
-  id = i.getId()\n
-  title = i.get_value(\'title\') or \'\'\n
-  skin_id = i.aq_parent.aq_parent.getId()\n
-  prefix = \'erp5_\'\n
-  if skin_id.startswith(prefix):\n
-    skin_id = skin_id[len(prefix):]\n
-  if id.startswith(\'my_\'):\n
-    for p in properties:\n
-      if id==\'my_%s\' % p:\n
-        key = (p, skin_id, title)\n
-        dic[key] = i\n
-  if id.startswith(\'your_\'):\n
-    for p in properties:\n
-      if id==\'your_%s\' % p:\n
-        key = (p, skin_id, title)\n
-        dic[key] = i\n
-\n
-result = []\n
-for (reference, business_field, title) in dic.keys():\n
-  language = \'en\'\n
-  field = dic[(reference, business_field, title)]\n
-  description = field.get_value(\'description\')\n
-  result.append({\'reference\':reference,\n
-                 \'language\':language,\n
-                 \'business_field\':business_field,\n
-                 \'title\':title,\n
-                 \'description\':description})\n
+            <value> <string>result = context.GlossaryModule_getTermDictListFromPropertySheet(property_sheet_list)\n
 \n
 if export_tsv:\n
   for i in result:\n
@@ -173,31 +128,13 @@ context.REQUEST.RESPONSE.redirect(context.absolute_url())\n
                             <string>kw</string>
                             <string>_print_</string>
                             <string>_print</string>
-                            <string>ignore</string>
-                            <string>all_field_list</string>
-                            <string>iterate</string>
                             <string>_getattr_</string>
                             <string>context</string>
-                            <string>properties</string>
+                            <string>result</string>
                             <string>_getiter_</string>
                             <string>i</string>
-                            <string>dic</string>
-                            <string>id</string>
-                            <string>title</string>
-                            <string>skin_id</string>
-                            <string>prefix</string>
-                            <string>_getitem_</string>
-                            <string>len</string>
-                            <string>p</string>
-                            <string>key</string>
-                            <string>_write_</string>
-                            <string>result</string>
-                            <string>reference</string>
-                            <string>business_field</string>
-                            <string>language</string>
-                            <string>field</string>
-                            <string>description</string>
                             <string>map</string>
+                            <string>_getitem_</string>
                             <string>new_id</string>
                           </tuple>
                         </value>
diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getTermDictListFromPropertySheet.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getTermDictListFromPropertySheet.xml
index 843dbda8a2..396c768326 100644
--- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getTermDictListFromPropertySheet.xml
+++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getTermDictListFromPropertySheet.xml
@@ -135,7 +135,9 @@ return result\n
             <key> <string>_proxy_roles</string> </key>
             <value>
               <tuple>
+                <string>Authenticated</string>
                 <string>Manager</string>
+                <string>Member</string>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_viewFindTermsFromPropertySheetDialog.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_viewFindTermsFromPropertySheetDialog.xml
index 3180e35b74..d404b24a24 100644
--- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_viewFindTermsFromPropertySheetDialog.xml
+++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_viewFindTermsFromPropertySheetDialog.xml
@@ -3,11 +3,8 @@
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
       <tuple>
-        <tuple>
-          <string>Products.ERP5Form.Form</string>
-          <string>ERP5Form</string>
-        </tuple>
-        <none/>
+        <global name="ERP5Form" module="Products.ERP5Form.Form"/>
+        <tuple/>
       </tuple>
     </pickle>
     <pickle>
@@ -74,34 +71,31 @@
             <value>
               <dictionary>
                 <item>
-                    <key>                 <string>bottom</string> </key>
+                    <key> <string>bottom</string> </key>
                     <value>
                       <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>center</string> </key>
+                    <key> <string>center</string> </key>
                     <value>
                       <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>hidden</string> </key>
+                    <key> <string>hidden</string> </key>
                     <value>
                       <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>left</string> </key>
+                    <key> <string>left</string> </key>
                     <value>
-                      <list>
-                        <string>my_property_sheet_list</string>
-                        <string>my_export_tsv</string>
-                      </list>
+                      <list/>
                     </value>
                 </item>
                 <item>
-                    <key>                 <string>right</string> </key>
+                    <key> <string>right</string> </key>
                     <value>
                       <list/>
                     </value>
-- 
2.30.9