From 834427b92081c3f3b918472dff91a528627a5cc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 23 Mar 2006 12:41:57 +0000
Subject: [PATCH] remove preferred visible modules

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6191 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_core/ERP5Site_getModuleItemList.xml  |  22 +-
 .../erp5_core/Preference_view.xml             |   1 -
 .../my_preferred_visible_module_list.xml      | 283 ------------------
 3 files changed, 7 insertions(+), 299 deletions(-)
 delete mode 100755 product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_view/my_preferred_visible_module_list.xml

diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml
index 5f395bcaf5..b131d7df08 100755
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/ERP5Site_getModuleItemList.xml
@@ -73,11 +73,6 @@ user = context.portal_membership.getAuthenticatedMember().getUserName()\n
 \n
 portal = context.getPortalObject()\n
 \n
-# (BIG) HACK : we invalidate cache if we are call without filter\n
-#   (ie when we are editing the PreferredVisibleModuleList)\n
-if not filter : \n
-  clearCache()\n
-\n
 ## do not filter when there is no visible module selected\n
 try : \n
   if len(portal.portal_preferences.getPreferredVisibleModuleList()) == 0 : \n
@@ -85,7 +80,7 @@ try : \n
 except ConflictError : raise\n
 except : filter = 0\n
 \n
-def getModuleItemList(user=None, portal_path=None, filter=filter):\n
+def getModuleItemList(user=None, portal_path=None):\n
   gettext = context.Localizer.erp5_ui.gettext\n
   item_list = []\n
   try :\n
@@ -95,8 +90,7 @@ def getModuleItemList(user=None, portal_path=None, filter=filter):\n
         url = module.getPath()\n
         label = module.getTitleOrId()\n
         label = gettext(label)\n
-        if not filter or url in portal.portal_preferences.getPreferredVisibleModuleList() : \n
-          item_list.append((label, url))\n
+        item_list.append((label, url))\n
       except ConflictError : raise\n
       except: pass\n
   except ConflictError : raise\n
@@ -108,7 +102,7 @@ def getModuleItemList(user=None, portal_path=None, filter=filter):\n
 \n
 getModuleItemList = CachingMethod(getModuleItemList, id=\'ERP5Site_getModuleItemList\')\n
 portal_path = context.getPortalObject().getPhysicalPath()\n
-return getModuleItemList(user=user, portal_path=portal_path, filter=filter)\n
+return getModuleItemList(user=user, portal_path=portal_path)\n
 </string> </value>
         </item>
         <item>
@@ -123,7 +117,7 @@ return getModuleItemList(user=user, portal_path=portal_path, filter=filter)\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>filter=1</string> </value>
+            <value> <string></string> </value>
         </item>
         <item>
             <key> <string>errors</string> </key>
@@ -143,13 +137,12 @@ return getModuleItemList(user=user, portal_path=portal_path, filter=filter)\n
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>1</int> </value>
+                        <value> <int>0</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
-                            <string>filter</string>
                             <string>Products.ERP5Type.Cache</string>
                             <string>CachingMethod</string>
                             <string>clearCache</string>
@@ -160,6 +153,7 @@ return getModuleItemList(user=user, portal_path=portal_path, filter=filter)\n
                             <string>user</string>
                             <string>portal</string>
                             <string>len</string>
+                            <string>filter</string>
                             <string>None</string>
                             <string>getModuleItemList</string>
                             <string>portal_path</string>
@@ -174,9 +168,7 @@ return getModuleItemList(user=user, portal_path=portal_path, filter=filter)\n
         <item>
             <key> <string>func_defaults</string> </key>
             <value>
-              <tuple>
-                <int>1</int>
-              </tuple>
+              <none/>
             </value>
         </item>
         <item>
diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_view.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_view.xml
index 9979687b0e..0e50b5e9cc 100755
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_view.xml
+++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_view.xml
@@ -106,7 +106,6 @@
                     <value>
                       <list>
                         <string>my_priority</string>
-                        <string>my_preferred_visible_module_list</string>
                         <string>my_preferred_section_category</string>
                       </list>
                     </value>
diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_view/my_preferred_visible_module_list.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_view/my_preferred_visible_module_list.xml
deleted file mode 100755
index 83d6e2a265..0000000000
--- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Preference_view/my_preferred_visible_module_list.xml
+++ /dev/null
@@ -1,283 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.Formulator.StandardFields</string>
-          <string>MultiListField</string>
-        </tuple>
-        <none/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>my_preferred_visible_module_list</string> </value>
-        </item>
-        <item>
-            <key> <string>message_values</string> </key>
-            <value>
-              <dictionary>
-                <item>
-                    <key> <string>external_validator_failed</string> </key>
-                    <value> <string>The input failed the external validator.</string> </value>
-                </item>
-                <item>
-                    <key> <string>required_not_found</string> </key>
-                    <value> <string>Input is required but no input given.</string> </value>
-                </item>
-                <item>
-                    <key> <string>unknown_selection</string> </key>
-                    <value> <string>You selected an item that was not in the list.</string> </value>
-                </item>
-              </dictionary>
-            </value>
-        </item>
-        <item>
-            <key> <string>overrides</string> </key>
-            <value>
-              <dictionary>
-                <item>
-                    <key> <string>alternate_name</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>css_class</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>default</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>description</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>editable</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>enabled</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>external_validator</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>extra</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>extra_item</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>hidden</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>items</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>required</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>size</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>unicode</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>view_separator</string> </key>
-                    <value> <string></string> </value>
-                </item>
-              </dictionary>
-            </value>
-        </item>
-        <item>
-            <key> <string>tales</string> </key>
-            <value>
-              <dictionary>
-                <item>
-                    <key> <string>alternate_name</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>css_class</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>default</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>description</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>editable</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>enabled</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>external_validator</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>extra</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>extra_item</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>hidden</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>required</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>size</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>unicode</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>view_separator</string> </key>
-                    <value> <string></string> </value>
-                </item>
-              </dictionary>
-            </value>
-        </item>
-        <item>
-            <key> <string>values</string> </key>
-            <value>
-              <dictionary>
-                <item>
-                    <key> <string>alternate_name</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>css_class</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>default</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>description</string> </key>
-                    <value> <string>Modules that are visible from the main page</string> </value>
-                </item>
-                <item>
-                    <key> <string>editable</string> </key>
-                    <value> <int>1</int> </value>
-                </item>
-                <item>
-                    <key> <string>enabled</string> </key>
-                    <value> <int>1</int> </value>
-                </item>
-                <item>
-                    <key> <string>external_validator</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>extra</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>extra_item</string> </key>
-                    <value> <string></string> </value>
-                </item>
-                <item>
-                    <key> <string>hidden</string> </key>
-                    <value> <int>0</int> </value>
-                </item>
-                <item>
-                    <key> <string>items</string> </key>
-                    <value>
-                      <list/>
-                    </value>
-                </item>
-                <item>
-                    <key> <string>required</string> </key>
-                    <value> <int>0</int> </value>
-                </item>
-                <item>
-                    <key> <string>size</string> </key>
-                    <value> <int>7</int> </value>
-                </item>
-                <item>
-                    <key> <string>title</string> </key>
-                    <value> <string>Visible Modules</string> </value>
-                </item>
-                <item>
-                    <key> <string>unicode</string> </key>
-                    <value> <int>0</int> </value>
-                </item>
-                <item>
-                    <key> <string>view_separator</string> </key>
-                    <value> <string encoding="cdata"><![CDATA[
-
-<br />
-
-]]></string> </value>
-                </item>
-              </dictionary>
-            </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-  <record id="2" aka="AAAAAAAAAAI=">
-    <pickle>
-      <tuple>
-        <tuple>
-          <string>Products.Formulator.TALESField</string>
-          <string>TALESMethod</string>
-        </tuple>
-        <none/>
-      </tuple>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_text</string> </key>
-            <value> <string>python:here.ERP5Site_getModuleItemList(filter=0)</string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
-- 
2.30.9