Bug 20473: Don't display 'Item information' tab when adding to basket from a file...
authorNick Clemens <nick@bywatersolutions.com>
Fri, 16 Dec 2022 13:12:19 +0000 (13:12 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 31 Jan 2023 14:00:16 +0000 (11:00 -0300)
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>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt

index 6151926..2e82165 100644 (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>
 
                                     </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 ) %]
                                                     [% 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>