use CGI;
use List::MoreUtils qw( uniq );
-use JSON qw( encode_json );
-use Try::Tiny;
+use Try::Tiny qw( catch try );
use C4::Auth qw( get_template_and_user );
use C4::Output qw( output_html_with_http_headers );
-use C4::AuthoritiesMarc qw( BuildSummary ModAuthority );
-use C4::Biblio qw( GetMarcBiblio ModBiblio );
-use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModificationTemplates );
+use C4::Auth qw( get_template_and_user );
+use C4::MarcModificationTemplates qw(
+ GetModificationTemplateActions
+ GetModificationTemplates
+);
use Koha::Biblios;
use Koha::BackgroundJob::BatchUpdateBiblio;
use Koha::MetadataRecord::Authority;
use Koha::Virtualshelves;
-my $input = new CGI;
+my $input = CGI->new;
our $dbh = C4::Context->dbh;
my $op = $input->param('op') // q|form|;
my $recordtype = $input->param('recordtype') // 'biblio';
# Display the form
$template->param(
view => 'form',
+ lists => Koha::Virtualshelves->search(
+ [
+ { public => 0, owner => $loggedinuser },
+ { public => 1 }
+ ]
+ )
);
} elsif ( $op eq 'list' ) {
# List all records to process
}
} else {
# The user enters manually the list of id
- push @record_ids, split( /\s\n/, $input->param('recordnumber_list') );
+ push @record_ids, split( /\s\n/, scalar $input->param('recordnumber_list') );
}
for my $record_id ( uniq @record_ids ) {
my @record_ids = $input->multi_param('record_id');
try {
+ my $patron = Koha::Patrons->find( $loggedinuser );
my $params = {
- mmtid => $mmtid,
- record_ids => \@record_ids,
+ mmtid => $mmtid,
+ record_ids => \@record_ids,
+ overlay_context => {
+ source => 'batchmod',
+ categorycode => $patron->categorycode,
+ userid => $patron->userid
+ }
};
my $job_id =