diff --git a/local/languages/de.ini b/local/languages/de.ini index 8d6a99741a7b0397a82c06fbef29ee171ad5324e..84ede6e3d748a4a6f35e0a5dc3a08bd95821d911 100644 --- a/local/languages/de.ini +++ b/local/languages/de.ini @@ -1027,6 +1027,8 @@ DE-105 = "Technische Universität Bergakademie Freiberg" DE-197 = "Stadtbibliothek Leipzig" DE-520 = "Hochschule für Technik und Wirtschaft Dresden" DE-540 = "Hochschule für Bildende Künste Dresden" +DE-1156 = "Folkwang Universität der Künste" +DE-1972 = "Robert Schumann Hochschule Düsseldorf" DE-Ch1 = "Technische Universität Chemnitz" DE-D13 = "Staatliche Kunstsammlungen Dresden" DE-D40 = "Staatliche Ethnographische Sammlungen Sachsen, Museum für Völkerkunde Dresden" @@ -1037,6 +1039,7 @@ DE-L189 = "Hochschule für Technik, Wirtschaft und Kultur Leipzig" DE-L228 = "Staatliche Ethnographische Sammlungen Sachsen, Museum für Völkerkunde Leipzig" DE-L242 = "Hochschule für Grafik und Buchkunst Leipzig" DE-L328 = "Halle 14 Kunstbibliothek Leipzig" +DE-Kn38 = "Bibliothek der HfMT Köln" DE-Wim8 = "Hochschule für Musik 'Franz Liszt' Weimar" DE-Zi4 = "Hochschule Zittau/Görlitz" DE-Zwi2 = "Westsächsische Hochschule Zwickau" @@ -1852,3 +1855,17 @@ non_rda_original_title = "Originaltitel" ;#8828 German Prints Index Number = "VD-Nummer" + +; LIDO RecordDriver relvant +expression creation = "Entstehungsvermerk" +publication event = "Ausstellung" +undated = "nicht datiert" +Image Rights = "Bildrechte" +Image Rights Default = "Bildrechte vorbehalten" +Measurements = "Maße" +Object type = "Objektbezeichnung" +Originator = "Schöpfer" +Originators = "Schöpfer" +Other ID = "Weitere Identifier" +Other Originators = "Weitere Schöpfer" +Time of origin = "Entstehungszeit" diff --git a/local/languages/en.ini b/local/languages/en.ini index c59a9a18045e873bced11b66d942789be5b9a939..b70b88820da7c218d5ad1f7ff90ed4ae8e13bb61 100644 --- a/local/languages/en.ini +++ b/local/languages/en.ini @@ -654,16 +654,19 @@ DE-105 = "Technische Universität Bergakademie Freiberg" DE-197 = "City Library Leipzig" DE-520 = "Dresden University of Applied Sciences" DE-540 = "Dresden Academy of Fine Arts" +DE-1156 = "Folkwang University of Arts" +DE-1972 = "Robert Schumann Academy Düsseldorf" DE-Ch1 = "Technische Universität Chemnitz" DE-D13 = "The Staatliche Kunstsammlungen Dresden (Dresden State Art Collections) " DE-D40 = "Staatliche Ethnographische Sammlungen Sachsen, Museum für Völkerkunde Dresden" DE-D117 = "Hochschule für Musik 'Carl Maria von Weber' Dresden" -;DE-Mit1 = "Hochschule Mittweida" +DE-Mit1 = "Hochschule Mittweida" DE-L152 = "University of Music and Theatre 'Felix Mendelssohn Bartholdy' Leipzig" DE-L189 = "Leipzig University of Applied Sciences" DE-L228 = "Staatliche Ethnographische Sammlungen Sachsen, Museum für Völkerkunde Leipzig" DE-L242 = "Academy of Visual Arts Leipzig" DE-L328 = "Halle 14 Art Library Leipzig" +DE-Kn38 = "Library of HfMT Köln" DE-Wim8 = "The Liszt School of Music Weimar" DE-Zi4 = "Zittau/Görlitz University of Applied Sciences" DE-Zwi2 = "University of Applied Sciences Zwickau" @@ -1777,7 +1780,7 @@ no_resolver_links = "No online links available." reset_password_text = "Please complete the form below to reset your password. You will receive an email after we have completed resetting your password." Reset Password = "Reset Password" -Work Title = "Workt Title" +Work Title = "Work Title" Work Part Title = "Work Part Title" ; #8496/#8497 @@ -1793,3 +1796,17 @@ non_rda_original_title = "Original Title" ;#8828 German Prints Index Number = "German Prints Index Number" + +; LIDO RecordDriver relvant +expression creation = "Expression creation" +publication event = "Publication event" +undated = "undated" +Image Rights = "Image Rights" +Image Rights Default = "Rights reserved" +Measurements = "Measurements" +Object type = "Object type" +Originator = "Originator" +Originators = "Originators" +Other ID = "Other ID" +Other Originators = "Other Originators" +Time of origin = "Time of origin" \ No newline at end of file diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index c23871368c5f414b60b177c53da714cfa49e1025..73ac45c168910eaf801998bc649765b6e69f47a0 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -52,7 +52,9 @@ $config = [ 'solrmarcremote' => 'finc\RecordDriver\Factory::getSolrMarcRemote', 'solrmarcremotefinc' => 'finc\RecordDriver\Factory::getSolrMarcRemoteFinc', 'solrai' => 'finc\RecordDriver\Factory::getSolrAI', - 'solris' => 'finc\RecordDriver\Factory::getSolrIS' + 'solris' => 'finc\RecordDriver\Factory::getSolrIS', + 'solrlido' => 'finc\RecordDriver\Factory::getSolrLido', + 'solrlidondl' => 'finc\RecordDriver\Factory::getSolrLidoNdl' ], ], 'recordtab' => [ @@ -63,6 +65,7 @@ $config = [ 'staffviewai' => 'finc\RecordTab\StaffViewAI', 'acquisitionpda' => 'finc\RecordTab\AcquisitionPDA', 'topics' => 'finc\RecordTab\Topics', + 'descriptionlido' => 'finc\RecordTab\DescriptionLido' ], ], 'resolver_driver' => [ @@ -123,6 +126,16 @@ $config = [ ], 'defaultTab' => null, ], + 'finc\RecordDriver\SolrLido' => [ + 'tabs' => [ + 'Holdings' => 'HoldingsILS', 'Description' => 'DescriptionLido', + 'Reviews' => 'Reviews', 'Excerpt' => 'Excerpt', + 'Preview' => 'preview', 'Map' => 'Map', + 'Similar' => 'SimilarItemsCarousel', + 'Details' => 'StaffViewArray', + ], + 'defaultTab' => null, + ], ], ], // Authorization configuration: diff --git a/module/finc/src/finc/RecordDriver/Factory.php b/module/finc/src/finc/RecordDriver/Factory.php index 96f1b7404e8a973268f9e94d2abce1b137f2dece..663b617f43c1283a59d0c5b83b8c174bc919ac25 100644 --- a/module/finc/src/finc/RecordDriver/Factory.php +++ b/module/finc/src/finc/RecordDriver/Factory.php @@ -207,4 +207,38 @@ class Factory $driver->attachSearchService($sm->getServiceLocator()->get('VuFind\Search')); return $driver; } + + /** + * Factory for SolrLido record driver. + * + * @param ServiceManager $sm Service manager. + * + * @return SolrLido + */ + public static function getSolrLidoNdl(ServiceManager $sm) + { + return new SolrLidoNdl( + $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + null, + $sm->getServiceLocator()->get('VuFind\Config')->get('searches'), + $sm->getServiceLocator()->get('VuFind\DateConverter') + ); + } + + /** + * Factory for SolrLidoFinc record driver. + * + * @param ServiceManager $sm Service manager. + * + * @return SolrLidoFinc + */ + public static function getSolrLido(ServiceManager $sm) + { + return new SolrLido( + $sm->getServiceLocator()->get('VuFind\Config')->get('config'), + null, + $sm->getServiceLocator()->get('VuFind\Config')->get('searches'), + $sm->getServiceLocator()->get('VuFind\DateConverter') + ); + } } diff --git a/module/finc/src/finc/RecordDriver/SolrLido.php b/module/finc/src/finc/RecordDriver/SolrLido.php new file mode 100644 index 0000000000000000000000000000000000000000..985587645160fc2adab62fe852372e41971ff42b --- /dev/null +++ b/module/finc/src/finc/RecordDriver/SolrLido.php @@ -0,0 +1,69 @@ +<?php +/** + * finc specific model for Lido records with a fullrecord in Solr. + * + * PHP version 5 + * + * Copyright (C) Leipzig University Library 2015. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package RecordDrivers + * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:record_drivers Wiki + */ +namespace finc\RecordDriver; + +/** + * finc specific model for LIDO records with a fullrecord in Solr. + * + * @category VuFind2 + * @package RecordDrivers + * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:record_drivers Wiki + */ +class SolrLido extends SolrLidoNdl +{ + use SolrLidoFincTrait; + + /** + * Date Converter + * + * @var \VuFind\Date\Converter + */ + protected $dateConverter; + + /** + * Constructor + * + * @param \Zend\Config\Config $mainConfig VuFind main configuration (omit + * for built-in defaults) + * @param \Zend\Config\Config $recordConfig Record-specific configuration + * file (omit to use $mainConfig as $recordConfig) + * @param \Zend\Config\Config $searchSettings Search-specific configuration + * file + * @param \VuFind\Date\Converter $dateConverter Date Converter + */ + public function __construct($mainConfig = null, $recordConfig = null, + $searchSettings = null, $dateConverter = null + ) + { + parent::__construct($mainConfig, $recordConfig, $searchSettings); + $this->dateConverter = $dateConverter; + } + +} \ No newline at end of file diff --git a/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php b/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php new file mode 100644 index 0000000000000000000000000000000000000000..4353f8abb5d7eb215a381d12f0e693ec4b5a579d --- /dev/null +++ b/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php @@ -0,0 +1,94 @@ +<?php +/** + * finc specific model for LIDO records with a fullrecord in Solr. + * + * PHP version 5 + * + * Copyright (C) Leipzig University Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package RecordDrivers + * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:record_drivers Wiki + */ +namespace finc\RecordDriver; + +/** + * finc specific model for Lido records with a fullrecord in Solr. + * + * @category VuFind2 + * @package RecordDrivers + * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:record_drivers Wiki + */ +trait SolrLidoFincTrait +{ + /** + * Return access notes for the record. + * + * @return array + */ + public function getAccessNote() + { + $restrictions = []; + if ($rights = $this->getSimpleXML()->xpath( + 'lido/administrativeMetadata/resourceWrap/resourceSet/rightsResource/' + . 'rightsType' + ) + ) { + $i = 0; + $notes = []; + foreach ($rights as $right) { + if (!isset($right->conceptID)) { + continue; + } + $type = strtolower((string)$right->conceptID->attributes()->type); + if (strtolower($type) == 'uri') { + $conceptID = (string)$right->conceptID; + $term = (string)$right->term; + if ($term) { + $notes[$i] = ['term' => $term, 'uri' => $conceptID]; + } + } + $i++; + } + } + return $notes; + } + + + /** + * Get comprehensive measurements description without dismantling in type, unit + * and value. + * + * @return array + */ + public function getMeasurementsDescription() + { + $results = []; + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/' + . 'objectIdentificationWrap/objectMeasurementsWrap/' + . 'objectMeasurementsSet/displayObjectMeasurements' + ) as $node) { + $results[] = (string)$node; + } + return $results; + } + +} \ No newline at end of file diff --git a/module/finc/src/finc/RecordDriver/SolrLidoNdl.php b/module/finc/src/finc/RecordDriver/SolrLidoNdl.php new file mode 100644 index 0000000000000000000000000000000000000000..71e8b0e8e39954342683f0540047a5db330a33e7 --- /dev/null +++ b/module/finc/src/finc/RecordDriver/SolrLidoNdl.php @@ -0,0 +1,787 @@ +<?php +/** + * Model for LIDO records in Solr. + * + * PHP version 5 + * + * Copyright (C) The National Library of Finland 2015. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind + * @package RecordDrivers + * @author Ere Maijala <ere.maijala@helsinki.fi> + * @author Samuli Sillanpää <samuli.sillanpaa@helsinki.fi> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:record_drivers Wiki + */ +namespace finc\RecordDriver; + +/** + * Model for LIDO records in Solr. + * + * @category VuFind + * @package RecordDrivers + * @author Ere Maijala <ere.maijala@helsinki.fi> + * @author Samuli Sillanpää <samuli.sillanpaa@helsinki.fi> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:record_drivers Wiki + */ +class SolrLidoNdl extends \finc\RecordDriver\SolrDefault +{ + /** + * Record metadata + * + * @var \SimpleXMLElement + */ + protected $simpleXML; + + /** + * Date Converter + * + * @var \VuFind\Date\Converter + */ + protected $dateConverter; + + /** + * Constructor + * + * @param \Zend\Config\Config $mainConfig VuFind main configuration (omit + * for built-in defaults) + * @param \Zend\Config\Config $recordConfig Record-specific configuration + * file (omit to use $mainConfig as $recordConfig) + * @param \Zend\Config\Config $searchSettings Search-specific configuration + * file + * @param \VuFind\Date\Converter $dateConverter Date Converter + */ + public function __construct($mainConfig = null, $recordConfig = null, + $searchSettings = null, $dateConverter = null + ) + { + parent::__construct($mainConfig, $recordConfig, $searchSettings); + $this->dateConverter = $dateConverter; + } + + /** + * Return access restriction notes for the record. + * + * @return array + */ + public function getAccessRestrictions() + { + $restrictions = []; + if ($rights = $this->getSimpleXML()->xpath( + 'lido/administrativeMetadata/resourceWrap/resourceSet/rightsResource/' + . 'rightsType' + ) + ) { + foreach ($rights as $right) { + if (!isset($right->conceptID)) { + continue; + } + $type = strtolower((string)$right->conceptID->attributes()->type); + if ($type == 'copyright') { + $term = (string)$right->term; + if ($term) { + $restrictions[] = $term; + } + } + } + } + return $restrictions; + } + + /** + * Return type of access restriction for the record. + * + * @param string $language Language + * + * @return mixed array with keys: + * 'copyright' Copyright (e.g. 'CC BY 4.0') + * 'link' Link to copyright info, see IndexRecord::getRightsLink + * or false if no access restriction type is defined. + */ + public function getAccessRestrictionsType($language) + { + if ($rights = $this->getSimpleXML()->xpath( + 'lido/administrativeMetadata/resourceWrap/resourceSet/rightsResource/' + . 'rightsType' + ) + ) { + $rights = $rights[0]; + + if ($conceptID = $rights->xpath('conceptID')) { + $conceptID = $conceptID[0]; + $attributes = $conceptID->attributes(); + if ($attributes->type + && strtolower($attributes->type) == 'copyright' + ) { + $data = []; + + $copyright = (string)$conceptID; + $data['copyright'] = $copyright; + + $copyright = strtoupper($copyright); + if ($link = $this->getRightsLink($copyright, $language)) { + $data['link'] = $link; + } + return $data; + } + } + } + return false; + } + + /** + * Return an associative array of image URLs associated with this record + * (key = URL, value = description). + * + * @param string $size Size of requested images + * + * @return array + */ + public function getAllThumbnails($size = 'large') + { + $urls = []; + $url = ''; + foreach ($this->getSimpleXML()->xpath( + '/lidoWrap/lido/administrativeMetadata/' + . 'resourceWrap/resourceSet/resourceRepresentation' + ) as $node) { + if ($node->linkResource) { + $attributes = $node->attributes(); + if (!$attributes->type + || (($size != 'large' && $attributes->type == 'thumb') + || $size == 'large' && $attributes->type == 'large' + || $attributes->type == 'zoomview') + ) { + $url = (string)$node->linkResource; + $urls[$url] = ''; + } + } + } + return $urls; + } + + /** + * Get an array of alternative titles for the record. + * + * @return array + */ + public function getAlternativeTitles() + { + $results = []; + $mainTitle = $this->getTitle(); + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectIdentificationWrap/titleWrap/titleSet/' + . "appellationValue[@label='teosnimi']" + ) as $node) { + if ((string)$node != $mainTitle) { + $results[] = (string)$node; + } + } + return $results; + } + + /** + * Get the collections of the current record. + * + * @return string + */ + public function getCollections() + { + return isset($this->fields['collection']) ? + $this->fields['collection'] : []; + } + + /** + * Get an array of events for the record. + * + * @return array + */ + public function getEvents() + { + $events = []; + foreach ($this->getSimpleXML()->xpath( + '/lidoWrap/lido/descriptiveMetadata/eventWrap/eventSet/event' + ) as $node) { + $name = isset($node->eventName->appellationValue) + ? (string)$node->eventName->appellationValue : ''; + $type = isset($node->eventType->term) + ? mb_strtolower((string)$node->eventType->term, 'UTF-8') : ''; + $date = isset($node->eventDate->displayDate) + ? (string)$node->eventDate->displayDate : ''; + if (!$date && isset($node->eventDate->date) + && !empty($node->eventDate->date) + ) { + $startDate = (string)$node->eventDate->date->earliestDate; + $endDate = (string)$node->eventDate->date->latestDate; + if (strlen($startDate) == 4 && strlen($endDate) == 4) { + $date = "$startDate-$endDate"; + } else { + $startDateType = 'Y-m-d'; + $endDateType = 'Y-m-d'; + if (strlen($startDate) == 7) { + $startDateType = 'Y-m'; + } + if (strlen($endDate) == 7) { + $endDateType = 'Y-m'; + } + $date = $this->dateConverter->convertToDisplayDate( + $startDateType, $startDate + ); + if ($startDate != $endDate) { + $date .= '-' . $this->dateConverter->convertToDisplayDate( + $endDateType, $endDate + ); + } + } + } + if ($type == 'valmistus') { + $confParam = 'lido_augment_display_date_with_period'; + if ($this->getDataSourceConfigurationValue($confParam)) { + if ($period = $node->periodName->term) { + if ($date) { + $date = $period . ', ' . $date; + } else { + $date = $period; + } + } + } + } + $method = isset($node->eventMethod->term) + ? (string)$node->eventMethod->term : ''; + $materials = []; + + if (isset($node->eventMaterialsTech->displayMaterialsTech)) { + // Use displayMaterialTech (default) + $materials[] = (string)$node->eventMaterialsTech + ->displayMaterialsTech; + } else if (isset($node->eventMaterialsTech->materialsTech)) { + // display label not defined, build from materialsTech + $materials = []; + foreach ($node->xpath('eventMaterialsTech/materialsTech') + as $materialsTech + ) { + if ($terms = $materialsTech->xpath('termMaterialsTech/term')) { + foreach ($terms as $term) { + $label = null; + $attributes = $term->attributes(); + if (isset($attributes->label)) { + // Musketti + $label = $attributes->label; + } else if (isset($materialsTech->extentMaterialsTech)) { + // Siiri + $label = $materialsTech->extentMaterialsTech; + } + if ($label) { + $term = "$term ($label)"; + } + $materials[] = $term; + } + } + } + } + + $places = []; + $place = isset($node->eventPlace->displayPlace) + ? (string)$node->eventPlace->displayPlace : ''; + if (!$place) { + if (isset($node->eventPlace->place->namePlaceSet)) { + $eventPlace = []; + foreach ($node->eventPlace->place->namePlaceSet as $namePlaceSet + ) { + if (trim((string)$namePlaceSet->appellationValue) != '') { + $eventPlace[] = isset($namePlaceSet) + ? trim((string)$namePlaceSet->appellationValue) : ''; + } + } + if ($eventPlace) { + $places[] = implode(', ', $eventPlace); + } + } + if (isset($node->eventPlace->place->partOfPlace)) { + foreach ($node->eventPlace->place->partOfPlace as $partOfPlace) { + $partOfPlaceName = []; + while (isset($partOfPlace->namePlaceSet)) { + $appellationValue = trim( + (string)$partOfPlace->namePlaceSet->appellationValue + ); + if ($appellationValue !== '') { + $partOfPlaceName[] = $appellationValue; + } + $partOfPlace = $partOfPlace->partOfPlace; + } + if ($partOfPlaceName) { + $places[] = implode(', ', $partOfPlaceName); + } + } + } + } else { + $places[] = $place; + } + $actors = []; + if (isset($node->eventActor)) { + foreach ($node->eventActor as $actor) { + $appellationValue = isset( + $actor->actorInRole->actor->nameActorSet->appellationValue + ) ? trim( + $actor->actorInRole->actor->nameActorSet->appellationValue + ) : ''; + if ($appellationValue !== '') { + $role = isset($actor->actorInRole->roleActor->term) + ? $actor->actorInRole->roleActor->term : ''; + $actors[] = [ + 'name' => $appellationValue, + 'role' => $role + ]; + } + } + } + $culture = isset($node->culture->term) + ? (string)$node->culture->term : ''; + $description = isset($node->eventDescriptionSet->descriptiveNoteValue) + ? (string)$node->eventDescriptionSet->descriptiveNoteValue : ''; + $event = [ + 'type' => $type, + 'name' => $name, + 'date' => $date, + 'method' => $method, + 'materials' => $materials, + 'places' => $places, + 'actors' => $actors, + 'culture' => $culture, + 'description' => $description + ]; + $events[$type][] = $event; + } + return $events; + } + + /** + * Get an array of format classifications for the record. + * + * @return array + */ + public function getFormatClassifications() + { + $results = []; + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectClassificationWrap' + ) as $node) { + $term = (string)$node->objectWorkTypeWrap->objectWorkType->term; + if ($term == 'rakennetun ympäristön kohde') { + foreach ($node->classificationWrap->classification + as $classificationNode + ) { + $type = null; + $attributes = $classificationNode->attributes(); + $type = isset($attributes->type) ? $attributes->type : ''; + if ($type) { + $results[] = (string)$classificationNode->term + . " $type)"; + } else { + $results[] = (string)$classificationNode->term; + } + } + } else if ($term == 'arkeologinen kohde') { + foreach ($node->classificationWrap->classification->term + as $classificationNode + ) { + $label = null; + $attributes = $classificationNode->attributes(); + $label = isset($attributes->label) ? $attributes->label : ''; + if ($label) { + $results[] = (string)$classificationNode . " ($label)"; + } else { + $results[] = (string)$classificationNode; + } + } + } + } + return $results; + } + + /** + * Get identifier + * + * @return array + */ + public function getIdentifier() + { + return isset($this->fields['identifier']) + ? $this->fields['identifier'] : []; + } + + /** + * Return image rights. + * + * @param string $language Language + * + * @return mixed array with keys: + * 'copyright' Copyright (e.g. 'CC BY 4.0') (optional) + * 'description Human readable description (array) + * 'link' Link to copyright info + * or false if the record contains no images + */ + public function getImageRights($language) + { + if (!count($this->getAllThumbnails())) { + return false; + } + + $rights = []; + + if ($type = $this->getAccessRestrictionsType($language)) { + $rights['copyright'] = $type['copyright']; + if (isset($type['link'])) { + $rights['link'] = $type['link']; + } + } + + $desc = $this->getAccessRestrictions(); + if ($desc && count($desc)) { + $description = []; + foreach ($desc as $p) { + $description[] = (string)$p; + } + $rights['description'] = $description; + } + + return isset($rights['copyright']) || isset($rights['description']) + ? $rights : false; + } + + /** + * Get an array of inscriptions for the record. + * + * @return array + */ + public function getInscriptions() + { + $results = []; + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectIdentificationWrap/inscriptionsWrap/' + . 'inscriptions/inscriptionDescription/descriptiveNoteValue' + ) as $node) { + $label = null; + $attributes = $node->attributes(); + $label = isset($attributes->label) ? $attributes->label : ''; + if ($label) { + $results[] = (string)$node . ' (' . $label . ')'; + } else { + $results[] = (string)$node; + + } + } + return $results; + } + + /** + * Get an array of local identifiers for the record. + * + * @return array + */ + public function getLocalIdentifiers() + { + $results = []; + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectIdentificationWrap/repositoryWrap/' + . 'repositorySet/workID' + ) as $node) { + $type = null; + $attributes = $node->attributes(); + $type = isset($attributes->type) ? $attributes->type : ''; + // sometimes type exists with empty value or space(s) + if (($type) && trim((string)$node) != '') { + $results[] = (string)$node . ' (' . $type . ')'; + } + } + return $results; + } + + /** + * Get the main format. + * + * @return array + */ + public function getMainFormat() + { + if (!isset($this->fields['format'])) { + return ''; + } + $formats = $this->fields['format']; + $format = reset($formats); + $format = preg_replace('/^\d+\/([^\/]+)\/.*/', '\1', $format); + return $format; + } + + /** + * Get measurements and augment them data source specifically if needed. + * + * @return array + */ + public function getMeasurements() + { + $results = []; + if (isset($this->fields['measurements'])) { + $results = $this->fields['measurements']; + $confParam = 'lido_augment_display_measurement_with_extent'; + if ($this->getDataSourceConfigurationValue($confParam)) { + if ($extent = $this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectIdentificationWrap/' + . 'objectMeasurementsWrap/objectMeasurementsSet/' + . 'objectMeasurements/extentMeasurements' + ) + ) { + $results[0] = "$results[0] ($extent[0])"; + } + } + } + return $results; + } + + /** + * Get all authors apart from presenters + * + * @return array + */ + public function getNonPresenterAuthors() + { + $authors = []; + foreach ($this->getSimpleXML()->xpath( + '/lidoWrap/lido/descriptiveMetadata/eventWrap/eventSet/event' + ) as $node) { + if (!isset($node->eventActor) || $node->eventType->term != 'valmistus') { + continue; + } + foreach ($node->eventActor as $actor) { + if (isset($actor->actorInRole->actor->nameActorSet->appellationValue) + && trim( + $actor->actorInRole->actor->nameActorSet->appellationValue + ) != '' + ) { + $role = isset($actor->actorInRole->roleActor->term) + ? $actor->actorInRole->roleActor->term : ''; + $authors[] = [ + 'name' => $actor->actorInRole->actor->nameActorSet + ->appellationValue, + 'role' => $role + ]; + } + } + } + return $authors; + } + + /** + * Get an array of dates for results list display + * + * @return array + */ + public function getResultDateRange() + { + return $this->getDateRange('creation'); + } + + /** + * Get subject actors + * + * @return array + */ + public function getSubjectActors() + { + $results = []; + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectRelationWrap/subjectWrap/' + . 'subjectSet/subject/subjectActor/actor/nameActorSet/appellationValue' + ) as $node) { + $results[] = (string)$node; + } + return $results; + } + + /** + * Get subject dates + * + * @return array + */ + public function getSubjectDates() + { + $results = []; + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectRelationWrap/subjectWrap/' + . 'subjectSet/subject/subjectDate/displayDate' + ) as $node) { + $results[] = (string)$node; + } + return $results; + } + + /** + * Get subject details + * + * @return array + */ + public function getSubjectDetails() + { + $results = []; + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectIdentificationWrap/titleWrap/titleSet/' + . "appellationValue[@label='aiheen tarkenne']" + ) as $node) { + $results[] = (string)$node; + } + return $results; + } + + /** + * Get subject places + * + * @return array + */ + public function getSubjectPlaces() + { + $results = []; + foreach ($this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectRelationWrap/subjectWrap/' + . 'subjectSet/subject/subjectPlace/displayPlace' + ) as $node) { + $results[] = (string)$node; + } + return $results; + } + + /** + * Return an array of associative URL arrays with one or more of the following + * keys: + * + * <li> + * <ul>desc: URL description text to display (optional)</ul> + * <ul>url: fully-formed URL (required if 'route' is absent)</ul> + * <ul>route: VuFind route to build URL with (required if 'url' is absent)</ul> + * <ul>routeParams: Parameters for route (optional)</ul> + * <ul>queryString: Query params to append after building route (optional)</ul> + * </li> + * + * @return array + */ + public function getURLs() + { + $urls = []; + foreach (parent::getURLs() as $url) { + /*if (!$this->urlBlacklisted( + isset($url['url']) ? $url['url'] : '', + isset($url['desc']) ? $url['desc'] : '' + )) {*/ + $urls[] = $url; + //} + } + return $urls; + } + + /** + * Get the web resource link from the record. + * + * @return mixed + */ + public function getWebResource() + { + $url = $this->getSimpleXML()->xpath( + 'lido/descriptiveMetadata/objectRelationWrap/relatedWorksWrap/' + . 'relatedWorkSet/relatedWork/object/objectWebResource' + ); + return isset($url[0]) ? $url[0] : false; + } + + /** + * Set raw data to initialize the object. + * + * @param mixed $data Raw data representing the record; Record Model + * objects are normally constructed by Record Driver objects using data + * passed in from a Search Results object. The exact nature of the data may + * vary depending on the data source -- the important thing is that the + * Record Driver + Search Results objects work together correctly. + * + * @return void + */ + public function setRawData($data) + { + parent::setRawData($data); + $this->simpleXML = null; + } + + /** + * Is social media sharing allowed (i.e. AddThis Tool). + * + * @return boolean + */ + public function socialMediaSharingAllowed() + { + $rights = $this->getSimpleXML()->xpath( + 'lido/administrativeMetadata/resourceWrap/resourceSet/rightsResource/' + . 'rightsType/conceptID[@type="Social media links"]' + ); + return empty($rights) || (string)$rights[0] != 'no'; + } + + /** + * Does a record come from a source that has given data + * source specific configuration set as true? + * + * @param string $confParam string of configuration parameter name + * + * @return bool + */ + protected function getDataSourceConfigurationValue($confParam) + { + $datasource = $this->getDataSource(); + return isset($this->recordConfig->$confParam) + && isset($this->recordConfig->$confParam[$datasource]) + ? $this->recordConfig->$confParam[$datasource] : null; + } + + /** + * Get a Date Range from Index Fields + * + * @param string $event Event name + * + * @return null|array Array of two dates or null if not available + */ + protected function getDateRange($event) + { + $key = "{$event}_daterange"; + if (!isset($this->fields[$key])) { + return null; + } + if (preg_match('/\[(\d{4}).* TO (\d{4})/', $this->fields[$key], $matches)) { + return [$matches[1], $matches[2] == '9999' ? null : $matches[2]]; + } + return null; + } + + /** + * Get the original record as a SimpleXML object + * + * @return SimpleXMLElement The record as SimpleXML + */ + protected function getSimpleXML() + { + if ($this->simpleXML === null) { + $this->simpleXML = simplexml_load_string($this->fields['fullrecord']); + } + return $this->simpleXML; + + } +} diff --git a/module/finc/src/finc/RecordTab/DescriptionLido.php b/module/finc/src/finc/RecordTab/DescriptionLido.php new file mode 100644 index 0000000000000000000000000000000000000000..0d7e26d903cc9be03a7de354aa228a331a6f013b --- /dev/null +++ b/module/finc/src/finc/RecordTab/DescriptionLido.php @@ -0,0 +1,63 @@ +<?php +/** + * Acquisition tab + * + * PHP version 5 + * + * Copyright (C) Villanova University 2010. + * Copyright (C) Leipzig University Library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package RecordTabs + * @author Demian Katz <demian.katz@villanova.edu> + * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + */ +namespace finc\RecordTab; + +/** + * Holdings (ILS) tab + * + * @category VuFind2 + * @package RecordTabs + * @author Demian Katz <demian.katz@villanova.edu> + * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + */ +class DescriptionLido extends \VuFind\RecordTab\AbstractBase +{ + /** + * Get the on-screen description for this tab. + * + * @return string + */ + public function getDescription() + { + return 'Description'; + } + + /** + * Is this tab active? + * + * @return bool + */ + public function isActive() + { + return true; + } +} \ No newline at end of file diff --git a/module/finc/src/finc/View/Helper/Root/Record.php b/module/finc/src/finc/View/Helper/Root/Record.php index 5fb135cae5fbaeb0bfc46f184fbd680915b278ec..92b0d27f079b1869642b6e6f53e22cb54d10f87a 100644 --- a/module/finc/src/finc/View/Helper/Root/Record.php +++ b/module/finc/src/finc/View/Helper/Root/Record.php @@ -210,6 +210,26 @@ class Record extends \VuFind\View\Helper\Root\Record return $this->rewriteLinks($links); } + /** + * Map list of multiple dates to a view of date range as string e.g. + * startdate - enddate Sorting of array should be managed by backend. + * + * @param array dates + * + * @return strings + */ + public function mapDateListToRangeView($dates) + { + if (is_array($dates)) { + if (count($dates) == 1) { + return $dates[0]; + } else { + return array_shift($dates) . '-' . array_pop($dates); + } + } + return $dates; + } + /** * Remove author dates from author string (used for using author names as search * term). diff --git a/themes/finc/scss/default.scss b/themes/finc/scss/default.scss index 48da08e2c9184a10cb8d209030f1fed1511d1767..619dc5491ec3095f99d027179ecd5811b2285166 100644 --- a/themes/finc/scss/default.scss +++ b/themes/finc/scss/default.scss @@ -111,6 +111,12 @@ header.fixed { left:auto;max-width: $row-width; } } } +.access-rights { + font-size: 0.75rem; + margin-bottom: 1rem; + +} + // Internformat - staff view table.citation th {min-width: 18%} .pace-car th {min-width: 10%} diff --git a/themes/finc/templates/RecordDriver/SolrLido/core.phtml b/themes/finc/templates/RecordDriver/SolrLido/core.phtml new file mode 100644 index 0000000000000000000000000000000000000000..c27e6bae14bf5dcbb1e76f908f0fab0973eaa455 --- /dev/null +++ b/themes/finc/templates/RecordDriver/SolrLido/core.phtml @@ -0,0 +1,416 @@ +<!-- recordDriver - solrLido - CORE.phtml --> +<? +if($loggedin = $this->auth()->isLoggedIn()) { + $user_id = $loggedin->id; + $loggedin = true; +} else { + $user_id = false; +} +?> +<div class="row" vocab="http://schema.org/" resource="#record" typeof="<?=$this->driver->getSchemaOrgFormats()?> Product"> + <? $QRCode = $this->record($this->driver)->getQRCode("core"); + $cover = $this->record($this->driver)->getCover('core', 'medium', $this->record($this->driver)->getThumbnail('large')); + $preview = $this->record($this->driver)->getPreviews(); ?> + <? if ($QRCode || $cover || $preview): ?> + <div class="medium-3 columns"> + <div class="text-center"> + <? /* Display thumbnail if appropriate: */ ?> + <? if($cover): ?> + <?=$cover?> + <? /* BOF - finc-specific StyleBasedIcons */ ?> + <? elseif ($this->record($this->driver)->showStyleBasedIcons()): ?> + <?=$this->record($this->driver)->getFormatIcon()?> + <? /* EOF - finc-specific StyleBasedIcons */ ?> + <? endif; ?> + + <? /* Display qrcode if appropriate: */ ?> + <? if($QRCode): ?> + <span class="hide-for-small"> + <br/><img alt="<?=$this->transEsc('QR Code')?>" class="qrcode" src="<?=$this->escapeHtmlAttr($QRCode);?>"/> + </span> + <? endif; ?> + <? /* Image rights: */ ?> + <? $rights = $this->driver->getImageRights($this->layout()->userLang); ?> + <div class="access-rights"> + <div class="image-rights"> + <? $hasLink = isset($rights['link']); ?> + <strong><?= $this->translate("Image Rights") ?> + :</strong> <? if (isset($rights['copyright'])) : ?><? if ($hasLink): ?><a target="_blank" href="<?= $rights['link'] ?>"><? endif; ?><?= $this->transEsc($rights['copyright']) ?><? if ($hasLink): ?></a><? endif ?><? endif ?> + </div> + <div class="copyright truncate-field"> + <? if (isset($rights['description'])): ?> + <? foreach ($rights['description'] as $item): ?> + <p><?= $this->transEsc($item) ?></p> + <? endforeach ?> + <? endif ?> + <? if (!isset($rights['copyright']) && !isset($rights['description'])): ?> + <?= $this->translate('Image Rights Default') ?> + <!--<p><a href="< ?= $this->url('content-page', array('page' => 'terms_conditions')) . '#image_rights' ?>"><i class="fa fa-arrow-right"></i>< ?= $this->translate('See also terms and conditions') ?></a>--> + <? endif; ?> + </div> + </div> + </div> + + <? // 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) ?> + <? if ($preview): ?><?=$preview?><? endif; ?> + </div> + + <div class="medium-9 columns"> + <? else: ?> + <div class="medium-12 columns"> + <? endif; ?> + <? /* This following line is a finc-specific change */ ?> + <h3 property="name"><?=$this->escapeHtml($this->driver->getTitle())?></h3> + + <? $summary = $this->driver->getSummary(); $summary = isset($summary[0]) ? $this->escapeHtml($summary[0]) : false; ?> + <? if ($summary): ?> + <p><?=$this->truncate($summary, 300)?></p> + + <? if(strlen($summary) > 300): ?> + <p><a href='<?=$this->recordLink()->getTabUrl($this->driver, 'Description')?>'><?=$this->transEsc('Full description')?></a></p> + <? endif; ?> + <? endif; ?> + + <? if ($this->userlist()->getMode() !== 'disabled'): ?> + <? /* Display the lists that this record is saved to */ ?> + <div class="savedLists hide alert-box info" data-alert tabindex="0" aria-live="assertive" role="alertdialog"> + <strong><?=$this->transEsc("Saved in")?>:</strong> + </div> + <? endif; ?> + + <?/* Display Main Details */?> + <table class="table"> + <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> + <? $journalTitle = $this->driver->getContainerTitle(); if (!empty($journalTitle)): ?> + <tr> + <th><?=$this->transEsc('Journal Title')?>:</th> + <td> + <? + $containerSource = $this->driver->getSourceIdentifier(); + $containerID = $this->driver->getContainerRecordID(); + ?> + <a href="<?=($containerID ? $this->recordLink()->getUrl("$containerSource|$containerID") : $this->record($this->driver)->getLink('journaltitle', $journalTitle))?>"><?=$this->escapeHtml($journalTitle)?></a> + <? $ref = $this->driver->getContainerReference(); if (!empty($ref)) { echo $this->escapeHtml($ref); } ?> + </td> + </tr> + <? endif; ?> + + <? $nextTitles = $this->driver->getNewerTitles(); $prevTitles = $this->driver->getPreviousTitles(); ?> + <? if (!empty($nextTitles)): ?> + <tr> + <th><?=$this->transEsc('New Title')?>: </th> + <td> + <? foreach($nextTitles as $field): ?> + <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? if (!empty($prevTitles)): ?> + <tr> + <th><?=$this->transEsc('Previous Title')?>: </th> + <td> + <? foreach($prevTitles as $field): ?> + <a href="<?=$this->record($this->driver)->getLink('title', $field)?>"><?=$this->escapeHtml($field)?></a><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + + <!-- Creator / Originator --> + <? $authors = $this->driver->getDeduplicatedAuthors(); ?> + <? if (isset($authors['main']) && !empty($authors['main'])): ?> + <tr> + <th><?= $this->transEsc(count($authors['main']) > 1 ? 'Originators' : 'Originator') ?>: </th> + <td> + <? $i = 0; foreach ($authors['main'] as $author => $roles): ?><?= ($i++ == 0) ? '' : ', ' ?><span property="author"><a href="<?= $this->record($this->driver)->getLink('author', $author) ?>"><?= $this->escapeHtml($author) ?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?= ($j++ == 0) ? '' : ', ' ?><?= $this->transEsc("CreatorRoles::" . $role) ?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? if (isset($authors['corporate']) && !empty($authors['corporate'])): ?> + <tr> + <th><?= $this->transEsc(count($authors['corporate']) > 1 ? 'Corporate Originator' : 'Corporate Originators') ?>:</th> + <td> + <? $i = 0; foreach ($authors['corporate'] as $corporate => $roles): ?><?= ($i++ == 0) ? '' : ', ' ?><span property="creator"><a href="<?= $this->record($this->driver)->getLink('author', $corporate) ?>"><?= $this->escapeHtml($corporate) ?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?= ($j++ == 0) ? '' : ', ' ?><?= $this->transEsc("CreatorRoles::" . $role) ?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? if (isset($authors['secondary']) && !empty($authors['secondary'])): ?> + <tr> + <th><?= $this->transEsc('Other Originators') ?>:</th> + <td> + <? $i = 0; foreach ($authors['secondary'] as $author => $roles): ?><?= ($i++ == 0) ? '' : ', ' ?><span property="contributor"><a href="<?= $this->record($this->driver)->getLink('author', $author) ?>"><?= $this->escapeHtml($author) ?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?= ($j++ == 0) ? '' : ', ' ?><?= $this->transEsc("CreatorRoles::" . $role) ?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getSubjectDetails()): ?> + <tr class="recordSubjects"> + <th><?= $this->transEsc('Subject Detail') ?>:</th> + <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getSubjectPlaces()): ?> + <tr class="recordSubjects"> + <th><?= $this->transEsc('Subject Place') ?>:</th> + <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getSubjectDates()): ?> + <tr class="recordSubjects"> + <th><?= $this->transEsc('Subject Date') ?>:</th> + <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getSubjectActors()): ?> + <tr class="recordSubjects"> + <th><?= $this->transEsc('Subject Actor') ?>:</th> + <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getInstitutions()): ?> + <tr class="recordInstitution"> + <th><?= $this->transEsc('Institution') ?>:</th> + <td> + <? foreach ($results as $index => $institution): ?> + <?= ($index > 0 ? '<br/>' : '') ?><?= $this->transEsc("source_$institution", array(), $this->translate($institution)) ?> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getIdentifier()): ?> + <tr class="recordIdentifier"> + <th><?= $this->transEsc('Inventory ID') ?>:</th> + <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getMeasurements()): ?> + <tr class="recordMeasurements"> + <th><?= $this->transEsc('Measurements') ?>:</th> + <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getMeasurementsDescription()): ?> + <tr class="recordMeasurementsDescription"> + <th><?= $this->transEsc('Measurements') ?>:</th> + <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getCollections()): ?> + <tr class="recordCollection"> + <th><?= $this->transEsc('Collection') ?>:</th> + <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> + </tr> + <? endif; ?> + + <!---Format Finc ---> + <? $formats = $this->driver->getFormats(); if (!empty($formats)): ?> + <tr> + <th><?= $this->transEsc('Object type') ?>:</th> + <td><?= $this->record($this->driver)->getFormatList() ?></td> + </tr> + <? endif; ?> + + <!-- Format Lido --> + <? if ($results = $this->driver->getFormatClassifications()): ?> + <tr class="recordClassifications"> + <th><?= $this->transEsc('Other Classification') ?>:</th> + <td> + <div class="truncate-field"><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></div> + </td> + </tr> + <? endif; ?> + + <? if ($results = $this->driver->getLocalIdentifiers()): ?> + <tr class="recordIdentifiers"> + <th><?= $this->transEsc('Other ID') ?>:</th> + <td><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $results)) ?></td> + </tr> + <? endif; ?> + + <? $mainFormat = $this->driver->getMainFormat(); ?> <? foreach ($this->driver->getEvents() as $eventType => $events): ?> + <tr class="recordEvents"> + <!--<th>< ?=$this->transEsc("lido_event_type_{$mainFormat}_$eventType")?>:</th>--> + <th> + <? if ($eventType == 'production'): ?> + <?= $this->transEsc('expression creation') ?> + <? elseif ($eventType == 'publication'): ?> + <?= $this->transEsc('Time of origin') ?> + <? $publicationIsSet = true; ?> + <? else: ?> + <?= $this->transEsc($eventType) ?> + <? endif; ?> + </th> + <td> + <div class="truncate-field"> + <? foreach ($events as $event): ?> + <? if ($event != $events[0]): ?><br/><? endif; ?> + <? if (!empty($event['name'])): ?><?= $this->escapeHtml($event['name']) ?><br/><? endif; ?> + <? if (!empty($event['date'])): ?><?= $this->escapeHtml($event['date']) ?><br/><? elseif ($event['type'] != 'käyttö' && $event['type'] != 'näyttely'): ?> <?= $this->transEsc('undated') ?><? endif; ?> + <? if (!empty($event['method'])): ?><?= $this->escapeHtml($event['method']) ?><br/><? endif; ?> + <? if (!empty($event['materials'])): ?><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $event['materials'])) ?><br/><? endif; ?> + <? if (!empty($event['places'])): ?><?= implode('<br/>', array_map(array($this, 'escapeHtml'), $event['places'])) ?><br/><? endif; ?> + <? if (!empty($event['culture'])): ?><?= $this->escapeHtml($event['culture']) ?><br/><? endif; ?> + <? if (!empty($event['actors'])): ?> + <? foreach ($event['actors'] as $actor): ?> + <?= $this->escapeHtml($actor['name']) ?><? if (!empty($actor['role'])): ?>, <?= $this->escapeHtml($actor['role']) ?><? endif; ?> + <? endforeach; ?> + <br/> + <? endif; ?> + <? if (!empty($event['description'])): ?><?= $this->escapeHtml($event['description']) ?><br/><? endif; ?> + <? endforeach; ?> + </div> + </td> + </tr> + <? endforeach; ?> + <!-- End --> + + <? $langs = $this->driver->getLanguages(); if (!empty($langs)): ?> + <tr> + <th><?= $this->transEsc('Language') ?>:</th> + <td><? foreach ($langs as $lang): ?><?= $this->escapeHtml($lang) ?><br/><? endforeach; ?></td> + </tr> + <? endif; ?> + + <? $dateSpan = $this->driver->getDateSpan(); if (!empty($dateSpan) && !$publicationIsSet): ?> + <? $contentDisplayed = true; ?> + <tr> + <th><?= $this->transEsc('Time of origin') ?>:</th> + <td> + <?= $this->record($this->driver)->mapDateListToRangeView($dateSpan); ?> + </td> + </tr> + <? endif; ?> + + <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> + <tr> + <th><?=$this->transEsc('Edition')?>: </th> + <td property="bookEdition"><?=$this->escapeHtml($edition)?></td> + </tr> + <? endif; ?> + + <?/* Display series section if at least one series exists. */?> + <? $series = $this->driver->getSeries(); if (!empty($series)): ?> + <tr> + <th><?=$this->transEsc('Series')?>: </th> + <td> + <? foreach ($series as $field): ?> + <?/* Depending on the record driver, $field may either be an array with + "name" and "number" keys or a flat string containing only the series + name. We should account for both cases to maximize compatibility. */?> + <? if (is_array($field)): ?> + <? if (!empty($field['name'])): ?> + <a href="<?=$this->record($this->driver)->getLink('series', $field['name'])?>"><?=$this->escapeHtml($field['name'])?></a> + <? if (!empty($field['number'])): ?> + <?=$this->escapeHtml($field['number'])?> + <? endif; ?> + <br/> + <? endif; ?> + <? else: ?> + <a href="<?=$this->record($this->driver)->getLink('series', $field)?>"><?=$this->escapeHtml($field)?></a><br/> + <? endif; ?> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $subjects = $this->driver->getAllSubjectHeadings(); if (!empty($subjects)): ?> + <tr> + <th><?=$this->transEsc('Subjects')?>: </th> + <td> + <? foreach ($subjects as $field): ?> + <div class="subject-line" property="keywords"> + <? $subject = ''; ?> + <? if(count($field) == 1) $field = explode('--', $field[0]); ?> + <? $i = 0; foreach ($field as $subfield): ?> + <?=($i++ == 0) ? '' : ' > '?> + <? $subject = trim($subject . ' ' . $subfield); ?> + <a title="<?=$this->escapeHtmlAttr($subject)?>" href="<?=$this->record($this->driver)->getLink('subject', $subject)?>" rel="nofollow"><?=trim($this->escapeHtml($subfield))?></a> + <? endforeach; ?> + </div> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $childRecordCount = $this->driver->tryMethod('getChildRecordCount'); if ($childRecordCount): ?> + <tr> + <th><?=$this->transEsc('child_records')?>: </th> + <td> + <a href="<?=$this->recordLink()->getChildRecordSearchUrl($this->driver)?>"><?=$this->transEsc('child_record_count', array('%%count%%' => $childRecordCount))?></a> + </td> + </tr> + <? endif; ?> + + <? + $openUrl = $this->openUrl($this->driver, 'record'); + $openUrlActive = $openUrl->isActive(); + // Account for replace_other_urls setting + $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); + ?> + <? if (!empty($urls) || $openUrlActive): ?> + <tr> + <th><?=$this->transEsc('Online Access')?>: </th> + <td> + <? foreach ($urls as $current): ?> + <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/> + <? endforeach; ?> + <? if ($openUrlActive): ?> + <?=$openUrl->renderTemplate()?><br/> + <? endif; ?> + </td> + </tr> + <? endif; ?> + + <? $recordLinks = $this->driver->getAllRecordLinks(); ?> + <? if(!empty($recordLinks)): ?> + <tr> + <th><?=$this->transEsc('Related Items')?>:</th> + <td> + <? foreach ($recordLinks as $recordLink): ?> + <?=$this->transEsc($recordLink['title'])?>: + <a href="<?=$this->recordLink()->related($recordLink['link'])?>"><?=$this->escapeHtml($recordLink['value'])?></a><br /> + <? endforeach; ?> + <? /* if we have record links, display relevant explanatory notes */ + $related = $this->driver->getRelationshipNotes(); + if (!empty($related)): ?> + <? foreach ($related as $field): ?> + <?=$this->escapeHtml($field)?><br/> + <? endforeach; ?> + <? endif; ?> + </td> + </tr> + <? endif; ?> + + <? if ($this->usertags()->getMode() !== 'disabled'): ?> + <? $tagList = $this->driver->getTags(null, null, 'count', $user_id); ?> + <tr> + <th><?=$this->transEsc('Tags')?>: </th> + <td> + <span class="right hide-for-print"> + <a class="tagRecord right" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" data-lightbox><i class="fa fa-plus"></i><?=$this->transEsc('Add Tag')?></a> + </span> + <?=$this->context($this)->renderInContext('record/taglist', array('tagList'=>$tagList, 'loggedin'=>$loggedin)) ?> + </td> + </tr> + <? endif; ?> + </table> + <?/* End Main Details */?> + </div> +</div> +<!-- recordDriver - solrLido - CORE.phtml end --> \ No newline at end of file diff --git a/themes/finc/templates/RecordTab/descriptionlido.phtml b/themes/finc/templates/RecordTab/descriptionlido.phtml new file mode 100644 index 0000000000000000000000000000000000000000..1fc9755cfff1111b0d27c29709f53b509c9ac3c1 --- /dev/null +++ b/themes/finc/templates/RecordTab/descriptionlido.phtml @@ -0,0 +1,32 @@ +<!-- recordtab - descriptionlido.phtml --> +<? +// Set page title. +$this->headTitle($this->translate('Description') . ': ' . $this->driver->getBreadcrumb()); + +// Grab clean ISBN for convenience: +$isbn = $this->driver->getCleanISBN(); +?> +<table class="table table-striped"> + <caption class="sr-only"><?= $this->transEsc('Description') ?></caption> + <? $dateSpan = $this->driver->getDateSpan(); if (!empty($dateSpan)): ?> + <tr> + <th><?= $this->transEsc('Time of origin') ?>:</th> + <td> + <?= $this->record($this->driver)->mapDateListToRangeView($dateSpan); ?> + </td> + </tr> + <? endif; ?> + + <? $notes = $this->driver->getAccessNote(); if (!empty($notes)): ?> + <tr> + <th><?= $this->transEsc('Access') ?>:</th> + <td> + <? foreach ($notes as $field): ?> + <? if (!empty($field['uri'])): ?><a href="<?= $this->escapeHtmlAttr($field['uri']) ?>"><?= $this->escapeHtml($field['term']) ?><? endif; ?><? if (!empty($field['uri'])): ?></a><? endif; ?> + <br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> +</table> +<!-- recordtab - descriptionlido.phtml - END --> \ No newline at end of file