diff --git a/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php b/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php index 443d56a23380d6f1d1c480e317f7f164008c0938..8e03432a87d668bbd324d8d55c511b7bc514e032 100644 --- a/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php @@ -697,11 +697,11 @@ trait SolrDefaultFincTrait * This method can be used to indicate a direct link than to form a general * look for query. * - * @param array $rids Array of record ids to test. + * @param array $array Array of record ids to test. * * @return int mixed If success return at least one finc id otherwise null. */ - protected function addFincIDToRecord ( $array ) + protected function addFincIDToRecord( $array ) { // record ids $rids = []; diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index 85f64782d4793538ca2cbec87f3d1f327482f4be..0105df80a40153434d39c17a25325a182962314d 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -1082,6 +1082,49 @@ trait SolrMarcFincTrait return $retval; } + /** + * Get an array of successing titles for the record. Opposite method to + * getting previous title of marc field 780. + * + * @return array + * @access protected + */ + public function getNewerTitles() + { + $array = []; + $previous = $this->getMarcRecord()->getFields('785'); + + // if no entry return void + if (!$previous) { + return $array; + } + + foreach ($previous as $key => $line) { + $array[$key]['pretext'] = ($line->getSubfield('i')) + ? $line->getSubfield('i')->getData() : ''; + $array[$key]['text'] = ($line->getSubfield('a')) + ? $line->getSubfield('a')->getData() : ''; + if (empty($array[$key]['text'])) { + $array[$key]['text'] = ($line->getSubfield('t')) + ? $line->getSubfield('t')->getData() : ''; + } + // get ppns of bsz + $linkFields = $line->getSubfields('w'); + foreach ($linkFields as $current) { + $text = $current->getData(); + // Extract parenthetical prefixes: + if (preg_match(self::BSZ_PATTERN, $text, $matches)) { + $array[$key]['record_id'] = $matches[2].$matches[3]; + } + } // end foreach + } // end foreach + + // open to discuss if it is better use $this->addFincIDToRecord($array) or + // RecordLink as ViewHelper at frontend; + return $array; + } + + /** * Get notice of a title representing a special case of University * library of Chemnitz: MAB field 999l @@ -1208,6 +1251,47 @@ trait SolrMarcFincTrait return $this->addFincIDToRecord($array); } + /** + * Get an array of previous titles for the record. + * + * @return array + * @access protected + */ + public function getPreviousTitles() + { + $array = []; + $previous = $this->getMarcRecord()->getFields('780'); + + // if no entry return void + if (!$previous) { + return $array; + } + + foreach ($previous as $key => $line) { + $array[$key]['pretext'] = ($line->getSubfield('i')) + ? $line->getSubfield('i')->getData() : ''; + $array[$key]['text'] = ($line->getSubfield('a')) + ? $line->getSubfield('a')->getData() : ''; + if (empty($array[$key]['text'])) { + $array[$key]['text'] = ($line->getSubfield('t')) + ? $line->getSubfield('t')->getData() : ''; + } + // get ppns of bsz + $linkFields = $line->getSubfields('w'); + foreach ($linkFields as $current) { + $text = $current->getData(); + // Extract parenthetical prefixes: + if (preg_match(self::BSZ_PATTERN, $text, $matches)) { + $array[$key]['record_id'] = $matches[2].$matches[3]; + } + } // end foreach + } // end foreach + + // open to discuss if it is better use $this->addFincIDToRecord($array) or + // RecordLink as ViewHelper at frontend; + return $array; + } + /** * Get an array of previous titles for the record. * diff --git a/module/finc/tests/bootstrap.php b/module/finc/tests/bootstrap.php new file mode 100644 index 0000000000000000000000000000000000000000..ed4eafd92da1d6eb26e70400089c2a5daa8b7dff --- /dev/null +++ b/module/finc/tests/bootstrap.php @@ -0,0 +1,212 @@ +<?php +/** + * Bootstrap + * + * PHP version 5 + * + * Copyright (C) Villanova University 2010. + * Copyright (C) project swissbib, University Library Basel, Switzerland + * 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 VuFind + * @package finc + * @author Guenter Hipler <guenter.hipler@unibas.ch> + * @author Frank Morgner <morgner.f@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://www.swissbib.org + */ +use Zend\Mvc\Service\ServiceManagerConfig; +use Zend\ServiceManager\ServiceManager; +use Zend\Stdlib\ArrayUtils; + +/** + * Bootstrap + * + * @category VuFind + * @package finc + * @author Guenter Hipler <guenter.hipler@unibas.ch> + * @author Frank Morgner <morgner.f@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org + */ +class Bootstrap +{ + /** + * ServiceManager + * + * @var ServiceManager + */ + protected static $serviceManager; + + /** + * Config + * + * @var static config + */ + protected static $config; + + /** + * Bootstrap + * + * @var static bootstrap + */ + protected static $bootstrap; + + /** + * Init + * + * @return void + */ + public static function init() + { + // Load the user-defined test configuration file, if it exists; + // otherwise, load + if (is_readable(FINC_TESTS_PATH . '/config.php')) { + $testConfig = include FINC_TESTS_PATH . '/config.php'; + } else { + $testConfig = include FINC_TESTS_PATH . '/config.php.dist'; + } + + $zf2ModulePaths = []; + if (isset($testConfig['module_listener_options']['module_paths'])) { + $modulePaths = $testConfig['module_listener_options']['module_paths']; + foreach ($modulePaths as $modulePath) { + if (($path = static::findParentPath($modulePath))) { + $zf2ModulePaths[] = $path; + } + } + } + $zf2ModulePaths = implode(PATH_SEPARATOR, $zf2ModulePaths) . PATH_SEPARATOR; + $zf2ModulePaths .= getenv('ZF2_MODULES_TEST_PATHS') ?: (defined('ZF2_MODULES_TEST_PATHS') ? ZF2_MODULES_TEST_PATHS : ''); + static::initAutoloader(); + // use ModuleManager to load this module and it's dependencies + $baseConfig = [ + 'module_listener_options' => [ + 'module_paths' => explode(PATH_SEPARATOR, $zf2ModulePaths), + ], + ]; + self::initEnvironment(); + $config = ArrayUtils::merge($baseConfig, $testConfig); + $serviceManager = new ServiceManager(new ServiceManagerConfig()); + $serviceManager->setService('ApplicationConfig', $config); + $serviceManager->get('ModuleManager')->loadModules(); + static::$serviceManager = $serviceManager; + static::$config = $config; + } + + /** + * InitVuFind + * + * @return void + */ + public function initEnvironment() + { + define('APPLICATION_ENV', 'development'); + define('FINC_TEST_FIXTURES', realpath(FINC_TESTS_PATH . '/fixtures')); + } + /** + * GetServiceManager + * + * @return ServiceManager + */ + public static function getServiceManager() + { + return static::$serviceManager; + } + /** + * GetConfig + * + * @return Config + */ + public static function getConfig() + { + return static::$config; + } + /** + * InitAutoloader + * + * @return void + */ + protected static function initAutoloader() + { + $vendorPath = static::findParentPath('vendor'); + if (is_readable($vendorPath . '/autoload.php')) { + include $vendorPath . '/autoload.php'; + $loader = new \Composer\Autoload\ClassLoader(); + $loader->add('VuFindTest', APPLICATION_PATH . '/module/VuFind/tests/unit-tests/src'); + $loader->add('VuFindTest', APPLICATION_PATH . '/module/VuFind/src'); + $loader->add('fincTest', FINC_TESTS_PATH . '/unit-tests/src'); + $loader->add('VuFindTest', APPLICATION_PATH . '/module/VuFind/src/VuFindTest'); + $loader->register(); + } else { + throw new RuntimeException('Unable initialize autoloading.'); + } + } + /** + * FindParentPath + * + * @param String $path Path + * + * @return bool|string + */ + protected static function findParentPath($path) + { + $dir = FINC_TESTS_PATH; + $previousDir = '.'; + while (!is_dir($dir . '/' . $path)) { + $dir = dirname($dir); + if ($previousDir === $dir) { + return false; + } + $previousDir = $dir; + } + return $dir . '/' . $path; + } +} + +// Set flag that we're in test mode +define('VUFIND_PHPUNIT_RUNNING', 1); + +// Set path to this module +define('VUFIND_PHPUNIT_MODULE_PATH', __DIR__); + +// Define default search backend identifier +defined('DEFAULT_SEARCH_BACKEND') +|| define('DEFAULT_SEARCH_BACKEND', 'Solr'); + +// Define path to local override directory +defined('LOCAL_OVERRIDE_DIR') +|| define( + 'LOCAL_OVERRIDE_DIR', + (getenv('VUFIND_LOCAL_DIR') ? getenv('VUFIND_LOCAL_DIR') : '') +); + +// Define path to cache directory +defined('LOCAL_CACHE_DIR') +|| define( + 'LOCAL_CACHE_DIR', + (getenv('VUFIND_CACHE_DIR') + ? getenv('VUFIND_CACHE_DIR') + : ( + strlen(LOCAL_OVERRIDE_DIR) > 0 ? LOCAL_OVERRIDE_DIR . '/cache' : '') + ) +); + +define('APPLICATION_PATH', realpath(dirname(__DIR__) . '/../..')); +define('FINC_TESTS_PATH', __DIR__); +chdir(APPLICATION_PATH); + +Bootstrap::init(); \ No newline at end of file diff --git a/module/finc/tests/config.php b/module/finc/tests/config.php new file mode 100644 index 0000000000000000000000000000000000000000..dfb4aefa3c852c9312b53e672512131ca912c28b --- /dev/null +++ b/module/finc/tests/config.php @@ -0,0 +1,19 @@ +<?php + +return [ + 'modules' => [ + 'VuFind', + 'VuFindTheme', + 'VuFindSearch', + 'finc' + ], + 'module_listener_options' => [ + 'config_glob_paths' => [ + '../../../config/autoload/{,*.}{global,local}.php', + ], + 'module_paths' => [ + 'module', + 'vendor', + ] + ] +]; \ No newline at end of file diff --git a/module/finc/tests/fixtures/misc/0002795235.json b/module/finc/tests/fixtures/misc/0002795235.json new file mode 100644 index 0000000000000000000000000000000000000000..d3996aa6374757fcab8a77c7b22c019d27481b97 --- /dev/null +++ b/module/finc/tests/fixtures/misc/0002795235.json @@ -0,0 +1,202 @@ +{ + "title_new":["Tanz"], + "mega_collection":["Sächsische Bibliografie", + "Verbundkatalog Film", + "Verbunddaten SWB"], + "oclc_num":["225206276"], + "spelling":["Ballettanz : Europe's leading dance magazine Nebentitel: Ballett-Tanz Balletttanz Europe's leading dance magazine Berlin : Friedrich-Berlin-Verl.-Ges. 2002 - 2010,1 2002 2010 1 Periodizität: monatl. (üa/Z) 101a!(04-02-10) s (DE-588)4059028-8 (DE-576)209129018 gnd Tanz f gnd Zeitschrift DE-101 s (DE-588)4004351-4 (DE-576)208855459 gnd Ballett f gnd Zeitschrift s (DE-588)4059028-8 (DE-576)209129018 gnd Tanz f gnd Zeitschrift DE-101 Berlin dbp Beil. Piattaforma multimediale della danza contemporanea italiana [Roma] : Fondazione, 2002 CD-ROMs (DE-576)111316251 (DE-600)2143839-0 Beil. Ballettanz. Schools Berlin : Friedrich-Berlin-Verl.-Ges., 2003 (DE-576)11739940X (DE-600)2185947-4 Jahrbuch Ballettanz. Jahrbuch ... Berlin : Friedrich-Berlin-Verl.-Ges., 2002 (DE-576)101178336 (DE-600)2087679-8 Online-Ausg. Ballettanz Berlin : Friedrich-Berlin-Verl., 2003 Online-Ressource (DE-576)321589122 (DE-600)2547390-6 Vorg. Ballett international, Tanz aktuell Berlin : Friedrich-Berlin-Verl.-Ges., 1994 0947-0484 (DE-576)038873095 (DE-600)1177998-6 Forts. Tanz Berlin : Friedrich-Berlin-Verlagsges., 2010 1869-7720 (DE-576)317975862 (DE-600)2536619-1"], + "language":["German", + "English"], + "itemdata":"{\"DE-14\":[{\"bc\":\"31487720\",\"cn\":\"Z. 4. 8283-2007\"},{\"bc\":\"31569790\",\"cn\":\"Z. 4. 8283-2005\"},{\"bc\":\"31569791\",\"cn\":\"Z. 4. 8283-2004\"},{\"bc\":\"31798276\",\"cn\":\"Z. 4. 8283-2006\"},{\"bc\":\"32170227\",\"cn\":\"Z. 4. 8283-2009\"},{\"bc\":\"32172181\",\"cn\":\"Z. 4. 8283-2008\"},{\"bc\":\"32911747\",\"cn\":\"Z. 4. 8283-2010\"},{\"bc\":\"XNOS059313\",\"cn\":\"Z. 4. 8283-2002\"},{\"bc\":\"XNOS062070\",\"cn\":\"Z. 4. 8283-2003\"}],\"DE-L152\":[{\"bc\":\"200079073152\"},{\"bc\":\"200468291152\"}],\"DE-15\":[{\"bc\":\"0021408062\",\"cn\":\"01ZB-2013-3:2009\"},{\"bc\":\"0021408095\",\"cn\":\"01ZB-2013-3:2010\"},{\"bc\":\"0022923247\",\"cn\":\"01ZB-2013-3:2002,1\"},{\"bc\":\"0022923255\",\"cn\":\"01ZB-2013-3:2002,2\"},{\"bc\":\"0022923263\",\"cn\":\"01ZB-2013-3:2003,1\"},{\"bc\":\"0022923271\",\"cn\":\"01ZB-2013-3:2003,2\"},{\"bc\":\"0022923288\",\"cn\":\"01ZB-2013-3:2004,1\"},{\"bc\":\"0022923296\",\"cn\":\"01ZB-2013-3:2004,2\"},{\"bc\":\"0022923302\",\"cn\":\"01ZB-2013-3:2005,1\"},{\"bc\":\"0022923310\",\"cn\":\"01ZB-2013-3:2005,2\"},{\"bc\":\"0022923327\",\"cn\":\"01ZB-2013-3:2006,1\"},{\"bc\":\"0022923335\",\"cn\":\"01ZB-2013-3:2006,2\"},{\"bc\":\"0022923343\",\"cn\":\"01ZB-2013-3:2007,1\"},{\"bc\":\"0022923351\",\"cn\":\"01ZB-2013-3:2007,2\"},{\"bc\":\"0022923368\",\"cn\":\"01ZB-2013-3:2008,1\"},{\"bc\":\"0022923376\",\"cn\":\"01ZB-2013-3:2008,2\"},{\"bc\":\"7014845755\"}]}", + "date_del152":"2010-02-25T10:32:41Z", + "institution":["DE-14", + "DE-15", + "DE-540", + "DE-Ka88", + "DE-L152"], + "topic_facet":["Tanz", + "f", + "Zeitschrift", + "Ballett"], + "dewey-raw":["792"], + "dewey-search":["792"], + "hierarchy_top_id":["0002795235"], + "dewey-sort":"792.00000000", + "id":"0002795235", + "facet_local_del330":["Tanz", + "f", + "Zeitschrift", + "Ballett"], + "barcode_del152":["200079073152", + "200468291152"], + "facet_de14_branch_collcode_exception":["zell1_FH6_P2"], + "barcode":["(DE-L152)200079073152", + "(DE-L152)200468291152", + "(DE-15)7014845755", + "(DE-15)0021408062", + "(DE-15)0021408095", + "(DE-15)0022923247", + "(DE-15)0022923255", + "(DE-15)0022923263", + "(DE-15)0022923271", + "(DE-15)0022923288", + "(DE-15)0022923296", + "(DE-15)0022923302", + "(DE-15)0022923310", + "(DE-15)0022923327", + "(DE-15)0022923335", + "(DE-15)0022923343", + "(DE-15)0022923351", + "(DE-15)0022923368", + "(DE-15)0022923376", + "(DE-14)31487720", + "(DE-14)31569790", + "(DE-14)31569791", + "(DE-14)31798276", + "(DE-14)32170227", + "(DE-14)32172181", + "(DE-14)32911747", + "(DE-14)XNOS059313", + "(DE-14)XNOS062070"], + "local_heading_facet_dezwi2":["Tanz", + "f", + "Zeitschrift", + "Ballett"], + "title_in_hierarchy":["Ballettanz : Europe's leading dance magazine"], + "format":["Journal"], + "dewey-ones":["792 - Stage presentations", + "793 - Indoor games & amusements"], + "publishPlace":["Berlin :"], + "format_de540":["Journal, E-Journal"], + "illustrated":"Illustrated", + "issn":["0947-0484", + "1612-6890", + "16126890", + "1869-7720"], + "date_de540":"2013-06-20T02:10:34Z", + "branch_de15":["Bibliotheca Albertina"], + "publisher":["Friedrich-Berlin-Verl.-Ges."], + "topic":["Tanz", + "f", + "Zeitschrift", + "Ballett"], + "spellingShingle":["Tanz", + "f", + "Zeitschrift", + "Ballett", + "Ballettanz : Europe's leading dance magazine"], + "branch_nrw":["Local Holdings"], + "format_nrw":["Journal, E-Journal"], + "branch_de14":["zell1"], + "access_facet":"Local Holdings", + "is_hierarchy_id":"0002795235", + "dateSpan":["2002 - 2010,1"], + "format_de15":["Journal, E-Journal"], + "is_hierarchy_title":"Ballettanz : Europe's leading dance magazine", + "dewey-tens":["790 - Sports, games & entertainment"], + "format_dezi4":["Journal"], + "imprint":"Berlin : Friedrich-Berlin-Verl.-Ges.", + "hierarchy_top_title":["Ballettanz : Europe's leading dance magazine"], + "rsn":["(DE-15)3227111", + "(DE-14)3532477", + "(DE-L152)70424"], + "title":"Ballettanz : Europe's leading dance magazine", + "format_del152":["Zeitschrift"], + "title_full":"Ballettanz : Europe's leading dance magazine", + "title_fullStr":"Ballettanz : Europe's leading dance magazine", + "title_full_unstemmed":"Ballettanz : Europe's leading dance magazine", + "fullrecord":"04807cas a2201573 4500001001100000003000700011005001700018007000300035008004100038015002100079016002200100016002200122022001400144022001400158029004700172035002100219035002500240040003100265041001300296044001000309082001300319084002500332084002300357245005000380246003000430246001600460246003600476260004200512362001800554363000900572363001200581515002700593591002800620689005500648689002400703689001100727689005800738689002400796689005500820689002400875689001100899751001600910770014500926770011301071770012101184775012401305780014001429785011101569935000901680935001001689935000701699935001101706982002501717969001301742982002501755969001301780982002501793969001301818982002501831969001301856982002501869969001301894982002501907969001301932982002501945969001301970982002501983969001302008982002502021969001302046982002602059969001402085982002602099969001402125982002602139969001402165982002602179969001402205982002602219969001402245982002602259969001402285982002602299969001402325982002602339969001402365983001902379969000802398982002302406984001102429982002302440984001102463982002302474984001102497982002302508984001102531982002302542984001102565982002302576984001102599982002302610984001102633982002502644984001102669982002502680984001102705983001902716984000702735982002902742970000902771982002902780970000902809983001902818970000702837970001802844950001402862950001502876950001102891950001102902950001002913950001202923950002402935950002102959950001602980950001602996950000903012950001603021852003203037852003203069852003303101852003403134852003403168980003103202\u001e0002795235\u001eDE-576\u001e20160708144106.0\u001etu\u001e020122d20022010xx p 0 0ger c\u001e \u001fa02,A08,1253\u001f2dnb\u001e7 \u001fa023045469\u001f2DE-101\u001e7 \u001fa2064947-2\u001f2DE-600\u001e \u001fa0947-0484\u001e \u001fa1612-6890\u001exa\u001fa16126890\u001fcBallettanz (Berlin. Zeitschrift)\u001e \u001fa(OCoLC)225206276\u001e \u001fa(DE-599)ZDB2064947-2\u001e \u001faDE-576\u001fbger\u001fcDE-576\u001ferakwb\u001e \u001fager\u001faeng\u001e \u001faXA-DE\u001e0 \u001fa792\u001fa793\u001e \u001fa100\u001fa490\u001faz475\u001f2zdbs\u001e \u001fa9,3\u001fa9,2\u001fa31\u001f2ssgn\u001e10\u001faBallettanz :\u001fbEurope's leading dance magazine\u001e1 \u001fiNebentitel:\u001faBallett-Tanz\u001e3 \u001faBalletttanz\u001e3 \u001faEurope's leading dance magazine\u001e \u001faBerlin :\u001fbFriedrich-Berlin-Verl.-Ges.\u001e1 \u001fa2002 - 2010,1\u001e00\u001fi2002\u001e10\u001fi2010\u001fb1\u001e \u001faPeriodizität: monatl.\u001e \u001fa(üa/Z) 101a!(04-02-10)\u001e00\u001fds\u001f0(DE-588)4059028-8\u001f0(DE-576)209129018\u001f2gnd\u001faTanz\u001e01\u001faf\u001f2gnd\u001faZeitschrift\u001e0 \u001f5DE-101\u001e10\u001fds\u001f0(DE-588)4004351-4\u001f0(DE-576)208855459\u001f2gnd\u001faBallett\u001e11\u001faf\u001f2gnd\u001faZeitschrift\u001e12\u001fds\u001f0(DE-588)4059028-8\u001f0(DE-576)209129018\u001f2gnd\u001faTanz\u001e13\u001faf\u001f2gnd\u001faZeitschrift\u001e1 \u001f5DE-101\u001e \u001faBerlin\u001f4dbp\u001e08\u001fiBeil.\u001faPiattaforma multimediale della danza contemporanea italiana\u001fd[Roma] : Fondazione, 2002\u001fhCD-ROMs\u001fw(DE-576)111316251\u001fw(DE-600)2143839-0\u001e08\u001fiBeil.\u001faBallettanz. Schools\u001fdBerlin : Friedrich-Berlin-Verl.-Ges., 2003\u001fw(DE-576)11739940X\u001fw(DE-600)2185947-4\u001e08\u001fiJahrbuch\u001faBallettanz. Jahrbuch ...\u001fdBerlin : Friedrich-Berlin-Verl.-Ges., 2002\u001fw(DE-576)101178336\u001fw(DE-600)2087679-8\u001e08\u001fiOnline-Ausg.\u001faBallettanz\u001fdBerlin : Friedrich-Berlin-Verl., 2003\u001fhOnline-Ressource\u001fw(DE-576)321589122\u001fw(DE-600)2547390-6\u001e00\u001fiVorg.\u001faBallett international, Tanz aktuell\u001fdBerlin : Friedrich-Berlin-Verl.-Ges., 1994\u001fx0947-0484\u001fw(DE-576)038873095\u001fw(DE-600)1177998-6\u001e00\u001fiForts.\u001faTanz\u001fdBerlin : Friedrich-Berlin-Verlagsges., 2010\u001fx1869-7720\u001fw(DE-576)317975862\u001fw(DE-600)2536619-1\u001e \u001faSAXB\u001e \u001fbdruck\u001e \u001fcmg\u001e \u001favkfilm\u001e \u001fa(DE-15)7014845755\u001fx1\u001e \u001fbKeine\u001fx1\u001e \u001fa(DE-15)0021408062\u001fx2\u001e \u001fbKeine\u001fx2\u001e \u001fa(DE-15)0021408095\u001fx3\u001e \u001fbKeine\u001fx3\u001e \u001fa(DE-15)0022923247\u001fx4\u001e \u001fbKeine\u001fx4\u001e \u001fa(DE-15)0022923255\u001fx5\u001e \u001fbKeine\u001fx5\u001e \u001fa(DE-15)0022923263\u001fx6\u001e \u001fbKeine\u001fx6\u001e \u001fa(DE-15)0022923271\u001fx7\u001e \u001fbKeine\u001fx7\u001e \u001fa(DE-15)0022923288\u001fx8\u001e \u001fbKeine\u001fx8\u001e \u001fa(DE-15)0022923296\u001fx9\u001e \u001fbKeine\u001fx9\u001e \u001fa(DE-15)0022923302\u001fx10\u001e \u001fbKeine\u001fx10\u001e \u001fa(DE-15)0022923310\u001fx11\u001e \u001fbKeine\u001fx11\u001e \u001fa(DE-15)0022923327\u001fx12\u001e \u001fbKeine\u001fx12\u001e \u001fa(DE-15)0022923335\u001fx13\u001e \u001fbKeine\u001fx13\u001e \u001fa(DE-15)0022923343\u001fx14\u001e \u001fbKeine\u001fx14\u001e \u001fa(DE-15)0022923351\u001fx15\u001e \u001fbKeine\u001fx15\u001e \u001fa(DE-15)0022923368\u001fx16\u001e \u001fbKeine\u001fx16\u001e \u001fa(DE-15)0022923376\u001fx17\u001e \u001fbKeine\u001fx17\u001e \u001fa(DE-15)3227111\u001e \u001fcZSA\u001e \u001fa(DE-14)31487720\u001fx1\u001e \u001fbFH6\u001fx1\u001e \u001fa(DE-14)31569790\u001fx2\u001e \u001fbFH6\u001fx2\u001e \u001fa(DE-14)31569791\u001fx3\u001e \u001fbFH6\u001fx3\u001e \u001fa(DE-14)31798276\u001fx4\u001e \u001fbFH6\u001fx4\u001e \u001fa(DE-14)32170227\u001fx5\u001e \u001fbFH6\u001fx5\u001e \u001fa(DE-14)32172181\u001fx6\u001e \u001fbFH6\u001fx6\u001e \u001fa(DE-14)32911747\u001fx7\u001e \u001fbFH6\u001fx7\u001e \u001fa(DE-14)XNOS059313\u001fx8\u001e \u001fbFH6\u001fx8\u001e \u001fa(DE-14)XNOS062070\u001fx9\u001e \u001fbFH6\u001fx9\u001e \u001fa(DE-14)3532477\u001e \u001fcZS\u001e \u001fa(DE-L152)200079073152\u001fx1\u001e \u001fbK\u001fx1\u001e \u001fa(DE-L152)200468291152\u001fx2\u001e \u001fbK\u001fx2\u001e \u001fa(DE-L152)70424\u001e \u001fcZS\u001e \u001fh2002 - 2010,1\u001e \u001faTanzkunst\u001e \u001faTanzkultur\u001e \u001faTanzen\u001e \u001faTänze\u001e \u001faDance\u001e \u001faDancing\u001e \u001faKlassisches Ballett\u001e \u001faKlassischer Tanz\u001e \u001faBühnentanz\u001e \u001faTheatertanz\u001e \u001faTanz\u001e \u001faTanztheater\u001e \u001faDE-14\u001fz2014-03-16T02:31:59Z\u001e \u001faDE-15\u001fz2013-06-28T08:20:45Z\u001e \u001faDE-540\u001fz2013-06-20T04:10:34Z\u001e \u001faDE-Ka88\u001fz2016-12-06T13:54:35Z\u001e \u001faDE-L152\u001fz2010-02-25T11:32:41Z\u001e \u001fa096434074\u001fb0\u001fc201612051615\u001e\u001d", + "dewey-hundreds":["700 - Arts & recreation"], + "recordtype":"marcfinc", + "publishDateSort":"2002", + "signatur":["(DE-15)01ZB-2013-3:2009", + "(DE-15)01ZB-2013-3:2010", + "(DE-15)01ZB-2013-3:2002,1", + "(DE-15)01ZB-2013-3:2002,2", + "(DE-15)01ZB-2013-3:2003,1", + "(DE-15)01ZB-2013-3:2003,2", + "(DE-15)01ZB-2013-3:2004,1", + "(DE-15)01ZB-2013-3:2004,2", + "(DE-15)01ZB-2013-3:2005,1", + "(DE-15)01ZB-2013-3:2005,2", + "(DE-15)01ZB-2013-3:2006,1", + "(DE-15)01ZB-2013-3:2006,2", + "(DE-15)01ZB-2013-3:2007,1", + "(DE-15)01ZB-2013-3:2007,2", + "(DE-15)01ZB-2013-3:2008,1", + "(DE-15)01ZB-2013-3:2008,2", + "(DE-14)Z. 4. 8283-2007", + "(DE-14)Z. 4. 8283", + "(DE-14)Z. 4. 8283-2005", + "(DE-14)Z. 4. 8283-2004", + "(DE-14)Z. 4. 8283-2006", + "(DE-14)Z. 4. 8283-2009", + "(DE-14)Z. 4. 8283-2008", + "(DE-14)Z. 4. 8283-2010", + "(DE-14)Z. 4. 8283-2002", + "(DE-14)Z. 4. 8283-2003"], + "topic_id":["4059028-8", + "4004351-4"], + "format_ded117":["Journal, E-Journal"], + "title_sub":"Europe's leading dance magazine", + "dewey-full":["792", + "793"], + "title_sort":"ballettanz :europe's leading dance magazine", + "multipart_set":" ", + "format_del189":["Journal"], + "title_short":"Ballettanz :", + "barcode_de15":["7014845755", + "0021408062", + "0021408095", + "0022923247", + "0022923255", + "0022923263", + "0022923271", + "0022923288", + "0022923296", + "0022923302", + "0022923310", + "0022923327", + "0022923335", + "0022923343", + "0022923351", + "0022923368", + "0022923376"], + "marc_error":["org.marc4j.ErrorHandler$Error:Minor Error : Subfield tag is an invalid uppercase character, changing it to lower case. --- [ 689 : D ]", + "org.marc4j.ErrorHandler$Error:Minor Error : Subfield tag is an invalid uppercase character, changing it to lower case. --- [ 689 : A ]", + "org.marc4j.ErrorHandler$Error:Minor Error : Subfield tag is an invalid uppercase character, changing it to lower case. --- [ 689 : D ]", + "org.marc4j.ErrorHandler$Error:Minor Error : Subfield tag is an invalid uppercase character, changing it to lower case. --- [ 689 : A ]", + "org.marc4j.ErrorHandler$Error:Minor Error : Subfield tag is an invalid uppercase character, changing it to lower case. --- [ 689 : D ]", + "org.marc4j.ErrorHandler$Error:Minor Error : Subfield tag is an invalid uppercase character, changing it to lower case. --- [ 689 : A ]"], + "misc_del152":[""], + "record_id":"096434074", + "callnumber_de15":["01ZB-2013-3:2009", + "01ZB-2013-3:2010", + "01ZB-2013-3:2002,1", + "01ZB-2013-3:2002,2", + "01ZB-2013-3:2003,1", + "01ZB-2013-3:2003,2", + "01ZB-2013-3:2004,1", + "01ZB-2013-3:2004,2", + "01ZB-2013-3:2005,1", + "01ZB-2013-3:2005,2", + "01ZB-2013-3:2006,1", + "01ZB-2013-3:2006,2", + "01ZB-2013-3:2007,1", + "01ZB-2013-3:2007,2", + "01ZB-2013-3:2008,1", + "01ZB-2013-3:2008,2"], + "date_de15":"2013-06-28T06:20:45Z", + "title_alt":["Ballett-Tanz", + "Balletttanz", + "Europe's leading dance magazine"], + "title_old":["Ballett international, Tanz aktuell"], + "rvk_facet":["No subject assigned"], + "source_id":"0", + "format_degla1":["Journal"], + "finc_class_facet":["Sport"], + "collcode_de15":["Magazin / Sonstige"], + "_version_":1564493323698176000, + "geogr_code":["not assigned"], + "geogr_code_person":["not assigned"] +} diff --git a/module/finc/tests/phpunit.xml b/module/finc/tests/phpunit.xml new file mode 100644 index 0000000000000000000000000000000000000000..bd716aae1508c2e3ccd169baa8d13fc6b3c95068 --- /dev/null +++ b/module/finc/tests/phpunit.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> + +<phpunit bootstrap="bootstrap.php" + backupGlobals="false"> + + <testsuite name="fincTest"> + <directory>./unit-tests/src</directory> + </testsuite> +</phpunit> diff --git a/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php new file mode 100644 index 0000000000000000000000000000000000000000..7595acb39e52bfd6eef1d674ea3a44c3cc907270 --- /dev/null +++ b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php @@ -0,0 +1,81 @@ +<?php +/** + * PHP version 5 + * + * Copyright (C) Villanova University 2010. + * Copyright (C) project swissbib, University Library Basel, Switzerland + * 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 VuFind + * @package finc + * @author Guenter Hipler <guenter.hipler@unibas.ch> + * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://www.swissbib.org + */ +namespace fincTest\RecordDriver; +use VuFindTest\Unit\TestCase as VuFindTestCase; +use finc\RecordDriver\SolrMarcFinc as SolrMarcFincDriver; +/** + * SolrMarcTestCase + * + * @category VuFind + * @package finc + * @author Guenter Hipler <guenter.hipler@unibas.ch> + * @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 + */ +class SolrMarcFincTestCase extends VuFindTestCase +{ + /** + * SolrMarcDriver + * + * @var SolrMarcFincDriver + */ + protected $driver; + + /** + * Initialize driver with fixture + * + * @param String $file File + * + * @return void + */ + public function initialize($file) + { + if (!$this->driver) { + $this->driver = new SolrMarcFincDriver(); + $fixture = $this->getFixtureData($file); + $this->driver->setRawData($fixture); + } + } + + /** + * Get record fixture + * + * @param String $file File + * + * @return array + */ + protected function getFixtureData($file) + { + return json_decode( + file_get_contents(realpath(FINC_TEST_FIXTURES . '/' . $file)), + true + ); + } +} \ No newline at end of file diff --git a/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcNewerPreviousTest.php b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcNewerPreviousTest.php new file mode 100644 index 0000000000000000000000000000000000000000..9e007bb0eb3fe73869f4bfa8229d6df7f61518a1 --- /dev/null +++ b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcNewerPreviousTest.php @@ -0,0 +1,92 @@ +<?php +/** +* PHP version 5 +* +* Copyright (C) Villanova University 2010. +* 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 VuFind +* @package FincTest +* @author Frank Morgner <morgnerf@ub.uni-leipzig.de> +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License +* @link http://www.swissbib.org +*/ +namespace fincTest\RecordDriver; +/** + * SolrMarcNewerPreviousTest + * + * @category VuFind + * @package FincTest + * @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 + */ +class SolrMarcNewerPreviousTest extends SolrMarcFincTestCase +{ + /** + * Setup + * + * @return void + */ + public function setUp() + { + $this->initialize('misc/0002795235.json'); + } + + /** + * TestNewerTitles + * + * @return void + */ + public function testNewerTitles() + { + $newer = $this->driver->getNewerTitles(false); + $this->assertInternalType('array', $newer); + $this->assertEquals('Tanz', $newer[0]['text']); + $this->assertEquals('Forts.', $newer[0]['pretext']); + $this->assertEquals('317975862', $newer[0]['record_id']); + } + + /** + * TestPreviousTitles + * + * @return void + */ + public function testPreviousTitles() + { + $previous = $this->driver->getPreviousTitles(false); + $this->assertInternalType('array', $previous); + $this->assertEquals( + 'Ballett international, Tanz aktuell', $previous[0]['text'] + ); + $this->assertEquals('Vorg.', $previous[0]['pretext']); + $this->assertEquals('038873095', $previous[0]['record_id']); + } + + /** + * TestGetUniqueId + * + * @return void + * + * @throws \Exception + */ + public function testGetUniqueId() + { + $id = $this->driver->getUniqueID(); + $this->assertEquals('0002795235', $id); + } +} + diff --git a/themes/finc/templates/RecordDriver/SolrMarc/core.phtml b/themes/finc/templates/RecordDriver/SolrMarc/core.phtml index 8ba99ea0b4b5a5a0e5d87d02a9bca163d0cdd1ce..a55476ccdb5dd6c28e773b651468eae25b419bf0 100644 --- a/themes/finc/templates/RecordDriver/SolrMarc/core.phtml +++ b/themes/finc/templates/RecordDriver/SolrMarc/core.phtml @@ -1,391 +1,399 @@ -<!-- recordDriver - solrMarc - 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; ?> - </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; ?> - - <? /* For alle finc-records we want to get rid of trailing special chars in the title and limit its length to 100 chars */ ?> - <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></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('Published in')?>:</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; ?> - - <? /* finc specific rows - Start */ ?> - <? $authors = $this->driver->getDeduplicatedAuthors(); if ((isset($authors['main']) && count($authors['main'])) || (isset($authors['secondary']) && count($authors['secondary'])) || (isset($authors['corporate']) && count($authors['corporate'])) || (isset($authors['corporate_secondary']) && count($authors['corporate_secondary']))): ?> - <tr> - <th><?=$this->transEsc('Authors/Corporations')?>: </th> - <td> - <? if (isset($authors['main']) && count($authors['main'])): ?> - <? $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)?><?=count($authors['main_orig'][$author])?" / ".array_pop($authors['main_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['secondary']) && count($authors['secondary'])): ?> - <?=count($authors['main'])?'; ':''?> - <? $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)?><?=count($authors['secondary_orig'][$author])?" / ".array_pop($authors['secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['corporate']) && count($authors['corporate'])): ?> - <?=count($authors['main'])||count($authors['secondary'])?'; ':''?> - <? $i = 0; foreach ($authors['corporate'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="creator"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_orig'][$author])?" / ".array_pop($authors['corporate_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - <? if (isset($authors['corporate_secondary']) && count($authors['corporate_secondary'])): ?> - <?=count($authors['main'])||count($authors['secondary'])||count($authors['corporate'])?'; ':''?> - <? $i = 0; foreach ($authors['corporate_secondary'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_secondary_orig'][$author])?" / ".array_pop($authors['corporate_secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> - <? endif; ?> - </td> - </tr> - <? endif; ?> - - <? $titleDetails = $this->driver->getTitleDetails(); if (!empty($titleDetails)): ?> - <tr> - <th><?=$this->transEsc('Title')?>: </th> - <td property="title"> - <? $i = 0; foreach ($titleDetails as $title): ?> - <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> - <? endforeach; ?> - </td> - </tr> - <? else: ?> - <tr> - <th><?=$this->transEsc('Title')?>: </th> - <td property="title"><?=$this->escapeHtml($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection()) . ($this->driver->getTitleStatement() ? ' / ' . $this->driver->getTitleStatement() : '')?><br /><?=($this->driver->tryMethod('getTitleOrig') && $this->driver->getTitleOrig() != '' ? $this->escapeHtml($this->driver->getTitleOrig()) : '')?></td> - </tr> - <? endif; ?> - - <? /* finc only SolrMarc core specific changes - Start */ ?> - <? $workPartTitleDetails = $this->driver->tryMethod('getWorkPartTitleDetails'); if (!empty($workPartTitleDetails)): ?> - <tr> - <th><?=$this->transEsc('Work Part Title')?>: </th> - <td property="work part title"> - <? $i = 0; foreach ($workPartTitleDetails as $title): ?> - <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $workTitleDetails = $this->driver->tryMethod('getWorkTitleDetails'); if (!empty($workTitleDetails)): ?> - <tr> - <th><?=$this->transEsc('Work Title')?>: </th> - <td property="work title"> - <? $i = 0; foreach ($workTitleDetails as $title): ?> - <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc only SolrMarc core specific changes - End */ ?> - - <? $titleUniform = $this->driver->getTitleUniform(); ?> - <? if (!empty($titleUniform)): ?> - <tr> - <th><?=$this->driver->isRDA()?$this->transEsc('rda_original_title'):$this->transEsc('non_rda_original_title')?>: </th> - <td><a href="<?=$this->record($this->driver)->getLink('title', $titleUniform)?>"><?=$this->escapeHtml($titleUniform)?></a></td> - </tr> - <? endif; ?> - - <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> - <tr> - <th><?=$this->transEsc('Edition')?>: </th> - <td property="bookEdition"><?=$this->escapeHtml($edition)?><? $editionOrig = $this->driver->getEditionOrig(); if (!empty($editionOrig)): ?><br /><?=$this->escapeHtml($editionOrig)?><? endif; ?></td> - </tr> - <? endif; ?> - - <? $dissertationNote = $this->driver->getDissertationNote(); if (!empty($dissertationNote)): ?> - <tr> - <th><?=$this->transEsc('Dissertation Note')?>: </th> - <td><?=$dissertationNote?></td> - </tr> - <? endif; ?> - <? /* finc specific rows - END */ ?> - - <? $formats = $this->driver->getFormats(); if (!empty($formats)): ?> - <tr> - <th><?=$this->transEsc('Format')?>: </th> - <td><?=$this->record($this->driver)->getFormatList()?></td> - </tr> - <? endif; ?> - - <? $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; ?> - - <? - $publications = $this->driver->getPublicationDetails(); - $pubDateSort = $this->driver->getPublishDateSort(); - if (!empty($publications)): ?> - <tr> - <th><?=$this->transEsc('Published')?>: </th> - <td> - <? foreach ($publications as $field): ?> - <span property="publisher" itemtype="http://schema.org/Organization"> - <? $pubPlace = $field->getPlace(); if (!empty($pubPlace)): ?> - <span itemprop="location"><?=$this->escapeHtml($pubPlace)?></span> - <? endif; ?> - <? $pubName = $field->getName(); if (!empty($pubName)): ?> - <span itemprop="name"><?=$this->escapeHtml($pubName)?></span> - <? endif; ?> - </span> - <? $pubDate = $field->getDate(); if (!empty($pubDateSort)): ?> - <span property="datePublished"><?=$this->escapeHtml($pubDateSort)?></span> - <? elseif (!empty($pubDate)): ?> - <span property="datePublished"><?=$this->escapeHtml($pubDate)?></span> - <? endif; ?> - <br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $germanPrintsIndexNumber = $this->driver->getIndexOfGermanPrints(); if (!empty($germanPrintsIndexNumber)): ?> - <tr> - <th><?=$this->transEsc('German Prints Index Number')?>: </th> - <td property="germanPrintsIndexNumber"><?=$this->escapeHtml($germanPrintsIndexNumber[0])?></td> - </tr> - <? endif; ?> - - <? /* finc specific row - replaces series - Start */ ?> - <? $hierarchyParentTitle = $this->driver->getHierarchyParentTitle(); if (!empty($hierarchyParentTitle) && empty($series)): ?> - <tr> - <th><?=$this->transEsc('Set Multipart')?>: </th> - <td> - <? $hierarchyParentId = $this->driver->getHierarchyParentID(); ?> - <? foreach ($hierarchyParentTitle as $key=>$hTitle): ?> - <? if(isset($hierarchyParentId[$key])): ?><a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key])?>"><? endif; ?><?=$this->escapeHtml($hTitle)?><? if(isset($hierarchyParentId[$key])): ?></a><? endif; ?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc specific row - replaces series - End */ ?> - - <? $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; ?> - - <? /* finc specific rows - Start */ ?> - <? $subjects = $this->driver->getLocalSubject(); if (!empty($subjects)): ?> - <tr> - <th><?=$this->transEsc('Subjects')?>: </th> - <td> - <? $i = 0; foreach ($subjects as $field): ?> - <?=($i++ == 0) ? '' : ', '?> - <a title="<?=$this->escapeHtmlAttr($field)?>" href="<?=$this->record($this->driver)->getLink('subject', $field)?>" rel="nofollow"><?=trim($this->escapeHtml($field))?></a> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $megaCollection = (array) $this->driver->tryMethod('getMegaCollection'); if (!empty($megaCollection)): ?> - <tr> - <th><?=$this->transEsc('Source')?>: </th> - <td> - <? foreach ($megaCollection as $field): ?> - <?=$this->escapeHtml($field)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - - <? $otherRelationshipEntry = (array) $this->driver->tryMethod('getOtherRelationshipEntry'); if (!empty($otherRelationshipEntry)): ?> - <? foreach ($otherRelationshipEntry as $key => $values): ?> - <tr> - <th><?=$this->transEsc($key)?>: </th> - <td> - <? foreach ($values as $value): ?> - <? if (!empty($value['link']) && $recordLink = $this->RecordLink()->getRecordLink($value['link'], 'record_id')): ?> - <a href="<?=$recordLink?>"><?=$this->escapeHtml($value['text'])?></a><br/> - <? else: ?> - <?=$this->escapeHtml($value['text'])?><br/> - <? endif; ?> - <? endforeach; ?> - </td> - </tr> - <? endforeach; ?> - <? endif; ?> - - <? $additionalNotes = (array) $this->driver->tryMethod('getAdditionalNotes'); if (!empty($additionalNotes)): ?> - <tr> - <th><?=$this->transEsc('Notes')?>: </th> - <td> - <? foreach ($additionalNotes as $note): ?> - <?=$this->escapeHtml($note)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? /* finc specific rows - End */ ?> - </table> - <?/* End Main Details */?> - </div> -</div> +<!-- recordDriver - solrMarc - 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; ?> + </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; ?> + + <? /* For alle finc-records we want to get rid of trailing special chars in the title and limit its length to 100 chars */ ?> + <h3 property="name"><?=$this->escapeHtml(preg_replace('/(\s[\/\.:]\s*)*$/', '', $this->truncate($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection(), 100)))?></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('Published in')?>:</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): ?> + <? if (!empty($field['record_id']) && $recordLink = $this->RecordLink()->getRecordLink($field['record_id'], 'record_id')): ?> + <?=$this->escapeHtml($field['pretext'])?> <a href="<?=$recordLink;?>"><?=$this->escapeHtml($field['text'])?></a><br/> + <? else: ?> + <?=$this->escapeHtml($field['pretext'])?> <a href="<?=$this->record($this->driver)->getLink('title', $field['text'])?>"><?=$this->escapeHtml($field['text'])?></a><br/> + <? endif; ?> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? if (!empty($prevTitles)): ?> + <tr> + <th><?=$this->transEsc('Previous Title')?>: </th> + <td> + <? foreach($prevTitles as $field): ?> + <? if (!empty($field['record_id']) && $recordLink = $this->RecordLink()->getRecordLink($field['record_id'], 'record_id')): ?> + <?=$this->escapeHtml($field['pretext'])?> <a href="<?=$recordLink;?>"><?=$this->escapeHtml($field['text'])?></a><br/> + <? else: ?> + <?=$this->escapeHtml($field['pretext'])?> <a href="<?=$this->record($this->driver)->getLink('title', $field['text'])?>"><?=$this->escapeHtml($field['text'])?></a><br/> + <? endif; ?> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? /* finc specific rows - Start */ ?> + <? $authors = $this->driver->getDeduplicatedAuthors(); if ((isset($authors['main']) && count($authors['main'])) || (isset($authors['secondary']) && count($authors['secondary'])) || (isset($authors['corporate']) && count($authors['corporate'])) || (isset($authors['corporate_secondary']) && count($authors['corporate_secondary']))): ?> + <tr> + <th><?=$this->transEsc('Authors/Corporations')?>: </th> + <td> + <? if (isset($authors['main']) && count($authors['main'])): ?> + <? $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)?><?=count($authors['main_orig'][$author])?" / ".array_pop($authors['main_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> + <? endif; ?> + <? if (isset($authors['secondary']) && count($authors['secondary'])): ?> + <?=count($authors['main'])?'; ':''?> + <? $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)?><?=count($authors['secondary_orig'][$author])?" / ".array_pop($authors['secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> + <? endif; ?> + <? if (isset($authors['corporate']) && count($authors['corporate'])): ?> + <?=count($authors['main'])||count($authors['secondary'])?'; ':''?> + <? $i = 0; foreach ($authors['corporate'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="creator"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_orig'][$author])?" / ".array_pop($authors['corporate_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> + <? endif; ?> + <? if (isset($authors['corporate_secondary']) && count($authors['corporate_secondary'])): ?> + <?=count($authors['main'])||count($authors['secondary'])||count($authors['corporate'])?'; ':''?> + <? $i = 0; foreach ($authors['corporate_secondary'] as $author => $roles): ?><?=($i++ == 0)?'':'; '?><span property="contributor"><a href="<?=$this->record($this->driver)->getLink('author', $author)?>"><?=$this->escapeHtml($author)?><?=count($authors['corporate_secondary_orig'][$author])?" / ".array_pop($authors['corporate_secondary_orig'][$author]):''?></a><? if (count($roles) > 0): ?> (<? $j = 0; foreach ($roles as $role): ?><?=($j++ == 0)?'':', '?><?=$this->transEsc("CreatorRoles::" . $role)?><? endforeach; ?>)<? endif; ?></span><? endforeach; ?> + <? endif; ?> + </td> + </tr> + <? endif; ?> + + <? $titleDetails = $this->driver->getTitleDetails(); if (!empty($titleDetails)): ?> + <tr> + <th><?=$this->transEsc('Title')?>: </th> + <td property="title"> + <? $i = 0; foreach ($titleDetails as $title): ?> + <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> + <? endforeach; ?> + </td> + </tr> + <? else: ?> + <tr> + <th><?=$this->transEsc('Title')?>: </th> + <td property="title"><?=$this->escapeHtml($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection()) . ($this->driver->getTitleStatement() ? ' / ' . $this->driver->getTitleStatement() : '')?><br /><?=($this->driver->tryMethod('getTitleOrig') && $this->driver->getTitleOrig() != '' ? $this->escapeHtml($this->driver->getTitleOrig()) : '')?></td> + </tr> + <? endif; ?> + + <? /* finc only SolrMarc core specific changes - Start */ ?> + <? $workPartTitleDetails = $this->driver->tryMethod('getWorkPartTitleDetails'); if (!empty($workPartTitleDetails)): ?> + <tr> + <th><?=$this->transEsc('Work Part Title')?>: </th> + <td property="work part title"> + <? $i = 0; foreach ($workPartTitleDetails as $title): ?> + <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $workTitleDetails = $this->driver->tryMethod('getWorkTitleDetails'); if (!empty($workTitleDetails)): ?> + <tr> + <th><?=$this->transEsc('Work Title')?>: </th> + <td property="work title"> + <? $i = 0; foreach ($workTitleDetails as $title): ?> + <?=($i > 0 ? '<br />':'')?><?=$this->escapeHtml($title)?><? $i++ ;?> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + <? /* finc only SolrMarc core specific changes - End */ ?> + + <? $titleUniform = $this->driver->getTitleUniform(); ?> + <? if (!empty($titleUniform)): ?> + <tr> + <th><?=$this->driver->isRDA()?$this->transEsc('rda_original_title'):$this->transEsc('non_rda_original_title')?>: </th> + <td><a href="<?=$this->record($this->driver)->getLink('title', $titleUniform)?>"><?=$this->escapeHtml($titleUniform)?></a></td> + </tr> + <? endif; ?> + + <? $edition = $this->driver->getEdition(); if (!empty($edition)): ?> + <tr> + <th><?=$this->transEsc('Edition')?>: </th> + <td property="bookEdition"><?=$this->escapeHtml($edition)?><? $editionOrig = $this->driver->getEditionOrig(); if (!empty($editionOrig)): ?><br /><?=$this->escapeHtml($editionOrig)?><? endif; ?></td> + </tr> + <? endif; ?> + + <? $dissertationNote = $this->driver->getDissertationNote(); if (!empty($dissertationNote)): ?> + <tr> + <th><?=$this->transEsc('Dissertation Note')?>: </th> + <td><?=$dissertationNote?></td> + </tr> + <? endif; ?> + <? /* finc specific rows - END */ ?> + + <? $formats = $this->driver->getFormats(); if (!empty($formats)): ?> + <tr> + <th><?=$this->transEsc('Format')?>: </th> + <td><?=$this->record($this->driver)->getFormatList()?></td> + </tr> + <? endif; ?> + + <? $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; ?> + + <? + $publications = $this->driver->getPublicationDetails(); + $pubDateSort = $this->driver->getPublishDateSort(); + if (!empty($publications)): ?> + <tr> + <th><?=$this->transEsc('Published')?>: </th> + <td> + <? foreach ($publications as $field): ?> + <span property="publisher" itemtype="http://schema.org/Organization"> + <? $pubPlace = $field->getPlace(); if (!empty($pubPlace)): ?> + <span itemprop="location"><?=$this->escapeHtml($pubPlace)?></span> + <? endif; ?> + <? $pubName = $field->getName(); if (!empty($pubName)): ?> + <span itemprop="name"><?=$this->escapeHtml($pubName)?></span> + <? endif; ?> + </span> + <? $pubDate = $field->getDate(); if (!empty($pubDateSort)): ?> + <span property="datePublished"><?=$this->escapeHtml($pubDateSort)?></span> + <? elseif (!empty($pubDate)): ?> + <span property="datePublished"><?=$this->escapeHtml($pubDate)?></span> + <? endif; ?> + <br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $germanPrintsIndexNumber = $this->driver->getIndexOfGermanPrints(); if (!empty($germanPrintsIndexNumber)): ?> + <tr> + <th><?=$this->transEsc('German Prints Index Number')?>: </th> + <td property="germanPrintsIndexNumber"><?=$this->escapeHtml($germanPrintsIndexNumber[0])?></td> + </tr> + <? endif; ?> + + <? /* finc specific row - replaces series - Start */ ?> + <? $hierarchyParentTitle = $this->driver->getHierarchyParentTitle(); if (!empty($hierarchyParentTitle) && empty($series)): ?> + <tr> + <th><?=$this->transEsc('Set Multipart')?>: </th> + <td> + <? $hierarchyParentId = $this->driver->getHierarchyParentID(); ?> + <? foreach ($hierarchyParentTitle as $key=>$hTitle): ?> + <? if(isset($hierarchyParentId[$key])): ?><a href="<?=$this->recordLink()->getUrl($hierarchyParentId[$key])?>"><? endif; ?><?=$this->escapeHtml($hTitle)?><? if(isset($hierarchyParentId[$key])): ?></a><? endif; ?><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + <? /* finc specific row - replaces series - End */ ?> + + <? $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; ?> + + <? /* finc specific rows - Start */ ?> + <? $subjects = $this->driver->getLocalSubject(); if (!empty($subjects)): ?> + <tr> + <th><?=$this->transEsc('Subjects')?>: </th> + <td> + <? $i = 0; foreach ($subjects as $field): ?> + <?=($i++ == 0) ? '' : ', '?> + <a title="<?=$this->escapeHtmlAttr($field)?>" href="<?=$this->record($this->driver)->getLink('subject', $field)?>" rel="nofollow"><?=trim($this->escapeHtml($field))?></a> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $megaCollection = (array) $this->driver->tryMethod('getMegaCollection'); if (!empty($megaCollection)): ?> + <tr> + <th><?=$this->transEsc('Source')?>: </th> + <td> + <? foreach ($megaCollection as $field): ?> + <?=$this->escapeHtml($field)?><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + + <? $otherRelationshipEntry = (array) $this->driver->tryMethod('getOtherRelationshipEntry'); if (!empty($otherRelationshipEntry)): ?> + <? foreach ($otherRelationshipEntry as $key => $values): ?> + <tr> + <th><?=$this->transEsc($key)?>: </th> + <td> + <? foreach ($values as $value): ?> + <? if (!empty($value['link']) && $recordLink = $this->RecordLink()->getRecordLink($value['link'], 'record_id')): ?> + <a href="<?=$recordLink?>"><?=$this->escapeHtml($value['text'])?></a><br/> + <? else: ?> + <?=$this->escapeHtml($value['text'])?><br/> + <? endif; ?> + <? endforeach; ?> + </td> + </tr> + <? endforeach; ?> + <? endif; ?> + + <? $additionalNotes = (array) $this->driver->tryMethod('getAdditionalNotes'); if (!empty($additionalNotes)): ?> + <tr> + <th><?=$this->transEsc('Notes')?>: </th> + <td> + <? foreach ($additionalNotes as $note): ?> + <?=$this->escapeHtml($note)?><br/> + <? endforeach; ?> + </td> + </tr> + <? endif; ?> + <? /* finc specific rows - End */ ?> + </table> + <?/* End Main Details */?> + </div> +</div> <!-- recordDriver - solrMarc - CORE.phtml end --> \ No newline at end of file