diff --git a/local/languages/finna/en-gb.ini b/local/languages/finna/en-gb.ini index 23e3b9c1915..329c62a285b 100644 --- a/local/languages/finna/en-gb.ini +++ b/local/languages/finna/en-gb.ini @@ -89,6 +89,7 @@ Appraisal = "Appraisal" Archive = "Archive" archive_authors = "Authors" Archive Citation = "Archive Citation" +Archive Content = "Archive Content" Archive File = "Archive Item" Archive Films = "Archive Material" Archive Origination = "Records Creator" @@ -397,7 +398,8 @@ Film Festivals = "Attended Film Festivals" Filming Date = "Filming date" Filming Location Notes = "Location notes" Filming Locations = "Locations" -Filter Collection = "Filter collection" +Filter Archive = "Filter Archive" +Filter Collection = "Filter Collection" filter_by_geo_location = "Limit by map location" Filters = "Filters" fine_type = "Type" diff --git a/local/languages/finna/fi.ini b/local/languages/finna/fi.ini index aa5c339cf85..89c07ae24ad 100644 --- a/local/languages/finna/fi.ini +++ b/local/languages/finna/fi.ini @@ -81,6 +81,7 @@ Appraisal = "Arvonmääritys" Archive = "Kuuluu arkistoon" archive_authors = "Tekijät" Archive Citation = "Arkistoviite" +Archive Content = "Arkiston sisältö" Archive File = "Kuuluu arkistoyksikköön" Archive Films = "Arkistoaineisto" Archive Origination = "Arkistonmuodostaja" @@ -386,6 +387,7 @@ field_info_other_language_alt_labels = "Kieliversiot" Field of Activity = "Toimiala" Filing Unit = "Säilytysyksikkö" Fill mandatory fields = "Täytä pakolliset tiedot" +Filter Archive = "Rajaa arkiston sisältöä" Filter Collection = "Rajaa kokoelman sisältöä" filter_by_geo_location = "Rajaa karttasijainnilla" Filters = "Rajaukset" @@ -1242,6 +1244,7 @@ verification_email_sent = "Ohjeet sähköpostiosoitteen vahvistamiseksi on lähe verification_email_subject = "Sähköpostiosoitteen vahvistaminen" verification_email_url_pretext = "Voit vahvistaa uuden sähköpostiosoitteesi seuraavassa osoitteessa: <%%url%%>. Klikkaa linkkiä vain, jos olet lisäämässä tai vaihtamassa sähköpostiosoitettasi." View Book Bag = "Näytä kori" +View Full Archive = "Näytä koko arkisto" widen_prefix_info = "Tämä haku on kohdennettu tiettyyn kenttään." With the search you can find = "Haulla löydät" work_expressions_title = "Muut versiot" diff --git a/local/languages/finna/sv.ini b/local/languages/finna/sv.ini index e564be0b834..429d770d811 100644 --- a/local/languages/finna/sv.ini +++ b/local/languages/finna/sv.ini @@ -83,6 +83,7 @@ Appraisal = "Informationsvärdering" Archive = "Arkiv" archive_authors = "Skapare" Archive Citation = "Arkivreferens" +Archive Content = "Arkivets innehåll" Archive File = "Arkivenhet" Archive Films = "Arkivmaterial" Archive Origination = "Arkivbildare" @@ -388,6 +389,7 @@ Film Festivals = "Deltagande i filmfestivaler" Filming Date = "Inspelningsdatum" Filming Location Notes = "Anmärkningar om inspelningsplatser" Filming Locations = "Inspelningsplatser" +Filter Archive = "Begränsä arkivet" Filter Collection = "Begränsa samlingen" filter_by_geo_location = "Begränsa med kartposition" Filters = "Begränsningar" diff --git a/module/Finna/src/Finna/RecordDriver/SolrEad3.php b/module/Finna/src/Finna/RecordDriver/SolrEad3.php index daa11bf01e4..e590b813ce0 100644 --- a/module/Finna/src/Finna/RecordDriver/SolrEad3.php +++ b/module/Finna/src/Finna/RecordDriver/SolrEad3.php @@ -182,6 +182,22 @@ class SolrEad3 extends SolrEad 'video/quicktime', ]; + /** + * Get archive type + * + * @return string + */ + public function getArchiveType(): string + { + $xml = $this->getXmlRecord(); + if ($type = $xml->{'add-data'}->archive->attributes()->type ?? '') { + if (trim((string)$type) === 'collection') { + return 'collection'; + } + } + return 'archive'; + } + /** * Get the institutions holding the record. * diff --git a/module/Finna/src/Finna/RecordDriver/SolrLido.php b/module/Finna/src/Finna/RecordDriver/SolrLido.php index 88e9cdfbfbf..1919fe44153 100644 --- a/module/Finna/src/Finna/RecordDriver/SolrLido.php +++ b/module/Finna/src/Finna/RecordDriver/SolrLido.php @@ -1227,6 +1227,16 @@ public function getCollections() return $this->getAllLanguageSpecificItems($results, $this->getLocale()); } + /** + * Get archive type + * + * @return string + */ + public function getArchiveType(): string + { + return 'collection'; + } + /** * Get an array of events for the record. * diff --git a/module/Finna/src/Finna/RecordTab/CollectionHierarchyTree.php b/module/Finna/src/Finna/RecordTab/CollectionHierarchyTree.php index b34ee2d8fe9..15ae7adfd9a 100644 --- a/module/Finna/src/Finna/RecordTab/CollectionHierarchyTree.php +++ b/module/Finna/src/Finna/RecordTab/CollectionHierarchyTree.php @@ -47,7 +47,7 @@ class CollectionHierarchyTree extends \VuFind\RecordTab\CollectionHierarchyTree */ public function getDescription() { - return $this->getRecordDriver() instanceof \Finna\RecordDriver\SolrEad - ? 'hierarchy_tree_archive' : 'hierarchy_tree_collection'; + return $this->driver->tryMethod('getArchiveType') === 'collection' + ? 'hierarchy_tree_collection' : 'hierarchy_tree_archive'; } } diff --git a/module/Finna/src/Finna/RecordTab/CollectionList.php b/module/Finna/src/Finna/RecordTab/CollectionList.php index b23aa8a50db..5044d791596 100644 --- a/module/Finna/src/Finna/RecordTab/CollectionList.php +++ b/module/Finna/src/Finna/RecordTab/CollectionList.php @@ -51,4 +51,15 @@ public function isActive() $driver = $this->getRecordDriver(); return $driver->tryMethod('isCollection') || $driver->tryMethod('getContainingCollections'); } + + /** + * Get the on-screen description for this tab. + * + * @return string + */ + public function getDescription() + { + return $this->driver->tryMethod('getArchiveType') === 'collection' + ? 'Collection Items' : 'Archive Content'; + } } diff --git a/module/Finna/src/Finna/RecordTab/HierarchyTree.php b/module/Finna/src/Finna/RecordTab/HierarchyTree.php index 1db0a30331c..a35bef60e0c 100644 --- a/module/Finna/src/Finna/RecordTab/HierarchyTree.php +++ b/module/Finna/src/Finna/RecordTab/HierarchyTree.php @@ -47,7 +47,7 @@ class HierarchyTree extends \VuFind\RecordTab\HierarchyTree */ public function getDescription() { - return $this->getRecordDriver() instanceof \Finna\RecordDriver\SolrEad - ? 'hierarchy_tree_archive' : 'hierarchy_tree_collection'; + return $this->driver->tryMethod('getArchiveType') === 'collection' + ? 'hierarchy_tree_collection' : 'hierarchy_tree_archive'; } } diff --git a/module/Finna/src/Finna/View/Helper/Root/RecordDataFormatterFactory.php b/module/Finna/src/Finna/View/Helper/Root/RecordDataFormatterFactory.php index 0f89b28254c..7478a96ae31 100644 --- a/module/Finna/src/Finna/View/Helper/Root/RecordDataFormatterFactory.php +++ b/module/Finna/src/Finna/View/Helper/Root/RecordDataFormatterFactory.php @@ -404,7 +404,11 @@ protected function getDefaultCoreFields() 'getOriginationExtended', 'data-origination.phtml', [ - 'context' => ['class' => 'record-origination'], + 'context' => ['class' => 'record-origination',], + 'labelFunction' => function ($data, $driver) { + return $driver->tryMethod('getArchiveType') === 'collection' + ? 'CreatorRoles::rda:collector' : 'Archive Origination'; + }, ] ); $setTemplateLine( @@ -413,6 +417,10 @@ protected function getDefaultCoreFields() 'data-hierarchyLinks.phtml', [ 'context' => ['class' => 'recordHierarchyLinks'], + 'labelFunction' => function ($data, $driver) { + return $driver->tryMethod('getArchiveType') === 'collection' + ? 'Parent Collection' : 'Parent Archive'; + }, ] ); $setTemplateLine( diff --git a/themes/finna2/templates/Recommend/CollectionSideFacets.phtml b/themes/finna2/templates/Recommend/CollectionSideFacets.phtml index 0d423f417dc..df1654a1fca 100644 --- a/themes/finna2/templates/Recommend/CollectionSideFacets.phtml +++ b/themes/finna2/templates/Recommend/CollectionSideFacets.phtml @@ -1,6 +1,7 @@ slot('side-facet-caption')->set('Filter Collection'); + $title = $this->driver->tryMethod('getArchiveType') === 'collection' ? 'Filter Collection' : 'Filter Archive'; + $this->slot('side-facet-caption')->set($title); ?> baseUriExtra = $this->recommend->getResults()->getParams()->getCollectionId(); ?> render('Recommend/SideFacets.phtml')?> diff --git a/themes/finna2/templates/RecordDriver/DefaultRecord/collection-record.phtml b/themes/finna2/templates/RecordDriver/DefaultRecord/collection-record.phtml new file mode 100644 index 00000000000..fdc2721aa24 --- /dev/null +++ b/themes/finna2/templates/RecordDriver/DefaultRecord/collection-record.phtml @@ -0,0 +1,21 @@ +driver->isCollection()) { + $linkText = $this->driver->tryMethod('getArchiveType') === 'collection' ? 'View Full Collection' : 'View Full Archive'; + } else { + $linkText = 'View Full Record'; + } +?> +

escapeHtml($this->driver->getShortTitle() . ' ' . $this->driver->getSubtitle() . ' ' . $this->driver->getTitleSection())?>

+ + transEsc($linkText)?> + + +record($this->driver)->renderTemplate( + 'core-fields.phtml', + [ + 'driver' => $this->driver, + 'defaults' => 'collection-record', + ] + ); +?> diff --git a/themes/finna2/templates/RecordDriver/DefaultRecord/result-compact.phtml b/themes/finna2/templates/RecordDriver/DefaultRecord/result-compact.phtml index 3e9ecc0c72e..32ae4cb9472 100644 --- a/themes/finna2/templates/RecordDriver/DefaultRecord/result-compact.phtml +++ b/themes/finna2/templates/RecordDriver/DefaultRecord/result-compact.phtml @@ -97,8 +97,9 @@ diff --git a/themes/finna2/templates/RecordDriver/SolrEad/result-condensed.phtml b/themes/finna2/templates/RecordDriver/SolrEad/result-condensed.phtml index b5a3a46c119..3e51582c66c 100644 --- a/themes/finna2/templates/RecordDriver/SolrEad/result-condensed.phtml +++ b/themes/finna2/templates/RecordDriver/SolrEad/result-condensed.phtml @@ -4,6 +4,7 @@ $img = $this->recordImage($this->record($this->driver)); $thumbnail = false; $thumbnailAlignment = $this->record($this->driver)->getThumbnailAlignment('result'); + $typeIsArchive = $this->driver->tryMethod('getArchiveType') !== 'collection'; if ($img): ob_start(); ?> render('list', ['small' => ['w' => 100, 'h' => 100], 'medium' => ['w' => 250, 'h' => 250]]) ?> @@ -55,9 +56,10 @@ @@ -79,7 +81,7 @@
driver->tryMethod('getOriginations', [], $this->driver->getOrigination())): $originations = (array)$originations; ?> - transEsc('Archive Origination')?>: + transEsc($typeIsArchive ? 'Archive Origination' : 'CreatorRoles::rda:collector')?>: $origination): ?> 0 ? ' ; ' : ''?>escapeHtml($origination)?> @@ -95,7 +97,7 @@ $topTitles = $this->driver->getHierarchyParentTitle(); ?> 0) : ?> - transEsc('Archive')?>: + transEsc($typeIsArchive ? 'Archive' : 'Parent Collection')?>: $parentId): ?> ">truncate($topTitles[$index], 180) : ''?> diff --git a/themes/finna2/templates/RecordDriver/SolrEad/result-list.phtml b/themes/finna2/templates/RecordDriver/SolrEad/result-list.phtml index 374286b6174..4ac561c3739 100644 --- a/themes/finna2/templates/RecordDriver/SolrEad/result-list.phtml +++ b/themes/finna2/templates/RecordDriver/SolrEad/result-list.phtml @@ -6,6 +6,7 @@ $thumbnailAlignment = $this->record($this->driver)->getThumbnailAlignment('result'); $recordLinker = $this->recordLinker($this->results); $coverDetails = $this->record($this->driver)->getCoverDetails('result-list', 'medium', $recordLinker->getUrl($this->driver)); + $typeIsArchive = $this->driver->tryMethod('getArchiveType') !== 'collection'; if ($img): ob_start(); ?> render('list', ['small' => ['w' => 100, 'h' => 100], 'medium' => ['w' => 250, 'h' => 250]]) ?> @@ -66,7 +67,7 @@ if ($img): translationEmpty('Archive Repository')): ?>transEsc('Archive Repository')?>: escapeHtml($this->organisationDisplayName($this->driver)) ?> driver->tryMethod('getOriginationExtended', [])): ?> -
transEsc('Archive Origination')?>: +
transEsc($typeIsArchive ? 'Archive Origination' : 'CreatorRoles::rda:collector')?>: $origination): ?> 0 ? ' ; ' : ''?> record($this->driver)->getLinkedFieldElement('author', $origination['name'], $origination, ['authorityType' => $origination['type'] ?? null, 'description' => false])?> @@ -82,7 +83,7 @@ if ($img): $topTitles = $this->driver->getHierarchyParentTitle(); ?> driver->isCollection()): ?> -
transEsc('Archive')?>: +
transEsc($typeIsArchive ? 'Archive' : 'Parent Collection')?>: $parentId): ?> ">truncate($topTitles[$index], 180) : ''?> @@ -137,9 +138,10 @@ if ($img):