From fdd6d380c39bbae09fb080f23ce20f07c05fd0d0 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Fri, 1 Dec 2006 10:22:40 +0000
Subject: [PATCH] Use generic accessor for data translation in domain tree.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11566 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ListBox.py             | 6 +++---
 product/ERP5Form/www/ListBox_asHTML.zpt | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py
index 5bb8ab78dd..6995955911 100644
--- a/product/ERP5Form/ListBox.py
+++ b/product/ERP5Form/ListBox.py
@@ -2144,7 +2144,7 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
     # FIXME: This part should be replaced with Page Templates.
     html_list = []
     ui_domain = 'erp5_ui'
-    context_domain = 'erp5_context'
+    context_domain = 'erp5_content'
     param_dict = self.getParamDict()
 
     # Prepare format parameters.
@@ -2232,10 +2232,10 @@ class ListBoxHTMLRenderer(ListBoxRenderer):
 
           if report_tree.is_open:
             method_id = 'foldDomain'
-            content = u'-&nbsp;<b>%s</b>' % unicode(Message(domain = ui_domain, message = report_tree.obj.getTitleOrId()))
+            content = u'-&nbsp;<b>%s</b>' % unicode(report_tree.obj.getTranslatedTitleOrId())
           else:
             method_id = 'unfoldDomain'
-            content = u'+&nbsp;%s' % unicode(Message(domain = ui_domain, message = report_tree.obj.getTitleOrId()))
+            content = u'+&nbsp;%s' % unicode(report_tree.obj.getTranslatedTitleOrId())
 
           html_list.append("""\
       <td nowrap valign="top" align="left" colspan="%d">
diff --git a/product/ERP5Form/www/ListBox_asHTML.zpt b/product/ERP5Form/www/ListBox_asHTML.zpt
index be4db34fc3..3ae5c7b166 100644
--- a/product/ERP5Form/www/ListBox_asHTML.zpt
+++ b/product/ERP5Form/www/ListBox_asHTML.zpt
@@ -60,10 +60,10 @@
                     tal:attributes="colspan python: total_depth - report_tree.depth + 1">
                     <a href="method"
                       tal:condition="report_tree/is_open"
-                      tal:attributes="href string:portal_selections/foldDomain?domain_url=${report_tree/domain_url}&form_id=${form_id}&list_selection_name=${selection_name}&domain_depth:int=${report_tree/depth}">-&nbsp;<b tal:content="report_tree/obj/getTitleOrId" i18n:translate="" i18n:domain="ui">Domain</b></a>
+                      tal:attributes="href string:portal_selections/foldDomain?domain_url=${report_tree/domain_url}&form_id=${form_id}&list_selection_name=${selection_name}&domain_depth:int=${report_tree/depth}">-&nbsp;<b tal:content="report_tree/obj/getTranslatedTitleOrId">Domain</b></a>
                     <a href="method"
                       tal:condition="not: report_tree/is_open"
-                      tal:attributes="href string:portal_selections/unfoldDomain?domain_url=${report_tree/domain_url}&form_id=${form_id}&list_selection_name=${selection_name}&domain_depth:int=${report_tree/depth}">+&nbsp;<tal:block tal:content="report_tree/obj/getTitleOrId" i18n:translate="" i18n:domain="ui">Domain</tal:block></a>
+                      tal:attributes="href string:portal_selections/unfoldDomain?domain_url=${report_tree/domain_url}&form_id=${form_id}&list_selection_name=${selection_name}&domain_depth:int=${report_tree/depth}">+&nbsp;<tal:block tal:content="report_tree/obj/getTranslatedTitleOrId">Domain</tal:block></a>
                   </td>
                 </tr>
               </table>
-- 
2.30.9