Commit ec75d41f authored by Ivan Tyagov's avatar Ivan Tyagov

Listbox do not need any longer a 'global_search_column_script' as it can use a default update one.

Make sure that global search column acts as a normal search column (i.e. it will be passed to count* & search methods and work fine).
Remove hard coded script to extract global search column value. Use request (resp. selection) to get it.
Add proper i18n.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38298 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 459e9baa
......@@ -62,8 +62,8 @@
display_style_list here/getDisplayStyleList;\n
list_style here/getListboxDisplayStyle;\n
global_search_column here/getGlobalSearchColumn;\n
global_search_column_script here/getGlobalSearchColumnScript;\n
show_global_search python: global_search_column not in (\'\', None) and global_search_column_script not in (\'\', None);\n
global_search_column_script python: here.getGlobalSearchColumnScript() or \'Base_doSelect\';\n
show_global_search python: global_search_column not in (\'\', None);\n
line_list here/query;\n
listbox_max_lines python: int(here.getMaxLineNumber());\n
total_line python: int(here.total_size);\n
......@@ -380,7 +380,9 @@
<tal:block tal:condition="python: search_field is None">\n
<input tal:condition="python: not is_gadget_mode" \n
name="id" size="5" value=""\n
type="text" tal:attributes="name alias; value param"/>\n
type="text" \n
tal:attributes="name alias; value param"\n
onkeypress="submitFormOnEnter(event, this.form, \'Base_doSelect\');"/>\n
<!-- Search for gadget mode -->\n
<input tal:condition="python: is_gadget_mode" \n
tal:define ="params python: {alias:\'this.value\'};"\n
......
......@@ -100,23 +100,31 @@
\n
<div class=" listbox-full-text-search"\n
metal:define-macro="listbox_global_search"\n
tal:define="search_text real_context/Base_getSearchText">\n
tal:define="search_text python: request.get(global_search_column, \n
selection.params.get(global_search_column));">\n
\n
<tal:block tal:condition="not: is_gadget_mode">\n
<!-- Normal mode -->\n
<input type="text"\n
title="Global Search"\n
i18n:domain="ui" i18n:attributes="value; title" \n
tal:attributes="value search_text;\n
name global_search_column;\n
onkeypress string: submitFormOnEnter(event, this.form, \'${global_search_column_script}\');"/>\n
<input class="button" \n
i18n:domain="ui" i18n:attributes="value"\n
value="Search" type="submit" \n
value="Search" \n
type="submit"\n
title="Search"\n
i18n:domain="ui" i18n:attributes="value; title" \n
tal:attributes="name string:${global_search_column_script}:method"/>\n
</tal:block>\n
\n
<tal:block tal:condition="is_gadget_mode">\n
<!-- Gadget mode -->\n
<input tal:define="params python: {\'%s:method\' %global_search_column_script:\'\',\'%s\' %global_search_column:\'this.value\'};"\n
type="text"\n
title="Global Search"\n
i18n:domain="ui" i18n:attributes="value; title"\n
tal:attributes=\'value search_text;\n
name global_search_column;\n
onkeypress python:"if(event.keyCode==13){" + real_context.KnowledgePad_generateAjaxCall(context_url+"/"+form_id,box,box_id,params).replace("\\"this.value\\"","this.value")+ "return false;;}"\'/>\n
......
1015
\ No newline at end of file
1016
\ No newline at end of file
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