Author: david
Date: Mon Sep 26 16:58:06 2011
New Revision: 9842

Log:
Make Treeview 'view all' link to informationobject/browse. Fixes issue #1943

Modified:
   trunk/apps/qubit/modules/informationobject/actions/browseAction.class.php
   trunk/lib/model/QubitInformationObject.php

Modified: 
trunk/apps/qubit/modules/informationobject/actions/browseAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/browseAction.class.php   
Mon Sep 26 16:50:27 2011        (r9841)
+++ trunk/apps/qubit/modules/informationobject/actions/browseAction.class.php   
Mon Sep 26 16:58:06 2011        (r9842)
@@ -34,13 +34,23 @@
     }
 
     $criteria = new Criteria;
-    $criteria->add(QubitInformationObject::PARENT_ID, 
QubitInformationObject::ROOT_ID);
+
+    $this->resource = $this->getRoute()->resource;
+    if (isset($this->resource))
+    {
+      $criteria->add(QubitInformationObject::PARENT_ID, $this->resource->id);
+    }
+    else
+    {
+      $criteria->add(QubitInformationObject::PARENT_ID, 
QubitInformationObject::ROOT_ID);
+    }
 
     if (isset($request->repositoryId))
     {
       $criteria->add(QubitInformationObject::REPOSITORY_ID, 
$request->repositoryId);
     }
 
+
     if (isset($request->collectionType))
     {
       $criteria->add(QubitInformationObject::COLLECTION_TYPE_ID, 
$request->collectionType);
@@ -107,4 +117,4 @@
     $this->pager->setMaxPerPage($request->limit);
     $this->pager->setPage($request->page);
   }
-}
\ No newline at end of file
+}

Modified: trunk/lib/model/QubitInformationObject.php
==============================================================================
--- trunk/lib/model/QubitInformationObject.php  Mon Sep 26 16:50:27 2011        
(r9841)
+++ trunk/lib/model/QubitInformationObject.php  Mon Sep 26 16:58:06 2011        
(r9842)
@@ -1742,7 +1742,7 @@
 
         $node['label'] = sfContext::getInstance()->i18n->__('+%1% ...', 
array('%1%' => $count));
         $node['parentId'] = $item['parentId'];
-        $node['href'] = sfContext::getInstance()->routing->generate(null, 
array('module' => 'search', 'query' => 
'parent:'.QubitInformationObject::getById($item['parentId'])->slug)); 
+        $node['href'] = sfContext::getInstance()->routing->generate(null, 
array(QubitInformationObject::getById($item['parentId']), 'module' => 
'informationobject', 'action' => 'browse')); 
         $node['isLeaf'] = 'true';
         $node['style'] = 'seeAllNode';
       }

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