You are here

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

Same name and namespace in other branches
  1. 6.2 includes/api.inc \merci_get_suggested_bucket_item()
1 call to merci_get_suggested_bucket_item()
merci_add_reservation_items in includes/api.inc
Adds items to reservation on creation/update.

File

includes/api.inc, line 827
MERCI - Managed Equipment Reservation Checkout and Inventory

Code

function merci_get_suggested_bucket_item($content_type, $start, $end, $items = array()) {
  $total_items_array = merci_reserved_bucket_items($content_type, $start, $end);
  foreach ($total_items_array as $item_nid => $node) {
    if (empty($total_items_array[$item_nid]) && !in_array($item_nid, $items)) {
      return $item_nid;
    }
  }
  return 0;
}