use C4::Auth qw( get_template_and_user );
use C4::Output qw( output_html_with_http_headers );
-use C4::AuthoritiesMarc qw( BuildSummary GetAuthTypeCode ModAuthority );
+use C4::AuthoritiesMarc qw( BuildSummary ModAuthority );
use C4::BackgroundJob;
use C4::Biblio qw( GetMarcBiblio ModBiblio );
use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModificationTemplates ModifyRecordWithTemplate );
-use Koha::Authority;
+
+use Koha::Biblios;
+use Koha::MetadataRecord::Authority;
my $input = new CGI;
our $dbh = C4::Context->dbh;
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { tools => 'biblio_batchmod' },
+ flagsrequired => { tools => 'records_batchmod' },
});
for my $record_id ( uniq @record_ids ) {
if ( $recordtype eq 'biblio' ) {
# Retrieve biblio information
- my $biblio = C4::Biblio::GetBiblio( $record_id );
+ my $biblio = Koha::Biblios->find( $record_id );
unless ( $biblio ) {
push @messages, {
type => 'warning',
push @records, $biblio;
} else {
# Retrieve authority information
- my $authority = Koha::Authority->get_from_authid( $record_id );
+ my $authority = Koha::MetadataRecord::Authority->get_from_authid( $record_id );
unless ( $authority ) {
push @messages, {
type => 'warning',
);
} elsif ( $op eq 'modify' ) {
# We want to modify selected records!
- my @record_ids = $input->param('record_id');
+ my @record_ids = $input->multi_param('record_id');
my ( $job );
if ( $runinbackground ) {
# Finally, modify the biblio
my $error = eval {
- my $record = GetMarcBiblio( $biblionumber );
+ my $record = GetMarcBiblio({ biblionumber => $biblionumber });
ModifyRecordWithTemplate( $mmtid, $record );
my $frameworkcode = C4::Biblio::GetFrameworkCode( $biblionumber );
ModBiblio( $record, $biblionumber, $frameworkcode );
# Authorities
my $authid = $record_id;
my $error = eval {
- my $authority = Koha::Authority->get_from_authid( $authid );
+ my $authority = Koha::MetadataRecord::Authority->get_from_authid( $authid );
my $record = $authority->record;
ModifyRecordWithTemplate( $mmtid, $record );
- ModAuthority( $authid, $record, GetAuthTypeCode( $authid ) );
+ ModAuthority( $authid, $record, $authority->authtypecode );
};
if ( $error and $error != $authid or $@ ) {
push @messages, {