Skip to content

Commit

Permalink
Merge branch 'develop-5'
Browse files Browse the repository at this point in the history
# Conflicts:
#	module/LMS/src/LMS/Controller/MyResearchController.php
  • Loading branch information
jschultze committed Dec 10, 2020
2 parents 0d1d57b + 90d43b6 commit efebc50
Show file tree
Hide file tree
Showing 35 changed files with 669 additions and 549 deletions.
7 changes: 5 additions & 2 deletions config/vufind/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,11 @@ default_dismax_handler = dismax
; hierarchy. A higher number results in fewer round-trips but may increase Solr's
; memory usage. Default is 1000.
;cursor_batch_size = 1000
; Limit of records per query if it's a batch query
limit_batch_per_query = 40
; This limits the number of records to retrieve in a batch e.g. when retrieving
; records for a list. Default is 100 which should be a good number to avoid
; memory problems.
;record_batch_size = 100

; Enable/Disable searching reserves using the "reserves" Solr core. When enabling
; this feature, you need to run the util/index_reserves.php script to populate the
; new index.
Expand Down
5 changes: 4 additions & 1 deletion config/vufind/facets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ dateRange[] = publishDate
facet_limit = 30
; Override facet_limit on a per-field basis using this array:
;facet_limit_by_field[format] = 50

; Limit facets based on a prefix on a per-field basis:
;facet_prefix_by_field[building] = 22
; Filter facet values to those matching a regular expression on a per-field basis:
;facet_matches_by_field[era_facet] = ".+0"
; By default, the side facets will only show 6 facets and then the "show more"
; button. This can get configured with the showMore settings.
; You can use the * to set a new default setting.
Expand Down
7 changes: 6 additions & 1 deletion module/CaLief/src/CaLief/Controller/CaLiefController.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,12 @@ public function orderAction() {
}
$view->format = $format;

$signature = $available->getSignature($format);
//$signature = $available->getSignature($format);
$signatureMarcData = $driver->getMarcData('Signature');
$signature= '';
if (isset($signatureMarcData[0]['signature']['data'][0])) {
$signature = $signatureMarcData[0]['signature']['data'][0];
}

if (!$this->caliefConfig['global']['useCaliefForVufindUsers']) {
if (!$this->caliefCheckAuthorize($userCalief) || empty($signature) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function emailAction()
$view->name = $this->params()->fromPost('name');
$view->email = $this->params()->fromPost('email');
$view->comments = $this->params()->fromPost('comments');
$view->category = $this->params()->fromPost('category');

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

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

// This sets up the email to be sent
Expand Down
2 changes: 0 additions & 2 deletions module/FacetPrefix/config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
'allow_override' => true,
'factories' => [
'FacetPrefix\Search\Params\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory',
'FacetPrefix\Search\Results\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory',
],
'aliases' => [
'VuFind\Search\Params\PluginManager' => 'FacetPrefix\Search\Params\PluginManager',
'VuFind\Search\Results\PluginManager' => 'FacetPrefix\Search\Results\PluginManager',
],
],
];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?php
/**
* Trait to add facet prefix and matches settings to a Params object.
*
* PHP version 7
*
* Copyright (C) Villanova University 2018.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category VuFind
* @package Search
* @author Demian Katz <[email protected]>
* @author Hajo Seng <[email protected]>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development:plugins:record_drivers Wiki
*/
namespace FacetPrefix\Search\Params;

use Zend\Config\Config;

/**
* Trait to add facet limiting settings to a Params object.
*
* @category VuFind
* @package Search
* @author Demian Katz <[email protected]>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development:plugins:record_drivers Wiki
*/
trait FacetRestrictionsTrait
{
/**
* Per-field facet prefix
*
* @var array
*/
protected $facetPrefixByField = [];

/**
* Per-field facet matches
*
* @var array
*/
protected $facetMatchesByField = [];

/**
* Initialize facet prefix and matches from a Config object.
*
* @param Config $config Configuration
*
* @return void
*/
protected function initFacetRestrictionsFromConfig(Config $config = null)
{
foreach ($config->facet_prefix_by_field ?? [] as $k => $v) {
$this->facetPrefixByField[$k] = $v;
}
foreach ($config->facet_matches_by_field ?? [] as $k => $v) {
$this->facetMatchesByField[$k] = $v;
}
}

/**
* Set Facet Prefix by Field
*
* @param array $new Associative array of $field name => $limit
*
* @return void
*/
public function setFacetPrefixByField(array $new)
{
$this->facetPrefixByField = $new;
}

/**
* Set Facet Matches by Field
*
* @param array $new Associative array of $field name => $limit
*
* @return void
*/
public function setFacetMatchesByField(array $new)
{
$this->facetMatchesByField = $new;
}

/**
* Get the facet prefix for the specified field.
*
* @param string $field Field to look up
*
* @return string
*/
protected function getFacetPrefixForField($field)
{
$prefix = $this->facetPrefixByField[$field] ?? '';
return $prefix;
}

/**
* Get the facet matches for the specified field.
*
* @param string $field Field to look up
*
* @return string
*/
protected function getFacetMatchesForField($field)
{
$matches = $this->facetMatchesByField[$field] ?? '';
return $matches;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __invoke(ContainerInterface $container, $requestedName,
) {
// Replace trailing "Params" with "Options" to get the options service:
$optionsService = preg_replace('/Params$/', 'Options', $requestedName);
// Replace leading "SearchKeys" with "VuFind" to get the VuFind options service:
// Replace leading "FacetPrefix" with "VuFind" to get the VuFind options service:
$optionsService = preg_replace('/^FacetPrefix/', 'VuFind', $optionsService);
$optionsObj = $container->get('VuFind\Search\Options\PluginManager')
->get($optionsService);
Expand Down
16 changes: 0 additions & 16 deletions module/FacetPrefix/src/FacetPrefix/Search/Params/PluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,6 @@ class PluginManager extends \VuFind\Search\Params\PluginManager
public function __construct($configOrContainerInstance = null,
array $v3config = []
) {
// These objects are not meant to be shared -- every time we retrieve one,
// we are building a brand new object.
$this->sharedByDefault = false;

$this->addAbstractFactory('VuFind\Search\Params\PluginFactory');
parent::__construct($configOrContainerInstance, $v3config);
}

/**
* Return the name of the base class or interface that plug-ins must conform
* to.
*
* @return string
*/
protected function getExpectedInterface()
{
return 'VuFind\Search\Base\Params';
}
}
67 changes: 0 additions & 67 deletions module/FacetPrefix/src/FacetPrefix/Search/Primo/Params.php

This file was deleted.

103 changes: 0 additions & 103 deletions module/FacetPrefix/src/FacetPrefix/Search/Results/PluginManager.php

This file was deleted.

Loading

0 comments on commit efebc50

Please sign in to comment.