Author: mcantelon
Date: Wed Jan  4 13:19:02 2012
New Revision: 10554

Log:
Got rights creation working to a limited degree.

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

Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php      Wed Jan  4 00:03:01 2012        
(r10553)
+++ trunk/lib/task/csvImportTask.class.php      Wed Jan  4 13:19:02 2012        
(r10554)
@@ -254,29 +254,13 @@
             // add allow record specifiying "Public Domain" for 
COPYRIGHT_STATUS
             //
           } else {
-print 'Creating right for '. $self->informationObject->title ."\n";
-            // add "Disallow" record for act "Replicate" specifiy 
COPYRIGHT_STATUS for "Rights Holder" (createActor)
-
+            // add rightsholder
             $actor = new QubitRightsHolder;
             $actor->parentId = QubitActor::ROOT_ID;
             $actor->authorizedFormOfName = $statusOrRightsholder;
             $actor->save();
 
-            /*
-            $actor = $self->createOrFetchActor($statusOrRightsholder);
-
-            $query = "SELECT id FROM rights_holder WHERE id=?";
-            $statement = $self->sqlQuery($query, array($actor->id));
-
-print 'Q:'. $query ." | ". $actor->id ."\n";
-            if (!($term = $statement->fetch(PDO::FETCH_OBJ)))
-            {
-              $rightsHolder = new QubitRightsHolder;
-              $rightsHolder->id = $actor->id;
-              $rightsHolder->save();
-            }
-            */
-
+            // add "Disallow" record for act "Replicate"
             $right = new QubitRights;
             $right->restriction = 1;
             $right->rightsHolderId = $actor->id;
@@ -285,6 +269,7 @@
             $right->copyrightStatusId = 306;
             $right->save();
 
+            // add relation
             $relation = new QubitRelation;
             $relation->subjectId = $self->informationObject->id;
             $relation->objectId = $right->id;
@@ -387,7 +372,9 @@
 
     $import->addColumnHandler('COPYRIGHT_STATUS', function(&$self, $data)
     {
-      $self->rowStatusVars['copyrightStatusOrRightsholder'] = $data;
+      if (trim($data)) {
+        $self->rowStatusVars['copyrightStatusOrRightsholder'] = $data;
+      }
     });
 
     $import->addColumnHandler('COPYRIGHT_EXPIRES', function(&$self, $data)
@@ -424,8 +411,9 @@
       if ($data)
       {
         $cvaToQubit = array(
-          'Text'  => 'Textual record',
-          'Photo' => 'Graphic material'
+          'Text'              => 'Textual record',
+          'Photograph'        => 'Graphic material',
+          'ArchitecturalPlan' => 'Architectural drawing'
         );
 
         if (isset($cvaToQubit[$data]))

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