Author: peter
Date: Wed Sep 23 17:19:52 2009
New Revision: 3486

Log:
limit ISAD date type options to just 'creation' and 'accumulation'. Fixes issue 
#918

Modified:
   trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
   trunk/lib/model/QubitTerm.php

Modified: 
trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php    
Wed Sep 23 17:05:30 2009        (r3485)
+++ trunk/apps/qubit/modules/informationobject/templates/editIsadSuccess.php    
Wed Sep 23 17:19:52 2009        (r3486)
@@ -53,7 +53,7 @@
             <?php echo object_select_tag($eventDate, 'getTypeId', array(
               'name' => 'updateEvents['.$i.'][typeId]',
               'related_class' => 'QubitTerm',
-              'peer_method' => 'getEventTypes')) ?>
+              'peer_method' => 'getIsadEventTypes')) ?>
           </div></td>
           <td><div class="animateNicely">
             <?php echo input_tag('updateEvents['.$i.'][startDate]', 
collapse_date($eventDate->getStartDate())) ?>
@@ -73,8 +73,8 @@
         <?php endif; ?>
         <tr>
           <td><div class="animateNicely">
-            <?php echo select_tag('updateEvents[new][typeId]',
-              objects_for_select(QubitTerm::getEventTypes(), 'getId', 
'__toString', QubitTerm::CREATION_ID)) ?>
+            <?php echo select_tag('updateEvents[new][typeId]', 
options_for_select($isadEventTypes, QubitTerm::CREATION_ID)) ?>
+
           </div></td>
           <td><?php echo input_tag('updateEvents[new][startDate]') ?></td>
           <td><?php echo input_tag('updateEvents[new][endDate]') ?></td>

Modified: trunk/lib/model/QubitTerm.php
==============================================================================
--- trunk/lib/model/QubitTerm.php       Wed Sep 23 17:05:30 2009        (r3485)
+++ trunk/lib/model/QubitTerm.php       Wed Sep 23 17:19:52 2009        (r3486)
@@ -767,6 +767,8 @@
     $selectList = array();
     $term = QubitTerm::getById(QubitTerm::CREATION_ID);
     $selectList[$term->getId()] = 
$term->getName(array('cultureFallback'=>true));
+    $term = QubitTerm::getById(QubitTerm::ACCUMULATION_ID);
+    $selectList[$term->getId()] = 
$term->getName(array('cultureFallback'=>true));
 
     if (isset($options['include_custom']))
     {
@@ -782,6 +784,22 @@
     return $selectList;
   }
 
+   /**
+   * Return the Term Objects that represent
+   * ISAD(G) events/dates
+   *
+   */
+  public static function getIsadEventTypes($options = array())
+  {
+    $list = array();
+    $term = self::getById(QubitTerm::CREATION_ID);
+    $list[] = $term;
+    $term = self::getById(QubitTerm::ACCUMULATION_ID);
+    $list[] = $term;
+
+    return $list;
+  }
+
   /**
    * Add search criteria for find records updated in last $numberOfDays
    *

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