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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+1 lines)
Lines 283-288 Link Here
283
                                    <form id="holds_clubsearch" action="request.pl" method="get">
283
                                    <form id="holds_clubsearch" action="request.pl" method="get">
284
                                        <div class="hint">Enter club ID or partial name:</div>
284
                                        <div class="hint">Enter club ID or partial name:</div>
285
                                        <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
285
                                        <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" />
286
                                        <input type="hidden" name="form_submitted" value="1" />
286
                                        <input type="submit" class="btn btn-primary" value="Search" />
287
                                        <input type="submit" class="btn btn-primary" value="Search" />
287
                                        [% FOREACH biblionumber IN biblionumbers %]
288
                                        [% FOREACH biblionumber IN biblionumbers %]
288
                                        <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
289
                                        <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
(-)a/reserve/request.pl (-15 / +22 lines)
Lines 89-94 my $messages; Link Here
89
my $exceeded_maxreserves;
89
my $exceeded_maxreserves;
90
my $exceeded_holds_per_record;
90
my $exceeded_holds_per_record;
91
my @failed_holds = $input->multi_param('failed_holds');
91
my @failed_holds = $input->multi_param('failed_holds');
92
my $form_submitted = $input->param('form_submitted');
92
93
93
my $op = $input->param('op') || q{};
94
my $op = $input->param('op') || q{};
94
95
Lines 150-171 if ($findborrower) { Link Here
150
    $borrowernumber_hold = $patron->borrowernumber if $patron;
151
    $borrowernumber_hold = $patron->borrowernumber if $patron;
151
}
152
}
152
153
153
if($findclub) {
154
if ($form_submitted) {
154
    my $club = Koha::Clubs->find( { name => $findclub } );
155
    if ($findclub) {
155
    if( $club ) {
156
        my $club = Koha::Clubs->find( { name => $findclub } );
156
        $club_hold = $club->id;
157
        if ($club) {
157
    } else {
158
            $club_hold = $club->id;
158
        my @clubs = Koha::Clubs->search( [
159
            { name => { like => '%'.$findclub.'%' } },
160
            { description => { like => '%'.$findclub.'%' } }
161
        ] )->as_list;
162
        if( scalar @clubs == 1 ) {
163
            $club_hold = $clubs[0]->id;
164
        } elsif ( @clubs ) {
165
            $template->param( clubs => \@clubs );
166
        } else {
159
        } else {
167
            $messageclub = "'$findclub'";
160
            my @clubs = Koha::Clubs->search(
161
                [
162
                    { name        => { like => '%' . $findclub . '%' } },
163
                    { description => { like => '%' . $findclub . '%' } }
164
                ]
165
            )->as_list;
166
            if ( scalar @clubs == 1 ) {
167
                $club_hold = $clubs[0]->id;
168
            } elsif (@clubs) {
169
                $template->param( clubs => \@clubs );
170
            } else {
171
                $messageclub = "'$findclub'";
172
            }
168
        }
173
        }
174
    } else {
175
        my @clubs = Koha::Clubs->search()->as_list;
176
        $template->param( clubs => \@clubs );
169
    }
177
    }
170
}
178
}
171
179
172
- 

Return to bug 37427