From 0a9cc3aeb76de5cd8751e00ae92e683757a11cc7 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 17 Jul 2018 10:23:31 -0400 Subject: [PATCH] Make use of "hasFullText" flag. --- languages/en.ini | 1 + module/VuFind/src/VuFind/RecordDriver/Summon.php | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/languages/en.ini b/languages/en.ini index 3031a66d013..5b929ff933e 100644 --- a/languages/en.ini +++ b/languages/en.ini @@ -411,6 +411,7 @@ Geographic Search = "Geographic Search" Geographic Terms = "Geographic Terms" Geography = "Geography" Get full text = "Get full text" +Get more information = "Get more information" Get RSS Feed = "Get RSS Feed" Globe = "Globe" Go = "Go" diff --git a/module/VuFind/src/VuFind/RecordDriver/Summon.php b/module/VuFind/src/VuFind/RecordDriver/Summon.php index 36b2114463a..9476f7880f9 100644 --- a/module/VuFind/src/VuFind/RecordDriver/Summon.php +++ b/module/VuFind/src/VuFind/RecordDriver/Summon.php @@ -499,11 +499,9 @@ class Summon extends DefaultRecord public function getURLs() { if (isset($this->fields['link'])) { + $msg = $this->hasFullText() ? 'Get full text' : 'Get more information'; return [ - [ - 'url' => $this->fields['link'], - 'desc' => $this->translate('Get full text') - ] + ['url' => $this->fields['link'], 'desc' => $this->translate($msg)] ]; } $retVal = []; @@ -629,4 +627,14 @@ class Summon extends DefaultRecord } return $str; } + + /** + * Does this record have full text access? + * + * @return bool + */ + public function hasFullText() + { + return (bool)($this->fields['hasFullText'] ?? false); + } } -- GitLab