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

(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 238-244 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
238
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
238
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
239
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
239
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
240
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
240
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
241
('HighlightedStopWords','and|or|not',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
241
('NotHighlightedWords','and|or|not',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
242
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
242
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
243
('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'),
243
('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'),
244
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
244
('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 8605-8611 if ( CheckVersion($DBversion) ) { Link Here
8605
8605
8606
$DBversion = "3.17.00.XXX";
8606
$DBversion = "3.17.00.XXX";
8607
if ( CheckVersion($DBversion) ) {
8607
if ( CheckVersion($DBversion) ) {
8608
    $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')"
8608
    $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')"
8609
    );
8609
    );
8610
    print "Upgrade to $DBversion done (Bug 6149: Operator highlighted in search results)\n";
8610
    print "Upgrade to $DBversion done (Bug 6149: Operator highlighted in search results)\n";
8611
    SetVersion($DBversion);
8611
    SetVersion($DBversion);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +1 lines)
Lines 152-158 OPAC: Link Here
152
                  yes: Highlight
152
                  yes: Highlight
153
                  no: "Don't highlight"
153
                  no: "Don't highlight"
154
            - 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
154
            - 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
155
            - pref: HighlightedStopWords
155
            - pref: NotHighlightedWords
156
              class: multi
156
              class: multi
157
            - (separate columns with |)
157
            - (separate columns with |)
158
        -
158
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-1 / +1 lines)
Lines 164-170 function highlightOn() { Link Here
164
    var x;
164
    var x;
165
    for (x in q_array) {
165
    for (x in q_array) {
166
        q_array[x] = q_array[x].toLowerCase();
166
        q_array[x] = q_array[x].toLowerCase();
167
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
167
        var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
168
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
168
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
169
            toHighlight.highlight(q_array[x]);
169
            toHighlight.highlight(q_array[x]);
170
        }
170
        }
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 1346-1352 Link Here
1346
            for (x in q_array) {
1346
            for (x in q_array) {
1347
                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
1347
                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
1348
                q_array[x] = q_array[x].toLowerCase();
1348
                q_array[x] = q_array[x].toLowerCase();
1349
                var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
1349
                var myStopwords = "[% Koha.Preference('NotHightedWords') %]".toLowerCase().split('|');
1350
                if( $.inArray(q_array[x], myStopwords) == -1 ) {
1350
                if( $.inArray(q_array[x], myStopwords) == -1 ) {
1351
                    $(".title").highlight(q_array[x]);
1351
                    $(".title").highlight(q_array[x]);
1352
                    $(".author").highlight(q_array[x]);
1352
                    $(".author").highlight(q_array[x]);
(-)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/bootstrap/en/modules/opac-results.tt (-1 / +1 lines)
Lines 653-659 function highlightOn() { Link Here
653
    for (x in q_array) {
653
    for (x in q_array) {
654
        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
654
        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
655
        q_array[x] = q_array[x].toLowerCase();
655
        q_array[x] = q_array[x].toLowerCase();
656
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
656
        var myStopwords = "[% Koha.Preference('NotHightedWords') %]".toLowerCase().split('|');
657
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
657
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
658
            $(".title").highlight(q_array[x]);
658
            $(".title").highlight(q_array[x]);
659
            $(".author").highlight(q_array[x]);
659
            $(".author").highlight(q_array[x]);
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 73-79 Link Here
73
        for (x in q_array) {
73
        for (x in q_array) {
74
                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
74
                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
75
                q_array[x] = q_array[x].toLowerCase();
75
                q_array[x] = q_array[x].toLowerCase();
76
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
76
        var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|');
77
                if( $.inArray(q_array[x], myStopwords) == -1 ) {
77
                if( $.inArray(q_array[x], myStopwords) == -1 ) {
78
                    $(".title").highlight(q_array[x]);
78
                    $(".title").highlight(q_array[x]);
79
                    $(".author").highlight(q_array[x]);
79
                    $(".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