Author: sevein
Date: Thu Aug  9 12:00:10 2012
New Revision: 12062

Log:
Add identifierTitle sorting queries for the treview

Modified:
   trunk/lib/model/QubitInformationObject.php

Modified: trunk/lib/model/QubitInformationObject.php
==============================================================================
--- trunk/lib/model/QubitInformationObject.php  Thu Aug  9 11:38:04 2012        
(r12061)
+++ trunk/lib/model/QubitInformationObject.php  Thu Aug  9 12:00:10 2012        
(r12062)
@@ -1672,7 +1672,36 @@
 
           $criteria = QubitCultureFallback::addFallbackCriteria($criteria, 
'QubitInformationObject');
 
-          die("TODO");
+          if ('next' == $position)
+          {
+            $criteria->add('title',
+              'CONCAT(
+                  COALESCE(identifier, ""),
+                  COALESCE((CASE WHEN (current.TITLE IS NOT NULL AND 
current.TITLE <> "") THEN current.TITLE ELSE source.TITLE END), ""),
+                  LPAD(lft, 12, 0))
+                >
+               CONCAT(
+                
COALESCE('.Propel::getConnection()->quote($current->identifier).', ""),
+                COALESCE('.Propel::getConnection()->quote($current->title).', 
""),
+                LPAD('.Propel::getConnection()->quote($current->lft).', 12, 
0))',
+              Criteria::CUSTOM);
+
+            $criteria->addAscendingOrderByColumn('identifier');
+            $criteria->addAscendingOrderByColumn('title');
+            $criteria->addAscendingOrderByColumn('lft');
+          }
+          else // 'previous'
+          {
+            $criteria->add('title',
+              'CONCAT(COALESCE((CASE WHEN (current.TITLE IS NOT NULL AND 
current.TITLE <> "") THEN current.TITLE ELSE source.TITLE END), ""), LPAD(lft, 
12, 0))
+                <
+               
CONCAT(COALESCE('.Propel::getConnection()->quote($current->title).', ""), 
LPAD('.Propel::getConnection()->quote($current->lft).', 12, 0))',
+              Criteria::CUSTOM);
+
+            $criteria->addDescendingOrderByColumn('identifier');
+            $criteria->addDescendingOrderByColumn('title');
+            $criteria->addDescendingOrderByColumn('lft');
+          }
 
           break;
 

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to