You are here

function merci_view in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2

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

Implementation of hook_view().

File

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

Code

function merci_view($node, $view_mode) {

  // TODO: should we fix node previews?
  if (!isset($node->preview)) {
    $node->content['merci_reservation_status'] = merci_display_reservation_status(merci_record_status($node->merci_reservation_status));
    if ($view_mode == 'full' && node_is_page($node)) {
      $reservation_table = drupal_get_form('merci_build_reservation_table_form', $node);

      //$node = node_prepare($node, $teaser);
      $node->content['merci_reservation_items'] = $reservation_table;
    }
  }
  return $node;
}