Lines 90-132
my $action = $input->param('action');
Link Here
|
90 |
$action ||= q{}; |
90 |
$action ||= q{}; |
91 |
|
91 |
|
92 |
if ( $action eq 'move' ) { |
92 |
if ( $action eq 'move' ) { |
93 |
my $where = $input->param('where'); |
93 |
my $where = $input->param('where'); |
94 |
my $reserve_id = $input->param('reserve_id'); |
94 |
my $reserve_id = $input->param('reserve_id'); |
95 |
my $prev_priority = $input->param('prev_priority'); |
95 |
my $prev_priority = $input->param('prev_priority'); |
96 |
my $next_priority = $input->param('next_priority'); |
96 |
my $next_priority = $input->param('next_priority'); |
97 |
my $first_priority = $input->param('first_priority'); |
97 |
my $first_priority = $input->param('first_priority'); |
98 |
my $last_priority = $input->param('last_priority'); |
98 |
my $last_priority = $input->param('last_priority'); |
99 |
my $hold_itemnumber = $input->param('itemnumber'); |
99 |
my $hold_itemnumber = $input->param('itemnumber'); |
100 |
if ( $prev_priority == 0 && $next_priority == 1 ){ |
100 |
if ( $prev_priority == 0 && $next_priority == 1 ) { |
101 |
C4::Reserves::RevertWaitingStatus({ itemnumber => $hold_itemnumber }); |
101 |
C4::Reserves::RevertWaitingStatus( { itemnumber => $hold_itemnumber } ); |
102 |
} else { |
102 |
} |
103 |
AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ); |
103 |
else { |
104 |
} |
104 |
AlterPriority( |
105 |
} elsif ( $action eq 'cancel' ) { |
105 |
$where, $reserve_id, $prev_priority, |
106 |
my $reserve_id = $input->param('reserve_id'); |
106 |
$next_priority, $first_priority, $last_priority |
107 |
my $cancellation_reason = $input->param("cancellation-reason"); |
107 |
); |
108 |
my $hold = Koha::Holds->find( $reserve_id ); |
108 |
} |
109 |
$hold->cancel({ cancellation_reason => $cancellation_reason }) if $hold; |
109 |
} |
110 |
} elsif ( $action eq 'setLowestPriority' ) { |
110 |
elsif ( $action eq 'cancel' ) { |
111 |
my $reserve_id = $input->param('reserve_id'); |
111 |
my $reserve_id = $input->param('reserve_id'); |
112 |
ToggleLowestPriority( $reserve_id ); |
112 |
my $cancellation_reason = $input->param("cancellation-reason"); |
113 |
} elsif ( $action eq 'toggleSuspend' ) { |
113 |
my $hold = Koha::Holds->find($reserve_id); |
114 |
my $reserve_id = $input->param('reserve_id'); |
114 |
$hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold; |
115 |
my $suspend_until = $input->param('suspend_until'); |
115 |
} |
116 |
ToggleSuspend( $reserve_id, $suspend_until ); |
116 |
elsif ( $action eq 'setLowestPriority' ) { |
117 |
} elsif ( $action eq 'cancelBulk') { |
117 |
my $reserve_id = $input->param('reserve_id'); |
118 |
my $cancellation_reason = $input->param("cancellation-reason"); |
118 |
ToggleLowestPriority($reserve_id); |
119 |
my @hold_ids = split ',', $input->param("ids"); |
119 |
} |
120 |
my $params = { |
120 |
elsif ( $action eq 'toggleSuspend' ) { |
121 |
reason => $cancellation_reason, |
121 |
my $reserve_id = $input->param('reserve_id'); |
122 |
hold_ids => \@hold_ids, |
122 |
my $suspend_until = $input->param('suspend_until'); |
123 |
}; |
123 |
ToggleSuspend( $reserve_id, $suspend_until ); |
124 |
my $job_id = Koha::BackgroundJob::BatchCancelHold->new->enqueue($params); |
124 |
} |
125 |
|
125 |
elsif ( $action eq 'cancelBulk' ) { |
126 |
$template->param( |
126 |
my $cancellation_reason = $input->param("cancellation-reason"); |
127 |
enqueued => 1, |
127 |
my @hold_ids = split ',', $input->param("ids"); |
128 |
job_id => $job_id |
128 |
my $params = { |
129 |
) |
129 |
reason => $cancellation_reason, |
|
|
130 |
hold_ids => \@hold_ids, |
131 |
}; |
132 |
my $job_id = Koha::BackgroundJob::BatchCancelHold->new->enqueue($params); |
133 |
|
134 |
$template->param( |
135 |
enqueued => 1, |
136 |
job_id => $job_id |
137 |
); |
130 |
} |
138 |
} |
131 |
|
139 |
|
132 |
if ($findborrower) { |
140 |
if ($findborrower) { |
133 |
- |
|
|