Author: david
Date: Mon Jun 27 14:53:06 2011
New Revision: 9196

Log:
Use relation_i18n date and description columns. Refs 
http://projects.artefactual.com/issues/21

Modified:
   trunk/apps/qubit/modules/relation/actions/editComponent.class.php
   trunk/apps/qubit/modules/relation/actions/indexAction.class.php
   
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/templates/_relatedAuthorityRecord.php
   trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/templates/indexSuccess.php

Modified: trunk/apps/qubit/modules/relation/actions/editComponent.class.php
==============================================================================
--- trunk/apps/qubit/modules/relation/actions/editComponent.class.php   Mon Jun 
27 14:32:12 2011        (r9195)
+++ trunk/apps/qubit/modules/relation/actions/editComponent.class.php   Mon Jun 
27 14:53:06 2011        (r9196)
@@ -70,16 +70,6 @@
   {
     switch ($field->getName())
     {
-      case 'date':
-        $this->relation->updateNote($this->form->getValue('date'), 
QubitTerm::RELATION_NOTE_DATE_ID);
-
-        break;
-
-      case 'description':
-        $this->relation->updateNote($this->form->getValue('description'), 
QubitTerm::RELATION_NOTE_DESCRIPTION_ID);
-
-        break;
-
       case 'resource':
         unset($this->relation->object);
 

Modified: trunk/apps/qubit/modules/relation/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/relation/actions/indexAction.class.php     Mon Jun 
27 14:32:12 2011        (r9195)
+++ trunk/apps/qubit/modules/relation/actions/indexAction.class.php     Mon Jun 
27 14:53:06 2011        (r9196)
@@ -33,20 +33,10 @@
 
     $value = array();
 
-    $note = $this->resource->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_ID);
-    if (isset($note))
-    {
-      $value['date'] = $note->content;
-    }
-
+    $value['date'] = $this->resource->date;
     $value['endDate'] = Qubit::renderDate($this->resource->endDate);
     $value['startDate'] = Qubit::renderDate($this->resource->startDate);
-
-    $note = 
$this->resource->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID);
-    if (isset($note))
-    {
-      $value['description'] = $note->content;
-    }
+    $value['description'] = $this->resource->description;
 
     if (isset($this->resource->object))
     {

Modified: 
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/templates/_relatedAuthorityRecord.php
==============================================================================
--- 
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/templates/_relatedAuthorityRecord.php
     Mon Jun 27 14:32:12 2011        (r9195)
+++ 
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/templates/_relatedAuthorityRecord.php
     Mon Jun 27 14:53:06 2011        (r9196)
@@ -39,9 +39,9 @@
           </td><td>
             <?php echo $item->type ?>
           </td><td>
-            <?php echo 
Qubit::renderDateStartEnd($item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_ID),
 $item->startDate, $item->endDate) ?>
+            <?php echo Qubit::renderDateStartEnd($item->date, 
$item->startDate, $item->endDate) ?>
           </td><td>
-            <?php echo 
$item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID) ?>
+            <?php echo $item->description ?>
           </td><td style="text-align: center">
             <input class="multiDelete" name="deleteRelations[]" 
type="checkbox" value="<?php echo url_for(array($item, 'module' => 'relation')) 
?>"/>
           </td>

Modified: 
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/templates/indexSuccess.php
==============================================================================
--- 
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/templates/indexSuccess.php    
    Mon Jun 27 14:32:12 2011        (r9195)
+++ 
trunk/plugins/sfIsaarPlugin/modules/sfIsaarPlugin/templates/indexSuccess.php    
    Mon Jun 27 14:53:06 2011        (r9196)
@@ -78,9 +78,9 @@
 
       <?php echo render_show(__('Category of the relationship'), 
render_value($item->type)) ?>
 
-      <?php echo render_show(__('Dates of the relationship'), 
Qubit::renderDateStartEnd($item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DATE_ID),
 $item->startDate, $item->endDate)) ?>
+      <?php echo render_show(__('Dates of the relationship'), 
Qubit::renderDateStartEnd($item->date, $item->startDate, $item->endDate)) ?>
 
-      <?php echo render_show(__('Description of relationship'), 
render_value($item->getNoteByTypeId(QubitTerm::RELATION_NOTE_DESCRIPTION_ID))) 
?>
+      <?php echo render_show(__('Description of relationship'), 
render_value($item->description)) ?>
 
     </div>
   </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