From f9d49990eff28fd70120a194c66856b878fb8cb3 Mon Sep 17 00:00:00 2001
From: Mayoro Diagne <mayoro@nexedi.com>
Date: Sat, 26 Jun 2010 22:31:30 +0000
Subject: [PATCH] 2010-06-26 mayoro * correct previous commit, use
 contentValues because  of caching method

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36621 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../PDFDocument_getReportSectionList.xml      | 22 ++++++++++++-------
 bt5/erp5_egov/bt/change_log                   |  3 +++
 bt5/erp5_egov/bt/revision                     |  2 +-
 3 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/PDFDocument_getReportSectionList.xml b/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/PDFDocument_getReportSectionList.xml
index b8adec1b4c..121795854c 100644
--- a/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/PDFDocument_getReportSectionList.xml
+++ b/bt5/erp5_egov/SkinTemplateItem/portal_skins/erp5_egov/PDFDocument_getReportSectionList.xml
@@ -65,13 +65,14 @@ file_type_list = (\'Image\', \'File\')\n
 sub_form_type_list = filter(lambda x: x not in file_type_list, type_list)\n
 \n
 # A simple solution: use title to group\n
-viewable_content_list = [x.getObject() for x in context.searchFolder(validation_state = [\'embedded\',\'draft\'])]\n
+viewable_content_list = context.contentValues(portal_type=type_list, checked_permission=\'View\',validation_state = \'embedded\')\n
 \n
 content_group_dict = {}\n
 for content in viewable_content_list:\n
-  title = content.getTitle()\n
-  content_group_dict.setdefault(title, [])\n
-  content_group_dict[title].append(content)\n
+  if content.getValidationState() in [\'embedded\',\'draft\']:\n
+    title = content.getTitle()\n
+    content_group_dict.setdefault(title, [])\n
+    content_group_dict[title].append(content)\n
 \n
 # Now sort every group by creation date (to be done)\n
 # XXXX\n
@@ -137,6 +138,14 @@ return result\n
             <key> <string>_params</string> </key>
             <value> <string></string> </value>
         </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
         <item>
             <key> <string>errors</string> </key>
             <value>
@@ -170,12 +179,9 @@ return result\n
                             <string>file_type_list</string>
                             <string>filter</string>
                             <string>sub_form_type_list</string>
-                            <string>append</string>
-                            <string>$append0</string>
-                            <string>_getiter_</string>
-                            <string>x</string>
                             <string>viewable_content_list</string>
                             <string>content_group_dict</string>
+                            <string>_getiter_</string>
                             <string>content</string>
                             <string>title</string>
                             <string>_getitem_</string>
diff --git a/bt5/erp5_egov/bt/change_log b/bt5/erp5_egov/bt/change_log
index 944f09144f..095ec16b7c 100644
--- a/bt5/erp5_egov/bt/change_log
+++ b/bt5/erp5_egov/bt/change_log
@@ -1,3 +1,6 @@
+2010-06-26 mayoro
+* correct previous commit, use contentValues because  of caching method
+
 2010-06-26 mayoro
 * Add erp5_html_compatibility in EGov registered skin selection, needed for form_view_dialog
 * Use  catalog to search for attachments
diff --git a/bt5/erp5_egov/bt/revision b/bt5/erp5_egov/bt/revision
index 0c1a9b6f06..7383593264 100644
--- a/bt5/erp5_egov/bt/revision
+++ b/bt5/erp5_egov/bt/revision
@@ -1 +1 @@
-645
\ No newline at end of file
+652
\ No newline at end of file
-- 
2.30.9