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 145-166 if ($findborrower) { Link Here
145
    $borrowernumber_hold = $patron->borrowernumber if $patron;
146
    $borrowernumber_hold = $patron->borrowernumber if $patron;
146
}
147
}
147
148
148
if($findclub) {
149
if ($form_submitted) {
149
    my $club = Koha::Clubs->find( { name => $findclub } );
150
    if ($findclub) {
150
    if( $club ) {
151
        my $club = Koha::Clubs->find( { name => $findclub } );
151
        $club_hold = $club->id;
152
        if ($club) {
152
    } else {
153
            $club_hold = $club->id;
153
        my @clubs = Koha::Clubs->search( [
154
            { name => { like => '%'.$findclub.'%' } },
155
            { description => { like => '%'.$findclub.'%' } }
156
        ] )->as_list;
157
        if( scalar @clubs == 1 ) {
158
            $club_hold = $clubs[0]->id;
159
        } elsif ( @clubs ) {
160
            $template->param( clubs => \@clubs );
161
        } else {
154
        } else {
162
            $messageclub = "'$findclub'";
155
            my @clubs = Koha::Clubs->search(
156
                [
157
                    { name        => { like => '%' . $findclub . '%' } },
158
                    { description => { like => '%' . $findclub . '%' } }
159
                ]
160
            )->as_list;
161
            if ( scalar @clubs == 1 ) {
162
                $club_hold = $clubs[0]->id;
163
            } elsif (@clubs) {
164
                $template->param( clubs => \@clubs );
165
            } else {
166
                $messageclub = "'$findclub'";
167
            }
163
        }
168
        }
169
    } else {
170
        my @clubs = Koha::Clubs->search()->as_list;
171
        $template->param( clubs => \@clubs );
164
    }
172
    }
165
}
173
}
166
174
167
- 

Return to bug 37427