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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 224-229 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
224
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
224
('opacheader','','70|10','Add HTML to be included as a custom header in the OPAC','Textarea'),
225
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
225
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at opac. See docs/opac/OpacHiddenItems.txt for more informations.','Textarea'),
226
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
226
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
227
('OpacHighlightedStopWords','and|And|or|Or',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
227
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
228
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
228
('OPACItemHolds','1','','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','YesNo'),
229
('OPACItemHolds','1','','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','YesNo'),
229
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
230
('OpacItemLocation','callnum','callnum|ccode|location','Show the shelving location of items in the opac','Choice'),
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 7155-7160 if ( CheckVersion($DBversion) ) { Link Here
7155
    SetVersion($DBversion);
7155
    SetVersion($DBversion);
7156
}
7156
}
7157
7157
7158
$DBversion = "XXX";
7159
if ( CheckVersion($DBversion) ) {
7160
    $dbh->do(
7161
"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')"
7162
    );
7163
    print "Upgrade to $DBversion done (Bug 6149: Operator Highlighted in Search Results)\n";
7164
    SetVersion($DBversion);
7165
}
7166
7158
=head1 FUNCTIONS
7167
=head1 FUNCTIONS
7159
7168
7160
=head2 TableExists($table)
7169
=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