Commit 9929501b authored by Jérome Perrin's avatar Jérome Perrin

Enable searching in view mode listbox's list mode proxy.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21767 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 546b3fbb
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<value> <value>
<list> <list>
<string>lines</string> <string>lines</string>
<string>list_method</string>
<string>search</string> <string>search</string>
<string>select</string> <string>select</string>
<string>anchor</string> <string>anchor</string>
...@@ -59,6 +60,10 @@ ...@@ -59,6 +60,10 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>anchor</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <value>
...@@ -81,6 +86,12 @@ ...@@ -81,6 +86,12 @@
<key> <string>list_action</string> </key> <key> <string>list_action</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>search</string> </key> <key> <string>search</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -120,9 +131,15 @@ ...@@ -120,9 +131,15 @@
<key> <string>list_action</string> </key> <key> <string>list_action</string> </key>
<value> <string>list</string> </value> <value> <string>list</string> </value>
</item> </item>
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAY=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>search</string> </key> <key> <string>search</string> </key>
<value> <int>0</int> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>select</string> </key> <key> <string>select</string> </key>
...@@ -186,4 +203,36 @@ ...@@ -186,4 +203,36 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>field/ListBox_getListModeProxyListMethodName</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="6" aka="AAAAAAAAAAY=">
<pickle>
<tuple>
<global name="Method" module="Products.Formulator.MethodField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>searchFolder</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData> </ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_function</string> </key>
<value> <string>getListModeProxyListMethodName</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5Form.ListBox_getListModeProxyListMethodName</string> </value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ListBox_getListModeProxyListMethodName</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
#############################################################################
#
# Copyright (c) 2008 Nexedi SA and Contributors. All Rights Reserved.
# Jerome Perrin <jerome@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
def getListModeProxyListMethodName(self):
"""Returns the name of the list method to use in listbox's list mode proxy
If the method uses contentValues or objectValues, use searchFolder so that
searching and sorting works. Otherwise, just use the method as is but sorting
will not work.
"""
template_field = self.getTemplateField()
if template_field.get_value('list_method').method_name in (
'contentValues', 'objectValues'):
return 'searchFolder'
return template_field.get_value('list_method').method_name
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment