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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 223-228 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
223
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
223
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
224
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
224
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
225
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
225
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
226
('OpacHighlightedStopWords','and|And|or|Or',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
226
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
227
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
227
('OPACItemHolds','1','','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','YesNo'),
228
('OPACItemHolds','1','','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','YesNo'),
228
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
229
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 7067-7072 if ( CheckVersion($DBversion) ) { Link Here
7067
    SetVersion($DBversion);
7067
    SetVersion($DBversion);
7068
}
7068
}
7069
7069
7070
$DBversion = "3.13.00.016";
7071
if ( CheckVersion($DBversion) ) {
7072
    $dbh->do(
7073
"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')"
7074
    );
7075
    print "Upgrade to $DBversion done (Bug 6149: Operator Highlighted in Search Results)\n";
7076
    SetVersion($DBversion);
7077
}
7078
7070
=head1 FUNCTIONS
7079
=head1 FUNCTIONS
7071
7080
7072
=head2 TableExists($table)
7081
=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 99-105 function highlightOn() { Link Here
99
    var x;
99
    var x;
100
    for (x in q_array) {
100
    for (x in q_array) {
101
        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
101
        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
102
        if ( q_array[x].length > 0 ) {
102
        q_array[x] = q_array[x].toLowerCase();
103
        var myStopwords = "[% Koha.Preference('OpacHighlightedStopWords') %]".toLowerCase().split('|');
104
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
103
            $(".title").highlight(q_array[x]);
105
            $(".title").highlight(q_array[x]);
104
            $(".author").highlight(q_array[x]);
106
            $(".author").highlight(q_array[x]);
105
            $(".results_summary").highlight(q_array[x]);
107
            $(".results_summary").highlight(q_array[x]);
106
- 

Return to bug 6149