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

(-)a/reserve/request.pl (-21 / +31 lines)
Lines 34-40 use Date::Calc qw( Date_to_Days ); Link Here
34
use C4::Output      qw( output_html_with_http_headers );
34
use C4::Output      qw( output_html_with_http_headers );
35
use C4::Auth        qw( get_template_and_user );
35
use C4::Auth        qw( get_template_and_user );
36
use C4::Reserves
36
use C4::Reserves
37
    qw( RevertWaitingStatus AlterPriority ToggleLowestPriority ToggleSuspend CanBookBeReserved GetMaxPatronHoldsForRecord CanItemBeReserved IsAvailableForItemLevelRequest );
37
    qw( RevertWaitingStatus AlterPriority ToggleLowestPriority CanBookBeReserved GetMaxPatronHoldsForRecord CanItemBeReserved IsAvailableForItemLevelRequest );
38
use C4::Items       qw( get_hostitemnumbers_of );
38
use C4::Items       qw( get_hostitemnumbers_of );
39
use C4::Koha        qw( getitemtypeimagelocation );
39
use C4::Koha        qw( getitemtypeimagelocation );
40
use C4::Serials     qw( CountSubscriptionFromBiblionumber );
40
use C4::Serials     qw( CountSubscriptionFromBiblionumber );
Lines 90-96 my $warnings; Link Here
90
my $messages;
90
my $messages;
91
my $exceeded_maxreserves;
91
my $exceeded_maxreserves;
92
my $exceeded_holds_per_record;
92
my $exceeded_holds_per_record;
93
my @failed_holds = $input->multi_param('failed_holds');
93
my @failed_holds   = $input->multi_param('failed_holds');
94
my $form_submitted = $input->param('form_submitted');
94
95
95
my $op = $input->param('op') || q{};
96
my $op = $input->param('op') || q{};
96
97
Lines 118-127 if ( $op eq 'cud-move' ) { Link Here
118
} elsif ( $op eq 'cud-setLowestPriority' ) {
119
} elsif ( $op eq 'cud-setLowestPriority' ) {
119
    my $reserve_id = $input->param('reserve_id');
120
    my $reserve_id = $input->param('reserve_id');
120
    ToggleLowestPriority($reserve_id);
121
    ToggleLowestPriority($reserve_id);
121
} elsif ( $op eq 'cud-toggleSuspend' ) {
122
} elsif ( $op eq 'cud-suspend' ) {
122
    my $reserve_id    = $input->param('reserve_id');
123
    my $reserve_id    = $input->param('reserve_id');
123
    my $suspend_until = $input->param('suspend_until');
124
    my $suspend_until = $input->param('suspend_until');
124
    ToggleSuspend( $reserve_id, $suspend_until );
125
    my $hold          = Koha::Holds->find($reserve_id);
126
    $hold->suspend_hold($suspend_until) if $hold;
127
} elsif ( $op eq 'cud-unsuspend' ) {
128
    my $reserve_id = $input->param('reserve_id');
129
    my $hold       = Koha::Holds->find($reserve_id);
130
    $hold->resume() if $hold;
125
} elsif ( $op eq 'cud-cancel_bulk' ) {
131
} elsif ( $op eq 'cud-cancel_bulk' ) {
126
    my $cancellation_reason = $input->param("cancellation-reason");
132
    my $cancellation_reason = $input->param("cancellation-reason");
127
    my @hold_ids            = split( ',', scalar $input->param("ids") );
133
    my @hold_ids            = split( ',', scalar $input->param("ids") );
Lines 142-165 if ($findborrower) { Link Here
142
    $borrowernumber_hold = $patron->borrowernumber if $patron;
148
    $borrowernumber_hold = $patron->borrowernumber if $patron;
143
}
149
}
144
150
145
if ($findclub) {
151
if ($form_submitted) {
146
    my $club = Koha::Clubs->find( { name => $findclub } );
152
    if ($findclub) {
147
    if ($club) {
153
        my $club = Koha::Clubs->find( { name => $findclub } );
148
        $club_hold = $club->id;
154
        if ($club) {
149
    } else {
155
            $club_hold = $club->id;
150
        my @clubs = Koha::Clubs->search(
151
            [
152
                { name        => { like => '%' . $findclub . '%' } },
153
                { description => { like => '%' . $findclub . '%' } }
154
            ]
155
        )->as_list;
156
        if ( scalar @clubs == 1 ) {
157
            $club_hold = $clubs[0]->id;
158
        } elsif (@clubs) {
159
            $template->param( clubs => \@clubs );
160
        } else {
156
        } else {
161
            $messageclub = "'$findclub'";
157
            my @clubs = Koha::Clubs->search(
158
                [
159
                    { name        => { like => '%' . $findclub . '%' } },
160
                    { description => { like => '%' . $findclub . '%' } }
161
                ]
162
            )->as_list;
163
            if ( scalar @clubs == 1 ) {
164
                $club_hold = $clubs[0]->id;
165
            } elsif (@clubs) {
166
                $template->param( clubs => \@clubs );
167
            } else {
168
                $messageclub = "'$findclub'";
169
            }
162
        }
170
        }
171
    } else {
172
        my @clubs = Koha::Clubs->search()->as_list;
173
        $template->param( clubs => \@clubs );
163
    }
174
    }
164
}
175
}
165
176
166
- 

Return to bug 9762