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

Merge branch 'master' into instance/fid

parents f32b14ee 1444dea8
Branches
Tags
No related merge requests found
......@@ -113,4 +113,30 @@ class RecordController extends \VuFind\Controller\RecordController implements
// No followup info found? Send back to record view:
return $this->redirectToRecord();
}
/**
* Home (default) action -- forward to requested (or default) tab.
*
* @return mixed
*/
public function homeAction()
{
if ($this->params()->fromQuery('catchMissing', null)) {
try {
return parent::homeAction();
} catch (\VuFind\Exception\RecordMissing $ex) {
$lookfor = $this->params()->fromQuery('catchMissing_lookfor','');
if (empty($lookfor)) throw $ex;
$type = $this->params()->fromQuery('catchMissing_searchType','Allfields');
$link = $this->redirect()->toRoute(
'search-results',
[],
['query' => compact('lookfor','type')]
);
return $link;
}
}
return parent::homeAction();
}
}
......@@ -150,13 +150,31 @@ class RecordLink extends \VuFind\View\Helper\Root\RecordLink
*
* @return string
*/
public function getUrl($driver)
public function getUrl(
$driver, $catchMissingLookfor = '', $catchMissingSearchType = 'AllFields'
)
{
try {
return $this->getTabUrl($driver);
} catch (RecordMissingException $exception) {
// return default result on Missing Record
// throw all other Exceptions
if (is_object($driver)) {
try {
return $this->getTabUrl($driver);
} catch (RecordMissingException $exception) {
// return default result on Missing Record
// throw all other Exceptions
}
} elseif (is_string($driver)) {
$ids = explode('|',$driver);
$id = array_shift($ids);
if ($id === 'Solr') $id = array_shift($ids);
$params['id'] = $id;
if (!empty($catchMissingLookfor)) {
$options['query'] = [
'catchMissing' => true,
'catchMissing_lookfor' => $catchMissingLookfor,
'catchMissing_searchType' => $catchMissingSearchType
];
}
$urlHelper = $this->getView()->plugin('url');
return $urlHelper('record',$params,$options ?? []);
}
return "";
}
......
......@@ -3,7 +3,7 @@
<?php $hierarchyParentId = $this->driver->tryMethod('getHierarchyParentID'); ?>
<?php foreach ($data as $key => $title): ?>
<?php if (isset($hierarchyParentId[$key])): ?>
<a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key]);?>"><?=$this->escapeHtml($title)?></a>
<a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key],$hierarchyParentId[$key],'ParentID');?>"><?=$this->escapeHtml($title)?></a>
<?php else: ?>
<?=$this->escapeHtml($title)?>
<?php endif; ?>
......
......@@ -10,7 +10,7 @@
// try container id as link - VuFind native behaviour
if ($containerID) {
$journalLink = $this->recordLink()->getUrl("$containerSource|$containerID");
$journalLink = $this->recordLink()->getUrl("$containerSource|$containerID",$data,'JournalTitle');
} // try to link via issn - finc adapted behaviour
elseif (!empty($issns)) {
$journalLink = $this->record($this->driver)->getLink('isn', $issns);
......
<span class="label label-danger"><?=$this->transEsc("Unavailable")?></span>
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