diff --git a/local/config/vufind/config.ini b/local/config/vufind/config.ini index 882f6a16dbb7ad97fef82d9c826a4fcc413dc1bc..693da8d8ea259331358e83103c93f99922d8fd5d 100644 --- a/local/config/vufind/config.ini +++ b/local/config/vufind/config.ini @@ -92,6 +92,8 @@ defaultAccountPage = Profile admin_enabled = false ; Show sidebar on the left side instead of right sidebarOnLeft = false +; Show Details / Staff View in lightbox after click on button in toolbar +showStaffViewInLightbox = true ; Invert the sidebarOnLeft setting for right-to-left languages? mirrorSidebarInRTL = true ; Handle menu as an offcanvas slider at mobile sizes (in bootstrap3-based themes) diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index ec33cb04f364b689ce40396c9ddbd857ff2ade97..322c9ab554758cc80f43e9aa054bdb682a4467df 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -455,16 +455,31 @@ trait SolrMarcFincTrait */ public function getMediumOfPerformance() { - if ($field382 = $this->getMarcRecord()->getField('382')) { - return $this->getSubfieldArray( - $field382, - ['a'], - true, - ', ' - ); + $retval = []; + + if ($fields382 = $this->getMarcRecord()->getFields('382')) { + foreach ($fields382 as $i => $field) { + $subfields = $field->getSubfields(); + $retval[$i] = ''; + foreach ($subfields as $field) { + switch ($field->getCode()) { + case 'a': + if (empty($retval[$i])) { + $retval[$i] = $field->getData(); + } else { + $retval[$i] .= ', ' . $field->getData(); + } + break; + case 'b': + case 'n': + $retval[$i] .= ' ' . trim($field->getData()); + break; + } + } + } } - return []; + return $retval; } /** diff --git a/themes/finc/js/staff_view_button.js b/themes/finc/js/staff_view_button.js new file mode 100644 index 0000000000000000000000000000000000000000..744e2a8fc1969187ca1d0431d8471c39b7b0510c --- /dev/null +++ b/themes/finc/js/staff_view_button.js @@ -0,0 +1,34 @@ +/*global VuFind */ +$(document).ready(function() { + $('.staff-view-btn').on('click', function(event){ + event.preventDefault(); + + let link = $(this); + if (link.data('status') !== 'loading') { + link.data('status', 'loading'); + link.append('<span id="staffview_spinner"><i class="fa fa-spinner fa-spin" aria-hidden="true"></i><span>'); + $.ajax({ + url: VuFind.path + '/Record/'+link.data('id')+'/AjaxTab', + dataType:'html', + method: "POST", + data: {tab: "details"}, + success: function(data, textStatus, jqXHR) { + if (data && data.length > 0) { + VuFind.lightbox.render( + '<h2>' + link.text() + '</h2>' + data + ); + } else { + VuFind.lightbox.alert(VuFind.translate('error_occurred'), 'danger'); + } + link.data('status', ''); + $('#staffview_spinner').remove(); + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + VuFind.lightbox.alert("Status: " + textStatus + "<br >Error: " + errorThrown, 'danger'); + link.data('status', ''); + $('#staffview_spinner').remove(); + } + }); + } + }); +}); diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index 62190274dddde6c29a85055cc297028785df9bc5..12a4e2b53dbe0aeb4e671c8f00b31b87df8788f8 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -1998,6 +1998,18 @@ footer { } //// Search results +.result-body { + h2 { + margin: 0; + } +} + +// re-define header for records in list of result, #19396 +header { + background-color: transparent; + width: auto; +} + //// Add top padding to sidebar and content for better looks; .mainbody, .sidebar { @@ -3068,6 +3080,11 @@ footer ul { float: none !important; } +.modal td[data-title="openURL:"], +.modal .table-resp-data td { + word-break: break-word; +} + //// Set modal width to make better use of the screen @media (max-width: $screen-xs-max) { .modal-dialog { diff --git a/themes/finc/templates/Recommend/SideFacets/range-slider.phtml b/themes/finc/templates/Recommend/SideFacets/range-slider.phtml index 31a94bfef9261342ea71876881dca013bad5985f..d68f84ff8e5bebd4dfeadf6d90e3034deca56854 100644 --- a/themes/finc/templates/Recommend/SideFacets/range-slider.phtml +++ b/themes/finc/templates/Recommend/SideFacets/range-slider.phtml @@ -14,23 +14,27 @@ <?=$results->getUrlQuery()->asHiddenFields(['page' => "/./", 'filter' => "/^{$this->title}:.*/"])?> <input type="hidden" name="<?=$this->escapeHtmlAttr($this->facet['type'])?>range[]" value="<?=$this->escapeHtmlAttr($this->title)?>"/> <div class="date-fields"> - <?php $extraInputAttribs = ($this->facet['type'] == 'date') ? 'maxlength="4" ' : ''; ?> + <?php /* finc adds 'max="'.(date('Y')+1).' to prevent dates beyond the year + 1 to be entered; maxlength was causing w3c issues */ ?> + <?php $extraInputAttribs = ($this->facet['type'] == 'date') ? 'max="'.(date('Y')+1).'" ' : ''; ?> <div class="date-from"> <label id="from-label" for="<?=$this->escapeHtmlAttr($this->title)?>from"> <?=$this->transEsc('date_from')?>: </label> - <input type="text" class="form-control" name="<?=$this->escapeHtmlAttr($this->title)?>from" id="<?=$this->escapeHtmlAttr($this->title)?>from" value="<?=isset($this->facet['values'][0]) ? $this->escapeHtmlAttr($this->facet['values'][0]) : ''?>" <?=$extraInputAttribs?>/> + <?php /* finc changes this to number for consistency with adv search */ ?> + <input type="number" class="form-control" name="<?=$this->escapeHtmlAttr($this->title)?>from" id="<?=$this->escapeHtmlAttr($this->title)?>from" value="<?=isset($this->facet['values'][0]) ? $this->escapeHtmlAttr($this->facet['values'][0]) : ''?>" <?=$extraInputAttribs?>/> </div> <div class="date-to"> <label id="to-label" for="<?=$this->escapeHtmlAttr($this->title)?>to"> <?=$this->transEsc('date_to')?>: </label> - <input type="text" class="form-control" name="<?=$this->escapeHtmlAttr($this->title)?>to" id="<?=$this->escapeHtmlAttr($this->title)?>to" value="<?=isset($this->facet['values'][1]) ? $this->escapeHtmlAttr($this->facet['values'][1]) : ''?>" <?=$extraInputAttribs?>/> + <?php /* finc changes this to number for consistency with adv search */ ?> + <input type="number" class="form-control" name="<?=$this->escapeHtmlAttr($this->title)?>to" id="<?=$this->escapeHtmlAttr($this->title)?>to" value="<?=isset($this->facet['values'][1]) ? $this->escapeHtmlAttr($this->facet['values'][1]) : ''?>" <?=$extraInputAttribs?>/> </div> </div> <?php if ($this->facet['type'] == 'date'): ?> <?php /* next line finc specific, adds aria-label */?> - <div class="slider-container"><input type="text" class="hidden" id="<?=$this->escapeHtmlAttr($this->title)?><?=$this->escapeHtml($this->facet['type'])?>Slider" aria-label="<?=$this->transEsc('Range-from-to')?>"/></div> + <div class="slider-container"> + <input type="text" class="hidden" id="<?=$this->escapeHtmlAttr($this->title)?><?=$this->escapeHtml($this->facet['type'])?>Slider" aria-label="<?=$this->transEsc('Range-from-to')?>"/></div> <?php endif; ?> <input class="btn btn-default" type="submit" value="<?=$this->transEsc('Set')?>"/> </form> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml index 3ec38ca856e328fb6bc1e1ecd31d6374080dfdc5..e444addd9f72f6d878e6286bedba3e239ad40853 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml @@ -32,14 +32,17 @@ if ($cover): <?php endif ?> <div class="media-body"> <div class="result-body"> - <div> - <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang=""> - <?=$this->record($this->driver)->getTitleHtml()?> - </a> - </div> + <?php /* finc: add header element for title and author; use h2 for record title; #19396 */ ?> + <header> + <h2> + <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang=""> + <?=$this->record($this->driver)->getTitleHtml()?> + </a> + </h2> - <div> <?php if ($this->driver->isCollection()): ?> + </header> + <div> <?=implode('<br>', array_map([$this, 'escapeHtml'], $this->driver->getSummary())); ?> <?php else: ?> <?php $summAuthors = $this->driver->getPrimaryAuthorsWithHighlighting(); @@ -50,13 +53,15 @@ if ($cover): <a href="<?=$this->record($this->driver)->getLink('author', $this->highlight($summAuthor, null, true, false))?>" class="author"><?=$this->highlight($summAuthor)?></a><?=$i + 1 < $authorCount ? ',' : ''?> <?php endforeach; ?> <?php endif; ?> + </header> + <div> <?php /* finc-specific from here, #8639, #7345 - CK */ /* finc-specific: nxt line #8639 - CK */ ?> <?php $journalTitle = $this->driver->getContainerTitle(); $summDate = $this->driver->getPublishDateSort(); ?> <?php if (!empty($journalTitle)): ?> - <?=!empty($summAuthor) ? '<br />' : ''?> + <?php /* finc: remove linebreak #19396 */ ?> <?=$this->transEsc('Published in')?> <?php $containerSource = $this->driver->getSourceIdentifier(); ?> <?php $containerID = $this->driver->getContainerRecordID(); ?> @@ -65,7 +70,7 @@ if ($cover): <?php /* finc-specific: nxt line #8639 - CK */ ?> <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?> <?php elseif (!empty($summDate)): ?> - <?=!empty($summAuthor) ? '<br />' : ''?> + <?php /* finc: remove linebreak #19396 */ ?> <?php /* finc-specific: nxt line #8639 - CK */ ?> <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?> <?php endif; ?> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/toolbar.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/toolbar.phtml index 4241584c793f670dda8c822a34f80cfe4ec0f90d..4c5e138851d32ffff6f1932891bfa04b40e8a1f1 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/toolbar.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/toolbar.phtml @@ -23,6 +23,18 @@ <a class="cite-record" data-lightbox href="<?= $this->recordLink()->getActionUrl($this->driver, 'Cite') ?>" rel="nofollow"><i class="fa fa-asterisk" aria-hidden="true"></i> <?= $this->transEsc('Cite this') ?></a> </li> <?php endif; ?> + <?php if ($this->tabs['Details'] + && $this->config()->get('config')->Site->showStaffViewInLightbox ?? false): ?> + <li> + <a href="<?=$this->recordLink()->getTabUrl($this->driver, 'Details')?>" + data-title="<?=$this->translate('Staff View')?>" + data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" + class="staff-view-btn"> + <i class="fa fa-info-circle" aria-hidden="true"></i> <?=$this->translate('Staff View')?> + </a> + <?=$this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'staff_view_button.js', 'SET');?> + </li> + <?php endif; ?> <?php /* finc: we don't use sms, CK */ /* <?php if ($this->accountCapabilities()->getSmsSetting() !== 'disabled'): ?> diff --git a/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml b/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml index d6edbf31147404a0e6ef590d9cebf01b682b780e..025825b978b779f94988cbf6d0376f756c5606c9 100644 --- a/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml +++ b/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml @@ -37,13 +37,15 @@ if ($cover): <?php endif ?> <div class="media-body"> <div class="result-body"> - <div> - <?php /* We don't use links for missing records as they would lead nowhere - CK */ ?> - <span href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang=""> - <?=$this->record($this->driver)->getTitleHtml()?> - </span> - </div> - + <?php /* finc: add header element and use h2 for record title #19396 */ ?> + <header> + <h2> + <?php /* We don't use links for missing records as they would lead nowhere - CK */ ?> + <span href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang=""> + <?=$this->record($this->driver)->getTitleHtml()?> + </span> + </h2> + </header> <?php /* We don't display formats nor previews nor other details for missing records - CK */ ?> diff --git a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml index 6b0dbed4c441bd562fde9d656299f5d376218826..5c6d087734902e76972133d50d5f854754cf88c9 100644 --- a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml +++ b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml @@ -31,13 +31,17 @@ if ($cover): <?php endif ?> <div class="media-body"> <div class="result-body"> - <div> - <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang=""> - <?=$this->record($this->driver)->getTitleHtml()?> - </a> - </div> - <div> + <?php /* finc: add header element and use h2 for record title #19396 */ ?> + <header> + <h2> + <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang=""> + <?=$this->record($this->driver)->getTitleHtml()?> + </a> + </h2> + <?php if ($this->driver->isCollection()): ?> + </header> + <div> <?=implode('<br>', array_map([$this, 'escapeHtml'], $this->driver->getSummary())); ?> <?php else: ?> <?php $summAuthors = $this->driver->getPrimaryAuthorsWithHighlighting(); @@ -48,11 +52,13 @@ if ($cover): <a href="<?=$this->record($this->driver)->getLink('author', $this->highlight($summAuthor, null, true, false))?>" class="author"><?=$this->highlight($summAuthor)?></a><?=$i + 1 < $authorCount ? ',' : ''?> <?php endforeach; ?> <?php endif; ?> + </header> + <div> <?php /* finc-specific from here - 04.16 - CK */ ?> <?php $journalTitle = $this->driver->getContainerTitle(); $summDate = $this->driver->getPublishDateSort(); ?> <?php if (!empty($journalTitle)): ?> - <?=!empty($summAuthor) ? '<br />' : ''?> + <?php /* finc: remove linebreak #19396 */ ?> <?=$this->transEsc('Published in')?> <?php $containerSource = $this->driver->getSourceIdentifier(); $containerID = $this->driver->getContainerRecordID(); @@ -76,7 +82,7 @@ if ($cover): <?php /* finc-specific -END - 04.16 - CK */ ?> <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?> <?php elseif (!empty($summDate)): ?> - <?=!empty($summAuthor) ? '<br />' : ''?> + <?php /* finc: remove linebreak #19396 */ ?> <?php /* finc-specific: nxt line #8639 - CK */ ?> <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?> <?php endif; ?> diff --git a/themes/finc/templates/collection/view.phtml b/themes/finc/templates/collection/view.phtml index 057474afed69e6f01dd3e1425f0b714c716d6bff..2179d5cb00cf3319fad98a4ece3235c51298e4d1 100644 --- a/themes/finc/templates/collection/view.phtml +++ b/themes/finc/templates/collection/view.phtml @@ -7,15 +7,15 @@ if ($this->syndeticsPlus()->isActive()) { $this->headScript()->appendFile($this->syndeticsPlus()->getScript()); } - + // Add RDF header link if applicable: if ($this->export()->recordSupportsFormat($this->driver, 'RDF')) { $this->headLink()->appendAlternate($this->recordLink()->getActionUrl($this->driver, 'RDF'), 'application/rdf+xml', 'RDF Representation'); } - + // Set flag for special cases relating to full-width hierarchy tree tab: $tree = (strtolower($this->activeTab) == 'hierarchytree'); - + // Set up breadcrumbs: $lastSearch = $this->searchMemory()->getLastSearchLink($this->transEsc('Search')); if (!empty($lastSearch)) { @@ -44,6 +44,14 @@ <ul class="nav nav-tabs"> <?php foreach ($this->tabs as $tab => $obj): ?> <?php // add current tab to breadcrumbs if applicable: + + if (strtolower($tab) === 'details' + && $this->config()->get('config')->Site->showStaffViewInLightbox + && strtolower($this->activeTab) !== 'details' /* load in new browser tab after right click */) { + // #21993 show button for staff view in toolbar instead + continue; + } + $desc = $obj->getDescription(); $tab_classes = []; if (0 === strcasecmp($this->activeTab, $tab)) { diff --git a/themes/finc/templates/record/view.phtml b/themes/finc/templates/record/view.phtml index 076ef6fb512970578a5aac9a2f531bdacdc6a6c8..eb4c40ee8c3a146db8fa915a01d5b1de2db4d17a 100644 --- a/themes/finc/templates/record/view.phtml +++ b/themes/finc/templates/record/view.phtml @@ -7,12 +7,12 @@ if ($this->syndeticsPlus()->isActive()) { $this->headScript()->appendFile($this->syndeticsPlus()->getScript()); } - + // Add RDF header link if applicable: if ($this->export()->recordSupportsFormat($this->driver, 'RDF')) { $this->headLink()->appendAlternate($this->recordLink()->getActionUrl($this->driver, 'RDF'), 'application/rdf+xml', 'RDF Representation'); } - + // Set up breadcrumbs: $this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') . '<li class="active" aria-current="page">' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> '; @@ -47,6 +47,13 @@ <ul class="nav nav-tabs"> <?php foreach ($this->tabs as $tab => $obj): ?> <?php // add current tab to breadcrumbs if applicable: + + if (strtolower($tab) === 'details' + && $this->config()->get('config')->Site->showStaffViewInLightbox + && strtolower($this->activeTab) !== 'details' /* load in new browser tab after right click */) { + // #21993 show button for staff view in toolbar instead + continue; + } $desc = $obj->getDescription(); $tabName = preg_replace("/\W/", "-", strtolower($tab)); $tabClasses = ['record-tab', $tabName]; diff --git a/themes/finc/templates/search/advanced/ranges.phtml b/themes/finc/templates/search/advanced/ranges.phtml index bad19945e1b1cf91b1015f2c3f76682bba306f6d..aa7cfbac64068a75b1d7a5d474fd452f4456d3a4 100644 --- a/themes/finc/templates/search/advanced/ranges.phtml +++ b/themes/finc/templates/search/advanced/ranges.phtml @@ -2,7 +2,8 @@ <?php if (isset($this->ranges) && !empty($this->ranges)): ?> <?php $params = $this->searchParams($this->searchClassId); $params->activateAllFacets(); ?> <?php foreach ($this->ranges as $current): $escField = $this->escapeHtmlAttr($current['field']); ?> - <?php $extraInputAttribs = ($current['type'] == 'date') ? 'maxlength="4" ' : ''; ?> + <?php /* finc adds 'max="'.(date('Y')+1).' to prevent dates beyond the year + 1 to be entered; maxlength was causing w3c issues */ ?> + <?php $extraInputAttribs = ($current['type'] == 'date') ? 'max="'.(date('Y')+1).'" ' : ''; ?> <?php /* #18306: alignment left to result - GG */ ?> <fieldset class="range left"> <legend><?=$this->transEsc($params->getFacetLabel($current['field']))?></legend> @@ -10,11 +11,11 @@ <div class="date-fields"> <div class="date-from"> <label id="from-label" for="<?=$escField?>from"><?=$this->transEsc('date_from')?>:</label> - <input type="text" name="<?=$escField?>from" id="<?=$escField?>from" value="<?=isset($current['values'][0])?$this->escapeHtmlAttr($current['values'][0]):''?>" class="form-control" <?=$extraInputAttribs?>/> + <input type="number" name="<?=$escField?>from" id="<?=$escField?>from" value="<?=isset($current['values'][0])?$this->escapeHtmlAttr($current['values'][0]):''?>" class="form-control" <?=$extraInputAttribs?>/> </div> <div class="date-to"> <label id="to-label" for="<?=$escField?>to"><?=$this->transEsc('date_to')?>:</label> - <input type="text" name="<?=$escField?>to" id="<?=$escField?>to" value="<?=isset($current['values'][1])?$this->escapeHtmlAttr($current['values'][1]):''?>" class="form-control" <?=$extraInputAttribs?>/> + <input type="number" name="<?=$escField?>to" id="<?=$escField?>to" value="<?=isset($current['values'][1])?$this->escapeHtmlAttr($current['values'][1]):''?>" class="form-control" <?=$extraInputAttribs?>/> </div> </div> <?php if ($current['type'] == 'date'): ?>