Author: peter
Date: 2008-11-05 15:14:06 -0800 (Wed, 05 Nov 2008)
New Revision: 1523

Modified:
   trunk/qubit/apps/qubit/lib/QubitRad.class.php
   trunk/qubit/apps/qubit/modules/actor/actions/createAction.class.php
   trunk/qubit/apps/qubit/modules/actor/actions/editAction.class.php
   trunk/qubit/apps/qubit/modules/actor/actions/updateAction.class.php
   trunk/qubit/apps/qubit/modules/actor/templates/editIsaarSuccess.php
   
trunk/qubit/apps/qubit/modules/informationobject/actions/createAction.class.php
   
trunk/qubit/apps/qubit/modules/informationobject/actions/createRadAction.class.php
   trunk/qubit/apps/qubit/modules/informationobject/actions/editAction.class.php
   
trunk/qubit/apps/qubit/modules/informationobject/actions/editRadAction.class.php
   
trunk/qubit/apps/qubit/modules/informationobject/actions/updateAction.class.php
   
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
   trunk/qubit/apps/qubit/modules/repository/actions/createAction.class.php
   trunk/qubit/apps/qubit/modules/repository/actions/editAction.class.php
   trunk/qubit/apps/qubit/modules/repository/actions/updateAction.class.php
   trunk/qubit/apps/qubit/modules/repository/templates/editIsdiahSuccess.php
   trunk/qubit/lib/model/QubitTerm.php
Log:
simplify note updates to use simple options_for_select, stop using 
object_select control which forces the initialization of new objects which are 
never used. Makes it easier to implement multi-entry of notes per single request

Modified: trunk/qubit/apps/qubit/lib/QubitRad.class.php
===================================================================
--- trunk/qubit/apps/qubit/lib/QubitRad.class.php       2008-11-05 22:11:56 UTC 
(rev 1522)
+++ trunk/qubit/apps/qubit/lib/QubitRad.class.php       2008-11-05 23:14:06 UTC 
(rev 1523)
@@ -102,28 +102,4 @@
     return $countryCode.$repositoryCode.implode('-', $identifiers);
   }
 
-  public static function getTitleNoteTypes()
-    {
-      $titleNoteTypes = 
QubitTaxonomy::getTermsById(QubitTaxonomy::RAD_TITLE_NOTE_ID);
-      $radTitleNoteTypes = array();
-      foreach ($titleNoteTypes as $titleNoteType)
-      {
-        $radTitleNoteTypes[$titleNoteType->getId()] = 
$titleNoteType->getName();
-      }
-
-      return $radTitleNoteTypes;
-    }
-
-  public static function getNoteTypes()
-  {
-    $noteTypes = QubitTaxonomy::getTermsById(QubitTaxonomy::RAD_NOTE_ID);
-    $radNoteTypes = array();
-    foreach ($noteTypes as $noteType)
-    {
-      $radNoteTypes[$noteType->getId()] = $noteType->getName();
-    }
-
-    return $radNoteTypes;
-  }
-
 }
\ No newline at end of file

Modified: trunk/qubit/apps/qubit/modules/actor/actions/createAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/actions/createAction.class.php 
2008-11-05 22:11:56 UTC (rev 1522)
+++ trunk/qubit/apps/qubit/modules/actor/actions/createAction.class.php 
2008-11-05 23:14:06 UTC (rev 1523)
@@ -34,30 +34,30 @@
   public function execute($request)
   {
     $this->actor = new QubitActor;
-    
+
     //Other Forms of Name
     $this->otherNames = null;
     $this->newName = new QubitActorName;
-  
+
     //Properties
     $this->languageCodes = null;
     $this->scriptCodes = null;
-  
+
     //Notes
     $this->notes = null;
-    $this->newNote = new QubitNote;
-  
+    $this->noteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::NOTE_TYPE_ID);
+
     //Events
     $this->date = new QubitEvent;
-  
+
     $this->repositoryReroute = null;
     $this->informationObjectReroute = null;
-    
+
     // Add javascript libraries to allow multiple instance select boxes
     $this->getResponse()->addJavaScript('jquery');
     $this->getResponse()->addJavaScript('/vendor/drupal/misc/drupal');
     $this->getResponse()->addJavaScript('multiInstanceSelect');
-  
+
    // Set default template
    $this->setTemplate(sfConfig::get('app_default_template_actor_edit'));
   }

Modified: trunk/qubit/apps/qubit/modules/actor/actions/editAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/actions/editAction.class.php   
2008-11-05 22:11:56 UTC (rev 1522)
+++ trunk/qubit/apps/qubit/modules/actor/actions/editAction.class.php   
2008-11-05 23:14:06 UTC (rev 1523)
@@ -46,7 +46,7 @@
 
     //Notes
     $this->notes = $this->actor->getActorNotes();
-    $this->newNote = new QubitNote;
+    $this->noteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::NOTE_TYPE_ID);
 
     //Event
     if ($this->actor->getDatesOfExistence())
@@ -75,7 +75,7 @@
     {
       $this->informationObjectReroute = null;
     }
-    
+
     // Add javascript libraries to allow multiple instance select boxes
     $this->getResponse()->addJavaScript('jquery');
     $this->getResponse()->addJavaScript('/vendor/drupal/misc/drupal');

Modified: trunk/qubit/apps/qubit/modules/actor/actions/updateAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/actions/updateAction.class.php 
2008-11-05 22:11:56 UTC (rev 1522)
+++ trunk/qubit/apps/qubit/modules/actor/actions/updateAction.class.php 
2008-11-05 23:14:06 UTC (rev 1523)
@@ -84,12 +84,12 @@
     // update the search index and return user to the default edit template
     // in case this is a generic 'update' action that is not associated with
     // a specific template (e.g. updateISAAR)
-    // 
+    //
     // update the search index for those informationObjects that are linked to 
this Actor
     if (count($informationObjectRelations = 
$this->actor->getInformationObjectRelations()) > 0)
-    {    
+    {
       foreach ($informationObjectRelations as $event)
-      {      
+      {
         SearchIndex::updateTranslatedLanguages($event->getInformationObject());
       }
     }
@@ -128,9 +128,9 @@
 
   public function updateActorNotes($actor)
   {
-    if ($this->getRequestParameter('content'))
+    if ($this->getRequestParameter('note'))
     {
-      $actor->setActorNote($this->getUser()->getAttribute('user_id'), 
$this->getRequestParameter('content'), 
$this->getRequestParameter('note_type_id'));
+      $actor->setActorNote($this->getUser()->getAttribute('user_id'), 
$this->getRequestParameter('note'), $this->getRequestParameter('note_type_id'));
     }
   }
 
@@ -167,29 +167,33 @@
   }
 
   public function updateProperties($actor)
-  { 
+  {
     // Add multiple languages of actor description
     if ($language_codes = $this->getRequestParameter('language_code'))
     {
       // If string, turn into single element array
       $language_codes = (is_array($language_codes)) ? $language_codes : 
array($language_codes);
-      
-      foreach ($language_codes as $language_code) {
-        if (strlen($language_code)) {
+
+      foreach ($language_codes as $language_code)
+      {
+        if (strlen($language_code))
+        {
           $actor->addProperty('language_of_actor_description', $language_code, 
$scope = 'languages');
           $this->foreignKeyUpdate = true;
         }
       }
     }
-  
+
     // Add multiple scripts of actor description
     if ($script_codes = $this->getRequestParameter('script_code'))
     {
       // If string, turn into single element array
       $script_codes = (is_array($script_codes)) ? $script_codes : 
array($script_codes);
-      
-      foreach ($script_codes as $script_code) {
-        if (strlen($script_code)) {
+
+      foreach ($script_codes as $script_code)
+      {
+        if (strlen($script_code))
+        {
           $actor->addProperty($name = 'script_of_actor_description', 
$script_code, $scope = 'scripts');
           $this->foreignKeyUpdate = true;
         }
@@ -225,7 +229,7 @@
 
   public function updateDates($actor, $date)
   {
-    if (($this->getRequestParameter('start_date')) or 
($this->getRequestParameter('description')))
+    if (($this->getRequestParameter('start_date')) || 
($this->getRequestParameter('description')))
     {
       $date->setTypeId(QubitTerm::EXISTENCE_ID);
       $date->setActorId($actor->getId());

Modified: trunk/qubit/apps/qubit/modules/actor/templates/editIsaarSuccess.php
===================================================================
--- trunk/qubit/apps/qubit/modules/actor/templates/editIsaarSuccess.php 
2008-11-05 22:11:56 UTC (rev 1522)
+++ trunk/qubit/apps/qubit/modules/actor/templates/editIsaarSuccess.php 
2008-11-05 23:14:06 UTC (rev 1523)
@@ -250,8 +250,8 @@
         <?php endif; ?>
 
         <tr valign="top">
-          <td><?php echo object_textarea_tag($newNote, 'getContent', 
array('size' => '10x1')) ?></td>
-          <td><?php echo object_select_tag($newNote, 'getTypeId', array('name' 
=> 'note_type_id', 'id' => 'note_type_id', 'related_class' => 'QubitTerm', 
'include_blank' => true, 'peer_method' => 'getNoteTypes', 'style' => 'width: 
120px;')) ?></td>
+        <td><?php echo input_tag('note')?></td>
+        <td><?php echo select_tag('note_type_id', 
options_for_select($noteTypes))?></td>
         </tr>
       </table>
     </div>

Modified: 
trunk/qubit/apps/qubit/modules/informationobject/actions/createAction.class.php
===================================================================
--- 
trunk/qubit/apps/qubit/modules/informationobject/actions/createAction.class.php 
    2008-11-05 22:11:56 UTC (rev 1522)
+++ 
trunk/qubit/apps/qubit/modules/informationobject/actions/createAction.class.php 
    2008-11-05 23:14:06 UTC (rev 1523)
@@ -27,7 +27,7 @@
    $this->informationObject = new QubitInformationObject;
 
    $request->setAttribute('informationObject', $this->informationObject);
-   
+
    // Add javascript libraries to allow adding multiple instances of a select 
box
    $this->getResponse()->addJavaScript('jquery');
    $this->getResponse()->addJavaScript('/vendor/drupal/misc/drupal');
@@ -48,18 +48,16 @@
    $this->newSubjectAccessPoint = new QubitObjectTermRelation;
    $this->newPlaceAccessPoint = new QubitObjectTermRelation;
    $this->nameSelectList = QubitActor::getAccessPointSelectList();
-   
+
    // Material Type
    $this->newMaterialType = new QubitObjectTermRelation;
    $this->materialTypes = null;
 
    // Notes
    $this->notes = null;
-   $this->newNote = new QubitNote;
+   $this->noteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::NOTE_TYPE_ID);
    $this->titleNotes = null;
-   $this->newTitleNote = new QubitNote;
    $this->publicationNotes = null;
-   $this->newPublicationNote = new QubitNote;
 
    // Actor (Event) Relations
    $this->creationEvents = null;
@@ -68,10 +66,10 @@
 
    // Digital Object
    $this->digitalObject = null;
-   
+
    // Physical Object
    $this->physicalObject = null;
-   
+
    // Set default template
    
$this->setTemplate(sfConfig::get('app_default_template_informationobject_edit'));
   }

Modified: 
trunk/qubit/apps/qubit/modules/informationobject/actions/createRadAction.class.php
===================================================================
--- 
trunk/qubit/apps/qubit/modules/informationobject/actions/createRadAction.class.php
  2008-11-05 22:11:56 UTC (rev 1522)
+++ 
trunk/qubit/apps/qubit/modules/informationobject/actions/createRadAction.class.php
  2008-11-05 23:14:06 UTC (rev 1523)
@@ -38,8 +38,8 @@
     // add RAD specific commands
     $this->radNotes = null;
     $this->radTitleNotes = null;
-    $this->radTitleNoteTypes = QubitRad::getTitleNoteTypes();
-    $this->radNoteTypes = QubitRad::getNoteTypes();
+    $this->radTitleNoteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::RAD_TITLE_NOTE_ID);
+    $this->radNoteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::RAD_NOTE_ID);
 
     // overwrite the default create template
     $this->setTemplate('editRad');

Modified: 
trunk/qubit/apps/qubit/modules/informationobject/actions/editAction.class.php
===================================================================
--- 
trunk/qubit/apps/qubit/modules/informationobject/actions/editAction.class.php   
    2008-11-05 22:11:56 UTC (rev 1522)
+++ 
trunk/qubit/apps/qubit/modules/informationobject/actions/editAction.class.php   
    2008-11-05 23:14:06 UTC (rev 1523)
@@ -36,7 +36,7 @@
     $this->forward404Unless($this->informationObject);
 
     $request->setAttribute('informationObject', $this->informationObject);
-    
+
     // Add javascript libraries to allow selecting multiple access points
     $this->getResponse()->addJavaScript('jquery');
     $this->getResponse()->addJavaScript('/vendor/drupal/misc/drupal');
@@ -55,11 +55,9 @@
 
     //Notes
     $this->notes = $this->informationObject->getNotes();
-    $this->newNote = new QubitNote;
-    $this->titleNotes = $this->informationObject->getNotesByType($options = 
array ('noteTypeId' => QubitTerm::TITLE_NOTE_ID, 'dog' => 2));
-    $this->newTitleNote = new QubitNote;
+    $this->noteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::NOTE_TYPE_ID);
+    $this->titleNotes = $this->informationObject->getNotesByType($options = 
array ('noteTypeId' => QubitTerm::TITLE_NOTE_ID));
     $this->publicationNotes = 
$this->informationObject->getNotesByType($options = array ('noteTypeId' => 
QubitTerm::PUBLICATION_NOTE_ID));
-    $this->newPublicationNote = new QubitNote;
 
     //Access Points
     $this->newSubjectAccessPoint = new QubitObjectTermRelation;
@@ -76,11 +74,11 @@
         $this->nameAccessPoints[] = $event;
       }
     }
-    
+
     // Material Type
     $this->newMaterialType = new QubitObjectTermRelation;
     $this->materialTypes = $this->informationObject->getMaterialTypes();
-    
+
     // Count related digital objects for warning message when deleting info 
object
     // Note: This should only be 0 or 1 digital objects.
     $this->digitalObjectCount = 0;

Modified: 
trunk/qubit/apps/qubit/modules/informationobject/actions/editRadAction.class.php
===================================================================
--- 
trunk/qubit/apps/qubit/modules/informationobject/actions/editRadAction.class.php
    2008-11-05 22:11:56 UTC (rev 1522)
+++ 
trunk/qubit/apps/qubit/modules/informationobject/actions/editRadAction.class.php
    2008-11-05 23:14:06 UTC (rev 1523)
@@ -38,10 +38,9 @@
     // add RAD specific commands
     $this->radNotes = $this->informationObject->getNotesByTaxonomy($options = 
array('taxonomyId' => QubitTaxonomy::RAD_NOTE_ID));
     $this->radTitleNotes = 
$this->informationObject->getNotesByTaxonomy($options = array('taxonomyId' => 
QubitTaxonomy::RAD_TITLE_NOTE_ID));
+    $this->radTitleNoteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::RAD_TITLE_NOTE_ID);
+    $this->radNoteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::RAD_NOTE_ID);
 
-    $this->radTitleNoteTypes = QubitRad::getTitleNoteTypes();
-    $this->radNoteTypes = QubitRad::getNoteTypes();
-
    // overwrite the default edit template
    $this->setTemplate('editRad');
   }

Modified: 
trunk/qubit/apps/qubit/modules/informationobject/actions/updateAction.class.php
===================================================================
--- 
trunk/qubit/apps/qubit/modules/informationobject/actions/updateAction.class.php 
    2008-11-05 22:11:56 UTC (rev 1522)
+++ 
trunk/qubit/apps/qubit/modules/informationobject/actions/updateAction.class.php 
    2008-11-05 23:14:06 UTC (rev 1523)
@@ -267,9 +267,9 @@
       $informationObject->setNote($options = array('userId' => 
$this->getUser()->getAttribute('user_id'), 'note' => 
$this->getRequestParameter('new_publication_note'), 'noteTypeId' => 
QubitTerm::PUBLICATION_NOTE_ID));
     }
 
-    if ($this->getRequestParameter('content'))
+    if ($this->getRequestParameter('note'))
     {
-      $informationObject->setNote($options = array('userId' => 
$this->getUser()->getAttribute('user_id'), 'note' => 
$this->getRequestParameter('content'), 'noteTypeId' => 
$this->getRequestParameter('note_type_id')));
+      $informationObject->setNote($options = array('userId' => 
$this->getUser()->getAttribute('user_id'), 'note' => 
$this->getRequestParameter('note'), 'noteTypeId' => 
$this->getRequestParameter('note_type_id')));
     }
   }
 

Modified: 
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php
===================================================================
--- 
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php  
    2008-11-05 22:11:56 UTC (rev 1522)
+++ 
trunk/qubit/apps/qubit/modules/informationobject/templates/editIsadSuccess.php  
    2008-11-05 23:14:06 UTC (rev 1523)
@@ -330,8 +330,8 @@
           <?php endforeach; ?>
         <?php endif; ?>
         <tr valign="top">
-          <td><?php echo object_textarea_tag($newNote, 'getContent', 
array('size' => '10x1', 'class'=>'multiInstance')) ?></td>
-          <td><?php echo object_select_tag($newNote, 'getTypeId', array('name' 
=> 'note_type_id', 'id' => 'note_type_id', 'related_class' => 'QubitTerm', 
'include_blank' => true, 'peer_method' => 'getNoteTypes', 'style' => 'width: 
120px;')) ?></td>
+          <td><?php echo input_tag('note')?></td>
+          <td><?php echo select_tag('note_type_id', 
options_for_select($noteTypes))?></td>
         </tr>
       </table>
     </div>

Modified: 
trunk/qubit/apps/qubit/modules/repository/actions/createAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/repository/actions/createAction.class.php    
2008-11-05 22:11:56 UTC (rev 1522)
+++ trunk/qubit/apps/qubit/modules/repository/actions/createAction.class.php    
2008-11-05 23:14:06 UTC (rev 1523)
@@ -53,8 +53,8 @@
 
     // Notes
     $this->notes = null;
-    $this->newNote = new QubitNote;
-    
+    $this->noteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::NOTE_TYPE_ID);
+
     // Add javascript libraries to allow multiple instance select boxes
     $this->getResponse()->addJavaScript('jquery');
     $this->getResponse()->addJavaScript('/vendor/drupal/misc/drupal');

Modified: trunk/qubit/apps/qubit/modules/repository/actions/editAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/repository/actions/editAction.class.php      
2008-11-05 22:11:56 UTC (rev 1522)
+++ trunk/qubit/apps/qubit/modules/repository/actions/editAction.class.php      
2008-11-05 23:14:06 UTC (rev 1523)
@@ -55,8 +55,8 @@
 
     //Notes
     $this->notes = $this->repository->getRepositoryNotes();
-    $this->newNote = new QubitNote;
-    
+    $this->noteTypes = 
QubitTerm::getOptionsForSelectList(QubitTaxonomy::NOTE_TYPE_ID);
+
     // Add javascript libraries to allow multiple instance select boxes
     $this->getResponse()->addJavaScript('jquery');
     $this->getResponse()->addJavaScript('/vendor/drupal/misc/drupal');

Modified: 
trunk/qubit/apps/qubit/modules/repository/actions/updateAction.class.php
===================================================================
--- trunk/qubit/apps/qubit/modules/repository/actions/updateAction.class.php    
2008-11-05 22:11:56 UTC (rev 1522)
+++ trunk/qubit/apps/qubit/modules/repository/actions/updateAction.class.php    
2008-11-05 23:14:06 UTC (rev 1523)
@@ -61,12 +61,12 @@
       // update the search index and return user to the default edit template
       // in case this is a generic 'update' action that is not associated with
       // a specific template (e.g. updateISDIAH)
-      // 
+      //
       // update the search index for those informationObjects that are linked 
to this Repository
       if (count($holdings = $this->repository->getRepositoryHoldings()) > 0)
-      {    
+      {
         foreach ($holdings as $informationObject)
-        {      
+        {
           SearchIndex::updateTranslatedLanguages($informationObject);
         }
       }
@@ -147,9 +147,11 @@
     {
       // If string, turn into single element array
       $language_codes = (is_array($language_codes)) ? $language_codes : 
array($language_codes);
-      
-      foreach ($language_codes as $language_code) {
-        if (strlen($language_code)) {
+
+      foreach ($language_codes as $language_code)
+      {
+        if (strlen($language_code))
+        {
           $repository->addProperty('language_of_repository_description', 
$language_code, $scope = 'languages');
           $this->foreignKeyUpdate = true;
         }
@@ -161,9 +163,11 @@
     {
       // If string, turn into single element array
       $script_codes = (is_array($script_codes)) ? $script_codes : 
array($script_codes);
-      
-      foreach ($script_codes as $script_code) {
-        if (strlen($script_code)) {
+
+      foreach ($script_codes as $script_code)
+      {
+        if (strlen($script_code))
+        {
           $repository->addProperty('script_of_repository_description', 
$script_code, $scope = 'scripts');
           $this->foreignKeyUpdate = true;
         }
@@ -183,16 +187,16 @@
   {
     if ($repository->getId())
     {
-      if (($this->getRequestParameter('contact_type')) or
-      ($this->getRequestParameter('contact_person')) or
-      ($this->getRequestParameter('street_address')) or
-      ($this->getRequestParameter('city')) or
-      ($this->getRequestParameter('region')) or
-      ($this->getRequestParameter('country_code')) or
-      ($this->getRequestParameter('postal_code')) or
-      ($this->getRequestParameter('telephone')) or
-      ($this->getRequestParameter('fax')) or
-      ($this->getRequestParameter('email')) or
+      if (($this->getRequestParameter('contact_type')) ||
+      ($this->getRequestParameter('contact_person')) ||
+      ($this->getRequestParameter('street_address')) ||
+      ($this->getRequestParameter('city')) ||
+      ($this->getRequestParameter('region')) ||
+      ($this->getRequestParameter('country_code')) ||
+      ($this->getRequestParameter('postal_code')) ||
+      ($this->getRequestParameter('telephone')) ||
+      ($this->getRequestParameter('fax')) ||
+      ($this->getRequestParameter('email')) ||
       ($this->getRequestParameter('website')))
       {
         $contactInformation = new QubitContactInformation;
@@ -223,9 +227,9 @@
 
   public function updateRepositoryNotes($repository)
   {
-    if ($this->getRequestParameter('content'))
+    if ($this->getRequestParameter('note'))
     {
-      
$repository->setRepositoryNote($this->getUser()->getAttribute('user_id'), 
$this->getRequestParameter('content'), 
$this->getRequestParameter('note_type_id'));
+      
$repository->setRepositoryNote($this->getUser()->getAttribute('user_id'), 
$this->getRequestParameter('note'), $this->getRequestParameter('note_type_id'));
     }
   }
 }

Modified: 
trunk/qubit/apps/qubit/modules/repository/templates/editIsdiahSuccess.php
===================================================================
--- trunk/qubit/apps/qubit/modules/repository/templates/editIsdiahSuccess.php   
2008-11-05 22:11:56 UTC (rev 1522)
+++ trunk/qubit/apps/qubit/modules/repository/templates/editIsdiahSuccess.php   
2008-11-05 23:14:06 UTC (rev 1523)
@@ -383,8 +383,8 @@
         <?php endif; ?>
 
         <tr valign="top">
-          <td><?php echo object_textarea_tag($newNote, 'getContent', 
array('size' => '10x1')) ?></td>
-          <td><?php echo object_select_tag($newNote, 'getTypeId', array('name' 
=> 'note_type_id', 'id' => 'note_type_id', 'related_class' => 'QubitTerm', 
'include_blank' => true, 'peer_method' => 'getNoteTypes', 'style' => 'width: 
120px;')) ?></td>
+        <td><?php echo input_tag('note')?></td>
+        <td><?php echo select_tag('note_type_id', 
options_for_select($noteTypes))?></td>
         </tr>
       </table>
     </div>

Modified: trunk/qubit/lib/model/QubitTerm.php
===================================================================
--- trunk/qubit/lib/model/QubitTerm.php 2008-11-05 22:11:56 UTC (rev 1522)
+++ trunk/qubit/lib/model/QubitTerm.php 2008-11-05 23:14:06 UTC (rev 1523)
@@ -406,6 +406,23 @@
 
     return $rs->getInt(1);
   }
+
+  /** Get a basic key['id']/value['name'] array for use as options in form 
select lists
+   *
+   */
+
+  public static function getOptionsForSelectList($taxonomyId)
+  {
+    $terms = QubitTaxonomy::getTermsById($taxonomyId);
+    $selectList = array();
+    foreach ($terms as $term)
+    {
+      $selectList[$term->getId()] = $term->getName();
+    }
+
+    return $selectList;
+  }
+
 }
 
 


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