Author: david
Date: Mon Oct 10 19:32:11 2011
New Revision: 10012

Log:
Add row counter

Modified:
   trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php
   trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php

Modified: 
trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php 
Mon Oct 10 19:26:34 2011        (r10011)
+++ trunk/apps/qubit/modules/informationobject/actions/fileListAction.class.php 
Mon Oct 10 19:32:11 2011        (r10012)
@@ -28,6 +28,12 @@
  */
 class InformationObjectFileListAction extends sfAction
 {
+  // Arrays not allowed in class constants
+  public static
+    $NAMES = array(
+      'sortColumn'
+    );
+
   public function execute($request)
   {
     $this->resource = $this->getRoute()->resource;
@@ -36,6 +42,11 @@
       $this->forward404();
     }
 
+    $this->generateReport($request);
+  }
+
+  public function generateReport($request)
+  {
     // Get "file" term in "level of description" taxonomy
     $c2 = new Criteria;
     $c2->addJoin(QubitTerm::ID, QubitTermI18n::ID, Criteria::INNER_JOIN);
@@ -83,7 +94,7 @@
     }
   }
 
-  public function getLocationString($resource)
+  public static function getLocationString($resource)
   {
     $locations = array();
     if (null !== ($physicalObjects = $resource->getPhysicalObjects()))
@@ -97,7 +108,7 @@
     return implode('; ', $locations);
   }
 
-  public function getCreationDates($resource)
+  public static function getCreationDates($resource)
   {
     $creationEvents = $resource->getCreationEvents();
 

Modified: 
trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php    
Mon Oct 10 19:26:34 2011        (r10011)
+++ trunk/apps/qubit/modules/informationobject/templates/fileListSuccess.php    
Mon Oct 10 19:32:11 2011        (r10012)
@@ -4,12 +4,13 @@
 
 <h1 class="label"><?php $isad = new sfIsadPlugin($resource); echo 
$isad->__toString() ?></h1>
 
-<?php foreach ($results as $parent => $items): ?>
+<?php $row = 0; foreach ($results as $parent => $items): ?>
   <h2><?php echo $parent ?></h2>
 
   <table>
     <thead>
       <tr>
+        <th><?php echo __('#') ?></th>
         <th><?php echo __('Title') ?></th>
         <th><?php echo __('Dates') ?></th>
         <th><?php echo __('Access restrictions') ?></th>
@@ -18,6 +19,7 @@
     </thead><tbody>
     <?php foreach ($items as $item): ?>
       <tr>
+        <td><?php echo ++$row ?></td>
         <td><?php echo $item['title'] ?></td>
         <td><?php echo $item['dates'] ?></td>
         <td><?php echo isset($item['accessConditions']) ? 
$item['accessConditions'] : __('None') ?></td>

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