1 [% USE ColumnsSettings %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Cataloging › [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %]) › Items</title>
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% INCLUDE 'datatables.inc' %]
8 <script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
9 [% INCLUDE 'columns_settings.inc' %]
10 [% INCLUDE 'browser-strings.inc' %]
12 <script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script>
14 <script type="text/javascript" src="[% interface %]/js/browser.js"></script>
15 <script type="text/javascript">
17 var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
20 $(document).ready(function(){
22 // Remove the onclick event defined in browser.js,
23 // otherwise the deletion confirmation will not work correctly
24 $('a[href*="biblionumber="]').off('click');
31 $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
32 /* Inline edit/delete links */
33 var biblionumber = $("input[name='biblionumber']").attr("value");
34 $("tr.editable").each(function(){
35 $(this).find("td:not(:first)").on('click', function(){
36 var rowid = $(this).parent().attr("id");
37 num_rowid = rowid.replace("row","");
38 $(".linktools").remove();
39 var edit_link = $('<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&frameworkcode=[% frameworkcode %]&biblionumber=[% biblionumber %]&itemnumber='+num_rowid+'&searchid=[% searchid %]#edititem">' + _("Edit item") + '</a>');
40 var delete_link = $('<a href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&frameworkcode=[% frameworkcode %]&biblionumber=[% biblionumber %]&itemnumber='+num_rowid+'&searchid=[% searchid %]">' + _("Delete item") + '</a></span>');
41 $(delete_link).on('click', function(e) {
42 return confirm_deletion();
44 var tools_node = $('<span class="linktools"></span>');
45 $(tools_node).append(edit_link);
46 $(tools_node).append(delete_link);
47 $(this).append(tools_node);
51 var columns_settings = [% ColumnsSettings.GetColumns( 'cataloguing', 'additem', 'itemst', 'json' ) %]
52 // Skip the first column
53 columns_settings.unshift( { cannot_be_toggled: "1" } );
55 var itemst = KohaTable("#itemst", {
57 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
62 "bKohaColumnsUseNames": true
65 var multiCopyControl = $("#add_multiple_copies_span");
66 var addMultipleBlock = $("#addmultiple");
67 var addSingleBlock = $("#addsingle");
68 multiCopyControl.hide();
69 $("#add_multiple_copies").on("click",function(e){
71 addMultipleBlock.toggle();
72 addSingleBlock.toggle();
73 multiCopyControl.toggle();
74 $('body,html').animate({ scrollTop: $('body').height() }, 100);
76 $("#cancel_add_multiple").on("click",function(e){
78 addMultipleBlock.toggle();
79 addSingleBlock.toggle();
80 multiCopyControl.toggle();
85 var total_errors = CheckMandatorySubfields(f);
86 if (total_errors==0) {
87 // Explanation about this line:
88 // In case of limited edition permission, we have to prevent user from modifying some fields.
89 // But there is no such thing as readonly attribute for select elements.
90 // So we use disabled instead. But disabled prevent values from being passed through the form at submit.
91 // So we "un-disable" the elements just before submitting.
92 // That's a bit clumsy, and if someone comes up with a better solution, feel free to improve that.
93 $("select[name=field_value]").removeAttr("disabled");
96 var alertString2 = _("Form not submitted because of the following problem(s)");
97 alertString2 += "\n------------------------------------------------------------------------------------\n";
98 alertString2 += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
104 function CheckMultipleAdd(f) {
106 if (!f || isNaN(f) || !parseInt(f) == f || f <= 0) {
107 alert(_("Please enter a number of items to create."));
110 <!-- Add a soft-limit of 99 with a reminder about potential data entry error -->
112 return confirm(_("You are about to add %s items. Continue?").format(f));
115 function Dopop(link,i) {
116 defaultvalue=document.forms[0].field_value[i].value;
117 newin=window.open(link+"&result="+defaultvalue,"valuebuilder",'width=500,height=400,toolbar=false,scrollbars=yes');
120 function confirm_deletion() {
121 return confirm(_("Are you sure you want to delete this item?"));
126 <link type="text/css" rel="stylesheet" href="[% interface %]/[% theme %]/css/addbiblio.css" />
128 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
131 <body id="cat_additem" class="cat">
132 [% INCLUDE 'header.inc' %]
133 [% INCLUDE 'cataloging-search.inc' %]
135 <div id="breadcrumbs">
136 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
137 › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a>
138 › Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]">[% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</a>
139 › <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]">Items</a>
142 <div id="doc3" class="yui-t7">
147 <h1>Items for [% title |html %] [% IF ( author ) %] by [% author %][% END %] (Record #[% biblionumber %])</h1>
149 [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
150 [% 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 %]
151 [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
152 [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
153 [% IF ( not_same_branch ) %]<div class="dialog alert"><strong>Cannot delete</strong>: The items do not belong to your library.</div>[% END %]
154 [% 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 %]
156 <div id="cataloguing_additem_itemlist">
157 [% IF ( item_loop ) %]
163 [% FOREACH item_header IN item_header_loop %]
164 [% IF item_header.column_name %]
165 <th data-colname="[% item_header.column_name %]">
169 [% item_header.header_value %]
175 [% FOREACH item_loo IN item_loop %]
176 [% IF ( item_loo.itemnumber == itemnumber) %]
177 [% IF item_loo.nomod %]
178 <tr id="row[% item_loo.itemnumber %]" class="active">
180 <tr id="row[% item_loo.itemnumber %]" class="active editable">
183 [% IF item_loo.nomod %]
184 <tr id="row[% item_loo.itemnumber %]">
186 <tr id="row[% item_loo.itemnumber %]" class="editable">
189 [% IF ( item_loo.nomod ) %]
193 <div class="dropdown">
194 <a class="btn btn-mini dropdown-toggle" id="itemactions[% item_loo.itemnumber %]" role="button" data-toggle="dropdown" href="#">
195 Actions <b class="caret"></b>
197 <ul class="dropdown-menu" role="menu" aria-labelledby="itemactions[% item_loo.itemnumber %]">
199 [% IF ( item_loo.hostitemflag ) %]
200 <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>
202 <li><a href="additem.pl?op=edititem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]&searchid=[% searchid %]#edititem">Edit</a></li>
203 <li><a href="additem.pl?op=dupeitem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]&searchid=[% searchid %]#additema">Duplicate</a></li>
204 [% IF ( item_loo.countanalytics ) %]
205 <li><a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=% item_loo.itemnumber %]">View analytics</a></li>
207 <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>
214 [% FOREACH item_valu IN item_loo.item_value %]
215 <td>[% item_valu.field |html %]</td>
225 <div class="yui-u first">
226 [% INCLUDE 'biblio-view-menu.inc' %]
229 <div id="cataloguing_additem_newitem">
230 <form id="f" method="post" action="/cgi-bin/koha/cataloguing/additem.pl" name="f">
231 <input type="hidden" name="op" value="[% op %]" />
233 <input type="hidden" name="popup" value="1" />
235 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
237 <h2 id="additema">Add item [% IF (circborrowernumber) %]<em>(fast cataloging)</em>[% END %]</h2>
239 <h2 id="edititem">Edit Item #[% itemnumber %][% IF ( barcode ) %] / Barcode [% barcode %][% END %]</h2>
241 <fieldset class="rows">
243 [% FOREACH ite IN item %]
244 <li><div class="subfield_line" style="[% ite.visibility %]" id="subfield[% ite.tag %][% ite.subfield %][% ite.random %]">
245 [% IF ( ite.mandatory ) %]
246 <label class="required">[% ite.subfield %] - [% ite.marc_lib %]</label>
248 <label>[% ite.subfield %] - [% ite.marc_lib %]</label>
251 [% SET mv = ite.marc_value %]
252 [% IF ( mv.type == 'hidden' ) %]
253 <input type="hidden" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]">
254 [% ELSIF ( mv.type == 'select' ) %]
255 [% IF ( mv.readonlyselect ) %]
256 <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor" readonly="readonly" disabled="disabled">
258 <select name="field_value" id="[%- mv.id -%]" size="1" class="input_marceditor">
260 [% FOREACH aval IN mv.values %]
261 [% IF aval == mv.default %]
262 <option value="[%- aval -%]" selected="selected">[%- mv.labels.$aval -%]</option>
264 <option value="[%- aval -%]">[%- mv.labels.$aval -%]</option>
268 [% ELSIF ( mv.type == 'text_auth' ) %]
269 <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
270 [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %]
271 <a href="#" class="buttonDot" onclick="[%- dopop -%]; return false;" title="Tag editor">...</a>
272 [% ELSIF ( mv.type == 'text_plugin' ) %]
273 <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
274 [% IF ( mv.nopopup ) %]
275 <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="No popup">...</a>
277 <a href="#" id="buttonDot_[%- mv.id -%]" class="[%- mv.class -%]" title="Tag editor">...</a>
279 [%- mv.javascript -%]
280 [% ELSIF ( mv.type == 'text' ) %]
281 <input type="text" id="[%- mv.id -%]" name="field_value" class="input_marceditor" size="50" maxlength="[%- mv.maxlength -%]" value="[%- mv.value -%]" />
282 [% ELSIF ( mv.type == 'textarea' ) %]
283 <textarea id="[%- mv.id -%]" name="field_value" class="input_marceditor" rows="5" cols="64" >[% mv.value %]</textarea>
286 <input type="hidden" name="tag" value="[% ite.tag %]" />
287 <input type="hidden" name="subfield" value="[% ite.subfield %]" />
288 <input type="hidden" name="mandatory" value="[% ite.mandatory %]" />
289 [% IF ( ite.repeatable ) %]
290 <a href="#" class="buttonPlus" onclick="CloneItemSubfield(this.parentNode); return false;">
291 <img src="[% interface %]/[% theme %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" />
294 [% IF ( ite.mandatory ) %] <span class="required">Required</span>[% END %]
299 <input type="hidden" name="indicator" value=" " />
300 <input type="hidden" name="indicator" value=" " />
301 <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
303 <fieldset class="action"> [% IF ( opisadd ) %]
304 <input type="submit" name="phony_submit" value="phony_submit" id="phony_submit" style="display:none;" onclick="return false;" />
305 <!-- 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
306 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.
307 It is a bit tricky, but necessary in the sake of UI correctness.
309 <span id="addsingle">
310 <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
311 <input type="submit" name="add_duplicate_submit" value="Add & duplicate" onclick="return Check(this.form)" />
313 <span id="addmultiple">
314 <input type="button" name="add_multiple_copies" id="add_multiple_copies" value="Add multiple copies of this item" />
316 <fieldset id="add_multiple_copies_span">
317 <label for="number_of_copies">Number of copies of this item to add: </label>
318 <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
319 <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>
320 <div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div>
324 <input type="hidden" name="tag" value="[% itemtagfield %]" />
325 <input type="hidden" name="subfield" value="[% itemtagsubfield %]" />
326 <input type="hidden" name="field_value" value="[% itemnumber %]" />
327 <input type="submit" value="Save changes" onclick="return Check(this.form)" />
330 [%# Fields for fast cataloging %]
331 <input type="hidden" name="circborrowernumber" value="[% circborrowernumber %]" />
332 <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" />
333 <input type="hidden" name="barcode" value="[% barcode %]" />
334 <input type="hidden" name="duedatespec" value="[% duedatespec %]" />
335 [%# End fields for fast cataloging %]
340 </div><!-- /yui-u -->
341 </div><!-- /yui-gf -->
345 [% INCLUDE 'intranet-bottom.inc' %]