Skip to content

Commit efebc50

Browse files
committed
Merge branch 'develop-5'
# Conflicts: # module/LMS/src/LMS/Controller/MyResearchController.php
2 parents 0d1d57b + 90d43b6 commit efebc50

File tree

35 files changed

+669
-549
lines changed

35 files changed

+669
-549
lines changed

config/vufind/config.ini

+5-2
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,11 @@ default_dismax_handler = dismax
462462
; hierarchy. A higher number results in fewer round-trips but may increase Solr's
463463
; memory usage. Default is 1000.
464464
;cursor_batch_size = 1000
465-
; Limit of records per query if it's a batch query
466-
limit_batch_per_query = 40
465+
; This limits the number of records to retrieve in a batch e.g. when retrieving
466+
; records for a list. Default is 100 which should be a good number to avoid
467+
; memory problems.
468+
;record_batch_size = 100
469+
467470
; Enable/Disable searching reserves using the "reserves" Solr core. When enabling
468471
; this feature, you need to run the util/index_reserves.php script to populate the
469472
; new index.

config/vufind/facets.ini

+4-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ dateRange[] = publishDate
8080
facet_limit = 30
8181
; Override facet_limit on a per-field basis using this array:
8282
;facet_limit_by_field[format] = 50
83-
83+
; Limit facets based on a prefix on a per-field basis:
84+
;facet_prefix_by_field[building] = 22
85+
; Filter facet values to those matching a regular expression on a per-field basis:
86+
;facet_matches_by_field[era_facet] = ".+0"
8487
; By default, the side facets will only show 6 facets and then the "show more"
8588
; button. This can get configured with the showMore settings.
8689
; You can use the * to set a new default setting.

module/CaLief/src/CaLief/Controller/CaLiefController.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,12 @@ public function orderAction() {
362362
}
363363
$view->format = $format;
364364

365-
$signature = $available->getSignature($format);
365+
//$signature = $available->getSignature($format);
366+
$signatureMarcData = $driver->getMarcData('Signature');
367+
$signature= '';
368+
if (isset($signatureMarcData[0]['signature']['data'][0])) {
369+
$signature = $signatureMarcData[0]['signature']['data'][0];
370+
}
366371

367372
if (!$this->caliefConfig['global']['useCaliefForVufindUsers']) {
368373
if (!$this->caliefCheckAuthorize($userCalief) || empty($signature) ) {

module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function emailAction()
4242
$view->name = $this->params()->fromPost('name');
4343
$view->email = $this->params()->fromPost('email');
4444
$view->comments = $this->params()->fromPost('comments');
45+
$view->category = $this->params()->fromPost('category');
4546

4647
// Process form submission:
4748
if ($this->formWasSubmitted('submit', $view->useRecaptcha)) {
@@ -74,6 +75,7 @@ public function emailAction()
7475

7576
$email_message = empty($view->name) ? '' : 'Name: ' . $view->name . "\n";
7677
$email_message .= 'Email: ' . $view->email . "\n";
78+
$email_message .= 'Category: ' . $view->category . "\n";
7779
$email_message .= 'Comments: ' . $view->comments . "\n\n";
7880

7981
// This sets up the email to be sent

module/FacetPrefix/config/module.config.php

-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
'allow_override' => true,
77
'factories' => [
88
'FacetPrefix\Search\Params\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory',
9-
'FacetPrefix\Search\Results\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory',
109
],
1110
'aliases' => [
1211
'VuFind\Search\Params\PluginManager' => 'FacetPrefix\Search\Params\PluginManager',
13-
'VuFind\Search\Results\PluginManager' => 'FacetPrefix\Search\Results\PluginManager',
1412
],
1513
],
1614
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<?php
2+
/**
3+
* Trait to add facet prefix and matches settings to a Params object.
4+
*
5+
* PHP version 7
6+
*
7+
* Copyright (C) Villanova University 2018.
8+
*
9+
* This program is free software; you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License version 2,
11+
* as published by the Free Software Foundation.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program; if not, write to the Free Software
20+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
*
22+
* @category VuFind
23+
* @package Search
24+
* @author Demian Katz <demian.katz@villanova.edu>
25+
* @author Hajo Seng <hajo.seng@sub.uni-hamburg.de>
26+
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
27+
* @link https://vufind.org/wiki/development:plugins:record_drivers Wiki
28+
*/
29+
namespace FacetPrefix\Search\Params;
30+
31+
use Zend\Config\Config;
32+
33+
/**
34+
* Trait to add facet limiting settings to a Params object.
35+
*
36+
* @category VuFind
37+
* @package Search
38+
* @author Demian Katz <demian.katz@villanova.edu>
39+
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
40+
* @link https://vufind.org/wiki/development:plugins:record_drivers Wiki
41+
*/
42+
trait FacetRestrictionsTrait
43+
{
44+
/**
45+
* Per-field facet prefix
46+
*
47+
* @var array
48+
*/
49+
protected $facetPrefixByField = [];
50+
51+
/**
52+
* Per-field facet matches
53+
*
54+
* @var array
55+
*/
56+
protected $facetMatchesByField = [];
57+
58+
/**
59+
* Initialize facet prefix and matches from a Config object.
60+
*
61+
* @param Config $config Configuration
62+
*
63+
* @return void
64+
*/
65+
protected function initFacetRestrictionsFromConfig(Config $config = null)
66+
{
67+
foreach ($config->facet_prefix_by_field ?? [] as $k => $v) {
68+
$this->facetPrefixByField[$k] = $v;
69+
}
70+
foreach ($config->facet_matches_by_field ?? [] as $k => $v) {
71+
$this->facetMatchesByField[$k] = $v;
72+
}
73+
}
74+
75+
/**
76+
* Set Facet Prefix by Field
77+
*
78+
* @param array $new Associative array of $field name => $limit
79+
*
80+
* @return void
81+
*/
82+
public function setFacetPrefixByField(array $new)
83+
{
84+
$this->facetPrefixByField = $new;
85+
}
86+
87+
/**
88+
* Set Facet Matches by Field
89+
*
90+
* @param array $new Associative array of $field name => $limit
91+
*
92+
* @return void
93+
*/
94+
public function setFacetMatchesByField(array $new)
95+
{
96+
$this->facetMatchesByField = $new;
97+
}
98+
99+
/**
100+
* Get the facet prefix for the specified field.
101+
*
102+
* @param string $field Field to look up
103+
*
104+
* @return string
105+
*/
106+
protected function getFacetPrefixForField($field)
107+
{
108+
$prefix = $this->facetPrefixByField[$field] ?? '';
109+
return $prefix;
110+
}
111+
112+
/**
113+
* Get the facet matches for the specified field.
114+
*
115+
* @param string $field Field to look up
116+
*
117+
* @return string
118+
*/
119+
protected function getFacetMatchesForField($field)
120+
{
121+
$matches = $this->facetMatchesByField[$field] ?? '';
122+
return $matches;
123+
}
124+
}

module/FacetPrefix/src/FacetPrefix/Search/Params/ParamsFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __invoke(ContainerInterface $container, $requestedName,
6060
) {
6161
// Replace trailing "Params" with "Options" to get the options service:
6262
$optionsService = preg_replace('/Params$/', 'Options', $requestedName);
63-
// Replace leading "SearchKeys" with "VuFind" to get the VuFind options service:
63+
// Replace leading "FacetPrefix" with "VuFind" to get the VuFind options service:
6464
$optionsService = preg_replace('/^FacetPrefix/', 'VuFind', $optionsService);
6565
$optionsObj = $container->get('VuFind\Search\Options\PluginManager')
6666
->get($optionsService);

module/FacetPrefix/src/FacetPrefix/Search/Params/PluginManager.php

-16
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,6 @@ class PluginManager extends \VuFind\Search\Params\PluginManager
112112
public function __construct($configOrContainerInstance = null,
113113
array $v3config = []
114114
) {
115-
// These objects are not meant to be shared -- every time we retrieve one,
116-
// we are building a brand new object.
117-
$this->sharedByDefault = false;
118-
119-
$this->addAbstractFactory('VuFind\Search\Params\PluginFactory');
120115
parent::__construct($configOrContainerInstance, $v3config);
121116
}
122-
123-
/**
124-
* Return the name of the base class or interface that plug-ins must conform
125-
* to.
126-
*
127-
* @return string
128-
*/
129-
protected function getExpectedInterface()
130-
{
131-
return 'VuFind\Search\Base\Params';
132-
}
133117
}

module/FacetPrefix/src/FacetPrefix/Search/Primo/Params.php

-67
This file was deleted.

module/FacetPrefix/src/FacetPrefix/Search/Results/PluginManager.php

-103
This file was deleted.

0 commit comments

Comments
 (0)