You are here

function merci_update in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6

Same name and namespace in other branches
  1. 6.2 merci.module \merci_update()
  2. 7.2 merci.module \merci_update()

Implementation of hook_update().

File

./merci.module, line 1735
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

function merci_update($node) {
  if ($node->type == 'merci_reservation') {
    if ($node->revision) {
      db_query("INSERT INTO {merci_reservation} (nid, vid, status) VALUES (%d, %d, %d)", $node->nid, $node->vid, $node->merci_status);
    }
    else {
      db_query("UPDATE {merci_reservation} SET status = %d WHERE vid = %d", $node->merci_status, $node->vid);
    }
    merci_add_reservation_items($node);
  }
}