Author: sevein
Date: Wed Aug 17 14:37:28 2011
New Revision: 9522
Log:
Make relatedRightsComponent work with accession and information objects
Modified:
trunk/apps/qubit/modules/right/actions/relatedRightsComponent.class.php
trunk/apps/qubit/modules/right/templates/_relatedRights.php
Modified:
trunk/apps/qubit/modules/right/actions/relatedRightsComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/right/actions/relatedRightsComponent.class.php
Wed Aug 17 14:30:21 2011 (r9521)
+++ trunk/apps/qubit/modules/right/actions/relatedRightsComponent.class.php
Wed Aug 17 14:37:28 2011 (r9522)
@@ -21,12 +21,19 @@
{
public function execute($request)
{
- foreach ($this->resource->ancestors->andSelf()->orderBy('rgt') as
$this->ancestor)
+ if ($this->resource instanceof QubitInformationObject)
{
- if (0 < count($this->ancestor->getRights()))
+ foreach ($this->resource->ancestors->andSelf()->orderBy('rgt') as
$this->ancestor)
{
- break;
+ if (0 < count($this->ancestor->getRights()))
+ {
+ break;
+ }
}
}
+ else if ($this->resource instanceof QubitAccession)
+ {
+ $this->ancestor = $this->resource;
+ }
}
}
Modified: trunk/apps/qubit/modules/right/templates/_relatedRights.php
==============================================================================
--- trunk/apps/qubit/modules/right/templates/_relatedRights.php Wed Aug 17
14:30:21 2011 (r9521)
+++ trunk/apps/qubit/modules/right/templates/_relatedRights.php Wed Aug 17
14:37:28 2011 (r9522)
@@ -7,8 +7,6 @@
<?php echo link_to(render_title($item->subject), array($item->subject,
'module' => 'informationobject'), array('title' => __('Inherited from %1%',
array('%1%' => $ancestor)))) ?>
<?php endif; ?>
- <?php // echo render_title($item->object) ?>
-
<?php echo render_show(__('Act'), render_value($item->object->act)) ?>
<?php echo render_show(__('Restriction'),
render_value($item->object->getRestriction(array('cultureFallback' => true))))
?>
--
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.