Author: mcantelon
Date: Thu Mar 29 15:40:43 2012
New Revision: 11312
Log:
Removed inelegant way of adding events.
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:32:51
2012 (r11311)
+++ trunk/lib/task/import/csvImportTask.class.php Thu Mar 29 15:40:43
2012 (r11312)
@@ -221,14 +221,7 @@
'datesOfCreationEnd' => '|',
'nameAccessPoints' => '|',
'placeAccessPoints' => '|',
- 'subjectAccessPoints' => '|',
- 'eventActors' => '|',
- 'eventTypes' => '|',
- 'eventPlaces' => '|',
- 'eventDates' => '|',
- 'eventStartDates' => '|',
- 'eventEndDates' => '|',
- 'eventDescriptions' => '|'
+ 'subjectAccessPoints' => '|'
),
/* import logic to execute before saving information object */
@@ -545,82 +538,6 @@
}
}
- // add ad-hoc events
- if (isset($self->rowStatusVars['eventActors']))
- {
- foreach($self->rowStatusVars['eventActors'] as $index => $actor)
- {
- // initialize data that'll be used to create the event
- $eventData = array(
- 'actorName' => $actor
- );
-
- // define whether each event-related column's values go directly
- // into an event property or put into a varibale for further
- // processing
- $eventColumns = array(
- 'eventTypes' => array(
- 'variable' => 'eventType',
- 'requiredError' => 'You have populated the eventActors
column but not the eventTypes column.'
- ),
- 'eventPlaces' => array('variable' => 'place'),
- 'eventDates' => array('property' => 'date'),
- 'eventStartDates' => array('property' => 'startDate'),
- 'eventEndDates' => array('property' => 'endDate'),
- 'eventDescriptions' => array('property' => 'description')
- );
-
- // handle each of the event-related columns
- $eventType = FALSE;
- $place = FALSE;
- foreach($eventColumns as $column => $definition)
- {
- if (isset($self->rowStatusVars[$column]))
- {
- $value
- = (count($self->rowStatusVars['eventActors']) ==
count($self->rowStatusVars[$column]))
- ? $self->rowStatusVars[$column][$index]
- : $self->rowStatusVars[$column][0];
-
- // allow column value(s) to set event property
- if (isset($definition['property']))
- {
- $eventData[($definition['property'])] = $value;
- }
-
- // allow column values(s) to set variable
- if (isset($definition['variable']))
- {
- $$definition['variable'] = $value;
- }
- } else if (isset($definition['requiredError'])) {
- throw new sfException('You have populated the eventActors
column but not the eventTypes column.');
- }
- }
-
- // if an event type has been specified, attempt to create the
event
- if ($eventType)
- {
- // do lookup of type ID
- $typeTerm =
$self->createOrFetchTerm(QubitTaxonomy::EVENT_TYPE_ID, $eventType);
- $eventTypeId = $typeTerm->id;
-
- // create event
- $event = $self->createEvent($eventTypeId, $eventData);
-
- // create a place term if specified
- if ($place)
- {
- // create place
- $placeTerm = $self->createTerm(QubitTaxonomy::PLACE_ID,
$place);
- $self->createObjectTermRelation($event->id, $placeTerm->id);
- }
- } else {
- throw new sfException('eventTypes column need to be
populated.');
- }
- }
- }
-
// add creators and create events
if (isset($self->rowStatusVars['creators'])
&& count($self->rowStatusVars['creators']))
--
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.