diff --git a/docker-env.0.finc.yml b/docker-env.0.finc.yml index 68452924bcae45c4fe104bf7a89b2719937c5d53..f252aa0761d9b9a1381bf8f0a9df283d465f3c63 100644 --- a/docker-env.0.finc.yml +++ b/docker-env.0.finc.yml @@ -54,7 +54,9 @@ autoconfig: username: dev password: dev searches.ini: - IndexShards: {} + IndexShards: + ai: ai.ub.uni-leipzig.de/solr/biblio + main: index.ub.uni-leipzig.de/solr/biblio searchspecs.yaml: "@parent_yaml": "../../../config/vufind/searchspecs.yaml" diff --git a/local/alpha/config/vufind/config.ini b/local/alpha/config/vufind/config.ini index eccc6eab2d024bf284d5960a0de6918f8d237674..eb8563c323db3cb8bc8e4962761b0493749d3d9a 100644 --- a/local/alpha/config/vufind/config.ini +++ b/local/alpha/config/vufind/config.ini @@ -33,3 +33,7 @@ tags=enabled max_tag_length=64 case_sensitive_tags=false show_solr_options_in_tag_search=true + +[Index] +; finc main +url = https://index.ub.uni-leipzig.de/solr \ No newline at end of file diff --git a/local/alpha/config/vufind/searches.ini b/local/alpha/config/vufind/searches.ini index 130d6f41c5997312bbe2112a6755e6ff8b52ed58..c259bc11f28286b2a81579ecd8e5f050c11f314c 100644 --- a/local/alpha/config/vufind/searches.ini +++ b/local/alpha/config/vufind/searches.ini @@ -22,4 +22,8 @@ relative_path = ../../../config/vufind/searches.ini ;#################################################################### [General] -highlighting = true \ No newline at end of file +highlighting = true + +[IndexShards] +ai = ai.ub.uni-leipzig.de/solr/biblio +main = index.ub.uni-leipzig.de/solr/biblio \ No newline at end of file diff --git a/local/config/vufind/SolrAI.ini b/local/config/vufind/SolrAI.ini index 6ef65a61a1cb3ad7234c94066064c153006d1bf0..40ac997175e1b3d26edfb9261014750c3bfea8d1 100644 --- a/local/config/vufind/SolrAI.ini +++ b/local/config/vufind/SolrAI.ini @@ -1,3 +1,2 @@ [General] -; Set the URI-pattern of the server which serves the raw Ai-record-data. -;baseUrl = "http://localhost/blob?%s" +baseUrl = "https://ai.ub.uni-leipzig.de/blob?%s" \ No newline at end of file diff --git a/local/config/vufind/config.ini b/local/config/vufind/config.ini index 930b4625c6f088491cc2d904275b616407ee0cb4..7f6c0d7c9ea257ceb2af078fd01c379c19319482 100644 --- a/local/config/vufind/config.ini +++ b/local/config/vufind/config.ini @@ -387,7 +387,7 @@ recordsBySource = false ; url can also be an array of servers. If so, VuFind will try the servers one by one ; until one can be reached. This is only useful for advanced fault-tolerant Solr ; installations. -url = http://localhost:8080/solr +url = https://index.ub.uni-leipzig.de/solr default_core = biblio ; This setting needs to match the <maxBooleanClauses> setting in your solrconfig.xml ; file; when VuFind has to look up large numbers of records using ID values, it may @@ -635,7 +635,7 @@ coverimagesCache = true ; Otherwise, you can use noCoverAvailableImage to specify a ; path relative to the base of your theme directory for a static image to display. -noCoverAvailableImage = images/noCover2.gif +noCoverAvailableImage = images/noCoverEmpty.gif ; You can select from Syndetics, SyndeticsPlus, Amazon Editorial, Amazon, Booksite ; and/or the Guardian diff --git a/local/config/vufind/searches.ini b/local/config/vufind/searches.ini index 1755366b266c17057da838ee76691cda9bb653ed..64ab99beb2ddc6f028d4c2c8a8e4196590d2f9a6 100644 --- a/local/config/vufind/searches.ini +++ b/local/config/vufind/searches.ini @@ -539,9 +539,11 @@ topic = "Subjects" ; Leave this commented out to disable sharding. ; To use sharding, simply fill in lines using the format: ; [display name of shard] = [URL of shard (without http://)] -;[IndexShards] +[IndexShards] ;Library Catalog = localhost:8080/solr/biblio ;Website = localhost:8080/solr/website +ai = ai.ub.uni-leipzig.de/solr/biblio +main = index.ub.uni-leipzig.de/solr/biblio ; This section allows you to set preferences for shards display. You only need to ; set these if you want to use shards. See also the [StripFields] section below diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index ecf42016f54dc70d5771fe8c0667493b58d1c9d4..401440dc5d3a359c44d3430868fd3fbff2128119 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -155,7 +155,7 @@ $config = [ 'finc\RecordTab\AcquisitionPDA' => 'Zend\ServiceManager\Factory\InvokableFactory', 'finc\RecordTab\Topics' => 'Zend\ServiceManager\Factory\InvokableFactory', 'finc\RecordTab\DescriptionLido' => 'Zend\ServiceManager\Factory\InvokableFactory', - 'finc\RecordTab\HierarchyTree' => 'VuFind\RecordTab\Factory::getHierarchyTree', + 'finc\RecordTab\HierarchyTree' => 'finc\RecordTab\HierarchyTreeFactory', ], 'aliases' => [ 'VuFind\RecordTab\HierarchyTree' => 'finc\RecordTab\HierarchyTree', diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index 88a0c6846b618f6f94a4fdfebb2c037e637dbab6..74fc5a99320981ccb6a500519b3107089b41296b 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -116,43 +116,18 @@ 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'); } - - - 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); + $tmpArr = array_unique($tmpArr); + $desc = implode(', ', $tmpArr); // If no description take url as description // For 856[40] url denoting resource itself @@ -175,10 +150,7 @@ trait SolrMarcFincTrait $retVal ) ) { - $retVal[] = [ - 'url' => $address, 'desc' => $desc, - 'indicators' => $indicator1.$indicator2 - ]; + $retVal[] = ['url' => $address, 'desc' => $desc]; } } } diff --git a/module/finc/src/finc/RecordTab/HierarchyTree.php b/module/finc/src/finc/RecordTab/HierarchyTree.php index 1c6eb81bf947106e5e0621c3f4f0f9be5b0860b3..cfc6a02c43cc86cde7eb86e3cc1a79e0bcab68a3 100644 --- a/module/finc/src/finc/RecordTab/HierarchyTree.php +++ b/module/finc/src/finc/RecordTab/HierarchyTree.php @@ -45,23 +45,6 @@ class HierarchyTree extends \VuFind\RecordTab\HierarchyTree */ protected $treeList = null; - /** - * Configuration - * - * @var \Zend\Config\Config - */ - protected $config = null; - - /** - * Constructor - * - * @param \Zend\Config\Config $config Configuration - */ - public function __construct(\Zend\Config\Config $config) - { - $this->config = $config; - } - public function getDescription() { if ($this->driver->isCollection()) return 'collection_hierarchy_tree_tab'; diff --git a/module/finc/src/finc/RecordTab/HierarchyTreeFactory.php b/module/finc/src/finc/RecordTab/HierarchyTreeFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..7c2b1c7672f2964a0a503da611a91fbc9c3c478d --- /dev/null +++ b/module/finc/src/finc/RecordTab/HierarchyTreeFactory.php @@ -0,0 +1,63 @@ +<?php +/** + * Record Tab Invokable Factory Class + * for HierarchyTree tab + * + * PHP version 7 + * + * Copyright (C) Leipzig University Library, 2020. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category VuFind + * @package RecordTab + * @author Dorian Merz <merz@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:hierarchy_components Wiki + */ +namespace finc\RecordTab; + +use Zend\ServiceManager\ServiceManager; + +/** + * Record Tab Invokable Factory Class + * for HierarchyTree tab + * + * @category VuFind + * @package RecordTab + * @author Dorian Merz <merz@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:hierarchy_components Wiki + * + * @codeCoverageIgnore + */ +class HierarchyTreeFactory +{ + /** + * Factory for HierarchyTree tab plugin. + * + * @param ServiceManager $sm Service manager. + * + * @return HierarchyTree + */ + public function __invoke(ServiceManager $sm, $requestedName, array $options = null) + { + if (!empty($options)) { + throw new \ConfigurationException('Unexpected options'); + } + return new $requestedName( + $sm->get('VuFind\Config\PluginManager')->get('config') + ); + } +} diff --git a/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php index 5d3672c0b4b64a7e4af23578902dbd4bcd4838a3..295fa6477787528846016bd69fb48f959e3cc542 100644 --- a/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php +++ b/module/finc/src/finc/View/Helper/Root/RecordDataFormatterFactory.php @@ -60,21 +60,31 @@ class RecordDataFormatterFactory 'collection-record', [$this, 'getDefaultCollectionRecordSpecs'] ); - $helper->setDefaults('core', [$this, 'getDefaultCoreSpecs']); + $helper->setDefaults( + 'core', + [$this, 'getDefaultCoreSpecs'] + ); $helper->setDefaults( 'description', [$this, 'getDefaultDescriptionSpecs'] ); - - $helper->setDefaults('core-ai', [$this, 'getAiCoreSpecs']); - - $helper->setDefaults('core-lido', [$this, 'getLidoCoreSpecs']); + $helper->setDefaults( + 'core-ai', + [$this, 'getAiCoreSpecs'] + ); + $helper->setDefaults( + 'core-lido', + [$this, 'getLidoCoreSpecs'] + ); $helper->setDefaults( 'description-lido', [$this, 'getLidoDescriptionSpecs'] ); + $helper->setDefaults( + 'core-marc', + [$this, 'getMarcCoreSpecs'] + ); - $helper->setDefaults('core-marc', [$this, 'getMarcCoreSpecs']); return $helper; } diff --git a/themes/finc/images/noCoverEmpty.gif b/themes/finc/images/noCoverEmpty.gif new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index c7c3e947032f2993164611e444831ae815a12345..a4ce7deba76770df5f26405e51a8a788e4fd1c1f 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -1682,6 +1682,12 @@ footer { width: 100%; } +// push record view icon to right (Desktop) on left-aligned sidebars -- pls NOTE: required offcanvas = true +.offcanvas-left .media-left { + @media (min-width: $screen-sm-min) { + float: right; + } +} //// Off-Canvas - END // SEARCH CONTROLS - END @@ -2670,6 +2676,9 @@ input { // Account - END +// Dropdown Toggler color +// WARNING: Potential Breaking Change! e.g. bookbag delete button with dropdown -- could result in white text on white background --> introduce variable "$btn-transparent-active-color" in custom themes and define color +// FIXME: MOVE TO buttons or dropdowns section .open .btn-transparent.dropdown-toggle { &[aria-expanded="true"] { color: $btn-transparent-active-color; diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/core.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/core.phtml index a2dfff1cc2c007b2733b4e35bee0a64720dc0205..dc3020e57e137e151cf6a2d0a5e77ff49b5b5cb2 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/core.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/core.phtml @@ -1,7 +1,7 @@ <!-- finc: RecordDriver - DefaultRecord - core --> -<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> +<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?= $this->driver->getSchemaOrgFormats() ?> Product"> <?php /* finc: use VF5.1 offcanvas toggler here as well if you have a custom sidebar - CK */ ?> - <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> + <?= $this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> <?php $QRCode = $this->record($this->driver)->getQRCode("core"); $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); @@ -9,35 +9,38 @@ $preview = $this->record($this->driver)->getPreviews(); ?> <?php if ($QRCode || $cover || $preview): ?> - <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> + <div class="media-left <?= $this->escapeHtmlAttr($coverDetails['size']) ?> img-col"> <?php /* Display thumbnail if appropriate: */ ?> <?php if ($cover): ?> - <?=$cover?> - <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, false position - GG */ ?> + <object type="image/jpeg" data="<?=$coverDetails['link']?>"> + <?= $this->record($this->driver)->getRecordIcon() ?> + </object> <?php endif; ?> <?php /* Display qrcode if appropriate: */ ?> <?php if ($QRCode): ?> <span class="hidden-xs"> - <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + <br/><img alt="<?= $this->transEsc('QR Code') ?>" class="qrcode" src="<?= $this->escapeHtmlAttr($QRCode); ?>"/> </span> <?php endif; ?> <?php // if you have a preview tab but want to move or remove the preview link // from this area of the record view, this can be split into // getPreviewData() (should stay here) and - // getPreviewLink() (can go in your desired tab) ?> + // getPreviewLink() (can go in your desired tab)?> <?php if ($preview): ?> <div class="record-previews"> - <?=$preview?> + <?= $preview ?> </div> <?php endif; ?> </div> - <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, right position - GG */ ?> - <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> - <?=$this->record($this->driver)->getRecordIcon()?> - <?php /* EOF - finc-specific StyleBasedIcons */ ?> - <?php endif; ?> + <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> + <?php /* BOF - finc-specific StyleBasedIcons */ ?> + <div class="media-left <?= $this->escapeHtmlAttr($coverDetails['size']) ?> img-col"> + <?= $this->record($this->driver)->getRecordIcon() ?> + </div> + <?php endif; ?> + <div class="media-body"> <?php /* finc: We want to get rid of trailing special chars in the title and limit its length to 100 chars; @@ -45,22 +48,23 @@ */ ?> <?php /* finc: add schema tags for title #13850 - VE */ ?> - <h1 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h1> + <h1 + property="name"><?= $this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100))) ?></h1> <?php $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> <?php if ($summary): ?> - <p><?=$this->truncate($summary, 300)?></p> + <p><?= $this->truncate($summary, 300) ?></p> <?php if (strlen($summary) > 300): ?> - <p class="hidden-print"><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> + <p class="hidden-print"><a href='<?= $this->recordLink()->getTabUrl($this->driver, 'Description') ?>#tabnav'><?= $this->transEsc('Full description') ?></a></p> <?php endif; ?> <?php endif; ?> <?php if ($this->userlist()->getMode() !== 'disabled'): ?> <?php /* Display the lists that this record is saved to */ ?> <div class="savedLists hidden alert alert-info"> - <strong><?=$this->transEsc("Saved in")?>:</strong> + <strong><?= $this->transEsc("Saved in") ?>:</strong> </div> <?php endif; ?> @@ -72,11 +76,11 @@ <?php if (!empty($coreFields)): ?> <?php /* include responsive data table - CK */ ?> <table class="table table-striped table-resp-data"> - <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <caption class="sr-only"><?= $this->transEsc('Bibliographic Details') ?></caption> <?php foreach ($coreFields as $current): ?> <tr> - <th><?=$this->transEsc($current['label'])?>:</th> - <td data-title="<?= $this->transEsc($current['label']) ?>:"><?=$current['value']?></td> + <th><?= $this->transEsc($current['label']) ?>:</th> + <td data-title="<?= $this->transEsc($current['label']) ?>:"><?= $current['value'] ?></td> </tr> <?php endforeach; ?> </table> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml index f0bbc18324d27c90f7d0554fd1a24a60a4bbd609..9980b4f57099b2500c19e7fad5cef79f2cc8a3fb 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml @@ -221,7 +221,7 @@ if ($cover): <ul class="dropdown-menu" role="menu" aria-labelledby="<?= $dLabel ?>"> <li> <?php /* #17711 give user feedback and dont reload page after deleting */ ?> - <a title="<?= $this->transEsc('confirm_delete_brief') ?>" onClick="$.post( + <a href="javascript:document.getElementById('<?=$dLabel?>').focus();" title="<?= $this->transEsc('confirm_delete_brief') ?>" onClick="$.post( '<?= $deleteUrl ?>', { 'delete':'<?= $this->escapeJs($id) ?>', @@ -246,7 +246,7 @@ if ($cover): <?= $this->transEsc('confirm_dialog_yes') ?> </a> </li> - <li><a href="#"><?= $this->transEsc('confirm_dialog_no') ?></a></li> + <li><a href="javascript:document.getElementById('<?=$dLabel?>').focus();"><?=$this->transEsc('confirm_dialog_no')?></a></li> </ul> </div> diff --git a/themes/finc/templates/RecordDriver/SolrAI/core.phtml b/themes/finc/templates/RecordDriver/SolrAI/core.phtml index b5bfed995248d6a20647bd1f314dc3a6196a44a6..1ca3a8236e485a28a1825d13d4816a5efe5c631b 100644 --- a/themes/finc/templates/RecordDriver/SolrAI/core.phtml +++ b/themes/finc/templates/RecordDriver/SolrAI/core.phtml @@ -1,8 +1,8 @@ <!-- finc: recordDriver - SolrAI - core --> <?php /* Created in 4826, based on DefaultRecord/core, compare with DefaultRecord/core during updates! */ ?> -<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> +<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?= $this->driver->getSchemaOrgFormats() ?> Product"> <?php /* finc: use VF5.1 offcanvas toggler here as well if you have a custom sidebar - CK */ ?> - <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> + <?= $this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> <?php $QRCode = $this->record($this->driver)->getQRCode("core"); $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); @@ -10,34 +10,36 @@ $preview = $this->record($this->driver)->getPreviews(); ?> <?php if ($QRCode || $cover || $preview): ?> - <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> + <div class="media-left <?= $this->escapeHtmlAttr($coverDetails['size']) ?> img-col"> <?php /* Display thumbnail if appropriate: */ ?> - <?php if($cover): ?> - <?=$cover?> - <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, false position - GG */ ?> + <?php if ($cover): ?> + <object type="image/jpeg" data="<?=$coverDetails['link']?>"> + <?= $this->record($this->driver)->getRecordIcon() ?> + </object> <?php endif; ?> <?php /* Display qrcode if appropriate: */ ?> - <?php if($QRCode): ?> + <?php if ($QRCode): ?> <span class="hidden-xs"> - <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + <br/><img alt="<?= $this->transEsc('QR Code') ?>" class="qrcode" src="<?= $this->escapeHtmlAttr($QRCode); ?>"/> </span> <?php endif; ?> <?php // if you have a preview tab but want to move or remove the preview link // from this area of the record view, this can be split into // getPreviewData() (should stay here) and - // getPreviewLink() (can go in your desired tab) ?> + // getPreviewLink() (can go in your desired tab)?> <?php if ($preview): ?> <div class="record-previews"> - <?=$preview?> + <?= $preview ?> </div> <?php endif; ?> </div> - <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, right position - GG */ ?> <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> - <?=$this->record($this->driver)->getRecordIcon()?> - <?php /* EOF - finc-specific StyleBasedIcons */ ?> + <?php /* BOF - finc-specific StyleBasedIcons */ ?> + <div class="media-left <?= $this->escapeHtmlAttr($coverDetails['size']) ?> img-col"> + <?= $this->record($this->driver)->getRecordIcon() ?> + </div> <?php endif; ?> <div class="media-body"> @@ -46,25 +48,27 @@ */ ?> <?php /* finc: add schema tags for title #13850 - VE */ ?> - <h1 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h1> + <h1 + property="name"><?= $this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100))) ?></h1> - <?php $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> + <?php $summary = $this->driver->getSummary(); + $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> <?php if ($summary): ?> - <p><?=$this->truncate($summary, 300)?></p> + <p><?= $this->truncate($summary, 300) ?></p> - <?php if(strlen($summary) > 300): ?> - <p class="hidden-print"><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> + <?php if (strlen($summary) > 300): ?> + <p class="hidden-print"><a href='<?= $this->recordLink()->getTabUrl($this->driver, 'Description') ?>#tabnav'><?= $this->transEsc('Full description') ?></a></p> <?php endif; ?> <?php endif; ?> <?php if ($this->userlist()->getMode() !== 'disabled'): ?> <?php /* Display the lists that this record is saved to */ ?> <div class="savedLists hidden alert alert-info"> - <strong><?=$this->transEsc("Saved in")?>:</strong> + <strong><?= $this->transEsc("Saved in") ?>:</strong> </div> <?php endif; ?> - <?php /* Display Main Details */?> + <?php /* Display Main Details */ ?> <?php $formatter = $this->recordDataFormatter(); $coreFields = $formatter->getData($driver, $formatter->getDefaults('core-ai')); @@ -72,17 +76,20 @@ <?php if (!empty($coreFields)): ?> <?php /* include responsive data table - CK */ ?> <table class="table table-striped table-resp-data"> - <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <caption class="sr-only"><?= $this->transEsc('Bibliographic Details') ?></caption> <?php foreach ($coreFields as $current): ?> <?php if ($current['label'] == null): ?> - <?=$current['value']?> + <?= $current['value'] ?> <?php else: ?> - <tr><th><?=$this->transEsc($current['label'])?>:</th><td data-title="<?= $this->transEsc($current['label']) ?>:"><?=$current['value']?></td></tr> + <tr> + <th><?= $this->transEsc($current['label']) ?>:</th> + <td><?= $current['value'] ?></td> + </tr> <?php endif; ?> <?php endforeach; ?> </table> <?php endif; ?> - <?php /* End Main Details */?> - </div> + <?php /* End Main Details */ ?> </div> +</div> <!-- recordDriver - solrAI - CORE - END --> diff --git a/themes/finc/templates/RecordDriver/SolrMarc/core.phtml b/themes/finc/templates/RecordDriver/SolrMarc/core.phtml index 2992f9689845f3b9d5c716c4ef7af9db27bf9b1c..21d74fbc3a3f80b515b648ffa48ff6bb5930723a 100644 --- a/themes/finc/templates/RecordDriver/SolrMarc/core.phtml +++ b/themes/finc/templates/RecordDriver/SolrMarc/core.phtml @@ -1,46 +1,46 @@ <!-- finc: RecordDriver - solrMarc - core --> <?php /* based on DefaultRecord/core, compare with DefaultRecord/core during updates! */ ?> -<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> +<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?= $this->driver->getSchemaOrgFormats() ?> Product"> <?php /* finc: use VF5.1 offcanvas toggler here as well if you have a custom sidebar - CK */ ?> - <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> + <?= $this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> <?php $QRCode = $this->record($this->driver)->getQRCode("core"); - $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); + $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('medium')); $cover = $coverDetails['html']; $preview = $this->record($this->driver)->getPreviews(); ?> <?php if ($QRCode || $cover || $preview): ?> <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> <?php /* Display thumbnail if appropriate: */ ?> - <?php if($cover): ?> - <?=$cover?> - <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, false position - GG */ ?> + <?php if ($cover): ?> + <object type="image/jpeg" data="<?=$coverDetails['link']?>"> + <?= $this->record($this->driver)->getRecordIcon() ?> + </object> <?php endif; ?> <?php /* Display qrcode if appropriate: */ ?> - <?php if($QRCode): ?> + <?php if ($QRCode): ?> <span class="hidden-xs"> - <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + <br/><img alt="<?= $this->transEsc('QR Code') ?>" class="qrcode" src="<?= $this->escapeHtmlAttr($QRCode); ?>"/> </span> <?php endif; ?> <?php // if you have a preview tab but want to move or remove the preview link // from this area of the record view, this can be split into // getPreviewData() (should stay here) and - // getPreviewLink() (can go in your desired tab) ?> + // getPreviewLink() (can go in your desired tab)?> <?php if ($preview): ?> <div class="record-previews"> - <?=$preview?> + <?= $preview ?> </div> <?php endif; ?> </div> - <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, right position - GG */ ?> - <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> + <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> <?php /* BOF - finc-specific StyleBasedIcons */ ?> - <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> - <?=$this->record($this->driver)->getRecordIcon()?> + <div class="media-left <?= $this->escapeHtmlAttr($coverDetails['size']) ?> img-col"> + <?= $this->record($this->driver)->getRecordIcon() ?> </div> - <?php endif; ?> + <?php endif; ?> <div class="media-body"> <?php /* finc: We want to get rid of trailing special chars in the title and limit its length to 100 chars; @@ -48,25 +48,27 @@ */ ?> <?php /* finc: add schema tags for title #13850 - VE */ ?> - <h1 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h1> + <h1 + property="name"><?= $this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100))) ?></h1> - <?php $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> + <?php $summary = $this->driver->getSummary(); + $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> <?php if ($summary): ?> - <p><?=$this->truncate($summary, 300)?></p> + <p><?= $this->truncate($summary, 300) ?></p> - <?php if(strlen($summary) > 300): ?> - <p class="hidden-print"><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>#tabnav'><?=$this->transEsc('Full description')?></a></p> + <?php if (strlen($summary) > 300): ?> + <p class="hidden-print"><a href='<?= $this->recordLink()->getTabUrl($this->driver, 'Description') ?>#tabnav'><?= $this->transEsc('Full description') ?></a></p> <?php endif; ?> <?php endif; ?> <?php if ($this->userlist()->getMode() !== 'disabled'): ?> <?php /* Display the lists that this record is saved to */ ?> - <div class="savedLists hidden alert alert-info"> - <strong><?=$this->transEsc("Saved in")?>:</strong> + <div class="savedLists hidden alert alert-info"> + <strong><?= $this->transEsc("Saved in") ?>:</strong> </div> <?php endif; ?> - <?php /* Display Main Details */?> + <?php /* Display Main Details */ ?> <?php $formatter = $this->recordDataFormatter(); $coreFields = $formatter->getData($driver, $formatter->getDefaults('core-marc')); @@ -74,20 +76,20 @@ <?php if (!empty($coreFields)): ?> <?php /* include responsive data table - CK */ ?> <table class="table table-striped table-resp-data"> - <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <caption class="sr-only"><?= $this->transEsc('Bibliographic Details') ?></caption> <?php foreach ($coreFields as $current): ?> <?php if ($current['label'] == null): ?> - <?=$current['value']?> + <?= $current['value'] ?> <?php else: ?> <tr> - <th><?=$this->transEsc($current['label'])?>:</th> - <td data-title="<?= $this->transEsc($current['label']) ?>:"><?=$current['value']?></td> + <th><?= $this->transEsc($current['label']) ?>:</th> + <td data-title="<?= $this->transEsc($current['label']) ?>:"><?= $current['value'] ?></td> </tr> <?php endif; ?> <?php endforeach; ?> </table> <?php endif; ?> - <?php /* End Main Details */?> - </div> + <?php /* End Main Details */ ?> </div> +</div> <!-- finc: RecordDriver - solrMarc - core - END --> diff --git a/themes/finc/templates/search/advanced/layout.phtml b/themes/finc/templates/search/advanced/layout.phtml index a7f4c048d40273945e2db99d5b19e3d0817b3919..a2b6a6e2f4120eb483f1d7e568681f642b8a6816 100644 --- a/themes/finc/templates/search/advanced/layout.phtml +++ b/themes/finc/templates/search/advanced/layout.phtml @@ -128,7 +128,7 @@ if (isset($searchDetails) && is_object($searchDetails)) { <?php endfor; ?> </div> <div class="adv-group-match"> - <label class="search_bool"><?=$this->transEsc("search_match")?>: </label> + <label class="search_bool" for="search_bool<?=$group ?>"><?=$this->transEsc("search_match")?>: </label> <select name="bool<?=$group ?>[]" id="search_bool<?=$group ?>" class="form-control"> <option value="AND"<?php if(isset($setSearchGroups[$group]) && 'AND' == $setSearchGroups[$group]):?> selected<?php endif;?>><?=$this->transEsc("search_AND")?></option> <option value="OR"<?php if(isset($setSearchGroups[$group]) && 'OR' == $setSearchGroups[$group]):?> selected<?php endif;?>><?=$this->transEsc("search_OR")?></option> diff --git a/themes/finc/templates/search/advanced/limit.phtml b/themes/finc/templates/search/advanced/limit.phtml new file mode 100644 index 0000000000000000000000000000000000000000..3a48c286d3ff45643374b11c44fe93e25d0941f7 --- /dev/null +++ b/themes/finc/templates/search/advanced/limit.phtml @@ -0,0 +1,21 @@ +<!-- finc: search - advanced - limit --> +<?php + // Set up convenience variables: + $limitList = $this->options->getLimitOptions(); + + // If a previous limit was used, make that the default; otherwise, use the "default default" + $lastLimit = $this->searchMemory()->getLastLimit($this->options->getSearchClassId()); + $defaultLimit = empty($lastLimit) ? $this->options->getDefaultLimit() : $lastLimit; +?> +<?php if (count($limitList) > 1): ?> + <fieldset class="limits"> + <legend><?=$this->transEsc('Results per page')?></legend> + <select id="limit" name="limit" class="form-control"> + <?php foreach ($limitList as $limitVal): ?> + <option value="<?=$this->escapeHtmlAttr($limitVal)?>" <?=($limitVal == $defaultLimit) ? 'selected="selected"' : ''?>><?=$this->escapeHtml($limitVal)?></option> + <?php endforeach; ?> + </select> + <label for="limit"><?=$this->transEsc('Limit To')?></label> + </fieldset> +<?php endif; ?> +<!-- finc: search - advanced - limit - END --> \ No newline at end of file diff --git a/themes/finc/templates/search/advanced/ranges.phtml b/themes/finc/templates/search/advanced/ranges.phtml new file mode 100644 index 0000000000000000000000000000000000000000..d0fc25eb2eda414af9dcf93b0e7364338b2c195e --- /dev/null +++ b/themes/finc/templates/search/advanced/ranges.phtml @@ -0,0 +1,76 @@ +<!-- finc: search - advanced - ranges --> +<?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" ' : ''; ?> + <fieldset class="range"> + <legend><?=$this->transEsc($params->getFacetLabel($current['field']))?></legend> + <input type="hidden" name="<?=$this->escapeHtmlAttr($current['type'])?>range[]" value="<?=$escField?>"/> + <div class="date-fields"> + <div class="date-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?>/> + </div> + <div class="date-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?>/> + </div> + </div> + <?php if ($current['type'] == 'date'): ?> + <div class="slider-container"> + <label for="<?=$escField?><?=$this->escapeHtmlAttr($current['type'])?>Slider"><?=$this->transEsc('Range-from-to')?>:</label> + <input type="text" id="<?=$escField?><?=$this->escapeHtmlAttr($current['type'])?>Slider"> + </div> + <?php + $this->headScript()->appendFile('vendor/bootstrap-slider.min.js'); + $this->headLink()->appendStylesheet('vendor/bootstrap-slider.min.css'); + $min = !empty($current['values'][0]) ? min($current['values'][0], 1400) : 1400; + $future = date('Y', time() + 31536000); + $max = !empty($current['values'][1]) ? max($future, $current['values'][1]) : $future; + $low = !empty($current['values'][0]) ? $current['values'][0] : $min; + $high = !empty($current['values'][1]) ? $current['values'][1] : $max; + $min = intval($min); + $max = intval($max); + $low = intval($low); + $high = intval($high); + $init = !empty($current['values'][0]) ? 'fillTexts()' : ''; + $script = <<<JS +$(document).ready(function() { + var fillTexts = function() { + var v = {$escField}dateSlider.getValue(); + $('#${escField}from').val(v[0]); + $('#${escField}to').val(v[1]); + }; + var {$escField}dateSlider = $('#{$escField}dateSlider') + .slider({ + 'min':{$min}, + 'max':{$max}, + 'handle':"square", + 'tooltip':"hide", + 'value':[{$low},{$high}] + }) + .on('change', fillTexts) + .data('slider'); + {$init} +}); + +$('#{$escField}from, #{$escField}to').change(function () { + var fromValue = Number($('#{$escField}from').val()); + var toValue = Number($('#{$escField}to').val()); + $('#{$escField}dateSlider').slider( + 'setValue', + [ + isNaN(fromValue) || fromValue <= 0 ? {$min} : fromValue, + isNaN(toValue) || toValue <= 0 ? {$max} : toValue + ], + true + ); +}); +JS; + ?> + <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET'); ?> + <?php endif; ?> + </fieldset> + <?php endforeach; ?> +<?php endif; ?> +<!-- finc: search - advanced - ranges - END --> \ No newline at end of file