Bug 20399: Remove "did you mean" for the staff interface
authorFridolin Somers <fridolin.somers@biblibre.com>
Thu, 19 Mar 2020 14:59:39 +0000 (17:59 +0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 26 Mar 2020 11:55:37 +0000 (11:55 +0000)
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 <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

admin/didyoumean.pl
installer/data/mysql/atomicupdate/bug_20399.sql [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/didyoumean.tt

index ef99c8b..6cc0a2f 100755 (executable)
@@ -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 (file)
index 0000000..372403f
--- /dev/null
@@ -0,0 +1 @@
+DELETE FROM systempreferences WHERE variable='INTRAdidyoumean';
\ No newline at end of file
index 0313824..3992c62 100644 (file)
@@ -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'),
index 5bd7448..0a9cc71 100644 (file)
                 <legend>OPAC</legend>
                 [% PROCESS pluginlist plugins=OPACpluginlist type='opac' %]
             </fieldset>
+            <!-- TODO not yet implemented
             <fieldset id="didyoumeanintranet">
                 <legend>Intranet</legend>
                 [% PROCESS pluginlist plugins=INTRApluginlist type='intranet' %]
             </fieldset>
+            -->
             <fieldset class="action"><button class="save-all submit" type="submit">Save configuration</button> <a href="/cgi-bin/koha/admin/didyoumean.pl" class="force_reload cancel">Cancel</a></fieldset>
         </form>
 
@@ -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,