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

(-)a/installer/data/mysql/atomicupdate/add-system-preference-StaffHighlightedWords.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 ('StaffHighlightedWords','1','','Activate or not highlighting of search terms for staff interface','YesNo ')
6
    });
7
    NewVersion( $DBversion, '20398', 'Add system preference StaffHighlightedWords');
8
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 237-242 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
237
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
237
('hidelostitems','0','','If ON, disables display of\"lost\" items in OPAC.','YesNo'),
238
('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
('HidePatronName','0','','If this is switched on, patron\'s cardnumber will be shown instead of their name on the holds and catalog screens','YesNo'),
239
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
239
('hide_marc','0',NULL,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)','YesNo'),
240
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
240
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
241
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
241
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
242
('HoldsAutoFill','0',NULL,'If on, librarian will not be asked if hold should be filled, it will be filled automatically','YesNo'),
242
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo'),
243
('HoldsAutoFillPrintSlip','0',NULL,'If on, hold slip print dialog will be displayed automatically','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (+7 lines)
Lines 120-125 Staff interface: Link Here
120
              type: textarea
120
              type: textarea
121
              syntax: text/html
121
              syntax: text/html
122
              class: code
122
              class: code
123
        -
124
            - pref: StaffHighlightedWords
125
              type: boolean
126
              choices:
127
                  1: Highlight
128
                  0: Don't highlight
129
            - words searched for in the staff interface search results pages.
123
    Options:
130
    Options:
124
        -
131
        -
125
            - pref: viewMARC
132
            - pref: viewMARC
(-)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("StaffHighlightedWords") == 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_StaffHighlightedWords = "[% Koha.Preference('StaffHighlightedWords') | 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 __ Cookies */
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_StaffHighlightedWords 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_StaffHighlightedWords == 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