Subversion Repositories locum

Compare Revisions

Ignore whitespace Rev 149 → Rev 150

/trunk/locum-client.php
253,18 → 253,24
$utf = "SET NAMES 'utf8' COLLATE 'utf8_unicode_ci'";
$utfprep = $db->query($utf);
 
$sql = "SELECT bnum FROM locum_avail_branches WHERE bnum IN (" . implode(",", $bib_hits_all) . ") AND count_avail > 0";
$sql = "SELECT bnum, branch, count_avail FROM locum_avail_branches WHERE bnum IN (" . implode(", ", $bib_hits_all) . ") AND timestamp > '$cache_cutoff'";
$init_result =& $db->query($sql);
if ($init_result) {
$avail_bib_arr = $init_result->fetchCol();
foreach ($bib_hits_all as $bnum_avail_chk) {
if (in_array($bnum_avail_chk, $avail_bib_arr)) {
$new_bib_hits_all[] = $bnum_avail_chk;
$branch_info_cache = $init_result->fetchAll(MDB2_FETCHMODE_ASSOC);
$bad_bibs = array();
$good_bibs = array();
foreach ($branch_info_cache as $item_binfo) {
if (($item_binfo['branch'] == $limit_available || $limit_available == 'any') && $item_binfo['count_avail'] > 0) {
if (!in_array($item_binfo['bnum'], $good_bibs)) {
$good_bibs[] = $item_binfo['bnum'];
}
} else {
$bad_bibs[] = $item_binfo['bnum'];
}
}
}
$bib_hits_all = $new_bib_hits_all;
unset($new_bib_hits_all);
$unavail_bibs = array_values(array_diff($bad_bibs, $good_bibs));
$bib_hits_all = array_values(array_diff($bib_hits_all, $unavail_bibs));
 
// rebuild from the full list
unset($bib_hits);
293,29 → 299,19
// trim out the rest of the array based on *any* cache value
if(!empty($bib_hits_all)) {
$sql = "SELECT bnum, branch, count_avail FROM locum_avail_branches WHERE bnum IN (" . implode(", ", $bib_hits_all) . ")";
$sql = "SELECT bnum FROM locum_avail_branches WHERE bnum IN (" . implode(",", $bib_hits_all) . ") AND count_avail > 0";
$init_result =& $db->query($sql);
if ($init_result) {
$branch_info_cache = $init_result->fetchAll(MDB2_FETCHMODE_ASSOC);
$bad_bibs = array();
$good_bibs = array();
foreach ($branch_info_cache as $item_binfo) {
if (($item_binfo['branch'] == $limit_available || $limit_available == 'any') && $item_binfo['count_avail'] > 0) {
if (!in_array($item_binfo['bnum'], $good_bibs)) {
$good_bibs[] = $item_binfo['bnum'];
}
} else {
$bad_bibs[] = $item_binfo['bnum'];
$avail_bib_arr = $init_result->fetchCol();
foreach ($bib_hits_all as $bnum_avail_chk) {
if (in_array($bnum_avail_chk, $avail_bib_arr)) {
$new_bib_hits_all[] = $bnum_avail_chk;
}
}
$unavail_bibs = array_values(array_diff($bad_bibs, $good_bibs));
$bib_hits_all = array_unique(array_values(array_diff($bib_hits_all, $unavail_bibs)));
}
$bib_hits_all = $new_bib_hits_all;
unset($new_bib_hits_all);
}
// $sql = "SELECT COUNT(DISTINCT(bnum)) FROM locum_avail_branches WHERE bnum IN (" . implode(",", $bib_hits_all) . ") AND count_avail > 0";
// $res =& $db->query($sql);
// $final_result_set['num_hits'] = $res->fetchOne();
}
 
// Refine by facets
646,6 → 642,8
if (count($bnum_arr)) {
$db =& MDB2::connect($this->dsn);
$utf = "SET NAMES 'utf8' COLLATE 'utf8_unicode_ci'";
$utfprep = $db->query($utf);
$sql = 'SELECT * FROM locum_bib_items WHERE bnum IN (' . implode(', ', $bnum_arr) . ')';
$res =& $db->query($sql);
$item_arr = $res->fetchAll(MDB2_FETCHMODE_ASSOC);
696,9 → 694,11
*
* @param string $cardnum Patron barcode/card number
* @param string $pin Patron pin/password
* @param array $last_record Array containing: 'bnum' => Bib num, 'date' => Date of last record harvested.
* It will return everything after that record if this value is passed
* @return boolean|array Array of patron checkouts or FALSE if $barcode doesn't exist
*/
public function get_patron_checkout_history($cardnum, $pin = NULL, $action = NULL) {
public function get_patron_checkout_history($cardnum, $pin = NULL, $last_record = NULL) {
if (is_callable(array(__CLASS__ . '_hook', __FUNCTION__))) {
eval('$hook = new ' . __CLASS__ . '_hook;');
return $hook->{__FUNCTION__}($cardnum, $pin);
724,6 → 724,19
}
/**
* Deletes patron checkout history off the ILS server
*
* @param string $cardnum Patron barcode/card number
* @param string $pin Patron pin/password
* @param string $action NULL = do nothing, 'all' = delete all records, 'selected' = Delete records in $vars array
* @param array $vars array of variables referring to records to delete (optional)
* @param array $last_record Array containing: 'bnum' => Bib num, 'date' => Date of last record harvested
*/
public function delete_patron_checkout_history($cardnum, $pin = NULL, $action = NULL, $vars = NULL, $last_record = NULL) {
}
/**
* Returns an array of patron holds
*
* @param string $cardnum Patron barcode/card number
/trunk/sphinx/sphinx.conf
363,7 → 363,7
ignore_chars = U+22,U+23,U+24,U+25,U+26,U+27,U+28,U+29,U+2C,U+2E
enable_star = 1
min_prefix_len = 1
charset_table = 0..9, a..z, A..Z->a..z,U+FE20,U+FE21,U+2032,-, \
charset_table = 0..9, a..z, A..Z->a..z,-,U+FE20,U+FE21,U+2032, \
U+00C0->a, U+00C1->a, U+00C2->a, U+00C3->a, U+00C4->a, U+00C5->a, U+00E0->a, U+00E1->a, U+00E2->a, U+00E3->a, U+00E4->a, U+00E5->a, U+0100->a, U+0101->a, U+0102->a, U+0103->a, U+010300->a, U+0104->a, U+0105->a, U+01CD->a, U+01CE->a, U+01DE->a, U+01DF->a, U+01E0->a, U+01E1->a, U+01FA->a, U+01FB->a, U+0200->a, U+0201->a, U+0202->a, U+0203->a, U+0226->a, U+0227->a, U+023A->a, U+0250->a, U+04D0->a, U+04D1->a, U+1D2C->a, U+1D43->a, U+1D44->a, U+1D8F->a, U+1E00->a, U+1E01->a, U+1E9A->a, U+1EA0->a, U+1EA1->a, U+1EA2->a, U+1EA3->a, U+1EA4->a, U+1EA5->a, U+1EA6->a, U+1EA7->a, U+1EA8->a, U+1EA9->a, U+1EAA->a, U+1EAB->a, U+1EAC->a, U+1EAD->a, U+1EAE->a, U+1EAF->a, U+1EB0->a, U+1EB1->a, U+1EB2->a, U+1EB3->a, U+1EB4->a, U+1EB5->a, U+1EB6->a, U+1EB7->a, U+2090->a, U+2C65->a, \
U+0180->b, U+0181->b, U+0182->b, U+0183->b, U+0243->b, U+0253->b, U+0299->b, U+16D2->b, U+1D03->b, U+1D2E->b, U+1D2F->b, U+1D47->b, U+1D6C->b, U+1D80->b, U+1E02->b, U+1E03->b, U+1E04->b, U+1E05->b, U+1E06->b, U+1E07->b, \
U+00C7->c, U+00E7->c, U+0106->c, U+0107->c, U+0108->c, U+0109->c, U+010A->c, U+010B->c, U+010C->c, U+010D->c, U+0187->c, U+0188->c, U+023B->c, U+023C->c, U+0255->c, U+0297->c, U+1D9C->c, U+1D9D->c, U+1E08->c, U+1E09->c, U+212D->c, U+2184->c, \