From 48cf043a7811d1cc9f62ffe571ffd26f31fac7a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Wed, 18 Dec 2024 14:31:39 +0000 Subject: [PATCH] DIS-138 feat: warn patron if retracted Applies only to EBSCO host and EDS records. If an article has been retracted, the user will be warned, and will have the option to click on the 'Retracted' link to see more information on the retraction via LibKey. Library catalogue records will not be affected. --- .../themes/responsive/RecordDrivers/EBSCO/result.tpl | 7 ++++++- .../themes/responsive/RecordDrivers/EBSCOhost/result.tpl | 7 ++++++- code/web/sys/SearchObject/EbscoEdsSearcher.php | 6 ++++++ code/web/sys/SearchObject/EbscohostSearcher.php | 7 +++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/code/web/interface/themes/responsive/RecordDrivers/EBSCO/result.tpl b/code/web/interface/themes/responsive/RecordDrivers/EBSCO/result.tpl index 77000ea216..05958730f5 100644 --- a/code/web/interface/themes/responsive/RecordDrivers/EBSCO/result.tpl +++ b/code/web/interface/themes/responsive/RecordDrivers/EBSCO/result.tpl @@ -4,7 +4,7 @@ + {if $retracted} + + {/if} {if !empty($summAuthor)}
diff --git a/code/web/interface/themes/responsive/RecordDrivers/EBSCOhost/result.tpl b/code/web/interface/themes/responsive/RecordDrivers/EBSCOhost/result.tpl index 13886af24a..9802280be8 100644 --- a/code/web/interface/themes/responsive/RecordDrivers/EBSCOhost/result.tpl +++ b/code/web/interface/themes/responsive/RecordDrivers/EBSCOhost/result.tpl @@ -4,7 +4,7 @@
+ {if $retracted} + + {/if} {if !empty($summAuthor)}
diff --git a/code/web/sys/SearchObject/EbscoEdsSearcher.php b/code/web/sys/SearchObject/EbscoEdsSearcher.php index f1cbf6a7e7..e011fac2d3 100644 --- a/code/web/sys/SearchObject/EbscoEdsSearcher.php +++ b/code/web/sys/SearchObject/EbscoEdsSearcher.php @@ -314,8 +314,14 @@ public function getResultRecordHTML() { foreach ($this->lastSearchResults->Data->Records[$x]->RecordInfo->BibRecord->BibEntity->Identifiers as $ui) { if ($ui->Type == "doi") { $libKeyResult = $this->getLibKeyResult($ui->Value); + if (isset($libKeyResult['data']['retractionNoticeUrl'])) { + $interface->assign('libKeyUrl', $libKeyResult['data']['retractionNoticeUrl']); + $interface->assign('retracted', true); + break; + } $interface->assign('libKeyUrl', $libKeyResult["data"]["bestIntegratorLink"]["bestLink"]); $interface->assign('libKeyCoverImageUrl', $libKeyResult['included'][0]['coverImageUrl']); + $interface->assign('retracted', false); break; } } diff --git a/code/web/sys/SearchObject/EbscohostSearcher.php b/code/web/sys/SearchObject/EbscohostSearcher.php index f4a4724c62..a7fc4b0786 100644 --- a/code/web/sys/SearchObject/EbscohostSearcher.php +++ b/code/web/sys/SearchObject/EbscohostSearcher.php @@ -256,8 +256,15 @@ public function getResultRecordHTML() { $interface->assign('resultIndex', $x + 1 + (($this->page - 1) * $this->limit)); if (Library::getActiveLibrary()->libKeySettingId != -1 && !empty($current->header->controlInfo->artinfo->ui)) { $libKeyResult = $this->getLibKeyResult($current->header->controlInfo->artinfo->ui); + if (isset($libKeyResult['data']['retractionNoticeUrl'])) { + $interface->assign('libKeyUrl', $libKeyResult['data']['retractionNoticeUrl']); + $interface->assign('retracted', true); + break; + } $interface->assign('libKeyUrl', $libKeyResult["data"]["bestIntegratorLink"]["bestLink"]); $interface->assign('libKeyCoverImageUrl', $libKeyResult['included'][0]['coverImageUrl']); + $interface->assign('retracted', false); + break; } require_once ROOT_DIR . '/RecordDrivers/EbscohostRecordDriver.php'; $record = new EbscohostRecordDriver($current);