From 8481e67cee0213026b9a3c822e83788feafe23f3 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 19 Mar 2020 17:59:39 +0300 Subject: [PATCH] Bug 20399: Remove "did you mean" for the staff interface The amdin page for the "did you mean" feature has two block for setting it up in the staff interface, and a note saying this isn't implemented on the staff interface yet. We remove the part about the staff interface until it actually is implemented. Test plan : 1) Apply patch 2) Go to Administration > Did you mean? 3) See there is only the OPAC block 4) Change some checkboxes 5) Save configuration 6) Check that configuration is saved Signed-off-by: Bernardo Gonzalez Kriegel Save works, syspref removed. --- admin/didyoumean.pl | 5 +---- installer/data/mysql/atomicupdate/bug_20399.sql | 1 + installer/data/mysql/sysprefs.sql | 1 - koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt | 5 +++-- 4 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_20399.sql diff --git a/admin/didyoumean.pl b/admin/didyoumean.pl index ef99c8b754..6cc0a2f9ec 100755 --- a/admin/didyoumean.pl +++ b/admin/didyoumean.pl @@ -22,15 +22,12 @@ my ($template, $loggedinuser, $cookie) my $opacplugins = from_json(C4::Context->preference('OPACdidyoumean') || '[]'); -my $intraplugins = from_json(C4::Context->preference('INTRAdidyoumean') || '[]'); - my @pluginlist = Koha::SuggestionEngine::AvailablePlugins(); foreach my $plugin (@pluginlist) { next if $plugin eq 'Koha::SuggestionEngine::Plugin::Null'; next unless (can_load( modules => { "$plugin" => undef } )); push @$opacplugins, { name => $plugin->NAME } unless grep { $_->{name} eq $plugin->NAME } @$opacplugins; - push @$intraplugins, { name => $plugin->NAME } unless grep { $_->{name} eq $plugin->NAME } @$intraplugins; } $template->{VARS}->{OPACpluginlist} = $opacplugins; -$template->{VARS}->{INTRApluginlist} = $intraplugins; + output_html_with_http_headers $input, $cookie, $template->output; diff --git a/installer/data/mysql/atomicupdate/bug_20399.sql b/installer/data/mysql/atomicupdate/bug_20399.sql new file mode 100644 index 0000000000..372403f10d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20399.sql @@ -0,0 +1 @@ +DELETE FROM systempreferences WHERE variable='INTRAdidyoumean'; \ No newline at end of file diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 6eeff845d1..7b025cebf6 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -250,7 +250,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'), ('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'), ('OnSiteCheckoutAutoCheck','0','','Enable/Do not enable onsite checkout by default if last checkout was an onsite checkout','YesNo'), -('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), ('IntranetBiblioDefaultView','normal','normal|marc|isbd|labeled_marc','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','Choice'), ('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'), ('IntranetCirculationHomeHTML', '', NULL, 'Show the following HTML in a div on the bottom of the reports home page', 'Free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt index 5bd7448f15..0a9cc712cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt @@ -57,10 +57,12 @@ OPAC [% PROCESS pluginlist plugins=OPACpluginlist type='opac' %] +
Cancel
@@ -96,9 +98,8 @@ function yesimeant() { var OPACdidyoumean = serialize_plugins('opac'); - var INTRAdidyoumean = serialize_plugins('intranet'); - var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean) + "&pref_INTRAdidyoumean=" + encodeURIComponent(INTRAdidyoumean); + var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean); $.ajax({ data: data, -- 2.17.1