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
Branches
Tags
No related merge requests found
......@@ -142,7 +142,9 @@ class Redi extends AbstractBase
'title' => $doiTerm->item($i)->textContent
. $doiDefinition->item($i)->textContent,
'href' => $href,
'service_type' => 'getFullTxt',
'access' => 'unknown',
'coverage' => null,
'service_type' => 'getDOI',
];
}
}
......
......@@ -81,7 +81,9 @@ class RediTest extends \VuFindTest\Unit\TestCase
0 => [
'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",
'service_type' => "getFullTxt",
'access' => 'unknown',
'coverage' => null,
'service_type' => "getDOI",
],
1 => [
'title' => "Zum Volltext (via SpringerLink)",
......
......@@ -16,6 +16,7 @@
namespace finc\Resolver\Driver;
use VuFind\Resolver\Driver\Redi as RediBase;
use Zend\Dom\DOMXPath;
/**
* Redi Link Resolver Driver
......@@ -57,4 +58,42 @@ class Redi extends RediBase
$feed = $this->httpClient->setUri($url)->send()->getBody();
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() {
});
/* finc specific */
$('.itemCount').each(function() {
let selector = $(this).attr('id');
if(!selector)
$(document).ready(function () {
var menuItems = $('.itemCount');
if(menuItems.length === 0) {
return;
}
var countables = new Array;
menuItems.each(function() {
countables.push($(this).attr('id'));
});
VuFind.account.register("itemCount", {
selector: "#" + selector,
ajaxMethod: "getAdditionalAccountInfo",
data: {'views':[selector]},
render: function render($element, status, ICON_LEVELS) {
var level = ICON_LEVELS.NONE;
var html = '';
$.each(status, function (i, result) {
$.each(result, function (id, itemCount) {
if ($element.attr("id") === id && itemCount > 0) {
level = ICON_LEVELS.GOOD;
html += '<span class="badge ok">' + itemCount + '</span>';
}
});
$.ajax({
dataType: 'json',
method: 'GET',
url: VuFind.path + '/AJAX/JSON?method=getAdditionalAccountInfo',
data: {'views':countables}
})
.done(function(response) {
if (response.data.countFines != undefined && response.data.countFines != 0) {
$('#getFinesTotal').text(response.data.countFines);
$('.fines').addClass('red-alert');
}
$.each(response.data.countViewItems, function (id, itemCount) {
$('#'+id).text('('+itemCount+')');
});
$element.html(html);
return level;
}
});
});
});
/* finc specific - END */
});
<!-- finc: ContentBlock -- FacetList -->
<!-- finc: ContentBlock - FacetList -->
<?php
// Load search actions and settings (if any):
$options = $this->searchOptions($searchClassId);
......@@ -95,4 +95,4 @@ JS;
<?php endforeach; ?>
</div>
<?php endif; ?>
<!-- finc: ContentBlock -- FacetList - END -->
\ No newline at end of file
<!-- finc: ContentBlock - FacetList - END -->
\ 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