Author: mcantelon
Date: Tue Dec 20 14:26:09 2011
New Revision: 10445
Log:
Created import class method for creating notes and added support for
alphanumberic designation in CVA import.
Modified:
trunk/lib/task/csvImportTask.class.php
Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php Tue Dec 20 14:09:16 2011
(r10444)
+++ trunk/lib/task/csvImportTask.class.php Tue Dec 20 14:26:09 2011
(r10445)
@@ -113,16 +113,18 @@
$self->information_object->save();
}
- // add note if specified
+ // add conservation note if specified
if ($self->rowStatusVars['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->rowStatusVars['conservation_note'];
- $note->scope = 'QubitTerm'; # not sure if this is needed
- $note->save();
+ $self->create_note(231, $self->rowStatusVars['conservation_note']);
+ }
+
+ // add alpha-numeric designation if specified
+ if ($self->rowStatusVars['alphanumeric_designation']) {
+ # NOTE: This creates the note in the DB, but it doesn't show up
+ # on the user side yet
+ $self->create_note(247,
$self->rowStatusVars['alphanumeric_designation']);
}
// add create event if specified
@@ -307,4 +309,15 @@
}
}
}
+
+ public function create_note($type_id, $text) {
+ $note = new QubitNote;
+ $note->objectId = $self->information_object->id;
+ $note->typeId = $type_id;
+ $note->content = $text;
+ $note->scope = 'QubitTerm'; # not sure if this is needed
+ $note->save();
+
+ return $note;
+ }
}
--
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.