Browse Source

Merge pull request #603 from albig/fix-559

Show all subparts in collection view
pull/605/head
Alexander Bigga 4 months ago
committed by GitHub
parent
commit
17bd286ba1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions
  1. +8
    -2
      Classes/Common/Document.php
  2. +1
    -0
      Classes/Common/MetsDocument.php
  3. +2
    -1
      Classes/Plugin/Collection.php

+ 8
- 2
Classes/Common/Document.php View File

@@ -1169,16 +1169,21 @@ abstract class Document
$metadata['volume'] = $metadata['year'];
}
if (empty($metadata['volume_sorting'][0])) {
if (!empty($metadata['year_sorting'][0])) {
// If METS @ORDER is given it is preferred over year_sorting and year.
if (!empty($metadata['mets_order'][0])) {
$metadata['volume_sorting'][0] = $metadata['mets_order'][0];
} elseif (!empty($metadata['year_sorting'][0])) {
$metadata['volume_sorting'][0] = $metadata['year_sorting'][0];
} elseif (!empty($metadata['year'][0])) {
$metadata['volume_sorting'][0] = $metadata['year'][0];
}
}
// If volume_sorting is still empty, try to use title_sorting finally (workaround for newspapers)
// If volume_sorting is still empty, try to use title_sorting or METS @ORDERLABEL finally (workaround for newspapers)
if (empty($metadata['volume_sorting'][0])) {
if (!empty($metadata['title_sorting'][0])) {
$metadata['volume_sorting'][0] = $metadata['title_sorting'][0];
} elseif (!empty($metadata['mets_orderlabel'][0])) {
$metadata['volume_sorting'][0] = $metadata['mets_orderlabel'][0];
}
}
}
@@ -1249,6 +1254,7 @@ abstract class Document
'collections' => $metadata['collection'],
'mets_label' => $metadata['mets_label'][0],
'mets_orderlabel' => $metadata['mets_orderlabel'][0],
'mets_order' => $metadata['mets_order'][0],
'owner' => $metadata['owner'][0],
'solrcore' => $core,
'status' => 0,


+ 1
- 0
Classes/Common/MetsDocument.php View File

@@ -131,6 +131,7 @@ final class MetsDocument extends Document
{
$details = $this->getLogicalStructure($id);
if (!empty($details)) {
$metadata['mets_order'][0] = $details['order'];
$metadata['mets_label'][0] = $details['label'];
$metadata['mets_orderlabel'][0] = $details['orderlabel'];
}


+ 2
- 1
Classes/Plugin/Collection.php View File

@@ -403,7 +403,8 @@ class Collection extends \Kitodo\Dlf\Common\AbstractPlugin
'p' => []
];
} else {
$subparts[$resArray['partof']][$resArray['volume_sorting']] = [
// volume_sorting should be always set - but it's not a required field. We append the uid to the array key to make it always unique.
$subparts[$resArray['partof']][$resArray['volume_sorting'] . str_pad($resArray['uid'], 9, '0', STR_PAD_LEFT)] = [
'u' => $resArray['uid'],
'h' => '',
's' => $sorting,


Loading…
Cancel
Save