From 98448000473fc2be4c434b40fdcd8c1a3f49cb38 Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Mon, 7 Apr 2008 16:43:52 +0000
Subject: [PATCH] Sort document by revision, in case of multiple documents with
 the same version and reference.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20327 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_dms/Base_zGetImplicitPredecessorValueList.xml      | 6 +++---
 .../erp5_dms/Base_zGetImplicitSuccessorValueList.xml        | 6 +++---
 bt5/erp5_dms/bt/revision                                    | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_zGetImplicitPredecessorValueList.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_zGetImplicitPredecessorValueList.xml
index 0b372baecb..3967c64cdf 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_zGetImplicitPredecessorValueList.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_zGetImplicitPredecessorValueList.xml
@@ -42,7 +42,7 @@
                         <key> <string>_keys</string> </key>
                         <value>
                           <list>
-                            <string>reference</string>
+<string>reference</string>
                           </list>
                         </value>
                     </item>
@@ -140,7 +140,7 @@ FROM\n
         <dtml-sqltest "\'%\'+str(reference)+\'%\'" column=SearchableText op=like type=string>\n
       AND\n
         <dtml-sqltest reference op=ne type=string>\n
-    ORDER BY reference, language_order DESC, version DESC\n
+    ORDER BY reference, language_order DESC, version DESC, revision DESC\n
   ) AS innersub\n
 )\n
 AS sub\n
@@ -226,7 +226,7 @@ FROM\n
         <dtml-sqltest "\'%\'+str(reference)+\'%\'" column=SearchableText op=like type=string>\n
       AND\n
         <dtml-sqltest reference op=ne type=string>\n
-    ORDER BY reference, language_order DESC, version DESC\n
+    ORDER BY reference, language_order DESC, version DESC, revision DESC\n
   ) AS innersub\n
 )\n
 AS sub\n
diff --git a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_zGetImplicitSuccessorValueList.xml b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_zGetImplicitSuccessorValueList.xml
index d2fbfed1dd..a5f230ab58 100644
--- a/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_zGetImplicitSuccessorValueList.xml
+++ b/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Base_zGetImplicitSuccessorValueList.xml
@@ -42,7 +42,7 @@
                         <key> <string>_keys</string> </key>
                         <value>
                           <list>
-                            <string>reference_list</string>
+<string>reference_list</string>
                           </list>
                         </value>
                     </item>
@@ -141,7 +141,7 @@ FROM\n
            <dtml-unless sequence-end> OR </dtml-unless>\n
          </dtml-in>\n
         )\n
-    ORDER BY reference, language_order DESC, version DESC\n
+    ORDER BY reference, language_order DESC, version DESC, revision DESC\n
   ) AS innersub\n
 )\n
 AS sub\n
@@ -228,7 +228,7 @@ FROM\n
            <dtml-unless sequence-end> OR </dtml-unless>\n
          </dtml-in>\n
         )\n
-    ORDER BY reference, language_order DESC, version DESC\n
+    ORDER BY reference, language_order DESC, version DESC, revision DESC\n
   ) AS innersub\n
 )\n
 AS sub\n
diff --git a/bt5/erp5_dms/bt/revision b/bt5/erp5_dms/bt/revision
index e39afc8dd2..354d30ba65 100644
--- a/bt5/erp5_dms/bt/revision
+++ b/bt5/erp5_dms/bt/revision
@@ -1 +1 @@
-868
\ No newline at end of file
+869
\ No newline at end of file
-- 
2.30.9