Skip to content

Commit

Permalink
Fixed period in title history and moved issued as new field
Browse files Browse the repository at this point in the history
  • Loading branch information
witt committed Oct 23, 2020
1 parent 94fa6c9 commit 6d36d22
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
23 changes: 23 additions & 0 deletions Classes/Lib/Zdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,16 @@ public function getPrecursor($zdbId, $initial = FALSE){
$this->zdbData['name'] = $matches[1][0];
}

//period
preg_match('/\<rdau:P60128 rdf:datatype="https?:\/\/www.w3.org\/2001\/XMLSchema#string">(.*)\<\/rdau:P60128\>/', $request, $matches, PREG_OFFSET_CAPTURE);

if(!empty($matches[1][0])){
$this->zdbData['period'] = $matches[1][0];
}

//get date issued
preg_match('/\<dcterms:issued rdf:datatype="https?:\/\/www.w3.org\/2001\/XMLSchema#string">(.*)\<\/dcterms:issued\>/', $request, $matches, PREG_OFFSET_CAPTURE);

if(!empty($matches[1][0])){
$this->zdbData['date_issued'] = $matches[1][0];
}
Expand All @@ -407,8 +415,16 @@ public function getPrecursor($zdbId, $initial = FALSE){
$this->precursor[$key]['name'] = $matches[1][0];
}

//period
preg_match('/\<rdau:P60128 rdf:datatype="https?:\/\/www.w3.org\/2001\/XMLSchema#string">(.*)\<\/rdau:P60128\>/', $request, $matches, PREG_OFFSET_CAPTURE);

if(!empty($matches[1][0])){
$this->precursor[$key]['period'] = $matches[1][0];
}

//get date issued
preg_match('/\<dcterms:issued rdf:datatype="https?:\/\/www.w3.org\/2001\/XMLSchema#string">(.*)\<\/dcterms:issued\>/', $request, $matches, PREG_OFFSET_CAPTURE);

if(!empty($matches[1][0])){
$this->precursor[$key]['date_issued'] = $matches[1][0];
}
Expand Down Expand Up @@ -451,6 +467,13 @@ public function getSuccessor($zdbId){
$this->successor[$key]['name'] = $matches[1][0];
}

//period
preg_match('/\<rdau:P60128 rdf:datatype="https?:\/\/www.w3.org\/2001\/XMLSchema#string">(.*)\<\/rdau:P60128\>/', $request, $matches, PREG_OFFSET_CAPTURE);

if(!empty($matches[1][0])){
$this->successor[$key]['period'] = $matches[1][0];
}

//get date issued
preg_match('/\<dcterms:issued rdf:datatype="https?:\/\/www.w3.org\/2001\/XMLSchema#string">(.*)\<\/dcterms:issued\>/', $request, $matches, PREG_OFFSET_CAPTURE);
if(!empty($matches[1][0])){
Expand Down
9 changes: 6 additions & 3 deletions Resources/Private/OldTemplates/Ezb/DisplayDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ <h1><f:format.htmlentitiesDecode>{journal.title}</f:format.htmlentitiesDecode></
<f:for each="{journal.title_history.precursor}" as="row">
<ul>
<li>{row.zdbid}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {row.date_issued}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {row.period}</li>
<li>{row.date_issued}</li>
<li>{row.name}</li>
</ul>
</f:for>
Expand All @@ -233,7 +234,8 @@ <h1><f:format.htmlentitiesDecode>{journal.title}</f:format.htmlentitiesDecode></
<f:if condition="{journal.title_history.zdbData}">
<ul class="ezb-detail-titlehistory-active">
<li>{journal.ZDB_number}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {journal.title_history.zdbData.date_issued}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {journal.title_history.zdbData.period}</li>
<li>{journal.title_history.zdbData.date_issued}</li>
<li>{journal.title_history.zdbData.name}</li>
</ul>
</f:if>
Expand All @@ -242,7 +244,8 @@ <h1><f:format.htmlentitiesDecode>{journal.title}</f:format.htmlentitiesDecode></
<f:for each="{journal.title_history.successor}" as="row">
<ul>
<li>{row.zdbid}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {row.date_issued}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {row.period}</li>
<li>{row.date_issued}</li>
<li>{row.name}</li>
</ul>
</f:for>
Expand Down
9 changes: 6 additions & 3 deletions Resources/Private/Templates/Ezb/DisplayDetail.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ <h1><f:format.htmlentitiesDecode>{journal.title}</f:format.htmlentitiesDecode></
<f:for each="{journal.title_history.precursor}" as="row">
<ul>
<li>{row.zdbid}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {row.date_issued}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {row.period}</li>
<li>{row.date_issued}</li>
<li>{row.name}</li>
</ul>
</f:for>
Expand All @@ -233,7 +234,8 @@ <h1><f:format.htmlentitiesDecode>{journal.title}</f:format.htmlentitiesDecode></
<f:if condition="{journal.title_history.zdbData}">
<ul class="ezb-detail-titlehistory-active">
<li>{journal.ZDB_number}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {journal.title_history.zdbData.date_issued}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {journal.title_history.zdbData.period}</li>
<li>{journal.title_history.zdbData.date_issued}</li>
<li>{journal.title_history.zdbData.name}</li>
</ul>
</f:if>
Expand All @@ -242,7 +244,8 @@ <h1><f:format.htmlentitiesDecode>{journal.title}</f:format.htmlentitiesDecode></
<f:for each="{journal.title_history.successor}" as="row">
<ul>
<li>{row.zdbid}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {row.date_issued}</li>
<li><f:translate key="LLL:EXT:libconnect/Resources/Private/Language/locallang.xlf:tx_libconnect.ezb.detail.in_period" />: {row.period}</li>
<li>{row.date_issued}</li>
<li>{row.name}</li>
</ul>
</f:for>
Expand Down

0 comments on commit 6d36d22

Please sign in to comment.