Skip to content
Snippets Groups Projects
Commit 7451b625 authored by Robert Lange's avatar Robert Lange
Browse files

Merge branch 'instance/fid' into instance/fid_adlr

parents b68823c4 d0855889
No related merge requests found
...@@ -142,7 +142,9 @@ class Redi extends AbstractBase ...@@ -142,7 +142,9 @@ class Redi extends AbstractBase
'title' => $doiTerm->item($i)->textContent 'title' => $doiTerm->item($i)->textContent
. $doiDefinition->item($i)->textContent, . $doiDefinition->item($i)->textContent,
'href' => $href, 'href' => $href,
'service_type' => 'getFullTxt', 'access' => 'unknown',
'coverage' => null,
'service_type' => 'getDOI',
]; ];
} }
} }
......
...@@ -81,7 +81,9 @@ class RediTest extends \VuFindTest\Unit\TestCase ...@@ -81,7 +81,9 @@ class RediTest extends \VuFindTest\Unit\TestCase
0 => [ 0 => [
'title' => "DOI:10.1007/s11606-014-2915-9", 'title' => "DOI:10.1007/s11606-014-2915-9",
'href' => "http://www-fr.redi-bw.de/links/?rl_site=ubl&rl_action=link&rl_link_target=citation&rl_link_name=doi&rl_citation=9443914d0e261c0c1f6a3fd8151213c1d4cec05f5d3053097da6fa5597bbb9d7", 'href' => "http://www-fr.redi-bw.de/links/?rl_site=ubl&rl_action=link&rl_link_target=citation&rl_link_name=doi&rl_citation=9443914d0e261c0c1f6a3fd8151213c1d4cec05f5d3053097da6fa5597bbb9d7",
'service_type' => "getFullTxt", 'access' => 'unknown',
'coverage' => null,
'service_type' => "getDOI",
], ],
1 => [ 1 => [
'title' => "Zum Volltext (via SpringerLink)", 'title' => "Zum Volltext (via SpringerLink)",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
namespace finc\Resolver\Driver; namespace finc\Resolver\Driver;
use VuFind\Resolver\Driver\Redi as RediBase; use VuFind\Resolver\Driver\Redi as RediBase;
use Zend\Dom\DOMXPath;
/** /**
* Redi Link Resolver Driver * Redi Link Resolver Driver
...@@ -57,4 +58,42 @@ class Redi extends RediBase ...@@ -57,4 +58,42 @@ class Redi extends RediBase
$feed = $this->httpClient->setUri($url)->send()->getBody(); $feed = $this->httpClient->setUri($url)->send()->getBody();
return $feed; return $feed;
} }
/**
* Parse the Redi XML response and return array with DOI information.
*
* @param DOMDocument $xml Loaded xml document
*
* @deprecated with VuFind 9 - cf. https://github.com/vufind-org/vufind/pull/2419
* @return array Get back a array with title, URL and service_type
*/
protected function parseDOI($xml)
{
$retval = [];
$xpath = new DOMXPath($xml);
$doiTerm = $xpath
->query("//dt[@class='doi_t']");
$doiDefinition = $xpath
->query("//dd[@class='doi_d']");
if ($doiTerm->length == $doiDefinition->length) {
for ($i = 0; $i < $doiTerm->length; $i++) {
$href = $xpath
->query(".//@href", $doiDefinition->item($i))
->item(0)->textContent;
$retval[] = [
'title' => $doiTerm->item($i)->textContent
. $doiDefinition->item($i)->textContent,
'href' => $href,
'access' => 'unknown',
'coverage' => null,
'service_type' => 'getDOI',
];
}
}
return $retval;
}
} }
...@@ -251,30 +251,31 @@ $(document).ready(function registerAccountAjax() { ...@@ -251,30 +251,31 @@ $(document).ready(function registerAccountAjax() {
}); });
/* finc specific */ /* finc specific */
$('.itemCount').each(function() { $(document).ready(function () {
let selector = $(this).attr('id'); var menuItems = $('.itemCount');
if(!selector) if(menuItems.length === 0) {
return; return;
}
var countables = new Array;
menuItems.each(function() {
countables.push($(this).attr('id'));
});
VuFind.account.register("itemCount", { $.ajax({
selector: "#" + selector, dataType: 'json',
ajaxMethod: "getAdditionalAccountInfo", method: 'GET',
data: {'views':[selector]}, url: VuFind.path + '/AJAX/JSON?method=getAdditionalAccountInfo',
render: function render($element, status, ICON_LEVELS) { data: {'views':countables}
var level = ICON_LEVELS.NONE; })
var html = ''; .done(function(response) {
$.each(status, function (i, result) { if (response.data.countFines != undefined && response.data.countFines != 0) {
$.each(result, function (id, itemCount) { $('#getFinesTotal').text(response.data.countFines);
if ($element.attr("id") === id && itemCount > 0) { $('.fines').addClass('red-alert');
level = ICON_LEVELS.GOOD; }
html += '<span class="badge ok">' + itemCount + '</span>'; $.each(response.data.countViewItems, function (id, itemCount) {
} $('#'+id).text('('+itemCount+')');
});
}); });
$element.html(html); });
return level;
}
});
}); });
/* finc specific - END */ /* finc specific - END */
}); });
<!-- finc: ContentBlock -- FacetList --> <!-- finc: ContentBlock - FacetList -->
<?php <?php
// Load search actions and settings (if any): // Load search actions and settings (if any):
$options = $this->searchOptions($searchClassId); $options = $this->searchOptions($searchClassId);
...@@ -95,4 +95,4 @@ JS; ...@@ -95,4 +95,4 @@ JS;
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php endif; ?> <?php endif; ?>
<!-- finc: ContentBlock -- FacetList - END --> <!-- finc: ContentBlock - FacetList - END -->
\ No newline at end of file \ No newline at end of file
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