Author: mcantelon
Date: Tue Jan  3 11:55:18 2012
New Revision: 10537

Log:
Added support for 'friendly' description of dates.

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

Modified: trunk/lib/QubitFlatfileImport.class.php
==============================================================================
--- trunk/lib/QubitFlatfileImport.class.php     Tue Jan  3 11:52:03 2012        
(r10536)
+++ trunk/lib/QubitFlatfileImport.class.php     Tue Jan  3 11:55:18 2012        
(r10537)
@@ -259,6 +259,11 @@
     $event->informationObjectId = $this->informationObject->id;
     $event->typeId = $typeId;
 
+    if (isset($options['date']))
+    {
+      $event->date = $options['date'];
+    }
+
     if (isset($options['actorName']))
     {
       $history = isset($options['actorHistory']) ? $options['actorHistory'] : 
false;

Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php      Tue Jan  3 11:52:03 2012        
(r10536)
+++ trunk/lib/task/csvImportTask.class.php      Tue Jan  3 11:55:18 2012        
(r10537)
@@ -199,15 +199,17 @@
           }
         }
 
-        // add name access points
-        foreach($self->rowStatusVars['nameAccessPoints'] as $name) {
-          $actor = $self->createOrFetchActor($name);
-          $relation = new QubitRelation;
-          $relation->subjectId = $self->informationObject->id;
-          $relation->objectId = $actor->id;
-          $relation->typeId = QubitTerm::NAME_ACCESS_POINT_ID;
-          $relation->save();
+        if (isset($self->rowStatusVars['nameAccessPoints'])) {
+          // add name access points
+          foreach($self->rowStatusVars['nameAccessPoints'] as $name) {
+            $actor = $self->createOrFetchActor($name);
+            $relation = new QubitRelation;
+            $relation->subjectId = $self->informationObject->id;
+            $relation->objectId = $actor->id;
+            $relation->typeId = QubitTerm::NAME_ACCESS_POINT_ID;
+            $relation->save();
 # "relation" table (relation.subject_id = information_object.id, 
relation.object_id = actor.id). 
+          }
         }
 
         // add accessions
@@ -259,6 +261,11 @@
                 }
               }
 
+              if(isset($self->rowStatusVars['datesOfCreation']))
+              {
+                $eventData['date'] = $self->rowStatusVars['datesOfCreation'];
+              }
+
               $event = $self->createEvent(
                 QubitTerm::CREATION_ID,
                 $eventData

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