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

(-)a/installer/data/mysql/atomicupdate/bug_27113-elasticsearch_autocomplete_input_search.perl (-2 / +2 lines)
Lines 1-9 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
3
    # you can use $dbh here like:
4
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OPACAutocompleteElasticSearch', '0', NULL, 'If ON, show search suggestions in the OPAC when using Elasticsearch.', 'YesNo')});
4
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('OPACAutocompleteElasticsearch', '0', NULL, 'If ON, show search suggestions in the OPAC when using Elasticsearch.', 'YesNo')});
5
5
6
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('IntranetAutocompleteElasticSearch', '0', NULL, 'If ON, show search suggestions in the staff interface when using Elasticsearch.', 'YesNo')});
6
    $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('StaffInterfaceAutocompleteElasticsearch', '0', NULL, 'If ON, show search suggestions in the staff interface when using Elasticsearch.', 'YesNo')});
7
7
8
    # Always end with this (adjust the bug info)
8
    # Always end with this (adjust the bug info)
9
    NewVersion( $DBversion, 27113, "Autocomplete with Elasticsearch");
9
    NewVersion( $DBversion, 27113, "Autocomplete with Elasticsearch");
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-2 / +2 lines)
Lines 348-354 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
348
('IndependentBranchesPatronModifications','0', NULL, 'Show only modification request for the logged in branch','YesNo'),
348
('IndependentBranchesPatronModifications','0', NULL, 'Show only modification request for the logged in branch','YesNo'),
349
('IndependentBranchesTransfers','0', NULL, 'Allow non-superlibrarians to transfer items between libraries','YesNo'),
349
('IndependentBranchesTransfers','0', NULL, 'Allow non-superlibrarians to transfer items between libraries','YesNo'),
350
('IntranetAddMastheadLibraryPulldown','0', NULL, 'Add a library select pulldown menu on the staff header search','YesNo'),
350
('IntranetAddMastheadLibraryPulldown','0', NULL, 'Add a library select pulldown menu on the staff header search','YesNo'),
351
('IntranetAutocompleteElasticSearch','0',NULL,'If ON, show search suggestions in the staff interface when using Elasticsearch.','YesNo'),
351
('StaffInterfaceAutocompleteElasticsearch','0',NULL,'If ON, show search suggestions in the staff interface when using Elasticsearch.','YesNo'),
352
('IntranetBiblioDefaultView','normal','normal|marc|isbd|labeled_marc','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','Choice'),
352
('IntranetBiblioDefaultView','normal','normal|marc|isbd|labeled_marc','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','Choice'),
353
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
353
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
354
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
354
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
Lines 485-491 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
485
('OPACAmazonCoverImages','0','','Display cover images on OPAC from Amazon Web Services','YesNo'),
485
('OPACAmazonCoverImages','0','','Display cover images on OPAC from Amazon Web Services','YesNo'),
486
('OPACAuthorIdentifiersAndInformation', '', '', 'Display author information on the OPAC detail page','multiple_sortable'),
486
('OPACAuthorIdentifiersAndInformation', '', '', 'Display author information on the OPAC detail page','multiple_sortable'),
487
('OpacAuthorities','1',NULL,'If ON, enables the search authorities link on OPAC','YesNo'),
487
('OpacAuthorities','1',NULL,'If ON, enables the search authorities link on OPAC','YesNo'),
488
('OPACAutocompleteElasticSearch','0',NULL,'If ON, show search suggestions in the OPAC when using Elasticsearch.','YesNo'),
488
('OPACAutocompleteElasticsearch','0',NULL,'If ON, show search suggestions in the OPAC when using Elasticsearch.','YesNo'),
489
('OPACBaseURL','',NULL,'Specify the Base URL of the OPAC, e.g., http://opac.mylibrary.com, including the protocol (http:// or https://). Otherwise, the http:// will be added automatically by Koha upon saving.','Free'),
489
('OPACBaseURL','',NULL,'Specify the Base URL of the OPAC, e.g., http://opac.mylibrary.com, including the protocol (http:// or https://). Otherwise, the http:// will be added automatically by Koha upon saving.','Free'),
490
('opacbookbag','1','','If ON, enables display of Cart feature','YesNo'),
490
('opacbookbag','1','','If ON, enables display of Cart feature','YesNo'),
491
('OpacBrowser','0',NULL,'If ON, enables subject authorities browser on OPAC (needs to set misc/cronjob/sbuild_browser_and_cloud.pl)','YesNo'),
491
('OpacBrowser','0',NULL,'If ON, enables subject authorities browser on OPAC (needs to set misc/cronjob/sbuild_browser_and_cloud.pl)','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/js/elasticsearch/autocomplete.js (-1 / +1 lines)
Lines 158-164 function autocomplete(inp, nb, left, right) { Link Here
158
                    for (j = 0; j < tmp_data[i]['highlight'][pref[k] + '.' + key].length; j++){
158
                    for (j = 0; j < tmp_data[i]['highlight'][pref[k] + '.' + key].length; j++){
159
                        /* div with data for autocomplete */
159
                        /* div with data for autocomplete */
160
                        let tmp = tmp_data[i]['highlight'][pref[k] + '.' + key][j]
160
                        let tmp = tmp_data[i]['highlight'][pref[k] + '.' + key][j]
161
                        myset.add(tmp.replace(/[ &#,+()$~%.'":*?<{}!/;]+$/g, ''));
161
                        myset.add(tmp.replace(/[ &#,+($~%.:*?<{!/;]+$/g, ''));
162
                        if (myset.size >= nb_autocomplete) break;
162
                        if (myset.size >= nb_autocomplete) break;
163
                    };
163
                    };
164
                    if (myset.size >= nb_autocomplete) break;
164
                    if (myset.size >= nb_autocomplete) break;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc (-2 / +2 lines)
Lines 98-105 Link Here
98
[% IF Koha.Preference( 'CookieConsent' ) %]
98
[% IF Koha.Preference( 'CookieConsent' ) %]
99
    [% Asset.js("js/cookieconsent.js") | $raw %]
99
    [% Asset.js("js/cookieconsent.js") | $raw %]
100
[% END %]
100
[% END %]
101
<!-- Intranet inc JS IntranetAutocompleteElasticSearch -->
101
<!-- Intranet inc JS StaffInterfaceAutocompleteElasticsearch -->
102
[% IF ( Koha.Preference('IntranetAutocompleteElasticSearch') ) %]
102
[% IF ( Koha.Preference('StaffInterfaceAutocompleteElasticsearch') ) %]
103
[% Asset.js("js/elasticsearch/autocomplete.js") | $raw %]
103
[% Asset.js("js/elasticsearch/autocomplete.js") | $raw %]
104
[% END %]
104
[% END %]
105
<!-- / js_includes.inc -->
105
<!-- / js_includes.inc -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (-2 / +2 lines)
Lines 393-399 Searching: Link Here
393
              class: url
393
              class: url
394
            - "Please only change this if you are sure it needs changing."
394
            - "Please only change this if you are sure it needs changing."
395
        -
395
        -
396
            - pref: OPACAutocompleteElasticSearch
396
            - pref: OPACAutocompleteElasticsearch
397
              type: boolean
397
              type: boolean
398
              default: 0
398
              default: 0
399
              choices:
399
              choices:
Lines 401-407 Searching: Link Here
401
                  0: "Don't show"
401
                  0: "Don't show"
402
            - search suggestions in the OPAC when using Elasticsearch.
402
            - search suggestions in the OPAC when using Elasticsearch.
403
        -
403
        -
404
            - pref: IntranetAutocompleteElasticSearch
404
            - pref: StaffInterfaceAutocompleteElasticsearch
405
              type: boolean
405
              type: boolean
406
              default: 0
406
              default: 0
407
              choices:
407
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-2 / +2 lines)
Lines 393-400 Link Here
393
            var dad  = line.parentNode;
393
            var dad  = line.parentNode;
394
            dad.appendChild(line.cloneNode(true));
394
            dad.appendChild(line.cloneNode(true));
395
            line.removeChild(ButtonPlus);
395
            line.removeChild(ButtonPlus);
396
            /* Intranet JS IntranetAutocompleteElasticSearch */
396
            /* Intranet JS StaffInterfaceAutocompleteElasticsearch */
397
            [% IF ( Koha.Preference('IntranetAutocompleteElasticSearch') ) %]
397
            [% IF ( Koha.Preference('StaffInterfaceAutocompleteElasticsearch') ) %]
398
                AutocompleteInitIntranet();
398
                AutocompleteInitIntranet();
399
            [% END %]
399
            [% END %]
400
        }
400
        }
(-)a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss (-2 / +2 lines)
Lines 3013-3024 fieldset.brief label.show-password-toggle-label { Link Here
3013
3013
3014
        &:hover {
3014
        &:hover {
3015
            /*when hovering an item:*/
3015
            /*when hovering an item:*/
3016
            background-color: #e9e9e9;
3016
            background-color: lighten( $dropdown-dark-color, 20 );
3017
        }
3017
        }
3018
3018
3019
        &.autocomplete-active {
3019
        &.autocomplete-active {
3020
            /*when navigating through the items using the arrow keys:*/
3020
            /*when navigating through the items using the arrow keys:*/
3021
            background-color: lighten( $input-btn-focus-color, 45% );
3021
            background-color: lighten( $dropdown-dark-color, 20 );
3022
        }
3022
        }
3023
    }
3023
    }
3024
}
3024
}
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-2 / +2 lines)
Lines 192-199 Link Here
192
[% INCLUDE 'js-date-format.inc' %]
192
[% INCLUDE 'js-date-format.inc' %]
193
[% INCLUDE 'js-biblio-format.inc' %]
193
[% INCLUDE 'js-biblio-format.inc' %]
194
[% PROCESS jsinclude %]
194
[% PROCESS jsinclude %]
195
<!-- OPAC *.inc JS OPACAutocompleteElasticSearch -->
195
<!-- OPAC *.inc JS OPACAutocompleteElasticsearch -->
196
[% IF ( Koha.Preference('OPACAutocompleteElasticSearch') ) %]
196
[% IF ( Koha.Preference('OPACAutocompleteElasticsearch') ) %]
197
    [% Asset.js("js/opac-elasticsearch/opac-autocomplete.js") | $raw %]
197
    [% Asset.js("js/opac-elasticsearch/opac-autocomplete.js") | $raw %]
198
[% END %]
198
[% END %]
199
[% IF ( Koha.Preference('OPACUserJS') ) %]
199
[% IF ( Koha.Preference('OPACUserJS') ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt (-5 / +4 lines)
Lines 612-619 Link Here
612
                $(newLine).find('.search-term-input select[name="op"]').first().prop("disabled",false).show();
612
                $(newLine).find('.search-term-input select[name="op"]').first().prop("disabled",false).show();
613
                newLine.find('input').val('');
613
                newLine.find('input').val('');
614
                thisLine.after(newLine);
614
                thisLine.after(newLine);
615
                /* OPAC JS OPACAutocompleteElasticSearch */
615
                /* OPAC JS OPACAutocompleteElasticsearch */
616
                [% IF ( Koha.Preference('OPACAutocompleteElasticSearch') ) %]
616
                [% IF ( Koha.Preference('OPACAutocompleteElasticsearch') ) %]
617
                    AutocompleteInitOpac();
617
                    AutocompleteInitOpac();
618
                [% END %]
618
                [% END %]
619
            });
619
            });
Lines 625-632 Link Here
625
                }
625
                }
626
                $(this).parent().parent().remove();
626
                $(this).parent().parent().remove();
627
                $('.search-term-row .search-term-input select[name="op"]').first().prop("disabled",true).hide();
627
                $('.search-term-row .search-term-input select[name="op"]').first().prop("disabled",true).hide();
628
                /* OPAC JS OPACAutocompleteElasticSearch */
628
                /* OPAC JS OPACAutocompleteElasticsearch */
629
                [% IF ( Koha.Preference('OPACAutocompleteElasticSearch') ) %]
629
                [% IF ( Koha.Preference('OPACAutocompleteElasticsearch') ) %]
630
                    AutocompleteInitOpac();
630
                    AutocompleteInitOpac();
631
                [% END %]
631
                [% END %]
632
            });
632
            });
633
- 

Return to bug 27113