query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { borrowers => 1 },
+ flagsrequired => { borrowers => 'edit_borrowers' },
debug => 1,
}
);
my $branchcode = $input->param('branchcode');
my $message_type = $input->param('message_type');
my $borrower_message = $input->param('borrower_message');
+my $batch = $input->param('batch');
Koha::Patron::Message->new(
{
}
)->store;
-my $url = $input->referer() // "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber";
+my $url = $input->referer;
+if ( $url ) {
+ if ( $url =~ m|circulation\.pl$| ) {
+ # Trick for POST form from batch checkouts
+ $url .= "?borrowernumber=$borrowernumber";
+ $url .= "&batch=1" if $batch;
+ }
+} else {
+ $url = "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber";
+}
print $input->redirect($url);