Bug 32658: Use template wrapper in order from staged file template

This patch implements the template WRAPPER system (see Bug 32571) for
building tabs on the page for adding to a basket from a staged
file.

To test you need an active vendor, at least one basket for that vendor,
and a staged MARC file.

Apply the patch and go to Acquisitions -> Vendor -> Basket -> Add to
basket -> From a staged file.

- Click "Add to orders" on one of your staged files.
- On the "Add orders from..." page you should see three tabs, the first
  one active.
- Tabs should look correct and work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 09717bb20d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Owen Leonard 2023-01-17 19:28:04 +00:00 committed by Matt Blenkinsop
parent f2e6e90d9c
commit 780323c869

View file

@ -64,17 +64,17 @@
([% file_name | html %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %]) ([% file_name | html %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %])
</h1> </h1>
<form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform"> <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
<div id="tabs" class="toptabs"> [% WRAPPER tabs id= "tabs" %]
<ul class="nav nav-tabs" role="tablist"> [% WRAPPER tabs_nav %]
<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> [% WRAPPER tab_item tabname= "records_to_import" active= 1 %] Select to import [% END %]
[% IF items %] [% 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> [% WRAPPER tab_item tabname= "items_info" %] Item information [% END %]
[% END %] [% END %]
<li role="presentation"><a href="#accounting_details" aria-controls="accounting_details" role="tab" data-toggle="tab">Default accounting details</a></li> [% WRAPPER tab_item tabname= "accounting_details" %] Default accounting details [% END %]
</ul> [% END %]
<div class="tab-content"> [% WRAPPER tab_panels %]
<div id="records_to_import" role="tabpanel" class="tab-pane active" > [% WRAPPER tab_panel tabname= "records_to_import" active= 1 %]
<div id="searchheader" class="searchheader"> <div id="searchheader" class="searchheader">
<div> <div>
<span class="checkall"><a id="checkAll" href="#">Select all</a></span> <span class="checkall"><a id="checkAll" href="#">Select all</a></span>
@ -363,66 +363,66 @@
</div> <!-- /.modal-content --> </div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog --> </div> <!-- /.modal-dialog -->
</div> <!-- /#dataPreview --> </div> <!-- /#dataPreview -->
</div> <!-- /#records_to_import --> [% END # /#records_to_import %]
[% IF ( items ) %] [% IF ( items ) %]
<div id="items_info" role="tabpanel" class="tab-pane"> [% WRAPPER tab_panel tabname= "items_info" %]
<h2>Item information</h2> <h2>Item information</h2>
<p>Import all the checked items in the basket with the following parameters:</p> <p>Import all the checked items in the basket with the following parameters:</p>
<fieldset class="rows" style="float:none;"> <fieldset class="rows" style="float:none;">
<legend>Item</legend> <legend>Item</legend>
[% IF ( NoACQframework ) %] [% IF ( NoACQframework ) %]
<div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div> <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
[% END %] [% END %]
<div class="item_edit_form"> <div class="item_edit_form">
[% FOREACH item IN items %] [% FOREACH item IN items %]
<div id="outeritemblock"> <div id="outeritemblock">
<div id="itemblock"> <div id="itemblock">
<ol> <ol>
[% FOREACH iteminformatio IN item.iteminformation %] [% FOREACH iteminformatio IN item.iteminformation %]
<li style="[% iteminformatio.hidden | html %];"> <li style="[% iteminformatio.hidden | html %];">
<div class="subfield_line" id="subfield[% iteminformatio.serialid | html %][% iteminformatio.countitems | html %][% iteminformatio.subfield | html %][% iteminformatio.random | html %]"> <div class="subfield_line" id="subfield[% iteminformatio.serialid | html %][% iteminformatio.countitems | html %][% iteminformatio.subfield | html %][% iteminformatio.random | html %]">
[% IF (iteminformatio.mandatory) %] [% IF (iteminformatio.mandatory) %]
<label class="required">[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label> <label class="required">[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label>
[% ELSE %] [% ELSE %]
<label>[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label> <label>[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label>
[% END %] [% END %]
[% IF ( iteminformatio.marc_value.type == 'select' ) %] [% IF ( iteminformatio.marc_value.type == 'select' ) %]
<select name="field_value" class="input_marceditor"> <select name="field_value" class="input_marceditor">
[% FOREACH value IN iteminformatio.marc_value.values %] [% FOREACH value IN iteminformatio.marc_value.values %]
[% IF ( value == iteminformatio.marc_value.default ) %] [% IF ( value == iteminformatio.marc_value.default ) %]
<option value="[% value | html %]" selected="selected">[% iteminformatio.marc_value.labels.$value | html %]</option> <option value="[% value | html %]" selected="selected">[% iteminformatio.marc_value.labels.$value | html %]</option>
[% ELSE %] [% ELSE %]
<option value="[% value | html %]">[% iteminformatio.marc_value.labels.$value | html %]</option> <option value="[% value | html %]">[% iteminformatio.marc_value.labels.$value | html %]</option>
[% END %] [% END %]
[% END %]
</select>
[% ELSE %]
[% iteminformatio.marc_value | $raw %]
[% END %] [% END %]
<input type="hidden" name="itemid" value="1" /> </select>
<input type="hidden" name="kohafield" value="[% iteminformatio.kohafield | html %]" /> [% ELSE %]
<input type="hidden" name="tag" value="[% iteminformatio.tag | html %]" /> [% iteminformatio.marc_value | $raw %]
<input type="hidden" name="subfield" value="[% iteminformatio.subfield | html %]" /> [% END %]
<input type="hidden" name="mandatory" value="[% iteminformatio.mandatory | html %]" /> <input type="hidden" name="itemid" value="1" />
[% IF ( iteminformatio.mandatory ) %] <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield | html %]" />
<span class="required">Required</span> <input type="hidden" name="tag" value="[% iteminformatio.tag | html %]" />
[% END %] <input type="hidden" name="subfield" value="[% iteminformatio.subfield | html %]" />
</div> <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory | html %]" />
</li> [% IF ( iteminformatio.mandatory ) %]
[% END %] <span class="required">Required</span>
</ol> [% END %]
</div><!-- /#itemblock --> </div>
</div> <!-- /#outeritemblock --> </li>
[% END #/FOREACH item %] [% END %]
</div> <!-- /.item_edit_form --> </ol>
</fieldset> </div><!-- /#itemblock -->
</div> <!-- /#items_info --> </div> <!-- /#outeritemblock -->
[% END #/FOREACH item %]
</div> <!-- /.item_edit_form -->
</fieldset>
[% END # /#items_info %]
[% END # /IF items %] [% END # /IF items %]
<div id="accounting_details" role="tabpanel" class="tab-pane"> [% WRAPPER tab_panel tabname= "accounting_details" %]
<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> <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>
<fieldset class="rows" style="float:none;"> <fieldset class="rows" style="float:none;">
<legend>Accounting details</legend> <legend>Accounting details</legend>
@ -486,9 +486,9 @@
</li> </li>
</ol> </ol>
</fieldset> <!-- /.rows --> </fieldset> <!-- /.rows -->
</div> <!-- /#accounting_details --> [% END # /#accounting_details %]
</div> <!-- /#tabs --> [% END #/WRAPPER tab_panels %]
[% END # /WRAPPER tabs %]
<fieldset class="action"> <fieldset class="action">
<input type="submit" id="add_order" class="btn btn-primary" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Cancel</a> <input type="submit" id="add_order" class="btn btn-primary" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Cancel</a>
</fieldset> </fieldset>