diff --git a/config/vufind/config.ini b/config/vufind/config.ini index 285fbb83cc..586bcbdcb5 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -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. diff --git a/config/vufind/facets.ini b/config/vufind/facets.ini index cfa85dd9ba..e5fbe092af 100644 --- a/config/vufind/facets.ini +++ b/config/vufind/facets.ini @@ -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. diff --git a/module/CaLief/src/CaLief/Controller/CaLiefController.php b/module/CaLief/src/CaLief/Controller/CaLiefController.php index 32c78c0d64..177757fe17 100644 --- a/module/CaLief/src/CaLief/Controller/CaLiefController.php +++ b/module/CaLief/src/CaLief/Controller/CaLiefController.php @@ -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) ) { diff --git a/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php b/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php index d743af81b7..51ef5111a0 100644 --- a/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php +++ b/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php @@ -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)) { @@ -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 diff --git a/module/FacetPrefix/config/module.config.php b/module/FacetPrefix/config/module.config.php index e4ec815ace..efdd777663 100644 --- a/module/FacetPrefix/config/module.config.php +++ b/module/FacetPrefix/config/module.config.php @@ -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', ], ], ]; diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Params/FacetRestrictionsTrait.php b/module/FacetPrefix/src/FacetPrefix/Search/Params/FacetRestrictionsTrait.php new file mode 100644 index 0000000000..caaa1627e8 --- /dev/null +++ b/module/FacetPrefix/src/FacetPrefix/Search/Params/FacetRestrictionsTrait.php @@ -0,0 +1,124 @@ + + * @author Hajo Seng + * @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 + * @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; + } +} diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Params/ParamsFactory.php b/module/FacetPrefix/src/FacetPrefix/Search/Params/ParamsFactory.php index 0f8bc83072..1c61dd3c4d 100644 --- a/module/FacetPrefix/src/FacetPrefix/Search/Params/ParamsFactory.php +++ b/module/FacetPrefix/src/FacetPrefix/Search/Params/ParamsFactory.php @@ -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); diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Params/PluginManager.php b/module/FacetPrefix/src/FacetPrefix/Search/Params/PluginManager.php index 6e38efa8b6..2a786dcca1 100644 --- a/module/FacetPrefix/src/FacetPrefix/Search/Params/PluginManager.php +++ b/module/FacetPrefix/src/FacetPrefix/Search/Params/PluginManager.php @@ -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'; - } } diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Primo/Params.php b/module/FacetPrefix/src/FacetPrefix/Search/Primo/Params.php deleted file mode 100644 index a6a825344b..0000000000 --- a/module/FacetPrefix/src/FacetPrefix/Search/Primo/Params.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://github.com/subhh/beluga - */ -namespace FacetPrefix\Search\Primo; - -use Libraries\Libraries; -use VuFindSearch\ParamBag; - -class Params extends \Libraries\Search\Primo\Params -{ - - /** - * Constructor - * - * @param \VuFind\Search\Base\Options $options Options to use - * @param \VuFind\Config\PluginManager $configLoader Config loader - */ - public function __construct($options, \VuFind\Config\PluginManager $configLoader, - \VuFind\Search\Memory $searchMemory - ) { - parent::__construct($options, $configLoader); - } - - /** - * Return current facet configurations - * - * @return array $facetSet - */ - public function getFacetSettings() - { - $facetSet = parent::getFacetSettings(); - - $facetConfig = $this->configLoader->get('facets'); - if (isset($facetConfig->FacetPrefix)) { - foreach ($facetConfig->FacetPrefix as $facet => $prefix) { - $facetSet["f.{$facet}.facet.prefix"] = $prefix; - } - } - - return $facetSet; - } -} - diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Results/PluginManager.php b/module/FacetPrefix/src/FacetPrefix/Search/Results/PluginManager.php deleted file mode 100644 index 019c81992f..0000000000 --- a/module/FacetPrefix/src/FacetPrefix/Search/Results/PluginManager.php +++ /dev/null @@ -1,103 +0,0 @@ - - * @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\Results; - -/** - * Search results plugin manager - * - * @category VuFind - * @package Search - * @author Demian Katz - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:plugins:record_drivers Wiki - */ -class PluginManager extends \Libraries\Search\Results\PluginManager -{ - /** - * Default plugin aliases. - * - * @var array - */ - protected $aliases = [ - 'browzine' => 'VuFind\Search\BrowZine\Results', - 'combined' => 'VuFind\Search\Combined\Results', - 'eds' => 'VuFind\Search\EDS\Results', - 'eit' => 'VuFind\Search\EIT\Results', - 'emptyset' => 'VuFind\Search\EmptySet\Results', - 'favorites' => 'VuFind\Search\Favorites\Results', - 'libguides' => 'VuFind\Search\LibGuides\Results', - 'mixedlist' => 'VuFind\Search\MixedList\Results', - 'pazpar2' => 'VuFind\Search\Pazpar2\Results', - 'primo' => 'VuFind\Search\Primo\Results', - 'search2' => 'VuFind\Search\Search2\Results', - 'solr' => 'VuFind\Search\Solr\Results', - 'solrauth' => 'VuFind\Search\SolrAuth\Results', - 'solrauthor' => 'VuFind\Search\SolrAuthor\Results', - 'solrauthorfacets' => 'VuFind\Search\SolrAuthorFacets\Results', - 'solrcollection' => 'VuFind\Search\SolrCollection\Results', - 'solrreserves' => 'VuFind\Search\SolrReserves\Results', - 'solrweb' => 'VuFind\Search\SolrWeb\Results', - 'summon' => 'VuFind\Search\Summon\Results', - 'tags' => 'VuFind\Search\Tags\Results', - 'worldcat' => 'VuFind\Search\WorldCat\Results', - ]; - - /** - * Default plugin factories. - * - * @var array - */ - protected $factories = [ - 'VuFind\Search\BrowZine\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\Combined\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\EDS\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\EIT\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\EmptySet\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\Favorites\Results' => - 'VuFind\Search\Favorites\ResultsFactory', - 'VuFind\Search\LibGuides\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\MixedList\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\Pazpar2\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\Primo\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\Search2\Results' => 'FacetPrefix\Search\Search2\ResultsFactory', - 'VuFind\Search\Solr\Results' => 'FacetPrefix\Search\Solr\ResultsFactory', - 'VuFind\Search\SolrAuth\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\SolrAuthor\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\SolrAuthorFacets\Results' => - 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\SolrCollection\Results' => - 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\SolrReserves\Results' => - 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\SolrWeb\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\Summon\Results' => 'VuFind\Search\Results\ResultsFactory', - 'VuFind\Search\Tags\Results' => 'VuFind\Search\Tags\ResultsFactory', - 'VuFind\Search\WorldCat\Results' => 'VuFind\Search\Results\ResultsFactory', - ]; - -} diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Results/ResultsFactory.php b/module/FacetPrefix/src/FacetPrefix/Search/Results/ResultsFactory.php deleted file mode 100644 index 2105085c62..0000000000 --- a/module/FacetPrefix/src/FacetPrefix/Search/Results/ResultsFactory.php +++ /dev/null @@ -1,72 +0,0 @@ - - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -namespace FacetPrefix\Search\Results; - -use Interop\Container\ContainerInterface; -use Zend\ServiceManager\Factory\FactoryInterface; - -/** - * Generic factory for search results objects. - * - * @category VuFind - * @package Search - * @author Demian Katz - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -class ResultsFactory implements FactoryInterface -{ - /** - * Create an object - * - * @param ContainerInterface $container Service manager - * @param string $requestedName Service being created - * @param null|array $options Extra options (optional) - * - * @return object - * - * @throws ServiceNotFoundException if unable to resolve the service. - * @throws ServiceNotCreatedException if an exception is raised when - * creating a service. - * @throws ContainerException if any other error occurs - */ - public function __invoke(ContainerInterface $container, $requestedName, - array $options = null - ) { - // Replace trailing "Results" with "Params" to get the params service: - $paramsService = preg_replace('/Results$/', 'Params', $requestedName); - $paramsService = preg_replace('/^VuFind/', 'FacetPrefix', $paramsService); - $params = $container->get('FacetPrefix\Search\Params\PluginManager') - ->get($paramsService); - $searchService = $container->get('VuFindSearch\Service'); - $recordLoader = $container->get('VuFind\Record\Loader'); - return new $requestedName( - $params, $searchService, $recordLoader, ...($options ?: []) - ); - } -} diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Search2/Params.php b/module/FacetPrefix/src/FacetPrefix/Search/Search2/Params.php index 330025e809..eccfe273e5 100644 --- a/module/FacetPrefix/src/FacetPrefix/Search/Search2/Params.php +++ b/module/FacetPrefix/src/FacetPrefix/Search/Search2/Params.php @@ -27,12 +27,11 @@ */ namespace FacetPrefix\Search\Search2; -use Libraries\Libraries; use VuFindSearch\ParamBag; use VuFind\Search\Solr\HierarchicalFacetHelper; -use SearchKeys\Search\SearchKeysHelper; +use VuFind\Search\Search2\Params as BaseParams; -class Params extends \Libraries\Search\Search2\Params +class Params extends BaseParams { /** * Constructor @@ -41,11 +40,9 @@ class Params extends \Libraries\Search\Search2\Params * @param \VuFind\Config\PluginManager $configLoader Config loader */ public function __construct($options, \VuFind\Config\PluginManager $configLoader, - HierarchicalFacetHelper $facetHelper = null, - SearchKeysHelper $searchKeysHelper, - \VuFind\Search\Memory $searchMemory + HierarchicalFacetHelper $facetHelper = null ) { - parent::__construct($options, $configLoader, $facetHelper, $searchKeysHelper, $searchMemory); + parent::__construct($options, $configLoader, $facetHelper); } /** @@ -63,13 +60,11 @@ public function getFacetSettings() $facetSet["f.{$facet}.facet.prefix"] = $prefix; } } - - if (isset($facetConfig->FacetMatches)) { + if (isset($facetConfig->FacetMatches)) { foreach ($facetConfig->FacetMatches as $facet => $matches) { $facetSet["f.{$facet}.facet.matches"] = $matches; } } - return $facetSet; } } diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Search2/ParamsFactory.php b/module/FacetPrefix/src/FacetPrefix/Search/Search2/ParamsFactory.php index 5390ae32ee..8484a93ed9 100644 --- a/module/FacetPrefix/src/FacetPrefix/Search/Search2/ParamsFactory.php +++ b/module/FacetPrefix/src/FacetPrefix/Search/Search2/ParamsFactory.php @@ -61,8 +61,6 @@ public function __invoke(ContainerInterface $container, $requestedName, throw new \Exception('Unexpected options sent to factory.'); } $facetHelper = $container->get('VuFind\Search\Solr\HierarchicalFacetHelper'); - $searchKeysHelper = $container->get('SearchKeys\Search\SearchKeysHelper'); - $searchMemory = $container->get('VuFind\Search\Memory'); - return parent::__invoke($container, $requestedName, [$facetHelper, $searchKeysHelper, $searchMemory]); + return parent::__invoke($container, $requestedName, [$facetHelper]); } } diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Search2/ResultsFactory.php b/module/FacetPrefix/src/FacetPrefix/Search/Search2/ResultsFactory.php deleted file mode 100644 index ee32622b1a..0000000000 --- a/module/FacetPrefix/src/FacetPrefix/Search/Search2/ResultsFactory.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -namespace FacetPrefix\Search\Search2; - -use Interop\Container\ContainerInterface; - -/** - * Factory for Search2 search results objects. - * - * @category VuFind - * @package Search_Search2 - * @author Demian Katz - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development Wiki - */ -class ResultsFactory extends \FacetPrefix\Search\Results\ResultsFactory -{ - /** - * Create an object - * - * @param ContainerInterface $container Service manager - * @param string $requestedName Service being created - * @param null|array $options Extra options (optional) - * - * @return object - * - * @throws ServiceNotFoundException if unable to resolve the service. - * @throws ServiceNotCreatedException if an exception is raised when - * creating a service. - * @throws ContainerException if any other error occurs - */ - public function __invoke(ContainerInterface $container, $requestedName, - array $options = null - ) { - $solr = parent::__invoke($container, $requestedName, $options); - $config = $container->get('VuFind\Config\PluginManager')->get('config'); - $solr->setSpellingProcessor( - new \VuFind\Search\Solr\SpellingProcessor($config->Spelling ?? null) - ); - return $solr; - } -} diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Solr/Params.php b/module/FacetPrefix/src/FacetPrefix/Search/Solr/Params.php index 51f607f33e..fba6411541 100644 --- a/module/FacetPrefix/src/FacetPrefix/Search/Solr/Params.php +++ b/module/FacetPrefix/src/FacetPrefix/Search/Solr/Params.php @@ -1,10 +1,10 @@ + * @category VuFind + * @package Search_Solr + * @author Demian Katz * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://github.com/subhh/beluga + * @link https://vufind.org Main Page */ namespace FacetPrefix\Search\Solr; -use Libraries\Libraries; use VuFindSearch\ParamBag; use VuFind\Search\Solr\HierarchicalFacetHelper; -use SearchKeys\Search\SearchKeysHelper; - -//use VuFind\Search\Solr\Params as BaseParams; -use Libraries\Search\Solr\Params as BaseParams; +use VuFind\Search\Solr\Params as BaseParams; +/** + * Solr Search Parameters + * + * @category VuFind + * @package Search_Solr + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ class Params extends BaseParams { + use \VuFind\Search\Params\FacetLimitTrait; + use \FacetPrefix\Search\Params\FacetRestrictionsTrait; /** * Constructor * * @param \VuFind\Search\Base\Options $options Options to use * @param \VuFind\Config\PluginManager $configLoader Config loader + * @param HierarchicalFacetHelper $facetHelper Hierarchical facet helper */ public function __construct($options, \VuFind\Config\PluginManager $configLoader, - HierarchicalFacetHelper $facetHelper = null, - SearchKeysHelper $searchKeysHelper, - \VuFind\Search\Memory $searchMemory + HierarchicalFacetHelper $facetHelper = null ) { - parent::__construct($options, $configLoader, $facetHelper, $searchKeysHelper, $searchMemory); + parent::__construct($options, $configLoader); + + $config = $configLoader->get($options->getFacetsIni()); + $this->initFacetRestrictionsFromConfig($config->Results_Settings ?? null); } /** @@ -59,22 +68,22 @@ public function __construct($options, \VuFind\Config\PluginManager $configLoader */ public function getFacetSettings() { - $facetSet = parent::getFacetSettings(); + // Build a list of facets we want from the index + $facetSet = []; - $facetConfig = $this->configLoader->get('facets'); - if (isset($facetConfig->FacetPrefix)) { - foreach ($facetConfig->FacetPrefix as $facet => $prefix) { - $facetSet["f.{$facet}.facet.prefix"] = $prefix; - } - } - - if (isset($facetConfig->FacetMatches)) { - foreach ($facetConfig->FacetMatches as $facet => $matches) { - $facetSet["f.{$facet}.facet.matches"] = $matches; + if (!empty($this->facetConfig)) { + $facetSet = parent::getFacetSettings(); + foreach (array_keys($this->facetConfig) as $facetField) { + $fieldPrefix = $this->getFacetPrefixForField($facetField); + if (!empty($fieldPrefix)) { + $facetSet["f.{$facetField}.facet.prefix"] = $fieldPrefix; + } + $fieldMatches = $this->getFacetMatchesForField($facetField); + if (!empty($fieldMatches)) { + $facetSet["f.{$facetField}.facet.matches"] = $fieldMatches; + } } } - return $facetSet; } } - diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Solr/ParamsFactory.php b/module/FacetPrefix/src/FacetPrefix/Search/Solr/ParamsFactory.php index 5a8ef00f38..0f39a1c760 100644 --- a/module/FacetPrefix/src/FacetPrefix/Search/Solr/ParamsFactory.php +++ b/module/FacetPrefix/src/FacetPrefix/Search/Solr/ParamsFactory.php @@ -61,8 +61,6 @@ public function __invoke(ContainerInterface $container, $requestedName, throw new \Exception('Unexpected options sent to factory.'); } $facetHelper = $container->get('VuFind\Search\Solr\HierarchicalFacetHelper'); - $searchKeysHelper = $container->get('SearchKeys\Search\SearchKeysHelper'); - $searchMemory = $container->get('VuFind\Search\Memory'); - return parent::__invoke($container, $requestedName, [$facetHelper, $searchKeysHelper, $searchMemory]); + return parent::__invoke($container, $requestedName, [$facetHelper]); } } diff --git a/module/LMS/src/LMS/Controller/MyResearchController.php b/module/LMS/src/LMS/Controller/MyResearchController.php index 297021e83c..3f347cf2e8 100644 --- a/module/LMS/src/LMS/Controller/MyResearchController.php +++ b/module/LMS/src/LMS/Controller/MyResearchController.php @@ -115,16 +115,18 @@ public function mylistAction() $showExportButton = false; if ($results->getListObject() && $results->getListObject()->isPublic()) { if ($lmsConfig = parse_ini_file(realpath(getenv('VUFIND_LOCAL_DIR') . '/config/vufind/lms.ini'), true)) { - $patron = $this->catalogLogin(); - if (is_array($patron)) { - foreach ($lmsConfig['lms-list-id-export']['allowed-user-types'] as $allowedUserType) { - foreach ($patron['type'] as $type) { - if ($type == $allowedUserType) { - $showExportButton = true; - } - } - } - } + if ($this->getAuthManager()->isLoggedIn()) { + $patron = $this->catalogLogin(); + if (is_array($patron)) { + foreach ($lmsConfig['lms-list-id-export']['allowed-user-types'] as $allowedUserType) { + foreach ($patron['type'] as $type) { + if ($type == $allowedUserType) { + $showExportButton = true; + } + } + } + } + } } } return $this->createViewModel( diff --git a/module/LimitBatch/src/LimitBatch/Backend/Solr/Backend.php b/module/LimitBatch/src/LimitBatch/Backend/Solr/Backend.php index 02453cb9db..7846ea6205 100644 --- a/module/LimitBatch/src/LimitBatch/Backend/Solr/Backend.php +++ b/module/LimitBatch/src/LimitBatch/Backend/Solr/Backend.php @@ -50,9 +50,7 @@ class Backend extends BackendBase public function setPageSize($pageSize) { - if(!empty($pageSize)) { - $this->pageSize = $pageSize; - } + $this->pageSize = $pageSize; } /** diff --git a/module/LimitBatch/src/LimitBatch/Search/Factory/AbstractSolrBackendFactory.php b/module/LimitBatch/src/LimitBatch/Search/Factory/AbstractSolrBackendFactory.php index ac13a288cf..f430fb96d6 100644 --- a/module/LimitBatch/src/LimitBatch/Search/Factory/AbstractSolrBackendFactory.php +++ b/module/LimitBatch/src/LimitBatch/Search/Factory/AbstractSolrBackendFactory.php @@ -52,9 +52,15 @@ abstract class AbstractSolrBackendFactory extends BackendFactory */ protected function createBackend(Connector $connector) { - $config = $this->config->get($this->mainConfig); $backend = new Backend($connector); - $backend->setPageSize($config['Index']['limit_batch_per_query']); + $config = $this->config->get($this->mainConfig); + $pageSize = $config->Index->record_batch_size ?? 100; + if ($pageSize > $config->Index->maxBooleanClauses ?? $pageSize) { + $pageSize = $config->Index->maxBooleanClauses; + } + if ($pageSize > 0) { + $backend->setPageSize($pageSize); + } $backend->setQueryBuilder($this->createQueryBuilder()); $backend->setSimilarBuilder($this->createSimilarBuilder()); if ($this->logger) { diff --git a/module/PAIAplus/config/module.config.php b/module/PAIAplus/config/module.config.php index 284496fd2c..c52c80b002 100644 --- a/module/PAIAplus/config/module.config.php +++ b/module/PAIAplus/config/module.config.php @@ -21,10 +21,13 @@ 'controllers' => [ 'factories' => [ 'PAIAplus\Controller\RecordController' => 'PAIAplus\Controller\AbstractBaseWithConfigFactory', + 'PAIAplus\Controller\MyResearchController' => 'PAIAplus\Controller\MyResearchControllerFactory', ], 'aliases' => [ 'Record' => 'PAIAplus\Controller\RecordController', 'record' => 'PAIAplus\Controller\RecordController', + 'MyResearch' => 'PAIAplus\Controller\MyResearchController', + 'myresearch' => 'PAIAplus\Controller\MyResearchController', ], ], ]; diff --git a/module/PAIAplus/src/PAIAplus/Controller/HoldsTrait.php b/module/PAIAplus/src/PAIAplus/Controller/HoldsTrait.php index ba9f8e7ee5..c091c9fc68 100644 --- a/module/PAIAplus/src/PAIAplus/Controller/HoldsTrait.php +++ b/module/PAIAplus/src/PAIAplus/Controller/HoldsTrait.php @@ -188,6 +188,8 @@ public function holdAction() $defaultRequestGroup = false; } + $referer = $_SERVER['HTTP_REFERER']; + $view = $this->createViewModel( [ 'gatheredDetails' => $gatheredDetails, @@ -201,6 +203,7 @@ public function holdAction() 'requestGroupNeeded' => $requestGroupNeeded, 'helpText' => $checkHolds['helpText'] ?? null, 'type' => $type, + 'referer' => $referer, ] ); $view->setTemplate('record/hold'); diff --git a/module/PAIAplus/src/PAIAplus/Controller/MyResearchController.php b/module/PAIAplus/src/PAIAplus/Controller/MyResearchController.php new file mode 100644 index 0000000000..4ad3f0c00d --- /dev/null +++ b/module/PAIAplus/src/PAIAplus/Controller/MyResearchController.php @@ -0,0 +1,177 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +namespace PAIAplus\Controller; + + +/** + * Controller for the user account area. + * + * @category VuFind + * @package Controller + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +class MyResearchController extends \VuFind\Controller\MyResearchController +{ + /** + * Send list of checked out books to view + * + * @return mixed + */ + public function checkedoutAction() + { + // Stop now if the user does not have valid catalog credentials available: + if (!is_array($patron = $this->catalogLogin())) { + return $patron; + } + + // Connect to the ILS: + $catalog = $this->getILS(); + + // Display account blocks, if any: + $this->addAccountBlocksToFlashMessenger($catalog, $patron); + + // Get the current renewal status and process renewal form, if necessary: + $renewStatus = $catalog->checkFunction('Renewals', compact('patron')); + $renewResult = $renewStatus + ? $this->renewals()->processRenewals( + $this->getRequest()->getPost(), $catalog, $patron + ) + : []; + + // By default, assume we will not need to display a renewal form: + $renewForm = false; + + // Get checked out item details: + $result = $catalog->getMyTransactions($patron); + + // Get page size: + $config = $this->getConfig(); + $limit = isset($config->Catalog->checked_out_page_size) + ? $config->Catalog->checked_out_page_size : 50; + + // Build paginator if needed: + if ($limit > 0 && $limit < count($result)) { + $adapter = new \Zend\Paginator\Adapter\ArrayAdapter($result); + $paginator = new \Zend\Paginator\Paginator($adapter); + $paginator->setItemCountPerPage($limit); + $paginator->setCurrentPageNumber($this->params()->fromQuery('page', 1)); + $pageStart = $paginator->getAbsoluteItemNumber(1) - 1; + $pageEnd = $paginator->getAbsoluteItemNumber($limit) - 1; + } else { + $paginator = false; + $pageStart = 0; + $pageEnd = count($result); + } + + $transactions = $hiddenTransactions = []; + foreach ($result as $i => $current) { + // Add renewal details if appropriate: + $current = $this->renewals()->addRenewDetails( + $catalog, $current, $renewStatus + ); + if ($renewStatus && !isset($current['renew_link']) + && $current['renewable'] + ) { + // Enable renewal form if necessary: + $renewForm = true; + } + + // Build record driver (only for the current visible page): + if ($i >= $pageStart && $i <= $pageEnd) { + $transactions[] = $this->getDriverForILSRecord($current); + } else { + $hiddenTransactions[] = $current; + } + } + + $displayItemBarcode + = !empty($config->Catalog->display_checked_out_item_barcode); + + $patron = $this->catalogLogin(); + $profileExpires = "not set"; + if (is_array($patron)) { + $profile = $catalog->getMyProfile($patron); + $profileExpires = $profile['expires']; + } + + return $this->createViewModel( + compact( + 'transactions', 'renewForm', 'renewResult', 'paginator', + 'hiddenTransactions', 'displayItemBarcode', 'profileExpires' + ) + ); + } + + /** + * Login Action + * + * @return mixed + */ + public function loginAction() + { + // If this authentication method doesn't use a VuFind-generated login + // form, force it through: + if ($this->getSessionInitiator()) { + // Don't get stuck in an infinite loop -- if processLogin is already + // set, it probably means Home action is forwarding back here to + // report an error! + // + // Also don't attempt to process a login that hasn't happened yet; + // if we've just been forced here from another page, we need the user + // to click the session initiator link before anything can happen. + if (!$this->params()->fromPost('processLogin', false) + && !$this->params()->fromPost('forcingLogin', false) + ) { + $this->getRequest()->getPost()->set('processLogin', true); + return $this->forwardTo('MyResearch', 'Home'); + } + } + + // Make request available to view for form updating: + $view = $this->createViewModel(); + + // Check for multiple PAIA backends + $paiaConfig = $this->getConfig('PAIA'); + $paiaBackends = []; + foreach ($paiaConfig as $key => $value) { + if (stristr($key, 'PAIA')) { + $name = $key; + if (isset($paiaConfig[$key]['name'])) { + $name = $paiaConfig[$key]['name']; + } + $paiaBackends[$key] = $name; + } + } + $view->paiaBackends = $paiaBackends; + + $view->request = $this->getRequest()->getPost(); + return $view; + } +} diff --git a/module/FacetPrefix/src/FacetPrefix/Search/Solr/ResultsFactory.php b/module/PAIAplus/src/PAIAplus/Controller/MyResearchControllerFactory.php similarity index 76% rename from module/FacetPrefix/src/FacetPrefix/Search/Solr/ResultsFactory.php rename to module/PAIAplus/src/PAIAplus/Controller/MyResearchControllerFactory.php index 406c52ec65..05cd838b17 100644 --- a/module/FacetPrefix/src/FacetPrefix/Search/Solr/ResultsFactory.php +++ b/module/PAIAplus/src/PAIAplus/Controller/MyResearchControllerFactory.php @@ -1,6 +1,6 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development Wiki */ -namespace FacetPrefix\Search\Solr; +namespace PAIAplus\Controller; use Interop\Container\ContainerInterface; +use Zend\ServiceManager\Factory\FactoryInterface; /** - * Factory for Solr search results objects. + * Generic controller factory. * * @category VuFind - * @package Search_Solr + * @package Controller * @author Demian Katz * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development Wiki */ -class ResultsFactory extends \FacetPrefix\Search\Results\ResultsFactory +class MyResearchControllerFactory implements FactoryInterface { /** * Create an object @@ -55,13 +56,11 @@ class ResultsFactory extends \FacetPrefix\Search\Results\ResultsFactory * @throws ContainerException if any other error occurs */ public function __invoke(ContainerInterface $container, $requestedName, - array $options = null + array $options = null ) { - $solr = parent::__invoke($container, $requestedName, $options); - $config = $container->get('VuFind\Config\PluginManager')->get('config'); - $solr->setSpellingProcessor( - new \VuFind\Search\Solr\SpellingProcessor($config->Spelling ?? null) - ); - return $solr; + if (!empty($options)) { + throw new \Exception('Unexpected options sent to factory.'); + } + return new $requestedName($container); } } diff --git a/module/PAIAplus/src/PAIAplus/ILS/Driver/PAIA.php b/module/PAIAplus/src/PAIAplus/ILS/Driver/PAIA.php index a27c55ece6..afe5079a49 100644 --- a/module/PAIAplus/src/PAIAplus/ILS/Driver/PAIA.php +++ b/module/PAIAplus/src/PAIAplus/ILS/Driver/PAIA.php @@ -278,6 +278,10 @@ protected function myTransactionsMapping($items) $result['upc'] = null; $result['institution_name'] = null; */ + if (isset($this->config['Global']['renewLimit'])) { + $result['renewLimit'] = $this->config['Global']['renewLimit']; + } + list($m, $d, $y) = explode('-', $result['dueTime']); $i = ($index < 10) ? '0' . $index : $index; $sort = $y.$m.$d.$i; @@ -366,7 +370,12 @@ protected function getPAIADomain() { $session = $this->getSession(); if (empty($session->paia_domain)) { - $session->paia_domain = 'PAIA'; + // Get PAIA domain from login form. + $paiaDomain = 'PAIA'; + if (isset($_POST['paia-select'])) { + $paiaDomain = $_POST['paia-select']; + } + $session->paia_domain = $paiaDomain; } return $session->paia_domain; } diff --git a/module/SearchKeys/src/SearchKeys/Search/Search2/Params.php b/module/SearchKeys/src/SearchKeys/Search/Search2/Params.php index 596042b5bc..6b9fb7e5be 100644 --- a/module/SearchKeys/src/SearchKeys/Search/Search2/Params.php +++ b/module/SearchKeys/src/SearchKeys/Search/Search2/Params.php @@ -84,38 +84,4 @@ protected function initSearch($request) } parent::initSearch($request); } - - /** - * Build a string for onscreen display showing the - * query used in the search (not the filters). - * - * @return string user friendly version of 'query' - */ - public function getDisplayQuery() - { - return $this->getRawQuery(); - } - - /** - * Build a string for onscreen display showing the - * query used in the search (not the filters). - * - * @return string raw version of 'query' - */ - public function getRawQuery() - { - // Build display query: - $query = QueryAdapter::display($this->getQuery(), NULL, array($this, 'returnIdentic')); - if (isset($translate)) { - foreach($translate as $translateTo => $translateFrom) { - $query = preg_replace('/{'.$translateTo.'}/', $translateFrom, $query); - } - } - return preg_replace('/^\((.*?)\)?/', '$1', $query); - } - - public function returnIdentic($item) { - return $item; - } - } diff --git a/module/SearchKeys/src/SearchKeys/Search/SearchKeysHelper.php b/module/SearchKeys/src/SearchKeys/Search/SearchKeysHelper.php index 5e66dba8f1..b97be8d191 100644 --- a/module/SearchKeys/src/SearchKeys/Search/SearchKeysHelper.php +++ b/module/SearchKeys/src/SearchKeys/Search/SearchKeysHelper.php @@ -8,11 +8,19 @@ class SearchKeysHelper { + /** + * SearchKeys Helper + * + * @var SearchKeysHelper + */ + protected $booleans = ['OR' => ['OR', 'ODER'], 'AND' => ['AND', 'UND'], 'NOT' => ['NOT', 'NICHT']]; - public function test() - { - return 'TeSt'; - } + /** + * SearchKeys Helper + * + * @var SearchKeysHelper + */ + protected $boolRegex = ''; /** * Analyzing search keys within search request and adjusting request accordingly @@ -25,91 +33,136 @@ public function test() */ public function processSearchKeys($request, $options, $config, $searchClassId) { + $keywords = $hiddenKeywords = $phraseKeywords = $keyRegexList = []; $id = strtolower($searchClassId); - $keywords = []; if ($config->get('keys-' . $id)) { $keywords = $config->get('keys-' . $id)->toArray(); } - $phrasedKeywords = []; - if ($config->get('phrasedKeys-' . $id)) { - $phrasedKeywords = $config->get('phrasedKeys-' . $id)->toArray(); - } - $hiddenKeywords = []; if ($config->get('hiddenKeys-' . $id)) { $hiddenKeywords = $config->get('hiddenKeys-' . $id)->toArray(); } + if ($config->get('phraseKeys-' . $id)) { + $phraseKeywords = $config->get('phraseKeys-' . $id)->toArray(); + } + foreach (array_merge($keywords, $hiddenKeywords, $phraseKeywords) as $keyword => $searchType) { + $upperKey = strtoupper($keyword); + $searchName = $options->getHumanReadableFieldName($searchType); + $keyRegexList[$searchType] = '(('.$keyword.'\s)|('.$upperKey.'\s)|('.$searchType.':)|('.$searchName.':))'; + } + $fullKeyRegex = implode('|', $keyRegexList); - $defaultType = $options->getDefaultHandler(); + $boolRegexList = []; + foreach ($this->booleans as $boolean) { + $boolRegexList[] = implode('|', $boolean); + } + $this->boolRegex = implode('|', $boolRegexList); - $lookfor = trim(preg_replace('/\s+/', ' ', $request->get('lookfor'))); - $lookfor = preg_replace('/""+/', '"', $lookfor); - $type = $request->get('type'); + $originalLookfor = trim(preg_replace('/\s+/', ' ', $request->get('lookfor'))); + $originalLookfor = preg_replace('/""+/', '"', $originalLookfor); + $orignalType = $request->get('type') ?? $options->getDefaultHandler(); + if (!preg_match('#' . $fullKeyRegex . '#', $originalLookfor)) { + return $request; + } $searchItems = []; - $searchBoolean = ['AND']; - $limit = 10; + $join = null; - while (!empty($lookfor) && $limit-- > 0) { - $item = $key = ''; - foreach (array_merge($keywords, $phrasedKeywords, $hiddenKeywords) as $keyword => $searchType) { - $upperKey = strtoupper($keyword); - $searchName = $options->getHumanReadableFieldName($searchType); - $keyRegex = '(('.$keyword.'\s)|('.$upperKey.'\s)|('.$searchType.':)|('.$searchName.':))'; - if (preg_match('#^'.$keyRegex.'([^"\s]*|("[^"]*"))((?=\s)|(?=$))#', $lookfor, $matches)) { - $key = $matches[1]; - $item = $matches[6]; - $type = $searchType; - $pos = strpos($lookfor, $key); - $lookfor = trim(substr_replace($lookfor, '', $pos, strlen($key))); - break; + if (preg_match_all('/(\()?[^()]+(?(1)\))/', $originalLookfor, $lfMatches)) { + $qg = 0; + foreach ($lfMatches[0] as $lfMatch) { + if (!isset($searchItems[$qg])) { + $searchItems[$qg] = []; } - } - if (empty($item)) { - $type = (empty($type)) ? $defaultType : $type; - if (preg_match('#^([^"\s]+|("[^"]+"))((?=\s)|(?=$))#', $lookfor, $matches)) { - $item = $matches[1]; - $pos = strpos($lookfor, $item); - $lookfor = trim(substr_replace($lookfor, '', $pos, strlen($item))); - if ($item == 'OR') { - $searchBoolean = ['OR']; + + $lfMatch = trim($lfMatch); + foreach ($this->booleans as $op => $opNames){ + if (in_array($lfMatch, $opNames)) { + if ($op == 'NOT') { + $join = 'AND'; + $searchItems[$qg]['bools'] = [$op]; + } else { + $join = $op; + } + continue 2; } } - if (!isset($searchItems[$type])) { - $searchItems[$type] = []; + + $countUpItems = false; + $lookfors = array_filter(preg_split('#\s*(' . $this->boolRegex . ')\s*#', $lfMatch)); + if (preg_match('#(' . $this->boolRegex . ')#', $lfMatch, $opMatches)) { + foreach ($this->booleans as $op => $opNames){ + if (in_array($opMatches[1], $opNames)) { + if ($op == 'NOT') { + if ($qg == 0) { + //ein erster Operator NOT erzeugt einen fehlerhaften Suchterm + $searchItems[1]['bools'] = [$op]; + } else { + $searchItems[$qg]['bools'] = [$op]; + } + $join = 'AND'; + $countUpItems = true; + } elseif (count($lookfors) == 1) { + //Term ist nicht geklammert und beinhaltet einen boolschen Operator + $join = $op; + } elseif (empty($searchItems[$qg]['bools'])) { + //bei $qg == 0 ist $searchItems[1]['bools'] nicht gesetzt + $searchItems[$qg]['bools'] = [$op]; + } + } + } } - $searchItems[$type][] = $item; - } - } - $lookfors = $types = []; - foreach ($searchItems as $type => $items) { - $types[] = $type; - $lookfor = implode(' ', $items); - if (in_array($type, $phrasedKeywords)) { - $lookfor = '"' . str_replace('"', '', $lookfor) . '"'; + foreach ($lookfors as $lookfor) { + $lookfor = trim($lookfor, " ()"); + $limit = 10; + while (!empty($lookfor) && $limit-- > 0) { + $item = $type = $key = ''; + foreach ($keyRegexList as $searchType => $keyRegex) { + if (preg_match('#^' . $keyRegex . '([^"\s]*|("[^"]*"))((?=\s)|(?=$))#', $lookfor, $matches)) { + $type = $searchType; + $lookfor = trim(substr_replace($lookfor, '', 0, strlen($matches[1]))); + $item = (in_array($type, $phraseKeywords)) ? $lookfor : $matches[6]; + break; + } + } + if (empty($item)) { + if (preg_match('/^([^"\s]+|("[^"]+"))((?=\s)|(?=$))/', $lookfor, $matches)) { + $type = $type ?? $orignalType; + $item = $matches[1]; + } + } + if (!empty($item)) { + $lookfor = trim(substr_replace($lookfor, '', 0, strlen($item))); + $searchItems[$qg]['lookfors'][] = $item; + $searchItems[$qg]['types'][] = $type; + if ($countUpItems) { + $qg++; + } + } + } + } + if (!$countUpItems) { + $qg++; + } } - $lookfors[] = $lookfor; } - if (count($lookfors) > 1) { - $request->set('lookfor', null); - $request->set('lookfor0', $lookfors); - $request->set('type0', $types); - if (empty($request->get('bool0'))) { - $request->set('bool0', $searchBoolean); - } - if (empty($request->get('op0'))) { - $request->set('op0', ['AND']); - } - if (empty($request->get('join'))) { - $request->set('join', 'OR'); + if (!empty($searchItems)) { + if (count($searchItems) == 1 && count($searchItems[0]['lookfors']) == 1 && !in_array($searchItems[0]['types'][0], $hiddenKeywords)) { + $request->set('lookfor', $searchItems[0]['lookfors'][0]); + $request->set('type', $searchItems[0]['types'][0]); + } else { + $request->set('lookfor', null); + $request->set('type', null); + foreach ($searchItems as $qg => $searchItem) { + $request->set('lookfor' . $qg, $searchItem['lookfors']); + $request->set('type' . $qg, $searchItem['types']); + $request->set('bool' . $qg, $searchItem['bools']); + } + if (!empty($join)) { + $request->set('join', $join); + } } - } elseif (count($lookfors) == 1) { - $request->set('lookfor0', null); - $request->set('lookfor', $lookfors[0]); - $request->set('type', $types[0]); - } else { - $request->set('lookfor', null); } return $request; } diff --git a/module/SearchKeys/src/SearchKeys/Search/Solr/Params.php b/module/SearchKeys/src/SearchKeys/Search/Solr/Params.php index 2847eeb1df..218305d59d 100644 --- a/module/SearchKeys/src/SearchKeys/Search/Solr/Params.php +++ b/module/SearchKeys/src/SearchKeys/Search/Solr/Params.php @@ -5,12 +5,12 @@ namespace SearchKeys\Search\Solr; -//use SearchKeys\Search\QueryAdapter; use VuFind\Search\QueryAdapter; use VuFind\Search\Solr\HierarchicalFacetHelper; use SearchKeys\Search\SearchKeysHelper; +use FacetPrefix\Search\Solr\Params as BaseParams; -class Params extends \VuFind\Search\Solr\Params +class Params extends BaseParams { /** * SearchKeys Helper @@ -53,42 +53,6 @@ protected function initSearch($request) } parent::initSearch($request); } - - /** - * Build a string for onscreen display showing the - * query used in the search (not the filters). - * - * @return string user friendly version of 'query' - */ - public function getDisplayQuery() - { - return $this->getRawQuery(); - } - - /** - * Build a string for onscreen display showing the - * query used in the search (not the filters). - * - * @return string raw version of 'query' - */ - public function getRawQuery() - { - $config = $this->configLoader->get('searchkeys'); - $translate = $config->get('translate-solr'); - // Build display query: - $query = QueryAdapter::display($this->getQuery(), NULL, array($this, 'returnIdentic')); - if (isset($translate)) { - foreach($translate as $translateTo => $translateFrom) { - $query = preg_replace('/{'.$translateTo.'}/', $translateFrom, $query); - } - } - return preg_replace('/^\((.*?)\)/', '$1', $query); - } - - public function returnIdentic($item) { - return $item; - } - } diff --git a/module/SearchKeys/src/SearchKeys/View/Helper/SearchKeys/SearchBox.php b/module/SearchKeys/src/SearchKeys/View/Helper/SearchKeys/SearchBox.php index c4727cf92c..16e4540b6a 100644 --- a/module/SearchKeys/src/SearchKeys/View/Helper/SearchKeys/SearchBox.php +++ b/module/SearchKeys/src/SearchKeys/View/Helper/SearchKeys/SearchBox.php @@ -41,7 +41,7 @@ public function getHandlers($activeSearchClass, $activeHandler) if (isset($this->searchkeysConfig[$keyClass])) { $searchKeys = $this->searchkeysConfig[$keyClass]; } - $keyClass = 'phrasedKeys-' . strtolower($activeSearchClass); + $keyClass = 'phraseKeys-' . strtolower($activeSearchClass); if ($this->searchkeysConfig[$keyClass]) { foreach ($this->searchkeysConfig[$keyClass] as $searchKey) { $searchKeys[] = $searchKey; diff --git a/themes/beluga-core-base/templates/Auth/AbstractBase/paia-select.phtml b/themes/beluga-core-base/templates/Auth/AbstractBase/paia-select.phtml new file mode 100644 index 0000000000..b3d9bbc7f3 --- /dev/null +++ b/themes/beluga-core-base/templates/Auth/AbstractBase/paia-select.phtml @@ -0,0 +1 @@ +escapeHtmlAttr($topClass)?>_password">transEsc('Password')?>: +context($this)->renderInContext('Auth/AbstractBase/paia-select.phtml', []) ?> \ No newline at end of file diff --git a/themes/belugax/theme.config.php b/themes/belugax/theme.config.php index 34cb3e3ccb..0a6439d8aa 100644 --- a/themes/belugax/theme.config.php +++ b/themes/belugax/theme.config.php @@ -25,6 +25,7 @@ 'recorddriver', 'helptooltips', 'rvk', + 'paiaplus', 'beluga-core-base', 'rvk', 'storageinfo', diff --git a/themes/paiaplus/css/paiaplus.css b/themes/paiaplus/css/paiaplus.css new file mode 100644 index 0000000000..029cad9654 --- /dev/null +++ b/themes/paiaplus/css/paiaplus.css @@ -0,0 +1,113 @@ +.daia-loading{ + font-weight: bold; +} + +.daia-loading::before{ + content: url(../images/ajax-loader.gif); +} + +.delimiter{ + border-top: 1px dashed #000000; + color: #FFFFFF; + background-color: #FFFFFF; + height: 1px; + margin-bottom: 2px; + margin-top: 2px; +} + +.doi { + font-size: 0px; +} + +.delimiter{ + border: none; + border-top: 1px dashed #E00060; + color: #FFFFFF; + background-color: #FFFFFF; + height: 1px; + margin-bottom: 2px; + margin-top: 2px; +} + +.daia_action { + font-weight: bold; + display: block; +} + +.daia_green { + color: #3DA22D; + font-weight: bold; +} + +.daia_orange { + color: #EB8E12; + font-weight: bold; +} + +.daia_red { + color: #FF0000; + font-weight: bold; +} + +.article_access_level, +.fid_article_access_level, +.fid_homepage_access_level, +.fid_issue_access_level, +.fid_volume_access_level, +.homepage_access_level, +.ill_access_level, +.issue_access_level, +.check_ill_access_level, +.oa_article_access_level, +.fa_article_access_level, +.print_access_level, +.uncertain_article_access_level, +.uncertain_homepage_access_level, +.uncertain_issue_access_level, +.uncertain_volume_access_level, +.unknown_access_level, +.volume_access_level { + font-weight: bold; +} + + + +.oa_article_access_level::after, +.oa_homepage_access_level::after, +.fa_article_access_level::after, +.fa_homepage_access_level::after { + content: url("../images/checkmark_green.png") " " url("../images/OpenAccess_Logo.png"); + margin-left: 5px; +} + +.article_access_level:after, +.homepage_access_level:after, +.issue_access_level:after, +.print_access_level:after, +.volume_access_level:after { + content: url("../images/checkmark_green.png"); + margin-left: 5px; +} + +.proxy_article_access_level:after, +.proxy_homepage_access_level:after, +.proxy_issue_access_level:after, +.proxy_volume_access_level:after { + content: url("../images/checkmark_green.png"); + margin-left: 5px; +} + +.ill_access_level:after, +.check_ill_access_level:after, +.uncertain_article_access_level:after, +.uncertain_homepage_access_level:after, +.uncertain_issue_access_level:after, +.uncertain_volume_access_level:after { + content: url("../images/checkmark_orange.png"); + margin-left: 5px; +} + +.unknown_access_level:after { + content: url("../images/questionmark_orange.png"); + margin-left: 5px; +} diff --git a/themes/paiaplus/mixin.config.php b/themes/paiaplus/mixin.config.php new file mode 100644 index 0000000000..576a1d5adf --- /dev/null +++ b/themes/paiaplus/mixin.config.php @@ -0,0 +1,4 @@ + ['paiaplus.css'], +]; diff --git a/themes/paiaplus/templates/Auth/AbstractBase/paia-select.phtml b/themes/paiaplus/templates/Auth/AbstractBase/paia-select.phtml new file mode 100644 index 0000000000..ba8d85e53d --- /dev/null +++ b/themes/paiaplus/templates/Auth/AbstractBase/paia-select.phtml @@ -0,0 +1,10 @@ +paiaBackends) > 1): ?> +
+ + +
+ \ No newline at end of file diff --git a/themes/recorddriver/templates/RecordDriver/SolrDefault/link-rvk.phtml b/themes/recorddriver/templates/RecordDriver/SolrDefault/link-rvk.phtml index 2634ff1dc1..73852aa66b 100644 --- a/themes/recorddriver/templates/RecordDriver/SolrDefault/link-rvk.phtml +++ b/themes/recorddriver/templates/RecordDriver/SolrDefault/link-rvk.phtml @@ -1,2 +1,2 @@ searchOptions($this->driver->getSourceIdentifier())->getSearchAction(); ?> -url($searchRoute)?>?lookfor=%22lookfor . ' rvk')?>%22 \ No newline at end of file +url($searchRoute)?>?lookfor=%22lookfor . ' rvk')?>%22&type=class