From 7daf9b8e0b11f6d2ce70690b112912ac10c7aa12 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Wed, 28 Feb 2007 09:36:33 +0000
Subject: [PATCH] use portal_selections.buildSQLExpressionFromDomainSelection
 instead of selection_domain.asSQLExpression.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13094 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 ...ionModule_zGetAccountingTransactionList.xml | 16 ++++++++--------
 .../Account_zGetAccountingTransactionList.xml  | 16 ++++++++--------
 .../Resource_zGetTrackingList.xml              | 18 ++++++++----------
 3 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml
index 90b0df2cf5..5cf0b7b92a 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_zGetAccountingTransactionList.xml
@@ -430,10 +430,10 @@ FROM\n
     </dtml-if>\n
   </dtml-in>\n
   <dtml-if selection_domain>\n
-    <dtml-var "selection_domain.asSQLJoinExpression()">,\n
+    <dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_domain)">,\n
   </dtml-if>\n
   <dtml-if selection_report>\n
-    <dtml-var "selection_report.asSQLJoinExpression()">,\n
+    <dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_report)">,\n
   </dtml-if>\n
   <dtml-if use_movement_table> movement,  </dtml-if>\n
   <dtml-if "stat or omit_input or omit_output or node">\n
@@ -448,10 +448,10 @@ WHERE\n
     AND <dtml-var "query[\'where_expression\']">\n
   </dtml-if>\n
   <dtml-if selection_domain>\n
-    AND <dtml-var "selection_domain.asSQLExpression()">\n
+    AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain)">\n
   </dtml-if>\n
   <dtml-if selection_report>\n
-    AND <dtml-var "selection_report.asSQLExpression(strict_membership=1)">\n
+    AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_report, strict_membership=1)">\n
   </dtml-if>\n
   <dtml-if specific_reference> AND (\n
             catalog.source_reference LIKE\n
@@ -617,10 +617,10 @@ FROM\n
     </dtml-if>\n
   </dtml-in>\n
   <dtml-if selection_domain>\n
-    <dtml-var "selection_domain.asSQLJoinExpression()">,\n
+    <dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_domain)">,\n
   </dtml-if>\n
   <dtml-if selection_report>\n
-    <dtml-var "selection_report.asSQLJoinExpression()">,\n
+    <dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_report)">,\n
   </dtml-if>\n
   <dtml-if use_movement_table> movement,  </dtml-if>\n
   <dtml-if "stat or omit_input or omit_output or node">\n
@@ -635,10 +635,10 @@ WHERE\n
     AND <dtml-var "query[\'where_expression\']">\n
   </dtml-if>\n
   <dtml-if selection_domain>\n
-    AND <dtml-var "selection_domain.asSQLExpression()">\n
+    AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain)">\n
   </dtml-if>\n
   <dtml-if selection_report>\n
-    AND <dtml-var "selection_report.asSQLExpression(strict_membership=1)">\n
+    AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_report, strict_membership=1)">\n
   </dtml-if>\n
   <dtml-if specific_reference> AND (\n
             catalog.source_reference LIKE\n
diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting_bbb/Account_zGetAccountingTransactionList.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting_bbb/Account_zGetAccountingTransactionList.xml
index 0911c0c697..d540a4fce5 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting_bbb/Account_zGetAccountingTransactionList.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting_bbb/Account_zGetAccountingTransactionList.xml
@@ -282,8 +282,8 @@ FROM\n
   catalog  AS section_bc,\n
   category AS section_membership,\n
   catalog  AS section,\n
-  <dtml-if selection_domain><dtml-var "selection_domain.asSQLJoinExpression()">, </dtml-if>\n
-  <dtml-if selection_report><dtml-var "selection_report.asSQLJoinExpression()">, </dtml-if>\n
+  <dtml-if selection_domain><dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_domain)">, </dtml-if>\n
+  <dtml-if selection_report><dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_report)">, </dtml-if>\n
   <dtml-if where_expression>, category </dtml-if>\n
   stock\n
   LEFT JOIN catalog AS mirror_section\n
@@ -356,10 +356,10 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
   AND <dtml-var where_expression>\n
 </dtml-if>\n
 <dtml-if selection_domain>\n
-  AND <dtml-var "selection_domain.asSQLExpression()">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain)">\n
 </dtml-if>\n
 <dtml-if selection_report>\n
-  AND <dtml-var "selection_report.asSQLExpression(strict_membership=1)">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_report, strict_membership=1)">\n
 </dtml-if>\n
 ORDER BY\n
   stock.date, transaction_line.uid\n
@@ -426,8 +426,8 @@ FROM\n
   catalog  AS section_bc,\n
   category AS section_membership,\n
   catalog  AS section,\n
-  <dtml-if selection_domain><dtml-var "selection_domain.asSQLJoinExpression()">, </dtml-if>\n
-  <dtml-if selection_report><dtml-var "selection_report.asSQLJoinExpression()">, </dtml-if>\n
+  <dtml-if selection_domain><dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_domain)">, </dtml-if>\n
+  <dtml-if selection_report><dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_report)">, </dtml-if>\n
   <dtml-if where_expression>, category </dtml-if>\n
   stock\n
   LEFT JOIN catalog AS mirror_section\n
@@ -500,10 +500,10 @@ WHERE stock.node_uid = <dtml-var node_uid>\n
   AND <dtml-var where_expression>\n
 </dtml-if>\n
 <dtml-if selection_domain>\n
-  AND <dtml-var "selection_domain.asSQLExpression()">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain)">\n
 </dtml-if>\n
 <dtml-if selection_report>\n
-  AND <dtml-var "selection_report.asSQLExpression(strict_membership=1)">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_report, strict_membership=1)">\n
 </dtml-if>\n
 ORDER BY\n
   stock.date, transaction_line.uid\n
diff --git a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Resource_zGetTrackingList.xml b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Resource_zGetTrackingList.xml
index 5ed9de6387..fe2bd44d33 100644
--- a/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Resource_zGetTrackingList.xml
+++ b/bt5/erp5_banking_core/SkinTemplateItem/portal_skins/erp5_banking_core/Resource_zGetTrackingList.xml
@@ -413,8 +413,8 @@ FROM\n
     <dtml-if expr="table_key != \'item\'">, <dtml-var table_item> AS <dtml-var table_key></dtml-if>\n
   </dtml-in>\n
 </dtml-if>\n
-<dtml-if selection_domain>, <dtml-var "selection_domain.asSQLJoinExpression()"> </dtml-if>\n
-<dtml-if selection_report>, <dtml-var "selection_report.asSQLJoinExpression()"> </dtml-if>\n
+<dtml-if selection_domain>, <dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_domain)"> </dtml-if>\n
+<dtml-if selection_report>, <dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_report)"> </dtml-if>\n
 , item\n
 \n
 \n
@@ -462,11 +462,10 @@ WHERE\n
 \n
 \n
 <dtml-if selection_domain>\n
-  AND <dtml-var "selection_domain.asSQLExpression(join_table=\'item\',\n
-                                                  join_column=\'node_uid\')">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain, join_table=\'item\', join_column=\'node_uid\')">\n
 </dtml-if>\n
 <dtml-if selection_report>\n
-  AND <dtml-var "selection_report.asSQLExpression(strict_membership=1)">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_report, strict_membership=1)">\n
 </dtml-if>\n
 \n
 <dtml-if group_by_expression>\n
@@ -532,8 +531,8 @@ FROM\n
     <dtml-if expr="table_key != \'item\'">, <dtml-var table_item> AS <dtml-var table_key></dtml-if>\n
   </dtml-in>\n
 </dtml-if>\n
-<dtml-if selection_domain>, <dtml-var "selection_domain.asSQLJoinExpression()"> </dtml-if>\n
-<dtml-if selection_report>, <dtml-var "selection_report.asSQLJoinExpression()"> </dtml-if>\n
+<dtml-if selection_domain>, <dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_domain)"> </dtml-if>\n
+<dtml-if selection_report>, <dtml-var "portal_selections.buildSQLJoinExpressionFromDomainSelection(selection_report)"> </dtml-if>\n
 , item\n
 \n
 \n
@@ -581,11 +580,10 @@ WHERE\n
 \n
 \n
 <dtml-if selection_domain>\n
-  AND <dtml-var "selection_domain.asSQLExpression(join_table=\'item\',\n
-                                                  join_column=\'node_uid\')">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_domain, join_table=\'item\', join_column=\'node_uid\')">\n
 </dtml-if>\n
 <dtml-if selection_report>\n
-  AND <dtml-var "selection_report.asSQLExpression(strict_membership=1)">\n
+  AND <dtml-var "portal_selections.buildSQLExpressionFromDomainSelection(selection_report, strict_membership=1)">\n
 </dtml-if>\n
 \n
 <dtml-if group_by_expression>\n
-- 
2.30.9