/** * Public method for getting title level holds * * @param string $id A Bib ID * * @return string|bool URL to place hold, or false if hold option unavailable * * @todo Indicate login failure or ILS connection failure somehow? */ public function getHold($id) { // Get Holdings Data if ($this->catalog) { $mode = $this->catalog->getTitleHoldsMode(); if ($mode == 'disabled') { return false; } else { if ($mode == 'driver') { try { $patron = $this->ilsAuth->storedCatalogLogin(); } catch (ILSException $e) { return false; } if (!$patron) { return false; } return $this->driverHold($id, $patron); } else { try { $patron = $this->ilsAuth->storedCatalogLogin(); } catch (ILSException $e) { $patron = false; } $mode = $this->checkOverrideMode($id, $mode); return $this->generateHold($id, $mode, $patron); } } } return false; }
/** * Get a link for placing a title level hold. * * @return mixed A url if a hold is possible, boolean false if not */ public function getRealTimeTitleHold() { if ($this->hasILS()) { $biblioLevel = strtolower($this->getBibliographicLevel()); if ("monograph" == $biblioLevel || strstr($biblioLevel, "part")) { if ($this->ils->getTitleHoldsMode() != "disabled") { return $this->titleHoldLogic->getHold($this->getUniqueID()); } } } return false; }
/** * Public method for getting title level holds * * @param string $id A Bib ID * * @return string|bool URL to place hold, or false if hold option unavailable */ public function getHold($id) { // Get Holdings Data if ($this->catalog) { $mode = ILSConnection::getTitleHoldsMode(); if ($mode == "disabled") { return false; } else { if ($mode == "driver") { $patron = $this->account->storedCatalogLogin(); if (!$patron) { return false; } return $this->driverHold($id, $patron); } else { return $this->generateHold($id, $mode); } } } return false; }
/** * Get a link for placing a title level hold. * * @param \VuFind\Auth\Manager $account Auth manager object * * @return mixed A url if a hold is possible, boolean false if not */ public function getRealTimeTitleHold(\VuFind\Auth\Manager $account) { $biblioLevel = $this->getBibliographicLevel(); if ("monograph" == strtolower($biblioLevel) || stristr("part", $biblioLevel)) { if (ILSConnection::getTitleHoldsMode() != "disabled") { $holdLogic = new TitleHoldLogic($account, $this->getILS()); return $holdLogic->getHold($this->getUniqueID()); } } return false; }
/** * checkRequestIsValid * * This is responsible for determining if an item is requestable * * @param string $id The Bib ID * @param array $data An Array of item data * @param patron $patron An array of patron data * * @return string True if request is valid, false if not */ public function checkRequestIsValid($id, $data, $patron) { $holdType = isset($data['holdtype']) ? $data['holdtype'] : "auto"; $level = isset($data['level']) ? $data['level'] : "copy"; $mode = "title" == $level ? ILSConnection::getTitleHoldsMode() : ILSConnection::getHoldsMode(); if ("driver" == $mode && "auto" == $holdType) { $itemID = isset($data['item_id']) ? $data['item_id'] : false; $result = $this->determineHoldType($patron['id'], $id, $itemID); if (!$result || $result == 'block') { return false; } } return true; }