Skip to content
Snippets Groups Projects
Commit 074bbcea authored by Chris Delis's avatar Chris Delis Committed by Demian Katz
Browse files

First steps to "consortialize" (see pull request #166).

parent f141b9df
No related merge requests found
...@@ -153,11 +153,11 @@ class Holds ...@@ -153,11 +153,11 @@ class Holds
* holding method to call * holding method to call
* *
* @param string $id A Bib ID * @param string $id A Bib ID
* @param array $ids A list of Source Records (if catalog is for a consortium)
* *
* @return array A sorted results set * @return array A sorted results set
*/ */
public function getHoldings($id, $ids = null)
public function getHoldings($id)
{ {
$holdings = array(); $holdings = array();
...@@ -167,7 +167,15 @@ class Holds ...@@ -167,7 +167,15 @@ class Holds
// controller and view to inform the user that these credentials are // controller and view to inform the user that these credentials are
// needed for hold data. // needed for hold data.
$patron = $this->ilsAuth->storedCatalogLogin(); $patron = $this->ilsAuth->storedCatalogLogin();
$result = $this->catalog->getHolding($id, $patron ? $patron : null);
// Does this ILS Driver handle consortial holdings?
$config = $this->catalog->getConfig('Holds');
if (isset($config['consortium']) && $config['consortium'] == true) {
$result = $this->catalog->getConsortialHoldings($id, $patron ? $patron : null, $ids);
} else {
$result = $this->catalog->getHolding($id, $patron ? $patron : null);
}
$mode = $this->catalog->getHoldsMode(); $mode = $this->catalog->getHoldsMode();
if ($mode == "disabled") { if ($mode == "disabled") {
......
...@@ -1062,7 +1062,7 @@ class SolrMarc extends SolrDefault ...@@ -1062,7 +1062,7 @@ class SolrMarc extends SolrDefault
public function getRealTimeHoldings() public function getRealTimeHoldings()
{ {
return $this->hasILS() return $this->hasILS()
? $this->holdLogic->getHoldings($this->getUniqueID()) ? $this->holdLogic->getHoldings($this->getUniqueID(), $this->getConsortialIDs())
: array(); : array();
} }
...@@ -1135,4 +1135,14 @@ class SolrMarc extends SolrDefault ...@@ -1135,4 +1135,14 @@ class SolrMarc extends SolrDefault
'record-rdf-mods.xsl', trim($this->marcRecord->toXML()) 'record-rdf-mods.xsl', trim($this->marcRecord->toXML())
); );
} }
/**
* Return the list of "source records" for this consortial record.
*
* @return array
*/
public function getConsortialIDs()
{
return $this->getFieldArray('035', 'a', true);
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment