Author: mcantelon
Date: Wed Jan  4 17:29:32 2012
New Revision: 10567

Log:
Refactored out a couple of redundant column handlers.

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

Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php      Wed Jan  4 17:25:57 2012        
(r10566)
+++ trunk/lib/task/csvImportTask.class.php      Wed Jan  4 17:29:32 2012        
(r10567)
@@ -178,7 +178,9 @@
         'copyrightStatus',
         'copyrightExpires',
         'copyrightHolder',
-        'datesOfCreationNote'
+        'datesOfCreationNote',
+        'datesOfCreationStart',
+        'datesOfCreationEnd'
       ),
       'rowInit' => function(&$self)
       {
@@ -307,19 +309,19 @@
           {
             // add create event if specified
             if (
-              isset($self->rowStatusVars['startYear'])
+              isset($self->rowStatusVars['datesOfCreationStart'])
               || (
-                isset($self->rowStatusVars['startYear'])
-                && isset($self->rowStatusVars['endYear'])
+                isset($self->rowStatusVars['datesOfCreationStart'])
+                && isset($self->rowStatusVars['datesOfCreationEnd'])
               )
             )
             {
-              $endDate = (isset($self->rowStatusVars['endYear']))
-                ? $self->rowStatusVars['endYear'] .'-00-00'
+              $endDate = (isset($self->rowStatusVars['datesOfCreationEnd']))
+                ? $self->rowStatusVars['datesOfCreationEnd'] .'-00-00'
                 : false;
 
               $eventData = array(
-                'startDate' => $self->rowStatusVars['startYear'] .'-00-00',
+                'startDate' => $self->rowStatusVars['datesOfCreationStart'] 
.'-00-00',
                 'endDate' => $endDate,
                 'actorName' => $creator
               );
@@ -402,16 +404,6 @@
       }
     });
 
-    $import->addColumnHandler('datesOfCreationStart', function(&$self, $data)
-    {
-      $self->rowStatusVars['startYear'] = $data;
-    });
-
-    $import->addColumnHandler('datesOfCreationEnd', function(&$self, $data)
-    {
-      $self->rowStatusVars['endYear'] = $data;
-    });
-
     $import->addColumnHandler('subjectAccessPoints', function(&$self, $data)
     {
       if ($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