@@ -, +, @@
---
cataloguing/addbiblio.pl | 10 +++++++++-
.../intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 1 +
misc/migration_tools/bulkmarcimport.pl | 3 ++-
misc/migration_tools/import_lexile.pl | 2 +-
tools/batch_record_modification.pl | 13 ++++++++++---
5 files changed, 23 insertions(+), 6 deletions(-)
--- a/cataloguing/addbiblio.pl
+++ a/cataloguing/addbiblio.pl
@@ -853,7 +853,14 @@ if ( $op eq "addbiblio" ) {
}
if ( $is_a_modif ) {
ModBiblioframework( $biblionumber, $frameworkcode );
- ModBiblio( $record, $biblionumber, $frameworkcode );
+ my ($member) = C4::Members::GetMember('borrowernumber' => $loggedinuser);
+ ModBiblio( $record, $biblionumber, $frameworkcode,
+ {
+ source => $z3950 ? 'z39.50' : 'intranet',
+ category => $member->{'category_type'},
+ borrower => $loggedinuser
+ }
+ );
}
else {
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
@@ -946,6 +953,7 @@ elsif ( $op eq "delete" ) {
$template->param(
biblionumberdata => $biblionumber,
op => $op,
+ z3950 => $z3950
);
if ( $op eq "duplicate" ) {
$biblionumber = "";
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
@@ -505,6 +505,7 @@ function Changefwk(FwkList) {
[% END %]
+
--- a/misc/migration_tools/bulkmarcimport.pl
+++ a/misc/migration_tools/bulkmarcimport.pl
@@ -403,7 +403,8 @@ RECORD: while ( ) {
if ($biblionumber) {
eval{$biblioitemnumber=GetBiblioData($biblionumber)->{biblioitemnumber};};
if ($update) {
- eval { ( $biblionumber, $biblioitemnumber ) = ModBiblio( $record, $biblionumber, GetFrameworkCode($biblionumber) ) };
+ eval { ( $biblionumber, $biblioitemnumber ) = ModBiblio( $record, $biblionumber, GetFrameworkCode($biblionumber),
+ { source => 'bulkmarcimport' }) };
if ($@) {
warn "ERROR: Edit biblio $biblionumber failed: $@\n";
printlog( { id => $id || $originalid || $biblionumber, op => "update", status => "ERROR" } ) if ($logfile);
--- a/misc/migration_tools/import_lexile.pl
+++ a/misc/migration_tools/import_lexile.pl
@@ -200,7 +200,7 @@ while ( my $row = $csv->getline_hr($fh) ) {
$record->append_fields($field);
}
- ModBiblio( $record, $biblionumber ) unless ( $test );
+ ModBiblio( $record, $biblionumber, {source => 'import_lexile'} ) unless ( $test );
}
}
--- a/tools/batch_record_modification.pl
+++ a/tools/batch_record_modification.pl
@@ -156,7 +156,7 @@ if ( $op eq 'form' ) {
my ( $job );
if ( $runinbackground ) {
my $job_size = scalar( @record_ids );
- $job = C4::BackgroundJob->new( $sessionID, "FIXME", '/cgi-bin/koha/tools/batch_record_modification.pl', $job_size );
+ $job = C4::BackgroundJob->new( $sessionID, "FIXME", $ENV{SCRIPT_NAME}, $job_size );
my $job_id = $job->id;
if (my $pid = fork) {
$dbh->{InactiveDestroy} = 1;
@@ -169,7 +169,7 @@ if ( $op eq 'form' ) {
close STDOUT;
close STDERR;
} else {
- warn "fork failed while attempting to run tools/batch_record_modification.pl as a background job";
+ warn "fork failed while attempting to run $ENV{'SCRIPT_NAME'} as a background job";
exit 0;
}
}
@@ -192,7 +192,14 @@ if ( $op eq 'form' ) {
my $error = eval {
my $record = GetMarcBiblio( $biblionumber );
ModifyRecordWithTemplate( $mmtid, $record );
- ModBiblio( $record, $biblionumber );
+ my ($member) = C4::Members::GetMember('borrowernumber' => $loggedinuser);
+ ModBiblio( $record, $biblionumber, '',
+ {
+ source => 'batchmod',
+ category => $member->{'category_type'},
+ borrower => $loggedinuser
+ }
+ );
};
if ( $error and $error != 1 or $@ ) { # ModBiblio returns 1 if everything as gone well
push @messages, {
--