Author: david
Date: Fri Oct  7 17:00:08 2011
New Revision: 9979

Log:
Add physical storage location report

Added:
   
trunk/apps/qubit/modules/informationobject/actions/storageLocationsAction.class.php
      - copied, changed from r9958, 
trunk/apps/qubit/modules/physicalobject/actions/boxListAction.class.php
   
trunk/apps/qubit/modules/informationobject/templates/storageLocationsSuccess.php
      - copied, changed from r9958, 
trunk/apps/qubit/modules/physicalobject/templates/boxListSuccess.php
Modified:
   trunk/apps/qubit/modules/informationobject/config/view.yml

Copied and modified: 
trunk/apps/qubit/modules/informationobject/actions/storageLocationsAction.class.php
 (from r9958, 
trunk/apps/qubit/modules/physicalobject/actions/boxListAction.class.php)
==============================================================================
--- trunk/apps/qubit/modules/physicalobject/actions/boxListAction.class.php     
Thu Oct  6 00:44:42 2011        (r9958, copy source)
+++ 
trunk/apps/qubit/modules/informationobject/actions/storageLocationsAction.class.php
 Fri Oct  7 17:00:08 2011        (r9979)
@@ -17,23 +17,27 @@
  * along with Qubit Toolkit.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-class PhysicalObjectBoxListAction extends sfAction
+class InformationObjectStorageLocationsAction extends sfAction
 {
   public function execute($request)
   {
-    if (!isset($request->limit))
+    $this->resource = $this->getRoute()->resource;
+
+    if (!isset($this->resource))
     {
-      $request->limit = sfConfig::get('app_hits_per_page');
+      $this->forward404();
     }
 
-    $this->resource = $this->getRoute()->resource;
-
     $criteria = new Criteria;
-    $criteria->add(QubitRelation::SUBJECT_ID, $this->resource->id);
+
+    $criteria->setDistinct();
+    $criteria->add(QubitInformationObject::LFT, $this->resource->lft, 
Criteria::GREATER_EQUAL);
+    $criteria->add(QubitInformationObject::RGT, $this->resource->rgt, 
Criteria::LESS_EQUAL);
     $criteria->add(QubitRelation::TYPE_ID, QubitTerm::HAS_PHYSICAL_OBJECT_ID);
     $criteria->addJoin(QubitRelation::OBJECT_ID, QubitInformationObject::ID);
+    $criteria->addJoin(QubitRelation::SUBJECT_ID, QubitPhysicalObject::ID);
 
-    $this->informationObjects = QubitInformationObject::get($criteria);
+    $this->physicalObjects = QubitPhysicalObject::get($criteria);
 
     $c2 = clone $criteria;
     $this->foundcount = BasePeer::doCount($c2)->fetchColumn(0);

Modified: trunk/apps/qubit/modules/informationobject/config/view.yml
==============================================================================
--- trunk/apps/qubit/modules/informationobject/config/view.yml  Fri Oct  7 
16:48:20 2011        (r9978)
+++ trunk/apps/qubit/modules/informationobject/config/view.yml  Fri Oct  7 
17:00:08 2011        (r9979)
@@ -51,3 +51,7 @@
     blank:
   components:
     sidebar: [repository, uploadLimit]
+
+storageLocationsSuccess:
+  stylesheets:
+    print-preview: { media: screen, position: last }

Copied and modified: 
trunk/apps/qubit/modules/informationobject/templates/storageLocationsSuccess.php
 (from r9958, 
trunk/apps/qubit/modules/physicalobject/templates/boxListSuccess.php)
==============================================================================
--- trunk/apps/qubit/modules/physicalobject/templates/boxListSuccess.php        
Thu Oct  6 00:44:42 2011        (r9958, copy source)
+++ 
trunk/apps/qubit/modules/informationobject/templates/storageLocationsSuccess.php
    Fri Oct  7 17:00:08 2011        (r9979)
@@ -1,57 +1,34 @@
 <div id="preview-message">
   <?php echo __('Print preview') ?>
-  <?php echo link_to('Close', array($resource, 'module' => 'physicalobject')) 
?>
+  <?php echo link_to('Close', array($resource, 'module' => 
'informationobject')) ?>
 </div>
 
-<h1 class="do-print"><?php echo sfConfig::get('app_ui_label_physicalobject') 
?></h1>
+<h1 class="do-print"><?php echo 'Physical storage locations' ?></h1>
 
 <h1 class="label">
-  <?php echo $resource->getLabel() ?>
+  <?php $isad = new sfIsadPlugin($resource); echo $isad->__toString() ?>
 </h1>
 
 <table class="sticky-enabled">
   <thead>
     <tr>
       <th>
-        <?php echo __('Reference code') ?>
+        <?php echo __('Name') ?>
       </th><th>
-        <?php echo __('Title') ?>
+        <?php echo __('Location') ?>
       </th><th>
-        <?php echo __('Date(s)') ?>
-      </th><th>
-        <?php echo __('Part of') ?>
-      </th><th>
-        <?php echo __('Conditions governing access') ?>
+        <?php echo __('Type') ?>
       </th>
     </tr>
   </thead><tbody>
-    <?php foreach ($informationObjects as $item): ?>
+    <?php foreach ($physicalObjects as $item): ?>
       <tr class="<?php echo 0 == @++$row % 2 ? 'even' : 'odd' ?>">
         <td>
-          <?php $isad = new sfIsadPlugin($item); echo 
render_value($isad->referenceCode) ?>
-        </td><td>
-          <?php echo render_title($item) ?>
-        </td><td>
-          <ul>
-            <?php foreach ($item->getDates() as $date): ?>
-              <li>
-                <?php echo 
Qubit::renderDateStartEnd($date->getDate(array('cultureFallback' => true)), 
$date->startDate, $date->endDate) ?> (<?php echo 
$date->getType(array('cultureFallback' => true)) ?>)
-                <?php if (isset($date->actor)): ?>
-                  <?php echo render_title($date->actor) ?>
-                <?php endif; ?>
-              </li>
-            <?php endforeach; ?>
-          </ul>
+          <?php echo link_to($item->name, array($item, 'module' => 
'physicalobject')) ?>
         </td><td>
-          <?php if ($item->getCollectionRoot()->id != $item->id): ?>
-            <?php echo render_title($item->getCollectionRoot()) ?>
-          <?php endif; ?>
+          <?php echo $item->location ?>
         </td><td>
-        <?php if (null != ($accessConditions = 
$item->getAccessConditions(array('cultureFallback' => true)))): ?>
-          <?php echo render_value($accessConditions) ?>
-        <?php else: ?>
-          <?php echo _('None') ?>
-        <?php endif; ?>
+          <?php echo $item->type->__toString() ?>
         </td>
       </tr>
     <?php endforeach; ?>

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