Author: mcantelon
Date: Fri Jan  6 14:12:12 2012
New Revision: 10590

Log:
Minor code cleanup.

Modified:
   trunk/lib/task/csvImportTask.class.php

Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php      Fri Jan  6 14:03:59 2012        
(r10589)
+++ trunk/lib/task/csvImportTask.class.php      Fri Jan  6 14:12:12 2012        
(r10590)
@@ -92,6 +92,12 @@
     );
     $defaultStatusTypeId = QubitTerm::STATUS_TYPE_PUBLICATION_ID;
 
+    // create note term if it doesn't yet exist
+    QubitFlatfileImport::createOrFetchTerm(
+      QubitTaxonomy::NOTE_TYPE_ID,
+      'Language note'
+    );
+
     // Load taxonomies into variables to avoid use of magic numbers
     $termData = $this->loadTaxonomyTerms(array(
       QubitTaxonomy::NOTE_TYPE_ID      => 'noteTypes',
@@ -99,9 +105,6 @@
       QubitTaxonomy::MATERIAL_TYPE_ID  => 'materialTypes'
     ));
 
-    // fetch/create note term so we can add notes
-    $languageNoteTerm = QubitFlatfileImport::createOrFetchTerm(37, 'Language 
note');
-
     // Define import
     $import = new QubitFlatfileImport(array(
       /* the status array is a place to put data that should be accessible
@@ -172,7 +175,7 @@
       /* import columns that can be added as QubitNote objects */
       'noteMap' => array(
         'languages' => array(
-          'typeId' => $languageNoteTerm->id
+          'typeId' => array_search('Language note', $termData['noteTypes'])
         ),
         'radNoteConservation' => array(
           'typeId' => array_search('Conservation note', $termData['noteTypes'])

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