View | Details | Raw Unified | Return to bug 6149
Collapse All | Expand All

(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 229-235 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
229
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
229
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
230
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
230
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
231
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
231
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
232
('HighlightedStopWords','and|or|not',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
232
('NotHighlightedWords','and|or|not',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
233
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
233
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
234
('OPACItemHolds','1','','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','YesNo'),
234
('OPACItemHolds','1','','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','YesNo'),
235
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
235
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +1 lines)
Lines 8039-8045 if(CheckVersion($DBversion)) { Link Here
8039
8039
8040
$DBversion = "3.15.00.XXX";
8040
$DBversion = "3.15.00.XXX";
8041
if ( CheckVersion($DBversion) ) {
8041
if ( CheckVersion($DBversion) ) {
8042
    $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')"
8042
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('NotHighlightedWords','and|or|not',NULL,'List of words to NOT highlight when OpacHighlightedWords is enabled','free')"
8043
    );
8043
    );
8044
    print "Upgrade to $DBversion done (Bug 6149: Operator highlighted in search results)\n";
8044
    print "Upgrade to $DBversion done (Bug 6149: Operator highlighted in search results)\n";
8045
    SetVersion($DBversion);
8045
    SetVersion($DBversion);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +1 lines)
Lines 136-142 OPAC: Link Here
136
                  yes: Highlight
136
                  yes: Highlight
137
                  no: "Don't highlight"
137
                  no: "Don't highlight"
138
            - 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
138
            - 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
139
            - pref: HighlightedStopWords
139
            - pref: NotHighlightedWords
140
              class: multi
140
              class: multi
141
            - (separate columns with |)
141
            - (separate columns with |)
142
        -
142
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-1 / +1 lines)
Lines 163-169 function highlightOn() { Link Here
163
    var x;
163
    var x;
164
    for (x in q_array) {
164
    for (x in q_array) {
165
        q_array[x] = q_array[x].toLowerCase();
165
        q_array[x] = q_array[x].toLowerCase();
166
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
166
        var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
167
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
167
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
168
            toHighlight.highlight(q_array[x]);
168
            toHighlight.highlight(q_array[x]);
169
        }
169
        }
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt (-1 / +1 lines)
Lines 351-357 function highlightOn() { Link Here
351
    for (x in q_array) {
351
    for (x in q_array) {
352
	    q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
352
	    q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
353
	    q_array[x] = q_array[x].toLowerCase();
353
	    q_array[x] = q_array[x].toLowerCase();
354
	    var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
354
	    var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
355
	    if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
355
	    if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
356
		    $("td").highlight(q_array[x]);
356
		    $("td").highlight(q_array[x]);
357
	    }
357
	    }
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 65-71 Link Here
65
        for (x in q_array) {
65
        for (x in q_array) {
66
                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
66
                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
67
                q_array[x] = q_array[x].toLowerCase();
67
                q_array[x] = q_array[x].toLowerCase();
68
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
68
        var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
69
                if( $.inArray(q_array[x], myStopwords) == -1 ) {
69
                if( $.inArray(q_array[x], myStopwords) == -1 ) {
70
                    $(".title").highlight(q_array[x]);
70
                    $(".title").highlight(q_array[x]);
71
                    $(".author").highlight(q_array[x]);
71
                    $(".author").highlight(q_array[x]);
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt (-1 / +1 lines)
Lines 85-91 function highlightOn() { Link Here
85
    for (x in q_array) {
85
    for (x in q_array) {
86
        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
86
        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
87
        q_array[x] = q_array[x].toLowerCase();
87
        q_array[x] = q_array[x].toLowerCase();
88
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
88
        var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
89
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
89
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
90
            $("td").highlight(q_array[x]);
90
            $("td").highlight(q_array[x]);
91
        }
91
        }
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-2 / +1 lines)
Lines 101-107 function highlightOn() { Link Here
101
    for (x in q_array) {
101
    for (x in q_array) {
102
        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
102
        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
103
        q_array[x] = q_array[x].toLowerCase();
103
        q_array[x] = q_array[x].toLowerCase();
104
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
104
        var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
105
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
105
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
106
            $(".title").highlight(q_array[x]);
106
            $(".title").highlight(q_array[x]);
107
            $(".author").highlight(q_array[x]);
107
            $(".author").highlight(q_array[x]);
108
- 

Return to bug 6149