Skip to content
Snippets Groups Projects
Commit 25b90049 authored by Robert Lange's avatar Robert Lange Committed by Dorian Merz
Browse files

refs #18023 [finc] add punctuation for solr marc publication details object

* new method in SolrMarcFincTrait to check for leader 18 a or i = no punctuation needed
* use publicationDetailsImprint of MultiDataFieldsTrait as finc standard, copied from de_15
parent da508e0e
No related merge requests found
...@@ -2428,6 +2428,17 @@ trait SolrMarcFincTrait ...@@ -2428,6 +2428,17 @@ trait SolrMarcFincTrait
return $retval; return $retval;
} }
/**
* Check if punctuation has already been added in marc field
* see also https://www.loc.gov/marc/bibliographic/bdleader.html
*
* @return boolean
*/
public function hasPunctuation()
{
return in_array($this->getMarcRecord()->getLeader()[18], ['a', 'i']);
}
/** /**
* Get the delivery status of the record. * Get the delivery status of the record.
* *
......
...@@ -210,6 +210,22 @@ trait MultiDataFieldsTrait ...@@ -210,6 +210,22 @@ trait MultiDataFieldsTrait
if (empty($data)) { if (empty($data)) {
return []; return [];
} }
if ($driver->tryMethod('hasPunctuation', [], true) === false) {
/** @var \VuFind\RecordDriver\Response\PublicationDetails $pubDetail */
foreach ($data as &$pubDetail) {
$place = $pubDetail->getPlace();
$name = $pubDetail->getName();
$date = $pubDetail->getDate();
if (!empty($place) && (!empty($name) || !empty($date))) {
$place = $place . ': ';
}
if (!empty($name) && !empty($date)) {
$name = $name . ', ';
}
$pubDetail = new \VuFind\RecordDriver\Response\PublicationDetails($place, $name, $date);
}
}
return [[ return [[
'label' => 'Published', 'label' => 'Published',
'values' => $data, 'values' => $data,
......
...@@ -393,10 +393,10 @@ class RecordDataFormatterFactory ...@@ -393,10 +393,10 @@ class RecordDataFormatterFactory
'getLanguages', 'getLanguages',
'data-transEscCommaSepLang.phtml' 'data-transEscCommaSepLang.phtml'
); );
$spec->setTemplateLine( $spec->setMultiLine(
'Published', 'Published',
'getImprint', true,
'data-imprint.phtml' [$this,'publicationDetailsImprint']
); );
$spec->setTemplateLine( $spec->setTemplateLine(
'Set Multipart', 'Set Multipart',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment