diff --git a/module/finc/src/finc/RecordDriver/SolrAI.php b/module/finc/src/finc/RecordDriver/SolrAI.php index 47934e336c17b5de71be4128f81e488133cd82c8..c21b5f87d9e0c3c3827ab189ee5b2fc169b4e492 100644 --- a/module/finc/src/finc/RecordDriver/SolrAI.php +++ b/module/finc/src/finc/RecordDriver/SolrAI.php @@ -28,8 +28,7 @@ * @link http://vufind.org/wiki/vufind2:record_drivers Wiki */ namespace finc\RecordDriver; -use \VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface, - Zend\Log\LoggerAwareInterface as LoggerAwareInterface; +use \VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface; /** * Recorddriver for Solr records from the aggregated index of Leipzig University @@ -44,10 +43,9 @@ use \VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface, * @SuppressWarnings(PHPMD.ExcessivePublicCount) */ class SolrAI extends SolrDefault implements - HttpServiceAwareInterface, LoggerAwareInterface + HttpServiceAwareInterface { use \VuFindHttp\HttpServiceAwareTrait; - use \VuFind\Log\LoggerAwareTrait; /** * AI record @@ -375,10 +373,18 @@ class SolrAI extends SolrDefault implements * Get the OpenURL parameters to represent this record (useful for the * title attribute of a COinS span tag). * + * @param bool $overrideSupportsOpenUrl Flag to override checking + * supportsOpenUrl() (default is false) + * * @return string OpenURL parameters. */ - public function getOpenURL() + public function getOpenUrl($overrideSupportsOpenUrl = false) { + // stop here if this record does not support OpenURLs + if (!$overrideSupportsOpenUrl && !$this->supportsOpenUrl()) { + return false; + } + $genre = $this->getAIRecord('rft.genre'); // Set up parameters based on the format of the record: switch ($genre) { diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php b/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php index eba0f0b63b6e561885e38f5b6d5138831d75fdd8..940c90c786925a84fb4bb35ab6d5deb953d79cc6 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php @@ -29,8 +29,7 @@ */ namespace finc\RecordDriver; -use VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface, - Zend\Log\LoggerAwareInterface as LoggerAwareInterface; +use VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface; /** * Model for PDA MARC records in Solr. @@ -43,10 +42,9 @@ use VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface, * @link http://vufind.org/wiki/vufind2:record_drivers Wiki */ class SolrMarcFincPDA extends SolrMarcFinc implements - HttpServiceAwareInterface, LoggerAwareInterface + HttpServiceAwareInterface { use \VuFindHttp\HttpServiceAwareTrait; - use \VuFind\Log\LoggerAwareTrait; /** * Get the price in Euro for the record.