From 9e686e023f957e29ba32f84d667014a69f196706 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sun, 27 Oct 2013 15:34:49 +0100 Subject: [PATCH] Bug 6149: Follow-up [defaults] - Stopwords for Result Highlighting - changed sample words to and|or|not in sysprefs.sql and updatedatabase - changed systempreference name from OpacHighlightedStopwords to HighlightedStopwords, as it also works for the staff results page Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer --- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 2 +- .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index ce94c3b7cb..8b7d30d9d4 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -238,7 +238,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'), ('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'), ('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'), -('OpacHighlightedStopWords','and|And|or|Or',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'), +('HighlightedStopWords','and|or|not',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'), ('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'), ('OPACItemHolds','1','0|1|force','Allow OPAC users to place hold on specific items. If No, users can only request next available copy. If Yes, users can choose between next available and specific copy. If Force, users *must* choose a specific copy.','Choice'), ('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 538bd7b4ef..6b5af31098 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8606,7 +8606,7 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.17.00.XXX"; if ( CheckVersion($DBversion) ) { - $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHighlightedStopWords','and|And|or|Or',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free')" + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HighlightedStopWords','and|or|not',NULL,'List of words to NOT highlight when OpacHighlightedWords is enabled','free')" ); print "Upgrade to $DBversion done (Bug 6149: Operator highlighted in search results)\n"; SetVersion($DBversion); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 91b5d628a8..a033294e7c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -152,7 +152,7 @@ OPAC: yes: Highlight no: "Don't highlight" - words the patron searched for in their search results and detail pages; To prevent certain words from ever being highlighted, enter a list of stopwords here - - pref: OpacHighlightedStopWords + - pref: HighlightedStopWords class: multi - (separate columns with |) - diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 5543288e9a..3b92ee3c0a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -164,7 +164,7 @@ function highlightOn() { var x; for (x in q_array) { q_array[x] = q_array[x].toLowerCase(); - var myStopwords = "[% Koha.Preference('OpacHighlightedStopWords') %]".toLowerCase().split('|'); + var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|'); if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) { toHighlight.highlight(q_array[x]); } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index d06ab65475..e159b6e5ff 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -73,7 +73,7 @@ for (x in q_array) { q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1"); q_array[x] = q_array[x].toLowerCase(); - var myStopwords = "[% Koha.Preference('OpacHighlightedStopWords') %]".toLowerCase().split('|'); + var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|'); if( $.inArray(q_array[x], myStopwords) == -1 ) { $(".title").highlight(q_array[x]); $(".author").highlight(q_array[x]); diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt index 42d9ca4dfe..933887d3f7 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -101,7 +101,7 @@ function highlightOn() { for (x in q_array) { q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1"); q_array[x] = q_array[x].toLowerCase(); - var myStopwords = "[% Koha.Preference('OpacHighlightedStopWords') %]".toLowerCase().split('|'); + var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|'); if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) { $(".title").highlight(q_array[x]); $(".author").highlight(q_array[x]); -- 2.20.1