Author: mcantelon
Date: Wed Apr 4 15:52:27 2012
New Revision: 11375
Log:
Removed rights import logic as we should do it with a separate tool to do it
properly.
Modified:
trunk/lib/task/import/csvImportTask.class.php
Modified: trunk/lib/task/import/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/import/csvImportTask.class.php Wed Apr 4 15:35:11
2012 (r11374)
+++ trunk/lib/task/import/csvImportTask.class.php Wed Apr 4 15:52:27
2012 (r11375)
@@ -93,7 +93,6 @@
QubitTaxonomy::RAD_NOTE_ID => 'radNoteTypes',
QubitTaxonomy::RAD_TITLE_NOTE_ID => 'titleNoteTypes',
QubitTaxonomy::MATERIAL_TYPE_ID => 'materialTypes',
- QubitTaxonomy::COPYRIGHT_STATUS_ID => 'copyrightStatusTypes',
QubitTaxonomy::RIGHT_ACT_ID => 'copyrightActTypes',
QubitTaxonomy::PHYSICAL_OBJECT_TYPE_ID => 'physicalObjectTypes'
));
@@ -119,8 +118,6 @@
'pubStatusTypes' => $termData['pubStatusTypes'],
'levelOfDetailTypes' => $termData['levelOfDetailTypes'],
'materialTypes' => $termData['materialTypes'],
- 'copyrightStatusTypes' => $termData['copyrightStatusTypes'],
- 'copyrightActTypes' => $termData['copyrightActTypes'],
'physicalObjectTypes' => $termData['physicalObjectTypes']
),
@@ -255,9 +252,6 @@
'repository',
'language',
'script',
- 'copyrightStatus',
- 'copyrightExpires',
- 'copyrightHolder',
'physicalObjectName',
'physicalObjectLocation',
'physicalObjectType',
@@ -507,131 +501,6 @@
);
}
- // add copyright info
- // TODO: handle this via a separate import
- if (isset($self->rowStatusVars['copyrightStatus']) &&
$self->rowStatusVars['copyrightStatus'])
- {
- switch (strtolower($self->rowStatusVars['copyrightStatus']))
- {
- case 'under copyright':
- print "Adding rights for ". $self->object->title ."...\n";
- $rightsHolderId = FALSE;
- $rightsHolderNames = explode('|',
$self->rowStatusVars['copyrightHolder']);
-
- if ($self->rowStatusVars['copyrightExpires'])
- {
- $endDates = explode('|',
$self->rowStatusVars['copyrightExpires']);
- }
-
- foreach($rightsHolderNames as $index => $rightsHolderName)
- {
- $rightsHolderName = ($rightsHolderName) ? $rightsHolderName
: 'Unknown';
- $rightsHolder =
$self->createOrFetchRightsHolder($rightsHolderName);
- $rightsHolderId = $rightsHolder->id;
-
- $rightsHolderName = trim(strtolower($rightsHolderName));
- if (
- $rightsHolderName == 'city of vancouver'
- || strpos($rightsHolderName, 'city of vancouver') === 0
- )
- {
- $restriction = 1;
- } else {
- $restriction = 0;
- }
-
- $rightAndRelation = array(
- 'restriction' => $restriction,
- 'basisId' => QubitTerm::RIGHT_BASIS_COPYRIGHT_ID,
- 'actId' => array_search(
- 'Replicate',
- $self->getStatus('copyrightActTypes')
- ),
- 'copyrightStatusId' => array_search(
- 'Under copyright',
- $self->getStatus('copyrightStatusTypes')
- )
- );
-
- if (isset($endDates))
- {
- // if rightsholder/expiry dates and paired, use
- // corresponding date ...otherwise just use the
- // first expiry date
- $rightAndRelation['endDate']
- = (count($endDates) == count($rightsHolderNames))
- ? $endDates[$index]
- : $endDates[0];
-
- if (!is_numeric($rightAndRelation['endDate']))
- {
- throw new sfException('Copyright expiry '.
$rightAndRelation['endDate']
- .' is invalid.');
- }
- }
-
- if ($rightsHolderId) $rightAndRelation['rightsHolderId'] =
$rightsHolderId;
- $self->createRightAndRelation($rightAndRelation);
- }
- break;
-
- case 'unknown':
- $rightsHolder = $self->createOrFetchRightsHolder('Unknown');
- $rightsHolderId = $rightsHolder->id;
-
- $rightAndRelation = array(
- 'rightsHolderId' => $rightsHolderId,
- 'restriction' => 0,
- 'basisId' => QubitTerm::RIGHT_BASIS_COPYRIGHT_ID,
- 'actId' => array_search(
- 'Replicate',
- $self->getStatus('copyrightActTypes')
- ),
- 'copyrightStatusId' => array_search(
- 'Unknown',
- $self->getStatus('copyrightStatusTypes')
- )
- );
-
- if ($self->rowStatusVars['copyrightExpires'])
- {
- $rightAndRelation['endDate'] =
$self->rowStatusVars['copyrightExpires'];
- }
-
- $self->createRightAndRelation($rightAndRelation);
- break;
-
- case 'public domain':
-
- $rightAndRelation = array(
- 'restriction' => 1,
- 'basisId' => QubitTerm::RIGHT_BASIS_COPYRIGHT_ID,
- 'actId' => array_search(
- 'Replicate',
- $self->getStatus('copyrightActTypes')
- ),
- 'copyrightStatusId' => array_search(
- 'Public domain',
- $self->getStatus('copyrightStatusTypes')
- )
- );
-
- if ($self->rowStatusVars['copyrightExpires'])
- {
- $rightAndRelation['endDate'] =
$self->rowStatusVars['copyrightExpires'];
- }
-
- $self->createRightAndRelation($rightAndRelation);
- break;
-
- default:
- throw new sfException('Copyright status "'
- . $self->rowStatusVars['copyrightStatus']
- .'" not handled: adjust script or import data');
- break;
- }
- }
-
// add creators and create events
$createEvents = array();
if (isset($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.