You are here

function pmorganization_update in Drupal PM (Project Management) 7

Implements hook_update().

File

pmorganization/pmorganization.module, line 384

Code

function pmorganization_update($node) {

  // if this is a new node or we're adding a new revision,
  if ($node->revision) {
    pmorganization_insert($node);
  }
  else {
    db_update('pmorganization')
      ->fields(array(
      'country' => $node->country,
      'www' => $node->www,
      'phone' => $node->phone,
      'email' => $node->email,
      'currency' => $node->currency,
      'provstate' => $node->provstate,
      'zip' => $node->zip,
      'city' => $node->city,
      'address' => $node->address,
      'taxid' => $node->taxid,
      'orglanguage' => $node->orglanguage,
      'iscustomer' => $node->iscustomer,
      'isprovider' => $node->isprovider,
      'isactive' => $node->isactive,
      'pricemode' => $node->pricemode,
    ))
      ->condition('vid', $node->vid, '=')
      ->execute();
    if ($node->title != $node->title_old) {
      module_invoke_all('pmorganization_change', $node->nid, $node->title);
    }
  }
}