Koha/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
Owen Leonard 58bec27564
Bug 25282: Correct Bootstrap dropdown button markup
Incorrect markup surrounding Bootstrap dropdown buttons causes display
problems with the buttons are in a DataTable. Dropdown wrapper <div>s
must have a "btn-group" class.

To reproduce the problem, look at the MARC bibliographic frameworks
page. The "Actions" menu when triggered will not line up with the
button.

In almost all cases, dropdown buttons inside tables should also have the
"dropup" class on their wrapper so that the menu appears above the
button. This prevents the menu from disappearing off the bottom of the
window when the button is positioned low in the viewport.

To test, apply the patch and test the button menus in tables on the
following pages:

- Acquisitions -> Invoices
- Acquisitions -> Add to order -> From external source -> Results
- Acquisitions -> Suggestions
- Administration -> Budgets
- Administration -> Funds
- Administration -> Authority types
- Administration -> Authority types -> MARC structure
- Administration -> MARC bibliographic frameworks
- Administration -> MARC bibliographic frameworks -> MARC structure
- Administration -> OAI sets configuration
- Administration -> Z39.50/SRU servers
- Authorities -> Authority search results
- Authorities -> New from Z39.50/SRU -> Search results
- Cataloging -> Edit items
- Cataloging -> New from Z39.50/SRU -> Search results
- Circulation -> Article requests
- Reports -> Saved reports
- Tools -> Patron lists
- Tools -> Rotating collections
- Serials -> Serials search results

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-04-29 16:20:08 +01:00

262 lines
16 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE ColumnsSettings %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Cataloging &rsaquo; [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %]) &rsaquo; Items</title>
[% INCLUDE 'doc-head-close.inc' %]
[% Asset.css("css/addbiblio.css") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% Asset.js("js/cataloging.js") | $raw %]
[% INCLUDE 'columns_settings.inc' %]
[% INCLUDE 'strings.inc' %]
[% Asset.js("js/browser.js") | $raw %]
[% INCLUDE 'select2.inc' %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'str/cataloging_additem.inc' %]
[% Asset.js("js/cataloging_additem.js") | $raw %]
</head>
<body id="cat_additem" class="cat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cataloging-search.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
&rsaquo; <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
&rsaquo; Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | uri %]">[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</a>
&rsaquo; <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | uri %]">Items</a>
</div>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-12">
<main>
[% INCLUDE 'blocking_errors.inc' %]
<h1>Items for [% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</h1>
[% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
[% IF ( no_next_barcode ) %]<div class="dialog alert"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
[% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
[% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
[% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
[% IF ( linked_analytics ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item has linked <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]&amp;analyze=1">analytics.</a>.</div>[% END %]
<div id="cataloguing_additem_itemlist">
[% IF ( item_loop ) %]
<div>
<table id="itemst">
<thead>
<tr>
<th>&nbsp;</th>
[% FOREACH item_header IN item_header_loop %]
[% IF item_header.column_name %]
<th data-colname="[% item_header.column_name | html %]">
[% ELSE %]
<th>
[% END %]
[% item_header.header_value | html %]
</th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH item_loo IN item_loop %]
[% IF ( item_loo.itemnumber == itemnumber) %]
[% IF item_loo.nomod %]
<tr id="row[% item_loo.itemnumber | html %]" class="active">
[% ELSE %]
<tr id="row[% item_loo.itemnumber | html %]" class="active editable">
[% END %]
[% ELSE %]
[% IF item_loo.nomod %]
<tr id="row[% item_loo.itemnumber | html %]">
[% ELSE %]
<tr id="row[% item_loo.itemnumber | html %]" class="editable">
[% END %]
[% END %]
[% IF ( item_loo.nomod ) %]
<td>&nbsp;</td>
[% ELSE %]
<td>
<div class="btn-group dropup">
<a class="btn btn-default btn-xs dropdown-toggle" id="itemactions[% item_loo.itemnumber | html %]" role="button" data-toggle="dropdown" href="#">
Actions <b class="caret"></b>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="itemactions[% item_loo.itemnumber | html %]">
[% IF ( item_loo.hostitemflag ) %]
<li><a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber | uri %]&amp;itemnumber=[% item_loo.itemnumber | uri %]#edititem">Edit in host</a> &nbsp; <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber | html %]&amp;hostitemnumber=[% item_loo.itemnumber | html %]&amp;searchid=[% searchid | html %]">Delink</a></li>
[% ELSE %]
<li><a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber | uri %]&amp;itemnumber=[% item_loo.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#edititem">Edit</a></li>
<li><a href="additem.pl?op=dupeitem&amp;biblionumber=[% biblionumber | uri %]&amp;itemnumber=[% item_loo.itemnumber | uri %]&amp;searchid=[% searchid | uri %]#additema">Duplicate</a></li>
<li class="print_label"><a href="/cgi-bin/koha/labels/label-edit-batch.pl?op=add&amp;number_type=itemnumber&amp;number_list=[% item_loo.itemnumber | uri %]" target="_blank" >Print label</a></li>
[% IF ( item_loo.countanalytics ) %]
<li><a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=% item_loo.itemnumber %]">View analytics</a></li>
[% ELSE %]
<li><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&amp;biblionumber=[% biblionumber | html %]&amp;itemnumber=[% item_loo.itemnumber | html %]&amp;searchid=[% searchid | html %]" onclick="return confirm_deletion();">Delete</a></li>
[% END %]
[% END %]
[% IF ( OPACBaseURL ) %]
<li class="view-in-opac"><a target="_blank" href="[% Koha.Preference('OPACBaseURL') | url %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">OPAC view</a></li>
[% END %]
</ul>
</div>
</td>
[% END %]
[% FOREACH item_valu IN item_loo.item_value %]
<td>[% item_valu.field | html %]</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>
</div>
[% END %]
<div class="row">
<div class="col-sm-2">
[% INCLUDE 'biblio-view-menu.inc' %]
</div>
<div class="col-sm-10">
<div id="cataloguing_additem_newitem">
<form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]" name="f">
<input type="hidden" name="op" value="[% op | html %]" />
[% IF (popup) %]
<input type="hidden" name="popup" value="1" />
[% END %]
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
[% IF op != 'saveitem' %]
<h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
[% ELSE %]
<h2 id="edititem">Edit Item #[% itemnumber | html %][% IF ( barcode ) %] / Barcode [% barcode | html %][% END %]</h2>
[% END %]
<fieldset class="rows">
<ol>
[% FOREACH ite IN item %]
<li><div class="subfield_line" style="[% ite.visibility | html %]" id="subfield[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]">
[% IF ( ite.mandatory ) %]
<label class="required">[% ite.subfield | html %] - [% ite.marc_lib | $raw %]</label>
[% ELSE %]
<label>[% ite.subfield | html %] - [% ite.marc_lib | $raw %]</label>
[% END %]
[% SET mv = ite.marc_value %]
[% IF ( mv.type == 'hidden' ) %]
<input type="hidden" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]">
[% ELSIF ( mv.type == 'select' ) %]
[% IF ( mv.readonly ) %]
<select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
[% ELSE %]
<select name="field_value" id="[%- mv.id | html -%]" size="1" class="input_marceditor">
[% END %]
[% FOREACH aval IN mv.values %]
[% IF aval == mv.default %]
<option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option>
[% ELSE %]
<option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option>
[% END %]
[% END %]
</select>
[% ELSIF ( mv.type == 'text_auth' ) %]
[% IF mv.readonly %]
<input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
[% ELSE %]
<input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
[% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
<a href="#" class="buttonDot" onclick="[%- dopop | html -%]; return false;" title="Tag editor">...</a>
[% END %]
[% ELSIF ( mv.type == 'text_plugin' ) %]
[% IF mv.readonly %]
<input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
[% ELSE %]
<input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
[% IF ( mv.nopopup ) %]
<a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="No popup">...</a>
[% ELSE %]
<a href="#" id="buttonDot_[%- mv.id | html -%]" class="[%- mv.class | html -%]" title="Tag editor">...</a>
[% END %]
[%- mv.javascript | $raw -%]
[% END %]
[% ELSIF ( mv.type == 'text' ) %]
[% IF mv.readonly %]
<input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" readonly="readonly" />
[% ELSE %]
<input type="text" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" />
[% END %]
[% ELSIF ( mv.type == 'textarea' ) %]
[% IF mv.readonly %]
<textarea id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" rows="5" cols="64" readonly="readonly" >[% mv.value | html %]</textarea>
[% ELSE %]
<textarea id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value | html %]</textarea>
[% END %]
[% END %]
<input type="hidden" name="tag" value="[% ite.tag | html %]" />
<input type="hidden" name="subfield" value="[% ite.subfield | html %]" />
<input type="hidden" name="mandatory" value="[% ite.mandatory | html %]" />
<input type="hidden" name="important" value="[% ite.important | html %]" />
[% IF ( ite.repeatable ) %]
<a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode.parentNode); return false;">
<img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
</a>
[% END %]
[% IF ( ite.mandatory ) %] <span class="required">Required</span>
[% ELSIF ( ite.important ) %] <span class="important">Important</span>
[% END %]
</div></li>
[% END %]
</ol>
</fieldset>
<input type="hidden" name="indicator" value=" " />
<input type="hidden" name="indicator" value=" " />
<input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
<fieldset class="action"> [% IF op != 'saveitem' %]
<input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
<!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe they validated the adding of multiple items
when pressing the enter key, while in fact it is the first submit button that is validated, in our case the "add (single) item" button.
It is a bit tricky, but necessary in the sake of UI correctness.
-->
<span id="addsingle">
<input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
<input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
</span>
<span id="addmultiple">
<input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
</span>
<fieldset id="add_multiple_copies_span">
<label for="number_of_copies">Number of copies of this item to add: </label>
<input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
<input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" /> <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a>
<div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div>
</fieldset>
[% ELSE %]
<input type="hidden" name="tag" value="[% itemtagfield | html %]" />
<input type="hidden" name="subfield" value="[% itemtagsubfield | html %]" />
<input type="hidden" name="field_value" value="[% itemnumber | html %]" />
<input type="submit" value="Save changes" onclick="return Check(this.form)">
<input type="button" id="addnewitem" value="Add a new item">
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Cancel</a>
[% END %]</fieldset>
[%# Fields for fast cataloging %]
<input type="hidden" name="circborrowernumber" value="[% circborrowernumber | html %]" />
<input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
<input type="hidden" name="barcode" value="[% barcode | html %]" />
<input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
[%# End fields for fast cataloging %]
</form>
</div> <!-- /#cataloguing_additem_newitem -->
</div> <!-- /.col-sm-10 -->
</div> <!-- /.row -->
</div> <!-- /#cataloguing_additem_itemlist -->
</main>
</div> <!-- /.col-sm-12 -->
</div> <!-- /.row -->
[% INCLUDE 'intranet-bottom.inc' %]