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

(-)a/members/member.pl (-5 / +9 lines)
Lines 46-52 my $searchmember = $input->param('searchmember'); Link Here
46
my $quicksearch  = $input->param('quicksearch') // 0;
46
my $quicksearch  = $input->param('quicksearch') // 0;
47
my $circsearch   = $input->param('circsearch')  // 0;
47
my $circsearch   = $input->param('circsearch')  // 0;
48
48
49
if ( $quicksearch and $searchmember && !$circsearch ) {
49
if ( $quicksearch and $searchmember ) {
50
    my $branchcode;
50
    my $branchcode;
51
    if (C4::Context::only_my_library) {
51
    if (C4::Context::only_my_library) {
52
        my $userenv = C4::Context->userenv;
52
        my $userenv = C4::Context->userenv;
Lines 60-66 if ( $quicksearch and $searchmember && !$circsearch ) { Link Here
60
                or ( not $branchcode ) )
60
                or ( not $branchcode ) )
61
            )
61
            )
62
        {
62
        {
63
            print $input->redirect( "/cgi-bin/koha/members/moremember.pl?borrowernumber=" . $patron->borrowernumber );
63
            my $redirect_url =
64
                $circsearch ? '/cgi-bin/koha/circ/circulation.pl' : '/cgi-bin/koha/members/moremember.pl';
65
            print $input->redirect( "$redirect_url?borrowernumber=" . $patron->borrowernumber );
64
            exit;
66
            exit;
65
        }
67
        }
66
    };
68
    };
Lines 72-79 if ( $quicksearch and $searchmember && !$circsearch ) { Link Here
72
    $maybe_redirect->($patron) if ($patron);
74
    $maybe_redirect->($patron) if ($patron);
73
75
74
    if ( C4::Context->preference('UniqueExtendedAttributesQuickSearch') ) {
76
    if ( C4::Context->preference('UniqueExtendedAttributesQuickSearch') ) {
77
75
        # Search all unique patron attributes
78
        # Search all unique patron attributes
76
        my @unique_types = Koha::Patron::Attribute::Types->search( { 'unique_id' => 1, 'staff_searchable' => 1, 'searched_by_default' => 1 } )->as_list;
79
        my @unique_types = Koha::Patron::Attribute::Types->search(
80
            { 'unique_id' => 1, 'staff_searchable' => 1, 'searched_by_default' => 1 } )->as_list;
77
        my @attribute_conditions;
81
        my @attribute_conditions;
78
        for my $type (@unique_types) {
82
        for my $type (@unique_types) {
79
            push @attribute_conditions, [
83
            push @attribute_conditions, [
Lines 85-91 if ( $quicksearch and $searchmember && !$circsearch ) { Link Here
85
        }
89
        }
86
90
87
        if (@attribute_conditions) {
91
        if (@attribute_conditions) {
88
            my @patrons = Koha::Patrons->search( \@attribute_conditions, { prefetch => ['extended_attributes'] } )->as_list;
92
            my @patrons =
93
                Koha::Patrons->search( \@attribute_conditions, { prefetch => ['extended_attributes'] } )->as_list;
89
94
90
            # The only case where could be more than one is when multiple unique attribute has the same value for different patrons
95
            # The only case where could be more than one is when multiple unique attribute has the same value for different patrons
91
            # which should be unlikely. If that is the case we should perform a full search.
96
            # which should be unlikely. If that is the case we should perform a full search.
92
- 

Return to bug 39229