[% ELSE %]
<div class="dialog message">
[% END %]
- <b><p>[% label_batch_msg | html %]</p></b>
+ <p><b>
+ [% IF ( label_batch_msg == "error" ) %]
+ Error attempting to create label batch. Please ask your system administrator to check the log for more details.
+ [% ELSE %]
+ Label <a href="/cgi-bin/koha/labels/label-edit-batch.pl?op=edit&element_id=[% label_batch_msg | uri %]" >batch #[% label_batch_msg | html %]</a> created.
+ [% END %]
+ </b></p>
</div>
[% END %]
</td>
<td>[% batch_lis.upload_timestamp | html %]</td>
<td>[% batch_lis.num_records | html %]</td>
- <td>[% batch_lis.num_items | html %][% IF ( batch_lis.num_items ) %] <a href="[% batch_lis.script_name | url %]?import_batch_id=[% batch_lis.import_batch_id | uri %]&op=create_labels">(Create label batch)</a>[% END %]</td>
+ <td>[% batch_lis.num_items | html %]
+ [% IF ( batch_lis.num_items && batch_lis.import_status == 'imported' ) %]
+ (<a href="[% batch_lis.script_name | url %]?import_batch_id=[% batch_lis.import_batch_id | uri %]&op=create_labels">Create label batch</a>)
+ [% END %]
+ </td>
<td class="actions">
[% IF ( batch_lis.can_clean ) %]
<form method="post" action="[% batch_lis.script_name | html %]" name="clean_batch_[% batch_lis.import_batch_id | html %]" id="clean_batch_[% batch_lis.import_batch_id | html %]" class="batch_form batch_clean">
[% END %]
</ul>
</nav>
-[% END %]
\ No newline at end of file
+[% END %]
#create a batch of labels, then lose $op & $import_batch_id so we get back to import batch list.
my $label_batch_id = create_labelbatch_from_importbatch($import_batch_id);
if ($label_batch_id == -1) {
- $template->param( label_batch_msg => "Error attempting to create label batch. Please ask your system administrator to check the log for more details.",
+ $template->param( label_batch_msg => "error",
message_type => 'alert',
);
}
else {
- $template->param( label_batch_msg => "Label batch #$label_batch_id created.",
+ $template->param( label_batch_msg => $label_batch_id,
message_type => 'dialog',
);
}