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
('OpacHighlightedStopWords','and|And|or|Or',NULL,'List of words to NOT highlight when OpacHitHighlight is enabled','free'),
241
('HighlightedStopWords','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 8579-8585 if ( CheckVersion($DBversion) ) { Link Here
8579
8579
8580
$DBversion = "3.17.00.XXX";
8580
$DBversion = "3.17.00.XXX";
8581
if ( CheckVersion($DBversion) ) {
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')"
8582
    $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')"
8583
    );
8583
    );
8584
    print "Upgrade to $DBversion done (Bug 6149: Operator highlighted in search results)\n";
8584
    print "Upgrade to $DBversion done (Bug 6149: Operator highlighted in search results)\n";
8585
    SetVersion($DBversion);
8585
    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: OpacHighlightedStopWords
155
            - pref: HighlightedStopWords
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('OpacHighlightedStopWords') %]".toLowerCase().split('|');
167
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".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/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('OpacHighlightedStopWords') %]".toLowerCase().split('|');
76
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".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.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('OpacHighlightedStopWords') %]".toLowerCase().split('|');
104
        var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".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