From 57fb7e45b774a5d4fcc44ebe5bea0e12bea03624 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 30 May 2008 14:37:33 -0500 Subject: [PATCH] kohabug 2186 - improve display of empty import batches [1] Display the "No records have been staged" message only if no import batches exist. [2] When displaying a batch that has no bibs in it, display a "There are no records in this batch to import". Also, do not display the "import record into catalogue" button for an empty batch. [3] Add CSS class "problem" to both messages. Documentation changes: minor; only required if screenshots exist of the manage staged MARC records page that has no import batches on it. Signed-off-by: Joshua Ferraro --- .../prog/en/modules/tools/manage-marc-import.tmpl | 15 +++++++++++++-- tools/manage-marc-import.pl | 12 +++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl index 549b8eef19..1150f68034 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl @@ -38,6 +38,14 @@

Label batch created, with id:

+ + + + No records have been staged. + Stage MARC records for import. + + +
    @@ -259,8 +267,11 @@ Page - - No records have been staged. Stage MARC records for import. + + + There are no records in this batch to import. + Manage staged MARC records. + diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl index eaf9815ada..97ac568892 100755 --- a/tools/manage-marc-import.pl +++ b/tools/manage-marc-import.pl @@ -365,11 +365,13 @@ sub batch_info { $template->param(upload_timestamp => $batch->{'upload_timestamp'}); $template->param(num_biblios => $batch->{'num_biblios'}); $template->param(num_items => $batch->{'num_biblios'}); - if ($batch->{'import_status'} eq 'staged' or $batch->{'import_status'} eq 'reverted') { - $template->param(can_commit => 1); - } - if ($batch->{'import_status'} eq 'imported') { - $template->param(can_revert => 1); + if ($batch->{'num_biblios'} > 0) { + if ($batch->{'import_status'} eq 'staged' or $batch->{'import_status'} eq 'reverted') { + $template->param(can_commit => 1); + } + if ($batch->{'import_status'} eq 'imported') { + $template->param(can_revert => 1); + } } if (defined $batch->{'matcher_id'}) { my $matcher = C4::Matcher->fetch($batch->{'matcher_id'}); -- 2.39.5