2 [% USE ColumnsSettings %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Cataloging › [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) › Items</title>
6 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% INCLUDE 'datatables.inc' %]
9 <script type="text/javascript" src="[% interface %]/[% theme %]/js/cataloging.js"></script>
10 [% INCLUDE 'columns_settings.inc' %]
11 [% INCLUDE 'browser-strings.inc' %]
13 <script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
15 <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
16 <script type="text/javascript">
18 var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
21 $(document).ready(function(){
23 // Remove the onclick event defined in browser.js,
24 // otherwise the deletion confirmation will not work correctly
25 $('a[href*="biblionumber="]').off('click');
32 $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
33 /* Inline edit/delete links */
34 var biblionumber = $("input[name='biblionumber']").attr("value");
35 $("tr.editable").each(function(){
36 $(this).find("td:not(:first)").on('click', function(){
37 var rowid = $(this).parent().attr("id");
38 num_rowid = rowid.replace("row","");
39 $(".linktools").remove();
40 var edit_link = $('<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&frameworkcode=[% frameworkcode %]&biblionumber=[% biblionumber %]&itemnumber='+num_rowid+'&searchid=[% searchid %]#edititem"></a>');
41 $(edit_link).text(_("Edit item"));
42 var delete_link = $('<a href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&frameworkcode=[% frameworkcode %]&biblionumber=[% biblionumber %]&itemnumber='+num_rowid+'&searchid=[% searchid %]"></a>');
43 $(delete_link).text(_("Delete item"));
44 $(delete_link).on('click', function(e) {
45 return confirm_deletion();
47 var tools_node = $('<span class="linktools"></span>');
48 $(tools_node).append(edit_link);
49 $(tools_node).append(delete_link);
50 $(this).append(tools_node);
54 var columns_settings = [% ColumnsSettings.GetColumns( 'cataloguing', 'additem', 'itemst', 'json' ) %]
55 // Skip the first column
56 columns_settings.unshift( { cannot_be_toggled: "1" } );
58 var itemst = KohaTable("#itemst", {
60 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
65 "bKohaColumnsUseNames": true
68 var multiCopyControl = $("#add_multiple_copies_span");
69 var addMultipleBlock = $("#addmultiple");
70 var addSingleBlock = $("#addsingle");
71 multiCopyControl.hide();
72 $("#add_multiple_copies").on("click",function(e){
74 addMultipleBlock.toggle();
75 addSingleBlock.toggle();
76 multiCopyControl.toggle();
77 $('body,html').animate({ scrollTop: $('body').height() }, 100);
79 $("#cancel_add_multiple").on("click",function(e){
81 addMultipleBlock.toggle();
82 addSingleBlock.toggle();
83 multiCopyControl.toggle();
88 var total_errors = CheckMandatorySubfields(f);
89 if (total_errors==0) {
90 // Explanation about this line:
91 // In case of limited edition permission, we have to prevent user from modifying some fields.
92 // But there is no such thing as readonly attribute for select elements.
93 // So we use disabled instead. But disabled prevent values from being passed through the form at submit.
94 // So we "un-disable" the elements just before submitting.
95 // That's a bit clumsy, and if someone comes up with a better solution, feel free to improve that.
96 $("select[name=field_value]").prop('disabled', false);
99 var alertString2 = _("Form not submitted because of the following problem(s)");
100 alertString2 += "\n------------------------------------------------------------------------------------\n";
101 alertString2 += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
107 function CheckMultipleAdd(f) {
109 if (!f || isNaN(f) || !parseInt(f) == f || f <= 0) {
110 alert(_("Please enter a number of items to create."));
113 <!-- Add a soft-limit of 99 with a reminder about potential data entry error -->
115 return confirm(_("You are about to add %s items. Continue?").format(f));
118 function Dopop(link,i) {
119 defaultvalue=document.forms[0].field_value[i].value;
120 newin=window.open(link+"&result="+defaultvalue,"valuebuilder",'width=500,height=400,toolbar=false,scrollbars=yes');
123 function confirm_deletion() {
124 return confirm(_("Are you sure you want to delete this item?"));
129 <link type="text/css" rel="stylesheet" href="[% interface %]/[% theme %]/css/addbiblio.css" />
131 [% INCLUDE 'select2.inc' %]
132 <script type="text/javascript">
133 $(document).ready(function() {
134 $('.subfield_line select').select2();
139 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
142 <body id="cat_additem" class="cat">
143 [% INCLUDE 'header.inc' %]
144 [% INCLUDE 'cataloging-search.inc' %]
146 <div id="breadcrumbs">
147 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
148 › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
149 › Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]">[% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</a>
150 › <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Items</a>
153 <div id="doc3" class="yui-t7">
158 <h1>Items for [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</h1>
160 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
161 [% 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 %]
162 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
163 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
164 [% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
165 [% IF ( linked_analytics ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item has linked <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&analyze=1">analytics.</a>.</div>[% END %]
167 <div id="cataloguing_additem_itemlist">
168 [% IF ( item_loop ) %]
174 [% FOREACH item_header IN item_header_loop %]
175 [% IF item_header.column_name %]
176 <th data-colname="[% item_header.column_name %]">
180 [% item_header.header_value %]
186 [% FOREACH item_loo IN item_loop %]
187 [% IF ( item_loo.itemnumber == itemnumber) %]
188 [% IF item_loo.nomod %]
189 <tr id="row[% item_loo.itemnumber %]" class="active">
191 <tr id="row[% item_loo.itemnumber %]" class="active editable">
194 [% IF item_loo.nomod %]
195 <tr id="row[% item_loo.itemnumber %]">
197 <tr id="row[% item_loo.itemnumber %]" class="editable">
200 [% IF ( item_loo.nomod ) %]
204 <div class="dropdown">
205 <a class="btn btn-mini dropdown-toggle" id="itemactions[% item_loo.itemnumber %]" role="button" data-toggle="dropdown" href="#">
206 Actions <b class="caret"></b>
208 <ul class="dropdown-menu" role="menu" aria-labelledby="itemactions[% item_loo.itemnumber %]">
210 [% IF ( item_loo.hostitemflag ) %]
211 <li><a href="additem.pl?op=edititem&biblionumber=[% item_loo.hostbiblionumber %]&itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a> <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&biblionumber=[% biblionumber %]&hostitemnumber=[% item_loo.itemnumber %]&searchid=[% searchid %]">Delink</a></li>
213 <li><a href="additem.pl?op=edititem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]&searchid=[% searchid %]#edititem">Edit</a></li>
214 <li><a href="additem.pl?op=dupeitem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]&searchid=[% searchid %]#additema">Duplicate</a></li>
215 [% IF ( item_loo.countanalytics ) %]
216 <li><a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=% item_loo.itemnumber %]">View analytics</a></li>
218 <li><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]&searchid=[% searchid %]" onclick="return confirm_deletion();">Delete</a></li>
221 [% IF ( OPACBaseURL ) %]
222 <li class="view-in-opac"><a target="_blank" href="[% Koha.Preference('OPACBaseURL') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]">OPAC view</a></li>
228 [% FOREACH item_valu IN item_loo.item_value %]
229 <td>[% item_valu.field |html %]</td>
239 <div class="yui-u first">
240 [% INCLUDE 'biblio-view-menu.inc' %]
243 <div id="cataloguing_additem_newitem">
244 <form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl" name="f">
245 <input type="hidden" name="op" value="[% op %]" />
247 <input type="hidden" name="popup" value="1" />
249 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
251 <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
253 <h2 id="edititem">Edit Item #[% itemnumber %][% IF ( barcode ) %] / Barcode [% barcode %][% END %]</h2>
255 <fieldset class="rows">
257 [% FOREACH ite IN item %]
258 <li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
259 [% IF ( ite.mandatory ) %]
260 <label class="required">[% ite.subfield %] - [% ite.marc_lib %]</label>
262 <label>[% ite.subfield %] - [% ite.marc_lib %]</label>
265 [% SET mv = ite.marc_value %]
266 [% IF ( mv.type == 'hidden' ) %]
267 <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]">
268 [% ELSIF ( mv.type == 'select' ) %]
269 [% IF ( mv.readonlyselect ) %]
270 <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
272 <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor">
274 [% FOREACH aval IN mv.values %]
275 [% IF aval == mv.default %]
276 <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option>
278 <option value="[%- aval -%]">[%- mv.labels.$aval -%]</option>
282 [% ELSIF ( mv.type == 'text_auth' ) %]
283 <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
284 [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
285 <a href="#" class="buttonDot" onclick="[%- dopop -%]; return false;" title="Tag editor">...</a>
286 [% ELSIF ( mv.type == 'text_plugin' ) %]
287 <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
288 [% IF ( mv.nopopup ) %]
289 <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a>
291 <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a>
293 [%- mv.javascript -%]
294 [% ELSIF ( mv.type == 'text' ) %]
295 <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
296 [% ELSIF ( mv.type == 'textarea' ) %]
297 <textarea id="[%- mv.id -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value %]</textarea>
300 <input type="hidden" name="tag" value="[% ite.tag %]" />
301 <input type="hidden" name="subfield" value="[% ite.subfield %]" />
302 <input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
303 [% IF ( ite.repeatable ) %]
304 <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
305 <img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
308 [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
313 <input type="hidden" name="indicator" value=" " />
314 <input type="hidden" name="indicator" value=" " />
315 <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
317 <fieldset class="action"> [% IF ( opisadd ) %]
318 <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
319 <!-- Note : We use here a false submit button because we have several submit buttons and we don't want the user to believe he validated the adding of multiple items
320 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.
321 It is a bit tricky, but necessary in the sake of UI correctness.
323 <span id="addsingle">
324 <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
325 <input type="submit" name="add_duplicate_submit" value="Add & duplicate" onclick="return Check(this.form)" />
327 <span id="addmultiple">
328 <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
330 <fieldset id="add_multiple_copies_span">
331 <label for="number_of_copies">Number of copies of this item to add: </label>
332 <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
333 <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>
334 <div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div>
338 <input type="hidden" name="tag" value="[% itemtagfield %]" />
339 <input type="hidden" name="subfield" value="[% itemtagsubfield %]" />
340 <input type="hidden" name="field_value" value="[% itemnumber %]" />
341 <input type="submit" value="Save changes" onclick="return Check(this.form)" />
344 [%# Fields for fast cataloging %]
345 <input type="hidden" name="circborrowernumber" value="[% circborrowernumber %]" />
346 <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
347 <input type="hidden" name="barcode" value="[% barcode %]" />
348 <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
349 [%# End fields for fast cataloging %]
354 </div><!-- /yui-u -->
355 </div><!-- /yui-gf -->
359 [% INCLUDE 'intranet-bottom.inc' %]