diff --git a/module/finc/src/finc/Controller/RecordController.php b/module/finc/src/finc/Controller/RecordController.php index 7e3702e24fc965f7940d620fc308c59fa759020b..ee9b3d49e75883ef2668a262f5024d94a658cbd5 100644 --- a/module/finc/src/finc/Controller/RecordController.php +++ b/module/finc/src/finc/Controller/RecordController.php @@ -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(); + } } diff --git a/module/finc/src/finc/View/Helper/Root/RecordLink.php b/module/finc/src/finc/View/Helper/Root/RecordLink.php index 12e27d4066fc9d9758aaf9db0483ef1545e3031c..aedb06a3acd190874e0e0c84dff7b94709791066 100644 --- a/module/finc/src/finc/View/Helper/Root/RecordLink.php +++ b/module/finc/src/finc/View/Helper/Root/RecordLink.php @@ -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 ""; } diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-hierarchyParentTitle.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-hierarchyParentTitle.phtml index fc59049c3a471ef7e8c71d4c15009f7c394c15b1..c926289b579d9570cc206820aef55a85b6396351 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/data-hierarchyParentTitle.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/data-hierarchyParentTitle.phtml @@ -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; ?> diff --git a/themes/finc/templates/RecordDriver/SolrAI/data-containerTitle.phtml b/themes/finc/templates/RecordDriver/SolrAI/data-containerTitle.phtml index f271e5a385495cb2d1c8592155256cb7ae5171b2..7e3472c48c497689765fc1fd6aa2d43caca506a7 100644 --- a/themes/finc/templates/RecordDriver/SolrAI/data-containerTitle.phtml +++ b/themes/finc/templates/RecordDriver/SolrAI/data-containerTitle.phtml @@ -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); diff --git a/themes/finc/templates/RecordDriver/SolrMarc/link-related.phtml b/themes/finc/templates/RecordDriver/SolrMarc/link-related.phtml new file mode 100644 index 0000000000000000000000000000000000000000..c3eb87fc3f5a17f8627cda9be65be255a9079e52 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrMarc/link-related.phtml @@ -0,0 +1 @@ +<?=$this->url('search-results')?>?lookfor=<?=urlencode($lookfor)?> diff --git a/themes/finc/templates/ajax/status-unavailable.phtml b/themes/finc/templates/ajax/status-unavailable.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d0a9131facc3b11e1b74352ade5f7edd9065502b --- /dev/null +++ b/themes/finc/templates/ajax/status-unavailable.phtml @@ -0,0 +1 @@ +<span class="label label-danger"><?=$this->transEsc("Unavailable")?></span> diff --git a/themes/finc/templates/search/history.phtml b/themes/finc/templates/search/history.phtml index ae21fffccbc1f474d1f9ec26e5cab4617dd76a30..04a7ee298e0aba39bd1d24479b4888e5c268933f 100644 --- a/themes/finc/templates/search/history.phtml +++ b/themes/finc/templates/search/history.phtml @@ -36,7 +36,8 @@ <?php endif; ?> <?php if (!empty($this->unsaved)): ?> <?=$this->context()->renderInContext('search/history-table.phtml', ['showSaved' => false]);?> - <a href="?purge=true"><i class="fa fa-remove" aria-hidden="true"></i> <?=$this->transEsc("history_purge")?></a> + <?php /* refs #17072: added url - GG */ ?> + <a href="<?= $this->url('search-history') ?>?purge=true"><i class="fa fa-remove" aria-hidden="true"></i> <?=$this->transEsc("history_purge")?></a> <?php else: ?> <?=$this->transEsc("history_no_searches")?> <?php endif; ?>