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

(-)a/installer/data/mysql/atomicupdate/bug_33117.pl (+18 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "33117",
5
    description => "Patron checkout is not able to find patrons if using a second surname or other name during the search",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{INSERT INTO systempreferences (`variable`,`value`,`explanation`,`options`,`type`) VALUES
11
                  ('PatronAutoCompleteSearchMethod','1','Allows staff to search for patrons using the method','Starts with|Contains','YesNo')
12
                  });
13
14
15
        say $out "Added new system preference 'PatronAutoCompleteSearchMethod'";
16
17
    },
18
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 551-556 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
551
('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'),
551
('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'),
552
('PatronAnonymizeDelay','',NULL,'Delay for anonymizing patrons', 'Integer'),
552
('PatronAnonymizeDelay','',NULL,'Delay for anonymizing patrons', 'Integer'),
553
('PatronAutoComplete','1','Try|Don\'t try','to guess the patron being entered while typing a patron search for circulation or patron search. Only returns the first 10 results at a time.','YesNo'),
553
('PatronAutoComplete','1','Try|Don\'t try','to guess the patron being entered while typing a patron search for circulation or patron search. Only returns the first 10 results at a time.','YesNo'),
554
('PatronAutoCompleteSearchMethod','1','Allows staff to search for patrons using the method','Starts with|Contains','YesNo'),
554
('PatronDuplicateMatchingAddFields','surname|firstname|dateofbirth', NULL,'A list of fields separated by "|" to deduplicate patrons when created','Free'),
555
('PatronDuplicateMatchingAddFields','surname|firstname|dateofbirth', NULL,'A list of fields separated by "|" to deduplicate patrons when created','Free'),
555
('patronimages','0',NULL,'Enable patron images for the staff interface','YesNo'),
556
('patronimages','0',NULL,'Enable patron images for the staff interface','YesNo'),
556
('PatronRemovalDelay','',NULL,'Delay for removing anonymized patrons', 'Integer'),
557
('PatronRemovalDelay','',NULL,'Delay for removing anonymized patrons', 'Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc (+1 lines)
Lines 72-77 Link Here
72
    <script>
72
    <script>
73
    // PatronAutoComplete
73
    // PatronAutoComplete
74
    var defaultPatronSearchFields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' | html %]";
74
    var defaultPatronSearchFields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' | html %]";
75
    var patronAutoCompleteSearchMethods = "[% Koha.Preference('PatronAutoCompleteSearchMethods') || html %]";
75
    var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]';
76
    var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]';
76
    var singleBranchMode = '[% singleBranchMode | html %]';
77
    var singleBranchMode = '[% singleBranchMode | html %]';
77
    var loggedInClass = "";
78
    var loggedInClass = "";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 26-31 Circulation: Link Here
26
                  0: "Don't try"
26
                  0: "Don't try"
27
            - to guess the patron being entered while typing a patron search for circulation or patron search.
27
            - to guess the patron being entered while typing a patron search for circulation or patron search.
28
            - Only returns the first 10 results at a time.
28
            - Only returns the first 10 results at a time.
29
        -
30
            - pref: PatronAutoCompleteSearchMethod
31
              choices:
32
                  1: Starts with
33
                  0: "Contains"
34
            - to determine whether to automatically begin patron searches using Starts with or Contains.
29
        -
35
        -
30
            - pref: itemBarcodeInputFilter
36
            - pref: itemBarcodeInputFilter
31
              choices:
37
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js (-2 / +2 lines)
Lines 2-7 function patron_autocomplete(node, options) { Link Here
2
    let link_to;
2
    let link_to;
3
    let url_params;
3
    let url_params;
4
    let on_select_callback;
4
    let on_select_callback;
5
    let leading_wildcard = search_type > 0 ? "" : "%";
5
    if ( options ) {
6
    if ( options ) {
6
        if ( options['link-to'] ) {
7
        if ( options['link-to'] ) {
7
            link_to = options['link-to'];
8
            link_to = options['link-to'];
Lines 22-28 function patron_autocomplete(node, options) { Link Here
22
                    let subquery_or = [];
23
                    let subquery_or = [];
23
                    defaultPatronSearchFields.split(',').forEach(function(field,i){
24
                    defaultPatronSearchFields.split(',').forEach(function(field,i){
24
                        subquery_or.push(
25
                        subquery_or.push(
25
                            {["me."+field]: {'like': pattern + '%'}}
26
                            {["me."+field]: {'like': leading_wildcard + pattern + '%'}}
26
                        );
27
                        );
27
                    });
28
                    });
28
                    subquery_and.push(subquery_or);
29
                    subquery_and.push(subquery_or);
29
- 

Return to bug 33117