Skip to content
Snippets Groups Projects
Commit 946e9421 authored by Dorian Merz's avatar Dorian Merz
Browse files

Merge branch 'master-v5' into instance/fid

parents 90ed48e8 2933aabf
No related merge requests found
...@@ -116,6 +116,23 @@ $config = [ ...@@ -116,6 +116,23 @@ $config = [
'solrlidondl' => 'finc\RecordDriver\SolrLidoNdl', 'solrlidondl' => 'finc\RecordDriver\SolrLidoNdl',
'solrdico' => 'finc\RecordDriver\SolrDico', 'solrdico' => 'finc\RecordDriver\SolrDico',
], ],
'delegators' => [
'finc\RecordDriver\SolrMarc' => [
'VuFind\RecordDriver\IlsAwareDelegatorFactory',
],
'finc\RecordDriver\SolrMarcFinc' => [
'VuFind\RecordDriver\IlsAwareDelegatorFactory',
],
'finc\RecordDriver\SolrMarcFincPDA' => [
'VuFind\RecordDriver\IlsAwareDelegatorFactory',
],
'finc\RecordDriver\SolrMarcRemote' => [
'VuFind\RecordDriver\IlsAwareDelegatorFactory',
],
'finc\RecordDriver\SolrMarcRemoteFinc' => [
'VuFind\RecordDriver\IlsAwareDelegatorFactory',
],
]
], ],
'recordtab' => [ 'recordtab' => [
'factories' => [ 'factories' => [
......
...@@ -133,13 +133,6 @@ class FincILS extends PAIA implements LoggerAwareInterface ...@@ -133,13 +133,6 @@ class FincILS extends PAIA implements LoggerAwareInterface
*/ */
protected $searchService; protected $searchService;
/**
* Date converter object
*
* @var \VuFind\Date\Converter
*/
protected $dateConverter;
/** /**
* Main Config * Main Config
* *
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
*/ */
namespace finc\RecordDriver; namespace finc\RecordDriver;
use VuFind\Exception\ILS as ILSException; use VuFind\RecordDriver\IlsAwareTrait;
use VuFind\View\Helper\Root\RecordLink; use VuFind\View\Helper\Root\RecordLink;
use VuFind\XSLT\Processor as XSLTProcessor; use VuFind\XSLT\Processor as XSLTProcessor;
...@@ -45,6 +45,8 @@ use VuFind\XSLT\Processor as XSLTProcessor; ...@@ -45,6 +45,8 @@ use VuFind\XSLT\Processor as XSLTProcessor;
*/ */
class SolrMarc extends SolrDefault class SolrMarc extends SolrDefault
{ {
use IlsAwareTrait;
/** /**
* MARC record. Access only via getMarcRecord() as this is initialized lazily. * MARC record. Access only via getMarcRecord() as this is initialized lazily.
* *
...@@ -52,27 +54,6 @@ class SolrMarc extends SolrDefault ...@@ -52,27 +54,6 @@ class SolrMarc extends SolrDefault
*/ */
protected $lazyMarcRecord = null; protected $lazyMarcRecord = null;
/**
* ILS connection
*
* @var \VuFind\ILS\Connection
*/
protected $ils = null;
/**
* Hold logic
*
* @var \VuFind\ILS\Logic\Holds
*/
protected $holdLogic;
/**
* Title hold logic
*
* @var \VuFind\ILS\Logic\TitleHolds
*/
protected $titleHoldLogic;
/** /**
* Get access restriction notes for the record. * Get access restriction notes for the record.
* *
...@@ -924,99 +905,6 @@ class SolrMarc extends SolrDefault ...@@ -924,99 +905,6 @@ class SolrMarc extends SolrDefault
return parent::getXML($format, $baseUrl, $recordLink); return parent::getXML($format, $baseUrl, $recordLink);
} }
/**
* Attach an ILS connection and related logic to the driver
*
* @param \VuFind\ILS\Connection $ils ILS connection
* @param \VuFind\ILS\Logic\Holds $holdLogic Hold logic handler
* @param \VuFind\ILS\Logic\TitleHolds $titleHoldLogic Title hold logic handler
*
* @return void
*/
public function attachILS(
\VuFind\ILS\Connection $ils,
\VuFind\ILS\Logic\Holds $holdLogic,
\VuFind\ILS\Logic\TitleHolds $titleHoldLogic
) {
$this->ils = $ils;
$this->holdLogic = $holdLogic;
$this->titleHoldLogic = $titleHoldLogic;
}
/**
* Do we have an attached ILS connection?
*
* @return bool
*/
protected function hasILS()
{
return null !== $this->ils;
}
/**
* Get an array of information about record holdings, obtained in real-time
* from the ILS.
*
* @return array
*/
public function getRealTimeHoldings()
{
return $this->hasILS() ? $this->holdLogic->getHoldings(
$this->getUniqueID(),
$this->getConsortialIDs()
) : [];
}
/**
* Get an array of information about record history, obtained in real-time
* from the ILS.
*
* @return array
*/
public function getRealTimeHistory()
{
// Get Acquisitions Data
if (!$this->hasILS()) {
return [];
}
try {
return $this->ils->getPurchaseHistory($this->getUniqueID());
} catch (ILSException $e) {
return [];
}
}
/**
* 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;
}
/**
* Returns true if the record supports real-time AJAX status lookups.
*
* @return bool
*/
public function supportsAjaxStatus()
{
// as AJAX status lookups are done via the ILS AJAX status lookup support is
// only given if the ILS is available for this record
return $this->hasILS();
}
/** /**
* Get access to the raw File_MARC object. * Get access to the raw File_MARC object.
* *
......
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