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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 238-243 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
('OpacHighlightedStopWords','and|And|or|Or',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
241
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
242
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
242
('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'),
243
('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 (+8 lines)
Lines 8577-8582 if ( CheckVersion($DBversion) ) { Link Here
8577
    SetVersion ($DBversion);
8577
    SetVersion ($DBversion);
8578
}
8578
}
8579
8579
8580
$DBversion = "3.17.00.XXX";
8581
if ( CheckVersion($DBversion) ) {
8582
    $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')"
8583
    );
8584
    print "Upgrade to $DBversion done (Bug 6149: Operator highlighted in search results)\n";
8585
    SetVersion($DBversion);
8586
}
8587
8580
=head1 FUNCTIONS
8588
=head1 FUNCTIONS
8581
8589
8582
=head2 TableExists($table)
8590
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +4 lines)
Lines 151-157 OPAC: Link Here
151
              choices:
151
              choices:
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.
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: OpacHighlightedStopWords
156
              class: multi
157
            - (separate columns with |)
155
        -
158
        -
156
            - pref: AuthorisedValueImages
159
            - pref: AuthorisedValueImages
157
              choices:
160
              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 162-168 $('#sort_by').change(function() { Link Here
162
function highlightOn() {
163
function highlightOn() {
163
    var x;
164
    var x;
164
    for (x in q_array) {
165
    for (x in q_array) {
165
        if ( q_array[x].length > 0 ) {
166
        q_array[x] = q_array[x].toLowerCase();
167
        var myStopwords = "[% Koha.Preference('OpacHighlightedStopWords') %]".toLowerCase().split('|');
168
        if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
166
            toHighlight.highlight(q_array[x]);
169
            toHighlight.highlight(q_array[x]);
167
        }
170
        }
168
    }
171
    }
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-4 / +8 lines)
Lines 70-80 Link Here
70
        }
70
        }
71
        function highlightOn() {
71
        function highlightOn() {
72
            var x;
72
            var x;
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
                $(".title").highlight(q_array[x]);
75
                q_array[x] = q_array[x].toLowerCase();
76
                $(".author").highlight(q_array[x]);
76
        var myStopwords = "[% Koha.Preference('OpacHighlightedStopWords') %]".toLowerCase().split('|');
77
                $(".results_summary").highlight(q_array[x]);
77
                if( $.inArray(q_array[x], myStopwords) == -1 ) {
78
                    $(".title").highlight(q_array[x]);
79
                    $(".author").highlight(q_array[x]);
80
            $(".results_summary").highlight(q_array[x]);
81
        }
78
            }
82
            }
79
            $(".highlight_toggle").toggle();
83
            $(".highlight_toggle").toggle();
80
        }
84
        }
(-)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