Fix Bug #791160: Show volumes' descriptive name in list view and navigation

This commit is contained in:
Sebastian Meyer 2011-06-22 19:36:00 +02:00
commit 5c1bc8ff75
10 changed files with 49 additions and 9 deletions

View File

@ -392,6 +392,8 @@ class tx_dlf_document {
$_details['label'] = (isset($_struct['LABEL']) ? (string) $_struct['LABEL'] : '');
$_details['volume'] = '';
$_details['pagination'] = '';
$_details['type'] = (string) $_struct['TYPE'];
@ -504,6 +506,7 @@ class tx_dlf_document {
'urn' => array (),
'purl' => array (),
'type' => array (),
'volume' => array (),
'volume_sorting' => array (),
'collection' => array (),
'owner' => array (),
@ -702,9 +705,9 @@ class tx_dlf_document {
// Get available data formats from database.
$_result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'type,other_type,root,namespace,class',
'tx_dlf_formats.type AS type,tx_dlf_formats.other_type AS other_type,tx_dlf_formats.root AS root,tx_dlf_formats.namespace AS namespace,tx_dlf_formats.class AS class',
'tx_dlf_formats',
'pid=0'.tx_dlf_helper::whereClause('tx_dlf_formats'),
'tx_dlf_formats.pid=0'.tx_dlf_helper::whereClause('tx_dlf_formats'),
'',
'',
''
@ -1062,6 +1065,7 @@ class tx_dlf_document {
'metadata' => json_encode($listed),
'structure' => $structure,
'partof' => $partof,
'volume' => $metadata['volume'][0],
'volume_sorting' => $metadata['volume_sorting'][0],
'collections' => $collections,
'owner' => $owner,

View File

@ -396,7 +396,7 @@ class tx_dlf_indexing {
if (!empty($metadata['year_sorting'][0])) {
$solrDoc->setField('year_sorting', $metadata['year_sorting'][0]);
$solrDoc->setField('year_sorting', intval($metadata['year_sorting'][0]));
}
@ -416,6 +416,18 @@ class tx_dlf_indexing {
unset ($metadata['place_sorting']);
$solrDoc->setField('volume', $metadata['volume'][0], self::$fieldboost['volume']);
unset ($metadata['volume']);
if (!empty($metadata['volume_sorting'][0])) {
$solrDoc->setField('volume_sorting', intval($metadata['volume_sorting'][0]));
}
unset ($metadata['volume_sorting']);
foreach ($metadata as $index_name => $data) {
if (!empty($data)) {

View File

@ -28,6 +28,7 @@ CREATE TABLE tx_dlf_documents (
metadata longtext NOT NULL,
structure int(11) DEFAULT '0' NOT NULL,
partof int(11) DEFAULT '0' NOT NULL,
volume tinytext NOT NULL,
volume_sorting int(11) DEFAULT '0' NOT NULL,
collections int(11) DEFAULT '0' NOT NULL,
owner int(11) DEFAULT '0' NOT NULL,

View File

@ -25,6 +25,7 @@
<label index="tx_dlf_documents.structure">Typ of Document</label>
<label index="tx_dlf_documents.partof">Part of ...</label>
<label index="tx_dlf_documents.partof.none">none</label>
<label index="tx_dlf_documents.volume">Number of Volume</label>
<label index="tx_dlf_documents.volume_sorting">Number of Volume (Sorting)</label>
<label index="tx_dlf_documents.collections">Collections</label>
<label index="tx_dlf_documents.owner">Owner</label>
@ -139,6 +140,7 @@
<label index="tx_dlf_documents.structure">Dokumententyp</label>
<label index="tx_dlf_documents.partof">Übergeordnete Einheit</label>
<label index="tx_dlf_documents.partof.none">keine</label>
<label index="tx_dlf_documents.volume">Bandnummer</label>
<label index="tx_dlf_documents.volume_sorting">Bandnummer (Sortierung)</label>
<label index="tx_dlf_documents.collections">Sammlungen</label>
<label index="tx_dlf_documents.owner">Besitzer</label>

View File

@ -235,7 +235,7 @@ class tx_dlf_collection extends tx_dlf_plugin {
}
$result = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
'tx_dlf_collections.label AS collLabel,tx_dlf_collections.description AS collDesc,tx_dlf_documents.uid AS uid,tx_dlf_documents.title AS title,tx_dlf_documents.author AS author,tx_dlf_documents.place AS place,tx_dlf_documents.year AS year,tx_dlf_documents.structure AS type',
'tx_dlf_collections.label AS collLabel,tx_dlf_collections.description AS collDesc,tx_dlf_documents.uid AS uid,tx_dlf_documents.title AS title,tx_dlf_documents.volume AS volume,tx_dlf_documents.author AS author,tx_dlf_documents.place AS place,tx_dlf_documents.year AS year,tx_dlf_documents.structure AS type',
'tx_dlf_documents',
'tx_dlf_relations',
'tx_dlf_collections',
@ -266,6 +266,7 @@ class tx_dlf_collection extends tx_dlf_plugin {
'uid' => $resArray['uid'],
'page' => 1,
'title' => array ($resArray['title']),
'volume' => array ($resArray['volume']),
'author' => array ($resArray['author']),
'year' => array ($resArray['year']),
'place' => array ($resArray['place']),

View File

@ -104,6 +104,7 @@ class tx_dlf_search extends tx_dlf_plugin {
'uid' => $doc->uid,
'page' => $doc->page,
'title' => array ($doc->title),
'volume' => array ($doc->volume),
'author' => array ($doc->author),
'year' => array ($doc->year),
'place' => array ($doc->place),

View File

@ -61,9 +61,11 @@ class tx_dlf_toc extends tx_dlf_plugin {
$entryArray = array ();
// Set "title", "type" and "pagination" from $entry array.
// Set "title", "volume", "type" and "pagination" from $entry array.
$entryArray['title'] = $entry['label'];
$entryArray['volume'] = $entry['volume'];
$entryArray['type'] = $this->pi_getLL($entry['type'], tx_dlf_helper::translate($entry['type'], 'tx_dlf_structures', $this->conf['pages']), FALSE);
$entryArray['pagination'] = $entry['pagination'];
@ -262,7 +264,7 @@ class tx_dlf_toc extends tx_dlf_plugin {
// Build table of contents from database.
$result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'tx_dlf_documents.uid AS uid,tx_dlf_documents.title AS title,tx_dlf_structures.index_name AS type',
'tx_dlf_documents.uid AS uid,tx_dlf_documents.title AS title,tx_dlf_documents.volume AS volume,tx_dlf_structures.index_name AS type',
'tx_dlf_documents,tx_dlf_structures',
$whereClause,
'',
@ -281,6 +283,7 @@ class tx_dlf_toc extends tx_dlf_plugin {
$_entry = array (
'label' => $resArray['title'],
'type' => $resArray['type'],
'volume' => $resArray['volume'],
'pagination' => '',
'points' => array ('doc' => $resArray['uid'])
);

View File

@ -6,6 +6,10 @@ plugin.tx_dlf_toc.menuConf {
1.NO = 1
1.NO.stdWrap.crop = 55 | &nbsp;... | 1
1.NO.stdWrap.ifEmpty.field = type
1.NO.stdWrap.ifEmpty.append.fieldRequired = volume
1.NO.stdWrap.ifEmpty.append = TEXT
1.NO.stdWrap.ifEmpty.append.field = volume
1.NO.stdWrap.ifEmpty.append.wrap = &nbsp;|
1.NO.stdWrap.dataWrap = <span class="tx-dlf-toc-title">|</span> <span class="tx-dlf-toc-pagination">{field:pagination}</span>
1.NO.doNotLinkIt.field = doNotLinkIt
1.NO.ATagTitle.field = type

View File

@ -124,10 +124,12 @@ Changelog:
<field name="type" type="string" indexed="true" stored="true" required="true" default="" />
<!-- Next four fields are used for displaying search hits. -->
<field name="title" type="standard" indexed="true" stored="true" required="true" default="" multiValued="false" />
<field name="volume" type="standard" indexed="true" stored="true" multiValued="false" />
<field name="author" type="standard" indexed="true" stored="true" multiValued="true" />
<field name="year" type="standard" indexed="true" stored="true" multiValued="true" />
<field name="place" type="standard" indexed="true" stored="true" multiValued="true" />
<!-- For sorting purposes, the year of publication should be handled as an integer. -->
<!-- For sorting purposes, the some fields should be handled as an integer. -->
<field name="volume_sorting" type="int" indexed="true" stored="false" multiValued="false" />
<field name="year_sorting" type="int" indexed="true" stored="false" multiValued="false" />
<!-- CatchAll field. See <copyField> below. -->
<field name="default" type="standard" indexed="true" stored="false" required="true" default="" multiValued="true" />

View File

@ -27,7 +27,7 @@ if (!defined ('TYPO3_MODE')) die ('Access denied.');
$TCA['tx_dlf_documents'] = array (
'ctrl' => $TCA['tx_dlf_documents']['ctrl'],
'interface' => array (
'showRecordFieldList' => 'title,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn',
'showRecordFieldList' => 'title,volume,author,year,place,uid,prod_id,location,oai_id,opac_id,union_id,urn',
'maxDBListItems' => 50,
'maxSingleDBListItems' => 250,
),
@ -242,6 +242,16 @@ $TCA['tx_dlf_documents'] = array (
'default' => 0,
),
),
'volume' => array (
'exclude' => 1,
'label' => 'LLL:EXT:dlf/locallang_db.xml:tx_dlf_documents.volume',
'config' => array (
'type' => 'input',
'size' => 30,
'max' => 255,
'eval' => 'trim',
),
),
'volume_sorting' => array (
'exclude' => 1,
'label' => 'LLL:EXT:dlf/locallang_db.xml:tx_dlf_documents.volume_sorting',
@ -319,7 +329,7 @@ $TCA['tx_dlf_documents'] = array (
'2' => array ('showitem' => 'author_sorting', 'canNotCollapse' => 1),
'3' => array ('showitem' => 'year_sorting', 'canNotCollapse' => 1),
'4' => array ('showitem' => 'place_sorting', 'canNotCollapse' => 1),
'5' => array ('showitem' => 'partof, --linebreak--, volume_sorting', 'canNotCollapse' => 1),
'5' => array ('showitem' => 'partof, --linebreak--, volume, volume_sorting', 'canNotCollapse' => 1),
),
);