Commit 0bbab1f1 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Accept empty results from selection_domain and selection_report.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5740 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent aafe0c55
......@@ -19,18 +19,30 @@ SELECT
</dtml-if>
FROM
<dtml-in from_table_list> <dtml-var sequence-item> AS <dtml-var sequence-key><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
<dtml-if selection_domain>, <dtml-var "selection_domain.asSqlJoinExpression()"> </dtml-if>
<dtml-if selection_report>, <dtml-var "selection_report.asSqlJoinExpression()"> </dtml-if>
<dtml-if selection_domain>
<dtml-let expression="selection_domain.asSqlJoinExpression()">
<dtml-if expression> , <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if selection_report>
<dtml-let expression="selection_report.asSqlJoinExpression()">
<dtml-if expression> , <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
WHERE
1 = 1
<dtml-if where_expression>
AND <dtml-var where_expression>
</dtml-if>
<dtml-if selection_domain>
AND <dtml-var "selection_domain.asSqlExpression()">
<dtml-let expression="selection_domain.asSqlExpression()">
<dtml-if expression> AND <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if selection_report>
AND <dtml-var "selection_report.asSqlExpression(strict_membership=1)">
<dtml-let expression="selection_report.asSqlExpression(strict_membership=1)">
<dtml-if expression> AND <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if sort_on>
ORDER BY
......
......@@ -20,8 +20,16 @@ SELECT DISTINCT
FROM
<dtml-in from_table_list> <dtml-var sequence-item> AS <dtml-var sequence-key><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
<dtml-if selection_domain>, <dtml-var "selection_domain.asSqlJoinExpression()"> </dtml-if>
<dtml-if selection_report>, <dtml-var "selection_report.asSqlJoinExpression()"> </dtml-if>
<dtml-if selection_domain>
<dtml-let expression="selection_domain.asSqlJoinExpression()">
<dtml-if expression> , <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if selection_report>
<dtml-let expression="selection_report.asSqlJoinExpression()">
<dtml-if expression> , <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
WHERE
1 = 1
......@@ -29,10 +37,14 @@ WHERE
AND <dtml-var where_expression>
</dtml-if>
<dtml-if selection_domain>
AND <dtml-var "selection_domain.asSqlExpression()">
<dtml-let expression="selection_domain.asSqlExpression()">
<dtml-if expression> AND <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if selection_report>
AND <dtml-var "selection_report.asSqlExpression(strict_membership=1)">
<dtml-let expression="selection_report.asSqlExpression(strict_membership=1)">
<dtml-if expression> AND <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if sort_on>
ORDER BY
......
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