You are here

function pmperson_update in Drupal PM (Project Management) 7

Implements hook_update().

File

pmperson/pmperson.module, line 432

Code

function pmperson_update($node) {

  // if this is a new node or we're adding a new revision,
  if ($node->revision) {
    pmperson_insert($node);
  }
  else {
    _pmperson_beforesave($node);
    db_update('pmperson')
      ->fields(array(
      'organization_nid' => $node->organization_nid,
      'organization_title' => $node->organization_title,
      'prefix' => $node->prefix,
      // Ignore use of $node->email rather than $node->mail.
      // @ignore coder_tough_love_8
      'email' => $node->email,
      'www' => $node->www,
      'phone' => $node->phone,
      'im' => $node->im,
      'user_uid' => $node->user_uid,
    ))
      ->condition('vid', $node->vid)
      ->execute();
    _pmperson_aftersave($node);
    if ($node->title != $node->title_old) {
      module_invoke_all('pmperson_change', $node->nid, $node->title);
    }
  }
}