You are here

function library_get_transactions_by_node in Library 6

Same name and namespace in other branches
  1. 5.2 library.module \library_get_transactions_by_node()
  2. 6.2 library.module \library_get_transactions_by_node()
  3. 7 library.module \library_get_transactions_by_node()
1 call to library_get_transactions_by_node()
library_history in ./library.pages.inc
Menu callback; show the transaction history of a single node.

File

./library.module, line 1018

Code

function library_get_transactions_by_node($node) {
  if ($node->type == 'patron') {
    $temp_transactions = library_get_transactions_by_patron($node);
    if (!empty($temp_transactions)) {
      $transactions[] = $temp_transactions;
    }
  }
  else {
    foreach ($node->items as $instance) {
      $item = (object) $instance;
      $temp_transactions = library_get_transactions_by_item($item);
      if (!empty($temp_transactions)) {
        $transactions[] = library_get_transactions_by_item($item);
      }
    }
  }
  return $transactions;
}