@@ -, +, @@ cleaned --- C4/ImportBatch.pm | 19 +++++++++++++++++++ .../prog/en/modules/tools/manage-marc-import.tt | 15 +++++++++++++-- tools/manage-marc-import.pl | 6 ++++++ 3 files changed, 38 insertions(+), 2 deletions(-) --- a/C4/ImportBatch.pm +++ a/C4/ImportBatch.pm @@ -53,6 +53,7 @@ BEGIN { BatchCommitRecords BatchRevertRecords CleanBatch + DeleteBatch GetAllImportBatches GetStagedWebserviceBatches @@ -959,6 +960,24 @@ sub CleanBatch { SetImportBatchStatus($batch_id, 'cleaned'); } +=head2 DeleteBatch + + DeleteBatch($batch_id) + +Deletes the record from the database. This can only be done +once the batch has been cleaned. + +=cut + +sub DeleteBatch { + my $batch_id = shift; + return unless defined $batch_id; + + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare('DELETE FROM import_batches WHERE import_batch_id = ?'); + $sth->execute( $batch_id ); +} + =head2 GetAllImportBatches my $results = GetAllImportBatches(); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt @@ -38,6 +38,7 @@