Bug 20473: Don't display 'Item information' tab when adding to basket from a file and not creating items

This patch adds a conditional, and moves another up one level to remove the tab
when it will have no content/effect

To test:
1. Stage a MARC file from Tools > Stage MARC records for import
2. Go to Acquisitions and create a basket for a vendor
3. Add to basket from staged file
4. Note that the "item information" tab is present, if you click on it, not that it is not useful
5. Cancel adding to basket
6. Apply patch
7. Add to basket from the staged file again
8. Confirm there is no item information tab
9. Confirm orders are added on 'Save'

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2022-12-16 13:12:19 +00:00 committed by Tomas Cohen Arazi
parent 74f2b83255
commit dcd6f549d9
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -72,7 +72,9 @@
<div id="tabs" class="toptabs">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#records_to_import" aria-controls="records_to_import" role="tab" data-toggle="tab">Select to import</a></li>
<li role="presentation"><a href="#items_info" class="items_info" aria-controls="items_info" role="tab" data-toggle="tab">Item information</a></li>
[% IF items %]
<li role="presentation"><a href="#items_info" class="items_info" aria-controls="items_info" role="tab" data-toggle="tab">Item information</a></li>
[% END %]
<li role="presentation"><a href="#accounting_details" aria-controls="accounting_details" role="tab" data-toggle="tab">Default accounting details</a></li>
</ul>
@ -368,11 +370,11 @@
</div> <!-- /#dataPreview -->
</div> <!-- /#records_to_import -->
[% IF ( items ) %]
<div id="items_info" role="tabpanel" class="tab-pane">
<h2>Item information</h2>
<p>Import all the checked items in the basket with the following parameters:</p>
[% IF ( items ) %]
<fieldset class="rows" style="float:none;">
<legend>Item</legend>
[% IF ( NoACQframework ) %]
@ -422,8 +424,8 @@
[% END #/FOREACH item %]
</div> <!-- /.item_edit_form -->
</fieldset>
[% END # /IF items %]
</div> <!-- /#items_info -->
[% END # /IF items %]
<div id="accounting_details" role="tabpanel" class="tab-pane">
<p>Import all the checked items in the basket with the following accounting details (used only if no information is filled for the item):</p>