Skip to content
Snippets Groups Projects
Commit 4e25eb88 authored by Gregor Gawol's avatar Gregor Gawol Committed by Dorian Merz
Browse files

refs #15134 [master] marcfield 856 online information

* set link label with config
* retrieve subfield sequence y then n and then 3
* added indicators
parent 2bb85cac
Branches
Tags
No related merge requests found
......@@ -116,18 +116,43 @@ trait SolrMarcFincTrait
if ($address) {
$address = $address->getData();
$tmpArr = [];
//$tmpArr = [];
// Is there a description? If not, just use the URL
// itself.
foreach (['y', '3', 'z', 'x'] as $current) {
/*foreach (['y', '3', 'z', 'x'] as $current) {
$desc = $url->getSubfield($current);
if ($desc) {
$desc = $desc->getData();
$tmpArr[] = $desc;
}
}*/
$desc = false;
if ($url->getSubfield('y')) {
$desc = $url->getSubfield('y');
} elseif ($url->getSubfield('n')) {
$desc = $url->getSubfield('n');
} elseif ($url->getSubfield('3')) {
$desc = $url->getSubfield('3');
}
$tmpArr = array_unique($tmpArr);
$desc = implode(', ', $tmpArr);
if ($desc) {
$desc = $desc->getData();
$desc = strlen($desc) > 3 ?
$desc : 'Online Information';
if (isset($this->mainConfig->UrlDesc->desc)) {
$tmpDesc = $this->mainConfig->UrlDesc->desc->toArray();
if (in_array($desc, $tmpDesc)) {
$desc = 'Online Information';
}
}
} else {
$desc = 'Online Information';
}
//$tmpArr = array_unique($tmpArr);
//$desc = implode(', ', $tmpArr);
// If no description take url as description
// For 856[40] url denoting resource itself
......@@ -150,7 +175,10 @@ trait SolrMarcFincTrait
$retVal
)
) {
$retVal[] = ['url' => $address, 'desc' => $desc];
$retVal[] = [
'url' => $address, 'desc' => $desc,
'indicators' => $indicator1.$indicator2
];
}
}
}
......
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