You are here

function library_get_transaction_by_tid in Library 6

Same name and namespace in other branches
  1. 5.2 library.module \library_get_transaction_by_tid()
  2. 6.2 library.module \library_get_transaction_by_tid()
  3. 7 library.module \library_get_transaction_by_tid()
1 call to library_get_transaction_by_tid()
library_transaction_view in ./library.pages.inc

File

./library.module, line 1065

Code

function library_get_transaction_by_tid($tid) {
  if (isset($tid) && is_numeric($tid)) {
    $result = db_fetch_object(db_query('SELECT lt.created, la.name as "action_name", la.status_change, lp.nid as "patron_id", lp.name_last, lp.name_first, n.title as "item_name", n.type as "item_type", lt.item_id as "item_id", lt.nid as "nid", lt.duedate, lt.notes FROM {library_transactions} lt, {library_actions} la, {library_patrons} lp, {node} n WHERE la.aid = lt.action_aid AND lp.nid = lt.patron_id AND n.nid = lt.nid AND lt.tid = %d', $tid));
    return $result;
  }
  else {
    return NULL;
  }
}