From 35b31dfe0156a96270054edb0ec548792c0f614a Mon Sep 17 00:00:00 2001
From: Ivan Tyagov <ivan@nexedi.com>
Date: Wed, 30 Jun 2010 12:28:37 +0000
Subject: [PATCH] Hide top listbox quick search as it duplicates with global
 one and uses spaces, leave bottom listbox quick search as a convenient way to
 do a quick search after viewing show found page results. Use separate method
 for sub query searches which reuses main one.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36735 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../search_text_listbox.xml                   |   2 +-
 .../top_search_text.xml                       |   5 +
 .../WebSite_viewListBoxSearchButtonWidget.xml |   8 +-
 .../WebSite_viewQuickSearchResultList.xml     | 141 ++++++++++++++++++
 bt5/erp5_km/bt/revision                       |   2 +-
 5 files changed, 152 insertions(+), 6 deletions(-)
 create mode 100644 bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewQuickSearchResultList.xml

diff --git a/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSection_viewMinimalKMWidgetFieldLibrary/search_text_listbox.xml b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSection_viewMinimalKMWidgetFieldLibrary/search_text_listbox.xml
index e4ed82df6a..820d4c4ae0 100644
--- a/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSection_viewMinimalKMWidgetFieldLibrary/search_text_listbox.xml
+++ b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSection_viewMinimalKMWidgetFieldLibrary/search_text_listbox.xml
@@ -234,7 +234,7 @@
                 </item>
                 <item>
                     <key> <string>enabled</string> </key>
-                    <value> <int>0</int> </value>
+                    <value> <int>1</int> </value>
                 </item>
                 <item>
                     <key> <string>external_validator</string> </key>
diff --git a/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewAdvancedSearchResultList/top_search_text.xml b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewAdvancedSearchResultList/top_search_text.xml
index 0c2c1321a7..621e98ba4b 100644
--- a/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewAdvancedSearchResultList/top_search_text.xml
+++ b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewAdvancedSearchResultList/top_search_text.xml
@@ -13,6 +13,7 @@
             <key> <string>delegated_list</string> </key>
             <value>
               <list>
+                <string>enabled</string>
                 <string>title</string>
               </list>
             </value>
@@ -74,6 +75,10 @@
             <key> <string>values</string> </key>
             <value>
               <dictionary>
+                <item>
+                    <key> <string>enabled</string> </key>
+                    <value> <int>0</int> </value>
+                </item>
                 <item>
                     <key> <string>field_id</string> </key>
                     <value> <string>search_text_listbox</string> </value>
diff --git a/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewListBoxSearchButtonWidget.xml b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewListBoxSearchButtonWidget.xml
index 9bd12a4fe1..7be4201d3b 100644
--- a/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewListBoxSearchButtonWidget.xml
+++ b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewListBoxSearchButtonWidget.xml
@@ -54,13 +54,13 @@
 \n
 <tal:block tal:define="search_text here/Base_getSearchText">\n
   <input type="text"\n
-         name="field_your_search_text"\n
-         onkeypress="submitFormOnEnter(event, \'main_form\', \'ERP5Site_viewQuickSearchResultList\', false, this)"\n
-         tal:attributes="value python: search_text"/>\n
+         name="field_your_search_text_listbox"\n
+         onkeypress="submitFormOnEnter(event, \'main_form\', \'WebSite_viewQuickSearchResultList\', false, this)"\n
+         tal:attributes="value search_text"/>\n
  \n
   <input type="submit" \n
          value="Search" \n
-         name="ERP5Site_viewQuickSearchResultList:method" \n
+         name="WebSite_viewQuickSearchResultList:method" \n
          class=""/>\n
 </tal:block>\n
 
diff --git a/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewQuickSearchResultList.xml b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewQuickSearchResultList.xml
new file mode 100644
index 0000000000..dfab2e2fee
--- /dev/null
+++ b/bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/WebSite_viewQuickSearchResultList.xml
@@ -0,0 +1,141 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>"""\n
+  This script is used in litsbox for additional filtering of show found listbox results.\n
+"""\n
+\n
+return context.ERP5Site_viewQuickSearchResultList(field_your_search_text=field_your_search_text_listbox,\n
+                                                  field_your_search_portal_type=field_your_search_portal_type,\n
+                                                  all_languages=all_languages,\n
+                                                  list_style=list_style,\n
+                                                  field_your_search_form_id=field_your_search_form_id)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>field_your_search_text_listbox=\'\',field_your_search_portal_type=\'\', all_languages=None, list_style=None, field_your_search_form_id=\'ERP5Site_viewSearchResult\'</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>5</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>field_your_search_text_listbox</string>
+                            <string>field_your_search_portal_type</string>
+                            <string>all_languages</string>
+                            <string>list_style</string>
+                            <string>field_your_search_form_id</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <string></string>
+                <string></string>
+                <none/>
+                <none/>
+                <string>ERP5Site_viewSearchResult</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>WebSite_viewQuickSearchResultList</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_km/bt/revision b/bt5/erp5_km/bt/revision
index 1d1a6f5557..0e8ebf59f2 100644
--- a/bt5/erp5_km/bt/revision
+++ b/bt5/erp5_km/bt/revision
@@ -1 +1 @@
-1475
\ No newline at end of file
+1476
\ No newline at end of file
-- 
2.30.9