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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 227-232 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
227
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
227
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
228
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
228
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
229
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
229
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
230
('OpacHighlightedStopWords','and|And|or|Or',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
230
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
231
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
231
('OPACItemHolds','1','','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','YesNo'),
232
('OPACItemHolds','1','','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','YesNo'),
232
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
233
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 7756-7761 if ( CheckVersion($DBversion) ) { Link Here
7756
    SetVersion ($DBversion);
7756
    SetVersion ($DBversion);
7757
}
7757
}
7758
7758
7759
7760
$DBversion = "3.13.00.XXX";
7761
if ( CheckVersion($DBversion) ) {
7762
    $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')"
7763
    );
7764
    print "Upgrade to $DBversion done (Bug 6149: Operator highlighted in search results)\n";
7765
    SetVersion($DBversion);
7766
}
7767
7768
7759
=head1 FUNCTIONS
7769
=head1 FUNCTIONS
7760
7770
7761
=head2 TableExists($table)
7771
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +4 lines)
Lines 135-141 OPAC: Link Here
135
              choices:
135
              choices:
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.
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: OpacHighlightedStopWords
140
              class: multi
141
            - (separate columns with |)
139
        -
142
        -
140
            - pref: AuthorisedValueImages
143
            - pref: AuthorisedValueImages
141
              choices:
144
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-1 / +4 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Catalog &rsaquo; [% IF ( searchdesc ) %]Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %][% ELSE %]You did not specify any search criteria[% END %]</title>
3
<title>Koha &rsaquo; Catalog &rsaquo; [% IF ( searchdesc ) %]Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %][% ELSE %]You did not specify any search criteria[% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 158-164 $('#sort_by').change(function() { Link Here
158
function highlightOn() {
159
function highlightOn() {
159
    var x;
160
    var x;
160
    for (x in q_array) {
161
    for (x in q_array) {
161
        if ( q_array[x].length > 0 ) {
162
        q_array[x] = q_array[x].toLowerCase();
163
        var myStopwords = "[% Koha.Preference('OpacHighlightedStopWords') %]".toLowerCase().split('|');
164
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
162
            toHighlight.highlight(q_array[x]);
165
            toHighlight.highlight(q_array[x]);
163
        }
166
        }
164
    }
167
    }
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-4 / +8 lines)
Lines 57-67 Link Here
57
        }
57
        }
58
        function highlightOn() {
58
        function highlightOn() {
59
            var x;
59
            var x;
60
            for (x in q_array) {
60
        for (x in q_array) {
61
                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
61
                q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
62
                $(".title").highlight(q_array[x]);
62
                q_array[x] = q_array[x].toLowerCase();
63
                $(".author").highlight(q_array[x]);
63
        var myStopwords = "[% Koha.Preference('OpacHighlightedStopWords') %]".toLowerCase().split('|');
64
                $(".results_summary").highlight(q_array[x]);
64
                if( $.inArray(q_array[x], myStopwords) == -1 ) {
65
                    $(".title").highlight(q_array[x]);
66
                    $(".author").highlight(q_array[x]);
67
            $(".results_summary").highlight(q_array[x]);
68
        }
65
            }
69
            }
66
            $(".highlight_toggle").toggle();
70
            $(".highlight_toggle").toggle();
67
        }
71
        }
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-2 / +3 lines)
Lines 100-106 function highlightOn() { Link Here
100
    var x;
100
    var x;
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
        if ( q_array[x].length > 0 ) {
103
        q_array[x] = q_array[x].toLowerCase();
104
        var myStopwords = "[% Koha.Preference('OpacHighlightedStopWords') %]".toLowerCase().split('|');
105
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
104
            $(".title").highlight(q_array[x]);
106
            $(".title").highlight(q_array[x]);
105
            $(".author").highlight(q_array[x]);
107
            $(".author").highlight(q_array[x]);
106
            $(".results_summary").highlight(q_array[x]);
108
            $(".results_summary").highlight(q_array[x]);
107
- 

Return to bug 6149