[Koha-patches] [PATCH] kohabug 2186 - improve display of empty import batches
Galen Charlton
galen.charlton at liblime.com
Fri May 30 21:37:33 CEST 2008
[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.
---
.../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 549b8ee..1150f68 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 @@
<p>Label batch created, with id: <!-- TMPL_VAR name="label_batch" --> </p>
</div>
<!-- /TMPL_IF -->
+
+<!-- TMPL_UNLESS name="batch_list" -->
+ <!-- TMPL_UNLESS name="batch_info" -->
+ <span class="problem">No records have been staged.</span>
+ <a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.
+ <!-- /TMPL_UNLESS -->
+<!-- /TMPL_UNLESS -->
+
<!-- TMPL_IF name="batch_info" -->
<fieldset class="rows">
<ul>
@@ -259,8 +267,11 @@ Page
<!-- /TMPL_LOOP -->
</div>
<!-- /TMPL_IF -->
- <!-- TMPL_ELSE -->
- No records have been staged. <a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.
+<!-- TMPL_ELSE -->
+ <!-- TMPL_IF name="batch_info" -->
+ <span class="problem">There are no records in this batch to import.</span>
+ <a href="/cgi-bin/koha/tools/manage-marc-import.pl">Manage staged MARC records</a>.
+ <!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</div>
diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl
index eaf9815..97ac568 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'});
--
1.5.5.GIT
More information about the Koha-patches
mailing list