You are here

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

Same name and namespace in other branches
  1. 6.2 includes/api.inc \merci_get_available_bucket_items()
  2. 7.2 includes/api.inc \merci_get_available_bucket_items()

Pulls items available to assign to a bucket for a reservation.

Parameters

$node: The reservation node.

$bucket_type: The bucket type.

Return value

An array of available items, in select options format.

2 calls to merci_get_available_bucket_items()
merci_build_reservation_table_form in ./merci.module
Builds the table of existing reserved items.
merci_node_validate in ./merci.module
Implementation of hook_validate().

File

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

Code

function merci_get_available_bucket_items($node, $bucket_type) {
  $date_info = $node->field_merci_date[0];
  $start = $date_info['value'];
  $end = $date_info['value2'];
  $options = merci_get_reservable_items('bucket', $bucket_type, $start, $end, $node->nid);
  return $options;
}