Commit 46b77f16 authored by Romain Courteaud's avatar Romain Courteaud

Use standard where_expression instead of adding hardcoded parameter to the...

Use standard where_expression instead of adding hardcoded parameter to the ZSQL Method Base_zSearchRelatedObjectsByCategoryList.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13434 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0b36b88e
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>order_by_expression</string> </key>
<value> <value>
<dictionary/> <dictionary/>
</value> </value>
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>where_expression</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -57,9 +63,10 @@ ...@@ -57,9 +63,10 @@
<key> <string>_keys</string> </key> <key> <string>_keys</string> </key>
<value> <value>
<list> <list>
<string>category_list</string> <string>category_list</string>
<string>portal_type</string> <string>strict_membership</string>
<string>strict_membership</string> <string>where_expression</string>
<string>order_by_expression</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -77,8 +84,9 @@ ...@@ -77,8 +84,9 @@
<item> <item>
<key> <string>arguments_src</string> </key> <key> <string>arguments_src</string> </key>
<value> <string>category_list\r\n <value> <string>category_list\r\n
portal_type\r\n strict_membership\r\n
strict_membership</string> </value> where_expression\r\n
order_by_expression</string> </value>
</item> </item>
<item> <item>
<key> <string>cache_time_</string> </key> <key> <string>cache_time_</string> </key>
...@@ -94,7 +102,9 @@ strict_membership</string> </value> ...@@ -94,7 +102,9 @@ strict_membership</string> </value>
</item> </item>
<item> <item>
<key> <string>connection_hook</string> </key> <key> <string>connection_hook</string> </key>
<value> <string></string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>connection_id</string> </key> <key> <string>connection_id</string> </key>
...@@ -116,23 +126,19 @@ strict_membership</string> </value> ...@@ -116,23 +126,19 @@ strict_membership</string> </value>
<key> <string>src</string> </key> <key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
<dtml-if portal_type>\n
SELECT DISTINCT catalog.uid, catalog.path, catalog.relative_url, portal_type\n
FROM catalog, category\n
WHERE (<dtml-in portal_type><dtml-unless sequence-start> OR </dtml-unless>catalog.portal_type=\'<dtml-var sequence-item>\'</dtml-in>)\n
AND catalog.uid = category.uid\n
AND (<dtml-var "portal_categories.buildSQLSelector(category_list)">)\n
<dtml-if strict_membership>\n
AND category.category_strict_membership = 1\n
</dtml-if>\n
<dtml-else>\n
SELECT DISTINCT catalog.uid, catalog.path, portal_type\n SELECT DISTINCT catalog.uid, catalog.path, portal_type\n
FROM catalog, category\n FROM catalog, category\n
WHERE catalog.uid = category.uid\n WHERE catalog.uid = category.uid\n
AND (<dtml-var "portal_categories.buildSQLSelector(category_list)">)\n AND (<dtml-var "portal_categories.buildSQLSelector(category_list)">)\n
<dtml-if strict_membership>\n <dtml-if strict_membership>\n
AND category.category_strict_membership = 1\n AND category.category_strict_membership = 1\n
</dtml-if>\n </dtml-if>\n
<dtml-if where_expression>\n
AND <dtml-var where_expression>\n
</dtml-if>\n
<dtml-if order_by_expression>\n
ORDER BY\n
<dtml-var order_by_expression>\n
</dtml-if> </dtml-if>
]]></string> </value> ]]></string> </value>
...@@ -171,23 +177,19 @@ AND (<dtml-var "portal_categories.buildSQLSelector(category_list)">)\n ...@@ -171,23 +177,19 @@ AND (<dtml-var "portal_categories.buildSQLSelector(category_list)">)\n
<key> <string>raw</string> </key> <key> <string>raw</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
<dtml-if portal_type>\n
SELECT DISTINCT catalog.uid, catalog.path, catalog.relative_url, portal_type\n
FROM catalog, category\n
WHERE (<dtml-in portal_type><dtml-unless sequence-start> OR </dtml-unless>catalog.portal_type=\'<dtml-var sequence-item>\'</dtml-in>)\n
AND catalog.uid = category.uid\n
AND (<dtml-var "portal_categories.buildSQLSelector(category_list)">)\n
<dtml-if strict_membership>\n
AND category.category_strict_membership = 1\n
</dtml-if>\n
<dtml-else>\n
SELECT DISTINCT catalog.uid, catalog.path, portal_type\n SELECT DISTINCT catalog.uid, catalog.path, portal_type\n
FROM catalog, category\n FROM catalog, category\n
WHERE catalog.uid = category.uid\n WHERE catalog.uid = category.uid\n
AND (<dtml-var "portal_categories.buildSQLSelector(category_list)">)\n AND (<dtml-var "portal_categories.buildSQLSelector(category_list)">)\n
<dtml-if strict_membership>\n <dtml-if strict_membership>\n
AND category.category_strict_membership = 1\n AND category.category_strict_membership = 1\n
</dtml-if>\n </dtml-if>\n
<dtml-if where_expression>\n
AND <dtml-var where_expression>\n
</dtml-if>\n
<dtml-if order_by_expression>\n
ORDER BY\n
<dtml-var order_by_expression>\n
</dtml-if> </dtml-if>
]]></string> </value> ]]></string> </value>
......
267 268
\ No newline at end of file \ No newline at end of file
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