You are here

function _pmnote_migrate_migrate_single_node in Drupal PM (Project Management) 7.2

Same name and namespace in other branches
  1. 8 pmnote/includes/pmnote.migrate.inc \_pmnote_migrate_migrate_single_node()
  2. 7.3 pmnote/includes/pmnote.migrate.inc \_pmnote_migrate_migrate_single_node()

Helper function to migrate single pmnote.

1 call to _pmnote_migrate_migrate_single_node()
pmnote_migrate_field_data in pmnote/includes/pmnote.migrate.inc
Migrate pmnote node fields data to drupal user bundle.

File

pmnote/includes/pmnote.migrate.inc, line 97
Migration functions for the PM Note module.

Code

function _pmnote_migrate_migrate_single_node($nid, $vid, $note) {
  $node = node_load($nid, $vid);

  // Ticket >> Task >> Project >> Organization.
  if ($note->task_nid) {
    $node->pmnote_parent[LANGUAGE_NONE][0]['target_id'] = $note->task_nid;
  }
  elseif ($note->project_nid) {
    $node->pmnote_parent[LANGUAGE_NONE][0]['target_id'] = $note->project_nid;
  }
  elseif ($note->organization_nid) {
    $node->pmnote_parent[LANGUAGE_NONE][0]['target_id'] = $note->organization_nid;
  }
  node_save($node);
  return TRUE;
}