Author: mcantelon
Date: Mon Dec 19 16:49:50 2011
New Revision: 10439
Log:
Added note creation logic in rough.
Modified:
trunk/lib/task/csvImportTask.class.php
Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php Mon Dec 19 16:21:40 2011
(r10438)
+++ trunk/lib/task/csvImportTask.class.php Mon Dec 19 16:49:50 2011
(r10439)
@@ -117,6 +117,18 @@
$self->information_object->save();
}
+ // add note if specified
+ if ($self->status['conservation_note']) {
+ # NOTE: This creates the note in the DB, but it doesn't show up
+ # on the user side yet
+ $note = new QubitNote;
+ $note->objectId = $self->information_object->id;
+ $note->typeId = 231;
+ $note->content = $self->status['conservation_note'];
+ $note->scope = 'QubitTerm'; # not sure if this is needed
+ $note->save();
+ }
+
// add create event if specified
if (
isset($self->status['start_year'])
@@ -152,6 +164,12 @@
$self->status['start_year'] = $data;
});
+ $import->addColumnHandler('Rad note – conservation', function(&$self,
$data) {
+ if ($data) {
+ $self->status['conservation_note'] = $data;
+ }
+ });
+
// import each row
while ($item = fgetcsv($fh, 60000))
{
--
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.