@@ -, +, @@ saving to catalog - This will return no records as the record is still a draft and has not been committed to catalog - This will return the biblio record as it has been saved to reservoir. - This will return a record as the biblio has been saved to the --- C4/ImportBatch.pm | 20 +++++++++++++++++++- cataloguing/addbiblio.pl | 3 +++ .../prog/en/modules/cataloguing/addbooks.tt | 6 +----- 3 files changed, 23 insertions(+), 6 deletions(-) --- a/C4/ImportBatch.pm +++ a/C4/ImportBatch.pm @@ -44,6 +44,7 @@ BEGIN { GetImportBatch AddAuthToBatch AddBiblioToBatch + DeleteBiblioInBatch AddItemsToImportBiblio ModAuthorityInBatch ModBiblioInBatch @@ -296,6 +297,15 @@ sub AddBiblioToBatch { return $import_record_id; } +=head2 DeleteBiblioInBatch + DeleteBiblioInBatch( $import_record_id ); +=cut + +sub DeleteBiblioInBatch { + my ($import_record_id) = @_; + _delete_import_record_marc($import_record_id); +} + =head2 ModBiblioInBatch ModBiblioInBatch($import_record_id, $marc_record); @@ -1615,6 +1625,15 @@ sub _update_import_record_marc { $sth->finish(); } +sub _delete_import_record_marc { + my ($import_record_id) = @_; + + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("DELETE FROM import_records WHERE import_record_id = ?"); + $sth->execute($import_record_id); + $sth->finish(); +} + sub _add_auth_fields { my ($import_record_id, $marc_record) = @_; @@ -1639,7 +1658,6 @@ sub _add_biblio_fields { my $sth = $dbh->prepare("INSERT INTO import_biblios (import_record_id, title, author, isbn, issn) VALUES (?, ?, ?, ?, ?)"); $sth->execute($import_record_id, $title, $author, $isbn, $issn); $sth->finish(); - } sub _update_biblio_fields { --- a/cataloguing/addbiblio.pl +++ a/cataloguing/addbiblio.pl @@ -848,6 +848,9 @@ if ( $op eq "addbiblio" ) { AddBiblioToBatch(1, 0, $record, 'biblio', int(rand(99999)), 0); print $input->redirect('/cgi-bin/koha/cataloguing/addbooks.pl'); } else { + if ($breedingid) { + DeleteBiblioInBatch($breedingid); + } ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); } } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt @@ -180,11 +180,7 @@
  • MARC preview
  • Card preview
  • [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] - [% IF breeding_loo.file == "draft_marc_records.mrc" %] -
  • Continue editing draft record
  • - [% ELSE %] -
  • Add biblio
  • - [% END %] +
  • Continue editing draft record
  • [% END %] --