From 3a10ca90cd6b4c2317a1e8a46a9a923b2f2a6878 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Thu, 6 Sep 2007 17:09:31 +0000
Subject: [PATCH] 2007-09-06 yo * Obtain a listbox with Form_getListbox instead
 of from a fixed localtion in configure_list_dialog and sort_list_dialog.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16141 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_skins/erp5_xhtml_style/configure_list_dialog.xml  | 5 +++--
 .../portal_skins/erp5_xhtml_style/sort_list_dialog.xml       | 3 ++-
 product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log        | 3 +++
 product/ERP5/bootstrap/erp5_xhtml_style/bt/revision          | 2 +-
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/configure_list_dialog.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/configure_list_dialog.xml
index 519fabb9a5..8ad01fd8f0 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/configure_list_dialog.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/configure_list_dialog.xml
@@ -90,13 +90,14 @@ XXX: uses hardcoded indices values to access fields\n
         <table tal:define="selection_name request/selection_name;\n
                           base_form python: getattr(here, request[\'form_id\']);\n
                           groups base_form/get_groups;\n
-                          default_columns python: base_form.get_fields_in_group(groups[0])[0].get_value(\'columns\');\n
+                          listbox python: base_form.Form_getListbox();\n
+                          default_columns python: listbox.get_value(\'columns\');\n
                           columns python: here.portal_selections.getSelectionColumns(selection_name, REQUEST=request, columns=default_columns);\n
                           selected_stats  python: here.portal_selections.getSelectionStats(selection_name, REQUEST=request);\n
                           global row_index python: 0;\n
                           global row_keys python: [\'None\'];\n
                           global stats python: [\' \',\'count\',\'sum\',\'max\',\'min\',\'avg\'];\n
-                          all_columns python: base_form.get_fields_in_group(groups[0])[0].get_value(\'all_columns\')">\n
+                          all_columns python: listbox.get_value(\'all_columns\')">\n
           <tal:block tal:repeat="item columns">\n
             <tr tal:define="global row_index python:row_index+1;\n
                             dummy python:row_keys.append(item[0])"\n
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/sort_list_dialog.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/sort_list_dialog.xml
index ebaaa552d6..287047dce7 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/sort_list_dialog.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/sort_list_dialog.xml
@@ -89,7 +89,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\n
             tal:define="items python:here.portal_selections.getSelectionSortOrder(request[\'selection_name\'], REQUEST=request);\n
                         base_form python:getattr(here,request[\'form_id\']);\n
                         groups base_form/get_groups;\n
-                        columns python:base_form.get_fields_in_group(groups[0])[0].get_value(\'all_columns\');\n
+                        listbox python:base_form.Form_getListbox();\n
+                        columns python:listbox.get_value(\'all_columns\');\n
                         global row_index python:0;\n
                         global row_keys python:[\'None\'];\n
                         all_columns python: [(\'None\',\'\')] + columns;">\n
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log b/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log
index 5db2f16352..bb52f8d163 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log
@@ -1,3 +1,6 @@
+2007-09-06 yo
+* Obtain a listbox with Form_getListbox instead of from a fixed localtion in configure_list_dialog and sort_list_dialog.
+
 2007-09-04 Kazuhiko
 * use portal_url.getPortalObject().absolute_url_path() instead of portal_url.getPortalPath() for better virtual host support.
 
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
index af40ff6b88..1fde7522a7 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
@@ -1 +1 @@
-433
\ No newline at end of file
+434
\ No newline at end of file
-- 
2.30.9