From 54c19a6e8cf8d6c3330cf97e117ab2baf38bf220 Mon Sep 17 00:00:00 2001
From: Yusei Tahara <yusei@nexedi.com>
Date: Fri, 25 Apr 2008 15:52:35 +0000
Subject: [PATCH] Use business_field_title argument on portal_catalog instead.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20821 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../GlossaryModule_createTermListForTranslation.xml    |  2 +-
 .../GlossaryModule_findTermFromPropertySheet.xml       |  2 +-
 .../GlossaryModule_getBusinessFieldFieldList.xml       |  2 +-
 .../erp5_glossary/GlossaryModule_getPOFile.xml         | 10 ++++++----
 bt5/erp5_forge/bt/revision                             |  2 +-
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_createTermListForTranslation.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_createTermListForTranslation.xml
index bd0d0f51d6..ece18db3ca 100644
--- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_createTermListForTranslation.xml
+++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_createTermListForTranslation.xml
@@ -79,7 +79,7 @@ for i in catalog(portal_type=\'Glossary Term\',\n
 \n
   if catalog.getResultValue(portal_type=\'Glossary Term\',\n
                             reference=reference,\n
-                            business_field=business_field,\n
+                            business_field_title=business_field,\n
                             language_id=language) is not None:\n
     continue\n
 \n
diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.xml
index c14fe24ef6..ea5a0be195 100644
--- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.xml
+++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_findTermFromPropertySheet.xml
@@ -80,7 +80,7 @@ else:\n
   for i in result:\n
     item_list = portal_catalog(portal_type=\'Glossary Term\',\n
                                reference=i[\'reference\'], language=i[\'language\'],\n
-                               business_field=i[\'business_field\'],\n
+                               business_field_title=i[\'business_field\'],\n
                                validation_state="!=deleted")\n
     if len(item_list)>0:\n
       continue\n
diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldFieldList.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldFieldList.xml
index 223231057c..77070c9c94 100644
--- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldFieldList.xml
+++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getBusinessFieldFieldList.xml
@@ -76,7 +76,7 @@ def get_term_list(business_field, reference):\n
   term_list = portal_catalog(portal_type=\'Glossary Term\',\n
                              validation_state=\'validated\',\n
                              language=\'en\',\n
-                             business_field=business_field,\n
+                             business_field_title=business_field,\n
                              reference=reference)\n
   return [i.getObject() for i in term_list]\n
 \n
diff --git a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getPOFile.xml b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getPOFile.xml
index 2a369fe8d1..bf0d4dbf9a 100644
--- a/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getPOFile.xml
+++ b/bt5/erp5_forge/SkinTemplateItem/portal_skins/erp5_glossary/GlossaryModule_getPOFile.xml
@@ -83,7 +83,7 @@ catalog = context.portal_catalog\n
 \n
 for i in catalog(portal_type=\'Glossary Term\',\n
                  validation_state=\'validated\',\n
-                 business_field=business_field_list,\n
+                 business_field_title=business_field_list,\n
                  language=language):\n
   term = i.getObject()\n
   reference = term.getReference()\n
@@ -93,7 +93,7 @@ for i in catalog(portal_type=\'Glossary Term\',\n
                                         validation_state=\'validated\',\n
                                         language=\'en\',\n
                                         reference=reference,\n
-                                        business_field=business_field)\n
+                                        business_field_title=business_field)\n
   if english_term is None:\n
     raise ValueError, \'Corresponding English term to "%s" does not exist in glossary.\' % term.Title()\n
 \n
@@ -102,17 +102,18 @@ for i in catalog(portal_type=\'Glossary Term\',\n
 \n
   english_title = english_term.getTitle()\n
   english_description = english_term.getDescription()\n
+  english_relative_url = english_term.getRelativeUrl()\n
 \n
   if translated_title:\n
     if not english_title:\n
-      raise ValueError, \'Title of corresponding English term to "%s" is empty.\' % translated_title\n
+      raise ValueError, \'Title of corresponding English term(%s) to "%s" is empty.\' % (english_relative_url, translated_title)\n
     if translated_title!=english_title:\n
       print MESSAGE_TEMPLATE % {\'english\':format(english_title),\n
                                 \'translation\':format(translated_title)}\n
 \n
   if translated_description:\n
     if not english_description:\n
-      raise ValueError, \'Description of corresponding English term to "%s" is empty.\' % translated_description\n
+      raise ValueError, \'Description of corresponding English term(%s) to "%s" is empty.\' % (english_relative_url, translated_description)\n
 \n
     if translated_description!=english_description:\n
       print MESSAGE_TEMPLATE % {\'english\':format(english_description),\n
@@ -187,6 +188,7 @@ return printed\n
                             <string>translated_description</string>
                             <string>english_title</string>
                             <string>english_description</string>
+                            <string>english_relative_url</string>
                             <string>RESPONSE</string>
                           </tuple>
                         </value>
diff --git a/bt5/erp5_forge/bt/revision b/bt5/erp5_forge/bt/revision
index cc4f7f3feb..1199cd493e 100644
--- a/bt5/erp5_forge/bt/revision
+++ b/bt5/erp5_forge/bt/revision
@@ -1 +1 @@
-218
\ No newline at end of file
+219
\ No newline at end of file
-- 
2.30.9