Bug 6149: Follow-up [defaults] - Stopwords for Result Highlighting
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Sun, 27 Oct 2013 14:34:49 +0000 (15:34 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 5 Sep 2014 13:52:00 +0000 (10:52 -0300)
- 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 <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt

index ce94c3b..8b7d30d 100644 (file)
@@ -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'),
index 538bd7b..6b5af31 100755 (executable)
@@ -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);
index 91b5d62..a033294 100644 (file)
@@ -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 |)
         -
index 5543288..3b92ee3 100644 (file)
@@ -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]);
         }
index d06ab65..e159b6e 100644 (file)
@@ -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]);
index 42d9ca4..933887d 100644 (file)
@@ -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]);