Author: mcantelon
Date: Thu Mar 29 15:32:51 2012
New Revision: 11311

Log:
Removed some no longer needed logic.

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

Modified: trunk/lib/task/import/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/import/csvImportTask.class.php       Thu Mar 29 15:26:24 
2012        (r11310)
+++ trunk/lib/task/import/csvImportTask.class.php       Thu Mar 29 15:32:51 
2012        (r11311)
@@ -662,30 +662,6 @@
                );
             }
           }
-
-          // if a role is found, create term and actor if need be
-          if (isset($self->rowStatusVars['actorRoles']))
-          {
-            foreach($self->rowStatusVars['actorRoles'] as $actorRole)
-            {
-              // create/fetch term
-              $term = $self->createOrFetchTerm(
-                QubitTaxonomy::EVENT_TYPE_ID,
-                $actorRole['role']
-              );
-
-              // allow for multiple people in same role
-              $actors = explode('|', $actorRole['actor']);
-
-              foreach($actors as $actor)
-              {
-                // create/fetch actor
-                $self->createOrFetchActor($actor);
-
-                $self->createEvent($term->id, array('actorName' => $actor));
-              }
-            }
-          }
         }
       }
     ));
@@ -703,57 +679,13 @@
       $self->object->setLevelOfDescriptionByName($data);
     });
 
-    /* create function to deal with columns whose names begin with
-       "relatedActor", parsing out name of role from column name */
-    $relatedActorHandler = function(&$self, $data)
-    {
-      if ($data)
-      {
-        // parse out actor role from column name
-        $pattern = '/^relatedActor(.*)By$|^relatedActor(.*)$/';
-        preg_match($pattern, $self->status['currentColumn'], $matches);
-        $termName = (isset($matches[1]) && $matches[1] != '') ? $matches[1] : 
'';
-        $termName = (isset($matches[2]) && $matches[2] != '') ? $matches[2] : 
$termName;
-
-        // note that role and actor should be created after saving info object
-        $self->rowStatusVars['actorRoles'] = 
(isset($self->rowStatusVars['actorRoles']))
-          ? $self->rowStatusVars['actorRoles']
-          : array();
-
-        $actors = explode('|', $data);
-
-        foreach($actors as $actor)
-        {
-          array_push(
-            $self->rowStatusVars['actorRoles'],
-            array('role' => $termName, 'actor' => $actor)
-          );
-        }
-      }
-    };
-
-    $import->addColumnHandler('relatedActorCommissionedBy', 
$relatedActorHandler);
-    $import->addColumnHandler('relatedActorPhotographer', 
$relatedActorHandler);
-
     // map value to taxonomy term name and take note of taxonomy term's ID
     $import->addColumnHandler('radGeneralMaterialDesignation', 
function(&$self, $data)
     {
       if ($data)
       {
-        $cvaToQubit = array(
-          'Text'              => 'Textual record',
-          'Photograph'        => 'Graphic material',
-          'OtherGraphical'    => 'Graphic material',
-          'ArchitecturalPlan' => 'Architectural drawing',
-          'Audio'             => 'Sound recording',
-          'MovingImage'       => 'Moving images',
-          'Map'               => 'Cartographic material'
-        );
-
-        $self->rowStatusVars['radGeneralMaterialDesignation'] = 
$self->translateNameToTermId(
-          'material types',
+        $self->rowStatusVars['radGeneralMaterialDesignation'] = array_search(
           $data,
-          $cvaToQubit,
           $self->getStatus('materialTypes')
         );
       }

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