Author: sevein
Date: Thu Apr 14 10:07:34 2011
New Revision: 9075

Log:
New default sort based on whether used logged in and add institution column to 
'recent changes' view to actor browser screen (see issues 1951 and 1932). Wu's 
contribution.

Modified:
   trunk/apps/qubit/modules/actor/actions/browseAction.class.php
   trunk/apps/qubit/modules/actor/templates/browseSuccess.php

Modified: trunk/apps/qubit/modules/actor/actions/browseAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/actor/actions/browseAction.class.php       Thu Apr 
14 09:29:58 2011        (r9074)
+++ trunk/apps/qubit/modules/actor/actions/browseAction.class.php       Thu Apr 
14 10:07:34 2011        (r9075)
@@ -53,7 +53,7 @@
       case 'nameUp':
         $criteria->addAscendingOrderByColumn('authorized_form_of_name');
 
-        break;
+      break;
 
       case 'typeDown':
         $fallbackTable = 'QubitTerm';
@@ -70,7 +70,6 @@
         break;
 
       case 'updatedDown':
-      default:
         $criteria->addDescendingOrderByColumn(QubitObject::UPDATED_AT);
 
         break;
@@ -79,6 +78,16 @@
         $criteria->addAscendingOrderByColumn(QubitObject::UPDATED_AT);
 
         break;
+
+      default:
+        if (!$this->getUser()->isAuthenticated())
+        {
+          $criteria->addAscendingOrderByColumn('authorized_form_of_name');
+        }
+        else
+        {
+          $criteria->addDescendingOrderByColumn(QubitObject::UPDATED_AT);
+        }
     }
 
     // Do source culture fallback
@@ -90,4 +99,4 @@
     $this->pager->setMaxPerPage($request->limit);
     $this->pager->setPage($request->page);
   }
-}
+}
\ No newline at end of file

Modified: trunk/apps/qubit/modules/actor/templates/browseSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/actor/templates/browseSuccess.php  Thu Apr 14 
09:29:58 2011        (r9074)
+++ trunk/apps/qubit/modules/actor/templates/browseSuccess.php  Thu Apr 14 
10:07:34 2011        (r9075)
@@ -6,8 +6,13 @@
 
   <div class="content">
     <ul class="clearfix links">
-      <li<?php if ('nameDown' != $sf_request->sort && 'nameUp' != 
$sf_request->sort): ?> class="active"<?php endif; ?>><?php echo 
link_to(__('Recent changes'), array('sort' => 'updatedDown') + 
$sf_request->getParameterHolder()->getAll(), array('title' => __('Sort'))) 
?></li>
-      <li<?php if ('nameDown' == $sf_request->sort || 'nameUp' == 
$sf_request->sort): ?> class="active"<?php endif; ?>><?php echo 
link_to(__('Alphabetic'), array('sort' => 'nameUp') + 
$sf_request->getParameterHolder()->getAll(), array('title' => __('Sort'))) 
?></li>
+      <?php if ($sf_user->isAuthenticated()): ?>
+        <li<?php if ('nameDown' != $sf_request->sort && 'nameUp' != 
$sf_request->sort): ?> class="active"<?php endif; ?>><?php echo 
link_to(__('Recent changes'), array('sort' => 'updatedDown') + 
$sf_request->getParameterHolder()->getAll(), array('title' => __('Sort'))) 
?></li>
+        <li<?php if ('nameDown' == $sf_request->sort || 'nameUp' == 
$sf_request->sort): ?> class="active"<?php endif; ?>><?php echo 
link_to(__('Alphabetic'), array('sort' => 'nameUp') + 
$sf_request->getParameterHolder()->getAll(), array('title' => __('Sort'))) 
?></li>
+      <?php else: ?>
+        <li<?php if ('updatedDown' == $sf_request->sort || 'updatedUp' == 
$sf_request->sort): ?> class="active"<?php endif; ?>><?php echo 
link_to(__('Recent changes'), array('sort' => 'updatedDown') + 
$sf_request->getParameterHolder()->getAll(), array('title' => __('Sort'))) 
?></li>
+        <li<?php if ('updatedDown' != $sf_request->sort && 'updatedUp' != 
$sf_request->sort): ?> class="active"<?php endif; ?>><?php echo 
link_to(__('Alphabetic'), array('sort' => 'nameUp') + 
$sf_request->getParameterHolder()->getAll(), array('title' => __('Sort'))) 
?></li>
+      <?php endif; ?> 
     </ul>
   </div>
 

-- 
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