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/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..45d397b30f47cc94ad50a11a0f4dd0294846868d 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -3068,6 +3068,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/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/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];