Author: david
Date: Wed Oct 13 15:24:31 2010
New Revision: 8084

Log:
Use $this->resource like r7463.

Modified:
   trunk/apps/qubit/modules/repository/actions/indexAction.class.php
   
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/indexAction.class.php
   
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/templates/indexSuccess.php

Modified: trunk/apps/qubit/modules/repository/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/repository/actions/indexAction.class.php   Wed Oct 
13 12:08:22 2010        (r8083)
+++ trunk/apps/qubit/modules/repository/actions/indexAction.class.php   Wed Oct 
13 15:24:31 2010        (r8084)
@@ -21,16 +21,20 @@
 {
   public function execute($request)
   {
-    $this->repository = QubitRepository::getById($this->request->id);
-    $this->forward404Unless($this->repository);
+    $this->resource = $this->getRoute()->resource;
 
-    $this->otherNames = $this->repository->getOtherNames();
+    if (!isset($this->resource))
+    {
+      $this->forward404();
+    }
+
+    $this->otherNames = $this->resource->getOtherNames();
     $this->maintenanceNote = null;
-    if (0 < count($maintenanceNotes = 
$this->repository->getNotesByType(array('noteTypeId' => 
QubitTerm::MAINTENANCE_NOTE_ID))))
+    if (0 < count($maintenanceNotes = 
$this->resource->getNotesByType(array('noteTypeId' => 
QubitTerm::MAINTENANCE_NOTE_ID))))
     {
       $this->maintenanceNote = $maintenanceNotes->offsetGet(0);
     }
 
-    $this->types = 
$this->repository->getTermRelations(QubitTaxonomy::REPOSITORY_TYPE_ID);
+    $this->types = 
$this->resource->getTermRelations(QubitTaxonomy::REPOSITORY_TYPE_ID);
   }
 }

Modified: 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/indexAction.class.php
==============================================================================
--- 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/indexAction.class.php
   Wed Oct 13 12:08:22 2010        (r8083)
+++ 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/actions/indexAction.class.php
   Wed Oct 13 15:24:31 2010        (r8084)
@@ -34,7 +34,7 @@
     parent::execute($request);
 
     // add ISDIAH specific commands
-    if (QubitAcl::check($this->repository, 'update'))
+    if (QubitAcl::check($this->resource, 'update'))
     {
       $validatorSchema = new sfValidatorSchema;
       $validatorSchema->authorizedFormOfName = new sfValidatorString(array(
@@ -58,15 +58,15 @@
         'required' => $this->context->i18n->__('%1%Contact information%2% - 
This is a %3%mandatory%4% element.', array('%1%' => '<a 
href="http://ica-atom.org/doc/RS-3#5.2.1";>', '%2%' => '</a>', '%3%' => '<a 
href="http://ica-atom.org/doc/RS-3#4.7";>', '%4%' => '</a>'))));
 
       $value = array();
-      $value['identifier'] = $this->repository->identifier;
-      $value['authorizedFormOfName'] = 
$this->repository->getAuthorizedFormOfName(array('culltureFallback' => true));
-      if (null !== $this->repository->getPrimaryContact())
+      $value['identifier'] = $this->resource->identifier;
+      $value['authorizedFormOfName'] = 
$this->resource->getAuthorizedFormOfName(array('culltureFallback' => true));
+      if (null !== $this->resource->getPrimaryContact())
       {
-        $value['primaryContact']['city'] = 
$this->repository->getPrimaryContact()->getCity(array('culltureFallback' => 
true));
-        $value['primaryContact']['countryCode'] = 
$this->repository->getPrimaryContact()->countryCode;
-        $value['primaryContact']['postalCode'] = 
$this->repository->getPrimaryContact()->postalCode;
-        $value['primaryContact']['region'] = 
$this->repository->getPrimaryContact()->getRegion(array('culltureFallback' => 
true));
-        $value['primaryContact']['streetAddress'] = 
$this->repository->getPrimaryContact()->streetAddress;
+        $value['primaryContact']['city'] = 
$this->resource->getPrimaryContact()->getCity(array('culltureFallback' => 
true));
+        $value['primaryContact']['countryCode'] = 
$this->resource->getPrimaryContact()->countryCode;
+        $value['primaryContact']['postalCode'] = 
$this->resource->getPrimaryContact()->postalCode;
+        $value['primaryContact']['region'] = 
$this->resource->getPrimaryContact()->getRegion(array('culltureFallback' => 
true));
+        $value['primaryContact']['streetAddress'] = 
$this->resource->getPrimaryContact()->streetAddress;
       }
 
       try

Modified: 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/templates/indexSuccess.php
==============================================================================
--- 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/templates/indexSuccess.php  
    Wed Oct 13 12:08:22 2010        (r8083)
+++ 
trunk/plugins/sfIsdiahPlugin/modules/sfIsdiahPlugin/templates/indexSuccess.php  
    Wed Oct 13 15:24:31 2010        (r8084)
@@ -1,6 +1,6 @@
 <h1><?php echo __('View %1%', array('%1%' => 
sfConfig::get('app_ui_label_repository'))) ?></h1>
 
-<?php echo link_to_if(SecurityPriviliges::editCredentials($sf_user, 
'repository'), '<h1 class="label">'.render_title($repository).'</h1>', 
array($repository, 'module' => 'repository', 'action' => 'edit'), array('title' 
=> __('Edit repository'))) ?>
+<?php echo link_to_if(SecurityPriviliges::editCredentials($sf_user, 
'repository'), '<h1 class="label">'.render_title($resource).'</h1>', 
array($resource, 'module' => 'repository', 'action' => 'edit'), array('title' 
=> __('Edit repository'))) ?>
 
 <?php if (isset($errorSchema)): ?>
   <div class="messages error">
@@ -12,15 +12,15 @@
   </div>
 <?php endif; ?>
 
-<?php echo render_show(__('Identifier'), 
render_value($repository->identifier)) ?>
+<?php echo render_show(__('Identifier'), render_value($resource->identifier)) 
?>
 
-<?php echo render_show(__('Authorized form of name'), 
render_value($repository)) ?>
+<?php echo render_show(__('Authorized form of name'), render_value($resource)) 
?>
 
 <div class="field">
   <h3><?php echo __('Parallel form(s) of name') ?></h3>
   <div>
     <ul>
-      <?php foreach ($repository->getOtherNames(array('typeId' => 
QubitTerm::PARALLEL_FORM_OF_NAME_ID)) as $name): ?>
+      <?php foreach ($resource->getOtherNames(array('typeId' => 
QubitTerm::PARALLEL_FORM_OF_NAME_ID)) as $name): ?>
         <li><?php echo render_value($name->__toString()) ?></li>
       <?php endforeach; ?>
     </ul>
@@ -31,7 +31,7 @@
   <h3><?php echo __('Other form(s) of name') ?></h3>
   <div>
     <ul>
-      <?php foreach ($repository->getOtherNames(array('typeId' => 
QubitTerm::OTHER_FORM_OF_NAME_ID)) as $name): ?>
+      <?php foreach ($resource->getOtherNames(array('typeId' => 
QubitTerm::OTHER_FORM_OF_NAME_ID)) as $name): ?>
         <li><?php echo render_value($name->__toString()) ?></li>
       <?php endforeach; ?>
     </ul>
@@ -62,51 +62,51 @@
   </div>
 </div>
 
-<?php echo render_show(__('History'), 
render_value($repository->getHistory(array('cultureFallback' => true)))) ?>
+<?php echo render_show(__('History'), 
render_value($resource->getHistory(array('cultureFallback' => true)))) ?>
 
-<?php echo render_show(__('Geographical and cultural context'), 
render_value($repository->getGeoculturalContext(array('cultureFallback' => 
true)))) ?>
+<?php echo render_show(__('Geographical and cultural context'), 
render_value($resource->getGeoculturalContext(array('cultureFallback' => 
true)))) ?>
 
-<?php echo render_show(__('Mandates/Sources of authority'), 
render_value($repository->getMandates(array('cultureFallback' => true)))) ?>
+<?php echo render_show(__('Mandates/Sources of authority'), 
render_value($resource->getMandates(array('cultureFallback' => true)))) ?>
 
-<?php echo render_show(__('Administrative structure'), 
render_value($repository->getInternalStructures(array('cultureFallback' => 
true)))) ?>
+<?php echo render_show(__('Administrative structure'), 
render_value($resource->getInternalStructures(array('cultureFallback' => 
true)))) ?>
 
-<?php echo render_show(__('Records management and collecting policies'), 
render_value($repository->getCollectingPolicies(array('cultureFallback' => 
true)))) ?>
+<?php echo render_show(__('Records management and collecting policies'), 
render_value($resource->getCollectingPolicies(array('cultureFallback' => 
true)))) ?>
 
-<?php echo render_show(__('Buildings'), 
render_value($repository->getBuildings(array('cultureFallback' => true)))) ?>
+<?php echo render_show(__('Buildings'), 
render_value($resource->getBuildings(array('cultureFallback' => true)))) ?>
 
-<?php echo render_show(__('Holdings'), 
render_value($repository->getHoldings(array('cultureFallback' => true)))) ?>
+<?php echo render_show(__('Holdings'), 
render_value($resource->getHoldings(array('cultureFallback' => true)))) ?>
 
-<?php echo render_show(__('Finding aids, guides and publications'), 
render_value($repository->getFindingAids(array('cultureFallback' => true)))) ?>
+<?php echo render_show(__('Finding aids, guides and publications'), 
render_value($resource->getFindingAids(array('cultureFallback' => true)))) ?>
 
-<?php echo render_show(__('Opening times'), 
render_value($repository->getOpeningTimes(array('cultureFallback' => true)))) ?>
+<?php echo render_show(__('Opening times'), 
render_value($resource->getOpeningTimes(array('cultureFallback' => true)))) ?>
 
-<?php echo render_show(__('Access conditions and requirements'), 
render_value($repository->getAccessConditions(array('cultureFallback' => 
true)))) ?>
+<?php echo render_show(__('Access conditions and requirements'), 
render_value($resource->getAccessConditions(array('cultureFallback' => true)))) 
?>
 
-<?php echo render_show(__('Accessibility'), 
render_value($repository->getDisabledAccess(array('cultureFallback' => true)))) 
?>
+<?php echo render_show(__('Accessibility'), 
render_value($resource->getDisabledAccess(array('cultureFallback' => true)))) ?>
 
-<?php echo render_show(__('Research services'), 
render_value($repository->getResearchServices(array('cultureFallback' => 
true)))) ?>
+<?php echo render_show(__('Research services'), 
render_value($resource->getResearchServices(array('cultureFallback' => true)))) 
?>
 
-<?php echo render_show(__('Reproduction services'), 
render_value($repository->getReproductionServices(array('cultureFallback' => 
true)))) ?>
+<?php echo render_show(__('Reproduction services'), 
render_value($resource->getReproductionServices(array('cultureFallback' => 
true)))) ?>
 
-<?php echo render_show(__('Public areas'), 
render_value($repository->getPublicFacilities(array('cultureFallback' => 
true)))) ?>
+<?php echo render_show(__('Public areas'), 
render_value($resource->getPublicFacilities(array('cultureFallback' => true)))) 
?>
 
-<?php echo render_show(__('Description identifier'), 
render_value($repository->descIdentifier)) ?>
+<?php echo render_show(__('Description identifier'), 
render_value($resource->descIdentifier)) ?>
 
-<?php echo render_show(__('Institution identifier'), 
render_value($repository->getDescInstitutionIdentifier(array('cultureFallback' 
=> true)))) ?>
+<?php echo render_show(__('Institution identifier'), 
render_value($resource->getDescInstitutionIdentifier(array('cultureFallback' => 
true)))) ?>
 
-<?php echo render_show(__('Rules and/or conventions used'), 
render_value($repository->getDescRules(array('cultureFallback' => true)))) ?>
+<?php echo render_show(__('Rules and/or conventions used'), 
render_value($resource->getDescRules(array('cultureFallback' => true)))) ?>
 
-<?php echo render_show(__('Status'), render_value($repository->descStatus)) ?>
+<?php echo render_show(__('Status'), render_value($resource->descStatus)) ?>
 
-<?php echo render_show(__('Level of detail'), 
render_value($repository->descDetail)) ?>
+<?php echo render_show(__('Level of detail'), 
render_value($resource->descDetail)) ?>
 
-<?php echo render_show(__('Dates of creation, revision and deletion'), 
render_value($repository->getDescRevisionHistory(array('cultureFallback' => 
true)))) ?>
+<?php echo render_show(__('Dates of creation, revision and deletion'), 
render_value($resource->getDescRevisionHistory(array('cultureFallback' => 
true)))) ?>
 
 <div class="field">
   <h3><?php echo __('Language(s)') ?></h3>
   <div>
     <ul>
-      <?php foreach ($repository->language as $code): ?>
+      <?php foreach ($resource->language as $code): ?>
         <li><?php echo format_language($code) ?></li>
       <?php endforeach; ?>
     </ul>
@@ -117,14 +117,14 @@
   <h3><?php echo __('Script(s)') ?></h3>
   <div>
     <ul>
-      <?php foreach ($repository->script as $code): ?>
+      <?php foreach ($resource->script as $code): ?>
         <li><?php echo format_script($code) ?></li>
       <?php endforeach; ?>
     </ul>
   </div>
 </div>
 
-<?php echo render_show(__('Sources'), 
render_value($repository->getDescSources(array('cultureFallback' => true)))) ?>
+<?php echo render_show(__('Sources'), 
render_value($resource->getDescSources(array('cultureFallback' => true)))) ?>
 
 <?php echo render_show(__('Maintenance notes'), 
render_value($maintenanceNote)) ?>
 
@@ -135,8 +135,8 @@
 
     <div class="content">
       <ul class="clearfix links">
-        <li><?php echo link_to(__('Edit'), array($repository, 'module' => 
'repository', 'action' => 'edit'), array('title' => __('Edit'))) ?></li>
-        <li><?php echo link_to(__('Delete'), array($repository, 'module' => 
'repository', 'action' => 'delete'), array('title' => __('Delete'))) ?></li>
+        <li><?php echo link_to(__('Edit'), array($resource, 'module' => 
'repository', 'action' => 'edit'), array('title' => __('Edit'))) ?></li>
+        <li><?php echo link_to(__('Delete'), array($resource, 'module' => 
'repository', 'action' => 'delete'), array('title' => __('Delete'))) ?></li>
         <li><?php echo link_to(__('Add new'), array('module' => 'repository', 
'action' => 'create'), array('title' => __('Add new'))) ?></li>
       </ul>
     </div>

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