@@ -33,13 +33,13 @@ |
||
| 33 | 33 | $foundNumbers = $this->documentRepository->getStatisticsForSelectedCollection($this->settings); |
| 34 | 34 | |
| 35 | 35 | // Set replacements. |
| 36 | - $args['###TITLES###'] = $foundNumbers['titles'] . ' ' . htmlspecialchars( |
|
| 36 | + $args['###TITLES###'] = $foundNumbers['titles'].' '.htmlspecialchars( |
|
| 37 | 37 | LocalizationUtility::translate( |
| 38 | 38 | ($foundNumbers['titles'] > 1 ? 'titles' : 'title'), 'dlf' |
| 39 | 39 | ) |
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | - $args['###VOLUMES###'] = $foundNumbers['volumes'] . ' ' . htmlspecialchars( |
|
| 42 | + $args['###VOLUMES###'] = $foundNumbers['volumes'].' '.htmlspecialchars( |
|
| 43 | 43 | LocalizationUtility::translate( |
| 44 | 44 | ($foundNumbers['volumes'] > 1 ? 'volumes' : 'volume'), 'dlf' |
| 45 | 45 | ) |
@@ -210,7 +210,6 @@ |
||
| 210 | 210 | * Volumes are documents that are both |
| 211 | 211 | * a) "leaf" elements i.e. partof != 0 |
| 212 | 212 | * b) "root" elements that are not referenced by other documents ("root" elements that have no descendants) |
| 213 | - |
|
| 214 | 213 | * @param array $settings |
| 215 | 214 | * |
| 216 | 215 | * @return array |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | |
| 359 | 359 | $excludeOtherWhere = ''; |
| 360 | 360 | if ($settings['excludeOther']) { |
| 361 | - $excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($settings['storagePid']); |
|
| 361 | + $excludeOtherWhere = 'tx_dlf_documents.pid='.intval($settings['storagePid']); |
|
| 362 | 362 | } |
| 363 | 363 | // Check if there are any metadata to suggest. |
| 364 | 364 | $result = $queryBuilder |
@@ -410,12 +410,12 @@ discard block |
||
| 410 | 410 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 411 | 411 | ->getConnectionForTable('tx_dlf_documents'); |
| 412 | 412 | |
| 413 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 414 | - 'FROM `tx_dlf_documents` ' . |
|
| 415 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 416 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 417 | - 'WHERE `tx_dlf_documents`.`record_id` = ? ' . |
|
| 418 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 413 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 414 | + 'FROM `tx_dlf_documents` '. |
|
| 415 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 416 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 417 | + 'WHERE `tx_dlf_documents`.`record_id` = ? '. |
|
| 418 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 419 | 419 | $where; |
| 420 | 420 | |
| 421 | 421 | $values = [ |
@@ -445,13 +445,13 @@ discard block |
||
| 445 | 445 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
| 446 | 446 | ->getConnectionForTable('tx_dlf_documents'); |
| 447 | 447 | |
| 448 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
| 449 | - 'FROM `tx_dlf_documents` ' . |
|
| 450 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
| 451 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
| 452 | - 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' . |
|
| 453 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
| 454 | - 'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' . |
|
| 448 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
| 449 | + 'FROM `tx_dlf_documents` '. |
|
| 450 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
| 451 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
| 452 | + 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '. |
|
| 453 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
| 454 | + 'AND '.Helper::whereExpression('tx_dlf_collections').' '. |
|
| 455 | 455 | 'GROUP BY `tx_dlf_documents`.`uid` '; |
| 456 | 456 | |
| 457 | 457 | $values = [ |
@@ -533,13 +533,13 @@ discard block |
||
| 533 | 533 | // Set search query. |
| 534 | 534 | if ( |
| 535 | 535 | (!empty($searchParams['fulltext'])) |
| 536 | - || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 536 | + || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches) |
|
| 537 | 537 | ) { |
| 538 | 538 | // If the query already is a fulltext query e.g using the facets |
| 539 | 539 | $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1]; |
| 540 | 540 | // Search in fulltext field if applicable. Query must not be empty! |
| 541 | 541 | if (!empty($searchParams['query'])) { |
| 542 | - $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')'; |
|
| 542 | + $query = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')'; |
|
| 543 | 543 | } |
| 544 | 544 | $params['fulltext'] = true; |
| 545 | 545 | } else { |
@@ -562,9 +562,9 @@ discard block |
||
| 562 | 562 | in_array($searchParams['extOperator'][$i], $allowedOperators) |
| 563 | 563 | ) { |
| 564 | 564 | if (!empty($query)) { |
| 565 | - $query .= ' ' . $searchParams['extOperator'][$i] . ' '; |
|
| 565 | + $query .= ' '.$searchParams['extOperator'][$i].' '; |
|
| 566 | 566 | } |
| 567 | - $query .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')'; |
|
| 567 | + $query .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')'; |
|
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | } |
@@ -584,12 +584,12 @@ discard block |
||
| 584 | 584 | ) { |
| 585 | 585 | // Search in document and all subordinates (valid for up to three levels of hierarchy). |
| 586 | 586 | $params['filterquery'][]['query'] = '_query_:"{!join from=' |
| 587 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 588 | - . $fields['uid'] . ':{!join from=' . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 589 | - . $fields['uid'] . ':' . $searchParams['documentId'] . '"' . ' OR {!join from=' |
|
| 590 | - . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 591 | - . $fields['uid'] . ':' . $searchParams['documentId'] . ' OR ' |
|
| 592 | - . $fields['uid'] . ':' . $searchParams['documentId']; |
|
| 587 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
| 588 | + . $fields['uid'].':{!join from='.$fields['uid'].' to='.$fields['partof'].'}' |
|
| 589 | + . $fields['uid'].':'.$searchParams['documentId'].'"'.' OR {!join from=' |
|
| 590 | + . $fields['uid'].' to='.$fields['partof'].'}' |
|
| 591 | + . $fields['uid'].':'.$searchParams['documentId'].' OR ' |
|
| 592 | + . $fields['uid'].':'.$searchParams['documentId']; |
|
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | // if a collection is given, we prepare the collection query string |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | $collecionsQueryString = $collection->getIndexName(); |
| 598 | 598 | $params['filterquery'][]['query'] = 'toplevel:true'; |
| 599 | 599 | $params['filterquery'][]['query'] = 'partof:0'; |
| 600 | - $params['filterquery'][]['query'] = 'collection_faceting:("' . $collecionsQueryString . '")'; |
|
| 600 | + $params['filterquery'][]['query'] = 'collection_faceting:("'.$collecionsQueryString.'")'; |
|
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | // Set some query parameters. |
@@ -626,8 +626,8 @@ discard block |
||
| 626 | 626 | if ($listedMetadata) { |
| 627 | 627 | foreach ($listedMetadata as $metadata) { |
| 628 | 628 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
| 629 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 630 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
| 629 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 630 | + $params['fields'] .= ','.$listMetadataRecord; |
|
| 631 | 631 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
| 632 | 632 | } |
| 633 | 633 | } |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | if (empty($documents[$doc['uid']]['title']) && ($documents[$doc['uid']]['partOf'] > 0)) { |
| 714 | 714 | $parentDocument = $this->findByUid($documents[$doc['uid']]['partOf']); |
| 715 | 715 | if ($parentDocument) { |
| 716 | - $documents[$doc['uid']]['title'] = '[' . $parentDocument->getTitle() . ']'; |
|
| 716 | + $documents[$doc['uid']]['title'] = '['.$parentDocument->getTitle().']'; |
|
| 717 | 717 | } |
| 718 | 718 | } |
| 719 | 719 | } |
@@ -737,7 +737,7 @@ discard block |
||
| 737 | 737 | $metadataArray = []; |
| 738 | 738 | |
| 739 | 739 | // Set some query parameters. |
| 740 | - $params['query'] = 'uid:' . $uid; |
|
| 740 | + $params['query'] = 'uid:'.$uid; |
|
| 741 | 741 | $params['start'] = 0; |
| 742 | 742 | $params['rows'] = 1; |
| 743 | 743 | $params['sort'] = ['score' => 'desc']; |
@@ -749,8 +749,8 @@ discard block |
||
| 749 | 749 | if ($listedMetadata) { |
| 750 | 750 | foreach ($listedMetadata as $metadata) { |
| 751 | 751 | if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) { |
| 752 | - $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 753 | - $params['fields'] .= ',' . $listMetadataRecord; |
|
| 752 | + $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u'); |
|
| 753 | + $params['fields'] .= ','.$listMetadataRecord; |
|
| 754 | 754 | $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord; |
| 755 | 755 | } |
| 756 | 756 | } |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | $cache = null; |
| 801 | 801 | // Calculate cache identifier. |
| 802 | 802 | if ($enableCache === true) { |
| 803 | - $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true)); |
|
| 803 | + $cacheIdentifier = Helper::digest($solr->core.print_r($parameters, true)); |
|
| 804 | 804 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
| 805 | 805 | } |
| 806 | 806 | $resultSet = [ |