Author: david
Date: Mon Sep 26 09:32:47 2011
New Revision: 9815

Log:
Add physical object reports bar to context menu

Added:
   trunk/apps/qubit/modules/physicalobject/actions/reportsComponent.class.php
      - copied, changed from r9814, 
trunk/apps/qubit/modules/informationobject/actions/contextMenuComponent.class.php
   trunk/apps/qubit/modules/physicalobject/templates/_reports.php
Modified:
   trunk/apps/qubit/modules/physicalobject/actions/indexAction.class.php
   trunk/apps/qubit/modules/physicalobject/config/view.yml
   trunk/apps/qubit/modules/repository/templates/_uploadLimit.php

Modified: trunk/apps/qubit/modules/physicalobject/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/physicalobject/actions/indexAction.class.php       
Fri Sep 23 17:52:47 2011        (r9814)
+++ trunk/apps/qubit/modules/physicalobject/actions/indexAction.class.php       
Mon Sep 26 09:32:47 2011        (r9815)
@@ -23,6 +23,11 @@
   {
     $this->resource = $this->getRoute()->resource;
 
+    if (!isset($this->resource))
+    {
+      $this->forward404();
+    }
+
     if (1 > strlen($title = $this->resource))
     {
       $title = $this->context->i18n->__('Untitled');

Copied and modified: 
trunk/apps/qubit/modules/physicalobject/actions/reportsComponent.class.php 
(from r9814, 
trunk/apps/qubit/modules/informationobject/actions/contextMenuComponent.class.php)
==============================================================================
--- 
trunk/apps/qubit/modules/informationobject/actions/contextMenuComponent.class.php
   Fri Sep 23 17:52:47 2011        (r9814, copy source)
+++ trunk/apps/qubit/modules/physicalobject/actions/reportsComponent.class.php  
Mon Sep 26 09:32:47 2011        (r9815)
@@ -26,7 +26,7 @@
  * @author Peter Van Garderen <[email protected]>
  * @author David Juhasz <[email protected]>
  */
-class InformationObjectContextMenuComponent extends sfComponent
+class PhysicalObjectReportsComponent extends sfComponent
 {
   public function execute($request)
   {

Modified: trunk/apps/qubit/modules/physicalobject/config/view.yml
==============================================================================
--- trunk/apps/qubit/modules/physicalobject/config/view.yml     Fri Sep 23 
17:52:47 2011        (r9814)
+++ trunk/apps/qubit/modules/physicalobject/config/view.yml     Mon Sep 26 
09:32:47 2011        (r9815)
@@ -5,4 +5,6 @@
 
 indexSuccess:
   javascripts:
-    blank:
\ No newline at end of file
+    blank:
+  components:
+    sidebar: [physicalobject, reports]

Added: trunk/apps/qubit/modules/physicalobject/templates/_reports.php
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/apps/qubit/modules/physicalobject/templates/_reports.php      Mon Sep 
26 09:32:47 2011        (r9815)
@@ -0,0 +1,10 @@
+<div>
+  <h3>
+    <?php echo __('Reports') ?>
+  </h3>
+  <div>
+    <ul>
+      <li><?php echo link_to(__('Box list'), array($resource, 'module' => 
'physicalobject', 'action' => 'boxList')) ?></li>
+    </ul>
+  </div>
+</div>

Modified: trunk/apps/qubit/modules/repository/templates/_uploadLimit.php
==============================================================================
--- trunk/apps/qubit/modules/repository/templates/_uploadLimit.php      Fri Sep 
23 17:52:47 2011        (r9814)
+++ trunk/apps/qubit/modules/repository/templates/_uploadLimit.php      Mon Sep 
26 09:32:47 2011        (r9815)
@@ -5,7 +5,7 @@
 
   <div>
 
-<?php if ('sfIsdiahPlugin' != $sf_context->getModuleName()): ?>
+<?php if ('sfIsdiahPlugin' != $sf_request->getModuleName()): ?>
   <?php echo __('for %repo%', array('%repo%' => 
link_to($resource->__toString(), array($resource, 'module' => 'repository')))) 
?>
 <?php endif; ?>
 

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