From 06a58fe56df512d6aa770a8a5478bed93e0a17fd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 2 Feb 2021 16:00:22 +0100 Subject: [PATCH] Bug 20410: Remove OpacGroupResults and PazPar2 This feature is not used as far as we know and it's not known to work. It's preferable to remove it. Test plan: Make sure the OpacGroupResults pref code is removed, as well as the PazPar2 files and code. Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- C4/Search.pm | 75 ---- C4/UsageStats.pm | 1 - Makefile.PL | 61 +-- debian/koha-common.install | 1 - debian/koha-core.install | 1 - debian/templates/koha-conf-site.xml.in | 14 - etc/koha-conf.xml | 14 - etc/pazpar2/MARC21slimUtils.xsl | 65 --- etc/pazpar2/koha-biblios.xml | 30 -- etc/pazpar2/marc21-work-groups.xsl | 199 ---------- etc/pazpar2/marc21.xsl | 288 -------------- etc/pazpar2/pazpar2.xml | 100 ----- etc/pazpar2/pz2-ourl-base.xsl | 169 -------- etc/pazpar2/pz2-ourl-marc21.xsl | 97 ----- .../data/mysql/atomicupdate/bug_20410.perl | 8 + .../modules/admin/preferences/searching.pref | 7 - .../en/modules/opac-results-grouped.tt | 373 ------------------ misc/bin/koha-pazpar2-ctl.sh | 62 --- misc/koha-install-log | 6 - opac/opac-search.pl | 53 +-- rewrite-config.PL | 14 - t/db_dependent/UsageStats.t | 1 - 22 files changed, 24 insertions(+), 1615 deletions(-) delete mode 100644 etc/pazpar2/MARC21slimUtils.xsl delete mode 100644 etc/pazpar2/koha-biblios.xml delete mode 100644 etc/pazpar2/marc21-work-groups.xsl delete mode 100644 etc/pazpar2/marc21.xsl delete mode 100644 etc/pazpar2/pazpar2.xml delete mode 100644 etc/pazpar2/pz2-ourl-base.xsl delete mode 100644 etc/pazpar2/pz2-ourl-marc21.xsl create mode 100644 installer/data/mysql/atomicupdate/bug_20410.perl delete mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt delete mode 100755 misc/bin/koha-pazpar2-ctl.sh diff --git a/C4/Search.pm b/C4/Search.pm index 864d4bd11b..0b50169ae0 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -23,7 +23,6 @@ use C4::Koha; # getFacets use Koha::DateUtils; use Koha::Libraries; use Lingua::Stem; -use C4::Search::PazPar2; use XML::Simple; use C4::XSLT; use C4::Reserves; # GetReserveStatus @@ -804,80 +803,6 @@ sub _get_facets_info { return $facets_info; } -sub pazGetRecords { - my ( - $koha_query, $simple_query, $sort_by_ref, $servers_ref, - $results_per_page, $offset, $branches, $query_type, - $scan - ) = @_; - #NOTE: Parameter $branches is not used here ! - - my $paz = C4::Search::PazPar2->new(C4::Context->config('pazpar2url')); - $paz->init(); - $paz->search($simple_query); - sleep 1; # FIXME: WHY? - - # do results - my $results_hashref = {}; - my $stats = XMLin($paz->stat); - my $results = XMLin($paz->show($offset, $results_per_page, 'work-title:1'), forcearray => 1); - - # for a grouped search result, the number of hits - # is the number of groups returned; 'bib_hits' will have - # the total number of bibs. - $results_hashref->{'biblioserver'}->{'hits'} = $results->{'merged'}->[0]; - $results_hashref->{'biblioserver'}->{'bib_hits'} = $stats->{'hits'}; - - HIT: foreach my $hit (@{ $results->{'hit'} }) { - my $recid = $hit->{recid}->[0]; - - my $work_title = $hit->{'md-work-title'}->[0]; - my $work_author; - if (exists $hit->{'md-work-author'}) { - $work_author = $hit->{'md-work-author'}->[0]; - } - my $group_label = (defined $work_author) ? "$work_title / $work_author" : $work_title; - - my $result_group = {}; - $result_group->{'group_label'} = $group_label; - $result_group->{'group_merge_key'} = $recid; - - my $count = 1; - if (exists $hit->{count}) { - $count = $hit->{count}->[0]; - } - $result_group->{'group_count'} = $count; - - for (my $i = 0; $i < $count; $i++) { - # FIXME -- may need to worry about diacritics here - my $rec = $paz->record($recid, $i); - push @{ $result_group->{'RECORDS'} }, $rec; - } - - push @{ $results_hashref->{'biblioserver'}->{'GROUPS'} }, $result_group; - } - - # pass through facets - my $termlist_xml = $paz->termlist('author,subject'); - my $terms = XMLin($termlist_xml, forcearray => 1); - my @facets_loop = (); - #die Dumper($results); -# foreach my $list (sort keys %{ $terms->{'list'} }) { -# my @facets = (); -# foreach my $facet (sort @{ $terms->{'list'}->{$list}->{'term'} } ) { -# push @facets, { -# facet_label_value => $facet->{'name'}->[0], -# }; -# } -# push @facets_loop, ( { -# type_label => $list, -# facets => \@facets, -# } ); -# } - - return ( undef, $results_hashref, \@facets_loop ); -} - # TRUNCATION sub _detect_truncation { my ( $operand, $index ) = @_; diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index ca0b8ce9ac..21b461929f 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -291,7 +291,6 @@ sub BuildReport { TalkingTechItivaPhoneNotification uppercasesurnames IncludeSeeFromInSearches - OpacGroupResults QueryAutoTruncate QueryFuzzy QueryStemming diff --git a/Makefile.PL b/Makefile.PL index b2d48ae65f..91d4b3c36b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -94,7 +94,6 @@ Makefile.PL - Koha packager and installer --koha_user Koha Unix user (e.g. koha) --koha_group Koha Unix group (e.g. koha) --install_sru Install the SRU server (yes, no) - --install_pazpar2 Install PazPar2 (yes, no) --use_memcached Use Memcached (yes, no) --font_dir Location of fonts (e.g. /usr/share/fonts/truetype/dejavu) --run_database_tests Run database dependent tests (yes, no) @@ -280,10 +279,6 @@ Directory for backup files produced by Koha. Directory for external Koha plugins. -=item PAZPAR2_CONF_DIR - -Directory for PazPar2 configuration files. - =item FONT_DIR Directory where DejaVu fonts are installed. @@ -328,7 +323,6 @@ my $target_map = { './etc' => { target => 'KOHA_CONF_DIR', trimdir => -1 }, './etc/zebradb' => { target => 'ZEBRA_CONF_DIR', trimdir => -1 }, './etc/z3950' => { target => 'Z3950_CONF_DIR', trimdir => -1 }, - './etc/pazpar2' => { target => 'PAZPAR2_CONF_DIR', trimdir => -1 }, './help.pl' => 'INTRANET_CGI_DIR', './ill' => 'INTRANET_CGI_DIR', './installer-CPAN.pl' => 'NONE', @@ -517,7 +511,6 @@ my %config_defaults = ( 'DB_TLS_CLIENT_CERTIFICATE' => '/etc/mysql-ssl/client-cert.pem', 'DB_TLS_CLIENT_KEY' => '/etc/mysql-ssl/client-key.pem', 'INSTALL_SRU' => 'yes', - 'INSTALL_PAZPAR2' => 'no', 'ZEBRA_MARC_FORMAT' => 'marc21', 'ZEBRA_LANGUAGE' => 'en', 'ZEBRA_TOKENIZER' => 'chr', @@ -530,8 +523,6 @@ my %config_defaults = ( 'KOHA_GROUP' => 'koha', 'MERGE_SERVER_HOST' => 'localhost', 'MERGE_SERVER_PORT' => '11001', - 'PAZPAR2_HOST' => 'localhost', - 'PAZPAR2_PORT' => '11002', 'RUN_DATABASE_TESTS' => 'no', 'PATH_TO_ZEBRA' => '', 'USE_MEMCACHED' => 'yes', @@ -603,7 +594,6 @@ my $cli_zebra_sru_auth_port = ""; my $cli_koha_user = ""; my $cli_koha_group = ""; my $cli_koha_install_sru = ""; -my $cli_koha_install_pazpar2 = ""; my $cli_koha_use_memcached = ""; my $cli_koha_font_dir = ""; my $cli_koha_run_database_tests = ""; @@ -638,7 +628,6 @@ my $results = GetOptions( "koha_user=s" => \$cli_koha_user, "koha_group=s" => \$cli_koha_group, "install_sru=s" => \$cli_koha_install_sru, - "install_pazpar2=s" => \$cli_koha_install_pazpar2, "use_memcached=s" => \$cli_koha_use_memcached, "font_dir=s" => \$cli_koha_font_dir, "run_database_tests=s" => \$cli_koha_run_database_tests, @@ -692,15 +681,8 @@ push @{ $pl_files->{'rewrite-config.PL'} }, ( ); push @{ $pl_files->{'rewrite-config.PL'} }, ( 'blib/SCRIPT_DIR/koha-zebra-ctl.sh', - 'blib/SCRIPT_DIR/koha-pazpar2-ctl.sh', 'blib/SCRIPT_DIR/koha-index-daemon-ctl.sh', ); -if ($config{'INSTALL_PAZPAR2'} eq 'yes') { - push @{ $pl_files->{'rewrite-config.PL'} }, ( - 'blib/PAZPAR2_CONF_DIR/koha-biblios.xml', - 'blib/PAZPAR2_CONF_DIR/pazpar2.xml' - ); -} $config{'ZEBRA_AUTH_CFG'} = 'zebra-authorities-dom.cfg'; $config{'ZEBRA_BIB_CFG'} = 'zebra-biblios-dom.cfg'; $config{'AUTH_RETRIEVAL_CFG'} = 'retrieval-info-auth-dom.xml'; @@ -921,7 +903,6 @@ sub get_cli_values { KOHA_USER => $cli_koha_user, KOHA_GROUP => $cli_koha_group, INSTALL_SRU => $cli_koha_install_sru, - INSTALL_PAZPAR2 => $cli_koha_install_pazpar2, USE_MEMCACHED => $cli_koha_use_memcached, FONT_DIR => $cli_koha_font_dir, RUN_DATABASE_TESTS => $cli_koha_run_database_tests, @@ -1232,41 +1213,6 @@ SRU port for authority data?); } - $msg = q( -Along with Zebra, you can also choose to install PazPar2, -which is a metasearch tool. With PazPar2, -Koha can perform on-the-fly merging of bibliographic -records during searching, allowing for FRBRization of -the results list. - -Install the PazPar2 configuration files?); - $msg .= _add_valid_values_disp('INSTALL_PAZPAR2', $valid_values); - $config{'INSTALL_PAZPAR2'} = _get_value('INSTALL_PAZPAR2', $msg, $defaults->{'INSTALL_PAZPAR2'}, $valid_values, $install_log_values); - - if ($config{'INSTALL_PAZPAR2'} eq 'yes') { - $msg = q( -Since you've chosen to configure PazPar2, you must -specify the host and port(s) that PazPar2 -uses: -); - $msg = q( -Zebra bibliographic server host?); - $config{'MERGE_SERVER_HOST'} = _get_value('MERGE_SERVER_HOST', $msg, $defaults->{'MERGE_SERVER_HOST'}, $valid_values, $install_log_values); - - $msg = q( -Zebra bibliographic port for PazPar2 to use?); - $config{'MERGE_SERVER_PORT'} = _get_value('MERGE_SERVER_PORT', $msg, $defaults->{'MERGE_SERVER_PORT'}, $valid_values, $install_log_values); - - $msg = q( -PazPar2 host?); - $config{'PAZPAR2_HOST'} = _get_value('PAZPAR2_HOST', $msg, $defaults->{'PAZPAR2_HOST'}, $valid_values, $install_log_values); - - $msg = q( -PazPar2 port?); - $config{'PAZPAR2_PORT'} = _get_value('PAZPAR2_PORT', $msg, $defaults->{'PAZPAR2_PORT'}, $valid_values, $install_log_values); - - } - $msg = q( Use memcached to cache the results of some function calls? This provides a significant performance improvement. @@ -1489,7 +1435,6 @@ sub get_target_directories { $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc'); $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb'); $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950'); - $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'pazpar2'); $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc'); $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin'); $dirmap{'SCRIPT_NONDEV_DIR'} = $dirmap{'SCRIPT_DIR'}; @@ -1523,7 +1468,6 @@ sub get_target_directories { $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc'); $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'zebradb'); $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'z3950'); - $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(@basedir, $package, 'etc', 'pazpar2'); $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc'); $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin'); #For dev install, point NONDEV_DIR to misc in current dir (not base) @@ -1552,7 +1496,6 @@ sub get_target_directories { $dirmap{'KOHA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package); $dirmap{'ZEBRA_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'zebradb'); $dirmap{'Z3950_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'z3950'); - $dirmap{'PAZPAR2_CONF_DIR'} = File::Spec->catdir(File::Spec->rootdir(), 'etc', $package, 'pazpar2'); $dirmap{'MISC_DIR'} = File::Spec->catdir(@basedir, $package, 'misc'); $dirmap{'SCRIPT_DIR'} = File::Spec->catdir(@basedir, $package, 'bin'); $dirmap{'SCRIPT_NONDEV_DIR'} = $dirmap{'SCRIPT_DIR'}; @@ -1782,8 +1725,6 @@ sub _update_zebra_conf_target { $target .= "\t\t\$(KOHA_INST_ZEBRA_CONF_DIR) \$(KOHA_DEST_ZEBRA_CONF_DIR) \n"; $target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_ZEBRA_CONF_DIR)\n"; $target .= "\tumask 022; \$(MOD_INSTALL) \\\n"; - $target .= "\t\t\$(KOHA_INST_PAZPAR2_CONF_DIR) \$(KOHA_DEST_PAZPAR2_CONF_DIR) \n"; - $target .= "\t\$(NOECHO) chmod -R u+w \$(KOHA_DEST_PAZPAR2_CONF_DIR)\n"; return $target; } @@ -1809,7 +1750,7 @@ make_upgrade_backup :: \t\$(NOECHO) umask 022; \$(MOD_BACKUP) \\ /; foreach my $key (qw/KOHA_CONF_DIR INTRANET_TMPL_DIR INTRANET_WWW_DIR OPAC_TMPL_DIR OPAC_WWW_DIR - PAZPAR2_CONF_DIR ZEBRA_CONF_DIR PLUGINS_DIR/) { + ZEBRA_CONF_DIR PLUGINS_DIR/) { $upgrade .= "\t\t\$(KOHA_INST_$key) \$(KOHA_DEST_$key) \\\n" unless exists $skip_directories->{$key} or not exists $target_directories->{$key}; diff --git a/debian/koha-common.install b/debian/koha-common.install index 7bc5b7e781..2f5c793d11 100644 --- a/debian/koha-common.install +++ b/debian/koha-common.install @@ -1,5 +1,4 @@ debian/tmp/usr/* usr -debian/tmp/etc/koha/pazpar2 debian/tmp/etc/koha/zebradb/[!z]* debian/tmp/etc/koha/z3950 debian/templates/* etc/koha diff --git a/debian/koha-core.install b/debian/koha-core.install index 7bc5b7e781..2f5c793d11 100644 --- a/debian/koha-core.install +++ b/debian/koha-core.install @@ -1,5 +1,4 @@ debian/tmp/usr/* usr -debian/tmp/etc/koha/pazpar2 debian/tmp/etc/koha/zebradb/[!z]* debian/tmp/etc/koha/z3950 debian/templates/* etc/koha diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 1480ddeb88..d6ebd44498 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -10,19 +10,6 @@ __START_SRU_PUBLICSERVER__ tcp:@:__SRU_BIBLIOS_PORT__ __END_SRU_PUBLICSERVER__ - - - /var/lib/koha/__KOHASITE__/biblios @@ -297,7 +284,6 @@ __END_SRU_PUBLICSERVER__ tool --> 0 0 - /usr/share/koha/misc/koha-install-log 0 0 diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml index 8b15553066..c5f827ba8d 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -14,19 +14,6 @@ tcp:@:__ZEBRA_SRU_BIBLIOS_PORT__ --> - -__PAZPAR2_TOGGLE_XML_PRE__ -tcp:@:__MERGE_SERVER_PORT__ - - __ZEBRA_DATA_DIR__/biblios - __ZEBRA_CONF_DIR__/__ZEBRA_BIB_CFG__ - __ZEBRA_CONF_DIR__/pqf.properties - -__PAZPAR2_TOGGLE_XML_POST__ - __ZEBRA_DATA_DIR__/biblios @@ -114,7 +101,6 @@ __PAZPAR2_TOGGLE_XML_POST__ - http://__PAZPAR2_HOST__:__PAZPAR2_PORT__/search.pz2 __MISC_DIR__/koha-install-log 0 0 diff --git a/etc/pazpar2/MARC21slimUtils.xsl b/etc/pazpar2/MARC21slimUtils.xsl deleted file mode 100644 index 27c40eeb71..0000000000 --- a/etc/pazpar2/MARC21slimUtils.xsl +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/etc/pazpar2/koha-biblios.xml b/etc/pazpar2/koha-biblios.xml deleted file mode 100644 index dc0fba0a28..0000000000 --- a/etc/pazpar2/koha-biblios.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/etc/pazpar2/marc21-work-groups.xsl b/etc/pazpar2/marc21-work-groups.xsl deleted file mode 100644 index 62515730f4..0000000000 --- a/etc/pazpar2/marc21-work-groups.xsl +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - electronic resource - - - article - - - book - - - - - - - - - - adgknmpr - - - - - - - adgknmpr - - - - - - - adgknmpr - - - - - - - - - - abnp - - - - - - - - - - - - - - - - - - - - - abcd - - - - - - - abcd - - - - - - - abcdnq - - - - - - - - titlekey - - - namemainentry - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/etc/pazpar2/marc21.xsl b/etc/pazpar2/marc21.xsl deleted file mode 100644 index f47642cc0a..0000000000 --- a/etc/pazpar2/marc21.xsl +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - electronic resource - - - electronic resource - - - electronic resource - - - article - - - book - - - - - - title - - - - - - - - - author - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/etc/pazpar2/pazpar2.xml b/etc/pazpar2/pazpar2.xml deleted file mode 100644 index 2269647975..0000000000 --- a/etc/pazpar2/pazpar2.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/etc/pazpar2/pz2-ourl-base.xsl b/etc/pazpar2/pz2-ourl-base.xsl deleted file mode 100644 index 260dc9f760..0000000000 --- a/etc/pazpar2/pz2-ourl-base.xsl +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - ?generatedby=pz2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - &aulast= - - - - - &aufirst= - - - - - - - - - - - - - - - - &volume= - - - - - &issue= - - - - - &spage= - - - - - - - - - - - - - - - &date= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - & - - = - - - - - - - - diff --git a/etc/pazpar2/pz2-ourl-marc21.xsl b/etc/pazpar2/pz2-ourl-marc21.xsl deleted file mode 100644 index 1c8efde457..0000000000 --- a/etc/pazpar2/pz2-ourl-marc21.xsl +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/data/mysql/atomicupdate/bug_20410.perl b/installer/data/mysql/atomicupdate/bug_20410.perl new file mode 100644 index 0000000000..2f56bbe2df --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20410.perl @@ -0,0 +1,8 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( q{ + DELETE FROM systempreferences WHERE variable="OpacGroupResults" + }); + + NewVersion( $DBversion, 20410, "Remove OpacGroupResults"); +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index bae50682a2..eaaf56344b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -37,13 +37,6 @@ Searching: unescape_escaped: Unescape escaped dont_escape: Don't escape - "regular expressions within query strings. If \"Escape\" is selected occurences of \"/\" in search terms will be automatically escaped, and regular expressions interpreted as regular strings. If \"Unescape escaped\" is selected this will allow writing regular expressions \"\/like this\/\" while \"/this/\", \"or/this\" will be escaped and interpreted as regular strings. (Elasticsearch only.)" - - - - pref: OpacGroupResults - default: 0 - choices: - yes: Use - no: "Don't use" - - PazPar2 to group similar results on the OPAC. This requires that PazPar2 is set up and running. - - pref: TraceCompleteSubfields default: 0 diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt deleted file mode 100644 index c976070934..0000000000 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt +++ /dev/null @@ -1,373 +0,0 @@ -[% USE raw %] -[% USE Asset %] -[% USE Koha %] -[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] -[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] -[% INCLUDE 'doc-head-open.inc' %] -[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › -[% IF ( searchdesc ) %] - Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc | html %]'[% END %] -[% ELSE %] - You did not specify any search criteria. -[% END %] -[% INCLUDE 'doc-head-close.inc' %] -[% BLOCK cssinclude %][% END %] - - - -[% INCLUDE 'bodytag.inc' bodyid='results-grouped' %] -[% INCLUDE 'masthead.inc' %] - -
- - - [% IF ( query_error ) %] -
-
-
-
-

Error:

-

[% query_error | html %]

-
-
-
-
- [% END %] - -
-
- [% IF ( opacfacets && total ) %] -
-
- - [% INCLUDE 'opac-facets.inc' %] - -
-
-
- [% ELSE %] -
- [% END %] -
- - [% IF ( total ) %] - [% IF ( scan ) %] -

Scan index:

-
- - - - - - - - - -
- Scan index for: -
- - - -
-
- -
- - - - - - - - - [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] - - - - - [% END %] - -
Term/PhraseCount
- [% SEARCH_RESULT.title | html %] - - [% FOREACH subtitl IN SEARCH_RESULT.subtitle.split(' | ') %][% IF Koha.Preference('marcflavour')=='UNIMARC' %],[% END %] - [% subtitl | html %] - [% END %] - [% SEARCH_RESULT.part_number | html %] [% SEARCH_RESULT.part_name | html %] -
-
- [% ELSE %] - -
-
- [% IF ( searchdesc ) %] - [% FOREACH QUERY_INPUT IN QUERY_INPUTS %] - - [% END %] - [% FOREACH LIMIT_INPUT IN LIMIT_INPUTS %] - - [% END %] - [% END %] - - - - - - - - [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %] - - [% FOREACH GROUP_RESULT IN SEARCH_RESULT.GROUP_RESULTS %] - [% IF ( GROUP_RESULT.even ) %] - - [% ELSE %] - - [% END %] - - - - [% END # / FOREACH GROUP_RESULT %] - [% END # / FOREACH SEARCH_RESULTS %] -
-
- - -
- [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %] - - [% END %] -
[% SEARCH_RESULT.group_label | html %]
- [% IF ( AdlibrisEnabled && GROUP_RESULT.normalized_isbn ) %] - Adlibris cover image - [% END %] - [% IF ( OPACAmazonCoverImages ) %] - [% IF ( GROUP_RESULT.isbn ) %][% ELSE %][% END %] - - [% ELSE %] - [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] - [% IF ( GROUP_RESULT.imageurl ) %] - - [% END %] - [% END %] - [% GROUP_RESULT.description | html %] - [% END %] - - [% GROUP_RESULT.result_number | html %]. - [% IF ( GROUP_RESULT.BiblioDefaultViewmarc ) %] - [% GROUP_RESULT.title | html %] - [% ELSE %] - [% IF ( GROUP_RESULT.BiblioDefaultViewisbd ) %] - [% GROUP_RESULT.title | html %] - [% ELSE %] - [% GROUP_RESULT.title | html %] - [% END %] - [% FOREACH subtitl IN GROUP_RESULT.subtitle %] - [% subtitl | html %] - [% END %] - - [% END # / IF GROUP_RESULT.BiblioDefaultViewmarc %] - [% IF ( GROUP_RESULT.author ) %] - by [% GROUP_RESULT.author | html %] - [% ELSE %] -   - [% END %] -

- [% IF ( GROUP_RESULT.publicationyear ) %] - [% GROUP_RESULT.publicationyear | html %][% END %] - [% IF ( GROUP_RESULT.publishercode ) %]- [% GROUP_RESULT.publishercode | html %][% END %] - [% IF ( GROUP_RESULT.place ) %] ; [% GROUP_RESULT.place | html %][% END %] - [% IF ( GROUP_RESULT.pages ) %] - [% GROUP_RESULT.pages | html %][% END %] - [% IF ( GROUP_RESULT.notes ) %] : [% GROUP_RESULT.notes | html %][% END %] - [% IF ( GROUP_RESULT.size ) %] ; [% GROUP_RESULT.size | html %][% END %] - [% IF ( GROUP_RESULT.timestamp ) %] (modified on [% GROUP_RESULT.timestamp | html %])[% END %] -

- [% IF ( GROUP_RESULT.searchhighlightblob ) %] -

[% GROUP_RESULT.searchhighlightblob | html %]

- [% END %] -

- [% IF ( GROUP_RESULT.available_items_loop ) %] - Items available at: - [% FOREACH available_items_loo IN GROUP_RESULT.available_items_loop %] - [% IF ( available_items_loo.branchname ) %][% available_items_loo.branchname | html %][% END %] - [% IF ( OPACItemsResultsDisplay ) %] - [% IF ( available_items_loo.location ) %][% available_items_loo.location | html %][% END %] - [% IF ( available_items_loo.itemcallnumber ) %][[% available_items_loo.itemcallnumber | html %]][% END %] - [% END %] - ([% available_items_loo.count | html %]), - [% END # / FOREACH available_items_loo %] - - [% ELSE %] - No items available: - [% END # / IF GROUP_RESULT.available_items_loop %] - - [% IF ( GROUP_RESULT.onloancount ) %] Checked out ([% GROUP_RESULT.onloancount | html %]), [% END %] - [% IF ( GROUP_RESULT.withdrawncount ) %] Withdrawn ([% GROUP_RESULT.withdrawncount | html %]), [% END %] - [% IF ( GROUP_RESULT.itemlostcount ) %] Lost ([% GROUP_RESULT.itemlostcount | html %]),[% END %] - [% IF ( GROUP_RESULT.damagedcount ) %] Damaged ([% GROUP_RESULT.damagedcount | html %]),[% END %] - [% IF ( GROUP_RESULT.orderedcount ) %] On order ([% GROUP_RESULT.orderedcount | html %]),[% END %] - [% IF ( GROUP_RESULT.intransitcount ) %] In transit ([% GROUP_RESULT.intransitcount | html %]),[% END %] - -

-

- [% IF Koha.Preference( 'RequestOnOpac' ) == 1 %] - [% UNLESS ( GROUP_RESULT.norequests ) %] - [% IF Koha.Preference( 'opacuserlogin' ) == 1 && GROUP_RESULT.holdable %] - Place hold - [% END %] - [% END %] - [% END %] - - [% IF ( ( Koha.Preference( 'opacbookbag' ) == 1 ) || ( Koha.Preference( 'virtualshelves' ) == 1 ) ) %] - [% END %] - [% IF ( GROUP_RESULT.classification ) %] - [% GROUP_RESULT.classification | html %] - [% END %] -

-
-
-
- [% END # / IF scan %] - [% INCLUDE 'page-numbers.inc' %] - [% END # / IF total %] - - [% IF Koha.Preference( 'suggestion' ) == 1 && ( Koha.Preference( 'AnonSuggestions' ) == 1 || loggedinusername || Koha.Preference( 'ILLModule' ) == 1 ) %] -
- Not finding what you're looking for? - -
- [% END %] -
- -
-
-
-
- -[% INCLUDE 'opac-bottom.inc' %] -[% BLOCK jsinclude %] - -[% END %] diff --git a/misc/bin/koha-pazpar2-ctl.sh b/misc/bin/koha-pazpar2-ctl.sh deleted file mode 100755 index 6db96dce31..0000000000 --- a/misc/bin/koha-pazpar2-ctl.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Koha 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 Koha; if not, see . - -### BEGIN INIT INFO -# Provides: koha-pazpar-daemon -# Required-Start: $syslog $remote_fs -# Required-Stop: $syslog $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: PazPar2 server daemon for Koha -### END INIT INFO - -USER=__KOHA_USER__ -GROUP=__KOHA_GROUP__ -DBNAME=__DB_NAME__ -NAME=koha-pazpar2-ctl.$DBNAME -LOGDIR=__LOG_DIR__ -ERRLOG=$LOGDIR/koha-pazpar2daemon.err -STDOUT=$LOGDIR/koha-pazpar2daemon.log -OUTPUT=$LOGDIR/koha-pazpar2daemon-output.log -PAZPAR2_CONF=__PAZPAR2_CONF_DIR__/pazpar2.xml -PAZPAR2SRV=/usr/sbin/pazpar2 - -test -f $PAZPAR2SRV || exit 0 - -OTHERUSER='' -if [[ $EUID -eq 0 ]]; then - OTHERUSER="--user=$USER.$GROUP" -fi - -case "$1" in - start) - echo "Starting PazPar2 Server" - daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 $OTHERUSER -- $PAZPAR2SRV -f $PAZPAR2_CONF - ;; - stop) - echo "Stopping PazPar2 Server" - daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 --stop -- $PAZPAR2SRV -f $PAZPAR2_CONF - ;; - restart) - echo "Restarting the PazPar2 Server" - daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 --restart -- $PAZPAR2SRV -f $PAZPAR2_CONF - ;; - *) - echo "Usage: /etc/init.d/$NAME {start|stop|restart}" - exit 1 - ;; -esac diff --git a/misc/koha-install-log b/misc/koha-install-log index 885280bb16..7e56fd1876 100644 --- a/misc/koha-install-log +++ b/misc/koha-install-log @@ -37,7 +37,6 @@ OPAC_WWW_DIR=__OPAC_WWW_DIR__ PERL_MODULE_DIR=__PERL_MODULE_DIR__ KOHA_CONF_DIR=__KOHA_CONF_DIR__ ZEBRA_CONF_DIR=__ZEBRA_CONF_DIR__ -PAZPAR2_CONF_DIR=__PAZPAR2_CONF_DIR__ MISC_DIR=__MISC_DIR__ SCRIPT_DIR=__SCRIPT_DIR__ MAN_DIR=__MAN_DIR__ @@ -51,15 +50,10 @@ ZEBRA_AUTH_CFG=__ZEBRA_AUTH_CFG__ ZEBRA_BIB_CFG=__ZEBRA_BIB_CFG__ AUTH_RETRIEVAL_CFG=__AUTH_RETRIEVAL_CFG__ BIB_RETRIEVAL_CFG=__BIB_RETRIEVAL_CFG__ -MERGE_SERVER_HOST=__MERGE_SERVER_HOST__ -MERGE_SERVER_PORT=__MERGE_SERVER_PORT__ -PAZPAR2_HOST=__PAZPAR2_HOST__ -PAZPAR2_PORT=__PAZPAR2_PORT__ INSTALL_MODE=__INSTALL_MODE__ INSTALL_BASE=__INSTALL_BASE__ INSTALL_ZEBRA=__INSTALL_ZEBRA__ INSTALL_SRU=__INSTALL_SRU__ -INSTALL_PAZPAR2=__INSTALL_PAZPAR2__ ZEBRA_TOKENIZER=__ZEBRA_TOKENIZER__ RUN_DATABASE_TESTS=__RUN_DATABASE_TESTS__ PATH_TO_ZEBRA=__PATH_TO_ZEBRA__ diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 2d1ac14e0a..743db92f40 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -101,13 +101,9 @@ my @params = $cgi->multi_param("limit"); my @searchCategories = $cgi->multi_param('searchcat'); my $format = $cgi->param("format") || ''; -my $build_grouped_results = C4::Context->preference('OPACGroupResults'); if ($format =~ /(rss|atom|opensearchdescription)/) { $template_name = 'opac-opensearch.tt'; } -elsif (@params && $build_grouped_results) { - $template_name = 'opac-results-grouped.tt'; -} elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) { $template_name = 'opac-results.tt'; } @@ -618,10 +614,6 @@ if ($tag) { # FIXME: Because search and standard search don't work together OpacHiddenItems # displays search results which should be hidden. # FIXME: No facets for tags search. -} elsif ($build_grouped_results) { - eval { - ($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,undef,$query_type,$scan); - }; } else { $pasarParams .= '&query=' . uri_escape_utf8($query); $pasarParams .= '&count=' . uri_escape_utf8($results_per_page); @@ -667,20 +659,8 @@ for (my $i=0;$i<@servers;$i++) { if ($server && $server =~/biblioserver/) { # this is the local bibliographic server $hits = $results_hashref->{$server}->{"hits"}; my $page = $cgi->param('page') || 0; - my @newresults; - if ($build_grouped_results) { - foreach my $group (@{ $results_hashref->{$server}->{"GROUPS"} }) { - # because pazGetRecords handles retieving only the records - # we want as specified by $offset and $results_per_page, - # we need to set the offset parameter of searchResults to 0 - my @group_results = searchResults( $search_context, $query_desc, $group->{'group_count'},$results_per_page, 0, $scan, - $group->{"RECORDS"}, $variables); - push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results }; - } - } else { - @newresults = searchResults( $search_context, $query_desc, $hits, $results_per_page, $offset, $scan, + my @newresults = searchResults( $search_context, $query_desc, $hits, $results_per_page, $offset, $scan, $results_hashref->{$server}->{"RECORDS"}, $variables); - } $hits = 0 unless @newresults; my $art_req_itypes; @@ -799,23 +779,20 @@ for (my $i=0;$i<@servers;$i++) { exit; } if ($hits) { - if ( !$build_grouped_results ) { - # We build the encrypted list of first OPACnumSearchResults biblios to pass with the search criteria for paging on opac-detail - $pasarParams .= '&listBiblios='; - my $j = 0; - foreach (@newresults) { - my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0; - $pasarParams .= uri_escape_utf8($bibnum) . ','; - $j++; - last if ($j == $results_per_page); - } - chop $pasarParams if ($pasarParams =~ /,$/); - $pasarParams .= '&total=' . uri_escape_utf8( int($total) ) if ($pasarParams !~ /total=(?:[0-9]+)?/); - if ($pasarParams) { - my $session = get_session($cgi->cookie("CGISESSID")); - $session->param('busc' => $pasarParams); - } - # + # We build the encrypted list of first OPACnumSearchResults biblios to pass with the search criteria for paging on opac-detail + $pasarParams .= '&listBiblios='; + my $j = 0; + foreach (@newresults) { + my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0; + $pasarParams .= uri_escape_utf8($bibnum) . ','; + $j++; + last if ($j == $results_per_page); + } + chop $pasarParams if ($pasarParams =~ /,$/); + $pasarParams .= '&total=' . uri_escape_utf8( int($total) ) if ($pasarParams !~ /total=(?:[0-9]+)?/); + if ($pasarParams) { + my $session = get_session($cgi->cookie("CGISESSID")); + $session->param('busc' => $pasarParams); } $template->param(total => $hits); my $limit_cgi_not_availablity = $limit_cgi; diff --git a/rewrite-config.PL b/rewrite-config.PL index a7d4088b33..4484e60d34 100644 --- a/rewrite-config.PL +++ b/rewrite-config.PL @@ -121,7 +121,6 @@ my %configuration = ( '__PERL_MODULE_DIR__' => ($ENV{'INSTALLSITELIB'} || sprintf($prefix."/lib/perl5/site_perl/%vd",$^V))."/koha", '__KOHA_CONF_DIR__' => "$prefix/etc/koha", '__ZEBRA_CONF_DIR__' => "$prefix/etc/koha/zebradb", - '__PAZPAR2_CONF_DIR__' => "$prefix/etc/koha/pazpar2", '__MISC_DIR__' => "$prefix/misc", '__SCRIPT_DIR__' => "$prefix/bin", '__SCRIPT_NONDEV_DIR__' => "$prefix/bin", @@ -140,15 +139,9 @@ my %configuration = ( '__ZEBRA_AUTH_CFG__' => 'zebra-authorities-dom.cfg', '__ZEBRA_BIB_CFG__' => 'zebra-biblios-dom.cfg', "__MERGE_SERVER_HOST__" => $myhost, - "__MERGE_SERVER_PORT__" => '11001', - "__PAZPAR2_HOST__" => $myhost, - "__PAZPAR2_PORT__" => '11002', "__INSTALL_MODE__" => 'standard', "__INSTALL_BASE__" => '/usr/share/koha', "__INSTALL_SRU__" => 'yes', - "__INSTALL_PAZPAR2__" => 'no', - "__PAZPAR2_TOGGLE_XML_PRE__" => '', "__RUN_DATABASE_TESTS__" => 'no', "__PATH_TO_ZEBRA__" => "", "__USE_MEMCACHED__" => 'yes', @@ -175,13 +168,6 @@ foreach my $key (keys %configuration) { } } -# munge commenting out the PazPar2 mergeserver -# entry in koha-conf.xml if necessary -if ($configuration{'__INSTALL_PAZPAR2__'} eq 'yes') { - $configuration{'__PAZPAR2_TOGGLE_XML_PRE__'} = ''; - $configuration{'__PAZPAR2_TOGGLE_XML_POST__'} = ''; -} - my $fname = $ARGV[0]; my $file = &read_file($fname); $file =~ s/__.*?__/exists $configuration{$&} ? $configuration{$&} : $&/seg; diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index a8ce7ebfe1..ff793c8e94 100755 --- a/t/db_dependent/UsageStats.t +++ b/t/db_dependent/UsageStats.t @@ -553,7 +553,6 @@ sub mocking_systempreferences_to_a_set_value { TalkingTechItivaPhoneNotification uppercasesurnames IncludeSeeFromInSearches - OpacGroupResults QueryAutoTruncate QueryFuzzy QueryStemming -- 2.39.5