diff --git a/local/alpha/config/vufind/searches.ini b/local/alpha/config/vufind/searches.ini index c259bc11f28286b2a81579ecd8e5f050c11f314c..6ac686dcbd2734ad5274d3ec21a7b7ebcb50118c 100644 --- a/local/alpha/config/vufind/searches.ini +++ b/local/alpha/config/vufind/searches.ini @@ -26,4 +26,7 @@ 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 +main = index.ub.uni-leipzig.de/solr/biblio + +[NewItem] +method = ils \ No newline at end of file diff --git a/local/config/vufind/config.ini b/local/config/vufind/config.ini index be6fd603ce9b01c28bcdd32c6fb084df72461362..7a05100d552814eac475fabed2bb29b81175a52d 100644 --- a/local/config/vufind/config.ini +++ b/local/config/vufind/config.ini @@ -99,7 +99,7 @@ showBookBag = true ; Set the maximum amount of items allowed in the Book Bag - Default is 100 bookBagMaxSize = 20 ; Display bulk items (export, save, etc.) and checkboxes on search result screens? -showBulkOptions = false +showBulkOptions = true ; Should users be allowed to save searches in their accounts? allowSavedSearches = true ; Generator value to display in an HTML header <meta> tag: @@ -1552,9 +1552,13 @@ remove[] = "gndmusic" ; identifier[replace] is the replacing phrase ; identifier[method] calls an alternative method with the link as parameter. ; The method is expected in View\Helper\Root\Record.php +; identifier[function] calls a function if available with the link as parameter. +; The function performed on the url *before* replacing with the replacement. It is +; intended to perform url-encoding links so they can be used as parameter value. ; Examples: ; url[pattern] = url.pattern.to.resolve.link ; url[method] = resolveLink +; url[method] = urlencode (https://www.php.net/manual/de/function.urlencode.php) nbn[pattern] = "^urn:nbn:" nbn[search] = "urn:nbn:" nbn[replace] = "http://nbn-resolving.de/urn:nbn:" diff --git a/local/config/vufind/searches.ini b/local/config/vufind/searches.ini index 64ab99beb2ddc6f028d4c2c8a8e4196590d2f9a6..1dbec8eddd33723afa4ba2786ee92204f0ada6a1 100644 --- a/local/config/vufind/searches.ini +++ b/local/config/vufind/searches.ini @@ -435,7 +435,7 @@ side[] = "ExpandFacets:Author" ; (see https://vufind.org/wiki/indexing:tracking_record_changes). If using the ILS, ; your driver must support the getNewItems() method. ; Valid options: ils, solr; default: ils -method = ils +method = solr ; Comma-separated list of date ranges to offer to the user (i.e. 1,5,30 = one day ; old, or five days old, or thirty days old). If using the "ils" method, be careful ; about raising the maximum age too high -- searching very long date ranges may put diff --git a/local/languages/de.ini b/local/languages/de.ini index b9ce710d22e612e56cbf143f87cb22df229c2840..b257ab271cbbbf0aba982fd9af093519c8487ff9 100644 --- a/local/languages/de.ini +++ b/local/languages/de.ini @@ -217,6 +217,7 @@ Change Profile Data = "Benutzerdaten ändern" Change User PIN of Self-Checkout = "Benutzer-PIN für Selbstverbuchung ändern" Checkedout = "Ausgeliehene Medien" Checkedoutpermanent = "Längerfristige Ausleihen" +Choose Period = Zeitraum auswählen Cite this = Zitieren Click here to view book = Volltext Clock = "Uhr" @@ -2041,3 +2042,15 @@ form-button-submit = "Ausgefülltes Formular abschicken" ; #17601 offcanvas-toggler-search-tips = "Suchtipps einblenden" + +; #18019 remove if using VuFind 7.0 +select_item = "Titel auswählen" + +; #17993 +; only for German translation +Email = "Mailen" +Print = "Drucken" +bookbag_email_selected = "Links zu ausgewählten Medien per E-Mail versenden" + +; #18441 +Skip_navigation_links = "Sprunglinks zur Suche und zum Inhalt" diff --git a/local/languages/en.ini b/local/languages/en.ini index 791449b2a2f9be5e9712e720fd81d4a2aee980e5..a4cb46bf4b95a77e2b4f17edcbcb02e68f6345b7 100644 --- a/local/languages/en.ini +++ b/local/languages/en.ini @@ -355,6 +355,7 @@ By Alphabetical = "In Alphabetic Order" Cannot find similar records = "Cannot find similar records." Cassette = Cassette Checkedoutpermanent = "Checked Out Permanent Items" +Choose Period = Choose Date Range # Chinese = "ä¸æ–‡ï¼ˆç¹é«”)" Chinese = Chinese Clock = "" @@ -2129,3 +2130,9 @@ form-button-submit = "Submit the completed form" ; #17601 offcanvas-toggler-search-tips = "Show search help" + +; #18019 remove if using VuFind 7.0 +select_item = "Select item" + +; #18441 +Skip_navigation_links = "Skip navigation links" diff --git a/module/fid/src/View/Helper/Root/GetIt.php b/module/fid/src/View/Helper/Root/GetIt.php index df73259aa95f6583d473181a31137eb7f4eb1e8c..df1436e69ded0e9c350fc006fe11975766a39225 100644 --- a/module/fid/src/View/Helper/Root/GetIt.php +++ b/module/fid/src/View/Helper/Root/GetIt.php @@ -77,20 +77,77 @@ class GetIt extends AbstractHelper * @var \fid\Service\Client */ protected $fidClient; + /** + * Solr field source_id + * @var + */ protected $sid; + /** + * Solr field format + * or instance specific configuration + * @var + */ protected $format; + /** + * Solr field facet_avail + * @var + */ protected $facetAvail; + /** + * Solr field multipart_set + * @var + */ protected $multipart; + /** + * Has a hierarchy parent title + * @var + */ protected $isCollection; + /** + * Solr field institution + * @var + */ protected $institution; + /** + * Solr field mega_collection + * @var + */ protected $megacollection; + /** + * Solr field collection + * @var + */ protected $collection; + /** + * Solr field isbn + * @var + */ protected $isbn; + /** + * Solr field issn + * @var + */ protected $issn; + /** + * Default color of a accordeon + * @var + */ protected $accordeonColorDefault; + /** + * second color of the accordeon + * @var + */ protected $accordeonColorAlternative; + /** + * Default headline text of the get it box + * @var + */ protected $accordeonHeadlineDefault; + /** + * second headline text of the get it box + * @var + */ protected $accordeonHeadlineAlternative; /** @@ -105,6 +162,8 @@ class GetIt extends AbstractHelper } /** + * Get Solr field data + * * @param $driver */ public function __invoke($driver) @@ -222,8 +281,12 @@ class GetIt extends AbstractHelper } /** + * + * Open Access + * * Configuration of SIDs 13,22,26,28,30,34,53,80,84,87,88,99,101,150,153,170 * + * * @param $accordeonColor string accordeon color * @param $accordeonHeadline string accordeon headline * @param $boxHeadline string headline text get it box @@ -259,6 +322,9 @@ class GetIt extends AbstractHelper } /** + * + * Magazine Articles + * * Configuration of SID 49,55,68,105 * * @param $accordeonColor string accordeon color @@ -300,6 +366,9 @@ class GetIt extends AbstractHelper } /** + * + * PDA + * * Configuration of SID 51 * * @param $accordeonColor string accordeon color @@ -343,6 +412,9 @@ class GetIt extends AbstractHelper } /** + * + * EBL + * * Configuration of SID 76 * * @param $accordeonColor string accordeon color @@ -397,6 +469,9 @@ class GetIt extends AbstractHelper } /** + * + * IZI Database + * * Configuration of SID 78 * * @param $accordeonColor string accordeon color @@ -432,6 +507,9 @@ class GetIt extends AbstractHelper } /** + * + * Margaret Herrick Library + * * Configuration of SID 103 * * @param $accordeonColor string accordeon color @@ -469,6 +547,9 @@ class GetIt extends AbstractHelper } /** + * + * VK Film collection + * * Configuration of SID 0,109,117,119,127,142,148,151,155 * * @param $accordeonColor string accordeon color @@ -653,6 +734,9 @@ class GetIt extends AbstractHelper } /** + * + * VK Film collection + * * Configuration of SID 0 (special cases) * * @param $accordeonColor string accordeon color @@ -721,6 +805,9 @@ class GetIt extends AbstractHelper } /** + * + * MediathekViewWeb + * * Configuration of SID 169 * * @param $accordeonColor string accordeon color @@ -758,6 +845,9 @@ class GetIt extends AbstractHelper } /** + * + * Bielefeld Academic Search Engine (BASE) + * * Configuration of SID 126 * * @param $accordeonColor string accordeon color @@ -793,6 +883,9 @@ class GetIt extends AbstractHelper } /** + * + * Has User ordered certain Record (SID 51) + * * @return bool */ public function isRecordOrdered() diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index f2631035d077e3e888772a4c53bf14cebc96ab53..515cee83dffde153dc95b8c1f5e2ee32ed7a3658 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -51,9 +51,11 @@ $config = [ 'controller_plugins' => [ 'factories' => [ 'finc\Controller\Plugin\EmailHold' => 'finc\Controller\Plugin\EmailHoldFactory', + 'finc\Controller\Plugin\NewItems' => 'finc\Controller\Plugin\NewItemsFactory' ], 'aliases' => [ - 'emailHold' => 'finc\Controller\Plugin\EmailHold' + 'emailHold' => 'finc\Controller\Plugin\EmailHold', + 'newItems' => 'finc\Controller\Plugin\NewItems' ] ], 'vufind' => [ diff --git a/module/finc/src/finc/Controller/Plugin/NewItems.php b/module/finc/src/finc/Controller/Plugin/NewItems.php new file mode 100644 index 0000000000000000000000000000000000000000..25998371eac9064e2bbef24bea316f6bd7dfb29e --- /dev/null +++ b/module/finc/src/finc/Controller/Plugin/NewItems.php @@ -0,0 +1,80 @@ +<?php +/** + * VuFind Action Helper - New Items Support Methods + * + * 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 Controller_Plugins + * @author Demian Katz <demian.katz@villanova.edu> + * @author Robert Lange <lange@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ +namespace finc\Controller\Plugin; + +use Zend\Config\Config; +use Zend\Mvc\Controller\Plugin\AbstractPlugin; + +/** + * Zend action helper to perform new items-related actions + * + * @category VuFind + * @package Controller_Plugins + * @author Demian Katz <demian.katz@villanova.edu> + * @author Robert Lange <lange@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ +class NewItems extends \VuFind\Controller\Plugin\NewItems +{ + /** + * Main Configuration + * + * @var null|Config + */ + protected $mainConfig; + + /** + * Constructor + * + * @param Config $searchConfig Configuration + * @param Config $mainConfig Configuration + */ + public function __construct(Config $searchConfig, Config $mainConfig) + { + $this->config = $searchConfig; + $this->mainConfig = $mainConfig; + } + + /** + * Get a Solr filter to limit to the specified number of days. + * + * @param int $range Days to search + * + * @return string + */ + public function getSolrFilter($range) + { + $field = 'first_indexed'; + if (!empty($isilPrefix = $this->mainConfig->CustomIndex->indexExtension)) { + $field = "{$isilPrefix}_date"; + } + return "$field:[NOW-{$range}DAY TO NOW]"; + } +} diff --git a/module/finc/src/finc/Controller/Plugin/NewItemsFactory.php b/module/finc/src/finc/Controller/Plugin/NewItemsFactory.php new file mode 100644 index 0000000000000000000000000000000000000000..42fe4cf4689f3f013792ef9137a65f4ad74affbb --- /dev/null +++ b/module/finc/src/finc/Controller/Plugin/NewItemsFactory.php @@ -0,0 +1,63 @@ +<?php +/** + * Factory for controller plugins. + * + * 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 View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @author Robert Lange <lange@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +namespace finc\Controller\Plugin; + +use Psr\Container\ContainerInterface; +use finc\Controller\Plugin\NewItems; +use Zend\ServiceManager\ServiceManager; + +/** + * Factory for controller plugins. + * + * @category VuFind + * @package View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @author André Lahmann <lahmann@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + * + * @codeCoverageIgnore + */ +class NewItemsFactory +{ + /** + * Construct the NewItems plugin. + * + * @param ServiceManager $sm Service manager. + * + * @return NewItems + */ + public function __invoke(ContainerInterface $sm) + { + $search = $sm->get('VuFind\Config\PluginManager')->get('searches'); + $config = isset($search->NewItem) + ? $search->NewItem : new \Zend\Config\Config([]); + return new NewItems($config, $sm->get('VuFind\Config\PluginManager')->get('config')); + } +} diff --git a/module/finc/src/finc/Cover/Loader.php b/module/finc/src/finc/Cover/Loader.php index b67ff8ee24e3f877679eafc1cbee4f2ac09bfb07..fe853e9f2e70b56c78ce7c19e6c80b9da8f3e06b 100644 --- a/module/finc/src/finc/Cover/Loader.php +++ b/module/finc/src/finc/Cover/Loader.php @@ -41,6 +41,8 @@ namespace finc\Cover; */ class Loader extends \VuFind\Cover\Loader { + const EMPTY_IMAGE_CONTENT = 'nothing here'; + /** * Flag denoting the last loaded image was a FailImage * @@ -57,9 +59,28 @@ class Loader extends \VuFind\Cover\Loader public function loadUnavailable() { $this->hasLoadedUnavailable = true; + if ($this->config->Content->useCoverFallbacksOnFail) { + file_put_contents($this->localFile, self::EMPTY_IMAGE_CONTENT); + } return parent::loadUnavailable(); } + public function loadImage($settings = []) + { + parent::loadImage($settings); + if ($this->image === self::EMPTY_IMAGE_CONTENT) { + $this->hasLoadedUnavailable = true; + } + } + + public function getImage() + { + if ($this->image === self::EMPTY_IMAGE_CONTENT) { + $this->hasLoadedUnavailable = true; + } + return parent::getImage(); + } + /** * Returns true if the last loaded image was the FailImage * diff --git a/module/finc/src/finc/Cover/Router.php b/module/finc/src/finc/Cover/Router.php index 8a758f27c9f6adb72c488431ee3a4584026c9fb0..5cc789f6855650b7008b42f843917db92cbeaac2 100644 --- a/module/finc/src/finc/Cover/Router.php +++ b/module/finc/src/finc/Cover/Router.php @@ -98,10 +98,8 @@ class Router implements \Zend\Log\LoggerAwareInterface if (!$resolveDynamic) { return null; } - $settings = is_array($thumb) ? array_merge($thumb, ['size' => $size]) - : ['size' => $size]; if ($testLoadImage) { - $this->coverLoader->loadImage($settings); + $this->coverLoader->loadImage(array_merge($thumb, ['size' => $size])); if ($this->coverLoader->hasLoadedUnavailable()) { return false; } diff --git a/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php b/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php index f5fb36b670842cb7f3d977259c2943941603bdbf..3c158d6bd04234f03516967bdb7472c37d4ad34b 100644 --- a/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php @@ -895,93 +895,6 @@ trait SolrDefaultFincTrait $this->fields['title_new'] : []; } - /** - * After giving a record ids as e.g. ppn of the context check (KXP|BSZ) if a - * foreign record exists. This method can be used to indicate a direct link - * than to form a general look for query. - * - * Please note: 1) This method can be simplified if it is necessary only to - * map record_id to id but you need the solr to check if the item really - * exists in the Solr infrastructure to maybe no displaying a false link later - * on. 2) There's legacy component to rewrite back real Solr record_id in - * return container. Can be useful if there are still any successive methods - * in action. - * - * @param array $array Array of record ids to test. - * @param string $context Context where to search related items. - * - * @return null|mixed If success return at least one finc id otherwise null. - */ - protected function addFincIDToRecord($array, $context = 'kxp_id_str') - { - // record ids - $rids = []; - // return array - $retval = []; - - // check if array contain record_ids and collect it as an array to - // use only one solr request for all - if (isset($array) && is_array($array)) { - foreach ($array as $line) { - if (isset($line['record_id']) && isset($line['source_id'])) { - $rids[] = [ - 'rid' => $line['record_id'], - 'sid' => $line['source_id'] - ]; - } - } - } - - // Solr query remains necessary if it is desired to check if solr - // infrastructure contains really the foreign items - - // build the query: - if (count($rids) == 1) { - // single query: - $value = $context . ':' . $rids[0]['rid'] - . ' AND source_id:' . $rids[0]['sid']; - } elseif (count($rids) > 1) { - // multi query: - foreach ($rids as $rid) { - $parts[] = '('. $context .':' . $rid['rid'] - . ' AND source_id:' . $rid['sid'] . ')'; - } - $value = '(' . implode(' OR ', $parts) . ')'; - } else { - return $array; - } - $query = new \VuFindSearch\Query\Query($value); - $bag = new ParamBag(); - $bag->set('fl', 'id, record_id,' . $context); - $records = $this->searchService - ->search('Solr', $query, 0, count($rids), $bag); - - $records = $records->getRecords(); - if (isset($records) - && !empty($records) - ) { - foreach ($records as $record) { - $retval[$record->getField($context)]['id'] = - $record->getUniqueID(); - $retval[$record->getField($context)]['record_id'] = - $record->getRID(); - } - } - - // write back in array - foreach ($array as &$val) { - if (isset($val['record_id'])) { - if (isset($retval[($val['record_id'])])) { - $val['id'] = $retval[($val['record_id'])]['id']; - $val['record_id'] = $retval[($val['record_id'])]['record_id']; - } - } - } - unset($val); - - return $array; - } - /** * Get the recordtype of the current Record * diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index aaed7e69ea8d14b22fee441e0c217fe7fb5160aa..ae53d4e3012e8f0c6a13288b51f37492e9ca1100 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -300,24 +300,14 @@ trait SolrMarcFincTrait $array[$key]['text'] = ($line->getSubfield('t')) ? $line->getSubfield('t')->getData() : ''; // get ppns of bsz - $linkFields = $line->getSubfields('w'); - foreach ($linkFields as $current) { - $text = $current->getData(); - // Extract parenthetical prefixes: - if (preg_match(self::KXP_PATTERN, $text, $matches)) { - //$id = $this->checkIfRecordExists($matches[2]); - //if ($id != null) { - $array[$key]['record_id'] = $matches[2].$matches[3]; - if (null != ($sid = $this->getSourceID())) { - $array[$key]['source_id'] = $sid; - } - //} - //break; - } - } // end foreach + $linkedRecords = $this->getRelatedKxpRecord($line); + + if (!empty($linkedRecords)) { + $array[$key]['id'] = current($linkedRecords['first_results'])->getUniqueId(); + } } // end foreach - return $this->addFincIDToRecord($array); + return $array; } /** @@ -1047,20 +1037,14 @@ trait SolrMarcFincTrait ? $line->getSubfield('t')->getData() : ''; } // get ppns of bsz - $linkFields = $line->getSubfields('w'); - foreach ($linkFields as $current) { - $text = $current->getData(); - // Extract parenthetical prefixes: - if (preg_match(self::KXP_PATTERN, $text, $matches)) { - $array[$key]['record_id'] = $matches[2] . $matches[3]; - if (null != ($sid = $this->getSourceID())) { - $array[$key]['source_id'] = $sid; - } - } - } // end foreach + $linkedRecords = $this->getRelatedKxpRecord($line); + + if (!empty($linkedRecords)) { + $array[$key]['id'] = current($linkedRecords['first_results'])->getUniqueId(); + } } // end foreach - return $this->addFincIDToRecord($array); + return $array; } @@ -1104,27 +1088,13 @@ trait SolrMarcFincTrait $retval[$key]['text'] = ($t = $line->getSubfield('t')) ? $a->getData() . ': ' . $t->getData() : $a->getData(); - $linkFields = $line->getSubfields('w'); - foreach ($linkFields as $current) { - $ids = $current->getData(); - - // Extract parenthetical prefixes: - if (preg_match(self::KXP_PATTERN, $ids, $matches)) { - // use the same key to set the record_id into the - // $retval array like it is used for the other - // content below - $retval[$key]['record_id'] - = $matches[2] . $matches[3]; - if (null != ($sid = $this->getSourceID())) { - $retval[$key]['source_id'] = $sid; - } - } + $linkedRecords = $this->getRelatedKxpRecord($line); + + if (!empty($linkedRecords)) { + $retval[$key]['id'] = current($linkedRecords['first_results'])->getUniqueId(); } } } - // add ids already here to the temporary array - // instead of the end of the function with the return value - $retval = $this->addFincIDToRecord($retval); // rearrange return array to collect same subjects below on unique key $array = []; foreach ($retval as $item) { @@ -1172,25 +1142,17 @@ trait SolrMarcFincTrait $array[$i]['text'] = ($line->getSubfield('t')) ? $line->getSubfield('t')->getData() : ''; // get ppns of bsz - $linkFields = $line->getSubfields('w'); - if (is_array($linkFields) && count($linkFields) > 0) { - foreach ($linkFields as $current) { - $text = $current->getData(); - // Extract parenthetical prefixes: - if (preg_match(self::KXP_PATTERN, $text, $matches)) { - $array[$key]['record_id'] = $matches[2].$matches[3]; - if (null != ($sid = $this->getSourceID())) { - $array[$key]['source_id'] = $sid; - } - } - } // end foreach - } // end if + $linkedRecords = $this->getRelatedKxpRecord($line); + + if (!empty($linkedRecords)) { + $array[$key]['id'] = current($linkedRecords['first_results'])->getUniqueId(); + } $i++; } // end if } // end foreach } } - return $this->addFincIDToRecord($array); + return $array; } /** @@ -1219,20 +1181,14 @@ trait SolrMarcFincTrait ? $line->getSubfield('t')->getData() : ''; } // get ppns of bsz - $linkFields = $line->getSubfields('w'); - foreach ($linkFields as $current) { - $text = $current->getData(); - // Extract parenthetical prefixes: - if (preg_match(self::KXP_PATTERN, $text, $matches)) { - $array[$key]['record_id'] = $matches[2].$matches[3]; - if (null != ($sid = $this->getSourceID())) { - $array[$key]['source_id'] = $sid; - } - } - } // end foreach + $linkedRecords = $this->getRelatedKxpRecord($line); + + if (!empty($linkedRecords)) { + $array[$key]['id'] = current($linkedRecords['first_results'])->getUniqueId(); + } } // end foreach - return $this->addFincIDToRecord($array); + return $array; } /** @@ -1407,7 +1363,7 @@ trait SolrMarcFincTrait { $array = []; $fields = ['770','775','776']; - $subfields = ['a', 'l', 't', 'b', 'd', 'e', 'f', 'h', 'o', '7','z']; + $subfields = ['a', 'l', 't', 'b', 'd', 'e', 'f', 'h', 'o', '7']; $i = 0; foreach ($fields as $field) { @@ -1436,33 +1392,51 @@ trait SolrMarcFincTrait $array[$i] = [ 'text' => implode(', ', $text), 'identifier' => ($line->getSubfield('i')) - ? $line->getSubfield('i')->getData() : '' + ? $line->getSubfield('i')->getData() : '', + 'note' => ($line->getSubfield('n')) + ? $line->getSubfield('n')->getData() : null, ]; // finally we can try to use given PPNs (from the BSZ) to // link the record - if ($linkFields = $line->getSubfields('w')) { + $linkedRecords = $this->getRelatedKxpRecord($line); + + if (!empty($linkedRecords['first_results'])) { + $array[$i]['id'] = current($linkedRecords['first_results'])->getUniqueId(); + } + + if (empty($linkedRecords) && $linkFields = $line->getSubfields('z')) { foreach ($linkFields as $current) { - $text = $current->getData(); - // Extract parenthetical prefixes: - if (preg_match(self::KXP_PATTERN, $text, $matches)) { - $array[$i]['record_id'] - = $matches[2] . $matches[3]; - if (null != ($sid = $this->getSourceID())) { - $array[$i]['source_id'] = $sid; - } - } + $linked[] = $current->getData(); + } + $linkedRecords = $this->searchRelatedRecords('isbn',$linked, 1); + if (!empty($linkedRecords['first_results'])) { + $array[$i]['related_records'] = $linkedRecords; } } // at least we found some identifier and text so increment $i++; } + } elseif ($linkFields = $line->getSubfields('z')) { + $linked = []; + foreach ($linkFields as $current) { + $linked[] = $current->getData(); + } + $linkedRecords = $this->searchRelatedRecords('isbn',$linked, 1); + if (!empty($linkedRecords['first_results'])) { + $array[$i] = [ + 'related_records' => $linkedRecords, + 'identifier' => 'Other Editions', + 'text' => '', + ]; + $i++; + } } } } } - return $this->addFincIDToRecord($array); + return $array; } /** @@ -1555,26 +1529,21 @@ trait SolrMarcFincTrait // finally we can try to use given PPNs (from the BSZ) to // link the record - if ($linkFields = $line->getSubfields('w')) { - foreach ($linkFields as $current) { - $text = $current->getData(); - // Extract parenthetical prefixes: - if (preg_match(self::KXP_PATTERN, $text, $matches)) { - $array[$i]['record_id'] - = $matches[2] . $matches[3]; - if (null != ($sid = $this->getSourceID())) { - $array[$i]['source_id'] = $sid; - } - } - } + // finally we can try to use given PPNs (from the BSZ) to + // link the record + $linkedRecords = $this->getRelatedKxpRecord($line); + + if (!empty($linkedRecords)) { + $array[$i]['id'] = current($linkedRecords['first_results'])->getUniqueId(); } + // at least we found some identifier and text so increment $i++; } } } } - return $this->addFincIDToRecord($array); + return $array; } /** @@ -1639,33 +1608,6 @@ trait SolrMarcFincTrait ['830'] ]; - $idRetrieval = function ($value) { - // use preg_match to get rid of the isil - preg_match(self::KXP_PATTERN, $value, $matches); - if (!empty($matches[2])) { - $query = 'kxp_id_str:' . $matches[2].$matches[3]; - if ($sid = $this->fields['source_id']) { - $query .= ' AND source_id:'.$sid; - } - $result = $this->searchService->search( - 'Solr', - new Query($query) - ); - if (count($result) === 0) { - $this->debug( - 'Could not retrieve id for record with ' . $query - ); - return null; - } - return current($result->getRecords())->getUniqueId(); - } - $this->debug( - 'Pregmatch pattern in getHierarchyParentID failed for ' - . $value - ); - return $value; - }; - // loop through all field lists in their particular order (as in // getHierchyParentTitle) and build the $parentID array foreach ($fieldList as $fieldNumbers) { @@ -1673,9 +1615,11 @@ trait SolrMarcFincTrait $fields = $this->getMarcRecord()->getFields($fieldNumber); foreach ($fields as $field) { if ($field->getSubfield('w')) { - $parentID[] = $idRetrieval( - $field->getSubfield('w')->getData() - ); + // refactored with #18333 + $related = $this->getRelatedKxpRecord($field); + if (!empty( $related['first_results'] ?? [])) { + $parentID[] = current($related['first_results'])->getUniqueId(); + } } elseif ($fieldNumber == '490') { // https://intern.finc.info/issues/8704 if ($field->getIndicator(1) == 0 @@ -2082,34 +2026,52 @@ trait SolrMarcFincTrait } } - /** - * Get related records via search index - * - * @param int $limit - * @param string $backend_id Search engine - * - * @return array - * @access protected - */ - protected function getRelatedRecords($limit, $backend_id = 'Solr') - { - $related = $this->getRelatedItems(true); + public function searchRelatedRecords($field, $values, $limit = 20, + $filters=[], $backend_id = 'Solr' + ) { - if (empty($related)) { - return []; + if (!empty($filters)) { + $fq = ''; + foreach ($filters as $filterField => $value) { + $fq = (empty($fq) ? '' : ' AND ') + . "$filterField:$value"; + } } $query = new Query( - 'isbn' . ':' . implode(' OR ', $related) - . ' AND NOT id:' . $this->getUniqueID() + $field . ':(' . implode(' OR ', $values) + . ') AND NOT id:' . $this->getUniqueID() + . (isset($fq) ? " AND $fq" : '') ); $result = $this->searchService->search($backend_id, $query, 0, $limit); $return['first_results'] = $result->getRecords(); - if ($result->getTotal() > $limit) { + + if (isset($limit) && $result->getTotal() > $limit) { $return['more_query'] = $query->getString(); } return $return; + + } + + public function getRelatedKxpRecord($line, $limit = 1, $linkSubField = 'w') { + + if ($linkFields = $line->getSubfields('w')) { + $linked = []; + foreach ($linkFields as $current) { + $text = $current->getData(); + // Extract parenthetical prefixes: + if (preg_match(self::KXP_PATTERN, $text, $matches)) { + $linked[] + = $matches[2] . $matches[3]; + } + } + $linkedRecords = $this->searchRelatedRecords('kxp_id_str', $linked, $limit, ['source_id' => $this->getSourceID()]); + if (!empty($linkedRecords['first_results'])) { + return $linkedRecords; + } + } + return null; } /** diff --git a/module/finc/src/finc/View/Helper/Root/Factory.php b/module/finc/src/finc/View/Helper/Root/Factory.php index b9f0bcca3d5acf8b1c4591c5d25be7ae903380f4..e4109ef4a2a8d6de1cde6956221ed5be15b0e8f9 100644 --- a/module/finc/src/finc/View/Helper/Root/Factory.php +++ b/module/finc/src/finc/View/Helper/Root/Factory.php @@ -208,4 +208,10 @@ class Factory empty($externalAccessLinks) ? [] : $externalAccessLinks ); } + + public static function getHeadTitle(ContainerInterface $container) + { + $config = $container->get('VuFind\Config')->get('config')->Site; + return new HeadTitle($config->title ?? ''); + } } diff --git a/module/finc/src/finc/View/Helper/Root/HeadTitle.php b/module/finc/src/finc/View/Helper/Root/HeadTitle.php new file mode 100644 index 0000000000000000000000000000000000000000..c4036a17429c5da292fb5e574bf9f40d53de3588 --- /dev/null +++ b/module/finc/src/finc/View/Helper/Root/HeadTitle.php @@ -0,0 +1,58 @@ +<?php +/** + * Head Title view helper + * + * 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 View_Helpers + * @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 Wiki + */ +namespace finc\View\Helper\Root; + +use Zend\View\Helper\HeadTitle as BaseHelper; + +/** + * Head Title view helper + * + * @category VuFind + * @package View_Helpers + * @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 Wiki + */ +class HeadTitle extends BaseHelper +{ + protected $headerSuffix; + + public function __construct($headerSuffix = '') + { + parent::__construct(); + if (!empty($headerSuffix)) { + $this->headerSuffix = ' - '.$headerSuffix; + } + } + + public function __invoke($title = null, $setType = null) + { + $title = $title ? : $this->headerSuffix; + return parent::__invoke($title, $setType); + } +} diff --git a/module/finc/src/finc/View/Helper/Root/MultiDataFieldsTrait.php b/module/finc/src/finc/View/Helper/Root/MultiDataFieldsTrait.php index b9536ccab15bf7871c05c89ade86a935039feb04..0f137ca2a6525f0f3072aa4fa5a872cba0576234 100644 --- a/module/finc/src/finc/View/Helper/Root/MultiDataFieldsTrait.php +++ b/module/finc/src/finc/View/Helper/Root/MultiDataFieldsTrait.php @@ -82,6 +82,30 @@ trait MultiDataFieldsTrait return $final; } + public function relatedRecords($data,$options,$driver) { + + $formats = $driver->tryMethod('getFormat'); + $reject = array('Microfilm', 'Microform', 'Microfiche'); + if (empty(array_intersect($reject, $formats))) { + $data = $driver->tryMethod( + 'getRelatedRecords', + [$options['limit'] ?? 3] + ); + } + if (!empty($data['first_results'])) { + return [[ + 'label' => 'Other Editions', + 'values' => $data, + 'options' => [ + 'pos' => $options['pos'], + 'renderType' => 'RecordDriverTemplate', + 'template' => 'data-relatedRecords.phtml', + ], + ]]; + } + return null; + } + /** * return render details for events data set * @return callback diff --git a/module/finc/src/finc/View/Helper/Root/Record.php b/module/finc/src/finc/View/Helper/Root/Record.php index 7c1968e2b53841e34abaa6262774a7ca4cea5c9a..c12efed09377fb0e62cd7f4866275eee5c228702 100644 --- a/module/finc/src/finc/View/Helper/Root/Record.php +++ b/module/finc/src/finc/View/Helper/Root/Record.php @@ -326,55 +326,46 @@ class Record extends \VuFind\View\Helper\Root\Record { $rewrite = $this->config->LinksRewrite->toArray(); foreach ($rewrite as $r) { - // is pattern set so try rewrite url - if (isset($r['pattern']) || $r['remove']) { - // is remove pattern than suppress link refs #10834 - if (isset($r['remove'])) { - if (0 != preg_match( - '/' . addcslashes($r['remove'], '/') . '/i', - trim($link['url']) - )) { - unset($link); - return; - } + // is remove pattern than suppress link refs #10834 + if (isset($r['remove'])) { + if (0 != preg_match( + '/' . addcslashes($r['remove'], '/') . '/i', + trim($link['url']) + )) { + unset($link); + return; + } + } + // is pattern set and matches so try rewrite url + if (isset($r['pattern']) && 0 != preg_match('/' . $r['pattern'] . '/i', trim($link['url']))) { + // if function is set and available then perform on url + if (isset($r['function']) && is_callable($r['function'])) { + $link['url'] = $r['function']($link['url']); } // is search and replace set so try to rewrite url if (isset($r['search']) && isset($r['replace'])) { - // check if pattern exists. if at least one match than continue - if (0 != preg_match( - '/' . $r['pattern'] . '/i', - trim($link['url']) - )) { - // prepare search pattern - // should be free of conflicting meta characters - $pattern - = str_replace(['.'], ['\.'], $r['search']); - $pattern = '/(' . $pattern . ')/i'; - // replace it only one time - $link['url'] = preg_replace( - $pattern, - trim($r['replace']), - trim($link['url']), - 1, - $count - ); - // add http if needed - // @to-do make it https compatible - if (!preg_match('/^(https?:\/\/)/', $link['url'])) { - $link['url'] = 'http://' . $link['url']; - } + // prepare search pattern + // should be free of conflicting meta characters + $pattern = str_replace(['.'], ['\.'], $r['search']); + $pattern = '/(' . $pattern . ')/i'; + // replace it only one time + $link['url'] = preg_replace( + $pattern, + trim($r['replace']), + trim($link['url']), + 1, + $count + ); + // add http if needed + // @to-do make it https compatible + if (!preg_match('/^(https?:\/\/)/', $link['url'])) { + $link['url'] = 'http://' . $link['url']; } } // is method set so call alternatively method proceed link if (isset($r['method']) && method_exists($this, $r['method'])) { - /* && $count > 0) { @todo fix */ - if (0 != preg_match( - '/' . $r['pattern'] . '/i', - trim($link['url']) - )) { - $link['url'] = $this->$r['method']($link['url']); - } + $link['url'] = $this->$r['method']($link['url']); } // end if isset method } // end if isset pattern } // end foreach @@ -476,6 +467,7 @@ class Record extends \VuFind\View\Helper\Root\Record $online_keys = [ "Online-Ausg.", "Online-Ausg.:", + "Online-Ausgabe", "Digital. Ausg.", "Online-Ausg. u.d.T.", "Elektronische Reproduktion" @@ -483,14 +475,34 @@ class Record extends \VuFind\View\Helper\Root\Record $onlineEditions = []; $recordLinkHelper = $this->getView()->plugin('recordLink'); foreach ($this->driver->tryMethod('getAdditionals') as $add) { - if (isset($add['identifier']) - && in_array($add['identifier'], $online_keys)) { + if ( + isset($add['identifier']) + && + ( + in_array($add['identifier'], $online_keys) + || + ( + isset($add['note']) + && + in_array($add['note'], $online_keys) + ) + ) + ) { if (isset($add['id'])) { $link = $recordLinkHelper->getTabUrl($add['id'], 'Holdings'); if (!empty($link)) { $add['link'] = $link; $onlineEditions[] = $add; } + } elseif (isset($add['related_records'])) { + foreach ($add['related_records']['first_results'] as $linkedRecord) { + $link = $recordLinkHelper->getTabUrl($linkedRecord); + if (!empty($link)) { + //overwrite link in entry and add to result array + $add['link'] = $link; + $onlineEditions[] = $add; + } + } } } } diff --git a/themes/bootstrap3/templates/record/checkbox.phtml b/themes/bootstrap3/templates/record/checkbox.phtml index 7c37bb0ab2482b8e6e321128dd30ed6fc4f77ac6..750c00fea0667df5b8b9cead6dba29d2097fd554 100644 --- a/themes/bootstrap3/templates/record/checkbox.phtml +++ b/themes/bootstrap3/templates/record/checkbox.phtml @@ -1,5 +1,5 @@ <label class="record-checkbox hidden-print"> - <input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"<?php if(isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?>/> + <input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->escapeHtmlAttr($this->id)?>"<?php if(isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?>/> <span class="checkbox-icon"></span> <?php if (strlen($this->number ?? '') > 0): ?><span class="sr-only"><?=$this->transEsc('result_checkbox_label', ['%%number%%' => $this->number]) ?></span><?php endif; ?> </label> diff --git a/themes/fid/languages/fid/de.ini b/themes/fid/languages/fid/de.ini index 2459aaded65f50cd1745fc33023f01d53b6aff3c..f3ff9f4784d0945919f4986b8a9ae5fedb5c7d9c 100644 --- a/themes/fid/languages/fid/de.ini +++ b/themes/fid/languages/fid/de.ini @@ -4,7 +4,7 @@ auth_error_account_blocked = Ihr Konto wurde aus Sicherheitsgründen gesperrt. B user_init_form_title = "Registrierung" user_create_form_title = "Registrierung abschließen" -user_update_form_title = "Profildaten editieren." +user_update_form_title = "Profildaten editieren" password_reset_form_title = "Passwort zurücksetzen" password_reset_form_information = "Bitte geben Sie die E-Mail-Adresse ein, mit der Sie sich registriert haben. Wir senden Ihnen einen Link per E-Mail, über den Sie Ihr Passwort ändern können." password_change_form_title = "Neues Passwort speichern" diff --git a/themes/finc-accessibility/templates/myresearch/delete.phtml b/themes/finc-accessibility/templates/myresearch/delete.phtml index b991a73aa630b5cad9b9b7d4ded39deb8a41cdcb..19fc345724ecabbc95f7602577310e30e2be84f4 100644 --- a/themes/finc-accessibility/templates/myresearch/delete.phtml +++ b/themes/finc-accessibility/templates/myresearch/delete.phtml @@ -1,20 +1,24 @@ <!-- finc-accessibility: myresearch - delete --> -<?php /* #17950 - use <p> for alerts - HR */ ?> +<?php /* #17950 - use <p> for alerts - HR */ +/* #18535 - record listings - AP */ ?> -<h2><?=$this->transEsc('delete_selected_favorites')?></h2> +<h1><?=$this->transEsc('delete_selected_favorites')?></h1> <form action="<?=$this->url('myresearch-delete')?>" method="post" name="bulkDelete" data-lightbox-onclose="VuFind.refreshPage"> <div id="popupMessages"><?=$this->flashmessages()?></div> <div id="popupDetails"> <?php if (!$this->list): ?> <p class="alert alert-info"><?=$this->transEsc("fav_delete_warn") ?></p> <?php else: ?> - <h3><?=$this->transEsc("List") ?>: <?=$this->escapeHtml($this->list->title) ?></h3> + <h2><?=$this->transEsc("List") ?>: <?=$this->escapeHtml($this->list->title) ?></h2> <?php endif; ?> - + <ul class="record-list"> <?php foreach ($this->records as $favorite): ?> - <strong><?=$this->transEsc('Title') ?>:</strong> - <?=$this->escapeHtml($favorite->getBreadcrumb())?><br /> + <li> + <strong><?=$this->transEsc('Title') ?>:</strong> + <?=$this->escapeHtml($favorite->getBreadcrumb())?> + </li> <?php endforeach; ?> + </ul> <br /> <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Delete')?>"/> <?php foreach ($this->deleteIDS as $deleteID): ?> diff --git a/themes/finc-accessibility/templates/search/list-list.phtml b/themes/finc-accessibility/templates/search/list-list.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b86711fdfea9516cf8b8023cd44571457fbb370f --- /dev/null +++ b/themes/finc-accessibility/templates/search/list-list.phtml @@ -0,0 +1,20 @@ +<!-- finc-accessibility: search - list-list --> +<?php /* #18535 - record listings - AP */ ?> +<?php if (!isset($this->indexStart)) $this->indexStart = 0; ?> +<?php $i = $this->indexStart; ?> +<?php $listStart = $this->results->getStartRecord() + $i - $this->indexStart; ?> +<ol class="record-list" start="<?=$listStart?>"> +<?php foreach ($this->results->getResults() as $current): ?> + <?php $recordNumber = $this->results->getStartRecord() + $i - $this->indexStart; ?> + <li id="result<?=$i++ ?>" class="result<?=$current->supportsAjaxStatus()?' ajaxItem':''?>"> + <?php if (isset($this->showCheckboxes) && $this->showCheckboxes): ?> + <?=$this->record($current)->getCheckbox('', 'search-cart-form', $recordNumber)?> + <?php endif; ?> + <div class="record-number"> + <?=$recordNumber ?> + </div> + <?=$this->record($current)->getSearchResult('list')?> + </li> +<?php endforeach; ?> +</ol> +<!-- finc-accessibility: search - list-list - END --> diff --git a/themes/finc/js/covers.js b/themes/finc/js/covers.js index c251aefba80b034997452c4b1b7103e13847df78..1f150538799ab5778d7129604d192603de5761a5 100644 --- a/themes/finc/js/covers.js +++ b/themes/finc/js/covers.js @@ -1,5 +1,5 @@ /* this is a backport from VF 7 core, remove on upgrade */ -/*global VuFind */ +/* global VuFind */ function loadCoverByElement(data, element) { var url = VuFind.path + '/AJAX/JSON?method=' + 'getRecordCover'; var img = element.find('img'); @@ -10,10 +10,11 @@ function loadCoverByElement(data, element) { spinner.hide(); container.show(); if (typeof response.data.url !== 'undefined' && response.data.url !== false) { - img.attr("src", response.data.url); - container.children().not("img").hide(); + img.attr('src', response.data.url); + container.children().not('img').hide(); anchor.show(); - anchor.attr("href", response.data.url); + anchor.attr('href', response.data.url); + anchor.removeClass('hidden'); // finc specific } else { img.remove(); if (typeof response.data.html !== 'undefined') { @@ -24,9 +25,9 @@ function loadCoverByElement(data, element) { } } $.ajax({ - dataType: "json", + dataType: 'json', url: url, - method: "GET", + method: 'GET', data: data, element: element, success: coverCallback @@ -44,4 +45,5 @@ function loadCovers() { loadCoverByElement(data, $(this)); }); } -$(document).ready(loadCovers); +// deactivated for finc - we load every single cover directly by itself in cover.phtml +// $(document).ready(loadCovers); diff --git a/themes/finc/scss/_customVariables.scss b/themes/finc/scss/_customVariables.scss index cb7f32ab30c1c220212a4dee737dbae29296bf87..2ec7208aa6fee819e34ae66f6cc2d778ee0fe718 100644 --- a/themes/finc/scss/_customVariables.scss +++ b/themes/finc/scss/_customVariables.scss @@ -147,7 +147,7 @@ $btn-transparent-border: $border-color !default; $button-title-hover-bg: $brand-secondary !default; -$btn-language-hover-bg: $brand-secondary !default; +$btn-language-hover-bg: $brand-primary !default; $btn-language-active-hover-bg: $steel !default; // Padding for toolbar buttons in record view/detail view diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index 5c153ecaaef943a9932ed4c81a5b2bf78bc2db71..5e7e39fd4fb2dfb0d9a5b422b2a691dc31b3e123 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -362,6 +362,11 @@ legend { padding-left: ($grid-gutter-width / 2); padding-right: ($grid-gutter-width / 2); width: auto; + + // Recent acquisitions search form (search/NewItem) + .form-search-newitem & { + padding-left: 0; + } } //// label {} @@ -374,10 +379,47 @@ legend { .text-success { background-color: $brand-success; margin-bottom: 0; + + // Warning signs in MyAccount sidebar + &.fa-bell, + &.fa-clock-o { + color: $brand-success; + } +} + +.text-warning { + // Warning signs in MyAccount sidebar + &.fa-bell, + &.fa-clock-o { + color: $brand-warning; + } } .text-danger { background-color: $brand-danger; + + // Warning sign in front of Login/MyAccount in header + &.fa-exclamation-triangle { + color: $brand-danger; + } +} + +// Warning signs in MyAccount sidebar and warning sign in front of Login/MyAccount in header +.text-danger, +.text-success, +.text-warning { + &.fa-bell, + &.fa-clock-o, + &.fa-exclamation-triangle { + background: transparent; + padding: 0; + + // icons in header navbar on Hover + .btn:focus &, + .btn:hover & { + color: inherit; + } + } } //// Required symbol @@ -484,7 +526,8 @@ select { } // remove icons in limiter select boxes in adv. search -#advSearchForm .limiter-boxes select.form-control { +#advSearchForm .limiter-boxes select.form-control, +#newitem_department { background-image: none; height: auto; } @@ -816,6 +859,17 @@ table.collapse.in { margin-top: 15px; } } + + // cover + .ajaxcover .spinner { + height: 0; + position: absolute; + } + + .cover-container { + min-width: 6em; + } + // cover - END } //// Sprites for Mediaicons @@ -1503,23 +1557,36 @@ header, .search.container { padding-right: 0; - // Make wider to fit searchbox and right-hand nav-elements in - @media only screen and (min-width: $screen-sm-min) { + // Make wider to fit searchbox and right-hand nav-elements + @media (min-width: $screen-sm-min) { flex: 0 1 auto; padding-top: $button-top-padding; + width: auto; } // Float "Find" button next to searchbox on XS and SM - @media only screen and (max-width: $screen-sm-max) { + @media (max-width: $screen-sm-max) { padding-left: 0; + } + + @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + flex: content; + } - .searchForm { + .searchForm_lookfor { + @media (max-width: $screen-xs-max) { + //max-width: 80%; + } + } + + .searchForm { + @media only screen and (max-width: $screen-sm-max) { display: flex; input { flex-grow: 2; flex-shrink: 2; - max-width: 43%; + // max-width: 43%; } .navbar { @@ -1533,23 +1600,8 @@ header, top: 40px; } } - } - - @media only screen and (max-width: $screen-xs-max) { - .searchForm_lookfor { - max-width: 80%; - } - } - @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { - flex: content; - - .btn, - .form-control { - float: left; - } - - .searchForm { + @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { display: block; .checkbox { @@ -1557,6 +1609,13 @@ header, } } } + + .btn, + .form-control { + @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) { + float: left; + } + } } //// this will get search box and buttons in line @@ -1878,6 +1937,13 @@ footer { padding-left: ($grid-gutter-width / 2); } +//// Result List ol, ul that contains li.result or facet group that contains li.facet +.record-list { + list-style: none; + padding: 0; + margin: 0; +} + //// Results (see BS SCSS/COMPONENTS/... for details) .result { hyphens: auto; @@ -1942,8 +2008,8 @@ footer { //// access-icon in resultlist .result { .media-left { - min-width: 16%; text-align: center; + width: 17%; //// remove left padding for print @media print { @@ -2309,9 +2375,11 @@ footer { // MAIN CONTENT - END // SIDEBAR -// Width when offcanvas if off +// Width when offcanvas is off body:not(.offcanvas) .sidebar { - width: 100%; + @media only screen and (max-width: $screen-xs-max) { + width: 100%; + } } //// pull content to right border for sidebar right @@ -2322,7 +2390,7 @@ body:not(.offcanvas) .sidebar { } } -//// Style my account sidebar menues to get the same look as facets +//// Style myaccount sidebar menues to get the same look as facets .myresearch-menu { border: 1px solid $border-color; @@ -2451,7 +2519,7 @@ body:not(.offcanvas) .sidebar { } } -//// OR- and AND-Facets + item counts in My Account +//// OR- and AND-Facets + item counts in MyAccount ///// Style the exclude icons .exclude i { color: $badge-link-color; @@ -2489,6 +2557,15 @@ body:not(.offcanvas) .sidebar { } } + // Numbers in MyAccount sidebar + &.ok, + &.overdue { + .myresearch-menu & { + color: $white; + padding: 3px 7px; + } + } + ////// light color on dark, when active (Facets + My Account) - we need the parent for specificity .facet.active > &, .sidebar a.active > & { @@ -2838,4 +2915,4 @@ input { } } -// AMSL - END +// AMSL - END \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-additionals.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-additionals.phtml index 7ee1dc4a8e260244adb97a318820e7075cf26164..25db346933b87109240b3531290d510c94295262 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/data-additionals.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/data-additionals.phtml @@ -9,6 +9,15 @@ <a href="<?=$url?>"><?=$this->escapeHtml($additional['text'])?></a> <?php endif; ?> <?php unset($url) ?> + <?php elseif (isset($additional['related_records'])): ?> + <?=$this->render( + 'RecordDriver/DefaultRecord/data-relatedRecords', + [ + 'data' => $additional['related_records'], + 'driver' => $this->driver, + 'label' => $additional['text'], + ] + ) ?> <?php else: ?> <?=$this->escapeHtml($additional['text'])?> <?php endif; ?> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/data-relatedRecords.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/data-relatedRecords.phtml new file mode 100644 index 0000000000000000000000000000000000000000..ae4992a21951a38c840dc8aff2800fda90db014a --- /dev/null +++ b/themes/finc/templates/RecordDriver/DefaultRecord/data-relatedRecords.phtml @@ -0,0 +1,17 @@ +<?php $first_other = TRUE; +foreach ($data['first_results'] as $other): ?> + <?php if ($first_other): ?> + <?php $first_other = FALSE; + if (!isset($label) || empty($label)) { + $label = $other->getTitle(); + } + ?> + <?php else: ?> + <?php $label = $other->getTitle() ?> + <br/> + <?php endif; ?> + <a href="<?= $this->recordLink()->getUrl($other->getUniqueId()) ?>"><?= $this->escapeHtml($label) ?></a> +<?php endforeach; ?> +<?php if (isset($data['more_query'])): ?> + <br/><a href="<?= $this->record($this->driver)->getLink('related', $data['more_query']) ?>"><?= $this->translate('More') ?> ...</a> +<?php endif; ?> \ No newline at end of file diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml index 991ba371499a349bff31bede9361361cf666133e..fb02204b5e109f165299c750dffcf523a98e066b 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml @@ -17,15 +17,16 @@ $coverDetails = $this->record($this->driver)->getCoverDetails('list-entry', 'med $cover = $coverDetails['html']; $thumbnail = false; $thumbnailAlignment = $this->record($this->driver)->getThumbnailAlignment('list'); -if ($cover): - ob_start(); ?> - <div class="media-<?=$thumbnailAlignment?> <?=$this->escapeHtmlAttr($coverDetails['size'])?>"> - <?=$cover?> - </div> - <?php $thumbnail = ob_get_contents(); ?> - <?php ob_end_clean(); ?> -<?php endif; ?> -<div class="result<?php if ($this->driver->supportsAjaxStatus()): ?> ajaxItem<?php endif ?>"> +?> +<li class="result<?php if ($this->driver->supportsAjaxStatus()): ?> ajaxItem<?php endif ?>"> + <?php if ($cover): + ob_start(); ?> + <div class="media-<?=$thumbnailAlignment?> <?=$this->escapeHtmlAttr($coverDetails['size'])?>"> + <?=$cover?> + </div> + <?php $thumbnail = ob_get_contents(); ?> + <?php ob_end_clean(); ?> + <?php endif; ?> <input type="hidden" value="<?=$this->escapeHtmlAttr($id)?>" class="hiddenId"/> <input type="hidden" value="<?=$this->escapeHtmlAttr($source)?>" class="hiddenSource"/> <?=$this->record($this->driver)->getCheckbox()?> @@ -37,17 +38,18 @@ if ($cover): <div class="result-body"> <div class="resultItemLine1"> <?php $missing = $this->driver instanceof \VuFind\RecordDriver\Missing; ?> + <?php $describedById = $driver->getSourceIdentifier() . '|' . $driver->getUniqueId(); ?> <?php if ($missing && $this->driver->isCachedRecord()): ?> - <span class="title"><?=$this->record($this->driver)->getTitleHtml()?></span> + <span id="<?=$describedById?>" class="title"><?=$this->record($this->driver)->getTitleHtml()?></span> <p class="alert alert-info"> <?= $this->translate('record_from_cache')?> <?php if ($queryParams = $this->record($this->driver)->getAdvancedSearchQueryParams()): ?> - <br/><a href="<?=$this->url('search-results', [], ['query'=>$queryParams])?>"><?=$this->transEsc('search_cached_record', ['%%title_full%%' => $this->driver->getTitle()])?></a> + <br/><a href="<?=$this->url('search-results', [], ['query' => $queryParams])?>"><?=$this->transEsc('search_cached_record', ['%%title_full%%' => $this->driver->getTitle()])?></a> <?php endif; ?> </p> <?php elseif (!$missing): ?> <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="getFull" data-view="<?=$this->params->getOptions()->getListViewOption() ?>"> - <span class="title"><?=$this->record($this->driver)->getTitleHtml()?></span> + <span id="<?=$describedById?>" class="title"><?=$this->record($this->driver)->getTitleHtml()?></span> </a> <?php endif;?> </div> @@ -200,7 +202,7 @@ if ($cover): <?php if ($isEditable): ?> <i class="fa fa-fw fa-edit" aria-hidden="true"></i> <a href="<?=$this->url('myresearch-edit')?>?id=<?=urlencode($id)?>&source=<?=urlencode($source)?><?php if (null !== $list_id): ?>&list_id=<?=urlencode($list_id)?><?php endif; ?>" - class="edit tool"><?=$this->transEsc('Edit')?></a><br/> + class="edit tool" aria-label="<?=$this->transEsc('Edit').': '.$this->record($this->driver)->getTitleHtml()?>"><?=$this->transEsc('Edit')?></a><br/> <?php /* Use a different delete URL if we're removing from a specific list or the overall favorites: */ $deleteUrl = null === $list_id ? $this->url('myresearch-favorites') @@ -215,7 +217,7 @@ if ($cover): <i class="fa fa-fw fa-trash-o" aria-hidden="true"></i> <a class="dropdown-toggle del-button" id="<?= $dLabel ?>" role="button" data-toggle="dropdown" - href="<?= $deleteUrlGet ?>"> + href="<?= $deleteUrlGet ?>" aria-label="<?=$this->transEsc('Delete').': '.$this->record($this->driver)->getTitleHtml()?>"> <?= $this->transEsc('Delete') ?> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="<?= $dLabel ?>"> @@ -259,5 +261,5 @@ if ($cover): <?=$thumbnail?> <?php endif; ?> </div> -</div> +</li> <!-- finc: RecordDriver - DefaultRecord - list-entry - END --> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml index 6baef95748b7f8840d8e78a07a38a48c5a700c41..36660cc5e396252fc74e6434b0e0fd971fcc63e4 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml @@ -5,6 +5,7 @@ $coverDetails = $this->record($this->driver)->getCoverDetails('result-list', 'me $cover = $coverDetails['html']; $thumbnail = false; $thumbnailAlignment = $this->record($this->driver)->getThumbnailAlignment('result'); +$describedById = $driver->getSourceIdentifier() . '|' . $driver->getUniqueId(); if ($cover): ob_start(); ?> <div class="media-<?=$thumbnailAlignment?> <?=$this->escapeHtmlAttr($coverDetails['size'])?>"> @@ -32,7 +33,7 @@ if ($cover): <div class="media-body"> <div class="result-body"> <div> - <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>"> + <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>"> <?=$this->record($this->driver)->getTitleHtml()?> </a> </div> diff --git a/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml b/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml index ac12afe218d6bbb6d573191c4570de887a9b20cd..b21060414fe9f741847bb2c695b19086527eca64 100644 --- a/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml +++ b/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml @@ -1,12 +1,12 @@ <!-- finc: recordDriver - FincMissing - result-list --> <?php /* this is mostly a copy of finc: recordDriver - DefaultRecord - result-list - it is only used for the print view of FincMissingRecords in bulk mode + it is only used for the print view of FincMissingRecords in bulk mode; + Fixme: Please remove any code we don't need here! - CK */ ?> <?php -/* finc: compare SolrAI/result-list with this one during upgrades! - CK */ $coverDetails = $this->record($this->driver)->getCoverDetails('result-list', 'medium', $this->recordLink()->getUrl($this->driver)); $cover = $coverDetails['html']; $thumbnail = false; @@ -21,7 +21,7 @@ if ($cover): <?php /* Show finc style-based icons; */ ?> <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> <?php ob_start(); ?> - <div class="media-<?=$thumbnailAlignment?> record-icon"> + <div class="media-<?=$thumbnailAlignment?> record-icon missing"> <?=$this->record($this->driver)->getRecordIcon()?> </div> <?php $thumbnail = ob_get_contents(); ?> @@ -38,84 +38,18 @@ if ($cover): <div class="media-body"> <div class="result-body"> <div> - <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>"> + <?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()?>"> <?=$this->record($this->driver)->getTitleHtml()?> - </a> + </span> </div> - <div> - <?php $summAuthors = $this->driver->getPrimaryAuthors(); - if (!empty($summAuthors)): ?> - <?=$this->transEsc('by')?> - <?php $authorCount = count($summAuthors); - foreach ($summAuthors as $i => $summAuthor): ?> - <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; ?> - <?php - /* finc-specific from here, #8639, #7345 - CK */ - /* finc-specific: nxt line #8639 - CK */ ?> - <?php $journalTitle = $this->driver->getContainerTitle(); - $summDate = current($this->driver->getPublicationDates()); ?> - <?php if (!empty($journalTitle)): ?> - <?=!empty($summAuthor) ? '<br />' : ''?> - <?=$this->transEsc('Published in')?> - <?php $containerSource = $this->driver->getSourceIdentifier(); ?> - <?php $containerID = $this->driver->getContainerRecordID(); ?> - <?php /* TODO: handle highlighting more elegantly here: */ ?> - <a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', str_replace(['{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'], '', $journalTitle)))?>"><?=$this->highlight($journalTitle) ?></a> - <?php /* finc-specific: nxt line #8639 - CK */ ?> - <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?> - <?php elseif (!empty($summDate)): ?> - <?=!empty($summAuthor) ? '<br />' : ''?> - <?php /* finc-specific: nxt line #8639 - CK */ ?> - <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?> - <?php endif; ?> - <?php $summInCollection = $this->driver->getContainingCollections(); - if (!empty($summInCollection)): ?> - <?php foreach ($summInCollection as $collId => $collText): ?> - <div> - <strong><?=$this->transEsc("in_collection_label")?></strong> - <a class="collectionLinkText" href="<?=$this->url('collection', ['id' => $collId])?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> - <?=$this->escapeHtml($collText)?> - </a> - </div> - <?php endforeach; ?> - <?php endif; ?> - </div> - <?php $summCallNo = $this->driver->getCallNumber(); - if (!empty($summCallNo)): ?> - <div class="callnumAndLocation"> - <strong><?=$this->transEsc('Call Number')?>:</strong> <?=$this->escapeHtml($summCallNo)?> - </div> - <?php endif; ?> + <?php /* We don't display formats nor previews nor other details for missing records - CK */ ?> - <div class="result-formats"> - <?=$this->record($this->driver)->getFormatList()?> - </div> </div> <div class="result-links hidden-print"> - <?php /* Display qrcode if appropriate: */ ?> - - <?php if ($this->cart()->isActiveInSearch() && $this->params->getOptions()->supportsCart() && $this->cart()->isActive()): ?> - <?=$this->render('record/cart-buttons.phtml', ['id' => $this->driver->getUniqueId(), 'source' => $this->driver->getSourceIdentifier()]);?><br/> - <?php endif; ?> - - <?php if ($this->userlist()->getMode() !== 'disabled'): ?> - <?php if ($this->permission()->allowDisplay('feature.Favorites')): ?> - <?php /* Add to favorites; finc: keep Icon inside link - CK */ ?> - <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" data-lightbox class="save-record result-link-label" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" title="<?=$this->transEsc('Add to favorites')?>"> - <i class="fa fa-fw fa-star" aria-hidden="true"></i> <span class="hidden-xs hidden-sm"><?=$this->transEsc('Add to favorites')?></span> - </a><br/> - <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> - <?=$block?> - <?php endif; ?> - <?php /* Saved lists */ ?> - <p class="savedLists alert alert-info hidden"> - <strong><?=$this->transEsc("Saved in")?>:</strong> - </p> - <?php endif; ?> + <?php /* We don't display any interaction buttons for missing records - CK */ ?> <?=$this->driver->supportsCoinsOpenUrl() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenUrl()) . '"></span>' : ''?> </div> diff --git a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml index 37b59c796055be28f670027ccd96cb3bf20a8d86..23ac31912b26e37d9c68fb16cd0984123776dc09 100644 --- a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml +++ b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml @@ -208,11 +208,11 @@ if ($cover): ?> <span class="hidden-xs"> <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a> - <div class="qrcode hidden"> + <span class="qrcode hidden"> <script type="text/template" class="qrCodeImgTag"> <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> </script> - </div> + </span> <br/> </span> <?php endif; ?> diff --git a/themes/finc/templates/cart/contents.phtml b/themes/finc/templates/cart/contents.phtml index 2ececda64d0cd0f05fe5eecaf9328bb71a357bbf..1546577216b002f73c576f91678eea424fcd6b8a 100644 --- a/themes/finc/templates/cart/contents.phtml +++ b/themes/finc/templates/cart/contents.phtml @@ -7,7 +7,8 @@ if (!empty($records)): ?> <div class="checkbox"> <label> <?=$this->record($record)->getCheckbox('cart')?> - <a title="<?=$this->transEsc('View Record')?>" href="<?=$this->recordLink()->getUrl($record)?>" data-lightbox-ignore><?=$this->escapeHtml($record->getBreadcrumb())?> + <?php $describedById = $record->getSourceIdentifier() . '|' . $record->getUniqueId(); ?> + <a id="<?=$describedById?>" title="<?=$this->transEsc('View Record')?>" href="<?=$this->recordLink()->getUrl($record)?>" data-lightbox-ignore><?=$this->escapeHtml($record->getBreadcrumb())?> <?php // finc-specific: Collect citation data: $helper = $this->citation($record); diff --git a/themes/finc/templates/header.phtml b/themes/finc/templates/header.phtml index e277d9d9374976bbd3e34e3f0b88dea27fefbfb2..b2019c53f1fe2c15e6e4d3b2e757cce73be8f037 100644 --- a/themes/finc/templates/header.phtml +++ b/themes/finc/templates/header.phtml @@ -48,7 +48,7 @@ <li class="logoutOptions<?php if ($account->dropdownEnabled()): ?> with-dropdown<?php endif ?><?php if (!$account->isLoggedIn()): ?> hidden<?php endif ?>"> <a class="btn" href="<?=$this->url('myresearch-home', [], ['query' => ['redirect' => 0]])?>"> <i id="account-icon" class="fa fa-home" aria-hidden="true"></i> - <span class="sr-only"><?=$this->transEsc("Your Account")?></span> + <span><?=$this->transEsc("Your Account")?></span> </a> </li> <?php if ($account->dropdownEnabled()): ?> @@ -61,21 +61,21 @@ <?php endif; ?> <li class="logoutOptions<?php if (!$account->isLoggedIn()): ?> hidden<?php endif ?>"> <a href="<?=$this->url('myresearch-logout')?>" class="logout btn"> - <i class="fa fa-sign-out" aria-hidden="true" title="<?=$this->transEsc('Log Out')?>"></i> - <span class="sr-only"><?=$this->transEsc("Log Out")?></span> + <i class="fa fa-sign-out" aria-hidden="true"></i> + <span><?=$this->transEsc("Log Out")?></span> </a> </li> <li id="loginOptions"<?php if ($account->isLoggedIn()): ?> class="hidden"<?php endif ?>> <?php if ($account->getSessionInitiator($this->serverUrl($this->url('myresearch-home')))): ?> <a class="btn" href="<?=$this->url('myresearch-userlogin')?>"> - <i class="fa fa-sign-in" aria-hidden="true" title="<?=$this->transEsc('Institutional Login')?>"></i> - <span class="sr-only"><?=$this->transEsc("Institutional Login")?></span> + <i class="fa fa-sign-in" aria-hidden="true"></i> + <span><?=$this->transEsc("Institutional Login")?></span> </a> <?php else: ?> <a class="btn" href="<?=$this->url('myresearch-userlogin')?>" data-lightbox> - <i class="fa fa-sign-in" aria-hidden="true" title="<?=$this->transEsc('Login')?>"></i> - <span class="sr-only"><?=$this->transEsc("Login")?></span> + <i class="fa fa-sign-in" aria-hidden="true"></i> + <span><?=$this->transEsc("Login")?></span> </a> <?php endif; ?> </li> @@ -126,7 +126,7 @@ <?php /* finc searchbox: we use searchbox here so it becomes part of the sticky header, we need to place this after the navbar-right for anything but mobile - see flex-container in SCSS:*/ ?> <?php if ($this->layout()->searchbox !== false): ?> - <div class="search container navbar"> + <div class="search container"> <nav class="nav searchbox hidden-print" role="search"> <?=$this->layout()->searchbox?> </nav> diff --git a/themes/finc/templates/layout/layout.phtml b/themes/finc/templates/layout/layout.phtml index 2993ffd55b4da7907a2a64ae0fc8096f3329df2d..de31a198ebb34751939531dd2df5d536f8046c64 100644 --- a/themes/finc/templates/layout/layout.phtml +++ b/themes/finc/templates/layout/layout.phtml @@ -153,28 +153,30 @@ if (!isset($this->layout()->searchbox)) { $this->layout()->searchbox = $this->render('search/searchbox.phtml'); } ?> -<?php if (isset($this->layout()->srmessage)): // message for benefit of screen-reader users ?> - <span class="sr-only" role="heading" aria-level="1"><?=$this->layout()->srmessage?></span> -<?php endif; ?> -<?php /* Add landmark role to avoid 'all content must be inside landmarks error', CK */ ?> -<div role="navigation" aria-label="Skip_navigation_links"> - <?php /* Show skip to search link only when page is not "advanced" search, CK */ ?> - <?php if (strtolower($this->layout()->templateName) !== 'advanced'): ?> - <a class="sr-only" href="#searchForm_lookfor"><?=$this->transEsc('Skip to search')?></a> +<?php /* Move skip links inside header landmark; + Start header here, not above, custom finc, CK */ ?> +<header class="hidden-print"> + <?php if (isset($this->layout()->srmessage)): // message for benefit of screen-reader users ?> + <span class="sr-only" role="heading" aria-level="1"><?=$this->layout()->srmessage?></span> <?php endif; ?> - <a class="sr-only" href="#content"><?=$this->transEsc('Skip to content')?></a> - <?php if (substr_count(strtolower($this->layout()->templateName), 'results') > 0): ?> - <?php if (strcmp($this->layout()->userLang, 'de') == 0): ?> - <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search')?></a> - <?php else: ?> - <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc('skip-to')?><?=strtolower($this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search'))?></a> + + <?php /* Add landmark role to avoid 'all content must be inside landmarks error', CK */ ?> + <div role="navigation" aria-label="<?=$this->transEsc('Skip_navigation_links')?>"> + <?php /* Show skip to search link only when page is not "advanced" search, CK */ ?> + <?php if (strtolower($this->layout()->templateName) !== 'advanced'): ?> + <a class="sr-only" href="#searchForm_lookfor"><?=$this->transEsc('Skip to search')?></a> <?php endif; ?> - <?php endif; ?> -</div> - -<?php /* Start header here, not above, custom finc, CK */ ?> -<header class="hidden-print"> + <a class="sr-only" href="#content"><?=$this->transEsc('Skip to content')?></a> + <?php if (substr_count(strtolower($this->layout()->templateName), 'results') > 0): ?> + <?php if (strcmp($this->layout()->userLang, 'de') == 0): ?> + <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search')?></a> + <?php else: ?> + <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc('skip-to')?><?=strtolower($this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search'))?></a> + <?php endif; ?> + <?php endif; ?> + </div> + <?=$this->render('header.phtml')?> </header> <nav class="breadcrumbs" aria-label="<?=$this->transEsc('Breadcrumbs')?>"> diff --git a/themes/finc/templates/myresearch/checkedout.phtml b/themes/finc/templates/myresearch/checkedout.phtml index a004ba5b0b99714875ad6e6b5e7f3c37da1807ee..00979e067ad3eea77db77c565373ebbb01b99c5e 100644 --- a/themes/finc/templates/myresearch/checkedout.phtml +++ b/themes/finc/templates/myresearch/checkedout.phtml @@ -75,15 +75,17 @@ <?php endif; ?> <?php endforeach; ?> + <ul class="record-list"> <?php $i = 0; foreach ($this->transactions as $resource): ?> <?php $ilsDetails = $resource->getExtraDetail('ils_details'); ?> - <div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId())?>" class="result"> + <?php $describedById = $resource->getSourceIdentifier() . '|' . $resource->getUniqueId(); ?> + <li id="record<?=$this->escapeHtmlAttr($resource->getUniqueId())?>" class="result"> <?php if ($this->renewForm): ?> <div class="checkbox"> <?php if (isset($ilsDetails['renewable']) && $ilsDetails['renewable'] && isset($ilsDetails['renew_details'])): ?> <?php $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $ilsDetails['renew_details']); ?> <label> - <input class="checkbox-select-item" type="checkbox" name="renewSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>" id="checkbox_<?=$safeId?>" /> + <input class="checkbox-select-item" type="checkbox" name="renewSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>" id="checkbox_<?=$safeId?>" aria-describedby="<?=$describedById?>" aria-label="<?=$this->transEsc('select_item')?>" /> </label> <input type="hidden" name="selectAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>" /> <input type="hidden" name="renewAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['renew_details'])?>" /> @@ -116,7 +118,7 @@ if (is_a($resource, 'VuFind\\RecordDriver\\SolrDefault') && !is_a($resource, 'VuFind\\RecordDriver\\Missing')) { $title = $resource->getTitle(); $title = empty($title) ? $this->transEsc('Title not available') : $this->escapeHtml($title); - echo '<a href="' . $this->recordLink()->getUrl($resource) . + echo '<a id="' . $describedById . '" href="' . $this->recordLink()->getUrl($resource) . '" class="title">' . $title . '</a>'; } elseif (isset($ilsDetails['title']) && !empty($ilsDetails['title'])){ // If the record is not available in Solr, perhaps the ILS driver sent us a title we can show... @@ -201,8 +203,9 @@ <?php endif ?> </div> <?=$resource->tryMethod('supportsCoinsOpenUrl')?'<span class="Z3988" title="' . $this->escapeHtmlAttr($resource->getCoinsOpenUrl()) . '"></span>':''?> - </div> + </li> <?php endforeach; ?> + </ul> <?php if ($this->renewForm): ?></form><?php endif; ?> <?=$paginator ? $this->paginationControl($paginator, 'Sliding', 'Helpers/pagination.phtml', compact('params')) : ''?> <?php else: ?> diff --git a/themes/finc/templates/myresearch/historicloans.phtml b/themes/finc/templates/myresearch/historicloans.phtml index 539b4d1c5ab4878173430e7fff43d7ca3a94322d..969bed2ec547bad90b19f7e89b04222ed21f0dfc 100644 --- a/themes/finc/templates/myresearch/historicloans.phtml +++ b/themes/finc/templates/myresearch/historicloans.phtml @@ -40,9 +40,10 @@ <?php endif; ?> </nav> + <ul class="record-list"> <?php $i = 0; foreach ($this->transactions as $resource): ?> <?php $ilsDetails = $resource->getExtraDetail('ils_details'); ?> - <div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId())?>" class="result"> + <li id="record<?=$this->escapeHtmlAttr($resource->getUniqueId())?>" class="result"> <?php $coverDetails = $this->record($resource)->getCoverDetails('checkedout', 'small', $this->recordLink()->getUrl($resource)); $cover = $coverDetails['html']; @@ -123,8 +124,9 @@ <?php endif ?> </div> <?=$resource->tryMethod('supportsCoinsOpenUrl')?'<span class="Z3988" title="' . $this->escapeHtmlAttr($resource->getCoinsOpenUrl()) . '"></span>':''?> - </div> + </li> <?php endforeach; ?> + </ul> <?=$this->paginator ? $this->paginationControl($this->paginator, 'Sliding', 'Helpers/pagination.phtml', ['params' => $this->params]) : ''?> <?php else: ?> <?=$this->transEsc('loan_history_empty')?> diff --git a/themes/finc/templates/myresearch/holds.phtml b/themes/finc/templates/myresearch/holds.phtml index a56c24f8d94134a858957ccd987aff1025b45a7e..315ba230bf4cfd4cd947dff18d0dd16cc0b970a7 100644 --- a/themes/finc/templates/myresearch/holds.phtml +++ b/themes/finc/templates/myresearch/holds.phtml @@ -42,16 +42,18 @@ <?php endif; ?> <?php $iteration = 0; ?> + <ul class="record-list"> <?php foreach ($this->recordList as $resource): ?> <?php $iteration++; ?> <?php $ilsDetails = $resource->getExtraDetail('ils_details'); ?> - <div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="result"> + <?php $describedById = $resource->getSourceIdentifier() . '|' . $resource->getUniqueId(); ?> + <li id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="result"> <?php if ($this->cancelForm && isset($ilsDetails['cancel_details'])): ?> <?php $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $resource->getUniqueId()); ?> <input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" /> <div class="checkbox"> <label> - <input type="checkbox" name="cancelSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" id="checkbox_<?=$safeId?>" /> + <input type="checkbox" name="cancelSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" id="checkbox_<?=$safeId?>" aria-describedby="<?=$describedById?>" aria-label="<?=$this->transEsc('select_item')?>" /> </label> </div> <?php endif; ?> @@ -79,11 +81,11 @@ if (is_a($resource, 'VuFind\\RecordDriver\\SolrDefault') && !is_a($resource, 'VuFind\\RecordDriver\\Missing')) { $title = $resource->getTitle(); $title = empty($title) ? $this->transEsc('Title not available') : $this->escapeHtml($title); - echo '<a href="' . $this->recordLink()->getUrl($resource) + echo '<a id="' . $describedById . '" href="' . $this->recordLink()->getUrl($resource) . '" class="title">' . $title . '</a>'; } elseif (isset($ilsDetails['title']) && !empty($ilsDetails['title'])){ // If the record is not available in Solr, perhaps the ILS driver sent us a title we can show... - echo '<span class="title">' . $this->escapeHtml($ilsDetails['title']) . '</span>'; + echo '<span class="title" id="' . $describedById . '">' . $this->escapeHtml($ilsDetails['title']) . '</span>'; } else { // Last resort -- indicate that no title could be found. echo $this->transEsc('Title not available'); @@ -175,8 +177,9 @@ <?php endif ?> </div> <?=$resource->tryMethod('supportsCoinsOpenUrl')?'<span class="Z3988" title="' . $this->escapeHtmlAttr($resource->getCoinsOpenUrl()) . '"></span>':''?> - </div> + </li> <?php endforeach; ?> + </ul> <?php if ($this->cancelForm): ?></form><?php endif; ?> <?php else: ?> <?=$this->transEsc('You do not have any holds or recalls placed') ?>. diff --git a/themes/finc/templates/myresearch/illrequests.phtml b/themes/finc/templates/myresearch/illrequests.phtml index 4fbba305d4d0dede164fcfc960c15ffe3152a89a..c95819f7c4f53a17bc9d01f5bd165940b39fc4de 100644 --- a/themes/finc/templates/myresearch/illrequests.phtml +++ b/themes/finc/templates/myresearch/illrequests.phtml @@ -43,16 +43,18 @@ <?php endif; ?> <?php $iteration = 0; ?> + <ul class="record-list"> <?php foreach ($this->recordList as $resource): ?> <?php $iteration++; ?> <?php $ilsDetails = $resource->getExtraDetail('ils_details'); ?> - <div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="result"> + <?php $describedById = $resource->getSourceIdentifier() . '|' . $resource->getUniqueId(); ?> + <li id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="result"> <?php if ($this->cancelForm && isset($ilsDetails['cancel_details'])): ?> <?php $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $resource->getUniqueId()); ?> <div class="checkbox"> <input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" /> <label> - <input type="checkbox" name="cancelSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" id="checkbox_<?=$safeId?>" /> + <input type="checkbox" name="cancelSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" id="checkbox_<?=$safeId?>" aria-describedby="<?=$describedById?>" aria-label="<?=$this->transEsc('select_item')?>" /> </label> </div> <?php endif; ?> @@ -80,7 +82,7 @@ if (is_a($resource, 'VuFind\\RecordDriver\\SolrDefault') && !is_a($resource, 'VuFind\\RecordDriver\\Missing')) { $title = $resource->getTitle(); $title = empty($title) ? $this->transEsc('Title not available') : $this->escapeHtml($title); - echo '<a href="' . $this->recordLink()->getUrl($resource) + echo '<a id="' . $describedById . '" href="' . $this->recordLink()->getUrl($resource) . '" class="title">' . $title . '</a>'; } elseif (isset($ilsDetails['title']) && !empty($ilsDetails['title'])){ // If the record is not available in Solr, perhaps the ILS driver sent us a title we can show... @@ -170,8 +172,9 @@ <?php endif ?> </div> <?=$resource->tryMethod('supportsCoinsOpenUrl')?'<span class="Z3988" title="' . $this->escapeHtmlAttr($resource->getCoinsOpenUrl()) . '"></span>':''?> - </div> + </li> <?php endforeach; ?> + </ul> <?php if ($this->cancelForm): ?></form><?php endif; ?> <?php else: ?> <?=$this->transEsc('You do not have any interlibrary loan requests placed') ?>. diff --git a/themes/finc/templates/myresearch/mylist.phtml b/themes/finc/templates/myresearch/mylist.phtml index 06cadc0e3a8fbad626b5ae56a3f28b288105fda0..95a00ff48f650d04520fec9938c064a6e59a9499 100644 --- a/themes/finc/templates/myresearch/mylist.phtml +++ b/themes/finc/templates/myresearch/mylist.phtml @@ -74,9 +74,11 @@ $user = $this->auth()->isLoggedIn(); <?php if ($recordTotal > 0): ?> <form class="form-inline" method="post" name="bulkActionForm" action="<?=$this->url('cart-myresearchbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler"> <?=$this->context($this)->renderInContext('myresearch/bulk-action-buttons.phtml', ['idPrefix' => '', 'list' => $list ?? null, 'account' => $this->account])?> + <ul class="record-list"> <?php foreach ($this->results->getResults() as $i => $current): ?> <?=$this->record($current)->getListEntry($list, $user)?> <?php endforeach; ?> + </ul> </form> <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results])?> <?php else: ?> diff --git a/themes/finc/templates/myresearch/storageretrievalrequests.phtml b/themes/finc/templates/myresearch/storageretrievalrequests.phtml index 115894920ccac17fe5a8bedf77c573d44f45e51a..b05bc9fb85ecb8da4d6b794ce1caf0542d3b2549 100644 --- a/themes/finc/templates/myresearch/storageretrievalrequests.phtml +++ b/themes/finc/templates/myresearch/storageretrievalrequests.phtml @@ -42,16 +42,18 @@ <?php endif; ?> <?php $iteration = 0; ?> + <ul class="record-list"> <?php foreach ($this->recordList as $resource): ?> <?php $iteration++; ?> <?php $ilsDetails = $resource->getExtraDetail('ils_details'); ?> - <div id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="result"> + <?php $describedById = $resource->getSourceIdentifier() . '|' . $resource->getUniqueId(); ?> + <li id="record<?=$this->escapeHtmlAttr($resource->getUniqueId()) ?>" class="result"> <?php if ($this->cancelForm && isset($ilsDetails['cancel_details'])): ?> <?php $safeId = preg_replace('/[^a-zA-Z0-9]/', '', $resource->getUniqueId()); ?> <div class="checkbox"> <input type="hidden" name="cancelAllIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" /> <label class="pull-left flip"> - <input type="checkbox" name="cancelSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" id="checkbox_<?=$safeId?>" /> + <input type="checkbox" name="cancelSelectedIDS[]" value="<?=$this->escapeHtmlAttr($ilsDetails['cancel_details']) ?>" id="checkbox_<?=$safeId?>" aria-describedby="<?=$describedById?>" aria-label="<?=$this->transEsc('select_item')?>" /> </label> </div> <?php endif; ?> @@ -79,7 +81,7 @@ if (is_a($resource, 'VuFind\\RecordDriver\\SolrDefault') && !is_a($resource, 'VuFind\\RecordDriver\\Missing')) { $title = $resource->getTitle(); $title = empty($title) ? $this->transEsc('Title not available') : $this->escapeHtml($title); - echo '<a href="' . $this->recordLink()->getUrl($resource) + echo '<a id="' . $describedById . '" href="' . $this->recordLink()->getUrl($resource) . '" class="title">' . $title . '</a>'; } elseif (isset($ilsDetails['title']) && !empty($ilsDetails['title'])){ // If the record is not available in Solr, perhaps the ILS driver sent us a title we can show... @@ -166,8 +168,9 @@ <?php endif ?> </div> <?=$resource->tryMethod('supportsCoinsOpenUrl')?'<span class="Z3988" title="' . $this->escapeHtmlAttr($resource->getCoinsOpenUrl()) . '"></span>':''?> - </div> + </li> <?php endforeach; ?> + </ul> <?php if ($this->cancelForm): ?></form><?php endif; ?> <?php else: ?> <?=$this->transEsc('You do not have any storage retrieval requests placed') ?>. diff --git a/themes/finc/templates/record/checkbox.phtml b/themes/finc/templates/record/checkbox.phtml new file mode 100644 index 0000000000000000000000000000000000000000..4a77b03ba688132f05fb98d9ebb3c5b4e9b4d49d --- /dev/null +++ b/themes/finc/templates/record/checkbox.phtml @@ -0,0 +1,8 @@ +<!-- finc: record - checkbox --> +<label class="record-checkbox hidden-print"> + <input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->id?>"<?php if(isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?> aria-describedby="<?=$this->id?>" aria-label="<?=$this->transEsc('select_item')?>"/> + <span class="checkbox-icon"></span> + <?php if (strlen($this->number ?? '') > 0): ?><span class="sr-only"><?=$this->transEsc('result_checkbox_label', ['%%number%%' => $this->number]) ?></span><?php endif; ?> +</label> +<input type="hidden" name="idsAll[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"<?php if(isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?>/> +<!-- finc: record - cart-buttons - END --> diff --git a/themes/finc/templates/record/cover.phtml b/themes/finc/templates/record/cover.phtml index af93f5da6ee32dd07521c4c5006ff8eda9fa2dbc..f8d179eb3f3b9d1e6c246f092509450557a16f84 100644 --- a/themes/finc/templates/record/cover.phtml +++ b/themes/finc/templates/record/cover.phtml @@ -10,12 +10,14 @@ <?php elseif ($cover === false): ?> <img src="<?=$this->url('cover-unavailable')?>" <?php if ($linkPreview): ?>data-linkpreview="true" <?php endif; ?>class="nocover" alt="<?=$this->transEsc('No Cover Image')?>" aria-hidden="true" /> <?php else: ?> - <div class="ajaxcover"> - <div class="spinner"><i class="fa fa-spinner fa-spin"></i> <?=$this->translate('Loading')?>...</div> + <div id="cover-<?=$driver->getUniqueID()?>" class="ajaxcover"> + <div class="spinner"><i class="fa fa-spinner fa-spin"></i></div> <div class="cover-container"> - <a class="coverlink"> - <img <?php if ($linkPreview): ?>data-linkpreview="true" <?php endif; ?>data-recordsource="<?=$this->escapeHtmlAttr($driver->getSourceIdentifier())?>" data-recordid="<?=$this->escapeHtmlAttr($driver->getUniqueID())?>" data-coversize="<?=$this->escapeHtmlAttr($size)?>" class="recordcover ajax" alt="<?=$this->escapeHtmlAttr($alt); ?>" /> - </a> + <?=$this->render('record/coverReplacement')?> + <a class="coverlink hidden"> + <img src onerror="loadCoverByElement({source:'<?=$this->escapeHtmlAttr($driver->getSourceIdentifier())?>', recordId:'<?=$this->escapeHtmlAttr($driver->getUniqueID())?>', size:'<?=$this->escapeHtmlAttr($size)?>'}, $('#cover-<?=$driver->getUniqueID()?>'))" + <?php if ($linkPreview): ?>data-linkpreview="true" <?php endif; ?> class="recordcover ajax" alt="<?=$this->escapeHtmlAttr($alt); ?>" /> + </a> </div> </div> <?php endif; ?> diff --git a/themes/finc/templates/search/bulk-action-buttons.phtml b/themes/finc/templates/search/bulk-action-buttons.phtml index 000657184878a36dd55ac105a2e0987fd6dbbdcb..cc40884afe28ff37699faaf0e3e6d1483eb120b3 100644 --- a/themes/finc/templates/search/bulk-action-buttons.phtml +++ b/themes/finc/templates/search/bulk-action-buttons.phtml @@ -12,7 +12,7 @@ <?php if (isset($this->showBulkOptions) && $this->showBulkOptions): ?> <input id="ribbon-email" class="btn btn-transparent" type="submit" name="email" title="<?=$this->transEsc('bookbag_email_selected')?>" value="<?=$this->transEsc('Email')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> <?php $exportOptions = $this->export()->getBulkOptions(); if (count($exportOptions) > 0): ?> - <input id="ribbon-export" class="btn btn-transparent" type="submit" name="export" title="<?=$this->transEsc('bookbag_export_selected')?>" value="<?=$this->transEsc('Export')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> + <input id="ribbon-export" class="btn btn-transparent" type="submit" name="export" title="<?=$this->transEsc('bookbag_export_selected')?>" value="<?=$this->transEsc('Export')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> <?php endif; ?> <input id="ribbon-print" class="btn btn-transparent" type="submit" name="print" title="<?=$this->transEsc('bookbag_print_selected')?>" value="<?=$this->transEsc('Print')?>"<?php if($this->formAttr):?> form="<?=$this->escapeHtmlAttr($this->formAttr) ?>"<?php endif; ?>/> <?php if ($this->userlist()->getMode() !== 'disabled'): ?> diff --git a/themes/finc/templates/search/newitem.phtml b/themes/finc/templates/search/newitem.phtml index 90b2a2077bfc8393592372667e03c42bf49b7f02..75049b76728d99909875fd5c5c842176e1c25d1c 100644 --- a/themes/finc/templates/search/newitem.phtml +++ b/themes/finc/templates/search/newitem.phtml @@ -1,41 +1,40 @@ <!-- finc - templates - search - newitem --> <?php - // Set up page title: - $this->headTitle($this->translate('New Item Search')); - - // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li class="active">' . $this->transEsc('New Items') . '</li>'; - - // Convenience variable: - $offlineMode = $this->ils()->getOfflineMode(); + // Set up page title: + $this->headTitle($this->translate('New Item Search')); + + // Set up breadcrumbs: + $this->layout()->breadcrumbs = '<li class="active">' . $this->transEsc('New Items') . '</li>'; + + // Convenience variable: + $offlineMode = $this->ils()->getOfflineMode(); ?> - -<h1><?=$this->transEsc('Find New Items')?></h1> -<?php if ($offlineMode == "ils-offline"): ?> - <?=$this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_holdings_message'])?> -<?php endif; ?> -<form method="get" class="form-search-newitem"> - <div class="form-group"> - <label class="control-label"><?=$this->transEsc('Range')?>:</label> - <div class="btn-group" data-toggle="buttons"> +<div class="mainbody"> + <h1><?= $this->transEsc('Find New Items') ?></h1> + <?php if ($offlineMode == "ils-offline"): ?> + <?= $this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_holdings_message']) ?> + <?php endif; ?> + <form method="get" class="form-search-newitem"> + <div class="form-group"> + <legend><?= $this->transEsc("Choose Period") ?>:</legend> <?php foreach ($this->ranges as $key => $range): ?> - <label class="btn btn-primary<?php if($key == 0): ?> active<?php endif ?>"> - <input type="radio" name="range" id="newitem_range_<?=$this->escapeHtmlAttr($key)?>" value="<?=$this->escapeHtmlAttr($range)?>"<?=($key == 0) ? ' checked="checked"' : ''?>/> - <?=($range == 1) ? $this->transEsc('Yesterday') : $this->transEsc('past_days', ['%%range%%' => $this->escapeHtml($range)])?> + <input type="radio" name="range" id="newitem_range_<?= $this->escapeHtmlAttr($key) ?>" value="<?= $this->escapeHtmlAttr($range) ?>"<?= ($key == 0) ? ' checked="checked"' : '' ?>/> + <label for="newitem_range_<?= $this->escapeHtmlAttr($key) ?>"> + <?= ($range == 1) ? $this->transEsc('From') . " " . $this->transEsc('Yesterday') : $this->transEsc('past_days', ['%%range%%' => $this->escapeHtml($range)]) ?> </label> <?php endforeach; ?> </div> - </div> - <?php if (is_array($this->fundList) && !empty($this->fundList)): ?> - <div class="form-group"> - <label class="control-label" for="newitem_department"><?=$this->transEsc('Department')?>:</label> - <select id="newitem_department" name="department" size="10" class="form-control"> - <?php foreach ($this->fundList as $fundId => $fund): ?> - <option value="<?=$this->escapeHtmlAttr($fundId)?>"><?=$this->transEsc($fund)?></option> - <?php endforeach; ?> - </select> - </div> - <?php endif; ?> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/> -</form> + <?php if (is_array($this->fundList) && !empty($this->fundList)): ?> + <div class="form-group"> + <label class="control-label" for="newitem_department"><?= $this->transEsc('Department') ?>:</label> + <select id="newitem_department" name="department" size="10" class="form-control"> + <?php foreach ($this->fundList as $fundId => $fund): ?> + <option value="<?= $this->escapeHtmlAttr($fundId) ?>"><?= $this->transEsc($fund) ?></option> + <?php endforeach; ?> + </select> + </div> + <?php endif; ?> + <input class="btn btn-primary" type="submit" name="submit" value="<?= $this->transEsc('Find') ?>"/> + </form> +</div> <!-- finc - templates - search - newitem - END --> diff --git a/themes/finc/templates/search/searchbox.phtml b/themes/finc/templates/search/searchbox.phtml index 65f67b3019798d98b1547c5a727e735da9afb250..0b308f0212f9d935458d87b116de2738ea5d8fd7 100644 --- a/themes/finc/templates/search/searchbox.phtml +++ b/themes/finc/templates/search/searchbox.phtml @@ -60,7 +60,7 @@ $hiddenFilterParams = $this->searchTabs()->getCurrentHiddenFilterParams($this->s <?php endif; ?> <button type="submit" class="btn btn-primary"><i class="fa fa-search" aria-hidden="true"></i> <span class="find-label sr-only"><?=$this->transEsc("Find")?></span></button> <?php if ($advSearch): ?> - <a href="<?=$this->url($advSearch) . ((isset($this->searchId) && $this->searchId) ? '?edit=' . $this->escapeHtmlAttr($this->searchId) : $hiddenFilterParams)?>" class="btn btn-transparent" role="button" rel="nofollow"><i class="fa fa-cog"></i> <span class="hidden-xs hidden-sm hidden-md"><?=$this->transEsc("Advanced")?></span></a> + <a href="<?=$this->url($advSearch) . ((isset($this->searchId) && $this->searchId) ? '?edit=' . $this->escapeHtmlAttr($this->searchId) : $hiddenFilterParams)?>" class="btn btn-transparent" role="button" rel="nofollow" aria-label="<?=$this->transEsc("Advanced")?>"><i class="fa fa-cog"></i> <span class="hidden-xs hidden-sm hidden-md"><?=$this->transEsc("Advanced")?></span></a> <?php endif; ?> <?php if ($geoUrl = $this->geocoords()->getSearchUrl($options)) : ?> <a href="<?=$geoUrl?>" class="btn btn-link"><?=$this->transEsc('Geographic Search')?></a> diff --git a/themes/finc/theme.config.php b/themes/finc/theme.config.php index d8ccfb67f974a065e14c9f4d74a4d34155223633..51037a227bb81a1179f169b376ce8b91026d8014 100644 --- a/themes/finc/theme.config.php +++ b/themes/finc/theme.config.php @@ -17,6 +17,7 @@ return [ 'recordLink' => 'finc\View\Helper\Root\RecordLink', 'record' => 'finc\View\Helper\Root\Record', 'flashmessages' => 'finc\View\Helper\Root\Flashmessages', + 'headTitle' => 'finc\View\Helper\Root\HeadTitle', ], 'factories' => [ 'finc\View\Helper\Root\BranchInfo' => @@ -41,6 +42,8 @@ return [ 'VuFind\View\Helper\Root\ResultFeedFactory', 'finc\View\Helper\Root\Flashmessages' => 'VuFind\View\Helper\Root\FlashmessagesFactory', + 'finc\View\Helper\Root\HeadTitle' => + 'finc\View\Helper\Root\Factory::getHeadTitle', ] ] ];