From 20434a17f226d8527227019e9e665a6f37f65edb Mon Sep 17 00:00:00 2001 From: Gregor Gawol <gawol@ub.uni-leipzig.de> Date: Fri, 30 Aug 2019 09:25:11 +0200 Subject: [PATCH] refs #15650 [fid_adlr] design detail view * set module fid_adlr * set core data default & ai * set design * display share button * changed design share button menu * changed breadcrumb * set tab table of contents to recorddataformatter * fixes bug playing times * set format bold --- composer.json | 8 +- composer.lock | 209 ++++++- config/application.config.php | 3 +- fid_adlr/config/vufind/export.ini | 22 + fid_adlr/languages/de.ini | 6 + fid_adlr/languages/en.ini | 4 + module/fid_adlr/Module.php | 60 ++ module/fid_adlr/config/module.config.php | 141 ++++- .../fid_adlr/src/fid_adlr/RecordTab/TOC.php | 62 ++ .../Root/RecordDataFormatterFactory.php | 571 ++++++++++++++++++ themes/fid_adlr/scss/compiled.scss | 164 ++++- .../RecordDriver/DefaultRecord/core.phtml | 157 +++++ .../DefaultRecord/data-additionals.phtml | 20 + .../DefaultRecord/data-authors.phtml | 57 ++ .../DefaultRecord/data-format.phtml | 12 + .../DefaultRecord/data-titlestatement.phtml | 10 + .../RecordDriver/DefaultRecord/toolbar.phtml | 58 ++ .../templates/RecordDriver/SolrAI/core.phtml | 160 +++++ .../RecordDriver/SolrMarc/core.phtml | 163 +++++ .../templates/RecordTab/acquisitionpda.phtml | 22 + .../templates/RecordTab/description.phtml | 26 + .../templates/RecordTab/holdingsils.phtml | 195 ++++++ .../templates/RecordTab/staffviewai.phtml | 45 ++ .../templates/RecordTab/staffviewmarc.phtml | 30 + themes/fid_adlr/templates/RecordTab/toc.phtml | 26 + themes/fid_adlr/templates/record/share.phtml | 3 + themes/fid_adlr/templates/record/view.phtml | 61 ++ themes/fid_adlr/theme.config.php | 9 + 28 files changed, 2267 insertions(+), 37 deletions(-) create mode 100644 fid_adlr/config/vufind/export.ini create mode 100644 module/fid_adlr/Module.php create mode 100644 module/fid_adlr/src/fid_adlr/RecordTab/TOC.php create mode 100644 module/fid_adlr/src/fid_adlr/View/Helper/Root/RecordDataFormatterFactory.php create mode 100644 themes/fid_adlr/templates/RecordDriver/DefaultRecord/core.phtml create mode 100644 themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-additionals.phtml create mode 100644 themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-authors.phtml create mode 100644 themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-format.phtml create mode 100644 themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-titlestatement.phtml create mode 100644 themes/fid_adlr/templates/RecordDriver/DefaultRecord/toolbar.phtml create mode 100644 themes/fid_adlr/templates/RecordDriver/SolrAI/core.phtml create mode 100644 themes/fid_adlr/templates/RecordDriver/SolrMarc/core.phtml create mode 100644 themes/fid_adlr/templates/RecordTab/acquisitionpda.phtml create mode 100644 themes/fid_adlr/templates/RecordTab/description.phtml create mode 100644 themes/fid_adlr/templates/RecordTab/holdingsils.phtml create mode 100644 themes/fid_adlr/templates/RecordTab/staffviewai.phtml create mode 100644 themes/fid_adlr/templates/RecordTab/staffviewmarc.phtml create mode 100644 themes/fid_adlr/templates/RecordTab/toc.phtml create mode 100644 themes/fid_adlr/templates/record/share.phtml create mode 100644 themes/fid_adlr/templates/record/view.phtml diff --git a/composer.json b/composer.json index d84afb037fe..dc32d98b036 100644 --- a/composer.json +++ b/composer.json @@ -85,7 +85,8 @@ "finc/vufindhttp-psrcompat": "^0.0.2", "finc/symfony-serializer-zend-bridge": "^0.0.1", "phpdocumentor/reflection-docblock": "^4.3", - "zendframework/zend-i18n-resources": "^2.6" + "zendframework/zend-i18n-resources": "^2.6", + "finc/worldcat-search-module": "^0.0.4" }, "require-dev": { "behat/mink": "1.7.1", @@ -109,8 +110,11 @@ "vendor/bin/phpcs --standard=tests/finc/phpcs.xml" ], "post-install-cmd": [ + "@copy-themes-force" ], "post-update-cmd": [ - ] + "@copy-themes-force" + ], + "copy-themes-force": "php devops/composer/themes.php --force" } } diff --git a/composer.lock b/composer.lock index 95515ffaf37..2b4b36d48cc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "83611cf5ee4d75cda9820e29478ca128", + "content-hash": "c7f7df41544f7dfa335e40adcd8bb780", "packages": [ { "name": "ahand/mobileesp", @@ -610,6 +610,56 @@ "description": "PSR compatibility layer for vufind-org/vufindhttp", "time": "2019-06-13T10:58:08+00:00" }, + { + "name": "finc/worldcat-search-module", + "version": "v0.0.4", + "source": { + "type": "git", + "url": "https://git.sc.uni-leipzig.de/ubl/finc/fid/worldcat-search-module.git", + "reference": "6a5d4f706406f079cbf6ea2a96f248a62b938c26" + }, + "require": { + "finc/vufindhttp-psrcompat": "^0.0", + "guzzlehttp/psr7": "^1.4", + "netresearch/jsonmapper": "^1.4", + "php": ">=7.1", + "psr/http-client": "^1.0" + }, + "require-dev": { + "http-interop/http-factory-guzzle": "^1.0", + "php-http/guzzle6-adapter": "^2.0", + "php-http/mock-client": "^1.2" + }, + "type": "library", + "extra": { + "vufind": { + "themes": { + "res/theme": "worldcat" + } + } + }, + "autoload": { + "psr-4": { + "finc\\WorldCat\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "Gregor Gawol", + "email": "gawol@ub.uni-leipzig.de" + }, + { + "name": "Sebastian Kehr", + "email": "kehr@ub.uni-leipzig.de" + } + ], + "description": "Worldcat Search Module", + "time": "2019-09-02T16:28:35+00:00" + }, { "name": "finc/zend-psr18bridge", "version": "v0.0.1", @@ -701,6 +751,77 @@ "homepage": "https://github.com/ghislainf/zf2-whoops", "time": "2016-06-06T08:41:08+00:00" }, + { + "name": "guzzlehttp/psr7", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2019-07-01T23:21:34+00:00" + }, { "name": "jasig/phpcas", "version": "1.3.6", @@ -960,6 +1081,52 @@ ], "time": "2019-05-05T10:12:03+00:00" }, + { + "name": "netresearch/jsonmapper", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06", + "reference": "0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "role": "Developer", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "time": "2019-08-15T19:41:25+00:00" + }, { "name": "ocramius/package-versions", "version": "1.4.0", @@ -2269,6 +2436,46 @@ ], "time": "2017-10-23T01:57:42+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "sabre/vobject", "version": "3.5.3", diff --git a/config/application.config.php b/config/application.config.php index cb113dfb315..58b38582a44 100644 --- a/config/application.config.php +++ b/config/application.config.php @@ -33,7 +33,8 @@ array_push($modules, ...[ 'finc\SymfonySerializerZendBridge', 'finc', 'fid', - 'fid_adlr', + 'finc\WorldCat', + 'fid_adlr' ]); /** End of temporarily necessary adjustments. */ diff --git a/fid_adlr/config/vufind/export.ini b/fid_adlr/config/vufind/export.ini new file mode 100644 index 00000000000..30db9803af1 --- /dev/null +++ b/fid_adlr/config/vufind/export.ini @@ -0,0 +1,22 @@ +;#################################################################### +;##################### DO NOT DELETE THIS HEADER #################### +;################### Leipzig University Library © 2015 ############## +; +; This is the ISIL-instance-specific default INI-file and inherits +; all the settings from the INI-file defined in [Parent_Config] which +; points to the default INI-file located in the folder vufind2/local +; + +[Parent_Config] +relative_path = ../../../fid/config/vufind/export.ini + +; A comma-separated list of config sections from the parent which should be +; completely overwritten by the equivalent sections in this configuration; +; any sections not listed here will be merged on a section-by-section basis. +;override_full_sections = "EndNote" + +; +; Add instance-specific customization after this header. +; +;##################### DO NOT DELETE THIS HEADER #################### +;#################################################################### \ No newline at end of file diff --git a/fid_adlr/languages/de.ini b/fid_adlr/languages/de.ini index 963f5e7b7bb..1b7b7de2eeb 100644 --- a/fid_adlr/languages/de.ini +++ b/fid_adlr/languages/de.ini @@ -50,3 +50,9 @@ Open Search = "Suche öffnen" Refine Results = "Filter" get_it = "Anfordern" + +Authors/Corporations = "Beteiligte" +Format = "Medientyp" +view_worldcat = "in diesen Bibliotheken vorhanden" +Description = "weitere Informationen" +go_to_list = "Zurück zur Übersicht" diff --git a/fid_adlr/languages/en.ini b/fid_adlr/languages/en.ini index 3ab8930d9b4..5b92308ecab 100644 --- a/fid_adlr/languages/en.ini +++ b/fid_adlr/languages/en.ini @@ -51,3 +51,7 @@ Open Search = "open search" Refine Results = "Filter" get_it = "Get it" + +Format = "Media Type" +view_worldcat = "Available in this Libraries" +Description = "further information" diff --git a/module/fid_adlr/Module.php b/module/fid_adlr/Module.php new file mode 100644 index 00000000000..d52e73fb656 --- /dev/null +++ b/module/fid_adlr/Module.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright (C) 2019 Leipzig University Library + * + * 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. + * + * @author Gregor Gawol <gawol@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +namespace fid_adlr; + +/** + * Template for ZF2 module for storing local overrides. + * + * @category VuFind + * @package Module + * @author Gregor Gawol <gawol@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://github.com/dmj/vf2-proxy + */ +class Module +{ + /** + * Get module configuration + * + * @return array + */ + public function getConfig(): array + { + return include __DIR__ . '/config/module.config.php'; + } + + /** + * Get autoloader configuration + * + * @return array + */ + public function getAutoloaderConfig() + { + return [ + 'Zend\Loader\StandardAutoloader' => [ + 'namespaces' => [ + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ], + ], + ]; + } +} diff --git a/module/fid_adlr/config/module.config.php b/module/fid_adlr/config/module.config.php index 0444a1d2c3f..2defe3b256e 100644 --- a/module/fid_adlr/config/module.config.php +++ b/module/fid_adlr/config/module.config.php @@ -15,9 +15,146 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> + * @author Gregor Gawol <gawol@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 */ +namespace fid_adlr\Module\Configuration; -return [ +$config = [ + 'controllers' => [ +// 'factories' => [ +// 'fid_bbi\Controller\FeedbackController' => 'VuFind\Controller\AbstractBaseFactory', +// 'fid_bbi\Controller\SearchController' => 'VuFind\Controller\AbstractBaseFactory', +// 'fid_bbi\Controller\RecordController' => 'VuFind\Controller\AbstractBaseWithConfigFactory', +// ], +// 'aliases' => [ +// 'feedback' => 'fid_bbi\Controller\FeedbackController', +// 'Feedback' => 'fid_bbi\Controller\FeedbackController', +// 'Search' => 'fid_bbi\Controller\SearchController', +// 'search' => 'fid_bbi\Controller\SearchController', +// 'Record' => 'fid_bbi\Controller\RecordController', +// 'record' => 'fid_bbi\Controller\RecordController', +// ], + ], + 'vufind' => [ + 'plugin_managers' => [ + 'recorddriver' => [ + 'factories' => [ + 'solrdefault' => 'finc\RecordDriver\Factory::getSolrDefault', + 'solrmarc' => 'finc\RecordDriver\Factory::getSolrMarc', + 'solrmarcfinc' => 'finc\RecordDriver\Factory::getSolrMarcFinc', + 'solrmarcfincpda' => 'finc\RecordDriver\Factory::getSolrMarcFincPDA', + 'solrmarcremote' => 'finc\RecordDriver\Factory::getSolrMarcRemote', + 'solrmarcremotefinc' => 'finc\RecordDriver\Factory::getSolrMarcRemoteFinc', + 'solrai' => 'finc\RecordDriver\Factory::getSolrAI', + 'solris' => 'finc\RecordDriver\Factory::getSolrIS', + 'solrlido' => 'finc\RecordDriver\Factory::getSolrLido', + 'solrlidondl' => 'finc\RecordDriver\Factory::getSolrLidoNdl' + ], + ], + 'recordtab' => [ + 'factories' => [ + 'hierarchytree' => 'finc\RecordTab\Factory::getHierarchyTree', + ], + 'invokables' => [ + 'staffviewai' => 'finc\RecordTab\StaffViewAI', + 'acquisitionpda' => 'finc\RecordTab\AcquisitionPDA', + 'topics' => 'finc\RecordTab\Topics', + 'descriptionlido' => 'finc\RecordTab\DescriptionLido', + 'toc' => 'fid_adlr\RecordTab\TOC' + ], + ], + ], + 'recorddriver_tabs' => [ + 'finc\RecordDriver\SolrDefault' => [ + 'tabs' => [ + 'Description' => 'Description', + 'Holdings' => null, + 'TOC' => 'TOC', + 'UserComments' => 'UserComments', + 'Reviews' => 'Reviews', + 'Excerpt' => 'Excerpt', + 'Preview' => 'preview', + 'HierarchyTree' => 'HierarchyTree', + 'Map' => 'Map', + 'Similar' => null, + 'Details' => 'StaffViewArray', + ], + 'defaultTab' => null, + ], + 'finc\RecordDriver\SolrMarcFinc' => [ + 'tabs' => [ + 'Description' => 'Description', + 'Holdings' => null, + 'TOC' => 'TOC', + 'UserComments' => 'UserComments', + 'Reviews' => 'Reviews', + 'Excerpt' => 'Excerpt', + 'Preview' => 'preview', + 'HierarchyTree' => 'HierarchyTree', + 'Map' => 'Map', + 'Similar' => null, + 'Details' => 'StaffViewMARC', + ], + 'defaultTab' => null, + ], + 'finc\RecordDriver\SolrAI' => [ + 'tabs' => [ + 'Description' => 'Description', + 'Holdings' => null, + 'TOC' => 'TOC', + 'UserComments' => 'UserComments', + 'Reviews' => 'Reviews', + 'Excerpt' => 'Excerpt', + 'Preview' => 'preview', + 'HierarchyTree' => 'HierarchyTree', + 'Map' => 'Map', + 'Similar' => null, + 'Details' => 'StaffViewAI', + ], + 'defaultTab' => null, + ], + ], + 'recorddriver_collection_tabs' => [ + 'VuFind\RecordDriver\AbstractBase' => [ + 'tabs' => [ + 'CollectionList' => 'CollectionList', + 'HierarchyTree' => 'CollectionHierarchyTree', + 'Details' => 'StaffViewArray', + ], + 'defaultTab' => null, + ], + ], + ], ]; + +$nonTabRecordActions = [ + 'PDA', + 'EmailHold', + 'ReportErrors', + 'Acquisition' +]; + +// Define record view routes -- route name => controller +// Define record view routes once again to add new nonTabRecordActions +$recordRoutes = [ + 'record' => 'Record', + 'export' => 'Export', + 'resources' => 'Resources' +]; + +// Define static routes -- Controller/Action strings +$staticRoutes = [ + 'MyResearch/Acquisition', + 'MyResearch/ResetPassword', + 'dds/Home', + 'dds/Email', + 'Record/EblLink', + 'Search/Sources' +]; + +$routeGenerator = new \VuFind\Route\RouteGenerator($nonTabRecordActions); +$routeGenerator->addRecordRoutes($config, $recordRoutes); +$routeGenerator->addStaticRoutes($config, $staticRoutes); + +return $config; \ No newline at end of file diff --git a/module/fid_adlr/src/fid_adlr/RecordTab/TOC.php b/module/fid_adlr/src/fid_adlr/RecordTab/TOC.php new file mode 100644 index 00000000000..88628626d09 --- /dev/null +++ b/module/fid_adlr/src/fid_adlr/RecordTab/TOC.php @@ -0,0 +1,62 @@ +<?php +/** + * Topics tab + * + * PHP version 5 + * + * Copyright (C) Villanova University 2010. + * + * 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 RecordTabs + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki + */ +namespace fid_adlr\RecordTab; + +/** + * Table of Contents tab + * + * @category VuFind + * @package RecordTabs + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki + */ +class TOC extends \VuFind\RecordTab\AbstractBase +{ + /** + * Get the on-screen description for this tab. + * + * @return string + */ + public function getDescription() + { + return 'Table of Contents'; + } + + /** + * Is this tab active? + * + * @return bool + */ + public function isActive() + { + $toc = $this->getRecordDriver()->tryMethod('getTOC'); + $summary = $this->getRecordDriver()->tryMethod('getSummary'); + return !empty($toc) || !empty($summary); + } +} diff --git a/module/fid_adlr/src/fid_adlr/View/Helper/Root/RecordDataFormatterFactory.php b/module/fid_adlr/src/fid_adlr/View/Helper/Root/RecordDataFormatterFactory.php new file mode 100644 index 00000000000..55aa15b6ea9 --- /dev/null +++ b/module/fid_adlr/src/fid_adlr/View/Helper/Root/RecordDataFormatterFactory.php @@ -0,0 +1,571 @@ +<?php +/** + * Factory for record driver data formatting view helper + * + * PHP version 7 + * + * Copyright (C) Villanova University 2016. + * + * 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> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:architecture:record_data_formatter + * Wiki + */ +namespace fid_adlr\View\Helper\Root; + +use VuFind\View\Helper\Root\RecordDataFormatter; + +/** + * Factory for record driver data formatting view helper + * + * @category VuFind + * @package View_Helpers + * @author Demian Katz <demian.katz@villanova.edu> + * @author Konsta Raunio <konsta.raunio@helsinki.fi> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:architecture:record_data_formatter + * Wiki + */ +class RecordDataFormatterFactory +{ + /** + * Create the helper. + * + * @return RecordDataFormatter + */ + public function __invoke() + { + $helper = new RecordDataFormatter(); + + $helper->setDefaults( + 'collection-info', + [$this, 'getDefaultCollectionInfoSpecs'] + ); + $helper->setDefaults( + 'collection-record', + [$this, 'getDefaultCollectionRecordSpecs'] + ); + $helper->setDefaults( + 'description', + [$this, 'getDefaultDescriptionSpecs'] + ); + $helper->setDefaults( + 'toc', + [$this, 'getTOCSpecs'] + ); + + // $helper->setDefaults('holdingsils', [$this, 'getHoldingsILSSpecs']); + $helper->setDefaults('core-ai', [$this, 'getAiCoreSpecs']); + + $helper->setDefaults('core-marc', [$this, 'getMarcCoreSpecs']); + return $helper; + } + + /** + * Get default specifications for displaying data in core metadata. + * + * @return array + */ + public function getAiCoreSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Authors/Corporations', + 'getDeduplicatedAuthors', + 'data-authors.phtml', + [ + 'useCache' => true, + 'context' => [ + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ] + ] + ); + $spec->setTemplateLine( + 'In', + 'getJTitle', + 'data-jTitle.phtml' + ); + $spec->setTemplateLine( + 'Published', + 'getPublicationDetails', + 'data-publicationDetails.phtml' + ); + $spec->setLine( + 'Format', + 'getFormats', + 'RecordHelper', + ['helperMethod' => 'getFormatList'] + ); + return $spec->getArray(); + } + + /** + * Get default specifications for displaying data in collection-info metadata. + * + * @return array + */ + public function getDefaultCollectionInfoSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Authors/Corporations', + 'getDeduplicatedAuthors', + 'data-authors.phtml', + [ + 'useCache' => true, + 'context' => [ + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ] + ] + ); + $spec->setTemplateLine( + 'Title', + 'getTitleDetails', + 'data-titleDetails.phtml' + ); + $spec->setTemplateLine( + 'Dates of publication', + 'getDateSpan', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Summary', + 'getSummary', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Published', + 'getPublicationDetails', + 'data-publicationDetails.phtml' + ); + $spec->setLine( + 'Edition', + 'getEdition', + null, + ['prefix' => '<span property="bookEdition">', 'suffix' => '</span>'] + ); + $spec->setTemplateLine( + 'Subjects', + 'getAllSubjectHeadings', + 'data-allSubjectHeadings.phtml' + ); + /* finc: remove 'Online Access' in record-details #13770 - VE */ + /* $spec->setTemplateLine('Online Access', true, 'data-onlineAccess.phtml'); */ + $spec->setTemplateLine( + 'Item Description', + 'getGeneralNotes', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Production Credits', + 'getProductionCredits', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Set Multipart', + 'getHierarchyParentTitle', + 'data-hierarchyParentTitle.phtml' + ); + $spec->setTemplateLine( + 'ISBN', + 'getISBNs', + 'data-isbn.phtml' + ); + $spec->setTemplateLine( + 'ISSN', + 'getISSNs', + 'data-issn.phtml' + ); + $spec->setTemplateLine( + 'Notes', + 'getAdditionalNotes', + 'data-escapeHtml.phtml', + [ + 'useCache' => true + ] + ); + $spec->setLine( + 'Format', + 'getFormats', + 'RecordHelper', + ['helperMethod' => 'getFormatList'] + ); + $spec->setTemplateLine( + 'Language', + 'getLanguages', + 'data-transEscCommaSepLang.phtml' + ); + $spec->setTemplateLine( + 'Additionals', + 'getAdditionals', + 'data-additionals.phtml', + [ + 'labelFunction' => function () { + return null; + } + ] + ); + return $spec->getArray(); + } + + /** + * Get default specifications for displaying data in collection-record metadata. + * + * @return array + */ + public function getDefaultCollectionRecordSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setLine('Summary', 'getSummary'); + $spec->setTemplateLine( + 'Authors/Corporations', + 'getDeduplicatedAuthors', + 'data-authors.phtml', + [ + 'useCache' => true, + 'context' => [ + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ] + ] + ); + $spec->setTemplateLine( + 'Language', + 'getLanguages', + 'data-transEscCommaSepLang.phtml' + ); + $spec->setLine( + 'Format', + 'getFormats', + 'RecordHelper', + ['helperMethod' => 'getFormatList'] + ); + $spec->setTemplateLine( + 'Access', + 'getAccessRestrictions', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Related Items', + 'getRelationshipNotes', + 'data-escapeHtml.phtml' + ); + return $spec->getArray(); + } + + /** + * Get default specifications for displaying data in the description tab. + * + * @return array + */ + public function getDefaultDescriptionSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Dates of publication', + 'getDateSpan', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Item Description', + 'getGeneralNotes', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Physical Description', + 'getPhysicalDescriptions', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Publication Frequency', + 'getPublicationFrequency', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Playing Time', + 'getPlayingTimes', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Format', + 'getSystemDetails', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Audience', + 'getTargetAudienceNotes', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Awards', + 'getAwards', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Production Credits', + 'getProductionCredits', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Bibliography', + 'getBibliographyNotes', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'ISBN', + 'getISBNs', + 'data-isbn.phtml' + ); + $spec->setTemplateLine( + 'ISSN', + 'getISSNs', + 'data-issn.phtml' + ); + $spec->setTemplateLine( + 'DOI', + 'getCleanDOI', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'EISSN', + 'getEISSNs', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Related Items', + 'getRelationshipNotes', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Access', + 'getAccessRestrictions', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Finding Aid', + 'getFindingAids', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Publication_Place', + 'getHierarchicalPlaceNames', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Author Notes', + true, + 'data-authorNotes.phtml' + ); + $spec->setTemplateLine( + 'Call Number', + 'getLocalSignature', + 'data-localSignature.phtml' + ); + $spec->setTemplateLine( + 'Notes', + 'getAdditionalNotes', + 'data-escapeHtml.phtml', + [ + 'useCache' => true + ] + ); + $spec->setTemplateLine( + 'Note', + 'getContentNote', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'ISBN', + 'getISBNs', + 'data-isbn.phtml' + ); + $spec->setTemplateLine( + 'Subjects', + 'getAllSubjectHeadings', + 'data-allSubjectHeadings.phtml' + ); + $spec->setTemplateLine( + 'Published in', + 'getContainerTitle', + 'data-containerTitle.phtml' + ); + $spec->setLine( + 'New Title', + 'getNewerTitles', + null, + ['recordLink' => 'title'] + ); + $spec->setLine( + 'Previous Title', + 'getPreviousTitles', + null, + ['recordLink' => 'title'] + ); + $spec->setTemplateLine( + 'Title Uniform', + 'getTitleUniform', + 'data-titleUniform.phtml', + [ + 'labelFunction' => function () { + return null; + } + ] + ); + $spec->setLine( + 'Edition', + 'getEdition', + null, + ['prefix' => '<span property="bookEdition">', 'suffix' => '</span>'] + ); + $spec->setLine( + 'Dissertation Note', + 'getDissertationNote', + 'data-escapeHtmlCommaSep.phtml' + ); + $spec->setTemplateLine( + 'Language', + 'getLanguages', + 'data-transEscCommaSepLang.phtml' + ); + $spec->setTemplateLine( + 'Set Multipart', + 'getHierarchyParentTitle', + 'data-hierarchyParentTitle.phtml' + ); + $spec->setTemplateLine( + 'Subjects', + 'getAllSubjectHeadings', + 'data-allSubjectHeadings.phtml' + ); + $spec->setTemplateLine( + 'child_records', + 'getChildRecordCount', + 'data-childRecords.phtml', + ['allowZero' => false] + ); + /* finc: remove 'Online Access' in record-details #13770 - VE */ + /* $spec->setTemplateLine('Online Access', true, 'data-onlineAccess.phtml'); */ + $spec->setTemplateLine( + 'Related Items', + 'getAllRecordLinks', + 'data-allRecordLinks.phtml' + ); + $spec->setTemplateLine( + 'Additionals', + 'getAdditionals', + 'data-additionals.phtml', + [ + 'labelFunction' => function () { + return null; + } + ] + ); + $spec->setTemplateLine( + 'Source', + 'getMegaCollection', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + null, + 'getOtherRelationshipEntry', + 'data-otherRelationshipEntry.phtml', + [ + ] + ); + $spec->setTemplateLine( + 'Notes', + 'getAdditionalNotes', + 'data-escapeHtml.phtml', + [ + 'useCache' => true + ] + ); + $spec->setTemplateLine('Tags', true, 'data-tags.phtml'); + return $spec->getArray(); + } + + /** + * Get marc specifications for displaying data in core metadata. + * + * @return array + */ + public function getMarcCoreSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Authors/Corporations', + 'getDeduplicatedAuthors', + 'data-authors.phtml', + [ + 'useCache' => true, + 'context' => [ + 'requiredDataFields' => [ + ['name' => 'role', 'prefix' => 'CreatorRoles::'] + ] + ] + ] + ); + $spec->setTemplateLine( + 'Title Statement', + 'getTitleStatement', + 'data-titlestatement.phtml' + ); + $spec->setTemplateLine( + 'Published', + 'getPublicationDetails', + 'data-publicationDetails.phtml' + ); + $spec->setTemplateLine( + 'Set Multipart', + 'getHierarchyParentTitle', + 'data-hierarchyParentTitle.phtml' + ); + $spec->setTemplateLine( + 'Format', + 'getFormats', + 'data-format.phtml' + ); + return $spec->getArray(); + } + + /** + * Get marc specifications for displaying data in core metadata. + * + * @return array + */ + public function getTOCSpecs() + { + $spec = new RecordDataFormatter\SpecBuilder(); + $spec->setTemplateLine( + 'Summary', + 'getSummary', + 'data-escapeHtml.phtml' + ); + $spec->setTemplateLine( + 'Table of Contents', + 'getTOC', + 'data-escapeHtml.phtml' + ); + return $spec->getArray(); + } +} diff --git a/themes/fid_adlr/scss/compiled.scss b/themes/fid_adlr/scss/compiled.scss index 599cb9672d4..0fade194c97 100644 --- a/themes/fid_adlr/scss/compiled.scss +++ b/themes/fid_adlr/scss/compiled.scss @@ -78,6 +78,7 @@ h2, h3, h4, h5 { + color: $black; // set headings to UBUNTU MONO font-family: $font-family-monospace; } @@ -129,6 +130,13 @@ h5 { // LISTS // ++ ul, +ul { + list-style-type: none; + padding-left: 0; + li { + color: $asphalt; + } +} // ++ ol {} // ++ li {} // ++ dl {} @@ -1139,7 +1147,7 @@ input.searchForm_lookfor { } .result-links { - .save-record { + .save-record, #toolbar-menu { color: $violet; } // move favorites and other icons to the right @@ -1181,42 +1189,44 @@ input.searchForm_lookfor { color: $violet; } } - .facet-group { - @include result-list-border($midnight-medium); - .active { - background-color: transparent; - color: $violet; - } - [data-toggle="collapse"]::after { - content: '\2212'; - } - .collapsed::after { - content: '\ff0b'; - } - .collapse, - .collapsing, - .facet { - border: 0; - } - .checkbox, .facet { - border: 0; - //padding: 10px 15px; - padding: .75em 1em; - width: 100%; - } - .title { - border: none; - color: $azure; - font-family: $font-family-monospace; - text-transform: uppercase; - } - } } .exclude i { color: $black; } +// FACET GROUP +.facet-group { + @include result-list-border($midnight-medium); + .active { + background-color: transparent; + color: $violet; + } + [data-toggle="collapse"]::after { + content: '\2212'; + } + .collapsed::after { + content: '\ff0b'; + } + .collapse, + .collapsing, + .facet { + border: 0; + } + .checkbox, .facet { + border: 0; + //padding: 10px 15px; + padding: .75em 1em; + width: 100%; + } + .title { + border: none; + color: $azure; + font-family: $font-family-monospace; + text-transform: uppercase; + } +} + // DATE-RANGE slider .slider-container { margin-bottom: 1.5em; @@ -1261,6 +1271,98 @@ input.searchForm_lookfor { // ++ GENERAL CONTENT PAGE - END // ++ DETAILS/RECORD VIEW PAGE +.table { + border: 0; + & tr { + border-bottom: 3px solid $midnight-medium; + @media screen and (min-width: $screen-lg-min) { + &:first-of-type { + border-top: 3px solid $midnight-medium; + } + } + } + & > tbody { + & > tr { + & > td { + color: $asphalt; + } + & > th, & > td { + font-weight: normal; + padding: 20px; + } + &:nth-of-type(2n+1) { + background-color: transparent; + } + } + } +} +.tab-content { + .tab-pane { + a { + color: $black; + } + .table { + tr { + border-bottom: 2px solid $midnight-medium; + @media screen and (min-width: $screen-lg-min) { + &:first-of-type { + border-top: 0; + } + } + color: $black; + & > th, & > td { + padding: 4px; + } + } + } + } +} +.toolbar-menu { + position: relative; + .dropdown-menu { + padding-left: 12px; + padding-right: 12px; + margin-left: -140px; + } +} +.title-toolbar { + h3 { + font-size: 24px; + } + & > .toolbar-details { + padding-top: 12px; + & > .toolbar-menu { + padding-top: 26px; + } + } +} +.openurls { + ul { + li { + a { + color: $asphalt; + &:hover { + color: #00359b; + } + } + } + } +} +.worldcat .openurls { + ul { + padding-left: 1em; + } +} +div[class$="-tab"] { + .media-body { + strong { + color: $asphalt; + } + } + .media-left { + padding-right: 88px; + } +} // ++ DETAILS/RECORD VIEW - END // ++ ADVANCED SEARCH diff --git a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/core.phtml b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/core.phtml new file mode 100644 index 00000000000..33a0c014344 --- /dev/null +++ b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/core.phtml @@ -0,0 +1,157 @@ +<!-- fid_adlr: RecordDriver - DefaultRecord - core --> +<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> + <?php /* finc: use VF5.1 offcanvas toggler here as well if you have a custom sidebar - CK */ ?> + <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> + <?php + $QRCode = $this->record($this->driver)->getQRCode("core"); + $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); + $cover = $coverDetails['html']; + $preview = $this->record($this->driver)->getPreviews(); + ?> + <?php if ($QRCode || $cover || $preview): ?> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> + <?php /* Display thumbnail if appropriate: */ ?> + <?php if ($cover): ?> + <?=$cover?> + <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, false position - GG */ ?> + <?php endif; ?> + + <?php /* Display qrcode if appropriate: */ ?> + <?php if ($QRCode): ?> + <span class="hidden-xs"> + <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + </span> + <?php endif; ?> + <?php // if you have a preview tab but want to move or remove the preview link + // from this area of the record view, this can be split into + // getPreviewData() (should stay here) and + // getPreviewLink() (can go in your desired tab) ?> + <?php if ($preview): ?> + <div class="record-previews"> + <?=$preview?> + </div> + <?php endif; ?> + </div> + <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, right position - GG */ ?> + <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> + <?=$this->record($this->driver)->getRecordIcon()?> + <?php /* EOF - finc-specific StyleBasedIcons */ ?> + </div> + <?php endif; ?> + <div class="media-body"> + <div class="title-toolbar"> + <div class="result-body"> + <?php /* finc: We want to get rid of trailing special chars in the title and limit its length to 100 chars; + in finc: keep schema name tag here!! #13861 - CK + */ + ?> + <?php /* finc: add schema tags for title #13850 - VE */ ?> + <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> + + <?php /* fid_adlr: Remove summary refs #15650 - GG */ ?> + + <?php if ($this->userlist()->getMode() !== 'disabled'): ?> + <?php /* Display the lists that this record is saved to */ ?> + <div class="savedLists hidden alert alert-info"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> + <?php endif; ?> + </div> + <div class="result-links toolbar-details"> + <?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="icon icon-star icon-1.5x" aria-hidden="true"></i> <span class="hidden-xs hidden-sm"><?/* =$this->transEsc('Add to favorites') */?></span> + </a><br/> + <div class="toolbar-menu"> + <a href="#" data-lightbox class="dropdown-toggle" id="toolbar-menu" + data-toggle="dropdown" aria-controls="toolbar-menu"> + <i class="icon icon-share-2 icon-1.5x" aria-hidden="true"></i> + </a> + <span id="toolbar-menu" class="dropdown-menu" aria-labelledby="toolbar-menu"> + <?=$this->record($this->driver)->getToolbar()?> + </span> + </div> + <br/> + <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> + <?=$block?> + <?php endif; ?> + <?php /* Saved lists */ ?> + <div class="savedLists alert alert-info hidden"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> + <?php endif; ?> + </div> + </div> + + <?php /* Display Main Details */ ?> + <?php + $formatter = $this->recordDataFormatter(); + $coreFields = $formatter->getData($this->driver, $formatter->getDefaults('core')); + ?> + <?php if (!empty($coreFields)): ?> + <table class="table table-striped"> + <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <?php foreach ($coreFields as $current): ?> + <tr> + <th><?=$this->transEsc($current['label'])?>:</th> + <td><?=$current['value']?></td> + </tr> + <?php endforeach; ?> + </table> + <?php endif; ?> + <?php /* End Main Details */ ?> + </div> + <?php if (count($this->tabs) > 0): ?> + <?php foreach ($this->tabs as $tab => $obj): ?> + <?php // add current tab to breadcrumbs if applicable: + $desc = $obj->getDescription(); + ?> + <div class="facet-group" id="side-panel-<?=$desc?>"> + <button class="title collapsed" data-toggle="collapse" href="#side-collapse-<?=$tab?>"> + <?=$this->transEsc($desc)?> + </button> + <div id="side-collapse-<?=$tab?>" class="collapse"> + <div class="tab-content"> + <div class="tab-pane active <?=$this->escapeHtmlAttr($tab) ?>-tab"> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"></div> + <div class="media-body"> + <?=$this->record($this->driver)->getTab($obj)?> + </div> + </div> + </div> + </div> + </div> + <?php endforeach; ?> + <?php endif; ?> + + <?php /* fid_adlr: set worldcat list refs #15650 - GG */ ?> + <div class="facet-group" id="side-panel-worldcat"> + <button class="title collapsed" data-toggle="collapse" href="#side-collapse-worldcat"> + <?=$this->transEsc('view_worldcat')?> + </button> + <div id="side-collapse-worldcat" class="collapse"> + <? $script = <<<JS + $(document).ready(function() { + var recordId = $('.hiddenId').val(); + var recordSource = $('.hiddenSource').val(); + // console.log({id: recordId, source: recordSource}); + $.ajax({ + dataType: 'json', + url: VuFind.path + '/AJAX/JSON?method=getWorldCat', + method: 'GET', + data: {id: recordId, source: recordSource} + }).done(function(response) { + $('.worldcat').html(response.data.html); + }); + }); +JS; + ?> + <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET');?> + <div class="worldcat"></div> + </div> + </div> +</div> +<!-- fid_adlr: RecordDriver - DefaultRecord - core - END --> diff --git a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-additionals.phtml b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-additionals.phtml new file mode 100644 index 00000000000..4b07a9c117c --- /dev/null +++ b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-additionals.phtml @@ -0,0 +1,20 @@ +<!-- finc: RecordDriver - DefaultRecord - data-additionals --> +<?php if (!empty($data) && is_array($data)): ?> + <?php foreach ($data as $additional) : ?> + <?php if (isset($additional['identifier'])): ?> + <tr> + <th> + <?=$this->transEsc($additional['identifier'])?><?php if (!preg_match('/:+$/', $additional['identifier'])): ?>:<?php endif; ?> + </th> + <td> + <?php if (isset($additional['id'])): ?> + <a href="<?=$this->recordLink()->getUrl($additional['id'])?>"><?=$this->escapeHtml($additional['text'])?></a> + <?php else: ?> + <?=$this->escapeHtml($additional['text'])?> + <?php endif; ?> + </td> + </tr> + <?php endif; ?> + <?php endforeach; ?> +<?php endif; ?> +<!-- finc: RecordDriver - DefaultRecord - data-additionals - END --> diff --git a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-authors.phtml b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-authors.phtml new file mode 100644 index 00000000000..a2512360fc5 --- /dev/null +++ b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-authors.phtml @@ -0,0 +1,57 @@ +<!-- fid_adlr: RecordDriver - DefaultRecord - data-authors --> +<?php +$formatProperty = function ($datafield, $name, $label) { + if (count($datafield) == 0) { + return ''; + } + $that = $this; + $translate = function ($str) use ($that, $label) { + return $that->transEsc($label . $str); + }; + return '<span class="author-property-' . $name . '">(' . implode(', ', array_unique(array_map($translate, $datafield))) . ')</span>'; +}; +$formattedAuthors = []; +$types = [ + 'main' => 'author', + 'secondary' => 'contributor', + 'corporate' => 'creator', + 'corporate_secondary' => 'contributor' +]; +?> +<?php foreach ($types as $type => $schemaLabel): ?> + <?php if (!empty($data[$type])): ?> + <?php foreach ($data[$type] as $author => $roles): ?> + <?php ob_start(); ?> + <span class="author-data" property="<?=$this->escapeHtml($schemaLabel)?>" typeof="Person"> + <span property="name"> + <a href="<?=$this->record($this->driver)->getLink('author', $author)?>"> + <strong><?=$this->escapeHtml($author)?></strong> + </a> + </span> + <?php + // Display additional data using the appropriate translation prefix + // (for example, to render author roles correctly): + if (!empty($requiredDataFields)) { + foreach ($requiredDataFields as $field) { + $name = $field['name']; + $prefix = $field['prefix'] ?? ''; + // deprecated due to more flexible solution at core + // to-do: revision of indexing and finc specific treatment + // of roles in RecordDriver + if (count($roles) > 0 && $name == 'role') { + echo $formatProperty($roles, $name, $prefix); + } + } + } + ?> + </span> + <?php +// Strip whitespace before close tags to avoid spaces in front of commas: + $formattedAuthors[] = trim(preg_replace('/\s+<\//', '</', ob_get_contents())); + ob_end_clean(); + ?> + <?php endforeach; ?> + <?php endif; ?> +<?php endforeach; ?> +<?=implode(', ', $formattedAuthors)?> +<!-- fid_adlr: RecordDriver - DefaultRecord - data-authors - END --> diff --git a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-format.phtml b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-format.phtml new file mode 100644 index 00000000000..41fe7996e5d --- /dev/null +++ b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-format.phtml @@ -0,0 +1,12 @@ +<!-- fid_adlr: RecordDriver - DefaultRecord - data-titlestatement --> +<?php // Don't add START and END comments ?> +<?php if (!empty($this->data)): ?> + <?php + $translated_formats = []; + ?> + <? foreach ($this->data as $format): ?> + <? $translated_formats[] = $this->transEsc($format); ?> + <? endforeach; ?> +<strong><?=implode('; ', array_map(array($this, 'escapeHtml'), $translated_formats))?></strong> +<?php endif; ?> +<!-- fid_adlr: RecordDriver - DefaultRecord - data-titlestatement - END --> diff --git a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-titlestatement.phtml b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-titlestatement.phtml new file mode 100644 index 00000000000..3e0a6f20df7 --- /dev/null +++ b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/data-titlestatement.phtml @@ -0,0 +1,10 @@ +<!-- fid_adlr: RecordDriver - DefaultRecord - data-titlestatement --> +<?php // Don't add START and END comments ?> +<?php if (!empty($data)): ?> + <?php if (is_array($data)): ?> + <?=implode('<br/>', array_map(array($this, 'escapeHtml'), $data))?> + <?php else: ?> + <?=$this->truncate($this->escapeHtml($data), 100)?> + <?php endif; ?> +<?php endif; ?> +<!-- fid_adlr: RecordDriver - DefaultRecord - data-titlestatement - END --> diff --git a/themes/fid_adlr/templates/RecordDriver/DefaultRecord/toolbar.phtml b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/toolbar.phtml new file mode 100644 index 00000000000..e6e02d5cada --- /dev/null +++ b/themes/fid_adlr/templates/RecordDriver/DefaultRecord/toolbar.phtml @@ -0,0 +1,58 @@ +<!-- fid_adlr: recordDriver - DefaultRecord - toolbar --> +<?php +$addThis = $this->addThis(); +if (!empty($addThis)) { + $this->headScript()->appendFile('https://s7.addthis.com/js/250/addthis_widget.js?pub=' . urlencode($addThis)); +} + +// Set up some variables for convenience: +$cart = $this->cart(); +$cartId = $this->driver->getSourceIdentifier() . '|' . $this->driver->getUniqueId(); +?> + +<?php /* finc: we use nav-stacked for display in sidebar, CK */ ?> +<ul class="record-nav nav nav-pills nav-stacked hidden-print"> + <?php /* finc: we use the sr-only description, CK */ ?> + <li class="sr-only"><?=$this->transEsc('Toolbar')?></li> + <?php if (count($this->driver->getCitationFormats()) > 0): ?> + <li> + <a class="cite-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Cite')?>" rel="nofollow"><?php /* <i class="fa fa-asterisk" aria-hidden="true"></i> */ ?> <?=$this->transEsc('Cite this')?></a> + </li> + <?php endif; ?> + <?php /* finc: we don't use sms, CK */ + /* + <?php if ($this->accountCapabilities()->getSmsSetting() !== 'disabled'): ?> + <li><a class="sms-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'SMS')?>" rel="nofollow"><i class="fa fa-mobile" aria-hidden="true"></i> <?=$this->transEsc('Text this')?></a></li> + <?php endif; ?> + */ ?> + <li> + <a class="mail-record" data-lightbox href="<?=$this->recordLink()->getActionUrl($this->driver, 'Email')?>" rel="nofollow"><?php /* <i class="fa fa-envelope" aria-hidden="true"></i> */ ?><?=$this->transEsc('Email this')?></a> + </li> + + <?php $exportFormats = $this->export()->getFormatsForRecord($this->driver); ?> + <?php if (count($exportFormats) > 0): ?> + <li> + <div class="openurls"> + <ul> + <?php foreach ($exportFormats as $exportFormat): ?> + <li> + <a <?php if ($this->export()->needsRedirect($exportFormat)): ?>target="<?=$this->escapeHtmlAttr($exportFormat)?>Main" + <?php endif; ?>href="<?=$this->recordLink()->getActionUrl($this->driver, 'Export')?>?style=<?=$this->escapeHtmlAttr($exportFormat)?>" + rel="nofollow"><?=$this->transEsc('Export to')?><?=$this->transEsc($this->export()->getLabelForFormat($exportFormat))?></a> + </li> + <?php endforeach; ?> + </ul> + </div> + </li> + <?php endif; ?> + + <?php if (!empty($addThis)): ?> + <li> + <a class="addThis addthis_button" href="https://www.addthis.com/bookmark.php?v=250&pub=<?=urlencode($addThis)?>"><i class="fa fa-bookmark" aria-hidden="true"></i> <?=$this->transEsc('Bookmark')?></a> + </li> + <?php endif; ?> + <li class="bookbag-menu"> + <?=$this->render('record/cart-buttons.phtml', ['id' => $this->driver->getUniqueId(), 'source' => $this->driver->getSourceIdentifier()]);?> + </li> +</ul> +<!-- fid_adlr: recordDriver - DefaultRecord - toolbar - END --> diff --git a/themes/fid_adlr/templates/RecordDriver/SolrAI/core.phtml b/themes/fid_adlr/templates/RecordDriver/SolrAI/core.phtml new file mode 100644 index 00000000000..354cbc33b72 --- /dev/null +++ b/themes/fid_adlr/templates/RecordDriver/SolrAI/core.phtml @@ -0,0 +1,160 @@ +<!-- fid_adlr: recordDriver - SolrAI - core --> +<?php /* Created in 4826, based on DefaultRecord/core, compare with DefaultRecord/core during updates! */ ?> +<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> + <?php /* finc: use VF5.1 offcanvas toggler here as well if you have a custom sidebar - CK */ ?> + <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> + <?php + $QRCode = $this->record($this->driver)->getQRCode("core"); + $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); + $cover = $coverDetails['html']; + $preview = $this->record($this->driver)->getPreviews(); + ?> + <?php if ($QRCode || $cover || $preview): ?> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> + <?php /* Display thumbnail if appropriate: */ ?> + <?php if ($cover): ?> + <?=$cover?> + <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, false position - GG */ ?> + <?php endif; ?> + + <?php /* Display qrcode if appropriate: */ ?> + <?php if ($QRCode): ?> + <span class="hidden-xs"> + <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + </span> + <?php endif; ?> + + <?php // if you have a preview tab but want to move or remove the preview link + // from this area of the record view, this can be split into + // getPreviewData() (should stay here) and + // getPreviewLink() (can go in your desired tab) ?> + <?php if ($preview): ?> + <div class="record-previews"> + <?=$preview?> + </div> + <?php endif; ?> + </div> + <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, right position - GG */ ?> + <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> + <?=$this->record($this->driver)->getRecordIcon()?> + <?php /* EOF - finc-specific StyleBasedIcons */ ?> + </div> + <?php endif; ?> + <div class="media-body"> + <div class="title-toolbar"> + <div class="result-body"> + <?php /* finc: We want to get rid of trailing special chars in the title and limit its length to 100 chars; + in finc: keep schema name tag here!! #13861 - CK + */ + ?> + <?php /* finc: add schema tags for title #13850 - VE */ ?> + <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> + + <?php /* fid_adlr: Remove summary refs #15650 - GG */ ?> + + <?php if ($this->userlist()->getMode() !== 'disabled'): ?> + <?php /* Display the lists that this record is saved to */ ?> + <div class="savedLists hidden alert alert-info"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> + <?php endif; ?> + </div> + <div class="result-links toolbar-details"> + <?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="icon icon-star icon-1.5x" aria-hidden="true"></i> + </a><br/> + <div class="toolbar-menu"> + <a href="#" data-lightbox class="dropdown-toggle" id="toolbar-menu" + data-toggle="dropdown" aria-controls="toolbar-menu"> + <i class="icon icon-share-2 icon-1.5x" aria-hidden="true"></i> + </a> + <span id="toolbar-menu" class="dropdown-menu" aria-labelledby="toolbar-menu"> + <?=$this->record($this->driver)->getToolbar()?> + </span> + </div> + <br/> + <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> + <?=$block?> + <?php endif; ?> + <?php /* Saved lists */ ?> + <div class="savedLists alert alert-info hidden"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> + <?php endif; ?> + </div> + </div> + + <?php /* Display Main Details */?> + <?php + $formatter = $this->recordDataFormatter(); + $coreFields = $formatter->getData($driver, $formatter->getDefaults('core-ai')); + ?> + <?php if (!empty($coreFields)): ?> + <table class="table table-striped"> + <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <?php foreach ($coreFields as $current): ?> + <?php if ($current['label'] == null): ?> + <?=$current['value']?> + <?php else: ?> + <tr><th><?=$this->transEsc($current['label'])?>:</th><td><?=$current['value']?></td></tr> + <?php endif; ?> + <?php endforeach; ?> + </table> + <?php endif; ?> + <?php /* End Main Details */?> + </div> + <?php if (count($this->tabs) > 0): ?> + <?php foreach ($this->tabs as $tab => $obj): ?> + <?php // add current tab to breadcrumbs if applicable: + $desc = $obj->getDescription(); + ?> + <div class="facet-group" id="side-panel-<?=$desc?>"> + <button class="title collapsed" data-toggle="collapse" href="#side-collapse-<?=$tab?>"> + <?=$this->transEsc($desc)?> + </button> + <div id="side-collapse-<?=$tab?>" class="collapse"> + <div class="tab-content"> + <div class="tab-pane active <?=$this->escapeHtmlAttr($tab) ?>-tab"> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"></div> + <div class="media-body"> + <?=$this->record($this->driver)->getTab($obj)?> + </div> + </div> + </div> + </div> + </div> + <?php endforeach; ?> + <?php endif; ?> + + <?php /* fid_adlr: set worldcat list refs #15650 - GG */ ?> + <div class="facet-group" id="side-panel-worldcat"> + <button class="title collapsed" data-toggle="collapse" href="#side-collapse-worldcat"> + <?=$this->transEsc('view_worldcat')?> + </button> + <div id="side-collapse-worldcat" class="collapse"> + <? $script = <<<JS + $(document).ready(function() { + var recordId = $('.hiddenId').val(); + var recordSource = $('.hiddenSource').val(); + // console.log({id: recordId, source: recordSource}); + $.ajax({ + dataType: 'json', + url: VuFind.path + '/AJAX/JSON?method=getWorldCat', + method: 'GET', + data: {id: recordId, source: recordSource} + }).done(function(response) { + $('.worldcat').html(response.data.html); + }); + }); +JS; + ?> + <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET');?> + <div class="worldcat"></div> + </div> + </div> + </div> +<!-- fid_adlr: recordDriver - SolrAI - core - END --> diff --git a/themes/fid_adlr/templates/RecordDriver/SolrMarc/core.phtml b/themes/fid_adlr/templates/RecordDriver/SolrMarc/core.phtml new file mode 100644 index 00000000000..6b5a510dcc8 --- /dev/null +++ b/themes/fid_adlr/templates/RecordDriver/SolrMarc/core.phtml @@ -0,0 +1,163 @@ +<!-- fid_adlr: RecordDriver - solrMarc - core --> +<?php /* based on DefaultRecord/core, compare with DefaultRecord/core during updates! */ ?> +<div class="media" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> + <?php /* finc: use VF5.1 offcanvas toggler here as well if you have a custom sidebar - CK */ ?> + <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler'); ?> + <?php + $QRCode = $this->record($this->driver)->getQRCode("core"); + $coverDetails = $this->record($this->driver)->getCoverDetails('core', 'medium', $this->record($this->driver)->getThumbnail('large')); + $cover = $coverDetails['html']; + $preview = $this->record($this->driver)->getPreviews(); + ?> + <?php if ($QRCode || $cover || $preview): ?> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> + <?php /* Display thumbnail if appropriate: */ ?> + <?php if ($cover): ?> + <?=$cover?> + <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, false position - GG */ ?> + <?php endif; ?> + + <?php /* Display qrcode if appropriate: */ ?> + <?php if ($QRCode): ?> + <span class="hidden-xs"> + <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + </span> + <?php endif; ?> + + <?php // if you have a preview tab but want to move or remove the preview link + // from this area of the record view, this can be split into + // getPreviewData() (should stay here) and + // getPreviewLink() (can go in your desired tab) ?> + <?php if ($preview): ?> + <div class="record-previews"> + <?=$preview?> + </div> + <?php endif; ?> + </div> + <?php /* if cover or qrcode or preview not set you can not finc-specific StyleBasedIcons, right position - GG */ ?> + <?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"> + <?=$this->record($this->driver)->getRecordIcon()?> + <?php /* EOF - finc-specific StyleBasedIcons */ ?> + </div> + <?php endif; ?> + <div class="media-body"> + <div class="title-toolbar"> + <div class="result-body"> + <?php /* finc: We want to get rid of trailing special chars in the title and limit its length to 100 chars; + in finc: keep schema name tag here!! #13861 - CK + */ + ?> + <?php /* finc: add schema tags for title #13850 - VE */ ?> + <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></h3> + + <?php /* fid_adlr: Remove summary refs #15650 - GG */ ?> + + <?php if ($this->userlist()->getMode() !== 'disabled'): ?> + <?php /* Display the lists that this record is saved to */ ?> + <div class="savedLists hidden alert alert-info"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> + <?php endif; ?> + </div> + <div class="result-links toolbar-details"> + <?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="icon icon-star icon-1.5x" aria-hidden="true"></i> + </a><br/> + <div class="toolbar-menu"> + <a href="#" data-lightbox class="dropdown-toggle" id="toolbar-menu" + data-toggle="dropdown" aria-controls="toolbar-menu"> + <i class="icon icon-share-2 icon-1.5x" aria-hidden="true"></i> + </a> + <span id="toolbar-menu" class="dropdown-menu" aria-labelledby="toolbar-menu"> + <?=$this->record($this->driver)->getToolbar()?> + </span> + </div> + <br/> + <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?> + <?=$block?> + <?php endif; ?> + <?php /* Saved lists */ ?> + <div class="savedLists alert alert-info hidden"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> + <?php endif; ?> + </div> + </div> + + <?php /* Display Main Details */?> + <?php + $formatter = $this->recordDataFormatter(); + $coreFields = $formatter->getData($driver, $formatter->getDefaults('core-marc')); + ?> + <?php if (!empty($coreFields)): ?> + <table class="table table-striped"> + <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <?php foreach ($coreFields as $current): ?> + <?php if ($current['label'] == null): ?> + <?=$current['value']?> + <?php else: ?> + <tr> + <th><?=$this->transEsc($current['label'])?>:</th> + <td><?=$current['value']?></td> + </tr> + <?php endif; ?> + <?php endforeach; ?> + </table> + <?php endif; ?> + <?php /* End Main Details */?> + </div> + <?php if (count($this->tabs) > 0): ?> + <?php foreach ($this->tabs as $tab => $obj): ?> + <?php // add current tab to breadcrumbs if applicable: + $desc = $obj->getDescription(); + ?> + <div class="facet-group" id="side-panel-<?=$desc?>"> + <button class="title collapsed" data-toggle="collapse" href="#side-collapse-<?=$tab?>"> + <?=$this->transEsc($desc)?> + </button> + <div id="side-collapse-<?=$tab?>" class="collapse"> + <div class="tab-content"> + <div class="tab-pane active <?=$this->escapeHtmlAttr($tab) ?>-tab"> + <div class="media-left <?=$this->escapeHtmlAttr($coverDetails['size'])?> img-col"></div> + <div class="media-body"> + <?=$this->record($this->driver)->getTab($obj)?> + </div> + </div> + </div> + </div> + </div> + <?php endforeach; ?> + <?php endif; ?> + + <?php /* fid_adlr: set worldcat list refs #15650 - GG */ ?> + <div class="facet-group" id="side-panel-worldcat"> + <button class="title collapsed" data-toggle="collapse" href="#side-collapse-worldcat"> + <?=$this->transEsc('view_worldcat')?> + </button> + <div id="side-collapse-worldcat" class="collapse"> + <? $script = <<<JS + $(document).ready(function() { + var recordId = $('.hiddenId').val(); + var recordSource = $('.hiddenSource').val(); + // console.log({id: recordId, source: recordSource}); + $.ajax({ + dataType: 'json', + url: VuFind.path + '/AJAX/JSON?method=getWorldCat', + method: 'GET', + data: {id: recordId, source: recordSource} + }).done(function(response) { + $('.worldcat').html(response.data.html); + }); + }); +JS; + ?> + <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET');?> + <div class="worldcat"></div> + </div> + </div> + </div> +<!-- fid_adlr: RecordDriver - solrMarc - core - END --> diff --git a/themes/fid_adlr/templates/RecordTab/acquisitionpda.phtml b/themes/fid_adlr/templates/RecordTab/acquisitionpda.phtml new file mode 100644 index 00000000000..93fa194e5d1 --- /dev/null +++ b/themes/fid_adlr/templates/RecordTab/acquisitionpda.phtml @@ -0,0 +1,22 @@ +<!-- fid_adlr - recordtab - acquistionpda --> +<?php +// Set page title. +$this->headTitle($this->driver->getBreadcrumb()); +// Get some variables +$id = $this->driver->getUniqueId(); +// $controllerClass = 'controller:' . $this->record($this->driver)->getController(); +$controllerClass = 'controller:SolrMarcFincPDA'; +?> +<h2><?=$this->transEsc('PDA::Acquisition')?></h2> +<p><?=$this->transEsc('PDA::pda_initial_text')?></p> +<p class="alert alert-info"><?=$this->transEsc('PDA::pda_restriction_text')?></p> +<div class="btn-group"> + <?php /* Leave title in here - it is used for the tooltip! - CK */ ?> + <a class="btn btn-primary" data-toggle="tooltip" title="<?=$this->transEsc('PDA::pda_open_new_window')?>" href="<?=$this->interlibraryloan()->getSwbLink($this->driver)?>" target="_blank"> + <?=$this->transEsc('PDA::pda_tab_interlibrary_button')?> + </a> + <a class="btn btn-primary pda-button <?=$controllerClass?>" data-lightbox href="<?=$this->url('record-pda', array('id' => $id))?>" rel="nofollow"> + <?=$this->transEsc('PDA::pda_tab_order_button')?> + </a> +</div> +<!-- fid_adlr - recordtab - acquistionpda - END --> diff --git a/themes/fid_adlr/templates/RecordTab/description.phtml b/themes/fid_adlr/templates/RecordTab/description.phtml new file mode 100644 index 00000000000..54df32f043f --- /dev/null +++ b/themes/fid_adlr/templates/RecordTab/description.phtml @@ -0,0 +1,26 @@ +<!-- fid_adlr: recordtab - description --> +<?php +// Set page title. +$this->headTitle($this->driver->getBreadcrumb()); + +$formatter = $this->recordDataFormatter(); +$mainFields = $formatter->getData($this->driver, $formatter->getDefaults('description')); +?> +<?php /* finc: remove schema tag here but keep in core,*/ ?> +<table class="table table-striped"> + <?php + /* Table gets filled via recordDriver/.../data-... templates as referenced in RecordDataFormatterFactory */ ?> + <caption class="sr-only"><?=$this->transEsc('Description')?></caption> + <?php if (!empty($mainFields)): ?> + <?php foreach ($mainFields as $current): ?> + <?php if (!empty($current['label'])): ?> + <tr><th><?=$this->transEsc($current['label'])?>:</th><td><?=$current['value']?></td></tr> + <?php elseif (!empty($current['value'])): ?> + <?=$current['value']?> + <?php endif; ?> + <?php endforeach; ?> + <?php else: ?> + <tr><td><?=$this->transEsc('no_description')?></td></tr> + <?php endif; ?> +</table> +<!-- fid_adlr: recordtab - description - END --> diff --git a/themes/fid_adlr/templates/RecordTab/holdingsils.phtml b/themes/fid_adlr/templates/RecordTab/holdingsils.phtml new file mode 100644 index 00000000000..80ef5b0355d --- /dev/null +++ b/themes/fid_adlr/templates/RecordTab/holdingsils.phtml @@ -0,0 +1,195 @@ +<!-- fid_adlr: recordTab - holdingsils --> +<?php + // Set up convenience variables: + $account = $this->auth()->getManager(); + $user = $account->isLoggedIn(); + $openUrl = $this->openUrl($this->driver, 'holdings'); + $openUrlActive = $openUrl->isActive(); + $doi = $this->doi($this->driver, 'holdings'); + $doiActive = $doi->isActive(); + // Account for replace_other_urls setting + $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); + // finc-specific: externalCatalogueLink + $extUrls = $this->externalCatalogueLink($this->driver)->getLinks(); + + $offlineMode = $this->ils()->getOfflineMode(); + // finc-specific: $holdings here, #9844, #7187 - CK + $holdings = ['holdings' => []]; + // finc-specific snippet, #9844, #7187 - CK + // if we already know that the ils is offline we do not need to query the realtimeholdings + if (!$offlineMode) { + try { + $holdings = $this->driver->getRealTimeHoldings(); + } catch (\VuFind\Exception\ILS $e) { + $holdings = ['holdings' => []]; + $offlineMode = 'ils-offline'; + } + } + // Set page title. + $this->headTitle($this->driver->getBreadcrumb()); +?> + +<?php /* finc-specific: nxt line - #7841@56988450 - CK */ ?> +<?php $holdingsEmpty = true; ?> + +<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $this->auth()->isLoggedIn()]);?> + +<?php if (!empty($holdings['blocks'])): ?> + <div id="account-block-msg" class="alert alert-danger"> + <?=$this->transEsc('account_block_options_missing', ['%%details%%' => implode('; ', $holdings['blocks'])])?> + </div> +<?php endif; ?> + +<?=($offlineMode == "ils-offline") ? $this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_holdings_message']) : ''?> +<?php if (($this->ils()->getHoldsMode() == 'driver' && !empty($holdings['holdings'])) || $this->ils()->getTitleHoldsMode() == 'driver'): ?> + <?php if ($account->loginEnabled() && $offlineMode != 'ils-offline'): ?> + <?php if (!$user): ?> + <div class="alert alert-info"> + <a href="<?=$this->recordLink()->getTabUrl($this->driver, 'Holdings')?>?login=true&catalogLogin=true" data-lightbox><?=$this->transEsc("hold_login")?></a> + </div> + <?php elseif (!$user->cat_username): ?> + <div class="alert alert-info"> + <?=$this->translate("hold_profile_html", ['%%url%%' => $this->recordLink()->getTabUrl($this->driver, 'Holdings') . '?catalogLogin=true'])?> + </div> + <?php endif; ?> + <?php endif; ?> +<?php endif; ?> +<?php $holdingTitleHold = $this->driver->tryMethod('getRealTimeTitleHold'); +if (!empty($holdingTitleHold)): ?> + <a class="placehold" data-lightbox title="<?=$this->transEsc('request_place_text')?>" href="<?=$this->recordLink()->getRequestUrl($holdingTitleHold)?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc('title_hold_place')?> + </a> +<?php endif; ?> + +<?php /* finc: add 'Online Access' in holdings-tab #13770 - VE */ ?> +<?php if (!empty($urls) || $openUrlActive || $doiActive): ?> + <h3><?=$this->transEsc("Internet")?></h3> + <?php if (!empty($urls)): ?> + <?php foreach ($urls as $current): ?> + <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/> + <?php endforeach; ?> + <?php endif; ?> + <?php /* finc-specific snippet - #9274 - replaces if ($openUrlActive): ... - CK */ ?> + <?php if ($openUrlActive): ?> + <?php if (empty($urls)): ?> + <?php $fallbackUrls = $this->driver->tryMethod('getURLs'); + if (!empty($fallbackUrls)): ?> + <span id="urlsHideable" style="display: none"> + <?php foreach ($fallbackUrls as $current): ?> + <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" target="_blank"><?=$this->escapeHtml($current['desc'])?></a><br/> + <?php endforeach; ?> + </span> + <?php endif; ?> + <?php endif; ?> + <?=$openUrl->renderTemplate()?> + <?php if ($doiActive): ?><?=$doi->renderTemplate()?><?php endif; ?> + <?php endif; ?> + <?php /* finc-specific snippet - #9274 - END */ ?> +<?php endif; ?> + +<?php foreach ($holdings['holdings'] ?? [] as $holding): ?> + <?php /* nxt line = finc-specific - #7841@56988450 - CK */ ?> + <?php $holdingsEmpty = false; ?> + <?php /* this next line produces an empty h3 heading in some cases - should be solved more elegantly - Fixme - CK */ ?> + <h3> + <?php $locationText = $this->transEsc('location_' . $holding['location'], [], $holding['location']); ?> + <?php if (isset($holding['locationhref']) && $holding['locationhref']): ?> + <a href="<?=$holding['locationhref']?>" target="_blank"><?=$locationText?></a> + <?php else: ?> + <?=$locationText?> + <?php endif; ?> + </h3> + + <?php /* nxt line = finc-specific - branch info - CK */ ?> + <?php if (isset($holding['locationid'])): ?> + <?=$this->branchInfo($this->driver)->getBranchInfo($holding['locationid']);?> + <?php endif; ?> + <?php /* finc: this next section produces an empty table in some cases - the table borders collapse, producing a thick line - should be solved more elegantly - Fixme - CK*/ ?> + <table class="table table-striped"> + <caption class="sr-only"><?=$this->transEsc('holdings_details_from', ['%%location%%' => $this->transEsc($holding['location'])])?></caption> + <?php /* finc: change order and structure of table #13606 - VE */ ?> + <?php foreach ($holding['items'] as $row): ?> + <?php + // finc: nxt line - emailholds #6096 - CK + $checkEmailHold = (isset($holding['checkEmailHold']) && $holding['checkEmailHold']); + try { + echo $this->context($this)->renderInContext( + 'RecordTab/holdingsils/' . $this->tab->getTemplate() . '.phtml', + ['holding' => $row] + ); + } catch (Exception $e) { + echo $this->context($this)->renderInContext( + 'RecordTab/holdingsils/standard.phtml', + ['holding' => $row] + ); + } + ?> + <?php endforeach; ?> + <? /* finc: we use call numbers in the table after "Notes" + We don't use the links to alphabrowse - CK */ ?> + <?php $callNos = $this->tab->getUniqueCallNumbers($holding['items']); if (!empty($callNos)): ?> + <tr> + <th> + <?=$this->transEsc("Call Number")?>: + </th> + <td> + <?php foreach ($callNos as $callNo): ?> + <?=$this->escapeHtml($callNo)?> + <br /> + <?php endforeach; ?> + </td> + </tr> + <?php endif; ?> + <?php if (isset($holding['textfields'])): foreach ($holding['textfields'] as $textFieldName => $textFields): ?> + <tr> + <?php // Translation for summary is a special case for backwards-compatibility ?> + <th><?=$textFieldName == 'summary' ? $this->transEsc("Volume Holdings") : $this->transEsc(ucfirst($textFieldName))?>:</th> + <td> + <?php foreach ($textFields as $current): ?> + <?=$this->escapeHtml($current)?><br/> + <?php endforeach; ?> + </td> + </tr> + <?php endforeach; endif; ?> + <? /* finc: we use call numbers after "Notes" - END */ ?> + <?php if (!empty($holding['purchase_history'])): ?> + <tr> + <th><?=$this->transEsc("Most Recent Received Issues")?>:</th> + <td> + <?php foreach ($holding['purchase_history'] as $current): ?> + <?=$this->escapeHtml($current['issue'])?><br/> + <?php endforeach; ?> + </td> + </tr> + <?php endif; ?> + </table> +<?php endforeach; ?> + +<?php /* finc-specific: nxt 3 lines - #7841@56988450 - CK */ ?> +<?php if ($holdingsEmpty && $this->driver->tryMethod('getLocalOrderInformation') == 'e'): ?> + <h3><?=$this->transEsc("title_ordered_by_library")?></h3> +<?php endif; ?> + +<?php /* finc-specific - external access - #9245 - CK */ ?> +<?php if (!empty($extUrls)): ?> + <h3><?=$this->transEsc("external_access")?></h3> + <?php if (!empty($extUrls)): ?> + <?php foreach ($extUrls as $current): ?> + <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($this->transEsc($current['desc']))?></a> + <br/> + <?php endforeach; ?> + <?php endif; ?> +<?php endif; ?> +<?php /* finc-specific - external access - END */ ?> + +<?php $history = $this->driver->getRealTimeHistory(); ?> +<?php if (is_array($history) && !empty($history)): ?> + <h3><?=$this->transEsc("Most Recent Received Issues")?></h3> + <table class="table table-striped"> + <?php foreach ($history as $row): ?> + <tr> + <td><?=$this->escapeHtml($row['issue'])?></td> + </tr> + <?php endforeach; ?> + </table> +<?php endif; ?> +<!-- fid_adlr: recordTab - holdingsils - END --> diff --git a/themes/fid_adlr/templates/RecordTab/staffviewai.phtml b/themes/fid_adlr/templates/RecordTab/staffviewai.phtml new file mode 100644 index 00000000000..709b245524f --- /dev/null +++ b/themes/fid_adlr/templates/RecordTab/staffviewai.phtml @@ -0,0 +1,45 @@ +<!-- fid_adlr: recordtab - staffviewai --> +<?php +// Set page title. +$this->headTitle($this->driver->getBreadcrumb()); +?> +<table class="citation table table-striped"> + <?php foreach ($this->driver->getAIRecord() as $field => $values): ?> + <tr> + <th><?=$this->escapeHtml($field)?></th> + <td> + <?php if (!is_array($values)) { + $values = array($values); + } ?> + <?php foreach ($values as $value): ?> + <?=$this->escapeHtml(is_array($value) ? print_r($value, true) : $value)?><br/> + <?php endforeach; ?> + </td> + </tr> + <?php endforeach; ?> + <?php /* the following introduced in 9934*/ ?> + <?php if ($openURL = $this->driver->getOpenUrl()): ?> + <tr> + <th><?=$this->escapeHtml('openURL')?></th> + <td> + <?=$this->escapeHtml($openURL)?><br/> + </td> + </tr> + <?php endif; ?> + <?php $fields = $this->driver->getRawData(); + if (!empty($fields)): ?> + <tr> + <th><?=$this->translate('SOLR')?></th> + <td></td> + </tr> + <?php ksort($fields); + foreach ($fields as $key => $values): ?> + <?php if ($key === 'fullrecord') continue; ?> + <tr> + <th><?=$this->escapeHtml($key)?></th> + <td><?=$this->escapeHtml(is_array($values) ? implode(', ', $values) : $values)?></td> + </tr> + <?php endforeach ?> + <?php endif; ?> +</table> +<!-- fid_adlr: recordtab - staffviewai - END --> diff --git a/themes/fid_adlr/templates/RecordTab/staffviewmarc.phtml b/themes/fid_adlr/templates/RecordTab/staffviewmarc.phtml new file mode 100644 index 00000000000..54af3f791ea --- /dev/null +++ b/themes/fid_adlr/templates/RecordTab/staffviewmarc.phtml @@ -0,0 +1,30 @@ +<!-- fid_adlr: recordtab - staffviewmarc --> +<?php +// Set page title. +$this->headTitle($this->driver->getBreadcrumb()); +?> +<?=\VuFind\XSLT\Processor::process('record-marc.xsl', $this->driver->getXML('marc21'))?> +<?php /* the following introduced in 9934*/ ?> +<?php if ($openURL = $this->driver->getOpenUrl()): ?> + <tr> + <th><?=$this->escapeHtml('openURL')?></th> + <td> + <?=$this->escapeHtml($openURL)?><br/> + </td> + </tr> +<?php endif; ?> +<?php $fields = $this->driver->getRawData(); +if (!empty($fields)): ?> + <table class="citation table table-striped"> + <caption><?=$this->translate('SOLR')?></caption> + <?php ksort($fields); + foreach ($fields as $key => $values): ?> + <?php if ($key === 'fullrecord') continue; ?> + <tr> + <th><?=$this->escapeHtml($key)?></th> + <td><?=$this->escapeHtml(is_array($values) ? implode(', ', $values) : $values)?></td> + </tr> + <?php endforeach ?> + </table> +<?php endif; ?> +<!-- fid_adlr: recordtab - staffviewmarc - END --> diff --git a/themes/fid_adlr/templates/RecordTab/toc.phtml b/themes/fid_adlr/templates/RecordTab/toc.phtml new file mode 100644 index 00000000000..0925ed435f3 --- /dev/null +++ b/themes/fid_adlr/templates/RecordTab/toc.phtml @@ -0,0 +1,26 @@ +<!-- fid_adlr: recordtab - toc --> +<?php +// Set page title. +$this->headTitle($this->driver->getBreadcrumb()); + +$formatter = $this->recordDataFormatter(); +$mainFields = $formatter->getData($this->driver, $formatter->getDefaults('toc')); +?> +<?php /* finc: remove schema tag here but keep in core,*/ ?> +<table class="table table-striped"> + <?php + /* Table gets filled via recordDriver/.../data-... templates as referenced in RecordDataFormatterFactory */ ?> + <caption class="sr-only"><?=$this->transEsc('Table of Contents')?></caption> + <?php if (!empty($mainFields)): ?> + <?php foreach ($mainFields as $current): ?> + <?php if (!empty($current['label'])): ?> + <tr><th><?=$this->transEsc($current['label'])?>:</th><td><?=$current['value']?></td></tr> + <?php elseif (!empty($current['value'])): ?> + <?=$current['value']?> + <?php endif; ?> + <?php endforeach; ?> + <?php else: ?> + <tr><td><?=$this->transEsc('Table of Contents unavailable')?></td></tr> + <?php endif; ?> +</table> +<!-- fid_adlr: recordtab - toc - END --> diff --git a/themes/fid_adlr/templates/record/share.phtml b/themes/fid_adlr/templates/record/share.phtml new file mode 100644 index 00000000000..63d0c41fcc3 --- /dev/null +++ b/themes/fid_adlr/templates/record/share.phtml @@ -0,0 +1,3 @@ +<!-- fid_adlr: record - share --> +<?=$this->record($this->driver)->getToolbar()?> +<!-- fid_adlr: record - share - END --> diff --git a/themes/fid_adlr/templates/record/view.phtml b/themes/fid_adlr/templates/record/view.phtml new file mode 100644 index 00000000000..4db4c89ce38 --- /dev/null +++ b/themes/fid_adlr/templates/record/view.phtml @@ -0,0 +1,61 @@ +<!-- fid_adlr: record - view --> +<?php +// Set up standard record scripts: +$this->headScript()->appendFile("record.js"); +$this->headScript()->appendFile("check_save_statuses.js"); +// Activate Syndetics Plus if necessary: +if ($this->syndeticsPlus()->isActive()) { + $this->headScript()->appendFile($this->syndeticsPlus()->getScript()); +} + +// Add RDF header link if applicable: +if ($this->export()->recordSupportsFormat($this->driver, 'RDF')) { + $this->headLink()->appendAlternate($this->recordLink()->getActionUrl($this->driver, 'RDF'), 'application/rdf+xml', 'RDF Representation'); +} + +// Set up breadcrumbs: +$this->layout()->breadcrumbs = '<li>' . $this->searchMemory()->getLastSearchLink($this->transEsc('Search'), '', '</li> ') . + '<li class="active">' . $this->recordLink()->getBreadcrumb($this->driver) . '</li> '; +$this->layout()->title = $this->driver->getShortTitle(); +?> + +<?php /* fid_adlr:Remove previous and next record refs #15650 - GG */ ?> + + <?php + /* finc-specific: Remove getToolbar from here and add it to sidebar below - CK + <?=$this->record($this->driver)->getToolbar()?> */ + ?> + + <div class="record source<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>"> + <?php /* finc: remove related-sidebar count and "solo" class since we use a custom sidebar, + keep print classes, CK */ ?> + <?php $sidebarList = $this->related()->getList($this->driver); ?> + <div class="<?=$this->layoutClass('mainbody')?> print-full-width"> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" class="hiddenId"/> + <input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource"/> + <?=$this->flashmessages()?> + <?=$this->record($this->driver)->getCoreMetadata()?> + + <?php /* fid_adlr: remove tabs refs #15650 - GG */ ?> + + <?php + $link = '<i class="icon icon-arrow-left icon-1.5x" aria-hidden="true"></i> ' . $this->transEsc('go_to_list'); + ?> + <?=$this->searchMemory()->getLastSearchLink($link)?> + + <?=$this->driver->supportsCoinsOpenURL() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenURL()) . '"></span>' : ''?> + </div> + + + <div class="<?=$this->layoutClass('sidebar')?>"> + <?php /* finc-specific: add toolbar to sidebar - CK */ ?> + <?//=$this->record($this->driver)->getToolbar()?> + + <?php foreach ($sidebarList as $current): ?> + <?=$this->related()->render($current)?> + <?php endforeach; ?> + </div> + </div> + + <?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, '$(document).ready(recordDocReady);', 'SET');?> + <!-- fid_adlr: record - view - END --> diff --git a/themes/fid_adlr/theme.config.php b/themes/fid_adlr/theme.config.php index ffd7f1abec0..adcf37ad385 100644 --- a/themes/fid_adlr/theme.config.php +++ b/themes/fid_adlr/theme.config.php @@ -2,4 +2,13 @@ return [ 'favicon' => 'favicon.ico', 'extends' => 'fid', + 'mixins' => [ + 'worldcat' + ], + 'helpers' => [ + 'factories' => [ + 'VuFind\View\Helper\Root\RecordDataFormatter' => + 'fid_adlr\View\Helper\Root\RecordDataFormatterFactory' + ] + ] ]; \ No newline at end of file -- GitLab