Author: david
Date: Thu Oct  8 15:35:59 2009
New Revision: 3701

Log:
Switch ISAD show & edit pages to name access points based on QubitRelation.

Modified:
   trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
   trunk/apps/qubit/modules/informationobject/actions/showAction.class.php
   trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
   trunk/apps/qubit/modules/informationobject/templates/showIsadSuccess.php

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Thu Oct  8 15:19:14 2009        (r3700)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Thu Oct  8 15:35:59 2009        (r3701)
@@ -389,14 +389,17 @@
     $this->newSubjectAccessPoint = new QubitObjectTermRelation;
     $this->newPlaceAccessPoint = new QubitObjectTermRelation;
     $this->placeAccessPoints = 
$this->informationObject->getPlaceAccessPoints();
+
+    //$events = $this->informationObject->getEvents();
+
+    // Name access points
     $this->nameSelectList = QubitActor::getAccessPointSelectList();
     $this->nameAccessPoints = array();
-    $events = $this->informationObject->getEvents();
-    foreach ($events as $event)
+    foreach ($this->informationObject->relationsRelatedBysubjectId as 
$relation)
     {
-      if ($event->getActorId())
+      if (QubitTerm::NAME_ACCESS_POINT_ID == $relation->typeId)
       {
-        $this->nameAccessPoints[] = $event;
+        $this->nameAccessPoints[] = $relation;
       }
     }
 
@@ -467,7 +470,11 @@
       {
         if (intval($name_id))
         {
-          $this->informationObject->addNameAccessPoint($name_id, 
QubitTerm::SUBJECT_ID);
+          $relation = new QubitRelation;
+          $relation->typeId = QubitTerm::NAME_ACCESS_POINT_ID;
+          $relation->objectId = $name_id;
+
+          $this->informationObject->relationsRelatedBysubjectId[] = $relation;
         }
       }
     }

Modified: 
trunk/apps/qubit/modules/informationobject/actions/showAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/showAction.class.php     
Thu Oct  8 15:19:14 2009        (r3700)
+++ trunk/apps/qubit/modules/informationobject/actions/showAction.class.php     
Thu Oct  8 15:35:59 2009        (r3701)
@@ -50,11 +50,11 @@
 
     // Access points
     $this->nameAccessPoints = array();
-    foreach ($this->informationObject->getActorEvents() as $event)
+    foreach ($this->informationObject->relationsRelatedBysubjectId as 
$relation)
     {
-      if ($event->getActorId())
+      if (QubitTerm::NAME_ACCESS_POINT_ID == $relation->typeId)
       {
-        $this->nameAccessPoints[] = $event;
+        $this->nameAccessPoints[] = $relation;
       }
     }
 

Modified: 
trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php    
Thu Oct  8 15:19:14 2009        (r3700)
+++ trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php    
Thu Oct  8 15:35:59 2009        (r3701)
@@ -225,33 +225,15 @@
     </div>
 
     <div class="form-item" id="nameAccessPoints">
-      <table class="inline">
-        <tr>
-          <th style="width: 60%;"><?php echo __('name access points') ?></th>
-          <th style="width: 30%;"><?php echo __('role') ?></th>
-          <th style="width: 10%; text-align: right;"><?php echo 
image_tag('delete', array('align' => 'top', 'class' => 'deleteIcon')) ?></th>
-        </tr>
+      <label><?php echo __('name access points') ?></label>
       <?php if ($nameAccessPoints): ?>
-        <?php foreach ($nameAccessPoints as $name): ?>
-        <tr class="<?php echo 'related_obj_'.$name->getId() ?>">
-          <td><div class="animateNicely"><?php echo 
render_title($name->getActor()); ?></div></td>
-          <td><div class="animateNicely"><?php echo 
$name->getType()->getRole() ?></div></td>
-          <td style="text-align: right"><div class="animateNicely">
-            <?php if ($name->getTypeId() == QubitTerm::SUBJECT_ID): ?>
-              <input type="checkbox" name="delete_actor_events[<?php echo 
$name->getId() ?>]" value="delete" class="multiDelete" />
-            <?php else: ?>
-              &nbsp;
-            <?php endif; ?>
-          </div></td>
-        </tr>
-        <?php endforeach; ?>
+      <ul>
+      <?php foreach ($nameAccessPoints as $relation): ?>
+        <li><?php echo render_title($relation->object); ?></li>
+      <?php endforeach; ?>
+      </ul>
       <?php endif; ?>
-        <tr>
-          <td colspan="3">
-            <?php echo select_tag('name_id', 
options_for_select($nameSelectList, null, array('include_blank' => true)), 
array('class'=>'multiInstance')) ?>
-          </td>
-        </tr>
-      </table>
+      <?php echo select_tag('name_id', options_for_select($nameSelectList, 
null, array('include_blank' => true)), array('class'=>'multiInstance')) ?>
     </div>
   </fieldset>
 

Modified: 
trunk/apps/qubit/modules/informationobject/templates/showIsadSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/showIsadSuccess.php    
Thu Oct  8 15:19:14 2009        (r3700)
+++ trunk/apps/qubit/modules/informationobject/templates/showIsadSuccess.php    
Thu Oct  8 15:35:59 2009        (r3701)
@@ -358,8 +358,8 @@
       <?php echo __('name access points') ?>
     </th><td>
       <ul>
-        <?php foreach ($nameAccessPoints as $name): ?>
-          <li><?php echo link_to(render_title($name->actor), array('module' => 
'actor', 'action' => 'show', 'id' => $name->actor->id)) ?><?php if($role = 
$name->getType()->getRole()): ?><span class="note2"> (<?php echo $role 
?>)</span><?php endif; ?></li>
+        <?php foreach ($nameAccessPoints as $relation): ?>
+          <li><?php echo link_to(render_title($relation->object), 
array('module' => 'actor', 'action' => 'show', 'id' => $relation->object->id)) 
?></li>
         <?php endforeach; ?>
       </ul>
     </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.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to