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

(-)a/installer/data/mysql/atomicupdate/add-system-preference-HighlightedWords.perl (+8 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if ( CheckVersion($DBversion) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`)
5
        VALUES ('HighlightedWords','0','','Activate or not highlighting of search terms in results','YesNo')
6
    });
7
    NewVersion( $DBversion, '20398', 'Add system preference HighlightedWords');
8
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 236-241 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
236
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
236
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
237
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
237
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
238
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
238
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
239
('HighlightedWords','0','','Highlight search terms in results','YesNo'),
239
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
240
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
240
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
241
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
241
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo'),
242
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (+8 lines)
Lines 132-137 Searching: Link Here
132
                  0: "don't use"
132
                  0: "don't use"
133
            - 'the operator "phr" in the callnumber and standard number staff interface searches.'
133
            - 'the operator "phr" in the callnumber and standard number staff interface searches.'
134
    Results display:
134
    Results display:
135
        -
136
            - pref: HighlightedWords
137
              type: boolean
138
              default: yes
139
              choices:
140
                  1: Highlight
141
                  0: "Don't highlight"
142
            - words the patron searched for in their search results and detail pages.
135
        -
143
        -
136
            - pref: numSearchResultsDropdown
144
            - pref: numSearchResultsDropdown
137
              type: boolean
145
              type: boolean
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-3 / +6 lines)
Lines 81-89 Link Here
81
                            |
81
                            |
82
                            <a href="#" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
82
                            <a href="#" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
83
                            |
83
                            |
84
                            <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
84
                            [% IF Koha.Preference("HighlightedWords") == 1 %]
85
                            <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
85
                                <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
86
                            |
86
                                <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
87
                                |
88
                            [% END %]
87
89
88
                            [% IF (Koha.Preference("intranetbookbag")) %]
90
                            [% IF (Koha.Preference("intranetbookbag")) %]
89
                                <div class="btn-group">
91
                                <div class="btn-group">
Lines 705-710 Link Here
705
        var CoceHost = "[% CoceHost | html %]";
707
        var CoceHost = "[% CoceHost | html %]";
706
        var CoceProviders = "[% CoceProviders | html %]";
708
        var CoceProviders = "[% CoceProviders | html %]";
707
        var PREF_BrowseResultSelection = parseInt( "[% Koha.Preference('BrowseResultSelection') | html %]", 10);
709
        var PREF_BrowseResultSelection = parseInt( "[% Koha.Preference('BrowseResultSelection') | html %]", 10);
710
        var PREF_HighlightedWords = "[% Koha.Preference('HighlightedWords') | html %]";
708
        var PREF_NotHighlightedWords = "[% Koha.Preference('NotHighlightedWords') | html %]";
711
        var PREF_NotHighlightedWords = "[% Koha.Preference('NotHighlightedWords') | html %]";
709
        var biblionumber = "[% biblionumber | html %]";
712
        var biblionumber = "[% biblionumber | html %]";
710
        var holdfor_cardnumber = "[% holdfor_cardnumber | html %]";
713
        var holdfor_cardnumber = "[% holdfor_cardnumber | html %]";
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js (-7 / +12 lines)
Lines 1-4 Link Here
1
/* global KOHA biblionumber new_results_browser addMultiple vShelfAdd openWindow search_result SEARCH_RESULTS PREF_LocalCoverImages PREF_IntranetCoce PREF_CoceProviders CoceHost CoceProviders addRecord delSingleRecord PREF_BrowseResultSelection resetSearchContext addBibToContext delBibToContext getContextBiblioNumbers holdfor_cardnumber holdforclub strQuery PREF_NotHighlightedWords __ */
1
/* global KOHA biblionumber new_results_browser addMultiple vShelfAdd openWindow search_result SEARCH_RESULTS PREF_LocalCoverImages PREF_IntranetCoce PREF_CoceProviders CoceHost CoceProviders addRecord delSingleRecord PREF_BrowseResultSelection resetSearchContext addBibToContext delBibToContext getContextBiblioNumbers holdfor_cardnumber holdforclub strQuery PREF_HighlightedWords PREF_NotHighlightedWords __ */
2
2
3
function verify_cover_images() {
3
function verify_cover_images() {
4
    /* Loop over each container in the template which contains covers */
4
    /* Loop over each container in the template which contains covers */
Lines 202-218 $(document).ready(function() { Link Here
202
        while ( q_array.length > 0 && q_array[q_array.length-1] == "") {
202
        while ( q_array.length > 0 && q_array[q_array.length-1] == "") {
203
            q_array = q_array.splice(0,-1);
203
            q_array = q_array.splice(0,-1);
204
        }
204
        }
205
        highlightOn();
205
        $("#highlight_toggle_off" ).hide().click(function(e) {
206
        $("#highlight_toggle_on" ).hide().click(function(e) {
207
            e.preventDefault();
206
            e.preventDefault();
208
            highlightOn();
207
            highlightOff();
209
        });
208
        });
210
        $("#highlight_toggle_off").show().click(function(e) {
209
        $("#highlight_toggle_on").show().click(function(e) {
211
            e.preventDefault();
210
            e.preventDefault();
212
            highlightOff();
211
            highlightOn();
213
        });
212
        });
214
    }
213
    }
215
214
215
    if( PREF_HighlightedWords == 1 ){
216
        highlightOn();
217
    } else {
218
    highlightOff();
219
    }
220
    
221
216
    if( SEARCH_RESULTS ){
222
    if( SEARCH_RESULTS ){
217
        var browser = KOHA.browser( search_result.searchid, parseInt( biblionumber, 10));
223
        var browser = KOHA.browser( search_result.searchid, parseInt( biblionumber, 10));
218
        browser.create( search_result.first_result_number, search_result.query_cgi, search_result.limit_cgi, search_result.sort_by, new_results_browser, search_result.total );
224
        browser.create( search_result.first_result_number, search_result.query_cgi, search_result.limit_cgi, search_result.sort_by, new_results_browser, search_result.total );
219
- 

Return to bug 20398