function _pmproject_migrate_migrate_single_node in Drupal PM (Project Management) 7.3
Same name and namespace in other branches
- 8 pmproject/includes/pmproject.migrate.inc \_pmproject_migrate_migrate_single_node()
- 7.2 pmproject/includes/pmproject.migrate.inc \_pmproject_migrate_migrate_single_node()
Helper function to migrate single pmproject.
1 call to _pmproject_migrate_migrate_single_node()
- pmproject_migrate_field_data in pmproject/
includes/ pmproject.migrate.inc - Migrate pmproject node fields data to drupal user bundle.
File
- pmproject/
includes/ pmproject.migrate.inc, line 96 - Migration functions for the PM Project module.
Code
function _pmproject_migrate_migrate_single_node($nid, $vid, $prj) {
$node = node_load($nid, $vid);
$assigned = _pmproject_get_drupal_uid_from_pmperson_nid($prj->assigned_nid);
if ($assigned) {
$node->pm_assigned[LANGUAGE_NONE][0]['target_id'] = $assigned;
}
$manager = _pmproject_get_drupal_uid_from_pmperson_nid($prj->manager_nid);
if ($manager) {
$node->pm_manager[LANGUAGE_NONE][0]['target_id'] = $manager;
}
if ($prj->duration) {
$node->pm_duration[LANGUAGE_NONE][0]['value'] = $prj->duration;
}
if ($prj->datebegin) {
$node->pm_date[LANGUAGE_NONE][0]['value'] = $prj->datebegin;
}
if ($prj->dateend) {
$node->pm_date[LANGUAGE_NONE][0]['value2'] = $prj->dateend;
}
if ($prj->billed) {
$node->pm_billing_status[LANGUAGE_NONE][0]['value'] = 'Billed';
}
elseif ($prj->billable) {
$node->pm_billing_status[LANGUAGE_NONE][0]['value'] = 'Billable';
}
if ($prj->durationunit) {
$node->pm_durationunit[LANGUAGE_NONE][0]['value'] = $prj->durationunit;
}
if ($prj->projectcategory) {
$node->pm_projectcategory[LANGUAGE_NONE][0]['value'] = $prj->projectcategory;
}
if ($prj->projectpriority) {
$node->pm_projectpriority[LANGUAGE_NONE][0]['value'] = $prj->projectpriority;
}
if ($prj->projectstatus) {
$node->pm_projectstatus[LANGUAGE_NONE][0]['value'] = $prj->projectstatus;
}
if ($prj->organization_nid) {
$node->pmproject_parent[LANGUAGE_NONE][0]['target_id'] = $prj->organization_nid;
}
if ($prj->currency) {
$node->pm_currency[LANGUAGE_NONE][0]['value'] = $prj->currency;
}
if ($prj->price) {
$node->pm_price[LANGUAGE_NONE][0]['value'] = $prj->price;
}
if ($prj->pricemode) {
$node->pm_pricemode[LANGUAGE_NONE][0]['value'] = $prj->pricemode;
}
node_save($node);
return TRUE;
}